@chevre/domain 28.0.0-alpha.2 → 28.0.0-alpha.20

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 (120) hide show
  1. package/lib/chevre/eventEmitter/transaction.d.ts +2 -2
  2. package/lib/chevre/eventEmitter/transaction.js +1 -1
  3. package/lib/chevre/repo/acceptedOffer.d.ts +3 -3
  4. package/lib/chevre/repo/acceptedOffer.js +14 -9
  5. package/lib/chevre/repo/acceptedOfferInReserve.d.ts +2 -2
  6. package/lib/chevre/repo/adminEvent.d.ts +0 -6
  7. package/lib/chevre/repo/adminEvent.js +3 -9
  8. package/lib/chevre/repo/adminEventSeries.d.ts +89 -0
  9. package/lib/chevre/repo/adminEventSeries.js +174 -0
  10. package/lib/chevre/repo/adminTask.d.ts +2 -2
  11. package/lib/chevre/repo/adminTransaction.d.ts +44 -48
  12. package/lib/chevre/repo/adminTransaction.js +0 -98
  13. package/lib/chevre/repo/aggregateEvent.js +0 -1
  14. package/lib/chevre/repo/aggregateTransaction.d.ts +0 -1
  15. package/lib/chevre/repo/aggregateTransaction.js +0 -1
  16. package/lib/chevre/repo/event.d.ts +2 -2
  17. package/lib/chevre/repo/event.js +71 -110
  18. package/lib/chevre/repo/eventSeries.d.ts +3 -82
  19. package/lib/chevre/repo/eventSeries.js +3 -201
  20. package/lib/chevre/repo/factory/acceptedOffer/reserveTransaction2itemOffered.d.ts +1 -1
  21. package/lib/chevre/repo/mongoose/schemas/civicStructure.d.ts +1 -0
  22. package/lib/chevre/repo/mongoose/schemas/order.d.ts +21 -1
  23. package/lib/chevre/repo/mongoose/schemas/place.js +0 -9
  24. package/lib/chevre/repo/mongoose/schemas/seller.d.ts +3 -1
  25. package/lib/chevre/repo/mongoose/schemas/seller.js +0 -2
  26. package/lib/chevre/repo/mongoose/schemas/transaction.d.ts +2 -3
  27. package/lib/chevre/repo/mongoose/schemas/transaction.js +81 -70
  28. package/lib/chevre/repo/order.d.ts +2 -2
  29. package/lib/chevre/repo/order.js +0 -31
  30. package/lib/chevre/repo/orderInTransaction.d.ts +5 -25
  31. package/lib/chevre/repo/orderInTransaction.js +0 -6
  32. package/lib/chevre/repo/place/movieTheater.d.ts +3 -1
  33. package/lib/chevre/repo/place/movieTheater.js +3 -1
  34. package/lib/chevre/repo/place/{hasPOS.d.ts → pos.d.ts} +13 -20
  35. package/lib/chevre/repo/place/{hasPOS.js → pos.js} +66 -29
  36. package/lib/chevre/repo/place/screeningRoom.d.ts +24 -3
  37. package/lib/chevre/repo/place/screeningRoom.js +28 -17
  38. package/lib/chevre/repo/priceSpecification.d.ts +8 -8
  39. package/lib/chevre/repo/seller.d.ts +11 -4
  40. package/lib/chevre/repo/seller.js +31 -58
  41. package/lib/chevre/repo/sellerPaymentAccepted.d.ts +14 -21
  42. package/lib/chevre/repo/sellerPaymentAccepted.js +65 -38
  43. package/lib/chevre/repo/task.d.ts +3 -3
  44. package/lib/chevre/repo/transaction/placeOrder.d.ts +6 -12
  45. package/lib/chevre/repo/transaction/placeOrder.js +53 -146
  46. package/lib/chevre/repo/transaction/returnOrderInProgress.d.ts +1 -1
  47. package/lib/chevre/repo/transaction.d.ts +1 -1
  48. package/lib/chevre/repo/transaction.js +0 -1
  49. package/lib/chevre/repository.d.ts +10 -5
  50. package/lib/chevre/repository.js +19 -8
  51. package/lib/chevre/service/aggregation/event/aggregateOffers.js +1 -2
  52. package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +0 -1
  53. package/lib/chevre/service/aggregation/system.js +1 -3
  54. package/lib/chevre/service/assetTransaction/pay/start/preStart/validateAcceptedPaymentMethodIfNeeded.js +1 -2
  55. package/lib/chevre/service/assetTransaction/pay/start/preStart/validateSeller.js +2 -2
  56. package/lib/chevre/service/delivery/reservation/factory.d.ts +1 -1
  57. package/lib/chevre/service/event/saveScreeningEventSeries.d.ts +2 -2
  58. package/lib/chevre/service/event/saveScreeningEventSeries.js +1 -1
  59. package/lib/chevre/service/event/saveScreeningEvents.d.ts +2 -0
  60. package/lib/chevre/service/event.d.ts +2 -0
  61. package/lib/chevre/service/event.js +0 -1
  62. package/lib/chevre/service/offer/any.d.ts +1 -1
  63. package/lib/chevre/service/offer/event/authorize/factory.d.ts +5 -5
  64. package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +1 -1
  65. package/lib/chevre/service/offer/event/authorize.js +1 -4
  66. package/lib/chevre/service/offer/event/issueEventOfferTicket.js +1 -1
  67. package/lib/chevre/service/offer/event/voidTransaction.js +2 -5
  68. package/lib/chevre/service/offer/event/voidTransactionByActionId.js +1 -4
  69. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +2 -9
  70. package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +2 -2
  71. package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +1 -4
  72. package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +1 -4
  73. package/lib/chevre/service/offer/onEventChanged.js +2 -4
  74. package/lib/chevre/service/offer.js +1 -2
  75. package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionCanceled.js +1 -1
  76. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +1 -6
  77. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.js +24 -4
  78. package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +1 -1
  79. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/processOrder.d.ts +1 -1
  80. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +1 -1
  81. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +1 -1
  82. package/lib/chevre/service/order/placeOrder/factory/orderedItem.d.ts +1 -1
  83. package/lib/chevre/service/order/placeOrder/factory.d.ts +1 -1
  84. package/lib/chevre/service/order/sendOrder.js +2 -14
  85. package/lib/chevre/service/payment/any/authorize.js +1 -1
  86. package/lib/chevre/service/payment/any/factory.d.ts +2 -2
  87. package/lib/chevre/service/payment/any/invalidatePaymentUrl.js +1 -4
  88. package/lib/chevre/service/payment/any/processVoidPayTransaction.js +2 -2
  89. package/lib/chevre/service/payment/any/publishPaymentUrl.js +1 -1
  90. package/lib/chevre/service/payment/creditCard/getGMOInfoFromSeller.js +1 -1
  91. package/lib/chevre/service/payment/factory/createPayObjectServiceOutput.d.ts +3 -3
  92. package/lib/chevre/service/payment/movieTicket/checkMovieTicket.js +1 -1
  93. package/lib/chevre/service/payment/movieTicket/payMovieTicket/payActionParams2seatInfoSyncIn.js +1 -1
  94. package/lib/chevre/service/payment/movieTicket/validation.js +1 -1
  95. package/lib/chevre/service/task/importEventsFromCOA.js +2 -0
  96. package/lib/chevre/service/task/onResourceDeleted.js +8 -8
  97. package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.d.ts +7 -3
  98. package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +51 -50
  99. package/lib/chevre/service/task/onResourceUpdated.js +5 -25
  100. package/lib/chevre/service/task/syncResourcesFromCOA.js +3 -1
  101. package/lib/chevre/service/transaction/deleteTransaction.js +1 -1
  102. package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.d.ts +1 -1
  103. package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateInvoiceReferencesOrder.d.ts +1 -1
  104. package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateMovieTicket.d.ts +1 -1
  105. package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +2 -2
  106. package/lib/chevre/service/transaction/placeOrder/confirm.js +1 -7
  107. package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.d.ts +2 -2
  108. package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +1 -4
  109. package/lib/chevre/service/transaction/placeOrder/start.js +1 -1
  110. package/lib/chevre/service/transaction/placeOrder/updateAgent.js +1 -4
  111. package/lib/chevre/service/transaction/returnOrder/potentialActions.js +1 -3
  112. package/lib/chevre/service/transaction/returnOrder/preStart/factory.d.ts +1 -1
  113. package/lib/chevre/service/transaction/returnOrder/preStart.d.ts +13 -1
  114. package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -2
  115. package/lib/chevre/service/transaction/returnOrder.d.ts +14 -3
  116. package/lib/chevre/service/transaction/returnOrder.js +1 -6
  117. package/lib/chevre/service/transaction.d.ts +1 -1
  118. package/package.json +2 -2
  119. package/lib/chevre/service/delivery/factory.d.ts +0 -16
  120. package/lib/chevre/service/delivery/factory.js +0 -124
@@ -68,51 +68,6 @@ class AdminTransactionRepo {
68
68
  })
69
69
  .exec();
70
70
  }
71
- // /**
72
- // * タスクエクスポートの遅延している取引について明示的にemitTransactionStatusChangedを実行する
73
- // */
74
- // public async exportTasksMany(params: {
75
- // now: Date;
76
- // delayInSeconds: number;
77
- // status: {
78
- // $in: factory.transactionStatusType[];
79
- // };
80
- // limit: number;
81
- // }) {
82
- // const delayedTransactions = await this.transactionModel.find({
83
- // status: { $in: params.status.$in },
84
- // 'tasksExportAction.actionStatus': {
85
- // $exists: true,
86
- // $eq: factory.actionStatusType.PotentialActionStatus
87
- // },
88
- // endDate: {
89
- // $exists: true,
90
- // $lt: moment(params.now)
91
- // .add(-params.delayInSeconds, 'seconds')
92
- // .toDate()
93
- // }
94
- // })
95
- // .select({
96
- // _id: 0,
97
- // id: { $toString: '$_id' },
98
- // typeOf: 1,
99
- // status: 1
100
- // })
101
- // .limit(params.limit)
102
- // .setOptions({ maxTimeMS: MONGO_MAX_TIME_MS })
103
- // .lean<Pick<factory.transaction.ITransaction<factory.transactionType>, 'id' | 'status' | 'typeOf'>[]>()
104
- // .exec();
105
- // if (delayedTransactions.length > 0) {
106
- // delayedTransactions.forEach((delayedTransaction) => {
107
- // transactionEventEmitter.emitTransactionStatusChanged({
108
- // id: delayedTransaction.id,
109
- // typeOf: delayedTransaction.typeOf,
110
- // status: delayedTransaction.status
111
- // });
112
- // });
113
- // }
114
- // return delayedTransactions;
115
- // }
116
71
  /**
117
72
  * add(2025-03-13~)
118
73
  */
@@ -167,59 +122,6 @@ class AdminTransactionRepo {
167
122
  return doc;
168
123
  }
169
124
  }
170
- // /**
171
- // * 取引を期限切れにする
172
- // */
173
- // public async makeExpired(params: {
174
- // expires: { $lt: Date };
175
- // limit: number; // add limit(2025-02-27~)
176
- // }): Promise<Pick<factory.transaction.ITransaction<factory.transactionType>, 'id' | 'typeOf'>[]> {
177
- // if (typeof params.limit !== 'number' || params.limit === 0) {
178
- // throw new factory.errors.ArgumentNull('limit');
179
- // }
180
- // const sort: { [key in keyof factory.transaction.ITransaction<factory.transactionType>]?: factory.sortType } = {
181
- // expires: factory.sortType.Ascending
182
- // };
183
- // // IDをemitしたいのでまずリスト検索(2023-04-27~)
184
- // const expiringTransactions =
185
- // await this.transactionModel.find({
186
- // status: { $eq: factory.transactionStatusType.InProgress },
187
- // expires: { $lt: params.expires.$lt }
188
- // })
189
- // .select({
190
- // _id: 0,
191
- // id: { $toString: '$_id' },
192
- // typeOf: 1
193
- // })
194
- // .limit(params.limit)
195
- // .sort(sort) // sort(2025-03-03~)
196
- // .setOptions({ maxTimeMS: MONGO_MAX_TIME_MS })
197
- // .lean<Pick<factory.transaction.ITransaction<factory.transactionType>, 'id' | 'typeOf'>[]>()
198
- // .exec();
199
- // if (expiringTransactions.length > 0) {
200
- // // ステータスと期限を見て更新
201
- // await this.transactionModel.updateMany(
202
- // {
203
- // _id: { $in: expiringTransactions.map((t) => t.id) },
204
- // status: { $eq: factory.transactionStatusType.InProgress },
205
- // expires: { $lt: params.expires.$lt }
206
- // },
207
- // {
208
- // status: factory.transactionStatusType.Expired,
209
- // endDate: new Date()
210
- // }
211
- // )
212
- // .exec();
213
- // expiringTransactions.forEach((expiringTransaction) => {
214
- // transactionEventEmitter.emitTransactionStatusChanged({
215
- // id: expiringTransaction.id,
216
- // typeOf: expiringTransaction.typeOf,
217
- // status: factory.transactionStatusType.Expired
218
- // });
219
- // });
220
- // }
221
- // return expiringTransactions;
222
- // }
223
125
  async findByIdAndDelete(params) {
224
126
  await this.transactionModel.findByIdAndDelete(params.id)
225
127
  .exec();
@@ -22,7 +22,6 @@ class AggregateEventRepo {
22
22
  $gte: params.startFrom,
23
23
  $lte: params.startThrough
24
24
  },
25
- typeOf: { $eq: params.typeOf },
26
25
  eventStatus: { $eq: eventStatus },
27
26
  ...(typeof params.project?.id?.$ne === 'string')
28
27
  ? { 'project.id': { $ne: params.project.id.$ne } }
@@ -31,7 +31,6 @@ export declare class AggregateTransactionRepo {
31
31
  };
32
32
  startFrom: Date;
33
33
  startThrough: Date;
34
- typeOf: factory.transactionType;
35
34
  clientId?: string;
36
35
  }): Promise<IAggregatePlaceOrder>;
37
36
  private agggregateByStatus;
@@ -22,7 +22,6 @@ class AggregateTransactionRepo {
22
22
  $gte: params.startFrom,
23
23
  $lte: params.startThrough
24
24
  },
25
- typeOf: { $eq: params.typeOf },
26
25
  status: { $eq: transactionStatus },
27
26
  ...(typeof params.project?.id?.$ne === 'string')
28
27
  ? { 'project.id': { $ne: params.project.id.$ne } }
@@ -1,7 +1,7 @@
1
1
  import { Connection, FilterQuery } from 'mongoose';
2
2
  import { factory } from '../factory';
3
3
  import * as EventFactory from '../factory/event';
4
- export type ISearchConditions = factory.event.screeningEvent.ISearchConditions;
4
+ export type ISearchConditions = Pick<factory.event.screeningEvent.ISearchConditions, 'additionalProperty' | 'endFrom' | 'endThrough' | 'eventStatuses' | 'id' | 'identifiers' | 'inSessionFrom' | 'inSessionThrough' | 'limit' | 'location' | 'offers' | 'organizer' | 'page' | 'project' | 'sort' | 'startFrom' | 'startThrough' | 'superEvent'> & {};
5
5
  export import IMinimizedIndividualEvent = EventFactory.IMinimizedIndividualEvent;
6
6
  type IKeyOfProjection = Exclude<keyof factory.event.screeningEvent.IEvent, 'id'> | 'aggregateOffer' | 'superEvent.location.id' | 'offers.itemOffered' | 'offers.itemOffered.id' | 'offers.typeOf';
7
7
  type IKeyOfProjection4publicFields = Exclude<keyof factory.event.screeningEvent.IEvent, 'id' | 'offers'>;
@@ -60,7 +60,7 @@ export declare class EventRepo {
60
60
  /**
61
61
  * COAイベントキャンセル時に使用
62
62
  */
63
- searchEventIds(params: Pick<ISearchConditions, 'project' | 'typeOf' | 'superEvent' | 'startFrom' | 'startThrough'>): Promise<string[]>;
63
+ searchEventIds(params: Pick<ISearchConditions, 'project' | 'superEvent' | 'startFrom' | 'startThrough'>): Promise<string[]>;
64
64
  /**
65
65
  * 特定イベントから指定フィールドのみ取得する
66
66
  * イベント IDは必ず返ります
@@ -22,18 +22,18 @@ class EventRepo {
22
22
  }
23
23
  static CREATE_MONGO_CONDITIONS(conditions) {
24
24
  const andConditions = [];
25
- const typeOfEq = conditions.typeOf;
26
- if (typeof typeOfEq === 'string') {
27
- andConditions.push({ typeOf: { $eq: typeOfEq } });
28
- }
29
- const typeOfIn = conditions.typeOfIn;
30
- if (Array.isArray(typeOfIn)) {
31
- andConditions.push({ typeOf: { $in: typeOfIn } });
32
- }
33
- // typeOf条件必須検証(2023-07-13~)
34
- if (typeof typeOfEq !== 'string' && !Array.isArray(typeOfIn)) {
35
- throw new factory_1.factory.errors.ArgumentNull('typeOf');
36
- }
25
+ // const typeOfEq = conditions.typeOf;
26
+ // if (typeof typeOfEq === 'string') {
27
+ // andConditions.push({ typeOf: { $eq: typeOfEq } });
28
+ // }
29
+ // const typeOfIn = conditions.typeOfIn;
30
+ // if (Array.isArray(typeOfIn)) {
31
+ // andConditions.push({ typeOf: { $in: typeOfIn } });
32
+ // }
33
+ // // typeOf条件必須検証(2023-07-13~)
34
+ // if (typeof typeOfEq !== 'string' && !Array.isArray(typeOfIn)) {
35
+ // throw new factory.errors.ArgumentNull('typeOf');
36
+ // }
37
37
  const projectIdEq = conditions.project?.id?.$eq;
38
38
  if (typeof projectIdEq === 'string') {
39
39
  andConditions.push({ 'project.id': { $eq: projectIdEq } });
@@ -113,110 +113,72 @@ class EventRepo {
113
113
  }
114
114
  });
115
115
  }
116
- let params;
117
- switch (conditions.typeOf) {
118
- case factory_1.factory.eventType.ScreeningEvent: {
119
- params = conditions;
120
- // /* istanbul ignore else */
121
- // if (typeof params.name === 'string' && params.name.length > 0) {
122
- // andConditions.push({
123
- // $or: [
124
- // {
125
- // 'name.ja': {
126
- // $exists: true,
127
- // $regex: new RegExp(params.name)
128
- // }
129
- // },
130
- // {
131
- // 'name.en': {
132
- // $exists: true,
133
- // $regex: new RegExp(params.name)
134
- // }
135
- // }
136
- // ]
137
- // });
138
- // }
139
- /* istanbul ignore else */
140
- const superEventLocationIdEq = params.superEvent?.location?.id?.$eq;
141
- if (typeof superEventLocationIdEq === 'string') {
142
- andConditions.push({
143
- 'superEvent.location.id': {
144
- $exists: true,
145
- $eq: superEventLocationIdEq
146
- }
147
- });
116
+ /* istanbul ignore else */
117
+ const superEventLocationIdEq = conditions.superEvent?.location?.id?.$eq;
118
+ if (typeof superEventLocationIdEq === 'string') {
119
+ andConditions.push({
120
+ 'superEvent.location.id': {
121
+ $exists: true,
122
+ $eq: superEventLocationIdEq
148
123
  }
149
- /* istanbul ignore else */
150
- if (params.superEvent !== undefined) {
151
- /* istanbul ignore else */
152
- if (Array.isArray(params.superEvent.ids)) {
153
- andConditions.push({
154
- 'superEvent.id': {
155
- $exists: true,
156
- $in: params.superEvent.ids
157
- }
158
- });
124
+ });
125
+ }
126
+ /* istanbul ignore else */
127
+ if (conditions.superEvent !== undefined) {
128
+ /* istanbul ignore else */
129
+ if (Array.isArray(conditions.superEvent.ids)) {
130
+ andConditions.push({
131
+ 'superEvent.id': {
132
+ $exists: true,
133
+ $in: conditions.superEvent.ids
159
134
  }
160
- /* istanbul ignore else */
161
- if (Array.isArray(params.superEvent.locationBranchCodes)) {
162
- andConditions.push({
163
- 'superEvent.location.branchCode': {
164
- $exists: true,
165
- $in: params.superEvent.locationBranchCodes
166
- }
167
- });
135
+ });
136
+ }
137
+ /* istanbul ignore else */
138
+ if (Array.isArray(conditions.superEvent.locationBranchCodes)) {
139
+ andConditions.push({
140
+ 'superEvent.location.branchCode': {
141
+ $exists: true,
142
+ $in: conditions.superEvent.locationBranchCodes
168
143
  }
169
- /* istanbul ignore else */
170
- if (Array.isArray(params.superEvent.workPerformedIdentifiers)) {
171
- andConditions.push({
172
- 'superEvent.workPerformed.identifier': {
173
- $exists: true,
174
- $in: params.superEvent.workPerformedIdentifiers
175
- }
176
- });
144
+ });
145
+ }
146
+ /* istanbul ignore else */
147
+ if (Array.isArray(conditions.superEvent.workPerformedIdentifiers)) {
148
+ andConditions.push({
149
+ 'superEvent.workPerformed.identifier': {
150
+ $exists: true,
151
+ $in: conditions.superEvent.workPerformedIdentifiers
177
152
  }
153
+ });
154
+ }
155
+ }
156
+ const itemOfferedIdIn = conditions.offers?.itemOffered?.id?.$in;
157
+ if (Array.isArray(itemOfferedIdIn)) {
158
+ andConditions.push({
159
+ 'offers.itemOffered.id': {
160
+ $exists: true,
161
+ $in: itemOfferedIdIn
178
162
  }
179
- const itemOfferedIdIn = params.offers?.itemOffered?.id?.$in;
180
- if (Array.isArray(itemOfferedIdIn)) {
181
- andConditions.push({
182
- 'offers.itemOffered.id': {
183
- $exists: true,
184
- $in: itemOfferedIdIn
185
- }
186
- });
187
- }
188
- const itemOfferedTicketedSeatTypeOfIn = params.offers?.itemOffered?.serviceOutput?.reservedTicket?.ticketedSeat?.typeOfs;
189
- if (Array.isArray(itemOfferedTicketedSeatTypeOfIn)) {
190
- andConditions.push({
191
- 'offers.itemOffered.serviceOutput.reservedTicket.ticketedSeat.typeOf': {
192
- $exists: true,
193
- $in: itemOfferedTicketedSeatTypeOfIn
194
- }
195
- });
163
+ });
164
+ }
165
+ const itemOfferedTicketedSeatTypeOfIn = conditions.offers?.itemOffered?.serviceOutput?.reservedTicket?.ticketedSeat?.typeOfs;
166
+ if (Array.isArray(itemOfferedTicketedSeatTypeOfIn)) {
167
+ andConditions.push({
168
+ 'offers.itemOffered.serviceOutput.reservedTicket.ticketedSeat.typeOf': {
169
+ $exists: true,
170
+ $in: itemOfferedTicketedSeatTypeOfIn
196
171
  }
197
- // const itemOfferedServiceTypeIdIn = params.offers?.itemOffered?.serviceType?.ids;
198
- // if (Array.isArray(itemOfferedServiceTypeIdIn)) {
199
- // andConditions.push({
200
- // 'offers.itemOffered.serviceType.id': {
201
- // $exists: true,
202
- // $in: itemOfferedServiceTypeIdIn
203
- // }
204
- // });
205
- // }
206
- const sellerMakesOfferElemMatch = params.offers?.seller?.makesOffer?.$elemMatch;
207
- if (typeof sellerMakesOfferElemMatch?.['availableAtOrFrom.id']?.$eq === 'string') {
208
- andConditions.push({
209
- 'offers.seller.makesOffer': {
210
- $exists: true,
211
- $elemMatch: sellerMakesOfferElemMatch
212
- }
213
- });
172
+ });
173
+ }
174
+ const sellerMakesOfferElemMatch = conditions.offers?.seller?.makesOffer?.$elemMatch;
175
+ if (typeof sellerMakesOfferElemMatch?.['availableAtOrFrom.id']?.$eq === 'string') {
176
+ andConditions.push({
177
+ 'offers.seller.makesOffer': {
178
+ $exists: true,
179
+ $elemMatch: sellerMakesOfferElemMatch
214
180
  }
215
- break;
216
- }
217
- case factory_1.factory.eventType.ScreeningEventSeries: // eslint-disable-line @typescript-eslint/no-explicit-any
218
- throw new factory_1.factory.errors.Internal('typeOf: ScreeningEventSeries discontinued');
219
- default:
181
+ });
220
182
  }
221
183
  return andConditions;
222
184
  }
@@ -339,7 +301,6 @@ class EventRepo {
339
301
  const doc = await this.eventModel.findOne({
340
302
  _id: { $eq: params.id.$eq },
341
303
  'project.id': { $eq: params.project.id.$eq },
342
- typeOf: { $in: [factory_1.factory.eventType.ScreeningEvent] },
343
304
  ...(typeof params.organizer?.id.$eq === 'string')
344
305
  ? { 'organizer.id': { $exists: true, $eq: params.organizer.id.$eq } }
345
306
  : undefined
@@ -1,10 +1,7 @@
1
- import type { Connection, FilterQuery, mongo } from 'mongoose';
1
+ import type { Connection, FilterQuery } from 'mongoose';
2
2
  import { factory } from '../factory';
3
3
  type ISearchConditions = factory.eventSeries.ISearchConditions;
4
4
  type IKeyOfProjection = Exclude<keyof factory.eventSeries.IEvent, 'id' | 'videoFormat'>;
5
- type IUnset = {
6
- [key in keyof factory.eventSeries.IEvent]?: 1;
7
- };
8
5
  /**
9
6
  * 施設コンテンツリポジトリ
10
7
  */
@@ -12,41 +9,10 @@ export declare class EventSeriesRepo {
12
9
  private readonly eventSeriesModel;
13
10
  constructor(connection: Connection);
14
11
  static CREATE_MONGO_CONDITIONS(conditions: ISearchConditions): FilterQuery<factory.eventSeries.IEvent>[];
15
- /**
16
- * 施設+コンテンツ+バージョンをキーにして冪等置換
17
- */
18
- upsertByVersion(params: {
19
- $set: factory.eventSeries.IAttributes;
20
- $unset?: IUnset;
21
- }[], options: {
22
- /**
23
- * falseの場合setOnInsertのみ
24
- * trueの場合setOnInsert+setのみ
25
- */
26
- upsert: boolean;
27
- }): Promise<{
28
- bulkWriteResult?: mongo.BulkWriteResult;
29
- modifiedEvents: {
30
- id: string;
31
- }[];
32
- }>;
33
- /**
34
- * sskts施設コンテンツ保管
35
- */
36
- upsertManyEventSeriesById4sskts(params: {
37
- id: string;
38
- attributes: factory.eventSeries.IAttributes;
39
- }[]): Promise<void>;
40
12
  /**
41
13
  * イベントを検索する(inclusion projection)
42
14
  */
43
15
  projectEventSeriesFields(params: ISearchConditions, inclusion: IKeyOfProjection[]): Promise<factory.eventSeries.IEvent[]>;
44
- deleteEventSeriesById(params: {
45
- project: {
46
- id: string;
47
- };
48
- id: string;
49
- }): Promise<void>;
50
16
  deleteManyByOrganizerId(params: {
51
17
  project: {
52
18
  id: string;
@@ -54,7 +20,7 @@ export declare class EventSeriesRepo {
54
20
  organizer: {
55
21
  id: string;
56
22
  };
57
- }): Promise<mongo.DeleteResult>;
23
+ }): Promise<import("mongodb").DeleteResult>;
58
24
  deleteManyByLocationId(params: {
59
25
  project: {
60
26
  id: string;
@@ -62,51 +28,6 @@ export declare class EventSeriesRepo {
62
28
  location: {
63
29
  id: string;
64
30
  };
65
- }): Promise<mongo.DeleteResult>;
66
- /**
67
- * 既存施設コンテンツの最大バージョンを集計する
68
- */
69
- aggregateMaxVersion(params: {
70
- project: {
71
- id: {
72
- $eq: string;
73
- };
74
- };
75
- workPerformed: {
76
- identifier: {
77
- $eq: string;
78
- };
79
- };
80
- location: {
81
- branchCode: {
82
- $in: string[];
83
- };
84
- };
85
- }): Promise<{
86
- maxVersion: string;
87
- }>;
88
- getCursor(conditions: FilterQuery<any>, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, factory.eventSeries.IAttributes & {
89
- _id: string;
90
- }, import("./mongoose/virtuals").IVirtuals, {}> & factory.eventSeries.IAttributes & {
91
- _id: string;
92
- } & Required<{
93
- _id: string;
94
- }> & {
95
- __v: number;
96
- }, import("mongoose").QueryOptions<factory.eventSeries.IAttributes & {
97
- _id: string;
98
- }>, (import("mongoose").Document<unknown, Record<string, never>, factory.eventSeries.IAttributes & {
99
- _id: string;
100
- }, import("./mongoose/virtuals").IVirtuals, {}> & factory.eventSeries.IAttributes & {
101
- _id: string;
102
- } & Required<{
103
- _id: string;
104
- }> & {
105
- __v: number;
106
- }) | null>;
107
- unsetUnnecessaryFields(params: {
108
- filter: FilterQuery<factory.eventSeries.IEvent>;
109
- $unset: IUnset;
110
- }): Promise<import("mongoose").UpdateWriteOpResult>;
31
+ }): Promise<import("mongodb").DeleteResult>;
111
32
  }
112
33
  export {};