@porulle/plugin-marketplace 0.64.0 → 0.65.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -59
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -11
- package/dist/routes/b2b.d.ts +1 -3
- package/dist/routes/b2b.d.ts.map +1 -1
- package/dist/routes/b2b.js +2 -70
- package/dist/routes/sub-orders.js +3 -3
- package/dist/routes/vendor-portal.js +6 -6
- package/dist/schema.d.ts +0 -194
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +0 -14
- package/dist/schemas/b2b.d.ts +0 -986
- package/dist/schemas/b2b.d.ts.map +1 -1
- package/dist/schemas/b2b.js +1 -184
- package/dist/schemas/commission.d.ts +0 -495
- package/dist/schemas/commission.d.ts.map +1 -1
- package/dist/schemas/commission.js +1 -78
- package/dist/schemas/disputes-returns-reviews.d.ts +0 -1354
- package/dist/schemas/disputes-returns-reviews.d.ts.map +1 -1
- package/dist/schemas/disputes-returns-reviews.js +1 -208
- package/dist/schemas/sub-orders.d.ts +0 -290
- package/dist/schemas/sub-orders.d.ts.map +1 -1
- package/dist/schemas/sub-orders.js +1 -59
- package/dist/schemas/vendor-portal.d.ts +0 -1755
- package/dist/schemas/vendor-portal.d.ts.map +1 -1
- package/dist/schemas/vendor-portal.js +1 -247
- package/dist/schemas/vendors.d.ts +0 -1321
- package/dist/schemas/vendors.d.ts.map +1 -1
- package/dist/schemas/vendors.js +1 -205
- package/dist/services/sub-order.d.ts +1 -31
- package/dist/services/sub-order.d.ts.map +1 -1
- package/dist/services/sub-order.js +14 -22
- package/dist/types.d.ts +0 -17
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +0 -4
- package/package.json +13 -11
- package/src/index.ts +3 -11
- package/src/routes/b2b.ts +1 -76
- package/src/routes/sub-orders.ts +3 -3
- package/src/routes/vendor-portal.ts +6 -6
- package/src/schema.ts +0 -16
- package/src/schemas/b2b.ts +1 -208
- package/src/schemas/commission.ts +1 -86
- package/src/schemas/disputes-returns-reviews.ts +1 -225
- package/src/schemas/sub-orders.ts +1 -65
- package/src/schemas/vendor-portal.ts +1 -269
- package/src/schemas/vendors.ts +1 -222
- package/src/services/sub-order.ts +16 -18
- package/src/types.ts +0 -28
- package/dist/schemas/payouts.d.ts +0 -375
- package/dist/schemas/payouts.d.ts.map +0 -1
- package/dist/schemas/payouts.js +0 -78
- package/dist/services/contract-price.d.ts +0 -64
- package/dist/services/contract-price.d.ts.map +0 -1
- package/dist/services/contract-price.js +0 -57
- package/src/schemas/payouts.ts +0 -90
- package/src/services/contract-price.ts +0 -80
|
@@ -17,118 +17,6 @@ export declare const CreateCommissionRuleBodySchema: z.ZodObject<{
|
|
|
17
17
|
validUntil: z.ZodOptional<z.ZodString>;
|
|
18
18
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
19
19
|
}, z.core.$strip>;
|
|
20
|
-
export declare const createCommissionRuleRoute: {
|
|
21
|
-
method: "post";
|
|
22
|
-
path: "/api/marketplace/commission-rules";
|
|
23
|
-
tags: string[];
|
|
24
|
-
summary: string;
|
|
25
|
-
request: {
|
|
26
|
-
body: {
|
|
27
|
-
content: {
|
|
28
|
-
"application/json": {
|
|
29
|
-
schema: z.ZodObject<{
|
|
30
|
-
name: z.ZodString;
|
|
31
|
-
type: z.ZodEnum<{
|
|
32
|
-
category: "category";
|
|
33
|
-
vendor_tier: "vendor_tier";
|
|
34
|
-
volume_tier: "volume_tier";
|
|
35
|
-
promotional: "promotional";
|
|
36
|
-
}>;
|
|
37
|
-
rateBps: z.ZodNumber;
|
|
38
|
-
categorySlug: z.ZodOptional<z.ZodString>;
|
|
39
|
-
vendorId: z.ZodOptional<z.ZodUUID>;
|
|
40
|
-
vendorTier: z.ZodOptional<z.ZodString>;
|
|
41
|
-
minVolumeCents: z.ZodOptional<z.ZodNumber>;
|
|
42
|
-
maxVolumeCents: z.ZodOptional<z.ZodNumber>;
|
|
43
|
-
validFrom: z.ZodOptional<z.ZodString>;
|
|
44
|
-
validUntil: z.ZodOptional<z.ZodString>;
|
|
45
|
-
priority: z.ZodOptional<z.ZodNumber>;
|
|
46
|
-
}, z.core.$strip>;
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
required: true;
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
responses: {
|
|
53
|
-
401: {
|
|
54
|
-
readonly content: {
|
|
55
|
-
readonly "application/json": {
|
|
56
|
-
readonly schema: z.ZodObject<{
|
|
57
|
-
error: z.ZodObject<{
|
|
58
|
-
code: z.ZodString;
|
|
59
|
-
message: z.ZodString;
|
|
60
|
-
}, z.core.$strip>;
|
|
61
|
-
}, z.core.$strip>;
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
readonly description: "Authentication required.";
|
|
65
|
-
};
|
|
66
|
-
403: {
|
|
67
|
-
readonly content: {
|
|
68
|
-
readonly "application/json": {
|
|
69
|
-
readonly schema: z.ZodObject<{
|
|
70
|
-
error: z.ZodObject<{
|
|
71
|
-
code: z.ZodString;
|
|
72
|
-
message: z.ZodString;
|
|
73
|
-
}, z.core.$strip>;
|
|
74
|
-
}, z.core.$strip>;
|
|
75
|
-
};
|
|
76
|
-
};
|
|
77
|
-
readonly description: "Insufficient permissions.";
|
|
78
|
-
};
|
|
79
|
-
404: {
|
|
80
|
-
readonly content: {
|
|
81
|
-
readonly "application/json": {
|
|
82
|
-
readonly schema: z.ZodObject<{
|
|
83
|
-
error: z.ZodObject<{
|
|
84
|
-
code: z.ZodString;
|
|
85
|
-
message: z.ZodString;
|
|
86
|
-
}, z.core.$strip>;
|
|
87
|
-
}, z.core.$strip>;
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
readonly description: "Not found.";
|
|
91
|
-
};
|
|
92
|
-
422: {
|
|
93
|
-
readonly content: {
|
|
94
|
-
readonly "application/json": {
|
|
95
|
-
readonly schema: z.ZodObject<{
|
|
96
|
-
error: z.ZodObject<{
|
|
97
|
-
code: z.ZodString;
|
|
98
|
-
message: z.ZodString;
|
|
99
|
-
}, z.core.$strip>;
|
|
100
|
-
}, z.core.$strip>;
|
|
101
|
-
};
|
|
102
|
-
};
|
|
103
|
-
readonly description: "Validation error.";
|
|
104
|
-
};
|
|
105
|
-
500: {
|
|
106
|
-
readonly content: {
|
|
107
|
-
readonly "application/json": {
|
|
108
|
-
readonly schema: z.ZodObject<{
|
|
109
|
-
error: z.ZodObject<{
|
|
110
|
-
code: z.ZodString;
|
|
111
|
-
message: z.ZodString;
|
|
112
|
-
}, z.core.$strip>;
|
|
113
|
-
}, z.core.$strip>;
|
|
114
|
-
};
|
|
115
|
-
};
|
|
116
|
-
readonly description: "Server error.";
|
|
117
|
-
};
|
|
118
|
-
201: {
|
|
119
|
-
content: {
|
|
120
|
-
"application/json": {
|
|
121
|
-
schema: z.ZodObject<{
|
|
122
|
-
data: z.ZodAny;
|
|
123
|
-
}, z.core.$strip>;
|
|
124
|
-
};
|
|
125
|
-
};
|
|
126
|
-
description: string;
|
|
127
|
-
};
|
|
128
|
-
};
|
|
129
|
-
} & {
|
|
130
|
-
getRoutingPath(): "/api/marketplace/commission-rules";
|
|
131
|
-
};
|
|
132
20
|
export declare const UpdateCommissionRuleBodySchema: z.ZodObject<{
|
|
133
21
|
name: z.ZodOptional<z.ZodString>;
|
|
134
22
|
rateBps: z.ZodOptional<z.ZodNumber>;
|
|
@@ -141,392 +29,9 @@ export declare const UpdateCommissionRuleBodySchema: z.ZodObject<{
|
|
|
141
29
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
142
30
|
isActive: z.ZodOptional<z.ZodBoolean>;
|
|
143
31
|
}, z.core.$strip>;
|
|
144
|
-
export declare const updateCommissionRuleRoute: {
|
|
145
|
-
method: "patch";
|
|
146
|
-
path: "/api/marketplace/commission-rules/{id}";
|
|
147
|
-
tags: string[];
|
|
148
|
-
summary: string;
|
|
149
|
-
request: {
|
|
150
|
-
params: z.ZodObject<{
|
|
151
|
-
id: z.ZodUUID;
|
|
152
|
-
}, z.core.$strip>;
|
|
153
|
-
body: {
|
|
154
|
-
content: {
|
|
155
|
-
"application/json": {
|
|
156
|
-
schema: z.ZodObject<{
|
|
157
|
-
name: z.ZodOptional<z.ZodString>;
|
|
158
|
-
rateBps: z.ZodOptional<z.ZodNumber>;
|
|
159
|
-
categorySlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
160
|
-
vendorTier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
161
|
-
minVolumeCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
162
|
-
maxVolumeCents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
163
|
-
validFrom: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
164
|
-
validUntil: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
165
|
-
priority: z.ZodOptional<z.ZodNumber>;
|
|
166
|
-
isActive: z.ZodOptional<z.ZodBoolean>;
|
|
167
|
-
}, z.core.$strip>;
|
|
168
|
-
};
|
|
169
|
-
};
|
|
170
|
-
required: true;
|
|
171
|
-
};
|
|
172
|
-
};
|
|
173
|
-
responses: {
|
|
174
|
-
401: {
|
|
175
|
-
readonly content: {
|
|
176
|
-
readonly "application/json": {
|
|
177
|
-
readonly schema: z.ZodObject<{
|
|
178
|
-
error: z.ZodObject<{
|
|
179
|
-
code: z.ZodString;
|
|
180
|
-
message: z.ZodString;
|
|
181
|
-
}, z.core.$strip>;
|
|
182
|
-
}, z.core.$strip>;
|
|
183
|
-
};
|
|
184
|
-
};
|
|
185
|
-
readonly description: "Authentication required.";
|
|
186
|
-
};
|
|
187
|
-
403: {
|
|
188
|
-
readonly content: {
|
|
189
|
-
readonly "application/json": {
|
|
190
|
-
readonly schema: z.ZodObject<{
|
|
191
|
-
error: z.ZodObject<{
|
|
192
|
-
code: z.ZodString;
|
|
193
|
-
message: z.ZodString;
|
|
194
|
-
}, z.core.$strip>;
|
|
195
|
-
}, z.core.$strip>;
|
|
196
|
-
};
|
|
197
|
-
};
|
|
198
|
-
readonly description: "Insufficient permissions.";
|
|
199
|
-
};
|
|
200
|
-
404: {
|
|
201
|
-
readonly content: {
|
|
202
|
-
readonly "application/json": {
|
|
203
|
-
readonly schema: z.ZodObject<{
|
|
204
|
-
error: z.ZodObject<{
|
|
205
|
-
code: z.ZodString;
|
|
206
|
-
message: z.ZodString;
|
|
207
|
-
}, z.core.$strip>;
|
|
208
|
-
}, z.core.$strip>;
|
|
209
|
-
};
|
|
210
|
-
};
|
|
211
|
-
readonly description: "Not found.";
|
|
212
|
-
};
|
|
213
|
-
422: {
|
|
214
|
-
readonly content: {
|
|
215
|
-
readonly "application/json": {
|
|
216
|
-
readonly schema: z.ZodObject<{
|
|
217
|
-
error: z.ZodObject<{
|
|
218
|
-
code: z.ZodString;
|
|
219
|
-
message: z.ZodString;
|
|
220
|
-
}, z.core.$strip>;
|
|
221
|
-
}, z.core.$strip>;
|
|
222
|
-
};
|
|
223
|
-
};
|
|
224
|
-
readonly description: "Validation error.";
|
|
225
|
-
};
|
|
226
|
-
500: {
|
|
227
|
-
readonly content: {
|
|
228
|
-
readonly "application/json": {
|
|
229
|
-
readonly schema: z.ZodObject<{
|
|
230
|
-
error: z.ZodObject<{
|
|
231
|
-
code: z.ZodString;
|
|
232
|
-
message: z.ZodString;
|
|
233
|
-
}, z.core.$strip>;
|
|
234
|
-
}, z.core.$strip>;
|
|
235
|
-
};
|
|
236
|
-
};
|
|
237
|
-
readonly description: "Server error.";
|
|
238
|
-
};
|
|
239
|
-
200: {
|
|
240
|
-
content: {
|
|
241
|
-
"application/json": {
|
|
242
|
-
schema: z.ZodObject<{
|
|
243
|
-
data: z.ZodAny;
|
|
244
|
-
}, z.core.$strip>;
|
|
245
|
-
};
|
|
246
|
-
};
|
|
247
|
-
description: string;
|
|
248
|
-
};
|
|
249
|
-
};
|
|
250
|
-
} & {
|
|
251
|
-
getRoutingPath(): "/api/marketplace/commission-rules/:id";
|
|
252
|
-
};
|
|
253
32
|
export declare const PreviewCommissionBodySchema: z.ZodObject<{
|
|
254
33
|
vendorId: z.ZodUUID;
|
|
255
34
|
categorySlug: z.ZodOptional<z.ZodString>;
|
|
256
35
|
volumeCents: z.ZodOptional<z.ZodNumber>;
|
|
257
36
|
}, z.core.$strip>;
|
|
258
|
-
export declare const previewCommissionRoute: {
|
|
259
|
-
method: "post";
|
|
260
|
-
path: "/api/marketplace/commission-rules/preview";
|
|
261
|
-
tags: string[];
|
|
262
|
-
summary: string;
|
|
263
|
-
request: {
|
|
264
|
-
body: {
|
|
265
|
-
content: {
|
|
266
|
-
"application/json": {
|
|
267
|
-
schema: z.ZodObject<{
|
|
268
|
-
vendorId: z.ZodUUID;
|
|
269
|
-
categorySlug: z.ZodOptional<z.ZodString>;
|
|
270
|
-
volumeCents: z.ZodOptional<z.ZodNumber>;
|
|
271
|
-
}, z.core.$strip>;
|
|
272
|
-
};
|
|
273
|
-
};
|
|
274
|
-
required: true;
|
|
275
|
-
};
|
|
276
|
-
};
|
|
277
|
-
responses: {
|
|
278
|
-
401: {
|
|
279
|
-
readonly content: {
|
|
280
|
-
readonly "application/json": {
|
|
281
|
-
readonly schema: z.ZodObject<{
|
|
282
|
-
error: z.ZodObject<{
|
|
283
|
-
code: z.ZodString;
|
|
284
|
-
message: z.ZodString;
|
|
285
|
-
}, z.core.$strip>;
|
|
286
|
-
}, z.core.$strip>;
|
|
287
|
-
};
|
|
288
|
-
};
|
|
289
|
-
readonly description: "Authentication required.";
|
|
290
|
-
};
|
|
291
|
-
403: {
|
|
292
|
-
readonly content: {
|
|
293
|
-
readonly "application/json": {
|
|
294
|
-
readonly schema: z.ZodObject<{
|
|
295
|
-
error: z.ZodObject<{
|
|
296
|
-
code: z.ZodString;
|
|
297
|
-
message: z.ZodString;
|
|
298
|
-
}, z.core.$strip>;
|
|
299
|
-
}, z.core.$strip>;
|
|
300
|
-
};
|
|
301
|
-
};
|
|
302
|
-
readonly description: "Insufficient permissions.";
|
|
303
|
-
};
|
|
304
|
-
404: {
|
|
305
|
-
readonly content: {
|
|
306
|
-
readonly "application/json": {
|
|
307
|
-
readonly schema: z.ZodObject<{
|
|
308
|
-
error: z.ZodObject<{
|
|
309
|
-
code: z.ZodString;
|
|
310
|
-
message: z.ZodString;
|
|
311
|
-
}, z.core.$strip>;
|
|
312
|
-
}, z.core.$strip>;
|
|
313
|
-
};
|
|
314
|
-
};
|
|
315
|
-
readonly description: "Not found.";
|
|
316
|
-
};
|
|
317
|
-
422: {
|
|
318
|
-
readonly content: {
|
|
319
|
-
readonly "application/json": {
|
|
320
|
-
readonly schema: z.ZodObject<{
|
|
321
|
-
error: z.ZodObject<{
|
|
322
|
-
code: z.ZodString;
|
|
323
|
-
message: z.ZodString;
|
|
324
|
-
}, z.core.$strip>;
|
|
325
|
-
}, z.core.$strip>;
|
|
326
|
-
};
|
|
327
|
-
};
|
|
328
|
-
readonly description: "Validation error.";
|
|
329
|
-
};
|
|
330
|
-
500: {
|
|
331
|
-
readonly content: {
|
|
332
|
-
readonly "application/json": {
|
|
333
|
-
readonly schema: z.ZodObject<{
|
|
334
|
-
error: z.ZodObject<{
|
|
335
|
-
code: z.ZodString;
|
|
336
|
-
message: z.ZodString;
|
|
337
|
-
}, z.core.$strip>;
|
|
338
|
-
}, z.core.$strip>;
|
|
339
|
-
};
|
|
340
|
-
};
|
|
341
|
-
readonly description: "Server error.";
|
|
342
|
-
};
|
|
343
|
-
200: {
|
|
344
|
-
content: {
|
|
345
|
-
"application/json": {
|
|
346
|
-
schema: z.ZodObject<{
|
|
347
|
-
data: z.ZodAny;
|
|
348
|
-
}, z.core.$strip>;
|
|
349
|
-
};
|
|
350
|
-
};
|
|
351
|
-
description: string;
|
|
352
|
-
};
|
|
353
|
-
};
|
|
354
|
-
} & {
|
|
355
|
-
getRoutingPath(): "/api/marketplace/commission-rules/preview";
|
|
356
|
-
};
|
|
357
|
-
export declare const listCommissionRulesRoute: {
|
|
358
|
-
method: "get";
|
|
359
|
-
path: "/api/marketplace/commission-rules";
|
|
360
|
-
tags: string[];
|
|
361
|
-
summary: string;
|
|
362
|
-
responses: {
|
|
363
|
-
401: {
|
|
364
|
-
readonly content: {
|
|
365
|
-
readonly "application/json": {
|
|
366
|
-
readonly schema: z.ZodObject<{
|
|
367
|
-
error: z.ZodObject<{
|
|
368
|
-
code: z.ZodString;
|
|
369
|
-
message: z.ZodString;
|
|
370
|
-
}, z.core.$strip>;
|
|
371
|
-
}, z.core.$strip>;
|
|
372
|
-
};
|
|
373
|
-
};
|
|
374
|
-
readonly description: "Authentication required.";
|
|
375
|
-
};
|
|
376
|
-
403: {
|
|
377
|
-
readonly content: {
|
|
378
|
-
readonly "application/json": {
|
|
379
|
-
readonly schema: z.ZodObject<{
|
|
380
|
-
error: z.ZodObject<{
|
|
381
|
-
code: z.ZodString;
|
|
382
|
-
message: z.ZodString;
|
|
383
|
-
}, z.core.$strip>;
|
|
384
|
-
}, z.core.$strip>;
|
|
385
|
-
};
|
|
386
|
-
};
|
|
387
|
-
readonly description: "Insufficient permissions.";
|
|
388
|
-
};
|
|
389
|
-
404: {
|
|
390
|
-
readonly content: {
|
|
391
|
-
readonly "application/json": {
|
|
392
|
-
readonly schema: z.ZodObject<{
|
|
393
|
-
error: z.ZodObject<{
|
|
394
|
-
code: z.ZodString;
|
|
395
|
-
message: z.ZodString;
|
|
396
|
-
}, z.core.$strip>;
|
|
397
|
-
}, z.core.$strip>;
|
|
398
|
-
};
|
|
399
|
-
};
|
|
400
|
-
readonly description: "Not found.";
|
|
401
|
-
};
|
|
402
|
-
422: {
|
|
403
|
-
readonly content: {
|
|
404
|
-
readonly "application/json": {
|
|
405
|
-
readonly schema: z.ZodObject<{
|
|
406
|
-
error: z.ZodObject<{
|
|
407
|
-
code: z.ZodString;
|
|
408
|
-
message: z.ZodString;
|
|
409
|
-
}, z.core.$strip>;
|
|
410
|
-
}, z.core.$strip>;
|
|
411
|
-
};
|
|
412
|
-
};
|
|
413
|
-
readonly description: "Validation error.";
|
|
414
|
-
};
|
|
415
|
-
500: {
|
|
416
|
-
readonly content: {
|
|
417
|
-
readonly "application/json": {
|
|
418
|
-
readonly schema: z.ZodObject<{
|
|
419
|
-
error: z.ZodObject<{
|
|
420
|
-
code: z.ZodString;
|
|
421
|
-
message: z.ZodString;
|
|
422
|
-
}, z.core.$strip>;
|
|
423
|
-
}, z.core.$strip>;
|
|
424
|
-
};
|
|
425
|
-
};
|
|
426
|
-
readonly description: "Server error.";
|
|
427
|
-
};
|
|
428
|
-
200: {
|
|
429
|
-
content: {
|
|
430
|
-
"application/json": {
|
|
431
|
-
schema: z.ZodObject<{
|
|
432
|
-
data: z.ZodAny;
|
|
433
|
-
}, z.core.$strip>;
|
|
434
|
-
};
|
|
435
|
-
};
|
|
436
|
-
description: string;
|
|
437
|
-
};
|
|
438
|
-
};
|
|
439
|
-
} & {
|
|
440
|
-
getRoutingPath(): "/api/marketplace/commission-rules";
|
|
441
|
-
};
|
|
442
|
-
export declare const deleteCommissionRuleRoute: {
|
|
443
|
-
method: "delete";
|
|
444
|
-
path: "/api/marketplace/commission-rules/{id}";
|
|
445
|
-
tags: string[];
|
|
446
|
-
summary: string;
|
|
447
|
-
request: {
|
|
448
|
-
params: z.ZodObject<{
|
|
449
|
-
id: z.ZodUUID;
|
|
450
|
-
}, z.core.$strip>;
|
|
451
|
-
};
|
|
452
|
-
responses: {
|
|
453
|
-
401: {
|
|
454
|
-
readonly content: {
|
|
455
|
-
readonly "application/json": {
|
|
456
|
-
readonly schema: z.ZodObject<{
|
|
457
|
-
error: z.ZodObject<{
|
|
458
|
-
code: z.ZodString;
|
|
459
|
-
message: z.ZodString;
|
|
460
|
-
}, z.core.$strip>;
|
|
461
|
-
}, z.core.$strip>;
|
|
462
|
-
};
|
|
463
|
-
};
|
|
464
|
-
readonly description: "Authentication required.";
|
|
465
|
-
};
|
|
466
|
-
403: {
|
|
467
|
-
readonly content: {
|
|
468
|
-
readonly "application/json": {
|
|
469
|
-
readonly schema: z.ZodObject<{
|
|
470
|
-
error: z.ZodObject<{
|
|
471
|
-
code: z.ZodString;
|
|
472
|
-
message: z.ZodString;
|
|
473
|
-
}, z.core.$strip>;
|
|
474
|
-
}, z.core.$strip>;
|
|
475
|
-
};
|
|
476
|
-
};
|
|
477
|
-
readonly description: "Insufficient permissions.";
|
|
478
|
-
};
|
|
479
|
-
404: {
|
|
480
|
-
readonly content: {
|
|
481
|
-
readonly "application/json": {
|
|
482
|
-
readonly schema: z.ZodObject<{
|
|
483
|
-
error: z.ZodObject<{
|
|
484
|
-
code: z.ZodString;
|
|
485
|
-
message: z.ZodString;
|
|
486
|
-
}, z.core.$strip>;
|
|
487
|
-
}, z.core.$strip>;
|
|
488
|
-
};
|
|
489
|
-
};
|
|
490
|
-
readonly description: "Not found.";
|
|
491
|
-
};
|
|
492
|
-
422: {
|
|
493
|
-
readonly content: {
|
|
494
|
-
readonly "application/json": {
|
|
495
|
-
readonly schema: z.ZodObject<{
|
|
496
|
-
error: z.ZodObject<{
|
|
497
|
-
code: z.ZodString;
|
|
498
|
-
message: z.ZodString;
|
|
499
|
-
}, z.core.$strip>;
|
|
500
|
-
}, z.core.$strip>;
|
|
501
|
-
};
|
|
502
|
-
};
|
|
503
|
-
readonly description: "Validation error.";
|
|
504
|
-
};
|
|
505
|
-
500: {
|
|
506
|
-
readonly content: {
|
|
507
|
-
readonly "application/json": {
|
|
508
|
-
readonly schema: z.ZodObject<{
|
|
509
|
-
error: z.ZodObject<{
|
|
510
|
-
code: z.ZodString;
|
|
511
|
-
message: z.ZodString;
|
|
512
|
-
}, z.core.$strip>;
|
|
513
|
-
}, z.core.$strip>;
|
|
514
|
-
};
|
|
515
|
-
};
|
|
516
|
-
readonly description: "Server error.";
|
|
517
|
-
};
|
|
518
|
-
200: {
|
|
519
|
-
content: {
|
|
520
|
-
"application/json": {
|
|
521
|
-
schema: z.ZodObject<{
|
|
522
|
-
data: z.ZodAny;
|
|
523
|
-
}, z.core.$strip>;
|
|
524
|
-
};
|
|
525
|
-
};
|
|
526
|
-
description: string;
|
|
527
|
-
};
|
|
528
|
-
};
|
|
529
|
-
} & {
|
|
530
|
-
getRoutingPath(): "/api/marketplace/commission-rules/:id";
|
|
531
|
-
};
|
|
532
37
|
//# sourceMappingURL=commission.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commission.d.ts","sourceRoot":"","sources":["../../src/schemas/commission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"commission.d.ts","sourceRoot":"","sources":["../../src/schemas/commission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAItC,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;iBAYF,CAAC;AAI1C,eAAO,MAAM,8BAA8B;;;;;;;;;;;iBAWF,CAAC;AAI1C,eAAO,MAAM,2BAA2B;;;;iBAIF,CAAC"}
|
|
@@ -1,18 +1,4 @@
|
|
|
1
|
-
import { z
|
|
2
|
-
const ErrorSchema = z.object({
|
|
3
|
-
error: z.object({
|
|
4
|
-
code: z.string(),
|
|
5
|
-
message: z.string(),
|
|
6
|
-
}),
|
|
7
|
-
});
|
|
8
|
-
const errorResponses = {
|
|
9
|
-
401: { content: { "application/json": { schema: ErrorSchema } }, description: "Authentication required." },
|
|
10
|
-
403: { content: { "application/json": { schema: ErrorSchema } }, description: "Insufficient permissions." },
|
|
11
|
-
404: { content: { "application/json": { schema: ErrorSchema } }, description: "Not found." },
|
|
12
|
-
422: { content: { "application/json": { schema: ErrorSchema } }, description: "Validation error." },
|
|
13
|
-
500: { content: { "application/json": { schema: ErrorSchema } }, description: "Server error." },
|
|
14
|
-
};
|
|
15
|
-
const CommissionResponseSchema = z.object({ data: z.any() });
|
|
1
|
+
import { z } from "@hono/zod-openapi";
|
|
16
2
|
// ─── Create Commission Rule ──────────────────────────────────────────────────
|
|
17
3
|
export const CreateCommissionRuleBodySchema = z.object({
|
|
18
4
|
name: z.string().min(1).openapi({ example: "Electronics Category Rate" }),
|
|
@@ -27,19 +13,6 @@ export const CreateCommissionRuleBodySchema = z.object({
|
|
|
27
13
|
validUntil: z.string().optional().openapi({ example: "2026-12-31T23:59:59Z", description: "ISO 8601 date string" }),
|
|
28
14
|
priority: z.number().int().optional(),
|
|
29
15
|
}).openapi("CreateCommissionRuleRequest");
|
|
30
|
-
export const createCommissionRuleRoute = createRoute({
|
|
31
|
-
method: "post",
|
|
32
|
-
path: "/api/marketplace/commission-rules",
|
|
33
|
-
tags: ["Marketplace - Commission"],
|
|
34
|
-
summary: "Create a commission rule",
|
|
35
|
-
request: {
|
|
36
|
-
body: { content: { "application/json": { schema: CreateCommissionRuleBodySchema } }, required: true },
|
|
37
|
-
},
|
|
38
|
-
responses: {
|
|
39
|
-
201: { content: { "application/json": { schema: CommissionResponseSchema } }, description: "Commission rule created." },
|
|
40
|
-
...errorResponses,
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
16
|
// ─── Update Commission Rule ──────────────────────────────────────────────────
|
|
44
17
|
export const UpdateCommissionRuleBodySchema = z.object({
|
|
45
18
|
name: z.string().min(1).optional(),
|
|
@@ -53,61 +26,11 @@ export const UpdateCommissionRuleBodySchema = z.object({
|
|
|
53
26
|
priority: z.number().int().optional(),
|
|
54
27
|
isActive: z.boolean().optional(),
|
|
55
28
|
}).openapi("UpdateCommissionRuleRequest");
|
|
56
|
-
export const updateCommissionRuleRoute = createRoute({
|
|
57
|
-
method: "patch",
|
|
58
|
-
path: "/api/marketplace/commission-rules/{id}",
|
|
59
|
-
tags: ["Marketplace - Commission"],
|
|
60
|
-
summary: "Update a commission rule",
|
|
61
|
-
request: {
|
|
62
|
-
params: z.object({ id: z.uuid() }),
|
|
63
|
-
body: { content: { "application/json": { schema: UpdateCommissionRuleBodySchema } }, required: true },
|
|
64
|
-
},
|
|
65
|
-
responses: {
|
|
66
|
-
200: { content: { "application/json": { schema: CommissionResponseSchema } }, description: "Commission rule updated." },
|
|
67
|
-
...errorResponses,
|
|
68
|
-
},
|
|
69
|
-
});
|
|
70
29
|
// ─── Preview Commission Rate ─────────────────────────────────────────────────
|
|
71
30
|
export const PreviewCommissionBodySchema = z.object({
|
|
72
31
|
vendorId: z.uuid().openapi({ example: "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f9a" }),
|
|
73
32
|
categorySlug: z.string().optional(),
|
|
74
33
|
volumeCents: z.number().int().optional().openapi({ example: 100000, description: "Order volume in cents" }),
|
|
75
34
|
}).openapi("PreviewCommissionRequest");
|
|
76
|
-
export const previewCommissionRoute = createRoute({
|
|
77
|
-
method: "post",
|
|
78
|
-
path: "/api/marketplace/commission-rules/preview",
|
|
79
|
-
tags: ["Marketplace - Commission"],
|
|
80
|
-
summary: "Preview the commission rate for a vendor",
|
|
81
|
-
request: {
|
|
82
|
-
body: { content: { "application/json": { schema: PreviewCommissionBodySchema } }, required: true },
|
|
83
|
-
},
|
|
84
|
-
responses: {
|
|
85
|
-
200: { content: { "application/json": { schema: CommissionResponseSchema } }, description: "Commission rate preview." },
|
|
86
|
-
...errorResponses,
|
|
87
|
-
},
|
|
88
|
-
});
|
|
89
35
|
// ─── List Commission Rules ──────────────────────────────────────────────────
|
|
90
|
-
export const listCommissionRulesRoute = createRoute({
|
|
91
|
-
method: "get",
|
|
92
|
-
path: "/api/marketplace/commission-rules",
|
|
93
|
-
tags: ["Marketplace - Commission"],
|
|
94
|
-
summary: "List all commission rules",
|
|
95
|
-
responses: {
|
|
96
|
-
200: { content: { "application/json": { schema: CommissionResponseSchema } }, description: "Success" },
|
|
97
|
-
...errorResponses,
|
|
98
|
-
},
|
|
99
|
-
});
|
|
100
36
|
// ─── Delete Commission Rule ─────────────────────────────────────────────────
|
|
101
|
-
export const deleteCommissionRuleRoute = createRoute({
|
|
102
|
-
method: "delete",
|
|
103
|
-
path: "/api/marketplace/commission-rules/{id}",
|
|
104
|
-
tags: ["Marketplace - Commission"],
|
|
105
|
-
summary: "Delete a commission rule",
|
|
106
|
-
request: {
|
|
107
|
-
params: z.object({ id: z.uuid() }),
|
|
108
|
-
},
|
|
109
|
-
responses: {
|
|
110
|
-
200: { content: { "application/json": { schema: CommissionResponseSchema } }, description: "Commission rule deleted." },
|
|
111
|
-
...errorResponses,
|
|
112
|
-
},
|
|
113
|
-
});
|