@chevre/domain 21.2.0-alpha.99 → 21.2.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/aggregateEventReservation.ts +1 -1
- package/example/src/chevre/aggregateSellerPaymentAccepted.ts +27 -0
- package/example/src/chevre/aggregation/aggregateSystem.ts +53 -22
- package/example/src/chevre/countDelayedTasks.ts +7 -2
- package/example/src/chevre/createManyEventsIfNotExist.ts +199 -46
- package/example/src/chevre/findScreeningRoomsByBranchCode.ts +4 -3
- package/example/src/chevre/giveUpStartDatePassedCertainPeriod.ts +56 -0
- package/example/src/chevre/lockStockHolder.ts +5 -2
- package/example/src/chevre/migrateCategoryCodeAdditionalProperties.ts +116 -0
- package/example/src/chevre/migrateScreeningEventSeriesVersion.ts +79 -0
- package/example/src/chevre/processRegisterMembership.ts +8 -4
- package/example/src/chevre/processRegisterPaymentCard.ts +8 -4
- package/example/src/chevre/processReserve.ts +1 -1
- package/example/src/chevre/searchAbortedTasks.ts +4 -6
- package/example/src/chevre/searchEventSeats.ts +5 -2
- package/example/src/chevre/searchHoldReservations.ts +38 -0
- package/example/src/chevre/searchPermissions.ts +54 -0
- package/example/src/chevre/searchScreeningRooms.ts +35 -0
- package/example/src/chevre/sendEmailMessage.ts +1 -2
- package/example/src/chevre/syncScreeningRooms.ts +22 -0
- package/example/src/chevre/syncScreeningRoomsAll.ts +44 -0
- package/example/src/chevre/unsetContainsInPlaceFromMovieTheater.ts +41 -0
- package/lib/chevre/factory/order.d.ts +4 -1
- package/lib/chevre/factory/order.js +19 -6
- package/lib/chevre/repo/account.js +3 -2
- package/lib/chevre/repo/accountTransaction.js +2 -1
- package/lib/chevre/repo/accountingReport.d.ts +1 -3
- package/lib/chevre/repo/action.d.ts +50 -1
- package/lib/chevre/repo/action.js +53 -2
- package/lib/chevre/repo/additionalProperty.js +2 -1
- package/lib/chevre/repo/aggregation.d.ts +3 -0
- package/lib/chevre/repo/aggregation.js +3 -0
- package/lib/chevre/repo/assetTransaction.js +6 -5
- package/lib/chevre/repo/categoryCode.d.ts +1 -1
- package/lib/chevre/repo/categoryCode.js +37 -25
- package/lib/chevre/repo/code.js +3 -2
- package/lib/chevre/repo/comment.js +2 -1
- package/lib/chevre/repo/creativeWork.d.ts +1 -1
- package/lib/chevre/repo/creativeWork.js +35 -12
- package/lib/chevre/repo/customer.js +2 -1
- package/lib/chevre/repo/emailMessage.js +2 -1
- package/lib/chevre/repo/event.d.ts +30 -2
- package/lib/chevre/repo/event.js +87 -36
- package/lib/chevre/repo/member.d.ts +14 -0
- package/lib/chevre/repo/member.js +31 -3
- package/lib/chevre/repo/merchantReturnPolicy.js +2 -1
- package/lib/chevre/repo/mongoose/schemas/assetTransaction.d.ts +3 -3
- package/lib/chevre/repo/mongoose/schemas/holdReservation.d.ts +75 -0
- package/lib/chevre/repo/mongoose/schemas/holdReservation.js +93 -0
- package/lib/chevre/repo/mongoose/schemas/offer.d.ts +3 -3
- package/lib/chevre/repo/mongoose/schemas/order.d.ts +21 -21
- package/lib/chevre/repo/mongoose/schemas/place.d.ts +6 -0
- package/lib/chevre/repo/mongoose/schemas/place.js +16 -1
- package/lib/chevre/repo/mongoose/schemas/product.js +6 -0
- package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +9 -9
- package/lib/chevre/repo/mongoose/schemas/transaction.d.ts +3 -3
- package/lib/chevre/repo/offer.js +3 -2
- package/lib/chevre/repo/offerCatalog.js +0 -27
- package/lib/chevre/repo/offerItemCondition.js +2 -1
- package/lib/chevre/repo/order.js +8 -7
- package/lib/chevre/repo/ownershipInfo.js +2 -7
- package/lib/chevre/repo/paymentServiceProvider.d.ts +65 -0
- package/lib/chevre/repo/paymentServiceProvider.js +156 -0
- package/lib/chevre/repo/place.d.ts +203 -27
- package/lib/chevre/repo/place.js +1726 -694
- package/lib/chevre/repo/priceSpecification.js +3 -2
- package/lib/chevre/repo/product.d.ts +5 -3
- package/lib/chevre/repo/product.js +92 -5
- package/lib/chevre/repo/project.js +2 -1
- package/lib/chevre/repo/reservation.d.ts +9 -1
- package/lib/chevre/repo/reservation.js +29 -20
- package/lib/chevre/repo/role.d.ts +7 -0
- package/lib/chevre/repo/role.js +39 -2
- package/lib/chevre/repo/seller.d.ts +21 -1
- package/lib/chevre/repo/seller.js +59 -4
- package/lib/chevre/repo/serviceOutput.js +2 -1
- package/lib/chevre/repo/stockHolder.d.ts +143 -7
- package/lib/chevre/repo/stockHolder.js +622 -104
- package/lib/chevre/repo/task.d.ts +12 -1
- package/lib/chevre/repo/task.js +17 -7
- package/lib/chevre/repo/transaction.js +6 -5
- package/lib/chevre/repo/trip.js +2 -1
- package/lib/chevre/repository.d.ts +6 -0
- package/lib/chevre/repository.js +8 -1
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +18 -8
- package/lib/chevre/service/aggregation/event/aggregateUseActionsOnEvent.js +19 -8
- package/lib/chevre/service/aggregation/system.d.ts +43 -1
- package/lib/chevre/service/aggregation/system.js +112 -2
- package/lib/chevre/service/assetTransaction/moneyTransfer.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/account/validation.js +1 -1
- package/lib/chevre/service/assetTransaction/pay.js +2 -2
- package/lib/chevre/service/assetTransaction/refund.js +1 -1
- package/lib/chevre/service/assetTransaction/reserve.js +10 -3
- package/lib/chevre/service/event.d.ts +3 -0
- package/lib/chevre/service/event.js +52 -21
- package/lib/chevre/service/iam.d.ts +6 -2
- package/lib/chevre/service/iam.js +23 -9
- package/lib/chevre/service/offer/event/factory.js +22 -13
- package/lib/chevre/service/offer/event/importFromCOA.js +2 -2
- package/lib/chevre/service/offer/eventServiceByCOA/factory.js +15 -8
- package/lib/chevre/service/offer/eventServiceByCOA.js +7 -9
- package/lib/chevre/service/offer/product/factory.js +13 -6
- package/lib/chevre/service/offer/product.js +2 -2
- package/lib/chevre/service/offer.d.ts +16 -8
- package/lib/chevre/service/offer.js +71 -8
- package/lib/chevre/service/order/createAccountingReportIfNotExist.js +31 -17
- package/lib/chevre/service/order/onOrderStatusChanged/factory.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged.js +2 -2
- package/lib/chevre/service/order/placeOrder.js +4 -4
- package/lib/chevre/service/order/returnOrder.js +1 -1
- package/lib/chevre/service/order/sendOrder.js +3 -3
- package/lib/chevre/service/payment/any/onPaymentStatusChanged.js +4 -6
- package/lib/chevre/service/payment/any/onRefund.js +46 -42
- package/lib/chevre/service/payment/creditCard.js +2 -2
- package/lib/chevre/service/payment/movieTicket/checkByIdentifier.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/factory.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/getCredentials.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/getCredentials.js +1 -1
- package/lib/chevre/service/payment/movieTicket/validation.js +16 -9
- package/lib/chevre/service/payment/movieTicket.js +2 -2
- package/lib/chevre/service/reserve/cancelReservation.js +15 -3
- package/lib/chevre/service/reserve/confirmReservation.js +19 -11
- package/lib/chevre/service/task/aggregateScreeningEvent.js +1 -1
- package/lib/chevre/service/task/cancelPendingReservation.js +1 -1
- package/lib/chevre/service/task/cancelReservation.js +1 -1
- package/lib/chevre/service/task/deleteTransaction.js +2 -0
- package/lib/chevre/service/task/onEventChanged.d.ts +7 -0
- package/lib/chevre/service/task/onEventChanged.js +29 -0
- package/lib/chevre/service/task/onResourceUpdated.d.ts +7 -0
- package/lib/chevre/service/task/onResourceUpdated.js +396 -0
- package/lib/chevre/service/task/syncScreeningRooms.d.ts +7 -0
- package/lib/chevre/service/task/syncScreeningRooms.js +24 -0
- package/lib/chevre/service/task/voidReserveTransaction.js +1 -1
- package/lib/chevre/service/transaction/deleteTransaction.d.ts +2 -0
- package/lib/chevre/service/transaction/deleteTransaction.js +129 -1
- package/lib/chevre/service/transaction/moneyTransfer/exportTasks/factory.js +1 -0
- package/lib/chevre/service/transaction/moneyTransfer/factory.d.ts +1 -1
- package/lib/chevre/service/transaction/moneyTransfer.js +1 -1
- package/lib/chevre/service/transaction/orderProgramMembership/findCreditCard.js +1 -1
- package/lib/chevre/service/transaction/orderProgramMembership/findPaymentCardPermit.js +1 -1
- package/lib/chevre/service/transaction/orderProgramMembership.js +1 -1
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.js +1 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/givePointAward.js +1 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/moneyTransfer.js +1 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/registerService.js +1 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/sendEmailMessage.js +4 -4
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions.js +3 -4
- package/lib/chevre/service/transaction/placeOrderInProgress/result/acceptedOffers.js +8 -12
- package/lib/chevre/service/transaction/placeOrderInProgress.js +6 -4
- package/lib/chevre/service/transaction/returnOrder/exportTasks/factory.js +1 -0
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnMoneyTransfer.js +2 -2
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.js +5 -5
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPointAward.js +2 -2
- package/lib/chevre/service/transaction/returnOrder/potentialActions/sendEmailMessage.js +3 -3
- package/lib/chevre/service/transaction/returnOrder/potentialActions.js +1 -1
- package/lib/chevre/service/transaction/returnOrder.js +3 -1
- package/lib/chevre/settings.d.ts +11 -0
- package/lib/chevre/settings.js +44 -2
- package/package.json +3 -3
- package/example/src/chevre/eventCatalog2eventService.ts +0 -123
- package/example/src/chevre/migrateOrderAdditionalProperties.ts +0 -85
- package/example/src/chevre/migrateStockHolderKeys.ts +0 -89
|
@@ -63,7 +63,7 @@ export declare class MongoRepository {
|
|
|
63
63
|
*/
|
|
64
64
|
$nin?: factory.taskName[];
|
|
65
65
|
};
|
|
66
|
-
}): Promise<Pick<import("@chevre/factory/lib/task").ITask | import("@chevre/factory/lib/task/confirmMoneyTransfer").ITask | import("@chevre/factory/lib/task/confirmRegisterService").ITask | import("@chevre/factory/lib/task/confirmPayTransaction").ITask | import("@chevre/factory/lib/task/confirmRegisterServiceTransaction").ITask | import("@chevre/factory/lib/task/confirmReserveTransaction").ITask | import("@chevre/factory/lib/task/deleteTransaction").ITask | import("@chevre/factory/lib/task/givePointAward").ITask | import("@chevre/factory/lib/task/onAuthorizationCreated").ITask | import("@chevre/factory/lib/task/orderProgramMembership").ITask | import("@chevre/factory/lib/task/placeOrder").ITask | import("@chevre/factory/lib/task/returnOrder").ITask | import("@chevre/factory/lib/task/returnMoneyTransfer").ITask | import("@chevre/factory/lib/task/returnPayTransaction").ITask | import("@chevre/factory/lib/task/returnPointAward").ITask | import("@chevre/factory/lib/task/returnReserveTransaction").ITask | import("@chevre/factory/lib/task/sendEmailMessage").ITask | import("@chevre/factory/lib/task/sendOrder").ITask | import("@chevre/factory/lib/task/triggerWebhook").ITask | import("@chevre/factory/lib/task/useReservation").ITask | import("@chevre/factory/lib/task/voidMoneyTransferTransaction").ITask | import("@chevre/factory/lib/task/voidPayTransaction").ITask | import("@chevre/factory/lib/task/voidRegisterServiceTransaction").ITask | import("@chevre/factory/lib/task/voidReserveTransaction").ITask, "id" | "name" | "status">[]>;
|
|
66
|
+
}): Promise<Pick<import("@chevre/factory/lib/task").ITask | import("@chevre/factory/lib/task/confirmMoneyTransfer").ITask | import("@chevre/factory/lib/task/confirmRegisterService").ITask | import("@chevre/factory/lib/task/confirmPayTransaction").ITask | import("@chevre/factory/lib/task/confirmRegisterServiceTransaction").ITask | import("@chevre/factory/lib/task/confirmReserveTransaction").ITask | import("@chevre/factory/lib/task/deleteTransaction").ITask | import("@chevre/factory/lib/task/givePointAward").ITask | import("@chevre/factory/lib/task/onAuthorizationCreated").ITask | import("@chevre/factory/lib/task/onEventChanged").ITask | import("@chevre/factory/lib/task/onResourceUpdated").ITask | import("@chevre/factory/lib/task/orderProgramMembership").ITask | import("@chevre/factory/lib/task/placeOrder").ITask | import("@chevre/factory/lib/task/returnOrder").ITask | import("@chevre/factory/lib/task/returnMoneyTransfer").ITask | import("@chevre/factory/lib/task/returnPayTransaction").ITask | import("@chevre/factory/lib/task/returnPointAward").ITask | import("@chevre/factory/lib/task/returnReserveTransaction").ITask | import("@chevre/factory/lib/task/sendEmailMessage").ITask | import("@chevre/factory/lib/task/sendOrder").ITask | import("@chevre/factory/lib/task/syncScreeningRooms").ITask | import("@chevre/factory/lib/task/triggerWebhook").ITask | import("@chevre/factory/lib/task/useReservation").ITask | import("@chevre/factory/lib/task/voidMoneyTransferTransaction").ITask | import("@chevre/factory/lib/task/voidPayTransaction").ITask | import("@chevre/factory/lib/task/voidRegisterServiceTransaction").ITask | import("@chevre/factory/lib/task/voidReserveTransaction").ITask, "id" | "name" | "status">[]>;
|
|
67
67
|
retry(params: {
|
|
68
68
|
intervalInMinutes: number;
|
|
69
69
|
}): Promise<void>;
|
|
@@ -101,8 +101,19 @@ export declare class MongoRepository {
|
|
|
101
101
|
$lte: Date;
|
|
102
102
|
};
|
|
103
103
|
}): Promise<import("mongodb").DeleteResult>;
|
|
104
|
+
/**
|
|
105
|
+
* 不要なタスクを削除する
|
|
106
|
+
*/
|
|
107
|
+
deleteRunsAtPassedCertainPeriod(params: {
|
|
108
|
+
runsAt: {
|
|
109
|
+
$lt: Date;
|
|
110
|
+
};
|
|
111
|
+
}): Promise<void>;
|
|
104
112
|
countDelayedTasks(params: {
|
|
105
113
|
delayInSeconds: number;
|
|
114
|
+
name: {
|
|
115
|
+
$nin?: factory.taskName[];
|
|
116
|
+
};
|
|
106
117
|
}): Promise<number>;
|
|
107
118
|
aggregateTask(params: {
|
|
108
119
|
project?: {
|
package/lib/chevre/repo/task.js
CHANGED
|
@@ -14,6 +14,7 @@ const moment = require("moment");
|
|
|
14
14
|
const factory = require("../factory");
|
|
15
15
|
const task_1 = require("./mongoose/schemas/task");
|
|
16
16
|
const task_2 = require("../eventEmitter/task");
|
|
17
|
+
const settings_1 = require("../settings");
|
|
17
18
|
/**
|
|
18
19
|
* タスク実行時のソート条件
|
|
19
20
|
*/
|
|
@@ -267,7 +268,7 @@ class MongoRepository {
|
|
|
267
268
|
status: 1
|
|
268
269
|
})
|
|
269
270
|
.limit(params.limit)
|
|
270
|
-
.setOptions({ maxTimeMS:
|
|
271
|
+
.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
271
272
|
.exec();
|
|
272
273
|
if (delayedTasks.length > 0) {
|
|
273
274
|
delayedTasks.forEach((delayedTask) => {
|
|
@@ -375,7 +376,7 @@ class MongoRepository {
|
|
|
375
376
|
return __awaiter(this, void 0, void 0, function* () {
|
|
376
377
|
const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
|
|
377
378
|
return this.taskModel.countDocuments((conditions.length > 0) ? { $and: conditions } : {})
|
|
378
|
-
.setOptions({ maxTimeMS:
|
|
379
|
+
.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
379
380
|
.exec();
|
|
380
381
|
});
|
|
381
382
|
}
|
|
@@ -397,7 +398,7 @@ class MongoRepository {
|
|
|
397
398
|
if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a.runsAt) !== undefined) {
|
|
398
399
|
query.sort({ runsAt: params.sort.runsAt });
|
|
399
400
|
}
|
|
400
|
-
return query.setOptions({ maxTimeMS:
|
|
401
|
+
return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
401
402
|
.exec()
|
|
402
403
|
.then((docs) => docs.map((doc) => doc.toObject()));
|
|
403
404
|
});
|
|
@@ -421,15 +422,24 @@ class MongoRepository {
|
|
|
421
422
|
.exec();
|
|
422
423
|
});
|
|
423
424
|
}
|
|
425
|
+
/**
|
|
426
|
+
* 不要なタスクを削除する
|
|
427
|
+
*/
|
|
428
|
+
deleteRunsAtPassedCertainPeriod(params) {
|
|
429
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
430
|
+
yield this.taskModel.deleteMany({
|
|
431
|
+
runsAt: { $lt: params.runsAt.$lt },
|
|
432
|
+
status: { $in: [factory.taskStatus.Aborted, factory.taskStatus.Executed] }
|
|
433
|
+
})
|
|
434
|
+
.exec();
|
|
435
|
+
});
|
|
436
|
+
}
|
|
424
437
|
countDelayedTasks(params) {
|
|
425
438
|
return __awaiter(this, void 0, void 0, function* () {
|
|
426
439
|
const runsAtLt = moment()
|
|
427
440
|
.add(-params.delayInSeconds, 'seconds')
|
|
428
441
|
.toDate();
|
|
429
|
-
return this.taskModel.count({
|
|
430
|
-
status: factory.taskStatus.Ready,
|
|
431
|
-
runsAt: { $lt: runsAtLt }
|
|
432
|
-
})
|
|
442
|
+
return this.taskModel.count(Object.assign({ status: factory.taskStatus.Ready, runsAt: { $lt: runsAtLt } }, (Array.isArray(params.name.$nin)) ? { name: { $nin: params.name.$nin } } : undefined))
|
|
433
443
|
.exec();
|
|
434
444
|
});
|
|
435
445
|
}
|
|
@@ -14,6 +14,7 @@ const moment = require("moment");
|
|
|
14
14
|
const factory = require("../factory");
|
|
15
15
|
const transaction_1 = require("./mongoose/schemas/transaction");
|
|
16
16
|
const transaction_2 = require("../eventEmitter/transaction");
|
|
17
|
+
const settings_1 = require("../settings");
|
|
17
18
|
/**
|
|
18
19
|
* 取引リポジトリ
|
|
19
20
|
*/
|
|
@@ -516,7 +517,7 @@ class MongoRepository {
|
|
|
516
517
|
typeOf: 1,
|
|
517
518
|
status: 1
|
|
518
519
|
})
|
|
519
|
-
.setOptions({ maxTimeMS:
|
|
520
|
+
.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
520
521
|
.exec();
|
|
521
522
|
if (reexportingTransactions.length > 0) {
|
|
522
523
|
for (const reexportingTransaction of reexportingTransactions) {
|
|
@@ -559,7 +560,7 @@ class MongoRepository {
|
|
|
559
560
|
typeOf: 1,
|
|
560
561
|
status: 1
|
|
561
562
|
})
|
|
562
|
-
.setOptions({ maxTimeMS:
|
|
563
|
+
.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
563
564
|
.exec();
|
|
564
565
|
if (delayedTransactions.length > 0) {
|
|
565
566
|
delayedTransactions.forEach((delayedTransaction) => {
|
|
@@ -606,7 +607,7 @@ class MongoRepository {
|
|
|
606
607
|
_id: 1,
|
|
607
608
|
typeOf: 1
|
|
608
609
|
})
|
|
609
|
-
.setOptions({ maxTimeMS:
|
|
610
|
+
.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
610
611
|
.exec();
|
|
611
612
|
if (expiringTransactions.length > 0) {
|
|
612
613
|
// ステータスと期限を見て更新
|
|
@@ -675,7 +676,7 @@ class MongoRepository {
|
|
|
675
676
|
return __awaiter(this, void 0, void 0, function* () {
|
|
676
677
|
const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
|
|
677
678
|
return this.transactionModel.countDocuments((conditions.length > 0) ? { $and: conditions } : {})
|
|
678
|
-
.setOptions({ maxTimeMS:
|
|
679
|
+
.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
679
680
|
.exec();
|
|
680
681
|
});
|
|
681
682
|
}
|
|
@@ -718,7 +719,7 @@ class MongoRepository {
|
|
|
718
719
|
}
|
|
719
720
|
// const explainResult = await (<any>query).explain();
|
|
720
721
|
// console.log(explainResult[0].executionStats.allPlansExecution.map((e: any) => e.executionStages.inputStage));
|
|
721
|
-
return query.setOptions({ maxTimeMS:
|
|
722
|
+
return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
722
723
|
.exec()
|
|
723
724
|
.then((docs) => docs.map((doc) => doc.toObject()));
|
|
724
725
|
});
|
package/lib/chevre/repo/trip.js
CHANGED
|
@@ -23,6 +23,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
23
23
|
exports.MongoRepository = void 0;
|
|
24
24
|
const factory = require("../factory");
|
|
25
25
|
const trip_1 = require("./mongoose/schemas/trip");
|
|
26
|
+
const settings_1 = require("../settings");
|
|
26
27
|
/**
|
|
27
28
|
* トリップリポジトリ
|
|
28
29
|
*/
|
|
@@ -193,7 +194,7 @@ class MongoRepository {
|
|
|
193
194
|
// console.log(explainResult[0].queryPlanner?.winningPlan?.inputStage?.inputStage?.inputStage);
|
|
194
195
|
// console.log(explainResult);
|
|
195
196
|
// return [];
|
|
196
|
-
return query.setOptions({ maxTimeMS:
|
|
197
|
+
return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
197
198
|
.exec()
|
|
198
199
|
.then((docs) => docs.map((doc) => doc.toObject()));
|
|
199
200
|
});
|
|
@@ -23,6 +23,7 @@ import { MongoRepository as OfferCatalogRepo } from './repo/offerCatalog';
|
|
|
23
23
|
import { MongoRepository as OfferItemConditionRepo } from './repo/offerItemCondition';
|
|
24
24
|
import { MongoRepository as OrderRepo } from './repo/order';
|
|
25
25
|
import { MongoRepository as OwnershipInfoRepo } from './repo/ownershipInfo';
|
|
26
|
+
import { MongoRepository as PaymentServiceProviderRepo } from './repo/paymentServiceProvider';
|
|
26
27
|
import { MongoRepository as PermitRepo } from './repo/permit';
|
|
27
28
|
import { MongoRepository as PlaceRepo } from './repo/place';
|
|
28
29
|
import { MongoRepository as PriceSpecificationRepo } from './repo/priceSpecification';
|
|
@@ -145,6 +146,11 @@ export declare class OrderNumber extends OrderNumberRepo {
|
|
|
145
146
|
*/
|
|
146
147
|
export declare class OwnershipInfo extends OwnershipInfoRepo {
|
|
147
148
|
}
|
|
149
|
+
/**
|
|
150
|
+
* 決済サービスプロバイダー
|
|
151
|
+
*/
|
|
152
|
+
export declare class PaymentServiceProvider extends PaymentServiceProviderRepo {
|
|
153
|
+
}
|
|
148
154
|
export declare namespace paymentMethod {
|
|
149
155
|
/**
|
|
150
156
|
* クレジットカードリポジトリ
|
package/lib/chevre/repository.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.rateLimit = exports.Trip = exports.TransactionNumber = exports.Transaction = exports.Telemetry = exports.Task = exports.StockHolder = exports.ServiceOutputIdentifier = exports.ServiceOutput = exports.Seller = exports.Role = exports.Reservation = exports.Project = exports.Product = exports.PriceSpecification = exports.Place = exports.Permit = exports.Person = exports.paymentMethod = exports.OwnershipInfo = exports.OrderNumber = exports.Order = exports.Offer = exports.OfferItemCondition = exports.OfferCatalog = exports.MerchantReturnPolicy = exports.Member = exports.Event = exports.EmailMessage = exports.Customer = exports.CreativeWork = exports.ConfirmationNumber = exports.Comment = exports.Code = exports.CategoryCode = exports.AssetTransaction = exports.action = exports.Aggregation = exports.AdditionalProperty = exports.Action = exports.AccountTransaction = exports.AccountTitle = exports.AccountingReport = exports.Account = void 0;
|
|
3
|
+
exports.rateLimit = exports.Trip = exports.TransactionNumber = exports.Transaction = exports.Telemetry = exports.Task = exports.StockHolder = exports.ServiceOutputIdentifier = exports.ServiceOutput = exports.Seller = exports.Role = exports.Reservation = exports.Project = exports.Product = exports.PriceSpecification = exports.Place = exports.Permit = exports.Person = exports.paymentMethod = exports.PaymentServiceProvider = exports.OwnershipInfo = exports.OrderNumber = exports.Order = exports.Offer = exports.OfferItemCondition = exports.OfferCatalog = exports.MerchantReturnPolicy = exports.Member = exports.Event = exports.EmailMessage = exports.Customer = exports.CreativeWork = exports.ConfirmationNumber = exports.Comment = exports.Code = exports.CategoryCode = exports.AssetTransaction = exports.action = exports.Aggregation = exports.AdditionalProperty = exports.Action = exports.AccountTransaction = exports.AccountTitle = exports.AccountingReport = exports.Account = void 0;
|
|
4
4
|
// tslint:disable:max-classes-per-file completed-docs
|
|
5
5
|
/**
|
|
6
6
|
* リポジトリ
|
|
@@ -27,6 +27,7 @@ const offerCatalog_1 = require("./repo/offerCatalog");
|
|
|
27
27
|
const offerItemCondition_1 = require("./repo/offerItemCondition");
|
|
28
28
|
const order_1 = require("./repo/order");
|
|
29
29
|
const ownershipInfo_1 = require("./repo/ownershipInfo");
|
|
30
|
+
const paymentServiceProvider_1 = require("./repo/paymentServiceProvider");
|
|
30
31
|
const permit_1 = require("./repo/permit");
|
|
31
32
|
const place_1 = require("./repo/place");
|
|
32
33
|
const priceSpecification_1 = require("./repo/priceSpecification");
|
|
@@ -175,6 +176,12 @@ exports.OrderNumber = OrderNumber;
|
|
|
175
176
|
class OwnershipInfo extends ownershipInfo_1.MongoRepository {
|
|
176
177
|
}
|
|
177
178
|
exports.OwnershipInfo = OwnershipInfo;
|
|
179
|
+
/**
|
|
180
|
+
* 決済サービスプロバイダー
|
|
181
|
+
*/
|
|
182
|
+
class PaymentServiceProvider extends paymentServiceProvider_1.MongoRepository {
|
|
183
|
+
}
|
|
184
|
+
exports.PaymentServiceProvider = PaymentServiceProvider;
|
|
178
185
|
var paymentMethod;
|
|
179
186
|
(function (paymentMethod) {
|
|
180
187
|
/**
|
|
@@ -81,13 +81,14 @@ function aggregateByEvent(params) {
|
|
|
81
81
|
}
|
|
82
82
|
const screeningRoom = yield repos.place.findScreeningRoomsByBranchCode({
|
|
83
83
|
branchCode: { $eq: event.location.branchCode },
|
|
84
|
-
containedInPlace: { id: { $eq: movieTheaterId } }
|
|
84
|
+
containedInPlace: { id: { $eq: movieTheaterId } },
|
|
85
|
+
useScreeningRoomType: settings_1.USE_READ_SCREENING_ROOM_TYPE
|
|
85
86
|
});
|
|
86
87
|
// 予約集計
|
|
87
88
|
const { maximumAttendeeCapacity, remainingAttendeeCapacity, aggregateReservation } = yield aggregateReservationByEvent({
|
|
88
89
|
aggregateDate: now,
|
|
89
90
|
event: event,
|
|
90
|
-
screeningRoom
|
|
91
|
+
screeningRoom
|
|
91
92
|
})(repos);
|
|
92
93
|
// オファーごとの集計
|
|
93
94
|
let aggregateOffer;
|
|
@@ -388,9 +389,11 @@ function filterByEligibleSeatingType(params) {
|
|
|
388
389
|
let remainingAttendeeCapacity;
|
|
389
390
|
if (maximumAttendeeCapacity > 0) {
|
|
390
391
|
const availabilities = yield repos.stockHolder.searchHolders({
|
|
392
|
+
project: { id: params.event.project.id },
|
|
391
393
|
eventId: params.event.id,
|
|
392
394
|
startDate: moment(params.event.startDate)
|
|
393
395
|
.toDate(),
|
|
396
|
+
hasTicketedSeat: true,
|
|
394
397
|
offers: eligibleSeatOffers
|
|
395
398
|
});
|
|
396
399
|
// remainingAttendeeCapacity = availabilities.filter((a) => a.availability === factory.itemAvailability.InStock).length;
|
|
@@ -425,11 +428,17 @@ function aggregateReservationByEvent(params) {
|
|
|
425
428
|
if (typeof eventLocationMaximumAttendeeCapacity === 'number') {
|
|
426
429
|
maximumAttendeeCapacity = eventLocationMaximumAttendeeCapacity;
|
|
427
430
|
}
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
431
|
+
const hasTicketedSeat = reservedSeatsAvailable({ event: params.event });
|
|
432
|
+
if (hasTicketedSeat) {
|
|
433
|
+
// seatCountを利用する(2023-06-24~)
|
|
434
|
+
const screeningRoomSeatCount = (typeof params.screeningRoom.seatCount === 'number') ? params.screeningRoom.seatCount : 0;
|
|
435
|
+
// const screeningRoomSeatCount = (Array.isArray(params.screeningRoom.containsPlace))
|
|
436
|
+
// // b.containsPlaceがundefinedの場合があるので注意(座席未登録)
|
|
437
|
+
// ? params.screeningRoom.containsPlace.reduce(
|
|
438
|
+
// (a, b) => a + ((Array.isArray(b.containsPlace)) ? b.containsPlace.length : 0),
|
|
439
|
+
// 0
|
|
440
|
+
// )
|
|
441
|
+
// : 0;
|
|
433
442
|
maximumAttendeeCapacity = screeningRoomSeatCount;
|
|
434
443
|
// イベントのキャパシティ設定がスクリーン座席数より小さければmaximumAttendeeCapacityを上書き
|
|
435
444
|
if (typeof eventLocationMaximumAttendeeCapacity === 'number' && eventLocationMaximumAttendeeCapacity < screeningRoomSeatCount) {
|
|
@@ -443,7 +452,8 @@ function aggregateReservationByEvent(params) {
|
|
|
443
452
|
event: {
|
|
444
453
|
id: params.event.id,
|
|
445
454
|
startDate: moment(params.event.startDate)
|
|
446
|
-
.toDate()
|
|
455
|
+
.toDate(),
|
|
456
|
+
hasTicketedSeat
|
|
447
457
|
}
|
|
448
458
|
});
|
|
449
459
|
remainingAttendeeCapacity = maximumAttendeeCapacity - unavailableOfferCount;
|
|
@@ -56,14 +56,25 @@ function findEntranceGates(params) {
|
|
|
56
56
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
57
57
|
let movieTheater;
|
|
58
58
|
try {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
const searchMovieTheatersResult = yield repos.place.searchMovieTheaters({
|
|
60
|
+
limit: 1,
|
|
61
|
+
page: 1,
|
|
62
|
+
id: { $eq: params.event.superEvent.location.id }
|
|
63
|
+
// $projection: {
|
|
64
|
+
// containsPlace: 0,
|
|
65
|
+
// hasPOS: 0,
|
|
66
|
+
// offers: 0,
|
|
67
|
+
// parentOrganization: 0,
|
|
68
|
+
// name: 0
|
|
69
|
+
// }
|
|
70
|
+
}, ['hasEntranceGate'], []);
|
|
71
|
+
movieTheater = searchMovieTheatersResult.shift();
|
|
72
|
+
// movieTheater = await repos.place.findById(
|
|
73
|
+
// { id: params.event.superEvent.location.id },
|
|
74
|
+
// // 不要な属性を取得しない
|
|
75
|
+
// ['hasEntranceGate'],
|
|
76
|
+
// []
|
|
77
|
+
// );
|
|
67
78
|
}
|
|
68
79
|
catch (error) {
|
|
69
80
|
let throwsError = true;
|
|
@@ -84,6 +84,48 @@ declare function aggregateUseAction(params: {
|
|
|
84
84
|
aggregationCount: number;
|
|
85
85
|
aggregateDuration: string;
|
|
86
86
|
}>;
|
|
87
|
+
/**
|
|
88
|
+
* 予約アクション集計
|
|
89
|
+
*/
|
|
90
|
+
declare function aggregateReserveAction(params: {
|
|
91
|
+
aggregateDurationUnit: AggregateDurationUnit;
|
|
92
|
+
aggregationCount: number;
|
|
93
|
+
excludedProjectId?: string;
|
|
94
|
+
}): (repos: {
|
|
95
|
+
agregation: AggregationRepo;
|
|
96
|
+
action: ActionRepo;
|
|
97
|
+
}) => Promise<{
|
|
98
|
+
aggregationCount: number;
|
|
99
|
+
aggregateDuration: string;
|
|
100
|
+
}>;
|
|
101
|
+
/**
|
|
102
|
+
* 注文アクション集計
|
|
103
|
+
*/
|
|
104
|
+
declare function aggregateOrderAction(params: {
|
|
105
|
+
aggregateDurationUnit: AggregateDurationUnit;
|
|
106
|
+
aggregationCount: number;
|
|
107
|
+
excludedProjectId?: string;
|
|
108
|
+
}): (repos: {
|
|
109
|
+
agregation: AggregationRepo;
|
|
110
|
+
action: ActionRepo;
|
|
111
|
+
}) => Promise<{
|
|
112
|
+
aggregationCount: number;
|
|
113
|
+
aggregateDuration: string;
|
|
114
|
+
}>;
|
|
115
|
+
/**
|
|
116
|
+
* 予約取消アクション集計
|
|
117
|
+
*/
|
|
118
|
+
declare function aggregateCancelReservationAction(params: {
|
|
119
|
+
aggregateDurationUnit: AggregateDurationUnit;
|
|
120
|
+
aggregationCount: number;
|
|
121
|
+
excludedProjectId?: string;
|
|
122
|
+
}): (repos: {
|
|
123
|
+
agregation: AggregationRepo;
|
|
124
|
+
action: ActionRepo;
|
|
125
|
+
}) => Promise<{
|
|
126
|
+
aggregationCount: number;
|
|
127
|
+
aggregateDuration: string;
|
|
128
|
+
}>;
|
|
87
129
|
declare function aggregateCheckMovieTicketAction(params: {
|
|
88
130
|
aggregateDurationUnit: AggregateDurationUnit;
|
|
89
131
|
aggregationCount: number;
|
|
@@ -142,4 +184,4 @@ declare function aggregateTask(params: {
|
|
|
142
184
|
aggregationCount: number;
|
|
143
185
|
aggregateDuration: string;
|
|
144
186
|
}>;
|
|
145
|
-
export { aggregateAuthorizeEventServiceOfferAction, aggregateAuthorizeOrderAction, aggregateAuthorizePaymentAction, aggregateCheckMovieTicketAction, aggregateEvent, aggregatePayMovieTicketAction, aggregatePayTransaction, aggregatePlaceOrder, aggregateReserveTransaction, aggregateTask, aggregateUseAction };
|
|
187
|
+
export { aggregateAuthorizeEventServiceOfferAction, aggregateAuthorizeOrderAction, aggregateAuthorizePaymentAction, aggregateCancelReservationAction, aggregateCheckMovieTicketAction, aggregateEvent, aggregateOrderAction, aggregatePayMovieTicketAction, aggregatePayTransaction, aggregatePlaceOrder, aggregateReserveAction, aggregateReserveTransaction, aggregateTask, aggregateUseAction };
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.aggregateUseAction = exports.aggregateTask = exports.aggregateReserveTransaction = exports.aggregatePlaceOrder = exports.aggregatePayTransaction = exports.aggregatePayMovieTicketAction = exports.aggregateEvent = exports.aggregateCheckMovieTicketAction = exports.aggregateAuthorizePaymentAction = exports.aggregateAuthorizeOrderAction = exports.aggregateAuthorizeEventServiceOfferAction = void 0;
|
|
12
|
+
exports.aggregateUseAction = exports.aggregateTask = exports.aggregateReserveTransaction = exports.aggregateReserveAction = exports.aggregatePlaceOrder = exports.aggregatePayTransaction = exports.aggregatePayMovieTicketAction = exports.aggregateOrderAction = exports.aggregateEvent = exports.aggregateCheckMovieTicketAction = exports.aggregateCancelReservationAction = exports.aggregateAuthorizePaymentAction = exports.aggregateAuthorizeOrderAction = exports.aggregateAuthorizeEventServiceOfferAction = void 0;
|
|
13
13
|
const createDebug = require("debug");
|
|
14
14
|
const moment = require("moment-timezone");
|
|
15
15
|
const factory = require("../../factory");
|
|
@@ -235,7 +235,7 @@ function aggregateUseAction(params) {
|
|
|
235
235
|
.add(-i, params.aggregateDurationUnit)
|
|
236
236
|
.endOf(params.aggregateDurationUnit)
|
|
237
237
|
.toDate();
|
|
238
|
-
const aggregateResult = yield repos.action.
|
|
238
|
+
const aggregateResult = yield repos.action.aggregateByTypeOf({
|
|
239
239
|
project: { id: { $ne: params.excludedProjectId } },
|
|
240
240
|
startFrom,
|
|
241
241
|
startThrough,
|
|
@@ -248,6 +248,116 @@ function aggregateUseAction(params) {
|
|
|
248
248
|
});
|
|
249
249
|
}
|
|
250
250
|
exports.aggregateUseAction = aggregateUseAction;
|
|
251
|
+
/**
|
|
252
|
+
* 予約アクション集計
|
|
253
|
+
*/
|
|
254
|
+
function aggregateReserveAction(params) {
|
|
255
|
+
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
256
|
+
var _a;
|
|
257
|
+
const aggregateDate = new Date();
|
|
258
|
+
const aggregateDuration = moment.duration(1, params.aggregateDurationUnit)
|
|
259
|
+
.toISOString();
|
|
260
|
+
let i = -1;
|
|
261
|
+
while (i < params.aggregationCount) {
|
|
262
|
+
i += 1;
|
|
263
|
+
const startFrom = moment(aggregateDate)
|
|
264
|
+
.utc()
|
|
265
|
+
// .tz('Asia/Tokyo')
|
|
266
|
+
.add(-i, params.aggregateDurationUnit)
|
|
267
|
+
.startOf(params.aggregateDurationUnit)
|
|
268
|
+
.toDate();
|
|
269
|
+
const startThrough = moment(aggregateDate)
|
|
270
|
+
.utc()
|
|
271
|
+
// .tz('Asia/Tokyo')
|
|
272
|
+
.add(-i, params.aggregateDurationUnit)
|
|
273
|
+
.endOf(params.aggregateDurationUnit)
|
|
274
|
+
.toDate();
|
|
275
|
+
const aggregateResult = yield repos.action.aggregateByTypeOf({
|
|
276
|
+
project: { id: { $ne: params.excludedProjectId } },
|
|
277
|
+
startFrom,
|
|
278
|
+
startThrough,
|
|
279
|
+
typeOf: factory.actionType.ReserveAction
|
|
280
|
+
});
|
|
281
|
+
debug('aggregateReserveAction:result', aggregateResult, (_a = aggregateResult.statuses[0]) === null || _a === void 0 ? void 0 : _a.aggregation.percentilesDuration, startFrom);
|
|
282
|
+
yield repos.agregation.saveAggregation(Object.assign({ typeOf: aggregation_1.AggregationType.AggregateReserveAction, project: { id: '*', typeOf: factory.organizationType.Project }, aggregateDuration, aggregateStart: startFrom, aggregateDate }, aggregateResult));
|
|
283
|
+
}
|
|
284
|
+
return { aggregationCount: i, aggregateDuration };
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
exports.aggregateReserveAction = aggregateReserveAction;
|
|
288
|
+
/**
|
|
289
|
+
* 注文アクション集計
|
|
290
|
+
*/
|
|
291
|
+
function aggregateOrderAction(params) {
|
|
292
|
+
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
293
|
+
var _a;
|
|
294
|
+
const aggregateDate = new Date();
|
|
295
|
+
const aggregateDuration = moment.duration(1, params.aggregateDurationUnit)
|
|
296
|
+
.toISOString();
|
|
297
|
+
let i = -1;
|
|
298
|
+
while (i < params.aggregationCount) {
|
|
299
|
+
i += 1;
|
|
300
|
+
const startFrom = moment(aggregateDate)
|
|
301
|
+
.utc()
|
|
302
|
+
// .tz('Asia/Tokyo')
|
|
303
|
+
.add(-i, params.aggregateDurationUnit)
|
|
304
|
+
.startOf(params.aggregateDurationUnit)
|
|
305
|
+
.toDate();
|
|
306
|
+
const startThrough = moment(aggregateDate)
|
|
307
|
+
.utc()
|
|
308
|
+
// .tz('Asia/Tokyo')
|
|
309
|
+
.add(-i, params.aggregateDurationUnit)
|
|
310
|
+
.endOf(params.aggregateDurationUnit)
|
|
311
|
+
.toDate();
|
|
312
|
+
const aggregateResult = yield repos.action.aggregateByTypeOf({
|
|
313
|
+
project: { id: { $ne: params.excludedProjectId } },
|
|
314
|
+
startFrom,
|
|
315
|
+
startThrough,
|
|
316
|
+
typeOf: factory.actionType.OrderAction
|
|
317
|
+
});
|
|
318
|
+
debug('aggregateOrderAction:result', aggregateResult, (_a = aggregateResult.statuses[0]) === null || _a === void 0 ? void 0 : _a.aggregation.percentilesDuration, startFrom);
|
|
319
|
+
yield repos.agregation.saveAggregation(Object.assign({ typeOf: aggregation_1.AggregationType.AggregateOrderAction, project: { id: '*', typeOf: factory.organizationType.Project }, aggregateDuration, aggregateStart: startFrom, aggregateDate }, aggregateResult));
|
|
320
|
+
}
|
|
321
|
+
return { aggregationCount: i, aggregateDuration };
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
exports.aggregateOrderAction = aggregateOrderAction;
|
|
325
|
+
/**
|
|
326
|
+
* 予約取消アクション集計
|
|
327
|
+
*/
|
|
328
|
+
function aggregateCancelReservationAction(params) {
|
|
329
|
+
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
330
|
+
var _a;
|
|
331
|
+
const aggregateDate = new Date();
|
|
332
|
+
const aggregateDuration = moment.duration(1, params.aggregateDurationUnit)
|
|
333
|
+
.toISOString();
|
|
334
|
+
let i = -1;
|
|
335
|
+
while (i < params.aggregationCount) {
|
|
336
|
+
i += 1;
|
|
337
|
+
const startFrom = moment(aggregateDate)
|
|
338
|
+
.utc()
|
|
339
|
+
// .tz('Asia/Tokyo')
|
|
340
|
+
.add(-i, params.aggregateDurationUnit)
|
|
341
|
+
.startOf(params.aggregateDurationUnit)
|
|
342
|
+
.toDate();
|
|
343
|
+
const startThrough = moment(aggregateDate)
|
|
344
|
+
.utc()
|
|
345
|
+
// .tz('Asia/Tokyo')
|
|
346
|
+
.add(-i, params.aggregateDurationUnit)
|
|
347
|
+
.endOf(params.aggregateDurationUnit)
|
|
348
|
+
.toDate();
|
|
349
|
+
const aggregateResult = yield repos.action.aggregateCancelReservationAction({
|
|
350
|
+
project: { id: { $ne: params.excludedProjectId } },
|
|
351
|
+
startFrom,
|
|
352
|
+
startThrough
|
|
353
|
+
});
|
|
354
|
+
debug('aggregateCancelReservationAction:result', aggregateResult, (_a = aggregateResult.statuses[0]) === null || _a === void 0 ? void 0 : _a.aggregation.percentilesDuration, startFrom);
|
|
355
|
+
yield repos.agregation.saveAggregation(Object.assign({ typeOf: aggregation_1.AggregationType.AggregateCancelReservationAction, project: { id: '*', typeOf: factory.organizationType.Project }, aggregateDuration, aggregateStart: startFrom, aggregateDate }, aggregateResult));
|
|
356
|
+
}
|
|
357
|
+
return { aggregationCount: i, aggregateDuration };
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
exports.aggregateCancelReservationAction = aggregateCancelReservationAction;
|
|
251
361
|
function aggregateCheckMovieTicketAction(params) {
|
|
252
362
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
253
363
|
var _a;
|
|
@@ -34,7 +34,7 @@ function start(params) {
|
|
|
34
34
|
project: { id: { $eq: params.project.id } },
|
|
35
35
|
typeOf: { $eq: factory.product.ProductType.PaymentCard },
|
|
36
36
|
id: { $eq: issuedThroughId }
|
|
37
|
-
});
|
|
37
|
+
}, [], []);
|
|
38
38
|
const product = products.shift();
|
|
39
39
|
if (product === undefined) {
|
|
40
40
|
throw new factory.errors.NotFound('Product');
|
|
@@ -28,7 +28,7 @@ function validateAccount(params) {
|
|
|
28
28
|
if (typeof sellerId !== 'string') {
|
|
29
29
|
throw new factory.errors.ArgumentNull('recipient.id');
|
|
30
30
|
}
|
|
31
|
-
const seller = yield repos.seller.findById({ id: sellerId });
|
|
31
|
+
const seller = yield repos.seller.findById({ id: sellerId }, ['paymentAccepted'], []);
|
|
32
32
|
const paymentAccepted = (_d = seller.paymentAccepted) === null || _d === void 0 ? void 0 : _d.some((a) => a.paymentMethodType === paymentMethodType);
|
|
33
33
|
if (paymentAccepted !== true) {
|
|
34
34
|
throw new factory.errors.Argument('recipient', `payment not accepted`);
|
|
@@ -194,7 +194,7 @@ function fixPaymentService(params) {
|
|
|
194
194
|
project: { id: { $eq: params.project.id } },
|
|
195
195
|
typeOf: { $eq: paymentServiceType },
|
|
196
196
|
id: { $eq: paymentServiceId }
|
|
197
|
-
});
|
|
197
|
+
}, [], []);
|
|
198
198
|
paymentService = paymentServices.shift();
|
|
199
199
|
if (paymentService === undefined) {
|
|
200
200
|
throw new factory.errors.NotFound('PaymentService');
|
|
@@ -210,7 +210,7 @@ function validateSeller(params) {
|
|
|
210
210
|
if (typeof sellerId !== 'string') {
|
|
211
211
|
throw new factory.errors.ArgumentNull('recipient.id');
|
|
212
212
|
}
|
|
213
|
-
const seller = yield repos.seller.findById({ id: sellerId });
|
|
213
|
+
const seller = yield repos.seller.findById({ id: sellerId }, ['paymentAccepted'], []);
|
|
214
214
|
const paymentMethodType = (_b = params.object.paymentMethod) === null || _b === void 0 ? void 0 : _b.typeOf;
|
|
215
215
|
if (typeof paymentMethodType !== 'string') {
|
|
216
216
|
throw new factory.errors.ArgumentNull('object.paymentMethod.typeOf');
|
|
@@ -91,7 +91,7 @@ function fixPaymentService(params) {
|
|
|
91
91
|
project: { id: { $eq: params.payAction.project.id } },
|
|
92
92
|
typeOf: { $eq: params.paymentServiceType },
|
|
93
93
|
id: { $eq: paymentServiceId }
|
|
94
|
-
});
|
|
94
|
+
}, [], []);
|
|
95
95
|
paymentService = paymentServices.shift();
|
|
96
96
|
if (paymentService === undefined) {
|
|
97
97
|
throw new factory.errors.NotFound('PaymentService');
|
|
@@ -236,12 +236,14 @@ function searchEventSeatOffers(params) {
|
|
|
236
236
|
}
|
|
237
237
|
},
|
|
238
238
|
$projection: params.$projection
|
|
239
|
-
});
|
|
239
|
+
}, settings_1.USE_READ_SCREENING_ROOM_TYPE);
|
|
240
240
|
if (seats.length > 0) {
|
|
241
241
|
const availabilities = yield repos.stockHolder.searchHolders({
|
|
242
|
+
project: { id: params.event.project.id },
|
|
242
243
|
eventId: params.event.id,
|
|
243
244
|
startDate: moment(params.event.startDate)
|
|
244
245
|
.toDate(),
|
|
246
|
+
hasTicketedSeat: true,
|
|
245
247
|
offers: seats.map((s) => {
|
|
246
248
|
var _a;
|
|
247
249
|
return {
|
|
@@ -625,7 +627,7 @@ function processLockOfferRateLimit(params) {
|
|
|
625
627
|
*/
|
|
626
628
|
function processLockSeats(params) {
|
|
627
629
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
628
|
-
var _a, _b;
|
|
630
|
+
var _a, _b, _c, _d, _e;
|
|
629
631
|
const offers = [];
|
|
630
632
|
params.reservations.forEach((r) => {
|
|
631
633
|
var _a, _b;
|
|
@@ -674,12 +676,15 @@ function processLockSeats(params) {
|
|
|
674
676
|
if (((_a = params.transaction.object) === null || _a === void 0 ? void 0 : _a.useHoldStockByTransactionNumber) === true) {
|
|
675
677
|
holder = params.transaction.transactionNumber;
|
|
676
678
|
}
|
|
677
|
-
const
|
|
679
|
+
const hasTicketedSeat = ((_d = (_c = (_b = params.event.offers.itemOffered.serviceOutput) === null || _b === void 0 ? void 0 : _b.reservedTicket) === null || _c === void 0 ? void 0 : _c.ticketedSeat) === null || _d === void 0 ? void 0 : _d.typeOf) === factory.placeType.Seat;
|
|
680
|
+
const maximumAttendeeCapacity4event = (_e = params.event.location) === null || _e === void 0 ? void 0 : _e.maximumAttendeeCapacity;
|
|
678
681
|
if (typeof maximumAttendeeCapacity4event === 'number') {
|
|
679
682
|
yield repos.stockHolder.lockIfNotLimitExceeded({
|
|
683
|
+
project: { id: params.event.project.id },
|
|
680
684
|
eventId: params.event.id,
|
|
681
685
|
startDate: moment(params.event.startDate)
|
|
682
686
|
.toDate(),
|
|
687
|
+
hasTicketedSeat,
|
|
683
688
|
offers,
|
|
684
689
|
expires,
|
|
685
690
|
holder
|
|
@@ -687,9 +692,11 @@ function processLockSeats(params) {
|
|
|
687
692
|
}
|
|
688
693
|
else {
|
|
689
694
|
yield repos.stockHolder.lock({
|
|
695
|
+
project: { id: params.event.project.id },
|
|
690
696
|
eventId: params.event.id,
|
|
691
697
|
startDate: moment(params.event.startDate)
|
|
692
698
|
.toDate(),
|
|
699
|
+
hasTicketedSeat,
|
|
693
700
|
offers,
|
|
694
701
|
expires,
|
|
695
702
|
holder
|