@chevre/domain 21.27.0-alpha.23 → 21.27.0-alpha.25

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.
@@ -21,7 +21,6 @@ async function main() {
21
21
  await (await chevre.service.aggregation.createService()).event.aggregateScreeningEvent({
22
22
  id: String(process.env.EVENT_ID)
23
23
  })({
24
- aggregateReservation: await chevre.repository.AggregateReservation.createInstance(mongoose.connection),
25
24
  event: await chevre.repository.Event.createInstance(mongoose.connection),
26
25
  stockHolder: await chevre.repository.StockHolder.createInstance(client, mongoose.connection),
27
26
  offer: await chevre.repository.Offer.createInstance(mongoose.connection),
@@ -30,7 +30,7 @@ async function main() {
30
30
  typeOf: chevre.factory.eventType.ScreeningEvent
31
31
  }
32
32
  },
33
- ['aggregateEntranceGate', 'aggregateReservation', 'aggregateOffer']
33
+ ['aggregateEntranceGate', 'aggregateOffer']
34
34
  );
35
35
  console.log('aggregateReservations:', aggregateReservations);
36
36
 
@@ -21,7 +21,7 @@ async function main() {
21
21
  typeOf: chevre.factory.eventType.ScreeningEvent
22
22
  }
23
23
  },
24
- ['aggregateEntranceGate', 'aggregateReservation', 'aggregateOffer']
24
+ ['aggregateEntranceGate', 'aggregateOffer']
25
25
  );
26
26
  console.log('aggregateReservations:', aggregateReservations);
27
27
  }
@@ -17,11 +17,9 @@ async function main() {
17
17
  ]
18
18
  }
19
19
  },
20
- $unset: {
20
+ $unset: <any>{
21
21
  aggregateEntranceGate: 1,
22
- ...{
23
- 'aggregateOffer.offers': 1
24
- }
22
+ 'aggregateOffer.offers': 1
25
23
  }
26
24
  });
27
25
  console.log('unset processed.', updateResult);
@@ -22,7 +22,7 @@ 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, _66, _67, _68, _69;
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, _67, _68, _69, _70, _71, _72, _73;
26
26
  const andConditions = [];
27
27
  const idIn = (_a = params.id) === null || _a === void 0 ? void 0 : _a.$in;
28
28
  if (Array.isArray(idIn)) {
@@ -66,7 +66,11 @@ class MongoRepository {
66
66
  if (typeof instrumentTransactionNumberEq === 'string') {
67
67
  andConditions.push({ 'instrument.transactionNumber': { $exists: true, $eq: instrumentTransactionNumberEq } });
68
68
  }
69
- const locationIdEq = (_m = (_l = params.location) === null || _l === void 0 ? void 0 : _l.id) === null || _m === void 0 ? void 0 : _m.$eq;
69
+ const instrumentTypeOfEq = (_m = (_l = params.instrument) === null || _l === void 0 ? void 0 : _l.typeOf) === null || _m === void 0 ? void 0 : _m.$eq;
70
+ if (typeof instrumentTypeOfEq === 'string') {
71
+ andConditions.push({ 'instrument.typeOf': { $exists: true, $eq: instrumentTypeOfEq } });
72
+ }
73
+ const locationIdEq = (_p = (_o = params.location) === null || _o === void 0 ? void 0 : _o.id) === null || _p === void 0 ? void 0 : _p.$eq;
70
74
  // tslint:disable-next-line:no-single-line-block-comment
71
75
  /* istanbul ignore else */
72
76
  if (typeof locationIdEq === 'string') {
@@ -77,7 +81,7 @@ class MongoRepository {
77
81
  }
78
82
  });
79
83
  }
80
- const locationIdentifierEq = (_p = (_o = params.location) === null || _o === void 0 ? void 0 : _o.identifier) === null || _p === void 0 ? void 0 : _p.$eq;
84
+ const locationIdentifierEq = (_r = (_q = params.location) === null || _q === void 0 ? void 0 : _q.identifier) === null || _r === void 0 ? void 0 : _r.$eq;
81
85
  // tslint:disable-next-line:no-single-line-block-comment
82
86
  /* istanbul ignore else */
83
87
  if (typeof locationIdentifierEq === 'string') {
@@ -88,7 +92,7 @@ class MongoRepository {
88
92
  }
89
93
  });
90
94
  }
91
- const objectMovieTicketsIdentifierEq = (_s = (_r = (_q = params.object) === null || _q === void 0 ? void 0 : _q.movieTickets) === null || _r === void 0 ? void 0 : _r.identifier) === null || _s === void 0 ? void 0 : _s.$eq;
95
+ const objectMovieTicketsIdentifierEq = (_u = (_t = (_s = params.object) === null || _s === void 0 ? void 0 : _s.movieTickets) === null || _t === void 0 ? void 0 : _t.identifier) === null || _u === void 0 ? void 0 : _u.$eq;
92
96
  if (typeof objectMovieTicketsIdentifierEq === 'string') {
93
97
  andConditions.push({
94
98
  'object.movieTickets.identifier': {
@@ -97,7 +101,7 @@ class MongoRepository {
97
101
  }
98
102
  });
99
103
  }
100
- const objectMovieTicketsServiceOutputReservationForIdEq = (_x = (_w = (_v = (_u = (_t = params.object) === null || _t === void 0 ? void 0 : _t.movieTickets) === null || _u === void 0 ? void 0 : _u.serviceOutput) === null || _v === void 0 ? void 0 : _v.reservationFor) === null || _w === void 0 ? void 0 : _w.id) === null || _x === void 0 ? void 0 : _x.$eq;
104
+ const objectMovieTicketsServiceOutputReservationForIdEq = (_z = (_y = (_x = (_w = (_v = params.object) === null || _v === void 0 ? void 0 : _v.movieTickets) === null || _w === void 0 ? void 0 : _w.serviceOutput) === null || _x === void 0 ? void 0 : _x.reservationFor) === null || _y === void 0 ? void 0 : _y.id) === null || _z === void 0 ? void 0 : _z.$eq;
101
105
  if (typeof objectMovieTicketsServiceOutputReservationForIdEq === 'string') {
102
106
  andConditions.push({
103
107
  'object.movieTickets.serviceOutput.reservationFor.id': {
@@ -108,7 +112,7 @@ class MongoRepository {
108
112
  }
109
113
  // tslint:disable-next-line:no-single-line-block-comment
110
114
  /* istanbul ignore else */
111
- const objectPaymentMethodIdEq = (_z = (_y = params.object) === null || _y === void 0 ? void 0 : _y.paymentMethodId) === null || _z === void 0 ? void 0 : _z.$eq;
115
+ const objectPaymentMethodIdEq = (_1 = (_0 = params.object) === null || _0 === void 0 ? void 0 : _0.paymentMethodId) === null || _1 === void 0 ? void 0 : _1.$eq;
112
116
  if (typeof objectPaymentMethodIdEq === 'string') {
113
117
  andConditions.push({
114
118
  'object.paymentMethodId': {
@@ -117,7 +121,7 @@ class MongoRepository {
117
121
  }
118
122
  });
119
123
  }
120
- const objectObjectPaymentMethodIdEq = (_2 = (_1 = (_0 = params.object) === null || _0 === void 0 ? void 0 : _0.object) === null || _1 === void 0 ? void 0 : _1.paymentMethodId) === null || _2 === void 0 ? void 0 : _2.$eq;
124
+ const objectObjectPaymentMethodIdEq = (_4 = (_3 = (_2 = params.object) === null || _2 === void 0 ? void 0 : _2.object) === null || _3 === void 0 ? void 0 : _3.paymentMethodId) === null || _4 === void 0 ? void 0 : _4.$eq;
121
125
  if (typeof objectObjectPaymentMethodIdEq === 'string') {
122
126
  andConditions.push({
123
127
  'object.object.paymentMethodId': {
@@ -126,7 +130,7 @@ class MongoRepository {
126
130
  }
127
131
  });
128
132
  }
129
- const objectReservationForIdEq = (_5 = (_4 = (_3 = params.object) === null || _3 === void 0 ? void 0 : _3.reservationFor) === null || _4 === void 0 ? void 0 : _4.id) === null || _5 === void 0 ? void 0 : _5.$eq;
133
+ const objectReservationForIdEq = (_7 = (_6 = (_5 = params.object) === null || _5 === void 0 ? void 0 : _5.reservationFor) === null || _6 === void 0 ? void 0 : _6.id) === null || _7 === void 0 ? void 0 : _7.$eq;
130
134
  // tslint:disable-next-line:no-single-line-block-comment
131
135
  /* istanbul ignore else */
132
136
  if (typeof objectReservationForIdEq === 'string') {
@@ -137,7 +141,7 @@ class MongoRepository {
137
141
  }
138
142
  });
139
143
  }
140
- const objectReservationNumberEq = (_7 = (_6 = params.object) === null || _6 === void 0 ? void 0 : _6.reservationNumber) === null || _7 === void 0 ? void 0 : _7.$eq;
144
+ const objectReservationNumberEq = (_9 = (_8 = params.object) === null || _8 === void 0 ? void 0 : _8.reservationNumber) === null || _9 === void 0 ? void 0 : _9.$eq;
141
145
  if (typeof objectReservationNumberEq === 'string') {
142
146
  andConditions.push({
143
147
  'object.reservationNumber': {
@@ -146,7 +150,7 @@ class MongoRepository {
146
150
  }
147
151
  });
148
152
  }
149
- const objectReservationNumberIn = (_9 = (_8 = params.object) === null || _8 === void 0 ? void 0 : _8.reservationNumber) === null || _9 === void 0 ? void 0 : _9.$in;
153
+ const objectReservationNumberIn = (_11 = (_10 = params.object) === null || _10 === void 0 ? void 0 : _10.reservationNumber) === null || _11 === void 0 ? void 0 : _11.$in;
150
154
  if (Array.isArray(objectReservationNumberIn)) {
151
155
  andConditions.push({
152
156
  'object.reservationNumber': {
@@ -155,7 +159,7 @@ class MongoRepository {
155
159
  }
156
160
  });
157
161
  }
158
- const objectPaymentMethodAccountIdEq = (_12 = (_11 = (_10 = params.object) === null || _10 === void 0 ? void 0 : _10.paymentMethod) === null || _11 === void 0 ? void 0 : _11.accountId) === null || _12 === void 0 ? void 0 : _12.$eq;
162
+ const objectPaymentMethodAccountIdEq = (_14 = (_13 = (_12 = params.object) === null || _12 === void 0 ? void 0 : _12.paymentMethod) === null || _13 === void 0 ? void 0 : _13.accountId) === null || _14 === void 0 ? void 0 : _14.$eq;
159
163
  // tslint:disable-next-line:no-single-line-block-comment
160
164
  /* istanbul ignore else */
161
165
  if (typeof objectPaymentMethodAccountIdEq === 'string') {
@@ -166,7 +170,7 @@ class MongoRepository {
166
170
  }
167
171
  });
168
172
  }
169
- const objectPaymentMethodPaymentMethodIdEq = (_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.$eq;
173
+ const objectPaymentMethodPaymentMethodIdEq = (_17 = (_16 = (_15 = params.object) === null || _15 === void 0 ? void 0 : _15.paymentMethod) === null || _16 === void 0 ? void 0 : _16.paymentMethodId) === null || _17 === void 0 ? void 0 : _17.$eq;
170
174
  // tslint:disable-next-line:no-single-line-block-comment
171
175
  /* istanbul ignore else */
172
176
  if (typeof objectPaymentMethodPaymentMethodIdEq === 'string') {
@@ -177,7 +181,7 @@ class MongoRepository {
177
181
  }
178
182
  });
179
183
  }
180
- const objectPaymentMethodPaymentMethodIdIn = (_18 = (_17 = (_16 = params.object) === null || _16 === void 0 ? void 0 : _16.paymentMethod) === null || _17 === void 0 ? void 0 : _17.paymentMethodId) === null || _18 === void 0 ? void 0 : _18.$in;
184
+ const objectPaymentMethodPaymentMethodIdIn = (_20 = (_19 = (_18 = params.object) === null || _18 === void 0 ? void 0 : _18.paymentMethod) === null || _19 === void 0 ? void 0 : _19.paymentMethodId) === null || _20 === void 0 ? void 0 : _20.$in;
181
185
  if (Array.isArray(objectPaymentMethodPaymentMethodIdIn)) {
182
186
  andConditions.push({
183
187
  'object.paymentMethod.paymentMethodId': {
@@ -186,7 +190,7 @@ class MongoRepository {
186
190
  }
187
191
  });
188
192
  }
189
- const objectPaymentMethodTypeOfEq = (_21 = (_20 = (_19 = params.object) === null || _19 === void 0 ? void 0 : _19.paymentMethod) === null || _20 === void 0 ? void 0 : _20.typeOf) === null || _21 === void 0 ? void 0 : _21.$eq;
193
+ const objectPaymentMethodTypeOfEq = (_23 = (_22 = (_21 = params.object) === null || _21 === void 0 ? void 0 : _21.paymentMethod) === null || _22 === void 0 ? void 0 : _22.typeOf) === null || _23 === void 0 ? void 0 : _23.$eq;
190
194
  // tslint:disable-next-line:no-single-line-block-comment
191
195
  /* istanbul ignore else */
192
196
  if (typeof objectPaymentMethodTypeOfEq === 'string') {
@@ -197,7 +201,7 @@ class MongoRepository {
197
201
  }
198
202
  });
199
203
  }
200
- const objectTypeOfEq = (_23 = (_22 = params.object) === null || _22 === void 0 ? void 0 : _22.typeOf) === null || _23 === void 0 ? void 0 : _23.$eq;
204
+ const objectTypeOfEq = (_25 = (_24 = params.object) === null || _24 === void 0 ? void 0 : _24.typeOf) === null || _25 === void 0 ? void 0 : _25.$eq;
201
205
  // tslint:disable-next-line:no-single-line-block-comment
202
206
  /* istanbul ignore else */
203
207
  if (typeof objectTypeOfEq === 'string') {
@@ -208,7 +212,7 @@ class MongoRepository {
208
212
  }
209
213
  });
210
214
  }
211
- const objectTypeOfIn = (_25 = (_24 = params.object) === null || _24 === void 0 ? void 0 : _24.typeOf) === null || _25 === void 0 ? void 0 : _25.$in;
215
+ const objectTypeOfIn = (_27 = (_26 = params.object) === null || _26 === void 0 ? void 0 : _26.typeOf) === null || _27 === void 0 ? void 0 : _27.$in;
212
216
  if (Array.isArray(objectTypeOfIn)) {
213
217
  andConditions.push({
214
218
  'object.typeOf': {
@@ -217,7 +221,7 @@ class MongoRepository {
217
221
  }
218
222
  });
219
223
  }
220
- const objectIdEq = (_27 = (_26 = params.object) === null || _26 === void 0 ? void 0 : _26.id) === null || _27 === void 0 ? void 0 : _27.$eq;
224
+ const objectIdEq = (_29 = (_28 = params.object) === null || _28 === void 0 ? void 0 : _28.id) === null || _29 === void 0 ? void 0 : _29.$eq;
221
225
  // tslint:disable-next-line:no-single-line-block-comment
222
226
  /* istanbul ignore else */
223
227
  if (typeof objectIdEq === 'string') {
@@ -228,7 +232,7 @@ class MongoRepository {
228
232
  }
229
233
  });
230
234
  }
231
- const objectIdIn = (_29 = (_28 = params.object) === null || _28 === void 0 ? void 0 : _28.id) === null || _29 === void 0 ? void 0 : _29.$in;
235
+ const objectIdIn = (_31 = (_30 = params.object) === null || _30 === void 0 ? void 0 : _30.id) === null || _31 === void 0 ? void 0 : _31.$in;
232
236
  if (Array.isArray(objectIdIn)) {
233
237
  andConditions.push({
234
238
  'object.id': {
@@ -237,7 +241,7 @@ class MongoRepository {
237
241
  }
238
242
  });
239
243
  }
240
- const objectOrderNumberIn = (_31 = (_30 = params.object) === null || _30 === void 0 ? void 0 : _30.orderNumber) === null || _31 === void 0 ? void 0 : _31.$in;
244
+ const objectOrderNumberIn = (_33 = (_32 = params.object) === null || _32 === void 0 ? void 0 : _32.orderNumber) === null || _33 === void 0 ? void 0 : _33.$in;
241
245
  if (Array.isArray(objectOrderNumberIn)) {
242
246
  andConditions.push({
243
247
  'object.orderNumber': {
@@ -246,7 +250,7 @@ class MongoRepository {
246
250
  }
247
251
  });
248
252
  }
249
- const objectEventIdIn = (_34 = (_33 = (_32 = params.object) === null || _32 === void 0 ? void 0 : _32.event) === null || _33 === void 0 ? void 0 : _33.id) === null || _34 === void 0 ? void 0 : _34.$in;
253
+ const objectEventIdIn = (_36 = (_35 = (_34 = params.object) === null || _34 === void 0 ? void 0 : _34.event) === null || _35 === void 0 ? void 0 : _35.id) === null || _36 === void 0 ? void 0 : _36.$in;
250
254
  if (Array.isArray(objectEventIdIn)) {
251
255
  andConditions.push({
252
256
  'object.event.id': {
@@ -255,7 +259,7 @@ class MongoRepository {
255
259
  }
256
260
  });
257
261
  }
258
- const objectAcceptedOfferSeatNumberIn = (_41 = (_40 = (_39 = (_38 = (_37 = (_36 = (_35 = params.object) === null || _35 === void 0 ? void 0 : _35.acceptedOffer) === null || _36 === void 0 ? void 0 : _36.itemOffered) === null || _37 === void 0 ? void 0 : _37.serviceOutput) === null || _38 === void 0 ? void 0 : _38.reservedTicket) === null || _39 === void 0 ? void 0 : _39.ticketedSeat) === null || _40 === void 0 ? void 0 : _40.seatNumber) === null || _41 === void 0 ? void 0 : _41.$in;
262
+ const objectAcceptedOfferSeatNumberIn = (_43 = (_42 = (_41 = (_40 = (_39 = (_38 = (_37 = params.object) === null || _37 === void 0 ? void 0 : _37.acceptedOffer) === null || _38 === void 0 ? void 0 : _38.itemOffered) === null || _39 === void 0 ? void 0 : _39.serviceOutput) === null || _40 === void 0 ? void 0 : _40.reservedTicket) === null || _41 === void 0 ? void 0 : _41.ticketedSeat) === null || _42 === void 0 ? void 0 : _42.seatNumber) === null || _43 === void 0 ? void 0 : _43.$in;
259
263
  if (Array.isArray(objectAcceptedOfferSeatNumberIn)) {
260
264
  andConditions.push({
261
265
  'object.acceptedOffer.itemOffered.serviceOutput.reservedTicket.ticketedSeat.seatNumber': {
@@ -264,6 +268,10 @@ class MongoRepository {
264
268
  }
265
269
  });
266
270
  }
271
+ const objectTransactionNumberEq = (_45 = (_44 = params.object) === null || _44 === void 0 ? void 0 : _44.transactionNumber) === null || _45 === void 0 ? void 0 : _45.$eq;
272
+ if (typeof objectTransactionNumberEq === 'string') {
273
+ andConditions.push({ 'object.transactionNumber': { $exists: true, $eq: objectTransactionNumberEq } });
274
+ }
267
275
  // tslint:disable-next-line:no-single-line-block-comment
268
276
  /* istanbul ignore else */
269
277
  if (typeof params.typeOf === 'string') {
@@ -272,7 +280,7 @@ class MongoRepository {
272
280
  });
273
281
  }
274
282
  else {
275
- const typeOfEq = (_42 = params.typeOf) === null || _42 === void 0 ? void 0 : _42.$eq;
283
+ const typeOfEq = (_46 = params.typeOf) === null || _46 === void 0 ? void 0 : _46.$eq;
276
284
  // tslint:disable-next-line:no-single-line-block-comment
277
285
  /* istanbul ignore else */
278
286
  if (typeof typeOfEq === 'string') {
@@ -281,7 +289,7 @@ class MongoRepository {
281
289
  });
282
290
  }
283
291
  }
284
- const actionStatusIn = (_43 = params.actionStatus) === null || _43 === void 0 ? void 0 : _43.$in;
292
+ const actionStatusIn = (_47 = params.actionStatus) === null || _47 === void 0 ? void 0 : _47.$in;
285
293
  // tslint:disable-next-line:no-single-line-block-comment
286
294
  /* istanbul ignore else */
287
295
  if (Array.isArray(actionStatusIn)) {
@@ -312,7 +320,7 @@ class MongoRepository {
312
320
  startDate: { $lte: startDateLte }
313
321
  });
314
322
  }
315
- const fromLocationTypeOfIn = (_45 = (_44 = params.fromLocation) === null || _44 === void 0 ? void 0 : _44.typeOf) === null || _45 === void 0 ? void 0 : _45.$in;
323
+ const fromLocationTypeOfIn = (_49 = (_48 = params.fromLocation) === null || _48 === void 0 ? void 0 : _48.typeOf) === null || _49 === void 0 ? void 0 : _49.$in;
316
324
  if (Array.isArray(fromLocationTypeOfIn)) {
317
325
  andConditions.push({
318
326
  'fromLocation.typeOf': {
@@ -321,7 +329,7 @@ class MongoRepository {
321
329
  }
322
330
  });
323
331
  }
324
- const fromLocationAccountNumberIn = (_47 = (_46 = params.fromLocation) === null || _46 === void 0 ? void 0 : _46.accountNumber) === null || _47 === void 0 ? void 0 : _47.$in;
332
+ const fromLocationAccountNumberIn = (_51 = (_50 = params.fromLocation) === null || _50 === void 0 ? void 0 : _50.accountNumber) === null || _51 === void 0 ? void 0 : _51.$in;
325
333
  if (Array.isArray(fromLocationAccountNumberIn)) {
326
334
  andConditions.push({
327
335
  'fromLocation.accountNumber': {
@@ -330,7 +338,7 @@ class MongoRepository {
330
338
  }
331
339
  });
332
340
  }
333
- const fromLocationAccountTypeIn = (_49 = (_48 = params.fromLocation) === null || _48 === void 0 ? void 0 : _48.accountType) === null || _49 === void 0 ? void 0 : _49.$in;
341
+ const fromLocationAccountTypeIn = (_53 = (_52 = params.fromLocation) === null || _52 === void 0 ? void 0 : _52.accountType) === null || _53 === void 0 ? void 0 : _53.$in;
334
342
  if (Array.isArray(fromLocationAccountTypeIn)) {
335
343
  andConditions.push({
336
344
  'fromLocation.accountType': {
@@ -339,7 +347,7 @@ class MongoRepository {
339
347
  }
340
348
  });
341
349
  }
342
- const toLocationTypeOfIn = (_51 = (_50 = params.toLocation) === null || _50 === void 0 ? void 0 : _50.typeOf) === null || _51 === void 0 ? void 0 : _51.$in;
350
+ const toLocationTypeOfIn = (_55 = (_54 = params.toLocation) === null || _54 === void 0 ? void 0 : _54.typeOf) === null || _55 === void 0 ? void 0 : _55.$in;
343
351
  if (Array.isArray(toLocationTypeOfIn)) {
344
352
  andConditions.push({
345
353
  'toLocation.typeOf': {
@@ -348,7 +356,7 @@ class MongoRepository {
348
356
  }
349
357
  });
350
358
  }
351
- const toLocationAccountNumberIn = (_53 = (_52 = params.toLocation) === null || _52 === void 0 ? void 0 : _52.accountNumber) === null || _53 === void 0 ? void 0 : _53.$in;
359
+ const toLocationAccountNumberIn = (_57 = (_56 = params.toLocation) === null || _56 === void 0 ? void 0 : _56.accountNumber) === null || _57 === void 0 ? void 0 : _57.$in;
352
360
  if (Array.isArray(toLocationAccountNumberIn)) {
353
361
  andConditions.push({
354
362
  'toLocation.accountNumber': {
@@ -357,7 +365,7 @@ class MongoRepository {
357
365
  }
358
366
  });
359
367
  }
360
- const toLocationAccountTypeIn = (_55 = (_54 = params.toLocation) === null || _54 === void 0 ? void 0 : _54.accountType) === null || _55 === void 0 ? void 0 : _55.$in;
368
+ const toLocationAccountTypeIn = (_59 = (_58 = params.toLocation) === null || _58 === void 0 ? void 0 : _58.accountType) === null || _59 === void 0 ? void 0 : _59.$in;
361
369
  if (Array.isArray(toLocationAccountTypeIn)) {
362
370
  andConditions.push({
363
371
  'toLocation.accountType': {
@@ -366,7 +374,7 @@ class MongoRepository {
366
374
  }
367
375
  });
368
376
  }
369
- const purposeTypeOfIn = (_57 = (_56 = params.purpose) === null || _56 === void 0 ? void 0 : _56.typeOf) === null || _57 === void 0 ? void 0 : _57.$in;
377
+ const purposeTypeOfIn = (_61 = (_60 = params.purpose) === null || _60 === void 0 ? void 0 : _60.typeOf) === null || _61 === void 0 ? void 0 : _61.$in;
370
378
  if (Array.isArray(purposeTypeOfIn)) {
371
379
  andConditions.push({
372
380
  'purpose.typeOf': {
@@ -375,7 +383,7 @@ class MongoRepository {
375
383
  }
376
384
  });
377
385
  }
378
- const purposeIdIn = (_59 = (_58 = params.purpose) === null || _58 === void 0 ? void 0 : _58.id) === null || _59 === void 0 ? void 0 : _59.$in;
386
+ const purposeIdIn = (_63 = (_62 = params.purpose) === null || _62 === void 0 ? void 0 : _62.id) === null || _63 === void 0 ? void 0 : _63.$in;
379
387
  if (Array.isArray(purposeIdIn)) {
380
388
  andConditions.push({
381
389
  'purpose.id': {
@@ -384,7 +392,7 @@ class MongoRepository {
384
392
  }
385
393
  });
386
394
  }
387
- const purposeOrderNumberIn = (_61 = (_60 = params.purpose) === null || _60 === void 0 ? void 0 : _60.orderNumber) === null || _61 === void 0 ? void 0 : _61.$in;
395
+ const purposeOrderNumberIn = (_65 = (_64 = params.purpose) === null || _64 === void 0 ? void 0 : _64.orderNumber) === null || _65 === void 0 ? void 0 : _65.$in;
388
396
  if (Array.isArray(purposeOrderNumberIn)) {
389
397
  andConditions.push({
390
398
  'purpose.orderNumber': {
@@ -393,7 +401,7 @@ class MongoRepository {
393
401
  }
394
402
  });
395
403
  }
396
- const resultTypeOfIn = (_63 = (_62 = params.result) === null || _62 === void 0 ? void 0 : _62.typeOf) === null || _63 === void 0 ? void 0 : _63.$in;
404
+ const resultTypeOfIn = (_67 = (_66 = params.result) === null || _66 === void 0 ? void 0 : _66.typeOf) === null || _67 === void 0 ? void 0 : _67.$in;
397
405
  if (Array.isArray(resultTypeOfIn)) {
398
406
  andConditions.push({
399
407
  'result.typeOf': {
@@ -402,7 +410,7 @@ class MongoRepository {
402
410
  }
403
411
  });
404
412
  }
405
- const resultIdIn = (_65 = (_64 = params.result) === null || _64 === void 0 ? void 0 : _64.id) === null || _65 === void 0 ? void 0 : _65.$in;
413
+ const resultIdIn = (_69 = (_68 = params.result) === null || _68 === void 0 ? void 0 : _68.id) === null || _69 === void 0 ? void 0 : _69.$in;
406
414
  if (Array.isArray(resultIdIn)) {
407
415
  andConditions.push({
408
416
  'result.id': {
@@ -411,7 +419,7 @@ class MongoRepository {
411
419
  }
412
420
  });
413
421
  }
414
- const resultOrderNumberIn = (_67 = (_66 = params.result) === null || _66 === void 0 ? void 0 : _66.orderNumber) === null || _67 === void 0 ? void 0 : _67.$in;
422
+ const resultOrderNumberIn = (_71 = (_70 = params.result) === null || _70 === void 0 ? void 0 : _70.orderNumber) === null || _71 === void 0 ? void 0 : _71.$in;
415
423
  if (Array.isArray(resultOrderNumberIn)) {
416
424
  andConditions.push({
417
425
  'result.orderNumber': {
@@ -420,7 +428,7 @@ class MongoRepository {
420
428
  }
421
429
  });
422
430
  }
423
- const resultCodeIn = (_69 = (_68 = params.result) === null || _68 === void 0 ? void 0 : _68.code) === null || _69 === void 0 ? void 0 : _69.$in;
431
+ const resultCodeIn = (_73 = (_72 = params.result) === null || _72 === void 0 ? void 0 : _72.code) === null || _73 === void 0 ? void 0 : _73.$in;
424
432
  if (Array.isArray(resultCodeIn)) {
425
433
  andConditions.push({
426
434
  'result.code': {
@@ -12,18 +12,16 @@ export interface IAggregateReservation {
12
12
  typeOf: factory.eventType;
13
13
  startDate: Date;
14
14
  };
15
- aggregateEntranceGate?: factory.event.screeningEvent.IAggregateEntranceGate;
16
- aggregateReservation?: factory.event.screeningEvent.IAggregateReservation;
17
- aggregateOffer?: factory.event.screeningEvent.IAggregateOffer;
15
+ aggregateEntranceGate?: factory.event.event.IAggregateEntranceGate;
16
+ aggregateOffer?: factory.event.event.IAggregateOffer;
18
17
  }
19
18
  export interface IUpdateAggregateReservationParams {
20
19
  $set: {
21
- aggregateReservation?: factory.event.screeningEvent.IAggregateReservation;
22
- aggregateOffer?: factory.event.screeningEvent.IAggregateOffer;
23
- aggregateEntranceGate?: factory.event.screeningEvent.IAggregateEntranceGate;
20
+ aggregateOffer?: factory.event.event.IAggregateOffer;
21
+ aggregateEntranceGate?: factory.event.event.IAggregateEntranceGate;
24
22
  };
25
23
  }
26
- type ISearchWithReservationForIdResult = Pick<IAggregateReservation, 'aggregateEntranceGate' | 'aggregateOffer' | 'aggregateReservation'> & {
24
+ type ISearchWithReservationForIdResult = Pick<IAggregateReservation, 'aggregateEntranceGate' | 'aggregateOffer'> & {
27
25
  /**
28
26
  * イベントID
29
27
  */
@@ -61,7 +59,7 @@ export declare class MongoRepository {
61
59
  /**
62
60
  * 予約集計を検索する
63
61
  */
64
- searchWithReservationForId(params: ISearchConditions, inclusion: ('aggregateEntranceGate' | 'aggregateOffer' | 'aggregateReservation')[]): Promise<ISearchWithReservationForIdResult[]>;
62
+ searchWithReservationForId(params: ISearchConditions, inclusion: ('aggregateEntranceGate' | 'aggregateOffer')[]): Promise<ISearchWithReservationForIdResult[]>;
65
63
  /**
66
64
  * 予約集計を保管する
67
65
  */
@@ -82,8 +82,7 @@ class MongoRepository {
82
82
  _id: 0,
83
83
  id: '$reservationFor.id',
84
84
  aggregateEntranceGate: 1,
85
- aggregateOffer: 1,
86
- aggregateReservation: 1
85
+ aggregateOffer: 1
87
86
  };
88
87
  }
89
88
  const sortByStartDate = (_a = params.sort) === null || _a === void 0 ? void 0 : _a['reservationFor.startDate'];
@@ -33,8 +33,8 @@ export interface IAttributes4patchUpdate<T extends factory.eventType> {
33
33
  export interface IUpdateAggregateReservationParams {
34
34
  $set: {
35
35
  updatedAt: Date;
36
- aggregateReservation: factory.event.screeningEvent.IAggregateReservation;
37
- aggregateOffer?: Pick<factory.event.screeningEvent.IAggregateOffer, 'aggregateDate' | 'offerCount' | 'typeOf'>;
36
+ aggregateReservation: factory.event.event.IAggregateReservation;
37
+ aggregateOffer?: Pick<factory.event.event.IAggregateOffer, 'aggregateDate' | 'offerCount' | 'typeOf'>;
38
38
  maximumAttendeeCapacity?: number;
39
39
  remainingAttendeeCapacity?: number;
40
40
  checkInCount?: number;
@@ -68,7 +68,7 @@ interface IStatus {
68
68
  interface IAggregateEvent {
69
69
  statuses: IStatus[];
70
70
  }
71
- type IKeyOfProjection<T extends factory.eventType> = keyof factory.event.IEvent<T> | '_id' | '__v' | 'createdAt' | 'updatedAt';
71
+ type IKeyOfProjection<T extends factory.eventType> = keyof factory.event.IEvent<T> | '_id' | '__v' | 'createdAt' | 'updatedAt' | 'aggregateEntranceGate' | 'aggregateOffer';
72
72
  type IUnset<T extends factory.eventType> = {
73
73
  [key in keyof factory.event.IEvent<T>]?: 1;
74
74
  };
@@ -387,6 +387,24 @@ const indexes = [
387
387
  'instrument.transactionNumber': { $exists: true }
388
388
  }
389
389
  }
390
+ ],
391
+ [
392
+ { 'instrument.typeOf': 1, startDate: -1 },
393
+ {
394
+ name: 'searchByInstrumentTypeOf',
395
+ partialFilterExpression: {
396
+ 'instrument.typeOf': { $exists: true }
397
+ }
398
+ }
399
+ ],
400
+ [
401
+ { 'object.transactionNumber': 1, startDate: -1 },
402
+ {
403
+ name: 'searchByObjectTransactionNumber',
404
+ partialFilterExpression: {
405
+ 'object.transactionNumber': { $exists: true }
406
+ }
407
+ }
390
408
  ]
391
409
  ];
392
410
  exports.indexes = indexes;
@@ -11,7 +11,6 @@ const schemaDefinition = {
11
11
  typeOf: { type: String, required: true },
12
12
  reservationFor: { type: mongoose_1.SchemaTypes.Mixed, required: true },
13
13
  aggregateEntranceGate: mongoose_1.SchemaTypes.Mixed,
14
- aggregateReservation: mongoose_1.SchemaTypes.Mixed,
15
14
  aggregateOffer: mongoose_1.SchemaTypes.Mixed
16
15
  };
17
16
  const schemaOptions = {
@@ -46,7 +46,7 @@ const schemaDefinition = {
46
46
  remainingAttendeeCapacity: { type: Number },
47
47
  checkInCount: { type: Number },
48
48
  attendeeCount: { type: Number },
49
- aggregateEntranceGate: mongoose_1.SchemaTypes.Mixed,
49
+ // aggregateEntranceGate: SchemaTypes.Mixed, // 廃止(2024-03-29~)
50
50
  aggregateReservation: mongoose_1.SchemaTypes.Mixed,
51
51
  aggregateOffer: mongoose_1.SchemaTypes.Mixed,
52
52
  coaInfo: mongoose_1.SchemaTypes.Mixed
@@ -1,4 +1,3 @@
1
- import type { MongoRepository as AggregateReservationRepo } from '../../../repo/aggregateReservation';
2
1
  import { IMinimizedIndividualEvent, MongoRepository as EventRepo } from '../../../repo/event';
3
2
  import type { MongoRepository as OfferRepo } from '../../../repo/offer';
4
3
  import type { MongoRepository as OfferCatalogRepo } from '../../../repo/offerCatalog';
@@ -9,8 +8,7 @@ import type { MongoRepository as ReservationRepo } from '../../../repo/reservati
9
8
  import type { StockHolderRepository as StockHolderRepo } from '../../../repo/stockHolder';
10
9
  import type { MongoRepository as TaskRepo } from '../../../repo/task';
11
10
  import * as factory from '../../../factory';
12
- export type IAggregateScreeningEventOperation<T> = (repos: {
13
- aggregateReservation: AggregateReservationRepo;
11
+ export interface IAggregateScreeningEventRepos {
14
12
  event: EventRepo;
15
13
  stockHolder: StockHolderRepo;
16
14
  offer: OfferRepo;
@@ -20,7 +18,8 @@ export type IAggregateScreeningEventOperation<T> = (repos: {
20
18
  product: ProductRepo;
21
19
  reservation: ReservationRepo;
22
20
  task: TaskRepo;
23
- }) => Promise<T>;
21
+ }
22
+ export type IAggregateScreeningEventOperation<T> = (repos: IAggregateScreeningEventRepos) => Promise<T>;
24
23
  /**
25
24
  * イベントデータをID指定で集計する
26
25
  */
@@ -11,7 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.aggregateByEvent = exports.aggregateScreeningEvent = void 0;
13
13
  /**
14
- * イベント集計サービス
14
+ * イベントの予約集計サービス
15
15
  */
16
16
  const createDebug = require("debug");
17
17
  const moment = require("moment-timezone");
@@ -122,18 +122,6 @@ function aggregateByEvent(params) {
122
122
  debug('update:', update);
123
123
  // 保管
124
124
  yield repos.event.updateAggregationById({ id: event.id }, update);
125
- if (settings_1.settings.useAggregateOfferProjects.includes(params.event.project.id)) {
126
- // aggregateReservationsにも保管(2024-03-25~)
127
- yield repos.aggregateReservation.save({
128
- project: event.project,
129
- reservationFor: {
130
- id: event.id,
131
- typeOf: event.typeOf,
132
- startDate: moment(event.startDate)
133
- .toDate()
134
- }
135
- }, { $set: { aggregateReservation } });
136
- }
137
125
  yield onAggregated({ event })({
138
126
  task: repos.task
139
127
  });
@@ -40,16 +40,12 @@ function publishPaymentUrl(params, purposeAsTransaction) {
40
40
  // 決済サービス確認
41
41
  const paymentServiceId = getPaymentServiceId(params);
42
42
  // 決済受入アクション生成(2024-03-28~)
43
- const actionAttributes = Object.assign({ project: params.project, typeOf: 'AcceptAction', agent: params.agent, object: {
43
+ const actionAttributes = Object.assign({ project: params.project, typeOf: factory.actionType.AcceptAction, agent: params.agent, object: {
44
44
  object: params.object,
45
45
  transactionNumber,
46
46
  typeOf: params.typeOf
47
47
  } }, (typeof (purposeAsTransaction === null || purposeAsTransaction === void 0 ? void 0 : purposeAsTransaction.id) === 'string')
48
- ? {
49
- purpose: Object.assign({ typeOf: factory.transactionType.PlaceOrder }, {
50
- id: purposeAsTransaction.id
51
- })
52
- }
48
+ ? { purpose: { typeOf: factory.transactionType.PlaceOrder, id: purposeAsTransaction.id } }
53
49
  : undefined);
54
50
  const action = yield repos.action.start(actionAttributes);
55
51
  let result;
@@ -468,15 +468,24 @@ function createScreeningEventFromCOA(params) {
468
468
  typeOf: 'WebAPI',
469
469
  identifier: factory.service.webAPI.Identifier.COA
470
470
  },
471
- // 廃止(2023-08-07~)
472
- // priceCurrency: factory.priceCurrency.JPY,
471
+ eligibleQuantity: {
472
+ typeOf: 'QuantitativeValue',
473
+ unitCode: factory.unitCode.C62,
474
+ maxValue: Number(params.performanceFromCOA.availableNum)
475
+ },
473
476
  itemOffered: {
474
477
  serviceOutput: {
475
478
  reservedTicket: {
476
479
  typeOf: 'Ticket',
477
- ticketedSeat: { typeOf: factory.placeType.Seat }
480
+ ticketedSeat: { typeOf: factory.placeType.Seat } // 必ず指定席
478
481
  }
479
482
  }
483
+ },
484
+ seller: {
485
+ typeOf: factory.organizationType.Corporation,
486
+ id: params.seller.id,
487
+ // name: params.sellerFromDB.name,
488
+ makesOffer: []
480
489
  }
481
490
  };
482
491
  const { additionalProperty, coaInfo } = createScreeningEventAdditionalPropertyFromCOA(params);
@@ -11,7 +11,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.call = void 0;
13
13
  const factory = require("../../factory");
14
- const aggregateReservation_1 = require("../../repo/aggregateReservation");
15
14
  const event_1 = require("../../repo/event");
16
15
  const offer_1 = require("../../repo/offer");
17
16
  const offerCatalog_1 = require("../../repo/offerCatalog");
@@ -31,7 +30,6 @@ function call(data) {
31
30
  throw new factory.errors.Argument('settings', 'redisClient required');
32
31
  }
33
32
  yield AggregationService.event.aggregateScreeningEvent(data)({
34
- aggregateReservation: new aggregateReservation_1.MongoRepository(settings.connection),
35
33
  event: new event_1.MongoRepository(settings.connection),
36
34
  stockHolder: new stockHolder_1.StockHolderRepository(settings.redisClient, settings.connection),
37
35
  offer: new offer_1.MongoRepository(settings.connection),
package/package.json CHANGED
@@ -10,8 +10,8 @@
10
10
  ],
11
11
  "dependencies": {
12
12
  "@aws-sdk/credential-providers": "3.433.0",
13
- "@chevre/factory": "4.364.0-alpha.3",
14
- "@cinerino/sdk": "5.15.0-alpha.1",
13
+ "@chevre/factory": "4.364.0",
14
+ "@cinerino/sdk": "5.15.0",
15
15
  "@motionpicture/coa-service": "9.4.0",
16
16
  "@motionpicture/gmo-service": "5.3.0",
17
17
  "@sendgrid/mail": "6.4.0",
@@ -110,5 +110,5 @@
110
110
  "postversion": "git push origin --tags",
111
111
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
112
112
  },
113
- "version": "21.27.0-alpha.23"
113
+ "version": "21.27.0-alpha.25"
114
114
  }