@chevre/domain 23.1.0-alpha.9 → 23.2.0-alpha.0
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/{eventOffer/adminEventOffers.ts → acceptedPaymentMethodOffer/adminAcceptedPaymentMethodOffers.ts} +12 -11
- package/example/src/chevre/actions/checkAcceptPayActions.ts +60 -0
- package/example/src/chevre/assetTransaction/checkPayTransactionsTicketToken.ts +67 -0
- package/example/src/chevre/event/importEventSeriesFromCOAByTitle.ts +83 -0
- package/example/src/chevre/event/importEventsFromCOAByTitle.ts +148 -0
- package/example/src/chevre/eventSeries/migrateEventSeriesUnacceptedPaymentMethod.ts +93 -0
- package/example/src/chevre/importEventsFromCOA.ts +5 -5
- package/example/src/chevre/pendingReservation/findEventSeatOffersBySection.ts +46 -0
- package/example/src/chevre/place/checkSectionCount.ts +27 -0
- package/example/src/chevre/place/findSectionsByRoom.ts +50 -0
- package/example/src/chevre/project/unsetProjectSettings.ts +73 -0
- package/example/src/chevre/reIndex.ts +0 -1
- package/example/src/chevre/roles/{addAdminSellerEventIfNotExists.ts → addAdminSellerEventOfferIfNotExists.ts} +1 -1
- package/example/src/chevre/stockHolder/findSeatsBySection.ts +59 -0
- package/example/src/chevre/stockHolder/searchSeats.ts +2 -2
- package/lib/chevre/repo/acceptedPaymentMethod.d.ts +41 -0
- package/lib/chevre/repo/acceptedPaymentMethod.js +180 -0
- package/lib/chevre/repo/authorization.d.ts +3 -2
- package/lib/chevre/repo/authorization.js +13 -5
- package/lib/chevre/repo/event.d.ts +1 -35
- package/lib/chevre/repo/event.js +2 -102
- package/lib/chevre/repo/eventOffer.js +3 -3
- package/lib/chevre/repo/mongoose/schemas/acceptedPaymentMethod.d.ts +10 -0
- package/lib/chevre/repo/mongoose/schemas/acceptedPaymentMethod.js +97 -0
- package/lib/chevre/repo/mongoose/schemas/eventOffer.js +9 -0
- package/lib/chevre/repo/note.js +4 -2
- package/lib/chevre/repo/pendingReservation.js +28 -71
- package/lib/chevre/repo/place/seat.d.ts +24 -0
- package/lib/chevre/repo/place/seat.js +103 -21
- package/lib/chevre/repo/place/section.d.ts +20 -0
- package/lib/chevre/repo/place/section.js +47 -0
- package/lib/chevre/repo/ticket.d.ts +7 -1
- package/lib/chevre/repo/ticket.js +14 -1
- package/lib/chevre/repository.d.ts +5 -0
- package/lib/chevre/repository.js +15 -2
- package/lib/chevre/service/aggregation/event/importFromCOA.js +2 -2
- package/lib/chevre/service/assetTransaction/pay/factory.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/factory.js +8 -3
- package/lib/chevre/service/assetTransaction/pay/validateAcceptedPaymentMethodIfNeeded.d.ts +16 -0
- package/lib/chevre/service/assetTransaction/pay/validateAcceptedPaymentMethodIfNeeded.js +94 -0
- package/lib/chevre/service/assetTransaction/pay.d.ts +6 -1
- package/lib/chevre/service/assetTransaction/pay.js +6 -1
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/fixExtendedEventOffer.d.ts +1 -2
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/fixExtendedEventOffer.js +7 -7
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/validateIssuedOfferIfExists.d.ts +6 -2
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/validateIssuedOfferIfExists.js +30 -30
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/validateMemberTierIfExists.d.ts +0 -1
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/validateMemberTierIfExists.js +7 -51
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/verifyTicketTokenAsNeeded.js +6 -8
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.d.ts +29 -1
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.js +9 -9
- package/lib/chevre/service/event/factory.d.ts +22 -0
- package/lib/chevre/service/event/factory.js +2 -0
- package/lib/chevre/service/event/processUpdateMovieTheater.d.ts +24 -0
- package/lib/chevre/service/event/processUpdateMovieTheater.js +190 -0
- package/lib/chevre/service/event/saveScreeningEventSeries.d.ts +63 -0
- package/lib/chevre/service/event/saveScreeningEventSeries.js +277 -0
- package/lib/chevre/service/event/saveScreeningEvents.d.ts +46 -0
- package/lib/chevre/service/event/saveScreeningEvents.js +321 -0
- package/lib/chevre/service/event.d.ts +4 -34
- package/lib/chevre/service/event.js +12 -698
- package/lib/chevre/service/eventOld.d.ts +60 -0
- package/lib/chevre/service/eventOld.js +864 -0
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre/requestedProgramMembershipUsed2permit.js +1 -1
- package/lib/chevre/service/offer/event/issueEventOfferTicket.d.ts +48 -0
- package/lib/chevre/service/offer/event/issueEventOfferTicket.js +123 -0
- package/lib/chevre/service/offer/event.d.ts +2 -1
- package/lib/chevre/service/offer/event.js +3 -1
- package/lib/chevre/service/offer.d.ts +31 -1
- package/lib/chevre/service/offer.js +104 -34
- package/lib/chevre/service/payment/any/authorize/fixTransactionNumber.d.ts +9 -0
- package/lib/chevre/service/payment/any/authorize/fixTransactionNumber.js +22 -11
- package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.d.ts +19 -2
- package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.js +87 -9
- package/lib/chevre/service/payment/any/factory.d.ts +20 -3
- package/lib/chevre/service/payment/any/factory.js +26 -6
- package/lib/chevre/service/payment/any/publishPaymentUrl/fixTransactionNumberOnPublishPaymentUrl.d.ts +4 -0
- package/lib/chevre/service/payment/any/publishPaymentUrl/fixTransactionNumberOnPublishPaymentUrl.js +15 -11
- package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.d.ts +6 -3
- package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.js +8 -22
- package/lib/chevre/service/payment/any.d.ts +5 -1
- package/lib/chevre/service/payment/any.js +22 -13
- package/lib/chevre/service/payment/factory.js +0 -5
- package/lib/chevre/service/payment/movieTicket/authorize.js +0 -5
- package/lib/chevre/service/task/authorizePayment.js +2 -0
- package/lib/chevre/service/task/publishPaymentUrl.js +4 -0
- package/lib/chevre/service/transaction/placeOrder/confirm/publishCode.js +1 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/factory.d.ts +9 -0
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/factory.js +2 -0
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateInvoiceReferencesOrder.d.ts +8 -0
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateInvoiceReferencesOrder.js +45 -0
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/validatePrice.d.ts +3 -0
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/validatePrice.js +38 -0
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +2 -8
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +5 -35
- package/package.json +3 -3
- package/example/src/chevre/checkReplaceActions.ts +0 -65
- package/example/src/chevre/upsertManyEventsByAdditionalProperty.ts +0 -193
- package/lib/chevre/service/code.d.ts +0 -8
- package/lib/chevre/service/code.js +0 -7
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.modelName = exports.indexes = void 0;
|
|
4
|
+
exports.createSchema = createSchema;
|
|
5
|
+
const mongoose_1 = require("mongoose");
|
|
6
|
+
const settings_1 = require("../../../settings");
|
|
7
|
+
const writeConcern_1 = require("../writeConcern");
|
|
8
|
+
const modelName = 'AcceptedPaymentMethod';
|
|
9
|
+
exports.modelName = modelName;
|
|
10
|
+
const schemaDefinition = {
|
|
11
|
+
project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
12
|
+
seller: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
13
|
+
typeOf: { type: String, required: true },
|
|
14
|
+
identifier: { type: String, required: true },
|
|
15
|
+
itemOffered: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
16
|
+
validFrom: { type: Date, required: true },
|
|
17
|
+
validThrough: { type: Date, required: true },
|
|
18
|
+
acceptedPaymentMethod: { type: mongoose_1.SchemaTypes.Mixed, required: true }
|
|
19
|
+
// offeredBy: { type: SchemaTypes.Mixed, required: false }
|
|
20
|
+
};
|
|
21
|
+
const schemaOptions = {
|
|
22
|
+
autoIndex: settings_1.MONGO_AUTO_INDEX,
|
|
23
|
+
autoCreate: false,
|
|
24
|
+
collection: 'acceptedPaymentMethods',
|
|
25
|
+
id: true,
|
|
26
|
+
read: settings_1.MONGO_READ_PREFERENCE,
|
|
27
|
+
writeConcern: writeConcern_1.writeConcern,
|
|
28
|
+
strict: true,
|
|
29
|
+
strictQuery: false,
|
|
30
|
+
timestamps: false,
|
|
31
|
+
versionKey: false,
|
|
32
|
+
toJSON: {
|
|
33
|
+
getters: false,
|
|
34
|
+
virtuals: false,
|
|
35
|
+
minimize: false,
|
|
36
|
+
versionKey: false
|
|
37
|
+
},
|
|
38
|
+
toObject: {
|
|
39
|
+
getters: false,
|
|
40
|
+
virtuals: true,
|
|
41
|
+
minimize: false,
|
|
42
|
+
versionKey: false
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const indexes = [
|
|
46
|
+
[
|
|
47
|
+
{ validFrom: 1 },
|
|
48
|
+
{ name: 'validFrom' }
|
|
49
|
+
],
|
|
50
|
+
[
|
|
51
|
+
{ validThrough: 1, validFrom: 1 },
|
|
52
|
+
{ name: 'validThrough' }
|
|
53
|
+
],
|
|
54
|
+
[
|
|
55
|
+
{
|
|
56
|
+
'project.id': 1,
|
|
57
|
+
'itemOffered.id': 1,
|
|
58
|
+
identifier: 1
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'uniqueByItemOfferedAndIdentifier',
|
|
62
|
+
unique: true
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
[
|
|
66
|
+
{ 'project.id': 1, validFrom: 1 },
|
|
67
|
+
{ name: 'projectId' }
|
|
68
|
+
],
|
|
69
|
+
[
|
|
70
|
+
{ 'seller.id': 1, validFrom: 1 },
|
|
71
|
+
{ name: 'sellerId' }
|
|
72
|
+
],
|
|
73
|
+
[
|
|
74
|
+
{ identifier: 1, validFrom: 1 },
|
|
75
|
+
{ name: 'identifier' }
|
|
76
|
+
],
|
|
77
|
+
[
|
|
78
|
+
{ 'itemOffered.id': 1, validFrom: 1 },
|
|
79
|
+
{ name: 'itemOfferedId' }
|
|
80
|
+
]
|
|
81
|
+
];
|
|
82
|
+
exports.indexes = indexes;
|
|
83
|
+
/**
|
|
84
|
+
* 対応決済方法オファースキーマ
|
|
85
|
+
*/
|
|
86
|
+
let schema;
|
|
87
|
+
function createSchema() {
|
|
88
|
+
if (schema === undefined) {
|
|
89
|
+
schema = new mongoose_1.Schema(schemaDefinition, schemaOptions);
|
|
90
|
+
if (settings_1.MONGO_AUTO_INDEX) {
|
|
91
|
+
indexes.forEach((indexParams) => {
|
|
92
|
+
schema === null || schema === void 0 ? void 0 : schema.index(...indexParams);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return schema;
|
|
97
|
+
}
|
|
@@ -82,6 +82,15 @@ const indexes = [
|
|
|
82
82
|
[
|
|
83
83
|
{ 'availableAtOrFrom.identifier': 1, validFrom: 1 },
|
|
84
84
|
{ name: 'availableAtOrFrom' }
|
|
85
|
+
],
|
|
86
|
+
[
|
|
87
|
+
{ 'offeredBy.identifier': 1, validFrom: 1 },
|
|
88
|
+
{
|
|
89
|
+
name: 'offeredByIdentifier',
|
|
90
|
+
partialFilterExpression: {
|
|
91
|
+
'offeredBy.identifier': { $exists: true }
|
|
92
|
+
}
|
|
93
|
+
}
|
|
85
94
|
]
|
|
86
95
|
];
|
|
87
96
|
exports.indexes = indexes;
|
package/lib/chevre/repo/note.js
CHANGED
|
@@ -192,8 +192,10 @@ class NoteRepo {
|
|
|
192
192
|
})
|
|
193
193
|
.lean()
|
|
194
194
|
.exec();
|
|
195
|
-
//
|
|
196
|
-
|
|
195
|
+
// console.log(
|
|
196
|
+
// 'NoteRepo.upsertNotesByIdentifier:',
|
|
197
|
+
// params.length, 'params ->', modifyingNotes.length, 'modifyingNotes found.', JSON.stringify(modifyingNotes)
|
|
198
|
+
// );
|
|
197
199
|
if (modifyingNotes.length !== bulkWriteOps.length) {
|
|
198
200
|
throw new factory.errors.NotFound(factory.creativeWorkType.NoteDigitalDocument);
|
|
199
201
|
}
|
|
@@ -286,34 +286,38 @@ class PendingReservationRepo {
|
|
|
286
286
|
});
|
|
287
287
|
});
|
|
288
288
|
}
|
|
289
|
-
// public async
|
|
289
|
+
// public async findSubReservationsByEvent(params: {
|
|
290
|
+
// limit: number;
|
|
291
|
+
// page: number;
|
|
290
292
|
// project: { id: string };
|
|
291
293
|
// eventId: string;
|
|
292
|
-
//
|
|
293
|
-
//
|
|
294
|
-
//
|
|
295
|
-
// }
|
|
296
|
-
// const {
|
|
297
|
-
// const reservationIdentifiers = offers.map((offer) => PendingReservationRepo.offer2identifier(offer, hasTicketedSeat));
|
|
294
|
+
// }): Promise<{
|
|
295
|
+
// // reservationNumber: string;
|
|
296
|
+
// identifier: string;
|
|
297
|
+
// }[]> {
|
|
298
|
+
// const { limit, page, eventId } = params;
|
|
298
299
|
// const aggregate = this.pendingReservationModel.aggregate<{
|
|
299
|
-
// // reservationNumber: string;
|
|
300
300
|
// identifier: string;
|
|
301
301
|
// }>([
|
|
302
|
-
// // unwind,matchの順序
|
|
303
|
-
// // unwind->matchでは遅い?
|
|
304
|
-
// // match->limit->unwind->matchにする
|
|
305
302
|
// {
|
|
306
|
-
// $
|
|
307
|
-
//
|
|
303
|
+
// $match: {
|
|
304
|
+
// 'reservationFor.id': { $eq: eventId },
|
|
305
|
+
// 'subReservation.identifier': { $exists: true }
|
|
308
306
|
// }
|
|
309
307
|
// },
|
|
308
|
+
// // { $sort: { bookingTime: factory.sortType.Descending } },
|
|
310
309
|
// {
|
|
311
|
-
// $
|
|
312
|
-
//
|
|
313
|
-
// 'subReservation.identifier': { $exists: true, $in: reservationIdentifiers }
|
|
310
|
+
// $unwind: {
|
|
311
|
+
// path: '$subReservation'
|
|
314
312
|
// }
|
|
315
313
|
// },
|
|
316
|
-
// { $
|
|
314
|
+
// { $sort: { 'subReservation.identifier': factory.sortType.Ascending } },
|
|
315
|
+
// // {
|
|
316
|
+
// // $match: {
|
|
317
|
+
// // // セクションで絞ってみる
|
|
318
|
+
// // 'subReservation.identifier': { $regex: new RegExp('^Default:') }
|
|
319
|
+
// // }
|
|
320
|
+
// // },
|
|
317
321
|
// {
|
|
318
322
|
// $project: {
|
|
319
323
|
// _id: 0,
|
|
@@ -322,64 +326,17 @@ class PendingReservationRepo {
|
|
|
322
326
|
// }
|
|
323
327
|
// }
|
|
324
328
|
// ]);
|
|
325
|
-
//
|
|
326
|
-
//
|
|
327
|
-
// .
|
|
328
|
-
//
|
|
329
|
-
//
|
|
330
|
-
//
|
|
331
|
-
//
|
|
332
|
-
// // tslint:disable-next-line:no-null-keyword
|
|
333
|
-
// // return (doc !== undefined) ? doc.reservationNumber : null;
|
|
334
|
-
// // tslint:disable-next-line:no-null-keyword
|
|
335
|
-
// return (doc !== undefined) ? doc.identifier : null;
|
|
336
|
-
// });
|
|
337
|
-
// }
|
|
338
|
-
// public async searchHoldersByDistinct(params: {
|
|
339
|
-
// project: { id: string };
|
|
340
|
-
// eventId: string;
|
|
341
|
-
// startDate: Date;
|
|
342
|
-
// hasTicketedSeat: boolean;
|
|
343
|
-
// offers: IOffer[];
|
|
344
|
-
// }) {
|
|
345
|
-
// const { eventId, offers, hasTicketedSeat } = params;
|
|
346
|
-
// const reservationIdentifiers = offers.map((offer) => PendingReservationRepo.offer2identifier(offer, hasTicketedSeat));
|
|
347
|
-
// const doc = await this.pendingReservationModel.distinct(
|
|
348
|
-
// 'subReservation.identifier',
|
|
349
|
-
// {
|
|
350
|
-
// 'reservationFor.id': { $eq: eventId },
|
|
351
|
-
// 'subReservation.identifier': { $exists: true, $in: reservationIdentifiers }
|
|
352
|
-
// }
|
|
353
|
-
// )
|
|
354
|
-
// .setOptions({ maxTimeMS: MONGO_MAX_TIME_MS })
|
|
355
|
-
// .exec();
|
|
356
|
-
// debug('searchHolders: distinct.', doc);
|
|
357
|
-
// return doc;
|
|
358
|
-
// }
|
|
359
|
-
// public async getSize(params: Omit<IUnlockKey, 'holder' | 'offer'>) {
|
|
360
|
-
// const { eventId } = params;
|
|
361
|
-
// const aggregate = this.aggregateReservationModel.aggregate([
|
|
362
|
-
// {
|
|
363
|
-
// $match: {
|
|
364
|
-
// 'reservationFor.id': { $eq: eventId }
|
|
365
|
-
// }
|
|
366
|
-
// },
|
|
367
|
-
// {
|
|
368
|
-
// $project: {
|
|
369
|
-
// typeOf: 1,
|
|
370
|
-
// objectSize: { $bsonSize: '$$ROOT' }
|
|
371
|
-
// }
|
|
372
|
-
// }
|
|
373
|
-
// ]);
|
|
329
|
+
// if (typeof limit === 'number' && limit > 0) {
|
|
330
|
+
// const pageMustBePositive: number = (typeof page === 'number' && page > 0) ? page : 1;
|
|
331
|
+
// aggregate.skip(limit * (pageMustBePositive - 1))
|
|
332
|
+
// .limit(limit);
|
|
333
|
+
// } else {
|
|
334
|
+
// throw new factory.errors.Argument('limit', 'must be number > 0');
|
|
335
|
+
// }
|
|
374
336
|
// return aggregate
|
|
375
337
|
// .option({ maxTimeMS: MONGO_MAX_TIME_MS })
|
|
376
338
|
// .exec();
|
|
377
339
|
// }
|
|
378
|
-
// public getCursor(conditions: FilterQuery<any>, projection: any) {
|
|
379
|
-
// return this.aggregateReservationModel.find(conditions, projection)
|
|
380
|
-
// .sort({ bookingTime: factory.sortType.Ascending })
|
|
381
|
-
// .cursor();
|
|
382
|
-
// }
|
|
383
340
|
docExists(params) {
|
|
384
341
|
return __awaiter(this, void 0, void 0, function* () {
|
|
385
342
|
const { eventId } = params;
|
|
@@ -79,6 +79,30 @@ export declare class SeatRepo {
|
|
|
79
79
|
};
|
|
80
80
|
};
|
|
81
81
|
}): Promise<factory.place.seat.IPlace[]>;
|
|
82
|
+
/**
|
|
83
|
+
* セクション指定の座席検索として再定義(2025-12-06~)
|
|
84
|
+
*/
|
|
85
|
+
findSeatsBySection(params: {
|
|
86
|
+
limit: number;
|
|
87
|
+
page: number;
|
|
88
|
+
projectId: string;
|
|
89
|
+
/**
|
|
90
|
+
* 販売者ID
|
|
91
|
+
*/
|
|
92
|
+
sellerId: string;
|
|
93
|
+
/**
|
|
94
|
+
* 施設コード
|
|
95
|
+
*/
|
|
96
|
+
movieTheaterCode: string;
|
|
97
|
+
/**
|
|
98
|
+
* ルームコード
|
|
99
|
+
*/
|
|
100
|
+
roomCode: string;
|
|
101
|
+
/**
|
|
102
|
+
* セクションコード
|
|
103
|
+
*/
|
|
104
|
+
sectionCode: string;
|
|
105
|
+
}, options: Pick<factory.place.seat.ISearchConditions, 'branchCode' | 'seatingType'>): Promise<Pick<factory.place.seat.IPlace, 'additionalProperty' | 'branchCode' | 'maximumAttendeeCapacity' | 'name' | 'seatingType'>[]>;
|
|
82
106
|
/**
|
|
83
107
|
* 座席区分集計検索
|
|
84
108
|
*/
|
|
@@ -39,30 +39,29 @@ class SeatRepo {
|
|
|
39
39
|
const includeSectionName = params['containedInPlace.name'] !== 0;
|
|
40
40
|
const includeSectionTypeOf = params['containedInPlace.typeOf'] !== 0;
|
|
41
41
|
const includeScreeningRooms = params['containedInPlace.containedInPlace'] !== 0;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
? {
|
|
51
|
-
containedInPlace: {
|
|
52
|
-
typeOf: '$typeOf',
|
|
53
|
-
branchCode: '$branchCode',
|
|
54
|
-
name: '$name',
|
|
42
|
+
/**
|
|
43
|
+
* containedInPlaceについて何かしたprojectするかどうか
|
|
44
|
+
*/
|
|
45
|
+
const includeContaindInPlace = includeSectionBranchCode || includeSectionName || includeSectionTypeOf || includeScreeningRooms;
|
|
46
|
+
const projectStage = Object.assign(Object.assign({ _id: 0, typeOf: '$containsPlace.containsPlace.typeOf', branchCode: '$containsPlace.containsPlace.branchCode', name: '$containsPlace.containsPlace.name', seatingType: '$containsPlace.containsPlace.seatingType', maximumAttendeeCapacity: '$containsPlace.containsPlace.maximumAttendeeCapacity' }, (includeContaindInPlace)
|
|
47
|
+
? {
|
|
48
|
+
containedInPlace: Object.assign(Object.assign(Object.assign(Object.assign({}, (includeSectionBranchCode) ? { branchCode: '$containsPlace.branchCode' } : undefined), (includeSectionName) ? { name: '$containsPlace.name' } : undefined), (includeSectionTypeOf) ? { typeOf: '$containsPlace.typeOf' } : undefined), (includeScreeningRooms)
|
|
49
|
+
? {
|
|
55
50
|
containedInPlace: {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
51
|
+
typeOf: '$typeOf',
|
|
52
|
+
branchCode: '$branchCode',
|
|
53
|
+
name: '$name',
|
|
54
|
+
containedInPlace: {
|
|
55
|
+
id: '$containedInPlace.id',
|
|
56
|
+
typeOf: '$containedInPlace.typeOf',
|
|
57
|
+
branchCode: '$containedInPlace.branchCode',
|
|
58
|
+
name: '$containedInPlace.name'
|
|
59
|
+
}
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
additionalProperty: '$containsPlace.containsPlace.additionalProperty'
|
|
65
|
-
};
|
|
62
|
+
: undefined)
|
|
63
|
+
}
|
|
64
|
+
: undefined), { additionalProperty: '$containsPlace.containsPlace.additionalProperty' });
|
|
66
65
|
Object.keys(params)
|
|
67
66
|
.forEach((field) => {
|
|
68
67
|
if (typeof projectStage[field] === 'string') {
|
|
@@ -445,6 +444,89 @@ class SeatRepo {
|
|
|
445
444
|
.exec();
|
|
446
445
|
});
|
|
447
446
|
}
|
|
447
|
+
/**
|
|
448
|
+
* セクション指定の座席検索として再定義(2025-12-06~)
|
|
449
|
+
*/
|
|
450
|
+
findSeatsBySection(params, options) {
|
|
451
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
452
|
+
const { limit, page, projectId, sellerId, movieTheaterCode, roomCode, sectionCode } = params;
|
|
453
|
+
// まずルーム検索
|
|
454
|
+
const screeningRoomDoc = yield this.placeModel.findOne({
|
|
455
|
+
typeOf: { $eq: factory.placeType.ScreeningRoom },
|
|
456
|
+
'project.id': { $eq: projectId },
|
|
457
|
+
'parentOrganization.id': { $exists: true, $eq: sellerId },
|
|
458
|
+
'containedInPlace.branchCode': { $exists: true, $eq: movieTheaterCode },
|
|
459
|
+
branchCode: { $eq: roomCode }
|
|
460
|
+
}, { _id: 1 })
|
|
461
|
+
.lean()
|
|
462
|
+
.exec();
|
|
463
|
+
// console.log('screeningRoomDoc:', screeningRoomDoc);
|
|
464
|
+
if (screeningRoomDoc === null) {
|
|
465
|
+
return [];
|
|
466
|
+
}
|
|
467
|
+
const matchStageBeforeUnwind = {
|
|
468
|
+
$match: { _id: { $eq: screeningRoomDoc._id } }
|
|
469
|
+
};
|
|
470
|
+
const matchStages = SeatRepo.CREATE_MATCH_STAGES(Object.assign(Object.assign({}, options), { containedInPlace: {
|
|
471
|
+
branchCode: { $eq: sectionCode },
|
|
472
|
+
containedInPlace: {
|
|
473
|
+
containedInPlace: {}
|
|
474
|
+
}
|
|
475
|
+
} }), { filterTypeOf: false });
|
|
476
|
+
const pageMustBeOne = (typeof page === 'number' && page > 0) ? page : 1;
|
|
477
|
+
let skipStage;
|
|
478
|
+
let limitStage;
|
|
479
|
+
if (typeof limit === 'number' && limit > 0) {
|
|
480
|
+
skipStage = { $skip: limit * (pageMustBeOne - 1) };
|
|
481
|
+
limitStage = { $limit: limit };
|
|
482
|
+
}
|
|
483
|
+
else {
|
|
484
|
+
throw new factory.errors.Argument('limit', 'must be number > 0');
|
|
485
|
+
}
|
|
486
|
+
const pipeline = [
|
|
487
|
+
// uniwind前はドキュメントの_id指定
|
|
488
|
+
matchStageBeforeUnwind,
|
|
489
|
+
{
|
|
490
|
+
$unwind: {
|
|
491
|
+
path: '$containsPlace'
|
|
492
|
+
// includeArrayIndex: 'sectionIndex'
|
|
493
|
+
}
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
$unwind: {
|
|
497
|
+
path: '$containsPlace.containsPlace'
|
|
498
|
+
// includeArrayIndex: 'seatIndex'
|
|
499
|
+
}
|
|
500
|
+
},
|
|
501
|
+
...matchStages,
|
|
502
|
+
{
|
|
503
|
+
$project: {
|
|
504
|
+
_id: 0,
|
|
505
|
+
branchCode: '$containsPlace.containsPlace.branchCode',
|
|
506
|
+
name: '$containsPlace.containsPlace.name',
|
|
507
|
+
seatingType: '$containsPlace.containsPlace.seatingType',
|
|
508
|
+
maximumAttendeeCapacity: '$containsPlace.containsPlace.maximumAttendeeCapacity',
|
|
509
|
+
additionalProperty: '$containsPlace.containsPlace.additionalProperty'
|
|
510
|
+
}
|
|
511
|
+
},
|
|
512
|
+
// {
|
|
513
|
+
// $sort: {
|
|
514
|
+
// // branchCode: factory.sortType.Ascending
|
|
515
|
+
// }
|
|
516
|
+
// },
|
|
517
|
+
skipStage,
|
|
518
|
+
limitStage
|
|
519
|
+
];
|
|
520
|
+
// console.log(pipeline);
|
|
521
|
+
return this.placeModel.aggregate(pipeline)
|
|
522
|
+
.option({
|
|
523
|
+
maxTimeMS: settings_1.MONGO_MAX_TIME_MS
|
|
524
|
+
// explain: true,
|
|
525
|
+
// hint: 'searchSeatsSort'
|
|
526
|
+
})
|
|
527
|
+
.exec();
|
|
528
|
+
});
|
|
529
|
+
}
|
|
448
530
|
/**
|
|
449
531
|
* 座席区分集計検索
|
|
450
532
|
*/
|
|
@@ -37,6 +37,26 @@ export declare class SectionRepo {
|
|
|
37
37
|
};
|
|
38
38
|
}, $unset: any): Promise<IUpdateSectionResult>;
|
|
39
39
|
searchScreeningRoomSections(searchConditions: factory.place.screeningRoomSection.ISearchConditions): Promise<IScreeningRoomSectionWithoutContainsPlace[]>;
|
|
40
|
+
/**
|
|
41
|
+
* ルーム指定のセクション検索として再定義(2025-12-07~)
|
|
42
|
+
*/
|
|
43
|
+
findSectionsByRoom(params: {
|
|
44
|
+
limit: number;
|
|
45
|
+
page: number;
|
|
46
|
+
projectId: string;
|
|
47
|
+
/**
|
|
48
|
+
* 販売者ID
|
|
49
|
+
*/
|
|
50
|
+
sellerId: string;
|
|
51
|
+
/**
|
|
52
|
+
* 施設コード
|
|
53
|
+
*/
|
|
54
|
+
movieTheaterCode: string;
|
|
55
|
+
/**
|
|
56
|
+
* ルームコード
|
|
57
|
+
*/
|
|
58
|
+
roomCode: string;
|
|
59
|
+
}): Promise<Pick<IScreeningRoomSectionWithoutContainsPlace, 'additionalProperty' | 'branchCode' | 'name'>[]>;
|
|
40
60
|
deleteScreeningRoomSection(screeningRoomSection: {
|
|
41
61
|
project: {
|
|
42
62
|
id: string;
|
|
@@ -248,6 +248,53 @@ class SectionRepo {
|
|
|
248
248
|
.exec();
|
|
249
249
|
});
|
|
250
250
|
}
|
|
251
|
+
/**
|
|
252
|
+
* ルーム指定のセクション検索として再定義(2025-12-07~)
|
|
253
|
+
*/
|
|
254
|
+
findSectionsByRoom(params
|
|
255
|
+
// options: Pick<
|
|
256
|
+
// factory.place.screeningRoomSection.ISearchConditions,
|
|
257
|
+
// 'branchCode'
|
|
258
|
+
// >
|
|
259
|
+
) {
|
|
260
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
261
|
+
const { limit, page, projectId, sellerId, movieTheaterCode, roomCode } = params;
|
|
262
|
+
const matchStageBeforeUnwind = {
|
|
263
|
+
$match: {
|
|
264
|
+
'project.id': { $eq: projectId },
|
|
265
|
+
'parentOrganization.id': { $exists: true, $eq: sellerId },
|
|
266
|
+
'containedInPlace.branchCode': { $exists: true, $eq: movieTheaterCode }, // 施設コード
|
|
267
|
+
branchCode: { $eq: roomCode } // ルームコード
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
const aggregate = this.placeModel.aggregate([
|
|
271
|
+
// uniwind前はドキュメントの_id指定
|
|
272
|
+
matchStageBeforeUnwind,
|
|
273
|
+
{ $unwind: '$containsPlace' },
|
|
274
|
+
// ...matchStages,
|
|
275
|
+
{
|
|
276
|
+
$project: {
|
|
277
|
+
_id: 0,
|
|
278
|
+
// typeOf: '$containsPlace.typeOf',
|
|
279
|
+
branchCode: '$containsPlace.branchCode',
|
|
280
|
+
name: '$containsPlace.name',
|
|
281
|
+
additionalProperty: '$containsPlace.additionalProperty'
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
]);
|
|
285
|
+
if (typeof limit === 'number' && limit > 0) {
|
|
286
|
+
const pageMustBePositive = (typeof page === 'number' && page > 0) ? page : 1;
|
|
287
|
+
aggregate.skip(limit * (pageMustBePositive - 1))
|
|
288
|
+
.limit(limit);
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
throw new factory.errors.Argument('limit', 'must be number > 0');
|
|
292
|
+
}
|
|
293
|
+
return aggregate
|
|
294
|
+
.option({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
295
|
+
.exec();
|
|
296
|
+
});
|
|
297
|
+
}
|
|
251
298
|
deleteScreeningRoomSection(screeningRoomSection) {
|
|
252
299
|
return __awaiter(this, void 0, void 0, function* () {
|
|
253
300
|
var _a;
|
|
@@ -38,5 +38,11 @@ export declare class TicketRepo {
|
|
|
38
38
|
* 承認コードからチケットを発行する
|
|
39
39
|
*/
|
|
40
40
|
issueByTicketToken(params: IIssueParams): Promise<Pick<ITicket, 'id'>>;
|
|
41
|
-
|
|
41
|
+
findTickets(params: ISearchConditions, inclusion: IKeyOfProjection[]): Promise<ITicket[]>;
|
|
42
|
+
/**
|
|
43
|
+
* 発行日時を一定期間過ぎたチケットを削除する
|
|
44
|
+
*/
|
|
45
|
+
deleteTicketsByDateIssued(params: {
|
|
46
|
+
dateIssuedLt: Date;
|
|
47
|
+
}): Promise<void>;
|
|
42
48
|
}
|
|
@@ -69,7 +69,7 @@ class TicketRepo {
|
|
|
69
69
|
return { id: insertedId };
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
-
|
|
72
|
+
findTickets(params, inclusion) {
|
|
73
73
|
return __awaiter(this, void 0, void 0, function* () {
|
|
74
74
|
var _a;
|
|
75
75
|
const conditions = TicketRepo.CREATE_MONGO_CONDITIONS(params);
|
|
@@ -92,5 +92,18 @@ class TicketRepo {
|
|
|
92
92
|
.exec();
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* 発行日時を一定期間過ぎたチケットを削除する
|
|
97
|
+
*/
|
|
98
|
+
deleteTicketsByDateIssued(params) {
|
|
99
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
+
yield this.ticketModel.deleteMany({
|
|
101
|
+
dateIssued: {
|
|
102
|
+
$lt: params.dateIssuedLt
|
|
103
|
+
}
|
|
104
|
+
})
|
|
105
|
+
.exec();
|
|
106
|
+
});
|
|
107
|
+
}
|
|
95
108
|
}
|
|
96
109
|
exports.TicketRepo = TicketRepo;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* リポジトリ
|
|
3
3
|
*/
|
|
4
4
|
import type { AcceptedOfferRepo } from './repo/acceptedOffer';
|
|
5
|
+
import type { AcceptedPaymentMethodRepo } from './repo/acceptedPaymentMethod';
|
|
5
6
|
import type { AccountRepo } from './repo/account';
|
|
6
7
|
import type { AccountingReportRepo } from './repo/accountingReport';
|
|
7
8
|
import type { AccountTitleRepo } from './repo/accountTitle';
|
|
@@ -94,6 +95,10 @@ export type AcceptedOffer = AcceptedOfferRepo;
|
|
|
94
95
|
export declare namespace AcceptedOffer {
|
|
95
96
|
function createInstance(...params: ConstructorParameters<typeof AcceptedOfferRepo>): Promise<AcceptedOfferRepo>;
|
|
96
97
|
}
|
|
98
|
+
export type AcceptedPaymentMethod = AcceptedPaymentMethodRepo;
|
|
99
|
+
export declare namespace AcceptedPaymentMethod {
|
|
100
|
+
function createInstance(...params: ConstructorParameters<typeof AcceptedPaymentMethodRepo>): Promise<AcceptedPaymentMethodRepo>;
|
|
101
|
+
}
|
|
97
102
|
export type Account = AccountRepo;
|
|
98
103
|
export declare namespace Account {
|
|
99
104
|
function createInstance(...params: ConstructorParameters<typeof AccountRepo>): Promise<AccountRepo>;
|
package/lib/chevre/repository.js
CHANGED
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
13
|
-
exports.WebSite = exports.rateLimit = exports.Trip = exports.TransactionProcess = exports.TransactionNumber = exports.Transaction = exports.Ticket = exports.Telemetry = exports.Task = exports.StockHolder = exports.setting = exports.Setting = exports.ServiceOutputIdentifier = exports.ServiceOutput = exports.ServiceAvailableHour = exports.SellerReturnPolicy = exports.SellerPaymentAccepted = exports.SellerMakesOffer = exports.Seller = exports.Schedule = exports.Role = exports.ReserveInterface = exports.Reservation = exports.ProjectMakesOffer = exports.Project = exports.ProductOffer = exports.ProductModel = exports.ProductHasOfferCatalog = exports.Product = exports.PriceSpecification = exports.PotentialAction = exports.place = exports.Permit = exports.Person = void 0;
|
|
12
|
+
exports.PendingReservation = exports.PaymentServiceProvider = exports.PaymentServiceChannel = exports.PaymentService = exports.Passport = exports.OwnershipInfo = exports.OrderNumber = exports.OrderInTransaction = exports.Order = exports.Offer = exports.OfferItemCondition = exports.OfferCatalogItem = exports.OfferCatalog = exports.NoteAboutOrder = exports.Note = exports.MovieTicketType = exports.Message = exports.MerchantReturnPolicy = exports.MemberProgram = exports.Member = exports.Issuer = exports.IdentityProvider = exports.Identity = exports.EventSeries = exports.EventSellerMakesOffer = exports.EventOffer = exports.Event = exports.EmailMessage = exports.CustomerType = exports.Customer = exports.Credentials = exports.CreativeWork = exports.ConfirmationNumber = exports.Comment = exports.Authorization = exports.CategoryCode = exports.AssetTransaction = exports.Aggregation = exports.AggregateReservation = exports.AggregateOrder = exports.AggregateOffer = exports.AdvanceBookingRequirement = exports.AdditionalProperty = exports.Action = exports.AccountTransaction = exports.AccountTitle = exports.AccountingReport = exports.Account = exports.AcceptedPaymentMethod = exports.AcceptedOffer = void 0;
|
|
13
|
+
exports.WebSite = exports.rateLimit = exports.Trip = exports.TransactionProcess = exports.TransactionNumber = exports.Transaction = exports.Ticket = exports.Telemetry = exports.Task = exports.StockHolder = exports.setting = exports.Setting = exports.ServiceOutputIdentifier = exports.ServiceOutput = exports.ServiceAvailableHour = exports.SellerReturnPolicy = exports.SellerPaymentAccepted = exports.SellerMakesOffer = exports.Seller = exports.Schedule = exports.Role = exports.ReserveInterface = exports.Reservation = exports.ProjectMakesOffer = exports.Project = exports.ProductOffer = exports.ProductModel = exports.ProductHasOfferCatalog = exports.Product = exports.PriceSpecification = exports.PotentialAction = exports.place = exports.Permit = exports.Person = exports.paymentMethod = void 0;
|
|
14
14
|
var AcceptedOffer;
|
|
15
15
|
(function (AcceptedOffer) {
|
|
16
16
|
let repo;
|
|
@@ -24,6 +24,19 @@ var AcceptedOffer;
|
|
|
24
24
|
}
|
|
25
25
|
AcceptedOffer.createInstance = createInstance;
|
|
26
26
|
})(AcceptedOffer || (exports.AcceptedOffer = AcceptedOffer = {}));
|
|
27
|
+
var AcceptedPaymentMethod;
|
|
28
|
+
(function (AcceptedPaymentMethod) {
|
|
29
|
+
let repo;
|
|
30
|
+
function createInstance(...params) {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
if (repo === undefined) {
|
|
33
|
+
repo = (yield Promise.resolve().then(() => require('./repo/acceptedPaymentMethod'))).AcceptedPaymentMethodRepo;
|
|
34
|
+
}
|
|
35
|
+
return new repo(...params);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
AcceptedPaymentMethod.createInstance = createInstance;
|
|
39
|
+
})(AcceptedPaymentMethod || (exports.AcceptedPaymentMethod = AcceptedPaymentMethod = {}));
|
|
27
40
|
var Account;
|
|
28
41
|
(function (Account) {
|
|
29
42
|
let repo;
|
|
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.importFromCOA = importFromCOA;
|
|
13
13
|
const createDebug = require("debug");
|
|
14
14
|
const moment = require("moment-timezone");
|
|
15
|
-
const
|
|
15
|
+
const saveScreeningEvents_1 = require("../../event/saveScreeningEvents");
|
|
16
16
|
const debug = createDebug('chevre-domain:service');
|
|
17
17
|
/**
|
|
18
18
|
* イベント席数を更新する
|
|
@@ -37,7 +37,7 @@ function importFromCOA(params) {
|
|
|
37
37
|
if (Array.isArray(countFreeSeatDate.listPerformance)) {
|
|
38
38
|
for (const countFreeSeatPerformance of countFreeSeatDate.listPerformance) {
|
|
39
39
|
try {
|
|
40
|
-
const eventId = (0,
|
|
40
|
+
const eventId = (0, saveScreeningEvents_1.createScreeningEventIdFromCOA)({
|
|
41
41
|
theaterCode: countFreeSeatResult.theaterCode,
|
|
42
42
|
titleCode: countFreeSeatPerformance.titleCode,
|
|
43
43
|
titleBranchNum: countFreeSeatPerformance.titleBranchNum,
|
|
@@ -14,7 +14,7 @@ export declare function createStartParams(params: factory.assetTransaction.pay.I
|
|
|
14
14
|
*/
|
|
15
15
|
id: string;
|
|
16
16
|
}[];
|
|
17
|
-
instrument: factory.action.trade.pay.
|
|
17
|
+
instrument: factory.action.trade.pay.IPlaceOrderRelatedInstrument[];
|
|
18
18
|
}, options: {
|
|
19
19
|
checkedAction: {
|
|
20
20
|
id: string;
|