@chevre/domain 26.0.0-alpha.9 → 26.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/chevre/eventEmitter/task.d.ts +8 -23
- package/lib/chevre/eventEmitter/task.js +2 -2
- package/lib/chevre/repo/acceptedOffer.d.ts +0 -7
- package/lib/chevre/repo/acceptedOffer.js +27 -27
- package/lib/chevre/repo/action/acceptCOAOffer.d.ts +3 -1
- package/lib/chevre/repo/action/acceptCOAOffer.js +8 -2
- package/lib/chevre/repo/action/acceptPay.d.ts +3 -1
- package/lib/chevre/repo/action/acceptPay.js +8 -4
- package/lib/chevre/repo/action/anyAction/actionProcess.d.ts +120 -0
- package/lib/chevre/repo/action/{actionProcess.js → anyAction/actionProcess.js} +28 -157
- package/lib/chevre/repo/action/anyAction/actionRecipe.d.ts +37 -0
- package/lib/chevre/repo/action/anyAction/actionRecipe.js +53 -0
- package/lib/chevre/repo/action/authorizeInvoice.d.ts +5 -8
- package/lib/chevre/repo/action/authorizeInvoice.js +7 -4
- package/lib/chevre/repo/action/authorizeOffer.d.ts +3 -1
- package/lib/chevre/repo/action/authorizeOffer.js +7 -2
- package/lib/chevre/repo/action/authorizePaymentMethod.d.ts +3 -1
- package/lib/chevre/repo/action/authorizePaymentMethod.js +7 -4
- package/lib/chevre/repo/action/authorizeTicketedObject.d.ts +3 -1
- package/lib/chevre/repo/action/authorizeTicketedObject.js +7 -2
- package/lib/chevre/repo/action/cancel.d.ts +25 -0
- package/lib/chevre/repo/action/cancel.js +47 -0
- package/lib/chevre/repo/action/checkMovieTicket.d.ts +3 -1
- package/lib/chevre/repo/action/checkMovieTicket.js +8 -1
- package/lib/chevre/repo/action/confirm.d.ts +11 -0
- package/lib/chevre/repo/action/confirm.js +16 -0
- package/lib/chevre/repo/action/create.d.ts +10 -0
- package/lib/chevre/repo/action/create.js +17 -0
- package/lib/chevre/repo/action/inform.d.ts +38 -0
- package/lib/chevre/repo/action/inform.js +146 -0
- package/lib/chevre/repo/action/order.d.ts +21 -0
- package/lib/chevre/repo/action/order.js +35 -0
- package/lib/chevre/repo/action/pay.d.ts +3 -1
- package/lib/chevre/repo/action/pay.js +7 -4
- package/lib/chevre/repo/action/refund.d.ts +3 -1
- package/lib/chevre/repo/action/refund.js +7 -4
- package/lib/chevre/repo/action/reserve.d.ts +21 -0
- package/lib/chevre/repo/action/reserve.js +37 -0
- package/lib/chevre/repo/action/returnAction.d.ts +11 -0
- package/lib/chevre/repo/action/returnAction.js +16 -0
- package/lib/chevre/repo/action/sendEmailMessage.d.ts +10 -0
- package/lib/chevre/repo/action/sendEmailMessage.js +17 -0
- package/lib/chevre/repo/action/sendOrder.d.ts +10 -0
- package/lib/chevre/repo/action/sendOrder.js +16 -0
- package/lib/chevre/repo/action/unknown2actionError.d.ts +6 -0
- package/lib/chevre/repo/action/unknown2actionError.js +15 -0
- package/lib/chevre/repo/action/update.d.ts +48 -0
- package/lib/chevre/repo/action/update.js +166 -0
- package/lib/chevre/repo/action/use.d.ts +39 -0
- package/lib/chevre/repo/action/use.js +153 -0
- package/lib/chevre/repo/{action.d.ts → adminAction.d.ts} +11 -37
- package/lib/chevre/repo/adminAction.js +176 -0
- package/lib/chevre/repo/adminAssetTransaction.d.ts +126 -0
- package/lib/chevre/repo/adminAssetTransaction.js +491 -0
- package/lib/chevre/repo/adminScheduledTask.d.ts +1 -1
- package/lib/chevre/repo/adminTask.d.ts +25 -8
- package/lib/chevre/repo/adminTask.js +31 -32
- package/lib/chevre/repo/adminTransaction.d.ts +131 -0
- package/lib/chevre/repo/adminTransaction.js +237 -0
- package/lib/chevre/repo/aggregateAction.d.ts +8 -11
- package/lib/chevre/repo/aggregateAction.js +0 -61
- package/lib/chevre/repo/aggregateAssetTransaction.d.ts +43 -0
- package/lib/chevre/repo/aggregateAssetTransaction.js +166 -0
- package/lib/chevre/repo/aggregateTransaction.d.ts +39 -0
- package/lib/chevre/repo/aggregateTransaction.js +166 -0
- package/lib/chevre/repo/aggregateUseAction.d.ts +35 -0
- package/lib/chevre/repo/aggregateUseAction.js +164 -0
- package/lib/chevre/repo/aggregation.d.ts +0 -8
- package/lib/chevre/repo/aggregation.js +0 -10
- package/lib/chevre/repo/assetTransaction.d.ts +10 -235
- package/lib/chevre/repo/assetTransaction.js +48 -636
- package/lib/chevre/repo/authorization.d.ts +0 -6
- package/lib/chevre/repo/authorization.js +15 -27
- package/lib/chevre/repo/message.d.ts +0 -7
- package/lib/chevre/repo/message.js +0 -38
- package/lib/chevre/repo/migrateAction.d.ts +48 -0
- package/lib/chevre/repo/migrateAction.js +32 -0
- package/lib/chevre/repo/mongoose/schemas/action/inform.d.ts +11 -0
- package/lib/chevre/repo/mongoose/schemas/action/inform.js +82 -0
- package/lib/chevre/repo/mongoose/schemas/action/update.d.ts +12 -0
- package/lib/chevre/repo/mongoose/schemas/action/update.js +112 -0
- package/lib/chevre/repo/mongoose/schemas/{ownershipInfo.d.ts → action/use.d.ts} +4 -6
- package/lib/chevre/repo/mongoose/schemas/action/use.js +92 -0
- package/lib/chevre/repo/mongoose/schemas/action.d.ts +1 -3
- package/lib/chevre/repo/mongoose/schemas/action.js +22 -7
- package/lib/chevre/repo/mongoose/schemas/actionRecipe.d.ts +1 -0
- package/lib/chevre/repo/mongoose/schemas/actionRecipe.js +19 -1
- package/lib/chevre/repo/mongoose/schemas/aggregateReservation.js +8 -9
- package/lib/chevre/repo/mongoose/schemas/aggregation.js +8 -1
- package/lib/chevre/repo/mongoose/schemas/assetTransaction.js +95 -76
- package/lib/chevre/repo/mongoose/schemas/authorization.js +25 -18
- package/lib/chevre/repo/mongoose/schemas/event.js +7 -0
- package/lib/chevre/repo/mongoose/schemas/eventOffer.js +7 -0
- package/lib/chevre/repo/mongoose/schemas/message.js +8 -1
- package/lib/chevre/repo/mongoose/schemas/pendingReservation.js +11 -4
- package/lib/chevre/repo/mongoose/schemas/setting.d.ts +5 -16
- package/lib/chevre/repo/mongoose/schemas/task.d.ts +2 -5
- package/lib/chevre/repo/mongoose/schemas/task.js +134 -118
- package/lib/chevre/repo/mongoose/schemas/ticket.js +8 -1
- package/lib/chevre/repo/orderInTransaction.d.ts +0 -3
- package/lib/chevre/repo/orderInTransaction.js +30 -22
- package/lib/chevre/repo/scheduledTask.d.ts +4 -1
- package/lib/chevre/repo/scheduledTask.js +3 -25
- package/lib/chevre/repo/task.d.ts +44 -155
- package/lib/chevre/repo/task.js +13 -555
- package/lib/chevre/repo/taskDelayed.d.ts +74 -0
- package/lib/chevre/repo/taskDelayed.js +195 -0
- package/lib/chevre/repo/taskRunning.d.ts +35 -0
- package/lib/chevre/repo/taskRunning.js +89 -0
- package/lib/chevre/repo/ticket.d.ts +0 -6
- package/lib/chevre/repo/ticket.js +0 -11
- package/lib/chevre/repo/transaction.d.ts +1 -187
- package/lib/chevre/repo/transaction.js +2 -383
- package/lib/chevre/repository.d.ts +65 -25
- package/lib/chevre/repository.js +144 -56
- package/lib/chevre/service/aggregation/system.d.ts +9 -8
- package/lib/chevre/service/aggregation/system.js +5 -5
- package/lib/chevre/service/assetTransaction/cancelReservation/start.js +10 -17
- package/lib/chevre/service/assetTransaction/pay/confirm.d.ts +0 -10
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorize.d.ts +0 -1
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeMovieTicket.d.ts +0 -1
- package/lib/chevre/service/assetTransaction/pay/start.d.ts +0 -1
- package/lib/chevre/service/assetTransaction/refund.d.ts +0 -1
- package/lib/chevre/service/assetTransaction/refund.js +2 -2
- package/lib/chevre/service/assetTransaction/reserve/cancel.d.ts +4 -2
- package/lib/chevre/service/assetTransaction/reserve/confirm.d.ts +4 -2
- package/lib/chevre/service/assetTransaction/reserveCOA/cancel.d.ts +8 -4
- package/lib/chevre/service/assetTransaction/reserveCOA/cancel.js +1 -1
- package/lib/chevre/service/asyncAction.d.ts +2 -2
- package/lib/chevre/service/asyncAction.js +1 -4
- package/lib/chevre/service/asyncActionHandler/onOperationFailed.d.ts +2 -2
- package/lib/chevre/service/asyncActionHandler/onOperationFailed.js +0 -2
- package/lib/chevre/service/asyncActionHandler.d.ts +4 -4
- package/lib/chevre/service/asyncActionHandler.js +11 -13
- package/lib/chevre/service/event/processUpdateMovieTheater.d.ts +4 -2
- package/lib/chevre/service/event/processUpdateMovieTheater.js +3 -3
- package/lib/chevre/service/event.d.ts +4 -2
- package/lib/chevre/service/event.js +3 -3
- package/lib/chevre/service/notification/sendEmailMessage.d.ts +4 -2
- package/lib/chevre/service/notification/sendEmailMessage.js +3 -3
- package/lib/chevre/service/notification/triggerWebhook.d.ts +4 -2
- package/lib/chevre/service/notification/triggerWebhook.js +5 -16
- package/lib/chevre/service/offer/event/authorize.d.ts +0 -1
- package/lib/chevre/service/offer/event/issueEventOfferTicket.d.ts +0 -1
- package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.d.ts +4 -2
- package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.js +1 -3
- package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4coa.d.ts +9 -5
- package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4coa.js +1 -1
- package/lib/chevre/service/offer/event/voidTransaction.d.ts +6 -4
- package/lib/chevre/service/offer/event/voidTransaction.js +7 -9
- package/lib/chevre/service/offer/event/voidTransactionByActionId.d.ts +6 -4
- package/lib/chevre/service/offer/event/voidTransactionByActionId.js +3 -15
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.d.ts +0 -4
- package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.js +19 -19
- package/lib/chevre/service/offer/onEventChanged.js +0 -2
- package/lib/chevre/service/order/confirmPayTransaction.d.ts +4 -10
- package/lib/chevre/service/order/confirmPayTransaction.js +7 -11
- package/lib/chevre/service/order/createAccountingReportIfNotExist.d.ts +1 -1
- package/lib/chevre/service/order/createAccountingReportIfNotExist.js +2 -56
- package/lib/chevre/service/order/deleteOrder.d.ts +2 -2
- package/lib/chevre/service/order/deleteOrder.js +1 -2
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/isDeliverable.js +1 -49
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.js +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered/factory.js +2 -4
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.js +2 -4
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.js +1 -9
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.d.ts +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.js +4 -8
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/processOrder.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.js +5 -11
- package/lib/chevre/service/order/onOrderUpdated/factory.js +0 -3
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.d.ts +4 -2
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +2 -2
- package/lib/chevre/service/order/placeOrder.d.ts +6 -4
- package/lib/chevre/service/order/placeOrder.js +9 -17
- package/lib/chevre/service/order/returnOrder.d.ts +4 -4
- package/lib/chevre/service/order/returnOrder.js +11 -43
- package/lib/chevre/service/order/sendOrder.d.ts +4 -6
- package/lib/chevre/service/order/sendOrder.js +30 -72
- package/lib/chevre/service/payment/any/authorize/fixTransactionNumber.d.ts +0 -1
- package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.d.ts +0 -1
- package/lib/chevre/service/payment/any/authorize.d.ts +0 -1
- package/lib/chevre/service/payment/any/findAcceptAction.d.ts +0 -4
- package/lib/chevre/service/payment/any/findAcceptAction.js +19 -19
- package/lib/chevre/service/payment/any/findAuthorizeAction.d.ts +0 -4
- package/lib/chevre/service/payment/any/findAuthorizeAction.js +19 -19
- package/lib/chevre/service/payment/any/findCheckAction.d.ts +0 -4
- package/lib/chevre/service/payment/any/findCheckAction.js +19 -19
- package/lib/chevre/service/payment/any/invalidatePaymentUrl.d.ts +0 -1
- package/lib/chevre/service/payment/any/onPayActionCompleted.d.ts +0 -1
- package/lib/chevre/service/payment/any/onPaymentStatusChanged.js +2 -2
- package/lib/chevre/service/payment/any/onRefundActionCompletedOrFailed.d.ts +0 -1
- package/lib/chevre/service/payment/any/processVoidPayTransaction.d.ts +0 -1
- package/lib/chevre/service/payment/any/processVoidPayTransaction.js +2 -2
- package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +0 -2
- package/lib/chevre/service/payment/any/publishPaymentUrl.js +2 -2
- package/lib/chevre/service/payment/any/voidPayTransaction.d.ts +0 -1
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.d.ts +0 -1
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard3ds.d.ts +0 -1
- package/lib/chevre/service/payment/creditCard/authorize.d.ts +0 -1
- package/lib/chevre/service/payment/creditCard/payCreditCard.d.ts +0 -1
- package/lib/chevre/service/payment/creditCard/refundCreditCard.d.ts +0 -1
- package/lib/chevre/service/payment/faceToFace.d.ts +0 -2
- package/lib/chevre/service/payment/movieTicket/authorize.d.ts +0 -1
- package/lib/chevre/service/payment/movieTicket/payMovieTicket.d.ts +0 -1
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket.d.ts +0 -1
- package/lib/chevre/service/project.d.ts +0 -6
- package/lib/chevre/service/project.js +0 -2
- package/lib/chevre/service/reserve/cancelReservation.d.ts +7 -3
- package/lib/chevre/service/reserve/cancelReservation.js +15 -25
- package/lib/chevre/service/reserve/checkInReservation.d.ts +4 -2
- package/lib/chevre/service/reserve/checkInReservation.js +2 -2
- package/lib/chevre/service/reserve/confirmReservation.d.ts +4 -2
- package/lib/chevre/service/reserve/confirmReservation.js +10 -36
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +1 -1
- package/lib/chevre/service/reserve/useReservation.d.ts +6 -2
- package/lib/chevre/service/reserve/useReservation.js +6 -24
- package/lib/chevre/service/reserveCOA/cancelReservation.d.ts +4 -2
- package/lib/chevre/service/reserveCOA/cancelReservation.js +3 -3
- package/lib/chevre/service/scheduledTask.d.ts +1 -4
- package/lib/chevre/service/scheduledTask.js +3 -10
- package/lib/chevre/service/scheduledTaskHandler/onOperationFailed.js +1 -2
- package/lib/chevre/service/scheduledTaskHandler.js +0 -13
- package/lib/chevre/service/task/acceptCOAOffer.js +1 -14
- package/lib/chevre/service/task/authorizePayment.js +1 -7
- package/lib/chevre/service/task/cancelPendingReservation.js +3 -4
- package/lib/chevre/service/task/cancelReservation.js +3 -5
- package/lib/chevre/service/task/checkMovieTicket.js +1 -7
- package/lib/chevre/service/task/checkResource.js +14 -57
- package/lib/chevre/service/task/confirmPayTransaction.js +11 -12
- package/lib/chevre/service/task/confirmReserveTransaction.d.ts +6 -2
- package/lib/chevre/service/task/confirmReserveTransaction.js +12 -7
- package/lib/chevre/service/task/createAccountingReport.js +8 -15
- package/lib/chevre/service/task/deleteTransaction.js +10 -41
- package/lib/chevre/service/task/importEventsFromCOA.js +4 -2
- package/lib/chevre/service/task/invalidatePaymentUrl.js +0 -1
- package/lib/chevre/service/task/onAuthorizationCreated.js +4 -13
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByAggregateOffer.d.ts +4 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByAggregateOffer.js +4 -4
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByEventSeries.d.ts +4 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByEventSeries.js +4 -4
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByMovieTheater.d.ts +4 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByMovieTheater.js +4 -4
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByOfferCatalog.d.ts +4 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByOfferCatalog.js +4 -4
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByProduct.d.ts +4 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByProduct.js +4 -4
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByRoom.d.ts +4 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByRoom.js +4 -4
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.d.ts +4 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.js +4 -4
- package/lib/chevre/service/task/onResourceDeleted.js +4 -3
- package/lib/chevre/service/task/onResourceUpdated/onAggregateOfferUpdated.js +0 -1
- package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +0 -1
- package/lib/chevre/service/task/onResourceUpdated/onOfferCatalogUpdated.js +0 -1
- package/lib/chevre/service/task/onResourceUpdated.js +0 -10
- package/lib/chevre/service/task/pay.js +0 -1
- package/lib/chevre/service/task/payment/invalidatePaymentUrlByTask.d.ts +0 -1
- package/lib/chevre/service/task/payment/payByTask.d.ts +0 -1
- package/lib/chevre/service/task/payment/refundByTask.d.ts +0 -1
- package/lib/chevre/service/task/payment/voidPaymentByTask.d.ts +0 -2
- package/lib/chevre/service/task/placeOrder.js +8 -6
- package/lib/chevre/service/task/publishPaymentUrl.js +2 -13
- package/lib/chevre/service/task/refund.js +0 -1
- package/lib/chevre/service/task/reserve.js +3 -6
- package/lib/chevre/service/task/returnOrder.js +3 -7
- package/lib/chevre/service/task/returnPayTransaction.js +9 -19
- package/lib/chevre/service/task/returnReserveTransaction.js +5 -6
- package/lib/chevre/service/task/sendEmailMessage.js +2 -2
- package/lib/chevre/service/task/sendOrder.js +4 -8
- package/lib/chevre/service/task/syncResourcesFromCOA.js +31 -23
- package/lib/chevre/service/task/triggerWebhook.js +4 -2
- package/lib/chevre/service/task/useReservation.js +6 -2
- package/lib/chevre/service/task/voidPayment.js +0 -2
- package/lib/chevre/service/task/voidReserveTransaction.js +11 -13
- package/lib/chevre/service/task.d.ts +4 -4
- package/lib/chevre/service/task.js +8 -12
- package/lib/chevre/service/taskHandler/onOperationFailed/informTaskIfNeeded.js +0 -1
- package/lib/chevre/service/taskHandler/onOperationFailed.d.ts +3 -2
- package/lib/chevre/service/taskHandler/onOperationFailed.js +5 -16
- package/lib/chevre/service/taskHandler.d.ts +1 -2
- package/lib/chevre/service/taskHandler.js +7 -19
- package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.js +2 -2
- package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.js +2 -2
- package/lib/chevre/service/transaction/deleteTransaction.d.ts +8 -4
- package/lib/chevre/service/transaction/deleteTransaction.js +7 -7
- package/lib/chevre/service/transaction/placeOrder/confirm.js +1 -1
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +11 -17
- package/lib/chevre/service/transaction/returnOrder.js +11 -17
- package/lib/chevre/service/validation/validateOrder.d.ts +0 -4
- package/lib/chevre/service/validation/validateOrder.js +3 -3
- package/lib/chevre/taskSettings.d.ts +4 -4
- package/package.json +2 -2
- package/lib/chevre/repo/action/actionProcess.d.ts +0 -147
- package/lib/chevre/repo/action/checkThing.d.ts +0 -8
- package/lib/chevre/repo/action/checkThing.js +0 -13
- package/lib/chevre/repo/action.js +0 -468
- package/lib/chevre/repo/asyncActionLegacy.d.ts +0 -23
- package/lib/chevre/repo/asyncActionLegacy.js +0 -59
- package/lib/chevre/repo/mongoose/schemas/ownershipInfo.js +0 -227
- package/lib/chevre/repo/mongoose/schemas/pendingReservationAggregate.d.ts +0 -25
- package/lib/chevre/repo/mongoose/schemas/pendingReservationAggregate.js +0 -100
- package/lib/chevre/repo/ownershipInfo.d.ts +0 -122
- package/lib/chevre/repo/ownershipInfo.js +0 -466
- package/lib/chevre/repo/scheduledTaskLegacy.d.ts +0 -39
- package/lib/chevre/repo/scheduledTaskLegacy.js +0 -96
- package/lib/chevre/repo/scheduledTaskMigration.d.ts +0 -21
- package/lib/chevre/repo/scheduledTaskMigration.js +0 -70
- package/lib/chevre/service/validation/validateEvent.d.ts +0 -11
- package/lib/chevre/service/validation/validateEvent.js +0 -21
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { factory } from '../../factory';
|
|
2
|
-
import type {
|
|
3
|
-
import type { AccountingReportRepo } from '../../repo/accountingReport';
|
|
4
|
-
import type { ActionRepo } from '../../repo/action';
|
|
2
|
+
import type { ConfirmActionRepo } from '../../repo/action/confirm';
|
|
5
3
|
import type { AssetTransactionRepo } from '../../repo/assetTransaction';
|
|
6
|
-
import type { EventRepo } from '../../repo/event';
|
|
7
4
|
import type { OrderRepo } from '../../repo/order';
|
|
8
|
-
import type { ProjectRepo } from '../../repo/project';
|
|
9
5
|
import type { TaskRepo } from '../../repo/task';
|
|
10
6
|
declare function confirmPayTransaction(data: factory.task.IData<factory.taskName.ConfirmPayTransaction> & {
|
|
11
7
|
project: {
|
|
@@ -13,13 +9,11 @@ declare function confirmPayTransaction(data: factory.task.IData<factory.taskName
|
|
|
13
9
|
typeOf: factory.organizationType.Project;
|
|
14
10
|
};
|
|
15
11
|
}, options: Record<string, never>): (repos: {
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
actions: {
|
|
13
|
+
confirm: ConfirmActionRepo;
|
|
14
|
+
};
|
|
18
15
|
assetTransaction: AssetTransactionRepo;
|
|
19
16
|
order: OrderRepo;
|
|
20
|
-
accountingReport: AccountingReportRepo;
|
|
21
|
-
event: EventRepo;
|
|
22
|
-
project: ProjectRepo;
|
|
23
17
|
task: TaskRepo;
|
|
24
18
|
}) => Promise<void>;
|
|
25
19
|
export { confirmPayTransaction };
|
|
@@ -34,13 +34,13 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.confirmPayTransaction = confirmPayTransaction;
|
|
37
|
+
const util_1 = require("util");
|
|
37
38
|
const factory_1 = require("../../factory");
|
|
38
|
-
// import type { TransactionRepo } from '../../repo/transaction';
|
|
39
39
|
const PayTransactionService = __importStar(require("../assetTransaction/pay"));
|
|
40
40
|
function confirmPayTransaction(data, options) {
|
|
41
41
|
return async (repos) => {
|
|
42
42
|
// アクション開始
|
|
43
|
-
const action = await repos.
|
|
43
|
+
const action = await repos.actions.confirm.start(data);
|
|
44
44
|
try {
|
|
45
45
|
for (const confirmingTransaction of data.object) {
|
|
46
46
|
await PayTransactionService.confirm({
|
|
@@ -60,20 +60,14 @@ function confirmPayTransaction(data, options) {
|
|
|
60
60
|
? { object: { paymentMethod: { identifier: confirmingTransaction.object.paymentMethod.identifier } } }
|
|
61
61
|
: undefined
|
|
62
62
|
})({
|
|
63
|
-
acceptedOffer: repos.acceptedOffer,
|
|
64
|
-
action: repos.action,
|
|
65
|
-
accountingReport: repos.accountingReport,
|
|
66
63
|
assetTransaction: repos.assetTransaction,
|
|
67
|
-
event: repos.event,
|
|
68
64
|
order: repos.order,
|
|
69
|
-
// project: repos.project,
|
|
70
|
-
task: repos.task
|
|
71
65
|
});
|
|
72
66
|
}
|
|
73
67
|
}
|
|
74
68
|
catch (error) {
|
|
75
69
|
try {
|
|
76
|
-
await repos.
|
|
70
|
+
await repos.actions.confirm.giveUp({ typeOf: action.typeOf, id: action.id, error });
|
|
77
71
|
}
|
|
78
72
|
catch (__) {
|
|
79
73
|
// 失敗したら仕方ない
|
|
@@ -82,7 +76,7 @@ function confirmPayTransaction(data, options) {
|
|
|
82
76
|
}
|
|
83
77
|
// アクション完了
|
|
84
78
|
const actionResult = {};
|
|
85
|
-
await repos.
|
|
79
|
+
await repos.actions.confirm.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: actionResult });
|
|
86
80
|
// processOrder連携(2023-08-23~)
|
|
87
81
|
await onConfirmed(data)({
|
|
88
82
|
task: repos.task
|
|
@@ -112,7 +106,9 @@ function onConfirmed(params) {
|
|
|
112
106
|
},
|
|
113
107
|
useOnOrderStatusChanged: params.useOnOrderStatusChanged === true
|
|
114
108
|
};
|
|
109
|
+
const taskIdentifier = (0, util_1.format)('%s:%s:%s:%s', params.project.id, factory_1.factory.taskName.OnAssetTransactionStatusChanged, onAssetTransactionStatusChangedTaskData.purpose.orderNumber, onAssetTransactionStatusChangedTaskData.object.transactionNumber);
|
|
115
110
|
const onAssetTransactionStatusChangedTask = {
|
|
111
|
+
identifier: taskIdentifier,
|
|
116
112
|
project: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project },
|
|
117
113
|
name: factory_1.factory.taskName.OnAssetTransactionStatusChanged,
|
|
118
114
|
status: factory_1.factory.taskStatus.Ready,
|
|
@@ -122,7 +118,7 @@ function onConfirmed(params) {
|
|
|
122
118
|
executionResults: [],
|
|
123
119
|
data: onAssetTransactionStatusChangedTaskData
|
|
124
120
|
};
|
|
125
|
-
await repos.task.
|
|
121
|
+
await repos.task.runTaskByIdentifier(onAssetTransactionStatusChangedTask);
|
|
126
122
|
}
|
|
127
123
|
}
|
|
128
124
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AccountingReportRepo } from '../../repo/accountingReport';
|
|
2
2
|
import { factory } from '../../factory';
|
|
3
|
-
export declare function createAccountingReportIfNotExist(params: Pick<factory.order.IOrder, 'id' | 'orderNumber' | 'project' | 'paymentMethods' | 'seller' | 'typeOf' | 'orderDate'>
|
|
3
|
+
export declare function createAccountingReportIfNotExist(params: Pick<factory.order.IOrder, 'id' | 'orderNumber' | 'project' | 'paymentMethods' | 'seller' | 'typeOf' | 'orderDate'>): (repos: {
|
|
4
4
|
accountingReport: AccountingReportRepo;
|
|
5
5
|
}) => Promise<void>;
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.createAccountingReportIfNotExist = createAccountingReportIfNotExist;
|
|
7
|
-
const
|
|
7
|
+
const moment_1 = __importDefault(require("moment"));
|
|
8
8
|
const factory_1 = require("../../factory");
|
|
9
9
|
function createAccountingReportIfNotExist(params) {
|
|
10
10
|
return async (repos) => {
|
|
@@ -17,61 +17,7 @@ function createAccountingReportIfNotExist(params) {
|
|
|
17
17
|
await repos.accountingReport.syncMainEntity(accountingReport);
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
// 最適化(2023-06-30~)
|
|
21
20
|
function createOrder4report(params) {
|
|
22
|
-
// if (!Array.isArray(params.acceptedOffers)) {
|
|
23
|
-
// throw new factory.errors.ArgumentNull('order.acceptedOffers');
|
|
24
|
-
// }
|
|
25
|
-
// const numItems: number = params.acceptedOffers.length;
|
|
26
|
-
// // 必要な属性についてDate型に変換(でないと検索クエリを効率的に使えない)
|
|
27
|
-
// const acceptedOffers = (Array.isArray(params.acceptedOffers))
|
|
28
|
-
// ? params.acceptedOffers.map((o) => {
|
|
29
|
-
// if (o.itemOffered.typeOf === factory.reservationType.EventReservation) {
|
|
30
|
-
// let itemOffered = o.itemOffered;
|
|
31
|
-
// const reservationFor = itemOffered.reservationFor;
|
|
32
|
-
// itemOffered = {
|
|
33
|
-
// ...itemOffered,
|
|
34
|
-
// reservationFor: {
|
|
35
|
-
// ...reservationFor,
|
|
36
|
-
// ...(reservationFor.doorTime !== undefined)
|
|
37
|
-
// ? {
|
|
38
|
-
// doorTime: moment(reservationFor.doorTime)
|
|
39
|
-
// .toDate()
|
|
40
|
-
// }
|
|
41
|
-
// : undefined,
|
|
42
|
-
// ...(reservationFor.endDate !== undefined)
|
|
43
|
-
// ? {
|
|
44
|
-
// endDate: moment(reservationFor.endDate)
|
|
45
|
-
// .toDate()
|
|
46
|
-
// }
|
|
47
|
-
// : undefined,
|
|
48
|
-
// ...(reservationFor.startDate !== undefined)
|
|
49
|
-
// ? {
|
|
50
|
-
// startDate: moment(reservationFor.startDate)
|
|
51
|
-
// .toDate()
|
|
52
|
-
// }
|
|
53
|
-
// : undefined
|
|
54
|
-
// }
|
|
55
|
-
// } as factory.order.IReservation;
|
|
56
|
-
// return {
|
|
57
|
-
// ...o,
|
|
58
|
-
// itemOffered
|
|
59
|
-
// };
|
|
60
|
-
// } else {
|
|
61
|
-
// return o;
|
|
62
|
-
// }
|
|
63
|
-
// })
|
|
64
|
-
// : [];
|
|
65
|
-
// const customer: factory.report.accountingReport.IOptimizedCustomer = {
|
|
66
|
-
// id: params.customer.id,
|
|
67
|
-
// typeOf: params.customer.typeOf,
|
|
68
|
-
// additionalProperty: (Array.isArray(params.customer.additionalProperty))
|
|
69
|
-
// ? params.customer.additionalProperty
|
|
70
|
-
// : [],
|
|
71
|
-
// identifier: (Array.isArray(params.customer.identifier))
|
|
72
|
-
// ? params.customer.identifier
|
|
73
|
-
// : []
|
|
74
|
-
// };
|
|
75
21
|
return {
|
|
76
22
|
id: params.id,
|
|
77
23
|
orderNumber: params.orderNumber,
|
|
@@ -82,7 +28,7 @@ function createOrder4report(params) {
|
|
|
82
28
|
typeOf: params.seller.typeOf
|
|
83
29
|
},
|
|
84
30
|
typeOf: params.typeOf,
|
|
85
|
-
orderDate: (0,
|
|
31
|
+
orderDate: (0, moment_1.default)(params.orderDate)
|
|
86
32
|
.toDate(),
|
|
87
33
|
// confirmationNumber: params.confirmationNumber, // discontinue(2026-05-06~)
|
|
88
34
|
// price: params.price, // discontinue(2026-05-06~)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AcceptedOfferRepo } from '../../repo/acceptedOffer';
|
|
2
2
|
import type { AccountingReportRepo } from '../../repo/accountingReport';
|
|
3
|
-
import type { IDeleteActionResult,
|
|
3
|
+
import type { IDeleteActionResult, AdminActionRepo } from '../../repo/adminAction';
|
|
4
4
|
import type { NoteRepo } from '../../repo/note';
|
|
5
5
|
import type { OrderRepo } from '../../repo/order';
|
|
6
6
|
import type { ReservationRepo } from '../../repo/reservation';
|
|
@@ -18,7 +18,7 @@ declare function deleteOrder(params: {
|
|
|
18
18
|
}): (repos: {
|
|
19
19
|
acceptedOffer: AcceptedOfferRepo;
|
|
20
20
|
accountingReport: AccountingReportRepo;
|
|
21
|
-
|
|
21
|
+
adminAction: AdminActionRepo;
|
|
22
22
|
note: NoteRepo;
|
|
23
23
|
order: OrderRepo;
|
|
24
24
|
reservation: ReservationRepo;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.deleteOrder = deleteOrder;
|
|
4
|
-
// import { createOwnershipInfosFromOrder } from '../delivery/factory';
|
|
5
4
|
const factory_1 = require("../../factory");
|
|
6
5
|
/**
|
|
7
6
|
* 注文に関わるリソースを削除する
|
|
@@ -45,7 +44,7 @@ function deleteOrder(params) {
|
|
|
45
44
|
}
|
|
46
45
|
});
|
|
47
46
|
// アクション削除(2026-07-10~)
|
|
48
|
-
deleteActionsResult = await repos.
|
|
47
|
+
deleteActionsResult = await repos.adminAction.deleteActionsByOrderNumber({
|
|
49
48
|
orderNumber: order.orderNumber,
|
|
50
49
|
project: { id: order.project.id },
|
|
51
50
|
});
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// import createDebug from 'debug';
|
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
3
|
exports.isDeliverable = isDeliverable;
|
|
5
4
|
const factory_1 = require("../../../factory");
|
|
6
|
-
// const debug = createDebug('chevre-domain:service:order');
|
|
7
5
|
function isDeliverable(params) {
|
|
8
6
|
return async (repos) => {
|
|
9
7
|
let allReserveTransactionConfirmed = false;
|
|
@@ -15,7 +13,7 @@ function isDeliverable(params) {
|
|
|
15
13
|
// 注文のreservationNumberを取得
|
|
16
14
|
const reservationNumbers = await repos.acceptedOffer.distinctValues({ orderNumber: { $in: [params.orderNumber] } }, 'acceptedOffers.itemOffered.reservationNumber');
|
|
17
15
|
if (reservationNumbers.length > 0) {
|
|
18
|
-
const referencedReserveTransactions = await repos.assetTransaction.
|
|
16
|
+
const referencedReserveTransactions = await repos.assetTransaction.findAssetTransactionsByTypeOf({
|
|
19
17
|
project: { id: { $eq: params.project.id } },
|
|
20
18
|
typeOf: factory_1.factory.assetTransactionType.Reserve,
|
|
21
19
|
transactionNumber: { $in: reservationNumbers }
|
|
@@ -27,52 +25,6 @@ function isDeliverable(params) {
|
|
|
27
25
|
else {
|
|
28
26
|
allReserveTransactionConfirmed = true;
|
|
29
27
|
}
|
|
30
|
-
// } else if (params.assetTransactionType === factory.assetTransactionType.MoneyTransfer) {
|
|
31
|
-
// allReserveTransactionConfirmed = true;
|
|
32
|
-
// allRegisterServiceTransactionConfirmed = true;
|
|
33
|
-
// // 注文のMoneyTransferTransaction.transactionNumberを取得
|
|
34
|
-
// const moneyTransferTransactionNumbers = await repos.acceptedOffer.distinctValues(
|
|
35
|
-
// { orderNumber: { $in: [params.orderNumber] } },
|
|
36
|
-
// 'acceptedOffers.serialNumber'
|
|
37
|
-
// );
|
|
38
|
-
// if (moneyTransferTransactionNumbers.length > 0) {
|
|
39
|
-
// debug('is deliverable?...', params.orderNumber, 'moneyTransferTransactionNumbers:', moneyTransferTransactionNumbers);
|
|
40
|
-
// const referencedMoneyTransferTransactions = await repos.assetTransaction.search(
|
|
41
|
-
// {
|
|
42
|
-
// project: { id: { $eq: params.project.id } },
|
|
43
|
-
// typeOf: factory.assetTransactionType.MoneyTransfer,
|
|
44
|
-
// transactionNumber: { $in: moneyTransferTransactionNumbers }
|
|
45
|
-
// },
|
|
46
|
-
// ['status']
|
|
47
|
-
// ) as Pick<factory.assetTransaction.moneyTransfer.ITransaction, 'status'>[];
|
|
48
|
-
// allMoneyTransferTransactionConfirmed =
|
|
49
|
-
// referencedMoneyTransferTransactions.length === moneyTransferTransactionNumbers.length
|
|
50
|
-
// && referencedMoneyTransferTransactions.every(({ status }) => status === factory.transactionStatusType.Confirmed);
|
|
51
|
-
// } else {
|
|
52
|
-
// allMoneyTransferTransactionConfirmed = true;
|
|
53
|
-
// }
|
|
54
|
-
// } else if (params.assetTransactionType === factory.assetTransactionType.RegisterService) {
|
|
55
|
-
// allReserveTransactionConfirmed = true;
|
|
56
|
-
// allMoneyTransferTransactionConfirmed = true;
|
|
57
|
-
// const registerServiceTransactionNumbers = await repos.acceptedOffer.distinctValues(
|
|
58
|
-
// { orderNumber: { $in: [params.orderNumber] } },
|
|
59
|
-
// 'acceptedOffers.serialNumber'
|
|
60
|
-
// );
|
|
61
|
-
// if (registerServiceTransactionNumbers.length > 0) {
|
|
62
|
-
// const referencedRegisterServiceTransactions = await repos.assetTransaction.search(
|
|
63
|
-
// {
|
|
64
|
-
// project: { id: { $eq: params.project.id } },
|
|
65
|
-
// typeOf: factory.assetTransactionType.RegisterService,
|
|
66
|
-
// transactionNumber: { $in: registerServiceTransactionNumbers }
|
|
67
|
-
// },
|
|
68
|
-
// ['status']
|
|
69
|
-
// ) as Pick<factory.assetTransaction.registerService.ITransaction, 'status'>[];
|
|
70
|
-
// allRegisterServiceTransactionConfirmed =
|
|
71
|
-
// referencedRegisterServiceTransactions.length === registerServiceTransactionNumbers.length
|
|
72
|
-
// && referencedRegisterServiceTransactions.every(({ status }) => status === factory.transactionStatusType.Confirmed);
|
|
73
|
-
// } else {
|
|
74
|
-
// allRegisterServiceTransactionConfirmed = true;
|
|
75
|
-
// }
|
|
76
28
|
}
|
|
77
29
|
return allReserveTransactionConfirmed && allMoneyTransferTransactionConfirmed && allRegisterServiceTransactionConfirmed;
|
|
78
30
|
};
|
package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.js
CHANGED
|
@@ -36,7 +36,7 @@ function onPayTransactionConfirmed(params) {
|
|
|
36
36
|
}
|
|
37
37
|
function fixPaymentMethodIdentifierIfPossible(params) {
|
|
38
38
|
return async (repos) => {
|
|
39
|
-
const referencedPayTransactions = await repos.assetTransaction.
|
|
39
|
+
const referencedPayTransactions = await repos.assetTransaction.findAssetTransactionsByTypeOf({
|
|
40
40
|
project: { id: { $eq: params.project.id } },
|
|
41
41
|
typeOf: factory_1.factory.assetTransactionType.Pay,
|
|
42
42
|
statuses: [factory_1.factory.transactionStatusType.Confirmed],
|
|
@@ -73,7 +73,7 @@ function isProcessable(params) {
|
|
|
73
73
|
const paymentMethodIds = order.paymentMethods.filter((invoice) => typeof invoice.paymentMethodId === 'string' && invoice.paymentMethodId.length > 0)
|
|
74
74
|
.map((invoice) => invoice.paymentMethodId);
|
|
75
75
|
if (paymentMethodIds.length > 0) {
|
|
76
|
-
const referencedPayTransactions = await repos.assetTransaction.
|
|
76
|
+
const referencedPayTransactions = await repos.assetTransaction.findAssetTransactionsByTypeOf({
|
|
77
77
|
project: { id: { $eq: params.project.id } },
|
|
78
78
|
typeOf: factory_1.factory.assetTransactionType.Pay,
|
|
79
79
|
transactionNumber: { $in: paymentMethodIds }
|
|
@@ -12,16 +12,14 @@ setting) {
|
|
|
12
12
|
const order4inform = creteOrder4inform(order);
|
|
13
13
|
const informIdentifier = `${factory_1.factory.order.OrderType.Order}:${order4inform.orderNumber}:${order4inform.orderStatus}`;
|
|
14
14
|
if (Array.isArray(informOrder) && informOrder.length > 0) {
|
|
15
|
-
let recipientId = '';
|
|
16
|
-
recipientId = order.customer.id;
|
|
15
|
+
// let recipientId = '';
|
|
16
|
+
// recipientId = order.customer.id;
|
|
17
17
|
informOrder.forEach((informOrderParams) => {
|
|
18
18
|
if (typeof informOrderParams.recipient?.url === 'string') {
|
|
19
19
|
const informActionAttributes = {
|
|
20
20
|
about: { orderNumber: order.orderNumber, typeOf: factory_1.factory.order.OrderType.Order },
|
|
21
21
|
object: order4inform,
|
|
22
22
|
recipient: {
|
|
23
|
-
// url: informOrderParams.recipient.url, // discontinue(2025-02-13~)
|
|
24
|
-
id: recipientId,
|
|
25
23
|
name: informOrderParams.recipient?.name,
|
|
26
24
|
typeOf: factory_1.factory.creativeWorkType.WebApplication
|
|
27
25
|
},
|
|
@@ -25,16 +25,14 @@ setting) {
|
|
|
25
25
|
const order4inform = creteOrder4inform(order);
|
|
26
26
|
const informIdentifier = `${factory_1.factory.order.OrderType.Order}:${order4inform.orderNumber}:${order4inform.orderStatus}:${order.acceptedOffers.page}`;
|
|
27
27
|
if (Array.isArray(informOrder) && informOrder.length > 0) {
|
|
28
|
-
let recipientId = '';
|
|
29
|
-
recipientId = order.customer.id;
|
|
28
|
+
// let recipientId = '';
|
|
29
|
+
// recipientId = order.customer.id;
|
|
30
30
|
informOrder.forEach((informOrderParams) => {
|
|
31
31
|
if (typeof informOrderParams.recipient?.url === 'string') {
|
|
32
32
|
const informActionAttributes = {
|
|
33
33
|
about: { orderNumber: order.orderNumber, typeOf: factory_1.factory.order.OrderType.Order },
|
|
34
34
|
object: order4inform,
|
|
35
35
|
recipient: {
|
|
36
|
-
// url: informOrderParams.recipient.url, // discontinue(2025-02-13~)
|
|
37
|
-
id: recipientId,
|
|
38
36
|
name: informOrderParams.recipient?.name,
|
|
39
37
|
typeOf: factory_1.factory.creativeWorkType.WebApplication
|
|
40
38
|
},
|
|
@@ -62,7 +62,7 @@ function createSendOrderTaskIfNotExist(params) {
|
|
|
62
62
|
};
|
|
63
63
|
const taskIdentifier = `${sendOrderTaskData.project.id}:${factory_1.factory.taskName.SendOrder}:${sendOrderTaskData.object.typeOf}:${sendOrderTaskData.object.orderNumber}`;
|
|
64
64
|
const sendOrderTask = {
|
|
65
|
-
alternateName: taskIdentifier,
|
|
65
|
+
// alternateName: taskIdentifier,
|
|
66
66
|
identifier: taskIdentifier,
|
|
67
67
|
project: params.order.project,
|
|
68
68
|
name: factory_1.factory.taskName.SendOrder,
|
|
@@ -92,7 +92,7 @@ function createOnAuthorizationCreatedTask(order) {
|
|
|
92
92
|
const taskRunsAt = new Date();
|
|
93
93
|
const taskIdentifier = `${order.project.id}:${factory_1.factory.taskName.OnAuthorizationCreated}:${factory_1.factory.transactionType.PlaceOrder}:${placeOrderTransaction?.id}`;
|
|
94
94
|
const task = {
|
|
95
|
-
alternateName: taskIdentifier,
|
|
95
|
+
// alternateName: taskIdentifier,
|
|
96
96
|
identifier: taskIdentifier,
|
|
97
97
|
name: factory_1.factory.taskName.OnAuthorizationCreated,
|
|
98
98
|
status: factory_1.factory.taskStatus.Ready,
|
|
@@ -53,7 +53,7 @@ function createConfirmPayTransactionTasks(order, simpleOrder) {
|
|
|
53
53
|
};
|
|
54
54
|
const taskIdentifier = (0, util_1.format)('%s:%s:%s:%s:%s:%s', order.project.id, factory_1.factory.taskName.ConfirmPayTransaction, data.purpose.typeOf, data.purpose.orderNumber, factory_1.factory.assetTransactionType.Pay, invoice.paymentMethodId);
|
|
55
55
|
const confirmPayTransactionTask = {
|
|
56
|
-
alternateName: taskIdentifier,
|
|
56
|
+
// alternateName: taskIdentifier,
|
|
57
57
|
identifier: taskIdentifier,
|
|
58
58
|
project: order.project,
|
|
59
59
|
name: factory_1.factory.taskName.ConfirmPayTransaction,
|
|
@@ -1,13 +1,8 @@
|
|
|
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.createSendEmailMessageTaskIfNotExist = createSendEmailMessageTaskIfNotExist;
|
|
7
|
-
const debug_1 = __importDefault(require("debug"));
|
|
8
4
|
const util_1 = require("util");
|
|
9
5
|
const factory_1 = require("../../../../factory");
|
|
10
|
-
const debug = (0, debug_1.default)('chevre-domain:service:order');
|
|
11
6
|
function createSendEmailMessageTaskIfNotExist(params) {
|
|
12
7
|
return async (repos) => {
|
|
13
8
|
const sendEmailMessageActions = params.sendEmailMessage;
|
|
@@ -19,12 +14,10 @@ function createSendEmailMessageTaskIfNotExist(params) {
|
|
|
19
14
|
about: { identifier: { $eq: factory_1.factory.creativeWork.message.email.AboutIdentifier.OnOrderSent } },
|
|
20
15
|
mainEntity: { orderNumber: { $eq: params.order.orderNumber } }
|
|
21
16
|
}, ['identifier'])).shift();
|
|
22
|
-
debug('createSendEmailMessageTaskIfNotExist: message4order:', JSON.stringify(message4order));
|
|
23
17
|
if (typeof message4order?.identifier === 'string') {
|
|
24
18
|
// 取引のpotentialActionsが存在する間は、メッセージ識別子が想定通りか確認する
|
|
25
19
|
const messageIdentifierByTransaction = sendEmailMessageActions?.at(0)?.object.identifier;
|
|
26
20
|
if (typeof messageIdentifierByTransaction === 'string') {
|
|
27
|
-
debug('createSendEmailMessageTaskIfNotExist: identifier matched?', message4order.identifier, messageIdentifierByTransaction);
|
|
28
21
|
if (message4order.identifier !== messageIdentifierByTransaction) {
|
|
29
22
|
throw new factory_1.factory.errors.Internal(`message identifier not matched. ${message4order.identifier} ${messageIdentifierByTransaction}`);
|
|
30
23
|
}
|
|
@@ -44,11 +37,10 @@ function createSendEmailMessageTaskIfNotExist(params) {
|
|
|
44
37
|
typeOf: factory_1.factory.creativeWorkType.EmailMessage
|
|
45
38
|
},
|
|
46
39
|
agent: params.order.project,
|
|
47
|
-
recipient: { typeOf: params.order.customer.typeOf, id: params.order.customer.id },
|
|
48
40
|
purpose: simpleOrder
|
|
49
41
|
};
|
|
50
42
|
const sendEmailMessageTask = {
|
|
51
|
-
alternateName: taskIdentifier,
|
|
43
|
+
// alternateName: taskIdentifier,
|
|
52
44
|
identifier: taskIdentifier,
|
|
53
45
|
project: params.order.project,
|
|
54
46
|
name: factory_1.factory.taskName.SendEmailMessage,
|
|
@@ -5,8 +5,8 @@ type IProcessingOrder = Pick<factory.order.IOrder, 'id' | 'orderNumber' | 'broke
|
|
|
5
5
|
numAcceptedOffers: number;
|
|
6
6
|
orderStatus: factory.orderStatus.OrderProcessing;
|
|
7
7
|
};
|
|
8
|
-
type ICreatingCheckResourceTask = Pick<factory.task.checkResource.IAttributes, '
|
|
9
|
-
alternateName
|
|
8
|
+
type ICreatingCheckResourceTask = Pick<factory.task.checkResource.IAttributes, 'data' | 'executionResults' | 'identifier' | 'name' | 'numberOfTried' | 'project' | 'remainingNumberOfTries' | 'runsAt' | 'status'> & {
|
|
9
|
+
alternateName?: never;
|
|
10
10
|
identifier: string;
|
|
11
11
|
};
|
|
12
12
|
type ICreatingInformProcessingOrderTask = Pick<factory.task.IAttributes<factory.taskName.TriggerWebhook>, 'data' | 'executionResults' | 'name' | 'numberOfTried' | 'project' | 'remainingNumberOfTries' | 'runsAt' | 'status'>;
|
|
@@ -15,16 +15,14 @@ function createInformProcessingOrderTasks(order, setting) {
|
|
|
15
15
|
const order4inform = creteProcessingOrderAsNotification(order);
|
|
16
16
|
const informIdentifier = `${factory_1.factory.order.OrderType.Order}:${order4inform.orderNumber}:${order4inform.orderStatus}`;
|
|
17
17
|
if (Array.isArray(informOrder) && informOrder.length > 0) {
|
|
18
|
-
let recipientId = '';
|
|
19
|
-
recipientId = order.customer.id;
|
|
18
|
+
// let recipientId = '';
|
|
19
|
+
// recipientId = order.customer.id;
|
|
20
20
|
informOrder.forEach((informOrderParams) => {
|
|
21
21
|
if (typeof informOrderParams.recipient?.url === 'string') {
|
|
22
22
|
const informActionAttributes = {
|
|
23
23
|
about: { orderNumber: order.orderNumber, typeOf: factory_1.factory.order.OrderType.Order },
|
|
24
24
|
object: order4inform,
|
|
25
25
|
recipient: {
|
|
26
|
-
// url: informOrderParams.recipient.url, // discontinue(2025-02-13~)
|
|
27
|
-
id: recipientId,
|
|
28
26
|
name: informOrderParams.recipient?.name,
|
|
29
27
|
typeOf: factory_1.factory.creativeWorkType.WebApplication
|
|
30
28
|
},
|
|
@@ -136,13 +134,11 @@ function createCheckResourceTask(order) {
|
|
|
136
134
|
object: {
|
|
137
135
|
orderNumber: order.orderNumber,
|
|
138
136
|
typeOf: order.typeOf
|
|
139
|
-
}
|
|
140
|
-
// project: order.project,
|
|
141
|
-
typeOf: factory_1.factory.actionType.CheckAction
|
|
137
|
+
}
|
|
142
138
|
};
|
|
143
139
|
const taskIdentifier = (0, util_1.format)('%s:%s:%s:%s', order.project.id, factory_1.factory.taskName.CheckResource, order.typeOf, order.orderNumber);
|
|
144
140
|
return {
|
|
145
|
-
alternateName: taskIdentifier, // add identifier(2025-03-29~)
|
|
141
|
+
// alternateName: taskIdentifier, // add identifier(2025-03-29~)
|
|
146
142
|
identifier: taskIdentifier, // add identifier(2025-03-29~)
|
|
147
143
|
project: order.project,
|
|
148
144
|
name: factory_1.factory.taskName.CheckResource,
|
|
@@ -50,7 +50,7 @@ function createConfirmReserveTransactionTasksIfNotExist(order, simpleOrder, opti
|
|
|
50
50
|
};
|
|
51
51
|
const taskIdentifier = (0, util_1.format)('%s:%s:%s:%s:%s:%s', order.project.id, factory_1.factory.taskName.ConfirmReserveTransaction, data.purpose.typeOf, data.purpose.orderNumber, data.object.typeOf, data.object.transactionNumber);
|
|
52
52
|
const confirmReserveTransactionTask = {
|
|
53
|
-
alternateName: taskIdentifier,
|
|
53
|
+
// alternateName: taskIdentifier,
|
|
54
54
|
identifier: taskIdentifier,
|
|
55
55
|
project: order.project,
|
|
56
56
|
name: factory_1.factory.taskName.ConfirmReserveTransaction,
|
|
@@ -16,19 +16,17 @@ function createInformTasks(order, returnOrderAction, setting) {
|
|
|
16
16
|
// informObject = createOrder4inform(order);
|
|
17
17
|
// }
|
|
18
18
|
if (Array.isArray(informOrder) && informOrder.length > 0) {
|
|
19
|
-
let recipientId = '';
|
|
20
|
-
recipientId = order.customer.id;
|
|
21
|
-
if (typeof order.returner?.id === 'string') {
|
|
22
|
-
|
|
23
|
-
}
|
|
19
|
+
// let recipientId = '';
|
|
20
|
+
// recipientId = order.customer.id;
|
|
21
|
+
// if (typeof order.returner?.id === 'string') {
|
|
22
|
+
// recipientId = order.returner.id;
|
|
23
|
+
// }
|
|
24
24
|
informOrder.forEach((informOrderParams) => {
|
|
25
25
|
if (typeof informOrderParams.recipient?.url === 'string') {
|
|
26
26
|
const informActionAttributes = {
|
|
27
27
|
about: { orderNumber: order.orderNumber, typeOf: factory_1.factory.order.OrderType.Order },
|
|
28
28
|
object: informObject,
|
|
29
29
|
recipient: {
|
|
30
|
-
// url: informOrderParams.recipient.url, // discontinue(2025-02-13~)
|
|
31
|
-
id: recipientId,
|
|
32
30
|
name: informOrderParams.recipient?.name,
|
|
33
31
|
typeOf: factory_1.factory.creativeWorkType.WebApplication
|
|
34
32
|
},
|
|
@@ -125,8 +123,6 @@ function createOnOrderReturnedTasksByTransaction(params) {
|
|
|
125
123
|
const simpleOrder = {
|
|
126
124
|
typeOf: params.order.typeOf,
|
|
127
125
|
orderNumber: params.order.orderNumber,
|
|
128
|
-
// price: params.order.price,
|
|
129
|
-
// priceCurrency: params.order.priceCurrency,
|
|
130
126
|
orderDate: params.order.orderDate
|
|
131
127
|
};
|
|
132
128
|
sendEmailMessageAttributes.forEach((s) => {
|
|
@@ -135,8 +131,6 @@ function createOnOrderReturnedTasksByTransaction(params) {
|
|
|
135
131
|
typeOf: factory_1.factory.actionType.SendAction,
|
|
136
132
|
object: s.object,
|
|
137
133
|
agent: params.order.project,
|
|
138
|
-
recipient: { typeOf: params.order.customer.typeOf, id: params.order.customer.id },
|
|
139
|
-
// potentialActions: {}, // discontinue(2024-06-25~)
|
|
140
134
|
purpose: simpleOrder
|
|
141
135
|
};
|
|
142
136
|
const sendEmailMessageTask = {
|
|
@@ -10,15 +10,12 @@ setting) {
|
|
|
10
10
|
const informTasks = [];
|
|
11
11
|
const order4inform = creteOrder4inform(order);
|
|
12
12
|
if (Array.isArray(informOrder) && informOrder.length > 0) {
|
|
13
|
-
const recipientId = '';
|
|
14
13
|
informOrder.forEach((informOrderParams) => {
|
|
15
14
|
if (typeof informOrderParams.recipient?.url === 'string') {
|
|
16
15
|
const informActionAttributes = {
|
|
17
16
|
about: { orderNumber: order4inform.orderNumber, typeOf: factory_1.factory.order.OrderType.Order },
|
|
18
17
|
object: order4inform,
|
|
19
18
|
recipient: {
|
|
20
|
-
// url: informOrderParams.recipient.url, // discontinue(2025-02-13~)
|
|
21
|
-
id: recipientId,
|
|
22
19
|
name: informOrderParams.recipient?.name,
|
|
23
20
|
typeOf: factory_1.factory.creativeWorkType.WebApplication
|
|
24
21
|
},
|
|
@@ -5,8 +5,10 @@ import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
|
|
|
5
5
|
import { factory } from '../../../factory';
|
|
6
6
|
type IPlaceOrderTransaction = Pick<factory.transaction.placeOrder.ITransaction, 'id' | 'project' | 'typeOf' | 'result' | 'object' | 'seller'>;
|
|
7
7
|
interface ICreatePlacingOrderFromExistingTransactionRepos {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
actions: {
|
|
9
|
+
authorizeOffer: AuthorizeOfferActionRepo;
|
|
10
|
+
authorizePaymentMethod: AuthorizePaymentMethodActionRepo;
|
|
11
|
+
};
|
|
10
12
|
orderInTransaction: OrderInTransactionRepo;
|
|
11
13
|
placeOrder: PlaceOrderRepo;
|
|
12
14
|
}
|
|
@@ -35,11 +35,11 @@ function createPlacingOrderFromExistingTransaction(params) {
|
|
|
35
35
|
const completedAuthorizeActionIds = authorizeActionsAsResult.map(({ id }) => id);
|
|
36
36
|
/* istanbul ignore else -- @preserve */
|
|
37
37
|
if (completedAuthorizeActionIds.length > 0) {
|
|
38
|
-
authorizePaymentActions = await repos.
|
|
38
|
+
authorizePaymentActions = await repos.actions.authorizePaymentMethod.findAuthorizePaymentMethodResultsById({
|
|
39
39
|
purpose: { id: placeOrderTransactionWithResult.id },
|
|
40
40
|
ids: completedAuthorizeActionIds
|
|
41
41
|
});
|
|
42
|
-
authorizeOfferActionsWithInstrument = await repos.
|
|
42
|
+
authorizeOfferActionsWithInstrument = await repos.actions.authorizeOffer.findAuthorizeOfferInstrumentsByIds({
|
|
43
43
|
purpose: { id: placeOrderTransactionWithResult.id },
|
|
44
44
|
ids: completedAuthorizeActionIds
|
|
45
45
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AcceptedOfferRepo } from '../../repo/acceptedOffer';
|
|
2
2
|
import type { AccountingReportRepo } from '../../repo/accountingReport';
|
|
3
|
-
import type {
|
|
3
|
+
import type { OrderActionRepo } from '../../repo/action/order';
|
|
4
4
|
import type { AuthorizeOfferActionRepo } from '../../repo/action/authorizeOffer';
|
|
5
5
|
import type { AuthorizePaymentMethodActionRepo } from '../../repo/action/authorizePaymentMethod';
|
|
6
6
|
import type { MessageRepo } from '../../repo/message';
|
|
@@ -14,9 +14,11 @@ import type { IntegrationSettingRepo as Settings } from '../../repo/setting/inte
|
|
|
14
14
|
interface IPlaceOrderRepos {
|
|
15
15
|
acceptedOffer: AcceptedOfferRepo;
|
|
16
16
|
accountingReport: AccountingReportRepo;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
actions: {
|
|
18
|
+
order: OrderActionRepo;
|
|
19
|
+
authorizeOffer: AuthorizeOfferActionRepo;
|
|
20
|
+
authorizePaymentMethod: AuthorizePaymentMethodActionRepo;
|
|
21
|
+
};
|
|
20
22
|
message: MessageRepo;
|
|
21
23
|
order: OrderRepo;
|
|
22
24
|
orderInTransaction: OrderInTransactionRepo;
|