@sixtyninecommerce/admin 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -5
- package/dist/customers/groups.d.ts +16 -5
- package/dist/customers/groups.js +6 -2
- package/dist/documents/emails.d.ts +5 -1
- package/dist/fulfillments/create.d.ts +1 -1
- package/dist/fulfillments/create.js +5 -2
- package/dist/fulfillments/warehouse.d.ts +29 -17
- package/dist/fulfillments/warehouse.js +32 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3953,7 +3953,7 @@ const page = await admin.customers.groups.list({
|
|
|
3953
3953
|
include: ['memberCount'],
|
|
3954
3954
|
take: 50,
|
|
3955
3955
|
});
|
|
3956
|
-
page.items[0]; // { id, name, createdAt, updatedAt, canViewIncomingStock, canBackorder, memberCount }
|
|
3956
|
+
page.items[0]; // { id, name, createdAt, updatedAt, canViewIncomingStock, canBackorder, viewOnly, memberCount }
|
|
3957
3957
|
|
|
3958
3958
|
const vip = await admin.customers.groups.create({ name: 'VIP', canBackorder: true });
|
|
3959
3959
|
await admin.customers.groups.add(vip.id, [customerId]);
|
|
@@ -3981,7 +3981,7 @@ await admin.customers.groups.b2b.set([...trade.map((group) => group.id), wholesa
|
|
|
3981
3981
|
group holds. Anything else, and a `take` outside 1 to 1000, is refused
|
|
3982
3982
|
`INVALID_CUSTOMER_GROUP_LIST_OPTIONS` (`ValidationError`) before anything is sent. To search by
|
|
3983
3983
|
text, take ids from `search.index('customer_groups', …)` and list them with `filter: { ids }`.
|
|
3984
|
-
- **`get`** answers the group, its
|
|
3984
|
+
- **`get`** answers the group, its three flags and whose it is (`catalogueOwnership`), or `null` for a
|
|
3985
3985
|
group the store does not hold. With `members` it adds one page of the group's members in this
|
|
3986
3986
|
store and their count, in one fixed order (by id, so pages never overlap);
|
|
3987
3987
|
`members.filter.ids` narrows the page to those customers, so the answer says which of them are
|
|
@@ -3995,8 +3995,11 @@ await admin.customers.groups.b2b.set([...trade.map((group) => group.id), wholesa
|
|
|
3995
3995
|
small the page. Ask for `memberCount` only where you show it, and expect a large group to be
|
|
3996
3996
|
slow.
|
|
3997
3997
|
- **`create` and `update`** send only what you name: a flag left out is not touched. The flags are
|
|
3998
|
-
`canViewIncomingStock` (members see incoming stock on the storefront)
|
|
3999
|
-
may order more than is in stock, within the store's backorder policy)
|
|
3998
|
+
`canViewIncomingStock` (members see incoming stock on the storefront), `canBackorder` (members
|
|
3999
|
+
may order more than is in stock, within the store's backorder policy) and `viewOnly` (signed-in
|
|
4000
|
+
members see the store's retail prices incl. VAT and fill a basket, but checkout, payments and
|
|
4001
|
+
quote requests are refused `VIEW_ONLY_ACCOUNT`; staff can still order for them). `viewOnly` needs
|
|
4002
|
+
a platform release that has it: an older engine refuses the whole document.
|
|
4000
4003
|
- **A group is one row for every store that holds it.** `update`, `delete` and `deleteMany` are
|
|
4001
4004
|
refused `MANAGED_BY_ORGANIZATION` (`BusinessRuleError`) for a group the store holds from its
|
|
4002
4005
|
organization, and `SHARED_CUSTOMER_GROUP_NOT_ALLOWED` (`PermissionDeniedError`) for one other
|
|
@@ -7178,7 +7181,7 @@ reads it by id:
|
|
|
7178
7181
|
|
|
7179
7182
|
```ts
|
|
7180
7183
|
const group = await admin.customers.groups.get(groupId);
|
|
7181
|
-
// { id, createdAt, updatedAt, name, externalKey, canViewIncomingStock, canBackorder,
|
|
7184
|
+
// { id, createdAt, updatedAt, name, externalKey, canViewIncomingStock, canBackorder, viewOnly,
|
|
7182
7185
|
// catalogueOwnership }, or null
|
|
7183
7186
|
```
|
|
7184
7187
|
|
|
@@ -25,6 +25,13 @@ export interface CustomerGroup {
|
|
|
25
25
|
canViewIncomingStock: boolean;
|
|
26
26
|
/** Members may order more than is in stock, within the store's or the variant's backorder policy. */
|
|
27
27
|
canBackorder: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* "View only": signed-in members see the store's retail prices including VAT (the prices an
|
|
30
|
+
* anonymous shopper sees, never a price list's) and can fill a basket on the storefront, but
|
|
31
|
+
* checkout, payments and quote requests are refused (`VIEW_ONLY_ACCOUNT`). Staff can still
|
|
32
|
+
* place orders for them. The Exact customer import never links a customer to such a group.
|
|
33
|
+
*/
|
|
34
|
+
viewOnly: boolean;
|
|
28
35
|
/**
|
|
29
36
|
* The store's own group, or its organization's (shared while the organization shares
|
|
30
37
|
* `customer_groups`); see {@link CatalogueOwnership}. `editableHere` false: rename it, change
|
|
@@ -91,6 +98,7 @@ export interface CustomerGroupListItem {
|
|
|
91
98
|
name: string;
|
|
92
99
|
canViewIncomingStock: boolean;
|
|
93
100
|
canBackorder: boolean;
|
|
101
|
+
viewOnly: boolean;
|
|
94
102
|
/**
|
|
95
103
|
* How many of the store's customers are in the group, present only when the call asked for
|
|
96
104
|
* `include: ['memberCount']`.
|
|
@@ -134,12 +142,15 @@ export interface CreateCustomerGroupInput {
|
|
|
134
142
|
canViewIncomingStock?: boolean;
|
|
135
143
|
/** See {@link CustomerGroup.canBackorder}. Off when omitted. */
|
|
136
144
|
canBackorder?: boolean;
|
|
145
|
+
/** See {@link CustomerGroup.viewOnly}. Off when omitted. */
|
|
146
|
+
viewOnly?: boolean;
|
|
137
147
|
}
|
|
138
148
|
/** A PATCH: an absent field keeps what the group has. */
|
|
139
149
|
export interface UpdateCustomerGroupInput {
|
|
140
150
|
name?: string;
|
|
141
151
|
canViewIncomingStock?: boolean;
|
|
142
152
|
canBackorder?: boolean;
|
|
153
|
+
viewOnly?: boolean;
|
|
143
154
|
}
|
|
144
155
|
/** A group by id and name. */
|
|
145
156
|
export interface CustomerGroupRef {
|
|
@@ -168,9 +179,9 @@ export interface CustomerB2BGroupsModule {
|
|
|
168
179
|
set(groupIds: readonly string[], options?: Call): Promise<CustomerGroupRef[]>;
|
|
169
180
|
}
|
|
170
181
|
/** A customer group as `get`, `create` and `update` read it. */
|
|
171
|
-
export declare const CUSTOMER_GROUP_FIELDS = "\n id\n createdAt\n updatedAt\n name\n externalKey\n \n customFields {\n canViewIncomingStock\n canBackorder\n }\n\n \n catalogueOwnership {\n state\n organizationName\n editableHere\n }\n\n";
|
|
172
|
-
export declare const CUSTOMER_GROUP_QUERY = "\n query CustomerGroup($id: ID!) {\n customerGroup(id: $id) { \n id\n createdAt\n updatedAt\n name\n externalKey\n \n customFields {\n canViewIncomingStock\n canBackorder\n }\n\n \n catalogueOwnership {\n state\n organizationName\n editableHere\n }\n\n }\n }\n";
|
|
173
|
-
export declare const CUSTOMER_GROUP_MEMBERS_QUERY = "\n query CustomerGroupWithMembers($id: ID!, $members: CustomerListOptions) {\n customerGroup(id: $id) {\n \n id\n createdAt\n updatedAt\n name\n externalKey\n \n customFields {\n canViewIncomingStock\n canBackorder\n }\n\n \n catalogueOwnership {\n state\n organizationName\n editableHere\n }\n\n\n customers(options: $members) {\n items {\n id\n createdAt\n firstName\n lastName\n emailAddress\n addresses {\n company\n defaultBillingAddress\n defaultShippingAddress\n }\n }\n totalItems\n }\n }\n }\n";
|
|
182
|
+
export declare const CUSTOMER_GROUP_FIELDS = "\n id\n createdAt\n updatedAt\n name\n externalKey\n \n customFields {\n canViewIncomingStock\n canBackorder\n viewOnly\n }\n\n \n catalogueOwnership {\n state\n organizationName\n editableHere\n }\n\n";
|
|
183
|
+
export declare const CUSTOMER_GROUP_QUERY = "\n query CustomerGroup($id: ID!) {\n customerGroup(id: $id) { \n id\n createdAt\n updatedAt\n name\n externalKey\n \n customFields {\n canViewIncomingStock\n canBackorder\n viewOnly\n }\n\n \n catalogueOwnership {\n state\n organizationName\n editableHere\n }\n\n }\n }\n";
|
|
184
|
+
export declare const CUSTOMER_GROUP_MEMBERS_QUERY = "\n query CustomerGroupWithMembers($id: ID!, $members: CustomerListOptions) {\n customerGroup(id: $id) {\n \n id\n createdAt\n updatedAt\n name\n externalKey\n \n customFields {\n canViewIncomingStock\n canBackorder\n viewOnly\n }\n\n \n catalogueOwnership {\n state\n organizationName\n editableHere\n }\n\n\n customers(options: $members) {\n items {\n id\n createdAt\n firstName\n lastName\n emailAddress\n addresses {\n company\n defaultBillingAddress\n defaultShippingAddress\n }\n }\n totalItems\n }\n }\n }\n";
|
|
174
185
|
/**
|
|
175
186
|
* The list document for a set of blocks. The member count is the `totalItems` of a one-row page
|
|
176
187
|
* of the group's customers: a `take` of 0 would make that page every member.
|
|
@@ -184,8 +195,8 @@ export declare const CUSTOMER_GROUP_MEMBERS_QUERY = "\n query CustomerGroupWith
|
|
|
184
195
|
* fix is `omit: ['customers']` on those two resolvers, which this package cannot make.
|
|
185
196
|
*/
|
|
186
197
|
export declare function customerGroupListQuery(include: readonly CustomerGroupListInclude[]): string;
|
|
187
|
-
export declare const CREATE_CUSTOMER_GROUP_MUTATION = "\n mutation CreateCustomerGroup($input: CreateCustomerGroupInput!) {\n createCustomerGroup(input: $input) { \n id\n createdAt\n updatedAt\n name\n externalKey\n \n customFields {\n canViewIncomingStock\n canBackorder\n }\n\n \n catalogueOwnership {\n state\n organizationName\n editableHere\n }\n\n }\n }\n";
|
|
188
|
-
export declare const UPDATE_CUSTOMER_GROUP_MUTATION = "\n mutation UpdateCustomerGroup($input: UpdateCustomerGroupInput!) {\n updateCustomerGroup(input: $input) { \n id\n createdAt\n updatedAt\n name\n externalKey\n \n customFields {\n canViewIncomingStock\n canBackorder\n }\n\n \n catalogueOwnership {\n state\n organizationName\n editableHere\n }\n\n }\n }\n";
|
|
198
|
+
export declare const CREATE_CUSTOMER_GROUP_MUTATION = "\n mutation CreateCustomerGroup($input: CreateCustomerGroupInput!) {\n createCustomerGroup(input: $input) { \n id\n createdAt\n updatedAt\n name\n externalKey\n \n customFields {\n canViewIncomingStock\n canBackorder\n viewOnly\n }\n\n \n catalogueOwnership {\n state\n organizationName\n editableHere\n }\n\n }\n }\n";
|
|
199
|
+
export declare const UPDATE_CUSTOMER_GROUP_MUTATION = "\n mutation UpdateCustomerGroup($input: UpdateCustomerGroupInput!) {\n updateCustomerGroup(input: $input) { \n id\n createdAt\n updatedAt\n name\n externalKey\n \n customFields {\n canViewIncomingStock\n canBackorder\n viewOnly\n }\n\n \n catalogueOwnership {\n state\n organizationName\n editableHere\n }\n\n }\n }\n";
|
|
189
200
|
export declare const DELETE_CUSTOMER_GROUP_MUTATION = "\n mutation DeleteCustomerGroup($id: ID!) {\n deleteCustomerGroup(id: $id) { \n result\n message\n }\n }\n";
|
|
190
201
|
export declare const DELETE_CUSTOMER_GROUPS_MUTATION = "\n mutation DeleteCustomerGroups($ids: [ID!]!) {\n deleteCustomerGroups(ids: $ids) { \n result\n message\n }\n }\n";
|
|
191
202
|
export declare const B2B_CUSTOMER_GROUPS_QUERY = "\n query CustomerGroupRefs {\n b2bCustomerGroups {\n id\n name\n }\n }\n";
|
package/dist/customers/groups.js
CHANGED
|
@@ -16,10 +16,13 @@ export const MAX_CUSTOMER_GROUP_LIST_TAKE = 1000;
|
|
|
16
16
|
export const CUSTOMER_GROUP_LIST_SORT_FIELDS = ['name', 'createdAt', 'updatedAt'];
|
|
17
17
|
/** The blocks a list row can add: `memberCount`, how many of the store's customers are in it. */
|
|
18
18
|
export const CUSTOMER_GROUP_LIST_INCLUDES = ['memberCount'];
|
|
19
|
+
/** The group's boolean flags, each a `CustomerGroup.customFields` field of the same name. */
|
|
20
|
+
const GROUP_FLAGS = ['canViewIncomingStock', 'canBackorder', 'viewOnly'];
|
|
19
21
|
const GROUP_FLAG_FIELDS = /* GraphQL */ `
|
|
20
22
|
customFields {
|
|
21
23
|
canViewIncomingStock
|
|
22
24
|
canBackorder
|
|
25
|
+
viewOnly
|
|
23
26
|
}
|
|
24
27
|
`;
|
|
25
28
|
/** A customer group as `get`, `create` and `update` read it. */
|
|
@@ -144,11 +147,12 @@ const isPageSize = (take) => typeof take === 'number' &&
|
|
|
144
147
|
take >= 1 &&
|
|
145
148
|
take <= MAX_CUSTOMER_GROUP_LIST_TAKE;
|
|
146
149
|
const isOffset = (skip) => typeof skip === 'number' && Number.isInteger(skip) && skip >= 0;
|
|
147
|
-
/**
|
|
150
|
+
/** Every flag is `false` unless the engine answers `true`: a group has no third state. */
|
|
148
151
|
function flagsOf(wire) {
|
|
149
152
|
return {
|
|
150
153
|
canViewIncomingStock: wire.customFields?.canViewIncomingStock === true,
|
|
151
154
|
canBackorder: wire.customFields?.canBackorder === true,
|
|
155
|
+
viewOnly: wire.customFields?.viewOnly === true,
|
|
152
156
|
};
|
|
153
157
|
}
|
|
154
158
|
function toCustomerGroup(wire) {
|
|
@@ -341,7 +345,7 @@ export async function listCustomerGroups(transport, options) {
|
|
|
341
345
|
/** Only the flags the caller set travel: an omitted flag is never sent as `null`. */
|
|
342
346
|
function flagFields(input) {
|
|
343
347
|
const customFields = {};
|
|
344
|
-
for (const flag of
|
|
348
|
+
for (const flag of GROUP_FLAGS) {
|
|
345
349
|
const value = input[flag];
|
|
346
350
|
if (value === undefined)
|
|
347
351
|
continue;
|
|
@@ -32,7 +32,11 @@ export interface EmailDelivery {
|
|
|
32
32
|
attempt: number;
|
|
33
33
|
/** The mail provider's message id, when it took the email. */
|
|
34
34
|
messageId: string | null;
|
|
35
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* Why the last attempt failed, as a coded sentence: `CODE: not sent (facts). Plain sentence.`
|
|
37
|
+
* (`SMTP_SEND_FAILED: not sent (code=EAUTH step=AUTH PLAIN reply=535). …`). Never the
|
|
38
|
+
* provider's or the mail server's own words, which can quote the gateway's user name or hosts.
|
|
39
|
+
*/
|
|
36
40
|
error: string | null;
|
|
37
41
|
durationMs: number | null;
|
|
38
42
|
/** The ids the email was rendered from (`orderId`, `invoiceId`, …) and other send facts. */
|
|
@@ -162,6 +162,6 @@ export interface FulfillmentCreateMethods {
|
|
|
162
162
|
*/
|
|
163
163
|
profileChargePreview(input: FulfillmentProfileChargePreviewInput, options?: Call): Promise<FulfillmentProfileChargePreview>;
|
|
164
164
|
}
|
|
165
|
-
export declare const CREATE_WAREHOUSE_FULFILLMENTS_MUTATION = "\n mutation CreateWarehouseFulfillments(\n $input: CreateWarehouseFulfillmentsInput!\n $idempotencyKey: String\n ) {\n createWarehouseFulfillments(input: $input, idempotencyKey: $idempotencyKey) {\n __typename\n ... on WarehouseCreateResult {\n created\n failed\n results {\n index\n fulfillment {\n \n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n\n }\n error {\n code\n message\n field\n }\n claimError {\n code\n message\n field\n }\n }\n }\n ... on WarehouseError {\n errorCode\n code\n message\n field\n }\n }\n }\n";
|
|
165
|
+
export declare const CREATE_WAREHOUSE_FULFILLMENTS_MUTATION = "\n mutation CreateWarehouseFulfillments(\n $input: CreateWarehouseFulfillmentsInput!\n $idempotencyKey: String\n ) {\n createWarehouseFulfillments(input: $input, idempotencyKey: $idempotencyKey) {\n __typename\n ... on WarehouseCreateResult {\n created\n failed\n results {\n index\n fulfillment {\n \n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n dropShipSupplierName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n\n }\n error {\n code\n message\n field\n }\n claimError {\n code\n message\n field\n }\n }\n }\n ... on WarehouseError {\n errorCode\n code\n message\n field\n }\n }\n }\n";
|
|
166
166
|
export declare const FULFILLMENT_PROFILE_CHARGE_PREVIEW_QUERY = "\n query FulfillmentProfileChargePreview($input: FulfillmentProfileChargePreviewInput!) {\n fulfillmentProfileChargePreview(input: $input) {\n profileName\n currencyCode\n minOrder\n selectedNet\n shortfall\n deliveryCharge\n deliveryChargeIncludesTax\n settled\n handedOver\n }\n }\n";
|
|
167
167
|
export declare function createFulfillmentCreateMethods(transport: Transport): FulfillmentCreateMethods;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* 400, never a 422). Each group's own refusal is data in `results[].error`.
|
|
10
10
|
*/
|
|
11
11
|
import { idempotencyKey as mintIdempotencyKey, ValidationError, } from '@sixtyninecommerce/core';
|
|
12
|
-
import { assertId, FULFILLMENT_FIELDS, invalid, isWarehouseErrorMember, toFulfillment, toRefusal, warehouseRefusalError, withAttemptKey, } from './warehouse.js';
|
|
12
|
+
import { assertId, dropShipSupplierAware, FULFILLMENT_FIELDS, invalid, isWarehouseErrorMember, toFulfillment, toRefusal, warehouseRefusalError, withAttemptKey, } from './warehouse.js';
|
|
13
13
|
export const CREATE_WAREHOUSE_FULFILLMENTS_MUTATION = /* GraphQL */ `
|
|
14
14
|
mutation CreateWarehouseFulfillments(
|
|
15
15
|
$input: CreateWarehouseFulfillmentsInput!
|
|
@@ -134,12 +134,15 @@ function assertPreviewInput(input) {
|
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
export function createFulfillmentCreateMethods(transport) {
|
|
137
|
+
// The create answers the warehouse's fulfilment fields, `dropShipSupplierName` among them: an
|
|
138
|
+
// engine before purchase-orders step 5.5 refuses that field before the mutation runs.
|
|
139
|
+
const engine = dropShipSupplierAware(transport);
|
|
137
140
|
return {
|
|
138
141
|
async create(input, options) {
|
|
139
142
|
assertCreateInput(input);
|
|
140
143
|
const key = options?.idempotencyKey ?? mintIdempotencyKey();
|
|
141
144
|
try {
|
|
142
|
-
const data = await
|
|
145
|
+
const data = await engine.graphql({
|
|
143
146
|
api: 'admin',
|
|
144
147
|
query: CREATE_WAREHOUSE_FULFILLMENTS_MUTATION,
|
|
145
148
|
variables: {
|
|
@@ -237,6 +237,12 @@ export interface WarehouseFulfillment {
|
|
|
237
237
|
/** Null for a legacy fulfillment whose warehouse was never recorded (office staff only). */
|
|
238
238
|
stockLocationId: string | null;
|
|
239
239
|
stockLocationName: string | null;
|
|
240
|
+
/**
|
|
241
|
+
* The supplier that shipped a drop-ship fulfilment (`handlerCode: 'drop-ship'`) straight to the
|
|
242
|
+
* customer: show it where a warehouse fulfilment shows its warehouse. Null otherwise, and against
|
|
243
|
+
* an engine before purchase-orders step 5.5.
|
|
244
|
+
*/
|
|
245
|
+
dropShipSupplierName: string | null;
|
|
240
246
|
/** ISO-8601. */
|
|
241
247
|
createdAt: string;
|
|
242
248
|
/** ISO-8601: when its current stage began. */
|
|
@@ -668,30 +674,30 @@ export interface WarehouseFulfillmentsModule {
|
|
|
668
674
|
* named fragment: `orders-coverage.spec.ts` reads each document's root field with every
|
|
669
675
|
* interpolation replaced, which a fragment spread at the top level would not survive.
|
|
670
676
|
*/
|
|
671
|
-
export declare const FULFILLMENT_FIELDS = "\n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n";
|
|
677
|
+
export declare const FULFILLMENT_FIELDS = "\n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n dropShipSupplierName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n";
|
|
672
678
|
export declare const MY_WAREHOUSES_QUERY = "\n query MyWarehouses {\n myWarehouses {\n id\n name\n }\n }\n";
|
|
673
679
|
export declare const WAREHOUSE_COUNTS_QUERY = "\n query WarehouseCounts($stockLocationId: ID!) {\n warehouseCounts(stockLocationId: $stockLocationId) {\n toShip\n toPick\n picking\n packed\n overdue\n shippedToday\n outsourced\n }\n }\n";
|
|
674
680
|
export declare const WAREHOUSE_DEMAND_QUERY = "\n query WarehouseDemand($input: WarehouseDemandInput!) {\n warehouseDemand(input: $input) {\n totalItems\n truncated\n items {\n \n orderId\n orderCode\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n orderPlacedAt\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n consolidationKey\n suggestedHandlerCode\n paymentBadge\n hold {\n reason\n note\n }\n queueExclusions\n externalPlatform\n externalOrderId\n sourceFulfillmentHandedOff\n sourceFulfilled\n sourceFulfilledReason\n chargedParcelCount\n lines {\n orderLineId\n productVariantId\n sku\n name\n featuredAsset {\n id\n preview\n }\n openQty\n routing\n routedLocationId\n onHandAtLocation\n }\n\n }\n }\n }\n";
|
|
675
|
-
export declare const WAREHOUSE_FULFILLMENTS_QUERY = "\n query WarehouseFulfillments($input: WarehouseFulfillmentListInput) {\n warehouseFulfillments(input: $input) {\n totalItems\n items {\n \n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n\n }\n }\n }\n";
|
|
676
|
-
export declare const WAREHOUSE_FULFILLMENT_QUERY = "\n query WarehouseFulfillment($id: ID!) {\n warehouseFulfillment(id: $id) {\n \n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n\n lines {\n orderLineId\n orderId\n orderCode\n productVariantId\n sku\n name\n featuredAsset {\n id\n preview\n }\n quantity\n }\n }\n }\n";
|
|
681
|
+
export declare const WAREHOUSE_FULFILLMENTS_QUERY = "\n query WarehouseFulfillments($input: WarehouseFulfillmentListInput) {\n warehouseFulfillments(input: $input) {\n totalItems\n items {\n \n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n dropShipSupplierName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n\n }\n }\n }\n";
|
|
682
|
+
export declare const WAREHOUSE_FULFILLMENT_QUERY = "\n query WarehouseFulfillment($id: ID!) {\n warehouseFulfillment(id: $id) {\n \n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n dropShipSupplierName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n\n lines {\n orderLineId\n orderId\n orderCode\n productVariantId\n sku\n name\n featuredAsset {\n id\n preview\n }\n quantity\n }\n }\n }\n";
|
|
677
683
|
export declare const WAREHOUSE_FULFILLMENT_HANDLERS_QUERY = "\n query WarehouseFulfillmentHandlers {\n warehouseFulfillmentHandlers {\n code\n description\n mode\n argsRequiredForCreate\n args {\n name\n type\n list\n required\n defaultValue\n label\n description\n ui\n }\n }\n }\n";
|
|
678
684
|
export declare const WAREHOUSE_PICK_LIST_QUERY = "\n query WarehousePickList($fulfillmentIds: [ID!]!) {\n warehousePickList(fulfillmentIds: $fulfillmentIds) {\n generatedAt\n timeZone\n warehouseNames\n lineCount\n unitCount\n printedBy {\n id\n name\n }\n fulfillments {\n id\n reference\n state\n orderCodes\n stockLocationName\n lineCount\n unitCount\n }\n lines {\n sku\n name\n productVariantId\n quantity\n fulfillments {\n fulfillmentId\n reference\n orderCodes\n quantity\n }\n }\n }\n }\n";
|
|
679
685
|
export declare const WAREHOUSE_APPEND_CANDIDATES_QUERY = "\n query WarehouseAppendCandidates($fulfillmentId: ID!) {\n warehouseAppendCandidates(fulfillmentId: $fulfillmentId) {\n \n orderId\n orderCode\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n orderPlacedAt\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n consolidationKey\n suggestedHandlerCode\n paymentBadge\n hold {\n reason\n note\n }\n queueExclusions\n externalPlatform\n externalOrderId\n sourceFulfillmentHandedOff\n sourceFulfilled\n sourceFulfilledReason\n chargedParcelCount\n lines {\n orderLineId\n productVariantId\n sku\n name\n featuredAsset {\n id\n preview\n }\n openQty\n routing\n routedLocationId\n onHandAtLocation\n }\n\n }\n }\n";
|
|
680
686
|
/** The order API, not the warehouse one: it names money (`ReadOrder`). */
|
|
681
687
|
export declare const FULFILLMENT_DETACH_PREVIEW_QUERY = "\n query FulfillmentDetachPreview($fulfillmentId: ID!, $orderId: ID!) {\n fulfillmentDetachPreview(fulfillmentId: $fulfillmentId, orderId: $orderId) {\n deliveryChargeApplies\n profileName\n profileMinimum\n currencyCode\n priceIncludesTax\n currentIncludesTax\n currentCharge\n newCharge\n orders {\n orderId\n code\n currentCharge\n newCharge\n }\n remainingNet\n belowProfileMinimum\n refusal {\n code\n message\n }\n }\n }\n";
|
|
682
|
-
export declare const CLAIM_FULFILLMENT_MUTATION = "\n mutation ClaimFulfillment($id: ID!) {\n claimFulfillment(id: $id) {\n \n __typename\n ... on WarehouseFulfillment {\n \n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n\n }\n \n ... on WarehouseError {\n errorCode\n code\n message\n field\n }\n\n\n }\n }\n";
|
|
683
|
-
export declare const UNCLAIM_FULFILLMENT_MUTATION = "\n mutation UnclaimFulfillment($id: ID!) {\n unclaimFulfillment(id: $id) {\n \n __typename\n ... on WarehouseFulfillment {\n \n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n\n }\n \n ... on WarehouseError {\n errorCode\n code\n message\n field\n }\n\n\n }\n }\n";
|
|
684
|
-
export declare const REOPEN_FULFILLMENT_MUTATION = "\n mutation ReopenFulfillment($id: ID!) {\n reopenFulfillment(id: $id) {\n \n __typename\n ... on WarehouseFulfillment {\n \n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n\n }\n \n ... on WarehouseError {\n errorCode\n code\n message\n field\n }\n\n\n }\n }\n";
|
|
685
|
-
export declare const PACK_FULFILLMENT_MUTATION = "\n mutation PackFulfillment($id: ID!, $parcels: [WarehouseParcelInput!]) {\n packFulfillment(id: $id, parcels: $parcels) {\n \n __typename\n ... on WarehouseFulfillment {\n \n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n\n }\n \n ... on WarehouseError {\n errorCode\n code\n message\n field\n }\n\n\n }\n }\n";
|
|
686
|
-
export declare const BOOK_FULFILLMENT_MUTATION = "\n mutation BookFulfillment($id: ID!) {\n bookFulfillment(id: $id) {\n \n __typename\n ... on WarehouseFulfillment {\n \n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n\n }\n \n ... on WarehouseError {\n errorCode\n code\n message\n field\n }\n\n\n }\n }\n";
|
|
687
|
-
export declare const UNBOOK_FULFILLMENT_MUTATION = "\n mutation UnbookFulfillment($id: ID!) {\n unbookFulfillment(id: $id) {\n \n __typename\n ... on WarehouseFulfillment {\n \n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n\n }\n \n ... on WarehouseError {\n errorCode\n code\n message\n field\n }\n\n\n }\n }\n";
|
|
688
|
-
export declare const SET_FULFILLMENT_HANDLER_MUTATION = "\n mutation SetFulfillmentHandler(\n $id: ID!\n $handlerCode: String!\n $handlerArgs: [WarehouseHandlerArgInput!]\n ) {\n setFulfillmentHandler(id: $id, handlerCode: $handlerCode, handlerArgs: $handlerArgs) {\n \n __typename\n ... on WarehouseFulfillment {\n \n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n\n }\n \n ... on WarehouseError {\n errorCode\n code\n message\n field\n }\n\n\n }\n }\n";
|
|
689
|
-
export declare const SET_FULFILLMENT_WAREHOUSE_MUTATION = "\n mutation SetFulfillmentWarehouse($id: ID!, $stockLocationId: ID!) {\n setFulfillmentWarehouse(id: $id, stockLocationId: $stockLocationId) {\n \n __typename\n ... on WarehouseFulfillment {\n \n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n\n }\n \n ... on WarehouseError {\n errorCode\n code\n message\n field\n }\n\n\n }\n }\n";
|
|
690
|
-
export declare const CORRECT_FULFILLMENT_QUANTITIES_MUTATION = "\n mutation CorrectFulfillmentQuantities(\n $fulfillmentId: ID!\n $lines: [WarehouseQuantityCorrectionLineInput!]!\n $disposition: FulfillmentUnitDisposition!\n $reason: String\n ) {\n correctFulfillmentQuantities(\n fulfillmentId: $fulfillmentId\n lines: $lines\n disposition: $disposition\n reason: $reason\n ) {\n \n __typename\n ... on WarehouseFulfillment {\n \n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n\n }\n \n ... on WarehouseError {\n errorCode\n code\n message\n field\n }\n\n\n }\n }\n";
|
|
691
|
-
export declare const SHIP_FULFILLMENTS_MUTATION = "\n mutation ShipFulfillments($ids: [ID!]!, $trackingCode: String) {\n shipFulfillments(ids: $ids, trackingCode: $trackingCode) {\n \n __typename\n ... on WarehouseBulkResult {\n succeeded\n failed\n results {\n fulfillmentId\n fulfillment {\n \n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n\n }\n error {\n code\n message\n field\n }\n }\n }\n \n ... on WarehouseError {\n errorCode\n code\n message\n field\n }\n\n\n }\n }\n";
|
|
692
|
-
export declare const DELIVER_FULFILLMENTS_MUTATION = "\n mutation DeliverFulfillments($ids: [ID!]!) {\n deliverFulfillments(ids: $ids) {\n \n __typename\n ... on WarehouseBulkResult {\n succeeded\n failed\n results {\n fulfillmentId\n fulfillment {\n \n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n\n }\n error {\n code\n message\n field\n }\n }\n }\n \n ... on WarehouseError {\n errorCode\n code\n message\n field\n }\n\n\n }\n }\n";
|
|
693
|
-
export declare const APPEND_TO_FULFILLMENT_MUTATION = "\n mutation AppendToFulfillment(\n $id: ID!\n $lines: [WarehouseFulfillmentLineInput!]!\n $idempotencyKey: String\n ) {\n appendToFulfillment(id: $id, lines: $lines, idempotencyKey: $idempotencyKey) {\n \n __typename\n ... on WarehouseFulfillment {\n \n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n\n }\n \n ... on WarehouseError {\n errorCode\n code\n message\n field\n }\n\n\n }\n }\n";
|
|
694
|
-
export declare const DETACH_ORDER_FROM_FULFILLMENT_MUTATION = "\n mutation DetachOrderFromFulfillment($id: ID!, $orderId: ID!) {\n detachOrderFromFulfillment(id: $id, orderId: $orderId) {\n \n __typename\n ... on WarehouseFulfillment {\n \n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n\n }\n \n ... on WarehouseError {\n errorCode\n code\n message\n field\n }\n\n\n }\n }\n";
|
|
688
|
+
export declare const CLAIM_FULFILLMENT_MUTATION = "\n mutation ClaimFulfillment($id: ID!) {\n claimFulfillment(id: $id) {\n \n __typename\n ... on WarehouseFulfillment {\n \n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n dropShipSupplierName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n\n }\n \n ... on WarehouseError {\n errorCode\n code\n message\n field\n }\n\n\n }\n }\n";
|
|
689
|
+
export declare const UNCLAIM_FULFILLMENT_MUTATION = "\n mutation UnclaimFulfillment($id: ID!) {\n unclaimFulfillment(id: $id) {\n \n __typename\n ... on WarehouseFulfillment {\n \n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n dropShipSupplierName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n\n }\n \n ... on WarehouseError {\n errorCode\n code\n message\n field\n }\n\n\n }\n }\n";
|
|
690
|
+
export declare const REOPEN_FULFILLMENT_MUTATION = "\n mutation ReopenFulfillment($id: ID!) {\n reopenFulfillment(id: $id) {\n \n __typename\n ... on WarehouseFulfillment {\n \n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n dropShipSupplierName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n\n }\n \n ... on WarehouseError {\n errorCode\n code\n message\n field\n }\n\n\n }\n }\n";
|
|
691
|
+
export declare const PACK_FULFILLMENT_MUTATION = "\n mutation PackFulfillment($id: ID!, $parcels: [WarehouseParcelInput!]) {\n packFulfillment(id: $id, parcels: $parcels) {\n \n __typename\n ... on WarehouseFulfillment {\n \n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n dropShipSupplierName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n\n }\n \n ... on WarehouseError {\n errorCode\n code\n message\n field\n }\n\n\n }\n }\n";
|
|
692
|
+
export declare const BOOK_FULFILLMENT_MUTATION = "\n mutation BookFulfillment($id: ID!) {\n bookFulfillment(id: $id) {\n \n __typename\n ... on WarehouseFulfillment {\n \n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n dropShipSupplierName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n\n }\n \n ... on WarehouseError {\n errorCode\n code\n message\n field\n }\n\n\n }\n }\n";
|
|
693
|
+
export declare const UNBOOK_FULFILLMENT_MUTATION = "\n mutation UnbookFulfillment($id: ID!) {\n unbookFulfillment(id: $id) {\n \n __typename\n ... on WarehouseFulfillment {\n \n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n dropShipSupplierName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n\n }\n \n ... on WarehouseError {\n errorCode\n code\n message\n field\n }\n\n\n }\n }\n";
|
|
694
|
+
export declare const SET_FULFILLMENT_HANDLER_MUTATION = "\n mutation SetFulfillmentHandler(\n $id: ID!\n $handlerCode: String!\n $handlerArgs: [WarehouseHandlerArgInput!]\n ) {\n setFulfillmentHandler(id: $id, handlerCode: $handlerCode, handlerArgs: $handlerArgs) {\n \n __typename\n ... on WarehouseFulfillment {\n \n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n dropShipSupplierName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n\n }\n \n ... on WarehouseError {\n errorCode\n code\n message\n field\n }\n\n\n }\n }\n";
|
|
695
|
+
export declare const SET_FULFILLMENT_WAREHOUSE_MUTATION = "\n mutation SetFulfillmentWarehouse($id: ID!, $stockLocationId: ID!) {\n setFulfillmentWarehouse(id: $id, stockLocationId: $stockLocationId) {\n \n __typename\n ... on WarehouseFulfillment {\n \n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n dropShipSupplierName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n\n }\n \n ... on WarehouseError {\n errorCode\n code\n message\n field\n }\n\n\n }\n }\n";
|
|
696
|
+
export declare const CORRECT_FULFILLMENT_QUANTITIES_MUTATION = "\n mutation CorrectFulfillmentQuantities(\n $fulfillmentId: ID!\n $lines: [WarehouseQuantityCorrectionLineInput!]!\n $disposition: FulfillmentUnitDisposition!\n $reason: String\n ) {\n correctFulfillmentQuantities(\n fulfillmentId: $fulfillmentId\n lines: $lines\n disposition: $disposition\n reason: $reason\n ) {\n \n __typename\n ... on WarehouseFulfillment {\n \n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n dropShipSupplierName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n\n }\n \n ... on WarehouseError {\n errorCode\n code\n message\n field\n }\n\n\n }\n }\n";
|
|
697
|
+
export declare const SHIP_FULFILLMENTS_MUTATION = "\n mutation ShipFulfillments($ids: [ID!]!, $trackingCode: String) {\n shipFulfillments(ids: $ids, trackingCode: $trackingCode) {\n \n __typename\n ... on WarehouseBulkResult {\n succeeded\n failed\n results {\n fulfillmentId\n fulfillment {\n \n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n dropShipSupplierName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n\n }\n error {\n code\n message\n field\n }\n }\n }\n \n ... on WarehouseError {\n errorCode\n code\n message\n field\n }\n\n\n }\n }\n";
|
|
698
|
+
export declare const DELIVER_FULFILLMENTS_MUTATION = "\n mutation DeliverFulfillments($ids: [ID!]!) {\n deliverFulfillments(ids: $ids) {\n \n __typename\n ... on WarehouseBulkResult {\n succeeded\n failed\n results {\n fulfillmentId\n fulfillment {\n \n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n dropShipSupplierName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n\n }\n error {\n code\n message\n field\n }\n }\n }\n \n ... on WarehouseError {\n errorCode\n code\n message\n field\n }\n\n\n }\n }\n";
|
|
699
|
+
export declare const APPEND_TO_FULFILLMENT_MUTATION = "\n mutation AppendToFulfillment(\n $id: ID!\n $lines: [WarehouseFulfillmentLineInput!]!\n $idempotencyKey: String\n ) {\n appendToFulfillment(id: $id, lines: $lines, idempotencyKey: $idempotencyKey) {\n \n __typename\n ... on WarehouseFulfillment {\n \n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n dropShipSupplierName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n\n }\n \n ... on WarehouseError {\n errorCode\n code\n message\n field\n }\n\n\n }\n }\n";
|
|
700
|
+
export declare const DETACH_ORDER_FROM_FULFILLMENT_MUTATION = "\n mutation DetachOrderFromFulfillment($id: ID!, $orderId: ID!) {\n detachOrderFromFulfillment(id: $id, orderId: $orderId) {\n \n __typename\n ... on WarehouseFulfillment {\n \n id\n state\n handlerCode\n method\n mode\n trackingCode\n stockLocationId\n stockLocationName\n dropShipSupplierName\n createdAt\n stateChangedAt\n overdue\n claimedBy {\n id\n name\n }\n claimedAt\n packedAt\n bookingStatus\n bookingError\n parcels {\n weightGrams\n lengthMm\n widthMm\n heightMm\n }\n orders {\n id\n code\n poNumber\n orderNotes\n requestedDeliveryDate\n deliveryDue\n paymentBadge\n hold {\n reason\n note\n }\n }\n customer {\n id\n name\n phone\n }\n shippingAddress {\n \n fullName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n\n }\n lineCount\n unitCount\n\n }\n \n ... on WarehouseError {\n errorCode\n code\n message\n field\n }\n\n\n }\n }\n";
|
|
695
701
|
/** The key a caller retries under, on an error of a call whose key it did not choose. */
|
|
696
702
|
export declare function withAttemptKey(error: unknown, key: string): unknown;
|
|
697
703
|
export interface RawRefusal {
|
|
@@ -721,4 +727,10 @@ export type RawFulfillment = WarehouseFulfillment & {
|
|
|
721
727
|
};
|
|
722
728
|
export declare function toFulfillment(raw: RawFulfillment): WarehouseFulfillment;
|
|
723
729
|
export declare function toRefusal(raw: RawRefusal | null | undefined): WarehouseRefusal | null;
|
|
724
|
-
|
|
730
|
+
/**
|
|
731
|
+
* The transport, sending a document that names `dropShipSupplierName` once more without it when the
|
|
732
|
+
* engine refused it as unknown (an engine before purchase-orders step 5.5): the field then reads
|
|
733
|
+
* null. Safe for a mutation too: a refused document never ran.
|
|
734
|
+
*/
|
|
735
|
+
export declare function dropShipSupplierAware(transport: Transport): Transport;
|
|
736
|
+
export declare function createWarehouseFulfillmentsModule(engineTransport: Transport): WarehouseFulfillmentsModule;
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
* `orders.drafts.place` does).
|
|
49
49
|
*/
|
|
50
50
|
import { errorFromGraphQLErrors, idempotencyKey as mintIdempotencyKey, pageFromVendureList, readOffsetCursor, ValidationError, } from '@sixtyninecommerce/core';
|
|
51
|
+
import { isUnknownFieldRejection } from '../payments/store-credit-fields.js';
|
|
51
52
|
/** The most fulfillments one `ship`, `deliver` or `pickList` call takes. */
|
|
52
53
|
export const MAX_WAREHOUSE_BULK_IDS = 100;
|
|
53
54
|
const ADDRESS_FIELDS = /* GraphQL */ `
|
|
@@ -74,6 +75,7 @@ export const FULFILLMENT_FIELDS = /* GraphQL */ `
|
|
|
74
75
|
trackingCode
|
|
75
76
|
stockLocationId
|
|
76
77
|
stockLocationName
|
|
78
|
+
dropShipSupplierName
|
|
77
79
|
createdAt
|
|
78
80
|
stateChangedAt
|
|
79
81
|
overdue
|
|
@@ -552,6 +554,7 @@ export function toFulfillment(raw) {
|
|
|
552
554
|
trackingCode: raw.trackingCode ?? null,
|
|
553
555
|
stockLocationId: raw.stockLocationId ?? null,
|
|
554
556
|
stockLocationName: raw.stockLocationName ?? null,
|
|
557
|
+
dropShipSupplierName: raw.dropShipSupplierName ?? null,
|
|
555
558
|
createdAt: raw.createdAt,
|
|
556
559
|
stateChangedAt: raw.stateChangedAt ?? null,
|
|
557
560
|
overdue: raw.overdue,
|
|
@@ -653,7 +656,35 @@ function bulkOrThrow(result) {
|
|
|
653
656
|
};
|
|
654
657
|
}
|
|
655
658
|
const DEFAULT_TAKE = 50;
|
|
656
|
-
|
|
659
|
+
/**
|
|
660
|
+
* The transport, sending a document that names `dropShipSupplierName` once more without it when the
|
|
661
|
+
* engine refused it as unknown (an engine before purchase-orders step 5.5): the field then reads
|
|
662
|
+
* null. Safe for a mutation too: a refused document never ran.
|
|
663
|
+
*/
|
|
664
|
+
export function dropShipSupplierAware(transport) {
|
|
665
|
+
return {
|
|
666
|
+
async graphql(call, options) {
|
|
667
|
+
try {
|
|
668
|
+
return await transport.graphql(call, options);
|
|
669
|
+
}
|
|
670
|
+
catch (error) {
|
|
671
|
+
const legacy = call.query.replace(/\bdropShipSupplierName\b/g, '');
|
|
672
|
+
if (legacy === call.query || !isUnknownFieldRejection(error))
|
|
673
|
+
throw error;
|
|
674
|
+
return transport.graphql({ ...call, query: legacy }, options);
|
|
675
|
+
}
|
|
676
|
+
},
|
|
677
|
+
// Delegated one by one: a transport is a class instance, whose members a spread would drop.
|
|
678
|
+
rest: (service, call, options) => transport.rest(service, call, options),
|
|
679
|
+
get rateLimit() {
|
|
680
|
+
return transport.rateLimit;
|
|
681
|
+
},
|
|
682
|
+
tenant: () => transport.tenant(),
|
|
683
|
+
channel: () => transport.channel(),
|
|
684
|
+
};
|
|
685
|
+
}
|
|
686
|
+
export function createWarehouseFulfillmentsModule(engineTransport) {
|
|
687
|
+
const transport = dropShipSupplierAware(engineTransport);
|
|
657
688
|
const single = async (query, field, variables, options) => {
|
|
658
689
|
const data = await transport.graphql({ api: 'admin', query, variables }, options);
|
|
659
690
|
return fulfillmentOrThrow(data[field]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sixtyninecommerce/admin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Back-office SDK for sixtynine-commerce: every capability of the platform as a method",
|
|
5
5
|
"homepage": "https://github.com/SIXTYNINE-digital/sixtynine-commerce-engine/tree/main/packages/admin-client#readme",
|
|
6
6
|
"repository": {
|