@shophost/rest-api 2.0.35 → 2.0.36

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.
Files changed (84) hide show
  1. package/LICENSE +17 -13
  2. package/README.md +76 -66
  3. package/package.json +2 -2
  4. package/src/app.js +1 -1
  5. package/src/app.js.map +1 -1
  6. package/src/core/db/__generated__/client/internal/class.js +1 -1
  7. package/src/core/db/__generated__/client/internal/prismaNamespace.d.ts +2 -2
  8. package/src/core/db/__generated__/client/internal/prismaNamespace.js +1 -1
  9. package/src/core/db/__generated__/client/models/Account.d.ts +0 -5
  10. package/src/core/db/__generated__/client/models/Address.d.ts +0 -5
  11. package/src/core/db/__generated__/client/models/Campaign.d.ts +0 -5
  12. package/src/core/db/__generated__/client/models/ClosingTimes.d.ts +0 -5
  13. package/src/core/db/__generated__/client/models/File.d.ts +0 -5
  14. package/src/core/db/__generated__/client/models/Invitation.d.ts +0 -5
  15. package/src/core/db/__generated__/client/models/LegalEntity.d.ts +0 -5
  16. package/src/core/db/__generated__/client/models/Manufacturer.d.ts +0 -5
  17. package/src/core/db/__generated__/client/models/ManufacturerTranslation.d.ts +0 -5
  18. package/src/core/db/__generated__/client/models/Member.d.ts +0 -5
  19. package/src/core/db/__generated__/client/models/Modifier.d.ts +0 -5
  20. package/src/core/db/__generated__/client/models/ModifierGroup.d.ts +0 -5
  21. package/src/core/db/__generated__/client/models/ModifierGroupTranslation.d.ts +0 -5
  22. package/src/core/db/__generated__/client/models/OpeningTimes.d.ts +0 -5
  23. package/src/core/db/__generated__/client/models/Order.d.ts +0 -5
  24. package/src/core/db/__generated__/client/models/OrderItem.d.ts +0 -5
  25. package/src/core/db/__generated__/client/models/OrderItemTranslation.d.ts +0 -5
  26. package/src/core/db/__generated__/client/models/Organization.d.ts +0 -5
  27. package/src/core/db/__generated__/client/models/OrganizationConfiguration.d.ts +0 -5
  28. package/src/core/db/__generated__/client/models/Payment.d.ts +0 -5
  29. package/src/core/db/__generated__/client/models/PaymentSession.d.ts +0 -5
  30. package/src/core/db/__generated__/client/models/Product.d.ts +0 -5
  31. package/src/core/db/__generated__/client/models/ProductCategory.d.ts +0 -5
  32. package/src/core/db/__generated__/client/models/ProductCategoryTranslation.d.ts +0 -5
  33. package/src/core/db/__generated__/client/models/ProductSnapshot.d.ts +0 -5
  34. package/src/core/db/__generated__/client/models/ProductTranslation.d.ts +0 -5
  35. package/src/core/db/__generated__/client/models/Reservation.d.ts +0 -5
  36. package/src/core/db/__generated__/client/models/Session.d.ts +0 -5
  37. package/src/core/db/__generated__/client/models/ShippingMethod.d.ts +0 -5
  38. package/src/core/db/__generated__/client/models/ShippingZone.d.ts +0 -5
  39. package/src/core/db/__generated__/client/models/User.d.ts +0 -5
  40. package/src/core/db/__generated__/client/models/Verification.d.ts +0 -5
  41. package/src/core/email/components.d.ts +16 -0
  42. package/src/core/email/components.js +1 -0
  43. package/src/core/email/components.js.map +1 -0
  44. package/src/core/lib/prisma.d.ts +8 -8
  45. package/src/features/analytics/analytics.handler.d.ts +2 -0
  46. package/src/features/analytics/analytics.handler.js +1 -0
  47. package/src/features/analytics/analytics.handler.js.map +1 -0
  48. package/src/features/analytics/analytics.route.d.ts +3 -0
  49. package/src/features/analytics/analytics.route.js +1 -0
  50. package/src/features/analytics/analytics.route.js.map +1 -0
  51. package/src/features/analytics/analytics.schema.d.ts +86 -0
  52. package/src/features/analytics/analytics.schema.js +1 -0
  53. package/src/features/analytics/analytics.schema.js.map +1 -0
  54. package/src/features/analytics/analytics.service.d.ts +45 -0
  55. package/src/features/analytics/analytics.service.js +1 -0
  56. package/src/features/analytics/analytics.service.js.map +1 -0
  57. package/src/features/cart/cart.schema.d.ts +1 -1
  58. package/src/features/cart/cart.service.d.ts +1 -1
  59. package/src/features/index.d.ts +1 -0
  60. package/src/features/index.js +1 -1
  61. package/src/features/index.js.map +1 -1
  62. package/src/features/order/emails/order-confirmation.email.js +1 -1
  63. package/src/features/order/emails/order-confirmation.email.js.map +1 -1
  64. package/src/features/order/emails/order-notification.email.js +1 -1
  65. package/src/features/order/emails/order-notification.email.js.map +1 -1
  66. package/src/features/order/order.schema.d.ts +4 -4
  67. package/src/features/order/order.service.d.ts +4 -4
  68. package/src/features/payment/payment.schema.d.ts +3 -3
  69. package/src/features/payment/payment.service.d.ts +1 -1
  70. package/src/features/product/product.schema.d.ts +3 -3
  71. package/src/features/product/product.service.d.ts +2 -2
  72. package/src/features/reservation/emails/reservation-cancellation.email.js +1 -1
  73. package/src/features/reservation/emails/reservation-cancellation.email.js.map +1 -1
  74. package/src/features/reservation/emails/reservation-confirmation.email.js +1 -1
  75. package/src/features/reservation/emails/reservation-confirmation.email.js.map +1 -1
  76. package/src/features/reservation/emails/reservation-notification.email.js +1 -1
  77. package/src/features/reservation/emails/reservation-notification.email.js.map +1 -1
  78. package/src/features/reservation/reservation.schema.d.ts +1 -1
  79. package/src/schemas/index.d.ts +1 -0
  80. package/src/schemas/index.js +1 -1
  81. package/src/schemas/index.js.map +1 -1
  82. package/src/test/integration/test-helpers.d.ts +2 -0
  83. package/src/test/integration/test-helpers.js +1 -1
  84. package/src/test/integration/test-helpers.js.map +1 -1
@@ -1170,11 +1170,6 @@ export type PaymentSessionFindManyArgs<ExtArgs extends runtime.Types.Extensions.
1170
1170
  * Skip the first `n` PaymentSessions.
1171
1171
  */
1172
1172
  skip?: number;
1173
- /**
1174
- * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
1175
- *
1176
- * Filter by unique combinations of PaymentSessions.
1177
- */
1178
1173
  distinct?: Prisma.PaymentSessionScalarFieldEnum | Prisma.PaymentSessionScalarFieldEnum[];
1179
1174
  };
1180
1175
  /**
@@ -2833,11 +2833,6 @@ export type ProductFindManyArgs<ExtArgs extends runtime.Types.Extensions.Interna
2833
2833
  * Skip the first `n` Products.
2834
2834
  */
2835
2835
  skip?: number;
2836
- /**
2837
- * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
2838
- *
2839
- * Filter by unique combinations of Products.
2840
- */
2841
2836
  distinct?: Prisma.ProductScalarFieldEnum | Prisma.ProductScalarFieldEnum[];
2842
2837
  };
2843
2838
  /**
@@ -1686,11 +1686,6 @@ export type ProductCategoryFindManyArgs<ExtArgs extends runtime.Types.Extensions
1686
1686
  * Skip the first `n` ProductCategories.
1687
1687
  */
1688
1688
  skip?: number;
1689
- /**
1690
- * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
1691
- *
1692
- * Filter by unique combinations of ProductCategories.
1693
- */
1694
1689
  distinct?: Prisma.ProductCategoryScalarFieldEnum | Prisma.ProductCategoryScalarFieldEnum[];
1695
1690
  };
1696
1691
  /**
@@ -1107,11 +1107,6 @@ export type ProductCategoryTranslationFindManyArgs<ExtArgs extends runtime.Types
1107
1107
  * Skip the first `n` ProductCategoryTranslations.
1108
1108
  */
1109
1109
  skip?: number;
1110
- /**
1111
- * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
1112
- *
1113
- * Filter by unique combinations of ProductCategoryTranslations.
1114
- */
1115
1110
  distinct?: Prisma.ProductCategoryTranslationScalarFieldEnum | Prisma.ProductCategoryTranslationScalarFieldEnum[];
1116
1111
  };
1117
1112
  /**
@@ -1134,11 +1134,6 @@ export type ProductSnapshotFindManyArgs<ExtArgs extends runtime.Types.Extensions
1134
1134
  * Skip the first `n` ProductSnapshots.
1135
1135
  */
1136
1136
  skip?: number;
1137
- /**
1138
- * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
1139
- *
1140
- * Filter by unique combinations of ProductSnapshots.
1141
- */
1142
1137
  distinct?: Prisma.ProductSnapshotScalarFieldEnum | Prisma.ProductSnapshotScalarFieldEnum[];
1143
1138
  };
1144
1139
  /**
@@ -1107,11 +1107,6 @@ export type ProductTranslationFindManyArgs<ExtArgs extends runtime.Types.Extensi
1107
1107
  * Skip the first `n` ProductTranslations.
1108
1108
  */
1109
1109
  skip?: number;
1110
- /**
1111
- * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
1112
- *
1113
- * Filter by unique combinations of ProductTranslations.
1114
- */
1115
1110
  distinct?: Prisma.ProductTranslationScalarFieldEnum | Prisma.ProductTranslationScalarFieldEnum[];
1116
1111
  };
1117
1112
  /**
@@ -1433,11 +1433,6 @@ export type ReservationFindManyArgs<ExtArgs extends runtime.Types.Extensions.Int
1433
1433
  * Skip the first `n` Reservations.
1434
1434
  */
1435
1435
  skip?: number;
1436
- /**
1437
- * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
1438
- *
1439
- * Filter by unique combinations of Reservations.
1440
- */
1441
1436
  distinct?: Prisma.ReservationScalarFieldEnum | Prisma.ReservationScalarFieldEnum[];
1442
1437
  };
1443
1438
  /**
@@ -1102,11 +1102,6 @@ export type SessionFindManyArgs<ExtArgs extends runtime.Types.Extensions.Interna
1102
1102
  * Skip the first `n` Sessions.
1103
1103
  */
1104
1104
  skip?: number;
1105
- /**
1106
- * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
1107
- *
1108
- * Filter by unique combinations of Sessions.
1109
- */
1110
1105
  distinct?: Prisma.SessionScalarFieldEnum | Prisma.SessionScalarFieldEnum[];
1111
1106
  };
1112
1107
  /**
@@ -1656,11 +1656,6 @@ export type ShippingMethodFindManyArgs<ExtArgs extends runtime.Types.Extensions.
1656
1656
  * Skip the first `n` ShippingMethods.
1657
1657
  */
1658
1658
  skip?: number;
1659
- /**
1660
- * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
1661
- *
1662
- * Filter by unique combinations of ShippingMethods.
1663
- */
1664
1659
  distinct?: Prisma.ShippingMethodScalarFieldEnum | Prisma.ShippingMethodScalarFieldEnum[];
1665
1660
  };
1666
1661
  /**
@@ -1152,11 +1152,6 @@ export type ShippingZoneFindManyArgs<ExtArgs extends runtime.Types.Extensions.In
1152
1152
  * Skip the first `n` ShippingZones.
1153
1153
  */
1154
1154
  skip?: number;
1155
- /**
1156
- * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
1157
- *
1158
- * Filter by unique combinations of ShippingZones.
1159
- */
1160
1155
  distinct?: Prisma.ShippingZoneScalarFieldEnum | Prisma.ShippingZoneScalarFieldEnum[];
1161
1156
  };
1162
1157
  /**
@@ -1834,11 +1834,6 @@ export type UserFindManyArgs<ExtArgs extends runtime.Types.Extensions.InternalAr
1834
1834
  * Skip the first `n` Users.
1835
1835
  */
1836
1836
  skip?: number;
1837
- /**
1838
- * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
1839
- *
1840
- * Filter by unique combinations of Users.
1841
- */
1842
1837
  distinct?: Prisma.UserScalarFieldEnum | Prisma.UserScalarFieldEnum[];
1843
1838
  };
1844
1839
  /**
@@ -840,11 +840,6 @@ export type VerificationFindManyArgs<ExtArgs extends runtime.Types.Extensions.In
840
840
  * Skip the first `n` Verifications.
841
841
  */
842
842
  skip?: number;
843
- /**
844
- * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
845
- *
846
- * Filter by unique combinations of Verifications.
847
- */
848
843
  distinct?: Prisma.VerificationScalarFieldEnum | Prisma.VerificationScalarFieldEnum[];
849
844
  };
850
845
  /**
@@ -0,0 +1,16 @@
1
+ import * as React from "react";
2
+ export declare const Body: React.ElementType<any, keyof React.JSX.IntrinsicElements>;
3
+ export declare const Button: React.ElementType<any, keyof React.JSX.IntrinsicElements>;
4
+ export declare const Column: React.ElementType<any, keyof React.JSX.IntrinsicElements>;
5
+ export declare const Container: React.ElementType<any, keyof React.JSX.IntrinsicElements>;
6
+ export declare const Head: React.ElementType<any, keyof React.JSX.IntrinsicElements>;
7
+ export declare const Heading: React.ElementType<any, keyof React.JSX.IntrinsicElements>;
8
+ export declare const Hr: React.ElementType<any, keyof React.JSX.IntrinsicElements>;
9
+ export declare const Html: React.ElementType<any, keyof React.JSX.IntrinsicElements>;
10
+ export declare const Img: React.ElementType<any, keyof React.JSX.IntrinsicElements>;
11
+ export declare const Link: React.ElementType<any, keyof React.JSX.IntrinsicElements>;
12
+ export declare const Preview: React.ElementType<any, keyof React.JSX.IntrinsicElements>;
13
+ export declare const Row: React.ElementType<any, keyof React.JSX.IntrinsicElements>;
14
+ export declare const Section: React.ElementType<any, keyof React.JSX.IntrinsicElements>;
15
+ export declare const Tailwind: React.ElementType<any, keyof React.JSX.IntrinsicElements>;
16
+ export declare const Text: React.ElementType<any, keyof React.JSX.IntrinsicElements>;
@@ -0,0 +1 @@
1
+ import{Body as o,Button as e,Column as n,Container as i,Head as c,Heading as s,Hr as m,Html as r,Img as l,Link as x,Preview as R,Row as p,Section as E,Tailwind as d,Text as H}from"@react-email/components";const t=a=>a;export const Body=t(o),Button=t(e),Column=t(n),Container=t(i),Head=t(c),Heading=t(s),Hr=t(m),Html=t(r),Img=t(l),Link=t(x),Preview=t(R),Row=t(p),Section=t(E),Tailwind=t(d),Text=t(H);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components.js","sourceRoot":"","sources":["../../../../../../packages/rest-api/src/core/email/components.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,IAAI,IAAI,cAAc,EACtB,MAAM,IAAI,gBAAgB,EAC1B,MAAM,IAAI,gBAAgB,EAC1B,SAAS,IAAI,mBAAmB,EAChC,IAAI,IAAI,cAAc,EACtB,OAAO,IAAI,iBAAiB,EAC5B,EAAE,IAAI,YAAY,EAClB,IAAI,IAAI,cAAc,EACtB,GAAG,IAAI,aAAa,EACpB,IAAI,IAAI,cAAc,EACtB,OAAO,IAAI,iBAAiB,EAC5B,GAAG,IAAI,aAAa,EACpB,OAAO,IAAI,iBAAiB,EAC5B,QAAQ,IAAI,kBAAkB,EAC9B,IAAI,IAAI,cAAc,GACvB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,gBAAgB,GAAG,CAAC,SAAkB,EAAE,EAAE,CAC9C,SAA8B,CAAC;AAEjC,MAAM,CAAC,MAAM,IAAI,GAAG,gBAAgB,CAAC,cAAc,CAAC,CAAC;AACrD,MAAM,CAAC,MAAM,MAAM,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;AACzD,MAAM,CAAC,MAAM,MAAM,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;AACzD,MAAM,CAAC,MAAM,SAAS,GAAG,gBAAgB,CAAC,mBAAmB,CAAC,CAAC;AAC/D,MAAM,CAAC,MAAM,IAAI,GAAG,gBAAgB,CAAC,cAAc,CAAC,CAAC;AACrD,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;AAC3D,MAAM,CAAC,MAAM,EAAE,GAAG,gBAAgB,CAAC,YAAY,CAAC,CAAC;AACjD,MAAM,CAAC,MAAM,IAAI,GAAG,gBAAgB,CAAC,cAAc,CAAC,CAAC;AACrD,MAAM,CAAC,MAAM,GAAG,GAAG,gBAAgB,CAAC,aAAa,CAAC,CAAC;AACnD,MAAM,CAAC,MAAM,IAAI,GAAG,gBAAgB,CAAC,cAAc,CAAC,CAAC;AACrD,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;AAC3D,MAAM,CAAC,MAAM,GAAG,GAAG,gBAAgB,CAAC,aAAa,CAAC,CAAC;AACnD,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;AAC3D,MAAM,CAAC,MAAM,QAAQ,GAAG,gBAAgB,CAAC,kBAAkB,CAAC,CAAC;AAC7D,MAAM,CAAC,MAAM,IAAI,GAAG,gBAAgB,CAAC,cAAc,CAAC,CAAC"}
@@ -26,7 +26,7 @@ export declare const createPrismaClient: (options: CreatePrismaClientOptions) =>
26
26
  }) => Promise<[import("@prisma/client/runtime/client").Result<T, A, "findMany">, import("prisma-extension-pagination").CursorPaginationMeta]>;
27
27
  };
28
28
  };
29
- user: {
29
+ file: {
30
30
  paginate: () => <T, A>(this: T, args?: import("@prisma/client/runtime/client").Exact<A, Omit<import("@prisma/client/runtime/client").Args<T, "findMany">, "cursor" | "take" | "skip">> | undefined) => {
31
31
  withPages: <TOptions extends Omit<P, "limit">, P extends import("prisma-extension-pagination").PageNumberPaginationOptions>(options?: (TOptions & {
32
32
  limit?: P["limit"] | undefined;
@@ -38,7 +38,7 @@ export declare const createPrismaClient: (options: CreatePrismaClientOptions) =>
38
38
  }) => Promise<[import("@prisma/client/runtime/client").Result<T, A, "findMany">, import("prisma-extension-pagination").CursorPaginationMeta]>;
39
39
  };
40
40
  };
41
- member: {
41
+ user: {
42
42
  paginate: () => <T, A>(this: T, args?: import("@prisma/client/runtime/client").Exact<A, Omit<import("@prisma/client/runtime/client").Args<T, "findMany">, "cursor" | "take" | "skip">> | undefined) => {
43
43
  withPages: <TOptions extends Omit<P, "limit">, P extends import("prisma-extension-pagination").PageNumberPaginationOptions>(options?: (TOptions & {
44
44
  limit?: P["limit"] | undefined;
@@ -50,7 +50,7 @@ export declare const createPrismaClient: (options: CreatePrismaClientOptions) =>
50
50
  }) => Promise<[import("@prisma/client/runtime/client").Result<T, A, "findMany">, import("prisma-extension-pagination").CursorPaginationMeta]>;
51
51
  };
52
52
  };
53
- organization: {
53
+ member: {
54
54
  paginate: () => <T, A>(this: T, args?: import("@prisma/client/runtime/client").Exact<A, Omit<import("@prisma/client/runtime/client").Args<T, "findMany">, "cursor" | "take" | "skip">> | undefined) => {
55
55
  withPages: <TOptions extends Omit<P, "limit">, P extends import("prisma-extension-pagination").PageNumberPaginationOptions>(options?: (TOptions & {
56
56
  limit?: P["limit"] | undefined;
@@ -62,7 +62,7 @@ export declare const createPrismaClient: (options: CreatePrismaClientOptions) =>
62
62
  }) => Promise<[import("@prisma/client/runtime/client").Result<T, A, "findMany">, import("prisma-extension-pagination").CursorPaginationMeta]>;
63
63
  };
64
64
  };
65
- file: {
65
+ organization: {
66
66
  paginate: () => <T, A>(this: T, args?: import("@prisma/client/runtime/client").Exact<A, Omit<import("@prisma/client/runtime/client").Args<T, "findMany">, "cursor" | "take" | "skip">> | undefined) => {
67
67
  withPages: <TOptions extends Omit<P, "limit">, P extends import("prisma-extension-pagination").PageNumberPaginationOptions>(options?: (TOptions & {
68
68
  limit?: P["limit"] | undefined;
@@ -428,7 +428,7 @@ export declare const createPrismaClient: (options: CreatePrismaClientOptions) =>
428
428
  }) => Promise<[import("@prisma/client/runtime/client").Result<T, A, "findMany">, import("prisma-extension-pagination").CursorPaginationMeta]>;
429
429
  };
430
430
  };
431
- user: {
431
+ file: {
432
432
  paginate: () => <T, A>(this: T, args?: import("@prisma/client/runtime/client").Exact<A, Omit<import("@prisma/client/runtime/client").Args<T, "findMany">, "cursor" | "take" | "skip">> | undefined) => {
433
433
  withPages: <TOptions extends Omit<P, "limit">, P extends import("prisma-extension-pagination").PageNumberPaginationOptions>(options?: (TOptions & {
434
434
  limit?: P["limit"] | undefined;
@@ -440,7 +440,7 @@ export declare const createPrismaClient: (options: CreatePrismaClientOptions) =>
440
440
  }) => Promise<[import("@prisma/client/runtime/client").Result<T, A, "findMany">, import("prisma-extension-pagination").CursorPaginationMeta]>;
441
441
  };
442
442
  };
443
- member: {
443
+ user: {
444
444
  paginate: () => <T, A>(this: T, args?: import("@prisma/client/runtime/client").Exact<A, Omit<import("@prisma/client/runtime/client").Args<T, "findMany">, "cursor" | "take" | "skip">> | undefined) => {
445
445
  withPages: <TOptions extends Omit<P, "limit">, P extends import("prisma-extension-pagination").PageNumberPaginationOptions>(options?: (TOptions & {
446
446
  limit?: P["limit"] | undefined;
@@ -452,7 +452,7 @@ export declare const createPrismaClient: (options: CreatePrismaClientOptions) =>
452
452
  }) => Promise<[import("@prisma/client/runtime/client").Result<T, A, "findMany">, import("prisma-extension-pagination").CursorPaginationMeta]>;
453
453
  };
454
454
  };
455
- organization: {
455
+ member: {
456
456
  paginate: () => <T, A>(this: T, args?: import("@prisma/client/runtime/client").Exact<A, Omit<import("@prisma/client/runtime/client").Args<T, "findMany">, "cursor" | "take" | "skip">> | undefined) => {
457
457
  withPages: <TOptions extends Omit<P, "limit">, P extends import("prisma-extension-pagination").PageNumberPaginationOptions>(options?: (TOptions & {
458
458
  limit?: P["limit"] | undefined;
@@ -464,7 +464,7 @@ export declare const createPrismaClient: (options: CreatePrismaClientOptions) =>
464
464
  }) => Promise<[import("@prisma/client/runtime/client").Result<T, A, "findMany">, import("prisma-extension-pagination").CursorPaginationMeta]>;
465
465
  };
466
466
  };
467
- file: {
467
+ organization: {
468
468
  paginate: () => <T, A>(this: T, args?: import("@prisma/client/runtime/client").Exact<A, Omit<import("@prisma/client/runtime/client").Args<T, "findMany">, "cursor" | "take" | "skip">> | undefined) => {
469
469
  withPages: <TOptions extends Omit<P, "limit">, P extends import("prisma-extension-pagination").PageNumberPaginationOptions>(options?: (TOptions & {
470
470
  limit?: P["limit"] | undefined;
@@ -0,0 +1,2 @@
1
+ import { PrismaClientType } from "../../core/lib/prisma";
2
+ export declare const buildAnalyticsHandler: (prisma: PrismaClientType) => import("@hono/zod-openapi").OpenAPIHono<import("../../core/hono/hono").AppBindings, {}, "/">;
@@ -0,0 +1 @@
1
+ import{__awaiter as s}from"tslib";import{createApiRouter as c}from"../../core/hono/hono";import{analyticsRoute as d}from"./analytics.route";import{AnalyticsService as p}from"./analytics.service";export const buildAnalyticsHandler=t=>{const r=c();return r.openapi(d.getOverview,e=>s(void 0,void 0,void 0,function*(){const i=e.get("auth"),o=e.req.valid("param"),a=e.req.valid("query");yield i.isGranted("read");const n=yield new p(t).getOverview(o.organizationId,a);return e.json(n,200)})),r};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analytics.handler.js","sourceRoot":"","sources":["../../../../../../packages/rest-api/src/features/analytics/analytics.handler.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,MAAwB,EAAE,EAAE;IAChE,MAAM,GAAG,GAAG,eAAe,EAAE,CAAC;IAE9B,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,WAAW,EAAE,CAAO,CAAM,EAAE,EAAE;QACvD,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,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAEnC,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAE7B,MAAM,OAAO,GAAG,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAC;QAC7C,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;QAEvE,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,CAAC,CAAA,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC;AACb,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const analyticsRoute: {
2
+ getOverview: any;
3
+ };
@@ -0,0 +1 @@
1
+ import{createApiRoute as a}from"../../core/hono/hono";import{ErrorSchema as e,HeaderSchema as r,OrganizationParams as t}from"../../schemas";import{AnalyticsOverviewQuerySchema as i,AnalyticsOverviewSchema as o}from"./analytics.schema";const n=a({description:"Returns dashboard analytics for an organization within a date range.",headers:r,method:"GET",operationId:"getAnalyticsOverview",path:"/:organizationId/analytics/overview",pathParams:t,query:i,responses:{200:o,400:e,401:e,404:e},summary:"Get Analytics Overview",tags:["Analytics"]});export const analyticsRoute={getOverview:n};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analytics.route.js","sourceRoot":"","sources":["../../../../../../packages/rest-api/src/features/analytics/analytics.route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,EACL,4BAA4B,EAC5B,uBAAuB,GACxB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,yBAAyB,GAAG,cAAc,CAAC;IAC/C,WAAW,EACT,sEAAsE;IACxE,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,KAAK;IACb,WAAW,EAAE,sBAAsB;IACnC,IAAI,EAAE,qCAAqC;IAC3C,UAAU,EAAE,kBAAkB;IAC9B,KAAK,EAAE,4BAA4B;IACnC,SAAS,EAAE;QACT,GAAG,EAAE,uBAAuB;QAC5B,GAAG,EAAE,WAAW;QAChB,GAAG,EAAE,WAAW;QAChB,GAAG,EAAE,WAAW;KACjB;IACD,OAAO,EAAE,wBAAwB;IACjC,IAAI,EAAE,CAAC,WAAW,CAAC;CACpB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,WAAW,EAAE,yBAAyB;CACvC,CAAC"}
@@ -0,0 +1,86 @@
1
+ import { z } from "@hono/zod-openapi";
2
+ export declare const AnalyticsOverviewQuerySchema: z.ZodObject<{
3
+ from: z.ZodCoercedDate<unknown>;
4
+ to: z.ZodCoercedDate<unknown>;
5
+ }, z.core.$strip>;
6
+ export declare const AnalyticsOverviewSchema: z.ZodObject<{
7
+ range: z.ZodObject<{
8
+ from: z.ZodDate;
9
+ to: z.ZodDate;
10
+ }, z.core.$strip>;
11
+ summary: z.ZodObject<{
12
+ currency: z.ZodEnum<{
13
+ USD: "USD";
14
+ EUR: "EUR";
15
+ GBP: "GBP";
16
+ JPY: "JPY";
17
+ AUD: "AUD";
18
+ CAD: "CAD";
19
+ CHF: "CHF";
20
+ CNY: "CNY";
21
+ SEK: "SEK";
22
+ NZD: "NZD";
23
+ MXN: "MXN";
24
+ SGD: "SGD";
25
+ HKD: "HKD";
26
+ NOK: "NOK";
27
+ KRW: "KRW";
28
+ TRY: "TRY";
29
+ RUB: "RUB";
30
+ INR: "INR";
31
+ BRL: "BRL";
32
+ ZAR: "ZAR";
33
+ DKK: "DKK";
34
+ PLN: "PLN";
35
+ THB: "THB";
36
+ IDR: "IDR";
37
+ HUF: "HUF";
38
+ CZK: "CZK";
39
+ ILS: "ILS";
40
+ PHP: "PHP";
41
+ AED: "AED";
42
+ COP: "COP";
43
+ SAR: "SAR";
44
+ MYR: "MYR";
45
+ RON: "RON";
46
+ }>;
47
+ totalSales: z.ZodNumber;
48
+ paidOrders: z.ZodNumber;
49
+ averageOrderValue: z.ZodNumber;
50
+ reservations: z.ZodNumber;
51
+ guests: z.ZodNumber;
52
+ }, z.core.$strip>;
53
+ salesByDay: z.ZodArray<z.ZodObject<{
54
+ date: z.ZodDate;
55
+ label: z.ZodString;
56
+ totalSales: z.ZodNumber;
57
+ paidOrders: z.ZodNumber;
58
+ }, z.core.$strip>>;
59
+ reservationsByDay: z.ZodArray<z.ZodObject<{
60
+ date: z.ZodDate;
61
+ label: z.ZodString;
62
+ reservations: z.ZodNumber;
63
+ guests: z.ZodNumber;
64
+ }, z.core.$strip>>;
65
+ paymentMethods: z.ZodArray<z.ZodObject<{
66
+ method: z.ZodEnum<{
67
+ card: "card";
68
+ blik: "blik";
69
+ paypal: "paypal";
70
+ bank_transfer: "bank_transfer";
71
+ cash_on_delivery: "cash_on_delivery";
72
+ }>;
73
+ count: z.ZodNumber;
74
+ totalSales: z.ZodNumber;
75
+ }, z.core.$strip>>;
76
+ fulfilmentMethods: z.ZodArray<z.ZodObject<{
77
+ method: z.ZodEnum<{
78
+ delivery: "delivery";
79
+ pickup: "pickup";
80
+ }>;
81
+ count: z.ZodNumber;
82
+ totalSales: z.ZodNumber;
83
+ }, z.core.$strip>>;
84
+ }, z.core.$strip>;
85
+ export type AnalyticsOverview = z.infer<typeof AnalyticsOverviewSchema>;
86
+ export type AnalyticsOverviewQuery = z.infer<typeof AnalyticsOverviewQuerySchema>;
@@ -0,0 +1 @@
1
+ import{z as e}from"@hono/zod-openapi";import{currency as t}from"../../schemas/currency.schema";import{fulfilmentMethod as n}from"../order/fulfilment.schema";const a=e.enum(["card","blik","paypal","bank_transfer","cash_on_delivery"]).openapi({description:"The payment method used for the order",example:"card"});export const AnalyticsOverviewQuerySchema=e.object({from:e.coerce.date().openapi({description:"Start of the reporting range",example:"2026-01-01T00:00:00.000Z"}),to:e.coerce.date().openapi({description:"End of the reporting range",example:"2026-01-30T23:59:59.999Z"})});const r=e.object({from:e.date(),to:e.date()}).openapi("AnalyticsRange"),o=e.object({currency:t,totalSales:e.number().min(0),paidOrders:e.number().int().min(0),averageOrderValue:e.number().min(0),reservations:e.number().int().min(0),guests:e.number().int().min(0)}).openapi("AnalyticsSummary"),i=e.object({date:e.date(),label:e.string(),totalSales:e.number().min(0),paidOrders:e.number().int().min(0)}).openapi("SalesByDayPoint"),m=e.object({date:e.date(),label:e.string(),reservations:e.number().int().min(0),guests:e.number().int().min(0)}).openapi("ReservationsByDayPoint"),s=e.object({method:a,count:e.number().int().min(0),totalSales:e.number().min(0)}).openapi("PaymentMethodBreakdownItem"),c=e.object({method:n,count:e.number().int().min(0),totalSales:e.number().min(0)}).openapi("FulfilmentBreakdownItem");export const AnalyticsOverviewSchema=e.object({range:r,summary:o,salesByDay:e.array(i),reservationsByDay:e.array(m),paymentMethods:e.array(s),fulfilmentMethods:e.array(c)}).openapi("AnalyticsOverview");
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analytics.schema.js","sourceRoot":"","sources":["../../../../../../packages/rest-api/src/features/analytics/analytics.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;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EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CAC9B,CAAC;KACD,OAAO,CAAC,yBAAyB,CAAC,CAAC;AAEtC,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC;KACrC,MAAM,CAAC;IACN,KAAK,EAAE,oBAAoB;IAC3B,OAAO,EAAE,sBAAsB;IAC/B,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAAC;IAC1C,iBAAiB,EAAE,CAAC,CAAC,KAAK,CAAC,4BAA4B,CAAC;IACxD,cAAc,EAAE,CAAC,CAAC,KAAK,CAAC,gCAAgC,CAAC;IACzD,iBAAiB,EAAE,CAAC,CAAC,KAAK,CAAC,6BAA6B,CAAC;CAC1D,CAAC;KACD,OAAO,CAAC,mBAAmB,CAAC,CAAC"}
@@ -0,0 +1,45 @@
1
+ import { PrismaClientType } from "../../core/lib/prisma";
2
+ declare class AnalyticsService {
3
+ private readonly prisma;
4
+ constructor(prisma: PrismaClientType);
5
+ getOverview(organizationId: string, query: {
6
+ from: Date;
7
+ to: Date;
8
+ }): Promise<{
9
+ range: {
10
+ from: Date;
11
+ to: Date;
12
+ };
13
+ summary: {
14
+ currency: "USD" | "EUR" | "GBP" | "JPY" | "AUD" | "CAD" | "CHF" | "CNY" | "SEK" | "NZD" | "MXN" | "SGD" | "HKD" | "NOK" | "KRW" | "TRY" | "RUB" | "INR" | "BRL" | "ZAR" | "DKK" | "PLN" | "THB" | "IDR" | "HUF" | "CZK" | "ILS" | "PHP" | "AED" | "COP" | "SAR" | "MYR" | "RON";
15
+ totalSales: number;
16
+ paidOrders: number;
17
+ averageOrderValue: number;
18
+ reservations: number;
19
+ guests: number;
20
+ };
21
+ salesByDay: {
22
+ date: Date;
23
+ label: string;
24
+ totalSales: number;
25
+ paidOrders: number;
26
+ }[];
27
+ reservationsByDay: {
28
+ date: Date;
29
+ label: string;
30
+ reservations: number;
31
+ guests: number;
32
+ }[];
33
+ paymentMethods: {
34
+ method: "card" | "blik" | "paypal" | "bank_transfer" | "cash_on_delivery";
35
+ count: number;
36
+ totalSales: number;
37
+ }[];
38
+ fulfilmentMethods: {
39
+ method: "delivery" | "pickup";
40
+ count: number;
41
+ totalSales: number;
42
+ }[];
43
+ }>;
44
+ }
45
+ export { AnalyticsService };
@@ -0,0 +1 @@
1
+ import{__awaiter as B}from"tslib";import{eachDayOfInterval as k,endOfDay as E,format as l,startOfDay as I}from"date-fns";import{HttpException as _}from"../../core/exceptions/http-exception";import{AnalyticsOverviewSchema as K}from"./analytics.schema";class P{constructor(o){this.prisma=o}getOverview(o,h){return B(this,void 0,void 0,function*(){var c,u,y,m;const n=I(h.from),r=E(h.to);if(n>r)throw new _(400,"`from` must be before or equal to `to`");const g=yield this.prisma.organization.findFirst({where:{id:o},include:{configuration:!0}});if(!g)throw new _(404,"Organization not found");const[b,x]=yield Promise.all([this.prisma.order.findMany({where:{organizationId:o,deletedAt:null,createdAt:{gte:n,lte:r}},select:{createdAt:!0,cancelledAt:!0,fulfilmentMethod:!0,payment:{select:{method:!0,status:!0,total:!0}}}}),this.prisma.reservation.findMany({where:{organizationId:o,date:{gte:n,lte:r}},select:{date:!0,guests:!0,cancelledAt:!0}})]),S=k({start:n,end:r}),d=S.map(t=>({date:t,label:l(t,"MMM d"),totalSales:0,paidOrders:0})),f=S.map(t=>({date:t,label:l(t,"MMM d"),reservations:0,guests:0})),w=new Map(d.map((t,e)=>[l(t.date,"yyyy-MM-dd"),e])),p=new Map,A=new Map(["delivery","pickup"].map(t=>[t,{method:t,count:0,totalSales:0}]));let v=0,i=0;for(const t of b){const e=t.cancelledAt===null&&((c=t.payment)===null||c===void 0?void 0:c.status)==="succeeded",s=l(t.createdAt,"yyyy-MM-dd"),M=w.get(s);if(e&&t.payment&&M!==void 0){d[M].totalSales+=t.payment.total,d[M].paidOrders+=1,v+=t.payment.total,i+=1;const a=(u=p.get(t.payment.method))!==null&&u!==void 0?u:{method:t.payment.method,count:0,totalSales:0};a.count+=1,a.totalSales+=t.payment.total,p.set(t.payment.method,a)}if(t.cancelledAt===null&&t.fulfilmentMethod){const a=A.get(t.fulfilmentMethod);a&&(a.count+=1,a.totalSales+=(m=(y=t.payment)===null||y===void 0?void 0:y.total)!==null&&m!==void 0?m:0)}}let O=0,D=0;for(const t of x){if(t.cancelledAt)continue;const e=l(t.date,"yyyy-MM-dd"),s=w.get(e);s!==void 0&&(f[s].reservations+=1,f[s].guests+=t.guests,O+=1,D+=t.guests)}return K.parse({range:{from:n,to:r},summary:{currency:g.configuration.defaultCurrency,totalSales:v,paidOrders:i,averageOrderValue:i>0?v/i:0,reservations:O,guests:D},salesByDay:d,reservationsByDay:f,paymentMethods:Array.from(p.values()).sort((t,e)=>e.totalSales-t.totalSales),fulfilmentMethods:Array.from(A.values()).sort((t,e)=>e.totalSales-t.totalSales)})})}}export{P as AnalyticsService};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analytics.service.js","sourceRoot":"","sources":["../../../../../../packages/rest-api/src/features/analytics/analytics.service.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3E,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAErE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,MAAM,gBAAgB;IACpB,YAA6B,MAAwB;QAAxB,WAAM,GAAN,MAAM,CAAkB;IAAG,CAAC;IAE5C,WAAW,CACtB,cAAsB,EACtB,KAA+B;;;YAE/B,MAAM,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC1C,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAEpC,IAAI,UAAU,GAAG,QAAQ,EAAE,CAAC;gBAC1B,MAAM,IAAI,aAAa,CAAC,GAAG,EAAE,wCAAwC,CAAC,CAAC;YACzE,CAAC;Y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AC,IAAI,CAAC,mBAAmB,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAC9D,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,UAAU,CACtC;aACF,CAAC,CAAC;QACL,CAAC;KAAA;CACF;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -2,6 +2,7 @@ import { z } from "@hono/zod-openapi";
2
2
  export declare const CartProductsMappingSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
3
3
  description: z.ZodDefault<z.ZodNullable<z.ZodString>>;
4
4
  title: z.ZodDefault<z.ZodString>;
5
+ currency: z.ZodString;
5
6
  id: z.ZodString;
6
7
  createdAt: z.ZodDate;
7
8
  slug: z.ZodOptional<z.ZodString>;
@@ -9,7 +10,6 @@ export declare const CartProductsMappingSchema: z.ZodRecord<z.ZodString, z.ZodOb
9
10
  sku: z.ZodOptional<z.ZodString>;
10
11
  basePrice: z.ZodCoercedNumber<unknown>;
11
12
  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>>;
12
- currency: z.ZodString;
13
13
  images: z.ZodOptional<z.ZodArray<z.ZodObject<{
14
14
  id: z.ZodString;
15
15
  url: z.ZodString;
@@ -19,11 +19,11 @@ declare class CartService {
19
19
  products: Record<string, {
20
20
  description: string | null;
21
21
  title: string;
22
+ currency: string;
22
23
  id: string;
23
24
  createdAt: Date;
24
25
  basePrice: number;
25
26
  discountedBasePrice: number | null;
26
- currency: string;
27
27
  modifierGroups: {
28
28
  title: string | null;
29
29
  id: string;
@@ -1,3 +1,4 @@
1
+ export { buildAnalyticsHandler } from "./analytics/analytics.handler";
1
2
  export { buildAccessHandler } from "./access/access.handler";
2
3
  export { buildCartHandler } from "./cart/cart.handler";
3
4
  export { buildFileHandler } from "./file/file.handler";
@@ -1 +1 @@
1
- export{buildAccessHandler}from"./access/access.handler";export{buildCartHandler}from"./cart/cart.handler";export{buildFileHandler}from"./file/file.handler";export{buildHealthHandler}from"./health/health.handler";export{buildLocationHandler}from"./location/location.handler";export{buildManufacturerHandler}from"./manufacturer/manufacturer.handler";export{buildOrderHandler}from"./order/order.handler";export{buildOrganizationHandler}from"./organization/organization.handler";export{buildPaymentHandler}from"./payment/payment.handler";export{buildProductCategoryHandler}from"./product-category/product-category.handler";export{buildProductHandler}from"./product/product.handler";export{buildReservationHandler}from"./reservation/reservation.handler";export{buildShippingHandler}from"./shipping/shipping.handler";export{buildShippingMethodHandler}from"./shipping-method/shipping-method.handler";export{buildWebhookHandler}from"./webhook/webhook.handler";
1
+ export{buildAnalyticsHandler}from"./analytics/analytics.handler";export{buildAccessHandler}from"./access/access.handler";export{buildCartHandler}from"./cart/cart.handler";export{buildFileHandler}from"./file/file.handler";export{buildHealthHandler}from"./health/health.handler";export{buildLocationHandler}from"./location/location.handler";export{buildManufacturerHandler}from"./manufacturer/manufacturer.handler";export{buildOrderHandler}from"./order/order.handler";export{buildOrganizationHandler}from"./organization/organization.handler";export{buildPaymentHandler}from"./payment/payment.handler";export{buildProductCategoryHandler}from"./product-category/product-category.handler";export{buildProductHandler}from"./product/product.handler";export{buildReservationHandler}from"./reservation/reservation.handler";export{buildShippingHandler}from"./shipping/shipping.handler";export{buildShippingMethodHandler}from"./shipping-method/shipping-method.handler";export{buildWebhookHandler}from"./webhook/webhook.handler";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/rest-api/src/features/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBA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E,2BAA2B,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AACvF,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC"}
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{Body as W,Column as n,Container as D,Head as Y,Heading as E,Hr as T,Html as J,Img as r,Link as c,Preview as K,Row as o,Section as s,Tailwind as U,Text as i}from"@react-email/components";const m=(h,l="PLN",a="en-US")=>new Intl.NumberFormat(a,{style:"currency",currency:l}).format(h),j=({user:h,organization:l,order:a})=>{var u,p,g,b,y,f,x,v,N,w,k,q,A,P,C,L;const F=`This is your receipt from ${l.name}`,O=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"numeric"}),B=((u=a.payment)===null||u===void 0?void 0:u.shipping)||0,_=((p=a.payment)===null||p===void 0?void 0:p.discount)||0,Z=((g=a.payment)===null||g===void 0?void 0:g.total)||0,H=`https://${l.configuration.hostname}/account/orders/${a.id}`;return t(J,{children:[e(Y,{}),e(K,{children:F}),e(U,{children:t(W,{className:"bg-gray-50 font-sans",children:[t(D,{className:"bg-gray-50 p-6 max-w-[600px]",children:[e(s,{className:"mb-6",children:t(o,{children:[e(n,{className:"w-[80%]",children:e(r,{alt:"React Email logo",height:"100",src:(b=l.logoFile)===null||b===void 0?void 0:b.url,className:"rounded-lg"})}),e(n,{align:"right",children:t(o,{align:"right",children:[e(n,{children:e(c,{href:"https://www.instagram.com/madrasbistro/",children:e(r,{alt:"Instagram",className:"mx-[4px]",height:"36",src:"https://react.email/static/instagram-logo.png",width:"36"})})}),e(n,{children:e(c,{href:"https://www.facebook.com/madrasBistro/",children:e(r,{alt:"Facebook",className:"mx-[4px]",height:"36",src:"https://react.email/static/facebook-logo.png",width:"36"})})})]})})]})}),t(s,{children:[t(E,{className:"text-3xl font-bold text-gray-800 mb-0",children:["Hi ",h.firstname,","]}),e(i,{className:"text-gray-600 mb-2 text-lg",children:"Your order has been received and is being processed."})]}),e(s,{className:"mb-0",children:e(c,{href:H,className:"bg-gray-900 text-sm rounded-md text-white font-medium py-2 px-5 text-center inline-block my-4",children:"Track Your Order"})})]}),t(D,{className:"mx-auto max-w-[600px] rounded-xl bg-white px-6",children:[e(s,{className:"mb-6",children:t(o,{children:[t(n,{className:"w-[60%]",children:[e(i,{className:"text-gray-500 mb-0",children:"Shipping details"}),t(i,{className:"font-semibold text-gray-800 my-0",children:[(y=a.shippingAddress)===null||y===void 0?void 0:y.firstname," ",(f=a.shippingAddress)===null||f===void 0?void 0:f.lastname]}),t(i,{className:"font-semibold text-gray-800 my-0",children:[(x=a.shippingAddress)===null||x===void 0?void 0:x.addressLineOne," ",((v=a.shippingAddress)===null||v===void 0?void 0:v.doorNumber)&&` / ${(N=a.shippingAddress)===null||N===void 0?void 0:N.doorNumber}`,e("br",{}),(w=a.shippingAddress)===null||w===void 0?void 0:w.city," ",(k=a.shippingAddress)===null||k===void 0?void 0:k.zipCode]}),e(i,{className:"text-gray-500 mb-0",children:"Phone"}),e(i,{className:"font-semibold text-gray-800 my-0",children:(q=a.shippingAddress)===null||q===void 0?void 0:q.phone})]}),e(n,{className:"w-[40%] p-0 mt-0",align:"right",valign:"top",children:e(i,{className:"text-gray-500 mb-0 pt-1",children:O})})]})}),e(i,{className:"text-gray-500 mb-0",children:"Order Summary"}),e(T,{className:"border-gray-200 mb-0"}),e(s,{children:a.items.map((R,I)=>{var M,S;const d=R;return e("table",{width:"100%",cellPadding:0,cellSpacing:0,border:0,className:I===a.items.length-1?"mb-0":"mb-4",children:t("tr",{children:[t("td",{valign:"top",children:[t(i,{className:"font-semibold mb-0",children:[((M=d.translations[0])===null||M===void 0?void 0:M.title)||"Product"," (",((S=d.translations[0])===null||S===void 0?void 0:S.subtitle)||"",")"]}),t(i,{className:"text-gray-600 mb-0 mt-0",children:["Quantity: ",d.quantity]})]}),e("td",{align:"right",valign:"top",children:e(i,{className:"font-semibold",children:m(d.unitPrice*d.quantity,l.configuration.defaultCurrency,l.configuration.defaultLocale)})})]})},I)})}),e(T,{className:"border-gray-200 mt-4"}),e(s,{children:t("table",{width:"100%",cellPadding:0,cellSpacing:0,border:0,children:[t("tr",{children:[e("td",{children:e(i,{className:"text-gray-700",children:"Delivery fee"})}),e("td",{align:"right",children:e(i,{className:"text-gray-700",children:m(B,l.configuration.defaultCurrency,l.configuration.defaultLocale)})})]}),_>0&&t("tr",{children:[e("td",{children:e(i,{className:"text-gray-700",children:"Campaign"})}),e("td",{align:"right",children:t(i,{className:"text-gray-700",children:["-",m(_,l.configuration.defaultCurrency,l.configuration.defaultLocale)]})})]})]})}),e(T,{className:"border-gray-200"}),e(s,{className:"mb-6",children:e("table",{width:"100%",cellPadding:0,cellSpacing:0,border:0,children:t("tr",{children:[e("td",{children:e(i,{className:"text-xl font-bold mb-0",children:"Total:"})}),e("td",{align:"right",children:e(i,{className:"text-xl font-bold mb-0",children:m(Z,l.configuration.defaultCurrency,l.configuration.defaultLocale)})})]})})})]}),e(s,{className:"text-center bg-gray-50 py-5",children:t("table",{className:"w-full",children:[e("tr",{className:"w-full",children:e("td",{align:"center",children:((A=l.logoFile)===null||A===void 0?void 0:A.url)&&e(r,{alt:"React Email logo",height:"100",src:l.logoFile.url,className:"rounded-lg"})})}),e("tr",{className:"w-full",children:t("td",{align:"center",children:[e(i,{className:"my-[8px] text-[16px] font-semibold text-xl pt-2 text-gray-900",children:l.name}),t(i,{className:"my-[8px] text-[16px] leading-[24px] text-gray-500",children:[(P=l.address)===null||P===void 0?void 0:P.addressLineOne,","," ",(C=l.address)===null||C===void 0?void 0:C.zipCode," ",(L=l.address)===null||L===void 0?void 0:L.city]}),e(i,{className:"mb-0 mt-[4px] text-[16px] leading-[24px] text-gray-500",children:l.phone})]})}),e("tr",{children:e("td",{align:"center",children:t(o,{className:"table-cell h-[44px] w-[56px] align-bottom pt-5",children:[e(n,{className:"pr-[8px]",children:e(c,{href:"https://www.facebook.com/madrasBistro/",children:e(r,{alt:"Facebook",height:"36",src:"https://react.email/static/facebook-logo.png",width:"36"})})}),e(n,{children:e(c,{href:"https://www.instagram.com/madrasbistro/",children:e(r,{alt:"Instagram",height:"36",src:"https://react.email/static/instagram-logo.png",width:"36"})})})]})})})]})})]})})]})},z={user:{id:"VD0OJ52f0mdAnm5YePP6BAW6hdbaCjAJ",name:"Abhishek Shaji",email:"kontakt@abhishek.pl",emailVerified:!0,image:"https://lh3.googleusercontent.com/a/ACg8ocKbkCAMTNvMizjXNxcm1aYtBiWnYpCYmU-7aE2Ft_M_uiHheZ5f=s96-c",createdAt:"2025-03-22T22:54:40.260Z",updatedAt:"2025-03-22T22:54:40.260Z",firstname:"Abhishek",lastname:"Shaji"},order:{id:"cm94wbpbm0000itx1iv9k2mqr",referenceId:"PH6LD6",token:"VAE9TX",expiresAt:"2025-04-07T00:20:09.689Z",items:[{translations:[{locale:"en",title:"Masala Dosa",subtitle:"Spice Level: Medium"},{locale:"pl",title:"null",subtitle:"Spice Level: Medium"}],rawData:{productId:"cm8kudyqq0006ityduhq0yveu",quantity:6,modifierGroups:[{id:"cm8kuonhv0002ji032ji4bzmc",modifiers:[{id:"cm8kudyqq000ditydq25s2n2e",quantity:1}]}]},unitPrice:39,image:{id:"cm8kuee0m0000l703ocs7snfb",url:"https://z3liuyatqnepss3d.public.blob.vercel-storage.com/Masala%20Dosa-b0tr9uWZqmBTPMUx4x0fzqkM6z5eCw.png",mimeType:"image/png",size:1429845,filename:"Masala Dosa.png"},totalPrice:234,quantity:6,productSnapshotId:"cm8kuopty0006ji035n7w5iby"},{translations:[{locale:"en",title:"Masala Dosa",subtitle:"Spice Level: Medium"},{locale:"pl",title:"null",subtitle:"Spice Level: Medium"}],rawData:{productId:"cm8kudyqq0006ityduhq0yveu",quantity:6,modifierGroups:[{id:"cm8kuonhv0002ji032ji4bzmc",modifiers:[{id:"cm8kudyqq000ditydq25s2n2e",quantity:1}]}]},unitPrice:39,image:{id:"cm8kuee0m0000l703ocs7snfb",url:"https://z3liuyatqnepss3d.public.blob.vercel-storage.com/Masala%20Dosa-b0tr9uWZqmBTPMUx4x0fzqkM6z5eCw.png",mimeType:"image/png",size:1429845,filename:"Masala Dosa.png"},totalPrice:234,quantity:6,productSnapshotId:"cm8kuopty0006ji035n7w5iby"}],shippingMethod:{id:"cm8kuqmkd000iitydar4a1poy",title:"Express Delivery",providerName:"Wolt Courier",requireDateOfDelivery:!0,shippingZones:[{id:"cm8kuqmkd000jitydpdvck2th",title:"Zone 1",distanceUpto:7,price:1,minimumOrderAmount:60,eta:"90min"}],createdAt:"2025-03-22T23:40:23.101Z",updatedAt:"2025-03-22T23:40:35.319Z"},acceptedAt:null,dispatchedAt:null,readyForDispatchAt:null,completedAt:null,cancelledAt:null,shippingAddress:{id:"cm94wbpbm0007itx1akuqh77n",firstname:"Klaudia",lastname:"Smoter",phone:"+48570135862",addressLineOne:"Stanis\u0142awa Lema 28",doorNumber:"54",addressLineTwo:null,zipCode:"31-571",city:"Krak\xF3w",country:"PL",placeId:"ChIJrQfdh9VaFkcRIvg8O2PqnWM",deliveryInstructions:"4th floor - Maho"},fulfilmentMethod:"delivery",currency:"PLN",payment:{id:"cm94wbpbm0008itx1thsnj7ui",method:"blik",provider:"stripe",status:"succeeded",shipping:1,subtotal:234,total:235,discount:0,currency:"PLN"},status:"pending"},organization:{id:"cm8kthfdq0001lg03b59mdy7b",name:"Madras Bistro",phone:"+48570135862",email:"contact@madrasbistro.pl",createdAt:"2025-03-22T23:05:14.271Z",legalEntityId:null,address:{id:"cm8kthfdr0002lg0350ijialt",firstname:null,lastname:null,phone:null,addressLineOne:"Plac Bohater\xF3w Getta 2",doorNumber:null,addressLineTwo:"3",zipCode:"33-332",city:"Krak\xF3w",country:"PL",placeId:"ChIJf-nsRkRbFkcR21gtObFSSSA",deliveryInstructions:null},configuration:{id:"cm8kthfdr0003lg03ghgs262n",hostname:"null",countriesShipping:["us"],stripeAccountId:"null",enableHostCheckout:!1,enableHostTracking:!1,isAcceptingOrders:!1,defaultLocale:"en",supportedLocales:["en","pl"],defaultCurrency:"PLN",createdAt:"2025-03-22T23:05:14.271Z"},logo:"https://z3liuyatqnepss3d.public.blob.vercel-storage.com/logo-zeJymFRMFCIKPlvjxYm2af3SAWvBOj.png",logoFile:{id:"cm8ktmu890005lg0356gwclfk",url:"https://z3liuyatqnepss3d.public.blob.vercel-storage.com/logo-zeJymFRMFCIKPlvjxYm2af3SAWvBOj.png",mimeType:"image/png",size:1652289,filename:"logo.png"}}};j.PreviewProps=z;export default j;export{j as OrderConfirmationEmail};
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{Body as W,Column as n,Container as D,Head as Y,Heading as E,Hr as T,Html as J,Img as r,Link as c,Preview as K,Row as o,Section as s,Tailwind as U,Text as i}from"../../../core/email/components";const m=(h,l="PLN",a="en-US")=>new Intl.NumberFormat(a,{style:"currency",currency:l}).format(h),j=({user:h,organization:l,order:a})=>{var u,p,g,b,y,f,x,v,N,w,k,q,A,P,C,L;const F=`This is your receipt from ${l.name}`,O=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"numeric"}),B=((u=a.payment)===null||u===void 0?void 0:u.shipping)||0,_=((p=a.payment)===null||p===void 0?void 0:p.discount)||0,Z=((g=a.payment)===null||g===void 0?void 0:g.total)||0,H=`https://${l.configuration.hostname}/account/orders/${a.id}`;return t(J,{children:[e(Y,{}),e(K,{children:F}),e(U,{children:t(W,{className:"bg-gray-50 font-sans",children:[t(D,{className:"bg-gray-50 p-6 max-w-[600px]",children:[e(s,{className:"mb-6",children:t(o,{children:[e(n,{className:"w-[80%]",children:e(r,{alt:"React Email logo",height:"100",src:(b=l.logoFile)===null||b===void 0?void 0:b.url,className:"rounded-lg"})}),e(n,{align:"right",children:t(o,{align:"right",children:[e(n,{children:e(c,{href:"https://www.instagram.com/madrasbistro/",children:e(r,{alt:"Instagram",className:"mx-[4px]",height:"36",src:"https://react.email/static/instagram-logo.png",width:"36"})})}),e(n,{children:e(c,{href:"https://www.facebook.com/madrasBistro/",children:e(r,{alt:"Facebook",className:"mx-[4px]",height:"36",src:"https://react.email/static/facebook-logo.png",width:"36"})})})]})})]})}),t(s,{children:[t(E,{className:"text-3xl font-bold text-gray-800 mb-0",children:["Hi ",h.firstname,","]}),e(i,{className:"text-gray-600 mb-2 text-lg",children:"Your order has been received and is being processed."})]}),e(s,{className:"mb-0",children:e(c,{href:H,className:"bg-gray-900 text-sm rounded-md text-white font-medium py-2 px-5 text-center inline-block my-4",children:"Track Your Order"})})]}),t(D,{className:"mx-auto max-w-[600px] rounded-xl bg-white px-6",children:[e(s,{className:"mb-6",children:t(o,{children:[t(n,{className:"w-[60%]",children:[e(i,{className:"text-gray-500 mb-0",children:"Shipping details"}),t(i,{className:"font-semibold text-gray-800 my-0",children:[(y=a.shippingAddress)===null||y===void 0?void 0:y.firstname," ",(f=a.shippingAddress)===null||f===void 0?void 0:f.lastname]}),t(i,{className:"font-semibold text-gray-800 my-0",children:[(x=a.shippingAddress)===null||x===void 0?void 0:x.addressLineOne," ",((v=a.shippingAddress)===null||v===void 0?void 0:v.doorNumber)&&` / ${(N=a.shippingAddress)===null||N===void 0?void 0:N.doorNumber}`,e("br",{}),(w=a.shippingAddress)===null||w===void 0?void 0:w.city," ",(k=a.shippingAddress)===null||k===void 0?void 0:k.zipCode]}),e(i,{className:"text-gray-500 mb-0",children:"Phone"}),e(i,{className:"font-semibold text-gray-800 my-0",children:(q=a.shippingAddress)===null||q===void 0?void 0:q.phone})]}),e(n,{className:"w-[40%] p-0 mt-0",align:"right",valign:"top",children:e(i,{className:"text-gray-500 mb-0 pt-1",children:O})})]})}),e(i,{className:"text-gray-500 mb-0",children:"Order Summary"}),e(T,{className:"border-gray-200 mb-0"}),e(s,{children:a.items.map((R,I)=>{var M,S;const d=R;return e("table",{width:"100%",cellPadding:0,cellSpacing:0,border:0,className:I===a.items.length-1?"mb-0":"mb-4",children:t("tr",{children:[t("td",{valign:"top",children:[t(i,{className:"font-semibold mb-0",children:[((M=d.translations[0])===null||M===void 0?void 0:M.title)||"Product"," (",((S=d.translations[0])===null||S===void 0?void 0:S.subtitle)||"",")"]}),t(i,{className:"text-gray-600 mb-0 mt-0",children:["Quantity: ",d.quantity]})]}),e("td",{align:"right",valign:"top",children:e(i,{className:"font-semibold",children:m(d.unitPrice*d.quantity,l.configuration.defaultCurrency,l.configuration.defaultLocale)})})]})},I)})}),e(T,{className:"border-gray-200 mt-4"}),e(s,{children:t("table",{width:"100%",cellPadding:0,cellSpacing:0,border:0,children:[t("tr",{children:[e("td",{children:e(i,{className:"text-gray-700",children:"Delivery fee"})}),e("td",{align:"right",children:e(i,{className:"text-gray-700",children:m(B,l.configuration.defaultCurrency,l.configuration.defaultLocale)})})]}),_>0&&t("tr",{children:[e("td",{children:e(i,{className:"text-gray-700",children:"Campaign"})}),e("td",{align:"right",children:t(i,{className:"text-gray-700",children:["-",m(_,l.configuration.defaultCurrency,l.configuration.defaultLocale)]})})]})]})}),e(T,{className:"border-gray-200"}),e(s,{className:"mb-6",children:e("table",{width:"100%",cellPadding:0,cellSpacing:0,border:0,children:t("tr",{children:[e("td",{children:e(i,{className:"text-xl font-bold mb-0",children:"Total:"})}),e("td",{align:"right",children:e(i,{className:"text-xl font-bold mb-0",children:m(Z,l.configuration.defaultCurrency,l.configuration.defaultLocale)})})]})})})]}),e(s,{className:"text-center bg-gray-50 py-5",children:t("table",{className:"w-full",children:[e("tr",{className:"w-full",children:e("td",{align:"center",children:((A=l.logoFile)===null||A===void 0?void 0:A.url)&&e(r,{alt:"React Email logo",height:"100",src:l.logoFile.url,className:"rounded-lg"})})}),e("tr",{className:"w-full",children:t("td",{align:"center",children:[e(i,{className:"my-[8px] text-[16px] font-semibold text-xl pt-2 text-gray-900",children:l.name}),t(i,{className:"my-[8px] text-[16px] leading-[24px] text-gray-500",children:[(P=l.address)===null||P===void 0?void 0:P.addressLineOne,","," ",(C=l.address)===null||C===void 0?void 0:C.zipCode," ",(L=l.address)===null||L===void 0?void 0:L.city]}),e(i,{className:"mb-0 mt-[4px] text-[16px] leading-[24px] text-gray-500",children:l.phone})]})}),e("tr",{children:e("td",{align:"center",children:t(o,{className:"table-cell h-[44px] w-[56px] align-bottom pt-5",children:[e(n,{className:"pr-[8px]",children:e(c,{href:"https://www.facebook.com/madrasBistro/",children:e(r,{alt:"Facebook",height:"36",src:"https://react.email/static/facebook-logo.png",width:"36"})})}),e(n,{children:e(c,{href:"https://www.instagram.com/madrasbistro/",children:e(r,{alt:"Instagram",height:"36",src:"https://react.email/static/instagram-logo.png",width:"36"})})})]})})})]})})]})})]})},z={user:{id:"VD0OJ52f0mdAnm5YePP6BAW6hdbaCjAJ",name:"Abhishek Shaji",email:"kontakt@abhishek.pl",emailVerified:!0,image:"https://lh3.googleusercontent.com/a/ACg8ocKbkCAMTNvMizjXNxcm1aYtBiWnYpCYmU-7aE2Ft_M_uiHheZ5f=s96-c",createdAt:"2025-03-22T22:54:40.260Z",updatedAt:"2025-03-22T22:54:40.260Z",firstname:"Abhishek",lastname:"Shaji"},order:{id:"cm94wbpbm0000itx1iv9k2mqr",referenceId:"PH6LD6",token:"VAE9TX",expiresAt:"2025-04-07T00:20:09.689Z",items:[{translations:[{locale:"en",title:"Masala Dosa",subtitle:"Spice Level: Medium"},{locale:"pl",title:"null",subtitle:"Spice Level: Medium"}],rawData:{productId:"cm8kudyqq0006ityduhq0yveu",quantity:6,modifierGroups:[{id:"cm8kuonhv0002ji032ji4bzmc",modifiers:[{id:"cm8kudyqq000ditydq25s2n2e",quantity:1}]}]},unitPrice:39,image:{id:"cm8kuee0m0000l703ocs7snfb",url:"https://z3liuyatqnepss3d.public.blob.vercel-storage.com/Masala%20Dosa-b0tr9uWZqmBTPMUx4x0fzqkM6z5eCw.png",mimeType:"image/png",size:1429845,filename:"Masala Dosa.png"},totalPrice:234,quantity:6,productSnapshotId:"cm8kuopty0006ji035n7w5iby"},{translations:[{locale:"en",title:"Masala Dosa",subtitle:"Spice Level: Medium"},{locale:"pl",title:"null",subtitle:"Spice Level: Medium"}],rawData:{productId:"cm8kudyqq0006ityduhq0yveu",quantity:6,modifierGroups:[{id:"cm8kuonhv0002ji032ji4bzmc",modifiers:[{id:"cm8kudyqq000ditydq25s2n2e",quantity:1}]}]},unitPrice:39,image:{id:"cm8kuee0m0000l703ocs7snfb",url:"https://z3liuyatqnepss3d.public.blob.vercel-storage.com/Masala%20Dosa-b0tr9uWZqmBTPMUx4x0fzqkM6z5eCw.png",mimeType:"image/png",size:1429845,filename:"Masala Dosa.png"},totalPrice:234,quantity:6,productSnapshotId:"cm8kuopty0006ji035n7w5iby"}],shippingMethod:{id:"cm8kuqmkd000iitydar4a1poy",title:"Express Delivery",providerName:"Wolt Courier",requireDateOfDelivery:!0,shippingZones:[{id:"cm8kuqmkd000jitydpdvck2th",title:"Zone 1",distanceUpto:7,price:1,minimumOrderAmount:60,eta:"90min"}],createdAt:"2025-03-22T23:40:23.101Z",updatedAt:"2025-03-22T23:40:35.319Z"},acceptedAt:null,dispatchedAt:null,readyForDispatchAt:null,completedAt:null,cancelledAt:null,shippingAddress:{id:"cm94wbpbm0007itx1akuqh77n",firstname:"Klaudia",lastname:"Smoter",phone:"+48570135862",addressLineOne:"Stanis\u0142awa Lema 28",doorNumber:"54",addressLineTwo:null,zipCode:"31-571",city:"Krak\xF3w",country:"PL",placeId:"ChIJrQfdh9VaFkcRIvg8O2PqnWM",deliveryInstructions:"4th floor - Maho"},fulfilmentMethod:"delivery",currency:"PLN",payment:{id:"cm94wbpbm0008itx1thsnj7ui",method:"blik",provider:"stripe",status:"succeeded",shipping:1,subtotal:234,total:235,discount:0,currency:"PLN"},status:"pending"},organization:{id:"cm8kthfdq0001lg03b59mdy7b",name:"Madras Bistro",phone:"+48570135862",email:"contact@madrasbistro.pl",createdAt:"2025-03-22T23:05:14.271Z",legalEntityId:null,address:{id:"cm8kthfdr0002lg0350ijialt",firstname:null,lastname:null,phone:null,addressLineOne:"Plac Bohater\xF3w Getta 2",doorNumber:null,addressLineTwo:"3",zipCode:"33-332",city:"Krak\xF3w",country:"PL",placeId:"ChIJf-nsRkRbFkcR21gtObFSSSA",deliveryInstructions:null},configuration:{id:"cm8kthfdr0003lg03ghgs262n",hostname:"null",countriesShipping:["us"],stripeAccountId:"null",enableHostCheckout:!1,enableHostTracking:!1,isAcceptingOrders:!1,defaultLocale:"en",supportedLocales:["en","pl"],defaultCurrency:"PLN",createdAt:"2025-03-22T23:05:14.271Z"},logo:"https://z3liuyatqnepss3d.public.blob.vercel-storage.com/logo-zeJymFRMFCIKPlvjxYm2af3SAWvBOj.png",logoFile:{id:"cm8ktmu890005lg0356gwclfk",url:"https://z3liuyatqnepss3d.public.blob.vercel-storage.com/logo-zeJymFRMFCIKPlvjxYm2af3SAWvBOj.png",mimeType:"image/png",size:1652289,filename:"logo.png"}}};j.PreviewProps=z;export default j;export{j as OrderConfirmationEmail};