feat(client): align account and order foundations
This commit is contained in:
@@ -29,6 +29,12 @@ test('declares the documented merchant warehouse and first-leg endpoints', () =>
|
||||
assert.match(apiSource, /url: '\/merchant\/v1\/orders\/first-leg'/)
|
||||
assert.match(apiSource, /url: '\/merchant\/v1\/orders\/first-leg\/inbound-code-policy'/)
|
||||
assert.match(apiSource, /url: '\/merchant\/v1\/orders\/first-leg\/batch'/)
|
||||
assert.match(apiSource, /url: '\/merchant\/v1\/order-addresses'/)
|
||||
assert.match(apiSource, /`\/merchant\/v1\/order-addresses\/\$\{id\}`/)
|
||||
assert.match(apiSource, /url: '\/merchant\/v1\/orders\/first-leg\/batch-imports\/template'/)
|
||||
assert.match(apiSource, /url: '\/merchant\/v1\/orders\/first-leg\/batch-imports'/)
|
||||
assert.match(apiSource, /params: \{ mode \}/)
|
||||
assert.match(apiSource, /data\.append\('file', file\)/)
|
||||
assert.match(apiSource, /`\/merchant\/v1\/orders\/first-leg\/\$\{id\}`/)
|
||||
assert.match(apiSource, /`\/merchant\/v1\/orders\/first-leg\/\$\{id\}\/submit`/)
|
||||
assert.match(apiSource, /`\/merchant\/v1\/warehouses\/\$\{id\}`/)
|
||||
@@ -134,13 +140,14 @@ test('sends backend-required channel, pricing, customs, destination and cargo fi
|
||||
assert.doesNotMatch(apiSource, /interface FirstLegOrderSaveRequest \{[^}]*customerId\??:/s)
|
||||
assert.match(storeSource, /customerName: customerName\.trim\(\)/)
|
||||
assert.match(storeSource, /destinationWarehouseId: draft\.destinationType === 'PRIVATE' \? undefined : draft\.destinationWarehouseId/)
|
||||
assert.match(storeSource, /draft\.pickupMethod === 'PICKUP'.*draft\.shipperPartySnapshot/s)
|
||||
assert.match(storeSource, /draft\.destinationType === 'PRIVATE'.*draft\.consigneePartySnapshot/s)
|
||||
assert.match(storeSource, /senderAddressId: draft\.pickupMethod === 'PICKUP' \? draft\.senderAddressId : undefined/)
|
||||
assert.match(storeSource, /privateDestinationAddressId: draft\.destinationType === 'PRIVATE' \? draft\.privateDestinationAddressId : undefined/)
|
||||
assert.doesNotMatch(storeSource, /sender: partyPayload|receiver: partyPayload/)
|
||||
for (const field of [
|
||||
'customsHsCode', 'lengthCm', 'widthCm', 'heightCm', 'unitsPerPackage', 'totalQuantity',
|
||||
'netWeightKg', 'unitDeclaredValue', 'material', 'usage', 'model', 'brand',
|
||||
'productLengthCm', 'productWidthCm', 'productHeightCm', 'shipmentId', 'referenceId',
|
||||
'productImageFileId',
|
||||
'productImageFileId', 'woodenProduct',
|
||||
]) {
|
||||
assert.match(storeSource, new RegExp(`${field}: item\\.`))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user