@chevre/domain 25.2.0-alpha.9 → 26.0.0-alpha.1
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.d.ts +16 -9
- package/lib/chevre/repo/action.js +99 -180
- package/lib/chevre/repo/adminScheduledTask.d.ts +20 -0
- package/lib/chevre/repo/adminScheduledTask.js +95 -0
- 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/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 +25 -0
- package/lib/chevre/repository.js +57 -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 +7 -5
- package/lib/chevre/service/payment/any/factory.d.ts +7 -7
- package/lib/chevre/service/payment/any/factory.js +18 -21
- 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
|
@@ -35,7 +35,7 @@ function onReservationConfirmedByAction(actionAttributes) {
|
|
|
35
35
|
}
|
|
36
36
|
// タスク保管
|
|
37
37
|
if (taskAttributes.length > 0) {
|
|
38
|
-
await repos.task.saveMany(taskAttributes
|
|
38
|
+
await repos.task.saveMany(taskAttributes);
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
}
|
|
@@ -46,6 +46,7 @@ function onReservationConfirmed(confirmedReservations, reserveAction) {
|
|
|
46
46
|
const setting = await repos.setting.findOne({ project: { id: { $eq: '*' } } }, ['onReservationStatusChanged']);
|
|
47
47
|
// const informReservations = settings.onReservationStatusChanged.informReservation;
|
|
48
48
|
const informReservations = setting?.onReservationStatusChanged?.informReservation;
|
|
49
|
+
const minimizeReservation = setting?.onReservationStatusChanged?.minimizeReservation === true;
|
|
49
50
|
let orderAsAbout;
|
|
50
51
|
if (Array.isArray(reserveAction.instrument)) {
|
|
51
52
|
for (const eachInstrument of reserveAction.instrument) {
|
|
@@ -98,16 +99,24 @@ function onReservationConfirmed(confirmedReservations, reserveAction) {
|
|
|
98
99
|
}
|
|
99
100
|
const subReservations4inform = confirmedReservations.map((r) => {
|
|
100
101
|
const { additionalProperty, additionalTicketText, id, modifiedTime, price, programMembershipUsed, reservedTicket, subReservation, typeOf } = r;
|
|
102
|
+
let reservedTicket4inform;
|
|
103
|
+
if (minimizeReservation) {
|
|
104
|
+
const { ticketType: _ticketType, ...reservedTicketWithNoTicketType } = reservedTicket;
|
|
105
|
+
reservedTicket4inform = reservedTicketWithNoTicketType;
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
reservedTicket4inform = reservedTicket; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
109
|
+
}
|
|
101
110
|
return {
|
|
102
111
|
id,
|
|
103
112
|
typeOf,
|
|
104
|
-
reservedTicket,
|
|
105
|
-
...(Array.isArray(additionalProperty)) ? { additionalProperty } : undefined,
|
|
113
|
+
reservedTicket: reservedTicket4inform,
|
|
106
114
|
...(typeof additionalTicketText === 'string') ? { additionalTicketText } : undefined,
|
|
107
115
|
...(modifiedTime instanceof Date) ? { modifiedTime } : undefined,
|
|
108
|
-
...(
|
|
109
|
-
...(
|
|
110
|
-
...(
|
|
116
|
+
...(Array.isArray(subReservation)) ? { subReservation } : undefined,
|
|
117
|
+
...(!minimizeReservation && Array.isArray(additionalProperty)) ? { additionalProperty } : undefined, // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
118
|
+
...(!minimizeReservation && price !== undefined) ? { price } : undefined, // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
119
|
+
...(!minimizeReservation && programMembershipUsed !== undefined) ? { programMembershipUsed } : undefined, // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
111
120
|
};
|
|
112
121
|
});
|
|
113
122
|
if (typeof issuedThrough.id !== 'string') {
|
|
@@ -116,7 +125,6 @@ function onReservationConfirmed(confirmedReservations, reserveAction) {
|
|
|
116
125
|
}
|
|
117
126
|
const informObject = {
|
|
118
127
|
bookingTime,
|
|
119
|
-
issuedThrough, // subReservationから移行(2024-03-20~)
|
|
120
128
|
project,
|
|
121
129
|
provider, // subReservationから移行(2024-03-20~)
|
|
122
130
|
reservationFor,
|
|
@@ -124,8 +132,9 @@ function onReservationConfirmed(confirmedReservations, reserveAction) {
|
|
|
124
132
|
reservationStatus: factory_1.factory.reservationStatusType.ReservationConfirmed,
|
|
125
133
|
subReservation: subReservations4inform,
|
|
126
134
|
typeOf: factory_1.factory.reservationType.ReservationPackage,
|
|
127
|
-
...(
|
|
128
|
-
|
|
135
|
+
...(!minimizeReservation) ? { issuedThrough } : undefined, // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
136
|
+
...(!minimizeReservation && typeof underName?.typeOf === 'string')
|
|
137
|
+
? { underName: (0, factory_2.optimizeUnderName4inform)({ underName }) } // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
129
138
|
: undefined
|
|
130
139
|
};
|
|
131
140
|
const informIdentifier = `${factory_1.factory.reservationType.ReservationPackage}:${informObject.reservationNumber}:${informObject.reservationStatus}`;
|
|
@@ -165,10 +174,10 @@ function onReservationConfirmed(confirmedReservations, reserveAction) {
|
|
|
165
174
|
}
|
|
166
175
|
// タスク保管
|
|
167
176
|
if (taskAttributes.length > 0) {
|
|
168
|
-
await repos.task.saveMany(taskAttributes
|
|
177
|
+
await repos.task.saveMany(taskAttributes);
|
|
169
178
|
}
|
|
170
179
|
if (onAuthorizationCreatedTask !== undefined) {
|
|
171
|
-
await repos.task.createIfNotExistByAlternateName(onAuthorizationCreatedTask
|
|
180
|
+
await repos.task.createIfNotExistByAlternateName(onAuthorizationCreatedTask);
|
|
172
181
|
}
|
|
173
182
|
}
|
|
174
183
|
};
|
|
@@ -94,7 +94,7 @@ function onReservationUsed(attendedReservation, action) {
|
|
|
94
94
|
}));
|
|
95
95
|
}
|
|
96
96
|
if (tasks.length > 0) {
|
|
97
|
-
await repos.task.saveMany(tasks
|
|
97
|
+
await repos.task.saveMany(tasks);
|
|
98
98
|
}
|
|
99
99
|
// create AggregateScreeningEvent task -> migrate to agg(2024-10-29~)
|
|
100
100
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.searchByOrder = searchByOrder;
|
|
4
|
-
const
|
|
4
|
+
const customerTelephone2COATelNum_1 = require("../../factory/customerTelephone2COATelNum");
|
|
5
5
|
const factory_1 = require("../../factory");
|
|
6
6
|
function searchByOrder(params) {
|
|
7
7
|
return async (repos) => {
|
|
@@ -42,11 +42,7 @@ function searchByOrder(params) {
|
|
|
42
42
|
if (order === undefined) {
|
|
43
43
|
throw new factory_1.factory.errors.NotFound(factory_1.factory.order.OrderType.Order);
|
|
44
44
|
}
|
|
45
|
-
const
|
|
46
|
-
const phoneNumber = phoneUtil.parse(order.customer.telephone, 'JP');
|
|
47
|
-
let telNum = phoneUtil.format(phoneNumber, google_libphonenumber_1.PhoneNumberFormat.NATIONAL);
|
|
48
|
-
// COAでは数字のみ受け付けるので数字以外を除去
|
|
49
|
-
telNum = telNum.replace(/[^\d]/g, '');
|
|
45
|
+
const telNum = (0, customerTelephone2COATelNum_1.customerTelephone2COATelNum)({ telephone: String(order.customer.telephone) });
|
|
50
46
|
const reservationNumber = (await repos.acceptedOffer.distinctValues({
|
|
51
47
|
orderNumber: { $in: [params.orderNumber] }
|
|
52
48
|
}, 'acceptedOffers.itemOffered.reservationNumber')).shift();
|
|
@@ -5,7 +5,7 @@ import { cancelPendingReservation, cancelReservation } from './reserve/cancelRes
|
|
|
5
5
|
import { checkInReservation } from './reserve/checkInReservation';
|
|
6
6
|
import { confirmReservation } from './reserve/confirmReservation';
|
|
7
7
|
import { findByCode } from './reserve/findByCode';
|
|
8
|
-
import {
|
|
8
|
+
import { adminFindReservations } from './reserve/adminFindReservations';
|
|
9
9
|
import { searchByOrder } from './reserve/searchByOrder';
|
|
10
10
|
import { verifyToken4reservation } from './reserve/verifyToken4reservation';
|
|
11
|
-
export { cancelPendingReservation, cancelReservation, checkInReservation, confirmReservation, findByCode,
|
|
11
|
+
export { cancelPendingReservation, cancelReservation, checkInReservation, confirmReservation, findByCode, adminFindReservations, searchByOrder, verifyToken4reservation };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.verifyToken4reservation = exports.searchByOrder = exports.
|
|
3
|
+
exports.verifyToken4reservation = exports.searchByOrder = exports.adminFindReservations = exports.findByCode = exports.confirmReservation = exports.checkInReservation = exports.cancelReservation = exports.cancelPendingReservation = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* 予約サービス
|
|
6
6
|
*/
|
|
@@ -13,8 +13,8 @@ const confirmReservation_1 = require("./reserve/confirmReservation");
|
|
|
13
13
|
Object.defineProperty(exports, "confirmReservation", { enumerable: true, get: function () { return confirmReservation_1.confirmReservation; } });
|
|
14
14
|
const findByCode_1 = require("./reserve/findByCode");
|
|
15
15
|
Object.defineProperty(exports, "findByCode", { enumerable: true, get: function () { return findByCode_1.findByCode; } });
|
|
16
|
-
const
|
|
17
|
-
Object.defineProperty(exports, "
|
|
16
|
+
const adminFindReservations_1 = require("./reserve/adminFindReservations");
|
|
17
|
+
Object.defineProperty(exports, "adminFindReservations", { enumerable: true, get: function () { return adminFindReservations_1.adminFindReservations; } });
|
|
18
18
|
const searchByOrder_1 = require("./reserve/searchByOrder");
|
|
19
19
|
Object.defineProperty(exports, "searchByOrder", { enumerable: true, get: function () { return searchByOrder_1.searchByOrder; } });
|
|
20
20
|
const verifyToken4reservation_1 = require("./reserve/verifyToken4reservation");
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IExecuteSettings as IMinimumExecuteSettings, IRunningTask } from '../eventEmitter/task';
|
|
2
|
+
import type { AggregationSettings } from '../taskSettings';
|
|
3
|
+
interface IExecuteSettings extends IMinimumExecuteSettings {
|
|
4
|
+
aggregationSettings?: AggregationSettings;
|
|
5
|
+
}
|
|
6
|
+
type IOperation<T> = (settings: IExecuteSettings) => Promise<T>;
|
|
7
|
+
/**
|
|
8
|
+
* Runningの予定タスクを実行する
|
|
9
|
+
*/
|
|
10
|
+
declare function executeScheduledTaskById(params: Pick<IRunningTask, 'id'>): IOperation<void>;
|
|
11
|
+
export { executeScheduledTaskById };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.executeScheduledTaskById = executeScheduledTaskById;
|
|
7
|
+
/**
|
|
8
|
+
* 予定タスクサービス
|
|
9
|
+
*/
|
|
10
|
+
const debug_1 = __importDefault(require("debug"));
|
|
11
|
+
const scheduledTaskHandler_1 = require("./scheduledTaskHandler");
|
|
12
|
+
const debug = (0, debug_1.default)('chevre-domain:service:task');
|
|
13
|
+
/**
|
|
14
|
+
* Runningの予定タスクを実行する
|
|
15
|
+
*/
|
|
16
|
+
function executeScheduledTaskById(params) {
|
|
17
|
+
return async (settings) => {
|
|
18
|
+
const scheduledTaskRepo = new (await import('../repo/scheduledTask.js')).ScheduledTaskRepo(settings.connection);
|
|
19
|
+
const { id } = params;
|
|
20
|
+
let task = null;
|
|
21
|
+
try {
|
|
22
|
+
task = await scheduledTaskRepo.findRunningScheduledTaskById({
|
|
23
|
+
id,
|
|
24
|
+
// status,
|
|
25
|
+
// executor: { name: executor.name }
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
/* istanbul ignore next */
|
|
30
|
+
debug('service.task.executeById error:', error);
|
|
31
|
+
}
|
|
32
|
+
// タスクがなければ終了
|
|
33
|
+
if (task !== null) {
|
|
34
|
+
await (0, scheduledTaskHandler_1.executeScheduledTask)(task)(settings, {
|
|
35
|
+
executeById: true,
|
|
36
|
+
executeByName: false
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { factory } from '../../factory';
|
|
2
|
+
import type { ScheduledTaskRepo } from '../../repo/scheduledTask';
|
|
3
|
+
import type { IExecutableTask } from '../../taskSettings';
|
|
4
|
+
/**
|
|
5
|
+
* タスク実行失敗時処理
|
|
6
|
+
*/
|
|
7
|
+
declare function onOperationFailed(params: {
|
|
8
|
+
task: IExecutableTask<factory.taskName>;
|
|
9
|
+
now: Date;
|
|
10
|
+
error: any;
|
|
11
|
+
}): (repos: {
|
|
12
|
+
scheduledTask: ScheduledTaskRepo;
|
|
13
|
+
}) => Promise<void>;
|
|
14
|
+
export { onOperationFailed };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.onOperationFailed = onOperationFailed;
|
|
4
|
+
const factory_1 = require("../../factory");
|
|
5
|
+
/**
|
|
6
|
+
* タスク実行失敗時処理
|
|
7
|
+
*/
|
|
8
|
+
function onOperationFailed(params) {
|
|
9
|
+
return async (repos) => {
|
|
10
|
+
let error = params.error;
|
|
11
|
+
const { task, now } = params;
|
|
12
|
+
if (error === null || typeof error !== 'object') {
|
|
13
|
+
error = { message: String(error) };
|
|
14
|
+
}
|
|
15
|
+
const endDate = new Date();
|
|
16
|
+
// remainingNumberOfTries<=0ならAborted(2025-08-04~)
|
|
17
|
+
const isRetryable = task.remainingNumberOfTries > 0;
|
|
18
|
+
if (isRetryable) {
|
|
19
|
+
const result = {
|
|
20
|
+
executedAt: now,
|
|
21
|
+
endDate,
|
|
22
|
+
error: {
|
|
23
|
+
...error,
|
|
24
|
+
code: error.code,
|
|
25
|
+
message: error.message,
|
|
26
|
+
name: error.name,
|
|
27
|
+
stack: error.stack
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
// 失敗してもここではステータスを戻さない(Runningのまま待機)
|
|
31
|
+
await repos.scheduledTask.setExecutionResultAndStatus({ id: task.id }, {
|
|
32
|
+
status: task.status,
|
|
33
|
+
executionResult: result
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
// 予定タスクは分析連携不要
|
|
38
|
+
// await informTaskIfNeeded({ task, executionEndDate: endDate })(repos);
|
|
39
|
+
const result = {
|
|
40
|
+
executedAt: now,
|
|
41
|
+
endDate,
|
|
42
|
+
error: {
|
|
43
|
+
...error,
|
|
44
|
+
code: error.code,
|
|
45
|
+
message: error.message,
|
|
46
|
+
name: error.name,
|
|
47
|
+
stack: error.stack
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
await repos.scheduledTask.setExecutionResultAndStatus({ id: task.id }, {
|
|
51
|
+
status: factory_1.factory.taskStatus.Aborted,
|
|
52
|
+
executionResult: result
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { factory } from '../factory';
|
|
2
|
+
import type { ICallResult, ICallableTaskOperation, IExecutableTask, IExecutableTaskKeys, IOperationExecute } from '../taskSettings';
|
|
3
|
+
export declare const taskLoader: {
|
|
4
|
+
load: (taskName: string) => Promise<{
|
|
5
|
+
call: ICallableTaskOperation;
|
|
6
|
+
}>;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* 予定タスクを実行する
|
|
10
|
+
*/
|
|
11
|
+
declare function executeScheduledTask(task: IExecutableTask<factory.taskName>): IOperationExecute<void>;
|
|
12
|
+
export { ICallableTaskOperation, ICallResult, IExecutableTaskKeys, IOperationExecute, executeScheduledTask };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.taskLoader = void 0;
|
|
7
|
+
exports.executeScheduledTask = executeScheduledTask;
|
|
8
|
+
const debug_1 = __importDefault(require("debug"));
|
|
9
|
+
const factory_1 = require("../factory");
|
|
10
|
+
const onOperationFailed_1 = require("./scheduledTaskHandler/onOperationFailed");
|
|
11
|
+
const debug = (0, debug_1.default)('chevre-domain:service:scheduledTaskHandler');
|
|
12
|
+
exports.taskLoader = {
|
|
13
|
+
load: (taskName) => {
|
|
14
|
+
return import(`./task/${taskName}.js`);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* 予定タスクを実行する
|
|
19
|
+
*/
|
|
20
|
+
function executeScheduledTask(task) {
|
|
21
|
+
const now = new Date();
|
|
22
|
+
debug('executing an executableTask...', task, now);
|
|
23
|
+
return async (settings, options) => {
|
|
24
|
+
const scheduledTaskRepo = new (await import('../repo/scheduledTask.js')).ScheduledTaskRepo(settings.connection);
|
|
25
|
+
try {
|
|
26
|
+
// 予定タスクのexpiresはDBのttl基準なので期限検証はしない
|
|
27
|
+
// if (task.expires instanceof Date) {
|
|
28
|
+
// const taskExpired: boolean = moment(now)
|
|
29
|
+
// .isAfter(task.expires);
|
|
30
|
+
// if (taskExpired) {
|
|
31
|
+
// throw new factory.errors.Internal(`task expired [expires:${task.expires}]`);
|
|
32
|
+
// }
|
|
33
|
+
// }
|
|
34
|
+
// remainingNumberOfTries<0ならcallを実行しない(2025-08-04~)
|
|
35
|
+
// リトライを繰り返した後、不明の原因でRunningのまま残ってしまったタスクがリトライされたケース
|
|
36
|
+
const { remainingNumberOfTries } = task;
|
|
37
|
+
const isCallable = remainingNumberOfTries >= 0;
|
|
38
|
+
if (!isCallable) {
|
|
39
|
+
throw new factory_1.factory.errors.Internal(`task remainingNumberOfTries < 0 [remainingNumberOfTries:${remainingNumberOfTries}]`);
|
|
40
|
+
}
|
|
41
|
+
// タスク名の関数が定義されていなければ、TypeErrorとなる
|
|
42
|
+
const { call } = await exports.taskLoader.load(task.name); // testが書きづらいのでtaskLoader経由で呼ぶ
|
|
43
|
+
const callResult = await call(task)(settings, options);
|
|
44
|
+
const result = {
|
|
45
|
+
executedAt: now,
|
|
46
|
+
endDate: new Date(),
|
|
47
|
+
// enable overwriting task.executionResults.error on Executed(2024-05-29~)
|
|
48
|
+
error: (callResult?.error instanceof Error)
|
|
49
|
+
? {
|
|
50
|
+
...callResult.error,
|
|
51
|
+
message: callResult.error.message
|
|
52
|
+
}
|
|
53
|
+
: ''
|
|
54
|
+
};
|
|
55
|
+
await scheduledTaskRepo.setExecutionResultAndStatus({ id: task.id }, {
|
|
56
|
+
status: factory_1.factory.taskStatus.Executed,
|
|
57
|
+
executionResult: result
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
await (0, onOperationFailed_1.onOperationFailed)({
|
|
62
|
+
task, now, error
|
|
63
|
+
})({ scheduledTask: scheduledTaskRepo });
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { factory } from '../../factory';
|
|
2
|
-
import type { IOperationExecute } from '../taskHandler';
|
|
2
|
+
import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../taskHandler';
|
|
3
3
|
/**
|
|
4
4
|
* タスク実行関数
|
|
5
5
|
*/
|
|
6
|
-
export declare function call(
|
|
6
|
+
export declare function call(params: Pick<factory.task.aggregateOffers.ITask, IExecutableTaskKeys>): IOperationExecute<ICallResult>;
|
|
@@ -15,8 +15,9 @@ const aggregateOffers_1 = require("../aggregation/event/aggregateOffers");
|
|
|
15
15
|
/**
|
|
16
16
|
* タスク実行関数
|
|
17
17
|
*/
|
|
18
|
-
function call(
|
|
18
|
+
function call(params) {
|
|
19
19
|
return async ({ redisClient, connection }) => {
|
|
20
|
+
const { data } = params;
|
|
20
21
|
if (redisClient === undefined) {
|
|
21
22
|
throw new factory_1.factory.errors.Argument('settings', 'redisClient required');
|
|
22
23
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { factory } from '../../factory';
|
|
2
|
-
import type { IOperationExecute } from '../taskHandler';
|
|
2
|
+
import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../taskHandler';
|
|
3
3
|
/**
|
|
4
4
|
* タスク実行関数
|
|
5
5
|
*/
|
|
6
|
-
export declare function call(
|
|
6
|
+
export declare function call(params: Pick<factory.task.aggregateScreeningEvent.ITask, IExecutableTaskKeys>): IOperationExecute<ICallResult>;
|
|
@@ -49,8 +49,9 @@ const AggregationService = __importStar(require("../aggregation"));
|
|
|
49
49
|
/**
|
|
50
50
|
* タスク実行関数
|
|
51
51
|
*/
|
|
52
|
-
function call(
|
|
52
|
+
function call(params) {
|
|
53
53
|
return async ({ connection, redisClient }) => {
|
|
54
|
+
const { data } = params;
|
|
54
55
|
if (redisClient === undefined) {
|
|
55
56
|
throw new factory_1.factory.errors.Argument('settings', 'redisClient required');
|
|
56
57
|
}
|
|
@@ -52,8 +52,10 @@ function call(params) {
|
|
|
52
52
|
const useCredentialsRepo = typeof paymentServiceId === 'string' && paymentServiceId !== ''
|
|
53
53
|
&& typeof credentialsExpireInSeconds === 'number' && credentialsExpireInSeconds > 0;
|
|
54
54
|
try {
|
|
55
|
+
const { instrument: _instrument, project: _project, ...authorizeParams } = params.data;
|
|
55
56
|
await (0, any_1.authorize)({
|
|
56
|
-
...
|
|
57
|
+
...authorizeParams,
|
|
58
|
+
project: { id: params.project.id },
|
|
57
59
|
instrument: (Array.isArray(params.data.instrument)) ? params.data.instrument : [],
|
|
58
60
|
sameAs: { id: params.id } // タスクIDを関連付け(2024-04-20~)
|
|
59
61
|
})({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { factory } from '../../factory';
|
|
2
|
-
import type { IOperationExecute } from '../taskHandler';
|
|
2
|
+
import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../taskHandler';
|
|
3
3
|
/**
|
|
4
4
|
* タスク実行関数
|
|
5
5
|
*/
|
|
6
|
-
export declare function call(
|
|
6
|
+
export declare function call(params: Pick<factory.task.cancelReservation.ITask, IExecutableTaskKeys>): IOperationExecute<ICallResult>;
|
|
@@ -13,8 +13,9 @@ const cancelReservation_1 = require("../reserve/cancelReservation");
|
|
|
13
13
|
/**
|
|
14
14
|
* タスク実行関数
|
|
15
15
|
*/
|
|
16
|
-
function call(
|
|
16
|
+
function call(params) {
|
|
17
17
|
return async ({ connection, redisClient }) => {
|
|
18
|
+
const { data } = params;
|
|
18
19
|
if (redisClient === undefined) {
|
|
19
20
|
throw new factory_1.factory.errors.Argument('settings', 'redisClient required');
|
|
20
21
|
}
|
|
@@ -15,7 +15,6 @@ const confirmPayTransaction_1 = require("../order/confirmPayTransaction");
|
|
|
15
15
|
* タスク実行関数
|
|
16
16
|
*/
|
|
17
17
|
function call(params) {
|
|
18
|
-
// export function call(data: factory.task.IData<factory.taskName.ConfirmPayTransaction>): IOperationExecute<void> {
|
|
19
18
|
return async ({ connection }) => {
|
|
20
19
|
await (0, confirmPayTransaction_1.confirmPayTransaction)({
|
|
21
20
|
...params.data,
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.call = call;
|
|
4
4
|
exports.confirmReserveTransaction = confirmReserveTransaction;
|
|
5
5
|
const coa_service_1 = require("@motionpicture/coa-service");
|
|
6
|
-
const google_libphonenumber_1 = require("google-libphonenumber");
|
|
7
6
|
const util_1 = require("util");
|
|
7
|
+
const customerTelephone2COATelNum_1 = require("../../factory/customerTelephone2COATelNum");
|
|
8
8
|
const factory_1 = require("../../factory");
|
|
9
9
|
const confirm_1 = require("../assetTransaction/reserve/confirm");
|
|
10
10
|
const reserveCOA_1 = require("../assetTransaction/reserveCOA");
|
|
@@ -71,12 +71,7 @@ function createConfirmObject4COAByOrder(params) {
|
|
|
71
71
|
&& o.offeredThrough?.identifier === factory_1.factory.service.webAPI.Identifier.COA;
|
|
72
72
|
});
|
|
73
73
|
const customer = params.order.customer;
|
|
74
|
-
|
|
75
|
-
const phoneUtil = google_libphonenumber_1.PhoneNumberUtil.getInstance();
|
|
76
|
-
const phoneNumber = phoneUtil.parse(customer.telephone, 'JP');
|
|
77
|
-
let telNum = phoneUtil.format(phoneNumber, google_libphonenumber_1.PhoneNumberFormat.NATIONAL);
|
|
78
|
-
// COAでは数字のみ受け付けるので数字以外を除去
|
|
79
|
-
telNum = telNum.replace(/[^\d]/g, '');
|
|
74
|
+
const telNum = (0, customerTelephone2COATelNum_1.customerTelephone2COATelNum)({ telephone: String(customer.telephone) });
|
|
80
75
|
const mailAddr = customer.email;
|
|
81
76
|
if (mailAddr === undefined) {
|
|
82
77
|
throw new factory_1.factory.errors.Argument('order', 'order.customer.email undefined');
|
|
@@ -262,7 +257,7 @@ function onConfirmed(params, options) {
|
|
|
262
257
|
executionResults: [],
|
|
263
258
|
data: onAssetTransactionStatusChangedTaskData
|
|
264
259
|
};
|
|
265
|
-
await repos.task.createOnAssetTransactionStatusChangedTaskIfNotExist(onAssetTransactionStatusChangedTask
|
|
260
|
+
await repos.task.createOnAssetTransactionStatusChangedTaskIfNotExist(onAssetTransactionStatusChangedTask);
|
|
266
261
|
}
|
|
267
262
|
};
|
|
268
263
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { IOperationExecute } from '../taskHandler';
|
|
1
|
+
import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../taskHandler';
|
|
2
2
|
import { factory } from '../../factory';
|
|
3
3
|
/**
|
|
4
4
|
* タスク実行関数
|
|
5
5
|
*/
|
|
6
|
-
export declare function call(
|
|
6
|
+
export declare function call(params: Pick<factory.task.deleteTransaction.ITask, IExecutableTaskKeys>): IOperationExecute<ICallResult>;
|
|
@@ -49,8 +49,9 @@ const TransactionService = __importStar(require("../transaction"));
|
|
|
49
49
|
/**
|
|
50
50
|
* タスク実行関数
|
|
51
51
|
*/
|
|
52
|
-
function call(
|
|
52
|
+
function call(params) {
|
|
53
53
|
return async ({ connection }) => {
|
|
54
|
+
const { data } = params;
|
|
54
55
|
await TransactionService.deleteTransaction(data)({
|
|
55
56
|
acceptedOffer: new acceptedOffer_1.AcceptedOfferRepo(connection),
|
|
56
57
|
accountingReport: new accountingReport_1.AccountingReportRepo(connection),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { IOperationExecute } from '../taskHandler';
|
|
1
|
+
import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../taskHandler';
|
|
2
2
|
import { factory } from '../../factory';
|
|
3
3
|
/**
|
|
4
4
|
* タスク実行関数
|
|
5
5
|
*/
|
|
6
|
-
export declare function call(
|
|
6
|
+
export declare function call(params: Pick<factory.task.onAssetTransactionStatusChanged.ITask, IExecutableTaskKeys>): IOperationExecute<ICallResult>;
|
|
@@ -3,26 +3,27 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.call = call;
|
|
4
4
|
const acceptedOffer_1 = require("../../repo/acceptedOffer");
|
|
5
5
|
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
6
|
+
const message_1 = require("../../repo/message");
|
|
6
7
|
const order_1 = require("../../repo/order");
|
|
7
8
|
const setting_1 = require("../../repo/setting");
|
|
8
9
|
const integration_1 = require("../../repo/setting/integration");
|
|
9
10
|
const task_1 = require("../../repo/task");
|
|
10
|
-
// import { TransactionRepo } from '../../repo/transaction';
|
|
11
11
|
const placeOrder_1 = require("../../repo/transaction/placeOrder");
|
|
12
12
|
const onAssetTransactionStatusChanged_1 = require("../order/onAssetTransactionStatusChanged");
|
|
13
13
|
/**
|
|
14
14
|
* タスク実行関数
|
|
15
15
|
*/
|
|
16
|
-
function call(
|
|
16
|
+
function call(params) {
|
|
17
17
|
return async ({ connection }) => {
|
|
18
|
+
const { data } = params;
|
|
18
19
|
const settings = new integration_1.IntegrationSettingRepo({ connection });
|
|
19
20
|
await (0, onAssetTransactionStatusChanged_1.onAssetTransactionStatusChanged)(data)({
|
|
20
21
|
acceptedOffer: new acceptedOffer_1.AcceptedOfferRepo(connection),
|
|
21
22
|
assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
|
|
23
|
+
message: new message_1.MessageRepo(connection),
|
|
22
24
|
order: new order_1.OrderRepo(connection),
|
|
23
25
|
setting: new setting_1.SettingRepo(connection),
|
|
24
26
|
task: new task_1.TaskRepo(connection),
|
|
25
|
-
// transaction: new TransactionRepo(connection),
|
|
26
27
|
placeOrder: new placeOrder_1.PlaceOrderRepo(connection)
|
|
27
28
|
}, settings);
|
|
28
29
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { factory } from '../../factory';
|
|
2
|
-
import type { IOperationExecute } from '../taskHandler';
|
|
2
|
+
import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../taskHandler';
|
|
3
3
|
/**
|
|
4
4
|
* タスク実行関数
|
|
5
5
|
*/
|
|
6
|
-
export declare function call(
|
|
6
|
+
export declare function call(params: Pick<factory.task.onEventChanged.ITask, IExecutableTaskKeys>): IOperationExecute<ICallResult>;
|
|
@@ -11,8 +11,9 @@ const onEventChanged_1 = require("../offer/onEventChanged");
|
|
|
11
11
|
/**
|
|
12
12
|
* タスク実行関数
|
|
13
13
|
*/
|
|
14
|
-
function call(
|
|
14
|
+
function call(params) {
|
|
15
15
|
return async ({ connection }) => {
|
|
16
|
+
const { data } = params;
|
|
16
17
|
await (0, onEventChanged_1.onEventChanged)(data)({
|
|
17
18
|
event: new event_1.EventRepo(connection),
|
|
18
19
|
eventSeries: new eventSeries_1.EventSeriesRepo(connection),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { IOperationExecute } from '../taskHandler';
|
|
1
|
+
import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../taskHandler';
|
|
2
2
|
import { factory } from '../../factory';
|
|
3
3
|
/**
|
|
4
4
|
* タスク実行関数
|
|
5
5
|
*/
|
|
6
|
-
export declare function call(
|
|
6
|
+
export declare function call(params: Pick<factory.task.ITask<factory.taskName.OnOrderPaymentCompleted>, IExecutableTaskKeys>): IOperationExecute<ICallResult>;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.call = call;
|
|
4
4
|
const acceptedOffer_1 = require("../../repo/acceptedOffer");
|
|
5
|
+
const message_1 = require("../../repo/message");
|
|
5
6
|
const order_1 = require("../../repo/order");
|
|
6
7
|
const setting_1 = require("../../repo/setting");
|
|
7
8
|
const integration_1 = require("../../repo/setting/integration");
|
|
@@ -11,11 +12,13 @@ const payOrder_1 = require("../order/payOrder");
|
|
|
11
12
|
/**
|
|
12
13
|
* タスク実行関数
|
|
13
14
|
*/
|
|
14
|
-
function call(
|
|
15
|
+
function call(params) {
|
|
15
16
|
return async ({ connection }) => {
|
|
17
|
+
const { data } = params;
|
|
16
18
|
const settings = new integration_1.IntegrationSettingRepo({ connection });
|
|
17
19
|
await (0, payOrder_1.payOrder)(data)({
|
|
18
20
|
acceptedOffer: new acceptedOffer_1.AcceptedOfferRepo(connection),
|
|
21
|
+
message: new message_1.MessageRepo(connection),
|
|
19
22
|
order: new order_1.OrderRepo(connection),
|
|
20
23
|
setting: new setting_1.SettingRepo(connection),
|
|
21
24
|
task: new task_1.TaskRepo(connection),
|
|
@@ -11,7 +11,7 @@ function createInformOfferTasks(params, setting) {
|
|
|
11
11
|
}
|
|
12
12
|
// const informResources = settings.onResourceUpdated.informResource;
|
|
13
13
|
const informResources = setting?.onResourceUpdated?.informResource;
|
|
14
|
-
const offers = await repos.offer.
|
|
14
|
+
const offers = await repos.offer.findUnitPriceOffers({
|
|
15
15
|
id: { $in: params.ids }
|
|
16
16
|
}, { typeOf: 1, name: 1, priceSpecification: 1, additionalProperty: 1, identifier: 1, project: 1 });
|
|
17
17
|
const offers4inform = offers.map(({ id, typeOf, name, priceSpecification, additionalProperty, identifier, project }) => {
|
|
@@ -51,7 +51,7 @@ function createInformOfferTasks(params, setting) {
|
|
|
51
51
|
});
|
|
52
52
|
});
|
|
53
53
|
if (informTasks.length > 0) {
|
|
54
|
-
await repos.task.saveMany(informTasks
|
|
54
|
+
await repos.task.saveMany(informTasks);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
};
|