@chevre/domain 23.2.0-alpha.2 → 23.2.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.
- package/example/src/chevre/actions/checkAuthorizePaymentActions.ts +55 -0
- package/example/src/chevre/event/importEventsFromCOAByTitle.ts +1 -1
- package/example/src/chevre/eventSeries/migrateEventSeriesOffers.ts +75 -0
- package/example/src/chevre/eventSeries/migrateEventSeriesVideoFormat.ts +80 -0
- package/example/src/chevre/place/adminEntranceGates.ts +68 -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/upsertSeatsByBranchCode.ts +72 -0
- package/example/src/chevre/reIndex.ts +1 -1
- package/example/src/chevre/roles/addAdminEventSeriesReadPermissionIfNotExists.ts +49 -0
- package/example/src/chevre/roles/addAdminMovieReadPermissionIfNotExists.ts +49 -0
- package/example/src/chevre/roles/addAdminMovieTheaterReadPermissionIfNotExists.ts +34 -0
- package/example/src/chevre/roles/addAdminMovieTheaterWritePermissionIfNotExists.ts +34 -0
- package/example/src/chevre/roles/addAdminRoomReadPermissionIfNotExists.ts +34 -0
- package/example/src/chevre/roles/addAdminRoomWritePermissionIfNotExists.ts +34 -0
- package/lib/chevre/repo/acceptedPaymentMethod.js +14 -10
- 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/creativeWork.js +9 -5
- package/lib/chevre/repo/eventSeries.js +16 -12
- package/lib/chevre/repo/mongoose/schemas/aggregateReservation.js +0 -1
- package/lib/chevre/repo/mongoose/schemas/creativeWork.js +10 -9
- package/lib/chevre/repo/mongoose/schemas/eventSeries.js +10 -0
- package/lib/chevre/repo/place/entranceGate.d.ts +58 -0
- package/lib/chevre/repo/place/entranceGate.js +159 -0
- package/lib/chevre/repo/place/movieTheater.d.ts +5 -2
- package/lib/chevre/repo/place/movieTheater.js +3 -1
- package/lib/chevre/repo/place/screeningRoom.d.ts +38 -31
- package/lib/chevre/repo/place/screeningRoom.js +166 -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 +36 -30
- package/lib/chevre/repo/place/section.js +214 -130
- package/lib/chevre/repository.d.ts +8 -0
- package/lib/chevre/repository.js +16 -0
- package/lib/chevre/service/assetTransaction/pay/validateAcceptedPaymentMethodIfNeeded.d.ts +6 -1
- package/lib/chevre/service/assetTransaction/pay/validateAcceptedPaymentMethodIfNeeded.js +26 -4
- package/lib/chevre/service/assetTransaction/pay.d.ts +3 -0
- package/lib/chevre/service/event/processUpdateMovieTheater.d.ts +1 -1
- package/lib/chevre/service/event/processUpdateMovieTheater.js +1 -1
- package/lib/chevre/service/event/saveScreeningEvents.d.ts +1 -1
- package/lib/chevre/service/event/saveScreeningEvents.js +1 -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/onEventChanged.js +7 -5
- package/lib/chevre/service/payment/any/factory.d.ts +5 -0
- package/lib/chevre/service/payment/any/factory.js +11 -2
- package/lib/chevre/service/payment/any.d.ts +8 -0
- package/lib/chevre/service/payment/any.js +3 -2
- package/lib/chevre/service/task/authorizePayment.js +3 -1
- package/lib/chevre/service/task/createEvent/createEventBySchedule/factory.d.ts +1 -1
- package/lib/chevre/service/task/createEvent/createEventBySchedule/factory.js +2 -2
- package/lib/chevre/service/task/createEvent/createEventBySchedule/schedule2events.js +1 -1
- package/lib/chevre/service/task/onResourceUpdated.js +2 -2
- package/lib/chevre/service/task/publishPaymentUrl.js +3 -1
- package/lib/chevre/service/task/syncResourcesFromCOA.js +1 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/factory.d.ts +2 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +3 -1
- package/lib/chevre/service/transaction/placeOrder/confirm.js +3 -1
- package/package.json +3 -2
- package/lib/chevre/service/eventOld.d.ts +0 -60
- package/lib/chevre/service/eventOld.js +0 -864
|
@@ -226,24 +226,13 @@ class SeatRepo {
|
|
|
226
226
|
return matchStages;
|
|
227
227
|
}
|
|
228
228
|
// tslint:disable-next-line:max-func-body-length
|
|
229
|
-
createSeat(seat) {
|
|
229
|
+
createSeat(seat, options) {
|
|
230
230
|
return __awaiter(this, void 0, void 0, function* () {
|
|
231
|
-
var _a, _b
|
|
232
|
-
const
|
|
233
|
-
if (typeof (screeningRoomSection === null || screeningRoomSection === void 0 ? void 0 : screeningRoomSection.branchCode) !== 'string') {
|
|
234
|
-
throw new factory.errors.ArgumentNull('containedInPlace.branchCode');
|
|
235
|
-
}
|
|
236
|
-
const screeningRoom = screeningRoomSection.containedInPlace;
|
|
237
|
-
if (typeof (screeningRoom === null || screeningRoom === void 0 ? void 0 : screeningRoom.branchCode) !== 'string') {
|
|
238
|
-
throw new factory.errors.ArgumentNull('containedInPlace.containedInPlace.branchCode');
|
|
239
|
-
}
|
|
240
|
-
const movieTheater = screeningRoom.containedInPlace;
|
|
241
|
-
if (typeof (movieTheater === null || movieTheater === void 0 ? void 0 : movieTheater.branchCode) !== 'string') {
|
|
242
|
-
throw new factory.errors.ArgumentNull('containedInPlace.containedInPlace.containedInPlace.branchCode');
|
|
243
|
-
}
|
|
231
|
+
var _a, _b;
|
|
232
|
+
const { project, parentOrganization, movieTheaterCode, roomCode, sectionCode } = options;
|
|
244
233
|
// 施設存在確認
|
|
245
|
-
const movieTheaterDoc = yield this.civicStructureModel.findOne(Object.assign({ typeOf: { $eq: factory.placeType.MovieTheater }, 'project.id': { $eq:
|
|
246
|
-
? { 'parentOrganization.id': { $exists: true, $eq:
|
|
234
|
+
const movieTheaterDoc = yield this.civicStructureModel.findOne(Object.assign({ typeOf: { $eq: factory.placeType.MovieTheater }, 'project.id': { $eq: project.id }, branchCode: { $eq: movieTheaterCode } }, (typeof (parentOrganization === null || parentOrganization === void 0 ? void 0 : parentOrganization.id) === 'string')
|
|
235
|
+
? { 'parentOrganization.id': { $exists: true, $eq: parentOrganization.id } }
|
|
247
236
|
: undefined), { _id: 1 })
|
|
248
237
|
.lean()
|
|
249
238
|
.exec();
|
|
@@ -252,19 +241,19 @@ class SeatRepo {
|
|
|
252
241
|
}
|
|
253
242
|
const doc = yield this.placeModel.findOneAndUpdate({
|
|
254
243
|
typeOf: { $eq: factory.placeType.ScreeningRoom },
|
|
255
|
-
'project.id': { $eq:
|
|
256
|
-
'containedInPlace.branchCode': { $exists: true, $eq:
|
|
257
|
-
branchCode: { $eq:
|
|
258
|
-
'containsPlace.branchCode': { $eq:
|
|
244
|
+
'project.id': { $eq: project.id },
|
|
245
|
+
'containedInPlace.branchCode': { $exists: true, $eq: movieTheaterCode },
|
|
246
|
+
branchCode: { $eq: roomCode },
|
|
247
|
+
'containsPlace.branchCode': { $eq: sectionCode }
|
|
259
248
|
}, {
|
|
260
249
|
$push: {
|
|
261
|
-
'containsPlace.$[screeningRoomSection].containsPlace': Object.assign(Object.assign(Object.assign({ typeOf:
|
|
250
|
+
'containsPlace.$[screeningRoomSection].containsPlace': Object.assign(Object.assign(Object.assign({ typeOf: factory.placeType.Seat, branchCode: seat.branchCode, additionalProperty: seat.additionalProperty }, (typeof ((_a = seat.name) === null || _a === void 0 ? void 0 : _a.ja) === 'string' || typeof ((_b = seat.name) === null || _b === void 0 ? void 0 : _b.en) === 'string') ? { name: seat.name } : undefined), (Array.isArray(seat.seatingType)) ? { seatingType: seat.seatingType } : undefined), (seat.maximumAttendeeCapacity === 0) ? { maximumAttendeeCapacity: seat.maximumAttendeeCapacity } : undefined)
|
|
262
251
|
}
|
|
263
252
|
}, {
|
|
264
253
|
new: true,
|
|
265
254
|
arrayFilters: [
|
|
266
255
|
{
|
|
267
|
-
'screeningRoomSection.branchCode': { $eq:
|
|
256
|
+
'screeningRoomSection.branchCode': { $eq: sectionCode },
|
|
268
257
|
'screeningRoomSection.containsPlace.branchCode': { $ne: seat.branchCode }
|
|
269
258
|
}
|
|
270
259
|
],
|
|
@@ -278,25 +267,131 @@ class SeatRepo {
|
|
|
278
267
|
return doc.toObject();
|
|
279
268
|
});
|
|
280
269
|
}
|
|
281
|
-
|
|
282
|
-
|
|
270
|
+
/**
|
|
271
|
+
* コードをキーにして冪等追加
|
|
272
|
+
*/
|
|
273
|
+
addSeatsByBranchCodeIfNotExist(params, options) {
|
|
283
274
|
return __awaiter(this, void 0, void 0, function* () {
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
275
|
+
const { project, parentOrganization, movieTheaterCode, roomCode, sectionCode } = options;
|
|
276
|
+
// 施設存在確認
|
|
277
|
+
const movieTheaterDoc = yield this.civicStructureModel.findOne(Object.assign({ typeOf: { $eq: factory.placeType.MovieTheater }, 'project.id': { $eq: project.id }, branchCode: { $eq: movieTheaterCode } }, (typeof (parentOrganization === null || parentOrganization === void 0 ? void 0 : parentOrganization.id) === 'string')
|
|
278
|
+
? { 'parentOrganization.id': { $exists: true, $eq: parentOrganization.id } }
|
|
279
|
+
: undefined), { _id: 1 })
|
|
280
|
+
.lean()
|
|
281
|
+
.exec();
|
|
282
|
+
if (movieTheaterDoc === null) {
|
|
283
|
+
throw new factory.errors.NotFound(factory.placeType.MovieTheater);
|
|
288
284
|
}
|
|
289
|
-
const
|
|
290
|
-
if (
|
|
291
|
-
|
|
285
|
+
const bulkWriteOps = [];
|
|
286
|
+
if (Array.isArray(params)) {
|
|
287
|
+
// セクションの存在するドキュメントでフィルター
|
|
288
|
+
const filter = {
|
|
289
|
+
typeOf: { $eq: factory.placeType.ScreeningRoom },
|
|
290
|
+
'project.id': { $eq: project.id },
|
|
291
|
+
'containedInPlace.branchCode': { $exists: true, $eq: movieTheaterCode },
|
|
292
|
+
branchCode: { $eq: roomCode },
|
|
293
|
+
'containsPlace.branchCode': { $eq: sectionCode }
|
|
294
|
+
};
|
|
295
|
+
params.forEach(({ $set }) => {
|
|
296
|
+
var _a, _b;
|
|
297
|
+
const setFields = __rest($set, []);
|
|
298
|
+
const pushingSeat = Object.assign(Object.assign(Object.assign(Object.assign({ typeOf: factory.placeType.Seat, branchCode: setFields.branchCode }, (typeof ((_a = setFields.name) === null || _a === void 0 ? void 0 : _a.ja) === 'string' || typeof ((_b = setFields.name) === null || _b === void 0 ? void 0 : _b.en) === 'string')
|
|
299
|
+
? { name: setFields.name }
|
|
300
|
+
: undefined), (Array.isArray(setFields.seatingType)) ? { seatingType: setFields.seatingType } : undefined), (Array.isArray(setFields.additionalProperty)) ? { additionalProperty: setFields.additionalProperty } : undefined), (setFields.maximumAttendeeCapacity === 0)
|
|
301
|
+
? { maximumAttendeeCapacity: setFields.maximumAttendeeCapacity }
|
|
302
|
+
: undefined);
|
|
303
|
+
const updateFilter = {
|
|
304
|
+
$push: { 'containsPlace.$[screeningRoomSection].containsPlace': pushingSeat }
|
|
305
|
+
};
|
|
306
|
+
const arrayFilters = [
|
|
307
|
+
{
|
|
308
|
+
'screeningRoomSection.branchCode': { $eq: sectionCode }, // セクションに
|
|
309
|
+
'screeningRoomSection.containsPlace.branchCode': { $ne: pushingSeat.branchCode } // 座席が存在しなければ
|
|
310
|
+
}
|
|
311
|
+
];
|
|
312
|
+
const updateOne = {
|
|
313
|
+
filter,
|
|
314
|
+
update: updateFilter,
|
|
315
|
+
arrayFilters
|
|
316
|
+
};
|
|
317
|
+
bulkWriteOps.push({ updateOne });
|
|
318
|
+
});
|
|
292
319
|
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
320
|
+
if (bulkWriteOps.length > 0) {
|
|
321
|
+
const bulkWriteResult = yield this.placeModel.bulkWrite(bulkWriteOps, { ordered: false });
|
|
322
|
+
return { bulkWriteResult };
|
|
296
323
|
}
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* コードをキーにして冪等編集
|
|
328
|
+
*/
|
|
329
|
+
updateSeatsByBranchCode(params, options) {
|
|
330
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
331
|
+
const { project, parentOrganization, movieTheaterCode, roomCode, sectionCode } = options;
|
|
332
|
+
const bulkWriteOps = [];
|
|
333
|
+
if (Array.isArray(params)) {
|
|
334
|
+
params.forEach(({ $set, $unset }) => {
|
|
335
|
+
var _a, _b;
|
|
336
|
+
// 座席の存在するドキュメントでフィルター
|
|
337
|
+
const filter = Object.assign({ typeOf: { $eq: factory.placeType.ScreeningRoom }, 'project.id': { $eq: project.id }, 'containedInPlace.branchCode': { $exists: true, $eq: movieTheaterCode }, branchCode: { $eq: roomCode }, 'containsPlace.branchCode': { $eq: sectionCode }, 'containsPlace.containsPlace.branchCode': { $eq: $set.branchCode } }, (typeof (parentOrganization === null || parentOrganization === void 0 ? void 0 : parentOrganization.id) === 'string')
|
|
338
|
+
? { 'parentOrganization.id': { $exists: true, $eq: parentOrganization.id } }
|
|
339
|
+
: undefined);
|
|
340
|
+
const setFields = __rest($set, []);
|
|
341
|
+
const updateFilter = {
|
|
342
|
+
$set: Object.assign(Object.assign(Object.assign(Object.assign({ 'containsPlace.$[screeningRoomSection].containsPlace.$[seat].branchCode': setFields.branchCode }, (typeof ((_a = setFields.name) === null || _a === void 0 ? void 0 : _a.ja) === 'string' || typeof ((_b = setFields.name) === null || _b === void 0 ? void 0 : _b.en) === 'string')
|
|
343
|
+
? {
|
|
344
|
+
'containsPlace.$[screeningRoomSection].containsPlace.$[seat].name': setFields.name
|
|
345
|
+
}
|
|
346
|
+
: undefined), (Array.isArray(setFields.seatingType))
|
|
347
|
+
? {
|
|
348
|
+
'containsPlace.$[screeningRoomSection].containsPlace.$[seat].seatingType': setFields.seatingType
|
|
349
|
+
}
|
|
350
|
+
: undefined), (Array.isArray(setFields.additionalProperty))
|
|
351
|
+
? {
|
|
352
|
+
// tslint:disable-next-line:max-line-length
|
|
353
|
+
'containsPlace.$[screeningRoomSection].containsPlace.$[seat].additionalProperty': setFields.additionalProperty
|
|
354
|
+
}
|
|
355
|
+
: undefined), (setFields.maximumAttendeeCapacity === 0)
|
|
356
|
+
? {
|
|
357
|
+
// tslint:disable-next-line:max-line-length
|
|
358
|
+
'containsPlace.$[screeningRoomSection].containsPlace.$[seat].maximumAttendeeCapacity': setFields.maximumAttendeeCapacity
|
|
359
|
+
}
|
|
360
|
+
: undefined),
|
|
361
|
+
$unset: Object.assign(Object.assign(Object.assign({}, (($unset === null || $unset === void 0 ? void 0 : $unset.name) === 1)
|
|
362
|
+
? { 'containsPlace.$[screeningRoomSection].containsPlace.$[seat].name': 1 }
|
|
363
|
+
: undefined), (($unset === null || $unset === void 0 ? void 0 : $unset.seatingType) === 1)
|
|
364
|
+
? { 'containsPlace.$[screeningRoomSection].containsPlace.$[seat].seatingType': 1 }
|
|
365
|
+
: undefined), (($unset === null || $unset === void 0 ? void 0 : $unset.maximumAttendeeCapacity) === 1)
|
|
366
|
+
? { 'containsPlace.$[screeningRoomSection].containsPlace.$[seat].maximumAttendeeCapacity': 1 }
|
|
367
|
+
: undefined)
|
|
368
|
+
};
|
|
369
|
+
const arrayFilters = [
|
|
370
|
+
{ 'screeningRoomSection.branchCode': { $eq: sectionCode } },
|
|
371
|
+
{ 'seat.branchCode': { $eq: setFields.branchCode } }
|
|
372
|
+
];
|
|
373
|
+
const updateOne = {
|
|
374
|
+
filter,
|
|
375
|
+
update: updateFilter,
|
|
376
|
+
arrayFilters
|
|
377
|
+
};
|
|
378
|
+
bulkWriteOps.push({ updateOne });
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
if (bulkWriteOps.length > 0) {
|
|
382
|
+
const bulkWriteResult = yield this.placeModel.bulkWrite(bulkWriteOps, { ordered: false });
|
|
383
|
+
return { bulkWriteResult };
|
|
384
|
+
}
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
388
|
+
updateSeatByBranchCode(seat, $unset, options) {
|
|
389
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
390
|
+
var _a, _b;
|
|
391
|
+
const { project, parentOrganization, movieTheaterCode, roomCode, sectionCode } = options;
|
|
392
|
+
const doc = yield this.placeModel.findOneAndUpdate(Object.assign({ typeOf: { $eq: factory.placeType.ScreeningRoom }, 'project.id': { $eq: project.id }, 'containedInPlace.branchCode': { $exists: true, $eq: movieTheaterCode }, branchCode: { $eq: roomCode }, 'containsPlace.branchCode': { $eq: sectionCode }, 'containsPlace.containsPlace.branchCode': { $eq: seat.branchCode } }, (typeof (parentOrganization === null || parentOrganization === void 0 ? void 0 : parentOrganization.id) === 'string')
|
|
393
|
+
? { 'parentOrganization.id': { $exists: true, $eq: parentOrganization.id } }
|
|
394
|
+
: undefined), Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ 'containsPlace.$[screeningRoomSection].containsPlace.$[seat].branchCode': seat.branchCode }, (typeof ((_a = seat.name) === null || _a === void 0 ? void 0 : _a.ja) === 'string' || typeof ((_b = seat.name) === null || _b === void 0 ? void 0 : _b.en) === 'string')
|
|
300
395
|
? {
|
|
301
396
|
'containsPlace.$[screeningRoomSection].containsPlace.$[seat].name': seat.name
|
|
302
397
|
}
|
|
@@ -333,7 +428,7 @@ class SeatRepo {
|
|
|
333
428
|
: undefined) }), {
|
|
334
429
|
new: true,
|
|
335
430
|
arrayFilters: [
|
|
336
|
-
{ 'screeningRoomSection.branchCode': { $eq:
|
|
431
|
+
{ 'screeningRoomSection.branchCode': { $eq: sectionCode } },
|
|
337
432
|
{ 'seat.branchCode': { $eq: seat.branchCode } }
|
|
338
433
|
],
|
|
339
434
|
projection: { 'containedInPlace.id': 1, typeOf: 1 }
|
|
@@ -585,14 +680,49 @@ class SeatRepo {
|
|
|
585
680
|
return (result !== undefined) ? result.seatingTypes : [];
|
|
586
681
|
});
|
|
587
682
|
}
|
|
588
|
-
|
|
683
|
+
/**
|
|
684
|
+
* コードをキーにして冪等削除
|
|
685
|
+
*/
|
|
686
|
+
deleteSeatsByBranchCode(params, options) {
|
|
687
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
688
|
+
const { project, parentOrganization, movieTheaterCode, roomCode, sectionCode } = options;
|
|
689
|
+
const bulkWriteOps = [];
|
|
690
|
+
if (Array.isArray(params)) {
|
|
691
|
+
params.forEach(({ branchCode }) => {
|
|
692
|
+
// 座席の存在するドキュメントでフィルター
|
|
693
|
+
const filter = Object.assign({ typeOf: { $eq: factory.placeType.ScreeningRoom }, 'project.id': { $eq: project.id }, 'containedInPlace.branchCode': { $exists: true, $eq: movieTheaterCode }, branchCode: { $eq: roomCode }, 'containsPlace.branchCode': { $eq: sectionCode }, 'containsPlace.containsPlace.branchCode': { $eq: branchCode } }, (typeof (parentOrganization === null || parentOrganization === void 0 ? void 0 : parentOrganization.id) === 'string')
|
|
694
|
+
? { 'parentOrganization.id': { $exists: true, $eq: parentOrganization.id } }
|
|
695
|
+
: undefined);
|
|
696
|
+
const updateFilter = {
|
|
697
|
+
$pull: {
|
|
698
|
+
'containsPlace.$[screeningRoomSection].containsPlace': { branchCode }
|
|
699
|
+
}
|
|
700
|
+
};
|
|
701
|
+
const arrayFilters = [
|
|
702
|
+
{ 'screeningRoomSection.branchCode': { $eq: sectionCode } }
|
|
703
|
+
];
|
|
704
|
+
const updateOne = {
|
|
705
|
+
filter,
|
|
706
|
+
update: updateFilter,
|
|
707
|
+
arrayFilters
|
|
708
|
+
};
|
|
709
|
+
bulkWriteOps.push({ updateOne });
|
|
710
|
+
});
|
|
711
|
+
}
|
|
712
|
+
if (bulkWriteOps.length > 0) {
|
|
713
|
+
const bulkWriteResult = yield this.placeModel.bulkWrite(bulkWriteOps, { ordered: false });
|
|
714
|
+
return { bulkWriteResult };
|
|
715
|
+
}
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
deleteSeatByBranchCode(seat, options) {
|
|
589
719
|
return __awaiter(this, void 0, void 0, function* () {
|
|
590
|
-
|
|
591
|
-
const doc = yield this.placeModel.findOneAndUpdate(Object.assign({ typeOf: { $eq: factory.placeType.ScreeningRoom }, 'project.id': { $eq:
|
|
720
|
+
const { project, parentOrganization, movieTheaterCode, roomCode, sectionCode } = options;
|
|
721
|
+
const doc = yield this.placeModel.findOneAndUpdate(Object.assign({ typeOf: { $eq: factory.placeType.ScreeningRoom }, 'project.id': { $eq: project.id }, 'containedInPlace.branchCode': {
|
|
592
722
|
$exists: true,
|
|
593
|
-
$eq:
|
|
594
|
-
}, branchCode: { $eq:
|
|
595
|
-
? { 'parentOrganization.id': { $exists: true, $eq:
|
|
723
|
+
$eq: movieTheaterCode
|
|
724
|
+
}, branchCode: { $eq: roomCode }, 'containsPlace.branchCode': { $eq: sectionCode }, 'containsPlace.containsPlace.branchCode': { $eq: seat.branchCode } }, (typeof (parentOrganization === null || parentOrganization === void 0 ? void 0 : parentOrganization.id) === 'string')
|
|
725
|
+
? { 'parentOrganization.id': { $exists: true, $eq: parentOrganization.id } }
|
|
596
726
|
: undefined), {
|
|
597
727
|
$pull: {
|
|
598
728
|
'containsPlace.$[screeningRoomSection].containsPlace': {
|
|
@@ -602,7 +732,7 @@ class SeatRepo {
|
|
|
602
732
|
}, {
|
|
603
733
|
new: true,
|
|
604
734
|
arrayFilters: [
|
|
605
|
-
{ 'screeningRoomSection.branchCode': { $eq:
|
|
735
|
+
{ 'screeningRoomSection.branchCode': { $eq: sectionCode } }
|
|
606
736
|
],
|
|
607
737
|
projection: { 'containedInPlace.id': 1, typeOf: 1 }
|
|
608
738
|
})
|
|
@@ -1,6 +1,18 @@
|
|
|
1
|
-
import type { Connection } from 'mongoose';
|
|
1
|
+
import type { Connection, PipelineStage } from 'mongoose';
|
|
2
2
|
import * as factory from '../../factory';
|
|
3
3
|
type IScreeningRoomSectionWithoutContainsPlace = Omit<factory.place.screeningRoomSection.IPlace, 'containsPlace'>;
|
|
4
|
+
type ICreatingSection = Pick<factory.place.screeningRoomSection.IPlace, 'additionalProperty' | 'branchCode' | 'name'>;
|
|
5
|
+
type IMatchStage = PipelineStage.Match;
|
|
6
|
+
interface IUpdateOptions {
|
|
7
|
+
project: {
|
|
8
|
+
id: string;
|
|
9
|
+
};
|
|
10
|
+
parentOrganization?: {
|
|
11
|
+
id?: string;
|
|
12
|
+
};
|
|
13
|
+
movieTheaterCode: string;
|
|
14
|
+
roomCode: string;
|
|
15
|
+
}
|
|
4
16
|
/**
|
|
5
17
|
* セクション編集時レスポンス
|
|
6
18
|
*/
|
|
@@ -20,22 +32,34 @@ export declare class SectionRepo {
|
|
|
20
32
|
private readonly civicStructureModel;
|
|
21
33
|
private readonly placeModel;
|
|
22
34
|
constructor(connection: Connection);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
35
|
+
static CREATE_SECTION_MONGO_CONDITIONS(searchConditions: Omit<factory.place.screeningRoomSection.ISearchConditions, '$projection' | 'limit' | 'page'>): IMatchStage[];
|
|
36
|
+
createSection(screeningRoomSection: ICreatingSection, options: IUpdateOptions): Promise<IUpdateSectionResult>;
|
|
37
|
+
/**
|
|
38
|
+
* セクションの名称と追加特性を編集する
|
|
39
|
+
*/
|
|
40
|
+
updateSectionByBranchCode(screeningRoomSection: ICreatingSection, $unset: any, options: IUpdateOptions): Promise<IUpdateSectionResult>;
|
|
41
|
+
/**
|
|
42
|
+
* セクションの座席を上書きする
|
|
43
|
+
*/
|
|
44
|
+
overwriteSeats(screeningRoomSection: Pick<factory.place.screeningRoomSection.IPlace, 'branchCode' | 'containsPlace'>, options: IUpdateOptions): Promise<IUpdateSectionResult>;
|
|
45
|
+
migrateSectionIdentifier(screeningRoomSection: {
|
|
46
|
+
project: {
|
|
47
|
+
id: string;
|
|
26
48
|
};
|
|
27
|
-
|
|
28
|
-
|
|
49
|
+
identifier: string;
|
|
50
|
+
branchCode: string;
|
|
29
51
|
containedInPlace: {
|
|
30
52
|
branchCode: string;
|
|
31
53
|
containedInPlace: {
|
|
32
54
|
branchCode: string;
|
|
33
55
|
};
|
|
34
56
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
57
|
+
}): Promise<IUpdateSectionResult>;
|
|
58
|
+
/**
|
|
59
|
+
* 最小限のprojectionでセクション検索を再定義
|
|
60
|
+
* 2026-01-08~
|
|
61
|
+
*/
|
|
62
|
+
findSections(params: Omit<factory.place.screeningRoomSection.ISearchConditions, '$projection'>): Promise<Pick<factory.place.screeningRoomSection.IPlace, 'additionalProperty' | 'branchCode' | 'name'>[]>;
|
|
39
63
|
searchScreeningRoomSections(searchConditions: factory.place.screeningRoomSection.ISearchConditions): Promise<IScreeningRoomSectionWithoutContainsPlace[]>;
|
|
40
64
|
/**
|
|
41
65
|
* ルーム指定のセクション検索として再定義(2025-12-07~)
|
|
@@ -57,29 +81,11 @@ export declare class SectionRepo {
|
|
|
57
81
|
*/
|
|
58
82
|
roomCode: string;
|
|
59
83
|
}): Promise<Pick<IScreeningRoomSectionWithoutContainsPlace, 'additionalProperty' | 'branchCode' | 'name'>[]>;
|
|
60
|
-
|
|
61
|
-
project: {
|
|
62
|
-
id: string;
|
|
63
|
-
};
|
|
64
|
-
parentOrganization?: {
|
|
65
|
-
id?: string;
|
|
66
|
-
};
|
|
84
|
+
deleteSectionByBranchCode(screeningRoomSection: {
|
|
67
85
|
/**
|
|
68
86
|
* セクションコード
|
|
69
87
|
*/
|
|
70
88
|
branchCode: string;
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* ルームコード
|
|
74
|
-
*/
|
|
75
|
-
branchCode: string;
|
|
76
|
-
containedInPlace: {
|
|
77
|
-
/**
|
|
78
|
-
* 施設コード
|
|
79
|
-
*/
|
|
80
|
-
branchCode: string;
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
}): Promise<IUpdateSectionResult>;
|
|
89
|
+
}, options: IUpdateOptions): Promise<IUpdateSectionResult>;
|
|
84
90
|
}
|
|
85
91
|
export {};
|