@instockng/api-client 1.0.7 → 1.0.8
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/apps/backend/src/http-app.js +28 -0
- package/dist/apps/backend/src/lib/brand-response.d.ts +1 -1
- package/dist/apps/backend/src/lib/cart-helpers.d.ts +13 -11
- package/dist/apps/backend/src/lib/cart-helpers.js +28 -0
- package/dist/apps/backend/src/lib/cart-response.d.ts +5 -5
- package/dist/apps/backend/src/lib/clerk.js +23 -0
- package/dist/apps/backend/src/lib/delivery-zone-response.d.ts +6 -4
- package/dist/apps/backend/src/lib/discount-code-response.d.ts +2 -2
- package/dist/apps/backend/src/lib/meta-capi.d.ts +5 -0
- package/dist/apps/backend/src/lib/meta-capi.js +33 -2
- package/dist/apps/backend/src/lib/order-recovery.d.ts +30 -24
- package/dist/apps/backend/src/lib/order-response.d.ts +9 -7
- package/dist/apps/backend/src/lib/product-response.d.ts +4 -4
- package/dist/apps/backend/src/lib/sentry.d.ts +48 -0
- package/dist/apps/backend/src/lib/sentry.js +180 -0
- package/dist/apps/backend/src/notifications/producers/meta-capi-producer.js +18 -4
- package/dist/apps/backend/src/routes/admin/abandoned-carts.d.ts +10 -10
- package/dist/apps/backend/src/routes/admin/brands.d.ts +4 -4
- package/dist/apps/backend/src/routes/admin/customers.d.ts +9 -7
- package/dist/apps/backend/src/routes/admin/delivery-zones.d.ts +23 -15
- package/dist/apps/backend/src/routes/admin/discount-codes.d.ts +10 -10
- package/dist/apps/backend/src/routes/admin/inventory.js +10 -0
- package/dist/apps/backend/src/routes/admin/orders.d.ts +54 -42
- package/dist/apps/backend/src/routes/admin/orders.js +25 -0
- package/dist/apps/backend/src/routes/admin/products.d.ts +12 -12
- package/dist/apps/backend/src/routes/admin/products.js +34 -15
- package/dist/apps/backend/src/routes/admin/stats.d.ts +9 -7
- package/dist/apps/backend/src/routes/admin/variants.d.ts +5 -5
- package/dist/apps/backend/src/routes/admin/variants.js +42 -18
- package/dist/apps/backend/src/routes/admin/warehouses.d.ts +7 -7
- package/dist/apps/backend/src/routes/public/brands.d.ts +1 -1
- package/dist/apps/backend/src/routes/public/carts.d.ts +49 -47
- package/dist/apps/backend/src/routes/public/carts.js +148 -1
- package/dist/apps/backend/src/routes/public/delivery-zones.d.ts +2 -0
- package/dist/apps/backend/src/routes/public/delivery-zones.js +2 -0
- package/dist/apps/backend/src/routes/public/orders.d.ts +18 -14
- package/dist/apps/backend/src/routes/public/orders.js +24 -0
- package/dist/apps/backend/src/routes/public/products.d.ts +6 -6
- package/dist/apps/backend/src/types/index.d.ts +1 -0
- package/dist/apps/backend/src/validators/delivery-zone.d.ts +4 -0
- package/dist/apps/backend/src/validators/delivery-zone.js +4 -0
- package/dist/apps/backend/src/validators/discount-code.d.ts +3 -3
- package/dist/apps/backend/src/validators/order.d.ts +3 -1
- package/dist/apps/backend/src/validators/order.js +3 -1
- package/dist/packages/api-client/src/fetchers/brands.d.ts +1 -1
- package/dist/packages/api-client/src/fetchers/carts.d.ts +49 -47
- package/dist/packages/api-client/src/fetchers/delivery-zones.d.ts +2 -0
- package/dist/packages/api-client/src/fetchers/orders.d.ts +18 -14
- package/dist/packages/api-client/src/fetchers/products.d.ts +6 -6
- package/dist/packages/api-client/src/hooks/admin/abandoned-carts.d.ts +10 -10
- package/dist/packages/api-client/src/hooks/admin/brands.d.ts +4 -4
- package/dist/packages/api-client/src/hooks/admin/customers.d.ts +9 -7
- package/dist/packages/api-client/src/hooks/admin/delivery-zones.d.ts +23 -15
- package/dist/packages/api-client/src/hooks/admin/discount-codes.d.ts +10 -10
- package/dist/packages/api-client/src/hooks/admin/orders.d.ts +54 -42
- package/dist/packages/api-client/src/hooks/admin/products.d.ts +6 -6
- package/dist/packages/api-client/src/hooks/admin/stats.d.ts +9 -7
- package/dist/packages/api-client/src/hooks/admin/variants.d.ts +5 -5
- package/dist/packages/api-client/src/hooks/admin/warehouses.d.ts +7 -7
- package/dist/packages/api-client/src/hooks/public/brands.d.ts +1 -1
- package/dist/packages/api-client/src/hooks/public/carts.d.ts +49 -47
- package/dist/packages/api-client/src/hooks/public/delivery-zones.d.ts +2 -0
- package/dist/packages/api-client/src/hooks/public/orders.d.ts +18 -14
- package/dist/packages/api-client/src/hooks/public/products.d.ts +6 -6
- package/dist/packages/api-client/src/rpc-client.d.ts +219 -187
- package/package.json +1 -1
|
@@ -41,8 +41,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
|
|
|
41
41
|
createdAt: string;
|
|
42
42
|
updatedAt: string;
|
|
43
43
|
deletedAt: string;
|
|
44
|
-
name: string;
|
|
45
44
|
id: string;
|
|
45
|
+
name: string;
|
|
46
46
|
slug: string;
|
|
47
47
|
logoUrl: string | null;
|
|
48
48
|
siteUrl: string;
|
|
@@ -59,18 +59,20 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
|
|
|
59
59
|
createdAt: string;
|
|
60
60
|
updatedAt: string;
|
|
61
61
|
deletedAt: string;
|
|
62
|
-
name: string;
|
|
63
62
|
id: string;
|
|
63
|
+
name: string;
|
|
64
64
|
isActive: boolean;
|
|
65
65
|
};
|
|
66
|
-
name: string;
|
|
67
66
|
id: string;
|
|
67
|
+
name: string;
|
|
68
68
|
brandId: string | null;
|
|
69
69
|
stateId: string;
|
|
70
70
|
allowCOD: boolean;
|
|
71
71
|
allowOnline: boolean;
|
|
72
72
|
waybillOnly: boolean;
|
|
73
73
|
estimatedDays: number | null;
|
|
74
|
+
noteTitle: string | null;
|
|
75
|
+
noteContent: string | null;
|
|
74
76
|
isActive: boolean;
|
|
75
77
|
};
|
|
76
78
|
items: {
|
|
@@ -84,8 +86,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
|
|
|
84
86
|
createdAt: string;
|
|
85
87
|
updatedAt: string;
|
|
86
88
|
deletedAt: string;
|
|
87
|
-
name: string;
|
|
88
89
|
id: string;
|
|
90
|
+
name: string;
|
|
89
91
|
slug: string;
|
|
90
92
|
brandId: string;
|
|
91
93
|
isActive: boolean;
|
|
@@ -237,8 +239,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
|
|
|
237
239
|
};
|
|
238
240
|
};
|
|
239
241
|
};
|
|
240
|
-
name: string | null;
|
|
241
242
|
id: string;
|
|
243
|
+
name: string | null;
|
|
242
244
|
isActive: boolean;
|
|
243
245
|
thumbnailUrl: string | null;
|
|
244
246
|
productId: string;
|
|
@@ -250,8 +252,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
|
|
|
250
252
|
createdAt: string;
|
|
251
253
|
updatedAt: string;
|
|
252
254
|
deletedAt: string;
|
|
253
|
-
name: string;
|
|
254
255
|
id: string;
|
|
256
|
+
name: string;
|
|
255
257
|
isActive: boolean;
|
|
256
258
|
address: string | null;
|
|
257
259
|
city: string | null;
|
|
@@ -263,8 +265,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
|
|
|
263
265
|
warehouseId: string | null;
|
|
264
266
|
quantity: number;
|
|
265
267
|
}[];
|
|
266
|
-
id: string;
|
|
267
268
|
email: string | null;
|
|
269
|
+
id: string;
|
|
268
270
|
brandId: string;
|
|
269
271
|
deliveryZoneId: string;
|
|
270
272
|
recoveryAttempts: number;
|
|
@@ -343,8 +345,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
|
|
|
343
345
|
createdAt: string;
|
|
344
346
|
updatedAt: string;
|
|
345
347
|
deletedAt: string;
|
|
346
|
-
name: string;
|
|
347
348
|
id: string;
|
|
349
|
+
name: string;
|
|
348
350
|
slug: string;
|
|
349
351
|
logoUrl: string | null;
|
|
350
352
|
siteUrl: string;
|
|
@@ -361,18 +363,20 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
|
|
|
361
363
|
createdAt: string;
|
|
362
364
|
updatedAt: string;
|
|
363
365
|
deletedAt: string;
|
|
364
|
-
name: string;
|
|
365
366
|
id: string;
|
|
367
|
+
name: string;
|
|
366
368
|
isActive: boolean;
|
|
367
369
|
};
|
|
368
|
-
name: string;
|
|
369
370
|
id: string;
|
|
371
|
+
name: string;
|
|
370
372
|
brandId: string | null;
|
|
371
373
|
stateId: string;
|
|
372
374
|
allowCOD: boolean;
|
|
373
375
|
allowOnline: boolean;
|
|
374
376
|
waybillOnly: boolean;
|
|
375
377
|
estimatedDays: number | null;
|
|
378
|
+
noteTitle: string | null;
|
|
379
|
+
noteContent: string | null;
|
|
376
380
|
isActive: boolean;
|
|
377
381
|
};
|
|
378
382
|
items: {
|
|
@@ -386,8 +390,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
|
|
|
386
390
|
createdAt: string;
|
|
387
391
|
updatedAt: string;
|
|
388
392
|
deletedAt: string;
|
|
389
|
-
name: string;
|
|
390
393
|
id: string;
|
|
394
|
+
name: string;
|
|
391
395
|
slug: string;
|
|
392
396
|
brandId: string;
|
|
393
397
|
isActive: boolean;
|
|
@@ -539,8 +543,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
|
|
|
539
543
|
};
|
|
540
544
|
};
|
|
541
545
|
};
|
|
542
|
-
name: string | null;
|
|
543
546
|
id: string;
|
|
547
|
+
name: string | null;
|
|
544
548
|
isActive: boolean;
|
|
545
549
|
thumbnailUrl: string | null;
|
|
546
550
|
productId: string;
|
|
@@ -552,8 +556,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
|
|
|
552
556
|
createdAt: string;
|
|
553
557
|
updatedAt: string;
|
|
554
558
|
deletedAt: string;
|
|
555
|
-
name: string;
|
|
556
559
|
id: string;
|
|
560
|
+
name: string;
|
|
557
561
|
isActive: boolean;
|
|
558
562
|
address: string | null;
|
|
559
563
|
city: string | null;
|
|
@@ -565,8 +569,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
|
|
|
565
569
|
warehouseId: string | null;
|
|
566
570
|
quantity: number;
|
|
567
571
|
}[];
|
|
568
|
-
id: string;
|
|
569
572
|
email: string | null;
|
|
573
|
+
id: string;
|
|
570
574
|
brandId: string;
|
|
571
575
|
deliveryZoneId: string;
|
|
572
576
|
recoveryAttempts: number;
|
|
@@ -6,6 +6,7 @@ import { confirmProspectOrder } from '../../lib/order-recovery';
|
|
|
6
6
|
import { formatOrderResponse } from '../../lib/order-response';
|
|
7
7
|
import { enqueueOrderNotification } from '../../notifications/producers/order-notification';
|
|
8
8
|
import { OrderStatus } from '@prisma/client';
|
|
9
|
+
import { captureException } from '../../lib/sentry';
|
|
9
10
|
const app = new Hono()
|
|
10
11
|
// GET order by ID and token (for order tracking and confirmation)
|
|
11
12
|
.get('/:id/:token', zValidator('param', z.object({
|
|
@@ -66,6 +67,17 @@ const app = new Hono()
|
|
|
66
67
|
return c.json({ ...formattedOrder, canConfirm, confirmationMessage }, 200);
|
|
67
68
|
}
|
|
68
69
|
catch (error) {
|
|
70
|
+
captureException(error instanceof Error ? error : new Error(String(error)), {
|
|
71
|
+
level: 'error',
|
|
72
|
+
tags: {
|
|
73
|
+
error_code: 'ORDER_FETCH_ERROR',
|
|
74
|
+
endpoint: 'GET /orders/:id/:token',
|
|
75
|
+
},
|
|
76
|
+
extra: {
|
|
77
|
+
orderId: c.req.param('id'),
|
|
78
|
+
},
|
|
79
|
+
honoContext: c,
|
|
80
|
+
});
|
|
69
81
|
return c.json({ error: { code: 'INTERNAL_ERROR', message: 'Failed to retrieve order' } }, 500);
|
|
70
82
|
}
|
|
71
83
|
})
|
|
@@ -149,6 +161,18 @@ const app = new Hono()
|
|
|
149
161
|
}
|
|
150
162
|
}, 400);
|
|
151
163
|
}
|
|
164
|
+
// CRITICAL: Order confirmation failures affect customer experience
|
|
165
|
+
captureException(error instanceof Error ? error : new Error(String(error)), {
|
|
166
|
+
level: 'fatal', // High severity - customer waiting for order
|
|
167
|
+
tags: {
|
|
168
|
+
error_code: 'ORDER_CONFIRM_ERROR',
|
|
169
|
+
endpoint: 'POST /orders/confirm',
|
|
170
|
+
},
|
|
171
|
+
extra: {
|
|
172
|
+
orderId: c.req.valid('json').orderId,
|
|
173
|
+
},
|
|
174
|
+
honoContext: c,
|
|
175
|
+
});
|
|
152
176
|
return c.json({
|
|
153
177
|
error: {
|
|
154
178
|
code: 'INTERNAL_ERROR',
|
|
@@ -26,8 +26,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
|
|
|
26
26
|
createdAt: string;
|
|
27
27
|
updatedAt: string;
|
|
28
28
|
deletedAt: string;
|
|
29
|
-
name: string;
|
|
30
29
|
id: string;
|
|
30
|
+
name: string;
|
|
31
31
|
slug: string;
|
|
32
32
|
logoUrl: string | null;
|
|
33
33
|
siteUrl: string;
|
|
@@ -39,8 +39,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
|
|
|
39
39
|
updatedAt: string;
|
|
40
40
|
price: number;
|
|
41
41
|
deletedAt: string;
|
|
42
|
-
name: string | null;
|
|
43
42
|
id: string;
|
|
43
|
+
name: string | null;
|
|
44
44
|
isActive: boolean;
|
|
45
45
|
thumbnailUrl: string | null;
|
|
46
46
|
productId: string;
|
|
@@ -48,8 +48,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
|
|
|
48
48
|
trackInventory: boolean;
|
|
49
49
|
lowStockThreshold: number | null;
|
|
50
50
|
}[];
|
|
51
|
-
name: string;
|
|
52
51
|
id: string;
|
|
52
|
+
name: string;
|
|
53
53
|
slug: string;
|
|
54
54
|
createdAt: string;
|
|
55
55
|
updatedAt: string;
|
|
@@ -249,8 +249,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
|
|
|
249
249
|
createdAt: string;
|
|
250
250
|
updatedAt: string;
|
|
251
251
|
deletedAt: string;
|
|
252
|
-
name: string;
|
|
253
252
|
id: string;
|
|
253
|
+
name: string;
|
|
254
254
|
slug: string;
|
|
255
255
|
logoUrl: string | null;
|
|
256
256
|
siteUrl: string;
|
|
@@ -262,8 +262,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
|
|
|
262
262
|
updatedAt: string;
|
|
263
263
|
price: number;
|
|
264
264
|
deletedAt: string;
|
|
265
|
-
name: string | null;
|
|
266
265
|
id: string;
|
|
266
|
+
name: string | null;
|
|
267
267
|
isActive: boolean;
|
|
268
268
|
thumbnailUrl: string | null;
|
|
269
269
|
productId: string;
|
|
@@ -271,8 +271,8 @@ declare const app: import("hono/hono-base").HonoBase<AppContext, {
|
|
|
271
271
|
trackInventory: boolean;
|
|
272
272
|
lowStockThreshold: number | null;
|
|
273
273
|
}[];
|
|
274
|
-
name: string;
|
|
275
274
|
id: string;
|
|
275
|
+
name: string;
|
|
276
276
|
slug: string;
|
|
277
277
|
createdAt: string;
|
|
278
278
|
updatedAt: string;
|
|
@@ -17,6 +17,8 @@ export declare const createDeliveryZoneSchema: z.ZodObject<{
|
|
|
17
17
|
allowOnline: z.ZodOptional<z.ZodBoolean>;
|
|
18
18
|
waybillOnly: z.ZodOptional<z.ZodBoolean>;
|
|
19
19
|
estimatedDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
20
|
+
noteTitle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
21
|
+
noteContent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
20
22
|
isActive: z.ZodOptional<z.ZodBoolean>;
|
|
21
23
|
}, z.core.$strip>;
|
|
22
24
|
export declare const updateDeliveryZoneSchema: z.ZodObject<{
|
|
@@ -27,5 +29,7 @@ export declare const updateDeliveryZoneSchema: z.ZodObject<{
|
|
|
27
29
|
allowOnline: z.ZodOptional<z.ZodBoolean>;
|
|
28
30
|
waybillOnly: z.ZodOptional<z.ZodBoolean>;
|
|
29
31
|
estimatedDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
32
|
+
noteTitle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
33
|
+
noteContent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
30
34
|
isActive: z.ZodOptional<z.ZodBoolean>;
|
|
31
35
|
}, z.core.$strip>;
|
|
@@ -18,6 +18,8 @@ export const createDeliveryZoneSchema = z
|
|
|
18
18
|
allowOnline: z.boolean().optional(),
|
|
19
19
|
waybillOnly: z.boolean().optional(),
|
|
20
20
|
estimatedDays: z.number().int().positive().nullable().optional(),
|
|
21
|
+
noteTitle: z.string().nullable().optional(),
|
|
22
|
+
noteContent: z.string().nullable().optional(),
|
|
21
23
|
isActive: z.boolean().optional(),
|
|
22
24
|
})
|
|
23
25
|
.refine((data) => {
|
|
@@ -38,6 +40,8 @@ export const updateDeliveryZoneSchema = z
|
|
|
38
40
|
allowOnline: z.boolean().optional(),
|
|
39
41
|
waybillOnly: z.boolean().optional(),
|
|
40
42
|
estimatedDays: z.number().int().positive().nullable().optional(),
|
|
43
|
+
noteTitle: z.string().nullable().optional(),
|
|
44
|
+
noteContent: z.string().nullable().optional(),
|
|
41
45
|
isActive: z.boolean().optional(),
|
|
42
46
|
})
|
|
43
47
|
.refine((data) => {
|
|
@@ -9,8 +9,8 @@ export declare const createDiscountCodeSchema: z.ZodObject<{
|
|
|
9
9
|
value: z.ZodNumber;
|
|
10
10
|
description: z.ZodOptional<z.ZodString>;
|
|
11
11
|
category: z.ZodDefault<z.ZodEnum<{
|
|
12
|
-
recovery: "recovery";
|
|
13
12
|
manual: "manual";
|
|
13
|
+
recovery: "recovery";
|
|
14
14
|
influencer: "influencer";
|
|
15
15
|
seasonal: "seasonal";
|
|
16
16
|
referral: "referral";
|
|
@@ -33,8 +33,8 @@ export declare const updateDiscountCodeSchema: z.ZodObject<{
|
|
|
33
33
|
value: z.ZodOptional<z.ZodNumber>;
|
|
34
34
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
35
35
|
category: z.ZodOptional<z.ZodEnum<{
|
|
36
|
-
recovery: "recovery";
|
|
37
36
|
manual: "manual";
|
|
37
|
+
recovery: "recovery";
|
|
38
38
|
influencer: "influencer";
|
|
39
39
|
seasonal: "seasonal";
|
|
40
40
|
referral: "referral";
|
|
@@ -59,8 +59,8 @@ export declare const bulkGenerateCodesSchema: z.ZodObject<{
|
|
|
59
59
|
value: z.ZodNumber;
|
|
60
60
|
description: z.ZodOptional<z.ZodString>;
|
|
61
61
|
category: z.ZodDefault<z.ZodEnum<{
|
|
62
|
-
recovery: "recovery";
|
|
63
62
|
manual: "manual";
|
|
63
|
+
recovery: "recovery";
|
|
64
64
|
influencer: "influencer";
|
|
65
65
|
seasonal: "seasonal";
|
|
66
66
|
referral: "referral";
|
|
@@ -3,6 +3,7 @@ export declare const createOrderSchema: z.ZodObject<{
|
|
|
3
3
|
brandSlug: z.ZodString;
|
|
4
4
|
firstName: z.ZodString;
|
|
5
5
|
lastName: z.ZodString;
|
|
6
|
+
email: z.ZodOptional<z.ZodString>;
|
|
6
7
|
phone: z.ZodString;
|
|
7
8
|
address: z.ZodString;
|
|
8
9
|
city: z.ZodString;
|
|
@@ -13,13 +14,14 @@ export declare const createOrderSchema: z.ZodObject<{
|
|
|
13
14
|
quantity: z.ZodNumber;
|
|
14
15
|
}, z.core.$strip>>;
|
|
15
16
|
discount: z.ZodOptional<z.ZodNumber>;
|
|
16
|
-
paymentMethod:
|
|
17
|
+
paymentMethod: z.ZodOptional<z.ZodString>;
|
|
17
18
|
paystackReference: z.ZodOptional<z.ZodString>;
|
|
18
19
|
}, z.core.$strip>;
|
|
19
20
|
export declare const updateOrderSchema: z.ZodObject<{
|
|
20
21
|
brandSlug: z.ZodOptional<z.ZodString>;
|
|
21
22
|
firstName: z.ZodOptional<z.ZodString>;
|
|
22
23
|
lastName: z.ZodOptional<z.ZodString>;
|
|
24
|
+
email: z.ZodOptional<z.ZodString>;
|
|
23
25
|
phone: z.ZodOptional<z.ZodString>;
|
|
24
26
|
address: z.ZodOptional<z.ZodString>;
|
|
25
27
|
city: z.ZodOptional<z.ZodString>;
|
|
@@ -4,6 +4,7 @@ export const createOrderSchema = z.object({
|
|
|
4
4
|
brandSlug: z.string().min(1),
|
|
5
5
|
firstName: z.string().min(1),
|
|
6
6
|
lastName: z.string().min(1),
|
|
7
|
+
email: z.string().email().optional(),
|
|
7
8
|
phone: z.string().min(1),
|
|
8
9
|
address: z.string().min(1),
|
|
9
10
|
city: z.string().min(1),
|
|
@@ -14,7 +15,7 @@ export const createOrderSchema = z.object({
|
|
|
14
15
|
quantity: z.number().int().positive(),
|
|
15
16
|
})).min(1),
|
|
16
17
|
discount: z.number().nonnegative().optional(),
|
|
17
|
-
paymentMethod: z.string().optional,
|
|
18
|
+
paymentMethod: z.string().optional(),
|
|
18
19
|
paystackReference: z.string().optional(),
|
|
19
20
|
});
|
|
20
21
|
// Update order schema (admin API)
|
|
@@ -22,6 +23,7 @@ export const updateOrderSchema = z.object({
|
|
|
22
23
|
brandSlug: z.string().min(1).optional(),
|
|
23
24
|
firstName: z.string().min(1).optional(),
|
|
24
25
|
lastName: z.string().min(1).optional(),
|
|
26
|
+
email: z.string().email().optional(),
|
|
25
27
|
phone: z.string().min(1).optional(),
|
|
26
28
|
address: z.string().min(1).optional(),
|
|
27
29
|
city: z.string().min(1).optional(),
|