@sixtyninecommerce/admin 0.10.0 → 0.11.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 +4347 -171
- package/dist/catalog/assets.d.ts +120 -8
- package/dist/catalog/assets.js +98 -12
- package/dist/catalog/collections.d.ts +279 -14
- package/dist/catalog/collections.js +246 -15
- package/dist/catalog/index.d.ts +9 -2
- package/dist/catalog/index.js +4 -0
- package/dist/catalog/products.d.ts +159 -19
- package/dist/catalog/products.js +88 -13
- package/dist/catalog/properties.d.ts +102 -14
- package/dist/catalog/properties.js +13 -0
- package/dist/catalog/recommendations.d.ts +261 -0
- package/dist/catalog/recommendations.js +145 -0
- package/dist/catalog/reviews.d.ts +368 -0
- package/dist/catalog/reviews.js +318 -0
- package/dist/catalog/types.d.ts +17 -1
- package/dist/catalog/types.js +10 -0
- package/dist/catalog/variant-find.d.ts +136 -0
- package/dist/catalog/variant-find.js +239 -0
- package/dist/catalog/variants.d.ts +233 -26
- package/dist/catalog/variants.js +125 -7
- package/dist/catalog/visibility.d.ts +20 -5
- package/dist/catalog/visibility.js +19 -1
- package/dist/client.d.ts +95 -9
- package/dist/client.js +35 -7
- package/dist/content/assets.d.ts +286 -0
- package/dist/content/assets.js +181 -0
- package/dist/content/items.d.ts +269 -0
- package/dist/content/items.js +170 -0
- package/dist/content/types.d.ts +282 -0
- package/dist/content/types.js +100 -0
- package/dist/customers/age-verification.d.ts +66 -0
- package/dist/customers/age-verification.js +79 -0
- package/dist/customers/credit.d.ts +263 -0
- package/dist/customers/credit.js +244 -0
- package/dist/customers/delivery-preferences.d.ts +120 -0
- package/dist/customers/delivery-preferences.js +97 -0
- package/dist/customers/groups.d.ts +207 -0
- package/dist/customers/groups.js +438 -0
- package/dist/customers/index.d.ts +447 -37
- package/dist/customers/index.js +313 -40
- package/dist/customers/invitation-status.d.ts +57 -0
- package/dist/customers/invitation-status.js +21 -0
- package/dist/customers/notes.d.ts +67 -0
- package/dist/customers/notes.js +51 -0
- package/dist/customers/notification-recipients.d.ts +97 -0
- package/dist/customers/notification-recipients.js +84 -0
- package/dist/customers/saved-lists.d.ts +42 -0
- package/dist/customers/saved-lists.js +61 -0
- package/dist/customers/vat.d.ts +83 -0
- package/dist/customers/vat.js +46 -0
- package/dist/customers/wire.d.ts +20 -0
- package/dist/customers/wire.js +35 -0
- package/dist/documents/ar.d.ts +307 -0
- package/dist/documents/ar.js +254 -0
- package/dist/documents/index.d.ts +731 -21
- package/dist/documents/index.js +436 -24
- package/dist/documents/pdf.d.ts +2 -0
- package/dist/documents/pdf.js +11 -0
- package/dist/fulfillments/create.d.ts +167 -0
- package/dist/fulfillments/create.js +216 -0
- package/dist/fulfillments/index.d.ts +44 -10
- package/dist/fulfillments/index.js +11 -2
- package/dist/fulfillments/payment-policy.d.ts +64 -0
- package/dist/fulfillments/payment-policy.js +140 -0
- package/dist/fulfillments/warehouse.d.ts +724 -0
- package/dist/fulfillments/warehouse.js +914 -0
- package/dist/geo/index.d.ts +119 -0
- package/dist/geo/index.js +107 -0
- package/dist/index.d.ts +123 -35
- package/dist/index.js +45 -12
- package/dist/integrations/afas-actions.d.ts +234 -0
- package/dist/integrations/afas-actions.js +310 -0
- package/dist/integrations/afas-types.d.ts +483 -0
- package/dist/integrations/afas-types.js +5 -0
- package/dist/integrations/afas.d.ts +234 -0
- package/dist/integrations/afas.js +290 -0
- package/dist/integrations/connections.d.ts +103 -0
- package/dist/integrations/connections.js +55 -0
- package/dist/integrations/esp.d.ts +313 -0
- package/dist/integrations/esp.js +169 -0
- package/dist/integrations/exact-online-types.d.ts +423 -0
- package/dist/integrations/exact-online-types.js +6 -0
- package/dist/integrations/exact-online.d.ts +248 -0
- package/dist/integrations/exact-online.js +376 -0
- package/dist/integrations/index.d.ts +29 -3
- package/dist/integrations/index.js +18 -3
- package/dist/integrations/pipeline-keys.d.ts +13 -0
- package/dist/integrations/pipeline-keys.js +22 -0
- package/dist/integrations/pipelines.d.ts +15 -14
- package/dist/integrations/pipelines.js +6 -22
- package/dist/integrations/types.d.ts +146 -0
- package/dist/locations/index.d.ts +66 -0
- package/dist/locations/index.js +31 -0
- package/dist/meta/index.d.ts +162 -0
- package/dist/orders/cancel-with-money.d.ts +227 -0
- package/dist/orders/cancel-with-money.js +153 -0
- package/dist/orders/commit-edit.d.ts +7 -1
- package/dist/orders/commit-edit.js +5 -1
- package/dist/orders/drafts.d.ts +800 -0
- package/dist/orders/drafts.js +771 -0
- package/dist/orders/fields.d.ts +245 -0
- package/dist/orders/fields.js +188 -0
- package/dist/orders/get.d.ts +29 -19
- package/dist/orders/get.js +17 -8
- package/dist/orders/index.d.ts +49 -9
- package/dist/orders/index.js +22 -2
- package/dist/orders/lifecycle.d.ts +128 -0
- package/dist/orders/lifecycle.js +158 -0
- package/dist/orders/line-price-preview.d.ts +7 -2
- package/dist/orders/list.d.ts +222 -0
- package/dist/orders/list.js +377 -0
- package/dist/orders/manual-pricing.d.ts +5 -0
- package/dist/orders/order-entry.d.ts +20 -7
- package/dist/orders/plan-edit.d.ts +1 -1
- package/dist/orders/plan-edit.js +4 -1
- package/dist/orders/settings.d.ts +201 -0
- package/dist/orders/settings.js +325 -0
- package/dist/orders/status.d.ts +159 -13
- package/dist/orders/status.js +21 -0
- package/dist/orders/surcharges.d.ts +8 -1
- package/dist/orders/surcharges.js +3 -2
- package/dist/payments/account-credit.d.ts +30 -0
- package/dist/payments/account-credit.js +19 -0
- package/dist/payments/ar.d.ts +292 -0
- package/dist/payments/ar.js +223 -0
- package/dist/payments/connected-account.d.ts +47 -0
- package/dist/payments/connected-account.js +61 -0
- package/dist/payments/credit-noted-fields.d.ts +12 -0
- package/dist/payments/credit-noted-fields.js +37 -0
- package/dist/payments/index.d.ts +257 -11
- package/dist/payments/index.js +131 -1
- package/dist/payments/methods.d.ts +303 -8
- package/dist/payments/methods.js +337 -7
- package/dist/payments/mollie-methods.d.ts +159 -0
- package/dist/payments/mollie-methods.js +141 -0
- package/dist/payments/payment-links.d.ts +180 -0
- package/dist/payments/payment-links.js +97 -0
- package/dist/payments/provider-keys.d.ts +150 -0
- package/dist/payments/provider-keys.js +118 -0
- package/dist/payments/providers.d.ts +86 -11
- package/dist/payments/providers.js +29 -0
- package/dist/payments/requests.d.ts +144 -0
- package/dist/payments/requests.js +92 -0
- package/dist/payments/store-credit-fields.d.ts +15 -0
- package/dist/payments/store-credit-fields.js +51 -0
- package/dist/pickups/index.d.ts +104 -0
- package/dist/pickups/index.js +105 -0
- package/dist/platform/channels.d.ts +132 -0
- package/dist/platform/channels.js +128 -0
- package/dist/platform/geo.d.ts +123 -0
- package/dist/platform/geo.js +144 -0
- package/dist/platform/tax.d.ts +154 -0
- package/dist/platform/tax.js +139 -0
- package/dist/pos/anomalies.d.ts +158 -0
- package/dist/pos/anomalies.js +64 -0
- package/dist/pos/assisted-selling.d.ts +79 -0
- package/dist/pos/assisted-selling.js +38 -0
- package/dist/pos/exchanges.d.ts +103 -0
- package/dist/pos/exchanges.js +22 -0
- package/dist/pos/gift-cards.d.ts +135 -0
- package/dist/pos/gift-cards.js +47 -0
- package/dist/pos/index.d.ts +2125 -32
- package/dist/pos/index.js +742 -4
- package/dist/pos/no-receipt.d.ts +94 -0
- package/dist/pos/no-receipt.js +25 -0
- package/dist/pos/offline-sales.d.ts +187 -0
- package/dist/pos/offline-sales.js +116 -0
- package/dist/pos/pay-by-link.d.ts +143 -0
- package/dist/pos/pay-by-link.js +57 -0
- package/dist/pos/quick-keys.d.ts +103 -0
- package/dist/pos/quick-keys.js +45 -0
- package/dist/pos/reports.d.ts +360 -0
- package/dist/pos/reports.js +62 -0
- package/dist/pos/returns.d.ts +217 -0
- package/dist/pos/returns.js +53 -0
- package/dist/pricing/bulk-coupons.d.ts +139 -0
- package/dist/pricing/bulk-coupons.js +112 -0
- package/dist/pricing/index.d.ts +174 -4
- package/dist/pricing/index.js +174 -1
- package/dist/pricing/price-lists.d.ts +604 -0
- package/dist/pricing/price-lists.js +600 -0
- package/dist/purchasing/alerts.d.ts +89 -0
- package/dist/purchasing/alerts.js +62 -0
- package/dist/purchasing/cost.d.ts +110 -0
- package/dist/purchasing/cost.js +86 -0
- package/dist/purchasing/index.d.ts +36 -0
- package/dist/purchasing/index.js +16 -0
- package/dist/purchasing/purchase-orders.d.ts +548 -0
- package/dist/purchasing/purchase-orders.js +491 -0
- package/dist/purchasing/replenishment.d.ts +281 -0
- package/dist/purchasing/replenishment.js +240 -0
- package/dist/purchasing/settings.d.ts +152 -0
- package/dist/purchasing/settings.js +181 -0
- package/dist/purchasing/suppliers.d.ts +476 -0
- package/dist/purchasing/suppliers.js +438 -0
- package/dist/quotes/index.d.ts +501 -0
- package/dist/quotes/index.js +439 -0
- package/dist/reports/index.d.ts +71 -8
- package/dist/reports/index.js +74 -11
- package/dist/returns/index.d.ts +614 -21
- package/dist/returns/index.js +695 -11
- package/dist/search/index.d.ts +76 -1
- package/dist/search/index.js +63 -0
- package/dist/shipping/definitions.d.ts +29 -0
- package/dist/shipping/definitions.js +47 -0
- package/dist/shipping/fulfillment-profiles.d.ts +174 -0
- package/dist/shipping/fulfillment-profiles.js +104 -0
- package/dist/shipping/hendriks.d.ts +97 -0
- package/dist/shipping/hendriks.js +50 -0
- package/dist/shipping/index.d.ts +48 -0
- package/dist/shipping/index.js +25 -0
- package/dist/shipping/methods.d.ts +198 -0
- package/dist/shipping/methods.js +240 -0
- package/dist/shipping/myparcel.d.ts +254 -0
- package/dist/shipping/myparcel.js +178 -0
- package/dist/shipping/parcel-count-suggestion.d.ts +2 -0
- package/dist/shipping/parcel-rule.d.ts +6 -5
- package/dist/shipping/parcel-rule.js +21 -23
- package/dist/shipping/rate-tables.d.ts +179 -0
- package/dist/shipping/rate-tables.js +184 -0
- package/dist/stock/index.d.ts +10 -3
- package/dist/stock/index.js +3 -0
- package/dist/stock/locations.d.ts +144 -0
- package/dist/stock/locations.js +168 -0
- package/dist/stock/transfers.d.ts +216 -43
- package/dist/stock/transfers.js +140 -13
- package/dist/stored-value/index.d.ts +214 -4
- package/dist/stored-value/index.js +152 -0
- package/dist/subscriptions/index.d.ts +682 -0
- package/dist/subscriptions/index.js +815 -0
- package/dist/tax/index.d.ts +76 -1
- package/dist/tax/index.js +50 -0
- package/dist/tenant/email-style.d.ts +102 -0
- package/dist/tenant/email-style.js +72 -0
- package/dist/tenant/email-templates.d.ts +66 -0
- package/dist/tenant/email-templates.js +54 -0
- package/dist/tenant/notifications.d.ts +23 -17
- package/dist/tenant/settings-sources.d.ts +1 -1
- package/dist/tenant/time-zone.d.ts +17 -0
- package/dist/tenant/time-zone.js +11 -0
- package/dist/types.d.ts +50 -3
- package/dist/users/index.d.ts +3 -0
- package/dist/users/index.js +2 -0
- package/dist/users/warehouses.d.ts +50 -0
- package/dist/users/warehouses.js +51 -0
- package/package.json +2 -2
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { BusinessRuleError, pageFromVendureList, readOffsetCursor, ValidationError, } from '@sixtyninecommerce/core';
|
|
2
|
+
import { fieldOf } from '../catalog/types.js';
|
|
3
|
+
/** The fields a list can be sorted by. */
|
|
4
|
+
export const STOCK_LOCATION_SORT_FIELDS = ['name', 'createdAt', 'updatedAt'];
|
|
5
|
+
const LOCATION_FIELDS = /* GraphQL */ `
|
|
6
|
+
id
|
|
7
|
+
name
|
|
8
|
+
description
|
|
9
|
+
createdAt
|
|
10
|
+
updatedAt
|
|
11
|
+
customFields {
|
|
12
|
+
isPublic
|
|
13
|
+
outOfStockThreshold
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
16
|
+
export const STOCK_LOCATIONS_QUERY = /* GraphQL */ `
|
|
17
|
+
query StockLocations($options: StockLocationListOptions) {
|
|
18
|
+
stockLocations(options: $options) {
|
|
19
|
+
items { ${LOCATION_FIELDS} }
|
|
20
|
+
totalItems
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
export const STOCK_LOCATION_QUERY = /* GraphQL */ `
|
|
25
|
+
query StockLocation($id: ID!) {
|
|
26
|
+
stockLocation(id: $id) { ${LOCATION_FIELDS} }
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
export const CREATE_STOCK_LOCATION_MUTATION = /* GraphQL */ `
|
|
30
|
+
mutation CreateStockLocation($input: CreateStockLocationInput!) {
|
|
31
|
+
createStockLocation(input: $input) { ${LOCATION_FIELDS} }
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
export const UPDATE_STOCK_LOCATION_MUTATION = /* GraphQL */ `
|
|
35
|
+
mutation UpdateStockLocation($input: UpdateStockLocationInput!) {
|
|
36
|
+
updateStockLocation(input: $input) { ${LOCATION_FIELDS} }
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
export const DELETE_STOCK_LOCATION_MUTATION = /* GraphQL */ `
|
|
40
|
+
mutation DeleteStockLocation($input: DeleteStockLocationInput!) {
|
|
41
|
+
deleteStockLocation(input: $input) {
|
|
42
|
+
result
|
|
43
|
+
message
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
`;
|
|
47
|
+
const DEFAULT_PAGE_SIZE = 100;
|
|
48
|
+
function toLocation(wire) {
|
|
49
|
+
return {
|
|
50
|
+
id: wire.id,
|
|
51
|
+
name: wire.name,
|
|
52
|
+
description: wire.description ?? '',
|
|
53
|
+
createdAt: wire.createdAt,
|
|
54
|
+
updatedAt: wire.updatedAt,
|
|
55
|
+
// The column defaults: a row written before the field existed reads null.
|
|
56
|
+
isPublic: wire.customFields?.isPublic ?? true,
|
|
57
|
+
outOfStockThreshold: wire.customFields?.outOfStockThreshold ?? 0,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
const invalidInput = (message) => new ValidationError({
|
|
61
|
+
code: 'STOCK_LOCATION_INPUT_INVALID',
|
|
62
|
+
message,
|
|
63
|
+
status: 400,
|
|
64
|
+
service: 'vendure',
|
|
65
|
+
});
|
|
66
|
+
function assertId(id, what = 'id') {
|
|
67
|
+
if (typeof id !== 'string' || id.trim() === '') {
|
|
68
|
+
throw invalidInput(`${what} must be a stock location id.`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function assertName(name) {
|
|
72
|
+
if (typeof name !== 'string' || name.trim() === '') {
|
|
73
|
+
throw invalidInput('A stock location needs a name.');
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/** The location's own custom fields, only the keys the caller set: never the sender fields. */
|
|
77
|
+
function customFieldsOf(input) {
|
|
78
|
+
const fields = {};
|
|
79
|
+
if (input.isPublic !== undefined)
|
|
80
|
+
fields.isPublic = input.isPublic;
|
|
81
|
+
if (input.outOfStockThreshold !== undefined)
|
|
82
|
+
fields.outOfStockThreshold = input.outOfStockThreshold;
|
|
83
|
+
return Object.keys(fields).length > 0 ? fields : undefined;
|
|
84
|
+
}
|
|
85
|
+
function listOptionsOf(skip, take, options) {
|
|
86
|
+
const term = options?.term?.trim() ?? '';
|
|
87
|
+
return {
|
|
88
|
+
skip,
|
|
89
|
+
take,
|
|
90
|
+
...(term === ''
|
|
91
|
+
? {}
|
|
92
|
+
: {
|
|
93
|
+
filter: { name: { contains: term }, description: { contains: term } },
|
|
94
|
+
filterOperator: 'OR',
|
|
95
|
+
}),
|
|
96
|
+
...(options?.sort ? { sort: { [options.sort.field]: options.sort.direction } } : {}),
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
export function createStockLocationsModule(transport) {
|
|
100
|
+
const listPage = async (skip, take, options) => {
|
|
101
|
+
const list = await fieldOf(transport, STOCK_LOCATIONS_QUERY, 'stockLocations', { options: listOptionsOf(skip, take, options) }, options);
|
|
102
|
+
return pageFromVendureList({ items: list.items.map(toLocation), totalItems: list.totalItems }, skip, take, (cursor) => listPage(readOffsetCursor(cursor), take, options));
|
|
103
|
+
};
|
|
104
|
+
return {
|
|
105
|
+
list(options) {
|
|
106
|
+
if (options?.sort && !STOCK_LOCATION_SORT_FIELDS.includes(options.sort.field)) {
|
|
107
|
+
return Promise.reject(invalidInput(`sort.field must be one of ${STOCK_LOCATION_SORT_FIELDS.join(', ')}.`));
|
|
108
|
+
}
|
|
109
|
+
const take = options?.limit ?? DEFAULT_PAGE_SIZE;
|
|
110
|
+
const skip = options?.after === undefined ? 0 : readOffsetCursor(options.after);
|
|
111
|
+
return listPage(skip, take, options);
|
|
112
|
+
},
|
|
113
|
+
async get(id, options) {
|
|
114
|
+
assertId(id);
|
|
115
|
+
const wire = await fieldOf(transport, STOCK_LOCATION_QUERY, 'stockLocation', { id }, options);
|
|
116
|
+
return wire === null ? null : toLocation(wire);
|
|
117
|
+
},
|
|
118
|
+
async create(input, options) {
|
|
119
|
+
assertName(input?.name);
|
|
120
|
+
const customFields = customFieldsOf(input);
|
|
121
|
+
return toLocation(await fieldOf(transport, CREATE_STOCK_LOCATION_MUTATION, 'createStockLocation', {
|
|
122
|
+
input: {
|
|
123
|
+
name: input.name,
|
|
124
|
+
description: input.description ?? '',
|
|
125
|
+
...(customFields ? { customFields } : {}),
|
|
126
|
+
},
|
|
127
|
+
}, options));
|
|
128
|
+
},
|
|
129
|
+
async update(id, input, options) {
|
|
130
|
+
assertId(id);
|
|
131
|
+
if (input?.name !== undefined)
|
|
132
|
+
assertName(input.name);
|
|
133
|
+
const customFields = customFieldsOf(input ?? {});
|
|
134
|
+
return toLocation(await fieldOf(transport, UPDATE_STOCK_LOCATION_MUTATION, 'updateStockLocation', {
|
|
135
|
+
input: {
|
|
136
|
+
id,
|
|
137
|
+
...(input?.name !== undefined ? { name: input.name } : {}),
|
|
138
|
+
...(input?.description !== undefined ? { description: input.description } : {}),
|
|
139
|
+
// Core applies customFields key by key: the sender fields are never named here.
|
|
140
|
+
...(customFields ? { customFields } : {}),
|
|
141
|
+
},
|
|
142
|
+
}, options));
|
|
143
|
+
},
|
|
144
|
+
async delete(id, options) {
|
|
145
|
+
assertId(id);
|
|
146
|
+
if (options?.transferToLocationId !== undefined) {
|
|
147
|
+
assertId(options.transferToLocationId, 'transferToLocationId');
|
|
148
|
+
}
|
|
149
|
+
const response = await fieldOf(transport, DELETE_STOCK_LOCATION_MUTATION, 'deleteStockLocation', {
|
|
150
|
+
input: {
|
|
151
|
+
id,
|
|
152
|
+
...(options?.transferToLocationId
|
|
153
|
+
? { transferToLocationId: options.transferToLocationId }
|
|
154
|
+
: {}),
|
|
155
|
+
},
|
|
156
|
+
}, options);
|
|
157
|
+
if (response?.result === 'DELETED')
|
|
158
|
+
return;
|
|
159
|
+
// Answered at HTTP 200, so the transport never throws for it.
|
|
160
|
+
throw new BusinessRuleError({
|
|
161
|
+
code: 'STOCK_LOCATION_NOT_DELETED',
|
|
162
|
+
message: response?.message?.trim() || 'The stock location was not deleted.',
|
|
163
|
+
status: 422,
|
|
164
|
+
service: 'vendure',
|
|
165
|
+
});
|
|
166
|
+
},
|
|
167
|
+
};
|
|
168
|
+
}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { type Page, type Transport } from '@sixtyninecommerce/core';
|
|
2
2
|
import { type MyparcelUnretractedShipment } from '../fulfillments/index.js';
|
|
3
|
+
import type { StockLocationAddress } from '../locations/index.js';
|
|
3
4
|
import type { Call, ListOptions } from '../types.js';
|
|
4
5
|
export type StockTransferState = 'draft' | 'in_transit' | 'received' | 'cancelled';
|
|
5
6
|
/** A `transfer` moves stock between two locations; a `consumption` uses it up at one. */
|
|
6
7
|
export type StockTransferKind = 'transfer' | 'consumption';
|
|
8
|
+
/**
|
|
9
|
+
* What `search` matches in `list`: the transfer code only (`code`, the engine's default), or the
|
|
10
|
+
* code or the label (`all`).
|
|
11
|
+
*/
|
|
12
|
+
export type StockTransferSearchMode = 'code' | 'all';
|
|
7
13
|
export interface StockTransferAddress {
|
|
8
14
|
contactName: string | null;
|
|
9
15
|
company: string | null;
|
|
@@ -31,6 +37,7 @@ export interface StockTransferLine {
|
|
|
31
37
|
id: string;
|
|
32
38
|
variantId: string;
|
|
33
39
|
sku: string;
|
|
40
|
+
variantName: string;
|
|
34
41
|
quantity: number;
|
|
35
42
|
receivedQuantity: number;
|
|
36
43
|
lostQuantity: number;
|
|
@@ -59,6 +66,10 @@ export interface StockTransfer {
|
|
|
59
66
|
note: string | null;
|
|
60
67
|
carrier: string | null;
|
|
61
68
|
trackingCode: string | null;
|
|
69
|
+
/**
|
|
70
|
+
* A calendar DAY, though it is stored as an instant: the dashboard records the day picked as
|
|
71
|
+
* that day's 00:00 UTC, so read it as the UTC day (`slice(0, 10)`), never in a local zone.
|
|
72
|
+
*/
|
|
62
73
|
estimatedArrivalAt: string | null;
|
|
63
74
|
shippedAt: string | null;
|
|
64
75
|
receivedAt: string | null;
|
|
@@ -67,11 +78,89 @@ export interface StockTransfer {
|
|
|
67
78
|
deliveryAddress: StockTransferAddress | null;
|
|
68
79
|
createdAt: string;
|
|
69
80
|
updatedAt: string;
|
|
81
|
+
/**
|
|
82
|
+
* Who created it. Null when the engine recorded nobody, or that administrator has since been
|
|
83
|
+
* deleted. An app or API key is not null here: it acts as its own administrator (see
|
|
84
|
+
* `StockTransferStaffRef`).
|
|
85
|
+
*/
|
|
86
|
+
initiatedBy: StockTransferStaffRef | null;
|
|
70
87
|
items: StockTransferLine[];
|
|
88
|
+
/** How many lines it has (`items.length`). */
|
|
89
|
+
totalLines: number;
|
|
71
90
|
totalQuantity: number;
|
|
72
91
|
totalReceivedQuantity: number;
|
|
73
92
|
totalLostQuantity: number;
|
|
74
93
|
}
|
|
94
|
+
/** A line as `get` and every write answer it: with its cost snapshot. */
|
|
95
|
+
export interface StockTransferDetailLine extends StockTransferLine {
|
|
96
|
+
/**
|
|
97
|
+
* The variant's standard cost per unit, in minor units of the store's currency, as posting a
|
|
98
|
+
* consumption snapshotted it. Null on a transfer's lines, and on a consumption line whose
|
|
99
|
+
* variant had no cost on file.
|
|
100
|
+
*/
|
|
101
|
+
unitCost: number | null;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* One transfer as `get` and every write answer it: the list's fields, plus who shipped and
|
|
105
|
+
* received it, its consumption value, its transfer note and how it was shipped.
|
|
106
|
+
*/
|
|
107
|
+
export interface StockTransferDetail extends Omit<StockTransfer, 'destinationLocation' | 'items'> {
|
|
108
|
+
/**
|
|
109
|
+
* Null for a consumption. `address` is the location's own postal address as stored (every
|
|
110
|
+
* field optional, as `locations` reads it), null when it has none: a shipment goes there
|
|
111
|
+
* unless `deliveryAddress` names another place.
|
|
112
|
+
*/
|
|
113
|
+
destinationLocation: {
|
|
114
|
+
id: string;
|
|
115
|
+
name: string;
|
|
116
|
+
address: StockLocationAddress | null;
|
|
117
|
+
} | null;
|
|
118
|
+
items: StockTransferDetailLine[];
|
|
119
|
+
/**
|
|
120
|
+
* Who shipped it, or posted the consumption. Null as `initiatedBy` is, and while it is not
|
|
121
|
+
* shipped (removing the shipment clears it).
|
|
122
|
+
*/
|
|
123
|
+
shippedBy: StockTransferStaffRef | null;
|
|
124
|
+
/**
|
|
125
|
+
* Who completed it: the receipt that took it to `received`, a close, or the consumption's
|
|
126
|
+
* post. Null as `initiatedBy` is, and until then: a partial receipt records nobody.
|
|
127
|
+
*/
|
|
128
|
+
receivedBy: StockTransferStaffRef | null;
|
|
129
|
+
/**
|
|
130
|
+
* A consumption's total standard-cost value, in minor units of the store's currency: the sum
|
|
131
|
+
* of its lines' `unitCost × quantity`, over the lines that have one. Null for a transfer. A
|
|
132
|
+
* draft consumption has no cost snapshot yet, so it reads 0 with `consumptionHasUnpricedLines`.
|
|
133
|
+
*/
|
|
134
|
+
consumptionTotalValue: number | null;
|
|
135
|
+
/**
|
|
136
|
+
* True when a line has no cost (a draft, or a variant with no cost on file when it was
|
|
137
|
+
* posted), so `consumptionTotalValue` understates it. Null for a transfer.
|
|
138
|
+
*/
|
|
139
|
+
consumptionHasUnpricedLines: boolean | null;
|
|
140
|
+
/** Where the transfer note PDF is stored; null until one was generated. */
|
|
141
|
+
pdfStorageKey: string | null;
|
|
142
|
+
/**
|
|
143
|
+
* The engine's fulfilment handler it shipped with (`manual-fulfillment`, `myparcel`,
|
|
144
|
+
* `hendriks-3pl`). Null while it is a draft. A cancelled transfer keeps it.
|
|
145
|
+
*/
|
|
146
|
+
fulfillmentHandlerCode: string | null;
|
|
147
|
+
/**
|
|
148
|
+
* The handler arguments the ship was given, as the handler stores them: a key/value object, or
|
|
149
|
+
* the `{ name, value }` list the fulfilment forms send. The handler owns their meaning.
|
|
150
|
+
*/
|
|
151
|
+
handlerArgs: Record<string, unknown> | StockTransferHandlerArg[] | null;
|
|
152
|
+
/** The first MyParcel parcel's shipment id; every parcel is on `parcels(id)`. */
|
|
153
|
+
myparcelShipmentId: number | null;
|
|
154
|
+
/** The first MyParcel parcel's barcode once it has one; every barcode is on `parcels(id)`. */
|
|
155
|
+
myparcelBarcode: string | null;
|
|
156
|
+
/** Where the Hendriks (3PL) export was uploaded; null until the export completed. */
|
|
157
|
+
hendriksRemotePath: string | null;
|
|
158
|
+
}
|
|
159
|
+
/** One handler argument in the list form the fulfilment forms send. */
|
|
160
|
+
export interface StockTransferHandlerArg {
|
|
161
|
+
name: string;
|
|
162
|
+
value: string;
|
|
163
|
+
}
|
|
75
164
|
export interface StockTransferLineInput {
|
|
76
165
|
variantId: string;
|
|
77
166
|
quantity: number;
|
|
@@ -86,27 +175,32 @@ export interface CreateStockTransferInput {
|
|
|
86
175
|
note?: string;
|
|
87
176
|
lines: StockTransferLineInput[];
|
|
88
177
|
}
|
|
89
|
-
/** A draft's fields; an omitted field is left as it is. */
|
|
178
|
+
/** A draft's fields; an omitted field is left as it is, and `null` clears one. */
|
|
90
179
|
export interface UpdateStockTransferInput {
|
|
91
180
|
sourceLocationId?: string;
|
|
92
181
|
destinationLocationId?: string;
|
|
93
|
-
label?: string;
|
|
94
|
-
note?: string;
|
|
182
|
+
label?: string | null;
|
|
183
|
+
note?: string | null;
|
|
95
184
|
/** Replaces every line. */
|
|
96
185
|
lines?: StockTransferLineInput[];
|
|
97
|
-
carrier?: string;
|
|
98
|
-
trackingCode?: string;
|
|
99
|
-
/** ISO 8601 with an explicit offset. */
|
|
100
|
-
estimatedArrivalAt?: string;
|
|
186
|
+
carrier?: string | null;
|
|
187
|
+
trackingCode?: string | null;
|
|
188
|
+
/** ISO 8601 with an explicit offset. A day is sent as its 00:00 UTC (see `estimatedArrivalAt`). */
|
|
189
|
+
estimatedArrivalAt?: string | null;
|
|
101
190
|
}
|
|
191
|
+
/**
|
|
192
|
+
* `carrier`, `trackingCode` and `estimatedArrivalAt`: an omitted field keeps what the draft
|
|
193
|
+
* holds, and `null` clears it.
|
|
194
|
+
*/
|
|
102
195
|
export interface ShipStockTransferInput {
|
|
103
|
-
carrier?: string;
|
|
104
|
-
trackingCode?: string;
|
|
105
|
-
/** ISO 8601 with an explicit offset. */
|
|
106
|
-
estimatedArrivalAt?: string;
|
|
107
|
-
/** The engine's fulfilment handler code;
|
|
108
|
-
fulfillmentHandlerCode?: string;
|
|
109
|
-
|
|
196
|
+
carrier?: string | null;
|
|
197
|
+
trackingCode?: string | null;
|
|
198
|
+
/** ISO 8601 with an explicit offset. A day is sent as its 00:00 UTC (see `estimatedArrivalAt`). */
|
|
199
|
+
estimatedArrivalAt?: string | null;
|
|
200
|
+
/** The engine's fulfilment handler code; omitted or null ships it by hand (manual). */
|
|
201
|
+
fulfillmentHandlerCode?: string | null;
|
|
202
|
+
/** The handler's arguments: a key/value object or the `{ name, value }` list; none when omitted. */
|
|
203
|
+
handlerArgs?: Record<string, unknown> | StockTransferHandlerArg[] | null;
|
|
110
204
|
/** Ship somewhere other than the destination's own address; null re-addresses it there. */
|
|
111
205
|
deliveryAddress?: StockTransferAddressInput | null;
|
|
112
206
|
}
|
|
@@ -170,6 +264,8 @@ export interface StockTransferFilter extends ListOptions {
|
|
|
170
264
|
/** ISO 8601 with an explicit offset. */
|
|
171
265
|
dateTo?: string;
|
|
172
266
|
search?: string;
|
|
267
|
+
/** What `search` matches; the engine's default (`code`) when omitted. */
|
|
268
|
+
searchMode?: StockTransferSearchMode;
|
|
173
269
|
/** Only the returns of this transfer. Needs an engine with returns. */
|
|
174
270
|
returnOfTransferId?: string;
|
|
175
271
|
/**
|
|
@@ -235,7 +331,11 @@ export interface StockTransferReturns {
|
|
|
235
331
|
*/
|
|
236
332
|
returnableLines: StockTransferReturnableLine[];
|
|
237
333
|
}
|
|
238
|
-
/**
|
|
334
|
+
/**
|
|
335
|
+
* The administrator who acted on a transfer. Usually a member of staff; an app installation or
|
|
336
|
+
* an API key acts as its own administrator, so it appears here too, with `firstName` "App" or
|
|
337
|
+
* "API Token" and its own name as `lastName`.
|
|
338
|
+
*/
|
|
239
339
|
export interface StockTransferStaffRef {
|
|
240
340
|
/** The administrator's id. */
|
|
241
341
|
id: string;
|
|
@@ -341,7 +441,9 @@ export interface StockTransferLabel {
|
|
|
341
441
|
* `stock.movements()`. Reads need `ReadStockLocation`; every write needs `AdjustStock`
|
|
342
442
|
* (or, for credentials minted before it existed, `UpdateStockLocation` — a transition a
|
|
343
443
|
* later release ends).
|
|
344
|
-
* None of these writes takes an idempotency key yet
|
|
444
|
+
* None of these writes takes an idempotency key yet, and the client never repeats one: a write
|
|
445
|
+
* whose answer was lost is read back with `get` before it is sent again (each method says what
|
|
446
|
+
* a repeat does).
|
|
345
447
|
*
|
|
346
448
|
* Every location and variant a transfer names must be the store's own:
|
|
347
449
|
* another store's location (or an id that does not exist) is refused
|
|
@@ -377,46 +479,117 @@ export interface StockTransferLabel {
|
|
|
377
479
|
* never by `get`: a caller ahead of the engine sees only those calls refused.
|
|
378
480
|
*/
|
|
379
481
|
export interface StockTransfersModule {
|
|
482
|
+
/**
|
|
483
|
+
* The store's transfers and consumptions, newest first, a page at a time (`limit`, default
|
|
484
|
+
* 25; `after` from a previous page). `search` matches the code, or the code or the label with
|
|
485
|
+
* `searchMode: 'all'`. A list row carries no detail fields: `get` one for those.
|
|
486
|
+
*
|
|
487
|
+
* @effect read
|
|
488
|
+
* @permission ReadStockLocation
|
|
489
|
+
*/
|
|
380
490
|
list(filter?: StockTransferFilter): Promise<Page<StockTransfer>>;
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
491
|
+
/**
|
|
492
|
+
* One transfer with its detail fields, or `null` when this store has no such transfer.
|
|
493
|
+
*
|
|
494
|
+
* @effect read
|
|
495
|
+
* @permission ReadStockLocation
|
|
496
|
+
*/
|
|
497
|
+
get(id: string, options?: Call): Promise<StockTransferDetail | null>;
|
|
498
|
+
/**
|
|
499
|
+
* A draft transfer or consumption. Moves no stock.
|
|
500
|
+
*
|
|
501
|
+
* @effect write
|
|
502
|
+
* @permission AdjustStock
|
|
503
|
+
*/
|
|
504
|
+
create(input: CreateStockTransferInput, options?: Call): Promise<StockTransferDetail>;
|
|
505
|
+
/**
|
|
506
|
+
* Only a draft can be edited. Moves no stock.
|
|
507
|
+
*
|
|
508
|
+
* @effect write
|
|
509
|
+
* @permission AdjustStock
|
|
510
|
+
*/
|
|
511
|
+
update(id: string, input: UpdateStockTransferInput, options?: Call): Promise<StockTransferDetail>;
|
|
385
512
|
/**
|
|
386
513
|
* Draft → in transit: the source is debited. A MyParcel ship books every
|
|
387
|
-
* parcel at MyParcel before it answers, so it is
|
|
388
|
-
* `REQUEST_TIMEOUT` does not mean it failed — `get` it
|
|
514
|
+
* parcel at MyParcel before it answers and buys their labels, so it is
|
|
515
|
+
* allowed up to 120s; a `REQUEST_TIMEOUT` does not mean it failed — `get` it
|
|
516
|
+
* before shipping again. Shipping a transfer already in transit answers it
|
|
517
|
+
* unchanged: nothing is debited or booked twice. A Hendriks (3PL) ship
|
|
518
|
+
* uploads its export, which a later cancel does not withdraw.
|
|
519
|
+
*
|
|
520
|
+
* Refused `FIELD_GROUP_LOCKED` (`BusinessRuleError`) while an app or API key
|
|
521
|
+
* owns the store's Stock. A member store's Stock owner never locks the hub's
|
|
522
|
+
* warehouse (ruling U8).
|
|
523
|
+
*
|
|
524
|
+
* @effect money
|
|
525
|
+
* @permission AdjustStock
|
|
526
|
+
*/
|
|
527
|
+
ship(id: string, input?: ShipStockTransferInput, options?: Call): Promise<StockTransferDetail>;
|
|
528
|
+
/**
|
|
529
|
+
* Post a consumption: debit its location, snapshot each line's cost and
|
|
530
|
+
* complete the draft. Only a draft is posted, so a repeat is refused
|
|
531
|
+
* (`USER_INPUT_ERROR`, `ValidationError`) and debits nothing.
|
|
532
|
+
*
|
|
533
|
+
* Refused `FIELD_GROUP_LOCKED` (`BusinessRuleError`) while an app or API key
|
|
534
|
+
* owns the store's Stock. A member store's Stock owner never locks the hub's
|
|
535
|
+
* warehouse (ruling U8).
|
|
536
|
+
*
|
|
537
|
+
* @effect write
|
|
538
|
+
* @permission AdjustStock
|
|
539
|
+
*/
|
|
540
|
+
postConsumption(id: string, options?: Call): Promise<StockTransferDetail>;
|
|
541
|
+
/**
|
|
542
|
+
* Credit the destination with what arrived, and write off what was lost, per line. The
|
|
543
|
+
* quantities are each line's running TOTALS, never increments: a repeat of the same call
|
|
544
|
+
* credits nothing again, and a total lower than the line's is refused.
|
|
545
|
+
*
|
|
546
|
+
* Refused `FIELD_GROUP_LOCKED` (`BusinessRuleError`) while an app or API key
|
|
547
|
+
* owns the store's Stock. A member store's Stock owner never locks the hub's
|
|
548
|
+
* warehouse (ruling U8).
|
|
549
|
+
*
|
|
550
|
+
* @effect write
|
|
551
|
+
* @permission AdjustStock
|
|
389
552
|
*/
|
|
390
|
-
|
|
391
|
-
/** Post a consumption: debit its location and complete the draft. */
|
|
392
|
-
postConsumption(id: string, options?: Call): Promise<StockTransfer>;
|
|
393
|
-
/** Credit the destination with what arrived, and write off what was lost, per line. */
|
|
394
|
-
receive(id: string, lines: ReceiveStockTransferLineInput[], options?: Call): Promise<StockTransfer>;
|
|
553
|
+
receive(id: string, lines: ReceiveStockTransferLineInput[], options?: Call): Promise<StockTransferDetail>;
|
|
395
554
|
/**
|
|
396
555
|
* Close an in-transit transfer as received. Each line still short is settled
|
|
397
556
|
* as `shortfall` names it — `LOST`, or `RETURN_TO_SOURCE` (credited back to
|
|
398
557
|
* the source) — and a line it does not name is written off as lost only with
|
|
399
558
|
* `acceptShortfallAsLost`; otherwise the close is refused. Refused too: a
|
|
400
559
|
* line named twice, a line of another transfer, a line with nothing
|
|
401
|
-
* outstanding. Each refusal is a `ValidationError` and changes nothing.
|
|
560
|
+
* outstanding. Each refusal is a `ValidationError` and changes nothing. A
|
|
561
|
+
* close that sends a line back to the source is refused `FIELD_GROUP_LOCKED`
|
|
562
|
+
* (`BusinessRuleError`) while an app or API key owns the store's Stock.
|
|
563
|
+
*
|
|
564
|
+
* @effect write
|
|
565
|
+
* @permission AdjustStock
|
|
402
566
|
*/
|
|
403
|
-
close(id: string, options?: CloseStockTransferOptions): Promise<
|
|
567
|
+
close(id: string, options?: CloseStockTransferOptions): Promise<StockTransferDetail>;
|
|
404
568
|
/**
|
|
405
569
|
* Cancel a draft, or an in-transit transfer (unreceived stock returns to the
|
|
406
570
|
* source). An in-transit MyParcel shipment's parcels are voided at MyParcel
|
|
407
|
-
* inside the call, so it is allowed up to 120s.
|
|
571
|
+
* inside the call, so it is allowed up to 120s. A cancelled transfer is
|
|
572
|
+
* final: cancelling it again is refused (`ValidationError`) and restores
|
|
573
|
+
* nothing twice. An in-transit cancel is refused `FIELD_GROUP_LOCKED`
|
|
574
|
+
* (`BusinessRuleError`) while an app or API key owns the store's Stock.
|
|
575
|
+
*
|
|
576
|
+
* @effect destructive
|
|
577
|
+
* @permission AdjustStock
|
|
408
578
|
*/
|
|
409
579
|
cancel(id: string, options?: Call & {
|
|
410
580
|
reason?: string;
|
|
411
|
-
}): Promise<
|
|
581
|
+
}): Promise<StockTransferDetail>;
|
|
412
582
|
/**
|
|
413
583
|
* Create a draft RETURN of transfer `id` (the original): its source is the
|
|
414
584
|
* original's destination, its lines capped per variant at what the original
|
|
415
585
|
* received minus its other returns that are not cancelled. Answers the
|
|
416
586
|
* return; ship and receive it like any transfer. A restricted credential
|
|
417
587
|
* must hold the return's source (the original's destination).
|
|
588
|
+
*
|
|
589
|
+
* @effect write
|
|
590
|
+
* @permission AdjustStock
|
|
418
591
|
*/
|
|
419
|
-
createReturn(id: string, input: CreateStockTransferReturnInput, options?: Call): Promise<
|
|
592
|
+
createReturn(id: string, input: CreateStockTransferReturnInput, options?: Call): Promise<StockTransferDetail>;
|
|
420
593
|
/**
|
|
421
594
|
* How transfer `id` is linked to returns — the transfer it returns from, its
|
|
422
595
|
* own returns, and what a new return may still take per variant — or null
|
|
@@ -488,22 +661,22 @@ export interface StockTransfersModule {
|
|
|
488
661
|
*/
|
|
489
662
|
myparcelLabel(id: string, format: StockTransferLabelFormat, options?: Call): Promise<StockTransferLabel>;
|
|
490
663
|
}
|
|
491
|
-
export declare const STOCK_TRANSFERS_QUERY = "\n query StockTransfers($options: StockTransferListOptions) {\n stockTransfers(options: $options) { items { \n id\n code\n kind\n state\n sourceLocation { id name }\n destinationLocation { id name }\n label\n note\n carrier\n trackingCode\n estimatedArrivalAt\n shippedAt\n receivedAt\n cancelledAt\n cancelReason\n deliveryAddress {\n contactName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n phoneNumber\n }\n createdAt\n updatedAt\n items {\n id\n productVariant { id sku }\n quantity\n receivedQuantity\n lostQuantity\n outstandingQuantity\n }\n totalQuantity\n totalReceivedQuantity\n totalLostQuantity\n } totalItems }\n }\n";
|
|
492
|
-
export declare const STOCK_TRANSFER_QUERY = "\n query StockTransfer($id: ID!) { stockTransfer(id: $id) { \n id\n code\n kind\n state\n sourceLocation { id name }\n destinationLocation { id name }\n label\n note\n carrier\n trackingCode\n estimatedArrivalAt\n shippedAt\n receivedAt\n cancelledAt\n cancelReason\n deliveryAddress {\n contactName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n phoneNumber\n }\n createdAt\n updatedAt\n items {\n id\n productVariant { id sku }\n quantity\n receivedQuantity\n lostQuantity\n outstandingQuantity\n }\n totalQuantity\n totalReceivedQuantity\n totalLostQuantity\n } }\n";
|
|
493
|
-
export declare const CREATE_STOCK_TRANSFER_MUTATION = "\n mutation CreateStockTransfer($input: CreateStockTransferInput!) {\n createStockTransfer(input: $input) { \n id\n code\n kind\n state\n sourceLocation { id name }\n destinationLocation { id name }\n label\n note\n carrier\n trackingCode\n estimatedArrivalAt\n shippedAt\n receivedAt\n cancelledAt\n cancelReason\n deliveryAddress {\n contactName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n phoneNumber\n }\n createdAt\n updatedAt\n items {\n id\n productVariant { id sku }\n quantity\n receivedQuantity\n lostQuantity\n outstandingQuantity\n }\n totalQuantity\n totalReceivedQuantity\n totalLostQuantity\n }\n }\n";
|
|
494
|
-
export declare const UPDATE_STOCK_TRANSFER_MUTATION = "\n mutation UpdateStockTransfer($id: ID!, $input: UpdateStockTransferInput!) {\n updateStockTransfer(id: $id, input: $input) { \n id\n code\n kind\n state\n sourceLocation { id name }\n destinationLocation { id name }\n label\n note\n carrier\n trackingCode\n estimatedArrivalAt\n shippedAt\n receivedAt\n cancelledAt\n cancelReason\n deliveryAddress {\n contactName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n phoneNumber\n }\n createdAt\n updatedAt\n items {\n id\n productVariant { id sku }\n quantity\n receivedQuantity\n lostQuantity\n outstandingQuantity\n }\n totalQuantity\n totalReceivedQuantity\n totalLostQuantity\n }\n }\n";
|
|
495
|
-
export declare const SHIP_STOCK_TRANSFER_MUTATION = "\n mutation ShipStockTransfer($id: ID!, $input: ShipStockTransferInput) {\n shipStockTransfer(id: $id, input: $input) { \n id\n code\n kind\n state\n sourceLocation { id name }\n destinationLocation { id name }\n label\n note\n carrier\n trackingCode\n estimatedArrivalAt\n shippedAt\n receivedAt\n cancelledAt\n cancelReason\n deliveryAddress {\n contactName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n phoneNumber\n }\n createdAt\n updatedAt\n items {\n id\n productVariant { id sku }\n quantity\n receivedQuantity\n lostQuantity\n outstandingQuantity\n }\n totalQuantity\n totalReceivedQuantity\n totalLostQuantity\n }\n }\n";
|
|
496
|
-
export declare const POST_STOCK_TRANSFER_CONSUMPTION_MUTATION = "\n mutation PostStockTransferConsumption($id: ID!) {\n postStockTransferConsumption(id: $id) { \n id\n code\n kind\n state\n sourceLocation { id name }\n destinationLocation { id name }\n label\n note\n carrier\n trackingCode\n estimatedArrivalAt\n shippedAt\n receivedAt\n cancelledAt\n cancelReason\n deliveryAddress {\n contactName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n phoneNumber\n }\n createdAt\n updatedAt\n items {\n id\n productVariant { id sku }\n quantity\n receivedQuantity\n lostQuantity\n outstandingQuantity\n }\n totalQuantity\n totalReceivedQuantity\n totalLostQuantity\n }\n }\n";
|
|
497
|
-
export declare const RECEIVE_STOCK_TRANSFER_LINES_MUTATION = "\n mutation ReceiveStockTransferLines($id: ID!, $lines: [ReceiveStockTransferLineInput!]!) {\n receiveStockTransferLines(id: $id, lines: $lines) { \n id\n code\n kind\n state\n sourceLocation { id name }\n destinationLocation { id name }\n label\n note\n carrier\n trackingCode\n estimatedArrivalAt\n shippedAt\n receivedAt\n cancelledAt\n cancelReason\n deliveryAddress {\n contactName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n phoneNumber\n }\n createdAt\n updatedAt\n items {\n id\n productVariant { id sku }\n quantity\n receivedQuantity\n lostQuantity\n outstandingQuantity\n }\n totalQuantity\n totalReceivedQuantity\n totalLostQuantity\n }\n }\n";
|
|
498
|
-
export declare const CLOSE_STOCK_TRANSFER_MUTATION = "\n mutation CloseStockTransfer($id: ID!, $acceptShortfallAsLost: Boolean) {\n closeStockTransfer(id: $id, acceptShortfallAsLost: $acceptShortfallAsLost) { \n id\n code\n kind\n state\n sourceLocation { id name }\n destinationLocation { id name }\n label\n note\n carrier\n trackingCode\n estimatedArrivalAt\n shippedAt\n receivedAt\n cancelledAt\n cancelReason\n deliveryAddress {\n contactName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n phoneNumber\n }\n createdAt\n updatedAt\n items {\n id\n productVariant { id sku }\n quantity\n receivedQuantity\n lostQuantity\n outstandingQuantity\n }\n totalQuantity\n totalReceivedQuantity\n totalLostQuantity\n }\n }\n";
|
|
664
|
+
export declare const STOCK_TRANSFERS_QUERY = "\n query StockTransfers($options: StockTransferListOptions) {\n stockTransfers(options: $options) { items { \n id\n code\n kind\n state\n sourceLocation { id name }\n destinationLocation { id name }\n label\n note\n carrier\n trackingCode\n estimatedArrivalAt\n shippedAt\n receivedAt\n cancelledAt\n cancelReason\n deliveryAddress {\n contactName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n phoneNumber\n }\n createdAt\n updatedAt\n initiatedBy { id firstName lastName }\n items {\n id\n productVariant { id name sku }\n quantity\n receivedQuantity\n lostQuantity\n outstandingQuantity\n }\n totalLines\n totalQuantity\n totalReceivedQuantity\n totalLostQuantity\n } totalItems }\n }\n";
|
|
665
|
+
export declare const STOCK_TRANSFER_QUERY = "\n query StockTransfer($id: ID!) { stockTransfer(id: $id) { \n id\n code\n kind\n state\n sourceLocation { id name }\n destinationLocation { id name customFields { address } }\n label\n note\n carrier\n trackingCode\n estimatedArrivalAt\n shippedAt\n receivedAt\n cancelledAt\n cancelReason\n deliveryAddress {\n contactName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n phoneNumber\n }\n createdAt\n updatedAt\n initiatedBy { id firstName lastName }\n shippedBy { id firstName lastName }\n receivedBy { id firstName lastName }\n consumptionTotalValue\n consumptionHasUnpricedLines\n pdfStorageKey\n fulfillmentHandlerCode\n handlerArgs\n myparcelShipmentId\n myparcelBarcode\n hendriksRemotePath\n items {\n id\n productVariant { id name sku }\n quantity\n receivedQuantity\n lostQuantity\n outstandingQuantity\n unitCost\n }\n totalLines\n totalQuantity\n totalReceivedQuantity\n totalLostQuantity\n } }\n";
|
|
666
|
+
export declare const CREATE_STOCK_TRANSFER_MUTATION = "\n mutation CreateStockTransfer($input: CreateStockTransferInput!) {\n createStockTransfer(input: $input) { \n id\n code\n kind\n state\n sourceLocation { id name }\n destinationLocation { id name customFields { address } }\n label\n note\n carrier\n trackingCode\n estimatedArrivalAt\n shippedAt\n receivedAt\n cancelledAt\n cancelReason\n deliveryAddress {\n contactName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n phoneNumber\n }\n createdAt\n updatedAt\n initiatedBy { id firstName lastName }\n shippedBy { id firstName lastName }\n receivedBy { id firstName lastName }\n consumptionTotalValue\n consumptionHasUnpricedLines\n pdfStorageKey\n fulfillmentHandlerCode\n handlerArgs\n myparcelShipmentId\n myparcelBarcode\n hendriksRemotePath\n items {\n id\n productVariant { id name sku }\n quantity\n receivedQuantity\n lostQuantity\n outstandingQuantity\n unitCost\n }\n totalLines\n totalQuantity\n totalReceivedQuantity\n totalLostQuantity\n }\n }\n";
|
|
667
|
+
export declare const UPDATE_STOCK_TRANSFER_MUTATION = "\n mutation UpdateStockTransfer($id: ID!, $input: UpdateStockTransferInput!) {\n updateStockTransfer(id: $id, input: $input) { \n id\n code\n kind\n state\n sourceLocation { id name }\n destinationLocation { id name customFields { address } }\n label\n note\n carrier\n trackingCode\n estimatedArrivalAt\n shippedAt\n receivedAt\n cancelledAt\n cancelReason\n deliveryAddress {\n contactName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n phoneNumber\n }\n createdAt\n updatedAt\n initiatedBy { id firstName lastName }\n shippedBy { id firstName lastName }\n receivedBy { id firstName lastName }\n consumptionTotalValue\n consumptionHasUnpricedLines\n pdfStorageKey\n fulfillmentHandlerCode\n handlerArgs\n myparcelShipmentId\n myparcelBarcode\n hendriksRemotePath\n items {\n id\n productVariant { id name sku }\n quantity\n receivedQuantity\n lostQuantity\n outstandingQuantity\n unitCost\n }\n totalLines\n totalQuantity\n totalReceivedQuantity\n totalLostQuantity\n }\n }\n";
|
|
668
|
+
export declare const SHIP_STOCK_TRANSFER_MUTATION = "\n mutation ShipStockTransfer($id: ID!, $input: ShipStockTransferInput) {\n shipStockTransfer(id: $id, input: $input) { \n id\n code\n kind\n state\n sourceLocation { id name }\n destinationLocation { id name customFields { address } }\n label\n note\n carrier\n trackingCode\n estimatedArrivalAt\n shippedAt\n receivedAt\n cancelledAt\n cancelReason\n deliveryAddress {\n contactName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n phoneNumber\n }\n createdAt\n updatedAt\n initiatedBy { id firstName lastName }\n shippedBy { id firstName lastName }\n receivedBy { id firstName lastName }\n consumptionTotalValue\n consumptionHasUnpricedLines\n pdfStorageKey\n fulfillmentHandlerCode\n handlerArgs\n myparcelShipmentId\n myparcelBarcode\n hendriksRemotePath\n items {\n id\n productVariant { id name sku }\n quantity\n receivedQuantity\n lostQuantity\n outstandingQuantity\n unitCost\n }\n totalLines\n totalQuantity\n totalReceivedQuantity\n totalLostQuantity\n }\n }\n";
|
|
669
|
+
export declare const POST_STOCK_TRANSFER_CONSUMPTION_MUTATION = "\n mutation PostStockTransferConsumption($id: ID!) {\n postStockTransferConsumption(id: $id) { \n id\n code\n kind\n state\n sourceLocation { id name }\n destinationLocation { id name customFields { address } }\n label\n note\n carrier\n trackingCode\n estimatedArrivalAt\n shippedAt\n receivedAt\n cancelledAt\n cancelReason\n deliveryAddress {\n contactName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n phoneNumber\n }\n createdAt\n updatedAt\n initiatedBy { id firstName lastName }\n shippedBy { id firstName lastName }\n receivedBy { id firstName lastName }\n consumptionTotalValue\n consumptionHasUnpricedLines\n pdfStorageKey\n fulfillmentHandlerCode\n handlerArgs\n myparcelShipmentId\n myparcelBarcode\n hendriksRemotePath\n items {\n id\n productVariant { id name sku }\n quantity\n receivedQuantity\n lostQuantity\n outstandingQuantity\n unitCost\n }\n totalLines\n totalQuantity\n totalReceivedQuantity\n totalLostQuantity\n }\n }\n";
|
|
670
|
+
export declare const RECEIVE_STOCK_TRANSFER_LINES_MUTATION = "\n mutation ReceiveStockTransferLines($id: ID!, $lines: [ReceiveStockTransferLineInput!]!) {\n receiveStockTransferLines(id: $id, lines: $lines) { \n id\n code\n kind\n state\n sourceLocation { id name }\n destinationLocation { id name customFields { address } }\n label\n note\n carrier\n trackingCode\n estimatedArrivalAt\n shippedAt\n receivedAt\n cancelledAt\n cancelReason\n deliveryAddress {\n contactName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n phoneNumber\n }\n createdAt\n updatedAt\n initiatedBy { id firstName lastName }\n shippedBy { id firstName lastName }\n receivedBy { id firstName lastName }\n consumptionTotalValue\n consumptionHasUnpricedLines\n pdfStorageKey\n fulfillmentHandlerCode\n handlerArgs\n myparcelShipmentId\n myparcelBarcode\n hendriksRemotePath\n items {\n id\n productVariant { id name sku }\n quantity\n receivedQuantity\n lostQuantity\n outstandingQuantity\n unitCost\n }\n totalLines\n totalQuantity\n totalReceivedQuantity\n totalLostQuantity\n }\n }\n";
|
|
671
|
+
export declare const CLOSE_STOCK_TRANSFER_MUTATION = "\n mutation CloseStockTransfer($id: ID!, $acceptShortfallAsLost: Boolean) {\n closeStockTransfer(id: $id, acceptShortfallAsLost: $acceptShortfallAsLost) { \n id\n code\n kind\n state\n sourceLocation { id name }\n destinationLocation { id name customFields { address } }\n label\n note\n carrier\n trackingCode\n estimatedArrivalAt\n shippedAt\n receivedAt\n cancelledAt\n cancelReason\n deliveryAddress {\n contactName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n phoneNumber\n }\n createdAt\n updatedAt\n initiatedBy { id firstName lastName }\n shippedBy { id firstName lastName }\n receivedBy { id firstName lastName }\n consumptionTotalValue\n consumptionHasUnpricedLines\n pdfStorageKey\n fulfillmentHandlerCode\n handlerArgs\n myparcelShipmentId\n myparcelBarcode\n hendriksRemotePath\n items {\n id\n productVariant { id name sku }\n quantity\n receivedQuantity\n lostQuantity\n outstandingQuantity\n unitCost\n }\n totalLines\n totalQuantity\n totalReceivedQuantity\n totalLostQuantity\n }\n }\n";
|
|
499
672
|
/**
|
|
500
673
|
* Its own document: it declares `$shortfall`, which an engine without per-line
|
|
501
674
|
* dispositions refuses as a whole. A close without dispositions keeps sending
|
|
502
675
|
* the document above.
|
|
503
676
|
*/
|
|
504
|
-
export declare const CLOSE_STOCK_TRANSFER_WITH_SHORTFALL_MUTATION = "\n mutation CloseStockTransferWithShortfall(\n $id: ID!\n $acceptShortfallAsLost: Boolean\n $shortfall: [StockTransferShortfallLineInput!]!\n ) {\n closeStockTransfer(\n id: $id\n acceptShortfallAsLost: $acceptShortfallAsLost\n shortfall: $shortfall\n ) { \n id\n code\n kind\n state\n sourceLocation { id name }\n destinationLocation { id name }\n label\n note\n carrier\n trackingCode\n estimatedArrivalAt\n shippedAt\n receivedAt\n cancelledAt\n cancelReason\n deliveryAddress {\n contactName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n phoneNumber\n }\n createdAt\n updatedAt\n items {\n id\n productVariant { id sku }\n quantity\n receivedQuantity\n lostQuantity\n outstandingQuantity\n }\n totalQuantity\n totalReceivedQuantity\n totalLostQuantity\n }\n }\n";
|
|
505
|
-
export declare const CANCEL_STOCK_TRANSFER_MUTATION = "\n mutation CancelStockTransfer($id: ID!, $reason: String) {\n cancelStockTransfer(id: $id, reason: $reason) { \n id\n code\n kind\n state\n sourceLocation { id name }\n destinationLocation { id name }\n label\n note\n carrier\n trackingCode\n estimatedArrivalAt\n shippedAt\n receivedAt\n cancelledAt\n cancelReason\n deliveryAddress {\n contactName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n phoneNumber\n }\n createdAt\n updatedAt\n items {\n id\n productVariant { id sku }\n quantity\n receivedQuantity\n lostQuantity\n outstandingQuantity\n }\n totalQuantity\n totalReceivedQuantity\n totalLostQuantity\n }\n }\n";
|
|
506
|
-
export declare const CREATE_STOCK_TRANSFER_RETURN_MUTATION = "\n mutation CreateStockTransferReturn($id: ID!, $input: CreateStockTransferReturnInput!) {\n createStockTransferReturn(id: $id, input: $input) { \n id\n code\n kind\n state\n sourceLocation { id name }\n destinationLocation { id name }\n label\n note\n carrier\n trackingCode\n estimatedArrivalAt\n shippedAt\n receivedAt\n cancelledAt\n cancelReason\n deliveryAddress {\n contactName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n phoneNumber\n }\n createdAt\n updatedAt\n items {\n id\n productVariant { id sku }\n quantity\n receivedQuantity\n lostQuantity\n outstandingQuantity\n }\n totalQuantity\n totalReceivedQuantity\n totalLostQuantity\n }\n }\n";
|
|
677
|
+
export declare const CLOSE_STOCK_TRANSFER_WITH_SHORTFALL_MUTATION = "\n mutation CloseStockTransferWithShortfall(\n $id: ID!\n $acceptShortfallAsLost: Boolean\n $shortfall: [StockTransferShortfallLineInput!]!\n ) {\n closeStockTransfer(\n id: $id\n acceptShortfallAsLost: $acceptShortfallAsLost\n shortfall: $shortfall\n ) { \n id\n code\n kind\n state\n sourceLocation { id name }\n destinationLocation { id name customFields { address } }\n label\n note\n carrier\n trackingCode\n estimatedArrivalAt\n shippedAt\n receivedAt\n cancelledAt\n cancelReason\n deliveryAddress {\n contactName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n phoneNumber\n }\n createdAt\n updatedAt\n initiatedBy { id firstName lastName }\n shippedBy { id firstName lastName }\n receivedBy { id firstName lastName }\n consumptionTotalValue\n consumptionHasUnpricedLines\n pdfStorageKey\n fulfillmentHandlerCode\n handlerArgs\n myparcelShipmentId\n myparcelBarcode\n hendriksRemotePath\n items {\n id\n productVariant { id name sku }\n quantity\n receivedQuantity\n lostQuantity\n outstandingQuantity\n unitCost\n }\n totalLines\n totalQuantity\n totalReceivedQuantity\n totalLostQuantity\n }\n }\n";
|
|
678
|
+
export declare const CANCEL_STOCK_TRANSFER_MUTATION = "\n mutation CancelStockTransfer($id: ID!, $reason: String) {\n cancelStockTransfer(id: $id, reason: $reason) { \n id\n code\n kind\n state\n sourceLocation { id name }\n destinationLocation { id name customFields { address } }\n label\n note\n carrier\n trackingCode\n estimatedArrivalAt\n shippedAt\n receivedAt\n cancelledAt\n cancelReason\n deliveryAddress {\n contactName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n phoneNumber\n }\n createdAt\n updatedAt\n initiatedBy { id firstName lastName }\n shippedBy { id firstName lastName }\n receivedBy { id firstName lastName }\n consumptionTotalValue\n consumptionHasUnpricedLines\n pdfStorageKey\n fulfillmentHandlerCode\n handlerArgs\n myparcelShipmentId\n myparcelBarcode\n hendriksRemotePath\n items {\n id\n productVariant { id name sku }\n quantity\n receivedQuantity\n lostQuantity\n outstandingQuantity\n unitCost\n }\n totalLines\n totalQuantity\n totalReceivedQuantity\n totalLostQuantity\n }\n }\n";
|
|
679
|
+
export declare const CREATE_STOCK_TRANSFER_RETURN_MUTATION = "\n mutation CreateStockTransferReturn($id: ID!, $input: CreateStockTransferReturnInput!) {\n createStockTransferReturn(id: $id, input: $input) { \n id\n code\n kind\n state\n sourceLocation { id name }\n destinationLocation { id name customFields { address } }\n label\n note\n carrier\n trackingCode\n estimatedArrivalAt\n shippedAt\n receivedAt\n cancelledAt\n cancelReason\n deliveryAddress {\n contactName\n company\n streetLine1\n streetLine2\n city\n province\n postalCode\n countryCode\n phoneNumber\n }\n createdAt\n updatedAt\n initiatedBy { id firstName lastName }\n shippedBy { id firstName lastName }\n receivedBy { id firstName lastName }\n consumptionTotalValue\n consumptionHasUnpricedLines\n pdfStorageKey\n fulfillmentHandlerCode\n handlerArgs\n myparcelShipmentId\n myparcelBarcode\n hendriksRemotePath\n items {\n id\n productVariant { id name sku }\n quantity\n receivedQuantity\n lostQuantity\n outstandingQuantity\n unitCost\n }\n totalLines\n totalQuantity\n totalReceivedQuantity\n totalLostQuantity\n }\n }\n";
|
|
507
680
|
export declare const STOCK_TRANSFER_RETURNS_QUERY = "\n query StockTransferReturns($id: ID!) {\n stockTransfer(id: $id) {\n returnOfTransferId\n returnOf { \n id\n code\n state\n label\n sourceLocation { id name }\n destinationLocation { id name }\n createdAt\n totalQuantity\n }\n returns { \n id\n code\n state\n label\n sourceLocation { id name }\n destinationLocation { id name }\n createdAt\n totalQuantity\n }\n returnableLines {\n productVariantId\n productVariant { name sku }\n receivedQuantity\n returnedQuantity\n returnableQuantity\n }\n }\n }\n";
|
|
508
681
|
/** The per-line settlement fields, in a document of their own like the return fields. */
|
|
509
682
|
export declare const STOCK_TRANSFER_SHORTFALL_QUERY = "\n query StockTransferShortfall($id: ID!) {\n stockTransfer(id: $id) {\n id\n state\n items {\n id\n productVariant { id sku }\n quantity\n receivedQuantity\n lostQuantity\n returnedToSourceQuantity\n outstandingQuantity\n }\n totalLostQuantity\n totalReturnedToSourceQuantity\n }\n }\n";
|