@chevre/domain 26.0.0-alpha.9 → 26.1.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/chevre/eventEmitter/task.d.ts +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 +11 -1
- package/lib/chevre/repo/action/acceptCOAOffer.js +25 -2
- package/lib/chevre/repo/action/acceptPay.d.ts +11 -1
- package/lib/chevre/repo/action/acceptPay.js +27 -6
- package/lib/chevre/repo/action/anyAction/actionProcess.d.ts +111 -0
- package/lib/chevre/repo/action/anyAction/actionProcess.js +290 -0
- 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 +8 -5
- package/lib/chevre/repo/action/authorizeOffer.d.ts +3 -1
- package/lib/chevre/repo/action/authorizeOffer.js +8 -7
- package/lib/chevre/repo/action/authorizePaymentMethod.d.ts +11 -1
- package/lib/chevre/repo/action/authorizePaymentMethod.js +25 -5
- 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 +11 -1
- package/lib/chevre/repo/action/checkMovieTicket.js +25 -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/dedicatedAction/dedicatedActionProcess.d.ts +46 -0
- package/lib/chevre/repo/action/dedicatedAction/dedicatedActionProcess.js +92 -0
- package/lib/chevre/repo/action/inform.d.ts +39 -0
- package/lib/chevre/repo/action/inform.js +115 -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 +8 -5
- 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 +50 -0
- package/lib/chevre/repo/action/update.js +129 -0
- package/lib/chevre/repo/action/use.d.ts +40 -0
- package/lib/chevre/repo/action/use.js +122 -0
- package/lib/chevre/repo/{action.d.ts → adminAction.d.ts} +11 -37
- package/lib/chevre/repo/adminAction.js +202 -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/factory/action/createMongoConditions.d.ts +4 -0
- package/lib/chevre/repo/factory/action/createMongoConditions.js +335 -0
- 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/abstractAction.d.ts +5 -0
- package/lib/chevre/repo/mongoose/schemas/action/abstractAction.js +2 -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/check.d.ts +3 -1
- package/lib/chevre/service/assetTransaction/pay/confirm.d.ts +0 -10
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorize.d.ts +1 -2
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeMovieTicket.d.ts +1 -2
- package/lib/chevre/service/assetTransaction/pay/start.d.ts +1 -2
- 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 +23 -24
- 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 +1 -2
- package/lib/chevre/service/payment/any/findAcceptAction.d.ts +0 -4
- package/lib/chevre/service/payment/any/findAcceptAction.js +23 -24
- package/lib/chevre/service/payment/any/findAuthorizeAction.d.ts +0 -4
- package/lib/chevre/service/payment/any/findAuthorizeAction.js +23 -24
- package/lib/chevre/service/payment/any/findCheckAction.d.ts +3 -5
- package/lib/chevre/service/payment/any/findCheckAction.js +24 -25
- 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 +1 -2
- package/lib/chevre/service/payment/movieTicket/checkMovieTicket.d.ts +3 -1
- package/lib/chevre/service/payment/movieTicket/checkMovieTicket.js +3 -3
- 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/payment/movieTicket/validation.d.ts +3 -1
- package/lib/chevre/service/payment/movieTicket/validation.js +2 -2
- 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 +5 -19
- package/lib/chevre/service/task/authorizePayment.js +6 -13
- 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 +8 -13
- 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 +3 -3
- package/lib/chevre/service/task/payment/invalidatePaymentUrlByTask.d.ts +0 -1
- package/lib/chevre/service/task/payment/payByTask.d.ts +3 -2
- package/lib/chevre/service/task/payment/payByTask.js +1 -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 +6 -18
- 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/actionProcess.js +0 -775
- 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
|
@@ -78,19 +78,6 @@ function reserveTransaction2action(params) {
|
|
|
78
78
|
// if (typeof transaction.object.underName?.typeOf === 'string') {
|
|
79
79
|
// underName = transaction.object.underName;
|
|
80
80
|
// }
|
|
81
|
-
// const moneyTransferActions: factory.action.transfer.moneyTransfer.IAttributes[] = [];
|
|
82
|
-
// const pendingReservations = (Array.isArray(transaction.object.subReservation)) ? transaction.object.subReservation : [];
|
|
83
|
-
// pendingReservations.forEach((reservation) => {
|
|
84
|
-
// const acceptedOffer4reservation = transaction.object.acceptedOffer?.find(
|
|
85
|
-
// (o) => o.itemOffered?.serviceOutput?.id === reservation.id
|
|
86
|
-
// );
|
|
87
|
-
// moneyTransferActions.push(...createMoneyTransferActions({
|
|
88
|
-
// acceptedOffer: acceptedOffer4reservation,
|
|
89
|
-
// reservation,
|
|
90
|
-
// transaction: params.transaction,
|
|
91
|
-
// underName
|
|
92
|
-
// }));
|
|
93
|
-
// });
|
|
94
81
|
const reservationPackage = {
|
|
95
82
|
reservationFor: {
|
|
96
83
|
id: String(reservationFor.id),
|
|
@@ -135,12 +122,10 @@ function createReservationUnderName(params) {
|
|
|
135
122
|
...((typeof telephone === 'string') && { telephone })
|
|
136
123
|
};
|
|
137
124
|
}
|
|
138
|
-
function reserveIfNotYet(
|
|
139
|
-
// params: factory.action.reserve.IAttributes,
|
|
140
|
-
params, options) {
|
|
125
|
+
function reserveIfNotYet(params, options) {
|
|
141
126
|
return async (repos) => {
|
|
142
127
|
const reservationPackage = params.object;
|
|
143
|
-
const reserveTransaction = (await repos.assetTransaction.
|
|
128
|
+
const reserveTransaction = (await repos.assetTransaction.findAssetTransactionsByTypeOf({
|
|
144
129
|
limit: 1,
|
|
145
130
|
page: 1,
|
|
146
131
|
typeOf: factory_1.factory.assetTransactionType.Reserve,
|
|
@@ -152,23 +137,12 @@ params, options) {
|
|
|
152
137
|
const actionAttributes = reserveTransaction2action({ transaction: reserveTransaction });
|
|
153
138
|
// 冪等性を担保(2023-05-31~)
|
|
154
139
|
debug('searching completed reserveAction... byTask:', options?.byTask, 'reservationNumber:', reservationPackage.reservationNumber);
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
typeOf: { $eq: actionAttributes.object.typeOf }
|
|
162
|
-
// reservationNumber: { $eq: params.object.reservationNumber }
|
|
163
|
-
},
|
|
164
|
-
purpose: {
|
|
165
|
-
id: { $in: [actionAttributes.purpose.id] },
|
|
166
|
-
typeOf: { $in: [actionAttributes.purpose.typeOf] }
|
|
167
|
-
}
|
|
168
|
-
}, ['id']);
|
|
169
|
-
debug(completedActions.length, 'completed reserveAction found. byTask:', options?.byTask, 'reservationNumber:', reservationPackage.reservationNumber);
|
|
170
|
-
if (completedActions.length === 0) {
|
|
171
|
-
const action = await repos.action.start(actionAttributes);
|
|
140
|
+
const completedAction = await repos.actions.reserve.findCompletedReserveAction({
|
|
141
|
+
purpose: { id: actionAttributes.purpose.id }
|
|
142
|
+
});
|
|
143
|
+
debug(completedAction?.id, 'completed reserveAction found. byTask:', options?.byTask, 'reservationNumber:', reservationPackage.reservationNumber);
|
|
144
|
+
if (completedAction === null) {
|
|
145
|
+
const action = await repos.actions.reserve.start(actionAttributes);
|
|
172
146
|
try {
|
|
173
147
|
let underName;
|
|
174
148
|
const underNameByTransaction = reserveTransaction.object.underName;
|
|
@@ -217,7 +191,7 @@ params, options) {
|
|
|
217
191
|
}
|
|
218
192
|
catch (error) {
|
|
219
193
|
try {
|
|
220
|
-
await repos.
|
|
194
|
+
await repos.actions.reserve.giveUp({ typeOf: action.typeOf, id: action.id, error });
|
|
221
195
|
}
|
|
222
196
|
catch (__) {
|
|
223
197
|
// 失敗したら仕方ない
|
|
@@ -225,7 +199,7 @@ params, options) {
|
|
|
225
199
|
throw error;
|
|
226
200
|
}
|
|
227
201
|
const actionResult = {};
|
|
228
|
-
await repos.
|
|
202
|
+
await repos.actions.reserve.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: actionResult });
|
|
229
203
|
}
|
|
230
204
|
return { actionAttributes, reserveTransaction };
|
|
231
205
|
};
|
|
@@ -42,7 +42,7 @@ function onReservationConfirmed(confirmedReservations, reserveAction) {
|
|
|
42
42
|
// );
|
|
43
43
|
const taskIdentifier = `${project.id}:${factory_1.factory.taskName.OnAuthorizationCreated}:${factory_1.factory.assetTransactionType.Reserve}:${reservationNumber}:onReservationConfirmed`;
|
|
44
44
|
onAuthorizationCreatedTask = {
|
|
45
|
-
alternateName: taskIdentifier,
|
|
45
|
+
// alternateName: taskIdentifier,
|
|
46
46
|
identifier: taskIdentifier,
|
|
47
47
|
name: factory_1.factory.taskName.OnAuthorizationCreated,
|
|
48
48
|
status: factory_1.factory.taskStatus.Ready,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { factory } from '../../factory';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ReserveActionRepo } from '../../repo/action/reserve';
|
|
3
|
+
import type { UseActionRepo } from '../../repo/action/use';
|
|
3
4
|
import type { AssetTransactionRepo } from '../../repo/assetTransaction';
|
|
4
5
|
import type { AuthorizationRepo } from '../../repo/authorization';
|
|
5
6
|
import type { OrderRepo } from '../../repo/order';
|
|
@@ -25,7 +26,10 @@ export declare function useReservation(params: {
|
|
|
25
26
|
identifier?: string;
|
|
26
27
|
};
|
|
27
28
|
}): (repos: {
|
|
28
|
-
|
|
29
|
+
actions: {
|
|
30
|
+
use: UseActionRepo;
|
|
31
|
+
reserve: ReserveActionRepo;
|
|
32
|
+
};
|
|
29
33
|
assetTransaction: AssetTransactionRepo;
|
|
30
34
|
code: AuthorizationRepo;
|
|
31
35
|
order: OrderRepo;
|
|
@@ -23,8 +23,6 @@ function useReservation(params) {
|
|
|
23
23
|
break;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
// } else {
|
|
27
|
-
// ticketToken = params?.instrument?.ticketToken;
|
|
28
26
|
}
|
|
29
27
|
// if (params.verifyToken === true) {} // タスク作成前に検証済なので検証不要
|
|
30
28
|
// confirmReservationが間に合わない可能性を考慮する(2023-06-01~)
|
|
@@ -33,29 +31,15 @@ function useReservation(params) {
|
|
|
33
31
|
const reservation = await repos.reservation.findReservationById({
|
|
34
32
|
id: reservationId,
|
|
35
33
|
inclusion: [
|
|
36
|
-
// 'issuedThrough',
|
|
37
|
-
// 'reservedTicket',
|
|
38
34
|
'project', 'reservationFor', 'reservationNumber', 'typeOf'
|
|
39
35
|
]
|
|
40
36
|
});
|
|
41
|
-
// if (typeof reservation.issuedThrough.id !== 'string') {
|
|
42
|
-
// // COA予約では予約使用アクションを想定していないので、興行idは必ず存在するはず
|
|
43
|
-
// throw new factory.errors.Internal('reservation.issuedThrough.id must be string');
|
|
44
|
-
// }
|
|
45
|
-
// const { reservedTicket } = reservation;
|
|
46
37
|
// optimize(2026-05-06~)
|
|
47
38
|
const reservationAsObject = {
|
|
48
39
|
id: reservation.id,
|
|
49
40
|
reservationNumber: reservation.reservationNumber,
|
|
50
41
|
typeOf: reservation.typeOf,
|
|
51
|
-
reservationFor: { id: reservation.reservationFor.id, typeOf: reservation.reservationFor.typeOf }
|
|
52
|
-
// discontinue issuedThrough,reservedTicket(2026-05-06~)
|
|
53
|
-
// issuedThrough: { id: reservation.issuedThrough.id, typeOf: reservation.issuedThrough.typeOf },
|
|
54
|
-
// reservedTicket: {
|
|
55
|
-
// typeOf: reservedTicket.typeOf,
|
|
56
|
-
// ...(typeof reservedTicket.identifier === 'string') ? { identifier: reservedTicket.identifier } : undefined,
|
|
57
|
-
// ...(typeof reservedTicket.ticketedSeat?.typeOf === 'string') ? { ticketedSeat: reservedTicket.ticketedSeat } : undefined
|
|
58
|
-
// }
|
|
42
|
+
reservationFor: { id: reservation.reservationFor.id, typeOf: reservation.reservationFor.typeOf }
|
|
59
43
|
};
|
|
60
44
|
// extend instrument to array(2025-02-18~)
|
|
61
45
|
const instrument = [
|
|
@@ -79,7 +63,7 @@ function useReservation(params) {
|
|
|
79
63
|
? { location: { typeOf: factory_1.factory.placeType.Place, identifier: params.location.identifier } }
|
|
80
64
|
: undefined
|
|
81
65
|
};
|
|
82
|
-
const action = await repos.
|
|
66
|
+
const action = await repos.actions.use.startUseAction(actionAttributes);
|
|
83
67
|
// ひとまず予約数:1に限定する
|
|
84
68
|
if (actionAttributes.object.length !== 1) {
|
|
85
69
|
throw new factory_1.factory.errors.Argument('object', 'number of using reservations must be 1');
|
|
@@ -91,14 +75,14 @@ function useReservation(params) {
|
|
|
91
75
|
}
|
|
92
76
|
catch (error) {
|
|
93
77
|
try {
|
|
94
|
-
await repos.
|
|
78
|
+
await repos.actions.use.giveUpUseAction({ typeOf: action.typeOf, id: action.id, error });
|
|
95
79
|
}
|
|
96
80
|
catch (__) {
|
|
97
81
|
// 失敗したら仕方ない
|
|
98
82
|
}
|
|
99
83
|
throw error;
|
|
100
84
|
}
|
|
101
|
-
await repos.
|
|
85
|
+
await repos.actions.use.completeUseAction({ typeOf: action.typeOf, id: action.id });
|
|
102
86
|
await (0, onReservationUsed_1.onReservationUsed)(attendedReservation, {
|
|
103
87
|
...actionAttributes,
|
|
104
88
|
id: action.id,
|
|
@@ -107,12 +91,10 @@ function useReservation(params) {
|
|
|
107
91
|
};
|
|
108
92
|
}
|
|
109
93
|
function reserveIfNotYet(params) {
|
|
110
|
-
return async (repos
|
|
111
|
-
// settings: Settings
|
|
112
|
-
) => {
|
|
94
|
+
return async (repos) => {
|
|
113
95
|
let reserveTransactions = [];
|
|
114
96
|
if (typeof params.object.id === 'string' && params.object.id.length > 0) {
|
|
115
|
-
reserveTransactions = await repos.assetTransaction.
|
|
97
|
+
reserveTransactions = await repos.assetTransaction.findAssetTransactionsByTypeOf({
|
|
116
98
|
typeOf: factory_1.factory.assetTransactionType.Reserve,
|
|
117
99
|
object: {
|
|
118
100
|
reservations: { id: { $in: [params.object.id] } }
|
|
@@ -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
|
|
@@ -116,11 +103,10 @@ function call(params) {
|
|
|
116
103
|
catch (error) {
|
|
117
104
|
let throwsError = true;
|
|
118
105
|
// アクションが存在すればタスクを実行済扱いにする
|
|
119
|
-
const action = (await actionRepo.
|
|
120
|
-
sameAs: { id:
|
|
121
|
-
purpose: { id:
|
|
122
|
-
|
|
123
|
-
})).shift();
|
|
106
|
+
const action = (await actionRepo.findActionBySameAs({
|
|
107
|
+
sameAs: { id: params.id },
|
|
108
|
+
purpose: { id: params.data.purpose.id }
|
|
109
|
+
}));
|
|
124
110
|
if (typeof action?.id === 'string') {
|
|
125
111
|
throwsError = false;
|
|
126
112
|
}
|
|
@@ -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 !== ''
|
|
@@ -63,8 +57,8 @@ function call(params) {
|
|
|
63
57
|
actions: {
|
|
64
58
|
pay: new pay_1.PayActionRepo(connection),
|
|
65
59
|
refund: new refund_1.RefundActionRepo(connection),
|
|
60
|
+
checkMovieTicket: new checkMovieTicket_1.CheckMovieTicketActionRepo(connection),
|
|
66
61
|
},
|
|
67
|
-
checkMovieTicketAction: new checkMovieTicket_1.CheckMovieTicketActionRepo(connection),
|
|
68
62
|
acceptPayAction: new acceptPay_1.AcceptPayActionRepo(connection),
|
|
69
63
|
authorizeInvoiceAction: new authorizeInvoice_1.AuthorizeInvoiceActionRepo(connection),
|
|
70
64
|
authorizePaymentMethodAction: authorizePaymentMethodActionRepo,
|
|
@@ -95,11 +89,10 @@ function call(params) {
|
|
|
95
89
|
catch (error) {
|
|
96
90
|
let throwsError = true;
|
|
97
91
|
// アクションが存在すればタスクを実行済扱いにする
|
|
98
|
-
const action = (await authorizePaymentMethodActionRepo.
|
|
99
|
-
sameAs: { id:
|
|
100
|
-
purpose: { id:
|
|
101
|
-
|
|
102
|
-
})).shift();
|
|
92
|
+
const action = (await authorizePaymentMethodActionRepo.findActionBySameAs({
|
|
93
|
+
sameAs: { id: params.id },
|
|
94
|
+
purpose: { id: params.data.purpose.id }
|
|
95
|
+
}));
|
|
103
96
|
if (typeof action?.id === 'string') {
|
|
104
97
|
throwsError = false;
|
|
105
98
|
}
|
|
@@ -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 !== ''
|
|
@@ -35,7 +29,9 @@ function call(params) {
|
|
|
35
29
|
...params.data,
|
|
36
30
|
sameAs: { id: params.id, typeOf: 'Task' }
|
|
37
31
|
})({
|
|
38
|
-
|
|
32
|
+
actions: {
|
|
33
|
+
checkMovieTicket: actionRepo,
|
|
34
|
+
},
|
|
39
35
|
credentials: new credentials_1.CredentialsRepo(redisClient, {
|
|
40
36
|
scope: `${factory_1.factory.service.paymentService.PaymentServiceType.MovieTicket}:${paymentServiceId}`,
|
|
41
37
|
expireInSeconds: (useCredentialsRepo) ? credentialsExpireInSeconds : 0
|
|
@@ -49,13 +45,12 @@ function call(params) {
|
|
|
49
45
|
catch (error) {
|
|
50
46
|
let throwsError = true;
|
|
51
47
|
// アクションが存在すればタスクを実行済扱いにする
|
|
52
|
-
const action = (await actionRepo.
|
|
53
|
-
sameAs: { id:
|
|
54
|
-
typeOf: { $eq: factory_1.factory.actionType.CheckAction },
|
|
48
|
+
const action = (await actionRepo.findActionBySameAs({
|
|
49
|
+
sameAs: { id: params.id },
|
|
55
50
|
...(typeof params.data.purpose?.id === 'string')
|
|
56
|
-
? { purpose: { id:
|
|
51
|
+
? { purpose: { id: params.data.purpose.id } }
|
|
57
52
|
: undefined
|
|
58
|
-
}))
|
|
53
|
+
}));
|
|
59
54
|
if (typeof action?.id === 'string') {
|
|
60
55
|
throwsError = false;
|
|
61
56
|
}
|
|
@@ -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
|
}
|