@deliverart/sdk-js-order 2.39.0 → 2.40.0-dev.1
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 +2 -0
- package/dist/index.cjs +48 -1
- package/dist/index.d.cts +13387 -1
- package/dist/index.d.ts +13387 -1
- package/dist/index.js +46 -1
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -1096,3 +1096,5 @@ unspecified provenance. A partner-only filter includes both groups.
|
|
|
1096
1096
|
The global-types package exports `orderSubPartnerSchema`, `OrderSubPartner`,
|
|
1097
1097
|
`orderSubPartnerLabels`, `getOrderSubPartners`, and `isOrderSubPartnerAllowed`.
|
|
1098
1098
|
These describe permitted identities, not the activation of a restaurant.
|
|
1099
|
+
|
|
1100
|
+
Manual Hub order creation supports `paymentAllocations` with two to five distinct `{ method, amount }` portions. Use positive decimal strings in POS currency minor units; the API requires the portions to exactly cover the calculated total and use completed local configurations. Selecting a method does not confirm receipt of money. Initial Stripe portions appear in settlement operations and expose their own Checkout link through payment information. Use `paymentSummary`, receipts and settlement operations for mixed orders; no singular original payment is returned. Partner and Storefront creation do not accept this input.
|
package/dist/index.cjs
CHANGED
|
@@ -217,6 +217,7 @@ __export(index_exports, {
|
|
|
217
217
|
getPointOfSaleOrdersInputSchema: () => getPointOfSaleOrdersInputSchema,
|
|
218
218
|
getPointOfSaleOrdersQuerySchema: () => getPointOfSaleOrdersQuerySchema,
|
|
219
219
|
getPointOfSaleOrdersResponseSchema: () => getPointOfSaleOrdersResponseSchema,
|
|
220
|
+
initialPaymentAllocationSchema: () => initialPaymentAllocationSchema,
|
|
220
221
|
isOrderSubPartnerAllowed: () => import_sdk_js_global_types31.isOrderSubPartnerAllowed,
|
|
221
222
|
kitchenOrderDetailsSchema: () => kitchenOrderDetailsSchema,
|
|
222
223
|
kitchenOrderSchema: () => kitchenOrderSchema,
|
|
@@ -282,6 +283,7 @@ __export(index_exports, {
|
|
|
282
283
|
orderMenuItemSchema: () => orderMenuItemSchema,
|
|
283
284
|
orderMenuItemsQuerySchema: () => orderMenuItemsQuerySchema,
|
|
284
285
|
orderNullableIriSchema: () => orderNullableIriSchema,
|
|
286
|
+
orderPaymentSummarySchema: () => orderPaymentSummarySchema,
|
|
285
287
|
orderPlanningModeSchema: () => import_sdk_js_global_types4.orderPlanningModeSchema,
|
|
286
288
|
orderPlanningModes: () => import_sdk_js_global_types4.orderPlanningModes,
|
|
287
289
|
orderPreparationStatusSchema: () => import_sdk_js_global_types4.orderPreparationStatusSchema,
|
|
@@ -634,6 +636,7 @@ var orderSettlementOperationSchema = import_zod4.z.object({
|
|
|
634
636
|
updatedAt: import_sdk_js_global_types2.datetimeSchema
|
|
635
637
|
});
|
|
636
638
|
var offlineSettlementFields = import_zod4.z.strictObject({
|
|
639
|
+
confirmedOutsideSystem: import_zod4.z.boolean().optional(),
|
|
637
640
|
instructionId: uuid3,
|
|
638
641
|
requestId: uuid3,
|
|
639
642
|
amount: import_zod4.z.string().regex(/^(?:0|[1-9][0-9]{0,5})(?:\.[0-9]{1,4})?$/).refine((value) => Number(value) > 0),
|
|
@@ -649,7 +652,8 @@ var recordOrderOfflineSettlementInputSchema = offlineSettlementFields.superRefin
|
|
|
649
652
|
);
|
|
650
653
|
var startOrderOnlineSettlementInputSchema = offlineSettlementFields.omit({
|
|
651
654
|
occurredAt: true,
|
|
652
|
-
reference: true
|
|
655
|
+
reference: true,
|
|
656
|
+
confirmedOutsideSystem: true
|
|
653
657
|
}).superRefine(
|
|
654
658
|
(value, context) => checkAmendmentReferenceAliases(value, context, ["sourcePayment", "paymentConfig"])
|
|
655
659
|
);
|
|
@@ -879,9 +883,34 @@ var normalizeOrderCustomerInfo = (value) => {
|
|
|
879
883
|
}
|
|
880
884
|
return value;
|
|
881
885
|
};
|
|
886
|
+
var orderPaymentSummarySchema = import_zod7.z.object({
|
|
887
|
+
kind: import_zod7.z.enum(["none", "single", "mixed", "unavailable"]),
|
|
888
|
+
complete: import_zod7.z.boolean(),
|
|
889
|
+
payments: import_zod7.z.array(
|
|
890
|
+
import_zod7.z.object({
|
|
891
|
+
id: import_zod7.z.string(),
|
|
892
|
+
method: import_sdk_js_payment.paymentMethodSchema,
|
|
893
|
+
amount: import_zod7.z.string(),
|
|
894
|
+
status: import_sdk_js_payment.paymentStatusSchema,
|
|
895
|
+
management: import_zod7.z.enum(["pos", "platform", "unknown"]),
|
|
896
|
+
collectingPlatform: import_zod7.z.string().nullable(),
|
|
897
|
+
ticketProvider: import_zod7.z.string().nullable()
|
|
898
|
+
})
|
|
899
|
+
),
|
|
900
|
+
legacyMethod: import_sdk_js_payment.paymentMethodSchema.nullable(),
|
|
901
|
+
legacyStatus: import_sdk_js_payment.paymentStatusSchema.nullable(),
|
|
902
|
+
reportedPortions: import_zod7.z.array(
|
|
903
|
+
import_zod7.z.object({
|
|
904
|
+
method: import_sdk_js_payment.paymentMethodSchema,
|
|
905
|
+
provider: import_zod7.z.string().nullable(),
|
|
906
|
+
amount: import_zod7.z.string().nullable()
|
|
907
|
+
})
|
|
908
|
+
)
|
|
909
|
+
});
|
|
882
910
|
var orderBaseSchema = import_zod7.z.object({
|
|
883
911
|
id: import_zod7.z.string(),
|
|
884
912
|
payment: import_sdk_js_payment.paymentNullableIriSchema,
|
|
913
|
+
paymentSummary: orderPaymentSummarySchema,
|
|
885
914
|
paymentMethod: import_sdk_js_payment.paymentMethodSchema.nullable(),
|
|
886
915
|
paymentStatus: import_sdk_js_payment.paymentStatusSchema.nullable(),
|
|
887
916
|
source: import_sdk_js_global_types4.orderSourceSchema,
|
|
@@ -1115,8 +1144,13 @@ var writableOrderMenuItemModifierSchema = import_zod7.z.lazy(
|
|
|
1115
1144
|
items: import_zod7.z.array(writableOrderMenuItemSchema)
|
|
1116
1145
|
})
|
|
1117
1146
|
);
|
|
1147
|
+
var initialPaymentAllocationSchema = import_zod7.z.strictObject({
|
|
1148
|
+
method: import_zod7.z.enum(["cash", "ticket", "credit_card", "bank_transfer", "stripe"]),
|
|
1149
|
+
amount: import_zod7.z.string().regex(/^[0-9]+(?:\.[0-9]{1,4})?$/).refine((value) => Number(value) > 0)
|
|
1150
|
+
});
|
|
1118
1151
|
var writableOrderBaseSchema = import_zod7.z.object({
|
|
1119
1152
|
pointOfSale: import_sdk_js_point_of_sale.pointOfSaleIriSchema,
|
|
1153
|
+
paymentAllocations: import_zod7.z.array(initialPaymentAllocationSchema).min(2).max(5).optional(),
|
|
1120
1154
|
customer: import_sdk_js_customer.customerNullableIriSchema.optional(),
|
|
1121
1155
|
source: import_sdk_js_global_types4.orderSourceSchema,
|
|
1122
1156
|
partner: import_sdk_js_global_types5.orderPartnerSchema.nullable().optional(),
|
|
@@ -1185,6 +1219,13 @@ var writableOrderSchema = import_zod7.z.discriminatedUnion("type", [
|
|
|
1185
1219
|
writableTakeAwayOrderSchema,
|
|
1186
1220
|
writableKitchenOrderSchema
|
|
1187
1221
|
]).superRefine((order, context) => {
|
|
1222
|
+
if (order.paymentAllocations && (order.source !== "application" || new Set(order.paymentAllocations.map((row) => row.method)).size !== order.paymentAllocations.length)) {
|
|
1223
|
+
context.addIssue({
|
|
1224
|
+
code: "custom",
|
|
1225
|
+
path: ["paymentAllocations"],
|
|
1226
|
+
message: "Initial portions require a manual order and distinct methods."
|
|
1227
|
+
});
|
|
1228
|
+
}
|
|
1188
1229
|
if (order.subPartner != null && (order.source !== "partner" || !(0, import_sdk_js_global_types5.isOrderSubPartnerAllowed)(order.partner, order.subPartner))) {
|
|
1189
1230
|
context.addIssue({
|
|
1190
1231
|
code: "custom",
|
|
@@ -2245,6 +2286,9 @@ var orderReceiptActionSchema = import_zod17.z.enum([
|
|
|
2245
2286
|
"collect"
|
|
2246
2287
|
]);
|
|
2247
2288
|
var orderReceiptFundingSchema = import_zod17.z.object({
|
|
2289
|
+
management: import_zod17.z.enum(["pos", "platform", "unknown"]),
|
|
2290
|
+
collectingPlatform: import_zod17.z.string().nullable(),
|
|
2291
|
+
blockedReason: import_zod17.z.enum(["platform_managed_payment", "historical_payment_management_unknown"]).nullable(),
|
|
2248
2292
|
id: uuid14,
|
|
2249
2293
|
method: import_sdk_js_global_types10.paymentMethodSchema,
|
|
2250
2294
|
status: import_zod17.z.enum(["pending", "pending_verification", "paid", "refunded", "failed", "canceled"]),
|
|
@@ -2275,6 +2319,7 @@ var orderReceiptsSchema = import_zod17.z.object({
|
|
|
2275
2319
|
journal: import_zod17.z.array(orderReceiptJournalSchema)
|
|
2276
2320
|
});
|
|
2277
2321
|
var recordOrderReceiptInputSchema = import_zod17.z.strictObject({
|
|
2322
|
+
confirmedOutsideSystem: import_zod17.z.boolean().optional(),
|
|
2278
2323
|
requestId: uuid14,
|
|
2279
2324
|
revision: import_zod17.z.number().int().positive(),
|
|
2280
2325
|
action: orderReceiptActionSchema,
|
|
@@ -4147,6 +4192,7 @@ var import_sdk_js_global_types31 = require("@deliverart/sdk-js-global-types");
|
|
|
4147
4192
|
getPointOfSaleOrdersInputSchema,
|
|
4148
4193
|
getPointOfSaleOrdersQuerySchema,
|
|
4149
4194
|
getPointOfSaleOrdersResponseSchema,
|
|
4195
|
+
initialPaymentAllocationSchema,
|
|
4150
4196
|
isOrderSubPartnerAllowed,
|
|
4151
4197
|
kitchenOrderDetailsSchema,
|
|
4152
4198
|
kitchenOrderSchema,
|
|
@@ -4212,6 +4258,7 @@ var import_sdk_js_global_types31 = require("@deliverart/sdk-js-global-types");
|
|
|
4212
4258
|
orderMenuItemSchema,
|
|
4213
4259
|
orderMenuItemsQuerySchema,
|
|
4214
4260
|
orderNullableIriSchema,
|
|
4261
|
+
orderPaymentSummarySchema,
|
|
4215
4262
|
orderPlanningModeSchema,
|
|
4216
4263
|
orderPlanningModes,
|
|
4217
4264
|
orderPreparationStatusSchema,
|