@chevre/domain 26.0.0-alpha.9 → 26.0.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 +8 -23
- package/lib/chevre/eventEmitter/task.js +2 -2
- package/lib/chevre/repo/acceptedOffer.d.ts +0 -7
- package/lib/chevre/repo/acceptedOffer.js +27 -27
- package/lib/chevre/repo/action/acceptCOAOffer.d.ts +3 -1
- package/lib/chevre/repo/action/acceptCOAOffer.js +8 -2
- package/lib/chevre/repo/action/acceptPay.d.ts +3 -1
- package/lib/chevre/repo/action/acceptPay.js +8 -4
- package/lib/chevre/repo/action/anyAction/actionProcess.d.ts +120 -0
- package/lib/chevre/repo/action/{actionProcess.js → anyAction/actionProcess.js} +28 -157
- package/lib/chevre/repo/action/anyAction/actionRecipe.d.ts +37 -0
- package/lib/chevre/repo/action/anyAction/actionRecipe.js +53 -0
- package/lib/chevre/repo/action/authorizeInvoice.d.ts +5 -8
- package/lib/chevre/repo/action/authorizeInvoice.js +7 -4
- package/lib/chevre/repo/action/authorizeOffer.d.ts +3 -1
- package/lib/chevre/repo/action/authorizeOffer.js +7 -2
- package/lib/chevre/repo/action/authorizePaymentMethod.d.ts +3 -1
- package/lib/chevre/repo/action/authorizePaymentMethod.js +7 -4
- package/lib/chevre/repo/action/authorizeTicketedObject.d.ts +3 -1
- package/lib/chevre/repo/action/authorizeTicketedObject.js +7 -2
- package/lib/chevre/repo/action/cancel.d.ts +25 -0
- package/lib/chevre/repo/action/cancel.js +47 -0
- package/lib/chevre/repo/action/checkMovieTicket.d.ts +3 -1
- package/lib/chevre/repo/action/checkMovieTicket.js +8 -1
- package/lib/chevre/repo/action/confirm.d.ts +11 -0
- package/lib/chevre/repo/action/confirm.js +16 -0
- package/lib/chevre/repo/action/create.d.ts +10 -0
- package/lib/chevre/repo/action/create.js +17 -0
- package/lib/chevre/repo/action/inform.d.ts +38 -0
- package/lib/chevre/repo/action/inform.js +146 -0
- package/lib/chevre/repo/action/order.d.ts +21 -0
- package/lib/chevre/repo/action/order.js +35 -0
- package/lib/chevre/repo/action/pay.d.ts +3 -1
- package/lib/chevre/repo/action/pay.js +7 -4
- package/lib/chevre/repo/action/refund.d.ts +3 -1
- package/lib/chevre/repo/action/refund.js +7 -4
- package/lib/chevre/repo/action/reserve.d.ts +21 -0
- package/lib/chevre/repo/action/reserve.js +37 -0
- package/lib/chevre/repo/action/returnAction.d.ts +11 -0
- package/lib/chevre/repo/action/returnAction.js +16 -0
- package/lib/chevre/repo/action/sendEmailMessage.d.ts +10 -0
- package/lib/chevre/repo/action/sendEmailMessage.js +17 -0
- package/lib/chevre/repo/action/sendOrder.d.ts +10 -0
- package/lib/chevre/repo/action/sendOrder.js +16 -0
- package/lib/chevre/repo/action/unknown2actionError.d.ts +6 -0
- package/lib/chevre/repo/action/unknown2actionError.js +15 -0
- package/lib/chevre/repo/action/update.d.ts +48 -0
- package/lib/chevre/repo/action/update.js +166 -0
- package/lib/chevre/repo/action/use.d.ts +39 -0
- package/lib/chevre/repo/action/use.js +153 -0
- package/lib/chevre/repo/{action.d.ts → adminAction.d.ts} +11 -37
- package/lib/chevre/repo/adminAction.js +176 -0
- package/lib/chevre/repo/adminAssetTransaction.d.ts +126 -0
- package/lib/chevre/repo/adminAssetTransaction.js +491 -0
- package/lib/chevre/repo/adminScheduledTask.d.ts +1 -1
- package/lib/chevre/repo/adminTask.d.ts +25 -8
- package/lib/chevre/repo/adminTask.js +31 -32
- package/lib/chevre/repo/adminTransaction.d.ts +131 -0
- package/lib/chevre/repo/adminTransaction.js +237 -0
- package/lib/chevre/repo/aggregateAction.d.ts +8 -11
- package/lib/chevre/repo/aggregateAction.js +0 -61
- package/lib/chevre/repo/aggregateAssetTransaction.d.ts +43 -0
- package/lib/chevre/repo/aggregateAssetTransaction.js +166 -0
- package/lib/chevre/repo/aggregateTransaction.d.ts +39 -0
- package/lib/chevre/repo/aggregateTransaction.js +166 -0
- package/lib/chevre/repo/aggregateUseAction.d.ts +35 -0
- package/lib/chevre/repo/aggregateUseAction.js +164 -0
- package/lib/chevre/repo/aggregation.d.ts +0 -8
- package/lib/chevre/repo/aggregation.js +0 -10
- package/lib/chevre/repo/assetTransaction.d.ts +10 -235
- package/lib/chevre/repo/assetTransaction.js +48 -636
- package/lib/chevre/repo/authorization.d.ts +0 -6
- package/lib/chevre/repo/authorization.js +15 -27
- package/lib/chevre/repo/message.d.ts +0 -7
- package/lib/chevre/repo/message.js +0 -38
- package/lib/chevre/repo/migrateAction.d.ts +48 -0
- package/lib/chevre/repo/migrateAction.js +32 -0
- package/lib/chevre/repo/mongoose/schemas/action/inform.d.ts +11 -0
- package/lib/chevre/repo/mongoose/schemas/action/inform.js +82 -0
- package/lib/chevre/repo/mongoose/schemas/action/update.d.ts +12 -0
- package/lib/chevre/repo/mongoose/schemas/action/update.js +112 -0
- package/lib/chevre/repo/mongoose/schemas/{ownershipInfo.d.ts → action/use.d.ts} +4 -6
- package/lib/chevre/repo/mongoose/schemas/action/use.js +92 -0
- package/lib/chevre/repo/mongoose/schemas/action.d.ts +1 -3
- package/lib/chevre/repo/mongoose/schemas/action.js +22 -7
- package/lib/chevre/repo/mongoose/schemas/actionRecipe.d.ts +1 -0
- package/lib/chevre/repo/mongoose/schemas/actionRecipe.js +19 -1
- package/lib/chevre/repo/mongoose/schemas/aggregateReservation.js +8 -9
- package/lib/chevre/repo/mongoose/schemas/aggregation.js +8 -1
- package/lib/chevre/repo/mongoose/schemas/assetTransaction.js +95 -76
- package/lib/chevre/repo/mongoose/schemas/authorization.js +25 -18
- package/lib/chevre/repo/mongoose/schemas/event.js +7 -0
- package/lib/chevre/repo/mongoose/schemas/eventOffer.js +7 -0
- package/lib/chevre/repo/mongoose/schemas/message.js +8 -1
- package/lib/chevre/repo/mongoose/schemas/pendingReservation.js +11 -4
- package/lib/chevre/repo/mongoose/schemas/setting.d.ts +5 -16
- package/lib/chevre/repo/mongoose/schemas/task.d.ts +2 -5
- package/lib/chevre/repo/mongoose/schemas/task.js +134 -118
- package/lib/chevre/repo/mongoose/schemas/ticket.js +8 -1
- package/lib/chevre/repo/orderInTransaction.d.ts +0 -3
- package/lib/chevre/repo/orderInTransaction.js +30 -22
- package/lib/chevre/repo/scheduledTask.d.ts +4 -1
- package/lib/chevre/repo/scheduledTask.js +3 -25
- package/lib/chevre/repo/task.d.ts +44 -155
- package/lib/chevre/repo/task.js +13 -555
- package/lib/chevre/repo/taskDelayed.d.ts +74 -0
- package/lib/chevre/repo/taskDelayed.js +195 -0
- package/lib/chevre/repo/taskRunning.d.ts +35 -0
- package/lib/chevre/repo/taskRunning.js +89 -0
- package/lib/chevre/repo/ticket.d.ts +0 -6
- package/lib/chevre/repo/ticket.js +0 -11
- package/lib/chevre/repo/transaction.d.ts +1 -187
- package/lib/chevre/repo/transaction.js +2 -383
- package/lib/chevre/repository.d.ts +65 -25
- package/lib/chevre/repository.js +144 -56
- package/lib/chevre/service/aggregation/system.d.ts +9 -8
- package/lib/chevre/service/aggregation/system.js +5 -5
- package/lib/chevre/service/assetTransaction/cancelReservation/start.js +10 -17
- package/lib/chevre/service/assetTransaction/pay/confirm.d.ts +0 -10
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorize.d.ts +0 -1
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeMovieTicket.d.ts +0 -1
- package/lib/chevre/service/assetTransaction/pay/start.d.ts +0 -1
- package/lib/chevre/service/assetTransaction/refund.d.ts +0 -1
- package/lib/chevre/service/assetTransaction/refund.js +2 -2
- package/lib/chevre/service/assetTransaction/reserve/cancel.d.ts +4 -2
- package/lib/chevre/service/assetTransaction/reserve/confirm.d.ts +4 -2
- package/lib/chevre/service/assetTransaction/reserveCOA/cancel.d.ts +8 -4
- package/lib/chevre/service/assetTransaction/reserveCOA/cancel.js +1 -1
- package/lib/chevre/service/asyncAction.d.ts +2 -2
- package/lib/chevre/service/asyncAction.js +1 -4
- package/lib/chevre/service/asyncActionHandler/onOperationFailed.d.ts +2 -2
- package/lib/chevre/service/asyncActionHandler/onOperationFailed.js +0 -2
- package/lib/chevre/service/asyncActionHandler.d.ts +4 -4
- package/lib/chevre/service/asyncActionHandler.js +11 -13
- package/lib/chevre/service/event/processUpdateMovieTheater.d.ts +4 -2
- package/lib/chevre/service/event/processUpdateMovieTheater.js +3 -3
- package/lib/chevre/service/event.d.ts +4 -2
- package/lib/chevre/service/event.js +3 -3
- package/lib/chevre/service/notification/sendEmailMessage.d.ts +4 -2
- package/lib/chevre/service/notification/sendEmailMessage.js +3 -3
- package/lib/chevre/service/notification/triggerWebhook.d.ts +4 -2
- package/lib/chevre/service/notification/triggerWebhook.js +5 -16
- package/lib/chevre/service/offer/event/authorize.d.ts +0 -1
- package/lib/chevre/service/offer/event/issueEventOfferTicket.d.ts +0 -1
- package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.d.ts +4 -2
- package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.js +1 -3
- package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4coa.d.ts +9 -5
- package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4coa.js +1 -1
- package/lib/chevre/service/offer/event/voidTransaction.d.ts +6 -4
- package/lib/chevre/service/offer/event/voidTransaction.js +7 -9
- package/lib/chevre/service/offer/event/voidTransactionByActionId.d.ts +6 -4
- package/lib/chevre/service/offer/event/voidTransactionByActionId.js +3 -15
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.d.ts +0 -4
- package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.js +19 -19
- package/lib/chevre/service/offer/onEventChanged.js +0 -2
- package/lib/chevre/service/order/confirmPayTransaction.d.ts +4 -10
- package/lib/chevre/service/order/confirmPayTransaction.js +7 -11
- package/lib/chevre/service/order/createAccountingReportIfNotExist.d.ts +1 -1
- package/lib/chevre/service/order/createAccountingReportIfNotExist.js +2 -56
- package/lib/chevre/service/order/deleteOrder.d.ts +2 -2
- package/lib/chevre/service/order/deleteOrder.js +1 -2
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/isDeliverable.js +1 -49
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.js +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered/factory.js +2 -4
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.js +2 -4
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.js +1 -9
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.d.ts +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.js +4 -8
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/processOrder.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.js +5 -11
- package/lib/chevre/service/order/onOrderUpdated/factory.js +0 -3
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.d.ts +4 -2
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +2 -2
- package/lib/chevre/service/order/placeOrder.d.ts +6 -4
- package/lib/chevre/service/order/placeOrder.js +9 -17
- package/lib/chevre/service/order/returnOrder.d.ts +4 -4
- package/lib/chevre/service/order/returnOrder.js +11 -43
- package/lib/chevre/service/order/sendOrder.d.ts +4 -6
- package/lib/chevre/service/order/sendOrder.js +30 -72
- package/lib/chevre/service/payment/any/authorize/fixTransactionNumber.d.ts +0 -1
- package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.d.ts +0 -1
- package/lib/chevre/service/payment/any/authorize.d.ts +0 -1
- package/lib/chevre/service/payment/any/findAcceptAction.d.ts +0 -4
- package/lib/chevre/service/payment/any/findAcceptAction.js +19 -19
- package/lib/chevre/service/payment/any/findAuthorizeAction.d.ts +0 -4
- package/lib/chevre/service/payment/any/findAuthorizeAction.js +19 -19
- package/lib/chevre/service/payment/any/findCheckAction.d.ts +0 -4
- package/lib/chevre/service/payment/any/findCheckAction.js +19 -19
- package/lib/chevre/service/payment/any/invalidatePaymentUrl.d.ts +0 -1
- package/lib/chevre/service/payment/any/onPayActionCompleted.d.ts +0 -1
- package/lib/chevre/service/payment/any/onPaymentStatusChanged.js +2 -2
- package/lib/chevre/service/payment/any/onRefundActionCompletedOrFailed.d.ts +0 -1
- package/lib/chevre/service/payment/any/processVoidPayTransaction.d.ts +0 -1
- package/lib/chevre/service/payment/any/processVoidPayTransaction.js +2 -2
- package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +0 -2
- package/lib/chevre/service/payment/any/publishPaymentUrl.js +2 -2
- package/lib/chevre/service/payment/any/voidPayTransaction.d.ts +0 -1
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.d.ts +0 -1
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard3ds.d.ts +0 -1
- package/lib/chevre/service/payment/creditCard/authorize.d.ts +0 -1
- package/lib/chevre/service/payment/creditCard/payCreditCard.d.ts +0 -1
- package/lib/chevre/service/payment/creditCard/refundCreditCard.d.ts +0 -1
- package/lib/chevre/service/payment/faceToFace.d.ts +0 -2
- package/lib/chevre/service/payment/movieTicket/authorize.d.ts +0 -1
- package/lib/chevre/service/payment/movieTicket/payMovieTicket.d.ts +0 -1
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket.d.ts +0 -1
- package/lib/chevre/service/project.d.ts +0 -6
- package/lib/chevre/service/project.js +0 -2
- package/lib/chevre/service/reserve/cancelReservation.d.ts +7 -3
- package/lib/chevre/service/reserve/cancelReservation.js +15 -25
- package/lib/chevre/service/reserve/checkInReservation.d.ts +4 -2
- package/lib/chevre/service/reserve/checkInReservation.js +2 -2
- package/lib/chevre/service/reserve/confirmReservation.d.ts +4 -2
- package/lib/chevre/service/reserve/confirmReservation.js +10 -36
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +1 -1
- package/lib/chevre/service/reserve/useReservation.d.ts +6 -2
- package/lib/chevre/service/reserve/useReservation.js +6 -24
- package/lib/chevre/service/reserveCOA/cancelReservation.d.ts +4 -2
- package/lib/chevre/service/reserveCOA/cancelReservation.js +3 -3
- package/lib/chevre/service/scheduledTask.d.ts +1 -4
- package/lib/chevre/service/scheduledTask.js +3 -10
- package/lib/chevre/service/scheduledTaskHandler/onOperationFailed.js +1 -2
- package/lib/chevre/service/scheduledTaskHandler.js +0 -13
- package/lib/chevre/service/task/acceptCOAOffer.js +1 -14
- package/lib/chevre/service/task/authorizePayment.js +1 -7
- package/lib/chevre/service/task/cancelPendingReservation.js +3 -4
- package/lib/chevre/service/task/cancelReservation.js +3 -5
- package/lib/chevre/service/task/checkMovieTicket.js +1 -7
- package/lib/chevre/service/task/checkResource.js +14 -57
- package/lib/chevre/service/task/confirmPayTransaction.js +11 -12
- package/lib/chevre/service/task/confirmReserveTransaction.d.ts +6 -2
- package/lib/chevre/service/task/confirmReserveTransaction.js +12 -7
- package/lib/chevre/service/task/createAccountingReport.js +8 -15
- package/lib/chevre/service/task/deleteTransaction.js +10 -41
- package/lib/chevre/service/task/importEventsFromCOA.js +4 -2
- package/lib/chevre/service/task/invalidatePaymentUrl.js +0 -1
- package/lib/chevre/service/task/onAuthorizationCreated.js +4 -13
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByAggregateOffer.d.ts +4 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByAggregateOffer.js +4 -4
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByEventSeries.d.ts +4 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByEventSeries.js +4 -4
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByMovieTheater.d.ts +4 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByMovieTheater.js +4 -4
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByOfferCatalog.d.ts +4 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByOfferCatalog.js +4 -4
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByProduct.d.ts +4 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByProduct.js +4 -4
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByRoom.d.ts +4 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByRoom.js +4 -4
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.d.ts +4 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.js +4 -4
- package/lib/chevre/service/task/onResourceDeleted.js +4 -3
- package/lib/chevre/service/task/onResourceUpdated/onAggregateOfferUpdated.js +0 -1
- package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +0 -1
- package/lib/chevre/service/task/onResourceUpdated/onOfferCatalogUpdated.js +0 -1
- package/lib/chevre/service/task/onResourceUpdated.js +0 -10
- package/lib/chevre/service/task/pay.js +0 -1
- package/lib/chevre/service/task/payment/invalidatePaymentUrlByTask.d.ts +0 -1
- package/lib/chevre/service/task/payment/payByTask.d.ts +0 -1
- package/lib/chevre/service/task/payment/refundByTask.d.ts +0 -1
- package/lib/chevre/service/task/payment/voidPaymentByTask.d.ts +0 -2
- package/lib/chevre/service/task/placeOrder.js +8 -6
- package/lib/chevre/service/task/publishPaymentUrl.js +2 -13
- package/lib/chevre/service/task/refund.js +0 -1
- package/lib/chevre/service/task/reserve.js +3 -6
- package/lib/chevre/service/task/returnOrder.js +3 -7
- package/lib/chevre/service/task/returnPayTransaction.js +9 -19
- package/lib/chevre/service/task/returnReserveTransaction.js +5 -6
- package/lib/chevre/service/task/sendEmailMessage.js +2 -2
- package/lib/chevre/service/task/sendOrder.js +4 -8
- package/lib/chevre/service/task/syncResourcesFromCOA.js +31 -23
- package/lib/chevre/service/task/triggerWebhook.js +4 -2
- package/lib/chevre/service/task/useReservation.js +6 -2
- package/lib/chevre/service/task/voidPayment.js +0 -2
- package/lib/chevre/service/task/voidReserveTransaction.js +11 -13
- package/lib/chevre/service/task.d.ts +4 -4
- package/lib/chevre/service/task.js +8 -12
- package/lib/chevre/service/taskHandler/onOperationFailed/informTaskIfNeeded.js +0 -1
- package/lib/chevre/service/taskHandler/onOperationFailed.d.ts +3 -2
- package/lib/chevre/service/taskHandler/onOperationFailed.js +5 -16
- package/lib/chevre/service/taskHandler.d.ts +1 -2
- package/lib/chevre/service/taskHandler.js +7 -19
- package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.js +2 -2
- package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.js +2 -2
- package/lib/chevre/service/transaction/deleteTransaction.d.ts +8 -4
- package/lib/chevre/service/transaction/deleteTransaction.js +7 -7
- package/lib/chevre/service/transaction/placeOrder/confirm.js +1 -1
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +11 -17
- package/lib/chevre/service/transaction/returnOrder.js +11 -17
- package/lib/chevre/service/validation/validateOrder.d.ts +0 -4
- package/lib/chevre/service/validation/validateOrder.js +3 -3
- package/lib/chevre/taskSettings.d.ts +4 -4
- package/package.json +2 -2
- package/lib/chevre/repo/action/actionProcess.d.ts +0 -147
- package/lib/chevre/repo/action/checkThing.d.ts +0 -8
- package/lib/chevre/repo/action/checkThing.js +0 -13
- package/lib/chevre/repo/action.js +0 -468
- package/lib/chevre/repo/asyncActionLegacy.d.ts +0 -23
- package/lib/chevre/repo/asyncActionLegacy.js +0 -59
- package/lib/chevre/repo/mongoose/schemas/ownershipInfo.js +0 -227
- package/lib/chevre/repo/mongoose/schemas/pendingReservationAggregate.d.ts +0 -25
- package/lib/chevre/repo/mongoose/schemas/pendingReservationAggregate.js +0 -100
- package/lib/chevre/repo/ownershipInfo.d.ts +0 -122
- package/lib/chevre/repo/ownershipInfo.js +0 -466
- package/lib/chevre/repo/scheduledTaskLegacy.d.ts +0 -39
- package/lib/chevre/repo/scheduledTaskLegacy.js +0 -96
- package/lib/chevre/repo/scheduledTaskMigration.d.ts +0 -21
- package/lib/chevre/repo/scheduledTaskMigration.js +0 -70
- package/lib/chevre/service/validation/validateEvent.d.ts +0 -11
- package/lib/chevre/service/validation/validateEvent.js +0 -21
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { COA } from '@motionpicture/coa-service';
|
|
2
2
|
import { factory } from '../../factory';
|
|
3
|
-
import {
|
|
3
|
+
import { CancelActionRepo } from '../../repo/action/cancel';
|
|
4
4
|
declare function cancelPendingReservation(params: factory.task.cancelPendingReservation.IPotentialCancelCOAReserveAction & {
|
|
5
5
|
project: {
|
|
6
6
|
id: string;
|
|
7
7
|
};
|
|
8
8
|
}): (repos: {
|
|
9
|
-
|
|
9
|
+
actions: {
|
|
10
|
+
cancel: CancelActionRepo;
|
|
11
|
+
};
|
|
10
12
|
reserveService: COA.service.Reserve;
|
|
11
13
|
}) => Promise<void>;
|
|
12
14
|
export { cancelPendingReservation };
|
|
@@ -23,7 +23,7 @@ function cancelPendingReservation(params) {
|
|
|
23
23
|
processCancelPendingCOAReserveResult: { delTmpReserveArgs },
|
|
24
24
|
project: { id: params.project.id }
|
|
25
25
|
});
|
|
26
|
-
const action = await repos.
|
|
26
|
+
const action = await repos.actions.cancel.start(actionAttributes, { recipe });
|
|
27
27
|
try {
|
|
28
28
|
try {
|
|
29
29
|
await repos.reserveService.delTmpReserve(delTmpReserveArgs);
|
|
@@ -51,7 +51,7 @@ function cancelPendingReservation(params) {
|
|
|
51
51
|
}
|
|
52
52
|
catch (error) {
|
|
53
53
|
try {
|
|
54
|
-
await repos.
|
|
54
|
+
await repos.actions.cancel.giveUp({ typeOf: action.typeOf, id: action.id, error });
|
|
55
55
|
}
|
|
56
56
|
catch (__) {
|
|
57
57
|
// 失敗したら仕方ない
|
|
@@ -59,6 +59,6 @@ function cancelPendingReservation(params) {
|
|
|
59
59
|
throw error;
|
|
60
60
|
}
|
|
61
61
|
const actionResult = {};
|
|
62
|
-
await repos.
|
|
62
|
+
await repos.actions.cancel.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: actionResult, recipe });
|
|
63
63
|
};
|
|
64
64
|
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import type { IExecuteSettings as IMinimumExecuteSettings, IRunningTask } from '../eventEmitter/task';
|
|
2
|
-
|
|
3
|
-
interface IExecuteSettings extends IMinimumExecuteSettings {
|
|
4
|
-
aggregationSettings?: AggregationSettings;
|
|
5
|
-
}
|
|
2
|
+
type IExecuteSettings = IMinimumExecuteSettings;
|
|
6
3
|
type IOperation<T> = (settings: IExecuteSettings) => Promise<T>;
|
|
7
4
|
/**
|
|
8
5
|
* Runningの予定タスクを実行する
|
|
@@ -19,22 +19,15 @@ function executeScheduledTaskById(params) {
|
|
|
19
19
|
const { id } = params;
|
|
20
20
|
let task = null;
|
|
21
21
|
try {
|
|
22
|
-
task = await scheduledTaskRepo.findRunningScheduledTaskById({
|
|
23
|
-
id,
|
|
24
|
-
// status,
|
|
25
|
-
// executor: { name: executor.name }
|
|
26
|
-
});
|
|
22
|
+
task = await scheduledTaskRepo.findRunningScheduledTaskById({ id });
|
|
27
23
|
}
|
|
28
24
|
catch (error) {
|
|
29
25
|
/* istanbul ignore next */
|
|
30
|
-
debug('
|
|
26
|
+
debug('scheduledTaskRepo.findRunningScheduledTaskById error:', error);
|
|
31
27
|
}
|
|
32
28
|
// タスクがなければ終了
|
|
33
29
|
if (task !== null) {
|
|
34
|
-
await (0, scheduledTaskHandler_1.executeScheduledTask)(task)(settings, {
|
|
35
|
-
executeById: true,
|
|
36
|
-
executeByName: false
|
|
37
|
-
});
|
|
30
|
+
await (0, scheduledTaskHandler_1.executeScheduledTask)(task)(settings, {});
|
|
38
31
|
}
|
|
39
32
|
};
|
|
40
33
|
}
|
|
@@ -13,7 +13,7 @@ function onOperationFailed(params) {
|
|
|
13
13
|
error = { message: String(error) };
|
|
14
14
|
}
|
|
15
15
|
const endDate = new Date();
|
|
16
|
-
// remainingNumberOfTries<=0ならAborted
|
|
16
|
+
// remainingNumberOfTries<=0ならAborted
|
|
17
17
|
const isRetryable = task.remainingNumberOfTries > 0;
|
|
18
18
|
if (isRetryable) {
|
|
19
19
|
const result = {
|
|
@@ -35,7 +35,6 @@ function onOperationFailed(params) {
|
|
|
35
35
|
}
|
|
36
36
|
else {
|
|
37
37
|
// 予定タスクは分析連携不要
|
|
38
|
-
// await informTaskIfNeeded({ task, executionEndDate: endDate })(repos);
|
|
39
38
|
const result = {
|
|
40
39
|
executedAt: now,
|
|
41
40
|
endDate,
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.taskLoader = void 0;
|
|
7
4
|
exports.executeScheduledTask = executeScheduledTask;
|
|
8
|
-
const debug_1 = __importDefault(require("debug"));
|
|
9
5
|
const factory_1 = require("../factory");
|
|
10
6
|
const onOperationFailed_1 = require("./scheduledTaskHandler/onOperationFailed");
|
|
11
|
-
const debug = (0, debug_1.default)('chevre-domain:service:scheduledTaskHandler');
|
|
12
7
|
exports.taskLoader = {
|
|
13
8
|
load: (taskName) => {
|
|
14
9
|
return import(`./task/${taskName}.js`);
|
|
@@ -19,18 +14,10 @@ exports.taskLoader = {
|
|
|
19
14
|
*/
|
|
20
15
|
function executeScheduledTask(task) {
|
|
21
16
|
const now = new Date();
|
|
22
|
-
debug('executing an executableTask...', task, now);
|
|
23
17
|
return async (settings, options) => {
|
|
24
18
|
const scheduledTaskRepo = new (await import('../repo/scheduledTask.js')).ScheduledTaskRepo(settings.connection);
|
|
25
19
|
try {
|
|
26
20
|
// 予定タスクの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
21
|
// remainingNumberOfTries<0ならcallを実行しない(2025-08-04~)
|
|
35
22
|
// リトライを繰り返した後、不明の原因でRunningのまま残ってしまったタスクがリトライされたケース
|
|
36
23
|
const { remainingNumberOfTries } = task;
|
|
@@ -7,9 +7,6 @@ const acceptCOAOffer_1 = require("../../repo/action/acceptCOAOffer");
|
|
|
7
7
|
const authorizeOffer_1 = require("../../repo/action/authorizeOffer");
|
|
8
8
|
const credentials_1 = require("../../repo/credentials");
|
|
9
9
|
const event_1 = require("../../repo/event");
|
|
10
|
-
// import { OrderInTransactionRepo } from '../../repo/orderInTransaction';
|
|
11
|
-
// import { OrderNumberRepo } from '../../repo/orderNumber';
|
|
12
|
-
// import { ProjectRepo } from '../../repo/project';
|
|
13
10
|
const reserveInterface_1 = require("../../repo/reserveInterface");
|
|
14
11
|
const integration_1 = require("../../repo/setting/integration");
|
|
15
12
|
const placeOrder_1 = require("../../repo/transaction/placeOrder");
|
|
@@ -19,14 +16,10 @@ let coaAuthClient;
|
|
|
19
16
|
* タスク実行関数
|
|
20
17
|
*/
|
|
21
18
|
function call(params) {
|
|
22
|
-
return async ({ connection, redisClient }
|
|
19
|
+
return async ({ connection, redisClient }) => {
|
|
23
20
|
if (redisClient === undefined) {
|
|
24
21
|
throw new factory_1.factory.errors.Argument('settings', 'redisClient required');
|
|
25
22
|
}
|
|
26
|
-
// 遅延実行(executeByName)には対応しない
|
|
27
|
-
if (!options.executeById) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
23
|
const settings = new integration_1.IntegrationSettingRepo({ connection });
|
|
31
24
|
const reserveInterfaceRepo = new reserveInterface_1.ReserveInterfaceRepo(connection);
|
|
32
25
|
const coaAPI = await reserveInterfaceRepo.findOne({ project: { id: { $eq: params.project.id } } });
|
|
@@ -57,7 +50,6 @@ function call(params) {
|
|
|
57
50
|
});
|
|
58
51
|
}
|
|
59
52
|
const actionRepo = new acceptCOAOffer_1.AcceptCOAOfferActionRepo(connection);
|
|
60
|
-
// const transactionProcessRepo = new TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
|
|
61
53
|
try {
|
|
62
54
|
const coaIntegrationSettings = await settings.getByKey('coa');
|
|
63
55
|
const reserveService = new coa_service_1.COA.service.Reserve({
|
|
@@ -86,8 +78,6 @@ function call(params) {
|
|
|
86
78
|
action: actionRepo,
|
|
87
79
|
authorizeOfferAction: new authorizeOffer_1.AuthorizeOfferActionRepo(connection),
|
|
88
80
|
event: new event_1.EventRepo(connection),
|
|
89
|
-
// orderNumber: new OrderNumberRepo({ connection }),
|
|
90
|
-
// project: new ProjectRepo(connection),
|
|
91
81
|
placeOrder: new placeOrder_1.PlaceOrderRepo(connection),
|
|
92
82
|
reserveService,
|
|
93
83
|
masterService
|
|
@@ -104,9 +94,6 @@ function call(params) {
|
|
|
104
94
|
})({
|
|
105
95
|
action: actionRepo,
|
|
106
96
|
event: new event_1.EventRepo(connection),
|
|
107
|
-
// orderInTransaction: new OrderInTransactionRepo(connection),
|
|
108
|
-
// orderNumber: new OrderNumberRepo({ connection }),
|
|
109
|
-
// project: new ProjectRepo(connection),
|
|
110
97
|
placeOrder: new placeOrder_1.PlaceOrderRepo(connection),
|
|
111
98
|
reserveService,
|
|
112
99
|
masterService
|
|
@@ -34,19 +34,13 @@ const any_1 = require("../payment/any");
|
|
|
34
34
|
* タスク実行関数
|
|
35
35
|
*/
|
|
36
36
|
function call(params) {
|
|
37
|
-
return async ({ connection, redisClient }
|
|
37
|
+
return async ({ connection, redisClient }) => {
|
|
38
38
|
if (redisClient === undefined) {
|
|
39
39
|
throw new factory_1.factory.errors.Argument('settings', 'redisClient required');
|
|
40
40
|
}
|
|
41
|
-
// 遅延実行(executeByName)には対応しない
|
|
42
|
-
if (!options.executeById) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
41
|
let callResult;
|
|
46
42
|
const settings = new integration_1.IntegrationSettingRepo({ connection });
|
|
47
|
-
// const actionRepo = new ActionRepo(connection);
|
|
48
43
|
const authorizePaymentMethodActionRepo = new authorizePaymentMethod_1.AuthorizePaymentMethodActionRepo(connection);
|
|
49
|
-
// const transactionProcessRepo = new TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
|
|
50
44
|
const paymentServiceId = params.data.object.issuedThrough.id;
|
|
51
45
|
const credentialsExpireInSeconds = (await settings.getByKey('movieticketReserve')).credentialsExpireInSeconds;
|
|
52
46
|
const useCredentialsRepo = typeof paymentServiceId === 'string' && paymentServiceId !== ''
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.call = call;
|
|
4
4
|
const coa_service_1 = require("@motionpicture/coa-service");
|
|
5
5
|
const factory_1 = require("../../factory");
|
|
6
|
-
const
|
|
6
|
+
const cancel_1 = require("../../repo/action/cancel");
|
|
7
7
|
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
8
8
|
const offer_1 = require("../../repo/rateLimit/offer");
|
|
9
9
|
const reservation_1 = require("../../repo/reservation");
|
|
@@ -18,7 +18,6 @@ let coaAuthClientCreated = false;
|
|
|
18
18
|
let coaAuthClient = new coa_service_1.COA.auth.RefreshToken({
|
|
19
19
|
endpoint: '', // 使用されないので空文字でok
|
|
20
20
|
refreshToken: '', // 使用されないので空文字でok
|
|
21
|
-
// useFetch: true
|
|
22
21
|
});
|
|
23
22
|
/**
|
|
24
23
|
* タスク実行関数
|
|
@@ -33,7 +32,7 @@ function call(params) {
|
|
|
33
32
|
// support COAReserve(2025-03-01~)
|
|
34
33
|
if (data.purpose?.typeOf === factory_1.factory.assetTransactionType.Reserve) {
|
|
35
34
|
await (0, cancelReservation_1.cancelPendingReservation)({ purpose: data.purpose })({
|
|
36
|
-
|
|
35
|
+
actions: { cancel: new cancel_1.CancelActionRepo(connection) },
|
|
37
36
|
assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
|
|
38
37
|
stockHolder: new stockHolder_1.StockHolderRepo({ connection }),
|
|
39
38
|
offerRateLimit: new offer_1.OfferRateLimitRepo(redisClient),
|
|
@@ -63,7 +62,7 @@ function call(params) {
|
|
|
63
62
|
instrument,
|
|
64
63
|
project: { id: params.project.id }
|
|
65
64
|
})({
|
|
66
|
-
|
|
65
|
+
actions: { cancel: new cancel_1.CancelActionRepo(connection) },
|
|
67
66
|
reserveService
|
|
68
67
|
});
|
|
69
68
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.call = call;
|
|
4
4
|
const factory_1 = require("../../factory");
|
|
5
|
-
const
|
|
5
|
+
const cancel_1 = require("../../repo/action/cancel");
|
|
6
6
|
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
7
7
|
const offer_1 = require("../../repo/rateLimit/offer");
|
|
8
8
|
const reservation_1 = require("../../repo/reservation");
|
|
@@ -20,15 +20,13 @@ function call(params) {
|
|
|
20
20
|
throw new factory_1.factory.errors.Argument('settings', 'redisClient required');
|
|
21
21
|
}
|
|
22
22
|
await (0, cancelReservation_1.cancelReservation)(data.actionAttributes)({
|
|
23
|
-
|
|
23
|
+
actions: { cancel: new cancel_1.CancelActionRepo(connection) },
|
|
24
24
|
reservation: new reservation_1.ReservationRepo(connection),
|
|
25
25
|
setting: new setting_1.SettingRepo(connection),
|
|
26
26
|
task: new task_1.TaskRepo(connection),
|
|
27
27
|
assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
|
|
28
28
|
offerRateLimit: new offer_1.OfferRateLimitRepo(redisClient),
|
|
29
29
|
stockHolder: new stockHolder_1.StockHolderRepo({ connection })
|
|
30
|
-
}
|
|
31
|
-
// settings
|
|
32
|
-
);
|
|
30
|
+
});
|
|
33
31
|
};
|
|
34
32
|
}
|
|
@@ -9,23 +9,17 @@ const paymentService_1 = require("../../repo/paymentService");
|
|
|
9
9
|
const paymentServiceProvider_1 = require("../../repo/paymentServiceProvider");
|
|
10
10
|
const sellerPaymentAccepted_1 = require("../../repo/sellerPaymentAccepted");
|
|
11
11
|
const integration_1 = require("../../repo/setting/integration");
|
|
12
|
-
// import { TransactionProcessRepo } from '../../repo/transactionProcess';
|
|
13
12
|
const pay_1 = require("../assetTransaction/pay");
|
|
14
13
|
/**
|
|
15
14
|
* タスク実行関数
|
|
16
15
|
*/
|
|
17
16
|
function call(params) {
|
|
18
|
-
return async ({ connection, redisClient }
|
|
17
|
+
return async ({ connection, redisClient }) => {
|
|
19
18
|
if (redisClient === undefined) {
|
|
20
19
|
throw new factory_1.factory.errors.Argument('settings', 'redisClient required');
|
|
21
20
|
}
|
|
22
|
-
// 遅延実行(executeByName)には対応しない
|
|
23
|
-
if (!options.executeById) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
21
|
const settings = new integration_1.IntegrationSettingRepo({ connection });
|
|
27
22
|
const actionRepo = new checkMovieTicket_1.CheckMovieTicketActionRepo(connection);
|
|
28
|
-
// const transactionProcessRepo = new TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
|
|
29
23
|
const paymentServiceId = params.data.object[0]?.id;
|
|
30
24
|
const credentialsExpireInSeconds = (await settings.getByKey('movieticketReserve')).credentialsExpireInSeconds;
|
|
31
25
|
const useCredentialsRepo = typeof paymentServiceId === 'string' && paymentServiceId !== ''
|
|
@@ -3,72 +3,29 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.call = call;
|
|
4
4
|
const factory_1 = require("../../factory");
|
|
5
5
|
const acceptedOffer_1 = require("../../repo/acceptedOffer");
|
|
6
|
-
const checkThing_1 = require("../../repo/action/checkThing");
|
|
7
6
|
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
8
|
-
const event_1 = require("../../repo/event");
|
|
9
7
|
const order_1 = require("../../repo/order");
|
|
10
|
-
const setting_1 = require("../../repo/setting");
|
|
11
|
-
const stockHolder_1 = require("../../repo/stockHolder");
|
|
12
|
-
const task_1 = require("../../repo/task");
|
|
13
|
-
const validateEvent_1 = require("../validation/validateEvent");
|
|
14
8
|
const validateOrder_1 = require("../validation/validateOrder");
|
|
15
9
|
/**
|
|
16
10
|
* タスク実行関数
|
|
17
11
|
*/
|
|
18
12
|
function call(params) {
|
|
19
|
-
return async ({ connection
|
|
20
|
-
if (redisClient === undefined) {
|
|
21
|
-
throw new factory_1.factory.errors.Argument('settings', 'redisClient required');
|
|
22
|
-
}
|
|
23
|
-
const actionRepo = new checkThing_1.CheckThingActionRepo(connection);
|
|
13
|
+
return async ({ connection }) => {
|
|
24
14
|
const { data } = params;
|
|
25
|
-
const actionAttributes = {
|
|
26
|
-
agent: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project },
|
|
27
|
-
object: data.object,
|
|
28
|
-
project: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project },
|
|
29
|
-
typeOf: factory_1.factory.actionType.CheckAction,
|
|
30
|
-
sameAs: { id: params.id, typeOf: 'Task' } // add sameAs(2025-09-22~)
|
|
31
|
-
};
|
|
32
|
-
const action = await actionRepo.start(actionAttributes);
|
|
33
15
|
const objectTypeOf = data.object.typeOf;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
break;
|
|
48
|
-
// support ScreeningEvent(2025-05-01~)
|
|
49
|
-
case factory_1.factory.eventType.ScreeningEvent:
|
|
50
|
-
await (0, validateEvent_1.validateEvent)({
|
|
51
|
-
id: data.object.id,
|
|
52
|
-
project: { id: params.project.id }
|
|
53
|
-
})({
|
|
54
|
-
event: new event_1.EventRepo(connection),
|
|
55
|
-
stockHolder: new stockHolder_1.StockHolderRepo({ connection })
|
|
56
|
-
});
|
|
57
|
-
break;
|
|
58
|
-
default:
|
|
59
|
-
throw new factory_1.factory.errors.NotImplemented(`${objectTypeOf} not implemented`);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
catch (error) {
|
|
63
|
-
try {
|
|
64
|
-
await actionRepo.giveUp({ typeOf: action.typeOf, id: action.id, error });
|
|
65
|
-
}
|
|
66
|
-
catch (__) {
|
|
67
|
-
// 失敗したら仕方ない
|
|
68
|
-
}
|
|
69
|
-
throw error;
|
|
16
|
+
switch (objectTypeOf) {
|
|
17
|
+
case factory_1.factory.order.OrderType.Order:
|
|
18
|
+
await (0, validateOrder_1.validateOrder)({
|
|
19
|
+
orderNumber: data.object.orderNumber,
|
|
20
|
+
project: { id: params.project.id }
|
|
21
|
+
})({
|
|
22
|
+
acceptedOffer: new acceptedOffer_1.AcceptedOfferRepo(connection),
|
|
23
|
+
assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
|
|
24
|
+
order: new order_1.OrderRepo(connection),
|
|
25
|
+
});
|
|
26
|
+
break;
|
|
27
|
+
default:
|
|
28
|
+
throw new factory_1.factory.errors.NotImplemented(`${objectTypeOf} not implemented`);
|
|
70
29
|
}
|
|
71
|
-
const actionResult = {}; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
72
|
-
await actionRepo.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: actionResult });
|
|
73
30
|
};
|
|
74
31
|
}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.call = call;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
4
|
+
// import { AcceptedOfferRepo } from '../../repo/acceptedOffer';
|
|
5
|
+
// import { AccountingReportRepo } from '../../repo/accountingReport';
|
|
6
|
+
const confirm_1 = require("../../repo/action/confirm");
|
|
7
7
|
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
8
|
-
|
|
8
|
+
// import { EventRepo } from '../../repo/event';
|
|
9
9
|
const order_1 = require("../../repo/order");
|
|
10
|
-
|
|
10
|
+
// import { ProjectRepo } from '../../repo/project';
|
|
11
11
|
const task_1 = require("../../repo/task");
|
|
12
|
-
// import { TransactionRepo } from '../../repo/transaction';
|
|
13
12
|
const confirmPayTransaction_1 = require("../order/confirmPayTransaction");
|
|
14
13
|
/**
|
|
15
14
|
* タスク実行関数
|
|
@@ -20,15 +19,15 @@ function call(params) {
|
|
|
20
19
|
...params.data,
|
|
21
20
|
project: params.project
|
|
22
21
|
}, {})({
|
|
23
|
-
acceptedOffer: new
|
|
24
|
-
action: new
|
|
22
|
+
// acceptedOffer: new AcceptedOfferRepo(connection),
|
|
23
|
+
// action: new ActionRepo(connection),
|
|
24
|
+
actions: { confirm: new confirm_1.ConfirmActionRepo(connection) },
|
|
25
25
|
assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
|
|
26
26
|
order: new order_1.OrderRepo(connection),
|
|
27
|
-
accountingReport: new
|
|
28
|
-
event: new
|
|
29
|
-
project: new
|
|
27
|
+
// accountingReport: new AccountingReportRepo(connection),
|
|
28
|
+
// event: new EventRepo(connection),
|
|
29
|
+
// project: new ProjectRepo(connection),
|
|
30
30
|
task: new task_1.TaskRepo(connection),
|
|
31
|
-
// transaction: new TransactionRepo(connection)
|
|
32
31
|
});
|
|
33
32
|
};
|
|
34
33
|
}
|
|
@@ -3,7 +3,8 @@ import { factory } from '../../factory';
|
|
|
3
3
|
import type { IntegrationSettingRepo as Settings } from '../../repo/setting/integration';
|
|
4
4
|
import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../taskHandler';
|
|
5
5
|
import { AcceptedOfferRepo } from '../../repo/acceptedOffer';
|
|
6
|
-
import {
|
|
6
|
+
import { ConfirmActionRepo } from '../../repo/action/confirm';
|
|
7
|
+
import { ReserveActionRepo } from '../../repo/action/reserve';
|
|
7
8
|
import { AssetTransactionRepo } from '../../repo/assetTransaction';
|
|
8
9
|
import { AuthorizationRepo } from '../../repo/authorization';
|
|
9
10
|
import { OrderRepo } from '../../repo/order';
|
|
@@ -30,7 +31,10 @@ export declare function confirmReserveTransaction(params: Omit<factory.task.IDat
|
|
|
30
31
|
useOnOrderStatusChanged: boolean;
|
|
31
32
|
}): (repos: {
|
|
32
33
|
acceptedOffer: AcceptedOfferRepo;
|
|
33
|
-
|
|
34
|
+
actions: {
|
|
35
|
+
confirm: ConfirmActionRepo;
|
|
36
|
+
reserve: ReserveActionRepo;
|
|
37
|
+
};
|
|
34
38
|
assetTransaction: AssetTransactionRepo;
|
|
35
39
|
code: AuthorizationRepo;
|
|
36
40
|
order: OrderRepo;
|
|
@@ -10,7 +10,8 @@ const confirm_1 = require("../assetTransaction/reserve/confirm");
|
|
|
10
10
|
const reserveCOA_1 = require("../assetTransaction/reserveCOA");
|
|
11
11
|
const factory_2 = require("../assetTransaction/reserveCOA/factory");
|
|
12
12
|
const acceptedOffer_1 = require("../../repo/acceptedOffer");
|
|
13
|
-
const
|
|
13
|
+
const confirm_2 = require("../../repo/action/confirm");
|
|
14
|
+
const reserve_1 = require("../../repo/action/reserve");
|
|
14
15
|
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
15
16
|
const authorization_1 = require("../../repo/authorization");
|
|
16
17
|
const order_1 = require("../../repo/order");
|
|
@@ -23,7 +24,6 @@ let coaAuthClientCreated = false;
|
|
|
23
24
|
let coaAuthClient = new coa_service_1.COA.auth.RefreshToken({
|
|
24
25
|
endpoint: '', // 使用されないので空文字でok
|
|
25
26
|
refreshToken: '', // 使用されないので空文字でok
|
|
26
|
-
// useFetch: true
|
|
27
27
|
});
|
|
28
28
|
/**
|
|
29
29
|
* タスク実行関数
|
|
@@ -53,7 +53,10 @@ function call(params) {
|
|
|
53
53
|
useOnOrderStatusChanged: true
|
|
54
54
|
})({
|
|
55
55
|
acceptedOffer: new acceptedOffer_1.AcceptedOfferRepo(connection),
|
|
56
|
-
|
|
56
|
+
actions: {
|
|
57
|
+
confirm: new confirm_2.ConfirmActionRepo(connection),
|
|
58
|
+
reserve: new reserve_1.ReserveActionRepo(connection),
|
|
59
|
+
},
|
|
57
60
|
assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
|
|
58
61
|
code: new authorization_1.AuthorizationRepo(connection),
|
|
59
62
|
order: new order_1.OrderRepo(connection),
|
|
@@ -179,7 +182,7 @@ function confirmReserveTransaction(params, options) {
|
|
|
179
182
|
object: confirmActionObject,
|
|
180
183
|
...(typeof sameAs?.id === 'string') ? { sameAs: { id: sameAs.id, typeOf: 'Task' } } : undefined // link sameAs(2024-06-10~)
|
|
181
184
|
};
|
|
182
|
-
const action = await repos.
|
|
185
|
+
const action = await repos.actions.confirm.start(confirmActionAttributes, {
|
|
183
186
|
...(recipe !== undefined) ? { recipe } : undefined // add recipe(2024-06-11~)
|
|
184
187
|
});
|
|
185
188
|
try {
|
|
@@ -209,7 +212,7 @@ function confirmReserveTransaction(params, options) {
|
|
|
209
212
|
}
|
|
210
213
|
catch (error) {
|
|
211
214
|
try {
|
|
212
|
-
await repos.
|
|
215
|
+
await repos.actions.confirm.giveUp({ typeOf: confirmActionAttributes.typeOf, id: action.id, error });
|
|
213
216
|
}
|
|
214
217
|
catch (__) {
|
|
215
218
|
// 失敗したら仕方ない
|
|
@@ -219,7 +222,7 @@ function confirmReserveTransaction(params, options) {
|
|
|
219
222
|
const result = {
|
|
220
223
|
// ...(updReserveResult !== undefined) ? { updReserveResult } : {} // discontinue(2024-06-11~)
|
|
221
224
|
};
|
|
222
|
-
await repos.
|
|
225
|
+
await repos.actions.confirm.completeWithVoid({
|
|
223
226
|
typeOf: confirmActionAttributes.typeOf, id: action.id, result,
|
|
224
227
|
...(recipe !== undefined) ? { recipe } : undefined // add recipe(2024-06-11~)
|
|
225
228
|
});
|
|
@@ -247,7 +250,9 @@ function onConfirmed(params, options) {
|
|
|
247
250
|
},
|
|
248
251
|
useOnOrderStatusChanged: options.useOnOrderStatusChanged === true
|
|
249
252
|
};
|
|
253
|
+
const taskIdentifier = (0, util_1.format)('%s:%s:%s:%s', params.project.id, factory_1.factory.taskName.OnAssetTransactionStatusChanged, onAssetTransactionStatusChangedTaskData.purpose.orderNumber, onAssetTransactionStatusChangedTaskData.object.transactionNumber);
|
|
250
254
|
const onAssetTransactionStatusChangedTask = {
|
|
255
|
+
identifier: taskIdentifier,
|
|
251
256
|
project: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project },
|
|
252
257
|
name: factory_1.factory.taskName.OnAssetTransactionStatusChanged,
|
|
253
258
|
status: factory_1.factory.taskStatus.Ready,
|
|
@@ -257,7 +262,7 @@ function onConfirmed(params, options) {
|
|
|
257
262
|
executionResults: [],
|
|
258
263
|
data: onAssetTransactionStatusChangedTaskData
|
|
259
264
|
};
|
|
260
|
-
await repos.task.
|
|
265
|
+
await repos.task.runTaskByIdentifier(onAssetTransactionStatusChangedTask);
|
|
261
266
|
}
|
|
262
267
|
};
|
|
263
268
|
}
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.call = call;
|
|
4
4
|
const factory_1 = require("../../factory");
|
|
5
|
-
const acceptedOffer_1 = require("../../repo/acceptedOffer");
|
|
6
5
|
const accountingReport_1 = require("../../repo/accountingReport");
|
|
7
|
-
const
|
|
6
|
+
const create_1 = require("../../repo/action/create");
|
|
8
7
|
const order_1 = require("../../repo/order");
|
|
9
8
|
const createAccountingReportIfNotExist_1 = require("../order/createAccountingReportIfNotExist");
|
|
10
9
|
/**
|
|
@@ -13,9 +12,10 @@ const createAccountingReportIfNotExist_1 = require("../order/createAccountingRep
|
|
|
13
12
|
function call(params) {
|
|
14
13
|
return async ({ connection }) => {
|
|
15
14
|
await createAccountingReport(params)({
|
|
16
|
-
acceptedOffer: new acceptedOffer_1.AcceptedOfferRepo(connection),
|
|
17
15
|
accountingReport: new accountingReport_1.AccountingReportRepo(connection),
|
|
18
|
-
|
|
16
|
+
actions: {
|
|
17
|
+
create: new create_1.CreateActionRepo(connection)
|
|
18
|
+
},
|
|
19
19
|
order: new order_1.OrderRepo(connection)
|
|
20
20
|
});
|
|
21
21
|
};
|
|
@@ -28,10 +28,6 @@ function createAccountingReport(params) {
|
|
|
28
28
|
project: { id: params.project.id },
|
|
29
29
|
inclusion: [
|
|
30
30
|
'orderNumber', 'project', 'paymentMethods', 'seller', 'typeOf', 'orderDate'
|
|
31
|
-
// 'customer', 'confirmationNumber',
|
|
32
|
-
// 'orderedItem',
|
|
33
|
-
// 'broker',
|
|
34
|
-
// 'price', 'priceCurrency',
|
|
35
31
|
]
|
|
36
32
|
});
|
|
37
33
|
const simpleOrder = {
|
|
@@ -51,16 +47,13 @@ function createAccountingReport(params) {
|
|
|
51
47
|
purpose: simpleOrder,
|
|
52
48
|
sameAs: { id: params.id, typeOf: 'Task' } // add sameAs(2025-09-21~)
|
|
53
49
|
};
|
|
54
|
-
const action = await repos.
|
|
50
|
+
const action = await repos.actions.create.start(actionAttributes);
|
|
55
51
|
try {
|
|
56
|
-
await (0, createAccountingReportIfNotExist_1.createAccountingReportIfNotExist)(
|
|
57
|
-
...order,
|
|
58
|
-
// acceptedOffers
|
|
59
|
-
})(repos);
|
|
52
|
+
await (0, createAccountingReportIfNotExist_1.createAccountingReportIfNotExist)(order)(repos);
|
|
60
53
|
}
|
|
61
54
|
catch (error) {
|
|
62
55
|
try {
|
|
63
|
-
await repos.
|
|
56
|
+
await repos.actions.create.giveUp({ typeOf: action.typeOf, id: action.id, error });
|
|
64
57
|
}
|
|
65
58
|
catch (__) {
|
|
66
59
|
// 失敗したら仕方ない
|
|
@@ -68,6 +61,6 @@ function createAccountingReport(params) {
|
|
|
68
61
|
throw error;
|
|
69
62
|
}
|
|
70
63
|
const result = {};
|
|
71
|
-
await repos.
|
|
64
|
+
await repos.actions.create.completeWithVoid({ typeOf: action.typeOf, id: action.id, result });
|
|
72
65
|
};
|
|
73
66
|
}
|