@chevre/domain 25.2.0-alpha.4 → 25.2.0-alpha.41
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/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/aggregateOffer.d.ts +2 -3
- package/lib/chevre/repo/creativeWork.d.ts +2 -3
- 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 +67 -66
- 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/setting.d.ts +4 -0
- 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/unitPriceInCatalog.d.ts +4 -0
- package/lib/chevre/repo/offer/unitPriceInCatalog.js +40 -0
- 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/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/product.d.ts +3 -4
- package/lib/chevre/repo/rateLimit/offer.js +0 -12
- package/lib/chevre/repo/reservation.d.ts +2 -3
- 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/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.js +0 -13
- 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/notification/factory.d.ts +2 -4
- package/lib/chevre/service/notification/factory.js +26 -24
- package/lib/chevre/service/notification/notifyAbortedTasksByEmail.d.ts +11 -5
- package/lib/chevre/service/notification/notifyAbortedTasksByEmail.js +11 -3
- 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/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 +17 -14
- 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/changeOffers.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/onOrderProcessing/createSendEmailMessageTaskIfNotExist.d.ts +5 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.js +95 -33
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +4 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +2 -6
- 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 +3 -1
- package/lib/chevre/service/payment/any/findAcceptAction.js +14 -6
- package/lib/chevre/service/payment/any/invalidatePaymentUrl.d.ts +2 -0
- package/lib/chevre/service/payment/any/invalidatePaymentUrl.js +4 -66
- 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/onReservationConfirmed.js +17 -8
- 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/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 +2 -7
- 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 +1 -1
- package/lib/chevre/service/task/onResourceUpdated.d.ts +2 -2
- package/lib/chevre/service/task/onResourceUpdated.js +2 -1
- 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/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/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.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 +35 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.js +17 -13
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/factory.d.ts +5 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +11 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +112 -91
- package/lib/chevre/service/transaction/placeOrder/confirm.d.ts +6 -5
- package/lib/chevre/service/transaction/placeOrder/confirm.js +33 -78
- 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/taskSettings.d.ts +1 -3
- 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
|
@@ -58,9 +58,9 @@ function processTransactionNotInProgress(params) {
|
|
|
58
58
|
function confirm(params, options) {
|
|
59
59
|
return async (repos) => {
|
|
60
60
|
// 確認番号を事前発行
|
|
61
|
-
await (0, publishConfirmationNumberIfNotExist_1.publishConfirmationNumberIfNotExist)({
|
|
61
|
+
const confirmationNumber = await (0, publishConfirmationNumberIfNotExist_1.publishConfirmationNumberIfNotExist)({
|
|
62
62
|
id: params.id,
|
|
63
|
-
status: { $in: [
|
|
63
|
+
// status: { $in: [factory.transactionStatusType.Confirmed, factory.transactionStatusType.InProgress] },
|
|
64
64
|
object: { orderDate: params.result.order.orderDate }
|
|
65
65
|
})(repos);
|
|
66
66
|
const transaction = await repos.placeOrder.findPlaceOrderById({ typeOf: factory_1.factory.transactionType.PlaceOrder, id: params.id }, ['typeOf', 'project', 'status', 'agent', 'seller', 'object', 'result']);
|
|
@@ -82,10 +82,12 @@ function confirm(params, options) {
|
|
|
82
82
|
// if (typeof orderNumber !== 'string' || orderNumber === '') {
|
|
83
83
|
// throw new factory.errors.Argument('transactionId', 'orderNumber not issued');
|
|
84
84
|
// }
|
|
85
|
+
// 注文に決済方法IDが発行済か確認(2026-07-12)
|
|
86
|
+
const paymentMethodIdByTransaction = await repos.orderInTransaction.findPaymentMethodId({ id: params.id });
|
|
85
87
|
// 取引に対する全ての承認アクションをマージ
|
|
86
88
|
const completedAuthorizeActions = await searchAuthorizeActions(params)(repos);
|
|
87
89
|
let acceptPayActions = [];
|
|
88
|
-
if (typeof
|
|
90
|
+
if (typeof paymentMethodIdByTransaction === 'string') {
|
|
89
91
|
acceptPayActions = await searchAcceptPayActions(params)(repos);
|
|
90
92
|
}
|
|
91
93
|
// 必要あらば注文コード発行(2024-02-05~)
|
|
@@ -110,20 +112,16 @@ function confirm(params, options) {
|
|
|
110
112
|
serialNumbers } = dissolveAuthorizeActions(completedAuthorizeActions);
|
|
111
113
|
// orderInTransactionから検索する(2024-03-04~)
|
|
112
114
|
const acceptedOffers = (await repos.orderInTransaction.findAcceptedOffersWithPriceByIdentifier({
|
|
113
|
-
// orderNumber,
|
|
114
115
|
identifier: transaction.id,
|
|
115
116
|
project: { id: transaction.project.id }
|
|
116
|
-
}))
|
|
117
|
+
}, { onlyPlaceOrder: true }))
|
|
117
118
|
.filter(({ serialNumber }) => typeof serialNumber === 'string' && serialNumbers.includes(serialNumber));
|
|
118
119
|
// 単価オファーの全適用条件を検証するために、単価オファーを参照(2026-07-06~)
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
authorizeEventServiceOfferActions
|
|
125
|
-
})({ offer: repos.offer });
|
|
126
|
-
}
|
|
120
|
+
const unitPriceOfferConditions = await (0, prepareUnitPriceOfferConditions_1.prepareUnitPriceOfferConditions)({
|
|
121
|
+
project: { id: transaction.project.id, },
|
|
122
|
+
acceptedOffers,
|
|
123
|
+
authorizeEventServiceOfferActions
|
|
124
|
+
})({ offer: repos.offer });
|
|
127
125
|
// authorizePaymentActionsからpayTransactionsを参照(2024-06-20~)
|
|
128
126
|
let payTransactions = [];
|
|
129
127
|
// 決済承認アクションのinstrument依存をobject依存へ変更(2025-12-14~)
|
|
@@ -141,42 +139,28 @@ function confirm(params, options) {
|
|
|
141
139
|
const seller = (0, factory_2.createSeller)({ transaction });
|
|
142
140
|
const { paymentMethods, placingOrder, result, eventId, reservationIds } = createResult({
|
|
143
141
|
...params,
|
|
144
|
-
orderNumber,
|
|
142
|
+
orderNumber,
|
|
143
|
+
confirmationNumber,
|
|
144
|
+
transaction,
|
|
145
145
|
acceptPayActions,
|
|
146
146
|
authorizePaymentActions, authorizeEventServiceOfferActions,
|
|
147
|
-
// authorizeProductOfferActions,
|
|
148
147
|
acceptedOffers, payTransactions, customer,
|
|
149
|
-
|
|
148
|
+
unitPriceOfferConditions,
|
|
149
|
+
...(typeof code === 'string') ? { code } : undefined,
|
|
150
|
+
paymentMethodIdByTransaction
|
|
150
151
|
}, options);
|
|
151
|
-
// discontinue emailMessageRepo
|
|
152
|
-
// // デフォルトEメールメッセージを検索
|
|
153
|
-
// let emailMessageOnOrderSent: factory.creativeWork.message.email.ICreativeWork | undefined;
|
|
154
|
-
// if (repos.emailMessage !== undefined) {
|
|
155
|
-
// const searchEmailMessagesResult = await repos.emailMessage.search({
|
|
156
|
-
// limit: 1,
|
|
157
|
-
// page: 1,
|
|
158
|
-
// project: { id: { $eq: transaction.project.id } },
|
|
159
|
-
// about: { identifier: { $eq: factory.creativeWork.message.email.AboutIdentifier.OnOrderSent } }
|
|
160
|
-
// });
|
|
161
|
-
// emailMessageOnOrderSent = searchEmailMessagesResult.shift();
|
|
162
|
-
// }
|
|
163
152
|
// ポストアクションを作成
|
|
164
153
|
const setting = await repos.setting.findOne({ project: { id: { $eq: '*' } } }, ['defaultSenderEmail']);
|
|
165
154
|
if (typeof setting?.defaultSenderEmail !== 'string') {
|
|
166
155
|
throw new factory_1.factory.errors.NotFound('setting.defaultSenderEmail');
|
|
167
156
|
}
|
|
168
|
-
const { emailMessages
|
|
157
|
+
const { emailMessages } = await (0, potentialActions_1.createPotentialActions)({
|
|
169
158
|
order: placingOrder, // createEmailMessageでのorder.acceptedOffersへの依存性を排除したのでこちらでよいはず(2024-02-21~)
|
|
170
159
|
customer,
|
|
171
160
|
seller,
|
|
172
161
|
paymentMethods,
|
|
173
|
-
// order: orderWithAcceptedOffers, // 現時点でcreateEmailMessageでorder.acceptedOffersを使用している(2024-02-06~)
|
|
174
|
-
// transaction: transaction,
|
|
175
162
|
...(params.potentialActions !== undefined) ? { potentialActions: params.potentialActions } : undefined,
|
|
176
|
-
|
|
177
|
-
},
|
|
178
|
-
// settings
|
|
179
|
-
setting);
|
|
163
|
+
}, setting);
|
|
180
164
|
// メッセージ保管(2024-04-28~)
|
|
181
165
|
await saveMessagesIfNeeded({
|
|
182
166
|
project: { id: transaction.project.id },
|
|
@@ -189,10 +173,11 @@ function confirm(params, options) {
|
|
|
189
173
|
id: transaction.id,
|
|
190
174
|
object: {
|
|
191
175
|
orderDate: params.result.order.orderDate,
|
|
192
|
-
orderNumber
|
|
176
|
+
orderNumber,
|
|
177
|
+
confirmationNumber: placingOrder.confirmationNumber
|
|
193
178
|
},
|
|
194
179
|
result: result,
|
|
195
|
-
potentialActions
|
|
180
|
+
// ...((options.useTransactionPotentialActions) && { potentialActions }) // support undefined(2026-07-17~)
|
|
196
181
|
});
|
|
197
182
|
}
|
|
198
183
|
catch (error) {
|
|
@@ -329,17 +314,20 @@ function createResult(params, options) {
|
|
|
329
314
|
}
|
|
330
315
|
});
|
|
331
316
|
// 取引の確定条件が全て整っているかどうか確認
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
317
|
+
const { paymentMethodIdByTransaction } = params;
|
|
318
|
+
(0, validation_1.validateTransaction)({ id: transaction.id }, params.acceptPayActions, params.authorizePaymentActions, params.authorizeEventServiceOfferActions, eventReservationAcceptedOffers, params.payTransactions, params.customer, {
|
|
319
|
+
...((typeof paymentMethodIdByTransaction === 'string') && { paymentMethodIdByTransaction })
|
|
320
|
+
});
|
|
335
321
|
const { paymentMethods, price } = (0, factory_2.createPaymentMethods)({ authorizePaymentActions: params.authorizePaymentActions });
|
|
336
322
|
const orderedItem = (0, orderedItem_1.acceptedOffers2orderedItem)({
|
|
337
323
|
eventReservationAcceptedOffers
|
|
338
324
|
});
|
|
339
325
|
(0, validation_1.validateEventOffers)({
|
|
326
|
+
project: { id: transaction.project.id },
|
|
340
327
|
order: { price },
|
|
341
328
|
paymentMethods,
|
|
342
|
-
|
|
329
|
+
authorizeOfferActions: params.authorizeEventServiceOfferActions,
|
|
330
|
+
unitPriceOfferConditions: params.unitPriceOfferConditions
|
|
343
331
|
});
|
|
344
332
|
// 注文オファー検証
|
|
345
333
|
(0, validation_1.validateAcceptedOffers)({
|
|
@@ -352,8 +340,10 @@ function createResult(params, options) {
|
|
|
352
340
|
result: params.result
|
|
353
341
|
});
|
|
354
342
|
(0, validation_1.validatePaymentMethods)({ order: { paymentMethods } }, options);
|
|
355
|
-
//
|
|
356
|
-
const { confirmationNumber } =
|
|
343
|
+
// 取引のobjectへの依存を排除する(2026-07-08~)
|
|
344
|
+
const { confirmationNumber } = params;
|
|
345
|
+
// // 確認番号を発行
|
|
346
|
+
// const { confirmationNumber } = createConfirmationNumber({ transaction });
|
|
357
347
|
// 注文作成
|
|
358
348
|
const orderAsResult = (0, result_1.createOrderAsResult)({
|
|
359
349
|
orderNumber: params.orderNumber,
|
|
@@ -400,21 +390,6 @@ function createResult(params, options) {
|
|
|
400
390
|
}
|
|
401
391
|
function searchAcceptPayActions(params) {
|
|
402
392
|
return async (repos) => {
|
|
403
|
-
// let acceptPayActions = <IAcceptPayAction[]>await repos.action.search(
|
|
404
|
-
// {
|
|
405
|
-
// project: { id: { $eq: params.project.id } },
|
|
406
|
-
// typeOf: { $eq: factory.actionType.AcceptAction },
|
|
407
|
-
// actionStatus: { $in: [factory.actionStatusType.CompletedActionStatus] },
|
|
408
|
-
// purpose: {
|
|
409
|
-
// id: { $in: [params.id] },
|
|
410
|
-
// typeOf: { $in: [factory.transactionType.PlaceOrder] }
|
|
411
|
-
// },
|
|
412
|
-
// object: {
|
|
413
|
-
// typeOf: { $eq: factory.assetTransactionType.Pay }
|
|
414
|
-
// }
|
|
415
|
-
// },
|
|
416
|
-
// ['object', 'endDate', 'result']
|
|
417
|
-
// );
|
|
418
393
|
let acceptPayActions = await repos.acceptPayAction.findAcceptActionsByPurpose({
|
|
419
394
|
project: { id: params.project.id },
|
|
420
395
|
actionStatus: factory_1.factory.actionStatusType.CompletedActionStatus,
|
|
@@ -433,15 +408,6 @@ function searchAcceptPayActions(params) {
|
|
|
433
408
|
function searchAuthorizeActions(params) {
|
|
434
409
|
return async (repos) => {
|
|
435
410
|
// 取引に対する全ての承認アクションをマージ
|
|
436
|
-
// let authorizeActions = <IAuthorizeOfferOrPaymentAction[]>await repos.action.searchByPurpose({
|
|
437
|
-
// typeOf: factory.actionType.AuthorizeAction,
|
|
438
|
-
// purpose: {
|
|
439
|
-
// typeOf: factory.transactionType.PlaceOrder,
|
|
440
|
-
// id: params.id
|
|
441
|
-
// },
|
|
442
|
-
// // Completedに絞る(2023-05-16~)
|
|
443
|
-
// actionStatus: { $eq: factory.actionStatusType.CompletedActionStatus }
|
|
444
|
-
// });
|
|
445
411
|
let authorizeActions = [
|
|
446
412
|
...await repos.authorizePaymentMethodAction.findAuthorizePaymentMethodActionsByPurpose({
|
|
447
413
|
purpose: {
|
|
@@ -468,14 +434,3 @@ function searchAuthorizeActions(params) {
|
|
|
468
434
|
return authorizeActions;
|
|
469
435
|
};
|
|
470
436
|
}
|
|
471
|
-
function createConfirmationNumber(params) {
|
|
472
|
-
const confirmationNumber = params.transaction.object.confirmationNumber;
|
|
473
|
-
// 取引に確認番号が保管されていなければ、確認番号を発行
|
|
474
|
-
if (typeof confirmationNumber !== 'string') {
|
|
475
|
-
// 事前に発行済なはずなので、ありえないフロー
|
|
476
|
-
throw new factory_1.factory.errors.Internal('object.confirmationNumber undefined');
|
|
477
|
-
}
|
|
478
|
-
return {
|
|
479
|
-
confirmationNumber,
|
|
480
|
-
};
|
|
481
|
-
}
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
import type { ConfirmationNumberRepo } from '../../../repo/confirmationNumber';
|
|
2
|
-
import type {
|
|
3
|
-
import { factory } from '../../../factory';
|
|
2
|
+
import type { OrderInTransactionRepo } from '../../../repo/orderInTransaction';
|
|
4
3
|
/**
|
|
5
|
-
*
|
|
4
|
+
* 未発行であれば、確認番号を発行して注文ドキュメントに保管する
|
|
5
|
+
* reimplement using OrderInTransactionRepo(2026-07-09~)
|
|
6
6
|
*/
|
|
7
7
|
declare function publishConfirmationNumberIfNotExist(params: {
|
|
8
8
|
/**
|
|
9
9
|
* 取引ID
|
|
10
10
|
*/
|
|
11
11
|
id: string;
|
|
12
|
-
status: {
|
|
13
|
-
$in: factory.transactionStatusType[];
|
|
14
|
-
};
|
|
15
12
|
object: {
|
|
16
13
|
orderDate: Date;
|
|
17
14
|
};
|
|
18
15
|
}): (repos: {
|
|
19
|
-
placeOrder: PlaceOrderRepo;
|
|
20
16
|
confirmationNumber: ConfirmationNumberRepo;
|
|
17
|
+
orderInTransaction: OrderInTransactionRepo;
|
|
21
18
|
}) => Promise<string>;
|
|
22
19
|
export { publishConfirmationNumberIfNotExist };
|
|
@@ -1,36 +1,54 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.publishConfirmationNumberIfNotExist = publishConfirmationNumberIfNotExist;
|
|
7
|
+
const debug_1 = __importDefault(require("debug"));
|
|
8
|
+
// import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
|
|
4
9
|
const factory_1 = require("../../../factory");
|
|
10
|
+
const debug = (0, debug_1.default)('chevre-domain:service:transaction:placeOrder:publishConfirmationNumberIfNotExist');
|
|
5
11
|
/**
|
|
6
|
-
*
|
|
12
|
+
* 未発行であれば、確認番号を発行して注文ドキュメントに保管する
|
|
13
|
+
* reimplement using OrderInTransactionRepo(2026-07-09~)
|
|
7
14
|
*/
|
|
8
15
|
function publishConfirmationNumberIfNotExist(params) {
|
|
9
16
|
return async (repos) => {
|
|
10
|
-
let confirmationNumber = await repos.placeOrder.findInProgressConfirmationNumberById({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
});
|
|
17
|
+
// let confirmationNumber = await repos.placeOrder.findInProgressConfirmationNumberById({
|
|
18
|
+
// id: params.id,
|
|
19
|
+
// status: { $in: params.status.$in }
|
|
20
|
+
// });
|
|
21
|
+
let confirmationNumber = await repos.orderInTransaction.findConfirmationNumberByIdentifier({ identifier: params.id });
|
|
22
|
+
debug('already exists?', confirmationNumber);
|
|
14
23
|
// すでに発行済であれば何もしない
|
|
15
24
|
if (typeof confirmationNumber === 'string') {
|
|
16
25
|
return confirmationNumber;
|
|
17
26
|
}
|
|
18
27
|
// 確認番号を発行
|
|
19
28
|
confirmationNumber = await repos.confirmationNumber.publish({ orderDate: params.object.orderDate });
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
29
|
+
debug('saving new confirmationNumber...', confirmationNumber);
|
|
30
|
+
// // 取引に存在しなければ保管
|
|
31
|
+
// await repos.placeOrder.saveConfirmationNumberIfNotExist({
|
|
32
|
+
// id: params.id,
|
|
33
|
+
// status: { $in: params.status.$in },
|
|
34
|
+
// confirmationNumber
|
|
35
|
+
// });
|
|
36
|
+
// 注文ドキュメントにも保管(2026-07-08~)
|
|
37
|
+
const saveResult = await repos.orderInTransaction.saveConfirmationNumberIfNotExist({
|
|
38
|
+
identifier: params.id,
|
|
24
39
|
confirmationNumber
|
|
25
|
-
});
|
|
40
|
+
}, { onlyPlaceOrder: true });
|
|
41
|
+
debug('saveConfirmationNumberIfNotExist result:', JSON.stringify(saveResult));
|
|
26
42
|
// 確認番号を取引から再取得
|
|
27
|
-
confirmationNumber = await repos.placeOrder.findInProgressConfirmationNumberById({
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
});
|
|
43
|
+
// confirmationNumber = await repos.placeOrder.findInProgressConfirmationNumberById({
|
|
44
|
+
// id: params.id,
|
|
45
|
+
// status: { $in: params.status.$in }
|
|
46
|
+
// });
|
|
47
|
+
confirmationNumber = await repos.orderInTransaction.findConfirmationNumberByIdentifier({ identifier: params.id });
|
|
48
|
+
debug('confirmationNumber should exist:', confirmationNumber);
|
|
31
49
|
// 万が一処理が想定通りでない場合confirmationNumberが存在しない
|
|
32
50
|
if (typeof confirmationNumber !== 'string') {
|
|
33
|
-
throw new factory_1.factory.errors.Internal('
|
|
51
|
+
throw new factory_1.factory.errors.Internal('orderInTransaction.confirmationNumber not found');
|
|
34
52
|
}
|
|
35
53
|
return confirmationNumber;
|
|
36
54
|
};
|
|
@@ -9,7 +9,7 @@ import type { ProjectMakesOfferRepo } from '../../../repo/projectMakesOffer';
|
|
|
9
9
|
import type { SellerRepo } from '../../../repo/seller';
|
|
10
10
|
import type { IStartedPlaceOrder, PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
|
|
11
11
|
import { IStartPlaceOrderParams } from './start/factory';
|
|
12
|
-
interface IStartOperationRepos {
|
|
12
|
+
export interface IStartOperationRepos {
|
|
13
13
|
issuer: IssuerRepo;
|
|
14
14
|
member: MemberRepo;
|
|
15
15
|
memberProgram: MemberProgramRepo;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { factory } from '../../../../factory';
|
|
2
|
+
import type { OrderInTransactionRepo } from '../../../../repo/orderInTransaction';
|
|
3
|
+
export interface IFixCustomerRepos {
|
|
4
|
+
orderInTransaction: OrderInTransactionRepo;
|
|
5
|
+
}
|
|
6
|
+
export type IProfileByRequest = Pick<factory.order.ICustomer, 'additionalProperty' | 'address' | 'age' | 'email' | 'familyName' | 'gender' | 'givenName' | 'name' | 'telephone' | 'url'> & {
|
|
7
|
+
telephoneRegion?: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* 進行中取引からカスタマー属性を決定する
|
|
11
|
+
*/
|
|
12
|
+
export declare function fixCustomer(params: {
|
|
13
|
+
/**
|
|
14
|
+
* 注文取引ID
|
|
15
|
+
*/
|
|
16
|
+
id: string;
|
|
17
|
+
profileByRequest: IProfileByRequest;
|
|
18
|
+
}): (repos: IFixCustomerRepos) => Promise<{
|
|
19
|
+
customer: factory.order.ICustomer;
|
|
20
|
+
}>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fixCustomer = fixCustomer;
|
|
4
|
+
const libphonenumber_js_1 = require("libphonenumber-js");
|
|
5
|
+
const factory_1 = require("../../../../factory");
|
|
6
|
+
/**
|
|
7
|
+
* 進行中取引からカスタマー属性を決定する
|
|
8
|
+
*/
|
|
9
|
+
function fixCustomer(params) {
|
|
10
|
+
return async (repos) => {
|
|
11
|
+
const { profileByRequest } = params;
|
|
12
|
+
let formattedTelephone;
|
|
13
|
+
try {
|
|
14
|
+
const phoneNumber = (0, libphonenumber_js_1.parsePhoneNumberFromString)(String(profileByRequest.telephone), profileByRequest.telephoneRegion);
|
|
15
|
+
if (phoneNumber === undefined || !phoneNumber.isValid()) {
|
|
16
|
+
throw new factory_1.factory.errors.Argument('telephone', 'Invalid phone number');
|
|
17
|
+
}
|
|
18
|
+
formattedTelephone = phoneNumber.format('E.164');
|
|
19
|
+
// if (useLibphonenumber) {
|
|
20
|
+
// const phoneNumber = parsePhoneNumberFromString(String(params.agent.telephone), params.agent.telephoneRegion as CountryCode | undefined);
|
|
21
|
+
// if (phoneNumber === undefined || !phoneNumber.isValid()) {
|
|
22
|
+
// throw new factory.errors.Argument('telephone', 'Invalid phone number');
|
|
23
|
+
// }
|
|
24
|
+
// formattedTelephone = phoneNumber.format('E.164');
|
|
25
|
+
// } else {
|
|
26
|
+
// const phoneUtil = PhoneNumberUtil.getInstance();
|
|
27
|
+
// const phoneNumber = phoneUtil.parse(params.agent.telephone, params.agent.telephoneRegion);
|
|
28
|
+
// if (!phoneUtil.isValidNumber(phoneNumber)) {
|
|
29
|
+
// throw new factory.errors.Argument('telephone', 'Invalid phone number');
|
|
30
|
+
// }
|
|
31
|
+
// formattedTelephone = phoneUtil.format(phoneNumber, PhoneNumberFormat.E164);
|
|
32
|
+
// }
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
throw new factory_1.factory.errors.Argument('telephone', (error instanceof Error) ? error.message : /* istanbul ignore next */ String(error));
|
|
36
|
+
}
|
|
37
|
+
// orderInTransaction.customer?.typeOfは取引開始時にセットされている前提で再実装(2026-06-24~)
|
|
38
|
+
const customerByTransaction = await repos.orderInTransaction.findCustomerByOrderIdentifier({ identifier: params.id });
|
|
39
|
+
const customerName = (typeof profileByRequest.name === 'string' && profileByRequest.name !== '')
|
|
40
|
+
? profileByRequest.name
|
|
41
|
+
: /* istanbul ignore next */ (typeof profileByRequest.givenName === 'string' && typeof profileByRequest.familyName === 'string'
|
|
42
|
+
&& profileByRequest.givenName !== '' && profileByRequest.familyName !== '')
|
|
43
|
+
? `${profileByRequest.givenName} ${profileByRequest.familyName}`
|
|
44
|
+
: undefined;
|
|
45
|
+
const identifier = (Array.isArray(customerByTransaction.identifier)) ? customerByTransaction.identifier : /* istanbul ignore next */ [];
|
|
46
|
+
const customer = {
|
|
47
|
+
typeOf: customerByTransaction.typeOf, // 取引開始時で固定
|
|
48
|
+
id: customerByTransaction.id, // 取引開始時で固定
|
|
49
|
+
identifier, // 取引開始時で固定
|
|
50
|
+
...((Array.isArray(profileByRequest.additionalProperty)) && { additionalProperty: profileByRequest.additionalProperty }),
|
|
51
|
+
...((typeof profileByRequest.age === 'string') && { age: profileByRequest.age }),
|
|
52
|
+
...((typeof profileByRequest.address === 'string') && { address: profileByRequest.address }),
|
|
53
|
+
...((typeof profileByRequest.email === 'string') && { email: profileByRequest.email }),
|
|
54
|
+
...((typeof profileByRequest.familyName === 'string') && { familyName: profileByRequest.familyName }),
|
|
55
|
+
...((typeof profileByRequest.gender === 'string') && { gender: profileByRequest.gender }),
|
|
56
|
+
...((typeof profileByRequest.givenName === 'string') && { givenName: profileByRequest.givenName }),
|
|
57
|
+
...((typeof customerName === 'string') && { name: customerName }),
|
|
58
|
+
...((typeof formattedTelephone === 'string') && { telephone: formattedTelephone }),
|
|
59
|
+
...((typeof profileByRequest.url === 'string') && { url: profileByRequest.url })
|
|
60
|
+
};
|
|
61
|
+
return { customer };
|
|
62
|
+
};
|
|
63
|
+
}
|
|
@@ -1,22 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.updateAgent = updateAgent;
|
|
4
|
-
const google_libphonenumber_1 = require("google-libphonenumber");
|
|
5
4
|
const factory_1 = require("../../../factory");
|
|
6
|
-
|
|
5
|
+
const fixCustomer_1 = require("./updateAgent/fixCustomer");
|
|
6
|
+
/**
|
|
7
|
+
* 取引人プロフィール更新
|
|
8
|
+
*/
|
|
9
|
+
function updateAgent(params) {
|
|
7
10
|
return async (repos) => {
|
|
8
|
-
let formattedTelephone;
|
|
9
|
-
try {
|
|
10
|
-
const phoneUtil = google_libphonenumber_1.PhoneNumberUtil.getInstance();
|
|
11
|
-
const phoneNumber = phoneUtil.parse(params.agent.telephone, params.agent.telephoneRegion);
|
|
12
|
-
if (!phoneUtil.isValidNumber(phoneNumber)) {
|
|
13
|
-
throw new factory_1.factory.errors.Argument('telephone', 'Invalid phone number');
|
|
14
|
-
}
|
|
15
|
-
formattedTelephone = phoneUtil.format(phoneNumber, google_libphonenumber_1.PhoneNumberFormat.E164);
|
|
16
|
-
}
|
|
17
|
-
catch (error) {
|
|
18
|
-
throw new factory_1.factory.errors.Argument('telephone', (error instanceof Error) ? error.message : String(error));
|
|
19
|
-
}
|
|
20
11
|
const transaction = await repos.placeOrder.findPlaceOrderInProgressById({
|
|
21
12
|
typeOf: factory_1.factory.transactionType.PlaceOrder,
|
|
22
13
|
id: params.id
|
|
@@ -24,77 +15,17 @@ function fixCustomer(params) {
|
|
|
24
15
|
if (transaction.agent.id !== params.agent.id) {
|
|
25
16
|
throw new factory_1.factory.errors.Forbidden('Transaction not yours');
|
|
26
17
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
typeOf: customerByTransaction.typeOf,
|
|
40
|
-
id: customerByTransaction.id,
|
|
41
|
-
...(Array.isArray(customerByTransaction.identifier))
|
|
42
|
-
? { identifier: customerByTransaction.identifier }
|
|
43
|
-
: /* istanbul ignore next */ undefined,
|
|
44
|
-
...(Array.isArray(params.agent.additionalProperty))
|
|
45
|
-
? { additionalProperty: params.agent.additionalProperty }
|
|
46
|
-
: /* istanbul ignore next */ undefined,
|
|
47
|
-
...(typeof params.agent.age === 'string') ? { age: params.agent.age }
|
|
48
|
-
: /* istanbul ignore next */ undefined,
|
|
49
|
-
...(typeof params.agent.address === 'string') ? { address: params.agent.address }
|
|
50
|
-
: /* istanbul ignore next */ undefined,
|
|
51
|
-
...(typeof params.agent.email === 'string') ? { email: params.agent.email }
|
|
52
|
-
: /* istanbul ignore next */ undefined,
|
|
53
|
-
...(typeof params.agent.familyName === 'string') ? { familyName: params.agent.familyName }
|
|
54
|
-
: /* istanbul ignore next */ undefined,
|
|
55
|
-
...(typeof params.agent.gender === 'string') ? { gender: params.agent.gender }
|
|
56
|
-
: /* istanbul ignore next */ undefined,
|
|
57
|
-
...(typeof params.agent.givenName === 'string') ? { givenName: params.agent.givenName }
|
|
58
|
-
: /* istanbul ignore next */ undefined,
|
|
59
|
-
...(typeof params.agent.name === 'string') ? { name: params.agent.name } : /* istanbul ignore next */ undefined,
|
|
60
|
-
...(typeof formattedTelephone === 'string') ? { telephone: formattedTelephone } : /* istanbul ignore next */ undefined,
|
|
61
|
-
...(typeof params.agent.url === 'string') ? { url: params.agent.url } : /* istanbul ignore next */ undefined
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return { customer, transaction };
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* 取引人プロフィール更新
|
|
70
|
-
*/
|
|
71
|
-
function updateAgent(params) {
|
|
72
|
-
return async (repos) => {
|
|
73
|
-
const { customer, transaction } = await fixCustomer(params)(repos);
|
|
74
|
-
// also save in orderInTransaction(2024-06-20~)
|
|
75
|
-
if (customer !== undefined) {
|
|
76
|
-
// // 注文ドキュメントを参照(2026-06-24~)
|
|
77
|
-
// const orderNumber = await repos.orderInTransaction.findOrderNumberByIdentifier({
|
|
78
|
-
// identifier: params.id,
|
|
79
|
-
// project: { id: transaction.project.id },
|
|
80
|
-
// }, { onlyPlaceOrder: true });
|
|
81
|
-
const customerName = (typeof customer.name === 'string' && customer.name !== '')
|
|
82
|
-
? customer.name
|
|
83
|
-
: (typeof customer.givenName === 'string' && typeof customer.familyName === 'string'
|
|
84
|
-
&& customer.givenName !== '' && customer.familyName !== '')
|
|
85
|
-
? `${customer.givenName} ${customer.familyName}`
|
|
86
|
-
: undefined;
|
|
87
|
-
const customerInOrder = {
|
|
88
|
-
...customer,
|
|
89
|
-
identifier: (Array.isArray(customer.identifier)) ? customer.identifier : [],
|
|
90
|
-
...(typeof customerName === 'string') ? { name: customerName } : undefined
|
|
91
|
-
};
|
|
92
|
-
await repos.orderInTransaction.setCustomerByIdentifier({
|
|
93
|
-
project: transaction.project,
|
|
94
|
-
identifier: params.id,
|
|
95
|
-
customer: customerInOrder
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
// return newAgent;
|
|
18
|
+
const { id: _id, typeOf: _typeOf, ...profileByRequest } = params.agent;
|
|
19
|
+
const { customer } = await (0, fixCustomer_1.fixCustomer)({ id: params.id, profileByRequest })(repos);
|
|
20
|
+
// // 注文ドキュメントを参照(2026-06-24~)
|
|
21
|
+
// const orderNumber = await repos.orderInTransaction.findOrderNumberByIdentifier({
|
|
22
|
+
// identifier: params.id,
|
|
23
|
+
// project: { id: transaction.project.id },
|
|
24
|
+
// }, { onlyPlaceOrder: true });
|
|
25
|
+
await repos.orderInTransaction.setCustomerByIdentifier({
|
|
26
|
+
project: transaction.project,
|
|
27
|
+
identifier: params.id,
|
|
28
|
+
customer
|
|
29
|
+
});
|
|
99
30
|
};
|
|
100
31
|
}
|
|
@@ -24,13 +24,11 @@ interface IExecuteOptions {
|
|
|
24
24
|
executeById: boolean;
|
|
25
25
|
executeByName: boolean;
|
|
26
26
|
}
|
|
27
|
-
type IOperation<T> = (settings: IExecuteSettings) => Promise<T>;
|
|
28
27
|
type IOperationExecute<T> = (settings: IExecuteSettings, options: IExecuteOptions) => Promise<T>;
|
|
29
28
|
type ICallResult = void | Pick<factory.task.IExecutionResult, 'error'>;
|
|
30
|
-
type ICallableTaskOperationSimple = (taskData: factory.task.IData<factory.taskName>) => IOperation<void>;
|
|
31
29
|
type ICallableTaskOperation = (task: IExecutableTask<factory.taskName>) => IOperationExecute<ICallResult>;
|
|
32
30
|
type IExecutableTaskKeys = 'data' | 'id' | 'name' | 'status' | 'numberOfTried' | 'project' | 'remainingNumberOfTries' | 'runsAt' | 'expires';
|
|
33
31
|
type IExecutableTask<T extends factory.taskName> = Pick<factory.task.ITask<T>, IExecutableTaskKeys> & {
|
|
34
32
|
status: factory.taskStatus.Running;
|
|
35
33
|
};
|
|
36
|
-
export { ICallableTaskOperation,
|
|
34
|
+
export { ICallableTaskOperation, ICallResult, IExecutableTask, IExecutableTaskKeys, IExecuteSettings, IExecuteOptions, IOperationExecute, AggregationSettings };
|
package/package.json
CHANGED
|
@@ -9,24 +9,24 @@
|
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@aws-sdk/client-cognito-identity-provider": "3.
|
|
13
|
-
"@aws-sdk/credential-providers": "3.
|
|
14
|
-
"@chevre/factory": "
|
|
12
|
+
"@aws-sdk/client-cognito-identity-provider": "3.1090.0",
|
|
13
|
+
"@aws-sdk/credential-providers": "3.1090.0",
|
|
14
|
+
"@chevre/factory": "10.0.0-alpha.1",
|
|
15
15
|
"@motionpicture/coa-service": "10.0.0",
|
|
16
16
|
"@motionpicture/gmo-service": "6.1.0-alpha.0",
|
|
17
17
|
"@sendgrid/client": "8.1.4",
|
|
18
18
|
"@surfrock/sdk": "2.0.0",
|
|
19
19
|
"debug": "4.4.3",
|
|
20
|
-
"google-libphonenumber": "^3.2.18",
|
|
21
20
|
"http-status": "2.1.0",
|
|
22
21
|
"jsonwebtoken": "9.0.0",
|
|
22
|
+
"libphonenumber-js": "1.13.8",
|
|
23
23
|
"lodash.difference": "^4.5.0",
|
|
24
24
|
"moment": "^2.29.1",
|
|
25
25
|
"moment-timezone": "^0.5.33",
|
|
26
26
|
"node-fpe": "2.0.4",
|
|
27
27
|
"pug": "3.0.3",
|
|
28
28
|
"uniqid": "5.4.0",
|
|
29
|
-
"uuid": "
|
|
29
|
+
"uuid": "11.1.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@eslint/js": "9.39.4",
|
|
@@ -34,21 +34,18 @@
|
|
|
34
34
|
"@sendgrid/helpers": "8.0.0",
|
|
35
35
|
"@size-limit/preset-big-lib": "12.0.0",
|
|
36
36
|
"@types/debug": "4.1.13",
|
|
37
|
-
"@types/google-libphonenumber": "^7.4.19",
|
|
38
37
|
"@types/jsonwebtoken": "9.0.1",
|
|
39
38
|
"@types/lodash.difference": "^4.5.6",
|
|
40
39
|
"@types/node": "22.19.7",
|
|
41
40
|
"@types/pug": "2.0.10",
|
|
42
41
|
"@types/uniqid": "^4.1.3",
|
|
43
|
-
"@types/uuid": "^3.4.10",
|
|
44
42
|
"@vitest/coverage-v8": "4.0.18",
|
|
45
43
|
"@vitest/ui": "4.0.18",
|
|
46
44
|
"csvtojson": "^2.0.10",
|
|
47
45
|
"dependency-cruiser": "17.3.8",
|
|
48
46
|
"eslint": "9.39.2",
|
|
49
|
-
"mongodb": "6.20.0",
|
|
50
47
|
"mongoose": "8.23.0",
|
|
51
|
-
"redis": "4.
|
|
48
|
+
"redis": "4.7.1",
|
|
52
49
|
"rimraf": "6.1.3",
|
|
53
50
|
"size-limit": "12.0.0",
|
|
54
51
|
"typescript": "5.9.3",
|
|
@@ -57,7 +54,7 @@
|
|
|
57
54
|
},
|
|
58
55
|
"peerDependencies": {
|
|
59
56
|
"mongoose": "^8.23.0",
|
|
60
|
-
"redis": "^4.
|
|
57
|
+
"redis": "^4.7.1"
|
|
61
58
|
},
|
|
62
59
|
"engines": {
|
|
63
60
|
"node": ">=22.0.0",
|
|
@@ -91,5 +88,5 @@
|
|
|
91
88
|
"postversion": "git push origin --tags",
|
|
92
89
|
"prepublishOnly": "npm run clean && npm run build"
|
|
93
90
|
},
|
|
94
|
-
"version": "25.2.0-alpha.
|
|
91
|
+
"version": "25.2.0-alpha.41"
|
|
95
92
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { PlaceOrderRepo } from '../../repo/transaction/placeOrder';
|
|
2
|
-
import { factory } from '../../factory';
|
|
3
|
-
type ITransaction = Pick<factory.transaction.placeOrder.ITransaction, 'id' | 'potentialActions' | 'project' | 'typeOf'>;
|
|
4
|
-
export declare function findConfirmedPlaceOrder(params: {
|
|
5
|
-
project: {
|
|
6
|
-
id: string;
|
|
7
|
-
};
|
|
8
|
-
confirmationNumber: string;
|
|
9
|
-
orderNumber: string;
|
|
10
|
-
}): (repos: {
|
|
11
|
-
placeOrder: PlaceOrderRepo;
|
|
12
|
-
}) => Promise<ITransaction>;
|
|
13
|
-
export {};
|