@chevre/domain 25.2.0-alpha.8 → 26.0.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/lib/chevre/eventEmitter/task.d.ts +2 -1
- package/lib/chevre/factory/customerTelephone2COATelNum.d.ts +3 -0
- package/lib/chevre/factory/customerTelephone2COATelNum.js +22 -0
- package/lib/chevre/repo/action/acceptPay.d.ts +15 -0
- package/lib/chevre/repo/action/acceptPay.js +47 -19
- package/lib/chevre/repo/action/actionProcess.js +57 -57
- package/lib/chevre/repo/action.d.ts +16 -9
- package/lib/chevre/repo/action.js +99 -180
- package/lib/chevre/repo/adminTask.d.ts +37 -0
- package/lib/chevre/repo/adminTask.js +163 -0
- package/lib/chevre/repo/aggregateOffer.d.ts +3 -14
- package/lib/chevre/repo/aggregateOffer.js +16 -125
- package/lib/chevre/repo/aggregateTask.d.ts +37 -0
- package/lib/chevre/repo/aggregateTask.js +136 -0
- package/lib/chevre/repo/asyncAction.d.ts +69 -0
- package/lib/chevre/repo/asyncAction.js +237 -0
- package/lib/chevre/repo/concurrentLock.d.ts +3 -1
- package/lib/chevre/repo/creativeWork.d.ts +2 -3
- package/lib/chevre/repo/credentials.d.ts +2 -1
- package/lib/chevre/repo/customerType.d.ts +2 -3
- package/lib/chevre/repo/event.d.ts +10 -11
- package/lib/chevre/repo/eventOffer.d.ts +4 -5
- package/lib/chevre/repo/eventSellerMakesOffer.d.ts +2 -3
- package/lib/chevre/repo/eventSeries.d.ts +4 -5
- package/lib/chevre/repo/message.d.ts +1 -1
- package/lib/chevre/repo/message.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/action.js +57 -57
- package/lib/chevre/repo/mongoose/schemas/asyncAction.d.ts +13 -0
- package/lib/chevre/repo/mongoose/schemas/asyncAction.js +89 -0
- package/lib/chevre/repo/mongoose/schemas/order.d.ts +4 -0
- package/lib/chevre/repo/mongoose/schemas/order.js +10 -0
- package/lib/chevre/repo/mongoose/schemas/scheduledTasks.d.ts +16 -0
- package/lib/chevre/repo/mongoose/schemas/scheduledTasks.js +103 -0
- package/lib/chevre/repo/mongoose/schemas/setting.d.ts +4 -0
- package/lib/chevre/repo/mongoose/schemas/task.d.ts +6 -1
- package/lib/chevre/repo/mongoose/schemas/task.js +12 -12
- package/lib/chevre/repo/note.d.ts +3 -4
- package/lib/chevre/repo/noteAboutOrder.d.ts +2 -3
- package/lib/chevre/repo/offer/offerInCatalogReadOnly.d.ts +2 -2
- package/lib/chevre/repo/offer/unitPriceInCatalog.d.ts +2 -2
- package/lib/chevre/repo/offer/unitPriceInCatalog.js +59 -11
- package/lib/chevre/repo/offerCatalog.d.ts +2 -3
- package/lib/chevre/repo/offerCatalogItem.d.ts +2 -3
- package/lib/chevre/repo/order.d.ts +2 -0
- package/lib/chevre/repo/order.js +14 -14
- package/lib/chevre/repo/orderInTransaction.d.ts +68 -1
- package/lib/chevre/repo/orderInTransaction.js +181 -3
- package/lib/chevre/repo/passport.d.ts +2 -1
- package/lib/chevre/repo/person.d.ts +0 -15
- package/lib/chevre/repo/person.js +122 -108
- package/lib/chevre/repo/place/entranceGate.d.ts +4 -5
- package/lib/chevre/repo/place/movieTheater.d.ts +3 -4
- package/lib/chevre/repo/place/screeningRoom.d.ts +4 -5
- package/lib/chevre/repo/place/seat.d.ts +4 -5
- package/lib/chevre/repo/place/section.d.ts +3 -4
- package/lib/chevre/repo/priceSpecification.d.ts +4 -4
- package/lib/chevre/repo/product.d.ts +3 -4
- package/lib/chevre/repo/rateLimit/offer.d.ts +3 -1
- package/lib/chevre/repo/rateLimit/offer.js +0 -12
- package/lib/chevre/repo/reservation.d.ts +2 -3
- package/lib/chevre/repo/scheduledTask.d.ts +90 -0
- package/lib/chevre/repo/scheduledTask.js +223 -0
- package/lib/chevre/repo/sellerMakesOffer.d.ts +3 -4
- package/lib/chevre/repo/stockHolder.d.ts +1 -1
- package/lib/chevre/repo/stockHolder.js +0 -146
- package/lib/chevre/repo/task.d.ts +30 -71
- package/lib/chevre/repo/task.js +59 -345
- package/lib/chevre/repo/transaction/placeOrder.d.ts +2 -45
- package/lib/chevre/repo/transaction/placeOrder.js +43 -83
- package/lib/chevre/repo/transaction.d.ts +2 -2
- package/lib/chevre/repo/transactionNumberCounter.js +0 -34
- package/lib/chevre/repo/transactionProcess.d.ts +2 -1
- package/lib/chevre/repo/transactionProcess.js +0 -13
- package/lib/chevre/repository.d.ts +20 -0
- package/lib/chevre/repository.js +46 -2
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +1 -1
- package/lib/chevre/service/aggregation/system.d.ts +2 -2
- package/lib/chevre/service/aggregation/system.js +1 -1
- package/lib/chevre/service/assetTransaction/cancelReservation.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/exportTasksById.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/start/factory.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/start/factory.js +3 -4
- package/lib/chevre/service/assetTransaction/pay/start.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/refund.js +1 -1
- package/lib/chevre/service/assetTransaction/reserve/exportTasksById.js +1 -1
- package/lib/chevre/service/assetTransaction/reserveCOA/cancel.js +1 -67
- package/lib/chevre/service/asyncAction.d.ts +16 -0
- package/lib/chevre/service/asyncAction.js +36 -0
- package/lib/chevre/service/asyncActionHandler/onOperationFailed.d.ts +15 -0
- package/lib/chevre/service/asyncActionHandler/onOperationFailed.js +42 -0
- package/lib/chevre/service/asyncActionHandler.d.ts +13 -0
- package/lib/chevre/service/asyncActionHandler.js +89 -0
- package/lib/chevre/service/notification/factory.d.ts +2 -4
- package/lib/chevre/service/notification/factory.js +26 -24
- package/lib/chevre/service/notification/notifyAbortedTasksByEmail.d.ts +12 -6
- package/lib/chevre/service/notification/notifyAbortedTasksByEmail.js +12 -4
- package/lib/chevre/service/offer/event/authorize/factory.d.ts +3 -5
- package/lib/chevre/service/offer/event/authorize/factory.js +93 -75
- package/lib/chevre/service/offer/event/authorize.d.ts +0 -4
- package/lib/chevre/service/offer/event/authorize.js +2 -2
- package/lib/chevre/service/offer/event/voidTransaction.d.ts +1 -1
- package/lib/chevre/service/offer/event/voidTransactionByActionId.d.ts +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +6 -7
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +10 -10
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/validateAcceptedOffers.js +2 -1
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.d.ts +0 -5
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +15 -12
- package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.d.ts +0 -5
- package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.js +2 -2
- package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.d.ts +4 -0
- package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.js +20 -9
- package/lib/chevre/service/offer/onEventChanged.js +2 -2
- package/lib/chevre/service/order/confirmPayTransaction.js +1 -1
- package/lib/chevre/service/order/deleteOrder.d.ts +5 -1
- package/lib/chevre/service/order/deleteOrder.js +8 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionCanceled.js +19 -11
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.d.ts +2 -0
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.d.ts +2 -2
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.js +1 -7
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +2 -0
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.js +2 -0
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +3 -3
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.d.ts +0 -3
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.js +73 -44
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.d.ts +5 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.js +53 -33
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/processOrder.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +6 -4
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +3 -7
- package/lib/chevre/service/order/onOrderUpdated.js +1 -1
- package/lib/chevre/service/order/payOrder.d.ts +2 -0
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.d.ts +2 -1
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +13 -58
- package/lib/chevre/service/order/placeOrder/factory.js +3 -21
- package/lib/chevre/service/order/placeOrder.d.ts +4 -5
- package/lib/chevre/service/order/placeOrder.js +20 -31
- package/lib/chevre/service/payment/any/authorize/fixOrderAsNeeded.js +1 -2
- package/lib/chevre/service/payment/any/authorize/fixTransactionNumber.d.ts +3 -2
- package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.d.ts +4 -3
- package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.js +3 -31
- package/lib/chevre/service/payment/any/authorize.js +13 -37
- package/lib/chevre/service/payment/any/factory.d.ts +7 -7
- package/lib/chevre/service/payment/any/factory.js +19 -22
- package/lib/chevre/service/payment/any/findAcceptAction.d.ts +7 -1
- package/lib/chevre/service/payment/any/findAcceptAction.js +34 -15
- package/lib/chevre/service/payment/any/findAuthorizeAction.d.ts +4 -0
- package/lib/chevre/service/payment/any/findAuthorizeAction.js +20 -9
- package/lib/chevre/service/payment/any/findCheckAction.d.ts +4 -0
- package/lib/chevre/service/payment/any/findCheckAction.js +20 -9
- package/lib/chevre/service/payment/any/invalidatePaymentUrl.d.ts +2 -0
- package/lib/chevre/service/payment/any/invalidatePaymentUrl.js +5 -67
- package/lib/chevre/service/payment/any/onPayActionCompleted.js +1 -1
- package/lib/chevre/service/payment/any/onRefundActionCompletedOrFailed.js +1 -1
- package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +4 -0
- package/lib/chevre/service/payment/any/publishPaymentUrl.js +4 -18
- package/lib/chevre/service/payment/any/voidPayTransaction.d.ts +2 -0
- package/lib/chevre/service/payment/any/voidPayTransaction.js +1 -23
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.js +5 -9
- package/lib/chevre/service/reserve/adminFindReservations.d.ts +15 -0
- package/lib/chevre/service/reserve/adminFindReservations.js +35 -0
- package/lib/chevre/service/reserve/potentialActions/onPendingReservationCanceled.js +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.js +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +20 -11
- package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationsCreated.js +1 -1
- package/lib/chevre/service/reserve/searchByOrder.js +2 -6
- package/lib/chevre/service/reserve.d.ts +2 -2
- package/lib/chevre/service/reserve.js +3 -3
- package/lib/chevre/service/scheduledTask.d.ts +11 -0
- package/lib/chevre/service/scheduledTask.js +40 -0
- package/lib/chevre/service/scheduledTaskHandler/onOperationFailed.d.ts +14 -0
- package/lib/chevre/service/scheduledTaskHandler/onOperationFailed.js +56 -0
- package/lib/chevre/service/scheduledTaskHandler.d.ts +12 -0
- package/lib/chevre/service/scheduledTaskHandler.js +66 -0
- package/lib/chevre/service/task/aggregateOffers.d.ts +2 -2
- package/lib/chevre/service/task/aggregateOffers.js +2 -1
- package/lib/chevre/service/task/aggregateScreeningEvent.d.ts +2 -2
- package/lib/chevre/service/task/aggregateScreeningEvent.js +2 -1
- package/lib/chevre/service/task/authorizePayment.js +3 -1
- package/lib/chevre/service/task/cancelReservation.d.ts +2 -2
- package/lib/chevre/service/task/cancelReservation.js +2 -1
- package/lib/chevre/service/task/confirmPayTransaction.js +0 -1
- package/lib/chevre/service/task/confirmReserveTransaction.js +3 -8
- package/lib/chevre/service/task/deleteTransaction.d.ts +2 -2
- package/lib/chevre/service/task/deleteTransaction.js +2 -1
- package/lib/chevre/service/task/onAssetTransactionStatusChanged.d.ts +2 -2
- package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +4 -3
- package/lib/chevre/service/task/onEventChanged.d.ts +2 -2
- package/lib/chevre/service/task/onEventChanged.js +2 -1
- package/lib/chevre/service/task/onOrderPaymentCompleted.d.ts +2 -2
- package/lib/chevre/service/task/onOrderPaymentCompleted.js +4 -1
- package/lib/chevre/service/task/onResourceUpdated/onAggregateOfferUpdated.js +2 -2
- package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +1 -1
- package/lib/chevre/service/task/onResourceUpdated/onOfferCatalogUpdated.js +1 -1
- package/lib/chevre/service/task/onResourceUpdated.d.ts +2 -2
- package/lib/chevre/service/task/onResourceUpdated.js +10 -9
- package/lib/chevre/service/task/placeOrder.d.ts +2 -2
- package/lib/chevre/service/task/placeOrder.js +6 -3
- package/lib/chevre/service/task/publishPaymentUrl.js +7 -3
- package/lib/chevre/service/task/refund.d.ts +2 -2
- package/lib/chevre/service/task/refund.js +4 -10
- package/lib/chevre/service/task/reserve.d.ts +2 -2
- package/lib/chevre/service/task/reserve.js +2 -1
- package/lib/chevre/service/task/returnOrder.d.ts +2 -2
- package/lib/chevre/service/task/returnOrder.js +2 -1
- package/lib/chevre/service/task/returnPayTransaction.js +1 -1
- package/lib/chevre/service/task/sendOrder.d.ts +2 -2
- package/lib/chevre/service/task/sendOrder.js +2 -1
- package/lib/chevre/service/task/voidPayTransaction.js +3 -7
- package/lib/chevre/service/task/voidPayment.d.ts +2 -2
- package/lib/chevre/service/task/voidPayment.js +2 -1
- package/lib/chevre/service/task/voidReserveTransaction.d.ts +1 -1
- package/lib/chevre/service/taskHandler/onOperationFailed/informTaskIfNeeded.js +1 -1
- package/lib/chevre/service/taskHandler/onOperationFailed.js +1 -1
- package/lib/chevre/service/taskHandler.d.ts +2 -2
- package/lib/chevre/service/taskHandler.js +36 -37
- package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.d.ts +15 -0
- package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.js +51 -0
- package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.d.ts +23 -0
- package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.js +64 -0
- package/lib/chevre/service/transaction/deleteTransaction.d.ts +1 -1
- package/lib/chevre/service/transaction/deleteTransaction.js +15 -152
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.d.ts +28 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.js +11 -12
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.d.ts +4 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.js +6 -7
- package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.d.ts +32 -4
- package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.js +10 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/factory.d.ts +5 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +6 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +23 -9
- package/lib/chevre/service/transaction/placeOrder/confirm.d.ts +6 -5
- package/lib/chevre/service/transaction/placeOrder/confirm.js +30 -40
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +1 -1
- package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.d.ts +4 -7
- package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.js +33 -15
- package/lib/chevre/service/transaction/placeOrder/start.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/updateAgent/fixCustomer.d.ts +20 -0
- package/lib/chevre/service/transaction/placeOrder/updateAgent/fixCustomer.js +63 -0
- package/lib/chevre/service/transaction/placeOrder/updateAgent.d.ts +0 -1
- package/lib/chevre/service/transaction/placeOrder/updateAgent.js +17 -86
- package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -1
- package/lib/chevre/service/transaction/returnOrder.js +1 -1
- package/lib/chevre/service.d.ts +8 -0
- package/lib/chevre/service.js +23 -1
- package/lib/chevre/taskSettings.d.ts +3 -4
- package/package.json +8 -11
- package/lib/chevre/service/order/findConfirmedPlaceOrder.d.ts +0 -13
- package/lib/chevre/service/order/findConfirmedPlaceOrder.js +0 -32
- package/lib/chevre/service/reserve/findReservations.d.ts +0 -33
- package/lib/chevre/service/reserve/findReservations.js +0 -61
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PersonRepo = void 0;
|
|
4
|
-
// import { fromEnv } from '@aws-sdk/credential-providers';
|
|
5
|
-
const google_libphonenumber_1 = require("google-libphonenumber");
|
|
6
4
|
const factory_1 = require("../factory");
|
|
7
5
|
/**
|
|
8
6
|
* 会員リポジトリ
|
|
@@ -92,73 +90,81 @@ class PersonRepo {
|
|
|
92
90
|
}
|
|
93
91
|
return person;
|
|
94
92
|
}
|
|
95
|
-
static PROFILE2ATTRIBUTE(params) {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
93
|
+
// public static PROFILE2ATTRIBUTE(params: factory.person.IProfile): AttributeType[] {
|
|
94
|
+
// let formatedPhoneNumber: string | undefined;
|
|
95
|
+
// if (typeof params.telephone === 'string' && params.telephone.length > 0) {
|
|
96
|
+
// try {
|
|
97
|
+
// // const phoneUtil = PhoneNumberUtil.getInstance();
|
|
98
|
+
// // const phoneNumber = phoneUtil.parse(params.telephone);
|
|
99
|
+
// // /* istanbul ignore if */
|
|
100
|
+
// // if (!phoneUtil.isValidNumber(phoneNumber)) {
|
|
101
|
+
// // throw new factory.errors.Argument('telephone', 'Invalid phone number');
|
|
102
|
+
// // }
|
|
103
|
+
// // formatedPhoneNumber = phoneUtil.format(phoneNumber, PhoneNumberFormat.E164);
|
|
104
|
+
// const phoneNumber = parsePhoneNumberFromString(params.telephone);
|
|
105
|
+
// if (phoneNumber === undefined || !phoneNumber.isValid()) {
|
|
106
|
+
// throw new factory.errors.Argument('telephone', 'Invalid phone number');
|
|
107
|
+
// }
|
|
108
|
+
// formatedPhoneNumber = phoneNumber.format('E.164');
|
|
109
|
+
// } catch (_error) {
|
|
110
|
+
// throw new factory.errors.Argument('telephone', 'Invalid phone number');
|
|
111
|
+
// }
|
|
112
|
+
// }
|
|
113
|
+
// const userAttributes: AttributeType[] = [];
|
|
114
|
+
// if (typeof params.givenName === 'string') {
|
|
115
|
+
// userAttributes.push({
|
|
116
|
+
// Name: 'given_name',
|
|
117
|
+
// Value: params.givenName
|
|
118
|
+
// });
|
|
119
|
+
// }
|
|
120
|
+
// if (typeof params.familyName === 'string') {
|
|
121
|
+
// userAttributes.push({
|
|
122
|
+
// Name: 'family_name',
|
|
123
|
+
// Value: params.familyName
|
|
124
|
+
// });
|
|
125
|
+
// }
|
|
126
|
+
// if (typeof params.email === 'string') {
|
|
127
|
+
// userAttributes.push({
|
|
128
|
+
// Name: 'email',
|
|
129
|
+
// Value: params.email
|
|
130
|
+
// });
|
|
131
|
+
// }
|
|
132
|
+
// if (typeof formatedPhoneNumber === 'string') {
|
|
133
|
+
// userAttributes.push({
|
|
134
|
+
// Name: 'phone_number',
|
|
135
|
+
// Value: formatedPhoneNumber
|
|
136
|
+
// });
|
|
137
|
+
// }
|
|
138
|
+
// if (Array.isArray(params.additionalProperty)) {
|
|
139
|
+
// userAttributes.push(...params.additionalProperty.map((a) => {
|
|
140
|
+
// let userAttributesValue: string = a.value;
|
|
141
|
+
// // custom:telephoneに関してもtelephoneと同様のバリデーションを追加
|
|
142
|
+
// if (a.name === 'custom:telephone') {
|
|
143
|
+
// try {
|
|
144
|
+
// // const phoneUtil = PhoneNumberUtil.getInstance();
|
|
145
|
+
// // const phoneNumber = phoneUtil.parse(String(a.value));
|
|
146
|
+
// // /* istanbul ignore if */
|
|
147
|
+
// // if (!phoneUtil.isValidNumber(phoneNumber)) {
|
|
148
|
+
// // throw new factory.errors.Argument('custom:telephone', 'Invalid phone number');
|
|
149
|
+
// // }
|
|
150
|
+
// // userAttributesValue = phoneUtil.format(phoneNumber, PhoneNumberFormat.E164);
|
|
151
|
+
// const phoneNumber = parsePhoneNumberFromString(String(a.value));
|
|
152
|
+
// if (phoneNumber === undefined || !phoneNumber.isValid()) {
|
|
153
|
+
// throw new factory.errors.Argument('telephone', 'Invalid phone number');
|
|
154
|
+
// }
|
|
155
|
+
// userAttributesValue = phoneNumber.format('E.164');
|
|
156
|
+
// } catch (_error) {
|
|
157
|
+
// throw new factory.errors.Argument('custome:telephone', 'Invalid phone number');
|
|
158
|
+
// }
|
|
159
|
+
// }
|
|
160
|
+
// return {
|
|
161
|
+
// Name: a.name,
|
|
162
|
+
// Value: userAttributesValue
|
|
163
|
+
// };
|
|
164
|
+
// }));
|
|
165
|
+
// }
|
|
166
|
+
// return userAttributes;
|
|
167
|
+
// }
|
|
162
168
|
/**
|
|
163
169
|
* 管理者権限でユーザー属性を取得する
|
|
164
170
|
*/
|
|
@@ -177,26 +183,30 @@ class PersonRepo {
|
|
|
177
183
|
});
|
|
178
184
|
});
|
|
179
185
|
}
|
|
180
|
-
/**
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
async updateProfile(params
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
186
|
+
// /**
|
|
187
|
+
// * 管理者権限でプロフィール更新
|
|
188
|
+
// */
|
|
189
|
+
// public async updateProfile(params: {
|
|
190
|
+
// username: string;
|
|
191
|
+
// profile: factory.person.IProfile;
|
|
192
|
+
// }): Promise<void> {
|
|
193
|
+
// return new Promise<void>((resolve, reject) => {
|
|
194
|
+
// const userAttributes = PersonRepo.PROFILE2ATTRIBUTE(params.profile);
|
|
195
|
+
// this.cognitoIdentityServiceProvider.adminUpdateUserAttributes(
|
|
196
|
+
// {
|
|
197
|
+
// UserPoolId: this.userPoolId,
|
|
198
|
+
// Username: params.username,
|
|
199
|
+
// UserAttributes: userAttributes
|
|
200
|
+
// },
|
|
201
|
+
// (err) => {
|
|
202
|
+
// if (err instanceof Error) {
|
|
203
|
+
// reject(new factory.errors.Argument('profile', err.message));
|
|
204
|
+
// } else {
|
|
205
|
+
// resolve();
|
|
206
|
+
// }
|
|
207
|
+
// });
|
|
208
|
+
// });
|
|
209
|
+
// }
|
|
200
210
|
/**
|
|
201
211
|
* 管理者権限でsubでユーザーを検索する
|
|
202
212
|
*/
|
|
@@ -249,25 +259,29 @@ class PersonRepo {
|
|
|
249
259
|
});
|
|
250
260
|
});
|
|
251
261
|
}
|
|
252
|
-
/**
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
async updateProfileByAccessToken(params
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
262
|
+
// /**
|
|
263
|
+
// * 会員プロフィール更新
|
|
264
|
+
// */
|
|
265
|
+
// public async updateProfileByAccessToken(params: {
|
|
266
|
+
// accessToken: string;
|
|
267
|
+
// profile: factory.person.IProfile;
|
|
268
|
+
// }): Promise<void> {
|
|
269
|
+
// return new Promise<void>((resolve, reject) => {
|
|
270
|
+
// const userAttributes = PersonRepo.PROFILE2ATTRIBUTE(params.profile);
|
|
271
|
+
// this.cognitoIdentityServiceProvider.updateUserAttributes(
|
|
272
|
+
// {
|
|
273
|
+
// AccessToken: params.accessToken,
|
|
274
|
+
// UserAttributes: userAttributes
|
|
275
|
+
// },
|
|
276
|
+
// (err) => {
|
|
277
|
+
// if (err instanceof Error) {
|
|
278
|
+
// reject(new factory.errors.Argument('profile', err.message));
|
|
279
|
+
// } else {
|
|
280
|
+
// resolve();
|
|
281
|
+
// }
|
|
282
|
+
// });
|
|
283
|
+
// });
|
|
284
|
+
// }
|
|
271
285
|
/**
|
|
272
286
|
* 削除
|
|
273
287
|
*/
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Connection } from 'mongoose';
|
|
1
|
+
import { Connection, mongo } from 'mongoose';
|
|
3
2
|
import { factory } from '../../factory';
|
|
4
3
|
/**
|
|
5
4
|
* ゲートを操作する組織
|
|
@@ -37,12 +36,12 @@ export declare class EntranceGateRepo {
|
|
|
37
36
|
addEntranceGatesByIdentifierIfNotExist(params: {
|
|
38
37
|
$set: ICreatingEntranceGate;
|
|
39
38
|
}[], options: IUpdateOptions): Promise<{
|
|
40
|
-
bulkWriteResult?: BulkWriteResult;
|
|
39
|
+
bulkWriteResult?: mongo.BulkWriteResult;
|
|
41
40
|
}>;
|
|
42
41
|
updateEntranceGatesByIdentifier(params: {
|
|
43
42
|
$set: ICreatingEntranceGate;
|
|
44
43
|
}[], options: IUpdateOptions): Promise<{
|
|
45
|
-
bulkWriteResult?: BulkWriteResult;
|
|
44
|
+
bulkWriteResult?: mongo.BulkWriteResult;
|
|
46
45
|
}>;
|
|
47
46
|
deleteEntranceGatesByIdentifier(params: {
|
|
48
47
|
/**
|
|
@@ -50,7 +49,7 @@ export declare class EntranceGateRepo {
|
|
|
50
49
|
*/
|
|
51
50
|
identifier: string;
|
|
52
51
|
}[], options: IUpdateOptions): Promise<{
|
|
53
|
-
bulkWriteResult?: BulkWriteResult;
|
|
52
|
+
bulkWriteResult?: mongo.BulkWriteResult;
|
|
54
53
|
}>;
|
|
55
54
|
private createMatchStages;
|
|
56
55
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Connection, FilterQuery } from 'mongoose';
|
|
1
|
+
import type { Connection, FilterQuery, mongo } from 'mongoose';
|
|
3
2
|
import { factory } from '../../factory';
|
|
4
3
|
import { IDocType } from '../mongoose/schemas/civicStructure';
|
|
5
4
|
export type IScreeningRoomFoundByBranchCode = Pick<factory.place.screeningRoom.IPlace, 'typeOf' | 'branchCode' | 'name' | 'containsPlace' | 'seatCount' | 'parentOrganization'>;
|
|
@@ -49,7 +48,7 @@ export declare class MovieTheaterRepo {
|
|
|
49
48
|
[key in keyof IUpsertingMovieTheater]?: 1;
|
|
50
49
|
};
|
|
51
50
|
}[], options: IUpsertOptions): Promise<{
|
|
52
|
-
bulkWriteResult?: BulkWriteResult;
|
|
51
|
+
bulkWriteResult?: mongo.BulkWriteResult;
|
|
53
52
|
/**
|
|
54
53
|
* 追加あるいは編集された施設
|
|
55
54
|
*/
|
|
@@ -86,7 +85,7 @@ export declare class MovieTheaterRepo {
|
|
|
86
85
|
*/
|
|
87
86
|
id: string;
|
|
88
87
|
};
|
|
89
|
-
}): Promise<
|
|
88
|
+
}): Promise<mongo.DeleteResult>;
|
|
90
89
|
/**
|
|
91
90
|
* プロジェクトに属する施設を全削除
|
|
92
91
|
*/
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { Connection, FilterQuery, PipelineStage } from 'mongoose';
|
|
1
|
+
import type { Connection, FilterQuery, PipelineStage, mongo } from 'mongoose';
|
|
3
2
|
import { factory } from '../../factory';
|
|
4
3
|
import { IDocType } from '../mongoose/schemas/place';
|
|
5
4
|
export type IScreeningRoomFoundByBranchCode = Pick<factory.place.screeningRoom.IPlace, 'typeOf' | 'branchCode' | 'name' | 'containsPlace' | 'seatCount' | 'parentOrganization'>;
|
|
@@ -66,7 +65,7 @@ export declare class ScreeningRoomRepo {
|
|
|
66
65
|
[key in keyof IUpsertingRoom]?: 1;
|
|
67
66
|
};
|
|
68
67
|
}[], options: IUpsertOptions): Promise<{
|
|
69
|
-
bulkWriteResult?: BulkWriteResult;
|
|
68
|
+
bulkWriteResult?: mongo.BulkWriteResult;
|
|
70
69
|
}>;
|
|
71
70
|
deleteRoomByBranchCode(screeningRoom: {
|
|
72
71
|
/**
|
|
@@ -84,7 +83,7 @@ export declare class ScreeningRoomRepo {
|
|
|
84
83
|
*/
|
|
85
84
|
id: string;
|
|
86
85
|
};
|
|
87
|
-
}): Promise<
|
|
86
|
+
}): Promise<mongo.DeleteResult>;
|
|
88
87
|
searchScreeningRooms(searchConditions: factory.place.screeningRoom.ISearchConditions): Promise<Omit<factory.place.screeningRoom.IPlace, 'containsPlace' | 'parentOrganization'>[]>;
|
|
89
88
|
findRooms(params: Omit<factory.place.screeningRoom.ISearchConditions, '$projection'>): Promise<Pick<factory.place.screeningRoom.IPlace, 'additionalProperty' | 'address' | 'branchCode' | 'name' | 'openSeatingAllowed' | 'maximumAttendeeCapacity'>[]>;
|
|
90
89
|
/**
|
|
@@ -116,7 +115,7 @@ export declare class ScreeningRoomRepo {
|
|
|
116
115
|
*/
|
|
117
116
|
id: string;
|
|
118
117
|
};
|
|
119
|
-
}): Promise<
|
|
118
|
+
}): Promise<mongo.DeleteResult>;
|
|
120
119
|
/**
|
|
121
120
|
* プロジェクトに属するルームを全削除
|
|
122
121
|
*/
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { AnyExpression, Connection, PipelineStage } from 'mongoose';
|
|
1
|
+
import type { AnyExpression, Connection, PipelineStage, mongo } from 'mongoose';
|
|
3
2
|
import { factory } from '../../factory';
|
|
4
3
|
type IMatchStage = PipelineStage.Match;
|
|
5
4
|
type ICreatingSeat = Pick<factory.place.seat.IPlace, 'additionalProperty' | 'branchCode' | 'name' | 'maximumAttendeeCapacity' | 'seatingType'>;
|
|
@@ -45,7 +44,7 @@ export declare class SeatRepo {
|
|
|
45
44
|
addSeatsByBranchCodeIfNotExist(params: {
|
|
46
45
|
$set: ICreatingSeat;
|
|
47
46
|
}[], options: IUpdateOptions): Promise<{
|
|
48
|
-
bulkWriteResult?: BulkWriteResult;
|
|
47
|
+
bulkWriteResult?: mongo.BulkWriteResult;
|
|
49
48
|
}>;
|
|
50
49
|
/**
|
|
51
50
|
* コードをキーにして冪等編集
|
|
@@ -56,7 +55,7 @@ export declare class SeatRepo {
|
|
|
56
55
|
[key in keyof ICreatingSeat]?: 1;
|
|
57
56
|
};
|
|
58
57
|
}[], options: IUpdateOptions): Promise<{
|
|
59
|
-
bulkWriteResult?: BulkWriteResult;
|
|
58
|
+
bulkWriteResult?: mongo.BulkWriteResult;
|
|
60
59
|
}>;
|
|
61
60
|
updateSeatByBranchCode(seat: ICreatingSeat, $unset: any, // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
62
61
|
options: IUpdateOptions): Promise<IUpdateSeatResult>;
|
|
@@ -166,7 +165,7 @@ export declare class SeatRepo {
|
|
|
166
165
|
*/
|
|
167
166
|
branchCode: string;
|
|
168
167
|
}[], options: IUpdateOptions): Promise<{
|
|
169
|
-
bulkWriteResult?: BulkWriteResult;
|
|
168
|
+
bulkWriteResult?: mongo.BulkWriteResult;
|
|
170
169
|
}>;
|
|
171
170
|
deleteSeatByBranchCode(seat: {
|
|
172
171
|
/**
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Connection, PipelineStage } from 'mongoose';
|
|
1
|
+
import type { Connection, PipelineStage, mongo } from 'mongoose';
|
|
3
2
|
import { factory } from '../../factory';
|
|
4
3
|
type IScreeningRoomSectionWithoutContainsPlace = Omit<factory.place.screeningRoomSection.IPlace, 'containsPlace'>;
|
|
5
4
|
type ICreatingSection = Pick<factory.place.screeningRoomSection.IPlace, 'additionalProperty' | 'branchCode' | 'name'>;
|
|
@@ -57,7 +56,7 @@ export declare class SectionRepo {
|
|
|
57
56
|
addSeatSectionsByBranchCodeIfNotExist(params: {
|
|
58
57
|
$set: IUpsertingSeatSection;
|
|
59
58
|
}[], options: IUpsertOptions): Promise<{
|
|
60
|
-
bulkWriteResult?: BulkWriteResult;
|
|
59
|
+
bulkWriteResult?: mongo.BulkWriteResult;
|
|
61
60
|
}>;
|
|
62
61
|
/**
|
|
63
62
|
* コードをキーにして冪等編集
|
|
@@ -65,7 +64,7 @@ export declare class SectionRepo {
|
|
|
65
64
|
updateSeatSectionsByBranchCode(params: {
|
|
66
65
|
$set: IUpsertingSeatSection;
|
|
67
66
|
}[], options: IUpsertOptions): Promise<{
|
|
68
|
-
bulkWriteResult?: BulkWriteResult;
|
|
67
|
+
bulkWriteResult?: mongo.BulkWriteResult;
|
|
69
68
|
}>;
|
|
70
69
|
migrateSectionIdentifier(screeningRoomSection: {
|
|
71
70
|
project: {
|
|
@@ -37,8 +37,8 @@ export declare class PriceSpecificationRepo {
|
|
|
37
37
|
};
|
|
38
38
|
}): Promise<void>;
|
|
39
39
|
getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & (({
|
|
40
|
-
project?: Pick<factory.project.IProject, "id" | "typeOf"> | undefined;
|
|
41
40
|
name?: (string | import("@chevre/factory/lib/chevre/multilingualString").IMultilingualString) | undefined;
|
|
41
|
+
project?: Pick<factory.project.IProject, "id" | "typeOf"> | undefined;
|
|
42
42
|
price: number;
|
|
43
43
|
priceCurrency: factory.priceCurrency;
|
|
44
44
|
typeOf: factory.priceSpecificationType.CategoryCodeChargeSpecification;
|
|
@@ -53,8 +53,8 @@ export declare class PriceSpecificationRepo {
|
|
|
53
53
|
} & {
|
|
54
54
|
__v: number;
|
|
55
55
|
}) | ({
|
|
56
|
-
project?: Pick<factory.project.IProject, "id" | "typeOf"> | undefined;
|
|
57
56
|
name?: (string | import("@chevre/factory/lib/chevre/multilingualString").IMultilingualString) | undefined;
|
|
57
|
+
project?: Pick<factory.project.IProject, "id" | "typeOf"> | undefined;
|
|
58
58
|
price: number;
|
|
59
59
|
priceCurrency: factory.priceCurrency;
|
|
60
60
|
typeOf: factory.priceSpecificationType.MovieTicketTypeChargeSpecification;
|
|
@@ -70,8 +70,8 @@ export declare class PriceSpecificationRepo {
|
|
|
70
70
|
} & {
|
|
71
71
|
__v: number;
|
|
72
72
|
})), import("mongoose").QueryOptions<IDocType>, (import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & (({
|
|
73
|
-
project?: Pick<factory.project.IProject, "id" | "typeOf"> | undefined;
|
|
74
73
|
name?: (string | import("@chevre/factory/lib/chevre/multilingualString").IMultilingualString) | undefined;
|
|
74
|
+
project?: Pick<factory.project.IProject, "id" | "typeOf"> | undefined;
|
|
75
75
|
price: number;
|
|
76
76
|
priceCurrency: factory.priceCurrency;
|
|
77
77
|
typeOf: factory.priceSpecificationType.CategoryCodeChargeSpecification;
|
|
@@ -86,8 +86,8 @@ export declare class PriceSpecificationRepo {
|
|
|
86
86
|
} & {
|
|
87
87
|
__v: number;
|
|
88
88
|
}) | ({
|
|
89
|
-
project?: Pick<factory.project.IProject, "id" | "typeOf"> | undefined;
|
|
90
89
|
name?: (string | import("@chevre/factory/lib/chevre/multilingualString").IMultilingualString) | undefined;
|
|
90
|
+
project?: Pick<factory.project.IProject, "id" | "typeOf"> | undefined;
|
|
91
91
|
price: number;
|
|
92
92
|
priceCurrency: factory.priceCurrency;
|
|
93
93
|
typeOf: factory.priceSpecificationType.MovieTicketTypeChargeSpecification;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Connection, FilterQuery, Types } from 'mongoose';
|
|
1
|
+
import { Connection, FilterQuery, Types, mongo } from 'mongoose';
|
|
3
2
|
import { factory } from '../factory';
|
|
4
3
|
import { IDocType, IDocTypeAsProduct } from './mongoose/schemas/product';
|
|
5
4
|
type IKeyOfProjection = keyof factory.product.IProduct | 'hasOfferCatalog.id';
|
|
@@ -65,7 +64,7 @@ export declare class ProductRepo {
|
|
|
65
64
|
};
|
|
66
65
|
$unset?: Partial<Record<IUnsetKey, 1>>;
|
|
67
66
|
}[]): Promise<{
|
|
68
|
-
bulkWriteResult?: BulkWriteResult;
|
|
67
|
+
bulkWriteResult?: mongo.BulkWriteResult;
|
|
69
68
|
modifiedProducts?: {
|
|
70
69
|
id: string;
|
|
71
70
|
}[];
|
|
@@ -80,7 +79,7 @@ export declare class ProductRepo {
|
|
|
80
79
|
hasOfferCatalog: {
|
|
81
80
|
id: string;
|
|
82
81
|
};
|
|
83
|
-
}): Promise<
|
|
82
|
+
}): Promise<mongo.DeleteResult>;
|
|
84
83
|
/**
|
|
85
84
|
* プロジェクト指定で削除する
|
|
86
85
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { createClient } from 'redis';
|
|
2
2
|
import { factory } from '../../factory';
|
|
3
|
+
type RedisClientType = ReturnType<typeof createClient>;
|
|
3
4
|
/**
|
|
4
5
|
* レート制限キーインターフェース
|
|
5
6
|
*/
|
|
@@ -34,3 +35,4 @@ export declare class OfferRateLimitRepo {
|
|
|
34
35
|
unlock(params: IRateLimitKey): Promise<void>;
|
|
35
36
|
getHolder(ratelimitKey: IRateLimitKey): Promise<string | null>;
|
|
36
37
|
}
|
|
38
|
+
export {};
|
|
@@ -28,7 +28,6 @@ class OfferRateLimitRepo {
|
|
|
28
28
|
* ロックする
|
|
29
29
|
* discontinue array params(2025-05-26~)
|
|
30
30
|
*/
|
|
31
|
-
// public async lock(ratelimitKeys: IRateLimitKey[]): Promise<void> {
|
|
32
31
|
async lock(params) {
|
|
33
32
|
const key = OfferRateLimitRepo.createKey(params);
|
|
34
33
|
const value = params.reservationNumber;
|
|
@@ -50,18 +49,8 @@ class OfferRateLimitRepo {
|
|
|
50
49
|
catch (_error) {
|
|
51
50
|
throw new factory_1.factory.errors.RateLimitExceeded('Offer');
|
|
52
51
|
}
|
|
53
|
-
// const multi = this.redisClient.multi();
|
|
54
|
-
// multi.setNX(key, value)
|
|
55
|
-
// .expire(key, ttl);
|
|
56
|
-
// const results = await multi.exec();
|
|
57
|
-
// if (Array.isArray(results) && (results[0] === 1 || (<any>results)[0] === true)) {
|
|
58
|
-
// return;
|
|
59
|
-
// } else {
|
|
60
|
-
// throw new factory.errors.RateLimitExceeded('Offer');
|
|
61
|
-
// }
|
|
62
52
|
}
|
|
63
53
|
// discontinue array params(2025-05-26~)
|
|
64
|
-
// public async unlock(ratelimitKeys: IRateLimitKey[]): Promise<void> {
|
|
65
54
|
async unlock(params) {
|
|
66
55
|
const key = OfferRateLimitRepo.createKey(params);
|
|
67
56
|
// reimplement using concurrentLockRepo(2025-05-27~)
|
|
@@ -69,7 +58,6 @@ class OfferRateLimitRepo {
|
|
|
69
58
|
about: { identifier: key, typeOf: 'Thing' },
|
|
70
59
|
audience: { identifier: params.reservationNumber, typeOf: 'Audience' }
|
|
71
60
|
});
|
|
72
|
-
// await this.redisClient.del(key);
|
|
73
61
|
}
|
|
74
62
|
async getHolder(ratelimitKey) {
|
|
75
63
|
const key = OfferRateLimitRepo.createKey(ratelimitKey);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Connection, UpdateWriteOpResult } from 'mongoose';
|
|
1
|
+
import type { Connection, UpdateWriteOpResult, mongo } from 'mongoose';
|
|
3
2
|
import { IDocType } from './mongoose/schemas/reservation';
|
|
4
3
|
import { factory } from '../factory';
|
|
5
4
|
export interface IUpdatePartiallyParams {
|
|
@@ -77,7 +76,7 @@ export declare class ReservationRepo {
|
|
|
77
76
|
reservationNumber: string;
|
|
78
77
|
underName?: factory.reservation.IUnderName;
|
|
79
78
|
broker?: factory.reservation.IBroker;
|
|
80
|
-
}): Promise<BulkWriteResult | undefined>;
|
|
79
|
+
}): Promise<mongo.BulkWriteResult | undefined>;
|
|
81
80
|
/**
|
|
82
81
|
* 予約取消
|
|
83
82
|
*/
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { Connection, UpdateWriteOpResult } from 'mongoose';
|
|
2
|
+
import { factory } from '../factory';
|
|
3
|
+
import type { IExecutableTask } from '../taskSettings';
|
|
4
|
+
type ICreatingTaskKeys = 'data' | 'executionResults' | 'name' | 'numberOfTried' | 'project' | 'remainingNumberOfTries' | 'runsAt' | 'status' | 'description';
|
|
5
|
+
/**
|
|
6
|
+
* リトライ可能なタスク作成属性
|
|
7
|
+
*/
|
|
8
|
+
type ICreatingTask = (Pick<factory.task.importEventCapacitiesFromCOA.IAttributes, ICreatingTaskKeys> | Pick<factory.task.importEventsFromCOA.IAttributes, ICreatingTaskKeys>) & {
|
|
9
|
+
expires: Date;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* 予定タスクリポジトリ
|
|
13
|
+
*/
|
|
14
|
+
export declare class ScheduledTaskRepo {
|
|
15
|
+
private readonly scheduledTaskModel;
|
|
16
|
+
constructor(connection: Connection);
|
|
17
|
+
addScheduledTasks(taskAttributes: ICreatingTask[]): Promise<{
|
|
18
|
+
id: string;
|
|
19
|
+
}[]>;
|
|
20
|
+
countPotentiallyRunningScheduledTasks(params: {
|
|
21
|
+
name: {
|
|
22
|
+
$eq: factory.taskName;
|
|
23
|
+
};
|
|
24
|
+
runsAt: {
|
|
25
|
+
$lt: Date;
|
|
26
|
+
};
|
|
27
|
+
limit?: number;
|
|
28
|
+
}): Promise<{
|
|
29
|
+
count: number;
|
|
30
|
+
}>;
|
|
31
|
+
/**
|
|
32
|
+
* 実行日時を一定期間過ぎたReadyタスクについて、Runningステータスに変更
|
|
33
|
+
*/
|
|
34
|
+
runScheduledTaskIfExists(params: {
|
|
35
|
+
/**
|
|
36
|
+
* 必ずタスク名指定で実行する
|
|
37
|
+
*/
|
|
38
|
+
name: {
|
|
39
|
+
$eq: factory.taskName;
|
|
40
|
+
};
|
|
41
|
+
runsAt: {
|
|
42
|
+
$lt: Date;
|
|
43
|
+
};
|
|
44
|
+
executor: {
|
|
45
|
+
name: string;
|
|
46
|
+
};
|
|
47
|
+
}): Promise<Pick<factory.task.ITask<factory.taskName>, 'id' | 'name'> | null>;
|
|
48
|
+
/**
|
|
49
|
+
* Running -> findOneするだけ
|
|
50
|
+
*/
|
|
51
|
+
findRunningScheduledTaskById(params: {
|
|
52
|
+
id: string;
|
|
53
|
+
}): Promise<IExecutableTask<factory.taskName> | null>;
|
|
54
|
+
/**
|
|
55
|
+
* タスクIDから実行結果とステータスを保管する
|
|
56
|
+
* Abortedの場合、dateAbortedもセットする
|
|
57
|
+
*/
|
|
58
|
+
setExecutionResultAndStatus(params: {
|
|
59
|
+
/**
|
|
60
|
+
* タスクID
|
|
61
|
+
*/
|
|
62
|
+
id: string;
|
|
63
|
+
}, update: {
|
|
64
|
+
status: factory.taskStatus.Executed | factory.taskStatus.Running | factory.taskStatus.Aborted;
|
|
65
|
+
executionResult: factory.task.IExecutionResult;
|
|
66
|
+
}): Promise<void>;
|
|
67
|
+
deleteTooOldReadyTasks(params: {
|
|
68
|
+
project: {
|
|
69
|
+
id: string;
|
|
70
|
+
};
|
|
71
|
+
name: factory.taskName;
|
|
72
|
+
runsAt: {
|
|
73
|
+
$lt: Date;
|
|
74
|
+
};
|
|
75
|
+
}): Promise<import("mongodb").DeleteResult>;
|
|
76
|
+
/**
|
|
77
|
+
* Runningのまま一定期間超過し、かつ、remainingNumberOfTries>0のタスクをReadyに変更する
|
|
78
|
+
*/
|
|
79
|
+
retryScheduledTasks(params: {
|
|
80
|
+
intervalInMinutes: number;
|
|
81
|
+
}): Promise<UpdateWriteOpResult>;
|
|
82
|
+
/**
|
|
83
|
+
* $eq:0をAbortedにする(タスク名称に関わらず)
|
|
84
|
+
* これらは中止されてもhubへ通知しない
|
|
85
|
+
*/
|
|
86
|
+
abortScheduledTasks(params: {
|
|
87
|
+
intervalInMinutes: number;
|
|
88
|
+
}): Promise<UpdateWriteOpResult>;
|
|
89
|
+
}
|
|
90
|
+
export {};
|