@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
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ActionRecipeRepo = void 0;
|
|
4
|
+
const actionRecipe_1 = require("../../mongoose/schemas/actionRecipe");
|
|
5
|
+
/**
|
|
6
|
+
* アクションレシピリポジトリ
|
|
7
|
+
*/
|
|
8
|
+
class ActionRecipeRepo {
|
|
9
|
+
actionRecipeModel;
|
|
10
|
+
recipeOptions;
|
|
11
|
+
constructor(params, options) {
|
|
12
|
+
this.actionRecipeModel = params.connection.model(actionRecipe_1.modelName, (0, actionRecipe_1.createSchema)());
|
|
13
|
+
this.recipeOptions = options;
|
|
14
|
+
}
|
|
15
|
+
async findRecipeByAction(params) {
|
|
16
|
+
return this.actionRecipeModel.findOne({
|
|
17
|
+
'project.id': { $eq: params.project.id },
|
|
18
|
+
'recipeFor.id': { $eq: params.recipeFor.id }
|
|
19
|
+
}, { step: 1, recipeCategory: 1 }
|
|
20
|
+
// { lean: true }
|
|
21
|
+
)
|
|
22
|
+
.lean()
|
|
23
|
+
.exec();
|
|
24
|
+
// if (result === null) {
|
|
25
|
+
// throw new factory.errors.NotFound(this.actionRecipeModel.modelName);
|
|
26
|
+
// }
|
|
27
|
+
// return result;
|
|
28
|
+
}
|
|
29
|
+
async upsertRecipe(savingRecipe) {
|
|
30
|
+
const dateModified = new Date();
|
|
31
|
+
const expires = new Date(dateModified.getTime() + this.recipeOptions.recipeExpireAfterSeconds * 1000);
|
|
32
|
+
const { typeOf, project, recipeCategory, recipeFor, step } = savingRecipe;
|
|
33
|
+
const filter = {
|
|
34
|
+
'recipeFor.id': { $eq: recipeFor.id }
|
|
35
|
+
};
|
|
36
|
+
const setOnInsert = {
|
|
37
|
+
project, typeOf, recipeCategory, recipeFor,
|
|
38
|
+
dateCreated: dateModified,
|
|
39
|
+
expires // 必須化(2026-08-16~)
|
|
40
|
+
};
|
|
41
|
+
const setKeys = { step, dateModified };
|
|
42
|
+
const update = {
|
|
43
|
+
$setOnInsert: setOnInsert,
|
|
44
|
+
$set: setKeys
|
|
45
|
+
};
|
|
46
|
+
await this.actionRecipeModel.updateOne(filter, update, {
|
|
47
|
+
upsert: true
|
|
48
|
+
// includeResultMetadata: true
|
|
49
|
+
})
|
|
50
|
+
.exec();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.ActionRecipeRepo = ActionRecipeRepo;
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
+
import type { Connection } from 'mongoose';
|
|
1
2
|
import { factory } from '../../factory';
|
|
2
|
-
import { IKeyOfProjection, IActionRecipe, ActionProcessRepo } from './actionProcess';
|
|
3
|
-
export type IAuthorizeInvoiceAction = factory.action.authorize.invoice.IAction
|
|
4
|
-
/**
|
|
5
|
-
* 実際存在しない属性だが、ActionProcessRepoのTActionに適合させるために補完
|
|
6
|
-
*/
|
|
7
|
-
recipient: any;
|
|
8
|
-
};
|
|
3
|
+
import { IKeyOfProjection, IActionRecipe, ActionProcessRepo } from './anyAction/actionProcess';
|
|
4
|
+
export type IAuthorizeInvoiceAction = factory.action.authorize.invoice.IAction;
|
|
9
5
|
/**
|
|
10
6
|
* インボイス承認リポジトリ
|
|
11
7
|
*/
|
|
12
8
|
export declare class AuthorizeInvoiceActionRepo extends ActionProcessRepo<IAuthorizeInvoiceAction, IActionRecipe<factory.recipe.RecipeCategory.authorizeInvoice | factory.recipe.RecipeCategory.authorizeInvoice3ds>> {
|
|
9
|
+
constructor(connection: Connection);
|
|
13
10
|
/**
|
|
14
11
|
* 決済取引からインボイス承認アクションをひとつ参照する
|
|
15
12
|
*/
|
|
@@ -22,5 +19,5 @@ export declare class AuthorizeInvoiceActionRepo extends ActionProcessRepo<IAutho
|
|
|
22
19
|
* 決済取引ID
|
|
23
20
|
*/
|
|
24
21
|
payTransactionId: string;
|
|
25
|
-
}, inclusion: IKeyOfProjection[]): Promise<
|
|
22
|
+
}, inclusion: IKeyOfProjection[]): Promise<import("@chevre/factory/lib/chevre/action/authorize/invoice").IAction[]>;
|
|
26
23
|
}
|
|
@@ -2,14 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AuthorizeInvoiceActionRepo = void 0;
|
|
4
4
|
const factory_1 = require("../../factory");
|
|
5
|
-
|
|
6
|
-
// import { createSchema, IModel as IActionModel, modelName } from './mongoose/schemas/action';
|
|
7
|
-
// import { createSchema as createRecipeSchema, IModel as IActionRecipeModel, modelName as recipeModelName } from './mongoose/schemas/actionRecipe';
|
|
8
|
-
const actionProcess_1 = require("./actionProcess");
|
|
5
|
+
const actionProcess_1 = require("./anyAction/actionProcess");
|
|
9
6
|
/**
|
|
10
7
|
* インボイス承認リポジトリ
|
|
11
8
|
*/
|
|
12
9
|
class AuthorizeInvoiceActionRepo extends actionProcess_1.ActionProcessRepo {
|
|
10
|
+
constructor(connection) {
|
|
11
|
+
super({ connection }, {
|
|
12
|
+
expireAfterSeconds: actionProcess_1.DEFAULT_EXPIRE_AFTER_SECONDS,
|
|
13
|
+
recipeExpireAfterSeconds: actionProcess_1.RECIPE_DEFAULT_EXPIRE_AFTER_SECONDS
|
|
14
|
+
});
|
|
15
|
+
}
|
|
13
16
|
/**
|
|
14
17
|
* 決済取引からインボイス承認アクションをひとつ参照する
|
|
15
18
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { Connection } from 'mongoose';
|
|
1
2
|
import { factory } from '../../factory';
|
|
2
|
-
import { ActionProcessRepo } from './actionProcess';
|
|
3
|
+
import { ActionProcessRepo } from './anyAction/actionProcess';
|
|
3
4
|
export type IAuthorizeEventServiceOfferAction = factory.action.authorize.offer.eventService.IAction;
|
|
4
5
|
export type IAuthorizeOfferAction = IAuthorizeEventServiceOfferAction;
|
|
5
6
|
export type IAuthorizeOfferActionWithInstrument = Pick<IAuthorizeEventServiceOfferAction, 'instrument'>;
|
|
@@ -7,6 +8,7 @@ export type IAuthorizeOfferActionWithInstrument = Pick<IAuthorizeEventServiceOff
|
|
|
7
8
|
* オファー承認リポジトリ
|
|
8
9
|
*/
|
|
9
10
|
export declare class AuthorizeOfferActionRepo extends ActionProcessRepo<IAuthorizeOfferAction, never> {
|
|
11
|
+
constructor(connection: Connection);
|
|
10
12
|
findAuthorizeOfferInstrumentsByIds(params: {
|
|
11
13
|
/**
|
|
12
14
|
* 注文取引
|
|
@@ -2,12 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AuthorizeOfferActionRepo = void 0;
|
|
4
4
|
const factory_1 = require("../../factory");
|
|
5
|
-
|
|
6
|
-
const actionProcess_1 = require("./actionProcess");
|
|
5
|
+
const actionProcess_1 = require("./anyAction/actionProcess");
|
|
7
6
|
/**
|
|
8
7
|
* オファー承認リポジトリ
|
|
9
8
|
*/
|
|
10
9
|
class AuthorizeOfferActionRepo extends actionProcess_1.ActionProcessRepo {
|
|
10
|
+
constructor(connection) {
|
|
11
|
+
super({ connection }, {
|
|
12
|
+
expireAfterSeconds: actionProcess_1.DEFAULT_EXPIRE_AFTER_SECONDS,
|
|
13
|
+
recipeExpireAfterSeconds: actionProcess_1.RECIPE_DEFAULT_EXPIRE_AFTER_SECONDS
|
|
14
|
+
});
|
|
15
|
+
}
|
|
11
16
|
async findAuthorizeOfferInstrumentsByIds(params) {
|
|
12
17
|
if (!Array.isArray(params.ids)) {
|
|
13
18
|
throw new factory_1.factory.errors.Argument('ids', 'must be Array');
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import type { Connection } from 'mongoose';
|
|
1
2
|
import { factory } from '../../factory';
|
|
2
|
-
import { ActionProcessRepo } from './actionProcess';
|
|
3
|
+
import { ActionProcessRepo } from './anyAction/actionProcess';
|
|
3
4
|
export type IAuthorizePaymentMethodAction = factory.action.authorize.paymentMethod.any.IAction;
|
|
4
5
|
export type IActionRecipe = never;
|
|
5
6
|
/**
|
|
6
7
|
* 決済承認リポジトリ
|
|
7
8
|
*/
|
|
8
9
|
export declare class AuthorizePaymentMethodActionRepo extends ActionProcessRepo<IAuthorizePaymentMethodAction, IActionRecipe> {
|
|
10
|
+
constructor(connection: Connection);
|
|
9
11
|
/**
|
|
10
12
|
* 取引に対する決済承認アクションを検索する
|
|
11
13
|
*/
|
|
@@ -2,14 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AuthorizePaymentMethodActionRepo = void 0;
|
|
4
4
|
const factory_1 = require("../../factory");
|
|
5
|
-
|
|
6
|
-
// import { createSchema, IModel as IActionModel, modelName } from './mongoose/schemas/action';
|
|
7
|
-
// import { createSchema as createRecipeSchema, IModel as IActionRecipeModel, modelName as recipeModelName } from './mongoose/schemas/actionRecipe';
|
|
8
|
-
const actionProcess_1 = require("./actionProcess");
|
|
5
|
+
const actionProcess_1 = require("./anyAction/actionProcess");
|
|
9
6
|
/**
|
|
10
7
|
* 決済承認リポジトリ
|
|
11
8
|
*/
|
|
12
9
|
class AuthorizePaymentMethodActionRepo extends actionProcess_1.ActionProcessRepo {
|
|
10
|
+
constructor(connection) {
|
|
11
|
+
super({ connection }, {
|
|
12
|
+
expireAfterSeconds: actionProcess_1.DEFAULT_EXPIRE_AFTER_SECONDS,
|
|
13
|
+
recipeExpireAfterSeconds: actionProcess_1.RECIPE_DEFAULT_EXPIRE_AFTER_SECONDS
|
|
14
|
+
});
|
|
15
|
+
}
|
|
13
16
|
/**
|
|
14
17
|
* 取引に対する決済承認アクションを検索する
|
|
15
18
|
*/
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import type { Connection } from 'mongoose';
|
|
1
2
|
import { factory } from '../../factory';
|
|
2
|
-
import { ActionProcessRepo } from './actionProcess';
|
|
3
|
+
import { ActionProcessRepo } from './anyAction/actionProcess';
|
|
3
4
|
export type IAuthorizeTicketedObjectAction = factory.action.authorize.ticketedObject.IAction;
|
|
4
5
|
/**
|
|
5
6
|
* 決済とオファー以外に対する汎用承認リポジトリ
|
|
6
7
|
*/
|
|
7
8
|
export declare class AuthorizeTicketedObjectActionRepo extends ActionProcessRepo<IAuthorizeTicketedObjectAction, never> {
|
|
9
|
+
constructor(connection: Connection);
|
|
8
10
|
}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AuthorizeTicketedObjectActionRepo = void 0;
|
|
4
|
-
|
|
5
|
-
const actionProcess_1 = require("./actionProcess");
|
|
4
|
+
const actionProcess_1 = require("./anyAction/actionProcess");
|
|
6
5
|
/**
|
|
7
6
|
* 決済とオファー以外に対する汎用承認リポジトリ
|
|
8
7
|
*/
|
|
9
8
|
class AuthorizeTicketedObjectActionRepo extends actionProcess_1.ActionProcessRepo {
|
|
9
|
+
constructor(connection) {
|
|
10
|
+
super({ connection }, {
|
|
11
|
+
expireAfterSeconds: actionProcess_1.DEFAULT_EXPIRE_AFTER_SECONDS,
|
|
12
|
+
recipeExpireAfterSeconds: actionProcess_1.RECIPE_DEFAULT_EXPIRE_AFTER_SECONDS
|
|
13
|
+
});
|
|
14
|
+
}
|
|
10
15
|
}
|
|
11
16
|
exports.AuthorizeTicketedObjectActionRepo = AuthorizeTicketedObjectActionRepo;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Connection } from 'mongoose';
|
|
2
|
+
import { factory } from '../../factory';
|
|
3
|
+
import { ActionProcessRepo } from './anyAction/actionProcess';
|
|
4
|
+
export type ICancelAction = factory.action.cancel.coaReserve.IAction | factory.action.cancel.reservation.IAction;
|
|
5
|
+
export type IActionRecipe = factory.action.cancel.coaReserve.ICancelPendingCOAReserveRecipe;
|
|
6
|
+
/**
|
|
7
|
+
* 予約取消アクションリポジトリ
|
|
8
|
+
*/
|
|
9
|
+
export declare class CancelActionRepo extends ActionProcessRepo<ICancelAction, IActionRecipe> {
|
|
10
|
+
constructor(connection: Connection);
|
|
11
|
+
/**
|
|
12
|
+
* 完了済取消アクション検索
|
|
13
|
+
*/
|
|
14
|
+
findCompletedCancelAction(params: {
|
|
15
|
+
object: {
|
|
16
|
+
reservationNumber: string;
|
|
17
|
+
};
|
|
18
|
+
purpose: {
|
|
19
|
+
/**
|
|
20
|
+
* 予約取引ID
|
|
21
|
+
*/
|
|
22
|
+
id: string;
|
|
23
|
+
};
|
|
24
|
+
}): Promise<Pick<ICancelAction, 'id'> | null>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CancelActionRepo = void 0;
|
|
4
|
+
const factory_1 = require("../../factory");
|
|
5
|
+
const actionProcess_1 = require("./anyAction/actionProcess");
|
|
6
|
+
const settings_1 = require("../../settings");
|
|
7
|
+
/**
|
|
8
|
+
* 予約取消アクションリポジトリ
|
|
9
|
+
*/
|
|
10
|
+
class CancelActionRepo extends actionProcess_1.ActionProcessRepo {
|
|
11
|
+
constructor(connection) {
|
|
12
|
+
super({ connection }, {
|
|
13
|
+
expireAfterSeconds: actionProcess_1.DEFAULT_EXPIRE_AFTER_SECONDS,
|
|
14
|
+
recipeExpireAfterSeconds: actionProcess_1.RECIPE_DEFAULT_EXPIRE_AFTER_SECONDS
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* 完了済取消アクション検索
|
|
19
|
+
*/
|
|
20
|
+
async findCompletedCancelAction(params) {
|
|
21
|
+
const query = this.actionModel.findOne({
|
|
22
|
+
// limit: 1,
|
|
23
|
+
// page: 1,
|
|
24
|
+
// actionStatus: { $in: [factory.actionStatusType.CompletedActionStatus] },
|
|
25
|
+
// typeOf: { $eq: factory.actionType.CancelAction },
|
|
26
|
+
// object: {
|
|
27
|
+
// typeOf: { $eq: factory.reservationType.ReservationPackage },
|
|
28
|
+
// reservationNumber: { $eq: reserveTransaction.transactionNumber }
|
|
29
|
+
// },
|
|
30
|
+
// purpose: {
|
|
31
|
+
// id: { $in: [params.purpose.id] },
|
|
32
|
+
// typeOf: { $in: [params.purpose.typeOf] }
|
|
33
|
+
// }
|
|
34
|
+
actionStatus: { $eq: factory_1.factory.actionStatusType.CompletedActionStatus },
|
|
35
|
+
typeOf: { $eq: factory_1.factory.actionType.CancelAction },
|
|
36
|
+
'object.reservationNumber': { $exists: true, $eq: params.object.reservationNumber },
|
|
37
|
+
'purpose.id': { $exists: true, $eq: params.purpose.id }
|
|
38
|
+
}, {
|
|
39
|
+
_id: 0,
|
|
40
|
+
id: { $toString: '$_id' }
|
|
41
|
+
});
|
|
42
|
+
return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
43
|
+
.lean()
|
|
44
|
+
.exec();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.CancelActionRepo = CancelActionRepo;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Surfrock } from '@surfrock/sdk';
|
|
2
|
+
import type { Connection } from 'mongoose';
|
|
2
3
|
import { factory } from '../../factory';
|
|
3
|
-
import { ActionProcessRepo, IActionRecipe } from './actionProcess';
|
|
4
|
+
import { ActionProcessRepo, IActionRecipe } from './anyAction/actionProcess';
|
|
4
5
|
export type IMinimizedPurchaseNumberAuthResult = Pick<factory.action.check.paymentMethod.movieTicket.IPurchaseNumberAuthResult, 'mkknmiNumSum' | 'resultInfo' | 'ykknmiNumSum'> & {
|
|
5
6
|
knyknrNoInfoOut: Omit<factory.action.check.paymentMethod.movieTicket.IPurchaseNumberInfo, 'ykknInfo' | 'mkknInfo'>[] | null;
|
|
6
7
|
};
|
|
@@ -60,6 +61,7 @@ export type ICheckMovieTicketAction = factory.action.check.paymentMethod.movieTi
|
|
|
60
61
|
* 決済カード認証アクションリポジトリ
|
|
61
62
|
*/
|
|
62
63
|
export declare class CheckMovieTicketActionRepo extends ActionProcessRepo<ICheckMovieTicketAction, IActionRecipe<factory.recipe.RecipeCategory.checkMovieTicket>> {
|
|
64
|
+
constructor(connection: Connection);
|
|
63
65
|
/**
|
|
64
66
|
* アクションIDからレシピのafterMediaを参照する
|
|
65
67
|
*/
|
|
@@ -3,11 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CheckMovieTicketActionRepo = void 0;
|
|
4
4
|
const factory_1 = require("../../factory");
|
|
5
5
|
const settings_1 = require("../../settings");
|
|
6
|
-
const actionProcess_1 = require("./actionProcess");
|
|
6
|
+
const actionProcess_1 = require("./anyAction/actionProcess");
|
|
7
|
+
const EXPIRE_AFTER_SECONDS = 2592000; // 30 days
|
|
7
8
|
/**
|
|
8
9
|
* 決済カード認証アクションリポジトリ
|
|
9
10
|
*/
|
|
10
11
|
class CheckMovieTicketActionRepo extends actionProcess_1.ActionProcessRepo {
|
|
12
|
+
constructor(connection) {
|
|
13
|
+
super({ connection }, {
|
|
14
|
+
expireAfterSeconds: EXPIRE_AFTER_SECONDS,
|
|
15
|
+
recipeExpireAfterSeconds: EXPIRE_AFTER_SECONDS
|
|
16
|
+
});
|
|
17
|
+
}
|
|
11
18
|
/**
|
|
12
19
|
* アクションIDからレシピのafterMediaを参照する
|
|
13
20
|
*/
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Connection } from 'mongoose';
|
|
2
|
+
import { factory } from '../../factory';
|
|
3
|
+
import { ActionProcessRepo } from './anyAction/actionProcess';
|
|
4
|
+
export type IConfirmAction = factory.action.interact.confirm.pay.IAction | factory.action.interact.confirm.reservation.IAction;
|
|
5
|
+
export type IActionRecipe = factory.action.interact.confirm.reservation.IConfirmCOAReserveRecipe;
|
|
6
|
+
/**
|
|
7
|
+
* 資産取引確定アクションリポジトリ
|
|
8
|
+
*/
|
|
9
|
+
export declare class ConfirmActionRepo extends ActionProcessRepo<IConfirmAction, IActionRecipe> {
|
|
10
|
+
constructor(connection: Connection);
|
|
11
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConfirmActionRepo = void 0;
|
|
4
|
+
const actionProcess_1 = require("./anyAction/actionProcess");
|
|
5
|
+
/**
|
|
6
|
+
* 資産取引確定アクションリポジトリ
|
|
7
|
+
*/
|
|
8
|
+
class ConfirmActionRepo extends actionProcess_1.ActionProcessRepo {
|
|
9
|
+
constructor(connection) {
|
|
10
|
+
super({ connection }, {
|
|
11
|
+
expireAfterSeconds: actionProcess_1.DEFAULT_EXPIRE_AFTER_SECONDS,
|
|
12
|
+
recipeExpireAfterSeconds: actionProcess_1.RECIPE_DEFAULT_EXPIRE_AFTER_SECONDS
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.ConfirmActionRepo = ConfirmActionRepo;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Connection } from 'mongoose';
|
|
2
|
+
import { factory } from '../../factory';
|
|
3
|
+
import { ActionProcessRepo } from './anyAction/actionProcess';
|
|
4
|
+
export type ICreateAction = factory.action.create.IAction;
|
|
5
|
+
/**
|
|
6
|
+
* レポート作成アクションリポジトリ
|
|
7
|
+
*/
|
|
8
|
+
export declare class CreateActionRepo extends ActionProcessRepo<ICreateAction, never> {
|
|
9
|
+
constructor(connection: Connection);
|
|
10
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateActionRepo = void 0;
|
|
4
|
+
const actionProcess_1 = require("./anyAction/actionProcess");
|
|
5
|
+
const EXPIRE_AFTER_SECONDS = 2592000; // 30 days
|
|
6
|
+
/**
|
|
7
|
+
* レポート作成アクションリポジトリ
|
|
8
|
+
*/
|
|
9
|
+
class CreateActionRepo extends actionProcess_1.ActionProcessRepo {
|
|
10
|
+
constructor(connection) {
|
|
11
|
+
super({ connection }, {
|
|
12
|
+
expireAfterSeconds: EXPIRE_AFTER_SECONDS,
|
|
13
|
+
recipeExpireAfterSeconds: EXPIRE_AFTER_SECONDS
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.CreateActionRepo = CreateActionRepo;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Connection, FilterQuery } from 'mongoose';
|
|
2
|
+
import { factory } from '../../factory';
|
|
3
|
+
import { IDocType } from '../mongoose/schemas/action/inform';
|
|
4
|
+
type StartableActionType = factory.actionType.InformAction;
|
|
5
|
+
type IAction = IDocType & {
|
|
6
|
+
id: string;
|
|
7
|
+
};
|
|
8
|
+
type IKeyOfProjection = keyof IDocType;
|
|
9
|
+
type IFindParams = Pick<factory.action.ISearchConditions, 'limit' | 'page' | 'project' | 'sort' | 'startFrom' | 'startThrough'> & {
|
|
10
|
+
id?: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* 通知アクションリポジトリ
|
|
14
|
+
*/
|
|
15
|
+
export declare class InformActionRepo {
|
|
16
|
+
private readonly informActionModel;
|
|
17
|
+
constructor(connection: Connection);
|
|
18
|
+
static CREATE_MONGO_CONDITIONS(params: IFindParams): FilterQuery<IDocType>[];
|
|
19
|
+
/**
|
|
20
|
+
* アクション開始
|
|
21
|
+
*/
|
|
22
|
+
startInformAction(attributes: factory.action.interact.inform.IAttributes): Promise<Pick<IAction, 'id' | 'typeOf' | 'startDate'>>;
|
|
23
|
+
completeInformAction(params: {
|
|
24
|
+
typeOf: StartableActionType;
|
|
25
|
+
id: string;
|
|
26
|
+
result: factory.action.interact.inform.IResult;
|
|
27
|
+
}): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* アクション失敗
|
|
30
|
+
*/
|
|
31
|
+
giveUpInformAction(params: {
|
|
32
|
+
typeOf: StartableActionType;
|
|
33
|
+
id: string;
|
|
34
|
+
error: Error | Error[] | unknown;
|
|
35
|
+
}): Promise<void>;
|
|
36
|
+
findInformActions(params: IFindParams, inclusion: IKeyOfProjection[]): Promise<IAction[]>;
|
|
37
|
+
}
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InformActionRepo = void 0;
|
|
4
|
+
const factory_1 = require("../../factory");
|
|
5
|
+
const settings_1 = require("../../settings");
|
|
6
|
+
const inform_1 = require("../mongoose/schemas/action/inform");
|
|
7
|
+
const unknown2actionError_1 = require("./unknown2actionError");
|
|
8
|
+
const AVAILABLE_PROJECT_FIELDS = [
|
|
9
|
+
'project',
|
|
10
|
+
'actionStatus',
|
|
11
|
+
'typeOf',
|
|
12
|
+
'agent',
|
|
13
|
+
'result',
|
|
14
|
+
'error',
|
|
15
|
+
'object',
|
|
16
|
+
'startDate',
|
|
17
|
+
'endDate',
|
|
18
|
+
'about',
|
|
19
|
+
'purpose',
|
|
20
|
+
'recipient',
|
|
21
|
+
'target',
|
|
22
|
+
'expires'
|
|
23
|
+
];
|
|
24
|
+
const EXPIRE_AFTER_SECONDS = 2592000; // 30 days
|
|
25
|
+
/**
|
|
26
|
+
* 通知アクションリポジトリ
|
|
27
|
+
*/
|
|
28
|
+
class InformActionRepo {
|
|
29
|
+
informActionModel;
|
|
30
|
+
constructor(connection) {
|
|
31
|
+
this.informActionModel = connection.model(inform_1.modelName, (0, inform_1.createSchema)());
|
|
32
|
+
}
|
|
33
|
+
static CREATE_MONGO_CONDITIONS(params) {
|
|
34
|
+
const andConditions = [];
|
|
35
|
+
const idEq = params.id;
|
|
36
|
+
if (typeof idEq === 'string') {
|
|
37
|
+
andConditions.push({ _id: { $eq: idEq } });
|
|
38
|
+
}
|
|
39
|
+
const projectIdEq = params.project?.id?.$eq;
|
|
40
|
+
if (typeof projectIdEq === 'string') {
|
|
41
|
+
andConditions.push({ 'project.id': { $eq: projectIdEq } });
|
|
42
|
+
}
|
|
43
|
+
// const objectIdEq = params.object?.id;
|
|
44
|
+
// if (typeof objectIdEq === 'string') {
|
|
45
|
+
// andConditions.push({ 'object.id': { $exists: true, $eq: objectIdEq } });
|
|
46
|
+
// }
|
|
47
|
+
// const objectOrderNumberEq = params.object?.orderNumber;
|
|
48
|
+
// if (typeof objectOrderNumberEq === 'string') {
|
|
49
|
+
// andConditions.push({ 'object.orderNumber': { $exists: true, $eq: objectOrderNumberEq } });
|
|
50
|
+
// }
|
|
51
|
+
// const aboutOrderNumberEq = params.about?.orderNumber;
|
|
52
|
+
// if (typeof aboutOrderNumberEq === 'string') {
|
|
53
|
+
// andConditions.push({ 'about.orderNumber': { $exists: true, $eq: aboutOrderNumberEq } });
|
|
54
|
+
// }
|
|
55
|
+
const startDateGte = params.startFrom;
|
|
56
|
+
if (startDateGte instanceof Date) {
|
|
57
|
+
andConditions.push({ startDate: { $gte: startDateGte } });
|
|
58
|
+
}
|
|
59
|
+
const startDateLte = params.startThrough;
|
|
60
|
+
if (startDateLte instanceof Date) {
|
|
61
|
+
andConditions.push({ startDate: { $lte: startDateLte } });
|
|
62
|
+
}
|
|
63
|
+
return andConditions;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* アクション開始
|
|
67
|
+
*/
|
|
68
|
+
async startInformAction(attributes) {
|
|
69
|
+
const startDate = new Date();
|
|
70
|
+
const expires = new Date(startDate.getTime() + EXPIRE_AFTER_SECONDS * 1000);
|
|
71
|
+
const creatingAction = {
|
|
72
|
+
...attributes,
|
|
73
|
+
actionStatus: factory_1.factory.actionStatusType.ActiveActionStatus,
|
|
74
|
+
startDate,
|
|
75
|
+
expires
|
|
76
|
+
};
|
|
77
|
+
const result = await this.informActionModel.insertMany(creatingAction, { rawResult: true });
|
|
78
|
+
const id = result.insertedIds?.[0]?.toHexString();
|
|
79
|
+
if (typeof id !== 'string') {
|
|
80
|
+
throw new factory_1.factory.errors.Internal('action not saved');
|
|
81
|
+
}
|
|
82
|
+
return { id, startDate, typeOf: creatingAction.typeOf };
|
|
83
|
+
}
|
|
84
|
+
async completeInformAction(params) {
|
|
85
|
+
const doc = await this.informActionModel.findOneAndUpdate({ _id: { $eq: params.id } }, {
|
|
86
|
+
$set: {
|
|
87
|
+
actionStatus: factory_1.factory.actionStatusType.CompletedActionStatus,
|
|
88
|
+
result: params.result,
|
|
89
|
+
endDate: new Date()
|
|
90
|
+
}
|
|
91
|
+
}, { new: false, projection: { _id: 1 } })
|
|
92
|
+
.lean()
|
|
93
|
+
.exec();
|
|
94
|
+
if (doc === null) {
|
|
95
|
+
throw new factory_1.factory.errors.NotFound(this.informActionModel.modelName);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* アクション失敗
|
|
100
|
+
*/
|
|
101
|
+
async giveUpInformAction(params) {
|
|
102
|
+
const actionError = Array.isArray(params.error)
|
|
103
|
+
? params.error.map(unknown2actionError_1.unknown2actionError)
|
|
104
|
+
: (0, unknown2actionError_1.unknown2actionError)(params.error);
|
|
105
|
+
const doc = await this.informActionModel.findOneAndUpdate({ _id: { $eq: params.id } }, {
|
|
106
|
+
$set: {
|
|
107
|
+
actionStatus: factory_1.factory.actionStatusType.FailedActionStatus,
|
|
108
|
+
error: actionError,
|
|
109
|
+
endDate: new Date()
|
|
110
|
+
}
|
|
111
|
+
}, { new: true, projection: { _id: 1 } })
|
|
112
|
+
.lean()
|
|
113
|
+
.exec();
|
|
114
|
+
if (doc === null) {
|
|
115
|
+
throw new factory_1.factory.errors.NotFound(this.informActionModel.modelName);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
async findInformActions(params, inclusion) {
|
|
119
|
+
const conditions = InformActionRepo.CREATE_MONGO_CONDITIONS(params);
|
|
120
|
+
let positiveProjectionFields = AVAILABLE_PROJECT_FIELDS;
|
|
121
|
+
if (Array.isArray(inclusion) && inclusion.length > 0) {
|
|
122
|
+
positiveProjectionFields = inclusion.filter((key) => AVAILABLE_PROJECT_FIELDS.includes(key));
|
|
123
|
+
}
|
|
124
|
+
const projection = {
|
|
125
|
+
_id: 0,
|
|
126
|
+
id: { $toString: '$_id' },
|
|
127
|
+
...Object.fromEntries(positiveProjectionFields.map((key) => ([key, 1])))
|
|
128
|
+
};
|
|
129
|
+
const query = this.informActionModel.find((conditions.length > 0) ? { $and: conditions } : {}, projection);
|
|
130
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
131
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
132
|
+
query.limit(params.limit)
|
|
133
|
+
.skip(params.limit * (page - 1));
|
|
134
|
+
}
|
|
135
|
+
/* istanbul ignore else */
|
|
136
|
+
if (params.sort?.startDate !== undefined) {
|
|
137
|
+
query.sort({ startDate: params.sort.startDate });
|
|
138
|
+
}
|
|
139
|
+
// const explainResult = await (<any>query).explain();
|
|
140
|
+
// console.log(explainResult[0].executionStats.allPlansExecution.map((e: any) => e.executionStages.inputStage));
|
|
141
|
+
return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
142
|
+
.lean() // 2024-08-26~
|
|
143
|
+
.exec();
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
exports.InformActionRepo = InformActionRepo;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Connection } from 'mongoose';
|
|
2
|
+
import { factory } from '../../factory';
|
|
3
|
+
import { ActionProcessRepo } from './anyAction/actionProcess';
|
|
4
|
+
export type IOrderAction = factory.action.trade.order.IAction;
|
|
5
|
+
/**
|
|
6
|
+
* 注文アクションリポジトリ
|
|
7
|
+
*/
|
|
8
|
+
export declare class OrderActionRepo extends ActionProcessRepo<IOrderAction, never> {
|
|
9
|
+
constructor(connection: Connection);
|
|
10
|
+
/**
|
|
11
|
+
* 完了済予約アクション検索
|
|
12
|
+
*/
|
|
13
|
+
findCompletedOrderAction(params: {
|
|
14
|
+
object: {
|
|
15
|
+
orderNumber: string;
|
|
16
|
+
};
|
|
17
|
+
purpose: {
|
|
18
|
+
id: string;
|
|
19
|
+
};
|
|
20
|
+
}): Promise<Pick<IOrderAction, 'id'> | null>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OrderActionRepo = void 0;
|
|
4
|
+
const factory_1 = require("../../factory");
|
|
5
|
+
const actionProcess_1 = require("./anyAction/actionProcess");
|
|
6
|
+
const settings_1 = require("../../settings");
|
|
7
|
+
/**
|
|
8
|
+
* 注文アクションリポジトリ
|
|
9
|
+
*/
|
|
10
|
+
class OrderActionRepo extends actionProcess_1.ActionProcessRepo {
|
|
11
|
+
constructor(connection) {
|
|
12
|
+
super({ connection }, {
|
|
13
|
+
expireAfterSeconds: actionProcess_1.DEFAULT_EXPIRE_AFTER_SECONDS,
|
|
14
|
+
recipeExpireAfterSeconds: actionProcess_1.RECIPE_DEFAULT_EXPIRE_AFTER_SECONDS
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* 完了済予約アクション検索
|
|
19
|
+
*/
|
|
20
|
+
async findCompletedOrderAction(params) {
|
|
21
|
+
const query = this.actionModel.findOne({
|
|
22
|
+
actionStatus: { $eq: factory_1.factory.actionStatusType.CompletedActionStatus },
|
|
23
|
+
typeOf: { $eq: factory_1.factory.actionType.OrderAction },
|
|
24
|
+
'object.orderNumber': { $exists: true, $eq: params.object.orderNumber },
|
|
25
|
+
'purpose.id': { $exists: true, $eq: params.purpose.id }
|
|
26
|
+
}, {
|
|
27
|
+
_id: 0,
|
|
28
|
+
id: { $toString: '$_id' }
|
|
29
|
+
});
|
|
30
|
+
return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
31
|
+
.lean()
|
|
32
|
+
.exec();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.OrderActionRepo = OrderActionRepo;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import type { Connection } from 'mongoose';
|
|
1
2
|
import { factory } from '../../factory';
|
|
2
|
-
import { ActionProcessRepo } from './actionProcess';
|
|
3
|
+
import { ActionProcessRepo } from './anyAction/actionProcess';
|
|
3
4
|
export type IPayAction = factory.action.trade.pay.IAction;
|
|
4
5
|
export type IActionRecipe = factory.action.trade.pay.IPayCreditCardRecipe | factory.action.trade.pay.IPayMovieTicketRecipe;
|
|
5
6
|
/**
|
|
6
7
|
* 決済アクションリポジトリ
|
|
7
8
|
*/
|
|
8
9
|
export declare class PayActionRepo extends ActionProcessRepo<IPayAction, IActionRecipe> {
|
|
10
|
+
constructor(connection: Connection);
|
|
9
11
|
/**
|
|
10
12
|
* 決済方法IDから決済アクションをひとつ参照する
|
|
11
13
|
* デフォルトでCompletedActionStatusのみ参照
|