@shophost/rest-api 2.0.58 → 2.0.60
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/package.json +1 -1
- package/src/bootstrap.js +1 -1
- package/src/bootstrap.js.map +1 -1
- package/src/container.d.ts +3 -1
- package/src/container.js +1 -1
- package/src/container.js.map +1 -1
- package/src/core/notifications/email.service.d.ts +1 -1
- package/src/core/notifications/email.service.js +1 -1
- package/src/core/notifications/email.service.js.map +1 -1
- package/src/features/customer/customer.handler.d.ts +2 -0
- package/src/features/customer/customer.handler.js +1 -0
- package/src/features/customer/customer.handler.js.map +1 -0
- package/src/features/customer/customer.route.d.ts +712 -0
- package/src/features/customer/customer.route.js +1 -0
- package/src/features/customer/customer.route.js.map +1 -0
- package/src/features/customer/customer.schema.d.ts +576 -0
- package/src/features/customer/customer.schema.js +1 -0
- package/src/features/customer/customer.schema.js.map +1 -0
- package/src/features/customer/customer.service.d.ts +166 -0
- package/src/features/customer/customer.service.js +1 -0
- package/src/features/customer/customer.service.js.map +1 -0
- package/src/features/index.d.ts +1 -0
- package/src/features/index.js +1 -1
- package/src/features/index.js.map +1 -1
- package/src/features/integration/integration.handler.js +1 -1
- package/src/features/integration/integration.handler.js.map +1 -1
- package/src/features/integration/integration.route.d.ts +175 -0
- package/src/features/integration/integration.route.js +1 -1
- package/src/features/integration/integration.route.js.map +1 -1
- package/src/features/integration/integration.schema.d.ts +13 -0
- package/src/features/integration/integration.schema.js +1 -1
- package/src/features/integration/integration.schema.js.map +1 -1
- package/src/features/integration/integration.service.d.ts +7 -0
- package/src/features/integration/integration.service.js +1 -1
- package/src/features/integration/integration.service.js.map +1 -1
- package/src/features/payment/payment.service.js +1 -1
- package/src/features/payment/payment.service.js.map +1 -1
- package/src/features/payment/stripe.service.d.ts +10 -0
- package/src/features/payment/stripe.service.js +1 -1
- package/src/features/payment/stripe.service.js.map +1 -1
- package/src/features/reservation/reservation.service.d.ts +1 -0
- package/src/features/reservation/reservation.service.js +1 -1
- package/src/features/reservation/reservation.service.js.map +1 -1
- package/src/schemas/index.d.ts +1 -0
- package/src/schemas/index.js +1 -1
- package/src/schemas/index.js.map +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z as t}from"@hono/zod-openapi";import{createApiRoute as r}from"../../core/hono/hono";import{AdminCustomerDetailSchema as a,AdminCustomerSchema as m,CustomerListQuerySchema as i,ErrorSchema as e,HeaderSchema as o,OrganizationParams as s,PaginationMetaSchema as n}from"../../schemas";const u=s.extend({id:t.string().min(1,"id is required").openapi({example:"user_123456789",description:"The user ID"})}),d=r({description:"Fetches paginated users who have placed at least one order or reservation in the organization",headers:o,method:"GET",operationId:"getCustomers",path:"/:organizationId/customers",pathParams:s,query:i,responses:{200:t.object({list:t.array(m),meta:n}),400:e,401:e,404:e},summary:"Get Customers",tags:["Customer"]}),c=r({description:"Fetches a customer profile with all orders and reservations for the organization",headers:o,method:"GET",operationId:"getCustomer",path:"/:organizationId/customers/:id",pathParams:u,responses:{200:a,400:e,401:e,404:e},summary:"Get Customer",tags:["Customer"]});export const customerRoute={getCustomer:c,getCustomers:d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customer.route.js","sourceRoot":"","sources":["../../../../../../packages/rest-api/src/features/customer/customer.route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,uBAAuB,EACvB,WAAW,EACX,YAAY,EACZ,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,eAAe,CAAC;AAEvB,MAAM,cAAc,GAAG,kBAAkB,CAAC,MAAM,CAAC;IAC/C,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC,OAAO,CAAC;QAC9C,OAAO,EAAE,gBAAgB;QACzB,WAAW,EAAE,aAAa;KAC3B,CAAC;CACH,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAG,cAAc,CAAC;IACvC,WAAW,EACT,+FAA+F;IACjG,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,KAAK;IACb,WAAW,EAAE,cAAc;IAC3B,IAAI,EAAE,4BAA4B;IAClC,UAAU,EAAE,kBAAkB;IAC9B,KAAK,EAAE,uBAAuB;IAC9B,SAAS,EAAE;QACT,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC;YACZ,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC;YAClC,IAAI,EAAE,oBAAoB;SAC3B,CAAC;QACF,GAAG,EAAE,WAAW;QAChB,GAAG,EAAE,WAAW;QAChB,GAAG,EAAE,WAAW;KACjB;IACD,OAAO,EAAE,eAAe;IACxB,IAAI,EAAE,CAAC,UAAU,CAAC;CACnB,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAAG,cAAc,CAAC;IACtC,WAAW,EACT,kFAAkF;IACpF,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,KAAK;IACb,WAAW,EAAE,aAAa;IAC1B,IAAI,EAAE,gCAAgC;IACtC,UAAU,EAAE,cAAc;IAC1B,SAAS,EAAE;QACT,GAAG,EAAE,yBAAyB;QAC9B,GAAG,EAAE,WAAW;QAChB,GAAG,EAAE,WAAW;QAChB,GAAG,EAAE,WAAW;KACjB;IACD,OAAO,EAAE,cAAc;IACvB,IAAI,EAAE,CAAC,UAAU,CAAC;CACnB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,WAAW,EAAE,gBAAgB;IAC7B,YAAY,EAAE,iBAAiB;CAChC,CAAC"}
|
|
@@ -0,0 +1,576 @@
|
|
|
1
|
+
import { z } from "@hono/zod-openapi";
|
|
2
|
+
export declare const CustomerListQuerySchema: z.ZodObject<{
|
|
3
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
4
|
+
page: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
5
|
+
search: z.ZodOptional<z.ZodString>;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export declare const AdminCustomerSchema: z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
email: z.ZodString;
|
|
10
|
+
firstname: z.ZodString;
|
|
11
|
+
lastname: z.ZodString;
|
|
12
|
+
image: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
13
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
14
|
+
createdAt: z.ZodDate;
|
|
15
|
+
orderCount: z.ZodNumber;
|
|
16
|
+
reservationCount: z.ZodNumber;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export declare const AdminCustomerDetailSchema: z.ZodObject<{
|
|
19
|
+
customer: z.ZodObject<{
|
|
20
|
+
id: z.ZodString;
|
|
21
|
+
email: z.ZodString;
|
|
22
|
+
firstname: z.ZodString;
|
|
23
|
+
lastname: z.ZodString;
|
|
24
|
+
image: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
25
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
26
|
+
createdAt: z.ZodDate;
|
|
27
|
+
orderCount: z.ZodNumber;
|
|
28
|
+
reservationCount: z.ZodNumber;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
orders: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
31
|
+
id: z.ZodString;
|
|
32
|
+
referenceId: z.ZodString;
|
|
33
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
34
|
+
pending: "pending";
|
|
35
|
+
draft: "draft";
|
|
36
|
+
accepted: "accepted";
|
|
37
|
+
"ready-for-dispatch": "ready-for-dispatch";
|
|
38
|
+
dispatched: "dispatched";
|
|
39
|
+
completed: "completed";
|
|
40
|
+
cancelled: "cancelled";
|
|
41
|
+
}>>;
|
|
42
|
+
token: z.ZodString;
|
|
43
|
+
expiresAt: z.ZodDate;
|
|
44
|
+
items: z.ZodArray<z.ZodObject<{
|
|
45
|
+
translations: z.ZodArray<z.ZodObject<{
|
|
46
|
+
locale: z.ZodEnum<{
|
|
47
|
+
id: "id";
|
|
48
|
+
af: "af";
|
|
49
|
+
sq: "sq";
|
|
50
|
+
ar_dz: "ar_dz";
|
|
51
|
+
ar_bh: "ar_bh";
|
|
52
|
+
ar_eg: "ar_eg";
|
|
53
|
+
ar_iq: "ar_iq";
|
|
54
|
+
ar_jo: "ar_jo";
|
|
55
|
+
ar_kw: "ar_kw";
|
|
56
|
+
ar_lb: "ar_lb";
|
|
57
|
+
ar_ly: "ar_ly";
|
|
58
|
+
ar_ma: "ar_ma";
|
|
59
|
+
ar_om: "ar_om";
|
|
60
|
+
ar_qa: "ar_qa";
|
|
61
|
+
ar_sa: "ar_sa";
|
|
62
|
+
ar_sy: "ar_sy";
|
|
63
|
+
ar_tn: "ar_tn";
|
|
64
|
+
ar_ae: "ar_ae";
|
|
65
|
+
ar_ye: "ar_ye";
|
|
66
|
+
eu: "eu";
|
|
67
|
+
be: "be";
|
|
68
|
+
bg: "bg";
|
|
69
|
+
ca: "ca";
|
|
70
|
+
zh_hk: "zh_hk";
|
|
71
|
+
zh_cn: "zh_cn";
|
|
72
|
+
zh_sg: "zh_sg";
|
|
73
|
+
zh_tw: "zh_tw";
|
|
74
|
+
hr: "hr";
|
|
75
|
+
cs: "cs";
|
|
76
|
+
da: "da";
|
|
77
|
+
nl_be: "nl_be";
|
|
78
|
+
nl: "nl";
|
|
79
|
+
en: "en";
|
|
80
|
+
en_au: "en_au";
|
|
81
|
+
en_bz: "en_bz";
|
|
82
|
+
en_ca: "en_ca";
|
|
83
|
+
en_ie: "en_ie";
|
|
84
|
+
en_jm: "en_jm";
|
|
85
|
+
en_nz: "en_nz";
|
|
86
|
+
en_za: "en_za";
|
|
87
|
+
en_tt: "en_tt";
|
|
88
|
+
en_gb: "en_gb";
|
|
89
|
+
en_us: "en_us";
|
|
90
|
+
et: "et";
|
|
91
|
+
fo: "fo";
|
|
92
|
+
fa: "fa";
|
|
93
|
+
fi: "fi";
|
|
94
|
+
fr_be: "fr_be";
|
|
95
|
+
fr_ca: "fr_ca";
|
|
96
|
+
fr_lu: "fr_lu";
|
|
97
|
+
fr: "fr";
|
|
98
|
+
fr_ch: "fr_ch";
|
|
99
|
+
gd: "gd";
|
|
100
|
+
de_at: "de_at";
|
|
101
|
+
de_li: "de_li";
|
|
102
|
+
de_lu: "de_lu";
|
|
103
|
+
de: "de";
|
|
104
|
+
de_ch: "de_ch";
|
|
105
|
+
el: "el";
|
|
106
|
+
he: "he";
|
|
107
|
+
hi: "hi";
|
|
108
|
+
hu: "hu";
|
|
109
|
+
is: "is";
|
|
110
|
+
ga: "ga";
|
|
111
|
+
it: "it";
|
|
112
|
+
it_ch: "it_ch";
|
|
113
|
+
ja: "ja";
|
|
114
|
+
ko: "ko";
|
|
115
|
+
ku: "ku";
|
|
116
|
+
lv: "lv";
|
|
117
|
+
lt: "lt";
|
|
118
|
+
mk: "mk";
|
|
119
|
+
ml: "ml";
|
|
120
|
+
ms: "ms";
|
|
121
|
+
mt: "mt";
|
|
122
|
+
no: "no";
|
|
123
|
+
nb: "nb";
|
|
124
|
+
nn: "nn";
|
|
125
|
+
pl: "pl";
|
|
126
|
+
pt_br: "pt_br";
|
|
127
|
+
pt: "pt";
|
|
128
|
+
pa: "pa";
|
|
129
|
+
rm: "rm";
|
|
130
|
+
ro: "ro";
|
|
131
|
+
ro_md: "ro_md";
|
|
132
|
+
ru: "ru";
|
|
133
|
+
ru_md: "ru_md";
|
|
134
|
+
sr: "sr";
|
|
135
|
+
sk: "sk";
|
|
136
|
+
sl: "sl";
|
|
137
|
+
sb: "sb";
|
|
138
|
+
es_ar: "es_ar";
|
|
139
|
+
es_bo: "es_bo";
|
|
140
|
+
es_cl: "es_cl";
|
|
141
|
+
es_co: "es_co";
|
|
142
|
+
es_cr: "es_cr";
|
|
143
|
+
es_do: "es_do";
|
|
144
|
+
es_ec: "es_ec";
|
|
145
|
+
es_sv: "es_sv";
|
|
146
|
+
es_gt: "es_gt";
|
|
147
|
+
es_hn: "es_hn";
|
|
148
|
+
es_mx: "es_mx";
|
|
149
|
+
es: "es";
|
|
150
|
+
sv: "sv";
|
|
151
|
+
sv_fi: "sv_fi";
|
|
152
|
+
th: "th";
|
|
153
|
+
tr: "tr";
|
|
154
|
+
uk: "uk";
|
|
155
|
+
ur: "ur";
|
|
156
|
+
vi: "vi";
|
|
157
|
+
cy: "cy";
|
|
158
|
+
ji: "ji";
|
|
159
|
+
zu: "zu";
|
|
160
|
+
}>;
|
|
161
|
+
title: z.ZodString;
|
|
162
|
+
subtitle: z.ZodString;
|
|
163
|
+
}, z.core.$strip>>;
|
|
164
|
+
rawData: z.ZodObject<{
|
|
165
|
+
productId: z.ZodString;
|
|
166
|
+
quantity: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
167
|
+
modifierGroups: z.ZodArray<z.ZodObject<{
|
|
168
|
+
id: z.ZodString;
|
|
169
|
+
modifiers: z.ZodArray<z.ZodObject<{
|
|
170
|
+
id: z.ZodString;
|
|
171
|
+
quantity: z.ZodDefault<z.ZodNumber>;
|
|
172
|
+
}, z.core.$strip>>;
|
|
173
|
+
}, z.core.$strip>>;
|
|
174
|
+
}, z.core.$strip>;
|
|
175
|
+
unitPrice: z.ZodNumber;
|
|
176
|
+
image: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
177
|
+
id: z.ZodString;
|
|
178
|
+
url: z.ZodString;
|
|
179
|
+
mimeType: z.ZodString;
|
|
180
|
+
size: z.ZodNumber;
|
|
181
|
+
filename: z.ZodString;
|
|
182
|
+
}, z.core.$strip>>>;
|
|
183
|
+
totalPrice: z.ZodNumber;
|
|
184
|
+
quantity: z.ZodNumber;
|
|
185
|
+
productSnapshotId: z.ZodString;
|
|
186
|
+
}, z.core.$strip>>;
|
|
187
|
+
shippingMethod: z.ZodNullable<z.ZodObject<{
|
|
188
|
+
id: z.ZodString;
|
|
189
|
+
title: z.ZodString;
|
|
190
|
+
providerName: z.ZodString;
|
|
191
|
+
providerLogo: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
192
|
+
id: z.ZodString;
|
|
193
|
+
url: z.ZodString;
|
|
194
|
+
mimeType: z.ZodString;
|
|
195
|
+
size: z.ZodNumber;
|
|
196
|
+
filename: z.ZodString;
|
|
197
|
+
}, z.core.$strip>>>;
|
|
198
|
+
requireDateOfDelivery: z.ZodOptional<z.ZodCoercedBoolean<unknown>>;
|
|
199
|
+
shippingZones: z.ZodArray<z.ZodObject<{
|
|
200
|
+
id: z.ZodOptional<z.ZodString>;
|
|
201
|
+
title: z.ZodString;
|
|
202
|
+
distanceUpto: z.ZodCoercedNumber<unknown>;
|
|
203
|
+
price: z.ZodCoercedNumber<unknown>;
|
|
204
|
+
minimumOrderAmount: z.ZodPipe<z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>>, z.ZodTransform<string | number | null, string | number | null | undefined>>, z.ZodNullable<z.ZodNumber>>;
|
|
205
|
+
eta: z.ZodString;
|
|
206
|
+
}, z.core.$strip>>;
|
|
207
|
+
eligibleShippingZone: z.ZodOptional<z.ZodObject<{
|
|
208
|
+
id: z.ZodOptional<z.ZodString>;
|
|
209
|
+
title: z.ZodString;
|
|
210
|
+
distanceUpto: z.ZodCoercedNumber<unknown>;
|
|
211
|
+
price: z.ZodCoercedNumber<unknown>;
|
|
212
|
+
minimumOrderAmount: z.ZodPipe<z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>>, z.ZodTransform<string | number | null, string | number | null | undefined>>, z.ZodNullable<z.ZodNumber>>;
|
|
213
|
+
eta: z.ZodString;
|
|
214
|
+
}, z.core.$strip>>;
|
|
215
|
+
createdAt: z.ZodDate;
|
|
216
|
+
updatedAt: z.ZodDate;
|
|
217
|
+
}, z.core.$strip>>;
|
|
218
|
+
acceptedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
219
|
+
dispatchedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
220
|
+
readyForDispatchAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
221
|
+
createdAt: z.ZodDate;
|
|
222
|
+
completedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
223
|
+
cancelledAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
224
|
+
inventoryDeductedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
225
|
+
inventoryConflictAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
226
|
+
inventoryConflictItems: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
227
|
+
productId: z.ZodString;
|
|
228
|
+
title: z.ZodString;
|
|
229
|
+
requestedQuantity: z.ZodNumber;
|
|
230
|
+
availableQuantity: z.ZodNumber;
|
|
231
|
+
}, z.core.$strip>>>>;
|
|
232
|
+
shippingAddress: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
233
|
+
id: z.ZodString;
|
|
234
|
+
firstname: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
235
|
+
lastname: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
236
|
+
phone: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
237
|
+
addressLineOne: z.ZodString;
|
|
238
|
+
doorNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
239
|
+
addressLineTwo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
240
|
+
zipCode: z.ZodOptional<z.ZodString>;
|
|
241
|
+
city: z.ZodString;
|
|
242
|
+
country: z.ZodString;
|
|
243
|
+
placeId: z.ZodString;
|
|
244
|
+
deliveryInstructions: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
245
|
+
}, z.core.$strip>>>;
|
|
246
|
+
fulfilmentMethod: z.ZodEnum<{
|
|
247
|
+
delivery: "delivery";
|
|
248
|
+
pickup: "pickup";
|
|
249
|
+
}>;
|
|
250
|
+
currency: z.ZodEnum<{
|
|
251
|
+
USD: "USD";
|
|
252
|
+
EUR: "EUR";
|
|
253
|
+
GBP: "GBP";
|
|
254
|
+
JPY: "JPY";
|
|
255
|
+
AUD: "AUD";
|
|
256
|
+
CAD: "CAD";
|
|
257
|
+
CHF: "CHF";
|
|
258
|
+
CNY: "CNY";
|
|
259
|
+
SEK: "SEK";
|
|
260
|
+
NZD: "NZD";
|
|
261
|
+
MXN: "MXN";
|
|
262
|
+
SGD: "SGD";
|
|
263
|
+
HKD: "HKD";
|
|
264
|
+
NOK: "NOK";
|
|
265
|
+
KRW: "KRW";
|
|
266
|
+
TRY: "TRY";
|
|
267
|
+
RUB: "RUB";
|
|
268
|
+
INR: "INR";
|
|
269
|
+
BRL: "BRL";
|
|
270
|
+
ZAR: "ZAR";
|
|
271
|
+
DKK: "DKK";
|
|
272
|
+
PLN: "PLN";
|
|
273
|
+
THB: "THB";
|
|
274
|
+
IDR: "IDR";
|
|
275
|
+
HUF: "HUF";
|
|
276
|
+
CZK: "CZK";
|
|
277
|
+
ILS: "ILS";
|
|
278
|
+
PHP: "PHP";
|
|
279
|
+
AED: "AED";
|
|
280
|
+
COP: "COP";
|
|
281
|
+
SAR: "SAR";
|
|
282
|
+
MYR: "MYR";
|
|
283
|
+
RON: "RON";
|
|
284
|
+
}>;
|
|
285
|
+
payment: z.ZodObject<{
|
|
286
|
+
id: z.ZodString;
|
|
287
|
+
method: z.ZodEnum<{
|
|
288
|
+
card: "card";
|
|
289
|
+
blik: "blik";
|
|
290
|
+
paypal: "paypal";
|
|
291
|
+
cash_on_delivery: "cash_on_delivery";
|
|
292
|
+
}>;
|
|
293
|
+
provider: z.ZodEnum<{
|
|
294
|
+
stripe: "stripe";
|
|
295
|
+
revolut: "revolut";
|
|
296
|
+
payu: "payu";
|
|
297
|
+
not_applicable: "not_applicable";
|
|
298
|
+
}>;
|
|
299
|
+
status: z.ZodEnum<{
|
|
300
|
+
pending: "pending";
|
|
301
|
+
succeeded: "succeeded";
|
|
302
|
+
refunded: "refunded";
|
|
303
|
+
failed: "failed";
|
|
304
|
+
canceled: "canceled";
|
|
305
|
+
}>;
|
|
306
|
+
shipping: z.ZodDefault<z.ZodNumber>;
|
|
307
|
+
subtotal: z.ZodNumber;
|
|
308
|
+
total: z.ZodNumber;
|
|
309
|
+
discount: z.ZodDefault<z.ZodNumber>;
|
|
310
|
+
currency: z.ZodEnum<{
|
|
311
|
+
USD: "USD";
|
|
312
|
+
EUR: "EUR";
|
|
313
|
+
GBP: "GBP";
|
|
314
|
+
JPY: "JPY";
|
|
315
|
+
AUD: "AUD";
|
|
316
|
+
CAD: "CAD";
|
|
317
|
+
CHF: "CHF";
|
|
318
|
+
CNY: "CNY";
|
|
319
|
+
SEK: "SEK";
|
|
320
|
+
NZD: "NZD";
|
|
321
|
+
MXN: "MXN";
|
|
322
|
+
SGD: "SGD";
|
|
323
|
+
HKD: "HKD";
|
|
324
|
+
NOK: "NOK";
|
|
325
|
+
KRW: "KRW";
|
|
326
|
+
TRY: "TRY";
|
|
327
|
+
RUB: "RUB";
|
|
328
|
+
INR: "INR";
|
|
329
|
+
BRL: "BRL";
|
|
330
|
+
ZAR: "ZAR";
|
|
331
|
+
DKK: "DKK";
|
|
332
|
+
PLN: "PLN";
|
|
333
|
+
THB: "THB";
|
|
334
|
+
IDR: "IDR";
|
|
335
|
+
HUF: "HUF";
|
|
336
|
+
CZK: "CZK";
|
|
337
|
+
ILS: "ILS";
|
|
338
|
+
PHP: "PHP";
|
|
339
|
+
AED: "AED";
|
|
340
|
+
COP: "COP";
|
|
341
|
+
SAR: "SAR";
|
|
342
|
+
MYR: "MYR";
|
|
343
|
+
RON: "RON";
|
|
344
|
+
}>;
|
|
345
|
+
}, z.core.$strip>;
|
|
346
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
347
|
+
status: "pending" | "accepted" | "ready-for-dispatch" | "dispatched" | "completed" | "cancelled";
|
|
348
|
+
id: string;
|
|
349
|
+
referenceId: string;
|
|
350
|
+
token: string;
|
|
351
|
+
expiresAt: Date;
|
|
352
|
+
items: {
|
|
353
|
+
translations: {
|
|
354
|
+
locale: "id" | "af" | "sq" | "ar_dz" | "ar_bh" | "ar_eg" | "ar_iq" | "ar_jo" | "ar_kw" | "ar_lb" | "ar_ly" | "ar_ma" | "ar_om" | "ar_qa" | "ar_sa" | "ar_sy" | "ar_tn" | "ar_ae" | "ar_ye" | "eu" | "be" | "bg" | "ca" | "zh_hk" | "zh_cn" | "zh_sg" | "zh_tw" | "hr" | "cs" | "da" | "nl_be" | "nl" | "en" | "en_au" | "en_bz" | "en_ca" | "en_ie" | "en_jm" | "en_nz" | "en_za" | "en_tt" | "en_gb" | "en_us" | "et" | "fo" | "fa" | "fi" | "fr_be" | "fr_ca" | "fr_lu" | "fr" | "fr_ch" | "gd" | "de_at" | "de_li" | "de_lu" | "de" | "de_ch" | "el" | "he" | "hi" | "hu" | "is" | "ga" | "it" | "it_ch" | "ja" | "ko" | "ku" | "lv" | "lt" | "mk" | "ml" | "ms" | "mt" | "no" | "nb" | "nn" | "pl" | "pt_br" | "pt" | "pa" | "rm" | "ro" | "ro_md" | "ru" | "ru_md" | "sr" | "sk" | "sl" | "sb" | "es_ar" | "es_bo" | "es_cl" | "es_co" | "es_cr" | "es_do" | "es_ec" | "es_sv" | "es_gt" | "es_hn" | "es_mx" | "es" | "sv" | "sv_fi" | "th" | "tr" | "uk" | "ur" | "vi" | "cy" | "ji" | "zu";
|
|
355
|
+
title: string;
|
|
356
|
+
subtitle: string;
|
|
357
|
+
}[];
|
|
358
|
+
rawData: {
|
|
359
|
+
productId: string;
|
|
360
|
+
modifierGroups: {
|
|
361
|
+
id: string;
|
|
362
|
+
modifiers: {
|
|
363
|
+
id: string;
|
|
364
|
+
quantity: number;
|
|
365
|
+
}[];
|
|
366
|
+
}[];
|
|
367
|
+
quantity?: number | undefined;
|
|
368
|
+
};
|
|
369
|
+
unitPrice: number;
|
|
370
|
+
totalPrice: number;
|
|
371
|
+
quantity: number;
|
|
372
|
+
productSnapshotId: string;
|
|
373
|
+
image?: {
|
|
374
|
+
id: string;
|
|
375
|
+
url: string;
|
|
376
|
+
mimeType: string;
|
|
377
|
+
size: number;
|
|
378
|
+
filename: string;
|
|
379
|
+
} | null | undefined;
|
|
380
|
+
}[];
|
|
381
|
+
shippingMethod: {
|
|
382
|
+
id: string;
|
|
383
|
+
title: string;
|
|
384
|
+
providerName: string;
|
|
385
|
+
shippingZones: {
|
|
386
|
+
title: string;
|
|
387
|
+
distanceUpto: number;
|
|
388
|
+
price: number;
|
|
389
|
+
minimumOrderAmount: number | null;
|
|
390
|
+
eta: string;
|
|
391
|
+
id?: string | undefined;
|
|
392
|
+
}[];
|
|
393
|
+
createdAt: Date;
|
|
394
|
+
updatedAt: Date;
|
|
395
|
+
providerLogo?: {
|
|
396
|
+
id: string;
|
|
397
|
+
url: string;
|
|
398
|
+
mimeType: string;
|
|
399
|
+
size: number;
|
|
400
|
+
filename: string;
|
|
401
|
+
} | null | undefined;
|
|
402
|
+
requireDateOfDelivery?: boolean | undefined;
|
|
403
|
+
eligibleShippingZone?: {
|
|
404
|
+
title: string;
|
|
405
|
+
distanceUpto: number;
|
|
406
|
+
price: number;
|
|
407
|
+
minimumOrderAmount: number | null;
|
|
408
|
+
eta: string;
|
|
409
|
+
id?: string | undefined;
|
|
410
|
+
} | undefined;
|
|
411
|
+
} | null;
|
|
412
|
+
createdAt: Date;
|
|
413
|
+
fulfilmentMethod: "delivery" | "pickup";
|
|
414
|
+
currency: "USD" | "EUR" | "GBP" | "JPY" | "AUD" | "CAD" | "CHF" | "CNY" | "SEK" | "NZD" | "MXN" | "SGD" | "HKD" | "NOK" | "KRW" | "TRY" | "RUB" | "INR" | "BRL" | "ZAR" | "DKK" | "PLN" | "THB" | "IDR" | "HUF" | "CZK" | "ILS" | "PHP" | "AED" | "COP" | "SAR" | "MYR" | "RON";
|
|
415
|
+
payment: {
|
|
416
|
+
id: string;
|
|
417
|
+
method: "card" | "blik" | "paypal" | "cash_on_delivery";
|
|
418
|
+
provider: "stripe" | "revolut" | "payu" | "not_applicable";
|
|
419
|
+
status: "pending" | "succeeded" | "refunded" | "failed" | "canceled";
|
|
420
|
+
shipping: number;
|
|
421
|
+
subtotal: number;
|
|
422
|
+
total: number;
|
|
423
|
+
discount: number;
|
|
424
|
+
currency: "USD" | "EUR" | "GBP" | "JPY" | "AUD" | "CAD" | "CHF" | "CNY" | "SEK" | "NZD" | "MXN" | "SGD" | "HKD" | "NOK" | "KRW" | "TRY" | "RUB" | "INR" | "BRL" | "ZAR" | "DKK" | "PLN" | "THB" | "IDR" | "HUF" | "CZK" | "ILS" | "PHP" | "AED" | "COP" | "SAR" | "MYR" | "RON";
|
|
425
|
+
};
|
|
426
|
+
acceptedAt?: Date | null | undefined;
|
|
427
|
+
dispatchedAt?: Date | null | undefined;
|
|
428
|
+
readyForDispatchAt?: Date | null | undefined;
|
|
429
|
+
completedAt?: Date | null | undefined;
|
|
430
|
+
cancelledAt?: Date | null | undefined;
|
|
431
|
+
inventoryDeductedAt?: Date | null | undefined;
|
|
432
|
+
inventoryConflictAt?: Date | null | undefined;
|
|
433
|
+
inventoryConflictItems?: {
|
|
434
|
+
productId: string;
|
|
435
|
+
title: string;
|
|
436
|
+
requestedQuantity: number;
|
|
437
|
+
availableQuantity: number;
|
|
438
|
+
}[] | null | undefined;
|
|
439
|
+
shippingAddress?: {
|
|
440
|
+
id: string;
|
|
441
|
+
addressLineOne: string;
|
|
442
|
+
city: string;
|
|
443
|
+
country: string;
|
|
444
|
+
placeId: string;
|
|
445
|
+
firstname?: string | null | undefined;
|
|
446
|
+
lastname?: string | null | undefined;
|
|
447
|
+
phone?: string | null | undefined;
|
|
448
|
+
doorNumber?: string | null | undefined;
|
|
449
|
+
addressLineTwo?: string | null | undefined;
|
|
450
|
+
zipCode?: string | undefined;
|
|
451
|
+
deliveryInstructions?: string | null | undefined;
|
|
452
|
+
} | null | undefined;
|
|
453
|
+
}, {
|
|
454
|
+
id: string;
|
|
455
|
+
referenceId: string;
|
|
456
|
+
token: string;
|
|
457
|
+
expiresAt: Date;
|
|
458
|
+
items: {
|
|
459
|
+
translations: {
|
|
460
|
+
locale: "id" | "af" | "sq" | "ar_dz" | "ar_bh" | "ar_eg" | "ar_iq" | "ar_jo" | "ar_kw" | "ar_lb" | "ar_ly" | "ar_ma" | "ar_om" | "ar_qa" | "ar_sa" | "ar_sy" | "ar_tn" | "ar_ae" | "ar_ye" | "eu" | "be" | "bg" | "ca" | "zh_hk" | "zh_cn" | "zh_sg" | "zh_tw" | "hr" | "cs" | "da" | "nl_be" | "nl" | "en" | "en_au" | "en_bz" | "en_ca" | "en_ie" | "en_jm" | "en_nz" | "en_za" | "en_tt" | "en_gb" | "en_us" | "et" | "fo" | "fa" | "fi" | "fr_be" | "fr_ca" | "fr_lu" | "fr" | "fr_ch" | "gd" | "de_at" | "de_li" | "de_lu" | "de" | "de_ch" | "el" | "he" | "hi" | "hu" | "is" | "ga" | "it" | "it_ch" | "ja" | "ko" | "ku" | "lv" | "lt" | "mk" | "ml" | "ms" | "mt" | "no" | "nb" | "nn" | "pl" | "pt_br" | "pt" | "pa" | "rm" | "ro" | "ro_md" | "ru" | "ru_md" | "sr" | "sk" | "sl" | "sb" | "es_ar" | "es_bo" | "es_cl" | "es_co" | "es_cr" | "es_do" | "es_ec" | "es_sv" | "es_gt" | "es_hn" | "es_mx" | "es" | "sv" | "sv_fi" | "th" | "tr" | "uk" | "ur" | "vi" | "cy" | "ji" | "zu";
|
|
461
|
+
title: string;
|
|
462
|
+
subtitle: string;
|
|
463
|
+
}[];
|
|
464
|
+
rawData: {
|
|
465
|
+
productId: string;
|
|
466
|
+
modifierGroups: {
|
|
467
|
+
id: string;
|
|
468
|
+
modifiers: {
|
|
469
|
+
id: string;
|
|
470
|
+
quantity: number;
|
|
471
|
+
}[];
|
|
472
|
+
}[];
|
|
473
|
+
quantity?: number | undefined;
|
|
474
|
+
};
|
|
475
|
+
unitPrice: number;
|
|
476
|
+
totalPrice: number;
|
|
477
|
+
quantity: number;
|
|
478
|
+
productSnapshotId: string;
|
|
479
|
+
image?: {
|
|
480
|
+
id: string;
|
|
481
|
+
url: string;
|
|
482
|
+
mimeType: string;
|
|
483
|
+
size: number;
|
|
484
|
+
filename: string;
|
|
485
|
+
} | null | undefined;
|
|
486
|
+
}[];
|
|
487
|
+
shippingMethod: {
|
|
488
|
+
id: string;
|
|
489
|
+
title: string;
|
|
490
|
+
providerName: string;
|
|
491
|
+
shippingZones: {
|
|
492
|
+
title: string;
|
|
493
|
+
distanceUpto: number;
|
|
494
|
+
price: number;
|
|
495
|
+
minimumOrderAmount: number | null;
|
|
496
|
+
eta: string;
|
|
497
|
+
id?: string | undefined;
|
|
498
|
+
}[];
|
|
499
|
+
createdAt: Date;
|
|
500
|
+
updatedAt: Date;
|
|
501
|
+
providerLogo?: {
|
|
502
|
+
id: string;
|
|
503
|
+
url: string;
|
|
504
|
+
mimeType: string;
|
|
505
|
+
size: number;
|
|
506
|
+
filename: string;
|
|
507
|
+
} | null | undefined;
|
|
508
|
+
requireDateOfDelivery?: boolean | undefined;
|
|
509
|
+
eligibleShippingZone?: {
|
|
510
|
+
title: string;
|
|
511
|
+
distanceUpto: number;
|
|
512
|
+
price: number;
|
|
513
|
+
minimumOrderAmount: number | null;
|
|
514
|
+
eta: string;
|
|
515
|
+
id?: string | undefined;
|
|
516
|
+
} | undefined;
|
|
517
|
+
} | null;
|
|
518
|
+
createdAt: Date;
|
|
519
|
+
fulfilmentMethod: "delivery" | "pickup";
|
|
520
|
+
currency: "USD" | "EUR" | "GBP" | "JPY" | "AUD" | "CAD" | "CHF" | "CNY" | "SEK" | "NZD" | "MXN" | "SGD" | "HKD" | "NOK" | "KRW" | "TRY" | "RUB" | "INR" | "BRL" | "ZAR" | "DKK" | "PLN" | "THB" | "IDR" | "HUF" | "CZK" | "ILS" | "PHP" | "AED" | "COP" | "SAR" | "MYR" | "RON";
|
|
521
|
+
payment: {
|
|
522
|
+
id: string;
|
|
523
|
+
method: "card" | "blik" | "paypal" | "cash_on_delivery";
|
|
524
|
+
provider: "stripe" | "revolut" | "payu" | "not_applicable";
|
|
525
|
+
status: "pending" | "succeeded" | "refunded" | "failed" | "canceled";
|
|
526
|
+
shipping: number;
|
|
527
|
+
subtotal: number;
|
|
528
|
+
total: number;
|
|
529
|
+
discount: number;
|
|
530
|
+
currency: "USD" | "EUR" | "GBP" | "JPY" | "AUD" | "CAD" | "CHF" | "CNY" | "SEK" | "NZD" | "MXN" | "SGD" | "HKD" | "NOK" | "KRW" | "TRY" | "RUB" | "INR" | "BRL" | "ZAR" | "DKK" | "PLN" | "THB" | "IDR" | "HUF" | "CZK" | "ILS" | "PHP" | "AED" | "COP" | "SAR" | "MYR" | "RON";
|
|
531
|
+
};
|
|
532
|
+
status?: "pending" | "draft" | "accepted" | "ready-for-dispatch" | "dispatched" | "completed" | "cancelled" | undefined;
|
|
533
|
+
acceptedAt?: Date | null | undefined;
|
|
534
|
+
dispatchedAt?: Date | null | undefined;
|
|
535
|
+
readyForDispatchAt?: Date | null | undefined;
|
|
536
|
+
completedAt?: Date | null | undefined;
|
|
537
|
+
cancelledAt?: Date | null | undefined;
|
|
538
|
+
inventoryDeductedAt?: Date | null | undefined;
|
|
539
|
+
inventoryConflictAt?: Date | null | undefined;
|
|
540
|
+
inventoryConflictItems?: {
|
|
541
|
+
productId: string;
|
|
542
|
+
title: string;
|
|
543
|
+
requestedQuantity: number;
|
|
544
|
+
availableQuantity: number;
|
|
545
|
+
}[] | null | undefined;
|
|
546
|
+
shippingAddress?: {
|
|
547
|
+
id: string;
|
|
548
|
+
addressLineOne: string;
|
|
549
|
+
city: string;
|
|
550
|
+
country: string;
|
|
551
|
+
placeId: string;
|
|
552
|
+
firstname?: string | null | undefined;
|
|
553
|
+
lastname?: string | null | undefined;
|
|
554
|
+
phone?: string | null | undefined;
|
|
555
|
+
doorNumber?: string | null | undefined;
|
|
556
|
+
addressLineTwo?: string | null | undefined;
|
|
557
|
+
zipCode?: string | undefined;
|
|
558
|
+
deliveryInstructions?: string | null | undefined;
|
|
559
|
+
} | null | undefined;
|
|
560
|
+
}>>>;
|
|
561
|
+
reservations: z.ZodArray<z.ZodObject<{
|
|
562
|
+
id: z.ZodString;
|
|
563
|
+
firstname: z.ZodString;
|
|
564
|
+
lastname: z.ZodString;
|
|
565
|
+
guests: z.ZodCoercedNumber<unknown>;
|
|
566
|
+
phone: z.ZodString;
|
|
567
|
+
date: z.ZodCoercedDate<unknown>;
|
|
568
|
+
referenceId: z.ZodString;
|
|
569
|
+
acceptedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
570
|
+
cancelledAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
571
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
572
|
+
}, z.core.$strip>>;
|
|
573
|
+
}, z.core.$strip>;
|
|
574
|
+
export type CustomerListQuery = z.infer<typeof CustomerListQuerySchema>;
|
|
575
|
+
export type AdminCustomer = z.infer<typeof AdminCustomerSchema>;
|
|
576
|
+
export type AdminCustomerDetail = z.infer<typeof AdminCustomerDetailSchema>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z as e}from"@hono/zod-openapi";import{UserSchema as r}from"../../core/auth/user.schema";import{PaginationQuerySchema as t}from"../../schemas/pagination.schema";import{OrderSchema as o}from"../order/order.schema";import{ReservationSchema as i}from"../reservation/reservation.schema";export const CustomerListQuerySchema=t.pick({page:!0,limit:!0,search:!0}).openapi("AdminCustomerListQuery"),AdminCustomerSchema=r.extend({createdAt:e.date().openapi({description:"Date when the customer account was created",example:"2026-03-29T12:00:00.000Z"}),orderCount:e.number().int().min(0).openapi({description:"Number of orders placed by the customer in this organization",example:3}),reservationCount:e.number().int().min(0).openapi({description:"Number of reservations created by the customer in this organization",example:2})}).openapi("AdminCustomer"),AdminCustomerDetailSchema=e.object({customer:AdminCustomerSchema,orders:e.array(o),reservations:e.array(i)}).openapi("AdminCustomerDetail");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customer.schema.js","sourceRoot":"","sources":["../../../../../../packages/rest-api/src/features/customer/customer.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,MAAM,CAAC,MAAM,uBAAuB,GAAG,qBAAqB,CAAC,IAAI,CAAC;IAChE,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,IAAI;CACb,CAAC,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC;AAErC,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC,MAAM,CAAC;IACnD,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC;QAC1B,WAAW,EAAE,4CAA4C;QACzD,OAAO,EAAE,0BAA0B;KACpC,CAAC;IACF,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;QAC1C,WAAW,EAAE,8DAA8D;QAC3E,OAAO,EAAE,CAAC;KACX,CAAC;IACF,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;QAChD,WAAW,EACT,qEAAqE;QACvE,OAAO,EAAE,CAAC;KACX,CAAC;CACH,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;AAE5B,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC;KACvC,MAAM,CAAC;IACN,QAAQ,EAAE,mBAAmB;IAC7B,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC;IAC5B,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC;CACzC,CAAC;KACD,OAAO,CAAC,qBAAqB,CAAC,CAAC"}
|