@chevre/domain 26.0.0-alpha.8 → 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/adminAsyncAction.d.ts +2 -2
- 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/asyncAction.d.ts +2 -2
- 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 -150
- package/lib/chevre/repo/task.js +13 -446
- 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 +3 -22
- package/lib/chevre/service/task.js +8 -40
- 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 -19
- package/lib/chevre/repo/scheduledTaskLegacy.js +0 -42
- 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
|
@@ -4,11 +4,11 @@ exports.modelName = exports.indexes = void 0;
|
|
|
4
4
|
exports.createSchema = createSchema;
|
|
5
5
|
const mongoose_1 = require("mongoose");
|
|
6
6
|
const writeConcern_1 = require("../writeConcern");
|
|
7
|
+
const factory_1 = require("../../../factory");
|
|
7
8
|
const settings_1 = require("../../../settings");
|
|
8
9
|
const modelName = 'Task';
|
|
9
10
|
exports.modelName = modelName;
|
|
10
11
|
const schemaDefinition = {
|
|
11
|
-
alternateName: String, // add(2025-03-28~)
|
|
12
12
|
identifier: String,
|
|
13
13
|
description: String, // add(2025-03-30~)
|
|
14
14
|
project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
@@ -22,7 +22,8 @@ const schemaDefinition = {
|
|
|
22
22
|
executor: mongoose_1.SchemaTypes.Mixed,
|
|
23
23
|
data: mongoose_1.SchemaTypes.Mixed,
|
|
24
24
|
dateAborted: Date,
|
|
25
|
-
|
|
25
|
+
// alternateName: String, // add(2025-03-28~) // identidfier移行完了につき廃止(2026-08-07~)
|
|
26
|
+
// expires: Date // add(2024-04-23~) // 非同期アクションは移行につきexpires廃止(2026-08-05~)
|
|
26
27
|
};
|
|
27
28
|
const schemaOptions = {
|
|
28
29
|
autoIndex: settings_1.MONGO_AUTO_INDEX,
|
|
@@ -51,115 +52,55 @@ const schemaOptions = {
|
|
|
51
52
|
const indexes = [
|
|
52
53
|
[
|
|
53
54
|
{ 'project.id': 1, runsAt: -1 },
|
|
54
|
-
{ name: 'searchByProjectId-v20220721' }
|
|
55
|
+
{ name: 'searchByProjectId-v20220721' } // タスク検索で使用中
|
|
55
56
|
],
|
|
56
57
|
[
|
|
57
58
|
{ name: 1, runsAt: -1 },
|
|
58
|
-
{ name: 'searchByName-v2' }
|
|
59
|
+
{ name: 'searchByName-v2' } // タスク検索で使用中
|
|
59
60
|
],
|
|
60
61
|
[
|
|
61
62
|
{ status: 1, runsAt: -1 },
|
|
62
|
-
{ name: 'searchByStatus-v2' }
|
|
63
|
+
{ name: 'searchByStatus-v2' } // タスク検索で使用中
|
|
63
64
|
],
|
|
64
65
|
[
|
|
65
66
|
{ runsAt: -1 },
|
|
66
|
-
{ name: 'searchByRunsAt-v2' }
|
|
67
|
-
],
|
|
68
|
-
[
|
|
69
|
-
// identifier追加(2023-09-01~)
|
|
70
|
-
{ identifier: 1, runsAt: -1 },
|
|
71
|
-
{
|
|
72
|
-
name: 'searchByIdentifier',
|
|
73
|
-
partialFilterExpression: {
|
|
74
|
-
identifier: { $exists: true }
|
|
75
|
-
}
|
|
76
|
-
}
|
|
67
|
+
{ name: 'searchByRunsAt-v2' } // タスク検索で使用中
|
|
77
68
|
],
|
|
69
|
+
// identifierはユニークインデックス有なので不要(2026-08-07~)
|
|
70
|
+
// [
|
|
71
|
+
// // identifier追加(2023-09-01~)
|
|
72
|
+
// { identifier: 1, runsAt: -1 },
|
|
73
|
+
// {
|
|
74
|
+
// name: 'searchByIdentifier',
|
|
75
|
+
// partialFilterExpression: {
|
|
76
|
+
// identifier: { $exists: true }
|
|
77
|
+
// }
|
|
78
|
+
// }
|
|
79
|
+
// ],
|
|
78
80
|
[
|
|
79
81
|
{ dateAborted: 1, runsAt: -1 },
|
|
80
82
|
{
|
|
81
|
-
name: 'searchByDateAborted',
|
|
83
|
+
name: 'searchByDateAborted', // notifyAbortedTasksByEmailで使用中
|
|
82
84
|
partialFilterExpression: {
|
|
83
85
|
dateAborted: { $type: 'date' }
|
|
84
86
|
}
|
|
85
87
|
}
|
|
86
88
|
],
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
],
|
|
105
|
-
[
|
|
106
|
-
{ remainingNumberOfTries: 1, runsAt: -1 },
|
|
107
|
-
{ name: 'searchByRemainingNumberOfTries-v2' }
|
|
108
|
-
],
|
|
109
|
-
[
|
|
110
|
-
{ 'data.agent.id': 1, runsAt: -1 },
|
|
111
|
-
{
|
|
112
|
-
name: 'searchByDataAgentId',
|
|
113
|
-
partialFilterExpression: {
|
|
114
|
-
'data.agent.id': { $exists: true }
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
],
|
|
118
|
-
[
|
|
119
|
-
{ 'data.object.orderNumber': 1, runsAt: -1 },
|
|
120
|
-
{
|
|
121
|
-
name: 'searchByDataObjectOrderNumber',
|
|
122
|
-
partialFilterExpression: {
|
|
123
|
-
'data.object.orderNumber': { $exists: true }
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
],
|
|
127
|
-
[
|
|
128
|
-
{ 'data.object.transactionNumber': 1, runsAt: -1 },
|
|
129
|
-
{
|
|
130
|
-
name: 'searchByDataObjectTransactionNumber',
|
|
131
|
-
partialFilterExpression: {
|
|
132
|
-
'data.object.transactionNumber': { $exists: true }
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
],
|
|
136
|
-
[
|
|
137
|
-
{ 'data.object.id': 1, runsAt: -1 },
|
|
138
|
-
{
|
|
139
|
-
name: 'searchByDataObjectId',
|
|
140
|
-
partialFilterExpression: {
|
|
141
|
-
'data.object.id': { $exists: true }
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
],
|
|
145
|
-
[
|
|
146
|
-
{ 'data.purpose.id': 1, runsAt: -1 },
|
|
147
|
-
{
|
|
148
|
-
name: 'searchByDataPurposeId',
|
|
149
|
-
partialFilterExpression: {
|
|
150
|
-
'data.purpose.id': { $exists: true }
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
],
|
|
154
|
-
[
|
|
155
|
-
{ 'data.purpose.orderNumber': 1, runsAt: -1 },
|
|
156
|
-
{
|
|
157
|
-
name: 'searchByDataPurposeOrderNumber',
|
|
158
|
-
partialFilterExpression: {
|
|
159
|
-
'data.purpose.orderNumber': { $exists: true }
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
],
|
|
89
|
+
// discontinue(2026-08-08~)
|
|
90
|
+
// [
|
|
91
|
+
// { lastTriedAt: 1, runsAt: -1 },
|
|
92
|
+
// {
|
|
93
|
+
// name: 'searchByLastTriedAt-v2',
|
|
94
|
+
// partialFilterExpression: {
|
|
95
|
+
// lastTriedAt: { $type: 'date' }
|
|
96
|
+
// }
|
|
97
|
+
// }
|
|
98
|
+
// ],
|
|
99
|
+
// discontinue(2026-08-08~)
|
|
100
|
+
// [
|
|
101
|
+
// { remainingNumberOfTries: 1, runsAt: -1 },
|
|
102
|
+
// { name: 'searchByRemainingNumberOfTries-v2' }
|
|
103
|
+
// ],
|
|
163
104
|
[
|
|
164
105
|
{ 'data.id': 1, runsAt: -1 },
|
|
165
106
|
{
|
|
@@ -169,14 +110,19 @@ const indexes = [
|
|
|
169
110
|
}
|
|
170
111
|
}
|
|
171
112
|
],
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
113
|
+
// 遅延タスク実行時のソート条件をrunsAtのみに統一したため、numberOfTriedを含めたインデックスはもう不要(2026-08-08~)
|
|
114
|
+
// [
|
|
115
|
+
// { status: 1, name: 1, numberOfTried: 1, runsAt: 1 },
|
|
116
|
+
// { name: 'executeOneByName' }
|
|
117
|
+
// ],
|
|
176
118
|
[
|
|
177
119
|
{ status: 1, runsAt: 1, name: 1 },
|
|
178
120
|
{ name: 'executeOneByNameIfExists' } // add(2025-03-08~)
|
|
179
121
|
],
|
|
122
|
+
[
|
|
123
|
+
{ status: 1, name: 1, runsAt: 1 },
|
|
124
|
+
{ name: 'runDelayedTaskByName' } // add(2026-08-05~)
|
|
125
|
+
],
|
|
180
126
|
[
|
|
181
127
|
{ status: 1, remainingNumberOfTries: 1, lastTriedAt: 1 },
|
|
182
128
|
{
|
|
@@ -195,26 +141,6 @@ const indexes = [
|
|
|
195
141
|
}
|
|
196
142
|
}
|
|
197
143
|
],
|
|
198
|
-
[
|
|
199
|
-
{ status: 1, expires: 1 },
|
|
200
|
-
{
|
|
201
|
-
name: 'makeExpiredMany',
|
|
202
|
-
partialFilterExpression: {
|
|
203
|
-
expires: { $exists: true }
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
],
|
|
207
|
-
[
|
|
208
|
-
// add unique index(2025-03-28~)
|
|
209
|
-
{ alternateName: 1 },
|
|
210
|
-
{
|
|
211
|
-
unique: true,
|
|
212
|
-
name: 'uniqueAlternateName',
|
|
213
|
-
partialFilterExpression: {
|
|
214
|
-
alternateName: { $exists: true }
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
],
|
|
218
144
|
// add unique index(dev)(2025-03-28~)
|
|
219
145
|
// add unique index(test,prod)(2026-07-08~)
|
|
220
146
|
[
|
|
@@ -226,9 +152,99 @@ const indexes = [
|
|
|
226
152
|
identifier: { $exists: true }
|
|
227
153
|
}
|
|
228
154
|
}
|
|
229
|
-
]
|
|
155
|
+
],
|
|
156
|
+
// alternateNameへのインデックスはおそらくもう不要(2026-08-07~)
|
|
157
|
+
// dev,testではインデックス削除済(2026-08-07)
|
|
158
|
+
// prodでは削除予定(2026-08-??)
|
|
159
|
+
// [
|
|
160
|
+
// // add unique index(2025-03-28~)
|
|
161
|
+
// { alternateName: 1 },
|
|
162
|
+
// {
|
|
163
|
+
// unique: true,
|
|
164
|
+
// name: 'uniqueAlternateName',
|
|
165
|
+
// partialFilterExpression: {
|
|
166
|
+
// alternateName: { $exists: true }
|
|
167
|
+
// }
|
|
168
|
+
// }
|
|
169
|
+
// ],
|
|
170
|
+
// ペイロード特定検索用はひとまず廃止(2026-08-07~)
|
|
171
|
+
// [
|
|
172
|
+
// { 'data.agent.id': 1, runsAt: -1 },
|
|
173
|
+
// {
|
|
174
|
+
// name: 'searchByDataAgentId',
|
|
175
|
+
// partialFilterExpression: {
|
|
176
|
+
// 'data.agent.id': { $exists: true }
|
|
177
|
+
// }
|
|
178
|
+
// }
|
|
179
|
+
// ],
|
|
180
|
+
// [
|
|
181
|
+
// { 'data.object.orderNumber': 1, runsAt: -1 },
|
|
182
|
+
// {
|
|
183
|
+
// name: 'searchByDataObjectOrderNumber',
|
|
184
|
+
// partialFilterExpression: {
|
|
185
|
+
// 'data.object.orderNumber': { $exists: true }
|
|
186
|
+
// }
|
|
187
|
+
// }
|
|
188
|
+
// ],
|
|
189
|
+
// [
|
|
190
|
+
// { 'data.object.transactionNumber': 1, runsAt: -1 },
|
|
191
|
+
// {
|
|
192
|
+
// name: 'searchByDataObjectTransactionNumber',
|
|
193
|
+
// partialFilterExpression: {
|
|
194
|
+
// 'data.object.transactionNumber': { $exists: true }
|
|
195
|
+
// }
|
|
196
|
+
// }
|
|
197
|
+
// ],
|
|
198
|
+
// [
|
|
199
|
+
// { 'data.object.id': 1, runsAt: -1 },
|
|
200
|
+
// {
|
|
201
|
+
// name: 'searchByDataObjectId',
|
|
202
|
+
// partialFilterExpression: {
|
|
203
|
+
// 'data.object.id': { $exists: true }
|
|
204
|
+
// }
|
|
205
|
+
// }
|
|
206
|
+
// ],
|
|
207
|
+
// [
|
|
208
|
+
// { 'data.purpose.id': 1, runsAt: -1 },
|
|
209
|
+
// {
|
|
210
|
+
// name: 'searchByDataPurposeId',
|
|
211
|
+
// partialFilterExpression: {
|
|
212
|
+
// 'data.purpose.id': { $exists: true }
|
|
213
|
+
// }
|
|
214
|
+
// }
|
|
215
|
+
// ],
|
|
216
|
+
// [
|
|
217
|
+
// { 'data.purpose.orderNumber': 1, runsAt: -1 },
|
|
218
|
+
// {
|
|
219
|
+
// name: 'searchByDataPurposeOrderNumber',
|
|
220
|
+
// partialFilterExpression: {
|
|
221
|
+
// 'data.purpose.orderNumber': { $exists: true }
|
|
222
|
+
// }
|
|
223
|
+
// }
|
|
224
|
+
// ],
|
|
230
225
|
];
|
|
231
226
|
exports.indexes = indexes;
|
|
227
|
+
const EXPIRE_AFTER_SECONDS = typeof process.env.TASK_EXPIRE_AFTER_SECONDS === 'string'
|
|
228
|
+
? Number(process.env.TASK_EXPIRE_AFTER_SECONDS)
|
|
229
|
+
: undefined;
|
|
230
|
+
// 0より大きい数値が設定されている場合のみ ttlインデックスを追加
|
|
231
|
+
if (typeof EXPIRE_AFTER_SECONDS === 'number' && EXPIRE_AFTER_SECONDS > 0) {
|
|
232
|
+
indexes.push([
|
|
233
|
+
{ runsAt: 1 },
|
|
234
|
+
{
|
|
235
|
+
name: 'ttlByRunsAt',
|
|
236
|
+
expireAfterSeconds: EXPIRE_AFTER_SECONDS,
|
|
237
|
+
partialFilterExpression: {
|
|
238
|
+
status: {
|
|
239
|
+
$in: [
|
|
240
|
+
factory_1.factory.taskStatus.Aborted,
|
|
241
|
+
factory_1.factory.taskStatus.Executed
|
|
242
|
+
]
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
]);
|
|
247
|
+
}
|
|
232
248
|
/**
|
|
233
249
|
* タスクスキーマ
|
|
234
250
|
*/
|
|
@@ -41,8 +41,15 @@ const schemaOptions = {
|
|
|
41
41
|
const indexes = [
|
|
42
42
|
[
|
|
43
43
|
{ dateIssued: 1 },
|
|
44
|
-
{
|
|
44
|
+
{
|
|
45
|
+
name: 'ttlByDateIssued', // support ttl index(2026-08-09~)
|
|
46
|
+
expireAfterSeconds: 604800 // 7 days
|
|
47
|
+
}
|
|
45
48
|
],
|
|
49
|
+
// [
|
|
50
|
+
// { dateIssued: 1 },
|
|
51
|
+
// { name: 'searchByDateIssued' }
|
|
52
|
+
// ],
|
|
46
53
|
[
|
|
47
54
|
{ 'project.id': 1, dateIssued: 1 },
|
|
48
55
|
{ name: 'searchByProjectId' }
|
|
@@ -79,7 +79,6 @@ export interface IPaymentMethodByPaymentUrl {
|
|
|
79
79
|
*/
|
|
80
80
|
export declare class OrderInTransactionRepo extends AcceptedOfferInReserveRepo {
|
|
81
81
|
private readonly orderModel;
|
|
82
|
-
private readonly transactionModel;
|
|
83
82
|
constructor(connection: Connection);
|
|
84
83
|
createPlaceOrderIfNotExists(params: Pick<IOrderInTransaction, 'orderNumber' | 'project' | 'identifier' | 'broker' | 'seller' | 'customer'>): Promise<import("mongoose").UpdateWriteOpResult | undefined>;
|
|
85
84
|
/**
|
|
@@ -177,8 +176,6 @@ export declare class OrderInTransactionRepo extends AcceptedOfferInReserveRepo {
|
|
|
177
176
|
savePaymentMethodId(params: {
|
|
178
177
|
id: string;
|
|
179
178
|
paymentMethod: IPaymentMethodByPaymentUrl;
|
|
180
|
-
}, options: {
|
|
181
|
-
savePaymentMethodIdInTransaction: boolean;
|
|
182
179
|
}): Promise<void>;
|
|
183
180
|
/**
|
|
184
181
|
* 進行中取引に保管された採用済決済方法を検索する
|
|
@@ -5,7 +5,11 @@ exports.OrderInTransactionRepo = void 0;
|
|
|
5
5
|
const errorHandler_1 = require("../errorHandler");
|
|
6
6
|
const factory_1 = require("../factory");
|
|
7
7
|
const order_1 = require("./mongoose/schemas/order");
|
|
8
|
-
|
|
8
|
+
// import {
|
|
9
|
+
// createSchema as createTransactionSchema,
|
|
10
|
+
// IModel as ITransactionModel, modelName as transactionModelName,
|
|
11
|
+
// IDocType as ITransactionDocType
|
|
12
|
+
// } from './mongoose/schemas/transaction';
|
|
9
13
|
const acceptedOfferInReserve_1 = require("./acceptedOfferInReserve");
|
|
10
14
|
// const debug = createDebug('chevre-domain:repo:orderInTransaction');
|
|
11
15
|
/**
|
|
@@ -13,11 +17,11 @@ const acceptedOfferInReserve_1 = require("./acceptedOfferInReserve");
|
|
|
13
17
|
*/
|
|
14
18
|
class OrderInTransactionRepo extends acceptedOfferInReserve_1.AcceptedOfferInReserveRepo {
|
|
15
19
|
orderModel;
|
|
16
|
-
transactionModel;
|
|
20
|
+
// private readonly transactionModel: ITransactionModel;
|
|
17
21
|
constructor(connection) {
|
|
18
22
|
super(connection);
|
|
19
23
|
this.orderModel = connection.model(order_1.modelName, (0, order_1.createSchema)());
|
|
20
|
-
this.transactionModel = connection.model
|
|
24
|
+
// this.transactionModel = connection.model<ITransactionDocType, ITransactionModel>(transactionModelName, createTransactionSchema());
|
|
21
25
|
}
|
|
22
26
|
async createPlaceOrderIfNotExists(params) {
|
|
23
27
|
const { orderNumber, project, identifier, broker, seller, customer } = params;
|
|
@@ -284,29 +288,33 @@ class OrderInTransactionRepo extends acceptedOfferInReserve_1.AcceptedOfferInRes
|
|
|
284
288
|
* 特定の進行中取引の決済方法IDを保管する
|
|
285
289
|
* transactionsへの保管としてひとまず定義(2026-07-11~)
|
|
286
290
|
*/
|
|
287
|
-
async savePaymentMethodId(params
|
|
288
|
-
const { savePaymentMethodIdInTransaction } = options;
|
|
291
|
+
async savePaymentMethodId(params) {
|
|
289
292
|
const { paymentMethodId } = params.paymentMethod;
|
|
290
293
|
if (typeof paymentMethodId !== 'string' || paymentMethodId === '') {
|
|
291
294
|
throw new factory_1.factory.errors.ArgumentNull('paymentMethod.paymentMethodId');
|
|
292
295
|
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
296
|
+
// savePaymentMethodIdInTransactionは廃止(2026-08-04~)
|
|
297
|
+
// if (savePaymentMethodIdInTransaction) {
|
|
298
|
+
// await this.transactionModel.findOneAndUpdate(
|
|
299
|
+
// {
|
|
300
|
+
// _id: { $eq: params.id },
|
|
301
|
+
// status: { $eq: factory.transactionStatusType.InProgress }
|
|
302
|
+
// },
|
|
303
|
+
// {
|
|
304
|
+
// $set: { 'object.paymentMethods': { paymentMethodId } }
|
|
305
|
+
// },
|
|
306
|
+
// {
|
|
307
|
+
// projection: { _id: 1 }
|
|
308
|
+
// }
|
|
309
|
+
// )
|
|
310
|
+
// .lean<{ _id: ObjectId }>()
|
|
311
|
+
// .exec()
|
|
312
|
+
// .then((doc) => {
|
|
313
|
+
// if (doc === null) {
|
|
314
|
+
// throw new factory.errors.NotFound(factory.transactionType.PlaceOrder);
|
|
315
|
+
// }
|
|
316
|
+
// });
|
|
317
|
+
// }
|
|
310
318
|
// 注文ドキュメントにも保管する(2026-07-12~)
|
|
311
319
|
await this.orderModel.findOneAndUpdate({
|
|
312
320
|
identifier: { $eq: params.id },
|
|
@@ -64,11 +64,14 @@ export declare class ScheduledTaskRepo {
|
|
|
64
64
|
status: factory.taskStatus.Executed | factory.taskStatus.Running | factory.taskStatus.Aborted;
|
|
65
65
|
executionResult: factory.task.IExecutionResult;
|
|
66
66
|
}): Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* cron:createImportEventCapacitiesTasksでの新タスク作成前に使用する
|
|
69
|
+
*/
|
|
67
70
|
deleteTooOldReadyTasks(params: {
|
|
68
71
|
project: {
|
|
69
72
|
id: string;
|
|
70
73
|
};
|
|
71
|
-
name: factory.taskName;
|
|
74
|
+
name: factory.taskName.ImportEventCapacitiesFromCOA;
|
|
72
75
|
runsAt: {
|
|
73
76
|
$lt: Date;
|
|
74
77
|
};
|
|
@@ -40,15 +40,6 @@ class ScheduledTaskRepo {
|
|
|
40
40
|
.map((objectId) => {
|
|
41
41
|
return { id: objectId.toHexString() };
|
|
42
42
|
});
|
|
43
|
-
// イベントは発火しない
|
|
44
|
-
// if (emitImmediately) {
|
|
45
|
-
// savedTasks.forEach((savedTask) => {
|
|
46
|
-
// taskEventEmitter.emitTaskStatusChanged({
|
|
47
|
-
// id: savedTask.id,
|
|
48
|
-
// status: factory.taskStatus.Ready
|
|
49
|
-
// });
|
|
50
|
-
// });
|
|
51
|
-
// }
|
|
52
43
|
return savedTasks;
|
|
53
44
|
}
|
|
54
45
|
else {
|
|
@@ -80,7 +71,6 @@ class ScheduledTaskRepo {
|
|
|
80
71
|
if (!(params.runsAt.$lt instanceof Date)) {
|
|
81
72
|
throw new factory_1.factory.errors.Argument('runsAt.$lt', 'must be Date');
|
|
82
73
|
}
|
|
83
|
-
// const { noEmitEvent } = options;
|
|
84
74
|
const projection = {
|
|
85
75
|
_id: 0,
|
|
86
76
|
id: { $toString: '$_id' },
|
|
@@ -106,9 +96,6 @@ class ScheduledTaskRepo {
|
|
|
106
96
|
new: true,
|
|
107
97
|
projection,
|
|
108
98
|
sort: { runsAt: factory_1.factory.sortType.Ascending } // ソートは、実行日時で固定化(2026-07-31~)
|
|
109
|
-
// ...(typeof params.sort.numberOfTried === 'number' || typeof params.sort.runsAt === 'number')
|
|
110
|
-
// ? { sort: params.sort }
|
|
111
|
-
// : undefined
|
|
112
99
|
})
|
|
113
100
|
.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
114
101
|
.lean()
|
|
@@ -116,18 +103,6 @@ class ScheduledTaskRepo {
|
|
|
116
103
|
if (doc === null) {
|
|
117
104
|
return null;
|
|
118
105
|
}
|
|
119
|
-
// if (!noEmitEvent) {
|
|
120
|
-
// const changedTask: IRunningTaskByName = {
|
|
121
|
-
// id: doc.id,
|
|
122
|
-
// status: factory.taskStatus.Running,
|
|
123
|
-
// name: nameEq
|
|
124
|
-
// };
|
|
125
|
-
// taskEventEmitter.emitTaskStatusChanged(
|
|
126
|
-
// changedTask,
|
|
127
|
-
// // 現時点でタスク遅延実行ではnext指定なし(2026-07-30)
|
|
128
|
-
// // (typeof next === 'function') ? next : undefined
|
|
129
|
-
// );
|
|
130
|
-
// }
|
|
131
106
|
return doc;
|
|
132
107
|
}
|
|
133
108
|
/**
|
|
@@ -162,6 +137,9 @@ class ScheduledTaskRepo {
|
|
|
162
137
|
})
|
|
163
138
|
.exec();
|
|
164
139
|
}
|
|
140
|
+
/**
|
|
141
|
+
* cron:createImportEventCapacitiesTasksでの新タスク作成前に使用する
|
|
142
|
+
*/
|
|
165
143
|
async deleteTooOldReadyTasks(params) {
|
|
166
144
|
return this.scheduledTaskModel.deleteMany({
|
|
167
145
|
'project.id': { $eq: params.project.id },
|