@chevre/domain 21.20.0-alpha.26 → 21.20.0-alpha.28

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 (23) hide show
  1. package/lib/chevre/factory/order.d.ts +1 -0
  2. package/lib/chevre/factory/order.js +2 -1
  3. package/lib/chevre/repo/action.d.ts +3 -0
  4. package/lib/chevre/repo/action.js +46 -42
  5. package/lib/chevre/service/offer/any.d.ts +3 -0
  6. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered.d.ts +1 -1
  7. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered.js +2 -30
  8. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.d.ts +8 -0
  9. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.js +41 -0
  10. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +9 -2
  11. package/lib/chevre/service/order/placeOrder.js +37 -13
  12. package/lib/chevre/service/transaction/placeOrderInProgress/confirm.d.ts +23 -0
  13. package/lib/chevre/service/transaction/placeOrderInProgress/confirm.js +194 -0
  14. package/lib/chevre/service/transaction/placeOrderInProgress/publishConfirmationNumberIfNotExist.d.ts +18 -0
  15. package/lib/chevre/service/transaction/placeOrderInProgress/publishConfirmationNumberIfNotExist.js +42 -0
  16. package/lib/chevre/service/transaction/placeOrderInProgress/publishOrderNumberIfNotExist.d.ts +23 -0
  17. package/lib/chevre/service/transaction/placeOrderInProgress/publishOrderNumberIfNotExist.js +46 -0
  18. package/lib/chevre/service/transaction/placeOrderInProgress.d.ts +16 -65
  19. package/lib/chevre/service/transaction/placeOrderInProgress.js +14 -245
  20. package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPointAward.js +1 -2
  21. package/lib/chevre/settings.d.ts +1 -0
  22. package/lib/chevre/settings.js +2 -1
  23. package/package.json +2 -2
@@ -1,4 +1,5 @@
1
1
  import * as factory from '../factory';
2
+ export declare const POINT_AWARD_IDENTIFIER_NAME = "pointAwardIdentifiers";
2
3
  export declare const AWARD_ACCOUNTS_IDENTIFIER_NAME = "awardAccounts";
3
4
  export type IMaskedCustomer = factory.order.ICustomer | Pick<factory.order.ICustomer, 'id' | 'typeOf'>;
4
5
  /**
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createMaskedCustomer = exports.AWARD_ACCOUNTS_IDENTIFIER_NAME = void 0;
3
+ exports.createMaskedCustomer = exports.AWARD_ACCOUNTS_IDENTIFIER_NAME = exports.POINT_AWARD_IDENTIFIER_NAME = void 0;
4
+ exports.POINT_AWARD_IDENTIFIER_NAME = 'pointAwardIdentifiers';
4
5
  exports.AWARD_ACCOUNTS_IDENTIFIER_NAME = 'awardAccounts';
5
6
  const MASKED_PROFILE = '****';
6
7
  /**
@@ -142,6 +142,9 @@ export declare class MongoRepository {
142
142
  actionStatus?: {
143
143
  $eq?: factory.actionStatusType;
144
144
  };
145
+ id?: {
146
+ $nin?: string[];
147
+ };
145
148
  sort?: factory.action.ISortOrder;
146
149
  }): Promise<IAction<T>[]>;
147
150
  /**
@@ -22,9 +22,13 @@ class MongoRepository {
22
22
  }
23
23
  // tslint:disable-next-line:cyclomatic-complexity max-func-body-length
24
24
  static CREATE_MONGO_CONDITIONS(params) {
25
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65;
25
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66;
26
26
  const andConditions = [];
27
- const projectIdEq = (_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
27
+ const idNin = (_a = params.id) === null || _a === void 0 ? void 0 : _a.$nin;
28
+ if (Array.isArray(idNin)) {
29
+ andConditions.push({ _id: { $nin: idNin } });
30
+ }
31
+ const projectIdEq = (_c = (_b = params.project) === null || _b === void 0 ? void 0 : _b.id) === null || _c === void 0 ? void 0 : _c.$eq;
28
32
  // tslint:disable-next-line:no-single-line-block-comment
29
33
  /* istanbul ignore else */
30
34
  if (typeof projectIdEq === 'string') {
@@ -36,7 +40,7 @@ class MongoRepository {
36
40
  }
37
41
  // tslint:disable-next-line:no-single-line-block-comment
38
42
  /* istanbul ignore else */
39
- const agentTypeOfIn = (_d = (_c = params.agent) === null || _c === void 0 ? void 0 : _c.typeOf) === null || _d === void 0 ? void 0 : _d.$in;
43
+ const agentTypeOfIn = (_e = (_d = params.agent) === null || _d === void 0 ? void 0 : _d.typeOf) === null || _e === void 0 ? void 0 : _e.$in;
40
44
  if (Array.isArray(agentTypeOfIn)) {
41
45
  andConditions.push({
42
46
  'agent.typeOf': {
@@ -45,7 +49,7 @@ class MongoRepository {
45
49
  }
46
50
  });
47
51
  }
48
- const agentIdIn = (_f = (_e = params.agent) === null || _e === void 0 ? void 0 : _e.id) === null || _f === void 0 ? void 0 : _f.$in;
52
+ const agentIdIn = (_g = (_f = params.agent) === null || _f === void 0 ? void 0 : _f.id) === null || _g === void 0 ? void 0 : _g.$in;
49
53
  if (Array.isArray(agentIdIn)) {
50
54
  andConditions.push({
51
55
  'agent.id': {
@@ -54,7 +58,7 @@ class MongoRepository {
54
58
  }
55
59
  });
56
60
  }
57
- const locationIdEq = (_h = (_g = params.location) === null || _g === void 0 ? void 0 : _g.id) === null || _h === void 0 ? void 0 : _h.$eq;
61
+ const locationIdEq = (_j = (_h = params.location) === null || _h === void 0 ? void 0 : _h.id) === null || _j === void 0 ? void 0 : _j.$eq;
58
62
  // tslint:disable-next-line:no-single-line-block-comment
59
63
  /* istanbul ignore else */
60
64
  if (typeof locationIdEq === 'string') {
@@ -65,7 +69,7 @@ class MongoRepository {
65
69
  }
66
70
  });
67
71
  }
68
- const locationIdentifierEq = (_k = (_j = params.location) === null || _j === void 0 ? void 0 : _j.identifier) === null || _k === void 0 ? void 0 : _k.$eq;
72
+ const locationIdentifierEq = (_l = (_k = params.location) === null || _k === void 0 ? void 0 : _k.identifier) === null || _l === void 0 ? void 0 : _l.$eq;
69
73
  // tslint:disable-next-line:no-single-line-block-comment
70
74
  /* istanbul ignore else */
71
75
  if (typeof locationIdentifierEq === 'string') {
@@ -76,7 +80,7 @@ class MongoRepository {
76
80
  }
77
81
  });
78
82
  }
79
- const objectMovieTicketsIdentifierEq = (_o = (_m = (_l = params.object) === null || _l === void 0 ? void 0 : _l.movieTickets) === null || _m === void 0 ? void 0 : _m.identifier) === null || _o === void 0 ? void 0 : _o.$eq;
83
+ const objectMovieTicketsIdentifierEq = (_p = (_o = (_m = params.object) === null || _m === void 0 ? void 0 : _m.movieTickets) === null || _o === void 0 ? void 0 : _o.identifier) === null || _p === void 0 ? void 0 : _p.$eq;
80
84
  if (typeof objectMovieTicketsIdentifierEq === 'string') {
81
85
  andConditions.push({
82
86
  'object.movieTickets.identifier': {
@@ -85,7 +89,7 @@ class MongoRepository {
85
89
  }
86
90
  });
87
91
  }
88
- const objectMovieTicketsServiceOutputReservationForIdEq = (_t = (_s = (_r = (_q = (_p = params.object) === null || _p === void 0 ? void 0 : _p.movieTickets) === null || _q === void 0 ? void 0 : _q.serviceOutput) === null || _r === void 0 ? void 0 : _r.reservationFor) === null || _s === void 0 ? void 0 : _s.id) === null || _t === void 0 ? void 0 : _t.$eq;
92
+ const objectMovieTicketsServiceOutputReservationForIdEq = (_u = (_t = (_s = (_r = (_q = params.object) === null || _q === void 0 ? void 0 : _q.movieTickets) === null || _r === void 0 ? void 0 : _r.serviceOutput) === null || _s === void 0 ? void 0 : _s.reservationFor) === null || _t === void 0 ? void 0 : _t.id) === null || _u === void 0 ? void 0 : _u.$eq;
89
93
  if (typeof objectMovieTicketsServiceOutputReservationForIdEq === 'string') {
90
94
  andConditions.push({
91
95
  'object.movieTickets.serviceOutput.reservationFor.id': {
@@ -96,7 +100,7 @@ class MongoRepository {
96
100
  }
97
101
  // tslint:disable-next-line:no-single-line-block-comment
98
102
  /* istanbul ignore else */
99
- const objectPaymentMethodIdEq = (_v = (_u = params.object) === null || _u === void 0 ? void 0 : _u.paymentMethodId) === null || _v === void 0 ? void 0 : _v.$eq;
103
+ const objectPaymentMethodIdEq = (_w = (_v = params.object) === null || _v === void 0 ? void 0 : _v.paymentMethodId) === null || _w === void 0 ? void 0 : _w.$eq;
100
104
  if (typeof objectPaymentMethodIdEq === 'string') {
101
105
  andConditions.push({
102
106
  'object.paymentMethodId': {
@@ -105,7 +109,7 @@ class MongoRepository {
105
109
  }
106
110
  });
107
111
  }
108
- const objectObjectPaymentMethodIdEq = (_y = (_x = (_w = params.object) === null || _w === void 0 ? void 0 : _w.object) === null || _x === void 0 ? void 0 : _x.paymentMethodId) === null || _y === void 0 ? void 0 : _y.$eq;
112
+ const objectObjectPaymentMethodIdEq = (_z = (_y = (_x = params.object) === null || _x === void 0 ? void 0 : _x.object) === null || _y === void 0 ? void 0 : _y.paymentMethodId) === null || _z === void 0 ? void 0 : _z.$eq;
109
113
  if (typeof objectObjectPaymentMethodIdEq === 'string') {
110
114
  andConditions.push({
111
115
  'object.object.paymentMethodId': {
@@ -114,7 +118,7 @@ class MongoRepository {
114
118
  }
115
119
  });
116
120
  }
117
- const objectReservationForIdEq = (_1 = (_0 = (_z = params.object) === null || _z === void 0 ? void 0 : _z.reservationFor) === null || _0 === void 0 ? void 0 : _0.id) === null || _1 === void 0 ? void 0 : _1.$eq;
121
+ const objectReservationForIdEq = (_2 = (_1 = (_0 = params.object) === null || _0 === void 0 ? void 0 : _0.reservationFor) === null || _1 === void 0 ? void 0 : _1.id) === null || _2 === void 0 ? void 0 : _2.$eq;
118
122
  // tslint:disable-next-line:no-single-line-block-comment
119
123
  /* istanbul ignore else */
120
124
  if (typeof objectReservationForIdEq === 'string') {
@@ -125,7 +129,7 @@ class MongoRepository {
125
129
  }
126
130
  });
127
131
  }
128
- const objectReservationNumberEq = (_3 = (_2 = params.object) === null || _2 === void 0 ? void 0 : _2.reservationNumber) === null || _3 === void 0 ? void 0 : _3.$eq;
132
+ const objectReservationNumberEq = (_4 = (_3 = params.object) === null || _3 === void 0 ? void 0 : _3.reservationNumber) === null || _4 === void 0 ? void 0 : _4.$eq;
129
133
  if (typeof objectReservationNumberEq === 'string') {
130
134
  andConditions.push({
131
135
  'object.reservationNumber': {
@@ -134,7 +138,7 @@ class MongoRepository {
134
138
  }
135
139
  });
136
140
  }
137
- const objectReservationNumberIn = (_5 = (_4 = params.object) === null || _4 === void 0 ? void 0 : _4.reservationNumber) === null || _5 === void 0 ? void 0 : _5.$in;
141
+ const objectReservationNumberIn = (_6 = (_5 = params.object) === null || _5 === void 0 ? void 0 : _5.reservationNumber) === null || _6 === void 0 ? void 0 : _6.$in;
138
142
  if (Array.isArray(objectReservationNumberIn)) {
139
143
  andConditions.push({
140
144
  'object.reservationNumber': {
@@ -143,7 +147,7 @@ class MongoRepository {
143
147
  }
144
148
  });
145
149
  }
146
- const objectPaymentMethodAccountIdEq = (_8 = (_7 = (_6 = params.object) === null || _6 === void 0 ? void 0 : _6.paymentMethod) === null || _7 === void 0 ? void 0 : _7.accountId) === null || _8 === void 0 ? void 0 : _8.$eq;
150
+ const objectPaymentMethodAccountIdEq = (_9 = (_8 = (_7 = params.object) === null || _7 === void 0 ? void 0 : _7.paymentMethod) === null || _8 === void 0 ? void 0 : _8.accountId) === null || _9 === void 0 ? void 0 : _9.$eq;
147
151
  // tslint:disable-next-line:no-single-line-block-comment
148
152
  /* istanbul ignore else */
149
153
  if (typeof objectPaymentMethodAccountIdEq === 'string') {
@@ -154,7 +158,7 @@ class MongoRepository {
154
158
  }
155
159
  });
156
160
  }
157
- const objectPaymentMethodPaymentMethodIdEq = (_11 = (_10 = (_9 = params.object) === null || _9 === void 0 ? void 0 : _9.paymentMethod) === null || _10 === void 0 ? void 0 : _10.paymentMethodId) === null || _11 === void 0 ? void 0 : _11.$eq;
161
+ const objectPaymentMethodPaymentMethodIdEq = (_12 = (_11 = (_10 = params.object) === null || _10 === void 0 ? void 0 : _10.paymentMethod) === null || _11 === void 0 ? void 0 : _11.paymentMethodId) === null || _12 === void 0 ? void 0 : _12.$eq;
158
162
  // tslint:disable-next-line:no-single-line-block-comment
159
163
  /* istanbul ignore else */
160
164
  if (typeof objectPaymentMethodPaymentMethodIdEq === 'string') {
@@ -165,7 +169,7 @@ class MongoRepository {
165
169
  }
166
170
  });
167
171
  }
168
- const objectPaymentMethodPaymentMethodIdIn = (_14 = (_13 = (_12 = params.object) === null || _12 === void 0 ? void 0 : _12.paymentMethod) === null || _13 === void 0 ? void 0 : _13.paymentMethodId) === null || _14 === void 0 ? void 0 : _14.$in;
172
+ const objectPaymentMethodPaymentMethodIdIn = (_15 = (_14 = (_13 = params.object) === null || _13 === void 0 ? void 0 : _13.paymentMethod) === null || _14 === void 0 ? void 0 : _14.paymentMethodId) === null || _15 === void 0 ? void 0 : _15.$in;
169
173
  if (Array.isArray(objectPaymentMethodPaymentMethodIdIn)) {
170
174
  andConditions.push({
171
175
  'object.paymentMethod.paymentMethodId': {
@@ -174,7 +178,7 @@ class MongoRepository {
174
178
  }
175
179
  });
176
180
  }
177
- const objectPaymentMethodTypeOfEq = (_17 = (_16 = (_15 = params.object) === null || _15 === void 0 ? void 0 : _15.paymentMethod) === null || _16 === void 0 ? void 0 : _16.typeOf) === null || _17 === void 0 ? void 0 : _17.$eq;
181
+ const objectPaymentMethodTypeOfEq = (_18 = (_17 = (_16 = params.object) === null || _16 === void 0 ? void 0 : _16.paymentMethod) === null || _17 === void 0 ? void 0 : _17.typeOf) === null || _18 === void 0 ? void 0 : _18.$eq;
178
182
  // tslint:disable-next-line:no-single-line-block-comment
179
183
  /* istanbul ignore else */
180
184
  if (typeof objectPaymentMethodTypeOfEq === 'string') {
@@ -185,7 +189,7 @@ class MongoRepository {
185
189
  }
186
190
  });
187
191
  }
188
- const objectTypeOfEq = (_19 = (_18 = params.object) === null || _18 === void 0 ? void 0 : _18.typeOf) === null || _19 === void 0 ? void 0 : _19.$eq;
192
+ const objectTypeOfEq = (_20 = (_19 = params.object) === null || _19 === void 0 ? void 0 : _19.typeOf) === null || _20 === void 0 ? void 0 : _20.$eq;
189
193
  // tslint:disable-next-line:no-single-line-block-comment
190
194
  /* istanbul ignore else */
191
195
  if (typeof objectTypeOfEq === 'string') {
@@ -196,7 +200,7 @@ class MongoRepository {
196
200
  }
197
201
  });
198
202
  }
199
- const objectTypeOfIn = (_21 = (_20 = params.object) === null || _20 === void 0 ? void 0 : _20.typeOf) === null || _21 === void 0 ? void 0 : _21.$in;
203
+ const objectTypeOfIn = (_22 = (_21 = params.object) === null || _21 === void 0 ? void 0 : _21.typeOf) === null || _22 === void 0 ? void 0 : _22.$in;
200
204
  if (Array.isArray(objectTypeOfIn)) {
201
205
  andConditions.push({
202
206
  'object.typeOf': {
@@ -205,7 +209,7 @@ class MongoRepository {
205
209
  }
206
210
  });
207
211
  }
208
- const objectIdEq = (_23 = (_22 = params.object) === null || _22 === void 0 ? void 0 : _22.id) === null || _23 === void 0 ? void 0 : _23.$eq;
212
+ const objectIdEq = (_24 = (_23 = params.object) === null || _23 === void 0 ? void 0 : _23.id) === null || _24 === void 0 ? void 0 : _24.$eq;
209
213
  // tslint:disable-next-line:no-single-line-block-comment
210
214
  /* istanbul ignore else */
211
215
  if (typeof objectIdEq === 'string') {
@@ -216,7 +220,7 @@ class MongoRepository {
216
220
  }
217
221
  });
218
222
  }
219
- const objectIdIn = (_25 = (_24 = params.object) === null || _24 === void 0 ? void 0 : _24.id) === null || _25 === void 0 ? void 0 : _25.$in;
223
+ const objectIdIn = (_26 = (_25 = params.object) === null || _25 === void 0 ? void 0 : _25.id) === null || _26 === void 0 ? void 0 : _26.$in;
220
224
  if (Array.isArray(objectIdIn)) {
221
225
  andConditions.push({
222
226
  'object.id': {
@@ -225,7 +229,7 @@ class MongoRepository {
225
229
  }
226
230
  });
227
231
  }
228
- const objectOrderNumberIn = (_27 = (_26 = params.object) === null || _26 === void 0 ? void 0 : _26.orderNumber) === null || _27 === void 0 ? void 0 : _27.$in;
232
+ const objectOrderNumberIn = (_28 = (_27 = params.object) === null || _27 === void 0 ? void 0 : _27.orderNumber) === null || _28 === void 0 ? void 0 : _28.$in;
229
233
  if (Array.isArray(objectOrderNumberIn)) {
230
234
  andConditions.push({
231
235
  'object.orderNumber': {
@@ -234,7 +238,7 @@ class MongoRepository {
234
238
  }
235
239
  });
236
240
  }
237
- const objectEventIdIn = (_30 = (_29 = (_28 = params.object) === null || _28 === void 0 ? void 0 : _28.event) === null || _29 === void 0 ? void 0 : _29.id) === null || _30 === void 0 ? void 0 : _30.$in;
241
+ const objectEventIdIn = (_31 = (_30 = (_29 = params.object) === null || _29 === void 0 ? void 0 : _29.event) === null || _30 === void 0 ? void 0 : _30.id) === null || _31 === void 0 ? void 0 : _31.$in;
238
242
  if (Array.isArray(objectEventIdIn)) {
239
243
  andConditions.push({
240
244
  'object.event.id': {
@@ -243,7 +247,7 @@ class MongoRepository {
243
247
  }
244
248
  });
245
249
  }
246
- const objectAcceptedOfferSeatNumberIn = (_37 = (_36 = (_35 = (_34 = (_33 = (_32 = (_31 = params.object) === null || _31 === void 0 ? void 0 : _31.acceptedOffer) === null || _32 === void 0 ? void 0 : _32.itemOffered) === null || _33 === void 0 ? void 0 : _33.serviceOutput) === null || _34 === void 0 ? void 0 : _34.reservedTicket) === null || _35 === void 0 ? void 0 : _35.ticketedSeat) === null || _36 === void 0 ? void 0 : _36.seatNumber) === null || _37 === void 0 ? void 0 : _37.$in;
250
+ const objectAcceptedOfferSeatNumberIn = (_38 = (_37 = (_36 = (_35 = (_34 = (_33 = (_32 = params.object) === null || _32 === void 0 ? void 0 : _32.acceptedOffer) === null || _33 === void 0 ? void 0 : _33.itemOffered) === null || _34 === void 0 ? void 0 : _34.serviceOutput) === null || _35 === void 0 ? void 0 : _35.reservedTicket) === null || _36 === void 0 ? void 0 : _36.ticketedSeat) === null || _37 === void 0 ? void 0 : _37.seatNumber) === null || _38 === void 0 ? void 0 : _38.$in;
247
251
  if (Array.isArray(objectAcceptedOfferSeatNumberIn)) {
248
252
  andConditions.push({
249
253
  'object.acceptedOffer.itemOffered.serviceOutput.reservedTicket.ticketedSeat.seatNumber': {
@@ -260,7 +264,7 @@ class MongoRepository {
260
264
  });
261
265
  }
262
266
  else {
263
- const typeOfEq = (_38 = params.typeOf) === null || _38 === void 0 ? void 0 : _38.$eq;
267
+ const typeOfEq = (_39 = params.typeOf) === null || _39 === void 0 ? void 0 : _39.$eq;
264
268
  // tslint:disable-next-line:no-single-line-block-comment
265
269
  /* istanbul ignore else */
266
270
  if (typeof typeOfEq === 'string') {
@@ -269,7 +273,7 @@ class MongoRepository {
269
273
  });
270
274
  }
271
275
  }
272
- const actionStatusIn = (_39 = params.actionStatus) === null || _39 === void 0 ? void 0 : _39.$in;
276
+ const actionStatusIn = (_40 = params.actionStatus) === null || _40 === void 0 ? void 0 : _40.$in;
273
277
  // tslint:disable-next-line:no-single-line-block-comment
274
278
  /* istanbul ignore else */
275
279
  if (Array.isArray(actionStatusIn)) {
@@ -300,7 +304,7 @@ class MongoRepository {
300
304
  startDate: { $lte: startDateLte }
301
305
  });
302
306
  }
303
- const fromLocationTypeOfIn = (_41 = (_40 = params.fromLocation) === null || _40 === void 0 ? void 0 : _40.typeOf) === null || _41 === void 0 ? void 0 : _41.$in;
307
+ const fromLocationTypeOfIn = (_42 = (_41 = params.fromLocation) === null || _41 === void 0 ? void 0 : _41.typeOf) === null || _42 === void 0 ? void 0 : _42.$in;
304
308
  if (Array.isArray(fromLocationTypeOfIn)) {
305
309
  andConditions.push({
306
310
  'fromLocation.typeOf': {
@@ -309,7 +313,7 @@ class MongoRepository {
309
313
  }
310
314
  });
311
315
  }
312
- const fromLocationAccountNumberIn = (_43 = (_42 = params.fromLocation) === null || _42 === void 0 ? void 0 : _42.accountNumber) === null || _43 === void 0 ? void 0 : _43.$in;
316
+ const fromLocationAccountNumberIn = (_44 = (_43 = params.fromLocation) === null || _43 === void 0 ? void 0 : _43.accountNumber) === null || _44 === void 0 ? void 0 : _44.$in;
313
317
  if (Array.isArray(fromLocationAccountNumberIn)) {
314
318
  andConditions.push({
315
319
  'fromLocation.accountNumber': {
@@ -318,7 +322,7 @@ class MongoRepository {
318
322
  }
319
323
  });
320
324
  }
321
- const fromLocationAccountTypeIn = (_45 = (_44 = params.fromLocation) === null || _44 === void 0 ? void 0 : _44.accountType) === null || _45 === void 0 ? void 0 : _45.$in;
325
+ const fromLocationAccountTypeIn = (_46 = (_45 = params.fromLocation) === null || _45 === void 0 ? void 0 : _45.accountType) === null || _46 === void 0 ? void 0 : _46.$in;
322
326
  if (Array.isArray(fromLocationAccountTypeIn)) {
323
327
  andConditions.push({
324
328
  'fromLocation.accountType': {
@@ -327,7 +331,7 @@ class MongoRepository {
327
331
  }
328
332
  });
329
333
  }
330
- const toLocationTypeOfIn = (_47 = (_46 = params.toLocation) === null || _46 === void 0 ? void 0 : _46.typeOf) === null || _47 === void 0 ? void 0 : _47.$in;
334
+ const toLocationTypeOfIn = (_48 = (_47 = params.toLocation) === null || _47 === void 0 ? void 0 : _47.typeOf) === null || _48 === void 0 ? void 0 : _48.$in;
331
335
  if (Array.isArray(toLocationTypeOfIn)) {
332
336
  andConditions.push({
333
337
  'toLocation.typeOf': {
@@ -336,7 +340,7 @@ class MongoRepository {
336
340
  }
337
341
  });
338
342
  }
339
- const toLocationAccountNumberIn = (_49 = (_48 = params.toLocation) === null || _48 === void 0 ? void 0 : _48.accountNumber) === null || _49 === void 0 ? void 0 : _49.$in;
343
+ const toLocationAccountNumberIn = (_50 = (_49 = params.toLocation) === null || _49 === void 0 ? void 0 : _49.accountNumber) === null || _50 === void 0 ? void 0 : _50.$in;
340
344
  if (Array.isArray(toLocationAccountNumberIn)) {
341
345
  andConditions.push({
342
346
  'toLocation.accountNumber': {
@@ -345,7 +349,7 @@ class MongoRepository {
345
349
  }
346
350
  });
347
351
  }
348
- const toLocationAccountTypeIn = (_51 = (_50 = params.toLocation) === null || _50 === void 0 ? void 0 : _50.accountType) === null || _51 === void 0 ? void 0 : _51.$in;
352
+ const toLocationAccountTypeIn = (_52 = (_51 = params.toLocation) === null || _51 === void 0 ? void 0 : _51.accountType) === null || _52 === void 0 ? void 0 : _52.$in;
349
353
  if (Array.isArray(toLocationAccountTypeIn)) {
350
354
  andConditions.push({
351
355
  'toLocation.accountType': {
@@ -354,7 +358,7 @@ class MongoRepository {
354
358
  }
355
359
  });
356
360
  }
357
- const purposeTypeOfIn = (_53 = (_52 = params.purpose) === null || _52 === void 0 ? void 0 : _52.typeOf) === null || _53 === void 0 ? void 0 : _53.$in;
361
+ const purposeTypeOfIn = (_54 = (_53 = params.purpose) === null || _53 === void 0 ? void 0 : _53.typeOf) === null || _54 === void 0 ? void 0 : _54.$in;
358
362
  if (Array.isArray(purposeTypeOfIn)) {
359
363
  andConditions.push({
360
364
  'purpose.typeOf': {
@@ -363,7 +367,7 @@ class MongoRepository {
363
367
  }
364
368
  });
365
369
  }
366
- const purposeIdIn = (_55 = (_54 = params.purpose) === null || _54 === void 0 ? void 0 : _54.id) === null || _55 === void 0 ? void 0 : _55.$in;
370
+ const purposeIdIn = (_56 = (_55 = params.purpose) === null || _55 === void 0 ? void 0 : _55.id) === null || _56 === void 0 ? void 0 : _56.$in;
367
371
  if (Array.isArray(purposeIdIn)) {
368
372
  andConditions.push({
369
373
  'purpose.id': {
@@ -372,7 +376,7 @@ class MongoRepository {
372
376
  }
373
377
  });
374
378
  }
375
- const purposeOrderNumberIn = (_57 = (_56 = params.purpose) === null || _56 === void 0 ? void 0 : _56.orderNumber) === null || _57 === void 0 ? void 0 : _57.$in;
379
+ const purposeOrderNumberIn = (_58 = (_57 = params.purpose) === null || _57 === void 0 ? void 0 : _57.orderNumber) === null || _58 === void 0 ? void 0 : _58.$in;
376
380
  if (Array.isArray(purposeOrderNumberIn)) {
377
381
  andConditions.push({
378
382
  'purpose.orderNumber': {
@@ -381,7 +385,7 @@ class MongoRepository {
381
385
  }
382
386
  });
383
387
  }
384
- const resultTypeOfIn = (_59 = (_58 = params.result) === null || _58 === void 0 ? void 0 : _58.typeOf) === null || _59 === void 0 ? void 0 : _59.$in;
388
+ const resultTypeOfIn = (_60 = (_59 = params.result) === null || _59 === void 0 ? void 0 : _59.typeOf) === null || _60 === void 0 ? void 0 : _60.$in;
385
389
  if (Array.isArray(resultTypeOfIn)) {
386
390
  andConditions.push({
387
391
  'result.typeOf': {
@@ -390,7 +394,7 @@ class MongoRepository {
390
394
  }
391
395
  });
392
396
  }
393
- const resultIdIn = (_61 = (_60 = params.result) === null || _60 === void 0 ? void 0 : _60.id) === null || _61 === void 0 ? void 0 : _61.$in;
397
+ const resultIdIn = (_62 = (_61 = params.result) === null || _61 === void 0 ? void 0 : _61.id) === null || _62 === void 0 ? void 0 : _62.$in;
394
398
  if (Array.isArray(resultIdIn)) {
395
399
  andConditions.push({
396
400
  'result.id': {
@@ -399,7 +403,7 @@ class MongoRepository {
399
403
  }
400
404
  });
401
405
  }
402
- const resultOrderNumberIn = (_63 = (_62 = params.result) === null || _62 === void 0 ? void 0 : _62.orderNumber) === null || _63 === void 0 ? void 0 : _63.$in;
406
+ const resultOrderNumberIn = (_64 = (_63 = params.result) === null || _63 === void 0 ? void 0 : _63.orderNumber) === null || _64 === void 0 ? void 0 : _64.$in;
403
407
  if (Array.isArray(resultOrderNumberIn)) {
404
408
  andConditions.push({
405
409
  'result.orderNumber': {
@@ -408,7 +412,7 @@ class MongoRepository {
408
412
  }
409
413
  });
410
414
  }
411
- const resultCodeIn = (_65 = (_64 = params.result) === null || _64 === void 0 ? void 0 : _64.code) === null || _65 === void 0 ? void 0 : _65.$in;
415
+ const resultCodeIn = (_66 = (_65 = params.result) === null || _65 === void 0 ? void 0 : _65.code) === null || _66 === void 0 ? void 0 : _66.$in;
412
416
  if (Array.isArray(resultCodeIn)) {
413
417
  andConditions.push({
414
418
  'result.code': {
@@ -621,16 +625,16 @@ class MongoRepository {
621
625
  * 取引に対するアクション検索時などに使用
622
626
  */
623
627
  searchByPurpose(params) {
624
- var _a, _b, _c, _d, _e, _f;
628
+ var _a, _b, _c, _d, _e, _f, _g, _h;
625
629
  return __awaiter(this, void 0, void 0, function* () {
626
- return this.search(Object.assign(Object.assign(Object.assign({ purpose: {
630
+ return this.search(Object.assign(Object.assign(Object.assign(Object.assign({ purpose: {
627
631
  id: { $in: [params.purpose.id] },
628
632
  typeOf: { $in: [params.purpose.typeOf] }
629
633
  }, object: Object.assign(Object.assign({}, (typeof ((_b = (_a = params.object) === null || _a === void 0 ? void 0 : _a.typeOf) === null || _b === void 0 ? void 0 : _b.$eq) === 'string')
630
634
  ? { typeOf: { $eq: params.object.typeOf.$eq } }
631
635
  : undefined), (typeof ((_d = (_c = params.object) === null || _c === void 0 ? void 0 : _c.paymentMethodId) === null || _d === void 0 ? void 0 : _d.$eq) === 'string')
632
636
  ? { paymentMethodId: { $eq: params.object.paymentMethodId.$eq } }
633
- : undefined) }, (typeof ((_e = params.actionStatus) === null || _e === void 0 ? void 0 : _e.$eq) === 'string') ? { actionStatus: { $in: [params.actionStatus.$eq] } } : undefined), (typeof params.typeOf === 'string') ? { typeOf: { $eq: params.typeOf } } : undefined), (typeof ((_f = params.sort) === null || _f === void 0 ? void 0 : _f.startDate) === 'number') ? { sort: params.sort } : undefined), [], []);
637
+ : undefined) }, (typeof ((_e = params.actionStatus) === null || _e === void 0 ? void 0 : _e.$eq) === 'string') ? { actionStatus: { $in: [params.actionStatus.$eq] } } : undefined), (typeof params.typeOf === 'string') ? { typeOf: { $eq: params.typeOf } } : undefined), (Array.isArray((_f = params.id) === null || _f === void 0 ? void 0 : _f.$nin)) ? { id: { $nin: (_g = params.id) === null || _g === void 0 ? void 0 : _g.$nin } } : undefined), (typeof ((_h = params.sort) === null || _h === void 0 ? void 0 : _h.startDate) === 'number') ? { sort: params.sort } : undefined), [], []);
634
638
  });
635
639
  }
636
640
  /**
@@ -21,6 +21,9 @@ export declare function acceptOffer(params: {
21
21
  acceptedOffers: factory.order.IAcceptedOffer<factory.order.IItemOffered>[];
22
22
  }): IAcceptOfferOperation<void>;
23
23
  export declare function voidAcceptedOffer(params: {
24
+ /**
25
+ * 取消対象の承認アクション
26
+ */
24
27
  authorizeActions: IAuthorizeOfferAction[];
25
28
  orderNumber: string;
26
29
  }): (repos: {
@@ -1,5 +1,5 @@
1
- import type { MongoRepository as TaskRepo } from '../../../repo/task';
2
1
  import * as factory from '../../../factory';
2
+ import type { MongoRepository as TaskRepo } from '../../../repo/task';
3
3
  type IPlaceOrderTransaction = Pick<factory.transaction.placeOrder.ITransaction, 'id' | 'project' | 'typeOf' | 'potentialActions'>;
4
4
  declare function onOrderDelivered(params: {
5
5
  order: Pick<factory.order.IOrder, 'id' | 'customer' | 'orderDate' | 'orderNumber' | 'project' | 'typeOf'> & {
@@ -14,8 +14,8 @@ exports.onOrderDelivered = void 0;
14
14
  * 注文ステータス変更時処理
15
15
  */
16
16
  const createDebug = require("debug");
17
- const util = require("util");
18
17
  const factory = require("../../../factory");
18
+ const createSendEmailMessageTaskIfNotExist_1 = require("./onOrderProcessing/createSendEmailMessageTaskIfNotExist");
19
19
  const factory_1 = require("./onOrderDelivered/factory");
20
20
  const debug = createDebug('chevre-domain:service:order');
21
21
  function onOrderDelivered(params) {
@@ -39,9 +39,7 @@ function onOrderDelivered(params) {
39
39
  yield repos.task.saveMany(tasks, { emitImmediately: true });
40
40
  switch (params.order.orderStatus) {
41
41
  case factory.orderStatus.OrderDelivered:
42
- yield createSendEmailMessageTaskIfNotExist({
43
- potentialActions: sendOrderPotentialActions
44
- })(repos);
42
+ yield (0, createSendEmailMessageTaskIfNotExist_1.createSendEmailMessageTaskIfNotExist)({ potentialActions: sendOrderPotentialActions })(repos);
45
43
  break;
46
44
  default:
47
45
  throw new factory.errors.NotImplemented(`${params.order.orderStatus} not implemented`);
@@ -49,29 +47,3 @@ function onOrderDelivered(params) {
49
47
  });
50
48
  }
51
49
  exports.onOrderDelivered = onOrderDelivered;
52
- function createSendEmailMessageTaskIfNotExist(params) {
53
- return (repos) => __awaiter(this, void 0, void 0, function* () {
54
- var _a;
55
- const sendEmailMessageActions = (_a = params.potentialActions) === null || _a === void 0 ? void 0 : _a.sendEmailMessage;
56
- const now = new Date();
57
- if (Array.isArray(sendEmailMessageActions)) {
58
- yield Promise.all(sendEmailMessageActions.map((sendEmailMessageAction, index) => __awaiter(this, void 0, void 0, function* () {
59
- const taskIdentifier = util.format('%s:%s:%s:%s:%s:%s', sendEmailMessageAction.project.id, factory.taskName.SendEmailMessage, sendEmailMessageAction.purpose.typeOf, sendEmailMessageAction.purpose.orderNumber, factory.orderStatus.OrderDelivered, index);
60
- const sendEmailMessageTask = {
61
- identifier: taskIdentifier,
62
- project: sendEmailMessageAction.project,
63
- name: factory.taskName.SendEmailMessage,
64
- status: factory.taskStatus.Ready,
65
- runsAt: now,
66
- remainingNumberOfTries: 10,
67
- numberOfTried: 0,
68
- executionResults: [],
69
- data: {
70
- actionAttributes: sendEmailMessageAction
71
- }
72
- };
73
- yield repos.task.createIfNotExistByIdentifier(sendEmailMessageTask, { emitImmediately: true });
74
- })));
75
- }
76
- });
77
- }
@@ -0,0 +1,8 @@
1
+ import type { MongoRepository as TaskRepo } from '../../../../repo/task';
2
+ import * as factory from '../../../../factory';
3
+ declare function createSendEmailMessageTaskIfNotExist(params: {
4
+ potentialActions?: factory.action.transfer.send.order.IPotentialActions;
5
+ }): (repos: {
6
+ task: TaskRepo;
7
+ }) => Promise<void>;
8
+ export { createSendEmailMessageTaskIfNotExist };
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.createSendEmailMessageTaskIfNotExist = void 0;
13
+ const util = require("util");
14
+ const factory = require("../../../../factory");
15
+ function createSendEmailMessageTaskIfNotExist(params) {
16
+ return (repos) => __awaiter(this, void 0, void 0, function* () {
17
+ var _a;
18
+ const sendEmailMessageActions = (_a = params.potentialActions) === null || _a === void 0 ? void 0 : _a.sendEmailMessage;
19
+ const now = new Date();
20
+ if (Array.isArray(sendEmailMessageActions)) {
21
+ yield Promise.all(sendEmailMessageActions.map((sendEmailMessageAction, index) => __awaiter(this, void 0, void 0, function* () {
22
+ const taskIdentifier = util.format('%s:%s:%s:%s:%s:%s', sendEmailMessageAction.project.id, factory.taskName.SendEmailMessage, sendEmailMessageAction.purpose.typeOf, sendEmailMessageAction.purpose.orderNumber, factory.orderStatus.OrderProcessing, index);
23
+ const sendEmailMessageTask = {
24
+ identifier: taskIdentifier,
25
+ project: sendEmailMessageAction.project,
26
+ name: factory.taskName.SendEmailMessage,
27
+ status: factory.taskStatus.Ready,
28
+ runsAt: now,
29
+ remainingNumberOfTries: 10,
30
+ numberOfTried: 0,
31
+ executionResults: [],
32
+ data: {
33
+ actionAttributes: sendEmailMessageAction
34
+ }
35
+ };
36
+ yield repos.task.createIfNotExistByIdentifier(sendEmailMessageTask, { emitImmediately: true });
37
+ })));
38
+ }
39
+ });
40
+ }
41
+ exports.createSendEmailMessageTaskIfNotExist = createSendEmailMessageTaskIfNotExist;
@@ -17,14 +17,17 @@ const createDebug = require("debug");
17
17
  const util = require("util");
18
18
  const factory = require("../../../factory");
19
19
  const order_1 = require("../../../factory/order");
20
+ const settings_1 = require("../../../settings");
21
+ const createSendEmailMessageTaskIfNotExist_1 = require("./onOrderProcessing/createSendEmailMessageTaskIfNotExist");
20
22
  const factory_1 = require("./onOrderProcessing/factory");
21
23
  const debug = createDebug('chevre-domain:service:order');
22
24
  const USE_CONFIRM_REGISTER_SERVICE_TRANSACTION = process.env.USE_CONFIRM_REGISTER_SERVICE_TRANSACTION === '1';
23
25
  function onOrderProcessing(params) {
24
26
  return (repos) => __awaiter(this, void 0, void 0, function* () {
25
- var _a, _b, _c;
27
+ var _a, _b, _c, _d, _e, _f, _g, _h;
26
28
  debug('onOrderStatusChanged called.', params.order.orderNumber, params.order.orderStatus, params.order.orderDate);
27
29
  let tasks = [];
30
+ const sendOrderPotentialActions = (_e = (_d = (_c = (_b = (_a = params.placeOrderTransaction) === null || _a === void 0 ? void 0 : _a.potentialActions) === null || _b === void 0 ? void 0 : _b.order) === null || _c === void 0 ? void 0 : _c.potentialActions) === null || _d === void 0 ? void 0 : _d.sendOrder) === null || _e === void 0 ? void 0 : _e.potentialActions;
28
31
  const maskedCustomer = (0, order_1.createMaskedCustomer)(params.order, { noProfile: true });
29
32
  const simpleOrder = {
30
33
  typeOf: params.order.typeOf,
@@ -55,8 +58,12 @@ function onOrderProcessing(params) {
55
58
  // 冗長なconfirmReserveTransactionタスク作成を回避(2023-08-25~)
56
59
  yield createConfirmReserveTransactionTasksIfNotExist(params.order, simpleOrder)(repos);
57
60
  yield createGivePointAwardTaskIfNotExist({
58
- potentialActions: (_c = (_b = (_a = params.placeOrderTransaction) === null || _a === void 0 ? void 0 : _a.potentialActions) === null || _b === void 0 ? void 0 : _b.order) === null || _c === void 0 ? void 0 : _c.potentialActions
61
+ potentialActions: (_h = (_g = (_f = params.placeOrderTransaction) === null || _f === void 0 ? void 0 : _f.potentialActions) === null || _g === void 0 ? void 0 : _g.order) === null || _h === void 0 ? void 0 : _h.potentialActions
59
62
  })(repos);
63
+ // OrderProcessingにおけるEメール送信に対応(2024-01-17~)
64
+ if (settings_1.USE_SEND_EMAIL_MESSAGE_ON_ORDER_PROCESSING) {
65
+ yield (0, createSendEmailMessageTaskIfNotExist_1.createSendEmailMessageTaskIfNotExist)({ potentialActions: sendOrderPotentialActions })(repos);
66
+ }
60
67
  break;
61
68
  default:
62
69
  }
@@ -8,25 +8,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- var __rest = (this && this.__rest) || function (s, e) {
12
- var t = {};
13
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
14
- t[p] = s[p];
15
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
16
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
17
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
18
- t[p[i]] = s[p[i]];
19
- }
20
- return t;
21
- };
22
11
  Object.defineProperty(exports, "__esModule", { value: true });
23
12
  exports.placeOrderWithoutTransaction = exports.placeOrder = void 0;
13
+ const createDebug = require("debug");
24
14
  const moment = require("moment");
25
15
  const order_1 = require("../../factory/order");
16
+ // import { voidAcceptedOffer } from '../offer/any';
26
17
  const createAccountingReportIfNotExist_1 = require("./createAccountingReportIfNotExist");
27
18
  const onAssetTransactionStatusChanged_1 = require("./onAssetTransactionStatusChanged");
28
19
  const onOrderStatusChanged_1 = require("./onOrderStatusChanged");
29
20
  const factory = require("../../factory");
21
+ const debug = createDebug('chevre-domain:service:order');
30
22
  function createOrder(params) {
31
23
  // 必要な属性についてDate型に変換(でないと検索クエリを効率的に使えない)
32
24
  const acceptedOffers = (Array.isArray(params.acceptedOffers))
@@ -112,8 +104,8 @@ function createOrderFromBody(params) {
112
104
  throw new factory.errors.NotFound('transaction.result.order');
113
105
  }
114
106
  order = createOrder(orderByTransaction);
115
- const { result } = placeOrderTransactionWithResult, placeOrderTransaction = __rest(placeOrderTransactionWithResult, ["result"]);
116
- return { order, placeOrderTransaction };
107
+ // const { result, ...placeOrderTransaction } = placeOrderTransactionWithResult;
108
+ return { order, placeOrderTransaction: placeOrderTransactionWithResult };
117
109
  });
118
110
  }
119
111
  /**
@@ -165,6 +157,33 @@ function placeOrderWithoutTransaction(params) {
165
157
  });
166
158
  }
167
159
  exports.placeOrderWithoutTransaction = placeOrderWithoutTransaction;
160
+ function voidAcceptedOfferIfNecessary(params) {
161
+ return (repos) => __awaiter(this, void 0, void 0, function* () {
162
+ var _a;
163
+ // 取引に保管された承認アクション以外のアクションについて、オファーを除外する
164
+ const authorizeActionsAsResult = (_a = params.purpose.result) === null || _a === void 0 ? void 0 : _a.authorizeActions;
165
+ if (Array.isArray(authorizeActionsAsResult) && authorizeActionsAsResult.length > 0) {
166
+ const completedAuthorizeActionIds = authorizeActionsAsResult.map(({ id }) => id);
167
+ debug(completedAuthorizeActionIds.length, 'completedAuthorizeActionIds found from transaction', params.purpose.id);
168
+ const authorizeActions = yield repos.action.searchByPurpose({
169
+ typeOf: factory.actionType.AuthorizeAction,
170
+ purpose: {
171
+ typeOf: factory.transactionType.PlaceOrder,
172
+ id: params.purpose.id
173
+ },
174
+ object: { typeOf: { $eq: factory.action.authorize.offer.eventService.ObjectType.SeatReservation } },
175
+ id: { $nin: completedAuthorizeActionIds }
176
+ });
177
+ debug('processing voidAcceptedOffer', authorizeActions.length, 'authorizeActions...', authorizeActions);
178
+ // tslint:disable-next-line:no-suspicious-comment
179
+ // TODO implement
180
+ // await voidAcceptedOffer({
181
+ // authorizeActions,
182
+ // orderNumber: params.object.orderNumber
183
+ // })(repos);
184
+ }
185
+ });
186
+ }
168
187
  /**
169
188
  * 注文を作成する
170
189
  */
@@ -227,6 +246,11 @@ function placeOrder(params) {
227
246
  if (completedActions.length === 0) {
228
247
  const action = yield repos.action.start(orderActionAttributes);
229
248
  try {
249
+ // 冗長なオファーを除外する(念のため)
250
+ yield voidAcceptedOfferIfNecessary({
251
+ object: { orderNumber: order.orderNumber },
252
+ purpose: placeOrderTransaction
253
+ })(repos);
230
254
  // orderInTransactionを考慮(2024-01-14~)
231
255
  yield repos.orderInTransaction.placeOrder(order);
232
256
  yield repos.order.createIfNotExist(order);