@chevre/domain 24.1.0-alpha.31 → 24.1.0-alpha.33

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.
@@ -18,8 +18,8 @@ export declare class AcceptedOfferRepo extends AcceptedOfferInReserveRepo {
18
18
  /**
19
19
  * オファー展開の注文検索
20
20
  */
21
- searchWithUnwoundAcceptedOffers(params: factory.order.ISearchConditions, projection: IProjection4searchWithUnwoundAcceptedOffers, options: {
22
- useReserveTransaction: boolean;
21
+ searchWithUnwoundAcceptedOffers(params: factory.order.ISearchConditions, projection: IProjection4searchWithUnwoundAcceptedOffers, _options: {
22
+ useItemOfferedByReserve?: boolean;
23
23
  }): Promise<(factory.order.IOrder & {
24
24
  acceptedOffers: [IAcceptedOffer];
25
25
  _id?: never;
@@ -67,8 +67,8 @@ export declare class AcceptedOfferRepo extends AcceptedOfferInReserveRepo {
67
67
  };
68
68
  };
69
69
  };
70
- }, options: {
71
- useReserveTransaction: boolean;
70
+ }, _options: {
71
+ useItemOfferedByReserve?: boolean;
72
72
  }): Promise<IAcceptedOffer[]>;
73
73
  /**
74
74
  * 注文オファーをsliceして検索する(2024-01-10~)
@@ -83,8 +83,8 @@ export declare class AcceptedOfferRepo extends AcceptedOfferInReserveRepo {
83
83
  $eq: string;
84
84
  };
85
85
  };
86
- }, options: {
87
- useReserveTransaction: boolean;
86
+ }, _options: {
87
+ useItemOfferedByReserve?: boolean;
88
88
  }): Promise<ISearchSlicedAcceptedOffersResult>;
89
89
  countByOrderNumber(filter: {
90
90
  orderNumber: {
@@ -19,7 +19,7 @@ class AcceptedOfferRepo extends acceptedOfferInReserve_1.AcceptedOfferInReserveR
19
19
  /**
20
20
  * オファー展開の注文検索
21
21
  */
22
- async searchWithUnwoundAcceptedOffers(params, projection, options) {
22
+ async searchWithUnwoundAcceptedOffers(params, projection, _options) {
23
23
  const conditions = order_2.OrderRepo.CREATE_MONGO_CONDITIONS(params);
24
24
  const aggregate = this.orderModel.aggregate();
25
25
  // unwind->matchでは遅い
@@ -53,8 +53,7 @@ class AcceptedOfferRepo extends acceptedOfferInReserve_1.AcceptedOfferInReserveR
53
53
  .exec();
54
54
  // 予約取引を参照(2026-05-17~)
55
55
  const offeredThroughIdentifier = orders.at(0)?.acceptedOffers[0].offeredThrough?.identifier;
56
- const useReserveTransaction = options.useReserveTransaction === true
57
- && offeredThroughIdentifier !== factory_1.factory.service.webAPI.Identifier.COA; // COAでは予約取引を参照しない
56
+ const useReserveTransaction = offeredThroughIdentifier !== factory_1.factory.service.webAPI.Identifier.COA; // COAでは予約取引を参照しない
58
57
  if (useReserveTransaction) {
59
58
  const reservationNumbers = [...new Set(orders.map((order) => String(order.acceptedOffers[0].serialNumber)))];
60
59
  let acceptedOffersByReserveTransaction = [];
@@ -125,7 +124,7 @@ class AcceptedOfferRepo extends acceptedOfferInReserve_1.AcceptedOfferInReserveR
125
124
  */
126
125
  async searchAcceptedOffersByOrderNumber(filter,
127
126
  // inclusion?: (keyof IAcceptedOffer)[], // 分かりにくいので廃止(2026-05-17~)
128
- options) {
127
+ _options) {
129
128
  /**
130
129
  * unwind前に1ドキュメントを特定するためのstage
131
130
  */
@@ -220,18 +219,12 @@ class AcceptedOfferRepo extends acceptedOfferInReserve_1.AcceptedOfferInReserveR
220
219
  .option({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
221
220
  .exec();
222
221
  // 予約取引を参照(2026-05-18~)
223
- const useReserveTransaction = options?.useReserveTransaction === true;
224
- if (useReserveTransaction) {
225
- return this.addAcceptedOffersDetails(acceptedOffers);
226
- }
227
- else {
228
- return acceptedOffers;
229
- }
222
+ return this.addAcceptedOffersDetails(acceptedOffers);
230
223
  }
231
224
  /**
232
225
  * 注文オファーをsliceして検索する(2024-01-10~)
233
226
  */
234
- async searchSlicedAcceptedOffersByOrderNumber(filter, options) {
227
+ async searchSlicedAcceptedOffersByOrderNumber(filter, _options) {
235
228
  const aggregate = this.orderModel.aggregate([
236
229
  { $match: { orderNumber: { $eq: filter.orderNumber.$eq } } },
237
230
  { $match: { 'project.id': { $eq: filter.project.id.$eq } } },
@@ -252,16 +245,10 @@ class AcceptedOfferRepo extends acceptedOfferInReserve_1.AcceptedOfferInReserveR
252
245
  }
253
246
  const { acceptedOffers, numAcceptedOffers } = result;
254
247
  // 予約取引を参照(2026-05-18~)
255
- const useReserveTransaction = options?.useReserveTransaction === true;
256
- if (useReserveTransaction) {
257
- return {
258
- acceptedOffers: await this.addAcceptedOffersDetails(acceptedOffers),
259
- numAcceptedOffers
260
- };
261
- }
262
- else {
263
- return result;
264
- }
248
+ return {
249
+ acceptedOffers: await this.addAcceptedOffersDetails(acceptedOffers),
250
+ numAcceptedOffers
251
+ };
265
252
  }
266
253
  async countByOrderNumber(filter) {
267
254
  const aggregate = this.orderModel.aggregate([
@@ -1,3 +1,3 @@
1
1
  import type { FilterQuery } from 'mongoose';
2
2
  import { factory } from '../../../factory';
3
- export declare function CREATE_MONGO_CONDITIONS(params: factory.reservation.eventReservation.ISearchConditions): FilterQuery<import("@chevre/factory/lib/chevre/reservation/event").IReservation>[];
3
+ export declare function createMongoConditions(params: factory.reservation.eventReservation.ISearchConditions): FilterQuery<import("@chevre/factory/lib/chevre/reservation/event").IReservation>[];
@@ -1,11 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CREATE_MONGO_CONDITIONS = CREATE_MONGO_CONDITIONS;
4
- const factory_1 = require("../../../factory");
5
- function CREATE_MONGO_CONDITIONS(params) {
3
+ exports.createMongoConditions = createMongoConditions;
4
+ function createMongoConditions(params) {
6
5
  // MongoDB検索条件
7
6
  const andConditions = [
8
- { typeOf: { $eq: params.typeOf } }
7
+ // { typeOf: { $eq: params.typeOf } } // EventReservationしかコレクションに存在しない前提のため、不要(2026-05-24~)
9
8
  ];
10
9
  const projectIdEq = params.project?.id?.$eq;
11
10
  if (typeof projectIdEq === 'string') {
@@ -24,15 +23,15 @@ function CREATE_MONGO_CONDITIONS(params) {
24
23
  if (typeof params.id.$eq === 'string') {
25
24
  andConditions.push({ _id: { $eq: params.id.$eq } });
26
25
  }
27
- if (typeof params.id.$ne === 'string') {
28
- andConditions.push({ _id: { $ne: params.id.$ne } });
29
- }
26
+ // if (typeof params.id.$ne === 'string') {
27
+ // andConditions.push({ _id: { $ne: params.id.$ne } });
28
+ // }
30
29
  if (Array.isArray(params.id.$in)) {
31
30
  andConditions.push({ _id: { $in: params.id.$in } });
32
31
  }
33
- if (Array.isArray(params.id.$nin)) {
34
- andConditions.push({ _id: { $nin: params.id.$nin } });
35
- }
32
+ // if (Array.isArray(params.id.$nin)) {
33
+ // andConditions.push({ _id: { $nin: params.id.$nin } });
34
+ // }
36
35
  }
37
36
  /* istanbul ignore else */
38
37
  if (Array.isArray(params.reservationNumbers)) {
@@ -61,13 +60,13 @@ function CREATE_MONGO_CONDITIONS(params) {
61
60
  }
62
61
  });
63
62
  }
64
- if (typeof params.reservationNumber.$ne === 'string') {
65
- andConditions.push({
66
- reservationNumber: {
67
- $ne: params.reservationNumber.$ne
68
- }
69
- });
70
- }
63
+ // if (typeof params.reservationNumber.$ne === 'string') {
64
+ // andConditions.push({
65
+ // reservationNumber: {
66
+ // $ne: params.reservationNumber.$ne
67
+ // }
68
+ // });
69
+ // }
71
70
  if (Array.isArray(params.reservationNumber.$in)) {
72
71
  andConditions.push({
73
72
  reservationNumber: {
@@ -75,13 +74,13 @@ function CREATE_MONGO_CONDITIONS(params) {
75
74
  }
76
75
  });
77
76
  }
78
- if (Array.isArray(params.reservationNumber.$nin)) {
79
- andConditions.push({
80
- reservationNumber: {
81
- $nin: params.reservationNumber.$nin
82
- }
83
- });
84
- }
77
+ // if (Array.isArray(params.reservationNumber.$nin)) {
78
+ // andConditions.push({
79
+ // reservationNumber: {
80
+ // $nin: params.reservationNumber.$nin
81
+ // }
82
+ // });
83
+ // }
85
84
  }
86
85
  }
87
86
  /* istanbul ignore else */
@@ -105,13 +104,13 @@ function CREATE_MONGO_CONDITIONS(params) {
105
104
  }
106
105
  });
107
106
  }
108
- if (typeof params.additionalTicketText.$ne === 'string') {
109
- andConditions.push({
110
- additionalTicketText: {
111
- $ne: params.additionalTicketText.$ne
112
- }
113
- });
114
- }
107
+ // if (typeof params.additionalTicketText.$ne === 'string') {
108
+ // andConditions.push({
109
+ // additionalTicketText: {
110
+ // $ne: params.additionalTicketText.$ne
111
+ // }
112
+ // });
113
+ // }
115
114
  if (Array.isArray(params.additionalTicketText.$in)) {
116
115
  andConditions.push({
117
116
  additionalTicketText: {
@@ -120,21 +119,21 @@ function CREATE_MONGO_CONDITIONS(params) {
120
119
  }
121
120
  });
122
121
  }
123
- if (Array.isArray(params.additionalTicketText.$nin)) {
124
- andConditions.push({
125
- additionalTicketText: {
126
- $nin: params.additionalTicketText.$nin
127
- }
128
- });
129
- }
122
+ // if (Array.isArray(params.additionalTicketText.$nin)) {
123
+ // andConditions.push({
124
+ // additionalTicketText: {
125
+ // $nin: params.additionalTicketText.$nin
126
+ // }
127
+ // });
128
+ // }
130
129
  const additionalTicketTextRegex = params.additionalTicketText?.$regex;
131
130
  if (typeof additionalTicketTextRegex === 'string' && additionalTicketTextRegex.length > 0) {
132
- const additionalTicketTextOptions = params.additionalTicketText?.$options;
131
+ // const additionalTicketTextOptions = params.additionalTicketText?.$options;
133
132
  andConditions.push({
134
133
  additionalTicketText: {
135
134
  $exists: true,
136
135
  $regex: new RegExp(additionalTicketTextRegex),
137
- ...(typeof additionalTicketTextOptions === 'string') ? { $options: additionalTicketTextOptions } : undefined
136
+ // ...(typeof additionalTicketTextOptions === 'string') ? { $options: additionalTicketTextOptions } : undefined
138
137
  }
139
138
  });
140
139
  }
@@ -156,237 +155,186 @@ function CREATE_MONGO_CONDITIONS(params) {
156
155
  if (Array.isArray(params.reservationStatuses)) {
157
156
  andConditions.push({ reservationStatus: { $in: params.reservationStatuses } });
158
157
  }
159
- /* istanbul ignore else */
160
- if (params.modifiedFrom instanceof Date) {
158
+ // if (params.modifiedFrom instanceof Date) {
159
+ // andConditions.push({
160
+ // modifiedTime: { $gte: params.modifiedFrom }
161
+ // });
162
+ // }
163
+ // if (params.modifiedThrough instanceof Date) {
164
+ // andConditions.push({
165
+ // modifiedTime: { $lte: params.modifiedThrough }
166
+ // });
167
+ // }
168
+ if (params.bookingFrom instanceof Date) {
161
169
  andConditions.push({
162
- modifiedTime: { $gte: params.modifiedFrom }
170
+ bookingTime: { $gte: params.bookingFrom }
163
171
  });
164
172
  }
165
- /* istanbul ignore else */
166
- if (params.modifiedThrough instanceof Date) {
173
+ if (params.bookingThrough instanceof Date) {
167
174
  andConditions.push({
168
- modifiedTime: { $lte: params.modifiedThrough }
175
+ bookingTime: { $lte: params.bookingThrough }
169
176
  });
170
177
  }
171
- /* istanbul ignore else */
172
- if (params.bookingFrom instanceof Date) {
178
+ if (typeof params.reservationFor?.id === 'string') {
173
179
  andConditions.push({
174
- bookingTime: {
180
+ 'reservationFor.id': {
175
181
  $exists: true,
176
- $gte: params.bookingFrom
182
+ $eq: params.reservationFor.id
177
183
  }
178
184
  });
179
185
  }
180
- /* istanbul ignore else */
181
- if (params.bookingThrough instanceof Date) {
182
- andConditions.push({
183
- bookingTime: {
184
- $exists: true,
185
- $lte: params.bookingThrough
186
- }
187
- });
186
+ else {
187
+ const reservationForIdEq4eventReservation = params.reservationFor?.id?.$eq;
188
+ if (typeof reservationForIdEq4eventReservation === 'string') {
189
+ andConditions.push({
190
+ 'reservationFor.id': {
191
+ $exists: true,
192
+ $eq: reservationForIdEq4eventReservation
193
+ }
194
+ });
195
+ }
188
196
  }
189
- switch (params.typeOf) {
190
- // case factory.reservationType.BusReservation:
191
- // const reservationForTypeOfEq = params.reservationFor?.typeOf;
192
- // if (typeof reservationForTypeOfEq === 'string') {
193
- // andConditions.push(
194
- // {
195
- // 'reservationFor.typeOf': {
196
- // $exists: true,
197
- // $eq: reservationForTypeOfEq
198
- // }
199
- // }
200
- // );
201
- // }
202
- // const reservationForIdEq = params.reservationFor?.id?.$eq;
203
- // if (typeof reservationForIdEq === 'string') {
204
- // andConditions.push(
205
- // {
206
- // 'reservationFor.id': {
207
- // $exists: true,
208
- // $eq: reservationForIdEq
209
- // }
210
- // }
211
- // );
212
- // }
213
- // const reservationForIdIn = params.reservationFor?.id?.$in;
214
- // if (Array.isArray(reservationForIdIn)) {
215
- // andConditions.push(
216
- // {
217
- // 'reservationFor.id': {
218
- // $exists: true,
219
- // $in: reservationForIdIn
220
- // }
197
+ /* istanbul ignore else */
198
+ if (params.reservationFor !== undefined) {
199
+ // if (params.reservationFor.typeOf !== undefined) {
200
+ // andConditions.push(
201
+ // {
202
+ // 'reservationFor.typeOf': {
203
+ // $exists: true,
204
+ // $eq: params.reservationFor.typeOf
221
205
  // }
222
- // );
223
- // }
224
- // break;
225
- case factory_1.factory.reservationType.EventReservation:
226
- if (typeof params.reservationFor?.id === 'string') {
206
+ // }
207
+ // );
208
+ // }
209
+ /* istanbul ignore else */
210
+ if (Array.isArray(params.reservationFor.ids)) {
211
+ andConditions.push({
212
+ 'reservationFor.id': {
213
+ $exists: true,
214
+ $in: params.reservationFor.ids
215
+ }
216
+ });
217
+ }
218
+ /* istanbul ignore else */
219
+ if (params.reservationFor.location !== undefined) {
220
+ /* istanbul ignore else */
221
+ if (Array.isArray(params.reservationFor.location.ids)) {
227
222
  andConditions.push({
228
- 'reservationFor.id': {
223
+ 'reservationFor.location.id': {
229
224
  $exists: true,
230
- $eq: params.reservationFor.id
225
+ $in: params.reservationFor.location.ids
231
226
  }
232
227
  });
233
228
  }
234
- else {
235
- const reservationForIdEq4eventReservation = params.reservationFor?.id?.$eq;
236
- if (typeof reservationForIdEq4eventReservation === 'string') {
237
- andConditions.push({
238
- 'reservationFor.id': {
239
- $exists: true,
240
- $eq: reservationForIdEq4eventReservation
241
- }
242
- });
243
- }
244
- }
245
229
  /* istanbul ignore else */
246
- if (params.reservationFor !== undefined) {
247
- /* istanbul ignore else */
248
- if (params.reservationFor.typeOf !== undefined) {
249
- andConditions.push({
250
- 'reservationFor.typeOf': {
251
- $exists: true,
252
- $eq: params.reservationFor.typeOf
253
- }
254
- });
230
+ if (Array.isArray(params.reservationFor.location.branchCodes)) {
231
+ andConditions.push({
232
+ 'reservationFor.location.branchCode': {
233
+ $exists: true,
234
+ $in: params.reservationFor.location.branchCodes
235
+ }
236
+ });
237
+ }
238
+ }
239
+ /* istanbul ignore else */
240
+ if (params.reservationFor.startFrom instanceof Date) {
241
+ andConditions.push({
242
+ 'reservationFor.startDate': {
243
+ $exists: true,
244
+ $gte: params.reservationFor.startFrom
255
245
  }
256
- /* istanbul ignore else */
257
- if (Array.isArray(params.reservationFor.ids)) {
258
- andConditions.push({
259
- 'reservationFor.id': {
260
- $exists: true,
261
- $in: params.reservationFor.ids
262
- }
263
- });
246
+ });
247
+ }
248
+ /* istanbul ignore else */
249
+ if (params.reservationFor.startThrough instanceof Date) {
250
+ andConditions.push({
251
+ 'reservationFor.startDate': {
252
+ $exists: true,
253
+ $lte: params.reservationFor.startThrough
264
254
  }
265
- /* istanbul ignore else */
266
- if (params.reservationFor.location !== undefined) {
267
- /* istanbul ignore else */
268
- if (Array.isArray(params.reservationFor.location.ids)) {
269
- andConditions.push({
270
- 'reservationFor.location.id': {
271
- $exists: true,
272
- $in: params.reservationFor.location.ids
273
- }
274
- });
255
+ });
256
+ }
257
+ /* istanbul ignore else */
258
+ if (params.reservationFor.endFrom instanceof Date) {
259
+ andConditions.push({
260
+ 'reservationFor.endDate': {
261
+ $exists: true,
262
+ $gte: params.reservationFor.endFrom
263
+ }
264
+ });
265
+ }
266
+ /* istanbul ignore else */
267
+ if (params.reservationFor.endThrough instanceof Date) {
268
+ andConditions.push({
269
+ 'reservationFor.endDate': {
270
+ $exists: true,
271
+ $lte: params.reservationFor.endThrough
272
+ }
273
+ });
274
+ }
275
+ /* istanbul ignore else */
276
+ if (params.reservationFor.superEvent !== undefined) {
277
+ /* istanbul ignore else */
278
+ if (params.reservationFor.superEvent.id !== undefined) {
279
+ andConditions.push({
280
+ 'reservationFor.superEvent.id': {
281
+ $exists: true,
282
+ $eq: params.reservationFor.superEvent.id
275
283
  }
276
- /* istanbul ignore else */
277
- if (Array.isArray(params.reservationFor.location.branchCodes)) {
278
- andConditions.push({
279
- 'reservationFor.location.branchCode': {
280
- $exists: true,
281
- $in: params.reservationFor.location.branchCodes
282
- }
283
- });
284
+ });
285
+ }
286
+ /* istanbul ignore else */
287
+ if (Array.isArray(params.reservationFor.superEvent.ids)) {
288
+ andConditions.push({
289
+ 'reservationFor.superEvent.id': {
290
+ $exists: true,
291
+ $in: params.reservationFor.superEvent.ids
284
292
  }
285
- }
293
+ });
294
+ }
295
+ /* istanbul ignore else */
296
+ if (params.reservationFor.superEvent.location !== undefined) {
286
297
  /* istanbul ignore else */
287
- if (params.reservationFor.startFrom instanceof Date) {
298
+ if (Array.isArray(params.reservationFor.superEvent.location.ids)) {
288
299
  andConditions.push({
289
- 'reservationFor.startDate': {
300
+ 'reservationFor.superEvent.location.id': {
290
301
  $exists: true,
291
- $gte: params.reservationFor.startFrom
302
+ $in: params.reservationFor.superEvent.location.ids
292
303
  }
293
304
  });
294
305
  }
295
306
  /* istanbul ignore else */
296
- if (params.reservationFor.startThrough instanceof Date) {
307
+ if (Array.isArray(params.reservationFor.superEvent.location.branchCodes)) {
297
308
  andConditions.push({
298
- 'reservationFor.startDate': {
309
+ 'reservationFor.superEvent.location.branchCode': {
299
310
  $exists: true,
300
- $lte: params.reservationFor.startThrough
311
+ $in: params.reservationFor.superEvent.location.branchCodes
301
312
  }
302
313
  });
303
314
  }
315
+ }
316
+ /* istanbul ignore else */
317
+ if (params.reservationFor.superEvent.workPerformed !== undefined) {
304
318
  /* istanbul ignore else */
305
- if (params.reservationFor.endFrom instanceof Date) {
319
+ if (Array.isArray(params.reservationFor.superEvent.workPerformed.ids)) {
306
320
  andConditions.push({
307
- 'reservationFor.endDate': {
321
+ 'reservationFor.superEvent.workPerformed.id': {
308
322
  $exists: true,
309
- $gte: params.reservationFor.endFrom
323
+ $in: params.reservationFor.superEvent.workPerformed.ids
310
324
  }
311
325
  });
312
326
  }
313
327
  /* istanbul ignore else */
314
- if (params.reservationFor.endThrough instanceof Date) {
328
+ if (Array.isArray(params.reservationFor.superEvent.workPerformed.identifiers)) {
315
329
  andConditions.push({
316
- 'reservationFor.endDate': {
330
+ 'reservationFor.superEvent.workPerformed.identifier': {
317
331
  $exists: true,
318
- $lte: params.reservationFor.endThrough
332
+ $in: params.reservationFor.superEvent.workPerformed.identifiers
319
333
  }
320
334
  });
321
335
  }
322
- /* istanbul ignore else */
323
- if (params.reservationFor.superEvent !== undefined) {
324
- /* istanbul ignore else */
325
- if (params.reservationFor.superEvent.id !== undefined) {
326
- andConditions.push({
327
- 'reservationFor.superEvent.id': {
328
- $exists: true,
329
- $eq: params.reservationFor.superEvent.id
330
- }
331
- });
332
- }
333
- /* istanbul ignore else */
334
- if (Array.isArray(params.reservationFor.superEvent.ids)) {
335
- andConditions.push({
336
- 'reservationFor.superEvent.id': {
337
- $exists: true,
338
- $in: params.reservationFor.superEvent.ids
339
- }
340
- });
341
- }
342
- /* istanbul ignore else */
343
- if (params.reservationFor.superEvent.location !== undefined) {
344
- /* istanbul ignore else */
345
- if (Array.isArray(params.reservationFor.superEvent.location.ids)) {
346
- andConditions.push({
347
- 'reservationFor.superEvent.location.id': {
348
- $exists: true,
349
- $in: params.reservationFor.superEvent.location.ids
350
- }
351
- });
352
- }
353
- /* istanbul ignore else */
354
- if (Array.isArray(params.reservationFor.superEvent.location.branchCodes)) {
355
- andConditions.push({
356
- 'reservationFor.superEvent.location.branchCode': {
357
- $exists: true,
358
- $in: params.reservationFor.superEvent.location.branchCodes
359
- }
360
- });
361
- }
362
- }
363
- /* istanbul ignore else */
364
- if (params.reservationFor.superEvent.workPerformed !== undefined) {
365
- /* istanbul ignore else */
366
- if (Array.isArray(params.reservationFor.superEvent.workPerformed.ids)) {
367
- andConditions.push({
368
- 'reservationFor.superEvent.workPerformed.id': {
369
- $exists: true,
370
- $in: params.reservationFor.superEvent.workPerformed.ids
371
- }
372
- });
373
- }
374
- /* istanbul ignore else */
375
- if (Array.isArray(params.reservationFor.superEvent.workPerformed.identifiers)) {
376
- andConditions.push({
377
- 'reservationFor.superEvent.workPerformed.identifier': {
378
- $exists: true,
379
- $in: params.reservationFor.superEvent.workPerformed.identifiers
380
- }
381
- });
382
- }
383
- }
384
- }
385
336
  }
386
- break;
387
- // case factory.reservationType.ReservationPackage:
388
- // break;
389
- default:
337
+ }
390
338
  }
391
339
  /* istanbul ignore else */
392
340
  if (params.reservedTicket !== undefined) {
@@ -455,41 +403,6 @@ function CREATE_MONGO_CONDITIONS(params) {
455
403
  }
456
404
  });
457
405
  }
458
- // const brokerIdentifierAll = params.broker?.identifier?.$all;
459
- // if (Array.isArray(brokerIdentifierAll)) {
460
- // andConditions.push({
461
- // 'broker.identifier': {
462
- // $exists: true,
463
- // $all: brokerIdentifierAll
464
- // }
465
- // });
466
- // }
467
- // const brokerIdentifierIn = params.broker?.identifier?.$in;
468
- // if (Array.isArray(brokerIdentifierIn)) {
469
- // andConditions.push({
470
- // 'broker.identifier': {
471
- // $exists: true,
472
- // $in: brokerIdentifierIn
473
- // }
474
- // });
475
- // }
476
- // const brokerIdentifierNin = params.broker?.identifier?.$nin;
477
- // if (Array.isArray(brokerIdentifierNin)) {
478
- // andConditions.push({
479
- // 'broker.identifier': {
480
- // $nin: brokerIdentifierNin
481
- // }
482
- // });
483
- // }
484
- // const brokerIdentifierElemMatch = params.broker?.identifier?.$elemMatch;
485
- // if (brokerIdentifierElemMatch !== undefined && brokerIdentifierElemMatch !== null) {
486
- // andConditions.push({
487
- // 'broker.identifier': {
488
- // $exists: true,
489
- // $elemMatch: brokerIdentifierElemMatch
490
- // }
491
- // });
492
- // }
493
406
  /* istanbul ignore else */
494
407
  if (params.underName !== undefined) {
495
408
  /* istanbul ignore else */
@@ -606,49 +519,6 @@ function CREATE_MONGO_CONDITIONS(params) {
606
519
  });
607
520
  }
608
521
  }
609
- // /* istanbul ignore else */
610
- // if (params.underName.identifier !== undefined) {
611
- // if (Array.isArray(params.underName.identifier.$all)) {
612
- // andConditions.push({
613
- // 'underName.identifier': {
614
- // $exists: true,
615
- // $all: params.underName.identifier.$all
616
- // }
617
- // });
618
- // }
619
- // if (Array.isArray(params.underName.identifier.$in)) {
620
- // andConditions.push({
621
- // 'underName.identifier': {
622
- // $exists: true,
623
- // $in: params.underName.identifier.$in
624
- // }
625
- // });
626
- // }
627
- // if (Array.isArray(params.underName.identifier.$nin)) {
628
- // andConditions.push({
629
- // 'underName.identifier': {
630
- // $nin: params.underName.identifier.$nin
631
- // }
632
- // });
633
- // }
634
- // if (params.underName.identifier.$elemMatch !== undefined) {
635
- // andConditions.push({
636
- // 'underName.identifier': {
637
- // $exists: true,
638
- // $elemMatch: params.underName.identifier.$elemMatch
639
- // }
640
- // });
641
- // }
642
- // }
643
- // /* istanbul ignore else */
644
- // if (Array.isArray(params.underName.identifiers)) {
645
- // andConditions.push({
646
- // 'underName.identifier': {
647
- // $exists: true,
648
- // $in: params.underName.identifiers
649
- // }
650
- // });
651
- // }
652
522
  }
653
523
  /* istanbul ignore else */
654
524
  if (typeof params.attended === 'boolean') {
@@ -662,67 +532,5 @@ function CREATE_MONGO_CONDITIONS(params) {
662
532
  checkedIn: params.checkedIn
663
533
  });
664
534
  }
665
- // /* istanbul ignore else */
666
- // if (params.additionalProperty !== undefined) {
667
- // if (Array.isArray(params.additionalProperty.$all)) {
668
- // andConditions.push({
669
- // additionalProperty: {
670
- // $exists: true,
671
- // $all: params.additionalProperty.$all
672
- // }
673
- // });
674
- // }
675
- // if (Array.isArray(params.additionalProperty.$in)) {
676
- // andConditions.push({
677
- // additionalProperty: {
678
- // $exists: true,
679
- // $in: params.additionalProperty.$in
680
- // }
681
- // });
682
- // }
683
- // if (Array.isArray(params.additionalProperty.$nin)) {
684
- // andConditions.push({
685
- // additionalProperty: {
686
- // $nin: params.additionalProperty.$nin
687
- // }
688
- // });
689
- // }
690
- // if (params.additionalProperty.$elemMatch !== undefined) {
691
- // andConditions.push({
692
- // additionalProperty: {
693
- // $exists: true,
694
- // $elemMatch: params.additionalProperty.$elemMatch
695
- // }
696
- // });
697
- // }
698
- // }
699
- // const programMembershipUsedIdentifierEq = params.programMembershipUsed?.identifier?.$eq;
700
- // if (typeof programMembershipUsedIdentifierEq === 'string') {
701
- // andConditions.push({
702
- // 'programMembershipUsed.identifier': {
703
- // $exists: true,
704
- // $eq: programMembershipUsedIdentifierEq
705
- // }
706
- // });
707
- // }
708
- // const programMembershipUsedIssuedThroughServiceTypeCodeValueEq =
709
- // params.programMembershipUsed?.issuedThrough?.serviceType?.codeValue?.$eq;
710
- // if (typeof programMembershipUsedIssuedThroughServiceTypeCodeValueEq === 'string') {
711
- // andConditions.push({
712
- // 'programMembershipUsed.issuedThrough.serviceType.codeValue': {
713
- // $exists: true,
714
- // $eq: programMembershipUsedIssuedThroughServiceTypeCodeValueEq
715
- // }
716
- // });
717
- // }
718
- // const appliesToMovieTicketIdentifierEq = params.price?.priceComponent?.appliesToMovieTicket?.identifier?.$eq;
719
- // if (typeof appliesToMovieTicketIdentifierEq === 'string') {
720
- // andConditions.push({
721
- // 'price.priceComponent.appliesToMovieTicket.identifier': {
722
- // $exists: true,
723
- // $eq: appliesToMovieTicketIdentifierEq
724
- // }
725
- // });
726
- // }
727
535
  return andConditions;
728
536
  }
@@ -147,6 +147,14 @@ export interface IServiceOutputIdentifierSetting {
147
147
  */
148
148
  version: string;
149
149
  }
150
+ interface ICOAIntegrationSettings {
151
+ timeoutReserve: number;
152
+ timeoutMaster: number;
153
+ }
154
+ interface IGMOIntegrationSettings {
155
+ timeout: number;
156
+ timeoutBackground: number;
157
+ }
150
158
  interface ISurfrockSettings {
151
159
  /**
152
160
  * 着券時タイムアウト
@@ -174,14 +182,8 @@ export interface IIntegrationSettings {
174
182
  abortedTasksWithoutReport: string[];
175
183
  numTryConfirmReserveTransaction: number;
176
184
  deliverOrderLimit: number;
177
- coa: {
178
- timeoutReserve: number;
179
- timeoutMaster: number;
180
- };
181
- gmo: {
182
- timeout: number;
183
- timeoutBackground: number;
184
- };
185
+ coa: ICOAIntegrationSettings;
186
+ gmo: IGMOIntegrationSettings;
185
187
  movieticketReserve: ISurfrockSettings;
186
188
  useExperimentalFeature: boolean;
187
189
  }
@@ -67,7 +67,8 @@ class HasPOSRepo {
67
67
  throw new factory_1.factory.errors.NotFound(factory_1.factory.placeType.MovieTheater);
68
68
  }
69
69
  const creatingPOS = {
70
- id: params.branchCode, // 互換性維持対応として
70
+ // 互換性維持対応としてidを保管
71
+ id: params.branchCode, // eslint-disable-line @typescript-eslint/no-explicit-any
71
72
  branchCode: params.branchCode,
72
73
  name: params.name
73
74
  };
@@ -19,7 +19,7 @@ class ReservationRepo {
19
19
  * 汎用予約カウント
20
20
  */
21
21
  async count(params) {
22
- const conditions = (0, createMongoConditions_1.CREATE_MONGO_CONDITIONS)(params);
22
+ const conditions = (0, createMongoConditions_1.createMongoConditions)(params);
23
23
  return this.reservationModel.countDocuments((conditions.length > 0) ? { $and: conditions } : {})
24
24
  .setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
25
25
  .exec();
@@ -28,7 +28,7 @@ class ReservationRepo {
28
28
  * 予約検索
29
29
  */
30
30
  async findReservations(params, inclusion) {
31
- const conditions = (0, createMongoConditions_1.CREATE_MONGO_CONDITIONS)(params);
31
+ const conditions = (0, createMongoConditions_1.createMongoConditions)(params);
32
32
  let projection;
33
33
  if (inclusion !== undefined && inclusion !== null) {
34
34
  projection = {
@@ -96,7 +96,7 @@ function deleteReservationsByOrder(order) {
96
96
  acceptedOffers: {
97
97
  // itemOffered: { typeOf: { $in: [factory.reservationType.EventReservation] } }
98
98
  }
99
- }, { useReserveTransaction: true } // 予約取引参照(2026-05-18~)
99
+ }, {} // 予約取引参照(2026-05-18~)
100
100
  );
101
101
  const reservationIds = acceptedOffers.map((o) => String(o.itemOffered.id));
102
102
  if (reservationIds.length > 0) {
@@ -101,7 +101,7 @@ function sendOrder(params) {
101
101
  $slice: [offerIndexBase, limit],
102
102
  orderNumber: { $eq: order.orderNumber },
103
103
  project: { id: { $eq: order.project.id } }
104
- }, { useReserveTransaction: true } // 予約取引参照(2026-05-18~)
104
+ }, {} // 予約取引参照(2026-05-18~)
105
105
  );
106
106
  acceptedOffers = searchSlicedAcceptedOffersResult.acceptedOffers;
107
107
  debug('delivering...', order.orderNumber, acceptedOffers.map((offer) => `${offer.itemOffered.id}`), // eslint-disable-line @typescript-eslint/no-explicit-any
@@ -47,10 +47,11 @@ payTransaction, paymentServiceId, options) {
47
47
  try {
48
48
  // タスクによって実行されているかどうか
49
49
  const executedByTask = typeof options.executor?.id === 'string' && options.executor.id !== '';
50
+ const gmoIntegrationSettings = await settings.getByKey('gmo');
50
51
  // 非同期承認時に長時間対応(2024-05-18~)
51
- const timeout = (executedByTask && typeof (await settings.getByKey('gmo')).timeoutBackground === 'number')
52
- ? (await settings.getByKey('gmo')).timeoutBackground
53
- : (await settings.getByKey('gmo')).timeout;
52
+ const timeout = (executedByTask && typeof gmoIntegrationSettings.timeoutBackground === 'number')
53
+ ? gmoIntegrationSettings.timeoutBackground
54
+ : gmoIntegrationSettings.timeout;
54
55
  debug('processAuthorizeCreditCard processing... executor:', options.executor?.id, 'timeout:', timeout);
55
56
  const creditCardService = new gmo_service_1.GMO.service.Credit({
56
57
  endpoint: String(availableChannel.serviceUrl)
@@ -39,7 +39,7 @@ function findByCode(params) {
39
39
  // typeOf?: { $in?: factory.order.IItemOffered['typeOf'][] };
40
40
  }
41
41
  }
42
- }, { useReserveTransaction: true } // 予約取引参照(2026-05-18~)
42
+ }, {} // 予約取引参照(2026-05-18~)
43
43
  )).shift();
44
44
  if (acceptedOffer === undefined) {
45
45
  throw new factory_1.factory.errors.NotFound('acceptedOffer');
@@ -16,7 +16,7 @@ function searchByOrder(params) {
16
16
  // typeOf: { $in: [reservationType] }
17
17
  }
18
18
  }
19
- }, { useReserveTransaction: true } // 予約取引参照(2026-05-18~)
19
+ }, {} // 予約取引参照(2026-05-18~)
20
20
  );
21
21
  const reservationIds = acceptedOffers.map((offer) => {
22
22
  if (offer.itemOffered.typeOf === reservationType) {
@@ -58,14 +58,15 @@ function call(params) {
58
58
  const actionRepo = new acceptCOAOffer_1.AcceptCOAOfferActionRepo(connection);
59
59
  // const transactionProcessRepo = new TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
60
60
  try {
61
+ const coaIntegrationSettings = await settings.getByKey('coa');
61
62
  const reserveService = new coa_service_1.COA.service.Reserve({
62
63
  endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
63
64
  auth: coaAuthClient
64
- }, { timeout: (await settings.getByKey('coa')).timeoutReserve });
65
+ }, { timeout: coaIntegrationSettings.timeoutReserve });
65
66
  const masterService = new coa_service_1.COA.service.Master({
66
67
  endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
67
68
  auth: coaAuthClient
68
- }, { timeout: (await settings.getByKey('coa')).timeoutMaster });
69
+ }, { timeout: coaIntegrationSettings.timeoutMaster });
69
70
  const { agent, object, potentialActions, purpose } = params.data;
70
71
  // agent.idからflgMemberを自動セット(2024-12-16~)
71
72
  const isMember = memberClients.includes(agent.id);
@@ -137,7 +137,7 @@ function fixOrderAsPurpose(params) {
137
137
  const acceptedOffers = await repos.acceptedOffer.searchAcceptedOffersByOrderNumber({
138
138
  orderNumber: { $eq: order.orderNumber },
139
139
  project: { id: { $eq: params.project.id } }
140
- }, { useReserveTransaction: true } // 予約取引参照(2026-05-18~)
140
+ }, {} // 予約取引参照(2026-05-18~)
141
141
  );
142
142
  return {
143
143
  ...order,
@@ -77,7 +77,7 @@ function fixOrderAsPurpose(params, transaction) {
77
77
  reservedTicket: { ticketedSeat: { seatNumber: { $in: seatNumbers } } }
78
78
  }
79
79
  }
80
- }, { useReserveTransaction: true } // 予約取引参照(2026-05-18~)
80
+ }, {} // 予約取引参照(2026-05-18~)
81
81
  );
82
82
  }
83
83
  return {
@@ -144,7 +144,7 @@ function fixOrders(params) {
144
144
  const acceptedOffers = await repos.acceptedOffer.searchAcceptedOffersByOrderNumber({
145
145
  orderNumber: { $eq: params.object.order[0].orderNumber },
146
146
  project: { id: { $eq: params.project.id } }
147
- }, { useReserveTransaction: true } // 予約取引参照(2026-05-18~)
147
+ }, {} // 予約取引参照(2026-05-18~)
148
148
  );
149
149
  return { acceptedOffers, eventIds, offerIds, orders };
150
150
  };
@@ -22,7 +22,7 @@ function validateOrder(params) {
22
22
  const acceptedOffers = await repos.acceptedOffer.searchAcceptedOffersByOrderNumber({
23
23
  orderNumber: { $eq: params.orderNumber },
24
24
  project: { id: { $eq: params.project.id } }
25
- }, { useReserveTransaction: true } // 予約取引参照(2026-05-18~)
25
+ }, {} // 予約取引参照(2026-05-18~)
26
26
  );
27
27
  let payTransactions = [];
28
28
  if (order.paymentMethods.length > 0) {
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "dependencies": {
12
12
  "@aws-sdk/client-cognito-identity-provider": "3.600.0",
13
13
  "@aws-sdk/credential-providers": "3.600.0",
14
- "@chevre/factory": "8.2.0-alpha.1",
14
+ "@chevre/factory": "8.2.0-alpha.2",
15
15
  "@motionpicture/coa-service": "10.0.0",
16
16
  "@motionpicture/gmo-service": "6.1.0-alpha.0",
17
17
  "@sendgrid/client": "8.1.4",
@@ -91,5 +91,5 @@
91
91
  "postversion": "git push origin --tags",
92
92
  "prepublishOnly": "npm run clean && npm run build"
93
93
  },
94
- "version": "24.1.0-alpha.31"
94
+ "version": "24.1.0-alpha.33"
95
95
  }