@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
|
@@ -5,11 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.taskLoader = void 0;
|
|
7
7
|
exports.executeAsyncAction = executeAsyncAction;
|
|
8
|
-
const debug_1 = __importDefault(require("debug"));
|
|
9
8
|
const moment_1 = __importDefault(require("moment"));
|
|
10
9
|
const factory_1 = require("../factory");
|
|
11
10
|
const onOperationFailed_1 = require("./asyncActionHandler/onOperationFailed");
|
|
12
|
-
const debug = (0, debug_1.default)('chevre-domain:service:asyncActionHandler');
|
|
13
11
|
exports.taskLoader = {
|
|
14
12
|
load: (taskName) => {
|
|
15
13
|
return import(`./task/${taskName}.js`);
|
|
@@ -20,10 +18,9 @@ exports.taskLoader = {
|
|
|
20
18
|
*/
|
|
21
19
|
function executeAsyncAction(task, next) {
|
|
22
20
|
const now = new Date();
|
|
23
|
-
debug('executing an executableTask...', task, now);
|
|
24
21
|
return async (settings, options) => {
|
|
25
22
|
const asyncActionRepo = new (await import('../repo/asyncAction.js')).AsyncActionRepo(settings.connection);
|
|
26
|
-
let
|
|
23
|
+
let taskAsNextFunctionParam;
|
|
27
24
|
try {
|
|
28
25
|
// 期限検証(2024-04-23~)
|
|
29
26
|
if (task.expires instanceof Date) {
|
|
@@ -57,32 +54,33 @@ function executeAsyncAction(task, next) {
|
|
|
57
54
|
status: factory_1.factory.taskStatus.Executed,
|
|
58
55
|
executionResult: result
|
|
59
56
|
});
|
|
60
|
-
|
|
57
|
+
taskAsNextFunctionParam = {
|
|
61
58
|
id: task.id,
|
|
62
|
-
remainingNumberOfTries: 0, // one timeの前提なのでひとまず固定で0
|
|
63
59
|
name: task.name,
|
|
64
60
|
status: factory_1.factory.taskStatus.Executed,
|
|
65
|
-
executionResult: result
|
|
66
61
|
};
|
|
67
62
|
}
|
|
68
63
|
catch (error) {
|
|
69
64
|
const onOperationFailedResult = await (0, onOperationFailed_1.onOperationFailed)({
|
|
70
65
|
task, now, error,
|
|
71
66
|
})({ asyncAction: asyncActionRepo });
|
|
72
|
-
|
|
67
|
+
taskAsNextFunctionParam = {
|
|
68
|
+
id: onOperationFailedResult.executedTask.id,
|
|
69
|
+
name: onOperationFailedResult.executedTask.name,
|
|
70
|
+
status: onOperationFailedResult.executedTask.status
|
|
71
|
+
};
|
|
72
|
+
;
|
|
73
73
|
}
|
|
74
74
|
finally {
|
|
75
75
|
if (typeof next === 'function') {
|
|
76
|
-
if (
|
|
77
|
-
|
|
76
|
+
if (taskAsNextFunctionParam === undefined) {
|
|
77
|
+
taskAsNextFunctionParam = {
|
|
78
78
|
id: task.id,
|
|
79
|
-
remainingNumberOfTries: 0, // one timeの前提なのでひとまず固定で0
|
|
80
79
|
name: task.name,
|
|
81
80
|
status: factory_1.factory.taskStatus.Aborted,
|
|
82
|
-
executionResult: {} // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
83
81
|
};
|
|
84
82
|
}
|
|
85
|
-
await next(
|
|
83
|
+
await next(taskAsNextFunctionParam)(settings);
|
|
86
84
|
}
|
|
87
85
|
}
|
|
88
86
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { COA } from '@motionpicture/coa-service';
|
|
2
|
-
import type {
|
|
2
|
+
import type { UpdateActionRepo } from '../../repo/action/update';
|
|
3
3
|
import type { CategoryCodeRepo } from '../../repo/categoryCode';
|
|
4
4
|
import type { MovieTheaterRepo } from '../../repo/place/movieTheater';
|
|
5
5
|
import type { ScreeningRoomRepo } from '../../repo/place/screeningRoom';
|
|
@@ -9,7 +9,9 @@ import { IImportFromCOAParams } from './factory';
|
|
|
9
9
|
type IMovieTheater = Pick<factory.place.movieTheater.IPlace, 'id' | 'typeOf' | 'branchCode' | 'name' | 'kanaName'>;
|
|
10
10
|
declare function processUpdateMovieTheater(params: IImportFromCOAParams): (repos: {
|
|
11
11
|
masterService: COA.service.Master;
|
|
12
|
-
|
|
12
|
+
actions: {
|
|
13
|
+
update: UpdateActionRepo;
|
|
14
|
+
};
|
|
13
15
|
categoryCode: CategoryCodeRepo;
|
|
14
16
|
movieTheater: MovieTheaterRepo;
|
|
15
17
|
screeningRoom: ScreeningRoomRepo;
|
|
@@ -20,7 +20,7 @@ function processUpdateMovieTheater(params) {
|
|
|
20
20
|
},
|
|
21
21
|
targetCollection: { typeOf: factory_1.factory.placeType.MovieTheater }
|
|
22
22
|
};
|
|
23
|
-
const action = await repos.
|
|
23
|
+
const action = await repos.actions.update.startUpdateAction(actionAttributes);
|
|
24
24
|
let seller;
|
|
25
25
|
let movieTheater;
|
|
26
26
|
let screeningRooms;
|
|
@@ -66,7 +66,7 @@ function processUpdateMovieTheater(params) {
|
|
|
66
66
|
}
|
|
67
67
|
catch (error) {
|
|
68
68
|
try {
|
|
69
|
-
await repos.
|
|
69
|
+
await repos.actions.update.giveUpUpdateAction({ typeOf: action.typeOf, id: action.id, error });
|
|
70
70
|
}
|
|
71
71
|
catch (__) {
|
|
72
72
|
// 失敗したら仕方ない
|
|
@@ -77,7 +77,7 @@ function processUpdateMovieTheater(params) {
|
|
|
77
77
|
screeningRoomsCount: screeningRooms.length,
|
|
78
78
|
...(processTime !== undefined) ? { processTime } : undefined
|
|
79
79
|
};
|
|
80
|
-
await repos.
|
|
80
|
+
await repos.actions.update.completeUpdateAction({ typeOf: action.typeOf, id: action.id, result: actionResult });
|
|
81
81
|
return { seller, movieTheater, screeningRooms };
|
|
82
82
|
};
|
|
83
83
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* マスターデータ同期サービス
|
|
3
3
|
*/
|
|
4
4
|
import type { COA } from '@motionpicture/coa-service';
|
|
5
|
-
import type {
|
|
5
|
+
import type { UpdateActionRepo } from '../repo/action/update';
|
|
6
6
|
import type { CategoryCodeRepo } from '../repo/categoryCode';
|
|
7
7
|
import type { CreativeWorkRepo } from '../repo/creativeWork';
|
|
8
8
|
import type { EventRepo } from '../repo/event';
|
|
@@ -17,7 +17,9 @@ import { saveScreeningEventSeries } from './event/saveScreeningEventSeries';
|
|
|
17
17
|
* イベントをインポートする
|
|
18
18
|
*/
|
|
19
19
|
declare function importFromCOA(params: IImportFromCOAParams): (repos: {
|
|
20
|
-
|
|
20
|
+
actions: {
|
|
21
|
+
update: UpdateActionRepo;
|
|
22
|
+
};
|
|
21
23
|
categoryCode: CategoryCodeRepo;
|
|
22
24
|
creativeWork: CreativeWorkRepo;
|
|
23
25
|
event: EventRepo;
|
|
@@ -70,7 +70,7 @@ function importFromCOA(params) {
|
|
|
70
70
|
instrument,
|
|
71
71
|
targetCollection: { typeOf: factory_1.factory.eventType.ScreeningEvent }
|
|
72
72
|
};
|
|
73
|
-
const action = await repos.
|
|
73
|
+
const action = await repos.actions.update.startUpdateAction(actionAttributes);
|
|
74
74
|
let savedScreeningEventsCount = 0;
|
|
75
75
|
let savedScreeningEventSeriesCount = 0;
|
|
76
76
|
let cancelledIds = [];
|
|
@@ -131,7 +131,7 @@ function importFromCOA(params) {
|
|
|
131
131
|
}
|
|
132
132
|
catch (error) {
|
|
133
133
|
try {
|
|
134
|
-
await repos.
|
|
134
|
+
await repos.actions.update.giveUpUpdateAction({ typeOf: action.typeOf, id: action.id, error });
|
|
135
135
|
}
|
|
136
136
|
catch (__) {
|
|
137
137
|
// 失敗したら仕方ない
|
|
@@ -144,7 +144,7 @@ function importFromCOA(params) {
|
|
|
144
144
|
savedScreeningEventSeriesCount,
|
|
145
145
|
...(processTime !== undefined) ? { processTime } : undefined
|
|
146
146
|
};
|
|
147
|
-
await repos.
|
|
147
|
+
await repos.actions.update.completeUpdateAction({ typeOf: action.typeOf, id: action.id, result: actionResult });
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
150
|
function cancelDeletedEvents(params) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { factory } from '../../factory';
|
|
2
|
-
import type {
|
|
2
|
+
import type { SendEmailMessageActionRepo } from '../../repo/action/sendEmailMessage';
|
|
3
3
|
import type { MessageRepo } from '../../repo/message';
|
|
4
4
|
import type { ProjectRepo } from '../../repo/project';
|
|
5
5
|
import type { IntegrationSettingRepo } from '../../repo/setting/integration';
|
|
@@ -11,7 +11,9 @@ declare function sendEmailMessage(params: factory.task.sendEmailMessage.IActionA
|
|
|
11
11
|
id: string;
|
|
12
12
|
};
|
|
13
13
|
}): (repos: {
|
|
14
|
-
|
|
14
|
+
actions: {
|
|
15
|
+
sendEmailMessage: SendEmailMessageActionRepo;
|
|
16
|
+
};
|
|
15
17
|
message: MessageRepo;
|
|
16
18
|
project: ProjectRepo;
|
|
17
19
|
integrationSetting: IntegrationSettingRepo;
|
|
@@ -80,7 +80,7 @@ function sendEmailMessage(params) {
|
|
|
80
80
|
project: { id: params.project.id }
|
|
81
81
|
});
|
|
82
82
|
const startingAction = createSendEmailMessageActionAttributes(params);
|
|
83
|
-
const action = await repos.
|
|
83
|
+
const action = await repos.actions.sendEmailMessage.start(startingAction, { recipe });
|
|
84
84
|
let result;
|
|
85
85
|
try {
|
|
86
86
|
mailData.customArgs = {
|
|
@@ -121,13 +121,13 @@ function sendEmailMessage(params) {
|
|
|
121
121
|
mailData,
|
|
122
122
|
project: { id: params.project.id }
|
|
123
123
|
});
|
|
124
|
-
await repos.
|
|
124
|
+
await repos.actions.sendEmailMessage.giveUp({ typeOf: action.typeOf, id: action.id, error, recipe });
|
|
125
125
|
}
|
|
126
126
|
catch (__) {
|
|
127
127
|
// 失敗したら仕方ない
|
|
128
128
|
}
|
|
129
129
|
throw error;
|
|
130
130
|
}
|
|
131
|
-
await repos.
|
|
131
|
+
await repos.actions.sendEmailMessage.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: result, recipe });
|
|
132
132
|
};
|
|
133
133
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { factory } from '../../factory';
|
|
2
|
-
import type {
|
|
2
|
+
import type { InformActionRepo } from '../../repo/action/inform';
|
|
3
3
|
import type { PotentialActionRepo } from '../../repo/potentialAction';
|
|
4
4
|
import type { SettingRepo } from '../../repo/setting';
|
|
5
5
|
interface ITriggerWebhookRepos {
|
|
6
|
-
|
|
6
|
+
actions: {
|
|
7
|
+
inform: InformActionRepo;
|
|
8
|
+
};
|
|
7
9
|
potentialAction: PotentialActionRepo;
|
|
8
10
|
setting: SettingRepo;
|
|
9
11
|
}
|
|
@@ -88,18 +88,7 @@ function createInformActionAttributes(params) {
|
|
|
88
88
|
const { about, object, purpose, recipient, project, id, typeOf } = params;
|
|
89
89
|
// redefine recipient(2025-02-15~)
|
|
90
90
|
let informRecipient;
|
|
91
|
-
|
|
92
|
-
// ...recipient
|
|
93
|
-
// // url: target.urlTemplate // discontinue(2025-02-15~)
|
|
94
|
-
// };
|
|
95
|
-
if (recipient?.typeOf === factory_1.factory.organizationType.Corporation && typeof recipient.id === 'string') {
|
|
96
|
-
informRecipient = {
|
|
97
|
-
id: recipient.id,
|
|
98
|
-
name: recipient.name,
|
|
99
|
-
typeOf: recipient.typeOf
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
else if (recipient?.typeOf === factory_1.factory.creativeWorkType.WebApplication) {
|
|
91
|
+
if (recipient?.typeOf === factory_1.factory.creativeWorkType.WebApplication) {
|
|
103
92
|
informRecipient = {
|
|
104
93
|
name: recipient.name,
|
|
105
94
|
typeOf: recipient.typeOf
|
|
@@ -139,9 +128,9 @@ function createInformActionAttributes(params) {
|
|
|
139
128
|
project: { id: project.id, typeOf: factory_1.factory.organizationType.Project },
|
|
140
129
|
recipient: informRecipient,
|
|
141
130
|
typeOf: factory_1.factory.actionType.InformAction,
|
|
131
|
+
target, // add(2025-02-06~)
|
|
142
132
|
...(typeof purpose?.typeOf === 'string') ? { purpose } : undefined,
|
|
143
133
|
...(typeof about?.typeOf === 'string') ? { about } : undefined, // add(2025-01-23~)
|
|
144
|
-
...(typeof target?.typeOf === 'string') ? { target } : undefined // add(2025-02-06~)
|
|
145
134
|
};
|
|
146
135
|
};
|
|
147
136
|
}
|
|
@@ -159,7 +148,7 @@ function processInformAction(params, options) {
|
|
|
159
148
|
const headerIdentifier = options?.triggerWebhook?.headerIdentifier;
|
|
160
149
|
const { identifier } = params;
|
|
161
150
|
const informActionAttributes = await createInformActionAttributes(params)(repos);
|
|
162
|
-
const action = await repos.
|
|
151
|
+
const action = await repos.actions.inform.startInformAction(informActionAttributes);
|
|
163
152
|
let result = {};
|
|
164
153
|
try {
|
|
165
154
|
const urlTemplate = informActionAttributes.target?.urlTemplate;
|
|
@@ -226,13 +215,13 @@ function processInformAction(params, options) {
|
|
|
226
215
|
}
|
|
227
216
|
catch (error) {
|
|
228
217
|
try {
|
|
229
|
-
await repos.
|
|
218
|
+
await repos.actions.inform.giveUpInformAction({ typeOf: action.typeOf, id: action.id, error });
|
|
230
219
|
}
|
|
231
220
|
catch (__) {
|
|
232
221
|
// 失敗したら仕方ない
|
|
233
222
|
}
|
|
234
223
|
throw error;
|
|
235
224
|
}
|
|
236
|
-
await repos.
|
|
225
|
+
await repos.actions.inform.completeInformAction({ typeOf: action.typeOf, id: action.id, result: result });
|
|
237
226
|
};
|
|
238
227
|
}
|
|
@@ -25,7 +25,6 @@ import type { TicketRepo } from '../../../repo/ticket';
|
|
|
25
25
|
import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
|
|
26
26
|
import type { TransactionNumberRepo } from '../../../repo/transactionNumber';
|
|
27
27
|
interface IAuthorizeRepos {
|
|
28
|
-
action?: never;
|
|
29
28
|
authorizeOfferAction: AuthorizeOfferActionRepo;
|
|
30
29
|
assetTransaction: AssetTransactionRepo;
|
|
31
30
|
authorization: AuthorizationRepo;
|
|
@@ -9,7 +9,6 @@ import type { MemberProgramRepo } from '../../../repo/memberProgram';
|
|
|
9
9
|
import type { TicketRepo } from '../../../repo/ticket';
|
|
10
10
|
import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
|
|
11
11
|
interface IIssueEventOfferTicketRepos {
|
|
12
|
-
action?: never;
|
|
13
12
|
authorizeTicketedObjectAction: AuthorizeTicketedObjectActionRepo;
|
|
14
13
|
authorization: AuthorizationRepo;
|
|
15
14
|
event: EventRepo;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { factory } from '../../../../factory';
|
|
2
2
|
import type { IntegrationSettingRepo as Settings } from '../../../../repo/setting/integration';
|
|
3
|
-
import type {
|
|
3
|
+
import type { CancelActionRepo } from '../../../../repo/action/cancel';
|
|
4
4
|
import type { AssetTransactionRepo } from '../../../../repo/assetTransaction';
|
|
5
5
|
import type { OrderInTransactionRepo } from '../../../../repo/orderInTransaction';
|
|
6
6
|
import type { OfferRateLimitRepo } from '../../../../repo/rateLimit/offer';
|
|
@@ -9,7 +9,9 @@ import type { SettingRepo } from '../../../../repo/setting';
|
|
|
9
9
|
import type { StockHolderRepo } from '../../../../repo/stockHolder';
|
|
10
10
|
import type { TaskRepo } from '../../../../repo/task';
|
|
11
11
|
interface IVoidTransactionRepos {
|
|
12
|
-
|
|
12
|
+
actions: {
|
|
13
|
+
cancel: CancelActionRepo;
|
|
14
|
+
};
|
|
13
15
|
assetTransaction: AssetTransactionRepo;
|
|
14
16
|
stockHolder: StockHolderRepo;
|
|
15
17
|
offerRateLimit: OfferRateLimitRepo;
|
|
@@ -2,15 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.processVoidTransaction4chevre = processVoidTransaction4chevre;
|
|
4
4
|
const factory_1 = require("../../../../factory");
|
|
5
|
-
// import type { TransactionRepo } from '../../../../repo/transaction';
|
|
6
5
|
const reserve_1 = require("../../../assetTransaction/reserve");
|
|
7
6
|
function processVoidTransaction4chevre(params) {
|
|
8
7
|
return async (repos, settings) => {
|
|
9
|
-
// const transactionNumber = params.action.object.pendingTransaction?.transactionNumber;
|
|
10
8
|
const transactionNumber = params.action.instrument.transactionNumber;
|
|
11
9
|
if (typeof transactionNumber === 'string') {
|
|
12
10
|
// 取引が存在すれば中止
|
|
13
|
-
const assetTransactions = await repos.assetTransaction.
|
|
11
|
+
const assetTransactions = await repos.assetTransaction.findAssetTransactionsByTypeOf({
|
|
14
12
|
limit: 1,
|
|
15
13
|
page: 1,
|
|
16
14
|
project: { id: { $eq: params.action.project.id } },
|
|
@@ -1,6 +1,6 @@
|
|
|
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
|
import { AcceptCOAOfferActionRepo } from '../../../../repo/action/acceptCOAOffer';
|
|
5
5
|
import { TaskRepo } from '../../../../repo/task';
|
|
6
6
|
declare function processVoidTransaction4coa(params: {
|
|
@@ -11,8 +11,10 @@ declare function processVoidTransaction4coa(params: {
|
|
|
11
11
|
*/
|
|
12
12
|
asyncCancelPendingReservation: boolean;
|
|
13
13
|
}): (repos: {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
actions: {
|
|
15
|
+
cancel: CancelActionRepo;
|
|
16
|
+
acceptCOAOffer: AcceptCOAOfferActionRepo;
|
|
17
|
+
};
|
|
16
18
|
reserveService: COA.service.Reserve;
|
|
17
19
|
task: TaskRepo;
|
|
18
20
|
}) => Promise<void>;
|
|
@@ -24,8 +26,10 @@ declare function processVoidTransactionByAcceptAction4coa(params: {
|
|
|
24
26
|
*/
|
|
25
27
|
asyncCancelPendingReservation: boolean;
|
|
26
28
|
}): (repos: {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
actions: {
|
|
30
|
+
cancel: CancelActionRepo;
|
|
31
|
+
acceptCOAOffer: AcceptCOAOfferActionRepo;
|
|
32
|
+
};
|
|
29
33
|
reserveService: COA.service.Reserve;
|
|
30
34
|
task: TaskRepo;
|
|
31
35
|
}) => Promise<void>;
|
|
@@ -13,7 +13,7 @@ function processVoidTransaction4coa(params, options) {
|
|
|
13
13
|
if (typeof acceptActionId !== 'string') {
|
|
14
14
|
throw new factory_1.factory.errors.NotFound('action.object.id');
|
|
15
15
|
}
|
|
16
|
-
const acceptAction = await repos.
|
|
16
|
+
const acceptAction = await repos.actions.acceptCOAOffer.findAnyActionById({ id: acceptActionId, typeOf: factory_1.factory.actionType.AcceptAction });
|
|
17
17
|
// console.log('processVoidTransaction4coa processing...', params.action.id, params.action.purpose.id, acceptAction);
|
|
18
18
|
await (0, cancel_1.cancelByAcceptAction)({ action: acceptAction }, options)(repos);
|
|
19
19
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { COA } from '@motionpicture/coa-service';
|
|
2
2
|
import { factory } from '../../../factory';
|
|
3
3
|
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
4
|
-
import type {
|
|
4
|
+
import type { CancelActionRepo } from '../../../repo/action/cancel';
|
|
5
5
|
import type { AcceptCOAOfferActionRepo } from '../../../repo/action/acceptCOAOffer';
|
|
6
6
|
import type { AuthorizeOfferActionRepo } from '../../../repo/action/authorizeOffer';
|
|
7
7
|
import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
|
|
@@ -16,9 +16,11 @@ interface IVoidTransactionRepos {
|
|
|
16
16
|
/**
|
|
17
17
|
* CancelAction開始で使用される
|
|
18
18
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
actions: {
|
|
20
|
+
cancel: CancelActionRepo;
|
|
21
|
+
acceptCOAOffer: AcceptCOAOfferActionRepo;
|
|
22
|
+
authorizeOffer: AuthorizeOfferActionRepo;
|
|
23
|
+
};
|
|
22
24
|
assetTransaction: AssetTransactionRepo;
|
|
23
25
|
stockHolder: StockHolderRepo;
|
|
24
26
|
offerRateLimit: OfferRateLimitRepo;
|
|
@@ -24,7 +24,7 @@ function voidTransaction(params) {
|
|
|
24
24
|
};
|
|
25
25
|
const transaction = await repos.placeOrder.findPlaceOrderById({ typeOf: params.purpose.typeOf, id: params.purpose.id }, ['typeOf', 'status', 'object']);
|
|
26
26
|
// 興行オファー承認アクション検索
|
|
27
|
-
let authorizeActions = await repos.
|
|
27
|
+
let authorizeActions = await repos.actions.authorizeOffer.findAuthorizeOfferActionsByPurpose({
|
|
28
28
|
// typeOf: factory.actionType.AuthorizeAction,
|
|
29
29
|
purpose: {
|
|
30
30
|
typeOf: params.purpose.typeOf,
|
|
@@ -79,7 +79,7 @@ function voidTransaction(params) {
|
|
|
79
79
|
await repos.orderInTransaction.deleteByIdentifier({ identifier: params.purpose.id });
|
|
80
80
|
}
|
|
81
81
|
await Promise.all(authorizeActions.map(async (action) => {
|
|
82
|
-
await repos.
|
|
82
|
+
await repos.actions.authorizeOffer.cancelWithVoid({ typeOf: action.typeOf, id: action.id, cancelAction });
|
|
83
83
|
switch (action.instrument.typeOf) {
|
|
84
84
|
// case WebAPIIdentifier.COA:
|
|
85
85
|
case factory_1.factory.assetTransactionType.COAReserveTransaction: {
|
|
@@ -88,8 +88,7 @@ function voidTransaction(params) {
|
|
|
88
88
|
throw new factory_1.factory.errors.Internal('repos.reserveService required');
|
|
89
89
|
}
|
|
90
90
|
await (0, processVoidTransaction4coa_1.processVoidTransaction4coa)({ action }, { asyncCancelPendingReservation: true })({
|
|
91
|
-
|
|
92
|
-
acceptCOAOfferAction: repos.acceptCOAOfferAction,
|
|
91
|
+
actions: repos.actions,
|
|
93
92
|
reserveService,
|
|
94
93
|
task: repos.task
|
|
95
94
|
});
|
|
@@ -121,7 +120,7 @@ function cancelAcceptActions(params) {
|
|
|
121
120
|
id: params.purpose.id
|
|
122
121
|
}, ['typeOf', 'status']);
|
|
123
122
|
// 興行オファー承認アクション検索
|
|
124
|
-
const completedAuthorizeActions = await repos.
|
|
123
|
+
const completedAuthorizeActions = await repos.actions.authorizeOffer.findAuthorizeOfferActionsByPurpose({
|
|
125
124
|
// typeOf: factory.actionType.AuthorizeAction,
|
|
126
125
|
purpose: {
|
|
127
126
|
typeOf: params.purpose.typeOf,
|
|
@@ -131,7 +130,7 @@ function cancelAcceptActions(params) {
|
|
|
131
130
|
actionStatus: { $eq: factory_1.factory.actionStatusType.CompletedActionStatus }
|
|
132
131
|
});
|
|
133
132
|
// 興行オファー採用アクション検索
|
|
134
|
-
let acceptActions = await repos.
|
|
133
|
+
let acceptActions = await repos.actions.acceptCOAOffer.findAcceptCOAOfferActionsByPurpose({
|
|
135
134
|
// typeOf: factory.actionType.AcceptAction,
|
|
136
135
|
purpose: {
|
|
137
136
|
typeOf: params.purpose.typeOf,
|
|
@@ -166,13 +165,12 @@ function cancelAcceptActions(params) {
|
|
|
166
165
|
}
|
|
167
166
|
const { reserveService } = repos;
|
|
168
167
|
await Promise.all(acceptActions.map(async (action) => {
|
|
169
|
-
await repos.
|
|
168
|
+
await repos.actions.acceptCOAOffer.cancelWithVoid({ typeOf: action.typeOf, id: action.id, cancelAction });
|
|
170
169
|
if (reserveService === undefined) {
|
|
171
170
|
throw new factory_1.factory.errors.Internal('repos.reserveService required');
|
|
172
171
|
}
|
|
173
172
|
await (0, processVoidTransaction4coa_1.processVoidTransactionByAcceptAction4coa)({ action }, { asyncCancelPendingReservation: true })({
|
|
174
|
-
|
|
175
|
-
acceptCOAOfferAction: repos.acceptCOAOfferAction,
|
|
173
|
+
actions: repos.actions,
|
|
176
174
|
reserveService,
|
|
177
175
|
task: repos.task
|
|
178
176
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { COA } from '@motionpicture/coa-service';
|
|
2
2
|
import { factory } from '../../../factory';
|
|
3
3
|
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
4
|
-
import type {
|
|
4
|
+
import type { CancelActionRepo } from '../../../repo/action/cancel';
|
|
5
5
|
import { AcceptCOAOfferActionRepo } from '../../../repo/action/acceptCOAOffer';
|
|
6
6
|
import type { AuthorizeOfferActionRepo } from '../../../repo/action/authorizeOffer';
|
|
7
7
|
import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
|
|
@@ -16,9 +16,11 @@ interface IVoidTransactionByActionIdRepos {
|
|
|
16
16
|
/**
|
|
17
17
|
* CancelAction開始で使用される
|
|
18
18
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
actions: {
|
|
20
|
+
cancel: CancelActionRepo;
|
|
21
|
+
acceptCOAOffer: AcceptCOAOfferActionRepo;
|
|
22
|
+
authorizeOffer: AuthorizeOfferActionRepo;
|
|
23
|
+
};
|
|
22
24
|
assetTransaction: AssetTransactionRepo;
|
|
23
25
|
stockHolder: StockHolderRepo;
|
|
24
26
|
offerRateLimit: OfferRateLimitRepo;
|
|
@@ -27,24 +27,13 @@ function voidTransactionByActionId(params) {
|
|
|
27
27
|
// throw new factory.errors.Forbidden('Transaction not yours');
|
|
28
28
|
// }
|
|
29
29
|
// const orderNumber = await repos.placeOrder.findInProgressOrderNumberById({ id: params.purpose.id });
|
|
30
|
-
const action = await repos.
|
|
30
|
+
const action = await repos.actions.authorizeOffer.findAnyActionById({ typeOf: factory_1.factory.actionType.AuthorizeAction, id: params.id });
|
|
31
31
|
if (action.purpose.typeOf !== transaction.typeOf || action.purpose.id !== transaction.id) {
|
|
32
32
|
throw new factory_1.factory.errors.Argument('Transaction', 'Action not found in the transaction');
|
|
33
33
|
}
|
|
34
34
|
// MongoDBでcompleteステータスであるにも関わらず、Chevreでは削除されている、というのが最悪の状況
|
|
35
35
|
// それだけは回避するためにMongoDBを先に変更
|
|
36
|
-
await repos.
|
|
37
|
-
// // add orderInTransaction(2024-01-15~)
|
|
38
|
-
// // USE_CREATE_ORDER_ON_OFFER_ACCEPTEDの場合、orderNumber発行済のはず
|
|
39
|
-
// // const orderNumberByTransaction = transaction.object.orderNumber;
|
|
40
|
-
// const orderNumberByTransaction = orderNumber; // transaction.objectへのアクセス回避(2024-05-30~)
|
|
41
|
-
// if (typeof orderNumberByTransaction === 'string') {
|
|
42
|
-
// await voidAcceptedOffer({
|
|
43
|
-
// // authorizeActions: [action],
|
|
44
|
-
// authorizeActionsWithInstrument: [action],
|
|
45
|
-
// orderNumber: orderNumberByTransaction
|
|
46
|
-
// })(repos);
|
|
47
|
-
// }
|
|
36
|
+
await repos.actions.authorizeOffer.cancelWithVoid({ typeOf: factory_1.factory.actionType.AuthorizeAction, id: params.id, cancelAction });
|
|
48
37
|
await (0, any_1.voidAcceptedOffer)({
|
|
49
38
|
authorizeActionsWithInstrument: [action],
|
|
50
39
|
placeOrderId: params.purpose.id
|
|
@@ -56,8 +45,7 @@ function voidTransactionByActionId(params) {
|
|
|
56
45
|
throw new factory_1.factory.errors.Internal('repos.reserveService required');
|
|
57
46
|
}
|
|
58
47
|
await (0, processVoidTransaction4coa_1.processVoidTransaction4coa)({ action }, { asyncCancelPendingReservation: false })({
|
|
59
|
-
|
|
60
|
-
acceptCOAOfferAction: repos.acceptCOAOfferAction,
|
|
48
|
+
actions: repos.actions,
|
|
61
49
|
reserveService,
|
|
62
50
|
task: repos.task
|
|
63
51
|
});
|
|
@@ -130,7 +130,7 @@ function reAcceptOffer(params) {
|
|
|
130
130
|
// }
|
|
131
131
|
const coaInfo = await findCOAInfo({ id: params.object.event.id, project: { id: transaction.project.id } })(repos);
|
|
132
132
|
// 承認アクション存在検証
|
|
133
|
-
await repos.authorizeOfferAction.
|
|
133
|
+
await repos.authorizeOfferAction.findAnyActionById({ id: params.potentialActions.id, typeOf: factory_1.factory.actionType.AuthorizeAction }, ['id'], []);
|
|
134
134
|
const actionAttributes = {
|
|
135
135
|
project: transaction.project,
|
|
136
136
|
typeOf: factory_1.factory.actionType.AcceptAction,
|
|
@@ -27,7 +27,7 @@ function changeOffers(params) {
|
|
|
27
27
|
// throw new factory.errors.NotFound('transaction.object.orderNumber');
|
|
28
28
|
// }
|
|
29
29
|
// 取引内のアクションかどうか確認
|
|
30
|
-
const authorizeAction = await repos.action.
|
|
30
|
+
const authorizeAction = await repos.action.findAnyActionById({ typeOf: factory_2.factory.actionType.AuthorizeAction, id: params.id });
|
|
31
31
|
if (authorizeAction.purpose.typeOf !== transaction.typeOf || authorizeAction.purpose.id !== transaction.id) {
|
|
32
32
|
throw new factory_2.factory.errors.Argument('Transaction', 'Action not found in the transaction');
|
|
33
33
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { factory } from '../../../factory';
|
|
2
2
|
import type { AcceptCOAOfferActionRepo } from '../../../repo/action/acceptCOAOffer';
|
|
3
3
|
import type { AsyncActionRepo } from '../../../repo/asyncAction';
|
|
4
|
-
import type { TaskRepo } from '../../../repo/task';
|
|
5
4
|
interface IFindAcceptActionResult {
|
|
6
5
|
/**
|
|
7
6
|
* アクションID
|
|
@@ -35,11 +34,8 @@ declare function findAcceptAction(params: {
|
|
|
35
34
|
*/
|
|
36
35
|
id: string;
|
|
37
36
|
};
|
|
38
|
-
}, options: {
|
|
39
|
-
useAsyncAction: boolean;
|
|
40
37
|
}): (repos: {
|
|
41
38
|
action: AcceptCOAOfferActionRepo;
|
|
42
39
|
asyncAction: AsyncActionRepo;
|
|
43
|
-
task: TaskRepo;
|
|
44
40
|
}) => Promise<IFindAcceptActionResult>;
|
|
45
41
|
export { findAcceptAction };
|
|
@@ -2,27 +2,27 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.findAcceptAction = findAcceptAction;
|
|
4
4
|
const factory_1 = require("../../../factory");
|
|
5
|
-
function findAcceptAction(params
|
|
5
|
+
function findAcceptAction(params) {
|
|
6
6
|
return async (repos) => {
|
|
7
7
|
// 非同期アクションに対応(2026-07-27~)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
//
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
8
|
+
// let task: Pick<factory.task.acceptCOAOffer.ITask, 'id' | 'status' | 'executionResults'> | undefined;
|
|
9
|
+
// まず非同期アクションを参照
|
|
10
|
+
const task = await repos.asyncAction.findAsyncActionById({
|
|
11
|
+
id: { $eq: params.sameAs.id },
|
|
12
|
+
project: { id: { $eq: params.project.id } },
|
|
13
|
+
name: factory_1.factory.taskName.AcceptCOAOffer
|
|
14
|
+
}, ['status', 'executionResults']);
|
|
15
|
+
// // 非同期アクションが存在しなければタスクを参照
|
|
16
|
+
// if (task === undefined) {
|
|
17
|
+
// task = await repos.task.findTaskById(
|
|
18
|
+
// {
|
|
19
|
+
// id: { $eq: params.sameAs.id },
|
|
20
|
+
// project: { id: { $eq: params.project.id } },
|
|
21
|
+
// name: factory.taskName.AcceptCOAOffer
|
|
22
|
+
// },
|
|
23
|
+
// ['status', 'executionResults']
|
|
24
|
+
// );
|
|
25
|
+
// }
|
|
26
26
|
if (task === undefined) {
|
|
27
27
|
throw new factory_1.factory.errors.NotFound(factory_1.factory.taskName.AcceptCOAOffer);
|
|
28
28
|
}
|
|
@@ -203,7 +203,6 @@ function createInformTasks(params, setting) {
|
|
|
203
203
|
const informActionAttributes = {
|
|
204
204
|
object: event4inform,
|
|
205
205
|
recipient: {
|
|
206
|
-
id: '',
|
|
207
206
|
name: String(informEvent.recipient?.name),
|
|
208
207
|
typeOf: factory_1.factory.creativeWorkType.WebApplication
|
|
209
208
|
// url: informUrl // discontinue(2025-02-13~)
|
|
@@ -257,7 +256,6 @@ function createInform2aggTasks(params, setting) {
|
|
|
257
256
|
const informActionAttributes = {
|
|
258
257
|
object: informObject,
|
|
259
258
|
recipient: {
|
|
260
|
-
id: '',
|
|
261
259
|
name: String(informEvent.recipient?.name),
|
|
262
260
|
typeOf: factory_1.factory.creativeWorkType.WebApplication
|
|
263
261
|
// url: informUrl // discontinue(2025-02-13~)
|