@chevre/domain 25.2.0-alpha.8 → 26.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/chevre/eventEmitter/task.d.ts +2 -1
- package/lib/chevre/factory/customerTelephone2COATelNum.d.ts +3 -0
- package/lib/chevre/factory/customerTelephone2COATelNum.js +22 -0
- package/lib/chevre/repo/action/acceptPay.d.ts +15 -0
- package/lib/chevre/repo/action/acceptPay.js +47 -19
- package/lib/chevre/repo/action/actionProcess.js +57 -57
- package/lib/chevre/repo/action.d.ts +16 -9
- package/lib/chevre/repo/action.js +99 -180
- package/lib/chevre/repo/adminTask.d.ts +37 -0
- package/lib/chevre/repo/adminTask.js +163 -0
- package/lib/chevre/repo/aggregateOffer.d.ts +3 -14
- package/lib/chevre/repo/aggregateOffer.js +16 -125
- package/lib/chevre/repo/aggregateTask.d.ts +37 -0
- package/lib/chevre/repo/aggregateTask.js +136 -0
- package/lib/chevre/repo/asyncAction.d.ts +69 -0
- package/lib/chevre/repo/asyncAction.js +237 -0
- package/lib/chevre/repo/concurrentLock.d.ts +3 -1
- package/lib/chevre/repo/creativeWork.d.ts +2 -3
- package/lib/chevre/repo/credentials.d.ts +2 -1
- package/lib/chevre/repo/customerType.d.ts +2 -3
- package/lib/chevre/repo/event.d.ts +10 -11
- package/lib/chevre/repo/eventOffer.d.ts +4 -5
- package/lib/chevre/repo/eventSellerMakesOffer.d.ts +2 -3
- package/lib/chevre/repo/eventSeries.d.ts +4 -5
- package/lib/chevre/repo/message.d.ts +1 -1
- package/lib/chevre/repo/message.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/action.js +57 -57
- package/lib/chevre/repo/mongoose/schemas/asyncAction.d.ts +13 -0
- package/lib/chevre/repo/mongoose/schemas/asyncAction.js +89 -0
- package/lib/chevre/repo/mongoose/schemas/order.d.ts +4 -0
- package/lib/chevre/repo/mongoose/schemas/order.js +10 -0
- package/lib/chevre/repo/mongoose/schemas/scheduledTasks.d.ts +16 -0
- package/lib/chevre/repo/mongoose/schemas/scheduledTasks.js +103 -0
- package/lib/chevre/repo/mongoose/schemas/setting.d.ts +4 -0
- package/lib/chevre/repo/mongoose/schemas/task.d.ts +6 -1
- package/lib/chevre/repo/mongoose/schemas/task.js +12 -12
- package/lib/chevre/repo/note.d.ts +3 -4
- package/lib/chevre/repo/noteAboutOrder.d.ts +2 -3
- package/lib/chevre/repo/offer/offerInCatalogReadOnly.d.ts +2 -2
- package/lib/chevre/repo/offer/unitPriceInCatalog.d.ts +2 -2
- package/lib/chevre/repo/offer/unitPriceInCatalog.js +59 -11
- package/lib/chevre/repo/offerCatalog.d.ts +2 -3
- package/lib/chevre/repo/offerCatalogItem.d.ts +2 -3
- package/lib/chevre/repo/order.d.ts +2 -0
- package/lib/chevre/repo/order.js +14 -14
- package/lib/chevre/repo/orderInTransaction.d.ts +68 -1
- package/lib/chevre/repo/orderInTransaction.js +181 -3
- package/lib/chevre/repo/passport.d.ts +2 -1
- package/lib/chevre/repo/person.d.ts +0 -15
- package/lib/chevre/repo/person.js +122 -108
- package/lib/chevre/repo/place/entranceGate.d.ts +4 -5
- package/lib/chevre/repo/place/movieTheater.d.ts +3 -4
- package/lib/chevre/repo/place/screeningRoom.d.ts +4 -5
- package/lib/chevre/repo/place/seat.d.ts +4 -5
- package/lib/chevre/repo/place/section.d.ts +3 -4
- package/lib/chevre/repo/priceSpecification.d.ts +4 -4
- package/lib/chevre/repo/product.d.ts +3 -4
- package/lib/chevre/repo/rateLimit/offer.d.ts +3 -1
- package/lib/chevre/repo/rateLimit/offer.js +0 -12
- package/lib/chevre/repo/reservation.d.ts +2 -3
- package/lib/chevre/repo/scheduledTask.d.ts +90 -0
- package/lib/chevre/repo/scheduledTask.js +223 -0
- package/lib/chevre/repo/sellerMakesOffer.d.ts +3 -4
- package/lib/chevre/repo/stockHolder.d.ts +1 -1
- package/lib/chevre/repo/stockHolder.js +0 -146
- package/lib/chevre/repo/task.d.ts +30 -71
- package/lib/chevre/repo/task.js +59 -345
- package/lib/chevre/repo/transaction/placeOrder.d.ts +2 -45
- package/lib/chevre/repo/transaction/placeOrder.js +43 -83
- package/lib/chevre/repo/transaction.d.ts +2 -2
- package/lib/chevre/repo/transactionNumberCounter.js +0 -34
- package/lib/chevre/repo/transactionProcess.d.ts +2 -1
- package/lib/chevre/repo/transactionProcess.js +0 -13
- package/lib/chevre/repository.d.ts +20 -0
- package/lib/chevre/repository.js +46 -2
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +1 -1
- package/lib/chevre/service/aggregation/system.d.ts +2 -2
- package/lib/chevre/service/aggregation/system.js +1 -1
- package/lib/chevre/service/assetTransaction/cancelReservation.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/exportTasksById.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/start/factory.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/start/factory.js +3 -4
- package/lib/chevre/service/assetTransaction/pay/start.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/refund.js +1 -1
- package/lib/chevre/service/assetTransaction/reserve/exportTasksById.js +1 -1
- package/lib/chevre/service/assetTransaction/reserveCOA/cancel.js +1 -67
- package/lib/chevre/service/asyncAction.d.ts +16 -0
- package/lib/chevre/service/asyncAction.js +36 -0
- package/lib/chevre/service/asyncActionHandler/onOperationFailed.d.ts +15 -0
- package/lib/chevre/service/asyncActionHandler/onOperationFailed.js +42 -0
- package/lib/chevre/service/asyncActionHandler.d.ts +13 -0
- package/lib/chevre/service/asyncActionHandler.js +89 -0
- package/lib/chevre/service/notification/factory.d.ts +2 -4
- package/lib/chevre/service/notification/factory.js +26 -24
- package/lib/chevre/service/notification/notifyAbortedTasksByEmail.d.ts +12 -6
- package/lib/chevre/service/notification/notifyAbortedTasksByEmail.js +12 -4
- package/lib/chevre/service/offer/event/authorize/factory.d.ts +3 -5
- package/lib/chevre/service/offer/event/authorize/factory.js +93 -75
- package/lib/chevre/service/offer/event/authorize.d.ts +0 -4
- package/lib/chevre/service/offer/event/authorize.js +2 -2
- package/lib/chevre/service/offer/event/voidTransaction.d.ts +1 -1
- package/lib/chevre/service/offer/event/voidTransactionByActionId.d.ts +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +6 -7
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +10 -10
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/validateAcceptedOffers.js +2 -1
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.d.ts +0 -5
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +15 -12
- package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.d.ts +0 -5
- package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.js +2 -2
- package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.d.ts +4 -0
- package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.js +20 -9
- package/lib/chevre/service/offer/onEventChanged.js +2 -2
- package/lib/chevre/service/order/confirmPayTransaction.js +1 -1
- package/lib/chevre/service/order/deleteOrder.d.ts +5 -1
- package/lib/chevre/service/order/deleteOrder.js +8 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionCanceled.js +19 -11
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.d.ts +2 -0
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.d.ts +2 -2
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.js +1 -7
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +2 -0
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.js +2 -0
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +3 -3
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.d.ts +0 -3
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.js +73 -44
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.d.ts +5 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.js +53 -33
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/processOrder.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +6 -4
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +3 -7
- package/lib/chevre/service/order/onOrderUpdated.js +1 -1
- package/lib/chevre/service/order/payOrder.d.ts +2 -0
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.d.ts +2 -1
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +13 -58
- package/lib/chevre/service/order/placeOrder/factory.js +3 -21
- package/lib/chevre/service/order/placeOrder.d.ts +4 -5
- package/lib/chevre/service/order/placeOrder.js +20 -31
- package/lib/chevre/service/payment/any/authorize/fixOrderAsNeeded.js +1 -2
- package/lib/chevre/service/payment/any/authorize/fixTransactionNumber.d.ts +3 -2
- package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.d.ts +4 -3
- package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.js +3 -31
- package/lib/chevre/service/payment/any/authorize.js +13 -37
- package/lib/chevre/service/payment/any/factory.d.ts +7 -7
- package/lib/chevre/service/payment/any/factory.js +19 -22
- package/lib/chevre/service/payment/any/findAcceptAction.d.ts +7 -1
- package/lib/chevre/service/payment/any/findAcceptAction.js +34 -15
- package/lib/chevre/service/payment/any/findAuthorizeAction.d.ts +4 -0
- package/lib/chevre/service/payment/any/findAuthorizeAction.js +20 -9
- package/lib/chevre/service/payment/any/findCheckAction.d.ts +4 -0
- package/lib/chevre/service/payment/any/findCheckAction.js +20 -9
- package/lib/chevre/service/payment/any/invalidatePaymentUrl.d.ts +2 -0
- package/lib/chevre/service/payment/any/invalidatePaymentUrl.js +5 -67
- package/lib/chevre/service/payment/any/onPayActionCompleted.js +1 -1
- package/lib/chevre/service/payment/any/onRefundActionCompletedOrFailed.js +1 -1
- package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +4 -0
- package/lib/chevre/service/payment/any/publishPaymentUrl.js +4 -18
- package/lib/chevre/service/payment/any/voidPayTransaction.d.ts +2 -0
- package/lib/chevre/service/payment/any/voidPayTransaction.js +1 -23
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.js +5 -9
- package/lib/chevre/service/reserve/adminFindReservations.d.ts +15 -0
- package/lib/chevre/service/reserve/adminFindReservations.js +35 -0
- package/lib/chevre/service/reserve/potentialActions/onPendingReservationCanceled.js +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.js +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +20 -11
- package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationsCreated.js +1 -1
- package/lib/chevre/service/reserve/searchByOrder.js +2 -6
- package/lib/chevre/service/reserve.d.ts +2 -2
- package/lib/chevre/service/reserve.js +3 -3
- package/lib/chevre/service/scheduledTask.d.ts +11 -0
- package/lib/chevre/service/scheduledTask.js +40 -0
- package/lib/chevre/service/scheduledTaskHandler/onOperationFailed.d.ts +14 -0
- package/lib/chevre/service/scheduledTaskHandler/onOperationFailed.js +56 -0
- package/lib/chevre/service/scheduledTaskHandler.d.ts +12 -0
- package/lib/chevre/service/scheduledTaskHandler.js +66 -0
- package/lib/chevre/service/task/aggregateOffers.d.ts +2 -2
- package/lib/chevre/service/task/aggregateOffers.js +2 -1
- package/lib/chevre/service/task/aggregateScreeningEvent.d.ts +2 -2
- package/lib/chevre/service/task/aggregateScreeningEvent.js +2 -1
- package/lib/chevre/service/task/authorizePayment.js +3 -1
- package/lib/chevre/service/task/cancelReservation.d.ts +2 -2
- package/lib/chevre/service/task/cancelReservation.js +2 -1
- package/lib/chevre/service/task/confirmPayTransaction.js +0 -1
- package/lib/chevre/service/task/confirmReserveTransaction.js +3 -8
- package/lib/chevre/service/task/deleteTransaction.d.ts +2 -2
- package/lib/chevre/service/task/deleteTransaction.js +2 -1
- package/lib/chevre/service/task/onAssetTransactionStatusChanged.d.ts +2 -2
- package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +4 -3
- package/lib/chevre/service/task/onEventChanged.d.ts +2 -2
- package/lib/chevre/service/task/onEventChanged.js +2 -1
- package/lib/chevre/service/task/onOrderPaymentCompleted.d.ts +2 -2
- package/lib/chevre/service/task/onOrderPaymentCompleted.js +4 -1
- package/lib/chevre/service/task/onResourceUpdated/onAggregateOfferUpdated.js +2 -2
- package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +1 -1
- package/lib/chevre/service/task/onResourceUpdated/onOfferCatalogUpdated.js +1 -1
- package/lib/chevre/service/task/onResourceUpdated.d.ts +2 -2
- package/lib/chevre/service/task/onResourceUpdated.js +10 -9
- package/lib/chevre/service/task/placeOrder.d.ts +2 -2
- package/lib/chevre/service/task/placeOrder.js +6 -3
- package/lib/chevre/service/task/publishPaymentUrl.js +7 -3
- package/lib/chevre/service/task/refund.d.ts +2 -2
- package/lib/chevre/service/task/refund.js +4 -10
- package/lib/chevre/service/task/reserve.d.ts +2 -2
- package/lib/chevre/service/task/reserve.js +2 -1
- package/lib/chevre/service/task/returnOrder.d.ts +2 -2
- package/lib/chevre/service/task/returnOrder.js +2 -1
- package/lib/chevre/service/task/returnPayTransaction.js +1 -1
- package/lib/chevre/service/task/sendOrder.d.ts +2 -2
- package/lib/chevre/service/task/sendOrder.js +2 -1
- package/lib/chevre/service/task/voidPayTransaction.js +3 -7
- package/lib/chevre/service/task/voidPayment.d.ts +2 -2
- package/lib/chevre/service/task/voidPayment.js +2 -1
- package/lib/chevre/service/task/voidReserveTransaction.d.ts +1 -1
- package/lib/chevre/service/taskHandler/onOperationFailed/informTaskIfNeeded.js +1 -1
- package/lib/chevre/service/taskHandler/onOperationFailed.js +1 -1
- package/lib/chevre/service/taskHandler.d.ts +2 -2
- package/lib/chevre/service/taskHandler.js +36 -37
- package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.d.ts +15 -0
- package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.js +51 -0
- package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.d.ts +23 -0
- package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.js +64 -0
- package/lib/chevre/service/transaction/deleteTransaction.d.ts +1 -1
- package/lib/chevre/service/transaction/deleteTransaction.js +15 -152
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.d.ts +28 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.js +11 -12
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.d.ts +4 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.js +6 -7
- package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.d.ts +32 -4
- package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.js +10 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/factory.d.ts +5 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +6 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +23 -9
- package/lib/chevre/service/transaction/placeOrder/confirm.d.ts +6 -5
- package/lib/chevre/service/transaction/placeOrder/confirm.js +30 -40
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +1 -1
- package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.d.ts +4 -7
- package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.js +33 -15
- package/lib/chevre/service/transaction/placeOrder/start.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/updateAgent/fixCustomer.d.ts +20 -0
- package/lib/chevre/service/transaction/placeOrder/updateAgent/fixCustomer.js +63 -0
- package/lib/chevre/service/transaction/placeOrder/updateAgent.d.ts +0 -1
- package/lib/chevre/service/transaction/placeOrder/updateAgent.js +17 -86
- package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -1
- package/lib/chevre/service/transaction/returnOrder.js +1 -1
- package/lib/chevre/service.d.ts +8 -0
- package/lib/chevre/service.js +23 -1
- package/lib/chevre/taskSettings.d.ts +3 -4
- package/package.json +8 -11
- package/lib/chevre/service/order/findConfirmedPlaceOrder.d.ts +0 -13
- package/lib/chevre/service/order/findConfirmedPlaceOrder.js +0 -32
- package/lib/chevre/service/reserve/findReservations.d.ts +0 -33
- package/lib/chevre/service/reserve/findReservations.js +0 -61
|
@@ -186,22 +186,6 @@ class PlaceOrderRepo {
|
|
|
186
186
|
.lean()
|
|
187
187
|
.exec();
|
|
188
188
|
}
|
|
189
|
-
/**
|
|
190
|
-
* 進行中取引に保管された採用済決済方法を検索する
|
|
191
|
-
*/
|
|
192
|
-
async findInProgressPaymentMethodId(params) {
|
|
193
|
-
const doc = await this.transactionModel.findOne({
|
|
194
|
-
_id: { $eq: params.id },
|
|
195
|
-
typeOf: { $eq: factory_1.factory.transactionType.PlaceOrder },
|
|
196
|
-
status: { $eq: factory_1.factory.transactionStatusType.InProgress }
|
|
197
|
-
}, { 'object.paymentMethods': 1 })
|
|
198
|
-
.lean() // 2024-08-26~
|
|
199
|
-
.exec();
|
|
200
|
-
if (doc === null) {
|
|
201
|
-
throw new factory_1.factory.errors.NotFound(this.transactionModel.modelName, `${factory_1.factory.transactionType.PlaceOrder} ${factory_1.factory.transactionStatusType.InProgress} not found`);
|
|
202
|
-
}
|
|
203
|
-
return doc.object.paymentMethods;
|
|
204
|
-
}
|
|
205
189
|
// /**
|
|
206
190
|
// * 取引の注文番号を検索する
|
|
207
191
|
// */
|
|
@@ -226,22 +210,31 @@ class PlaceOrderRepo {
|
|
|
226
210
|
// }
|
|
227
211
|
// return doc.object.orderNumber;
|
|
228
212
|
// }
|
|
229
|
-
/**
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
async findInProgressConfirmationNumberById(params
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
}
|
|
213
|
+
// /**
|
|
214
|
+
// * 取引の確認番号を検索する
|
|
215
|
+
// */
|
|
216
|
+
// public async findInProgressConfirmationNumberById(params: {
|
|
217
|
+
// id: string;
|
|
218
|
+
// status: { $in: factory.transactionStatusType[] };
|
|
219
|
+
// }): Promise<string | undefined> {
|
|
220
|
+
// const doc = await this.transactionModel.findOne(
|
|
221
|
+
// {
|
|
222
|
+
// _id: { $eq: params.id },
|
|
223
|
+
// typeOf: { $eq: factory.transactionType.PlaceOrder },
|
|
224
|
+
// status: { $in: params.status.$in }
|
|
225
|
+
// },
|
|
226
|
+
// { 'object.confirmationNumber': 1 }
|
|
227
|
+
// )
|
|
228
|
+
// .lean<{ object: Pick<factory.transaction.placeOrder.IObject, 'confirmationNumber'> }>() // 2024-08-26~
|
|
229
|
+
// .exec();
|
|
230
|
+
// if (doc === null) {
|
|
231
|
+
// throw new factory.errors.NotFound(
|
|
232
|
+
// this.transactionModel.modelName,
|
|
233
|
+
// `${factory.transactionType.PlaceOrder} ${params.status.$in.join(' or ')} not found`
|
|
234
|
+
// );
|
|
235
|
+
// }
|
|
236
|
+
// return doc.object.confirmationNumber;
|
|
237
|
+
// }
|
|
245
238
|
/**
|
|
246
239
|
* 取引期限変更
|
|
247
240
|
*/
|
|
@@ -263,47 +256,6 @@ class PlaceOrderRepo {
|
|
|
263
256
|
throw new factory_1.factory.errors.NotFound(this.transactionModel.modelName, `${params.typeOf} ${factory_1.factory.transactionStatusType.InProgress} not found`);
|
|
264
257
|
}
|
|
265
258
|
}
|
|
266
|
-
/**
|
|
267
|
-
* 取引オブジェクトを更新
|
|
268
|
-
* 注文名称など
|
|
269
|
-
*/
|
|
270
|
-
async updateObject(params) {
|
|
271
|
-
const doc = await this.transactionModel.findOneAndUpdate({
|
|
272
|
-
_id: { $eq: params.id },
|
|
273
|
-
typeOf: { $eq: params.typeOf },
|
|
274
|
-
status: { $eq: factory_1.factory.transactionStatusType.InProgress }
|
|
275
|
-
}, {
|
|
276
|
-
$set: {
|
|
277
|
-
...(typeof params.object?.name === 'string') ? { 'object.name': params.object.name } : undefined
|
|
278
|
-
}
|
|
279
|
-
}, {
|
|
280
|
-
projection: { _id: 1 }
|
|
281
|
-
})
|
|
282
|
-
.lean()
|
|
283
|
-
.exec();
|
|
284
|
-
if (doc === null) {
|
|
285
|
-
throw new factory_1.factory.errors.NotFound(this.transactionModel.modelName, `${params.typeOf} ${factory_1.factory.transactionStatusType.InProgress} not found`);
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
/**
|
|
289
|
-
* 特定の進行中取引を更新する(汎用)
|
|
290
|
-
*/
|
|
291
|
-
async findByIdAndUpdateInProgress(params) {
|
|
292
|
-
await this.transactionModel.findOneAndUpdate({
|
|
293
|
-
_id: { $eq: params.id },
|
|
294
|
-
status: { $eq: factory_1.factory.transactionStatusType.InProgress }
|
|
295
|
-
}, params.update, {
|
|
296
|
-
// new: true,
|
|
297
|
-
projection: { _id: 1 }
|
|
298
|
-
})
|
|
299
|
-
.lean()
|
|
300
|
-
.exec()
|
|
301
|
-
.then((doc) => {
|
|
302
|
-
if (doc === null) {
|
|
303
|
-
throw new factory_1.factory.errors.ArgumentNull(this.transactionModel.modelName);
|
|
304
|
-
}
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
259
|
/**
|
|
308
260
|
* 進行中取引のobjectに注文番号を保管する
|
|
309
261
|
*/
|
|
@@ -316,15 +268,22 @@ class PlaceOrderRepo {
|
|
|
316
268
|
.exec();
|
|
317
269
|
return { modifiedCount: result.modifiedCount };
|
|
318
270
|
}
|
|
319
|
-
async saveConfirmationNumberIfNotExist(params
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
}
|
|
271
|
+
// public async saveConfirmationNumberIfNotExist(params: {
|
|
272
|
+
// id: string;
|
|
273
|
+
// status: { $in: factory.transactionStatusType[] };
|
|
274
|
+
// confirmationNumber: string;
|
|
275
|
+
// }): Promise<void> {
|
|
276
|
+
// await this.transactionModel.updateOne(
|
|
277
|
+
// {
|
|
278
|
+
// _id: { $eq: params.id },
|
|
279
|
+
// // status: { $eq: factory.transactionStatusType.InProgress },
|
|
280
|
+
// status: { $in: params.status.$in },
|
|
281
|
+
// 'object.confirmationNumber': { $exists: false }
|
|
282
|
+
// },
|
|
283
|
+
// { $set: { 'object.confirmationNumber': params.confirmationNumber } }
|
|
284
|
+
// )
|
|
285
|
+
// .exec();
|
|
286
|
+
// }
|
|
328
287
|
/**
|
|
329
288
|
* 進行中の注文取引を取得する
|
|
330
289
|
*/
|
|
@@ -441,8 +400,9 @@ class PlaceOrderRepo {
|
|
|
441
400
|
endDate,
|
|
442
401
|
'object.orderDate': params.object.orderDate, // add(2026-06-15~)
|
|
443
402
|
'object.orderNumber': params.object.orderNumber, // add(2026-06-27~)
|
|
403
|
+
'object.confirmationNumber': params.object.confirmationNumber, // add(2026-07-08~)
|
|
444
404
|
result: params.result, // resultを更新
|
|
445
|
-
potentialActions: params.potentialActions //
|
|
405
|
+
...((params.potentialActions !== undefined) && { potentialActions: params.potentialActions }) // support undefined(2026-07-17~)
|
|
446
406
|
}, {
|
|
447
407
|
new: true,
|
|
448
408
|
projection: { _id: 1 }
|
|
@@ -144,7 +144,7 @@ export declare class TransactionRepo {
|
|
|
144
144
|
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
145
145
|
status: factory.transactionStatusType;
|
|
146
146
|
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
147
|
-
potentialActions?:
|
|
147
|
+
potentialActions?: undefined;
|
|
148
148
|
} & {
|
|
149
149
|
_id: import("mongoose").Types.ObjectId;
|
|
150
150
|
} & {
|
|
@@ -182,7 +182,7 @@ export declare class TransactionRepo {
|
|
|
182
182
|
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
183
183
|
status: factory.transactionStatusType;
|
|
184
184
|
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
185
|
-
potentialActions?:
|
|
185
|
+
potentialActions?: undefined;
|
|
186
186
|
} & {
|
|
187
187
|
_id: import("mongoose").Types.ObjectId;
|
|
188
188
|
} & {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TransactionNumberCounterRepo = void 0;
|
|
4
|
-
// import { RedisClientType } from 'redis';
|
|
5
4
|
const errorHandler_1 = require("../errorHandler");
|
|
6
5
|
const factory_1 = require("../factory");
|
|
7
6
|
const transactionNumber_1 = require("./mongoose/schemas/transactionNumber");
|
|
@@ -10,44 +9,11 @@ const MAX_RETRY_INCREMENT = 1;
|
|
|
10
9
|
* 取引番号カウンターリポジトリ
|
|
11
10
|
*/
|
|
12
11
|
class TransactionNumberCounterRepo {
|
|
13
|
-
// private readonly redisClient: RedisClientType;
|
|
14
12
|
transactionNumberModel;
|
|
15
13
|
constructor(params) {
|
|
16
14
|
const { connection } = params;
|
|
17
|
-
// this.redisClient = redisClient;
|
|
18
15
|
this.transactionNumberModel = connection.model(transactionNumber_1.modelName, (0, transactionNumber_1.createSchema)());
|
|
19
16
|
}
|
|
20
|
-
// public async incrementByRedis(params: {
|
|
21
|
-
// identifier: string;
|
|
22
|
-
// includedInDataCatalog: {
|
|
23
|
-
// identifier: DataCatalogIdentifier;
|
|
24
|
-
// };
|
|
25
|
-
// expires: Date;
|
|
26
|
-
// }): Promise<number> {
|
|
27
|
-
// // const now = moment();
|
|
28
|
-
// const { expires } = params;
|
|
29
|
-
// const key = `${params.includedInDataCatalog.identifier}:${params.identifier}`;
|
|
30
|
-
// // const TTL = moment(expires)
|
|
31
|
-
// // .diff(now, 'seconds');
|
|
32
|
-
// const [incrReply, expireAtReply] = await this.redisClient.multi()
|
|
33
|
-
// .incr(key)
|
|
34
|
-
// // .expire(key, TTL)
|
|
35
|
-
// .expireAt(key, expires)
|
|
36
|
-
// .exec();
|
|
37
|
-
// // tslint:disable-next-line:no-single-line-block-comment
|
|
38
|
-
// /* istanbul ignore else: please write tests */
|
|
39
|
-
// if (typeof incrReply !== 'number') {
|
|
40
|
-
// // 基本的にありえないフロー
|
|
41
|
-
// throw new factory.errors.Internal('transaction number not incremented unexpectedly');
|
|
42
|
-
// }
|
|
43
|
-
// // expireAtReplyの検証も追加する(2023-04-19~)
|
|
44
|
-
// const expiredSet = expireAtReply === 1 || <any>expireAtReply === true;
|
|
45
|
-
// if (!expiredSet) {
|
|
46
|
-
// // 基本的にありえないフロー
|
|
47
|
-
// throw new factory.errors.Internal('transaction number expiration not set unexpectedly');
|
|
48
|
-
// }
|
|
49
|
-
// return incrReply;
|
|
50
|
-
// }
|
|
51
17
|
async incrementByMongo(params) {
|
|
52
18
|
const now = new Date();
|
|
53
19
|
const dataFeedExpires = params.expires;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { createClient } from 'redis';
|
|
2
2
|
import { factory } from '../factory';
|
|
3
3
|
interface IProcessKey {
|
|
4
4
|
typeOf: factory.transactionType;
|
|
@@ -13,6 +13,7 @@ interface IProcessKey {
|
|
|
13
13
|
interface IOptions {
|
|
14
14
|
lockExpiresInSeconds: number;
|
|
15
15
|
}
|
|
16
|
+
type RedisClientType = ReturnType<typeof createClient>;
|
|
16
17
|
/**
|
|
17
18
|
* 取引プロセスリポジトリ
|
|
18
19
|
*/
|
|
@@ -16,10 +16,8 @@ const DEFAULT_LOCK_EXPIRES = 120;
|
|
|
16
16
|
class TransactionProcessRepo {
|
|
17
17
|
concurrentLockRepo;
|
|
18
18
|
options;
|
|
19
|
-
// private readonly redisClient: RedisClientType;
|
|
20
19
|
constructor(redisClient, options) {
|
|
21
20
|
this.concurrentLockRepo = new concurrentLock_1.ConcurrentLockRepo({ redisClient });
|
|
22
|
-
// this.redisClient = redisClient;
|
|
23
21
|
this.options = options;
|
|
24
22
|
}
|
|
25
23
|
static CREATE_REDIS_KEY(params) {
|
|
@@ -44,16 +42,6 @@ class TransactionProcessRepo {
|
|
|
44
42
|
catch (_error) {
|
|
45
43
|
throw new factory_1.factory.errors.AlreadyInUse(params.typeOf, [], 'Another transaction process in progress');
|
|
46
44
|
}
|
|
47
|
-
// const results = await this.redisClient.multi()
|
|
48
|
-
// .setNX(key, '1')
|
|
49
|
-
// .expire(key, ttl)
|
|
50
|
-
// .exec();
|
|
51
|
-
// debug('locked,', params.id, results);
|
|
52
|
-
// if (Array.isArray(results) && (results[0] === 1 || (<any>results)[0] === true)) {
|
|
53
|
-
// return;
|
|
54
|
-
// } else {
|
|
55
|
-
// throw new factory.errors.AlreadyInUse(params.typeOf, [], 'Another transaction process in progress');
|
|
56
|
-
// }
|
|
57
45
|
}
|
|
58
46
|
async unlock(params) {
|
|
59
47
|
const key = TransactionProcessRepo.CREATE_REDIS_KEY(params);
|
|
@@ -62,7 +50,6 @@ class TransactionProcessRepo {
|
|
|
62
50
|
about: { identifier: key, typeOf: 'Thing' },
|
|
63
51
|
audience: { identifier: '1', typeOf: 'Audience' }
|
|
64
52
|
});
|
|
65
|
-
// await this.redisClient.del([key]);
|
|
66
53
|
}
|
|
67
54
|
}
|
|
68
55
|
exports.TransactionProcessRepo = TransactionProcessRepo;
|
|
@@ -15,11 +15,14 @@ import type { CheckMovieTicketActionRepo } from './repo/action/checkMovieTicket'
|
|
|
15
15
|
import type { CheckThingActionRepo } from './repo/action/checkThing';
|
|
16
16
|
import type { PayActionRepo } from './repo/action/pay';
|
|
17
17
|
import type { RefundActionRepo } from './repo/action/refund';
|
|
18
|
+
import type { AsyncActionRepo } from './repo/asyncAction';
|
|
18
19
|
import type { AdditionalPropertyRepo } from './repo/additionalProperty';
|
|
20
|
+
import type { AdminTaskRepo } from './repo/adminTask';
|
|
19
21
|
import type { AggregateActionRepo } from './repo/aggregateAction';
|
|
20
22
|
import type { AggregateOfferRepo } from './repo/aggregateOffer';
|
|
21
23
|
import type { AggregateOrderRepo } from './repo/aggregateOrder';
|
|
22
24
|
import type { AggregateReservationRepo } from './repo/aggregateReservation';
|
|
25
|
+
import type { AggregateTaskRepo } from './repo/aggregateTask';
|
|
23
26
|
import type { AggregationRepo } from './repo/aggregation';
|
|
24
27
|
import type { AssetTransactionRepo } from './repo/assetTransaction';
|
|
25
28
|
import type { ReserveTransactionRepo } from './repo/assetTransaction/reserve';
|
|
@@ -85,6 +88,7 @@ import type { MemberSettingRepo } from './repo/setting/member';
|
|
|
85
88
|
import type { RateLimitSettingRepo } from './repo/setting/rateLimit';
|
|
86
89
|
import type { WaiterSettingRepo } from './repo/setting/waiter';
|
|
87
90
|
import type { StockHolderRepo } from './repo/stockHolder';
|
|
91
|
+
import type { ScheduledTaskRepo } from './repo/scheduledTask';
|
|
88
92
|
import type { TaskRepo } from './repo/task';
|
|
89
93
|
import type { TicketRepo } from './repo/ticket';
|
|
90
94
|
import type { TransactionRepo } from './repo/transaction';
|
|
@@ -158,10 +162,18 @@ export type AdditionalProperty = AdditionalPropertyRepo;
|
|
|
158
162
|
export declare namespace AdditionalProperty {
|
|
159
163
|
function createInstance(...params: ConstructorParameters<typeof AdditionalPropertyRepo>): Promise<AdditionalPropertyRepo>;
|
|
160
164
|
}
|
|
165
|
+
export type AdminTask = AdminTaskRepo;
|
|
166
|
+
export declare namespace AdminTask {
|
|
167
|
+
function createInstance(...params: ConstructorParameters<typeof AdminTaskRepo>): Promise<AdminTaskRepo>;
|
|
168
|
+
}
|
|
161
169
|
export type AggregateAction = AggregateActionRepo;
|
|
162
170
|
export declare namespace AggregateAction {
|
|
163
171
|
function createInstance(...params: ConstructorParameters<typeof AggregateActionRepo>): Promise<AggregateActionRepo>;
|
|
164
172
|
}
|
|
173
|
+
export type AggregateTask = AggregateTaskRepo;
|
|
174
|
+
export declare namespace AggregateTask {
|
|
175
|
+
function createInstance(...params: ConstructorParameters<typeof AggregateTaskRepo>): Promise<AggregateTaskRepo>;
|
|
176
|
+
}
|
|
165
177
|
export type AggregateOffer = AggregateOfferRepo;
|
|
166
178
|
export declare namespace AggregateOffer {
|
|
167
179
|
function createInstance(...params: ConstructorParameters<typeof AggregateOfferRepo>): Promise<AggregateOfferRepo>;
|
|
@@ -466,10 +478,18 @@ export type StockHolder = StockHolderRepo;
|
|
|
466
478
|
export declare namespace StockHolder {
|
|
467
479
|
function createInstance(...params: ConstructorParameters<typeof StockHolderRepo>): Promise<StockHolderRepo>;
|
|
468
480
|
}
|
|
481
|
+
export type ScheduledTask = ScheduledTaskRepo;
|
|
482
|
+
export declare namespace ScheduledTask {
|
|
483
|
+
function createInstance(...params: ConstructorParameters<typeof ScheduledTaskRepo>): Promise<ScheduledTaskRepo>;
|
|
484
|
+
}
|
|
469
485
|
export type Task = TaskRepo;
|
|
470
486
|
export declare namespace Task {
|
|
471
487
|
function createInstance(...params: ConstructorParameters<typeof TaskRepo>): Promise<TaskRepo>;
|
|
472
488
|
}
|
|
489
|
+
export type AsyncAction = AsyncActionRepo;
|
|
490
|
+
export declare namespace AsyncAction {
|
|
491
|
+
function createInstance(...params: ConstructorParameters<typeof AsyncActionRepo>): Promise<AsyncActionRepo>;
|
|
492
|
+
}
|
|
473
493
|
export type Ticket = TicketRepo;
|
|
474
494
|
export declare namespace Ticket {
|
|
475
495
|
function createInstance(...params: ConstructorParameters<typeof TicketRepo>): Promise<TicketRepo>;
|
package/lib/chevre/repository.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.WebSite = exports.rateLimit = exports.TransactionProcess = exports.TransactionNumber = exports.transaction = exports.Transaction = exports.Ticket = exports.Task = exports.StockHolder = exports.setting = exports.Setting = exports.ServiceAvailableHour = exports.SellerReturnPolicy = exports.SellerPaymentAccepted = exports.SellerMakesOffer = exports.Seller = exports.Schedule = exports.Role = exports.ReserveInterface = exports.Reservation = exports.ProjectMakesOffer = exports.Project = exports.ProductHasOfferCatalog = exports.Product = exports.PriceSpecification = exports.PotentialAction = void 0;
|
|
3
|
+
exports.PendingReservation = exports.PaymentServiceProvider = exports.PaymentServiceChannel = exports.PaymentService = exports.Passport = exports.OwnershipInfo = exports.OrderNumber = exports.OrderInTransaction = exports.Order = exports.Offer = exports.OfferItemCondition = exports.OfferCatalogItem = exports.OfferCatalog = exports.NoteAboutOrder = exports.Note = exports.MovieTicketType = exports.Message = exports.MerchantReturnPolicy = exports.MemberProgram = exports.Member = exports.Issuer = exports.IdentityProvider = exports.Identity = exports.EventSeries = exports.EventSellerMakesOffer = exports.EventOffer = exports.Event = exports.EmailMessage = exports.CustomerType = exports.Customer = exports.Credentials = exports.CreativeWork = exports.ConfirmationNumber = exports.Authorization = exports.CategoryCode = exports.assetTransaction = exports.AssetTransaction = exports.Aggregation = exports.AggregateReservation = exports.AggregateOrder = exports.AggregateOffer = exports.AggregateTask = exports.AggregateAction = exports.AdminTask = exports.AdditionalProperty = exports.action = exports.Action = exports.AccountTitle = exports.AccountingReport = exports.AcceptedOffer = void 0;
|
|
4
|
+
exports.WebSite = exports.rateLimit = exports.TransactionProcess = exports.TransactionNumber = exports.transaction = exports.Transaction = exports.Ticket = exports.AsyncAction = exports.Task = exports.ScheduledTask = exports.StockHolder = exports.setting = exports.Setting = exports.ServiceAvailableHour = exports.SellerReturnPolicy = exports.SellerPaymentAccepted = exports.SellerMakesOffer = exports.Seller = exports.Schedule = exports.Role = exports.ReserveInterface = exports.Reservation = exports.ProjectMakesOffer = exports.Project = exports.ProductHasOfferCatalog = exports.Product = exports.PriceSpecification = exports.PotentialAction = exports.place = exports.Person = void 0;
|
|
5
5
|
var AcceptedOffer;
|
|
6
6
|
(function (AcceptedOffer) {
|
|
7
7
|
let repo;
|
|
@@ -170,6 +170,17 @@ var AdditionalProperty;
|
|
|
170
170
|
}
|
|
171
171
|
AdditionalProperty.createInstance = createInstance;
|
|
172
172
|
})(AdditionalProperty || (exports.AdditionalProperty = AdditionalProperty = {}));
|
|
173
|
+
var AdminTask;
|
|
174
|
+
(function (AdminTask) {
|
|
175
|
+
let repo;
|
|
176
|
+
async function createInstance(...params) {
|
|
177
|
+
if (repo === undefined) {
|
|
178
|
+
repo = (await import('./repo/adminTask.js')).AdminTaskRepo;
|
|
179
|
+
}
|
|
180
|
+
return new repo(...params);
|
|
181
|
+
}
|
|
182
|
+
AdminTask.createInstance = createInstance;
|
|
183
|
+
})(AdminTask || (exports.AdminTask = AdminTask = {}));
|
|
173
184
|
var AggregateAction;
|
|
174
185
|
(function (AggregateAction) {
|
|
175
186
|
let repo;
|
|
@@ -181,6 +192,17 @@ var AggregateAction;
|
|
|
181
192
|
}
|
|
182
193
|
AggregateAction.createInstance = createInstance;
|
|
183
194
|
})(AggregateAction || (exports.AggregateAction = AggregateAction = {}));
|
|
195
|
+
var AggregateTask;
|
|
196
|
+
(function (AggregateTask) {
|
|
197
|
+
let repo;
|
|
198
|
+
async function createInstance(...params) {
|
|
199
|
+
if (repo === undefined) {
|
|
200
|
+
repo = (await import('./repo/aggregateTask.js')).AggregateTaskRepo;
|
|
201
|
+
}
|
|
202
|
+
return new repo(...params);
|
|
203
|
+
}
|
|
204
|
+
AggregateTask.createInstance = createInstance;
|
|
205
|
+
})(AggregateTask || (exports.AggregateTask = AggregateTask = {}));
|
|
184
206
|
var AggregateOffer;
|
|
185
207
|
(function (AggregateOffer) {
|
|
186
208
|
let repo;
|
|
@@ -978,6 +1000,17 @@ var StockHolder;
|
|
|
978
1000
|
}
|
|
979
1001
|
StockHolder.createInstance = createInstance;
|
|
980
1002
|
})(StockHolder || (exports.StockHolder = StockHolder = {}));
|
|
1003
|
+
var ScheduledTask;
|
|
1004
|
+
(function (ScheduledTask) {
|
|
1005
|
+
let repo;
|
|
1006
|
+
async function createInstance(...params) {
|
|
1007
|
+
if (repo === undefined) {
|
|
1008
|
+
repo = (await import('./repo/scheduledTask.js')).ScheduledTaskRepo;
|
|
1009
|
+
}
|
|
1010
|
+
return new repo(...params);
|
|
1011
|
+
}
|
|
1012
|
+
ScheduledTask.createInstance = createInstance;
|
|
1013
|
+
})(ScheduledTask || (exports.ScheduledTask = ScheduledTask = {}));
|
|
981
1014
|
var Task;
|
|
982
1015
|
(function (Task) {
|
|
983
1016
|
let repo;
|
|
@@ -989,6 +1022,17 @@ var Task;
|
|
|
989
1022
|
}
|
|
990
1023
|
Task.createInstance = createInstance;
|
|
991
1024
|
})(Task || (exports.Task = Task = {}));
|
|
1025
|
+
var AsyncAction;
|
|
1026
|
+
(function (AsyncAction) {
|
|
1027
|
+
let repo;
|
|
1028
|
+
async function createInstance(...params) {
|
|
1029
|
+
if (repo === undefined) {
|
|
1030
|
+
repo = (await import('./repo/asyncAction.js')).AsyncActionRepo;
|
|
1031
|
+
}
|
|
1032
|
+
return new repo(...params);
|
|
1033
|
+
}
|
|
1034
|
+
AsyncAction.createInstance = createInstance;
|
|
1035
|
+
})(AsyncAction || (exports.AsyncAction = AsyncAction = {}));
|
|
992
1036
|
var Ticket;
|
|
993
1037
|
(function (Ticket) {
|
|
994
1038
|
let repo;
|
|
@@ -148,7 +148,7 @@ function onAggregated(params, options) {
|
|
|
148
148
|
executionResults: [],
|
|
149
149
|
data: { typeOf: factory_1.factory.eventType.ScreeningEvent, id: params.event.id }
|
|
150
150
|
};
|
|
151
|
-
await repos.task.saveMany([aggregateOffersTaskAttributes]
|
|
151
|
+
await repos.task.saveMany([aggregateOffersTaskAttributes]);
|
|
152
152
|
}
|
|
153
153
|
};
|
|
154
154
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { AggregateActionRepo } from '../../repo/aggregateAction';
|
|
2
|
+
import type { AggregateTaskRepo } from '../../repo/aggregateTask';
|
|
2
3
|
import { AggregationRepo } from '../../repo/aggregation';
|
|
3
4
|
import type { AssetTransactionRepo } from '../../repo/assetTransaction';
|
|
4
5
|
import type { EventRepo } from '../../repo/event';
|
|
5
6
|
import { OrderRepo } from '../../repo/order';
|
|
6
|
-
import type { TaskRepo } from '../../repo/task';
|
|
7
7
|
import type { TransactionRepo } from '../../repo/transaction';
|
|
8
8
|
type AggregateDurationUnit = 'days' | 'hours';
|
|
9
9
|
interface IAggregateParams {
|
|
@@ -141,7 +141,7 @@ declare function aggregateReserveTransaction(params: IAggregateParams): (repos:
|
|
|
141
141
|
}>;
|
|
142
142
|
declare function aggregateTask(params: IAggregateParams): (repos: {
|
|
143
143
|
agregation: AggregationRepo;
|
|
144
|
-
|
|
144
|
+
aggregateTask: AggregateTaskRepo;
|
|
145
145
|
}) => Promise<{
|
|
146
146
|
aggregationCount: number;
|
|
147
147
|
aggregateDuration: string;
|
|
@@ -673,7 +673,7 @@ function aggregateTask(params) {
|
|
|
673
673
|
.add(-i, params.aggregateDurationUnit)
|
|
674
674
|
.endOf(params.aggregateDurationUnit)
|
|
675
675
|
.toDate();
|
|
676
|
-
const aggregateResult = await repos.
|
|
676
|
+
const aggregateResult = await repos.aggregateTask.aggregateTask({
|
|
677
677
|
project: { id: { $ne: params.excludedProjectId } },
|
|
678
678
|
runsFrom,
|
|
679
679
|
runsThrough
|
|
@@ -90,6 +90,6 @@ function exportTasksById(params) {
|
|
|
90
90
|
default:
|
|
91
91
|
throw new factory_1.factory.errors.NotImplemented(`Transaction status "${transaction.status}" not implemented.`);
|
|
92
92
|
}
|
|
93
|
-
return repos.task.saveMany(taskAttributes
|
|
93
|
+
return repos.task.saveMany(taskAttributes);
|
|
94
94
|
};
|
|
95
95
|
}
|
|
@@ -100,6 +100,6 @@ function exportTasksById(params) {
|
|
|
100
100
|
default:
|
|
101
101
|
throw new factory_1.factory.errors.NotImplemented(`Transaction status "${transaction.status}" not implemented.`);
|
|
102
102
|
}
|
|
103
|
-
return repos.task.saveMany(taskAttributes
|
|
103
|
+
return repos.task.saveMany(taskAttributes);
|
|
104
104
|
};
|
|
105
105
|
}
|
|
@@ -167,7 +167,7 @@ function publishPaymentUrl(params, options) {
|
|
|
167
167
|
}
|
|
168
168
|
const actionResult = {
|
|
169
169
|
paymentMethodId: result.paymentMethodId,
|
|
170
|
-
paymentUrl: result.paymentUrl
|
|
170
|
+
// paymentUrl: result.paymentUrl // result.paymentUrlは廃止(2026-07-14~)
|
|
171
171
|
};
|
|
172
172
|
await repos.acceptPayAction.completeWithVoid({ typeOf: actionAttributes.typeOf, id: action.id, result: actionResult, recipe });
|
|
173
173
|
return result;
|
|
@@ -20,7 +20,7 @@ export declare function createStartParams(params: factory.assetTransaction.pay.I
|
|
|
20
20
|
*/
|
|
21
21
|
id: string;
|
|
22
22
|
}[];
|
|
23
|
-
instrument: factory.action.trade.pay.
|
|
23
|
+
instrument: factory.action.trade.pay.IPayTransactionInstrument[];
|
|
24
24
|
}, options: {
|
|
25
25
|
checkedAction: {
|
|
26
26
|
id: string;
|
|
@@ -82,7 +82,8 @@ function createStartParams(params, options) {
|
|
|
82
82
|
break;
|
|
83
83
|
}
|
|
84
84
|
default:
|
|
85
|
-
|
|
85
|
+
// no op
|
|
86
|
+
throw new factory_1.factory.errors.NotImplemented(`paymentServiceType: ${params.paymentServiceType} not implemented`);
|
|
86
87
|
}
|
|
87
88
|
// const informPaymentParams = createInformPaymentParams({
|
|
88
89
|
// paymentService: <factory.service.paymentService.IService | undefined>params.paymentService
|
|
@@ -122,12 +123,10 @@ function createStartParams(params, options) {
|
|
|
122
123
|
: paymentMethodType,
|
|
123
124
|
amount: paymentMethodAmount, // MonetaryAmount対応(2023-08-14~)
|
|
124
125
|
identifier: paymentMethodType, // 追加(2023-08-29~)
|
|
126
|
+
totalPaymentDue,
|
|
125
127
|
...(typeof params.object.paymentMethod?.description === 'string')
|
|
126
128
|
? { description: params.object.paymentMethod?.description }
|
|
127
129
|
: undefined,
|
|
128
|
-
...(totalPaymentDue !== undefined)
|
|
129
|
-
? { totalPaymentDue: totalPaymentDue }
|
|
130
|
-
: undefined,
|
|
131
130
|
...(typeof accountId === 'string') ? { accountId: accountId } : undefined,
|
|
132
131
|
...(typeof params.object.paymentMethod?.method === 'string')
|
|
133
132
|
? { method: params.object.paymentMethod?.method }
|
|
@@ -44,7 +44,7 @@ export { IPaymentAgencyTransaction };
|
|
|
44
44
|
* 取引開始
|
|
45
45
|
*/
|
|
46
46
|
export declare function start(params: factory.assetTransaction.pay.IStartParamsWithoutDetail & {
|
|
47
|
-
instrument: factory.action.trade.pay.
|
|
47
|
+
instrument: factory.action.trade.pay.IPayTransactionInstrument[];
|
|
48
48
|
}, options: {
|
|
49
49
|
pendingPaymentAgencyTransaction?: IPaymentAgencyTransaction;
|
|
50
50
|
/**
|
|
@@ -219,6 +219,6 @@ function exportTasksById(params) {
|
|
|
219
219
|
default:
|
|
220
220
|
throw new factory_1.factory.errors.NotImplemented(`Transaction status "${transaction.status}" not implemented.`);
|
|
221
221
|
}
|
|
222
|
-
return repos.task.saveMany(taskAttributes
|
|
222
|
+
return repos.task.saveMany(taskAttributes);
|
|
223
223
|
};
|
|
224
224
|
}
|
|
@@ -73,6 +73,6 @@ function exportTasksById(params) {
|
|
|
73
73
|
default:
|
|
74
74
|
throw new factory_1.factory.errors.NotImplemented(`Transaction status "${transaction.status}" not implemented.`);
|
|
75
75
|
}
|
|
76
|
-
return repos.task.saveMany(taskAttributes
|
|
76
|
+
return repos.task.saveMany(taskAttributes);
|
|
77
77
|
};
|
|
78
78
|
}
|
|
@@ -3,72 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.cancelByAcceptAction = cancelByAcceptAction;
|
|
4
4
|
const factory_1 = require("../../../factory");
|
|
5
5
|
const cancelReservation_1 = require("../../reserveCOA/cancelReservation");
|
|
6
|
-
// /**
|
|
7
|
-
// * 興行オファー承認アクションからCOA予約を取り消す
|
|
8
|
-
// */
|
|
9
|
-
// function cancel(
|
|
10
|
-
// params: {
|
|
11
|
-
// action: factory.action.authorize.offer.eventService.IAction;
|
|
12
|
-
// },
|
|
13
|
-
// options: {
|
|
14
|
-
// /**
|
|
15
|
-
// * cancelPendingReservation async?(2025-03-03~)
|
|
16
|
-
// */
|
|
17
|
-
// asyncCancelPendingReservation: boolean;
|
|
18
|
-
// }
|
|
19
|
-
// ): ICancelOperation<void> {
|
|
20
|
-
// return async (repos: {
|
|
21
|
-
// action: ActionRepo;
|
|
22
|
-
// reserveService: COA.service.Reserve;
|
|
23
|
-
// task: TaskRepo;
|
|
24
|
-
// }) => {
|
|
25
|
-
// // object.pendingTransactionに連携内容情報が記録されているので、その情報を元に仮予約を取り消す
|
|
26
|
-
// let delTmpReserveParams: COA.factory.reserve.IDelTmpReserveArgs | undefined;
|
|
27
|
-
// // objectに進行中取引情報があれば利用する(2023-09-11~)
|
|
28
|
-
// const pendingTransaction = params.action.object.pendingTransaction;
|
|
29
|
-
// if (typeof pendingTransaction?.typeOf === 'string') {
|
|
30
|
-
// delTmpReserveParams = {
|
|
31
|
-
// theaterCode: pendingTransaction.theaterCode,
|
|
32
|
-
// dateJouei: pendingTransaction.dateJouei,
|
|
33
|
-
// titleCode: pendingTransaction.titleCode,
|
|
34
|
-
// titleBranchNum: pendingTransaction.titleBranchNum,
|
|
35
|
-
// timeBegin: pendingTransaction.timeBegin,
|
|
36
|
-
// tmpReserveNum: pendingTransaction.tmpReserveNum
|
|
37
|
-
// };
|
|
38
|
-
// }
|
|
39
|
-
// if (delTmpReserveParams !== undefined) {
|
|
40
|
-
// const { asyncCancelPendingReservation } = options;
|
|
41
|
-
// const object: factory.action.cancel.coaReserve.IObject = {
|
|
42
|
-
// ...delTmpReserveParams,
|
|
43
|
-
// reservationStatus: factory.reservationStatusType.ReservationPending,
|
|
44
|
-
// transactionNumber: delTmpReserveParams.tmpReserveNum,
|
|
45
|
-
// typeOf: factory.assetTransactionType.COAReserveTransaction
|
|
46
|
-
// };
|
|
47
|
-
// const instrument: factory.action.cancel.coaReserve.IPlaceOrderAsInstrument[] = [params.action.purpose];
|
|
48
|
-
// if (asyncCancelPendingReservation) {
|
|
49
|
-
// // support async(2025-03-03~)
|
|
50
|
-
// const data: factory.task.cancelPendingReservation.IPotentialCancelCOAReserveAction = { object, instrument };
|
|
51
|
-
// const cancelPendingReservationTask: factory.task.cancelPendingReservation.IAttributes = {
|
|
52
|
-
// project: { id: params.action.project.id, typeOf: factory.organizationType.Project },
|
|
53
|
-
// name: factory.taskName.CancelPendingReservation,
|
|
54
|
-
// status: factory.taskStatus.Ready,
|
|
55
|
-
// runsAt: new Date(),
|
|
56
|
-
// remainingNumberOfTries: 10,
|
|
57
|
-
// numberOfTried: 0,
|
|
58
|
-
// executionResults: [],
|
|
59
|
-
// data
|
|
60
|
-
// };
|
|
61
|
-
// await repos.task.saveMany([cancelPendingReservationTask], { emitImmediately: true });
|
|
62
|
-
// } else {
|
|
63
|
-
// await cancelPendingReservation({
|
|
64
|
-
// project: { id: params.action.project.id },
|
|
65
|
-
// object,
|
|
66
|
-
// instrument
|
|
67
|
-
// })(repos);
|
|
68
|
-
// }
|
|
69
|
-
// }
|
|
70
|
-
// };
|
|
71
|
-
// }
|
|
72
6
|
/**
|
|
73
7
|
* 興行オファー採用アクションからCOA予約を取り消す
|
|
74
8
|
*/
|
|
@@ -115,7 +49,7 @@ function cancelByAcceptAction(params, options) {
|
|
|
115
49
|
executionResults: [],
|
|
116
50
|
data
|
|
117
51
|
};
|
|
118
|
-
await repos.task.saveMany([cancelPendingReservationTask]
|
|
52
|
+
await repos.task.saveMany([cancelPendingReservationTask]);
|
|
119
53
|
}
|
|
120
54
|
else {
|
|
121
55
|
await (0, cancelReservation_1.cancelPendingReservation)({
|