@chevre/domain 24.1.0-alpha.5 → 24.1.0-alpha.50
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/emailMessageBuilder.js +4 -12
- package/lib/chevre/index.d.ts +1 -2
- package/lib/chevre/index.js +1 -3
- package/lib/chevre/repo/acceptedOffer.d.ts +15 -26
- package/lib/chevre/repo/acceptedOffer.js +106 -67
- package/lib/chevre/repo/acceptedOfferInReserve.d.ts +30 -0
- package/lib/chevre/repo/acceptedOfferInReserve.js +86 -0
- package/lib/chevre/repo/accountingReport.js +2 -30
- package/lib/chevre/repo/action/actionProcess.d.ts +1 -1
- package/lib/chevre/repo/assetTransaction/reserve.d.ts +1 -2
- package/lib/chevre/repo/assetTransaction/reserve.js +4 -50
- package/lib/chevre/repo/event.js +12 -8
- package/lib/chevre/repo/factory/acceptedOffer/reserveTransaction2itemOffered.d.ts +7 -0
- package/lib/chevre/repo/factory/acceptedOffer/reserveTransaction2itemOffered.js +74 -0
- package/lib/chevre/repo/factory/reservation/createMongoConditions.d.ts +1 -1
- package/lib/chevre/repo/factory/reservation/createMongoConditions.js +171 -362
- package/lib/chevre/repo/mongoose/schemas/accountingReport.js +42 -42
- package/lib/chevre/repo/mongoose/schemas/order.js +108 -108
- package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +3 -1
- package/lib/chevre/repo/mongoose/schemas/reservation.js +128 -146
- package/lib/chevre/repo/mongoose/schemas/setting.d.ts +84 -0
- package/lib/chevre/repo/mongoose/schemas/setting.js +2 -1
- package/lib/chevre/repo/order.d.ts +2 -83
- package/lib/chevre/repo/order.js +10 -373
- package/lib/chevre/repo/orderInTransaction.d.ts +56 -6
- package/lib/chevre/repo/orderInTransaction.js +58 -4
- package/lib/chevre/repo/place/hasPOS.js +2 -1
- package/lib/chevre/repo/reservation.d.ts +20 -7
- package/lib/chevre/repo/reservation.js +16 -12
- package/lib/chevre/repo/role.d.ts +1 -15
- package/lib/chevre/repo/role.js +7 -14
- package/lib/chevre/repo/setting/integration.d.ts +27 -0
- package/lib/chevre/repo/setting/integration.js +102 -0
- package/lib/chevre/repo/transaction.d.ts +6 -6
- package/lib/chevre/repository.d.ts +5 -0
- package/lib/chevre/repository.js +11 -0
- package/lib/chevre/service/aggregation/event/aggregateOffers.js +6 -1
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +0 -1
- package/lib/chevre/service/assetTransaction/cancelReservation/factory.js +14 -11
- package/lib/chevre/service/assetTransaction/cancelReservation/start.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/cancelReservation/start.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/check.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/searchGMOTrade.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorize.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeCreditCard.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeMovieTicket.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/start.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/reserve/cancel.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/reserve/confirm.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createReservation.js +0 -12
- package/lib/chevre/service/assetTransaction/reserve/start/factory/price.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/reserve/start.d.ts +1 -1
- package/lib/chevre/service/delivery/factory.d.ts +6 -1
- package/lib/chevre/service/delivery/factory.js +1 -1
- package/lib/chevre/service/delivery/reservation/factory.d.ts +1 -3
- package/lib/chevre/service/delivery/reservation/factory.js +0 -17
- package/lib/chevre/service/notification/notifyAbortedTasksByEmail.d.ts +2 -4
- package/lib/chevre/service/notification/notifyAbortedTasksByEmail.js +3 -3
- package/lib/chevre/service/notification/notifyByEmail.d.ts +3 -3
- package/lib/chevre/service/notification/notifyByEmail.js +7 -12
- package/lib/chevre/service/notification/sendEmailMessage.d.ts +2 -3
- package/lib/chevre/service/notification/sendEmailMessage.js +5 -4
- package/lib/chevre/service/offer/any.d.ts +7 -2
- package/lib/chevre/service/offer/event/authorize/factory.d.ts +6 -3
- package/lib/chevre/service/offer/event/authorize/factory.js +13 -15
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +1 -1
- package/lib/chevre/service/offer/event/authorize.d.ts +16 -2
- package/lib/chevre/service/offer/event/authorize.js +62 -11
- package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.d.ts +1 -1
- 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 +1 -3
- package/lib/chevre/service/order/createAccountingReportIfNotExist.d.ts +1 -1
- package/lib/chevre/service/order/createAccountingReportIfNotExist.js +15 -15
- package/lib/chevre/service/order/deleteOrder.js +19 -43
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.d.ts +1 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onReserveTransactionConfirmed.d.ts +1 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.d.ts +1 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.js +9 -11
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/processing2inTransit.d.ts +1 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered.js +0 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +6 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially.js +0 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +2 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +0 -1
- package/lib/chevre/service/order/onOrderUpdated.js +0 -1
- package/lib/chevre/service/order/payOrder.d.ts +1 -1
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +4 -1
- package/lib/chevre/service/order/placeOrder/factory/orderedItem.d.ts +1 -1
- package/lib/chevre/service/order/placeOrder/factory/orderedItem.js +0 -5
- package/lib/chevre/service/order/placeOrder/factory.d.ts +1 -1
- package/lib/chevre/service/order/placeOrder.d.ts +1 -1
- package/lib/chevre/service/order/returnOrder.js +0 -1
- package/lib/chevre/service/order/sendOrder.js +0 -4
- package/lib/chevre/service/payment/any/authorize.d.ts +1 -1
- package/lib/chevre/service/payment/any/person2username.js +0 -1
- package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/authorize.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/authorize.js +4 -3
- package/lib/chevre/service/payment/creditCard/payCreditCard.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/payCreditCard.js +1 -1
- package/lib/chevre/service/payment/creditCard/refundCreditCard.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/refundCreditCard.js +1 -1
- package/lib/chevre/service/payment/creditCard/searchGMOTrade.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/searchGMOTrade.js +1 -1
- package/lib/chevre/service/payment/creditCard/voidTransaction.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/voidTransaction.js +1 -1
- package/lib/chevre/service/payment/factory/createPayObjectServiceOutput.d.ts +8 -1
- package/lib/chevre/service/payment/factory/createPayObjectServiceOutput.js +1 -1
- package/lib/chevre/service/payment/movieTicket/authorize.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/checkMovieTicket.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/payMovieTicket.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/payMovieTicket.js +1 -1
- package/lib/chevre/service/payment/movieTicket/processPurchaseNumberAuth.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/processPurchaseNumberAuth.js +1 -1
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket.js +2 -2
- package/lib/chevre/service/payment/movieTicket/voidTransaction.d.ts +1 -1
- package/lib/chevre/service/reserve/confirmReservation.js +7 -7
- package/lib/chevre/service/reserve/factory.js +2 -1
- package/lib/chevre/service/reserve/findByCode.d.ts +1 -1
- package/lib/chevre/service/reserve/findByCode.js +1 -1
- package/lib/chevre/service/reserve/findReservations.d.ts +14 -6
- package/lib/chevre/service/reserve/findReservations.js +26 -36
- package/lib/chevre/service/reserve/potentialActions/onPendingReservationCanceled.js +0 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +0 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.d.ts +4 -3
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +1 -10
- package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +0 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationsCreated.js +0 -1
- package/lib/chevre/service/reserve/searchByOrder.js +7 -3
- package/lib/chevre/service/task/acceptCOAOffer.js +6 -3
- package/lib/chevre/service/task/authorizePayment.js +4 -2
- package/lib/chevre/service/task/cancelPendingReservation.js +4 -2
- package/lib/chevre/service/task/checkMovieTicket.js +4 -2
- package/lib/chevre/service/task/confirmReserveTransaction.d.ts +1 -1
- package/lib/chevre/service/task/confirmReserveTransaction.js +5 -3
- package/lib/chevre/service/task/createAccountingReport.js +4 -8
- package/lib/chevre/service/task/importEventCapacitiesFromCOA.js +4 -2
- package/lib/chevre/service/task/importEventsFromCOA.js +4 -2
- package/lib/chevre/service/task/importOffersFromCOA.js +4 -2
- package/lib/chevre/service/task/invalidatePaymentUrl.js +3 -1
- package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +3 -1
- package/lib/chevre/service/task/onOrderPaymentCompleted.js +3 -1
- package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +0 -1
- package/lib/chevre/service/task/pay.js +4 -2
- package/lib/chevre/service/task/payment/invalidatePaymentUrlByTask.d.ts +1 -1
- package/lib/chevre/service/task/payment/payByTask.d.ts +1 -1
- package/lib/chevre/service/task/payment/payByTask.js +6 -7
- package/lib/chevre/service/task/payment/refundByTask.d.ts +1 -1
- package/lib/chevre/service/task/payment/voidPaymentByTask.d.ts +1 -1
- package/lib/chevre/service/task/placeOrder.js +3 -1
- package/lib/chevre/service/task/publishPaymentUrl.js +3 -1
- package/lib/chevre/service/task/refund.js +4 -2
- package/lib/chevre/service/task/returnReserveTransaction.js +4 -2
- package/lib/chevre/service/task/sendEmailMessage.js +5 -3
- package/lib/chevre/service/task/syncResourcesFromCOA.js +4 -2
- package/lib/chevre/service/task/voidPayment.js +4 -2
- package/lib/chevre/service/task/voidReserveTransaction.js +4 -2
- package/lib/chevre/service/task.d.ts +0 -7
- package/lib/chevre/service/taskHandler.js +1 -0
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.js +0 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.js +0 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateInvoiceReferencesOrder.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateMovieTicket.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +2 -2
- package/lib/chevre/service/transaction/placeOrder/confirm.js +5 -3
- package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +0 -1
- package/lib/chevre/service/transaction/placeOrder/updateAgent.js +0 -1
- package/lib/chevre/service/transaction/returnOrder/exportTasks/factory.js +0 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.js +0 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions.js +0 -1
- package/lib/chevre/service/transaction/returnOrder/preStart.js +0 -3
- package/lib/chevre/service/validation/validateOrder.js +3 -78
- package/lib/chevre/settings.d.ts +0 -55
- package/lib/chevre/settings.js +1 -29
- package/lib/chevre/taskSettings.d.ts +0 -22
- package/lib/chevre/taskSettings.js +1 -7
- package/package.json +2 -2
- package/lib/chevre/credentials/customSearch.d.ts +0 -13
- package/lib/chevre/credentials/customSearch.js +0 -16
- package/lib/chevre/credentials/lineNotify.d.ts +0 -17
- package/lib/chevre/credentials/lineNotify.js +0 -20
- package/lib/chevre/credentials/sendGrid.d.ts +0 -24
- package/lib/chevre/credentials/sendGrid.js +0 -18
- package/lib/chevre/credentials.d.ts +0 -20
- package/lib/chevre/credentials.js +0 -42
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.deleteOrder = deleteOrder;
|
|
4
|
-
|
|
5
|
-
const
|
|
4
|
+
// import { createOwnershipInfosFromOrder } from '../delivery/factory';
|
|
5
|
+
const factory_1 = require("../../factory");
|
|
6
6
|
/**
|
|
7
7
|
* 注文に関わるリソースを削除する
|
|
8
8
|
* 冪等性を確保すること
|
|
@@ -20,24 +20,24 @@ function deleteOrder(params) {
|
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
if (typeof order.id !== 'string') {
|
|
23
|
-
throw new
|
|
23
|
+
throw new factory_1.factory.errors.Internal(`order.id undefined. orderNumber: ${params.object.orderNumber}`);
|
|
24
24
|
}
|
|
25
25
|
// 注文アイテムの予約を削除
|
|
26
26
|
await deleteReservationsByOrder(order)(repos);
|
|
27
|
-
//
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
catch (error) {
|
|
32
|
-
|
|
33
|
-
}
|
|
27
|
+
// 所有権は所有期限でcleanされるので、注文削除時連動はひとまず廃止(2026-05-17~)
|
|
28
|
+
// // 所有権削除
|
|
29
|
+
// try {
|
|
30
|
+
// await deleteOwnershipInfosByOrder(order)(repos);
|
|
31
|
+
// } catch (error) {
|
|
32
|
+
// console.error('deleteOwnershipInfosByOrder throws', error);
|
|
33
|
+
// }
|
|
34
34
|
// 経理レポート削除
|
|
35
35
|
await repos.accountingReport.deleteByOrderNumber({ mainEntity: { orderNumber: order.orderNumber } });
|
|
36
36
|
// メモ削除(2024-02-15~)
|
|
37
37
|
await repos.note.deleteNotesByAbout({
|
|
38
38
|
about: {
|
|
39
39
|
id: order.id,
|
|
40
|
-
typeOf:
|
|
40
|
+
typeOf: factory_1.factory.order.OrderType.Order
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
// 注文削除
|
|
@@ -49,7 +49,7 @@ function deleteOrder(params) {
|
|
|
49
49
|
function deletePersonIfNecessary(order) {
|
|
50
50
|
return async (repos) => {
|
|
51
51
|
// 代理注文を除く
|
|
52
|
-
const isCustomerPerson = order.customer.typeOf ===
|
|
52
|
+
const isCustomerPerson = order.customer.typeOf === factory_1.factory.personType.Person
|
|
53
53
|
&& typeof order.broker?.typeOf !== 'string';
|
|
54
54
|
if (isCustomerPerson) {
|
|
55
55
|
const ordersByPerson = await repos.order.projectFields({
|
|
@@ -60,12 +60,12 @@ function deletePersonIfNecessary(order) {
|
|
|
60
60
|
if (ordersByPerson.length === 0) {
|
|
61
61
|
const setting = await repos.setting.findOne({ project: { id: { $eq: '*' } } }, ['userPoolIdNew']);
|
|
62
62
|
if (typeof setting?.userPoolIdNew !== 'string') {
|
|
63
|
-
throw new
|
|
63
|
+
throw new factory_1.factory.errors.NotFound('setting.userPoolIdNew');
|
|
64
64
|
}
|
|
65
65
|
const deletePersonTask = {
|
|
66
|
-
project: { typeOf:
|
|
67
|
-
name:
|
|
68
|
-
status:
|
|
66
|
+
project: { typeOf: factory_1.factory.organizationType.Project, id: order.project.id },
|
|
67
|
+
name: factory_1.factory.taskName.DeletePerson,
|
|
68
|
+
status: factory_1.factory.taskStatus.Ready,
|
|
69
69
|
runsAt: new Date(),
|
|
70
70
|
remainingNumberOfTries: 10,
|
|
71
71
|
numberOfTried: 0,
|
|
@@ -74,8 +74,8 @@ function deletePersonIfNecessary(order) {
|
|
|
74
74
|
id: order.customer.id,
|
|
75
75
|
agent: {
|
|
76
76
|
id: order.project.id,
|
|
77
|
-
typeOf:
|
|
78
|
-
name:
|
|
77
|
+
typeOf: factory_1.factory.organizationType.Project,
|
|
78
|
+
name: factory_1.factory.organizationType.Project
|
|
79
79
|
},
|
|
80
80
|
physically: true,
|
|
81
81
|
userPoolId: setting.userPoolIdNew,
|
|
@@ -94,7 +94,7 @@ function deleteReservationsByOrder(order) {
|
|
|
94
94
|
orderNumber: { $eq: order.orderNumber },
|
|
95
95
|
project: { id: { $eq: order.project.id } },
|
|
96
96
|
acceptedOffers: {
|
|
97
|
-
|
|
97
|
+
// itemOffered: { typeOf: { $in: [factory.reservationType.EventReservation] } }
|
|
98
98
|
}
|
|
99
99
|
});
|
|
100
100
|
const reservationIds = acceptedOffers.map((o) => String(o.itemOffered.id));
|
|
@@ -103,27 +103,3 @@ function deleteReservationsByOrder(order) {
|
|
|
103
103
|
}
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
|
-
function deleteOwnershipInfosByOrder(order) {
|
|
107
|
-
return async (repos) => {
|
|
108
|
-
const now = new Date();
|
|
109
|
-
const ownershipInfos = (0, factory_1.createOwnershipInfosFromOrder)({
|
|
110
|
-
order: {
|
|
111
|
-
...order,
|
|
112
|
-
acceptedOffers: await repos.acceptedOffer.searchAcceptedOffersByOrderNumber({
|
|
113
|
-
orderNumber: { $eq: order.orderNumber },
|
|
114
|
-
project: { id: { $eq: order.project.id } }
|
|
115
|
-
})
|
|
116
|
-
},
|
|
117
|
-
offerIndexBase: 0
|
|
118
|
-
});
|
|
119
|
-
const ownershipIdentifiers = ownershipInfos.map((o) => String(o.identifier));
|
|
120
|
-
if (ownershipIdentifiers.length > 0) {
|
|
121
|
-
await repos.ownershipInfo.deleteExpiredByIdentifiers({
|
|
122
|
-
project: { id: order.project.id },
|
|
123
|
-
identifiers: ownershipIdentifiers,
|
|
124
|
-
// 所有期限切れのもの(ownedThroughの存在しないものは削除してはいけない)
|
|
125
|
-
ownedThrough: { $lte: now }
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
}
|
package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { SettingRepo } from '../../../repo/setting';
|
|
|
5
5
|
import type { TaskRepo } from '../../../repo/task';
|
|
6
6
|
import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
|
|
7
7
|
import { factory } from '../../../factory';
|
|
8
|
-
import { Settings } from '../../../
|
|
8
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
9
9
|
interface IOnPayTransactionConfirmedRepos {
|
|
10
10
|
acceptedOffer: AcceptedOfferRepo;
|
|
11
11
|
assetTransaction: AssetTransactionRepo;
|
package/lib/chevre/service/order/onAssetTransactionStatusChanged/onReserveTransactionConfirmed.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { SettingRepo } from '../../../repo/setting';
|
|
|
5
5
|
import type { TaskRepo } from '../../../repo/task';
|
|
6
6
|
import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
|
|
7
7
|
import { factory } from '../../../factory';
|
|
8
|
-
import { Settings } from '../../../
|
|
8
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
9
9
|
interface IOnReserveTransactionConfirmedRepos {
|
|
10
10
|
acceptedOffer: AcceptedOfferRepo;
|
|
11
11
|
assetTransaction: AssetTransactionRepo;
|
|
@@ -3,7 +3,7 @@ import type { OrderRepo } from '../../../repo/order';
|
|
|
3
3
|
import type { SettingRepo } from '../../../repo/setting';
|
|
4
4
|
import type { TaskRepo } from '../../../repo/task';
|
|
5
5
|
import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
|
|
6
|
-
import { Settings } from '../../../
|
|
6
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
7
7
|
interface IPaymentDue2ProcessingRepos {
|
|
8
8
|
acceptedOffer: AcceptedOfferRepo;
|
|
9
9
|
order: OrderRepo;
|
|
@@ -55,28 +55,26 @@ function paymentDue2Processing(params) {
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
if (params.useOnOrderStatusChanged) {
|
|
58
|
-
// 全acceptedOffersを検索(2023-12-08~)
|
|
59
|
-
// const acceptedOffers = await repos.acceptedOffer.searchAcceptedOffersByOrderNumber(
|
|
60
|
-
// {
|
|
61
|
-
// orderNumber: { $eq: order.orderNumber },
|
|
62
|
-
// project: { id: { $eq: params.project.id } }
|
|
63
|
-
// },
|
|
64
|
-
// ['itemOffered', 'offeredThrough']
|
|
65
|
-
// );
|
|
66
58
|
const { numAcceptedOffers } = await repos.acceptedOffer.countByOrderNumber({
|
|
67
59
|
orderNumber: { $eq: order.orderNumber },
|
|
68
60
|
project: { id: { $eq: params.project.id } }
|
|
69
61
|
});
|
|
70
|
-
const itemOfferedTypeOfs = await repos.acceptedOffer.distinctValues(
|
|
62
|
+
// const itemOfferedTypeOfs = await repos.acceptedOffer.distinctValues(
|
|
63
|
+
// { orderNumber: { $in: [params.orderNumber] } },
|
|
64
|
+
// 'acceptedOffers.itemOffered.typeOf'
|
|
65
|
+
// ) as factory.order.IItemOffered['typeOf'][];
|
|
71
66
|
const serialNumbers = await repos.acceptedOffer.distinctValues({ orderNumber: { $in: [params.orderNumber] } }, 'acceptedOffers.serialNumber');
|
|
72
67
|
const offeredThroughIdentifier = (await repos.acceptedOffer.distinctValues({ orderNumber: { $in: [params.orderNumber] } }, 'acceptedOffers.offeredThrough.identifier')).shift();
|
|
73
|
-
debug('onAssetTransactionStatusChanged paymentDue2Processing: calling onOrderProcessing...', 'numAcceptedOffers:', numAcceptedOffers,
|
|
68
|
+
debug('onAssetTransactionStatusChanged paymentDue2Processing: calling onOrderProcessing...', 'numAcceptedOffers:', numAcceptedOffers,
|
|
69
|
+
// 'itemOfferedTypeOfs:', itemOfferedTypeOfs,
|
|
70
|
+
'serialNumbers:', serialNumbers, 'offeredThroughIdentifier:', offeredThroughIdentifier);
|
|
74
71
|
await (0, onOrderStatusChanged_1.onOrderProcessing)({
|
|
75
72
|
order: {
|
|
76
73
|
...order,
|
|
77
74
|
// acceptedOffers,
|
|
78
75
|
numAcceptedOffers,
|
|
79
|
-
itemOfferedTypeOf: itemOfferedTypeOfs[0], // 1つしかない前提
|
|
76
|
+
// itemOfferedTypeOf: itemOfferedTypeOfs[0], // 1つしかない前提
|
|
77
|
+
itemOfferedTypeOf: factory_1.factory.reservationType.EventReservation, // EventReservationしか存在しないので固定でよし
|
|
80
78
|
serialNumbers,
|
|
81
79
|
offeredThroughIdentifier,
|
|
82
80
|
orderStatus: factory_1.factory.orderStatus.OrderProcessing // 強制的にOrderProcessingとして処理する
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { OrderRepo } from '../../../repo/order';
|
|
2
2
|
import type { TaskRepo } from '../../../repo/task';
|
|
3
3
|
import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
|
|
4
|
-
import { Settings } from '../../../
|
|
4
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
5
5
|
declare function processing2inTransit(params: {
|
|
6
6
|
project: {
|
|
7
7
|
id: string;
|
|
@@ -7,7 +7,7 @@ import type { PlaceOrderRepo } from '../../repo/transaction/placeOrder';
|
|
|
7
7
|
import { paymentDue2Processing } from './onAssetTransactionStatusChanged/paymentDue2Processing';
|
|
8
8
|
import { processing2inTransit } from './onAssetTransactionStatusChanged/processing2inTransit';
|
|
9
9
|
import { factory } from '../../factory';
|
|
10
|
-
import { Settings } from '../../
|
|
10
|
+
import type { IntegrationSettingRepo as Settings } from '../../repo/setting/integration';
|
|
11
11
|
interface IOnAssetTransactionStatusChangedRepos {
|
|
12
12
|
acceptedOffer: AcceptedOfferRepo;
|
|
13
13
|
assetTransaction: AssetTransactionRepo;
|
|
@@ -9,7 +9,6 @@ exports.onOrderDelivered = onOrderDelivered;
|
|
|
9
9
|
*/
|
|
10
10
|
const debug_1 = __importDefault(require("debug"));
|
|
11
11
|
const factory_1 = require("../../../factory");
|
|
12
|
-
// import { Settings } from '../../../settings';
|
|
13
12
|
const factory_2 = require("./onOrderDelivered/factory");
|
|
14
13
|
const debug = (0, debug_1.default)('chevre-domain:service:order');
|
|
15
14
|
function onOrderDelivered(params) {
|
package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts
CHANGED
|
@@ -5,7 +5,12 @@ type IInTransitOrder = Pick<factory.order.IOrder, 'confirmationNumber' | 'projec
|
|
|
5
5
|
limit: number;
|
|
6
6
|
page: number;
|
|
7
7
|
};
|
|
8
|
-
deliveredAcceptedOffers: factory.order.IAcceptedOffer
|
|
8
|
+
deliveredAcceptedOffers: (Omit<factory.order.IAcceptedOffer, 'priceSpecification'> & {
|
|
9
|
+
/**
|
|
10
|
+
* COA以外では注文ドキュメントにpriceSpecificationが存在しないのでIFを補完
|
|
11
|
+
*/
|
|
12
|
+
priceSpecification?: factory.order.ITicketPriceSpecification;
|
|
13
|
+
})[];
|
|
9
14
|
orderStatus: factory.orderStatus.OrderInTransit;
|
|
10
15
|
};
|
|
11
16
|
declare function createInformTasks(params: {
|
|
@@ -9,7 +9,6 @@ exports.onOrderDeliveredPartially = onOrderDeliveredPartially;
|
|
|
9
9
|
*/
|
|
10
10
|
const debug_1 = __importDefault(require("debug"));
|
|
11
11
|
const factory_1 = require("../../../factory");
|
|
12
|
-
// import { Settings } from '../../../settings';
|
|
13
12
|
const factory_2 = require("./onOrderDeliveredPartially/factory");
|
|
14
13
|
const debug = (0, debug_1.default)('chevre-domain:service:order');
|
|
15
14
|
function onOrderDeliveredPartially(params) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TaskRepo } from '../../../repo/task';
|
|
2
2
|
import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
|
|
3
3
|
import { factory } from '../../../factory';
|
|
4
|
-
import { Settings } from '../../../
|
|
4
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
5
5
|
interface IOnOrderInTransitRepos {
|
|
6
6
|
task: TaskRepo;
|
|
7
7
|
placeOrder: PlaceOrderRepo;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SettingRepo } from '../../../repo/setting';
|
|
2
2
|
import type { TaskRepo } from '../../../repo/task';
|
|
3
3
|
import { factory } from '../../../factory';
|
|
4
|
-
import { Settings } from '../../../
|
|
4
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
5
5
|
import { IExternalOrder, IProcessingOrder } from './onOrderProcessing/factory';
|
|
6
6
|
import { processOrder } from './onOrderProcessing/processOrder';
|
|
7
7
|
type IPlaceOrderTransaction = Pick<factory.transaction.placeOrder.ITransaction, 'id' | 'typeOf' | 'potentialActions'>;
|
|
@@ -18,7 +18,8 @@ const debug = (0, debug_1.default)('chevre-domain:service:order');
|
|
|
18
18
|
function onOrderProcessing(params) {
|
|
19
19
|
return async (repos, settings) => {
|
|
20
20
|
const setting = await repos.setting.findOne({ project: { id: { $eq: '*' } } }, ['onOrderStatusChanged']);
|
|
21
|
-
const { numTryConfirmReserveTransaction } = settings;
|
|
21
|
+
// const { numTryConfirmReserveTransaction } = settings;
|
|
22
|
+
const numTryConfirmReserveTransaction = await settings.getByKey('numTryConfirmReserveTransaction');
|
|
22
23
|
debug('onOrderStatusChanged called.', params.order.orderNumber, params.order.orderStatus, params.order.orderDate);
|
|
23
24
|
let tasks;
|
|
24
25
|
let creatingCheckResourceTask;
|
|
@@ -10,7 +10,6 @@ exports.onOrderReturned = onOrderReturned;
|
|
|
10
10
|
const debug_1 = __importDefault(require("debug"));
|
|
11
11
|
const google_libphonenumber_1 = require("google-libphonenumber");
|
|
12
12
|
const factory_1 = require("../../../factory");
|
|
13
|
-
// import { Settings } from '../../../settings';
|
|
14
13
|
// import { createMaskedCustomer } from '../../../factory/order';
|
|
15
14
|
const factory_2 = require("./onOrderReturned/factory");
|
|
16
15
|
const debug = (0, debug_1.default)('chevre-domain:service:order');
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.onOrderUpdated = onOrderUpdated;
|
|
4
4
|
const factory_1 = require("../../factory");
|
|
5
|
-
// import { Settings } from '../../settings';
|
|
6
5
|
const factory_2 = require("./onOrderUpdated/factory");
|
|
7
6
|
function onOrderUpdated(params) {
|
|
8
7
|
return async (repos
|
|
@@ -4,7 +4,7 @@ import type { SettingRepo } from '../../repo/setting';
|
|
|
4
4
|
import type { TaskRepo } from '../../repo/task';
|
|
5
5
|
import type { PlaceOrderRepo } from '../../repo/transaction/placeOrder';
|
|
6
6
|
import { factory } from '../../factory';
|
|
7
|
-
import { Settings } from '../../
|
|
7
|
+
import type { IntegrationSettingRepo as Settings } from '../../repo/setting/integration';
|
|
8
8
|
/**
|
|
9
9
|
* 注文を決済する
|
|
10
10
|
*/
|
|
@@ -80,7 +80,10 @@ function createPlacingOrderFromExistingTransaction(params) {
|
|
|
80
80
|
.map(({ instrument }) => String(instrument.transactionNumber));
|
|
81
81
|
try {
|
|
82
82
|
// すでにtypeOf: Orderに変更済の場合acceptedOffersは空になるが、そもそもorderedItemはその後上書きされないので、空のまま処理して問題なし
|
|
83
|
-
acceptedOffers = (await repos.orderInTransaction.
|
|
83
|
+
acceptedOffers = (await repos.orderInTransaction.findAcceptedOffersWithPriceByOrderNumber({
|
|
84
|
+
orderNumber,
|
|
85
|
+
project: { id: params.project.id }
|
|
86
|
+
}))
|
|
84
87
|
.filter(({ serialNumber }) => typeof serialNumber === 'string' && serialNumbers.includes(serialNumber));
|
|
85
88
|
}
|
|
86
89
|
catch (error) {
|
|
@@ -3,6 +3,6 @@ import { factory } from '../../../../factory';
|
|
|
3
3
|
* 受入オファーを注文アイテムに変換する
|
|
4
4
|
*/
|
|
5
5
|
declare function acceptedOffers2orderedItem(params: {
|
|
6
|
-
eventReservationAcceptedOffers: factory.order.IAcceptedOffer[];
|
|
6
|
+
eventReservationAcceptedOffers: Pick<factory.order.IAcceptedOffer, 'itemOffered'>[];
|
|
7
7
|
}): factory.order.IOrderedItem[];
|
|
8
8
|
export { acceptedOffers2orderedItem };
|
|
@@ -9,11 +9,6 @@ function acceptedOffers2orderedItem(params) {
|
|
|
9
9
|
// 予約がある場合
|
|
10
10
|
const { reservationOrderItems } = createReservationAcceptedOffers(params);
|
|
11
11
|
// 通貨転送がある場合
|
|
12
|
-
// const { moneyTransferOrderItems } = createMoneyTransferAcceptedOffers(params);
|
|
13
|
-
// プロダクトがある場合
|
|
14
|
-
// const { productOrderItems } = createProductItems(params);
|
|
15
|
-
// return [...reservationOrderItems, ...moneyTransferOrderItems, ...productOrderItems];
|
|
16
|
-
// return [...reservationOrderItems, ...productOrderItems];
|
|
17
12
|
return reservationOrderItems;
|
|
18
13
|
}
|
|
19
14
|
function createReservationAcceptedOffers(params) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IPlacingOrder } from '../../../repo/orderInTransaction';
|
|
2
2
|
import { factory } from '../../../factory';
|
|
3
3
|
type IPlaceOrderTransaction = Pick<factory.transaction.placeOrder.ITransaction, 'id' | 'project' | 'typeOf' | 'result' | 'object' | 'seller'>;
|
|
4
|
-
type IOrderAcceptedOffer = factory.order.IAcceptedOffer
|
|
4
|
+
type IOrderAcceptedOffer = Pick<factory.order.IAcceptedOffer, 'itemOffered' | 'serialNumber'>;
|
|
5
5
|
declare function createPaymentMethods(params: {
|
|
6
6
|
authorizePaymentActions: Pick<factory.action.authorize.paymentMethod.any.IAction, 'result'>[];
|
|
7
7
|
}): {
|
|
@@ -9,7 +9,7 @@ import type { SettingRepo } from '../../repo/setting';
|
|
|
9
9
|
import type { TaskRepo } from '../../repo/task';
|
|
10
10
|
import type { PlaceOrderRepo } from '../../repo/transaction/placeOrder';
|
|
11
11
|
import { factory } from '../../factory';
|
|
12
|
-
import { Settings } from '../../
|
|
12
|
+
import type { IntegrationSettingRepo as Settings } from '../../repo/setting/integration';
|
|
13
13
|
interface IPlaceOrderRepos {
|
|
14
14
|
acceptedOffer: AcceptedOfferRepo;
|
|
15
15
|
accountingReport: AccountingReportRepo;
|
|
@@ -8,7 +8,6 @@ const debug_1 = __importDefault(require("debug"));
|
|
|
8
8
|
// import { createMaskedCustomer } from '../../factory/order';
|
|
9
9
|
const onOrderStatusChanged_1 = require("./onOrderStatusChanged");
|
|
10
10
|
const factory_1 = require("../../factory");
|
|
11
|
-
// import { Settings } from '../../settings';
|
|
12
11
|
const debug = (0, debug_1.default)('chevre-domain:service:order');
|
|
13
12
|
function createReturnPolicy(params) {
|
|
14
13
|
const { identifier, returnFees, restockingFee, typeOf } = params.returnOrderTransaction.object.returnPolicy;
|
|
@@ -10,7 +10,6 @@ const factory_1 = require("../delivery/factory");
|
|
|
10
10
|
// import { findPlaceOrderTransaction } from './findPlaceOrderTransaction';
|
|
11
11
|
const onOrderStatusChanged_1 = require("./onOrderStatusChanged");
|
|
12
12
|
const factory_2 = require("../../factory");
|
|
13
|
-
// import { Settings } from '../../settings';
|
|
14
13
|
const debug = (0, debug_1.default)('chevre-domain:service:order');
|
|
15
14
|
/**
|
|
16
15
|
* 注文を配送する
|
|
@@ -94,10 +93,7 @@ function sendOrder(params) {
|
|
|
94
93
|
case factory_2.factory.personType.Person:
|
|
95
94
|
createOwnerships = true; // Personのみに限定(2026-03-15~)
|
|
96
95
|
break;
|
|
97
|
-
// case factory.creativeWorkType.WebApplication:
|
|
98
|
-
// break;
|
|
99
96
|
default:
|
|
100
|
-
// createOwnerships = true;
|
|
101
97
|
}
|
|
102
98
|
try {
|
|
103
99
|
const offerIndexBase = (limit * (page - 1));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { factory } from '../../../factory';
|
|
2
|
-
import { Settings } from '../../../
|
|
2
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
3
3
|
import type { AccountingReportRepo } from '../../../repo/accountingReport';
|
|
4
4
|
import type { PayActionRepo } from '../../../repo/action/pay';
|
|
5
5
|
import type { RefundActionRepo } from '../../../repo/action/refund';
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.person2username = person2username;
|
|
4
4
|
const factory_1 = require("../../../factory");
|
|
5
|
-
// import { Settings } from '../../../settings';
|
|
6
5
|
const person_1 = require("../../../repo/person");
|
|
7
6
|
const SSKTS_PROVIDER_NAME = 'SSKTS';
|
|
8
7
|
async function person2username(person, cognitoIdentityServiceProvider, setting
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { factory } from '../../../factory';
|
|
2
|
-
import { Settings } from '../../../
|
|
2
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
3
3
|
import type { AcceptPayActionRepo } from '../../../repo/action/acceptPay';
|
|
4
4
|
import type { AuthorizeInvoiceActionRepo } from '../../../repo/action/authorizeInvoice';
|
|
5
5
|
import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { factory } from '../../../factory';
|
|
2
|
-
import { Settings } from '../../../
|
|
2
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
3
3
|
import type { AuthorizeInvoiceActionRepo } from '../../../repo/action/authorizeInvoice';
|
|
4
4
|
import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
5
5
|
import type { PaymentServiceProviderRepo } from '../../../repo/paymentServiceProvider';
|
|
@@ -47,10 +47,11 @@ payTransaction, paymentServiceId, options) {
|
|
|
47
47
|
try {
|
|
48
48
|
// タスクによって実行されているかどうか
|
|
49
49
|
const executedByTask = typeof options.executor?.id === 'string' && options.executor.id !== '';
|
|
50
|
+
const gmoIntegrationSettings = await settings.getByKey('gmo');
|
|
50
51
|
// 非同期承認時に長時間対応(2024-05-18~)
|
|
51
|
-
const timeout = (executedByTask && typeof
|
|
52
|
-
?
|
|
53
|
-
:
|
|
52
|
+
const timeout = (executedByTask && typeof gmoIntegrationSettings.timeoutBackground === 'number')
|
|
53
|
+
? gmoIntegrationSettings.timeoutBackground
|
|
54
|
+
: gmoIntegrationSettings.timeout;
|
|
54
55
|
debug('processAuthorizeCreditCard processing... executor:', options.executor?.id, 'timeout:', timeout);
|
|
55
56
|
const creditCardService = new gmo_service_1.GMO.service.Credit({
|
|
56
57
|
endpoint: String(availableChannel.serviceUrl)
|
|
@@ -6,7 +6,7 @@ import type { PaymentServiceProviderRepo } from '../../../repo/paymentServicePro
|
|
|
6
6
|
import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccepted';
|
|
7
7
|
import type { TaskRepo } from '../../../repo/task';
|
|
8
8
|
import { factory } from '../../../factory';
|
|
9
|
-
import { Settings } from '../../../
|
|
9
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
10
10
|
/**
|
|
11
11
|
* クレジットカード決済
|
|
12
12
|
*/
|
|
@@ -39,7 +39,7 @@ function payCreditCard(params) {
|
|
|
39
39
|
try {
|
|
40
40
|
const creditService = new gmo_service_1.GMO.service.Credit({
|
|
41
41
|
endpoint: String(availableChannel.serviceUrl)
|
|
42
|
-
}, { timeout: settings.gmo.timeout });
|
|
42
|
+
}, { timeout: (await settings.getByKey('gmo')).timeout });
|
|
43
43
|
await Promise.all(payObject.map(async (paymentMethod) => {
|
|
44
44
|
const processAlterTranResult = await processAlterTran({
|
|
45
45
|
shopId, shopPass, availableChannel, paymentMethod
|
|
@@ -6,7 +6,7 @@ import type { PaymentServiceProviderRepo } from '../../../repo/paymentServicePro
|
|
|
6
6
|
import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccepted';
|
|
7
7
|
import type { TaskRepo } from '../../../repo/task';
|
|
8
8
|
import { factory } from '../../../factory';
|
|
9
|
-
import { Settings } from '../../../
|
|
9
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
10
10
|
/**
|
|
11
11
|
* refund CreditCard IF payment
|
|
12
12
|
*/
|
|
@@ -59,7 +59,7 @@ function refundCreditCard(params
|
|
|
59
59
|
try {
|
|
60
60
|
const creditService = new gmo_service_1.GMO.service.Credit({
|
|
61
61
|
endpoint: String(availableChannel.serviceUrl)
|
|
62
|
-
}, { timeout: settings.gmo.timeout });
|
|
62
|
+
}, { timeout: (await settings.getByKey('gmo')).timeout });
|
|
63
63
|
processAlterTranResult = await processAlterTran({
|
|
64
64
|
availableChannel,
|
|
65
65
|
alterTranResultByPayAction,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GMO } from '@motionpicture/gmo-service';
|
|
2
2
|
import { factory } from '../../../factory';
|
|
3
|
-
import { Settings } from '../../../
|
|
3
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
4
4
|
/**
|
|
5
5
|
* 決済代行側の取引状態参照
|
|
6
6
|
* 存在しない場合NotFoundエラー
|
|
@@ -11,7 +11,7 @@ const gmoError_1 = require("./gmoError");
|
|
|
11
11
|
async function searchGMOTrade(params, settings) {
|
|
12
12
|
const creditCardService = new gmo_service_1.GMO.service.Credit({
|
|
13
13
|
endpoint: String(params.availableChannel.serviceUrl)
|
|
14
|
-
}, { timeout: settings.gmo.timeout });
|
|
14
|
+
}, { timeout: (await settings.getByKey('gmo')).timeout });
|
|
15
15
|
// 取引状態参照
|
|
16
16
|
let searchTradeResult;
|
|
17
17
|
try {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { factory } from '../../../factory';
|
|
2
|
-
import { Settings } from '../../../
|
|
2
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
3
3
|
import type { AuthorizeInvoiceActionRepo } from '../../../repo/action/authorizeInvoice';
|
|
4
4
|
import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
5
5
|
import type { PaymentServiceProviderRepo } from '../../../repo/paymentServiceProvider';
|
|
@@ -59,7 +59,7 @@ function voidTransaction(params) {
|
|
|
59
59
|
}
|
|
60
60
|
const creditCardService = new gmo_service_1.GMO.service.Credit({
|
|
61
61
|
endpoint: String(availableChannel.serviceUrl)
|
|
62
|
-
}, { timeout: settings.gmo.timeout });
|
|
62
|
+
}, { timeout: (await settings.getByKey('gmo')).timeout });
|
|
63
63
|
let searchTradeResult;
|
|
64
64
|
try {
|
|
65
65
|
searchTradeResult = await creditCardService.searchTrade({
|
|
@@ -12,5 +12,12 @@ declare function createPayObjectServiceOutput(params: {
|
|
|
12
12
|
purchaseNumberAuthResult: factory.action.check.paymentMethod.movieTicket.IPurchaseNumberAuthResult;
|
|
13
13
|
};
|
|
14
14
|
}): factory.invoice.IPaymentServiceOutput | undefined;
|
|
15
|
-
|
|
15
|
+
/**
|
|
16
|
+
* 決済カードの適用された注文オファー
|
|
17
|
+
*/
|
|
18
|
+
type IAcceptedOfferMovieTicketUsed = Pick<factory.order.IAcceptedOffer, 'priceSpecification'> & {
|
|
19
|
+
itemOffered: Pick<factory.order.IReservation, 'reservationFor' | 'reservationNumber'> & {
|
|
20
|
+
reservedTicket: Pick<factory.order.IReservedTicket, 'identifier' | 'ticketedSeat' | 'ticketToken'> | Pick<factory.order.ICOAReservedTicket, 'identifier' | 'ticketedSeat' | 'ticketToken'>;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
16
23
|
export { createPayObjectServiceOutput, IAcceptedOfferMovieTicketUsed };
|
|
@@ -131,7 +131,7 @@ function reservationPriceComponent2invoicePriceComponent(component) {
|
|
|
131
131
|
* 決済カードの対象予約情報を作成する
|
|
132
132
|
*/
|
|
133
133
|
function movieTicket2reservation4invoice(movieTicket, order, paymentMethodType, payTransactionNumber) {
|
|
134
|
-
// Order
|
|
134
|
+
// Orderから決済カードの対象予約を取得
|
|
135
135
|
const reservationOffer = order.acceptedOffersMovieTicketUsed.find(({ itemOffered, priceSpecification }) => {
|
|
136
136
|
let mvtkUnitPriceSpec;
|
|
137
137
|
// MovieTicket適用単価オファーからidentifierを取り出す
|
|
@@ -9,7 +9,7 @@ import type { PaymentServiceProviderRepo } from '../../../repo/paymentServicePro
|
|
|
9
9
|
import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccepted';
|
|
10
10
|
import type { TaskRepo } from '../../../repo/task';
|
|
11
11
|
import { factory } from '../../../factory';
|
|
12
|
-
import { Settings } from '../../../
|
|
12
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
13
13
|
interface IAuthorizeResult {
|
|
14
14
|
accountId: string;
|
|
15
15
|
accountsReceivablesByServiceType: factory.assetTransaction.pay.IAccountsReceivableByServiceType[];
|
|
@@ -5,7 +5,7 @@ import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
|
5
5
|
import type { PaymentServiceProviderRepo } from '../../../repo/paymentServiceProvider';
|
|
6
6
|
import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccepted';
|
|
7
7
|
import { factory } from '../../../factory';
|
|
8
|
-
import { Settings } from '../../../
|
|
8
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
9
9
|
import { ICheckResult } from './processPurchaseNumberAuth';
|
|
10
10
|
interface ICheckOperationRepos {
|
|
11
11
|
checkMovieTicketAction: CheckMovieTicketActionRepo;
|
|
@@ -8,7 +8,7 @@ import type { PaymentServiceProviderRepo } from '../../../repo/paymentServicePro
|
|
|
8
8
|
import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccepted';
|
|
9
9
|
import type { TaskRepo } from '../../../repo/task';
|
|
10
10
|
import { factory } from '../../../factory';
|
|
11
|
-
import { Settings } from '../../../
|
|
11
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
12
12
|
interface IPayOperationRepos {
|
|
13
13
|
action?: never;
|
|
14
14
|
actions: {
|
|
@@ -53,7 +53,7 @@ function payMovieTicket(params, options) {
|
|
|
53
53
|
state: '',
|
|
54
54
|
credentialsRepo: repos.credentials // set credentialsRepo(2024-11-20~)
|
|
55
55
|
});
|
|
56
|
-
const seatService = new sdk_1.Surfrock.service.seat.SeatService({ endpoint: String(availableChannel.serviceUrl), auth: mvtkReserveAuthClient }, { timeout: settings.movieticketReserve.
|
|
56
|
+
const seatService = new sdk_1.Surfrock.service.seat.SeatService({ endpoint: String(availableChannel.serviceUrl), auth: mvtkReserveAuthClient }, { timeout: (await settings.getByKey('movieticketReserve')).timeoutPay });
|
|
57
57
|
processSeatInfoSyncResult = await (0, processSeatInfoSync_1.processSeatInfoSync)({ seatInfoSyncIn })({ seatService });
|
|
58
58
|
}
|
|
59
59
|
// add recipe(2024-06-03~)
|
|
@@ -3,7 +3,7 @@ import type { IMinimizedIndividualEvent } from '../../../repo/event';
|
|
|
3
3
|
import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
4
4
|
import type { PaymentServiceProviderRepo } from '../../../repo/paymentServiceProvider';
|
|
5
5
|
import { factory } from '../../../factory';
|
|
6
|
-
import { Settings } from '../../../
|
|
6
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
7
7
|
interface ICheckResult {
|
|
8
8
|
purchaseNumberAuthIn: factory.action.check.paymentMethod.movieTicket.IPurchaseNumberAuthIn;
|
|
9
9
|
purchaseNumberAuthResult: factory.action.check.paymentMethod.movieTicket.IPurchaseNumberAuthResult;
|