@porulle/core 0.7.0 → 0.8.0
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/auth/setup.d.ts.map +1 -1
- package/dist/auth/setup.js +1 -0
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +5 -0
- package/dist/config/types.d.ts +17 -1
- package/dist/config/types.d.ts.map +1 -1
- package/dist/generated/plugin-manifest.d.ts +3 -0
- package/dist/generated/plugin-manifest.d.ts.map +1 -1
- package/dist/generated/plugin-manifest.js +1 -0
- package/dist/hooks/checkout.d.ts.map +1 -1
- package/dist/hooks/checkout.js +16 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/interfaces/rest/index.d.ts.map +1 -1
- package/dist/interfaces/rest/index.js +12 -0
- package/dist/interfaces/rest/routes/admin/staff.d.ts +12 -0
- package/dist/interfaces/rest/routes/admin/staff.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/admin/staff.js +172 -0
- package/dist/interfaces/rest/routes/analytics.d.ts +5 -0
- package/dist/interfaces/rest/routes/analytics.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/analytics.js +24 -0
- package/dist/interfaces/rest/routes/carts.d.ts.map +1 -1
- package/dist/interfaces/rest/routes/carts.js +39 -2
- package/dist/interfaces/rest/routes/catalog.d.ts.map +1 -1
- package/dist/interfaces/rest/routes/catalog.js +17 -1
- package/dist/interfaces/rest/routes/checkout.d.ts.map +1 -1
- package/dist/interfaces/rest/routes/checkout.js +17 -0
- package/dist/interfaces/rest/routes/documents.d.ts +10 -0
- package/dist/interfaces/rest/routes/documents.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/documents.js +40 -0
- package/dist/interfaces/rest/routes/orders.d.ts.map +1 -1
- package/dist/interfaces/rest/routes/orders.js +98 -1
- package/dist/interfaces/rest/routes/pricing.d.ts.map +1 -1
- package/dist/interfaces/rest/routes/pricing.js +36 -1
- package/dist/interfaces/rest/routes/settings.d.ts +5 -0
- package/dist/interfaces/rest/routes/settings.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/settings.js +50 -0
- package/dist/interfaces/rest/routes/shipping.d.ts +5 -0
- package/dist/interfaces/rest/routes/shipping.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/shipping.js +68 -0
- package/dist/interfaces/rest/routes/tax.d.ts +5 -0
- package/dist/interfaces/rest/routes/tax.d.ts.map +1 -0
- package/dist/interfaces/rest/routes/tax.js +68 -0
- package/dist/interfaces/rest/schemas/admin-staff.d.ts +899 -0
- package/dist/interfaces/rest/schemas/admin-staff.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/admin-staff.js +98 -0
- package/dist/interfaces/rest/schemas/analytics.d.ts +252 -0
- package/dist/interfaces/rest/schemas/analytics.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/analytics.js +33 -0
- package/dist/interfaces/rest/schemas/carts.d.ts +656 -0
- package/dist/interfaces/rest/schemas/carts.d.ts.map +1 -1
- package/dist/interfaces/rest/schemas/carts.js +38 -0
- package/dist/interfaces/rest/schemas/catalog.d.ts +1218 -1
- package/dist/interfaces/rest/schemas/catalog.d.ts.map +1 -1
- package/dist/interfaces/rest/schemas/catalog.js +48 -0
- package/dist/interfaces/rest/schemas/checkout.d.ts +2 -0
- package/dist/interfaces/rest/schemas/checkout.d.ts.map +1 -1
- package/dist/interfaces/rest/schemas/checkout.js +4 -0
- package/dist/interfaces/rest/schemas/customer-portal.d.ts +35 -0
- package/dist/interfaces/rest/schemas/customer-portal.d.ts.map +1 -1
- package/dist/interfaces/rest/schemas/documents.d.ts +509 -0
- package/dist/interfaces/rest/schemas/documents.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/documents.js +65 -0
- package/dist/interfaces/rest/schemas/orders.d.ts +3110 -43
- package/dist/interfaces/rest/schemas/orders.d.ts.map +1 -1
- package/dist/interfaces/rest/schemas/orders.js +233 -0
- package/dist/interfaces/rest/schemas/pricing.d.ts +405 -0
- package/dist/interfaces/rest/schemas/pricing.d.ts.map +1 -1
- package/dist/interfaces/rest/schemas/pricing.js +70 -0
- package/dist/interfaces/rest/schemas/responses.d.ts +156 -0
- package/dist/interfaces/rest/schemas/responses.d.ts.map +1 -1
- package/dist/interfaces/rest/schemas/search.d.ts +17 -0
- package/dist/interfaces/rest/schemas/search.d.ts.map +1 -1
- package/dist/interfaces/rest/schemas/settings.d.ts +397 -0
- package/dist/interfaces/rest/schemas/settings.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/settings.js +79 -0
- package/dist/interfaces/rest/schemas/shipping.d.ts +1093 -0
- package/dist/interfaces/rest/schemas/shipping.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/shipping.js +146 -0
- package/dist/interfaces/rest/schemas/tax.d.ts +1074 -0
- package/dist/interfaces/rest/schemas/tax.d.ts.map +1 -0
- package/dist/interfaces/rest/schemas/tax.js +132 -0
- package/dist/kernel/database/schema.d.ts +4 -0
- package/dist/kernel/database/schema.d.ts.map +1 -1
- package/dist/kernel/database/schema.js +8 -0
- package/dist/kernel/hooks/types.d.ts +1 -1
- package/dist/kernel/hooks/types.d.ts.map +1 -1
- package/dist/kernel/plugin/manifest.d.ts +23 -0
- package/dist/kernel/plugin/manifest.d.ts.map +1 -1
- package/dist/kernel/plugin/manifest.js +17 -2
- package/dist/modules/analytics/module.d.ts.map +1 -1
- package/dist/modules/analytics/module.js +6 -0
- package/dist/modules/analytics/reports.d.ts +58 -0
- package/dist/modules/analytics/reports.d.ts.map +1 -0
- package/dist/modules/analytics/reports.js +249 -0
- package/dist/modules/analytics/service.d.ts +10 -0
- package/dist/modules/analytics/service.d.ts.map +1 -1
- package/dist/modules/analytics/service.js +14 -0
- package/dist/modules/cart/repository/index.d.ts +7 -0
- package/dist/modules/cart/repository/index.d.ts.map +1 -1
- package/dist/modules/cart/repository/index.js +25 -1
- package/dist/modules/cart/schema.d.ts +17 -0
- package/dist/modules/cart/schema.d.ts.map +1 -1
- package/dist/modules/cart/schema.js +2 -0
- package/dist/modules/cart/schemas.d.ts +1 -0
- package/dist/modules/cart/schemas.d.ts.map +1 -1
- package/dist/modules/cart/schemas.js +1 -0
- package/dist/modules/cart/service.d.ts +32 -0
- package/dist/modules/cart/service.d.ts.map +1 -1
- package/dist/modules/cart/service.js +58 -0
- package/dist/modules/catalog/entity-service.d.ts +21 -0
- package/dist/modules/catalog/entity-service.d.ts.map +1 -1
- package/dist/modules/catalog/entity-service.js +132 -3
- package/dist/modules/catalog/schema.d.ts +34 -0
- package/dist/modules/catalog/schema.d.ts.map +1 -1
- package/dist/modules/catalog/schema.js +5 -0
- package/dist/modules/catalog/schemas.d.ts +3 -0
- package/dist/modules/catalog/schemas.d.ts.map +1 -1
- package/dist/modules/catalog/schemas.js +3 -0
- package/dist/modules/catalog/service.d.ts +36 -0
- package/dist/modules/catalog/service.d.ts.map +1 -1
- package/dist/modules/catalog/service.js +6 -0
- package/dist/modules/documents/module.d.ts +7 -0
- package/dist/modules/documents/module.d.ts.map +1 -0
- package/dist/modules/documents/module.js +12 -0
- package/dist/modules/documents/pdf.d.ts +25 -0
- package/dist/modules/documents/pdf.d.ts.map +1 -0
- package/dist/modules/documents/pdf.js +80 -0
- package/dist/modules/documents/render.d.ts +32 -0
- package/dist/modules/documents/render.d.ts.map +1 -0
- package/dist/modules/documents/render.js +190 -0
- package/dist/modules/documents/repository/index.d.ts +25 -0
- package/dist/modules/documents/repository/index.d.ts.map +1 -0
- package/dist/modules/documents/repository/index.js +47 -0
- package/dist/modules/documents/schema.d.ts +214 -0
- package/dist/modules/documents/schema.d.ts.map +1 -0
- package/dist/modules/documents/schema.js +42 -0
- package/dist/modules/documents/service.d.ts +51 -0
- package/dist/modules/documents/service.d.ts.map +1 -0
- package/dist/modules/documents/service.js +119 -0
- package/dist/modules/fulfillment/service.d.ts +18 -0
- package/dist/modules/fulfillment/service.d.ts.map +1 -1
- package/dist/modules/fulfillment/service.js +85 -1
- package/dist/modules/orders/repository/index.d.ts +18 -1
- package/dist/modules/orders/repository/index.d.ts.map +1 -1
- package/dist/modules/orders/repository/index.js +86 -1
- package/dist/modules/orders/schema.d.ts +374 -0
- package/dist/modules/orders/schema.d.ts.map +1 -1
- package/dist/modules/orders/schema.js +52 -1
- package/dist/modules/orders/service.d.ts +86 -1
- package/dist/modules/orders/service.d.ts.map +1 -1
- package/dist/modules/orders/service.js +447 -20
- package/dist/modules/pricing/repository/index.d.ts +5 -0
- package/dist/modules/pricing/repository/index.d.ts.map +1 -1
- package/dist/modules/pricing/repository/index.js +19 -0
- package/dist/modules/pricing/service.d.ts +18 -0
- package/dist/modules/pricing/service.d.ts.map +1 -1
- package/dist/modules/pricing/service.js +38 -0
- package/dist/modules/settings/module.d.ts +6 -0
- package/dist/modules/settings/module.d.ts.map +1 -0
- package/dist/modules/settings/module.js +11 -0
- package/dist/modules/settings/repository/index.d.ts +16 -0
- package/dist/modules/settings/repository/index.d.ts.map +1 -0
- package/dist/modules/settings/repository/index.js +41 -0
- package/dist/modules/settings/schema.d.ts +121 -0
- package/dist/modules/settings/schema.d.ts.map +1 -0
- package/dist/modules/settings/schema.js +24 -0
- package/dist/modules/settings/service.d.ts +26 -0
- package/dist/modules/settings/service.d.ts.map +1 -0
- package/dist/modules/settings/service.js +51 -0
- package/dist/modules/shipping/calculator.d.ts +5 -0
- package/dist/modules/shipping/calculator.d.ts.map +1 -1
- package/dist/modules/shipping/calculator.js +10 -0
- package/dist/modules/shipping/module.d.ts +5 -1
- package/dist/modules/shipping/module.d.ts.map +1 -1
- package/dist/modules/shipping/module.js +4 -1
- package/dist/modules/shipping/repository/index.d.ts +27 -2
- package/dist/modules/shipping/repository/index.d.ts.map +1 -1
- package/dist/modules/shipping/repository/index.js +105 -1
- package/dist/modules/shipping/schema.d.ts +419 -0
- package/dist/modules/shipping/schema.d.ts.map +1 -0
- package/dist/modules/shipping/schema.js +56 -0
- package/dist/modules/shipping/service.d.ts +54 -0
- package/dist/modules/shipping/service.d.ts.map +1 -1
- package/dist/modules/shipping/service.js +161 -2
- package/dist/modules/tax/adapter.d.ts +13 -0
- package/dist/modules/tax/adapter.d.ts.map +1 -1
- package/dist/modules/tax/module.d.ts +5 -1
- package/dist/modules/tax/module.d.ts.map +1 -1
- package/dist/modules/tax/module.js +4 -1
- package/dist/modules/tax/repository/index.d.ts +38 -2
- package/dist/modules/tax/repository/index.d.ts.map +1 -1
- package/dist/modules/tax/repository/index.js +138 -1
- package/dist/modules/tax/schema.d.ts +355 -0
- package/dist/modules/tax/schema.d.ts.map +1 -0
- package/dist/modules/tax/schema.js +55 -0
- package/dist/modules/tax/service.d.ts +60 -1
- package/dist/modules/tax/service.d.ts.map +1 -1
- package/dist/modules/tax/service.js +227 -2
- package/dist/runtime/kernel-modules.d.ts +15 -2
- package/dist/runtime/kernel-modules.d.ts.map +1 -1
- package/dist/runtime/kernel-modules.js +4 -0
- package/dist/runtime/kernel-types.d.ts +5 -1
- package/dist/runtime/kernel-types.d.ts.map +1 -1
- package/dist/runtime/kernel-types.js +2 -0
- package/dist/runtime/server.js +1 -1
- package/dist/test-utils/create-plugin-test-app.d.ts +3 -0
- package/dist/test-utils/create-plugin-test-app.d.ts.map +1 -1
- package/dist/test-utils/create-plugin-test-app.js +15 -3
- package/dist/test-utils/rest-api-test-utils.d.ts.map +1 -1
- package/dist/test-utils/rest-api-test-utils.js +6 -0
- package/package.json +3 -3
- package/src/auth/setup.ts +1 -0
- package/src/config/defaults.ts +5 -0
- package/src/config/types.ts +17 -1
- package/src/generated/plugin-capabilities.d.ts +1 -0
- package/src/generated/plugin-manifest.ts +1 -0
- package/src/generated/plugin-repositories.d.ts +1 -0
- package/src/hooks/checkout.ts +25 -3
- package/src/index.ts +1 -0
- package/src/interfaces/rest/index.ts +12 -0
- package/src/interfaces/rest/routes/admin/staff.ts +218 -0
- package/src/interfaces/rest/routes/analytics.ts +33 -0
- package/src/interfaces/rest/routes/carts.ts +52 -2
- package/src/interfaces/rest/routes/catalog.ts +34 -0
- package/src/interfaces/rest/routes/checkout.ts +22 -0
- package/src/interfaces/rest/routes/documents.ts +61 -0
- package/src/interfaces/rest/routes/orders.ts +137 -1
- package/src/interfaces/rest/routes/pricing.ts +44 -1
- package/src/interfaces/rest/routes/settings.ts +61 -0
- package/src/interfaces/rest/routes/shipping.ts +92 -0
- package/src/interfaces/rest/routes/tax.ts +90 -0
- package/src/interfaces/rest/schemas/admin-staff.ts +110 -0
- package/src/interfaces/rest/schemas/analytics.ts +39 -0
- package/src/interfaces/rest/schemas/carts.ts +40 -0
- package/src/interfaces/rest/schemas/catalog.ts +53 -0
- package/src/interfaces/rest/schemas/checkout.ts +4 -0
- package/src/interfaces/rest/schemas/documents.ts +72 -0
- package/src/interfaces/rest/schemas/orders.ts +257 -0
- package/src/interfaces/rest/schemas/pricing.ts +75 -0
- package/src/interfaces/rest/schemas/settings.ts +93 -0
- package/src/interfaces/rest/schemas/shipping.ts +164 -0
- package/src/interfaces/rest/schemas/tax.ts +148 -0
- package/src/kernel/database/schema.ts +12 -0
- package/src/kernel/hooks/types.ts +1 -0
- package/src/kernel/plugin/manifest.ts +38 -2
- package/src/modules/analytics/module.ts +10 -0
- package/src/modules/analytics/reports.ts +311 -0
- package/src/modules/analytics/service.ts +23 -0
- package/src/modules/cart/repository/index.ts +30 -1
- package/src/modules/cart/schema.ts +2 -0
- package/src/modules/cart/schemas.ts +1 -0
- package/src/modules/cart/service.ts +101 -0
- package/src/modules/catalog/entity-service.ts +168 -3
- package/src/modules/catalog/schema.ts +5 -0
- package/src/modules/catalog/schemas.ts +3 -0
- package/src/modules/catalog/service.ts +30 -0
- package/src/modules/documents/module.ts +19 -0
- package/src/modules/documents/pdf.ts +101 -0
- package/src/modules/documents/render.ts +231 -0
- package/src/modules/documents/repository/index.ts +68 -0
- package/src/modules/documents/schema.ts +44 -0
- package/src/modules/documents/service.ts +176 -0
- package/src/modules/fulfillment/service.ts +139 -1
- package/src/modules/orders/repository/index.ts +127 -1
- package/src/modules/orders/schema.ts +54 -1
- package/src/modules/orders/service.ts +654 -22
- package/src/modules/pricing/repository/index.ts +34 -0
- package/src/modules/pricing/service.ts +71 -0
- package/src/modules/settings/module.ts +18 -0
- package/src/modules/settings/repository/index.ts +59 -0
- package/src/modules/settings/schema.ts +25 -0
- package/src/modules/settings/service.ts +82 -0
- package/src/modules/shipping/calculator.ts +27 -0
- package/src/modules/shipping/module.ts +6 -2
- package/src/modules/shipping/repository/index.ts +136 -2
- package/src/modules/shipping/schema.ts +58 -0
- package/src/modules/shipping/service.ts +260 -1
- package/src/modules/tax/adapter.ts +9 -0
- package/src/modules/tax/module.ts +6 -2
- package/src/modules/tax/repository/index.ts +169 -2
- package/src/modules/tax/schema.ts +57 -0
- package/src/modules/tax/service.ts +313 -2
- package/src/runtime/kernel-modules.ts +4 -0
- package/src/runtime/kernel-types.ts +6 -0
- package/src/runtime/server.ts +1 -1
- package/src/test-utils/create-plugin-test-app.ts +17 -4
- package/src/test-utils/rest-api-test-utils.ts +6 -0
|
@@ -173,6 +173,411 @@ export declare const setBasePriceRoute: {
|
|
|
173
173
|
} & {
|
|
174
174
|
getRoutingPath(): "/prices";
|
|
175
175
|
};
|
|
176
|
+
export declare const UpdateModifierBodySchema: z.ZodObject<{
|
|
177
|
+
name: z.ZodOptional<z.ZodString>;
|
|
178
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
179
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
180
|
+
validFrom: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
181
|
+
validUntil: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
182
|
+
minQuantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
183
|
+
maxQuantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
184
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
185
|
+
}, z.core.$strip>;
|
|
186
|
+
export declare const listModifiersRoute: {
|
|
187
|
+
method: "get";
|
|
188
|
+
path: "/modifiers";
|
|
189
|
+
tags: string[];
|
|
190
|
+
summary: string;
|
|
191
|
+
description: string;
|
|
192
|
+
request: {
|
|
193
|
+
query: z.ZodObject<{
|
|
194
|
+
entityId: z.ZodOptional<z.ZodString>;
|
|
195
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
196
|
+
active: z.ZodOptional<z.ZodString>;
|
|
197
|
+
}, z.core.$strip>;
|
|
198
|
+
};
|
|
199
|
+
responses: {
|
|
200
|
+
400: {
|
|
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
|
+
details: z.ZodOptional<z.ZodObject<{
|
|
208
|
+
issues: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
209
|
+
path: z.ZodString;
|
|
210
|
+
message: z.ZodString;
|
|
211
|
+
code: z.ZodString;
|
|
212
|
+
}, z.core.$strip>>>;
|
|
213
|
+
}, z.core.$strip>>;
|
|
214
|
+
}, z.core.$strip>;
|
|
215
|
+
}, z.core.$strip>;
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
readonly description: "Business logic error.";
|
|
219
|
+
};
|
|
220
|
+
401: {
|
|
221
|
+
readonly content: {
|
|
222
|
+
readonly "application/json": {
|
|
223
|
+
readonly schema: z.ZodObject<{
|
|
224
|
+
error: z.ZodObject<{
|
|
225
|
+
code: z.ZodString;
|
|
226
|
+
message: z.ZodString;
|
|
227
|
+
details: z.ZodOptional<z.ZodObject<{
|
|
228
|
+
issues: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
229
|
+
path: z.ZodString;
|
|
230
|
+
message: z.ZodString;
|
|
231
|
+
code: z.ZodString;
|
|
232
|
+
}, z.core.$strip>>>;
|
|
233
|
+
}, z.core.$strip>>;
|
|
234
|
+
}, z.core.$strip>;
|
|
235
|
+
}, z.core.$strip>;
|
|
236
|
+
};
|
|
237
|
+
};
|
|
238
|
+
readonly description: "Authentication required.";
|
|
239
|
+
};
|
|
240
|
+
403: {
|
|
241
|
+
readonly content: {
|
|
242
|
+
readonly "application/json": {
|
|
243
|
+
readonly schema: z.ZodObject<{
|
|
244
|
+
error: z.ZodObject<{
|
|
245
|
+
code: z.ZodString;
|
|
246
|
+
message: z.ZodString;
|
|
247
|
+
details: z.ZodOptional<z.ZodObject<{
|
|
248
|
+
issues: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
249
|
+
path: z.ZodString;
|
|
250
|
+
message: z.ZodString;
|
|
251
|
+
code: z.ZodString;
|
|
252
|
+
}, z.core.$strip>>>;
|
|
253
|
+
}, z.core.$strip>>;
|
|
254
|
+
}, z.core.$strip>;
|
|
255
|
+
}, z.core.$strip>;
|
|
256
|
+
};
|
|
257
|
+
};
|
|
258
|
+
readonly description: "Insufficient permissions.";
|
|
259
|
+
};
|
|
260
|
+
404: {
|
|
261
|
+
readonly content: {
|
|
262
|
+
readonly "application/json": {
|
|
263
|
+
readonly schema: z.ZodObject<{
|
|
264
|
+
error: z.ZodObject<{
|
|
265
|
+
code: z.ZodString;
|
|
266
|
+
message: z.ZodString;
|
|
267
|
+
details: z.ZodOptional<z.ZodObject<{
|
|
268
|
+
issues: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
269
|
+
path: z.ZodString;
|
|
270
|
+
message: z.ZodString;
|
|
271
|
+
code: z.ZodString;
|
|
272
|
+
}, z.core.$strip>>>;
|
|
273
|
+
}, z.core.$strip>>;
|
|
274
|
+
}, z.core.$strip>;
|
|
275
|
+
}, z.core.$strip>;
|
|
276
|
+
};
|
|
277
|
+
};
|
|
278
|
+
readonly description: "Resource not found.";
|
|
279
|
+
};
|
|
280
|
+
422: {
|
|
281
|
+
readonly content: {
|
|
282
|
+
readonly "application/json": {
|
|
283
|
+
readonly schema: z.ZodObject<{
|
|
284
|
+
error: z.ZodObject<{
|
|
285
|
+
code: z.ZodString;
|
|
286
|
+
message: z.ZodString;
|
|
287
|
+
details: z.ZodOptional<z.ZodObject<{
|
|
288
|
+
issues: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
289
|
+
path: z.ZodString;
|
|
290
|
+
message: z.ZodString;
|
|
291
|
+
code: z.ZodString;
|
|
292
|
+
}, z.core.$strip>>>;
|
|
293
|
+
}, z.core.$strip>>;
|
|
294
|
+
}, z.core.$strip>;
|
|
295
|
+
}, z.core.$strip>;
|
|
296
|
+
};
|
|
297
|
+
};
|
|
298
|
+
readonly description: "Validation error.";
|
|
299
|
+
};
|
|
300
|
+
200: {
|
|
301
|
+
content: {
|
|
302
|
+
"application/json": {
|
|
303
|
+
schema: z.ZodObject<{
|
|
304
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
305
|
+
}, z.core.$strip>;
|
|
306
|
+
};
|
|
307
|
+
};
|
|
308
|
+
description: string;
|
|
309
|
+
};
|
|
310
|
+
};
|
|
311
|
+
} & {
|
|
312
|
+
getRoutingPath(): "/modifiers";
|
|
313
|
+
};
|
|
314
|
+
export declare const updateModifierRoute: {
|
|
315
|
+
method: "patch";
|
|
316
|
+
path: "/modifiers/{id}";
|
|
317
|
+
tags: string[];
|
|
318
|
+
summary: string;
|
|
319
|
+
request: {
|
|
320
|
+
params: z.ZodObject<{
|
|
321
|
+
id: z.ZodUUID;
|
|
322
|
+
}, z.core.$strip>;
|
|
323
|
+
body: {
|
|
324
|
+
content: {
|
|
325
|
+
"application/json": {
|
|
326
|
+
schema: z.ZodObject<{
|
|
327
|
+
name: z.ZodOptional<z.ZodString>;
|
|
328
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
329
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
330
|
+
validFrom: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
331
|
+
validUntil: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
332
|
+
minQuantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
333
|
+
maxQuantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
334
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
335
|
+
}, z.core.$strip>;
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
required: true;
|
|
339
|
+
};
|
|
340
|
+
};
|
|
341
|
+
responses: {
|
|
342
|
+
400: {
|
|
343
|
+
readonly content: {
|
|
344
|
+
readonly "application/json": {
|
|
345
|
+
readonly schema: z.ZodObject<{
|
|
346
|
+
error: z.ZodObject<{
|
|
347
|
+
code: z.ZodString;
|
|
348
|
+
message: z.ZodString;
|
|
349
|
+
details: z.ZodOptional<z.ZodObject<{
|
|
350
|
+
issues: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
351
|
+
path: z.ZodString;
|
|
352
|
+
message: z.ZodString;
|
|
353
|
+
code: z.ZodString;
|
|
354
|
+
}, z.core.$strip>>>;
|
|
355
|
+
}, z.core.$strip>>;
|
|
356
|
+
}, z.core.$strip>;
|
|
357
|
+
}, z.core.$strip>;
|
|
358
|
+
};
|
|
359
|
+
};
|
|
360
|
+
readonly description: "Business logic error.";
|
|
361
|
+
};
|
|
362
|
+
401: {
|
|
363
|
+
readonly content: {
|
|
364
|
+
readonly "application/json": {
|
|
365
|
+
readonly schema: z.ZodObject<{
|
|
366
|
+
error: z.ZodObject<{
|
|
367
|
+
code: z.ZodString;
|
|
368
|
+
message: z.ZodString;
|
|
369
|
+
details: z.ZodOptional<z.ZodObject<{
|
|
370
|
+
issues: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
371
|
+
path: z.ZodString;
|
|
372
|
+
message: z.ZodString;
|
|
373
|
+
code: z.ZodString;
|
|
374
|
+
}, z.core.$strip>>>;
|
|
375
|
+
}, z.core.$strip>>;
|
|
376
|
+
}, z.core.$strip>;
|
|
377
|
+
}, z.core.$strip>;
|
|
378
|
+
};
|
|
379
|
+
};
|
|
380
|
+
readonly description: "Authentication required.";
|
|
381
|
+
};
|
|
382
|
+
403: {
|
|
383
|
+
readonly content: {
|
|
384
|
+
readonly "application/json": {
|
|
385
|
+
readonly schema: z.ZodObject<{
|
|
386
|
+
error: z.ZodObject<{
|
|
387
|
+
code: z.ZodString;
|
|
388
|
+
message: z.ZodString;
|
|
389
|
+
details: z.ZodOptional<z.ZodObject<{
|
|
390
|
+
issues: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
391
|
+
path: z.ZodString;
|
|
392
|
+
message: z.ZodString;
|
|
393
|
+
code: z.ZodString;
|
|
394
|
+
}, z.core.$strip>>>;
|
|
395
|
+
}, z.core.$strip>>;
|
|
396
|
+
}, z.core.$strip>;
|
|
397
|
+
}, z.core.$strip>;
|
|
398
|
+
};
|
|
399
|
+
};
|
|
400
|
+
readonly description: "Insufficient permissions.";
|
|
401
|
+
};
|
|
402
|
+
404: {
|
|
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
|
+
details: z.ZodOptional<z.ZodObject<{
|
|
410
|
+
issues: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
411
|
+
path: z.ZodString;
|
|
412
|
+
message: z.ZodString;
|
|
413
|
+
code: z.ZodString;
|
|
414
|
+
}, z.core.$strip>>>;
|
|
415
|
+
}, z.core.$strip>>;
|
|
416
|
+
}, z.core.$strip>;
|
|
417
|
+
}, z.core.$strip>;
|
|
418
|
+
};
|
|
419
|
+
};
|
|
420
|
+
readonly description: "Resource not found.";
|
|
421
|
+
};
|
|
422
|
+
422: {
|
|
423
|
+
readonly content: {
|
|
424
|
+
readonly "application/json": {
|
|
425
|
+
readonly schema: z.ZodObject<{
|
|
426
|
+
error: z.ZodObject<{
|
|
427
|
+
code: z.ZodString;
|
|
428
|
+
message: z.ZodString;
|
|
429
|
+
details: z.ZodOptional<z.ZodObject<{
|
|
430
|
+
issues: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
431
|
+
path: z.ZodString;
|
|
432
|
+
message: z.ZodString;
|
|
433
|
+
code: z.ZodString;
|
|
434
|
+
}, z.core.$strip>>>;
|
|
435
|
+
}, z.core.$strip>>;
|
|
436
|
+
}, z.core.$strip>;
|
|
437
|
+
}, z.core.$strip>;
|
|
438
|
+
};
|
|
439
|
+
};
|
|
440
|
+
readonly description: "Validation error.";
|
|
441
|
+
};
|
|
442
|
+
200: {
|
|
443
|
+
content: {
|
|
444
|
+
"application/json": {
|
|
445
|
+
schema: z.ZodObject<{
|
|
446
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
447
|
+
}, z.core.$strip>;
|
|
448
|
+
};
|
|
449
|
+
};
|
|
450
|
+
description: string;
|
|
451
|
+
};
|
|
452
|
+
};
|
|
453
|
+
} & {
|
|
454
|
+
getRoutingPath(): "/modifiers/:id";
|
|
455
|
+
};
|
|
456
|
+
export declare const deleteModifierRoute: {
|
|
457
|
+
method: "delete";
|
|
458
|
+
path: "/modifiers/{id}";
|
|
459
|
+
tags: string[];
|
|
460
|
+
summary: string;
|
|
461
|
+
request: {
|
|
462
|
+
params: z.ZodObject<{
|
|
463
|
+
id: z.ZodUUID;
|
|
464
|
+
}, z.core.$strip>;
|
|
465
|
+
};
|
|
466
|
+
responses: {
|
|
467
|
+
400: {
|
|
468
|
+
readonly content: {
|
|
469
|
+
readonly "application/json": {
|
|
470
|
+
readonly schema: z.ZodObject<{
|
|
471
|
+
error: z.ZodObject<{
|
|
472
|
+
code: z.ZodString;
|
|
473
|
+
message: z.ZodString;
|
|
474
|
+
details: z.ZodOptional<z.ZodObject<{
|
|
475
|
+
issues: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
476
|
+
path: z.ZodString;
|
|
477
|
+
message: z.ZodString;
|
|
478
|
+
code: z.ZodString;
|
|
479
|
+
}, z.core.$strip>>>;
|
|
480
|
+
}, z.core.$strip>>;
|
|
481
|
+
}, z.core.$strip>;
|
|
482
|
+
}, z.core.$strip>;
|
|
483
|
+
};
|
|
484
|
+
};
|
|
485
|
+
readonly description: "Business logic error.";
|
|
486
|
+
};
|
|
487
|
+
401: {
|
|
488
|
+
readonly content: {
|
|
489
|
+
readonly "application/json": {
|
|
490
|
+
readonly schema: z.ZodObject<{
|
|
491
|
+
error: z.ZodObject<{
|
|
492
|
+
code: z.ZodString;
|
|
493
|
+
message: z.ZodString;
|
|
494
|
+
details: z.ZodOptional<z.ZodObject<{
|
|
495
|
+
issues: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
496
|
+
path: z.ZodString;
|
|
497
|
+
message: z.ZodString;
|
|
498
|
+
code: z.ZodString;
|
|
499
|
+
}, z.core.$strip>>>;
|
|
500
|
+
}, z.core.$strip>>;
|
|
501
|
+
}, z.core.$strip>;
|
|
502
|
+
}, z.core.$strip>;
|
|
503
|
+
};
|
|
504
|
+
};
|
|
505
|
+
readonly description: "Authentication required.";
|
|
506
|
+
};
|
|
507
|
+
403: {
|
|
508
|
+
readonly content: {
|
|
509
|
+
readonly "application/json": {
|
|
510
|
+
readonly schema: z.ZodObject<{
|
|
511
|
+
error: z.ZodObject<{
|
|
512
|
+
code: z.ZodString;
|
|
513
|
+
message: z.ZodString;
|
|
514
|
+
details: z.ZodOptional<z.ZodObject<{
|
|
515
|
+
issues: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
516
|
+
path: z.ZodString;
|
|
517
|
+
message: z.ZodString;
|
|
518
|
+
code: z.ZodString;
|
|
519
|
+
}, z.core.$strip>>>;
|
|
520
|
+
}, z.core.$strip>>;
|
|
521
|
+
}, z.core.$strip>;
|
|
522
|
+
}, z.core.$strip>;
|
|
523
|
+
};
|
|
524
|
+
};
|
|
525
|
+
readonly description: "Insufficient permissions.";
|
|
526
|
+
};
|
|
527
|
+
404: {
|
|
528
|
+
readonly content: {
|
|
529
|
+
readonly "application/json": {
|
|
530
|
+
readonly schema: z.ZodObject<{
|
|
531
|
+
error: z.ZodObject<{
|
|
532
|
+
code: z.ZodString;
|
|
533
|
+
message: z.ZodString;
|
|
534
|
+
details: z.ZodOptional<z.ZodObject<{
|
|
535
|
+
issues: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
536
|
+
path: z.ZodString;
|
|
537
|
+
message: z.ZodString;
|
|
538
|
+
code: z.ZodString;
|
|
539
|
+
}, z.core.$strip>>>;
|
|
540
|
+
}, z.core.$strip>>;
|
|
541
|
+
}, z.core.$strip>;
|
|
542
|
+
}, z.core.$strip>;
|
|
543
|
+
};
|
|
544
|
+
};
|
|
545
|
+
readonly description: "Resource not found.";
|
|
546
|
+
};
|
|
547
|
+
422: {
|
|
548
|
+
readonly content: {
|
|
549
|
+
readonly "application/json": {
|
|
550
|
+
readonly schema: z.ZodObject<{
|
|
551
|
+
error: z.ZodObject<{
|
|
552
|
+
code: z.ZodString;
|
|
553
|
+
message: z.ZodString;
|
|
554
|
+
details: z.ZodOptional<z.ZodObject<{
|
|
555
|
+
issues: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
556
|
+
path: z.ZodString;
|
|
557
|
+
message: z.ZodString;
|
|
558
|
+
code: z.ZodString;
|
|
559
|
+
}, z.core.$strip>>>;
|
|
560
|
+
}, z.core.$strip>>;
|
|
561
|
+
}, z.core.$strip>;
|
|
562
|
+
}, z.core.$strip>;
|
|
563
|
+
};
|
|
564
|
+
};
|
|
565
|
+
readonly description: "Validation error.";
|
|
566
|
+
};
|
|
567
|
+
200: {
|
|
568
|
+
content: {
|
|
569
|
+
"application/json": {
|
|
570
|
+
schema: z.ZodObject<{
|
|
571
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
572
|
+
}, z.core.$strip>;
|
|
573
|
+
};
|
|
574
|
+
};
|
|
575
|
+
description: string;
|
|
576
|
+
};
|
|
577
|
+
};
|
|
578
|
+
} & {
|
|
579
|
+
getRoutingPath(): "/modifiers/:id";
|
|
580
|
+
};
|
|
176
581
|
export declare const createModifierRoute: {
|
|
177
582
|
method: "post";
|
|
178
583
|
path: "/modifiers";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pricing.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/rest/schemas/pricing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAe,MAAM,mBAAmB,CAAC;AAKnD,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AACvG,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,CAAC;AAI5D,eAAO,MAAM,qBAAqB;;iBAEL,CAAC;AAI9B,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmB1B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoB5B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoB9B,CAAC"}
|
|
1
|
+
{"version":3,"file":"pricing.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/rest/schemas/pricing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAe,MAAM,mBAAmB,CAAC;AAKnD,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AACvG,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,CAAC;AAI5D,eAAO,MAAM,qBAAqB;;iBAEL,CAAC;AAI9B,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmB1B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoB5B,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;iBASF,CAAC;AAMpC,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoB7B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmB9B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAe9B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoB9B,CAAC"}
|
|
@@ -49,6 +49,76 @@ export const setBasePriceRoute = createRoute({
|
|
|
49
49
|
...errorResponses,
|
|
50
50
|
},
|
|
51
51
|
});
|
|
52
|
+
export const UpdateModifierBodySchema = z.object({
|
|
53
|
+
name: z.string().optional(),
|
|
54
|
+
value: z.number().optional(),
|
|
55
|
+
priority: z.number().int().optional(),
|
|
56
|
+
validFrom: z.coerce.date().nullable().optional(),
|
|
57
|
+
validUntil: z.coerce.date().nullable().optional(),
|
|
58
|
+
minQuantity: z.number().int().nullable().optional(),
|
|
59
|
+
maxQuantity: z.number().int().nullable().optional(),
|
|
60
|
+
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
61
|
+
}).openapi("UpdateModifierRequest");
|
|
62
|
+
const ModifierIdParam = z.object({
|
|
63
|
+
id: z.uuid().openapi({ example: "550e8400-e29b-41d4-a716-446655440000" }),
|
|
64
|
+
});
|
|
65
|
+
export const listModifiersRoute = createRoute({
|
|
66
|
+
method: "get",
|
|
67
|
+
path: "/modifiers",
|
|
68
|
+
tags: ["Pricing"],
|
|
69
|
+
summary: "List price modifiers",
|
|
70
|
+
description: "Lists active and scheduled price modifiers. Filter by entityId, currency, or active=true (currently within validity window).",
|
|
71
|
+
request: {
|
|
72
|
+
query: z.object({
|
|
73
|
+
entityId: z.string().optional(),
|
|
74
|
+
currency: z.string().optional(),
|
|
75
|
+
active: z.string().optional().openapi({ example: "true" }),
|
|
76
|
+
}),
|
|
77
|
+
},
|
|
78
|
+
responses: {
|
|
79
|
+
200: {
|
|
80
|
+
content: { "application/json": { schema: PricingResponseSchema } },
|
|
81
|
+
description: "Price modifiers",
|
|
82
|
+
},
|
|
83
|
+
...errorResponses,
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
export const updateModifierRoute = createRoute({
|
|
87
|
+
method: "patch",
|
|
88
|
+
path: "/modifiers/{id}",
|
|
89
|
+
tags: ["Pricing"],
|
|
90
|
+
summary: "Update a price modifier's value or validity",
|
|
91
|
+
request: {
|
|
92
|
+
params: ModifierIdParam,
|
|
93
|
+
body: {
|
|
94
|
+
content: { "application/json": { schema: UpdateModifierBodySchema } },
|
|
95
|
+
required: true,
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
responses: {
|
|
99
|
+
200: {
|
|
100
|
+
content: { "application/json": { schema: PricingResponseSchema } },
|
|
101
|
+
description: "Price modifier updated.",
|
|
102
|
+
},
|
|
103
|
+
...errorResponses,
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
export const deleteModifierRoute = createRoute({
|
|
107
|
+
method: "delete",
|
|
108
|
+
path: "/modifiers/{id}",
|
|
109
|
+
tags: ["Pricing"],
|
|
110
|
+
summary: "Delete a price modifier (end a sale early)",
|
|
111
|
+
request: {
|
|
112
|
+
params: ModifierIdParam,
|
|
113
|
+
},
|
|
114
|
+
responses: {
|
|
115
|
+
200: {
|
|
116
|
+
content: { "application/json": { schema: PricingResponseSchema } },
|
|
117
|
+
description: "Price modifier deleted.",
|
|
118
|
+
},
|
|
119
|
+
...errorResponses,
|
|
120
|
+
},
|
|
121
|
+
});
|
|
52
122
|
export const createModifierRoute = createRoute({
|
|
53
123
|
method: "post",
|
|
54
124
|
path: "/modifiers",
|