@unchainedshop/core-orders 3.0.0-alpha7 → 3.0.0-rc10

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 (141) hide show
  1. package/lib/db/OrderDeliveriesCollection.d.ts +21 -2
  2. package/lib/db/OrderDeliveriesCollection.d.ts.map +1 -1
  3. package/lib/db/OrderDeliveriesCollection.js +6 -0
  4. package/lib/db/OrderDeliveriesCollection.js.map +1 -1
  5. package/lib/db/OrderDiscountsCollection.d.ts +16 -2
  6. package/lib/db/OrderDiscountsCollection.d.ts.map +1 -1
  7. package/lib/db/OrderDiscountsCollection.js +5 -0
  8. package/lib/db/OrderDiscountsCollection.js.map +1 -1
  9. package/lib/db/OrderPaymentsCollection.d.ts +22 -2
  10. package/lib/db/OrderPaymentsCollection.d.ts.map +1 -1
  11. package/lib/db/OrderPaymentsCollection.js +6 -0
  12. package/lib/db/OrderPaymentsCollection.js.map +1 -1
  13. package/lib/db/OrderPositionsCollection.d.ts +22 -2
  14. package/lib/db/OrderPositionsCollection.d.ts.map +1 -1
  15. package/lib/db/OrderPositionsCollection.js.map +1 -1
  16. package/lib/db/OrdersCollection.d.ts +33 -2
  17. package/lib/db/OrdersCollection.d.ts.map +1 -1
  18. package/lib/db/OrdersCollection.js +8 -1
  19. package/lib/db/OrdersCollection.js.map +1 -1
  20. package/lib/module/buildFindSelector.d.ts +5 -0
  21. package/lib/module/buildFindSelector.d.ts.map +1 -0
  22. package/lib/module/buildFindSelector.js +18 -0
  23. package/lib/module/buildFindSelector.js.map +1 -0
  24. package/lib/module/configureOrderDeliveriesModule.d.ts +14 -27
  25. package/lib/module/configureOrderDeliveriesModule.d.ts.map +1 -1
  26. package/lib/module/configureOrderDeliveriesModule.js +8 -69
  27. package/lib/module/configureOrderDeliveriesModule.js.map +1 -1
  28. package/lib/module/configureOrderDiscountsModule.d.ts +17 -18
  29. package/lib/module/configureOrderDiscountsModule.d.ts.map +1 -1
  30. package/lib/module/configureOrderDiscountsModule.js +34 -143
  31. package/lib/module/configureOrderDiscountsModule.js.map +1 -1
  32. package/lib/module/configureOrderPaymentsModule.d.ts +17 -37
  33. package/lib/module/configureOrderPaymentsModule.d.ts.map +1 -1
  34. package/lib/module/configureOrderPaymentsModule.js +16 -124
  35. package/lib/module/configureOrderPaymentsModule.js.map +1 -1
  36. package/lib/module/configureOrderPositionsModule.d.ts +22 -41
  37. package/lib/module/configureOrderPositionsModule.d.ts.map +1 -1
  38. package/lib/module/configureOrderPositionsModule.js +22 -85
  39. package/lib/module/configureOrderPositionsModule.js.map +1 -1
  40. package/lib/module/configureOrdersModule-mutations.d.ts +5 -11
  41. package/lib/module/configureOrdersModule-mutations.d.ts.map +1 -1
  42. package/lib/module/configureOrdersModule-mutations.js +11 -50
  43. package/lib/module/configureOrdersModule-mutations.js.map +1 -1
  44. package/lib/module/configureOrdersModule-queries.d.ts +18 -6
  45. package/lib/module/configureOrdersModule-queries.d.ts.map +1 -1
  46. package/lib/module/configureOrdersModule-queries.js +35 -22
  47. package/lib/module/configureOrdersModule-queries.js.map +1 -1
  48. package/lib/module/configureOrdersModule.d.ts +11 -8
  49. package/lib/module/configureOrdersModule.d.ts.map +1 -1
  50. package/lib/module/configureOrdersModule.js +134 -154
  51. package/lib/module/configureOrdersModule.js.map +1 -1
  52. package/lib/orders-index.d.ts +11 -8
  53. package/lib/orders-index.d.ts.map +1 -1
  54. package/lib/orders-index.js +11 -8
  55. package/lib/orders-index.js.map +1 -1
  56. package/lib/orders-settings.d.ts +4 -8
  57. package/lib/orders-settings.d.ts.map +1 -1
  58. package/lib/orders-settings.js.map +1 -1
  59. package/package.json +13 -13
  60. package/src/db/OrderDeliveriesCollection.ts +25 -2
  61. package/src/db/OrderDiscountsCollection.ts +18 -2
  62. package/src/db/OrderPaymentsCollection.ts +26 -2
  63. package/src/db/OrderPositionsCollection.ts +21 -2
  64. package/src/db/OrdersCollection.ts +44 -2
  65. package/src/module/buildFindSelector.test.ts +8 -8
  66. package/src/module/buildFindSelector.ts +24 -0
  67. package/src/module/configureOrderDeliveriesModule.ts +29 -172
  68. package/src/module/configureOrderDiscountsModule.ts +46 -213
  69. package/src/module/configureOrderPaymentsModule.ts +58 -266
  70. package/src/module/configureOrderPositionsModule.ts +57 -208
  71. package/src/module/configureOrdersModule-mutations.ts +13 -85
  72. package/src/module/configureOrdersModule-queries.ts +61 -29
  73. package/src/module/configureOrdersModule.ts +181 -264
  74. package/src/orders-index.ts +11 -10
  75. package/src/orders-settings.ts +5 -7
  76. package/tsconfig.json +5 -7
  77. package/lib/db/OrderDiscountTrigger.d.ts +0 -5
  78. package/lib/db/OrderDiscountTrigger.d.ts.map +0 -1
  79. package/lib/db/OrderDiscountTrigger.js +0 -6
  80. package/lib/db/OrderDiscountTrigger.js.map +0 -1
  81. package/lib/director/OrderDiscountAdapter.d.ts +0 -4
  82. package/lib/director/OrderDiscountAdapter.d.ts.map +0 -1
  83. package/lib/director/OrderDiscountAdapter.js +0 -3
  84. package/lib/director/OrderDiscountAdapter.js.map +0 -1
  85. package/lib/director/OrderDiscountConfiguration.d.ts +0 -6
  86. package/lib/director/OrderDiscountConfiguration.d.ts.map +0 -1
  87. package/lib/director/OrderDiscountConfiguration.js +0 -2
  88. package/lib/director/OrderDiscountConfiguration.js.map +0 -1
  89. package/lib/director/OrderDiscountDirector.d.ts +0 -3
  90. package/lib/director/OrderDiscountDirector.d.ts.map +0 -1
  91. package/lib/director/OrderDiscountDirector.js +0 -3
  92. package/lib/director/OrderDiscountDirector.js.map +0 -1
  93. package/lib/director/OrderPricingAdapter.d.ts +0 -22
  94. package/lib/director/OrderPricingAdapter.d.ts.map +0 -1
  95. package/lib/director/OrderPricingAdapter.js +0 -25
  96. package/lib/director/OrderPricingAdapter.js.map +0 -1
  97. package/lib/director/OrderPricingDirector.d.ts +0 -18
  98. package/lib/director/OrderPricingDirector.d.ts.map +0 -1
  99. package/lib/director/OrderPricingDirector.js +0 -39
  100. package/lib/director/OrderPricingDirector.js.map +0 -1
  101. package/lib/director/OrderPricingSheet.d.ts +0 -36
  102. package/lib/director/OrderPricingSheet.d.ts.map +0 -1
  103. package/lib/director/OrderPricingSheet.js +0 -108
  104. package/lib/director/OrderPricingSheet.js.map +0 -1
  105. package/lib/module/configureOrdersModule-processing.d.ts +0 -32
  106. package/lib/module/configureOrdersModule-processing.d.ts.map +0 -1
  107. package/lib/module/configureOrdersModule-processing.js +0 -339
  108. package/lib/module/configureOrdersModule-processing.js.map +0 -1
  109. package/lib/module/configureOrdersModule-transformations.d.ts +0 -20
  110. package/lib/module/configureOrdersModule-transformations.d.ts.map +0 -1
  111. package/lib/module/configureOrdersModule-transformations.js +0 -111
  112. package/lib/module/configureOrdersModule-transformations.js.map +0 -1
  113. package/lib/service/migrateOrderCartService.d.ts +0 -10
  114. package/lib/service/migrateOrderCartService.d.ts.map +0 -1
  115. package/lib/service/migrateOrderCartService.js +0 -32
  116. package/lib/service/migrateOrderCartService.js.map +0 -1
  117. package/lib/service/nextUserCartService.d.ts +0 -11
  118. package/lib/service/nextUserCartService.d.ts.map +0 -1
  119. package/lib/service/nextUserCartService.js +0 -34
  120. package/lib/service/nextUserCartService.js.map +0 -1
  121. package/lib/service/orderServices.d.ts +0 -8
  122. package/lib/service/orderServices.d.ts.map +0 -1
  123. package/lib/service/orderServices.js +0 -7
  124. package/lib/service/orderServices.js.map +0 -1
  125. package/lib/types.d.ts +0 -116
  126. package/lib/types.d.ts.map +0 -1
  127. package/lib/types.js +0 -25
  128. package/lib/types.js.map +0 -1
  129. package/src/db/OrderDiscountTrigger.ts +0 -4
  130. package/src/director/OrderDiscountAdapter.ts +0 -8
  131. package/src/director/OrderDiscountConfiguration.ts +0 -5
  132. package/src/director/OrderDiscountDirector.ts +0 -5
  133. package/src/director/OrderPricingAdapter.ts +0 -61
  134. package/src/director/OrderPricingDirector.ts +0 -72
  135. package/src/director/OrderPricingSheet.ts +0 -146
  136. package/src/module/configureOrdersModule-processing.ts +0 -508
  137. package/src/module/configureOrdersModule-transformations.ts +0 -171
  138. package/src/service/migrateOrderCartService.ts +0 -53
  139. package/src/service/nextUserCartService.ts +0 -54
  140. package/src/service/orderServices.ts +0 -12
  141. package/src/types.ts +0 -129
@@ -1,171 +0,0 @@
1
- import { Order, OrderDiscount } from '../types.js';
2
- import { mongodb } from '@unchainedshop/mongodb';
3
- import { PaymentPricingRowCategory } from '@unchainedshop/core-payment';
4
- import {
5
- IOrderPricingSheet,
6
- OrderPricingRowCategory,
7
- OrderPricingSheet,
8
- } from '../director/OrderPricingSheet.js';
9
- import { UnchainedCore } from '@unchainedshop/core';
10
- import { ProductPricingRowCategory } from '@unchainedshop/core-products';
11
- import { DeliveryPricingRowCategory } from '@unchainedshop/core-delivery';
12
- import { OrderPrice, OrderPricingDiscount } from '../director/OrderPricingDirector.js';
13
-
14
- export interface OrderTransformations {
15
- discounted: (
16
- order: Order,
17
- orderDiscount: OrderDiscount,
18
- unchainedAPI: UnchainedCore,
19
- ) => Promise<Array<OrderPricingDiscount>>;
20
- discountTotal: (
21
- order: Order,
22
- orderDiscount: OrderDiscount,
23
- unchainedAPI: UnchainedCore,
24
- ) => Promise<OrderPrice>;
25
-
26
- isCart: (order: Order) => boolean;
27
- cart: (order: { countryContext?: string; orderNumber?: string; userId: string }) => Promise<Order>;
28
- pricingSheet: (order: Order) => IOrderPricingSheet;
29
- }
30
-
31
- export const configureOrderModuleTransformations = ({
32
- Orders,
33
- }: {
34
- Orders: mongodb.Collection<Order>;
35
- }): OrderTransformations => {
36
- return {
37
- discounted: async (order, orderDiscount, unchainedAPI) => {
38
- const { modules } = unchainedAPI;
39
-
40
- // Delivery discounts
41
- const orderDelivery = await modules.orders.deliveries.findDelivery({
42
- orderDeliveryId: order.deliveryId,
43
- });
44
- const orderDeliveryDiscounts = modules.orders.deliveries.discounts(
45
- orderDelivery,
46
- { order, orderDiscount },
47
- unchainedAPI,
48
- );
49
-
50
- // Payment discounts
51
- const orderPayment = await modules.orders.payments.findOrderPayment({
52
- orderPaymentId: order.paymentId,
53
- });
54
- const orderPaymentDiscounts = modules.orders.payments.discounts(
55
- orderPayment,
56
- { order, orderDiscount },
57
- unchainedAPI,
58
- );
59
-
60
- // Position discounts
61
- const orderPositions = await modules.orders.positions.findOrderPositions({
62
- orderId: order._id,
63
- });
64
- const orderPositionDiscounts = orderPositions.flatMap((orderPosition) =>
65
- modules.orders.positions.discounts(orderPosition, { order, orderDiscount }, unchainedAPI),
66
- );
67
-
68
- // order discounts
69
- const pricingSheet = OrderPricingSheet({
70
- calculation: order.calculation,
71
- currency: order.currency,
72
- });
73
-
74
- const orderDiscounts = pricingSheet
75
- .discountPrices(orderDiscount._id)
76
- .map((discount) => ({ order, ...discount }));
77
-
78
- // All discounts
79
- const discounted = [
80
- ...orderPaymentDiscounts,
81
- ...orderDeliveryDiscounts,
82
- ...orderPositionDiscounts,
83
- ...orderDiscounts,
84
- ].filter(Boolean);
85
-
86
- return discounted;
87
- },
88
-
89
- discountTotal: async (order, orderDiscount, unchainedAPI) => {
90
- const { modules } = unchainedAPI;
91
- const orderDiscountId = orderDiscount._id;
92
-
93
- // Delivery discounts
94
- const orderDelivery = await modules.orders.deliveries.findDelivery({
95
- orderDeliveryId: order.deliveryId,
96
- });
97
- const orderDeliveryDiscountSum =
98
- orderDelivery &&
99
- modules.orders.deliveries
100
- .pricingSheet(orderDelivery, order.currency, unchainedAPI)
101
- .total({ category: DeliveryPricingRowCategory.Discount, discountId: orderDiscountId });
102
-
103
- // Payment discounts
104
- const orderPayment = await modules.orders.payments.findOrderPayment({
105
- orderPaymentId: order.paymentId,
106
- });
107
- const orderPaymentDiscountSum =
108
- orderPayment &&
109
- modules.orders.payments
110
- .pricingSheet(orderPayment, order.currency, unchainedAPI)
111
- .total({ category: PaymentPricingRowCategory.Discount, discountId: orderDiscountId });
112
-
113
- // Position discounts
114
- const orderPositions = await modules.orders.positions.findOrderPositions({
115
- orderId: order._id,
116
- });
117
- const orderPositionDiscounts = orderPositions.map((orderPosition) =>
118
- modules.orders.positions
119
- .pricingSheet(orderPosition, order.currency, unchainedAPI)
120
- .total({ category: ProductPricingRowCategory.Discount, discountId: orderDiscountId }),
121
- );
122
-
123
- // order discounts
124
- const orderDiscountSum = OrderPricingSheet({
125
- calculation: order.calculation,
126
- currency: order.currency,
127
- }).total({ category: OrderPricingRowCategory.Discounts, discountId: orderDiscountId });
128
-
129
- const prices = [
130
- orderDeliveryDiscountSum.amount,
131
- orderPaymentDiscountSum.amount,
132
- ...orderPositionDiscounts.map((positionDiscount) => positionDiscount.amount),
133
- orderDiscountSum.amount,
134
- ];
135
- const amount = prices.reduce((oldValue, price) => oldValue + (price || 0), 0);
136
- return {
137
- amount,
138
- currency: order.currency,
139
- };
140
- },
141
-
142
- isCart: (order) => {
143
- return order.status === null;
144
- },
145
- cart: async ({ orderNumber, countryContext, userId }) => {
146
- const selector: mongodb.Filter<Order> = {
147
- countryCode: countryContext,
148
- status: { $eq: null },
149
- userId,
150
- };
151
-
152
- if (orderNumber) {
153
- selector.orderNumber = orderNumber;
154
- }
155
-
156
- const options: mongodb.FindOptions = {
157
- sort: {
158
- updated: -1,
159
- },
160
- };
161
- return Orders.findOne(selector, options);
162
- },
163
-
164
- pricingSheet: (order) => {
165
- return OrderPricingSheet({
166
- calculation: order.calculation,
167
- currency: order.currency,
168
- });
169
- },
170
- };
171
- };
@@ -1,53 +0,0 @@
1
- import { UnchainedCore } from '@unchainedshop/core';
2
- import { Order } from '../types.js';
3
-
4
- export type MigrateOrderCartsService = (
5
- params: {
6
- fromUserId: string;
7
- toUserId: string;
8
- shouldMerge: boolean;
9
- countryContext: string;
10
- },
11
- unchainedAPI: UnchainedCore,
12
- ) => Promise<Order>;
13
-
14
- export const migrateOrderCartsService: MigrateOrderCartsService = async (
15
- { fromUserId, toUserId, shouldMerge, countryContext },
16
- unchainedAPI,
17
- ) => {
18
- const fromCart = await unchainedAPI.modules.orders.cart({
19
- countryContext,
20
- userId: fromUserId,
21
- });
22
- const toCart = await unchainedAPI.modules.orders.cart({
23
- countryContext,
24
- userId: toUserId,
25
- });
26
-
27
- if (!fromCart) {
28
- // No cart, don't copy
29
- return toCart;
30
- }
31
-
32
- if (!toCart || !shouldMerge) {
33
- // No destination cart, move whole cart
34
- unchainedAPI.modules.orders.setCartOwner({ orderId: fromCart._id, userId: toUserId });
35
- return unchainedAPI.modules.orders.updateCalculation(fromCart._id, unchainedAPI);
36
- }
37
-
38
- // Move positions
39
- unchainedAPI.modules.orders.moveCartPositions({ fromOrderId: fromCart._id, toOrderId: toCart._id });
40
-
41
- // Move billing address if target order has none
42
- if (fromCart.billingAddress && !toCart.billingAddress) {
43
- await unchainedAPI.modules.orders.updateBillingAddress(toCart._id, fromCart.billingAddress);
44
- }
45
-
46
- // Move contact data if target order has none
47
- if (fromCart.contact && !toCart.contact) {
48
- await unchainedAPI.modules.orders.updateContact(toCart._id, fromCart.contact);
49
- }
50
-
51
- await unchainedAPI.modules.orders.updateCalculation(fromCart._id, unchainedAPI);
52
- return unchainedAPI.modules.orders.updateCalculation(toCart._id, unchainedAPI);
53
- };
@@ -1,54 +0,0 @@
1
- import { User } from '@unchainedshop/core-users';
2
- import { ordersSettings } from '../orders-settings.js';
3
- import { resolveBestCurrency } from '@unchainedshop/utils';
4
- import { UnchainedCore } from '@unchainedshop/core';
5
- import { Order } from '../types.js';
6
-
7
- export type NextUserCartService = (
8
- params: {
9
- user: User;
10
- orderNumber?: string;
11
- countryCode?: string;
12
- forceCartCreation?: boolean;
13
- },
14
- unchainedAPI: UnchainedCore,
15
- ) => Promise<Order | null>;
16
-
17
- export const nextUserCartService: NextUserCartService = async (
18
- { user, orderNumber, countryCode, forceCartCreation },
19
- unchainedAPI,
20
- ) => {
21
- const { modules } = unchainedAPI;
22
-
23
- const cart = await modules.orders.cart({
24
- countryContext: countryCode || user.lastLogin?.countryCode,
25
- orderNumber,
26
- userId: user._id,
27
- });
28
- if (cart) return cart;
29
-
30
- const shouldCreateNewCart = forceCartCreation || ordersSettings.ensureUserHasCart;
31
- if (!shouldCreateNewCart) return null;
32
-
33
- const countryObject = await modules.countries.findCountry({ isoCode: countryCode });
34
- const currencies = await modules.currencies.findCurrencies({ includeInactive: false });
35
- const currency = resolveBestCurrency(countryObject.defaultCurrencyCode, currencies);
36
-
37
- const order = await modules.orders.create({
38
- userId: user._id,
39
- orderNumber,
40
- currency,
41
- countryCode,
42
- billingAddress: user.lastBillingAddress || user.profile?.address,
43
- contact:
44
- user.lastContact ||
45
- (!user.guest
46
- ? {
47
- telNumber: user.profile?.phoneMobile,
48
- emailAddress: modules.users.primaryEmail(user)?.address,
49
- }
50
- : {}),
51
- });
52
-
53
- return modules.orders.initProviders(order, unchainedAPI);
54
- };
@@ -1,12 +0,0 @@
1
- import { migrateOrderCartsService, MigrateOrderCartsService } from './migrateOrderCartService.js';
2
- import { nextUserCartService, NextUserCartService } from './nextUserCartService.js';
3
-
4
- export interface OrderServices {
5
- migrateOrderCarts: MigrateOrderCartsService;
6
- nextUserCart: NextUserCartService;
7
- }
8
-
9
- export const orderServices: OrderServices = {
10
- migrateOrderCarts: migrateOrderCartsService,
11
- nextUserCart: nextUserCartService,
12
- };
package/src/types.ts DELETED
@@ -1,129 +0,0 @@
1
- import type { ProductPricingCalculation } from '@unchainedshop/core-products';
2
- import type { TimestampFields, LogFields, Address, Contact } from '@unchainedshop/mongodb';
3
- import { OrderPrice } from './director/OrderPricingDirector.js';
4
-
5
- export type OrderReport = {
6
- newCount: number;
7
- checkoutCount: number;
8
- rejectCount: number;
9
- confirmCount: number;
10
- fulfillCount: number;
11
- };
12
-
13
- export enum OrderStatus {
14
- PENDING = 'PENDING',
15
- CONFIRMED = 'CONFIRMED',
16
- FULLFILLED = 'FULLFILLED',
17
- REJECTED = 'REJECTED',
18
- }
19
-
20
- export type OrderPosition = {
21
- _id?: string;
22
- calculation: Array<ProductPricingCalculation>;
23
- configuration: Array<{ key: string; value: string }>;
24
- context?: any;
25
- orderId: string;
26
- originalProductId?: string;
27
- productId: string;
28
- quantity: number;
29
- quotationId?: string;
30
- scheduling: Array<any>;
31
- } & TimestampFields;
32
-
33
- export type Order = {
34
- _id?: string;
35
- billingAddress?: Address;
36
- calculation: Array<any>;
37
- confirmed?: Date;
38
- rejected?: Date;
39
- contact?: Contact;
40
- context?: any;
41
- countryCode: string;
42
- currency: string;
43
- deliveryId?: string;
44
- fullfilled?: Date;
45
- ordered?: Date;
46
- orderNumber?: string;
47
- originEnrollmentId?: string;
48
- paymentId?: string;
49
- status: OrderStatus | null;
50
- userId: string;
51
- } & LogFields &
52
- TimestampFields;
53
-
54
- export enum OrderDiscountTrigger {
55
- USER = 'USER',
56
- SYSTEM = 'SYSTEM',
57
- }
58
-
59
- export type OrderDiscount = {
60
- _id?: string;
61
- orderId: string;
62
- code?: string;
63
- total?: OrderPrice;
64
- trigger?: OrderDiscountTrigger;
65
- discountKey?: string;
66
- reservation?: any;
67
- context?: any;
68
- } & TimestampFields;
69
-
70
- export type OrderQuery = {
71
- includeCarts?: boolean;
72
- orderStatus?: OrderStatus[];
73
- queryString?: string;
74
- status?: OrderStatus[];
75
- userId?: string;
76
- };
77
-
78
- export enum OrderDeliveryStatus {
79
- OPEN = 'OPEN', // Null value is mapped to OPEN status
80
- DELIVERED = 'DELIVERED',
81
- RETURNED = 'RETURNED',
82
- }
83
-
84
- export enum OrderPaymentStatus {
85
- OPEN = 'OPEN', // Null value is mapped to OPEN status
86
- PAID = 'PAID',
87
- REFUNDED = 'REFUNDED',
88
- }
89
-
90
- export type OrderPayment = {
91
- _id?: string;
92
- orderId: string;
93
- context?: any;
94
- paid?: Date;
95
- transactionId?: string;
96
- paymentProviderId?: string;
97
- status?: OrderPaymentStatus | null;
98
- calculation?: Array<any>;
99
- } & LogFields &
100
- TimestampFields;
101
-
102
- export type OrderPaymentDiscount = Omit<OrderPrice, '_id'> & {
103
- _id?: string;
104
- discountId: string;
105
- item: OrderPayment;
106
- };
107
-
108
- export type OrderDelivery = {
109
- _id?: string;
110
- orderId: string;
111
- deliveryProviderId: string;
112
- delivered?: Date;
113
- status: OrderDeliveryStatus | null;
114
- context?: any;
115
- calculation: Array<any>;
116
- } & LogFields &
117
- TimestampFields;
118
-
119
- export type OrderDeliveryDiscount = Omit<OrderPrice, '_id'> & {
120
- _id?: string;
121
- discountId: string;
122
- item: OrderDelivery;
123
- };
124
-
125
- export type OrderPositionDiscount = Omit<OrderPrice, '_id'> & {
126
- _id?: string;
127
- discountId: string;
128
- item: OrderPosition;
129
- };