@chevre/domain 23.2.0-alpha.6 → 23.2.0-alpha.61
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.
- package/example/src/chevre/acceptedPaymentMethodOffer/adminAcceptedPaymentMethodOffers.ts +25 -17
- package/example/src/chevre/confirmationNumber/testRandomness.ts +49 -0
- package/example/src/chevre/emailMessage/createEmailMessageText.ts +63 -0
- package/example/src/chevre/event/importEventsFromCOAByTitle.ts +2 -2
- package/example/src/chevre/event/unsetSuperEventVideoFormat.ts +30 -0
- package/example/src/chevre/eventSeries/unsetVideoFormat.ts +31 -0
- package/example/src/chevre/{upsertScreeningEventSeriesByVersion.ts → eventSeries/upsertScreeningEventSeriesByVersion.ts} +47 -43
- package/example/src/chevre/{upsertOfferCatalogItemsByIdentifier.ts → offerCatalog/upsertOfferCatalogItemsByIdentifier.ts} +6 -3
- package/example/src/chevre/{upsertOfferCatalogsByIdentifier.ts → offerCatalog/upsertOfferCatalogsByIdentifier.ts} +8 -3
- package/example/src/chevre/{upsertOffersByIdentifier.ts → offers/upsertOffersByIdentifier.ts} +5 -3
- package/example/src/chevre/orderNumber/testRandomness.ts +54 -0
- package/example/src/chevre/place/adminEntranceGates.ts +69 -0
- package/example/src/chevre/place/checkEntranceGatesCount.ts +82 -0
- package/example/src/chevre/place/findRooms.ts +24 -0
- package/example/src/chevre/place/findSections.ts +28 -0
- package/example/src/chevre/place/migrateSectionIdentifier.ts +92 -0
- package/example/src/chevre/place/seatsJson2csv.ts +63 -0
- package/example/src/chevre/place/upsertMovieTheatersByBranchCode.ts +41 -0
- package/example/src/chevre/place/upsertRoomsByBranchCode.ts +40 -0
- package/example/src/chevre/place/upsertSeatSectionsByBranchCode.ts +56 -0
- package/example/src/chevre/reIndex.ts +1 -1
- package/example/src/chevre/roles/addAdminAcceptedPaymentMethodReadPermissionIfNotExists.ts +33 -0
- package/example/src/chevre/roles/addAdminAcceptedPaymentMethodWritePermissionIfNotExists.ts +33 -0
- package/example/src/chevre/roles/addAdminMovieReadPermissionIfNotExists.ts +49 -0
- package/example/src/chevre/roles/addAdminRoomReadPermissionIfNotExists.ts +34 -0
- package/example/src/chevre/roles/addAdminRoomWritePermissionIfNotExists.ts +34 -0
- package/example/src/chevre/settings/addOrderNumberSetting.ts +44 -0
- package/example/src/chevre/settings/addTransactionNumberSetting.ts +40 -0
- package/example/src/chevre/transactionNumber/publishByTimestamp.ts +23 -0
- package/example/src/chevre/transactionNumber/testRandomness.ts +42 -0
- package/example/src/chevre/unsetUnnecessaryFields.ts +8 -4
- package/lib/chevre/emailMessageBuilder.js +1 -0
- package/lib/chevre/factory/event.d.ts +1 -1
- package/lib/chevre/factory/event.js +11 -5
- package/lib/chevre/factory/transactionNumber.d.ts +19 -0
- package/lib/chevre/factory/transactionNumber.js +54 -0
- package/lib/chevre/repo/acceptedPaymentMethod.d.ts +41 -8
- package/lib/chevre/repo/acceptedPaymentMethod.js +72 -27
- package/lib/chevre/repo/aggregateOffer.d.ts +6 -1
- package/lib/chevre/repo/aggregateOffer.js +11 -3
- package/lib/chevre/repo/aggregateOrder.js +0 -93
- package/lib/chevre/repo/aggregateReservation.d.ts +0 -1
- package/lib/chevre/repo/aggregateReservation.js +0 -2
- package/lib/chevre/repo/confirmationNumber.d.ts +1 -0
- package/lib/chevre/repo/confirmationNumber.js +32 -25
- package/lib/chevre/repo/event.d.ts +3 -18
- package/lib/chevre/repo/event.js +94 -83
- package/lib/chevre/repo/eventOffer.d.ts +8 -0
- package/lib/chevre/repo/eventOffer.js +11 -0
- package/lib/chevre/repo/eventSeries.d.ts +17 -30
- package/lib/chevre/repo/eventSeries.js +204 -146
- package/lib/chevre/repo/mongoose/schemas/aggregateReservation.js +0 -1
- package/lib/chevre/repo/mongoose/schemas/eventSeries.js +20 -5
- package/lib/chevre/repo/mongoose/schemas/offerCatalog.js +2 -8
- package/lib/chevre/repo/mongoose/schemas/offerCatalogItem.js +28 -2
- package/lib/chevre/repo/mongoose/schemas/place.d.ts +6 -2
- package/lib/chevre/repo/mongoose/schemas/setting.d.ts +40 -0
- package/lib/chevre/repo/mongoose/schemas/setting.js +3 -0
- package/lib/chevre/repo/offerCatalog.d.ts +14 -1
- package/lib/chevre/repo/offerCatalog.js +41 -19
- package/lib/chevre/repo/offerCatalogItem.d.ts +10 -1
- package/lib/chevre/repo/offerCatalogItem.js +32 -17
- package/lib/chevre/repo/orderNumber.d.ts +6 -0
- package/lib/chevre/repo/orderNumber.js +110 -35
- package/lib/chevre/repo/place/entranceGate.d.ts +57 -0
- package/lib/chevre/repo/place/entranceGate.js +172 -0
- package/lib/chevre/repo/place/movieTheater.d.ts +40 -3
- package/lib/chevre/repo/place/movieTheater.js +77 -6
- package/lib/chevre/repo/place/screeningRoom.d.ts +60 -31
- package/lib/chevre/repo/place/screeningRoom.js +227 -135
- package/lib/chevre/repo/place/seat.d.ts +47 -45
- package/lib/chevre/repo/place/seat.js +175 -45
- package/lib/chevre/repo/place/section.d.ts +60 -30
- package/lib/chevre/repo/place/section.js +337 -127
- package/lib/chevre/repo/serviceOutputIdentifier.d.ts +3 -1
- package/lib/chevre/repo/serviceOutputIdentifier.js +42 -27
- package/lib/chevre/repo/setting.d.ts +1 -1
- package/lib/chevre/repo/setting.js +2 -2
- package/lib/chevre/repo/task.d.ts +1 -1
- package/lib/chevre/repo/transactionNumber.d.ts +5 -0
- package/lib/chevre/repo/transactionNumber.js +63 -27
- package/lib/chevre/repository.d.ts +8 -0
- package/lib/chevre/repository.js +16 -0
- package/lib/chevre/service/assetTransaction/fixInformAction.d.ts +3 -0
- package/lib/chevre/service/assetTransaction/fixInformAction.js +3 -0
- package/lib/chevre/service/assetTransaction/pay/cancel.d.ts +12 -0
- package/lib/chevre/service/assetTransaction/pay/cancel.js +25 -0
- package/lib/chevre/service/assetTransaction/pay/check.d.ts +23 -0
- package/lib/chevre/service/assetTransaction/pay/check.js +37 -0
- package/lib/chevre/service/assetTransaction/pay/confirm.d.ts +24 -0
- package/lib/chevre/service/assetTransaction/pay/confirm.js +72 -0
- package/lib/chevre/service/assetTransaction/pay/exportTasksById.d.ts +18 -0
- package/lib/chevre/service/assetTransaction/pay/exportTasksById.js +111 -0
- package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.d.ts +48 -0
- package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.js +164 -0
- package/lib/chevre/service/assetTransaction/pay/searchGMOTrade.d.ts +20 -0
- package/lib/chevre/service/assetTransaction/pay/searchGMOTrade.js +59 -0
- package/lib/chevre/service/assetTransaction/pay/{account → start/account}/validation.d.ts +2 -2
- package/lib/chevre/service/assetTransaction/pay/{account → start/account}/validation.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/{factory.d.ts → start/factory.d.ts} +1 -1
- package/lib/chevre/service/assetTransaction/pay/{factory.js → start/factory.js} +1 -1
- package/lib/chevre/service/assetTransaction/pay/{validateAcceptedPaymentMethodIfNeeded.d.ts → start/preStart/validateAcceptedPaymentMethodIfNeeded.d.ts} +4 -4
- package/lib/chevre/service/assetTransaction/pay/{validateAcceptedPaymentMethodIfNeeded.js → start/preStart/validateAcceptedPaymentMethodIfNeeded.js} +1 -4
- package/lib/chevre/service/assetTransaction/pay/start/preStart/validateSeller.d.ts +8 -0
- package/lib/chevre/service/assetTransaction/pay/start/preStart/validateSeller.js +54 -0
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeAccount.d.ts +13 -0
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeAccount.js +49 -0
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeCreditCard.d.ts +29 -0
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeCreditCard.js +37 -0
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeMovieTicket.d.ts +42 -0
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeMovieTicket.js +31 -0
- package/lib/chevre/service/assetTransaction/pay/start.d.ts +60 -0
- package/lib/chevre/service/assetTransaction/pay/start.js +145 -0
- package/lib/chevre/service/assetTransaction/pay.d.ts +8 -170
- package/lib/chevre/service/assetTransaction/pay.js +16 -623
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createStartParams.js +10 -2
- package/lib/chevre/service/event/processUpdateMovieTheater.d.ts +1 -1
- package/lib/chevre/service/event/processUpdateMovieTheater.js +13 -11
- package/lib/chevre/service/event/saveScreeningEventSeries.js +4 -5
- package/lib/chevre/service/event/saveScreeningEvents.d.ts +2 -2
- package/lib/chevre/service/event/saveScreeningEvents.js +16 -12
- package/lib/chevre/service/offer/event/authorize/factory.js +9 -1
- package/lib/chevre/service/offer/event/searchEventTicketOffers.js +7 -4
- package/lib/chevre/service/offer/event/searchOfferAppliesToMovieTicket.js +9 -6
- package/lib/chevre/service/offer/event/searchOffersByIds.js +7 -4
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +7 -1
- package/lib/chevre/service/offer/onEventChanged.js +10 -6
- package/lib/chevre/service/offer/product.js +1 -1
- package/lib/chevre/service/offer.d.ts +5 -0
- package/lib/chevre/service/offer.js +34 -9
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.d.ts +1 -1
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByAggregateOffer.d.ts +13 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByAggregateOffer.js +53 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByEventSeries.d.ts +13 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByEventSeries.js +56 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByMovieTheater.d.ts +15 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByMovieTheater.js +58 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByOfferCatalog.d.ts +17 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByOfferCatalog.js +75 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByProduct.d.ts +19 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByProduct.js +60 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByRoom.d.ts +20 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByRoom.js +51 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.d.ts +27 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.js +100 -0
- package/lib/chevre/service/task/onResourceDeleted.d.ts +6 -0
- package/lib/chevre/service/task/onResourceDeleted.js +168 -0
- package/lib/chevre/service/task/onResourceUpdated.js +205 -42
- package/lib/chevre/service/task/syncResourcesFromCOA.js +4 -2
- package/lib/chevre/service/taskHandler.js +1 -0
- package/package.json +9 -9
- package/example/src/chevre/event/upsertManyScreeningEventByIdentifier.ts +0 -191
- package/example/src/chevre/eventSeries/migrateEventSeriesUnacceptedPaymentMethod.ts +0 -93
- package/example/src/chevre/offers/createSampleOffers.ts +0 -154
- package/example/src/chevre/settings/addSettings.ts +0 -46
- package/lib/chevre/service/eventOld.d.ts +0 -60
- package/lib/chevre/service/eventOld.js +0 -864
- package/lib/chevre/service/task/createEvent/createEvent.d.ts +0 -25
- package/lib/chevre/service/task/createEvent/createEvent.js +0 -45
- package/lib/chevre/service/task/createEvent/createEventBySchedule/factory.d.ts +0 -22
- package/lib/chevre/service/task/createEvent/createEventBySchedule/factory.js +0 -188
- package/lib/chevre/service/task/createEvent/createEventBySchedule/schedule2events.d.ts +0 -15
- package/lib/chevre/service/task/createEvent/createEventBySchedule/schedule2events.js +0 -116
- package/lib/chevre/service/task/createEvent/createEventBySchedule.d.ts +0 -25
- package/lib/chevre/service/task/createEvent/createEventBySchedule.js +0 -107
- package/lib/chevre/service/task/createEvent/createEventSeries.d.ts +0 -13
- package/lib/chevre/service/task/createEvent/createEventSeries.js +0 -118
- package/lib/chevre/service/task/createEvent.d.ts +0 -6
- package/lib/chevre/service/task/createEvent.js +0 -46
- package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.d.ts +0 -45
- package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +0 -447
|
@@ -195,11 +195,9 @@ class OfferCatalogRepo {
|
|
|
195
195
|
/**
|
|
196
196
|
* コードをキーにして冪等置換(2023-12-14~)
|
|
197
197
|
*/
|
|
198
|
-
upsertManyByIdentifier(params
|
|
199
|
-
// options?: {
|
|
200
|
-
// }
|
|
201
|
-
) {
|
|
198
|
+
upsertManyByIdentifier(params, options) {
|
|
202
199
|
return __awaiter(this, void 0, void 0, function* () {
|
|
200
|
+
const { itemListElementType, productType, update } = options;
|
|
203
201
|
const uniqid = yield Promise.resolve().then(() => require('uniqid'));
|
|
204
202
|
const bulkWriteOps = [];
|
|
205
203
|
const queryFilters = [];
|
|
@@ -209,28 +207,52 @@ class OfferCatalogRepo {
|
|
|
209
207
|
if (typeof identifier !== 'string' || identifier.length === 0) {
|
|
210
208
|
throw new factory.errors.ArgumentNull('identifier');
|
|
211
209
|
}
|
|
210
|
+
// 指定されたproductTypeを強制する
|
|
211
|
+
if (setFields.itemOffered.typeOf !== productType) {
|
|
212
|
+
throw new factory.errors.Argument('itemOffered.typeOf', `not matched with productType: ${productType}`);
|
|
213
|
+
}
|
|
214
|
+
// 指定されたitemListElementTypeを強制する
|
|
215
|
+
const everyElementTypeMatched = setFields.itemListElement.every((element) => element.typeOf === itemListElementType);
|
|
216
|
+
if (!everyElementTypeMatched) {
|
|
217
|
+
throw new factory.errors.Argument('itemListElement.typeOf', `not matched with itemListElementType: ${itemListElementType}`);
|
|
218
|
+
}
|
|
212
219
|
// リソースのユニークネスを保証するfilter
|
|
213
220
|
const filter = {
|
|
214
221
|
'project.id': { $eq: project.id },
|
|
215
|
-
identifier: { $eq: identifier }
|
|
222
|
+
identifier: { $eq: identifier },
|
|
223
|
+
'itemOffered.typeOf': { $exists: true, $eq: productType }, // プロダクトタイプを変更させないためにフィルター追加(2026-01-30~)
|
|
224
|
+
'itemListElement.typeOf': { $exists: true, $eq: itemListElementType } // アイテムタイプを変更させないためにフィルター追加(2026-02-03~)
|
|
216
225
|
};
|
|
217
226
|
queryFilters.push({
|
|
218
227
|
'project.id': { $eq: project.id },
|
|
219
|
-
identifier: { $eq: identifier }
|
|
228
|
+
identifier: { $eq: identifier },
|
|
229
|
+
'itemOffered.typeOf': { $exists: true, $eq: productType }, // プロダクトタイプを変更させないためにフィルター追加(2026-01-30~)
|
|
230
|
+
'itemListElement.typeOf': { $exists: true, $eq: itemListElementType } // アイテムタイプを変更させないためにフィルター追加(2026-02-03~)
|
|
220
231
|
});
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
232
|
+
if (update === true) {
|
|
233
|
+
const updateOne = {
|
|
234
|
+
filter,
|
|
235
|
+
update: Object.assign({ $set: setFields }, ($unset !== undefined) ? { $unset } : undefined),
|
|
236
|
+
upsert: false
|
|
237
|
+
};
|
|
238
|
+
bulkWriteOps.push({ updateOne });
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
// デフォルトはupsert操作
|
|
242
|
+
const newId = uniqid();
|
|
243
|
+
const setOnInsert = {
|
|
244
|
+
identifier,
|
|
245
|
+
project,
|
|
246
|
+
typeOf,
|
|
247
|
+
_id: newId
|
|
248
|
+
};
|
|
249
|
+
const updateOne = {
|
|
250
|
+
filter,
|
|
251
|
+
update: Object.assign({ $setOnInsert: setOnInsert, $set: setFields }, ($unset !== undefined) ? { $unset } : undefined),
|
|
252
|
+
upsert: true
|
|
253
|
+
};
|
|
254
|
+
bulkWriteOps.push({ updateOne });
|
|
255
|
+
}
|
|
234
256
|
});
|
|
235
257
|
}
|
|
236
258
|
if (bulkWriteOps.length > 0) {
|
|
@@ -32,7 +32,16 @@ export declare class OfferCatalogItemRepo {
|
|
|
32
32
|
$unset?: {
|
|
33
33
|
[key in keyof factory.offerCatalog.IOfferCatalog]?: 1;
|
|
34
34
|
};
|
|
35
|
-
}[]
|
|
35
|
+
}[], options: {
|
|
36
|
+
/**
|
|
37
|
+
* support only update(2026-01-30~)
|
|
38
|
+
*/
|
|
39
|
+
update: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* プロダクトタイプでfilter(2026-01-30~)
|
|
42
|
+
*/
|
|
43
|
+
productType: factory.product.ProductType;
|
|
44
|
+
}): Promise<{
|
|
36
45
|
bulkWriteResult: BulkWriteResult;
|
|
37
46
|
modifiedCatalogs: {
|
|
38
47
|
id: string;
|
|
@@ -159,11 +159,9 @@ class OfferCatalogItemRepo {
|
|
|
159
159
|
/**
|
|
160
160
|
* コードをキーにして冪等置換(2023-12-14~)
|
|
161
161
|
*/
|
|
162
|
-
upsertManyByIdentifier(params
|
|
163
|
-
// options?: {
|
|
164
|
-
// }
|
|
165
|
-
) {
|
|
162
|
+
upsertManyByIdentifier(params, options) {
|
|
166
163
|
return __awaiter(this, void 0, void 0, function* () {
|
|
164
|
+
const { productType, update } = options;
|
|
167
165
|
const bulkWriteOps = [];
|
|
168
166
|
const queryFilters = [];
|
|
169
167
|
if (Array.isArray(params)) {
|
|
@@ -172,26 +170,43 @@ class OfferCatalogItemRepo {
|
|
|
172
170
|
if (typeof identifier !== 'string' || identifier.length === 0) {
|
|
173
171
|
throw new factory.errors.ArgumentNull('identifier');
|
|
174
172
|
}
|
|
173
|
+
// 指定されたproductTypeを強制する
|
|
174
|
+
if (setFields.itemOffered.typeOf !== productType) {
|
|
175
|
+
throw new factory.errors.Argument('itemOffered.typeOf', `not matched with productType: ${productType}`);
|
|
176
|
+
}
|
|
175
177
|
// リソースのユニークネスを保証するfilter
|
|
176
178
|
const filter = {
|
|
177
179
|
'project.id': { $eq: project.id },
|
|
178
|
-
identifier: { $eq: identifier }
|
|
180
|
+
identifier: { $eq: identifier },
|
|
181
|
+
'itemOffered.typeOf': { $exists: true, $eq: productType } // プロダクトタイプを変更させないためにフィルター追加(2026-01-30~)
|
|
179
182
|
};
|
|
180
183
|
queryFilters.push({
|
|
181
184
|
'project.id': { $eq: project.id },
|
|
182
|
-
identifier: { $eq: identifier }
|
|
185
|
+
identifier: { $eq: identifier },
|
|
186
|
+
'itemOffered.typeOf': { $exists: true, $eq: productType } // プロダクトタイプを変更させないためにフィルター追加(2026-01-30~)
|
|
183
187
|
});
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
188
|
+
if (update === true) {
|
|
189
|
+
const updateOne = {
|
|
190
|
+
filter,
|
|
191
|
+
update: Object.assign({ $set: setFields }, ($unset !== undefined) ? { $unset } : undefined),
|
|
192
|
+
upsert: false
|
|
193
|
+
};
|
|
194
|
+
bulkWriteOps.push({ updateOne });
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
// デフォルトはupsert操作
|
|
198
|
+
const setOnInsert = {
|
|
199
|
+
identifier,
|
|
200
|
+
project,
|
|
201
|
+
typeOf
|
|
202
|
+
};
|
|
203
|
+
const updateOne = {
|
|
204
|
+
filter,
|
|
205
|
+
update: Object.assign({ $setOnInsert: setOnInsert, $set: setFields }, ($unset !== undefined) ? { $unset } : undefined),
|
|
206
|
+
upsert: true
|
|
207
|
+
};
|
|
208
|
+
bulkWriteOps.push({ updateOne });
|
|
209
|
+
}
|
|
195
210
|
});
|
|
196
211
|
}
|
|
197
212
|
if (bulkWriteOps.length > 0) {
|
|
@@ -4,6 +4,7 @@ import type { Connection } from 'mongoose';
|
|
|
4
4
|
*/
|
|
5
5
|
export declare class OrderNumberRepo {
|
|
6
6
|
private readonly counterRepo;
|
|
7
|
+
private readonly settingModel;
|
|
7
8
|
constructor(params: {
|
|
8
9
|
connection: Connection;
|
|
9
10
|
});
|
|
@@ -19,4 +20,9 @@ export declare class OrderNumberRepo {
|
|
|
19
20
|
*/
|
|
20
21
|
orderDate: Date;
|
|
21
22
|
}): Promise<string>;
|
|
23
|
+
decrypt(id: string): Promise<string>;
|
|
24
|
+
/**
|
|
25
|
+
* 注文番号生成設定を検索する
|
|
26
|
+
*/
|
|
27
|
+
private findSetting;
|
|
22
28
|
}
|
|
@@ -10,41 +10,41 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.OrderNumberRepo = void 0;
|
|
13
|
-
const cdigit = require("cdigit");
|
|
14
13
|
const moment = require("moment-timezone");
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
const transactionNumber_1 = require("./mongoose/schemas/transactionNumber");
|
|
14
|
+
const factory = require("../factory");
|
|
15
|
+
const transactionNumber_1 = require("../factory/transactionNumber");
|
|
16
|
+
const setting_1 = require("./mongoose/schemas/setting");
|
|
17
|
+
const transactionNumber_2 = require("./mongoose/schemas/transactionNumber");
|
|
20
18
|
const transactionNumberCounter_1 = require("./transactionNumberCounter");
|
|
21
19
|
const ORDER_NUMBER_SEPARATOR = '-';
|
|
20
|
+
const defaultVersioningForceProjects = [
|
|
21
|
+
'HMX',
|
|
22
|
+
'SMT',
|
|
23
|
+
'KOJ'
|
|
24
|
+
];
|
|
22
25
|
/**
|
|
23
26
|
* 注文番号リポジトリ
|
|
24
27
|
*/
|
|
25
28
|
class OrderNumberRepo {
|
|
26
29
|
constructor(params) {
|
|
27
|
-
// const { connection } = params;
|
|
28
|
-
// this.settingModel = connection.model(settingModelName, createSettingSchema());
|
|
29
30
|
this.counterRepo = new transactionNumberCounter_1.TransactionNumberCounterRepo(params);
|
|
31
|
+
this.settingModel = params.connection.model(setting_1.modelName, (0, setting_1.createSchema)());
|
|
30
32
|
}
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
//
|
|
35
|
-
//
|
|
36
|
-
//
|
|
37
|
-
//
|
|
38
|
-
//
|
|
39
|
-
// params.projectPrefix,
|
|
40
|
-
// params.timestamp
|
|
41
|
-
// );
|
|
33
|
+
// public static GENERATE_VERSION0(timestamp: string, seq: number): string {
|
|
34
|
+
// let orderNumber = `${timestamp}${seq}`;
|
|
35
|
+
// // checkdigit
|
|
36
|
+
// const cd = cdigit.luhn.compute(orderNumber);
|
|
37
|
+
// orderNumber = fpe({ password: cd })
|
|
38
|
+
// .encrypt(orderNumber);
|
|
39
|
+
// orderNumber = `${cd}${orderNumber}`;
|
|
40
|
+
// return orderNumber;
|
|
42
41
|
// }
|
|
43
42
|
/**
|
|
44
43
|
* タイムスタンプから発行する
|
|
45
44
|
*/
|
|
46
45
|
publishByTimestamp(params) {
|
|
47
46
|
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
const { fpeSecret, version, validFrom, versioningForceProjects, versioningExceptionProjects } = yield this.findSetting();
|
|
48
48
|
const timestamp = moment(params.orderDate)
|
|
49
49
|
.valueOf()
|
|
50
50
|
.toString();
|
|
@@ -53,31 +53,106 @@ class OrderNumberRepo {
|
|
|
53
53
|
let dataFeedExpires;
|
|
54
54
|
const dataFeedIdentifier = `${projectPrefix}:${timestamp}`;
|
|
55
55
|
let incrReply;
|
|
56
|
-
// const useMongoBySettings = await this.useMongoBySettings(params);
|
|
57
56
|
dataFeedExpires = moment(params.orderDate)
|
|
58
57
|
.add(1, 'minute') // ミリ秒でカウントしていくので、注文日時後1分で十分
|
|
59
58
|
.toDate();
|
|
60
59
|
incrReply = yield this.counterRepo.incrementByMongo({
|
|
61
60
|
identifier: dataFeedIdentifier,
|
|
62
|
-
includedInDataCatalog: { identifier:
|
|
61
|
+
includedInDataCatalog: { identifier: transactionNumber_2.DataCatalogIdentifier.orderNumber },
|
|
63
62
|
expires: dataFeedExpires
|
|
64
63
|
});
|
|
65
|
-
let orderNumber
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
orderNumber.
|
|
78
|
-
|
|
64
|
+
let orderNumber;
|
|
65
|
+
let useVersioning = (validFrom instanceof Date && moment(validFrom)
|
|
66
|
+
.isSameOrBefore(params.orderDate))
|
|
67
|
+
// versioningForceProjectsであれば強制的にversioning(2026-02-05~)
|
|
68
|
+
|| versioningForceProjects.includes(projectPrefix);
|
|
69
|
+
// versioningExceptionProjectsであれば強制的にversioning不使用(2026-02-10~)
|
|
70
|
+
if (versioningExceptionProjects.includes(projectPrefix)) {
|
|
71
|
+
useVersioning = false;
|
|
72
|
+
}
|
|
73
|
+
if (typeof fpeSecret === 'string' && typeof version === 'string' && useVersioning) {
|
|
74
|
+
const transactionFactory = new transactionNumber_1.TransactionNumberFactory({ fpeSecret, version });
|
|
75
|
+
orderNumber = transactionFactory.generate(timestamp, incrReply);
|
|
76
|
+
orderNumber = `${projectPrefix.at(0)}${orderNumber}`; // 桁数をversion0に合わせるためにエイリアスの1文字目のみを採用
|
|
77
|
+
orderNumber = `${[
|
|
78
|
+
// tslint:disable-next-line:no-magic-numbers
|
|
79
|
+
orderNumber.slice(0, 4),
|
|
80
|
+
// tslint:disable-next-line:no-magic-numbers
|
|
81
|
+
orderNumber.slice(4, 11),
|
|
82
|
+
// tslint:disable-next-line:no-magic-numbers
|
|
83
|
+
orderNumber.slice(11)
|
|
84
|
+
].join(ORDER_NUMBER_SEPARATOR)}`;
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
// discontinue version0(2026-02-13~)
|
|
88
|
+
throw new factory.errors.NotImplemented('orderNumber with no version discontinued');
|
|
89
|
+
// orderNumber = OrderNumberRepo.GENERATE_VERSION0(timestamp, incrReply);
|
|
90
|
+
// orderNumber = `${projectPrefix}${orderNumber}`;
|
|
91
|
+
// orderNumber = `${[
|
|
92
|
+
// // tslint:disable-next-line:no-magic-numbers
|
|
93
|
+
// orderNumber.slice(0, 4),
|
|
94
|
+
// // tslint:disable-next-line:no-magic-numbers
|
|
95
|
+
// orderNumber.slice(4, 11),
|
|
96
|
+
// // tslint:disable-next-line:no-magic-numbers
|
|
97
|
+
// orderNumber.slice(11)
|
|
98
|
+
// ].join(ORDER_NUMBER_SEPARATOR)}`;
|
|
99
|
+
}
|
|
79
100
|
return orderNumber;
|
|
80
101
|
});
|
|
81
102
|
}
|
|
103
|
+
decrypt(id) {
|
|
104
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
105
|
+
const { fpeSecret, version } = yield this.findSetting();
|
|
106
|
+
if (typeof fpeSecret === 'string' && typeof version === 'string') {
|
|
107
|
+
const transactionFactory = new transactionNumber_1.TransactionNumberFactory({ fpeSecret, version });
|
|
108
|
+
const originalOrderNumber = id.replace(/-/g, '')
|
|
109
|
+
// tslint:disable-next-line:no-magic-numbers
|
|
110
|
+
.slice(1);
|
|
111
|
+
return transactionFactory.decrypt(originalOrderNumber);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
throw new factory.errors.NotImplemented('no version not implemented');
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* 注文番号生成設定を検索する
|
|
120
|
+
*/
|
|
121
|
+
findSetting() {
|
|
122
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
123
|
+
const filterQuery = { 'project.id': { $eq: '*' } };
|
|
124
|
+
const projection = {
|
|
125
|
+
_id: 0,
|
|
126
|
+
orderNumber: 1
|
|
127
|
+
};
|
|
128
|
+
const setting = yield this.settingModel.findOne(filterQuery, projection)
|
|
129
|
+
.lean()
|
|
130
|
+
.exec();
|
|
131
|
+
if (setting === null || setting.orderNumber === undefined) {
|
|
132
|
+
return {
|
|
133
|
+
versioningForceProjects: [],
|
|
134
|
+
versioningExceptionProjects: []
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
const { fpeSecret, version, validFrom, versioningForceProjects, versioningExceptionProjects } = setting.orderNumber;
|
|
138
|
+
if (typeof fpeSecret !== 'string' || fpeSecret === '') {
|
|
139
|
+
throw new factory.errors.NotFound('setting.orderNumber.secret');
|
|
140
|
+
}
|
|
141
|
+
if (typeof version !== 'string' || version === '') {
|
|
142
|
+
throw new factory.errors.NotFound('setting.orderNumber.version');
|
|
143
|
+
}
|
|
144
|
+
if (!(validFrom instanceof Date)) {
|
|
145
|
+
throw new factory.errors.NotFound('setting.orderNumber.validFrom must be Date');
|
|
146
|
+
}
|
|
147
|
+
return {
|
|
148
|
+
fpeSecret, version, validFrom,
|
|
149
|
+
versioningForceProjects: [
|
|
150
|
+
...(Array.isArray(versioningForceProjects)) ? versioningForceProjects : [],
|
|
151
|
+
...defaultVersioningForceProjects
|
|
152
|
+
],
|
|
153
|
+
versioningExceptionProjects: (Array.isArray(versioningExceptionProjects)) ? versioningExceptionProjects : []
|
|
154
|
+
};
|
|
155
|
+
});
|
|
156
|
+
}
|
|
82
157
|
}
|
|
83
158
|
exports.OrderNumberRepo = OrderNumberRepo;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { BulkWriteResult } from 'mongodb';
|
|
2
|
+
import { Connection } from 'mongoose';
|
|
3
|
+
import * as factory from '../../factory';
|
|
4
|
+
/**
|
|
5
|
+
* ゲートを操作する組織
|
|
6
|
+
*/
|
|
7
|
+
interface IOperator {
|
|
8
|
+
/**
|
|
9
|
+
* 施設ID
|
|
10
|
+
*/
|
|
11
|
+
id: string;
|
|
12
|
+
}
|
|
13
|
+
type IEntranceGate = Pick<factory.place.entranceGate.IEntranceGate, 'identifier' | 'name'>;
|
|
14
|
+
type ICreatingEntranceGate = Pick<factory.place.entranceGate.IEntranceGate, 'identifier' | 'name'>;
|
|
15
|
+
interface IUpdateOptions {
|
|
16
|
+
project: {
|
|
17
|
+
id: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 施設の入場ゲートリポジトリ
|
|
22
|
+
*/
|
|
23
|
+
export declare class EntranceGateRepo {
|
|
24
|
+
/**
|
|
25
|
+
* 施設
|
|
26
|
+
*/
|
|
27
|
+
private readonly operator;
|
|
28
|
+
private readonly civicStructureModel;
|
|
29
|
+
constructor(connection: Connection, operater: IOperator);
|
|
30
|
+
/**
|
|
31
|
+
* リポジトリの施設をセットする
|
|
32
|
+
*/
|
|
33
|
+
setOperatorId(params: {
|
|
34
|
+
id: string;
|
|
35
|
+
}): void;
|
|
36
|
+
findEntranceGates(params: factory.place.entranceGate.ISearchConditions): Promise<IEntranceGate[]>;
|
|
37
|
+
addEntranceGatesByIdentifierIfNotExist(params: {
|
|
38
|
+
$set: ICreatingEntranceGate;
|
|
39
|
+
}[], options: IUpdateOptions): Promise<{
|
|
40
|
+
bulkWriteResult?: BulkWriteResult;
|
|
41
|
+
}>;
|
|
42
|
+
updateEntranceGatesByIdentifier(params: {
|
|
43
|
+
$set: ICreatingEntranceGate;
|
|
44
|
+
}[], options: IUpdateOptions): Promise<{
|
|
45
|
+
bulkWriteResult?: BulkWriteResult;
|
|
46
|
+
}>;
|
|
47
|
+
deleteEntranceGatesByIdentifier(params: {
|
|
48
|
+
/**
|
|
49
|
+
* ゲートコード
|
|
50
|
+
*/
|
|
51
|
+
identifier: string;
|
|
52
|
+
}[], options: IUpdateOptions): Promise<{
|
|
53
|
+
bulkWriteResult?: BulkWriteResult;
|
|
54
|
+
}>;
|
|
55
|
+
private createMatchStages;
|
|
56
|
+
}
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.EntranceGateRepo = void 0;
|
|
13
|
+
const mongoose_1 = require("mongoose");
|
|
14
|
+
const factory = require("../../factory");
|
|
15
|
+
const settings_1 = require("../../settings");
|
|
16
|
+
const civicStructure_1 = require("../mongoose/schemas/civicStructure");
|
|
17
|
+
/**
|
|
18
|
+
* 施設の入場ゲートリポジトリ
|
|
19
|
+
*/
|
|
20
|
+
class EntranceGateRepo {
|
|
21
|
+
constructor(connection, operater) {
|
|
22
|
+
this.civicStructureModel = connection.model(civicStructure_1.modelName, (0, civicStructure_1.createSchema)());
|
|
23
|
+
this.operator = operater;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* リポジトリの施設をセットする
|
|
27
|
+
*/
|
|
28
|
+
setOperatorId(params) {
|
|
29
|
+
this.operator.id = params.id;
|
|
30
|
+
}
|
|
31
|
+
findEntranceGates(params) {
|
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
const aggregate = this.civicStructureModel.aggregate([
|
|
34
|
+
{
|
|
35
|
+
$unwind: {
|
|
36
|
+
path: '$hasEntranceGate'
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
...this.createMatchStages(params),
|
|
40
|
+
{ $sort: { 'hasEntranceGate.identifier': factory.sortType.Ascending } },
|
|
41
|
+
{
|
|
42
|
+
$project: {
|
|
43
|
+
_id: 0,
|
|
44
|
+
identifier: '$hasEntranceGate.identifier',
|
|
45
|
+
name: '$hasEntranceGate.name'
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
]);
|
|
49
|
+
const { limit, page } = params;
|
|
50
|
+
if (typeof limit === 'number' && limit > 0) {
|
|
51
|
+
const pageMustBePositive = (typeof page === 'number' && page > 0) ? page : 1;
|
|
52
|
+
aggregate.skip(limit * (pageMustBePositive - 1))
|
|
53
|
+
.limit(limit);
|
|
54
|
+
}
|
|
55
|
+
return aggregate.option({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
56
|
+
.exec();
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
addEntranceGatesByIdentifierIfNotExist(params, options) {
|
|
60
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
const { project } = options;
|
|
62
|
+
const movieTheaterId = new mongoose_1.Types.ObjectId(this.operator.id);
|
|
63
|
+
const bulkWriteOps = [];
|
|
64
|
+
if (Array.isArray(params)) {
|
|
65
|
+
params.forEach(({ $set }) => {
|
|
66
|
+
const { identifier, name } = $set;
|
|
67
|
+
// ゲートを含まない施設があれば
|
|
68
|
+
const filter = {
|
|
69
|
+
'project.id': { $eq: project.id },
|
|
70
|
+
_id: { $eq: movieTheaterId },
|
|
71
|
+
'hasEntranceGate.identifier': { $ne: identifier }
|
|
72
|
+
};
|
|
73
|
+
const creatingEntranceGate = Object.assign({ identifier, typeOf: factory.placeType.Place }, (typeof (name === null || name === void 0 ? void 0 : name.ja) === 'string' || typeof (name === null || name === void 0 ? void 0 : name.en) === 'string') ? { name } : undefined);
|
|
74
|
+
// ゲートをpush
|
|
75
|
+
const update = {
|
|
76
|
+
$push: { hasEntranceGate: creatingEntranceGate }
|
|
77
|
+
};
|
|
78
|
+
const updateOne = { filter, update };
|
|
79
|
+
bulkWriteOps.push({ updateOne });
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
if (bulkWriteOps.length > 0) {
|
|
83
|
+
const bulkWriteResult = yield this.civicStructureModel.bulkWrite(bulkWriteOps, { ordered: false });
|
|
84
|
+
return { bulkWriteResult };
|
|
85
|
+
}
|
|
86
|
+
return {};
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
updateEntranceGatesByIdentifier(params, options) {
|
|
90
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
91
|
+
const { project } = options;
|
|
92
|
+
const movieTheaterId = new mongoose_1.Types.ObjectId(this.operator.id);
|
|
93
|
+
const bulkWriteOps = [];
|
|
94
|
+
if (Array.isArray(params)) {
|
|
95
|
+
params.forEach(({ $set }) => {
|
|
96
|
+
const { identifier, name } = $set;
|
|
97
|
+
// ゲートを含む施設があれば
|
|
98
|
+
const filter = {
|
|
99
|
+
'project.id': { $eq: project.id },
|
|
100
|
+
_id: { $eq: movieTheaterId },
|
|
101
|
+
'hasEntranceGate.identifier': { $eq: identifier }
|
|
102
|
+
};
|
|
103
|
+
const updatingEntranceGate = Object.assign({ identifier, typeOf: factory.placeType.Place }, (typeof (name === null || name === void 0 ? void 0 : name.ja) === 'string' || typeof (name === null || name === void 0 ? void 0 : name.en) === 'string') ? { name } : undefined);
|
|
104
|
+
const update = {
|
|
105
|
+
$set: {
|
|
106
|
+
'hasEntranceGate.$[entranceGate]': updatingEntranceGate
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
// ゲートコードで$set
|
|
110
|
+
const arrayFilters = [
|
|
111
|
+
{ 'entranceGate.identifier': { $eq: identifier } }
|
|
112
|
+
];
|
|
113
|
+
const updateOne = { filter, update, arrayFilters };
|
|
114
|
+
bulkWriteOps.push({ updateOne });
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
if (bulkWriteOps.length > 0) {
|
|
118
|
+
const bulkWriteResult = yield this.civicStructureModel.bulkWrite(bulkWriteOps, { ordered: false });
|
|
119
|
+
return { bulkWriteResult };
|
|
120
|
+
}
|
|
121
|
+
return {};
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
deleteEntranceGatesByIdentifier(params, options) {
|
|
125
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
126
|
+
const { project } = options;
|
|
127
|
+
const movieTheaterId = new mongoose_1.Types.ObjectId(this.operator.id);
|
|
128
|
+
const bulkWriteOps = [];
|
|
129
|
+
if (Array.isArray(params)) {
|
|
130
|
+
params.forEach(({ identifier }) => {
|
|
131
|
+
// ゲートを含む施設があれば
|
|
132
|
+
const filter = {
|
|
133
|
+
'project.id': { $eq: project.id },
|
|
134
|
+
_id: { $eq: movieTheaterId },
|
|
135
|
+
'hasEntranceGate.identifier': { $eq: identifier }
|
|
136
|
+
};
|
|
137
|
+
// ゲートをpull
|
|
138
|
+
const update = {
|
|
139
|
+
$pull: { hasEntranceGate: { identifier: { $eq: identifier } } }
|
|
140
|
+
};
|
|
141
|
+
const updateOne = { filter, update };
|
|
142
|
+
bulkWriteOps.push({ updateOne });
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
if (bulkWriteOps.length > 0) {
|
|
146
|
+
const bulkWriteResult = yield this.civicStructureModel.bulkWrite(bulkWriteOps, { ordered: false });
|
|
147
|
+
return { bulkWriteResult };
|
|
148
|
+
}
|
|
149
|
+
return {};
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
createMatchStages(params) {
|
|
153
|
+
var _a, _b, _c, _d;
|
|
154
|
+
const matchStages = [
|
|
155
|
+
{ $match: { _id: { $eq: new mongoose_1.Types.ObjectId(this.operator.id) } } }
|
|
156
|
+
];
|
|
157
|
+
const projectIdEq = (_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
|
|
158
|
+
if (typeof projectIdEq === 'string') {
|
|
159
|
+
matchStages.push({ $match: { 'project.id': { $eq: projectIdEq } } });
|
|
160
|
+
}
|
|
161
|
+
const identifierEq = (_c = params.identifier) === null || _c === void 0 ? void 0 : _c.$eq;
|
|
162
|
+
if (typeof identifierEq === 'string') {
|
|
163
|
+
matchStages.push({ $match: { 'hasEntranceGate.identifier': { $eq: identifierEq } } });
|
|
164
|
+
}
|
|
165
|
+
const identifierIn = (_d = params.identifier) === null || _d === void 0 ? void 0 : _d.$in;
|
|
166
|
+
if (Array.isArray(identifierIn)) {
|
|
167
|
+
matchStages.push({ $match: { 'hasEntranceGate.identifier': { $in: identifierIn } } });
|
|
168
|
+
}
|
|
169
|
+
return matchStages;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
exports.EntranceGateRepo = EntranceGateRepo;
|