@jaicome/contracts 0.0.73 → 0.0.76
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/dist/fulfillment-states.d.mts +43 -3
- package/dist/fulfillment-states.mjs +67 -2
- package/dist/index.d.mts +2673 -317
- package/dist/index.mjs +450 -68
- package/dist/{orders-yFOPRYZw.d.mts → orders-CHXvc7L7.d.mts} +810 -255
- package/dist/payments-Qea5Yb_X.d.mts +387 -0
- package/dist/schema/index.d.mts +1266 -554
- package/dist/schema/index.mjs +2 -2
- package/dist/utils/payment-resolver.d.mts +87 -0
- package/dist/utils/payment-resolver.mjs +118 -0
- package/dist/{schema-0qCwa7QX.mjs → zatca-CEInGWOH.mjs} +761 -274
- package/package.json +9 -3
|
@@ -159,7 +159,7 @@ const translationFieldSchema = z.record(z.string(), z.string());
|
|
|
159
159
|
|
|
160
160
|
//#endregion
|
|
161
161
|
//#region src/schema/catalog.ts
|
|
162
|
-
const catalogAmountSchema = z.bigint();
|
|
162
|
+
const catalogAmountSchema = z.coerce.bigint();
|
|
163
163
|
const catalogAvailabilityValues = [
|
|
164
164
|
"AVAILABLE",
|
|
165
165
|
"SOLDOUT",
|
|
@@ -246,7 +246,10 @@ const catalogItemDetailSchema = z.object({
|
|
|
246
246
|
id: z.string(),
|
|
247
247
|
name: translationFieldSchema,
|
|
248
248
|
description: translationFieldSchema.nullish(),
|
|
249
|
-
|
|
249
|
+
images: z.array(z.object({
|
|
250
|
+
id: z.string(),
|
|
251
|
+
url: z.string()
|
|
252
|
+
})),
|
|
250
253
|
foodAndBeverageDetails: z.object({
|
|
251
254
|
calorie: z.number(),
|
|
252
255
|
ingredients: z.array(z.enum(catalogFoodIngredientValues)),
|
|
@@ -299,6 +302,7 @@ const catalogModifierFilterSchema = baseFilterSchema.extend({
|
|
|
299
302
|
const listCatalogModifiersInputSchema = baseListInputSchema(catalogModifierFilterSchema);
|
|
300
303
|
const listCatalogModifiersOutputSchema = baseListOutputSchema(catalogModifierBaseSchema);
|
|
301
304
|
const catalogModifierListFilterSchema = baseFilterSchema.extend({
|
|
305
|
+
merchantId: z.string().nullish(),
|
|
302
306
|
itemId: z.string().nullish(),
|
|
303
307
|
locationId: z.string().nullish(),
|
|
304
308
|
name: z.string().nullish(),
|
|
@@ -401,7 +405,8 @@ const updateItemInputSchema = z.object({
|
|
|
401
405
|
update: z.object({
|
|
402
406
|
name: z.record(z.string(), z.string()).nullish(),
|
|
403
407
|
description: z.record(z.string(), z.string()).nullish(),
|
|
404
|
-
availability: z.enum(catalogAvailabilityValues).nullish()
|
|
408
|
+
availability: z.enum(catalogAvailabilityValues).nullish(),
|
|
409
|
+
ordinal: z.number().int().nonnegative().nullish()
|
|
405
410
|
})
|
|
406
411
|
});
|
|
407
412
|
const updateItemOutputSchema = z.object({
|
|
@@ -545,7 +550,7 @@ const catalogModifierListDetailSchema = z.object({
|
|
|
545
550
|
const getModifierListOutputSchema = catalogModifierListDetailSchema;
|
|
546
551
|
const updateModifierInputSchema = z.object({
|
|
547
552
|
modifierId: z.string(),
|
|
548
|
-
name: z.string(),
|
|
553
|
+
name: z.record(z.string(), z.string()),
|
|
549
554
|
priceAmount: catalogAmountSchema,
|
|
550
555
|
onByDefault: z.boolean(),
|
|
551
556
|
ordinal: z.number().int().nonnegative().nullish(),
|
|
@@ -554,7 +559,7 @@ const updateModifierInputSchema = z.object({
|
|
|
554
559
|
const updateModifierOutputSchema = mutationIdOutputSchema;
|
|
555
560
|
const updateModifierListInputSchema = z.object({
|
|
556
561
|
modifierListId: z.string(),
|
|
557
|
-
name: z.string(),
|
|
562
|
+
name: z.record(z.string(), z.string()),
|
|
558
563
|
selectionType: z.enum(catalogSelectionTypeValues),
|
|
559
564
|
ordinal: z.number().int().nonnegative().nullish(),
|
|
560
565
|
merchantId: z.string().optional()
|
|
@@ -800,7 +805,7 @@ const discountBaseSchema = z.object({
|
|
|
800
805
|
itemIds: z.array(z.string().uuid()).default([]),
|
|
801
806
|
categoryIds: z.array(z.string().uuid()).default([])
|
|
802
807
|
});
|
|
803
|
-
const ensureTargets = (data, ctx) => {
|
|
808
|
+
const ensureTargets$2 = (data, ctx) => {
|
|
804
809
|
if (data.autoApplyScope === "SELECTED_ITEMS" && (!data.itemIds || data.itemIds.length === 0)) ctx.addIssue({
|
|
805
810
|
code: z.ZodIssueCode.custom,
|
|
806
811
|
path: ["itemIds"],
|
|
@@ -827,7 +832,7 @@ const discountCoreSchema = z.object({
|
|
|
827
832
|
categoryIds: z.array(z.string().uuid()).nullish()
|
|
828
833
|
});
|
|
829
834
|
const createDiscountInputSchema = discountCoreSchema.superRefine((data, ctx) => {
|
|
830
|
-
ensureTargets(data, ctx);
|
|
835
|
+
ensureTargets$2(data, ctx);
|
|
831
836
|
if (data.discountType === "PERCENTAGE" && data.value > 100) ctx.addIssue({
|
|
832
837
|
code: z.ZodIssueCode.custom,
|
|
833
838
|
path: ["value"],
|
|
@@ -835,7 +840,7 @@ const createDiscountInputSchema = discountCoreSchema.superRefine((data, ctx) =>
|
|
|
835
840
|
});
|
|
836
841
|
});
|
|
837
842
|
const updateDiscountPatchSchema = discountCoreSchema.partial().superRefine((data, ctx) => {
|
|
838
|
-
ensureTargets(data, ctx);
|
|
843
|
+
ensureTargets$2(data, ctx);
|
|
839
844
|
if ((data.discountType === "PERCENTAGE" || !data.discountType) && typeof data.value === "number" && data.value > 100) ctx.addIssue({
|
|
840
845
|
code: z.ZodIssueCode.custom,
|
|
841
846
|
path: ["value"],
|
|
@@ -1027,13 +1032,13 @@ const merchantBaseSchema = z.object({
|
|
|
1027
1032
|
id: z.uuid(),
|
|
1028
1033
|
name: translationFieldSchema,
|
|
1029
1034
|
description: translationFieldSchema,
|
|
1030
|
-
slug: z.string(),
|
|
1035
|
+
slug: z.string().nullable(),
|
|
1031
1036
|
ownerId: z.string(),
|
|
1032
1037
|
country: z.string(),
|
|
1033
|
-
businessEmail: z.string(),
|
|
1034
|
-
phoneNumber: z.string(),
|
|
1035
|
-
logoUrl: z.string(),
|
|
1036
|
-
bannerUrl: z.string(),
|
|
1038
|
+
businessEmail: z.string().nullable(),
|
|
1039
|
+
phoneNumber: z.string().nullable(),
|
|
1040
|
+
logoUrl: z.string().nullable(),
|
|
1041
|
+
bannerUrl: z.string().nullable(),
|
|
1037
1042
|
createdAt: z.date(),
|
|
1038
1043
|
updatedAt: z.date()
|
|
1039
1044
|
});
|
|
@@ -1049,21 +1054,16 @@ const createMerchantInputSchema = z.object({
|
|
|
1049
1054
|
const merchantIntegrationSchema = z.object({
|
|
1050
1055
|
id: z.uuid(),
|
|
1051
1056
|
merchantId: z.uuid(),
|
|
1052
|
-
accountId: z.string(),
|
|
1053
1057
|
provider: z.string(),
|
|
1054
1058
|
createdAt: z.date(),
|
|
1055
1059
|
updatedAt: z.date()
|
|
1056
1060
|
});
|
|
1057
1061
|
const merchantLegalDetailsSchema = z.object({
|
|
1058
|
-
id: z.uuid(),
|
|
1059
|
-
merchantId: z.uuid(),
|
|
1060
1062
|
CRNNumber: z.string(),
|
|
1061
1063
|
VATName: z.string().nullable(),
|
|
1062
1064
|
VATNumber: z.string().nullable(),
|
|
1063
1065
|
crnDocUrl: z.string().nullable(),
|
|
1064
|
-
vatDocUrl: z.string().nullable()
|
|
1065
|
-
createdAt: z.date(),
|
|
1066
|
-
updatedAt: z.date()
|
|
1066
|
+
vatDocUrl: z.string().nullable()
|
|
1067
1067
|
});
|
|
1068
1068
|
const merchantFullDetailsSchema = z.object({
|
|
1069
1069
|
id: z.uuid(),
|
|
@@ -1099,18 +1099,11 @@ const merchantSummarySchema = z.object({
|
|
|
1099
1099
|
});
|
|
1100
1100
|
const merchantSyncEventSchema = z.object({ message: z.string() });
|
|
1101
1101
|
const merchantIdInputSchema = z.object({ merchantId: z.string() });
|
|
1102
|
+
const getMerchantInputSchema = z.object({ merchantId: z.string().optional() });
|
|
1102
1103
|
const createMerchantOutputSchema = z.object({
|
|
1103
1104
|
merchantId: z.string(),
|
|
1104
1105
|
userId: z.string()
|
|
1105
1106
|
});
|
|
1106
|
-
const linkSquareIntegrationInputSchema = z.object({
|
|
1107
|
-
redirectUrl: z.string(),
|
|
1108
|
-
userId: z.string().nullish()
|
|
1109
|
-
});
|
|
1110
|
-
const linkSquareIntegrationOutputSchema = z.object({
|
|
1111
|
-
url: z.string(),
|
|
1112
|
-
redirect: z.boolean().default(true)
|
|
1113
|
-
});
|
|
1114
1107
|
const merchantFilterSchema = baseFilterSchema.extend({
|
|
1115
1108
|
name: z.string().nullish(),
|
|
1116
1109
|
businessEmail: z.string().nullish(),
|
|
@@ -1122,35 +1115,42 @@ const merchantListItemSchema = z.object({
|
|
|
1122
1115
|
name: translationFieldSchema,
|
|
1123
1116
|
businessEmail: z.string().nullable(),
|
|
1124
1117
|
phoneNumber: z.string().nullable(),
|
|
1118
|
+
logoUrl: z.string().nullable(),
|
|
1125
1119
|
country: z.string(),
|
|
1126
1120
|
createdAt: z.date()
|
|
1127
1121
|
});
|
|
1128
1122
|
const listMerchantsOutputSchema = baseListOutputSchema(merchantListItemSchema);
|
|
1129
|
-
const
|
|
1130
|
-
merchantId: z.uuid(),
|
|
1131
|
-
CRNNumber: z.string().min(1),
|
|
1132
|
-
VATName: z.string().optional(),
|
|
1133
|
-
VATNumber: z.string().optional(),
|
|
1134
|
-
crnDoc: z.instanceof(File).optional(),
|
|
1135
|
-
vatDoc: z.instanceof(File).optional()
|
|
1136
|
-
});
|
|
1137
|
-
const updateMerchantLegalDetailsInputSchema = z.object({
|
|
1138
|
-
merchantId: z.uuid(),
|
|
1139
|
-
legalDetailsId: z.uuid(),
|
|
1140
|
-
CRNNumber: z.string().min(1).optional(),
|
|
1141
|
-
VATName: z.string().optional(),
|
|
1142
|
-
VATNumber: z.string().optional(),
|
|
1143
|
-
crnDoc: z.instanceof(File).nullable().optional(),
|
|
1144
|
-
vatDoc: z.instanceof(File).nullable().optional()
|
|
1145
|
-
});
|
|
1146
|
-
const uploadCrnDocumentInputSchema = z.object({
|
|
1123
|
+
const uploadMerchantCrnDocInputSchema = z.object({
|
|
1147
1124
|
merchantId: z.uuid(),
|
|
1148
1125
|
crnDoc: z.instanceof(File)
|
|
1149
1126
|
});
|
|
1150
|
-
const
|
|
1127
|
+
const uploadMerchantVatDocInputSchema = z.object({
|
|
1151
1128
|
merchantId: z.uuid(),
|
|
1152
1129
|
vatDoc: z.instanceof(File)
|
|
1153
1130
|
});
|
|
1131
|
+
const updateMerchantInputSchema = z.object({
|
|
1132
|
+
merchantId: z.uuid(),
|
|
1133
|
+
name: translationFieldSchema.optional(),
|
|
1134
|
+
description: translationFieldSchema.nullable().optional(),
|
|
1135
|
+
businessEmail: z.string().email().optional(),
|
|
1136
|
+
phoneNumber: z.string().optional(),
|
|
1137
|
+
logo: z.instanceof(File).nullable().optional(),
|
|
1138
|
+
banner: z.instanceof(File).nullable().optional(),
|
|
1139
|
+
legalDetails: z.object({
|
|
1140
|
+
CRNNumber: z.string().min(1).optional(),
|
|
1141
|
+
VATName: z.string().nullable().optional(),
|
|
1142
|
+
VATNumber: z.string().nullable().optional()
|
|
1143
|
+
}).nullable().optional()
|
|
1144
|
+
});
|
|
1145
|
+
const deleteMerchantAccountInputSchema = z.object({
|
|
1146
|
+
password: z.string().min(1),
|
|
1147
|
+
confirmSoftDelete: z.literal(true)
|
|
1148
|
+
});
|
|
1149
|
+
const deleteMerchantAccountOutputSchema = z.object({
|
|
1150
|
+
success: z.literal(true),
|
|
1151
|
+
merchantId: z.uuid(),
|
|
1152
|
+
deletedAt: z.date()
|
|
1153
|
+
});
|
|
1154
1154
|
|
|
1155
1155
|
//#endregion
|
|
1156
1156
|
//#region src/schema/leads.ts
|
|
@@ -1166,7 +1166,7 @@ const preferredContactTimeSchema = z.enum([
|
|
|
1166
1166
|
* Input schema for creating a lead as admin
|
|
1167
1167
|
* Includes all merchant creation fields plus lead-specific fields
|
|
1168
1168
|
*/
|
|
1169
|
-
const
|
|
1169
|
+
const createLeadInputSchema = createMerchantInputSchema.extend({
|
|
1170
1170
|
services: z.array(z.string()).default([]),
|
|
1171
1171
|
preferredContactTime: preferredContactTimeSchema
|
|
1172
1172
|
});
|
|
@@ -1174,7 +1174,7 @@ const createLeadForAdminInputSchema = createMerchantInputSchema.extend({
|
|
|
1174
1174
|
* Output schema for lead creation
|
|
1175
1175
|
* Returns the created merchant and optional CRM lead ID
|
|
1176
1176
|
*/
|
|
1177
|
-
const
|
|
1177
|
+
const createLeadOutputSchema = z.object({
|
|
1178
1178
|
merchant: merchantFullDetailsSchema,
|
|
1179
1179
|
crmLeadId: z.string().nullable()
|
|
1180
1180
|
});
|
|
@@ -1184,15 +1184,15 @@ const createLeadForAdminOutputSchema = z.object({
|
|
|
1184
1184
|
/**
|
|
1185
1185
|
* Payment Method: What the user/customer chooses to pay with (user-facing).
|
|
1186
1186
|
* - COD: Cash on Delivery/Pickup
|
|
1187
|
-
* -
|
|
1187
|
+
* - ONLINE: Online card payment
|
|
1188
1188
|
*/
|
|
1189
|
-
const paymentMethodIds = ["COD", "
|
|
1189
|
+
const paymentMethodIds = ["COD", "ONLINE"];
|
|
1190
1190
|
/**
|
|
1191
1191
|
* Accepted Payments: Payment methods a location/fulfillment accepts.
|
|
1192
1192
|
* Used in fulfillment configuration (pickup, delivery, dinein, curbside).
|
|
1193
|
-
* Must always be COD and/or
|
|
1193
|
+
* Must always be COD and/or ONLINE - no legacy CASH values.
|
|
1194
1194
|
*/
|
|
1195
|
-
const acceptedPaymentIds = ["COD", "
|
|
1195
|
+
const acceptedPaymentIds = ["COD", "ONLINE"];
|
|
1196
1196
|
/**
|
|
1197
1197
|
* Payment Gateway: Which backend processor handled the payment (backend/storage).
|
|
1198
1198
|
* - MOYASAR: Moyasar payment gateway
|
|
@@ -1200,9 +1200,155 @@ const acceptedPaymentIds = ["COD", "CARD"];
|
|
|
1200
1200
|
*/
|
|
1201
1201
|
const paymentGatewayIds = ["MOYASAR"];
|
|
1202
1202
|
|
|
1203
|
+
//#endregion
|
|
1204
|
+
//#region src/schema/payments.ts
|
|
1205
|
+
const gatewayIds = paymentGatewayIds;
|
|
1206
|
+
const paymentStatuses = [
|
|
1207
|
+
"INITIATED",
|
|
1208
|
+
"PAID",
|
|
1209
|
+
"AUTHORIZED",
|
|
1210
|
+
"FAILED",
|
|
1211
|
+
"REFUNDED",
|
|
1212
|
+
"CAPTURED",
|
|
1213
|
+
"VOIDED",
|
|
1214
|
+
"VERIFIED"
|
|
1215
|
+
];
|
|
1216
|
+
const initiatePaymentInputSchema = z.object({
|
|
1217
|
+
entities: z.object({
|
|
1218
|
+
merchantId: z.string(),
|
|
1219
|
+
customerId: z.string()
|
|
1220
|
+
}),
|
|
1221
|
+
payment: z.object({
|
|
1222
|
+
method: z.enum(paymentMethodIds),
|
|
1223
|
+
orderId: z.string(),
|
|
1224
|
+
amount: z.number(),
|
|
1225
|
+
currency: z.string(),
|
|
1226
|
+
description: z.string(),
|
|
1227
|
+
language: z.string(),
|
|
1228
|
+
metadata: z.record(z.string(), z.unknown()),
|
|
1229
|
+
success_url: z.string()
|
|
1230
|
+
}),
|
|
1231
|
+
metadata: z.record(z.string(), z.unknown()).nullish()
|
|
1232
|
+
});
|
|
1233
|
+
const initiatePaymentOutputSchema = z.object({ url: z.string() });
|
|
1234
|
+
const paymentSourceSchema = z.object({
|
|
1235
|
+
type: z.string().optional(),
|
|
1236
|
+
company: z.string().optional(),
|
|
1237
|
+
entryMethod: z.string().optional(),
|
|
1238
|
+
card: z.object({
|
|
1239
|
+
bin: z.string().optional(),
|
|
1240
|
+
expMonth: z.number().optional(),
|
|
1241
|
+
expYear: z.number().optional(),
|
|
1242
|
+
fingerprint: z.string().optional(),
|
|
1243
|
+
last4: z.string().optional()
|
|
1244
|
+
}).optional(),
|
|
1245
|
+
digitalWalletDetails: z.object({
|
|
1246
|
+
type: z.string().optional(),
|
|
1247
|
+
brand: z.string().optional(),
|
|
1248
|
+
applicationDetails: z.unknown().optional()
|
|
1249
|
+
}).optional(),
|
|
1250
|
+
receivedMoney: z.unknown().optional(),
|
|
1251
|
+
changeMoney: z.unknown().optional()
|
|
1252
|
+
});
|
|
1253
|
+
const recordPaymentInputSchema = z.object({
|
|
1254
|
+
merchantId: z.string(),
|
|
1255
|
+
orderId: z.string(),
|
|
1256
|
+
payment: z.object({
|
|
1257
|
+
paymentId: z.string(),
|
|
1258
|
+
amount: z.number(),
|
|
1259
|
+
currency: z.string(),
|
|
1260
|
+
fee: z.number(),
|
|
1261
|
+
status: z.enum(paymentStatuses),
|
|
1262
|
+
gateway: z.enum(gatewayIds).nullable(),
|
|
1263
|
+
source: paymentSourceSchema,
|
|
1264
|
+
metadata: z.unknown(),
|
|
1265
|
+
ip: z.string().optional()
|
|
1266
|
+
})
|
|
1267
|
+
});
|
|
1268
|
+
const refundPaymentInputSchema = z.object({
|
|
1269
|
+
paymentId: z.string(),
|
|
1270
|
+
amount: z.number()
|
|
1271
|
+
});
|
|
1272
|
+
const paymentOutputSchema = z.object({
|
|
1273
|
+
id: z.string(),
|
|
1274
|
+
amount: z.number(),
|
|
1275
|
+
currency: z.string(),
|
|
1276
|
+
fee: z.number(),
|
|
1277
|
+
status: z.enum(paymentStatuses),
|
|
1278
|
+
gateway: z.enum(gatewayIds).nullable(),
|
|
1279
|
+
source: paymentSourceSchema,
|
|
1280
|
+
metadata: z.record(z.string(), z.unknown()).nullish(),
|
|
1281
|
+
ip: z.string().nullish(),
|
|
1282
|
+
orderId: z.string().uuid().nullish(),
|
|
1283
|
+
createdAt: z.date(),
|
|
1284
|
+
updatedAt: z.date()
|
|
1285
|
+
});
|
|
1286
|
+
const paymentListItemSchema = z.object({
|
|
1287
|
+
id: z.string(),
|
|
1288
|
+
amount: z.number(),
|
|
1289
|
+
currency: z.string(),
|
|
1290
|
+
fee: z.number(),
|
|
1291
|
+
status: z.enum(paymentStatuses),
|
|
1292
|
+
gateway: z.enum(gatewayIds).nullable(),
|
|
1293
|
+
source: paymentSourceSchema,
|
|
1294
|
+
orderId: z.string().uuid().nullish(),
|
|
1295
|
+
createdAt: z.date()
|
|
1296
|
+
});
|
|
1297
|
+
const paymentFilterSchema = z.object({
|
|
1298
|
+
merchantId: z.uuid().nullish(),
|
|
1299
|
+
locationId: z.uuid().nullish(),
|
|
1300
|
+
orderId: z.uuid().nullish(),
|
|
1301
|
+
status: z.enum(paymentStatuses).nullish(),
|
|
1302
|
+
gateway: z.enum(gatewayIds).nullable().nullish(),
|
|
1303
|
+
startTime: z.coerce.date().nullish(),
|
|
1304
|
+
endTime: z.coerce.date().nullish()
|
|
1305
|
+
});
|
|
1306
|
+
const listPaymentsInputSchema = z.object({
|
|
1307
|
+
pagination: z.object({
|
|
1308
|
+
page: z.number().min(1).default(1),
|
|
1309
|
+
pageSize: z.number().min(1).max(100).default(20)
|
|
1310
|
+
}).optional().default({
|
|
1311
|
+
page: 1,
|
|
1312
|
+
pageSize: 20
|
|
1313
|
+
}),
|
|
1314
|
+
filter: paymentFilterSchema.optional(),
|
|
1315
|
+
sort: z.record(z.string(), z.enum(["asc", "desc"])).optional()
|
|
1316
|
+
});
|
|
1317
|
+
const listPaymentsOutputSchema = z.object({
|
|
1318
|
+
items: z.array(paymentListItemSchema),
|
|
1319
|
+
pagination: z.object({
|
|
1320
|
+
page: z.number(),
|
|
1321
|
+
pageSize: z.number(),
|
|
1322
|
+
totalItems: z.number(),
|
|
1323
|
+
totalPages: z.number()
|
|
1324
|
+
})
|
|
1325
|
+
});
|
|
1326
|
+
const getPaymentInputSchema = z.object({ paymentId: z.uuid() });
|
|
1327
|
+
const refundOrderInputSchema = z.object({
|
|
1328
|
+
orderId: z.uuid(),
|
|
1329
|
+
amount: z.number().optional()
|
|
1330
|
+
});
|
|
1331
|
+
const refundOrderOutputSchema = z.object({
|
|
1332
|
+
orderId: z.string(),
|
|
1333
|
+
refundInitiated: z.boolean(),
|
|
1334
|
+
paymentIds: z.array(z.string()),
|
|
1335
|
+
message: z.string()
|
|
1336
|
+
});
|
|
1337
|
+
/** Payment types for COD (Cash on Delivery) orders. */
|
|
1338
|
+
const codPaymentTypeIds = ["CASH", "ONLINE"];
|
|
1339
|
+
/** Mark a COD payment as paid. */
|
|
1340
|
+
const setPaidInputSchema = z.object({
|
|
1341
|
+
paymentId: z.uuid(),
|
|
1342
|
+
type: z.enum(codPaymentTypeIds).optional()
|
|
1343
|
+
});
|
|
1344
|
+
const setPaidOutputSchema = z.object({
|
|
1345
|
+
success: z.boolean(),
|
|
1346
|
+
payment: paymentOutputSchema
|
|
1347
|
+
});
|
|
1348
|
+
|
|
1203
1349
|
//#endregion
|
|
1204
1350
|
//#region src/schema/promocodes.ts
|
|
1205
|
-
const promoCodeAmountSchema = z.bigint();
|
|
1351
|
+
const promoCodeAmountSchema = z.coerce.bigint();
|
|
1206
1352
|
const promoCodeScopes = ["APP", "LOCATION"];
|
|
1207
1353
|
const promoCodeDiscountTypes = ["PERCENTAGE", "FIXED_AMOUNT"];
|
|
1208
1354
|
const promoCodeApplicationTargets = [
|
|
@@ -1216,7 +1362,7 @@ const promoCodeConfigurationSchema = z.object({
|
|
|
1216
1362
|
usageLimit: z.number().int().positive().nullish(),
|
|
1217
1363
|
applyOn: z.array(z.enum(promoCodeApplicationTargets)).nullish(),
|
|
1218
1364
|
minOrderAmount: promoCodeAmountSchema.nullish(),
|
|
1219
|
-
maxDiscountAmount: z.number().int().positive().
|
|
1365
|
+
maxDiscountAmount: z.number().int().positive().nullish()
|
|
1220
1366
|
}).partial();
|
|
1221
1367
|
const promoCodeBaseSchema = z.object({
|
|
1222
1368
|
id: z.uuid(),
|
|
@@ -1255,15 +1401,10 @@ const createPromoCodeInputSchema = promoCodeCoreSchema.superRefine((data, ctx) =
|
|
|
1255
1401
|
path: ["locationId"],
|
|
1256
1402
|
message: "locationId is required for location scoped promo codes"
|
|
1257
1403
|
});
|
|
1258
|
-
if (data.discountType === "PERCENTAGE" && data.value >
|
|
1259
|
-
code: z.ZodIssueCode.custom,
|
|
1260
|
-
path: ["value"],
|
|
1261
|
-
message: "Percentage discounts cannot exceed 25%"
|
|
1262
|
-
});
|
|
1263
|
-
if (data.discountType === "FIXED_AMOUNT" && data.value > 25) ctx.addIssue({
|
|
1404
|
+
if (data.discountType === "PERCENTAGE" && data.value > 100) ctx.addIssue({
|
|
1264
1405
|
code: z.ZodIssueCode.custom,
|
|
1265
1406
|
path: ["value"],
|
|
1266
|
-
message: "
|
|
1407
|
+
message: "Percentage discounts cannot exceed 100%"
|
|
1267
1408
|
});
|
|
1268
1409
|
if (data.startsAt && data.expiresAt && data.expiresAt < data.startsAt) ctx.addIssue({
|
|
1269
1410
|
code: z.ZodIssueCode.custom,
|
|
@@ -1277,15 +1418,10 @@ const updatePromoCodePatchSchema = promoCodeCoreSchema.partial().superRefine((da
|
|
|
1277
1418
|
path: ["locationId"],
|
|
1278
1419
|
message: "locationId must be provided when changing scope to LOCATION"
|
|
1279
1420
|
});
|
|
1280
|
-
if ((data.discountType === "PERCENTAGE" || !data.discountType) && typeof data.value === "number" && data.value >
|
|
1281
|
-
code: z.ZodIssueCode.custom,
|
|
1282
|
-
path: ["value"],
|
|
1283
|
-
message: "Percentage discounts cannot exceed 25%"
|
|
1284
|
-
});
|
|
1285
|
-
if ((data.discountType === "FIXED_AMOUNT" || !data.discountType) && typeof data.value === "number" && data.value > 25) ctx.addIssue({
|
|
1421
|
+
if ((data.discountType === "PERCENTAGE" || !data.discountType) && typeof data.value === "number" && data.value > 100) ctx.addIssue({
|
|
1286
1422
|
code: z.ZodIssueCode.custom,
|
|
1287
1423
|
path: ["value"],
|
|
1288
|
-
message: "
|
|
1424
|
+
message: "Percentage discounts cannot exceed 100%"
|
|
1289
1425
|
});
|
|
1290
1426
|
if (data.startsAt && data.expiresAt && data.expiresAt < data.startsAt) ctx.addIssue({
|
|
1291
1427
|
code: z.ZodIssueCode.custom,
|
|
@@ -1327,7 +1463,7 @@ const defaultPromoCodeSort = defaultTimeSort;
|
|
|
1327
1463
|
|
|
1328
1464
|
//#endregion
|
|
1329
1465
|
//#region src/schema/orders.ts
|
|
1330
|
-
const orderAmountSchema = z.bigint();
|
|
1466
|
+
const orderAmountSchema = z.coerce.bigint();
|
|
1331
1467
|
const orderFulfillmentStateValues = [
|
|
1332
1468
|
"NEW",
|
|
1333
1469
|
"AWAITING_DELIVERY",
|
|
@@ -1410,6 +1546,14 @@ const orderFulfillmentSchema = z.discriminatedUnion("type", [
|
|
|
1410
1546
|
tableNumber: z.string()
|
|
1411
1547
|
})
|
|
1412
1548
|
]);
|
|
1549
|
+
const orderFulfillmentHistorySchema = z.object({
|
|
1550
|
+
id: z.string(),
|
|
1551
|
+
fulfillmentId: z.string(),
|
|
1552
|
+
oldState: z.enum(orderFulfillmentStateValues).nullish(),
|
|
1553
|
+
newState: z.enum(orderFulfillmentStateValues),
|
|
1554
|
+
version: z.number(),
|
|
1555
|
+
createdAt: z.coerce.date()
|
|
1556
|
+
});
|
|
1413
1557
|
const orderFulfillmentOutputSchema = z.discriminatedUnion("type", [
|
|
1414
1558
|
z.object({
|
|
1415
1559
|
type: z.literal("DELIVERY"),
|
|
@@ -1420,32 +1564,28 @@ const orderFulfillmentOutputSchema = z.discriminatedUnion("type", [
|
|
|
1420
1564
|
}),
|
|
1421
1565
|
customerAddress: z.string(),
|
|
1422
1566
|
duration: z.number(),
|
|
1423
|
-
distance: z.number()
|
|
1567
|
+
distance: z.number(),
|
|
1568
|
+
history: z.array(orderFulfillmentHistorySchema).default([])
|
|
1424
1569
|
}),
|
|
1425
1570
|
z.object({
|
|
1426
1571
|
type: z.literal("PICKUP"),
|
|
1427
|
-
state: z.enum(orderFulfillmentStateValues)
|
|
1572
|
+
state: z.enum(orderFulfillmentStateValues),
|
|
1573
|
+
history: z.array(orderFulfillmentHistorySchema).default([])
|
|
1428
1574
|
}),
|
|
1429
1575
|
z.object({
|
|
1430
1576
|
type: z.literal("CURBSIDE"),
|
|
1431
1577
|
state: z.enum(orderFulfillmentStateValues),
|
|
1432
1578
|
carPlateNumber: z.string(),
|
|
1433
|
-
parkingNumber: z.string().nullish()
|
|
1579
|
+
parkingNumber: z.string().nullish(),
|
|
1580
|
+
history: z.array(orderFulfillmentHistorySchema).default([])
|
|
1434
1581
|
}),
|
|
1435
1582
|
z.object({
|
|
1436
1583
|
type: z.literal("DINEIN"),
|
|
1437
1584
|
state: z.enum(orderFulfillmentStateValues),
|
|
1438
|
-
tableNumber: z.string()
|
|
1585
|
+
tableNumber: z.string(),
|
|
1586
|
+
history: z.array(orderFulfillmentHistorySchema).default([])
|
|
1439
1587
|
})
|
|
1440
1588
|
]);
|
|
1441
|
-
const orderFulfillmentHistorySchema = z.object({
|
|
1442
|
-
id: z.string(),
|
|
1443
|
-
fulfillmentId: z.string(),
|
|
1444
|
-
oldState: z.enum(orderFulfillmentStateValues).nullish(),
|
|
1445
|
-
newState: z.enum(orderFulfillmentStateValues),
|
|
1446
|
-
version: z.number(),
|
|
1447
|
-
createdAt: z.date()
|
|
1448
|
-
});
|
|
1449
1589
|
const orderModifierSchema = z.object({
|
|
1450
1590
|
id: z.string(),
|
|
1451
1591
|
quantity: z.number()
|
|
@@ -1476,7 +1616,10 @@ const orderLineItemSchema = z.object({
|
|
|
1476
1616
|
quantity: z.number()
|
|
1477
1617
|
}).array().nullish(),
|
|
1478
1618
|
totalAmount: orderAmountSchema,
|
|
1479
|
-
note: z.string().nullish()
|
|
1619
|
+
note: z.string().nullish(),
|
|
1620
|
+
categoryIds: z.array(z.string()).nullish(),
|
|
1621
|
+
itemId: z.string().nullish(),
|
|
1622
|
+
variationId: z.string().nullish()
|
|
1480
1623
|
});
|
|
1481
1624
|
const orderPromocodeSummarySchema = z.object({
|
|
1482
1625
|
valid: z.boolean(),
|
|
@@ -1507,7 +1650,9 @@ const orderSchema = z.object({
|
|
|
1507
1650
|
customer: orderCustomerSchema.nullish(),
|
|
1508
1651
|
lineItems: orderLineItemSchema.array(),
|
|
1509
1652
|
fulfillments: orderFulfillmentOutputSchema.array(),
|
|
1510
|
-
|
|
1653
|
+
paymentSource: paymentSourceSchema.nullish(),
|
|
1654
|
+
paymentStatus: z.enum(paymentStatuses).nullish(),
|
|
1655
|
+
paymentMethod: z.enum(paymentMethodIds).nullish(),
|
|
1511
1656
|
taxes: z.object({
|
|
1512
1657
|
id: z.string().nullish(),
|
|
1513
1658
|
catalogObjectId: z.string().nullish(),
|
|
@@ -1527,8 +1672,8 @@ const orderSchema = z.object({
|
|
|
1527
1672
|
type: z.string().nullish(),
|
|
1528
1673
|
scope: z.string().nullish()
|
|
1529
1674
|
}).array().nullish(),
|
|
1530
|
-
createdAt: z.date(),
|
|
1531
|
-
updatedAt: z.date(),
|
|
1675
|
+
createdAt: z.coerce.date(),
|
|
1676
|
+
updatedAt: z.coerce.date(),
|
|
1532
1677
|
discountAmount: orderAmountSchema.default(0n),
|
|
1533
1678
|
subtotalAmount: orderAmountSchema.default(0n),
|
|
1534
1679
|
taxAmount: orderAmountSchema.default(0n),
|
|
@@ -1561,8 +1706,7 @@ const orderSchema = z.object({
|
|
|
1561
1706
|
metadata: z.record(z.string(), z.any()).nullish(),
|
|
1562
1707
|
promocode: orderPromocodeSummarySchema.nullish(),
|
|
1563
1708
|
paymentIds: z.array(z.uuid()),
|
|
1564
|
-
source: orderSourceSchema.nullish()
|
|
1565
|
-
fulfillmentHistory: orderFulfillmentHistorySchema.array().default([])
|
|
1709
|
+
source: orderSourceSchema.nullish()
|
|
1566
1710
|
});
|
|
1567
1711
|
const orderEntitiesSchema = z.object({ merchantId: z.string() });
|
|
1568
1712
|
const orderConfigSchema = z.object({
|
|
@@ -1588,7 +1732,8 @@ const createOrderInputSchema = z.object({
|
|
|
1588
1732
|
lineItems: z.array(orderLineItemInputSchema),
|
|
1589
1733
|
note: z.string().nullish(),
|
|
1590
1734
|
fulfillment: orderFulfillmentSchema,
|
|
1591
|
-
|
|
1735
|
+
paymentSource: paymentSourceSchema.nullish(),
|
|
1736
|
+
paymentMethod: z.enum(paymentMethodIds).nullish(),
|
|
1592
1737
|
metadata: z.record(z.string(), z.any()).nullish(),
|
|
1593
1738
|
successUrl: z.string(),
|
|
1594
1739
|
promocode: orderPromocodeInputSchema.nullish()
|
|
@@ -1626,7 +1771,7 @@ const orderFilterSchema = baseFilterSchema.extend({
|
|
|
1626
1771
|
customerId: z.uuid().nullish(),
|
|
1627
1772
|
fulfillmentState: z.enum(orderFulfillmentStateValues).nullish(),
|
|
1628
1773
|
fulfillmentType: z.enum(orderFulfillmentTypes).nullish(),
|
|
1629
|
-
|
|
1774
|
+
paymentStatus: z.enum(paymentStatuses).nullish(),
|
|
1630
1775
|
coordinates: z.object({
|
|
1631
1776
|
latitude: z.number(),
|
|
1632
1777
|
longitude: z.number()
|
|
@@ -1640,7 +1785,9 @@ const orderSummarySchema = z.object({
|
|
|
1640
1785
|
locationId: z.string(),
|
|
1641
1786
|
customerId: z.string().nullish(),
|
|
1642
1787
|
customerName: z.string().nullish(),
|
|
1643
|
-
|
|
1788
|
+
paymentSource: paymentSourceSchema.nullish(),
|
|
1789
|
+
paymentStatus: z.enum(paymentStatuses).nullish(),
|
|
1790
|
+
paymentMethod: z.enum(paymentMethodIds).nullish(),
|
|
1644
1791
|
paymentIds: z.array(z.uuid()),
|
|
1645
1792
|
currency: z.string(),
|
|
1646
1793
|
totalAmount: orderAmountSchema,
|
|
@@ -1650,8 +1797,8 @@ const orderSummarySchema = z.object({
|
|
|
1650
1797
|
serviceChargeAmount: orderAmountSchema.nullish(),
|
|
1651
1798
|
tipAmount: orderAmountSchema.nullish(),
|
|
1652
1799
|
amountDue: orderAmountSchema.nullish(),
|
|
1653
|
-
createdAt: z.date(),
|
|
1654
|
-
updatedAt: z.date(),
|
|
1800
|
+
createdAt: z.coerce.date(),
|
|
1801
|
+
updatedAt: z.coerce.date(),
|
|
1655
1802
|
fulfillmentState: z.enum(orderFulfillmentStateValues).nullish(),
|
|
1656
1803
|
fulfillmentType: z.enum(orderFulfillmentTypes).nullish(),
|
|
1657
1804
|
source: orderSourceSchema.nullish()
|
|
@@ -1773,7 +1920,7 @@ const createDeliveryConfigInputSchema = z$1.object({
|
|
|
1773
1920
|
providers: z$1.array(providerPricingConfigSchema).min(1),
|
|
1774
1921
|
windows: z$1.array(createDeliveryWindowInputSchema).default([]),
|
|
1775
1922
|
minDeliveryAmount: amountSchema.nullish(),
|
|
1776
|
-
acceptedPayments: z$1.enum(["COD", "
|
|
1923
|
+
acceptedPayments: z$1.enum(["COD", "ONLINE"]).array().min(1).default(["COD", "ONLINE"])
|
|
1777
1924
|
});
|
|
1778
1925
|
const deliveryConfigSchema = z$1.object({
|
|
1779
1926
|
isEnabled: z$1.boolean(),
|
|
@@ -1792,7 +1939,7 @@ const deliveryConfigSchema = z$1.object({
|
|
|
1792
1939
|
endTime: z$1.string().regex(/^\d{2}:\d{2}$/)
|
|
1793
1940
|
})),
|
|
1794
1941
|
minDeliveryAmount: amountSchema.nullish(),
|
|
1795
|
-
acceptedPayments: z$1.enum(["COD", "
|
|
1942
|
+
acceptedPayments: z$1.enum(["COD", "ONLINE"]).array().min(1)
|
|
1796
1943
|
});
|
|
1797
1944
|
const addProviderInputSchema = z$1.object({
|
|
1798
1945
|
locationId: z$1.uuid(),
|
|
@@ -1838,12 +1985,12 @@ const themeSchema = z$1.object({
|
|
|
1838
1985
|
const pickupConfigSchema = z$1.object({
|
|
1839
1986
|
isEnabled: z$1.boolean(),
|
|
1840
1987
|
preparationTimeMinutes: z$1.number().int().min(0),
|
|
1841
|
-
acceptedPayments: z$1.enum(["COD", "
|
|
1988
|
+
acceptedPayments: z$1.enum(["COD", "ONLINE"]).array().min(1)
|
|
1842
1989
|
});
|
|
1843
1990
|
const dineInConfigSchema = z$1.object({
|
|
1844
1991
|
isEnabled: z$1.boolean(),
|
|
1845
1992
|
numberOfTables: z$1.number().int().min(0),
|
|
1846
|
-
acceptedPayments: z$1.enum(["COD", "
|
|
1993
|
+
acceptedPayments: z$1.enum(["COD", "ONLINE"]).array().min(1)
|
|
1847
1994
|
});
|
|
1848
1995
|
const curbsideSpotSchema = z$1.object({
|
|
1849
1996
|
id: z$1.string(),
|
|
@@ -1855,7 +2002,18 @@ const curbsideConfigSchema = z$1.object({
|
|
|
1855
2002
|
isEnabled: z$1.boolean(),
|
|
1856
2003
|
hasParkingSpots: z$1.boolean(),
|
|
1857
2004
|
spots: z$1.array(curbsideSpotSchema).optional(),
|
|
1858
|
-
acceptedPayments: z$1.enum(["COD", "
|
|
2005
|
+
acceptedPayments: z$1.enum(["COD", "ONLINE"]).array().min(1)
|
|
2006
|
+
});
|
|
2007
|
+
const temporaryClosureInputSchema = z$1.object({
|
|
2008
|
+
duration: z$1.number().int().min(1).optional(),
|
|
2009
|
+
closedUntil: z$1.string().datetime().optional(),
|
|
2010
|
+
reason: z$1.string().max(200).optional()
|
|
2011
|
+
});
|
|
2012
|
+
const temporaryClosureOutputSchema = z$1.object({
|
|
2013
|
+
closedAt: z$1.string(),
|
|
2014
|
+
reopensAt: z$1.string(),
|
|
2015
|
+
reason: z$1.string().optional(),
|
|
2016
|
+
remainingSeconds: z$1.number().int().min(0)
|
|
1859
2017
|
});
|
|
1860
2018
|
const locationSchema = z$1.object({
|
|
1861
2019
|
id: z$1.string(),
|
|
@@ -1886,12 +2044,15 @@ const locationSchema = z$1.object({
|
|
|
1886
2044
|
logoUrl: z$1.string().nullish(),
|
|
1887
2045
|
backgroundUrl: z$1.string().nullish(),
|
|
1888
2046
|
mcc: z$1.string().nullish(),
|
|
1889
|
-
paymentTypes: z$1.enum(["COD", "
|
|
2047
|
+
paymentTypes: z$1.enum(["COD", "ONLINE"]).array(),
|
|
1890
2048
|
theme: themeSchema.nullish(),
|
|
1891
2049
|
timezone: z$1.string(),
|
|
1892
2050
|
type: z$1.string(),
|
|
1893
2051
|
meatSources: z$1.array(locationMeatSourceSchema).nullish(),
|
|
1894
|
-
orderConfig: orderConfigSchema
|
|
2052
|
+
orderConfig: orderConfigSchema,
|
|
2053
|
+
isTemporarilyClosed: z$1.boolean().optional(),
|
|
2054
|
+
isClosed: z$1.boolean().optional(),
|
|
2055
|
+
temporaryClosure: temporaryClosureOutputSchema.nullish()
|
|
1895
2056
|
});
|
|
1896
2057
|
const locationSummarySchema = z$1.object({
|
|
1897
2058
|
id: z$1.string(),
|
|
@@ -1923,10 +2084,13 @@ const locationSummarySchema = z$1.object({
|
|
|
1923
2084
|
bannerUrl: z$1.string().nullish(),
|
|
1924
2085
|
mcc: z$1.string().nullish(),
|
|
1925
2086
|
numberOfTables: z$1.number().default(0),
|
|
1926
|
-
acceptedPayments: z$1.enum(["COD", "
|
|
2087
|
+
acceptedPayments: z$1.enum(["COD", "ONLINE"]).array(),
|
|
1927
2088
|
theme: themeSchema.nullish(),
|
|
1928
2089
|
type: z$1.string(),
|
|
1929
|
-
meatSources: z$1.array(locationMeatSourceSchema).nullish()
|
|
2090
|
+
meatSources: z$1.array(locationMeatSourceSchema).nullish(),
|
|
2091
|
+
isTemporarilyClosed: z$1.boolean().optional(),
|
|
2092
|
+
isClosed: z$1.boolean().optional(),
|
|
2093
|
+
temporaryClosure: temporaryClosureOutputSchema.nullish()
|
|
1930
2094
|
});
|
|
1931
2095
|
const listLocationsOutputSchema = baseListOutputSchema(locationSummarySchema);
|
|
1932
2096
|
const defaultLocationSort = defaultTimeSort;
|
|
@@ -1960,7 +2124,7 @@ const upsertDineInInputSchema = z$1.object({
|
|
|
1960
2124
|
locationId: z$1.uuid(),
|
|
1961
2125
|
dinein: dineInConfigSchema.partial().extend({
|
|
1962
2126
|
windows: z$1.array(businessHoursPeriodSchema).optional(),
|
|
1963
|
-
acceptedPayments: z$1.enum(["COD", "
|
|
2127
|
+
acceptedPayments: z$1.enum(["COD", "ONLINE"]).array().min(1).optional()
|
|
1964
2128
|
})
|
|
1965
2129
|
});
|
|
1966
2130
|
const upsertDeliveryInputSchema = z$1.object({
|
|
@@ -1977,7 +2141,7 @@ const upsertPickupInputSchema = z$1.object({
|
|
|
1977
2141
|
locationId: z$1.uuid(),
|
|
1978
2142
|
pickup: pickupConfigSchema.partial().extend({
|
|
1979
2143
|
windows: z$1.array(businessHoursPeriodSchema).optional(),
|
|
1980
|
-
acceptedPayments: z$1.enum(["COD", "
|
|
2144
|
+
acceptedPayments: z$1.enum(["COD", "ONLINE"]).array().min(1).optional()
|
|
1981
2145
|
})
|
|
1982
2146
|
});
|
|
1983
2147
|
const upsertCurbsideInputSchema = z$1.object({
|
|
@@ -1987,7 +2151,7 @@ const upsertCurbsideInputSchema = z$1.object({
|
|
|
1987
2151
|
hasParkingSpots: true
|
|
1988
2152
|
}).partial().extend({
|
|
1989
2153
|
windows: z$1.array(businessHoursPeriodSchema).optional(),
|
|
1990
|
-
acceptedPayments: z$1.enum(["COD", "
|
|
2154
|
+
acceptedPayments: z$1.enum(["COD", "ONLINE"]).array().min(1).optional()
|
|
1991
2155
|
})
|
|
1992
2156
|
});
|
|
1993
2157
|
const addCurbsideSpotInputSchema = z$1.object({
|
|
@@ -2041,7 +2205,8 @@ const createWhatsAppGroupInputSchema = z$1.object({
|
|
|
2041
2205
|
const createWhatsAppGroupOutputSchema = z$1.object({
|
|
2042
2206
|
id: z$1.string().uuid(),
|
|
2043
2207
|
groupJid: z$1.string(),
|
|
2044
|
-
groupName: z$1.string()
|
|
2208
|
+
groupName: z$1.string(),
|
|
2209
|
+
inviteLink: z$1.string().url().optional()
|
|
2045
2210
|
});
|
|
2046
2211
|
/**
|
|
2047
2212
|
* Link an existing WhatsApp group to a location
|
|
@@ -2103,44 +2268,195 @@ const upsertLocationBusinessHoursInputSchema = z$1.object({
|
|
|
2103
2268
|
* Delete business hours for a location (fulfillmentType = GENERAL)
|
|
2104
2269
|
*/
|
|
2105
2270
|
const deleteLocationBusinessHoursInputSchema = z$1.object({ locationId: z$1.uuid() });
|
|
2271
|
+
const deleteLocationInputSchema = z$1.object({ locationId: z$1.uuid() });
|
|
2272
|
+
const deleteLocationOutputSchema = z$1.object({
|
|
2273
|
+
success: z$1.literal(true),
|
|
2274
|
+
locationId: z$1.uuid(),
|
|
2275
|
+
deletedAt: z$1.date()
|
|
2276
|
+
});
|
|
2106
2277
|
|
|
2107
2278
|
//#endregion
|
|
2108
|
-
//#region src/schema/merchant-
|
|
2109
|
-
const
|
|
2279
|
+
//#region src/schema/merchant-integrations.ts
|
|
2280
|
+
const deliveryProviderSchema = z.enum([
|
|
2281
|
+
"LOCAL",
|
|
2282
|
+
"LEAJLAK",
|
|
2283
|
+
"PARCEL",
|
|
2284
|
+
"QMILE"
|
|
2285
|
+
]);
|
|
2286
|
+
const posProviderSchema = z.enum(["SQUARE"]);
|
|
2287
|
+
const integrationProviderSchema = z.union([deliveryProviderSchema, posProviderSchema]);
|
|
2288
|
+
const integrationTypeSchema = z.enum(["delivery", "pos"]);
|
|
2289
|
+
const integrationStatusSchema = z.enum(["active", "inactive"]);
|
|
2290
|
+
const leajlakConfigSchema = z.object({
|
|
2291
|
+
type: z.literal("LEAJLAK"),
|
|
2292
|
+
accessToken: z.string().min(1)
|
|
2293
|
+
});
|
|
2294
|
+
const parcelConfigSchema = z.object({
|
|
2295
|
+
type: z.literal("PARCEL"),
|
|
2296
|
+
apiKey: z.string().min(1),
|
|
2297
|
+
region: z.string().min(1)
|
|
2298
|
+
});
|
|
2299
|
+
const qmileConfigSchema = z.object({
|
|
2300
|
+
type: z.literal("QMILE"),
|
|
2301
|
+
apiKey: z.string().min(1)
|
|
2302
|
+
});
|
|
2303
|
+
const localConfigSchema = z.object({ type: z.literal("LOCAL") });
|
|
2304
|
+
const providerConfigSchema = z.discriminatedUnion("type", [
|
|
2305
|
+
leajlakConfigSchema,
|
|
2306
|
+
parcelConfigSchema,
|
|
2307
|
+
qmileConfigSchema,
|
|
2308
|
+
localConfigSchema
|
|
2309
|
+
]);
|
|
2310
|
+
const merchantIntegrationBaseSchema = z.object({
|
|
2110
2311
|
id: z.uuid(),
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2312
|
+
merchantId: z.uuid(),
|
|
2313
|
+
type: integrationTypeSchema,
|
|
2314
|
+
provider: z.string(),
|
|
2315
|
+
status: integrationStatusSchema,
|
|
2316
|
+
credentials: z.record(z.string(), z.unknown()),
|
|
2317
|
+
config: z.record(z.string(), z.unknown()),
|
|
2318
|
+
accessTokenExpiresAt: z.date().nullable(),
|
|
2319
|
+
refreshTokenExpiresAt: z.date().nullable(),
|
|
2320
|
+
externalMerchantId: z.string().nullable(),
|
|
2321
|
+
scope: z.string().nullable(),
|
|
2120
2322
|
createdAt: z.date(),
|
|
2121
|
-
updatedAt: z.date()
|
|
2323
|
+
updatedAt: z.date(),
|
|
2324
|
+
deletedAt: z.date().nullable()
|
|
2122
2325
|
});
|
|
2123
|
-
const
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
currency: z.string().default("SAR"),
|
|
2128
|
-
billingPeriodDays: z.number().int().positive(),
|
|
2129
|
-
platformFeeFixedCents: z.number().int().nonnegative().default(0),
|
|
2130
|
-
platformFeePercentage: z.number().int().nonnegative().default(0),
|
|
2131
|
-
capabilities: z.object({
|
|
2132
|
-
maxLocations: z.number().nullable().optional(),
|
|
2133
|
-
orderFeePercentage: z.number().nullable().optional(),
|
|
2134
|
-
allowedPaymentMethods: z.array(z.string()).optional(),
|
|
2135
|
-
canBeActive: z.boolean().optional(),
|
|
2136
|
-
canBeHidden: z.boolean().optional()
|
|
2137
|
-
}).passthrough(),
|
|
2138
|
-
isActive: z.boolean().default(true)
|
|
2326
|
+
const createIntegrationInputSchema = z.object({
|
|
2327
|
+
merchantId: z.uuid(),
|
|
2328
|
+
provider: deliveryProviderSchema,
|
|
2329
|
+
data: providerConfigSchema
|
|
2139
2330
|
});
|
|
2140
|
-
const
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2331
|
+
const createIntegrationOutputSchema = merchantIntegrationBaseSchema;
|
|
2332
|
+
const getIntegrationInputSchema = z.object({
|
|
2333
|
+
merchantId: z.uuid().optional(),
|
|
2334
|
+
provider: integrationProviderSchema
|
|
2335
|
+
});
|
|
2336
|
+
const getIntegrationOutputSchema = merchantIntegrationBaseSchema.nullable();
|
|
2337
|
+
const listIntegrationsInputSchema = z.object({ merchantId: z.uuid().optional() });
|
|
2338
|
+
const listIntegrationsOutputSchema = z.array(merchantIntegrationBaseSchema);
|
|
2339
|
+
const setIntegrationStatusInputSchema = z.object({
|
|
2340
|
+
integrationId: z.uuid(),
|
|
2341
|
+
status: integrationStatusSchema
|
|
2342
|
+
});
|
|
2343
|
+
const setIntegrationStatusOutputSchema = merchantIntegrationBaseSchema;
|
|
2344
|
+
const deleteIntegrationInputSchema = z.object({ integrationId: z.uuid() });
|
|
2345
|
+
const deliveryStatusSchema = z.enum([
|
|
2346
|
+
"pending",
|
|
2347
|
+
"assigned",
|
|
2348
|
+
"accepted",
|
|
2349
|
+
"in_progress",
|
|
2350
|
+
"arrived",
|
|
2351
|
+
"picked_up",
|
|
2352
|
+
"shipped",
|
|
2353
|
+
"delivered",
|
|
2354
|
+
"failed",
|
|
2355
|
+
"cancelled"
|
|
2356
|
+
]);
|
|
2357
|
+
const connectIntegrationInputSchema = z.discriminatedUnion("provider", [
|
|
2358
|
+
z.object({
|
|
2359
|
+
merchantId: z.uuid().optional(),
|
|
2360
|
+
provider: z.literal("SQUARE"),
|
|
2361
|
+
redirectUrl: z.string().min(1)
|
|
2362
|
+
}),
|
|
2363
|
+
z.object({
|
|
2364
|
+
merchantId: z.uuid().optional(),
|
|
2365
|
+
provider: z.literal("LEAJLAK"),
|
|
2366
|
+
accessToken: z.string().min(1)
|
|
2367
|
+
}),
|
|
2368
|
+
z.object({
|
|
2369
|
+
merchantId: z.uuid().optional(),
|
|
2370
|
+
provider: z.literal("PARCEL"),
|
|
2371
|
+
apiKey: z.string().min(1),
|
|
2372
|
+
region: z.string().min(1)
|
|
2373
|
+
}),
|
|
2374
|
+
z.object({
|
|
2375
|
+
merchantId: z.uuid().optional(),
|
|
2376
|
+
provider: z.literal("QMILE"),
|
|
2377
|
+
apiKey: z.string().min(1)
|
|
2378
|
+
}),
|
|
2379
|
+
z.object({
|
|
2380
|
+
merchantId: z.uuid().optional(),
|
|
2381
|
+
provider: z.literal("LOCAL")
|
|
2382
|
+
})
|
|
2383
|
+
]);
|
|
2384
|
+
const connectIntegrationOutputSchema = z.discriminatedUnion("kind", [z.object({
|
|
2385
|
+
kind: z.literal("oauth_redirect"),
|
|
2386
|
+
provider: z.literal("SQUARE"),
|
|
2387
|
+
url: z.string().url(),
|
|
2388
|
+
redirect: z.boolean().default(true)
|
|
2389
|
+
}), z.object({
|
|
2390
|
+
kind: z.literal("connected"),
|
|
2391
|
+
integration: merchantIntegrationBaseSchema
|
|
2392
|
+
})]);
|
|
2393
|
+
const disconnectIntegrationInputSchema = z.object({
|
|
2394
|
+
merchantId: z.uuid().optional(),
|
|
2395
|
+
provider: integrationProviderSchema
|
|
2396
|
+
});
|
|
2397
|
+
const deliveryBaseSchema = z.object({
|
|
2398
|
+
id: z.uuid(),
|
|
2399
|
+
orderId: z.uuid(),
|
|
2400
|
+
merchantId: z.uuid(),
|
|
2401
|
+
locationId: z.uuid(),
|
|
2402
|
+
provider: deliveryProviderSchema,
|
|
2403
|
+
providerOrderId: z.string().nullable(),
|
|
2404
|
+
status: deliveryStatusSchema,
|
|
2405
|
+
trackingUrl: z.string().nullable(),
|
|
2406
|
+
deliveryData: z.record(z.string(), z.unknown()),
|
|
2407
|
+
createdAt: z.date(),
|
|
2408
|
+
updatedAt: z.date()
|
|
2409
|
+
});
|
|
2410
|
+
const integrateLocationInputSchema = z.object({
|
|
2411
|
+
merchantId: z.uuid().optional(),
|
|
2412
|
+
provider: deliveryProviderSchema,
|
|
2413
|
+
locationId: z.uuid(),
|
|
2414
|
+
contactPerson: z.string().min(1).optional(),
|
|
2415
|
+
email: z.string().email().optional()
|
|
2416
|
+
});
|
|
2417
|
+
const integrateLocationOutputSchema = z.object({
|
|
2418
|
+
success: z.boolean(),
|
|
2419
|
+
providerLocationId: z.string().min(1),
|
|
2420
|
+
providerMetadata: z.record(z.string(), z.unknown())
|
|
2421
|
+
});
|
|
2422
|
+
|
|
2423
|
+
//#endregion
|
|
2424
|
+
//#region src/schema/merchant-subscriptions.ts
|
|
2425
|
+
const subscriptionPlanSchema = z.object({
|
|
2426
|
+
id: z.uuid(),
|
|
2427
|
+
name: z.string(),
|
|
2428
|
+
description: z.string().nullable(),
|
|
2429
|
+
price: z.bigint(),
|
|
2430
|
+
currency: z.string(),
|
|
2431
|
+
billingPeriodDays: z.number().int(),
|
|
2432
|
+
platformFeeFixedCents: z.bigint(),
|
|
2433
|
+
platformFeePercentage: z.number().int(),
|
|
2434
|
+
capabilities: z.record(z.string(), z.unknown()),
|
|
2435
|
+
isActive: z.boolean(),
|
|
2436
|
+
createdAt: z.date(),
|
|
2437
|
+
updatedAt: z.date()
|
|
2438
|
+
});
|
|
2439
|
+
const createSubscriptionPlanInputSchema = z.object({
|
|
2440
|
+
name: z.string().min(1),
|
|
2441
|
+
description: z.string().nullable().optional(),
|
|
2442
|
+
price: z.number().nonnegative(),
|
|
2443
|
+
currency: z.string().default("SAR"),
|
|
2444
|
+
billingPeriodDays: z.number().int().positive(),
|
|
2445
|
+
platformFeeFixedCents: z.number().int().nonnegative().default(0),
|
|
2446
|
+
platformFeePercentage: z.number().int().nonnegative().default(0),
|
|
2447
|
+
capabilities: z.object({
|
|
2448
|
+
maxLocations: z.number().nullable().optional(),
|
|
2449
|
+
orderFeePercentage: z.number().nullable().optional(),
|
|
2450
|
+
allowedPaymentMethods: z.array(z.string()).optional(),
|
|
2451
|
+
canBeActive: z.boolean().optional(),
|
|
2452
|
+
canBeHidden: z.boolean().optional()
|
|
2453
|
+
}).passthrough(),
|
|
2454
|
+
isActive: z.boolean().default(true)
|
|
2455
|
+
});
|
|
2456
|
+
const updateSubscriptionPlanInputSchema = z.object({
|
|
2457
|
+
name: z.string().min(1).optional(),
|
|
2458
|
+
description: z.string().nullable().optional(),
|
|
2459
|
+
price: z.number().nonnegative().optional(),
|
|
2144
2460
|
currency: z.string().optional(),
|
|
2145
2461
|
billingPeriodDays: z.number().int().positive().optional(),
|
|
2146
2462
|
platformFeeFixedCents: z.number().int().nonnegative().optional(),
|
|
@@ -2382,140 +2698,6 @@ const sendDirectMessageOutputSchema = z.object({
|
|
|
2382
2698
|
failedCount: z.number()
|
|
2383
2699
|
});
|
|
2384
2700
|
|
|
2385
|
-
//#endregion
|
|
2386
|
-
//#region src/schema/payments.ts
|
|
2387
|
-
const gatewayIds = paymentGatewayIds;
|
|
2388
|
-
const paymentStatuses = [
|
|
2389
|
-
"INITIATED",
|
|
2390
|
-
"PAID",
|
|
2391
|
-
"AUTHORIZED",
|
|
2392
|
-
"FAILED",
|
|
2393
|
-
"REFUNDED",
|
|
2394
|
-
"CAPTURED",
|
|
2395
|
-
"VOIDED",
|
|
2396
|
-
"VERIFIED"
|
|
2397
|
-
];
|
|
2398
|
-
const initiatePaymentInputSchema = z.object({
|
|
2399
|
-
entities: z.object({
|
|
2400
|
-
merchantId: z.string(),
|
|
2401
|
-
customerId: z.string()
|
|
2402
|
-
}),
|
|
2403
|
-
payment: z.object({
|
|
2404
|
-
method: z.enum(paymentMethodIds),
|
|
2405
|
-
orderId: z.string(),
|
|
2406
|
-
amount: z.number(),
|
|
2407
|
-
currency: z.string(),
|
|
2408
|
-
description: z.string(),
|
|
2409
|
-
language: z.string(),
|
|
2410
|
-
metadata: z.record(z.string(), z.unknown()),
|
|
2411
|
-
success_url: z.string()
|
|
2412
|
-
}),
|
|
2413
|
-
metadata: z.record(z.string(), z.unknown()).nullish()
|
|
2414
|
-
});
|
|
2415
|
-
const initiatePaymentOutputSchema = z.object({ url: z.string() });
|
|
2416
|
-
const paymentSourceSchema = z.object({
|
|
2417
|
-
type: z.string().optional(),
|
|
2418
|
-
company: z.string().optional(),
|
|
2419
|
-
entryMethod: z.string().optional(),
|
|
2420
|
-
card: z.object({
|
|
2421
|
-
bin: z.string().optional(),
|
|
2422
|
-
expMonth: z.number().optional(),
|
|
2423
|
-
expYear: z.number().optional(),
|
|
2424
|
-
fingerprint: z.string().optional(),
|
|
2425
|
-
last4: z.string().optional()
|
|
2426
|
-
}).optional(),
|
|
2427
|
-
digitalWalletDetails: z.object({
|
|
2428
|
-
type: z.string().optional(),
|
|
2429
|
-
brand: z.string().optional(),
|
|
2430
|
-
applicationDetails: z.unknown().optional()
|
|
2431
|
-
}).optional(),
|
|
2432
|
-
receivedMoney: z.unknown().optional(),
|
|
2433
|
-
changeMoney: z.unknown().optional()
|
|
2434
|
-
});
|
|
2435
|
-
const recordPaymentInputSchema = z.object({
|
|
2436
|
-
merchantId: z.string(),
|
|
2437
|
-
orderId: z.string(),
|
|
2438
|
-
payment: z.object({
|
|
2439
|
-
paymentId: z.string(),
|
|
2440
|
-
amount: z.number(),
|
|
2441
|
-
currency: z.string(),
|
|
2442
|
-
fee: z.number(),
|
|
2443
|
-
status: z.enum(paymentStatuses),
|
|
2444
|
-
gateway: z.enum(gatewayIds).nullable(),
|
|
2445
|
-
source: paymentSourceSchema,
|
|
2446
|
-
metadata: z.unknown(),
|
|
2447
|
-
ip: z.string().optional()
|
|
2448
|
-
})
|
|
2449
|
-
});
|
|
2450
|
-
const refundPaymentInputSchema = z.object({
|
|
2451
|
-
paymentId: z.string(),
|
|
2452
|
-
amount: z.number()
|
|
2453
|
-
});
|
|
2454
|
-
const paymentOutputSchema = z.object({
|
|
2455
|
-
id: z.string(),
|
|
2456
|
-
amount: z.number(),
|
|
2457
|
-
currency: z.string(),
|
|
2458
|
-
fee: z.number(),
|
|
2459
|
-
status: z.enum(paymentStatuses),
|
|
2460
|
-
gateway: z.enum(gatewayIds).nullable(),
|
|
2461
|
-
source: paymentSourceSchema,
|
|
2462
|
-
metadata: z.record(z.string(), z.unknown()).nullish(),
|
|
2463
|
-
ip: z.string().nullish(),
|
|
2464
|
-
orderId: z.string().uuid().nullish(),
|
|
2465
|
-
createdAt: z.date(),
|
|
2466
|
-
updatedAt: z.date()
|
|
2467
|
-
});
|
|
2468
|
-
const paymentListItemSchema = z.object({
|
|
2469
|
-
id: z.string(),
|
|
2470
|
-
amount: z.number(),
|
|
2471
|
-
currency: z.string(),
|
|
2472
|
-
fee: z.number(),
|
|
2473
|
-
status: z.enum(paymentStatuses),
|
|
2474
|
-
gateway: z.enum(gatewayIds).nullable(),
|
|
2475
|
-
source: paymentSourceSchema,
|
|
2476
|
-
orderId: z.string().uuid().nullish(),
|
|
2477
|
-
createdAt: z.date()
|
|
2478
|
-
});
|
|
2479
|
-
const paymentFilterSchema = z.object({
|
|
2480
|
-
merchantId: z.uuid().nullish(),
|
|
2481
|
-
orderId: z.uuid().nullish(),
|
|
2482
|
-
status: z.enum(paymentStatuses).nullish(),
|
|
2483
|
-
gateway: z.enum(gatewayIds).nullable().nullish(),
|
|
2484
|
-
startTime: z.coerce.date().nullish(),
|
|
2485
|
-
endTime: z.coerce.date().nullish()
|
|
2486
|
-
});
|
|
2487
|
-
const listPaymentsInputSchema = z.object({
|
|
2488
|
-
pagination: z.object({
|
|
2489
|
-
page: z.number().min(1).default(1),
|
|
2490
|
-
pageSize: z.number().min(1).max(100).default(20)
|
|
2491
|
-
}).optional().default({
|
|
2492
|
-
page: 1,
|
|
2493
|
-
pageSize: 20
|
|
2494
|
-
}),
|
|
2495
|
-
filter: paymentFilterSchema.optional(),
|
|
2496
|
-
sort: z.record(z.string(), z.enum(["asc", "desc"])).optional()
|
|
2497
|
-
});
|
|
2498
|
-
const listPaymentsOutputSchema = z.object({
|
|
2499
|
-
items: z.array(paymentListItemSchema),
|
|
2500
|
-
pagination: z.object({
|
|
2501
|
-
page: z.number(),
|
|
2502
|
-
pageSize: z.number(),
|
|
2503
|
-
totalItems: z.number(),
|
|
2504
|
-
totalPages: z.number()
|
|
2505
|
-
})
|
|
2506
|
-
});
|
|
2507
|
-
const getPaymentInputSchema = z.object({ paymentId: z.uuid() });
|
|
2508
|
-
const refundOrderInputSchema = z.object({
|
|
2509
|
-
orderId: z.uuid(),
|
|
2510
|
-
amount: z.number().optional()
|
|
2511
|
-
});
|
|
2512
|
-
const refundOrderOutputSchema = z.object({
|
|
2513
|
-
orderId: z.string(),
|
|
2514
|
-
refundInitiated: z.boolean(),
|
|
2515
|
-
paymentIds: z.array(z.string()),
|
|
2516
|
-
message: z.string()
|
|
2517
|
-
});
|
|
2518
|
-
|
|
2519
2701
|
//#endregion
|
|
2520
2702
|
//#region src/schema/payouts.ts
|
|
2521
2703
|
const payoutStatusSchema = z.enum([
|
|
@@ -2742,6 +2924,7 @@ const payoutReportOrderSchema = z.object({
|
|
|
2742
2924
|
platformFee: z.bigint(),
|
|
2743
2925
|
paymentFee: z.bigint(),
|
|
2744
2926
|
netPayout: z.bigint(),
|
|
2927
|
+
platformFeeDiscount: z.bigint(),
|
|
2745
2928
|
payments: z.array(payoutReportPaymentSchema)
|
|
2746
2929
|
});
|
|
2747
2930
|
/**
|
|
@@ -2749,12 +2932,24 @@ const payoutReportOrderSchema = z.object({
|
|
|
2749
2932
|
*/
|
|
2750
2933
|
const payoutReportOverallSchema = z.object({
|
|
2751
2934
|
totalRevenue: z.bigint(),
|
|
2935
|
+
totalHeldAmount: z.bigint(),
|
|
2752
2936
|
totalPlatformFee: z.bigint(),
|
|
2937
|
+
totalCancelledPlatformFee: z.bigint(),
|
|
2753
2938
|
totalPaymentFee: z.bigint(),
|
|
2754
2939
|
totalNetPayout: z.bigint(),
|
|
2940
|
+
totalPayoutAmount: z.bigint(),
|
|
2941
|
+
totalDueAmount: z.bigint(),
|
|
2755
2942
|
orderCount: z.number().int(),
|
|
2756
2943
|
onlinePaymentCount: z.number().int(),
|
|
2757
|
-
cashPaymentCount: z.number().int()
|
|
2944
|
+
cashPaymentCount: z.number().int(),
|
|
2945
|
+
totalDineInPlatformFeeDiscount: z.bigint(),
|
|
2946
|
+
dineInOrderCount: z.number().int(),
|
|
2947
|
+
completedRevenueMinor: z.bigint(),
|
|
2948
|
+
cancelledRevenueMinor: z.bigint(),
|
|
2949
|
+
failedRevenueMinor: z.bigint(),
|
|
2950
|
+
missingRevenueMinor: z.bigint(),
|
|
2951
|
+
dineInRevenueMinor: z.bigint(),
|
|
2952
|
+
dineInGatewayFeeMinor: z.bigint()
|
|
2758
2953
|
});
|
|
2759
2954
|
/**
|
|
2760
2955
|
* Summary KPIs schema
|
|
@@ -2769,7 +2964,9 @@ const payoutReportSummarySchema = z.object({
|
|
|
2769
2964
|
completedCount: z.number().int(),
|
|
2770
2965
|
canceledCount: z.number().int(),
|
|
2771
2966
|
refundedCount: z.number().int(),
|
|
2772
|
-
otherCount: z.number().int()
|
|
2967
|
+
otherCount: z.number().int(),
|
|
2968
|
+
newCount: z.number().int(),
|
|
2969
|
+
failedCount: z.number().int()
|
|
2773
2970
|
}),
|
|
2774
2971
|
byPaymentMethod: z.array(z.object({
|
|
2775
2972
|
method: z.enum(paymentMethodIds),
|
|
@@ -2784,6 +2981,7 @@ const payoutReportSummarySchema = z.object({
|
|
|
2784
2981
|
netPayout: z.bigint()
|
|
2785
2982
|
})),
|
|
2786
2983
|
averageOrderValue: z.bigint(),
|
|
2984
|
+
completionRate: z.number(),
|
|
2787
2985
|
topItems: z.array(z.object({
|
|
2788
2986
|
itemId: z.string().uuid(),
|
|
2789
2987
|
name: z.string(),
|
|
@@ -2801,4 +2999,293 @@ const payoutReportOutputSchema = z.object({
|
|
|
2801
2999
|
});
|
|
2802
3000
|
|
|
2803
3001
|
//#endregion
|
|
2804
|
-
export { messageScopeEnum as $, getCategoryInputSchema as $a, merchantCustomerBaseSchema as $i, orderLineItemInputSchema as $n, bannerListOutputSchema as $o, createSocialInputSchema as $r, listLocationsInputSchema as $t, unsettledBalanceSchema as A, createImageOutputSchema as Aa, createCustomerManualInputSchema as Ai, upsertLocationBusinessHoursInputSchema as An, updateModifierInputSchema as Ao, paymentMethodIds as Ar, createAddressInputSchema as At, paymentListItemSchema as B, deleteCategoryOutputSchema as Ba, customerFilterSchema as Bi, listOrdersOutputSchema as Bn, upsertModifierDefaultLocationOverrideInputSchema as Bo, listMerchantsOutputSchema as Br, deleteFulfillmentBusinessHoursInputSchema as Bt, listPayoutsInputSchema as C, catalogSelectionTypeValues as Ca, bulkCustomerExportRowSchema as Ci, uploadLocationBannerOutputSchema as Cn, unlinkItemWithCategoryInputSchema as Co, promoCodeOutputSchema as Cr, sendMerchantInvoiceInputSchema as Ct, payoutSchema as D, createCategoryInputSchema as Da, bulkCustomerImportRowClientSchema as Di, upsertDeliveryInputSchema as Dn, updateCategoryOutputSchema as Do, updatePromoCodeInputSchema as Dr, addProviderInputSchema as Dt, payoutProviderSchema as E, catalogVariationWithDefaultSchema as Ea, bulkCustomerImportResultSchema as Ei, upsertCurbsideInputSchema as En, updateCategoryInputSchema as Eo, promoCodeValidationResultSchema as Er, addCurbsideSpotInputSchema as Et, initiatePaymentInputSchema as F, createModifierListOutputSchema as Fa, customerAddressByIdInputSchema as Fi, defaultOrderSort as Fn, updateVariationOutputSchema as Fo, createMerchantLegalDetailsInputSchema as Fr, createWhatsAppGroupInputSchema as Ft, refundOrderInputSchema as G, deleteModifierListOutputSchema as Ga, deleteCustomerInputSchema as Gi, orderEntitiesSchema as Gn, upsertVariationLocationOverrideInputSchema as Go, merchantIntegrationSchema as Gr, fulfillmentBusinessHoursOutputSchema as Gt, paymentSourceSchema as H, deleteItemOutputSchema as Ha, defaultCustomerAddressSort as Hi, orderByIdOutputSchema as Hn, upsertModifierLocationOverrideInputSchema as Ho, merchantFilterSchema as Hr, deleteWhatsAppGroupInputSchema as Ht, initiatePaymentOutputSchema as I, createModifierOutputSchema as Ia, customerAddressFilterSchema as Ii, fetchOrderByIdOutputSchema as In, uploadCatalogItemPhotoInputSchema as Io, createMerchantOutputSchema as Ir, createWhatsAppGroupOutputSchema as It, calculateSmsCostInputSchema as J, deleteModifierOverrideOutputSchema as Ja, listCustomerAddressesOutputSchema as Ji, orderFulfillmentOutputSchema as Jn, businessHoursSchema as Jo, merchantSummarySchema as Jr, linkWhatsAppGroupOutputSchema as Jt, refundOrderOutputSchema as K, deleteModifierOutputSchema as Ka, deleteMerchantCustomerInputSchema as Ki, orderFilterSchema as Kn, translationFieldSchema as Ko, merchantLegalDetailsSchema as Kr, fulfillmentTypeEnum as Kt, listPaymentsInputSchema as L, createVariationInputSchema as La, customerAddressOutputSchema as Li, getOrderByIdInputSchema as Ln, uploadCatalogItemPhotoOutputSchema as Lo, linkSquareIntegrationInputSchema as Lr, curbsideConfigSchema as Lt, upsertBankAccountInputSchema as M, createItemOutputSchema as Ma, createMerchantCustomerManualInputSchema as Mi, upsertPickupInputSchema as Mn, updateModifierListOutputSchema as Mo, createLeadForAdminOutputSchema as Mr, createDeliveryConfigInputSchema as Mt, gatewayIds as N, createModifierInputSchema as Na, createMerchantCustomerManualOutputSchema as Ni, checkoutResultSchema as Nn, updateModifierOutputSchema as No, preferredContactTimeSchema as Nr, createDeliveryWindowInputSchema as Nt, payoutStatusSchema as O, createCategoryOutputSchema as Oa, bulkCustomerImportRowSchema as Oi, upsertDineInInputSchema as On, updateItemInputSchema as Oo, acceptedPaymentIds as Or, availableWhatsAppGroupSchema as Ot, getPaymentInputSchema as P, createModifierListInputSchema as Pa, customerAddressBaseSchema as Pi, createOrderInputSchema as Pn, updateVariationInputSchema as Po, createMerchantInputSchema as Pr, createLocationInputSchema as Pt, messageProviderEnum as Q, getCatalogItemOutputSchema as Qa, listMerchantCustomersOutputSchema as Qi, orderGatewayIds as Qn, bannerIdInputSchema as Qo, uploadVatDocumentInputSchema as Qr, listLocationWhatsAppGroupsOutputSchema as Qt, listPaymentsOutputSchema as R, createVariationOutputSchema as Ra, customerBaseSchema as Ri, getOrderConfigInputSchema as Rn, upsertItemLocationOverrideInputSchema as Ro, linkSquareIntegrationOutputSchema as Rr, curbsideSpotSchema as Rt, listCompanyPayoutAccountsInputSchema as S, catalogPriceRangeSchema as Sa, bulkCustomerExportResultSchema as Si, uploadLocationBannerInputSchema as Sn, mutationIdOutputSchema as So, promoCodeListOutputSchema as Sr, merchantSubscriptionSchema as St, locationBalanceSchema as T, catalogVariationFilterSchema as Ta, bulkCustomerImportInputSchema as Ti, uploadLocationPhotoOutputSchema as Tn, unlinkItemWithModifierListInputSchema as To, promoCodeValidationInputSchema as Tr, updateSubscriptionPlanInputSchema as Tt, paymentStatuses as U, deleteModifierInputSchema as Ua, defaultCustomerSort as Ui, orderConfigSchema as Un, upsertModifierOverrideInputSchema as Uo, merchantFullDetailsSchema as Ur, deliveryConfigSchema as Ut, paymentOutputSchema as V, deleteItemInputSchema as Va, customerOutputSchema as Vi, orderAmountSchema as Vn, upsertModifierInputSchema as Vo, merchantBaseSchema as Vr, deleteLocationBusinessHoursInputSchema as Vt, recordPaymentInputSchema as W, deleteModifierListInputSchema as Wa, defaultMerchantCustomerSort as Wi, orderCustomerSchema as Wn, upsertModifierOverrideOutputSchema as Wo, merchantIdInputSchema as Wr, dineInConfigSchema as Wt, getSmsBalanceInputSchema as X, deleteVariationOutputSchema as Xa, listCustomersOutputSchema as Xi, orderFulfillmentStateValues as Xn, activeBannerOutputSchema as Xo, updateMerchantLegalDetailsInputSchema as Xr, listAvailableWhatsAppGroupsOutputSchema as Xt, calculateSmsCostOutputSchema as Y, deleteVariationInputSchema as Ya, listCustomersInputSchema as Yi, orderFulfillmentSchema as Yn, activeBannerListOutputSchema as Yo, merchantSyncEventSchema as Yr, listAvailableWhatsAppGroupsInputSchema as Yt, getSmsBalanceOutputSchema as Z, getCatalogItemInputSchema as Za, listMerchantCustomersInputSchema as Zi, orderFulfillmentTypes as Zn, approveBannerInputSchema as Zo, uploadCrnDocumentInputSchema as Zr, listLocationWhatsAppGroupsInputSchema as Zt, getEffectiveBankAccountInputSchema as _, catalogModifierItemOverrideSchema as _a, discountScopes as _i, themeSchema as _n, listCatalogModifiersInputSchema as _o, promoCodeBaseSchema as _r, templateVariableSchema as _t, payoutReportOverallSchema as a, catalogAvailabilityValues as aa, anbPaymentStatusSchema as ai, locationMeatSourceSchema as an, linkItemWithCategoryInputSchema as ao, orderSchema as ar, placementSchema as as, availableTemplateResourcesSchema as at, getLocationBalanceOutputSchema as b, catalogModifierListFilterSchema as ba, updateDiscountInputSchema as bi, updateProviderInputSchema as bn, listCatalogVariationsOutputSchema as bo, promoCodeFilterSchema as br, createSubscriptionPlanInputSchema as bt, bankAccountSchema as c, catalogCategorySchema as ca, anbSinglePaymentResponseSchema as ci, locationStatusFilterSchema as cn, linkOperationOutputSchema as co, scheduleTypeEnum as cr, baseListInputSchema as cs, listMessageTemplatesInputSchema as ct, createCompanyPayoutAccountInputSchema as d, catalogItemDetailSchema as da, createDiscountInputSchema as di, providerPricingConfigSchema as dn, listCatalogCategoriesWithItemsInputSchema as do, validatePromoCodeForOrderResultSchema as dr, sortDirectionSchema as ds, messageTemplateByIdInputSchema as dt, merchantCustomerByIdInputSchema as ea, socialBaseSchema as ei, listLocationsOutputSchema as en, getCategoryOutputSchema as eo, orderLineItemSchema as er, bannerOutputSchema as es, sendDirectMessageInputSchema as et, createPayoutInputSchema as f, catalogItemFilterSchema as fa, discountAutoApplyScopes as fi, providerStrategyEnum as fn, listCatalogCategoriesWithItemsOutputSchema as fo, createPromoCodeInputSchema as fr, sortSchema as fs, messageTemplateFilterSchema as ft, getCompanyPayoutAccountInputSchema as g, catalogModifierFilterSchema as ga, discountOutputSchema as gi, removeProviderInputSchema as gn, listCatalogModifierListsOutputSchema as go, promoCodeApplicationTargets as gr, templateVariableCategorySchema as gt, getBankAccountOutputSchema as h, catalogModifierDefaultLocationOverrideSchema as ha, discountListOutputSchema as hi, removeLocationThemeInputSchema as hn, listCatalogModifierListsInputSchema as ho, promoCodeAmountSchema as hr, templateHelperSchema as ht, payoutReportOutputSchema as i, catalogAmountSchema as ia, anbPaymentStatusResponseSchema as ii, locationListSchema as in, getModifierOutputSchema as io, orderPromocodeSummarySchema as ir, listBannersInputSchema as is, smsProviderEnum as it, updateCompanyPayoutAccountInputSchema as j, createItemInputSchema as ja, createCustomerManualOutputSchema as ji, upsertLocationThemeInputSchema as jn, updateModifierListInputSchema as jo, createLeadForAdminInputSchema as jr, createDeliveryConfigForLocationInputSchema as jt, unsettledBalanceItemSchema as k, createImageInputSchema as ka, createCustomerAddressInputSchema as ki, upsertFulfillmentBusinessHoursInputSchema as kn, updateItemOutputSchema as ko, paymentGatewayIds as kr, createAddressForLocationInputSchema as kt, calculatePayoutOutputSchema as l, catalogDietaryPreferenceValues as la, anbWebhookPayloadSchema as li, locationWhatsAppGroupSchema as ln, listCatalogCategoriesInputSchema as lo, updateFulfillmentInputSchema as lr, baseListOutputSchema as ls, listMessageTemplatesOutputSchema as lt, getBankAccountInputSchema as m, catalogModifierBaseSchema as ma, discountIdInputSchema as mi, removeDeliveryInputSchema as mn, listCatalogItemsOutputSchema as mo, listPromoCodesInputSchema as mr, messageTemplateProviderEnum as mt, payoutReportInputSchema as n, merchantCustomerOutputSchema as na, socialPlatformsEnum as ni, locationFilterSchema as nn, getModifierListInputSchema as no, orderOutputSchema as nr, createBannerInputSchema as ns, sendMessageInputSchema as nt, payoutReportPaymentSchema as o, catalogCategoryBaseSchema as oa, anbSinglePaymentInitiationResponseSchema as oi, locationMutationOutputSchema as on, linkItemWithImageInputSchema as oo, orderSourceSchema as or, updateBannerInputSchema as os, createMessageTemplateInputSchema as ot, deleteCompanyPayoutAccountInputSchema as p, catalogItemSummarySchema as pa, discountBaseSchema as pi, removeCurbsideSpotInputSchema as pn, listCatalogItemsInputSchema as po, defaultPromoCodeSort as pr, paginationSchema as ps, messageTemplateOutputSchema as pt, refundPaymentInputSchema as q, deleteModifierOverrideInputSchema as qa, listCustomerAddressesInputSchema as qi, orderFulfillmentHistorySchema as qn, businessHoursPeriodSchema as qo, merchantListItemSchema as qr, linkWhatsAppGroupInputSchema as qt, payoutReportOrderSchema as r, upsertCustomerInputSchema as ra, updateSocialInputSchema as ri, locationIdInputSchema as rn, getModifierListOutputSchema as ro, orderPromocodeInputSchema as rr, listActiveBannersInputSchema as rs, sendMessageOutputSchema as rt, payoutReportSummarySchema as s, catalogCategoryFilterSchema as sa, anbSinglePaymentRequestSchema as si, locationSchema as sn, linkItemWithModifierListInputSchema as so, orderSummarySchema as sr, baseFilterSchema as ss, defaultMessageTemplateSort as st, payoutReportFulfillmentSchema as t, merchantCustomerFilterSchema as ta, socialIdInputSchema as ti, locationAddressSchema as tn, getModifierInputSchema as to, orderModifierSchema as tr, bannerStatusSchema as ts, sendDirectMessageOutputSchema as tt, companyPayoutAccountSchema as u, catalogFoodIngredientValues as ua, mapAnbStatusToPayoutStatus as ui, pickupConfigSchema as un, listCatalogCategoriesOutputSchema as uo, upsertOrderConfigInputSchema as ur, defaultTimeSort as us, messageTemplateBaseSchema as ut, getEffectiveBankAccountOutputSchema as v, catalogModifierListBaseSchema as va, discountTypes as vi, updateDeliveryConfigInputSchema as vn, listCatalogModifiersOutputSchema as vo, promoCodeConfigurationSchema as vr, updateMessageTemplateInputSchema as vt, listPayoutsOutputSchema as w, catalogVariationBaseSchema as wa, bulkCustomerImportErrorSchema as wi, uploadLocationPhotoInputSchema as wn, unlinkItemWithImageInputSchema as wo, promoCodeScopes as wr, subscriptionPlanSchema as wt, getPayoutInputSchema as x, catalogModifierLocationOverrideSchema as xa, bulkCustomerExportInputSchema as xi, updateWhatsAppGroupInputSchema as xn, modifierOverrideTypeValues as xo, promoCodeIdInputSchema as xr, merchantInvoiceSchema as xt, getLocationBalanceInputSchema as y, catalogModifierListDetailSchema as ya, listDiscountsInputSchema as yi, updateLocationInputSchema as yn, listCatalogVariationsInputSchema as yo, promoCodeDiscountTypes as yr, createMerchantInvoiceInputSchema as yt, paymentFilterSchema as z, deleteCategoryInputSchema as za, customerByIdInputSchema as zi, listOrdersInputSchema as zn, upsertItemModifierOverrideInputSchema as zo, listMerchantsInputSchema as zr, defaultLocationSort as zt };
|
|
3002
|
+
//#region src/schema/service-charges.ts
|
|
3003
|
+
const chargeScopes = ["ORDER", "LINE_ITEM"];
|
|
3004
|
+
const chargeTypes = ["PERCENTAGE", "FIXED_AMOUNT"];
|
|
3005
|
+
const chargeAutoApplyScopes = [
|
|
3006
|
+
"ALL_ITEMS",
|
|
3007
|
+
"CATEGORY",
|
|
3008
|
+
"SELECTED_ITEMS"
|
|
3009
|
+
];
|
|
3010
|
+
const chargeValueSchema = z.number().int().positive({ message: "Value must be greater than zero" }).max(1e6, { message: "Value is too large" });
|
|
3011
|
+
const serviceChargeBaseSchema = z.object({
|
|
3012
|
+
id: z.string().uuid(),
|
|
3013
|
+
merchantId: z.string().uuid(),
|
|
3014
|
+
locationId: z.string().uuid(),
|
|
3015
|
+
name: z.string(),
|
|
3016
|
+
scope: z.enum(chargeScopes),
|
|
3017
|
+
chargeType: z.enum(chargeTypes),
|
|
3018
|
+
value: z.number(),
|
|
3019
|
+
autoApplyScope: z.enum(chargeAutoApplyScopes),
|
|
3020
|
+
isActive: z.boolean(),
|
|
3021
|
+
taxable: z.boolean(),
|
|
3022
|
+
startsAt: z.date().nullish(),
|
|
3023
|
+
endsAt: z.date().nullish(),
|
|
3024
|
+
createdAt: z.date(),
|
|
3025
|
+
updatedAt: z.date(),
|
|
3026
|
+
itemIds: z.array(z.string().uuid()).default([]),
|
|
3027
|
+
categoryIds: z.array(z.string().uuid()).default([])
|
|
3028
|
+
});
|
|
3029
|
+
const ensureTargets$1 = (data, ctx) => {
|
|
3030
|
+
if (data.autoApplyScope === "SELECTED_ITEMS" && (!data.itemIds || data.itemIds.length === 0)) ctx.addIssue({
|
|
3031
|
+
code: z.ZodIssueCode.custom,
|
|
3032
|
+
path: ["itemIds"],
|
|
3033
|
+
message: "itemIds are required when autoApplyScope is SELECTED_ITEMS"
|
|
3034
|
+
});
|
|
3035
|
+
if (data.autoApplyScope === "CATEGORY" && (!data.categoryIds || data.categoryIds.length === 0)) ctx.addIssue({
|
|
3036
|
+
code: z.ZodIssueCode.custom,
|
|
3037
|
+
path: ["categoryIds"],
|
|
3038
|
+
message: "categoryIds are required when autoApplyScope is CATEGORY"
|
|
3039
|
+
});
|
|
3040
|
+
};
|
|
3041
|
+
const serviceChargeCoreSchema = z.object({
|
|
3042
|
+
merchantId: z.string().uuid(),
|
|
3043
|
+
locationId: z.string().uuid(),
|
|
3044
|
+
name: z.string().min(1),
|
|
3045
|
+
scope: z.enum(chargeScopes),
|
|
3046
|
+
chargeType: z.enum(chargeTypes),
|
|
3047
|
+
value: chargeValueSchema,
|
|
3048
|
+
autoApplyScope: z.enum(chargeAutoApplyScopes).default("ALL_ITEMS"),
|
|
3049
|
+
isActive: z.boolean().default(true),
|
|
3050
|
+
taxable: z.boolean().default(true),
|
|
3051
|
+
startsAt: z.date().nullish(),
|
|
3052
|
+
endsAt: z.date().nullish(),
|
|
3053
|
+
itemIds: z.array(z.string().uuid()).nullish(),
|
|
3054
|
+
categoryIds: z.array(z.string().uuid()).nullish()
|
|
3055
|
+
});
|
|
3056
|
+
const createServiceChargeInputSchema = serviceChargeCoreSchema.superRefine((data, ctx) => {
|
|
3057
|
+
ensureTargets$1(data, ctx);
|
|
3058
|
+
if (data.chargeType === "PERCENTAGE" && data.value > 100) ctx.addIssue({
|
|
3059
|
+
code: z.ZodIssueCode.custom,
|
|
3060
|
+
path: ["value"],
|
|
3061
|
+
message: "Percentage charges cannot exceed 100%"
|
|
3062
|
+
});
|
|
3063
|
+
});
|
|
3064
|
+
const updateServiceChargePatchSchema = serviceChargeCoreSchema.partial().superRefine((data, ctx) => {
|
|
3065
|
+
ensureTargets$1(data, ctx);
|
|
3066
|
+
if ((data.chargeType === "PERCENTAGE" || !data.chargeType) && typeof data.value === "number" && data.value > 100) ctx.addIssue({
|
|
3067
|
+
code: z.ZodIssueCode.custom,
|
|
3068
|
+
path: ["value"],
|
|
3069
|
+
message: "Percentage charges cannot exceed 100%"
|
|
3070
|
+
});
|
|
3071
|
+
}).refine((value) => Object.keys(value).length > 0, { message: "At least one field must be provided" });
|
|
3072
|
+
const updateServiceChargeInputSchema = z.object({
|
|
3073
|
+
serviceChargeId: z.string().uuid(),
|
|
3074
|
+
update: updateServiceChargePatchSchema
|
|
3075
|
+
});
|
|
3076
|
+
const listServiceChargesInputSchema = z.object({
|
|
3077
|
+
merchantId: z.string().uuid().nullish(),
|
|
3078
|
+
locationId: z.string().uuid().nullish(),
|
|
3079
|
+
isActive: z.boolean().nullish()
|
|
3080
|
+
});
|
|
3081
|
+
const serviceChargeIdInputSchema = z.object({ serviceChargeId: z.string().uuid() });
|
|
3082
|
+
const serviceChargeListOutputSchema = z.object({ serviceCharges: serviceChargeBaseSchema.array() });
|
|
3083
|
+
const serviceChargeOutputSchema = serviceChargeBaseSchema;
|
|
3084
|
+
|
|
3085
|
+
//#endregion
|
|
3086
|
+
//#region src/schema/taxes.ts
|
|
3087
|
+
const taxScopes = ["ORDER", "LINE_ITEM"];
|
|
3088
|
+
const taxTypes = ["ADDITIVE", "INCLUSIVE"];
|
|
3089
|
+
const taxAutoApplyScopes = [
|
|
3090
|
+
"ALL_ITEMS",
|
|
3091
|
+
"CATEGORY",
|
|
3092
|
+
"SELECTED_ITEMS"
|
|
3093
|
+
];
|
|
3094
|
+
const taxValueSchema = z.number().int().positive({ message: "Value must be greater than zero" }).max(1e6, { message: "Value is too large" });
|
|
3095
|
+
const taxBaseSchema = z.object({
|
|
3096
|
+
id: z.string().uuid(),
|
|
3097
|
+
merchantId: z.string().uuid(),
|
|
3098
|
+
locationId: z.string().uuid(),
|
|
3099
|
+
name: z.string(),
|
|
3100
|
+
scope: z.enum(taxScopes),
|
|
3101
|
+
taxType: z.enum(taxTypes),
|
|
3102
|
+
value: z.number(),
|
|
3103
|
+
autoApplyScope: z.enum(taxAutoApplyScopes),
|
|
3104
|
+
isActive: z.boolean(),
|
|
3105
|
+
taxable: z.boolean(),
|
|
3106
|
+
startsAt: z.date().nullish(),
|
|
3107
|
+
endsAt: z.date().nullish(),
|
|
3108
|
+
createdAt: z.date(),
|
|
3109
|
+
updatedAt: z.date(),
|
|
3110
|
+
itemIds: z.array(z.string().uuid()).default([]),
|
|
3111
|
+
categoryIds: z.array(z.string().uuid()).default([])
|
|
3112
|
+
});
|
|
3113
|
+
const ensureTargets = (data, ctx) => {
|
|
3114
|
+
if (data.autoApplyScope === "SELECTED_ITEMS" && (!data.itemIds || data.itemIds.length === 0)) ctx.addIssue({
|
|
3115
|
+
code: z.ZodIssueCode.custom,
|
|
3116
|
+
path: ["itemIds"],
|
|
3117
|
+
message: "itemIds are required when autoApplyScope is SELECTED_ITEMS"
|
|
3118
|
+
});
|
|
3119
|
+
if (data.autoApplyScope === "CATEGORY" && (!data.categoryIds || data.categoryIds.length === 0)) ctx.addIssue({
|
|
3120
|
+
code: z.ZodIssueCode.custom,
|
|
3121
|
+
path: ["categoryIds"],
|
|
3122
|
+
message: "categoryIds are required when autoApplyScope is CATEGORY"
|
|
3123
|
+
});
|
|
3124
|
+
};
|
|
3125
|
+
const taxCoreSchema = z.object({
|
|
3126
|
+
merchantId: z.string().uuid(),
|
|
3127
|
+
locationId: z.string().uuid(),
|
|
3128
|
+
name: z.string().min(1),
|
|
3129
|
+
scope: z.enum(taxScopes),
|
|
3130
|
+
taxType: z.enum(taxTypes),
|
|
3131
|
+
value: taxValueSchema,
|
|
3132
|
+
autoApplyScope: z.enum(taxAutoApplyScopes).default("ALL_ITEMS"),
|
|
3133
|
+
isActive: z.boolean().default(true),
|
|
3134
|
+
taxable: z.boolean().default(true),
|
|
3135
|
+
startsAt: z.date().nullish(),
|
|
3136
|
+
endsAt: z.date().nullish(),
|
|
3137
|
+
itemIds: z.array(z.string().uuid()).nullish(),
|
|
3138
|
+
categoryIds: z.array(z.string().uuid()).nullish()
|
|
3139
|
+
});
|
|
3140
|
+
const createTaxInputSchema = taxCoreSchema.superRefine((data, ctx) => {
|
|
3141
|
+
ensureTargets(data, ctx);
|
|
3142
|
+
});
|
|
3143
|
+
const updateTaxPatchSchema = taxCoreSchema.partial().superRefine((data, ctx) => {
|
|
3144
|
+
ensureTargets(data, ctx);
|
|
3145
|
+
}).refine((value) => Object.keys(value).length > 0, { message: "At least one field must be provided" });
|
|
3146
|
+
const updateTaxInputSchema = z.object({
|
|
3147
|
+
taxId: z.string().uuid(),
|
|
3148
|
+
update: updateTaxPatchSchema
|
|
3149
|
+
});
|
|
3150
|
+
const listTaxesInputSchema = z.object({
|
|
3151
|
+
merchantId: z.string().uuid().nullish(),
|
|
3152
|
+
locationId: z.string().uuid().nullish(),
|
|
3153
|
+
isActive: z.boolean().nullish()
|
|
3154
|
+
});
|
|
3155
|
+
const taxIdInputSchema = z.object({ taxId: z.string().uuid() });
|
|
3156
|
+
const taxListOutputSchema = z.object({ taxes: taxBaseSchema.array() });
|
|
3157
|
+
const taxOutputSchema = taxBaseSchema;
|
|
3158
|
+
|
|
3159
|
+
//#endregion
|
|
3160
|
+
//#region src/schema/zatca.ts
|
|
3161
|
+
const egsLocationSchema = z.object({
|
|
3162
|
+
city: z.string().min(1),
|
|
3163
|
+
district: z.string().min(1),
|
|
3164
|
+
street: z.string().min(1),
|
|
3165
|
+
building: z.string().min(1),
|
|
3166
|
+
postalCode: z.string().min(1),
|
|
3167
|
+
additionalNumber: z.string().optional()
|
|
3168
|
+
});
|
|
3169
|
+
const egsInfoSchema = z.object({
|
|
3170
|
+
id: z.uuid(),
|
|
3171
|
+
name: z.string().min(1),
|
|
3172
|
+
model: z.string().min(1),
|
|
3173
|
+
branchName: z.string().min(1),
|
|
3174
|
+
branchIndustry: z.string().min(1),
|
|
3175
|
+
vatName: z.string().min(1),
|
|
3176
|
+
vatNumber: z.string().regex(/^3\d{13}3$/, "VAT number must be 15 digits starting and ending with 3"),
|
|
3177
|
+
location: egsLocationSchema.optional()
|
|
3178
|
+
});
|
|
3179
|
+
const onboardEgsInputSchema = z.object({
|
|
3180
|
+
locationId: z.uuid(),
|
|
3181
|
+
otp: z.string().length(6, "OTP must be exactly 6 digits").regex(/^\d{6}$/, "OTP must be numeric")
|
|
3182
|
+
});
|
|
3183
|
+
const onboardEgsOutputSchema = z.object({
|
|
3184
|
+
egsId: z.uuid(),
|
|
3185
|
+
lastInvoiceHash: z.string(),
|
|
3186
|
+
nextInvoiceCounter: z.number().int()
|
|
3187
|
+
});
|
|
3188
|
+
const zatcaLineItemSchema = z.object({
|
|
3189
|
+
id: z.string(),
|
|
3190
|
+
name: z.string(),
|
|
3191
|
+
quantity: z.number(),
|
|
3192
|
+
taxExclusivePrice: z.number(),
|
|
3193
|
+
vatPercent: z.number(),
|
|
3194
|
+
discounts: z.array(z.object({
|
|
3195
|
+
amount: z.number(),
|
|
3196
|
+
reason: z.string().optional()
|
|
3197
|
+
})).optional(),
|
|
3198
|
+
vatCategory: z.string().optional()
|
|
3199
|
+
});
|
|
3200
|
+
const zatcaInvoicePropsSchema = z.object({
|
|
3201
|
+
invoiceCode: z.string(),
|
|
3202
|
+
invoiceType: z.string(),
|
|
3203
|
+
crnNumber: z.string(),
|
|
3204
|
+
invoiceCounterNumber: z.number().int(),
|
|
3205
|
+
invoiceSerialNumber: z.string(),
|
|
3206
|
+
issueDate: z.date(),
|
|
3207
|
+
previousInvoiceHash: z.string(),
|
|
3208
|
+
lineItems: z.array(zatcaLineItemSchema),
|
|
3209
|
+
customerInfo: z.object({
|
|
3210
|
+
vatName: z.string().optional(),
|
|
3211
|
+
vatNumber: z.string().optional()
|
|
3212
|
+
}).optional()
|
|
3213
|
+
});
|
|
3214
|
+
const reportInvoiceInputSchema = z.object({
|
|
3215
|
+
egsId: z.uuid(),
|
|
3216
|
+
invoiceProps: zatcaInvoicePropsSchema,
|
|
3217
|
+
invoiceHash: z.string()
|
|
3218
|
+
});
|
|
3219
|
+
const reportInvoiceOutputSchema = z.object({
|
|
3220
|
+
success: z.boolean(),
|
|
3221
|
+
invoiceHash: z.string(),
|
|
3222
|
+
reportingStatus: z.string()
|
|
3223
|
+
});
|
|
3224
|
+
const batchReportInputSchema = z.object({
|
|
3225
|
+
egsId: z.uuid(),
|
|
3226
|
+
invoices: z.array(zatcaInvoicePropsSchema)
|
|
3227
|
+
});
|
|
3228
|
+
const batchReportOutputSchema = z.object({
|
|
3229
|
+
results: z.array(reportInvoiceOutputSchema),
|
|
3230
|
+
total: z.number().int(),
|
|
3231
|
+
succeeded: z.number().int(),
|
|
3232
|
+
failed: z.number().int()
|
|
3233
|
+
});
|
|
3234
|
+
const zatcaInvoiceLocalSchema = z.object({
|
|
3235
|
+
id: z.uuid(),
|
|
3236
|
+
orderId: z.string().optional(),
|
|
3237
|
+
egsId: z.string(),
|
|
3238
|
+
invoiceHash: z.string().nullable().optional(),
|
|
3239
|
+
signedInvoiceB64: z.string().nullable().optional(),
|
|
3240
|
+
invoiceQrData: z.string(),
|
|
3241
|
+
invoiceCounterNumber: z.number().int(),
|
|
3242
|
+
invoiceSerialNumber: z.string(),
|
|
3243
|
+
issueDate: z.date(),
|
|
3244
|
+
previousInvoiceHash: z.string(),
|
|
3245
|
+
locationId: z.string(),
|
|
3246
|
+
lineItems: z.array(zatcaLineItemSchema),
|
|
3247
|
+
customer: z.object({
|
|
3248
|
+
vatName: z.string().optional(),
|
|
3249
|
+
vatNumber: z.string().optional()
|
|
3250
|
+
}).optional().nullable(),
|
|
3251
|
+
cancelation: z.unknown().nullable(),
|
|
3252
|
+
syncStatus: z.enum([
|
|
3253
|
+
"draft",
|
|
3254
|
+
"pending",
|
|
3255
|
+
"synced",
|
|
3256
|
+
"failed"
|
|
3257
|
+
]),
|
|
3258
|
+
syncedAt: z.date().nullable().optional(),
|
|
3259
|
+
serverInvoiceId: z.string().nullable().optional(),
|
|
3260
|
+
paymentId: z.string().optional(),
|
|
3261
|
+
createdAt: z.date()
|
|
3262
|
+
});
|
|
3263
|
+
const syncInvoicesInputSchema = z.object({
|
|
3264
|
+
egsId: z.uuid(),
|
|
3265
|
+
invoices: z.array(zatcaInvoiceLocalSchema)
|
|
3266
|
+
});
|
|
3267
|
+
const egsStatusOutputSchema = z.object({
|
|
3268
|
+
egsId: z.uuid(),
|
|
3269
|
+
deviceId: z.string(),
|
|
3270
|
+
isOnboarded: z.boolean(),
|
|
3271
|
+
lastInvoiceHash: z.string().nullable(),
|
|
3272
|
+
nextInvoiceCounter: z.number().int().nullable()
|
|
3273
|
+
});
|
|
3274
|
+
const onboardingDataOutputSchema = z.object({
|
|
3275
|
+
vatName: z.string().nullable(),
|
|
3276
|
+
vatNumber: z.string().nullable(),
|
|
3277
|
+
locationName: z.string().nullable(),
|
|
3278
|
+
locationAddress: egsLocationSchema.nullable()
|
|
3279
|
+
});
|
|
3280
|
+
const invoiceByPaymentOutputSchema = z.object({
|
|
3281
|
+
invoiceHash: z.string(),
|
|
3282
|
+
invoiceQrData: z.string(),
|
|
3283
|
+
invoiceSerialNumber: z.string(),
|
|
3284
|
+
invoiceCounterNumber: z.number().int(),
|
|
3285
|
+
issueDate: z.date(),
|
|
3286
|
+
syncStatus: z.string(),
|
|
3287
|
+
reportedAt: z.date().nullable()
|
|
3288
|
+
}).nullable();
|
|
3289
|
+
|
|
3290
|
+
//#endregion
|
|
3291
|
+
export { getEffectiveBankAccountOutputSchema as $, customerBaseSchema as $a, getMerchantInputSchema as $i, locationListSchema as $n, createVariationInputSchema as $o, orderOutputSchema as $r, uploadCatalogItemPhotoOutputSchema as $s, deliveryStatusSchema as $t, listServiceChargesInputSchema as A, discountListOutputSchema as Aa, listPaymentsInputSchema as Ai, curbsideConfigSchema as An, catalogModifierDefaultLocationOverrideSchema as Ao, checkoutResultSchema as Ar, listCatalogItemsOutputSchema as As, messageTemplateBaseSchema as At, payoutReportOverallSchema as B, bulkCustomerImportInputSchema as Ba, refundPaymentInputSchema as Bi, fulfillmentBusinessHoursOutputSchema as Bn, catalogVariationBaseSchema as Bo, orderConfigSchema as Br, unlinkItemWithImageInputSchema as Bs, createSubscriptionPlanInputSchema as Bt, taxScopes as C, anbSinglePaymentResponseSchema as Ca, baseFilterSchema as Cc, promoCodeValidationResultSchema as Ci, createAddressInputSchema as Cn, catalogCategorySchema as Co, upsertCurbsideInputSchema as Cr, linkItemWithModifierListInputSchema as Cs, sendMessageOutputSchema as Ct, chargeScopes as D, discountAutoApplyScopes as Da, sortDirectionSchema as Dc, getPaymentInputSchema as Di, createLocationInputSchema as Dn, catalogItemFilterSchema as Do, upsertLocationBusinessHoursInputSchema as Dr, listCatalogCategoriesWithItemsInputSchema as Ds, defaultMessageTemplateSort as Dt, chargeAutoApplyScopes as E, createDiscountInputSchema as Ea, defaultTimeSort as Ec, gatewayIds as Ei, createDeliveryWindowInputSchema as En, catalogItemDetailSchema as Eo, upsertFulfillmentBusinessHoursInputSchema as Er, listCatalogCategoriesOutputSchema as Es, createMessageTemplateInputSchema as Et, updateServiceChargeInputSchema as F, updateDiscountInputSchema as Fa, paymentSourceSchema as Fi, deleteLocationInputSchema as Fn, catalogModifierListFilterSchema as Fo, getOrderConfigInputSchema as Fr, listCatalogVariationsInputSchema as Fs, templateHelperSchema as Ft, companyPayoutAccountSchema as G, createCustomerManualInputSchema as Ga, paymentMethodIds as Gi, listAvailableWhatsAppGroupsOutputSchema as Gn, createImageInputSchema as Go, orderFulfillmentOutputSchema as Gr, updateItemOutputSchema as Gs, updateSubscriptionPlanInputSchema as Gt, payoutReportSummarySchema as H, bulkCustomerImportRowClientSchema as Ha, setPaidOutputSchema as Hi, linkWhatsAppGroupInputSchema as Hn, catalogVariationWithDefaultSchema as Ho, orderEntitiesSchema as Hr, updateCategoryInputSchema as Hs, merchantSubscriptionSchema as Ht, payoutReportFulfillmentSchema as I, bulkCustomerExportInputSchema as Ia, paymentStatuses as Ii, deleteLocationOutputSchema as In, catalogModifierListSummarySchema as Io, listOrdersInputSchema as Ir, listCatalogVariationsOutputSchema as Is, templateVariableCategorySchema as It, deleteCompanyPayoutAccountInputSchema as J, createMerchantCustomerManualOutputSchema as Ja, preferredContactTimeSchema as Ji, listLocationsInputSchema as Jn, createItemOutputSchema as Jo, orderFulfillmentTypes as Jr, updateModifierListOutputSchema as Js, createIntegrationInputSchema as Jt, createCompanyPayoutAccountInputSchema as K, createCustomerManualOutputSchema as Ka, createLeadInputSchema as Ki, listLocationWhatsAppGroupsInputSchema as Kn, createImageOutputSchema as Ko, orderFulfillmentSchema as Kr, updateModifierInputSchema as Ks, connectIntegrationInputSchema as Kt, payoutReportInputSchema as L, bulkCustomerExportResultSchema as La, recordPaymentInputSchema as Li, deleteWhatsAppGroupInputSchema as Ln, catalogModifierLocationOverrideSchema as Lo, listOrdersOutputSchema as Lr, modifierOverrideTypeValues as Ls, templateVariableSchema as Lt, serviceChargeIdInputSchema as M, discountScopes as Ma, paymentFilterSchema as Mi, defaultLocationSort as Mn, catalogModifierItemOverrideSchema as Mo, defaultOrderSort as Mr, listCatalogModifierListsOutputSchema as Ms, messageTemplateFilterSchema as Mt, serviceChargeListOutputSchema as N, discountTypes as Na, paymentListItemSchema as Ni, deleteFulfillmentBusinessHoursInputSchema as Nn, catalogModifierListBaseSchema as No, fetchOrderByIdOutputSchema as Nr, listCatalogModifiersInputSchema as Ns, messageTemplateOutputSchema as Nt, chargeTypes as O, discountBaseSchema as Oa, sortSchema as Oc, initiatePaymentInputSchema as Oi, createWhatsAppGroupInputSchema as On, catalogItemSummarySchema as Oo, upsertLocationThemeInputSchema as Or, listCatalogCategoriesWithItemsOutputSchema as Os, listMessageTemplatesInputSchema as Ot, serviceChargeOutputSchema as P, listDiscountsInputSchema as Pa, paymentOutputSchema as Pi, deleteLocationBusinessHoursInputSchema as Pn, catalogModifierListDetailSchema as Po, getOrderByIdInputSchema as Pr, listCatalogModifiersOutputSchema as Ps, messageTemplateProviderEnum as Pt, getEffectiveBankAccountInputSchema as Q, customerAddressOutputSchema as Qa, deleteMerchantAccountOutputSchema as Qi, locationIdInputSchema as Qn, createModifierOutputSchema as Qo, orderModifierSchema as Qr, uploadCatalogItemPhotoInputSchema as Qs, deliveryProviderSchema as Qt, payoutReportOrderSchema as R, bulkCustomerExportRowSchema as Ra, refundOrderInputSchema as Ri, deliveryConfigSchema as Rn, catalogPriceRangeSchema as Ro, orderAmountSchema as Rr, mutationIdOutputSchema as Rs, updateMessageTemplateInputSchema as Rt, taxOutputSchema as S, anbSinglePaymentRequestSchema as Sa, updateBannerInputSchema as Sc, promoCodeValidationInputSchema as Si, createAddressForLocationInputSchema as Sn, catalogCategoryFilterSchema as So, uploadLocationPhotoOutputSchema as Sr, linkItemWithImageInputSchema as Ss, sendMessageInputSchema as St, updateTaxInputSchema as T, mapAnbStatusToPayoutStatus as Ta, baseListOutputSchema as Tc, codPaymentTypeIds as Ti, createDeliveryConfigInputSchema as Tn, catalogFoodIngredientValues as To, upsertDineInInputSchema as Tr, listCatalogCategoriesInputSchema as Ts, availableTemplateResourcesSchema as Tt, bankAccountSchema as U, bulkCustomerImportRowSchema as Ua, acceptedPaymentIds as Ui, linkWhatsAppGroupOutputSchema as Un, createCategoryInputSchema as Uo, orderFilterSchema as Ur, updateCategoryOutputSchema as Us, sendMerchantInvoiceInputSchema as Ut, payoutReportPaymentSchema as V, bulkCustomerImportResultSchema as Va, setPaidInputSchema as Vi, fulfillmentTypeEnum as Vn, catalogVariationFilterSchema as Vo, orderCustomerSchema as Vr, unlinkItemWithModifierListInputSchema as Vs, merchantInvoiceSchema as Vt, calculatePayoutOutputSchema as W, createCustomerAddressInputSchema as Wa, paymentGatewayIds as Wi, listAvailableWhatsAppGroupsInputSchema as Wn, createCategoryOutputSchema as Wo, orderFulfillmentHistorySchema as Wr, updateItemInputSchema as Ws, subscriptionPlanSchema as Wt, getBankAccountOutputSchema as X, customerAddressByIdInputSchema as Xa, createMerchantOutputSchema as Xi, locationAddressSchema as Xn, createModifierListInputSchema as Xo, orderLineItemInputSchema as Xr, updateVariationInputSchema as Xs, deleteIntegrationInputSchema as Xt, getBankAccountInputSchema as Y, customerAddressBaseSchema as Ya, createMerchantInputSchema as Yi, listLocationsOutputSchema as Yn, createModifierInputSchema as Yo, orderGatewayIds as Yr, updateModifierOutputSchema as Ys, createIntegrationOutputSchema as Yt, getCompanyPayoutAccountInputSchema as Z, customerAddressFilterSchema as Za, deleteMerchantAccountInputSchema as Zi, locationFilterSchema as Zn, createModifierListOutputSchema as Zo, orderLineItemSchema as Zr, updateVariationOutputSchema as Zs, deliveryBaseSchema as Zt, listTaxesInputSchema as _, socialPlatformsEnum as _a, bannerStatusSchema as _c, promoCodeFilterSchema as _i, setIntegrationStatusInputSchema as _n, merchantCustomerOutputSchema as _o, updateProviderInputSchema as _r, getModifierInputSchema as _s, getSmsBalanceOutputSchema as _t, egsStatusOutputSchema as a, merchantIdInputSchema as aa, upsertModifierOverrideInputSchema as ac, scheduleTypeEnum as ai, integrationProviderSchema as an, defaultMerchantCustomerSort as ao, pickupConfigSchema as ar, deleteModifierInputSchema as as, listPayoutsOutputSchema as at, taxIdInputSchema as b, anbPaymentStatusSchema as ba, listBannersInputSchema as bc, promoCodeOutputSchema as bi, addProviderInputSchema as bn, catalogAvailabilityValues as bo, uploadLocationBannerOutputSchema as br, getModifierOutputSchema as bs, sendDirectMessageInputSchema as bt, onboardEgsOutputSchema as c, merchantListItemSchema as ca, translationFieldSchema as cc, validatePromoCodeForOrderResultSchema as ci, leajlakConfigSchema as cn, listCustomerAddressesInputSchema as co, removeCurbsideSpotInputSchema as cr, deleteModifierOutputSchema as cs, payoutSchema as ct, reportInvoiceOutputSchema as d, updateMerchantInputSchema as da, activeBannerListOutputSchema as dc, listPromoCodesInputSchema as di, localConfigSchema as dn, listCustomersOutputSchema as do, removeProviderInputSchema as dr, deleteVariationInputSchema as ds, unsettledBalanceSchema as dt, listMerchantsInputSchema as ea, upsertItemLocationOverrideInputSchema as ec, orderPromocodeInputSchema as ei, disconnectIntegrationInputSchema as en, customerByIdInputSchema as eo, locationMeatSourceSchema as er, createVariationOutputSchema as es, getLocationBalanceInputSchema as et, syncInvoicesInputSchema as f, uploadMerchantCrnDocInputSchema as fa, activeBannerOutputSchema as fc, promoCodeAmountSchema as fi, merchantIntegrationBaseSchema as fn, listMerchantCustomersInputSchema as fo, temporaryClosureInputSchema as fr, deleteVariationOutputSchema as fs, updateCompanyPayoutAccountInputSchema as ft, createTaxInputSchema as g, socialIdInputSchema as ga, bannerOutputSchema as gc, promoCodeDiscountTypes as gi, qmileConfigSchema as gn, merchantCustomerFilterSchema as go, updateLocationInputSchema as gr, getCategoryOutputSchema as gs, getSmsBalanceInputSchema as gt, zatcaLineItemSchema as h, socialBaseSchema as ha, bannerListOutputSchema as hc, promoCodeConfigurationSchema as hi, providerConfigSchema as hn, merchantCustomerByIdInputSchema as ho, updateDeliveryConfigInputSchema as hr, getCategoryInputSchema as hs, calculateSmsCostOutputSchema as ht, egsLocationSchema as i, merchantFullDetailsSchema as ia, upsertModifierLocationOverrideInputSchema as ic, orderSummarySchema as ii, integrateLocationOutputSchema as in, defaultCustomerSort as io, locationWhatsAppGroupSchema as ir, deleteItemOutputSchema as is, listPayoutsInputSchema as it, serviceChargeBaseSchema as j, discountOutputSchema as ja, listPaymentsOutputSchema as ji, curbsideSpotSchema as jn, catalogModifierFilterSchema as jo, createOrderInputSchema as jr, listCatalogModifierListsInputSchema as js, messageTemplateByIdInputSchema as jt, createServiceChargeInputSchema as k, discountIdInputSchema as ka, paginationSchema as kc, initiatePaymentOutputSchema as ki, createWhatsAppGroupOutputSchema as kn, catalogModifierBaseSchema as ko, upsertPickupInputSchema as kr, listCatalogItemsInputSchema as ks, listMessageTemplatesOutputSchema as kt, onboardingDataOutputSchema as l, merchantSummarySchema as la, businessHoursPeriodSchema as lc, createPromoCodeInputSchema as li, listIntegrationsInputSchema as ln, listCustomerAddressesOutputSchema as lo, removeDeliveryInputSchema as lr, deleteModifierOverrideInputSchema as ls, payoutStatusSchema as lt, zatcaInvoicePropsSchema as m, createSocialInputSchema as ma, bannerIdInputSchema as mc, promoCodeBaseSchema as mi, posProviderSchema as mn, merchantCustomerBaseSchema as mo, themeSchema as mr, getCatalogItemOutputSchema as ms, calculateSmsCostInputSchema as mt, batchReportOutputSchema as n, merchantBaseSchema as na, upsertModifierDefaultLocationOverrideInputSchema as nc, orderSchema as ni, getIntegrationOutputSchema as nn, customerOutputSchema as no, locationSchema as nr, deleteCategoryOutputSchema as ns, getPayoutInputSchema as nt, invoiceByPaymentOutputSchema as o, merchantIntegrationSchema as oa, upsertModifierOverrideOutputSchema as oc, updateFulfillmentInputSchema as oi, integrationStatusSchema as on, deleteCustomerInputSchema as oo, providerPricingConfigSchema as or, deleteModifierListInputSchema as os, locationBalanceSchema as ot, zatcaInvoiceLocalSchema as p, uploadMerchantVatDocInputSchema as pa, approveBannerInputSchema as pc, promoCodeApplicationTargets as pi, parcelConfigSchema as pn, listMerchantCustomersOutputSchema as po, temporaryClosureOutputSchema as pr, getCatalogItemInputSchema as ps, upsertBankAccountInputSchema as pt, createPayoutInputSchema as q, createMerchantCustomerManualInputSchema as qa, createLeadOutputSchema as qi, listLocationWhatsAppGroupsOutputSchema as qn, createItemInputSchema as qo, orderFulfillmentStateValues as qr, updateModifierListInputSchema as qs, connectIntegrationOutputSchema as qt, egsInfoSchema as r, merchantFilterSchema as ra, upsertModifierInputSchema as rc, orderSourceSchema as ri, integrateLocationInputSchema as rn, defaultCustomerAddressSort as ro, locationStatusFilterSchema as rr, deleteItemInputSchema as rs, listCompanyPayoutAccountsInputSchema as rt, onboardEgsInputSchema as s, merchantLegalDetailsSchema as sa, upsertVariationLocationOverrideInputSchema as sc, upsertOrderConfigInputSchema as si, integrationTypeSchema as sn, deleteMerchantCustomerInputSchema as so, providerStrategyEnum as sr, deleteModifierListOutputSchema as ss, payoutProviderSchema as st, batchReportInputSchema as t, listMerchantsOutputSchema as ta, upsertItemModifierOverrideInputSchema as tc, orderPromocodeSummarySchema as ti, getIntegrationInputSchema as tn, customerFilterSchema as to, locationMutationOutputSchema as tr, deleteCategoryInputSchema as ts, getLocationBalanceOutputSchema as tt, reportInvoiceInputSchema as u, merchantSyncEventSchema as ua, businessHoursSchema as uc, defaultPromoCodeSort as ui, listIntegrationsOutputSchema as un, listCustomersInputSchema as uo, removeLocationThemeInputSchema as ur, deleteModifierOverrideOutputSchema as us, unsettledBalanceItemSchema as ut, taxAutoApplyScopes as v, updateSocialInputSchema as va, createBannerInputSchema as vc, promoCodeIdInputSchema as vi, setIntegrationStatusOutputSchema as vn, upsertCustomerInputSchema as vo, updateWhatsAppGroupInputSchema as vr, getModifierListInputSchema as vs, messageProviderEnum as vt, taxTypes as w, anbWebhookPayloadSchema as wa, baseListInputSchema as wc, updatePromoCodeInputSchema as wi, createDeliveryConfigForLocationInputSchema as wn, catalogDietaryPreferenceValues as wo, upsertDeliveryInputSchema as wr, linkOperationOutputSchema as ws, smsProviderEnum as wt, taxListOutputSchema as x, anbSinglePaymentInitiationResponseSchema as xa, placementSchema as xc, promoCodeScopes as xi, availableWhatsAppGroupSchema as xn, catalogCategoryBaseSchema as xo, uploadLocationPhotoInputSchema as xr, linkItemWithCategoryInputSchema as xs, sendDirectMessageOutputSchema as xt, taxBaseSchema as y, anbPaymentStatusResponseSchema as ya, listActiveBannersInputSchema as yc, promoCodeListOutputSchema as yi, addCurbsideSpotInputSchema as yn, catalogAmountSchema as yo, uploadLocationBannerInputSchema as yr, getModifierListOutputSchema as ys, messageScopeEnum as yt, payoutReportOutputSchema as z, bulkCustomerImportErrorSchema as za, refundOrderOutputSchema as zi, dineInConfigSchema as zn, catalogSelectionTypeValues as zo, orderByIdOutputSchema as zr, unlinkItemWithCategoryInputSchema as zs, createMerchantInvoiceInputSchema as zt };
|