@shophost/rest-api 2.0.50 → 2.0.52
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 +3 -3
- package/package.json +1 -1
- package/schema.prisma +4 -0
- package/src/{app.d.ts → bootstrap.d.ts} +2 -4
- package/src/bootstrap.js +1 -0
- package/src/bootstrap.js.map +1 -0
- package/src/container.d.ts +49 -0
- package/src/container.js +1 -0
- package/src/container.js.map +1 -0
- package/src/core/db/__generated__/client/internal/class.js +33 -29
- package/src/core/db/__generated__/client/internal/class.js.map +1 -1
- package/src/core/db/__generated__/client/internal/prismaNamespace.d.ts +4 -0
- package/src/core/db/__generated__/client/internal/prismaNamespace.js +1 -1
- package/src/core/db/__generated__/client/internal/prismaNamespace.js.map +1 -1
- package/src/core/db/__generated__/client/internal/prismaNamespaceBrowser.d.ts +4 -0
- package/src/core/db/__generated__/client/internal/prismaNamespaceBrowser.js +1 -1
- package/src/core/db/__generated__/client/internal/prismaNamespaceBrowser.js.map +1 -1
- package/src/core/db/__generated__/client/models/Order.d.ts +178 -1
- package/src/core/db/__generated__/client/models/Product.d.ts +75 -1
- package/src/core/lib/prisma.d.ts +62 -62
- package/src/core/notifications/email.service.d.ts +8 -2
- package/src/core/notifications/email.service.js +1 -1
- package/src/core/notifications/email.service.js.map +1 -1
- package/src/core/openapi/openapi.lib.d.ts +2 -2
- package/src/core/openapi/openapi.lib.js +1 -1
- package/src/core/openapi/openapi.lib.js.map +1 -1
- package/src/core/utils/zod.util.js +1 -1
- package/src/core/utils/zod.util.js.map +1 -1
- package/src/features/access/access.handler.d.ts +2 -2
- package/src/features/access/access.handler.js +1 -1
- package/src/features/access/access.handler.js.map +1 -1
- package/src/features/analytics/analytics.handler.d.ts +2 -2
- package/src/features/analytics/analytics.handler.js +1 -1
- package/src/features/analytics/analytics.handler.js.map +1 -1
- package/src/features/cart/cart.handler.d.ts +2 -2
- package/src/features/cart/cart.handler.js +1 -1
- package/src/features/cart/cart.handler.js.map +1 -1
- package/src/features/cart/cart.route.d.ts +29 -0
- package/src/features/cart/cart.route.js +1 -1
- package/src/features/cart/cart.route.js.map +1 -1
- package/src/features/cart/cart.schema.d.ts +399 -0
- package/src/features/cart/cart.schema.js +1 -1
- package/src/features/cart/cart.schema.js.map +1 -1
- package/src/features/cart/cart.service.d.ts +30 -3
- package/src/features/cart/cart.service.js +1 -1
- package/src/features/cart/cart.service.js.map +1 -1
- package/src/features/file/file.handler.d.ts +2 -2
- package/src/features/file/file.handler.js +1 -1
- package/src/features/file/file.handler.js.map +1 -1
- package/src/features/health/health.handler.d.ts +1 -1
- package/src/features/health/health.handler.js +1 -1
- package/src/features/health/health.handler.js.map +1 -1
- package/src/features/index.d.ts +17 -17
- package/src/features/index.js +1 -1
- package/src/features/index.js.map +1 -1
- package/src/features/integration/integration-config.d.ts +25 -0
- package/src/features/integration/integration-config.js +1 -0
- package/src/features/integration/integration-config.js.map +1 -0
- package/src/features/integration/integration-registry.d.ts +39 -0
- package/src/features/integration/integration-registry.js +1 -0
- package/src/features/integration/integration-registry.js.map +1 -0
- package/src/features/integration/integration.handler.d.ts +2 -2
- package/src/features/integration/integration.handler.js +1 -1
- package/src/features/integration/integration.handler.js.map +1 -1
- package/src/features/integration/integration.schema.d.ts +15 -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 +3 -4
- package/src/features/integration/integration.service.js +1 -1
- package/src/features/integration/integration.service.js.map +1 -1
- package/src/features/inventory/inventory.service.d.ts +24 -0
- package/src/features/inventory/inventory.service.js +1 -0
- package/src/features/inventory/inventory.service.js.map +1 -0
- package/src/features/location/location.handler.d.ts +2 -7
- package/src/features/location/location.handler.js +1 -1
- package/src/features/location/location.handler.js.map +1 -1
- package/src/features/manufacturer/manufacturer.handler.d.ts +2 -2
- package/src/features/manufacturer/manufacturer.handler.js +1 -1
- package/src/features/manufacturer/manufacturer.handler.js.map +1 -1
- package/src/features/order/order.handler.d.ts +2 -4
- package/src/features/order/order.handler.js +1 -1
- package/src/features/order/order.handler.js.map +1 -1
- package/src/features/order/order.route.d.ts +314 -0
- package/src/features/order/order.route.js +1 -1
- package/src/features/order/order.route.js.map +1 -1
- package/src/features/order/order.schema.d.ts +33 -0
- package/src/features/order/order.schema.js +1 -1
- package/src/features/order/order.schema.js.map +1 -1
- package/src/features/order/order.service.d.ts +57 -6
- package/src/features/order/order.service.js +1 -1
- package/src/features/order/order.service.js.map +1 -1
- package/src/features/organization/organization-configuration.schema.d.ts +18 -18
- package/src/features/organization/organization.handler.d.ts +2 -2
- package/src/features/organization/organization.handler.js +1 -1
- package/src/features/organization/organization.handler.js.map +1 -1
- package/src/features/organization/organization.route.d.ts +18 -18
- package/src/features/organization/organization.schema.d.ts +18 -18
- package/src/features/organization/organization.service.d.ts +4 -2
- package/src/features/organization/organization.service.js +1 -1
- package/src/features/organization/organization.service.js.map +1 -1
- package/src/features/payment/payment.handler.d.ts +2 -3
- package/src/features/payment/payment.handler.js +1 -1
- package/src/features/payment/payment.handler.js.map +1 -1
- package/src/features/payment/payment.service.d.ts +9 -8
- 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 +3 -2
- package/src/features/payment/stripe.service.js +1 -1
- package/src/features/payment/stripe.service.js.map +1 -1
- package/src/features/product/product.handler.d.ts +2 -2
- package/src/features/product/product.handler.js +1 -1
- package/src/features/product/product.handler.js.map +1 -1
- package/src/features/product/product.route.d.ts +10 -0
- package/src/features/product/product.schema.d.ts +4 -0
- package/src/features/product/product.schema.js +1 -1
- package/src/features/product/product.schema.js.map +1 -1
- package/src/features/product/product.service.d.ts +8 -0
- package/src/features/product/product.service.js +1 -1
- package/src/features/product/product.service.js.map +1 -1
- package/src/features/product-category/product-category.handler.d.ts +2 -2
- package/src/features/product-category/product-category.handler.js +1 -1
- package/src/features/product-category/product-category.handler.js.map +1 -1
- package/src/features/reservation/reservation.handler.d.ts +2 -2
- package/src/features/reservation/reservation.handler.js +1 -1
- package/src/features/reservation/reservation.handler.js.map +1 -1
- package/src/features/reservation/reservation.service.d.ts +5 -2
- package/src/features/reservation/reservation.service.js +1 -1
- package/src/features/reservation/reservation.service.js.map +1 -1
- package/src/features/shipping/shipping.handler.d.ts +2 -2
- package/src/features/shipping/shipping.handler.js +1 -1
- package/src/features/shipping/shipping.handler.js.map +1 -1
- package/src/features/shipping/shipping.service.d.ts +4 -2
- package/src/features/shipping/shipping.service.js +1 -1
- package/src/features/shipping/shipping.service.js.map +1 -1
- package/src/features/shipping-method/shipping-method.handler.d.ts +2 -2
- package/src/features/shipping-method/shipping-method.handler.js +1 -1
- package/src/features/shipping-method/shipping-method.handler.js.map +1 -1
- package/src/features/webhook/webhook.handler.d.ts +2 -4
- package/src/features/webhook/webhook.handler.js +1 -1
- package/src/features/webhook/webhook.handler.js.map +1 -1
- package/src/index.d.ts +1 -2
- package/src/index.js +1 -1
- package/src/index.js.map +1 -1
- package/src/integrations/next.d.ts +2 -4
- package/src/integrations/next.js +1 -1
- package/src/integrations/next.js.map +1 -1
- package/src/schemas/number.schema.d.ts +1 -0
- package/src/schemas/number.schema.js +1 -1
- package/src/schemas/number.schema.js.map +1 -1
- package/src/app.js +0 -1
- package/src/app.js.map +0 -1
- package/src/core/notifications/notification-options.d.ts +0 -3
- package/src/core/notifications/notification-options.js +0 -1
- package/src/core/notifications/notification-options.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as
|
|
1
|
+
import{__awaiter as u}from"tslib";import{createApiRouter as l}from"../../core/hono/hono";import{manufacturerRoute as d}from"./manufacturer.route";export const registerManufacturerHandlers=i=>{const o=l();return o.openapi(d.createManufacturer,a=>u(void 0,void 0,void 0,function*(){const r=a.get("auth"),t=a.req.valid("param"),e=a.req.valid("json"),n=yield r.isGranted("create"),s=yield i.createManufacturer(t.organizationId,n.id,e);return a.json(s,201)})),o.openapi(d.getManufacturer,a=>u(void 0,void 0,void 0,function*(){const r=a.get("auth"),t=a.req.valid("param"),e=a.req.valid("query");yield r.isGranted("read");const n=yield i.getManufacturer(t.organizationId,t.id,{locale:e.locale||null});return a.json(n,200)})),o.openapi(d.getManufacturers,a=>u(void 0,void 0,void 0,function*(){const r=a.get("auth"),t=a.req.valid("param"),e=a.req.valid("query");yield r.isGranted("read");const n=yield i.getManufacturers(t.organizationId,Object.assign(Object.assign({},e),{locale:e.locale||null}));return a.json(n,200)})),o.openapi(d.updateManufacturer,a=>u(void 0,void 0,void 0,function*(){const r=a.get("auth"),t=a.req.valid("param"),e=a.req.valid("json"),n=yield r.isGranted("update"),s=yield i.updateManufacturer(t.organizationId,t.id,n.id,e);return a.json(s,200)})),o.openapi(d.deleteManufacturer,a=>u(void 0,void 0,void 0,function*(){const r=a.get("auth"),t=a.req.valid("param"),e=yield r.isGranted("delete");return yield i.deleteManufacturer(t.organizationId,t.id,e.id),a.body(null,204)})),o};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manufacturer.handler.js","sourceRoot":"","sources":["../../../../../../packages/rest-api/src/features/manufacturer/manufacturer.handler.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"manufacturer.handler.js","sourceRoot":"","sources":["../../../../../../packages/rest-api/src/features/manufacturer/manufacturer.handler.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,OAA4B,EAAE,EAAE;IAC3E,MAAM,GAAG,GAAG,eAAe,EAAE,CAAC;IAE9B,GAAG,CAAC,OAAO,CAAC,iBAAiB,CAAC,kBAAkB,EAAE,CAAO,CAAC,EAAE,EAAE;QAC5D,MAAM,IAAI,GAAG,CAAC,CAAC,GAAG,CA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AC,MAAM,CAAC,CAAC;QAC3B,MAAM,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACpC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QAE5C,MAAM,OAAO,CAAC,kBAAkB,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;QAE5E,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAC3B,CAAC,CAAA,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC;AACb,CAAC,CAAC"}
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { PaymentServiceOptions } from "../payment/payment.service";
|
|
4
|
-
export declare const buildOrderHandler: (prisma: PrismaClientType, options: PaymentServiceOptions, notifications?: NotificationOptions) => import("@hono/zod-openapi").OpenAPIHono<import("../../core/hono/hono").AppBindings, {}, "/">;
|
|
1
|
+
import { OrderService } from "./order.service";
|
|
2
|
+
export declare const registerOrderHandlers: (service: OrderService) => import("@hono/zod-openapi").OpenAPIHono<import("../../core/hono/hono").AppBindings, {}, "/">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as
|
|
1
|
+
import{__awaiter as s}from"tslib";import{createApiRouter as l}from"../../core/hono/hono";import{orderRoute as u}from"./order.route";import{OrderInventoryConflictError as v}from"./order.service";export const registerOrderHandlers=i=>{const n=l();return n.openapi(u.createOrder,r=>s(void 0,void 0,void 0,function*(){const e=r.get("auth"),t=r.req.valid("param"),o=r.req.valid("json"),a=yield e.getCurrentUser();try{const{order:d,redirectUrl:p}=yield i.createOrder(t.organizationId,a,o);return r.json({order:d,redirectUrl:p},201)}catch(d){if(d instanceof v)return r.json(d.payload,409);throw d}})),n.openapi(u.getMyOrders,r=>s(void 0,void 0,void 0,function*(){const e=r.get("auth"),t=r.req.valid("param"),o=r.req.valid("query"),a=yield e.getCurrentUser(),d=yield i.getMyOrders(a.id,t.organizationId,o);return r.json(d,200)})),n.openapi(u.getOrder,r=>s(void 0,void 0,void 0,function*(){const e=r.get("auth"),t=r.req.valid("param"),o=yield e.getCurrentUser(),a=yield i.getOrder(o,t.organizationId,t.id);return r.json(a,200)})),n.openapi(u.getOrders,r=>s(void 0,void 0,void 0,function*(){const e=r.get("auth"),t=r.req.valid("param"),o=r.req.valid("query");yield e.isGranted("read");const a=yield i.getOrders(t.organizationId,o);return r.json(a,200)})),n.openapi(u.updateStatus,r=>s(void 0,void 0,void 0,function*(){const e=r.get("auth"),t=r.req.valid("param");yield e.isGranted("update");const o=yield i.updateStatus(t.organizationId,t.id,t.operation);return r.json(o,200)})),n.openapi(u.deleteOrder,r=>s(void 0,void 0,void 0,function*(){const e=r.get("auth"),t=r.req.valid("param"),o=yield e.isGranted("delete");return yield i.deleteOrder(t.organizationId,t.id,o.id),r.body(null,204)})),n};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order.handler.js","sourceRoot":"","sources":["../../../../../../packages/rest-api/src/features/order/order.handler.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"order.handler.js","sourceRoot":"","sources":["../../../../../../packages/rest-api/src/features/order/order.handler.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EACL,2BAA2B,GAE5B,MAAM,iBAAiB,CAAC;AAEzB,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,OAAqB,EAAE,EAAE;IAC7D,MAAM,GAAG,GAAG,eAAe,EAAE,CAAC;IAE9B,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,CAAO,CAAC,EAAE,EAAE;QA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EAAE,EAAE;QAC/C,MAAM,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC3B,MAAM,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAEpC,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QAE/B,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,YAAY,CACtC,MAAM,CAAC,cAAc,EACrB,MAAM,CAAC,EAAE,EACT,MAAM,CAAC,SAAS,CACjB,CAAC;QAEF,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC5B,CAAC,CAAA,CAAC,CAAC;IAEH,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,CAAO,CAAC,EAAE,EAAE;QAC9C,MAAM,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC3B,MAAM,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACpC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QAE5C,MAAM,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;QAErE,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAC3B,CAAC,CAAA,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC;AACb,CAAC,CAAC"}
|
|
@@ -336,6 +336,14 @@ export declare const orderRoute: {
|
|
|
336
336
|
createdAt: z.ZodDate;
|
|
337
337
|
completedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
338
338
|
cancelledAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
339
|
+
inventoryDeductedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
340
|
+
inventoryConflictAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
341
|
+
inventoryConflictItems: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
342
|
+
productId: z.ZodString;
|
|
343
|
+
title: z.ZodString;
|
|
344
|
+
requestedQuantity: z.ZodNumber;
|
|
345
|
+
availableQuantity: z.ZodNumber;
|
|
346
|
+
}, z.core.$strip>>>>;
|
|
339
347
|
shippingAddress: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
340
348
|
id: z.ZodString;
|
|
341
349
|
firstname: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
@@ -535,6 +543,14 @@ export declare const orderRoute: {
|
|
|
535
543
|
readyForDispatchAt?: Date | null | undefined;
|
|
536
544
|
completedAt?: Date | null | undefined;
|
|
537
545
|
cancelledAt?: Date | null | undefined;
|
|
546
|
+
inventoryDeductedAt?: Date | null | undefined;
|
|
547
|
+
inventoryConflictAt?: Date | null | undefined;
|
|
548
|
+
inventoryConflictItems?: {
|
|
549
|
+
productId: string;
|
|
550
|
+
title: string;
|
|
551
|
+
requestedQuantity: number;
|
|
552
|
+
availableQuantity: number;
|
|
553
|
+
}[] | null | undefined;
|
|
538
554
|
shippingAddress?: {
|
|
539
555
|
id: string;
|
|
540
556
|
addressLineOne: string;
|
|
@@ -634,6 +650,14 @@ export declare const orderRoute: {
|
|
|
634
650
|
readyForDispatchAt?: Date | null | undefined;
|
|
635
651
|
completedAt?: Date | null | undefined;
|
|
636
652
|
cancelledAt?: Date | null | undefined;
|
|
653
|
+
inventoryDeductedAt?: Date | null | undefined;
|
|
654
|
+
inventoryConflictAt?: Date | null | undefined;
|
|
655
|
+
inventoryConflictItems?: {
|
|
656
|
+
productId: string;
|
|
657
|
+
title: string;
|
|
658
|
+
requestedQuantity: number;
|
|
659
|
+
availableQuantity: number;
|
|
660
|
+
}[] | null | undefined;
|
|
637
661
|
shippingAddress?: {
|
|
638
662
|
id: string;
|
|
639
663
|
addressLineOne: string;
|
|
@@ -1027,6 +1051,14 @@ export declare const orderRoute: {
|
|
|
1027
1051
|
createdAt: z.ZodDate;
|
|
1028
1052
|
completedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
1029
1053
|
cancelledAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
1054
|
+
inventoryDeductedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
1055
|
+
inventoryConflictAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
1056
|
+
inventoryConflictItems: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
1057
|
+
productId: z.ZodString;
|
|
1058
|
+
title: z.ZodString;
|
|
1059
|
+
requestedQuantity: z.ZodNumber;
|
|
1060
|
+
availableQuantity: z.ZodNumber;
|
|
1061
|
+
}, z.core.$strip>>>>;
|
|
1030
1062
|
shippingAddress: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1031
1063
|
id: z.ZodString;
|
|
1032
1064
|
firstname: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
@@ -1226,6 +1258,14 @@ export declare const orderRoute: {
|
|
|
1226
1258
|
readyForDispatchAt?: Date | null | undefined;
|
|
1227
1259
|
completedAt?: Date | null | undefined;
|
|
1228
1260
|
cancelledAt?: Date | null | undefined;
|
|
1261
|
+
inventoryDeductedAt?: Date | null | undefined;
|
|
1262
|
+
inventoryConflictAt?: Date | null | undefined;
|
|
1263
|
+
inventoryConflictItems?: {
|
|
1264
|
+
productId: string;
|
|
1265
|
+
title: string;
|
|
1266
|
+
requestedQuantity: number;
|
|
1267
|
+
availableQuantity: number;
|
|
1268
|
+
}[] | null | undefined;
|
|
1229
1269
|
shippingAddress?: {
|
|
1230
1270
|
id: string;
|
|
1231
1271
|
addressLineOne: string;
|
|
@@ -1325,6 +1365,14 @@ export declare const orderRoute: {
|
|
|
1325
1365
|
readyForDispatchAt?: Date | null | undefined;
|
|
1326
1366
|
completedAt?: Date | null | undefined;
|
|
1327
1367
|
cancelledAt?: Date | null | undefined;
|
|
1368
|
+
inventoryDeductedAt?: Date | null | undefined;
|
|
1369
|
+
inventoryConflictAt?: Date | null | undefined;
|
|
1370
|
+
inventoryConflictItems?: {
|
|
1371
|
+
productId: string;
|
|
1372
|
+
title: string;
|
|
1373
|
+
requestedQuantity: number;
|
|
1374
|
+
availableQuantity: number;
|
|
1375
|
+
}[] | null | undefined;
|
|
1328
1376
|
shippingAddress?: {
|
|
1329
1377
|
id: string;
|
|
1330
1378
|
addressLineOne: string;
|
|
@@ -1637,6 +1685,14 @@ export declare const orderRoute: {
|
|
|
1637
1685
|
createdAt: z.ZodDate;
|
|
1638
1686
|
completedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
1639
1687
|
cancelledAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
1688
|
+
inventoryDeductedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
1689
|
+
inventoryConflictAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
1690
|
+
inventoryConflictItems: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
1691
|
+
productId: z.ZodString;
|
|
1692
|
+
title: z.ZodString;
|
|
1693
|
+
requestedQuantity: z.ZodNumber;
|
|
1694
|
+
availableQuantity: z.ZodNumber;
|
|
1695
|
+
}, z.core.$strip>>>>;
|
|
1640
1696
|
shippingAddress: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1641
1697
|
id: z.ZodString;
|
|
1642
1698
|
firstname: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
@@ -1836,6 +1892,14 @@ export declare const orderRoute: {
|
|
|
1836
1892
|
readyForDispatchAt?: Date | null | undefined;
|
|
1837
1893
|
completedAt?: Date | null | undefined;
|
|
1838
1894
|
cancelledAt?: Date | null | undefined;
|
|
1895
|
+
inventoryDeductedAt?: Date | null | undefined;
|
|
1896
|
+
inventoryConflictAt?: Date | null | undefined;
|
|
1897
|
+
inventoryConflictItems?: {
|
|
1898
|
+
productId: string;
|
|
1899
|
+
title: string;
|
|
1900
|
+
requestedQuantity: number;
|
|
1901
|
+
availableQuantity: number;
|
|
1902
|
+
}[] | null | undefined;
|
|
1839
1903
|
shippingAddress?: {
|
|
1840
1904
|
id: string;
|
|
1841
1905
|
addressLineOne: string;
|
|
@@ -1935,6 +1999,14 @@ export declare const orderRoute: {
|
|
|
1935
1999
|
readyForDispatchAt?: Date | null | undefined;
|
|
1936
2000
|
completedAt?: Date | null | undefined;
|
|
1937
2001
|
cancelledAt?: Date | null | undefined;
|
|
2002
|
+
inventoryDeductedAt?: Date | null | undefined;
|
|
2003
|
+
inventoryConflictAt?: Date | null | undefined;
|
|
2004
|
+
inventoryConflictItems?: {
|
|
2005
|
+
productId: string;
|
|
2006
|
+
title: string;
|
|
2007
|
+
requestedQuantity: number;
|
|
2008
|
+
availableQuantity: number;
|
|
2009
|
+
}[] | null | undefined;
|
|
1938
2010
|
shippingAddress?: {
|
|
1939
2011
|
id: string;
|
|
1940
2012
|
addressLineOne: string;
|
|
@@ -1956,6 +2028,200 @@ export declare const orderRoute: {
|
|
|
1956
2028
|
};
|
|
1957
2029
|
description: string;
|
|
1958
2030
|
};
|
|
2031
|
+
409: {
|
|
2032
|
+
content: {
|
|
2033
|
+
"application/json": {
|
|
2034
|
+
schema: z.ZodObject<{
|
|
2035
|
+
invalidProductIds: z.ZodArray<z.ZodString>;
|
|
2036
|
+
normalizedItems: z.ZodArray<z.ZodObject<{
|
|
2037
|
+
productId: z.ZodString;
|
|
2038
|
+
quantity: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
2039
|
+
modifierGroups: z.ZodArray<z.ZodObject<{
|
|
2040
|
+
id: z.ZodString;
|
|
2041
|
+
modifiers: z.ZodArray<z.ZodObject<{
|
|
2042
|
+
id: z.ZodString;
|
|
2043
|
+
quantity: z.ZodDefault<z.ZodNumber>;
|
|
2044
|
+
}, z.core.$strip>>;
|
|
2045
|
+
}, z.core.$strip>>;
|
|
2046
|
+
}, z.core.$strip>>;
|
|
2047
|
+
adjustments: z.ZodArray<z.ZodObject<{
|
|
2048
|
+
productId: z.ZodString;
|
|
2049
|
+
modifierGroups: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2050
|
+
id: z.ZodString;
|
|
2051
|
+
modifiers: z.ZodArray<z.ZodObject<{
|
|
2052
|
+
id: z.ZodString;
|
|
2053
|
+
quantity: z.ZodDefault<z.ZodNumber>;
|
|
2054
|
+
}, z.core.$strip>>;
|
|
2055
|
+
}, z.core.$strip>>>;
|
|
2056
|
+
reason: z.ZodEnum<{
|
|
2057
|
+
invalid_product: "invalid_product";
|
|
2058
|
+
out_of_stock: "out_of_stock";
|
|
2059
|
+
insufficient_stock: "insufficient_stock";
|
|
2060
|
+
}>;
|
|
2061
|
+
requestedQuantity: z.ZodNumber;
|
|
2062
|
+
resolvedQuantity: z.ZodNumber;
|
|
2063
|
+
}, z.core.$strip>>;
|
|
2064
|
+
products: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
2065
|
+
description: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
2066
|
+
title: z.ZodDefault<z.ZodString>;
|
|
2067
|
+
currency: z.ZodString;
|
|
2068
|
+
id: z.ZodString;
|
|
2069
|
+
createdAt: z.ZodDate;
|
|
2070
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
2071
|
+
publishedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
2072
|
+
sku: z.ZodOptional<z.ZodString>;
|
|
2073
|
+
basePrice: z.ZodCoercedNumber<unknown>;
|
|
2074
|
+
discountedBasePrice: 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>>;
|
|
2075
|
+
availableQuantity: 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>>;
|
|
2076
|
+
images: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2077
|
+
id: z.ZodString;
|
|
2078
|
+
url: z.ZodString;
|
|
2079
|
+
mimeType: z.ZodString;
|
|
2080
|
+
size: z.ZodNumber;
|
|
2081
|
+
filename: z.ZodString;
|
|
2082
|
+
}, z.core.$strip>>>;
|
|
2083
|
+
modifierGroups: z.ZodArray<z.ZodObject<{
|
|
2084
|
+
title: z.ZodNullable<z.ZodDefault<z.ZodString>>;
|
|
2085
|
+
id: z.ZodString;
|
|
2086
|
+
defaultLocale: z.ZodOptional<z.ZodEnum<{
|
|
2087
|
+
id: "id";
|
|
2088
|
+
af: "af";
|
|
2089
|
+
sq: "sq";
|
|
2090
|
+
ar_dz: "ar_dz";
|
|
2091
|
+
ar_bh: "ar_bh";
|
|
2092
|
+
ar_eg: "ar_eg";
|
|
2093
|
+
ar_iq: "ar_iq";
|
|
2094
|
+
ar_jo: "ar_jo";
|
|
2095
|
+
ar_kw: "ar_kw";
|
|
2096
|
+
ar_lb: "ar_lb";
|
|
2097
|
+
ar_ly: "ar_ly";
|
|
2098
|
+
ar_ma: "ar_ma";
|
|
2099
|
+
ar_om: "ar_om";
|
|
2100
|
+
ar_qa: "ar_qa";
|
|
2101
|
+
ar_sa: "ar_sa";
|
|
2102
|
+
ar_sy: "ar_sy";
|
|
2103
|
+
ar_tn: "ar_tn";
|
|
2104
|
+
ar_ae: "ar_ae";
|
|
2105
|
+
ar_ye: "ar_ye";
|
|
2106
|
+
eu: "eu";
|
|
2107
|
+
be: "be";
|
|
2108
|
+
bg: "bg";
|
|
2109
|
+
ca: "ca";
|
|
2110
|
+
zh_hk: "zh_hk";
|
|
2111
|
+
zh_cn: "zh_cn";
|
|
2112
|
+
zh_sg: "zh_sg";
|
|
2113
|
+
zh_tw: "zh_tw";
|
|
2114
|
+
hr: "hr";
|
|
2115
|
+
cs: "cs";
|
|
2116
|
+
da: "da";
|
|
2117
|
+
nl_be: "nl_be";
|
|
2118
|
+
nl: "nl";
|
|
2119
|
+
en: "en";
|
|
2120
|
+
en_au: "en_au";
|
|
2121
|
+
en_bz: "en_bz";
|
|
2122
|
+
en_ca: "en_ca";
|
|
2123
|
+
en_ie: "en_ie";
|
|
2124
|
+
en_jm: "en_jm";
|
|
2125
|
+
en_nz: "en_nz";
|
|
2126
|
+
en_za: "en_za";
|
|
2127
|
+
en_tt: "en_tt";
|
|
2128
|
+
en_gb: "en_gb";
|
|
2129
|
+
en_us: "en_us";
|
|
2130
|
+
et: "et";
|
|
2131
|
+
fo: "fo";
|
|
2132
|
+
fa: "fa";
|
|
2133
|
+
fi: "fi";
|
|
2134
|
+
fr_be: "fr_be";
|
|
2135
|
+
fr_ca: "fr_ca";
|
|
2136
|
+
fr_lu: "fr_lu";
|
|
2137
|
+
fr: "fr";
|
|
2138
|
+
fr_ch: "fr_ch";
|
|
2139
|
+
gd: "gd";
|
|
2140
|
+
de_at: "de_at";
|
|
2141
|
+
de_li: "de_li";
|
|
2142
|
+
de_lu: "de_lu";
|
|
2143
|
+
de: "de";
|
|
2144
|
+
de_ch: "de_ch";
|
|
2145
|
+
el: "el";
|
|
2146
|
+
he: "he";
|
|
2147
|
+
hi: "hi";
|
|
2148
|
+
hu: "hu";
|
|
2149
|
+
is: "is";
|
|
2150
|
+
ga: "ga";
|
|
2151
|
+
it: "it";
|
|
2152
|
+
it_ch: "it_ch";
|
|
2153
|
+
ja: "ja";
|
|
2154
|
+
ko: "ko";
|
|
2155
|
+
ku: "ku";
|
|
2156
|
+
lv: "lv";
|
|
2157
|
+
lt: "lt";
|
|
2158
|
+
mk: "mk";
|
|
2159
|
+
ml: "ml";
|
|
2160
|
+
ms: "ms";
|
|
2161
|
+
mt: "mt";
|
|
2162
|
+
no: "no";
|
|
2163
|
+
nb: "nb";
|
|
2164
|
+
nn: "nn";
|
|
2165
|
+
pl: "pl";
|
|
2166
|
+
pt_br: "pt_br";
|
|
2167
|
+
pt: "pt";
|
|
2168
|
+
pa: "pa";
|
|
2169
|
+
rm: "rm";
|
|
2170
|
+
ro: "ro";
|
|
2171
|
+
ro_md: "ro_md";
|
|
2172
|
+
ru: "ru";
|
|
2173
|
+
ru_md: "ru_md";
|
|
2174
|
+
sr: "sr";
|
|
2175
|
+
sk: "sk";
|
|
2176
|
+
sl: "sl";
|
|
2177
|
+
sb: "sb";
|
|
2178
|
+
es_ar: "es_ar";
|
|
2179
|
+
es_bo: "es_bo";
|
|
2180
|
+
es_cl: "es_cl";
|
|
2181
|
+
es_co: "es_co";
|
|
2182
|
+
es_cr: "es_cr";
|
|
2183
|
+
es_do: "es_do";
|
|
2184
|
+
es_ec: "es_ec";
|
|
2185
|
+
es_sv: "es_sv";
|
|
2186
|
+
es_gt: "es_gt";
|
|
2187
|
+
es_hn: "es_hn";
|
|
2188
|
+
es_mx: "es_mx";
|
|
2189
|
+
es: "es";
|
|
2190
|
+
sv: "sv";
|
|
2191
|
+
sv_fi: "sv_fi";
|
|
2192
|
+
th: "th";
|
|
2193
|
+
tr: "tr";
|
|
2194
|
+
uk: "uk";
|
|
2195
|
+
ur: "ur";
|
|
2196
|
+
vi: "vi";
|
|
2197
|
+
cy: "cy";
|
|
2198
|
+
ji: "ji";
|
|
2199
|
+
zu: "zu";
|
|
2200
|
+
}>>;
|
|
2201
|
+
selectMin: z.ZodCoercedNumber<unknown>;
|
|
2202
|
+
selectMax: z.ZodCoercedNumber<unknown>;
|
|
2203
|
+
modifiers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2204
|
+
id: z.ZodOptional<z.ZodString>;
|
|
2205
|
+
title: z.ZodString;
|
|
2206
|
+
sku: z.ZodOptional<z.ZodCoercedString<unknown>>;
|
|
2207
|
+
price: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
2208
|
+
}, z.core.$strip>>>;
|
|
2209
|
+
}, z.core.$strip>>;
|
|
2210
|
+
categories: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
2211
|
+
id: z.ZodString;
|
|
2212
|
+
}, z.core.$strip>>>;
|
|
2213
|
+
manufacturerId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2214
|
+
metadata: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
2215
|
+
}, z.core.$strip>>;
|
|
2216
|
+
shipping: z.ZodOptional<z.ZodNumber>;
|
|
2217
|
+
subtotal: z.ZodNumber;
|
|
2218
|
+
total: z.ZodNumber;
|
|
2219
|
+
message: z.ZodString;
|
|
2220
|
+
}, z.core.$strip>;
|
|
2221
|
+
};
|
|
2222
|
+
};
|
|
2223
|
+
description: string;
|
|
2224
|
+
};
|
|
1959
2225
|
400: {
|
|
1960
2226
|
content: {
|
|
1961
2227
|
"application/json": {
|
|
@@ -2209,6 +2475,14 @@ export declare const orderRoute: {
|
|
|
2209
2475
|
createdAt: z.ZodDate;
|
|
2210
2476
|
completedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
2211
2477
|
cancelledAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
2478
|
+
inventoryDeductedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
2479
|
+
inventoryConflictAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
2480
|
+
inventoryConflictItems: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
2481
|
+
productId: z.ZodString;
|
|
2482
|
+
title: z.ZodString;
|
|
2483
|
+
requestedQuantity: z.ZodNumber;
|
|
2484
|
+
availableQuantity: z.ZodNumber;
|
|
2485
|
+
}, z.core.$strip>>>>;
|
|
2212
2486
|
shippingAddress: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
2213
2487
|
id: z.ZodString;
|
|
2214
2488
|
firstname: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
@@ -2408,6 +2682,14 @@ export declare const orderRoute: {
|
|
|
2408
2682
|
readyForDispatchAt?: Date | null | undefined;
|
|
2409
2683
|
completedAt?: Date | null | undefined;
|
|
2410
2684
|
cancelledAt?: Date | null | undefined;
|
|
2685
|
+
inventoryDeductedAt?: Date | null | undefined;
|
|
2686
|
+
inventoryConflictAt?: Date | null | undefined;
|
|
2687
|
+
inventoryConflictItems?: {
|
|
2688
|
+
productId: string;
|
|
2689
|
+
title: string;
|
|
2690
|
+
requestedQuantity: number;
|
|
2691
|
+
availableQuantity: number;
|
|
2692
|
+
}[] | null | undefined;
|
|
2411
2693
|
shippingAddress?: {
|
|
2412
2694
|
id: string;
|
|
2413
2695
|
addressLineOne: string;
|
|
@@ -2507,6 +2789,14 @@ export declare const orderRoute: {
|
|
|
2507
2789
|
readyForDispatchAt?: Date | null | undefined;
|
|
2508
2790
|
completedAt?: Date | null | undefined;
|
|
2509
2791
|
cancelledAt?: Date | null | undefined;
|
|
2792
|
+
inventoryDeductedAt?: Date | null | undefined;
|
|
2793
|
+
inventoryConflictAt?: Date | null | undefined;
|
|
2794
|
+
inventoryConflictItems?: {
|
|
2795
|
+
productId: string;
|
|
2796
|
+
title: string;
|
|
2797
|
+
requestedQuantity: number;
|
|
2798
|
+
availableQuantity: number;
|
|
2799
|
+
}[] | null | undefined;
|
|
2510
2800
|
shippingAddress?: {
|
|
2511
2801
|
id: string;
|
|
2512
2802
|
addressLineOne: string;
|
|
@@ -2777,6 +3067,14 @@ export declare const orderRoute: {
|
|
|
2777
3067
|
createdAt: z.ZodDate;
|
|
2778
3068
|
completedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
2779
3069
|
cancelledAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
3070
|
+
inventoryDeductedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
3071
|
+
inventoryConflictAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
3072
|
+
inventoryConflictItems: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
3073
|
+
productId: z.ZodString;
|
|
3074
|
+
title: z.ZodString;
|
|
3075
|
+
requestedQuantity: z.ZodNumber;
|
|
3076
|
+
availableQuantity: z.ZodNumber;
|
|
3077
|
+
}, z.core.$strip>>>>;
|
|
2780
3078
|
shippingAddress: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
2781
3079
|
id: z.ZodString;
|
|
2782
3080
|
firstname: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
@@ -2976,6 +3274,14 @@ export declare const orderRoute: {
|
|
|
2976
3274
|
readyForDispatchAt?: Date | null | undefined;
|
|
2977
3275
|
completedAt?: Date | null | undefined;
|
|
2978
3276
|
cancelledAt?: Date | null | undefined;
|
|
3277
|
+
inventoryDeductedAt?: Date | null | undefined;
|
|
3278
|
+
inventoryConflictAt?: Date | null | undefined;
|
|
3279
|
+
inventoryConflictItems?: {
|
|
3280
|
+
productId: string;
|
|
3281
|
+
title: string;
|
|
3282
|
+
requestedQuantity: number;
|
|
3283
|
+
availableQuantity: number;
|
|
3284
|
+
}[] | null | undefined;
|
|
2979
3285
|
shippingAddress?: {
|
|
2980
3286
|
id: string;
|
|
2981
3287
|
addressLineOne: string;
|
|
@@ -3075,6 +3381,14 @@ export declare const orderRoute: {
|
|
|
3075
3381
|
readyForDispatchAt?: Date | null | undefined;
|
|
3076
3382
|
completedAt?: Date | null | undefined;
|
|
3077
3383
|
cancelledAt?: Date | null | undefined;
|
|
3384
|
+
inventoryDeductedAt?: Date | null | undefined;
|
|
3385
|
+
inventoryConflictAt?: Date | null | undefined;
|
|
3386
|
+
inventoryConflictItems?: {
|
|
3387
|
+
productId: string;
|
|
3388
|
+
title: string;
|
|
3389
|
+
requestedQuantity: number;
|
|
3390
|
+
availableQuantity: number;
|
|
3391
|
+
}[] | null | undefined;
|
|
3078
3392
|
shippingAddress?: {
|
|
3079
3393
|
id: string;
|
|
3080
3394
|
addressLineOne: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as r}from"@hono/zod-openapi";import{createApiRoute as t}from"../../core/hono/hono";import{CreateOrderSchema as
|
|
1
|
+
import{z as r}from"@hono/zod-openapi";import{createApiRoute as t}from"../../core/hono/hono";import{CartConflictSchema as p}from"../cart/cart.schema";import{CreateOrderSchema as m,ErrorSchema as e,HeaderSchema as a,OrderSchema as o,OrderStatusSchema as h,OrganizationParams as s,OrganizationWithIdParams as d,PaginationMetaSchema as n,PaginationQuerySchema as i}from"../../schemas";const c=t({description:"Fetches paginated list of orders",headers:a,method:"GET",operationId:"getOrders",path:"/:organizationId/orders",pathParams:s,query:i,responses:{200:r.object({list:r.array(o),meta:n}),400:e,401:e},summary:"Get Orders",tags:["Order"]}),g=t({description:"Fetches paginated list of orders for the authenticated user",headers:a,method:"GET",operationId:"getMyOrders",path:"/:organizationId/orders/me",pathParams:s,query:i,responses:{200:r.object({list:r.array(o),meta:n}),400:e,401:e},summary:"Get My Orders",tags:["Order"]}),O=t({body:m,description:"Creates a new order",headers:a,method:"POST",operationId:"createOrder",path:"/:organizationId/orders",pathParams:r.object({organizationId:r.string().cuid().min(1).openapi({description:"The organization ID",example:"ckel0e8qw00004n5p5w6fznym",param:{in:"path",name:"organizationId"}})}),responses:{201:r.object({order:o,redirectUrl:r.string().url().optional()}),409:p,400:e,401:e,404:e},summary:"Create Order",tags:["Order"]}),u=t({headers:a,method:"GET",operationId:"getOrder",path:"/:organizationId/orders/:id",pathParams:d,responses:{200:o,401:e,404:e},summary:"Get Order",tags:["Order"]}),l=t({description:"Changes the status of an existing order based on the operation",headers:a,method:"POST",operationId:"updateOrderStatus",path:"/:organizationId/orders/:id/status/:operation",pathParams:d.extend({operation:h}),responses:{200:o,400:e,401:e,404:e},summary:"Change Order Status",tags:["Order"]}),y=t({description:"Soft deletes order",headers:a,method:"DELETE",operationId:"deleteOrder",path:"/:organizationId/orders/:id",pathParams:d,responses:{204:null,400:e,401:e,404:e},summary:"Delete Order",tags:["Order"]});export const orderRoute={getOrders:c,getMyOrders:g,createOrder:O,getOrder:u,updateStatus:l,deleteOrder:y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order.route.js","sourceRoot":"","sources":["../../../../../../packages/rest-api/src/features/order/order.route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,eAAe,CAAC;AAEvB,MAAM,cAAc,GAAG,cAAc,CAAC;IACpC,WAAW,EAAE,kCAAkC;IAC/C,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,KAAK;IACb,WAAW,EAAE,WAAW;IACxB,IAAI,EAAE,yBAAyB;IAC/B,UAAU,EAAE,kBAAkB;IAC9B,KAAK,EAAE,qBAAqB;IAC5B,SAAS,EAAE;QACT,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC;YACZ,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC;YAC1B,IAAI,EAAE,oBAAoB;SAC3B,CAAC;QACF,GAAG,EAAE,WAAW;QAChB,GAAG,EAAE,WAAW;KACjB;IACD,OAAO,EAAE,YAAY;IACrB,IAAI,EAAE,CAAC,OAAO,CAAC;CAChB,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAAG,cAAc,CAAC;IACtC,WAAW,EAAE,6DAA6D;IAC1E,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,KAAK;IACb,WAAW,EAAE,aAAa;IAC1B,IAAI,EAAE,4BAA4B;IAClC,UAAU,EAAE,kBAAkB;IAC9B,KAAK,EAAE,qBAAqB;IAC5B,SAAS,EAAE;QACT,GAAG,EAAE,CAAC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art.schema";
|
|
2
3
|
export declare const OrderStatusSchema: z.ZodEnum<{
|
|
3
4
|
pending: "pending";
|
|
4
5
|
draft: "draft";
|
|
@@ -151,6 +152,12 @@ export declare const OrderItemSchema: z.ZodObject<{
|
|
|
151
152
|
quantity: z.ZodNumber;
|
|
152
153
|
productSnapshotId: z.ZodString;
|
|
153
154
|
}, z.core.$strip>;
|
|
155
|
+
export declare const InventoryConflictItemSchema: z.ZodObject<{
|
|
156
|
+
productId: z.ZodString;
|
|
157
|
+
title: z.ZodString;
|
|
158
|
+
requestedQuantity: z.ZodNumber;
|
|
159
|
+
availableQuantity: z.ZodNumber;
|
|
160
|
+
}, z.core.$strip>;
|
|
154
161
|
export declare const OrderSchema: z.ZodPipe<z.ZodObject<{
|
|
155
162
|
id: z.ZodString;
|
|
156
163
|
referenceId: z.ZodString;
|
|
@@ -345,6 +352,14 @@ export declare const OrderSchema: z.ZodPipe<z.ZodObject<{
|
|
|
345
352
|
createdAt: z.ZodDate;
|
|
346
353
|
completedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
347
354
|
cancelledAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
355
|
+
inventoryDeductedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
356
|
+
inventoryConflictAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
357
|
+
inventoryConflictItems: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
358
|
+
productId: z.ZodString;
|
|
359
|
+
title: z.ZodString;
|
|
360
|
+
requestedQuantity: z.ZodNumber;
|
|
361
|
+
availableQuantity: z.ZodNumber;
|
|
362
|
+
}, z.core.$strip>>>>;
|
|
348
363
|
shippingAddress: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
349
364
|
id: z.ZodString;
|
|
350
365
|
firstname: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
@@ -544,6 +559,14 @@ export declare const OrderSchema: z.ZodPipe<z.ZodObject<{
|
|
|
544
559
|
readyForDispatchAt?: Date | null | undefined;
|
|
545
560
|
completedAt?: Date | null | undefined;
|
|
546
561
|
cancelledAt?: Date | null | undefined;
|
|
562
|
+
inventoryDeductedAt?: Date | null | undefined;
|
|
563
|
+
inventoryConflictAt?: Date | null | undefined;
|
|
564
|
+
inventoryConflictItems?: {
|
|
565
|
+
productId: string;
|
|
566
|
+
title: string;
|
|
567
|
+
requestedQuantity: number;
|
|
568
|
+
availableQuantity: number;
|
|
569
|
+
}[] | null | undefined;
|
|
547
570
|
shippingAddress?: {
|
|
548
571
|
id: string;
|
|
549
572
|
addressLineOne: string;
|
|
@@ -643,6 +666,14 @@ export declare const OrderSchema: z.ZodPipe<z.ZodObject<{
|
|
|
643
666
|
readyForDispatchAt?: Date | null | undefined;
|
|
644
667
|
completedAt?: Date | null | undefined;
|
|
645
668
|
cancelledAt?: Date | null | undefined;
|
|
669
|
+
inventoryDeductedAt?: Date | null | undefined;
|
|
670
|
+
inventoryConflictAt?: Date | null | undefined;
|
|
671
|
+
inventoryConflictItems?: {
|
|
672
|
+
productId: string;
|
|
673
|
+
title: string;
|
|
674
|
+
requestedQuantity: number;
|
|
675
|
+
availableQuantity: number;
|
|
676
|
+
}[] | null | undefined;
|
|
646
677
|
shippingAddress?: {
|
|
647
678
|
id: string;
|
|
648
679
|
addressLineOne: string;
|
|
@@ -695,3 +726,5 @@ export type OrderItem = z.infer<typeof OrderItemSchema>;
|
|
|
695
726
|
export type Order = z.infer<typeof OrderSchema>;
|
|
696
727
|
export type CreateOrder = z.infer<typeof CreateOrderSchema>;
|
|
697
728
|
export type OrderStatus = z.infer<typeof OrderStatusSchema>;
|
|
729
|
+
export type InventoryConflictItem = z.infer<typeof InventoryConflictItemSchema>;
|
|
730
|
+
export type OrderConflict = z.infer<typeof CartConflictSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as e}from"@hono/zod-openapi";import{AddressSchema as a}from"../../schemas/address.schema";import{currency as o}from"../../schemas/currency.schema";import{locale as
|
|
1
|
+
import{z as e}from"@hono/zod-openapi";import{AddressSchema as a}from"../../schemas/address.schema";import{currency as o}from"../../schemas/currency.schema";import{locale as n}from"../../schemas/locales.schema";import{CartItemSchema as p,CartSchema as d}from"../cart/cart.schema";import{FileSchema as l}from"../file/file.schema";import{PaymentMethodSchema as c,PaymentProviderSchema as s,PaymentSchema as m}from"../payment/payment.schema";import{ShippingMethodSchema as h}from"../shipping-method/shipping-method.schema";import{fulfilmentMethod as r}from"./fulfilment.schema";export const OrderStatusSchema=e.enum(["draft","pending","accepted","ready-for-dispatch","dispatched","completed","cancelled"]).openapi({description:"Status of the order",example:"accepted"}),OrderItemSchema=e.object({translations:e.array(e.object({locale:n.openapi({description:"Locale of the translation",example:"en-US"}),title:e.string().openapi({description:"Title of the ordered product",example:"Premium Watch"}),subtitle:e.string().openapi({description:"Additional details about the ordered item, including modifiers",example:"Color: Silver, Size: Large"})})).openapi({description:"Translations for the order item"}),rawData:p,unitPrice:e.number().min(0).openapi({description:"Price per unit of the item",example:299.99}),image:l.nullable().optional(),totalPrice:e.number().min(0).openapi({description:"Total price for this item (unitPrice \xD7 quantity)",example:599.98}),quantity:e.number().min(1).openapi({description:"Number of units ordered",example:2}),productSnapshotId:e.string().cuid()}).openapi("OrderItem"),InventoryConflictItemSchema=e.object({productId:e.string().cuid(),title:e.string(),requestedQuantity:e.number().int().min(1),availableQuantity:e.number().int().min(0)}).openapi("InventoryConflictItem"),OrderSchema=e.object({id:e.string().openapi({description:"Unique identifier for the order",example:"clj1234567890abcdef"}),referenceId:e.string().openapi({description:"External reference ID for the order",example:"ORD-12345"}),status:OrderStatusSchema.optional(),token:e.string().openapi({description:"Security token for order verification",example:"a1b2c3d4e5f6g7h8i9j0"}),expiresAt:e.date().openapi({description:"Expiration date for the order",example:"2023-12-31T23:59:59Z"}),items:e.array(OrderItemSchema).min(1).openapi({description:"Array of items in the order"}),shippingMethod:h.nullable().openapi({description:"Shipping method selected for the order"}),acceptedAt:e.date().nullable().optional().openapi({description:"Date when the order was accepted",example:"2023-06-15T14:30:00Z"}),dispatchedAt:e.date().nullable().optional().openapi({description:"Date when the order was dispatched",example:"2023-06-16T09:15:00Z"}),readyForDispatchAt:e.date().nullable().optional().openapi({description:"Date when the order was ready for dispatch",example:"2023-06-16T09:15:00Z"}),createdAt:e.date().openapi({description:"Date when the order was created",example:"2023-06-15T14:30:00Z"}),completedAt:e.date().nullable().optional().openapi({description:"Date when the order was completed",example:"2023-06-18T11:45:00Z"}),cancelledAt:e.date().nullable().optional().openapi({description:"Date when the order was cancelled",example:"2023-06-14T16:20:00Z"}),inventoryDeductedAt:e.date().nullable().optional().openapi({description:"Date when the paid order inventory was deducted",example:"2023-06-15T14:30:00Z"}),inventoryConflictAt:e.date().nullable().optional().openapi({description:"Date when the paid order was flagged for manual inventory review",example:"2023-06-15T14:30:00Z"}),inventoryConflictItems:e.array(InventoryConflictItemSchema).nullable().optional().openapi({description:"List of line items that could not be deducted after payment"}),shippingAddress:a.nullable().optional(),fulfilmentMethod:r.openapi({description:"Method of order fulfilment (pickup or delivery)",example:"delivery"}),currency:o.openapi({description:"Currency used for the order",example:"USD"}),payment:m}).transform(t=>{let i;return t.cancelledAt?i="cancelled":t.completedAt?i="completed":t.dispatchedAt?i="dispatched":t.readyForDispatchAt?i="ready-for-dispatch":t.acceptedAt?i="accepted":i="pending",Object.assign(Object.assign({},t),{status:i})}).openapi("Order"),CreateOrderSchema=d.extend({fulfilmentMethod:r.default("delivery"),payment:e.object({provider:s,method:c}),checkoutBaseUrl:e.string().url()}).refine(t=>t.fulfilmentMethod!=="delivery"||t.shippingMethodId!==void 0,{message:"shippingMethodId is required when fulfilmentMethod is 'delivery'",path:["shippingMethodId"]}).openapi("CreateOrder");
|