@chevre/domain 24.1.0-alpha.6 → 24.1.0-alpha.60
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.d.ts +1 -1
- package/lib/chevre/emailMessageBuilder.js +4 -12
- package/lib/chevre/factory/transaction/placeOrder.d.ts +0 -3
- package/lib/chevre/index.d.ts +1 -2
- package/lib/chevre/index.js +1 -3
- package/lib/chevre/repo/acceptedOffer.d.ts +25 -27
- package/lib/chevre/repo/acceptedOffer.js +102 -67
- package/lib/chevre/repo/acceptedOfferInReserve.d.ts +34 -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 +9 -0
- package/lib/chevre/repo/factory/acceptedOffer/reserveTransaction2itemOffered.js +76 -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 +134 -131
- package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +3 -1
- package/lib/chevre/repo/mongoose/schemas/reservation.js +96 -147
- 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 +3 -83
- package/lib/chevre/repo/order.js +16 -376
- package/lib/chevre/repo/orderInTransaction.d.ts +58 -7
- 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/createSubReservations.js +2 -2
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createReservation.d.ts +1 -8
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createReservation.js +20 -32
- 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 +17 -18
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +1 -1
- package/lib/chevre/service/offer/event/authorize.d.ts +2 -2
- package/lib/chevre/service/offer/event/authorize.js +55 -107
- 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.d.ts +1 -1
- package/lib/chevre/service/order/deleteOrder.js +19 -46
- 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.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/factory.js +13 -17
- package/lib/chevre/service/order/placeOrder.d.ts +3 -2
- package/lib/chevre/service/order/placeOrder.js +0 -9
- package/lib/chevre/service/order/returnOrder.js +0 -1
- package/lib/chevre/service/order/sendOrder.js +1 -7
- package/lib/chevre/service/payment/any/authorize.d.ts +1 -1
- package/lib/chevre/service/payment/any/factory.js +7 -6
- 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/transaction/placeOrder/confirm/factory/result.d.ts +0 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/factory/result.js +7 -17
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.d.ts +7 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.js +0 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.d.ts +7 -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 +5 -3
- package/lib/chevre/service/transaction/placeOrder/confirm.js +28 -40
- package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +0 -1
- package/lib/chevre/service/transaction/placeOrder/start/factory.d.ts +11 -2
- package/lib/chevre/service/transaction/placeOrder/start/factory.js +12 -10
- package/lib/chevre/service/transaction/placeOrder/start/validateStartRequest.d.ts +1 -2
- package/lib/chevre/service/transaction/placeOrder/start/validateStartRequest.js +5 -16
- package/lib/chevre/service/transaction/placeOrder/start.d.ts +3 -4
- package/lib/chevre/service/transaction/placeOrder/start.js +2 -2
- package/lib/chevre/service/transaction/placeOrder/updateAgent.js +0 -1
- package/lib/chevre/service/transaction/placeOrder.d.ts +2 -2
- package/lib/chevre/service/transaction/returnOrder/exportTasks/factory.js +0 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.d.ts +1 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.js +0 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions/sendEmailMessage.d.ts +1 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions.d.ts +1 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions.js +0 -1
- package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -4
- package/lib/chevre/service/transaction/returnOrder.js +1 -1
- package/lib/chevre/service/validation/validateOrder.js +4 -79
- 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
|
@@ -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
|
*/
|
|
@@ -22,4 +22,4 @@ declare function createPlacingOrderFromExistingTransaction(params: {
|
|
|
22
22
|
placeOrderTransaction: IPlaceOrderTransaction;
|
|
23
23
|
serialNumbers: string[];
|
|
24
24
|
}>;
|
|
25
|
-
export { ICreatePlacingOrderFromExistingTransactionRepos, createPlacingOrderFromExistingTransaction };
|
|
25
|
+
export { ICreatePlacingOrderFromExistingTransactionRepos, IPlacingOrder, createPlacingOrderFromExistingTransaction };
|
|
@@ -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
|
}): {
|
|
@@ -15,7 +15,6 @@ function createPaymentMethods(params) {
|
|
|
15
15
|
// 決済方法をセット
|
|
16
16
|
params.authorizePaymentActions.forEach((a) => {
|
|
17
17
|
const resultAsInvoice = (Array.isArray(a.result))
|
|
18
|
-
// ? a.result?.find(({ typeOf }) => typeOf === factory.action.authorize.paymentMethod.any.ResultType.Payment)
|
|
19
18
|
? a.result[0]
|
|
20
19
|
: undefined;
|
|
21
20
|
if (resultAsInvoice === undefined) {
|
|
@@ -42,16 +41,12 @@ function createPaymentMethods(params) {
|
|
|
42
41
|
paymentStatus: resultAsInvoice.paymentStatus,
|
|
43
42
|
paymentMethod: paymentMethodOfInvoice,
|
|
44
43
|
...(resultAsInvoice.totalPaymentDue !== undefined) ? { totalPaymentDue: resultAsInvoice.totalPaymentDue } : undefined
|
|
45
|
-
// ...(USE_ORDER_PAYMENT_METHOD_TYPE_OF) // 完全廃止(2024-01-17~)
|
|
46
|
-
// ? { typeOf: paymentMethodType }
|
|
47
|
-
// : undefined
|
|
48
44
|
});
|
|
49
45
|
});
|
|
50
46
|
// 決済方法から注文金額の計算
|
|
51
47
|
price += params.authorizePaymentActions
|
|
52
48
|
.reduce((a, b) => {
|
|
53
49
|
const resultAsInvoice = (Array.isArray(b.result))
|
|
54
|
-
// ? b.result?.find(({ typeOf }) => typeOf === factory.action.authorize.paymentMethod.any.ResultType.Payment)
|
|
55
50
|
? b.result[0]
|
|
56
51
|
: undefined;
|
|
57
52
|
const jpyAmount = (resultAsInvoice?.totalPaymentDue?.currency === factory_1.factory.priceCurrency.JPY)
|
|
@@ -78,42 +73,43 @@ function createPlacingOrder(params) {
|
|
|
78
73
|
throw new factory_1.factory.errors.NotFound('transaction.result.order');
|
|
79
74
|
}
|
|
80
75
|
const seller = createSeller({ transaction });
|
|
81
|
-
|
|
76
|
+
// discontinue(2026-06-11~)
|
|
77
|
+
// const name: string | undefined =
|
|
78
|
+
// (typeof transaction.object.name === 'string') ? transaction.object.name : undefined;
|
|
82
79
|
const broker = (typeof transaction.object.broker?.typeOf === 'string') ? transaction.object.broker : undefined;
|
|
83
80
|
const { paymentMethods, price } = createPaymentMethods({ authorizePaymentActions });
|
|
84
81
|
const eventReservationAcceptedOffers = [];
|
|
85
|
-
// const productAcceptedOffers: factory.order.IAcceptedOffer<factory.order.IPermit>[] = [];
|
|
86
|
-
// const moneyTransferAcceptedOffers: factory.order.IAcceptedOffer<factory.order.IMoneyTransfer>[] = [];
|
|
87
82
|
params.acceptedOffers.forEach((acceptedOffer) => {
|
|
88
83
|
const itemOfferedTypeOf = acceptedOffer.itemOffered.typeOf;
|
|
89
84
|
switch (itemOfferedTypeOf) {
|
|
90
85
|
case factory_1.factory.reservationType.EventReservation:
|
|
91
86
|
eventReservationAcceptedOffers.push(acceptedOffer);
|
|
92
87
|
break;
|
|
93
|
-
// case factory.permit.PermitType.Permit:
|
|
94
|
-
// productAcceptedOffers.push((acceptedOffer as factory.order.IAcceptedOffer<factory.order.IPermit>));
|
|
95
|
-
// break;
|
|
96
|
-
// case factory.actionType.MoneyTransfer:
|
|
97
|
-
// moneyTransferAcceptedOffers.push(<factory.order.IAcceptedOffer<factory.order.IMoneyTransfer>>acceptedOffer);
|
|
98
|
-
// break;
|
|
99
88
|
default:
|
|
100
89
|
throw new factory_1.factory.errors.NotImplemented(`${itemOfferedTypeOf} not implemented`);
|
|
101
90
|
}
|
|
102
91
|
});
|
|
103
92
|
const orderedItem = (0, orderedItem_1.acceptedOffers2orderedItem)({
|
|
104
93
|
eventReservationAcceptedOffers,
|
|
105
|
-
// productAcceptedOffers,
|
|
106
|
-
// moneyTransferAcceptedOffers
|
|
107
94
|
});
|
|
95
|
+
const confirmationNumber = transaction.object.confirmationNumber;
|
|
96
|
+
if (typeof confirmationNumber !== 'string') {
|
|
97
|
+
// 事前に発行済なはずなので、ありえないフロー
|
|
98
|
+
throw new factory_1.factory.errors.Internal('object.confirmationNumber undefined');
|
|
99
|
+
}
|
|
108
100
|
return {
|
|
109
101
|
...orderByTransaction,
|
|
102
|
+
confirmationNumber,
|
|
103
|
+
typeOf: factory_1.factory.order.OrderType.Order, // 取引保管を廃止するためにここで指定(2026-06-14~)
|
|
104
|
+
orderStatus: factory_1.factory.orderStatus.OrderPaymentDue, // 取引保管を廃止するためにここで指定(2026-06-14~)
|
|
110
105
|
seller, // 2024-06-17~
|
|
111
106
|
paymentMethods, // 2024-06-17~
|
|
112
107
|
price, // 2024-06-17~
|
|
108
|
+
priceCurrency: factory_1.factory.priceCurrency.JPY, // 取引保管を廃止するためにここで指定(2026-06-14~)
|
|
113
109
|
orderDate: (0, moment_1.default)(orderByTransaction.orderDate)
|
|
114
110
|
.toDate(),
|
|
115
111
|
orderedItem, // 2024-06-18~
|
|
116
|
-
...(typeof name === 'string') ? { name } : undefined, //
|
|
112
|
+
// ...(typeof name === 'string') ? { name } : undefined, // discontinue(2026-06-11~)
|
|
117
113
|
...(typeof broker?.typeOf === 'string') ? { broker } : undefined // 2024-06-17~
|
|
118
114
|
};
|
|
119
115
|
}
|
|
@@ -9,7 +9,8 @@ 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
|
+
import { IPlacingOrder } from './placeOrder/createPlacingOrderFromExistingTransaction';
|
|
13
14
|
interface IPlaceOrderRepos {
|
|
14
15
|
acceptedOffer: AcceptedOfferRepo;
|
|
15
16
|
accountingReport: AccountingReportRepo;
|
|
@@ -36,6 +37,6 @@ declare function placeOrder(params: {
|
|
|
36
37
|
};
|
|
37
38
|
useOnOrderStatusChanged: boolean;
|
|
38
39
|
}): (repos: IPlaceOrderRepos, settings: Settings) => Promise<{
|
|
39
|
-
order:
|
|
40
|
+
order: IPlacingOrder;
|
|
40
41
|
}>;
|
|
41
42
|
export { IPlaceOrderRepos, placeOrder };
|
|
@@ -31,15 +31,7 @@ function placeOrder(params) {
|
|
|
31
31
|
}
|
|
32
32
|
const simpleOrder = {
|
|
33
33
|
typeOf: order.typeOf,
|
|
34
|
-
// seller: {
|
|
35
|
-
// id: order.seller.id,
|
|
36
|
-
// typeOf: order.seller.typeOf,
|
|
37
|
-
// name: order.seller.name
|
|
38
|
-
// }, // 廃止(2024-03-06~)
|
|
39
|
-
// customer: { typeOf: maskedCustomer.typeOf, id: maskedCustomer.id }, // 廃止(2024-03-06~)
|
|
40
34
|
orderNumber: order.orderNumber,
|
|
41
|
-
// price: order.price,
|
|
42
|
-
// priceCurrency: order.priceCurrency,
|
|
43
35
|
orderDate: order.orderDate
|
|
44
36
|
};
|
|
45
37
|
const orderActionPurpose = {
|
|
@@ -48,7 +40,6 @@ function placeOrder(params) {
|
|
|
48
40
|
const orderActionAttributes = {
|
|
49
41
|
agent: (typeof params.agent?.typeOf === 'string') ? params.agent : placeOrderTransaction.project,
|
|
50
42
|
object: simpleOrder,
|
|
51
|
-
// potentialActions: {}, // discontinue(2024-06-28~)
|
|
52
43
|
project: placeOrderTransaction.project,
|
|
53
44
|
purpose: orderActionPurpose,
|
|
54
45
|
typeOf: factory_1.factory.actionType.OrderAction
|
|
@@ -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));
|
|
@@ -107,8 +103,7 @@ function sendOrder(params) {
|
|
|
107
103
|
project: { id: { $eq: order.project.id } }
|
|
108
104
|
});
|
|
109
105
|
acceptedOffers = searchSlicedAcceptedOffersResult.acceptedOffers;
|
|
110
|
-
debug('delivering...', order.orderNumber,
|
|
111
|
-
params.object.acceptedOffers, 'offerIndexBase:', offerIndexBase);
|
|
106
|
+
debug('delivering...', order.orderNumber, params.object.acceptedOffers, 'offerIndexBase:', offerIndexBase);
|
|
112
107
|
// 所有権作成
|
|
113
108
|
if (createOwnerships) {
|
|
114
109
|
creatingOwnershipInfos = (0, factory_1.createOwnershipInfosFromOrder)({
|
|
@@ -163,7 +158,6 @@ function sendOrder(params) {
|
|
|
163
158
|
price: order.price,
|
|
164
159
|
priceCurrency: order.priceCurrency
|
|
165
160
|
}
|
|
166
|
-
// placeOrderTransaction
|
|
167
161
|
})(repos);
|
|
168
162
|
}
|
|
169
163
|
else {
|
|
@@ -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';
|
|
@@ -162,12 +162,13 @@ function creatPayTransactionStartParams(params) {
|
|
|
162
162
|
};
|
|
163
163
|
}
|
|
164
164
|
function createMovieTicket(params) {
|
|
165
|
-
|
|
166
|
-
//
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
165
|
+
const ticketIdentifier = (0, util_1.format)('%s:%s:%s', params.serviceOutput.reservationFor.id, params.serviceOutput.reservedTicket.ticketedSeat.seatSection, params.serviceOutput.reservedTicket.ticketedSeat.seatNumber);
|
|
166
|
+
// カスタム指定は廃止(2026-06-08~)
|
|
167
|
+
// // 指定があれば採用(2024-04-16~)
|
|
168
|
+
// const ticketIdentifierByRequest = params.serviceOutput.reservedTicket.identifier;
|
|
169
|
+
// if (typeof ticketIdentifierByRequest === 'string' && ticketIdentifierByRequest.length > 0) {
|
|
170
|
+
// ticketIdentifier = ticketIdentifierByRequest;
|
|
171
|
+
// }
|
|
171
172
|
const serviceOutput = {
|
|
172
173
|
reservationFor: {
|
|
173
174
|
typeOf: params.serviceOutput.reservationFor.typeOf,
|
|
@@ -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;
|
|
@@ -73,7 +73,7 @@ function processPurchaseNumberAuth(params) {
|
|
|
73
73
|
const authService = new sdk_1.Surfrock.service.auth.AuthService({
|
|
74
74
|
endpoint: String(availableChannel.serviceUrl),
|
|
75
75
|
auth: mvtkReserveAuthClient
|
|
76
|
-
}, { timeout: settings.movieticketReserve.timeoutCheck });
|
|
76
|
+
}, { timeout: (await settings.getByKey('movieticketReserve')).timeoutCheck });
|
|
77
77
|
const purchaseNumberAuthResult = await authService.purchaseNumberAuth(purchaseNumberAuthIn);
|
|
78
78
|
return { purchaseNumberAuthIn, purchaseNumberAuthResult };
|
|
79
79
|
};
|
|
@@ -5,7 +5,7 @@ import type { CredentialsRepo } from '../../../repo/credentials';
|
|
|
5
5
|
import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
6
6
|
import type { TaskRepo } from '../../../repo/task';
|
|
7
7
|
import { factory } from '../../../factory';
|
|
8
|
-
import { Settings } from '../../../
|
|
8
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
9
9
|
interface IRefundOperationRepos {
|
|
10
10
|
action?: never;
|
|
11
11
|
actions: {
|
|
@@ -17,7 +17,7 @@ const processSeatInfoSyncCancel_1 = require("./refundMovieTicket/processSeatInfo
|
|
|
17
17
|
function wait4payActionDelayIfNeeded(params) {
|
|
18
18
|
return async (settings) => {
|
|
19
19
|
const { payAction } = params;
|
|
20
|
-
const minIntervalBetweenPayAndRefund = settings.movieticketReserve.minIntervalBetweenPayAndRefund;
|
|
20
|
+
const minIntervalBetweenPayAndRefund = (await settings.getByKey('movieticketReserve')).minIntervalBetweenPayAndRefund;
|
|
21
21
|
let waitingNecessary = false;
|
|
22
22
|
if (typeof minIntervalBetweenPayAndRefund === 'number' && minIntervalBetweenPayAndRefund > 0) {
|
|
23
23
|
if (payAction.actionStatus !== factory_1.factory.actionStatusType.CompletedActionStatus) {
|
|
@@ -74,7 +74,7 @@ function refundMovieTicket(params, options) {
|
|
|
74
74
|
state: '',
|
|
75
75
|
credentialsRepo: repos.credentials // set credentialsRepo(2024-11-20~)
|
|
76
76
|
});
|
|
77
|
-
const seatService = new sdk_1.Surfrock.service.seat.SeatService({ endpoint: String(availableChannel.serviceUrl), auth: mvtkReserveAuthClient }, { timeout: settings.movieticketReserve.
|
|
77
|
+
const seatService = new sdk_1.Surfrock.service.seat.SeatService({ endpoint: String(availableChannel.serviceUrl), auth: mvtkReserveAuthClient }, { timeout: (await settings.getByKey('movieticketReserve')).timeoutRefund });
|
|
78
78
|
let seatInfoSyncCancelIn;
|
|
79
79
|
let seatInfoSyncIn;
|
|
80
80
|
const useSeatInfoSyncCancel = availableChannel.credentials?.useSeatInfoSyncCancel === true;
|
|
@@ -5,7 +5,7 @@ import type { CredentialsRepo } from '../../../repo/credentials';
|
|
|
5
5
|
import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
6
6
|
import type { TaskRepo } from '../../../repo/task';
|
|
7
7
|
import { factory } from '../../../factory';
|
|
8
|
-
import { Settings } from '../../../
|
|
8
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
9
9
|
declare function voidTransaction(params: factory.task.voidPayment.IData): (repos: {
|
|
10
10
|
actions: {
|
|
11
11
|
pay: PayActionRepo;
|
|
@@ -61,7 +61,8 @@ function confirmReservation(params) {
|
|
|
61
61
|
...rawReservation.reservedTicket,
|
|
62
62
|
ticketType: ticketTypeByTransaction
|
|
63
63
|
},
|
|
64
|
-
reservationFor: reserveTransaction.object.reservationFor // reservationForは予約取引から参照する(2026-04-05~)
|
|
64
|
+
reservationFor: reserveTransaction.object.reservationFor, // reservationForは予約取引から参照する(2026-04-05~)
|
|
65
|
+
issuedThrough: reserveTransaction.object.issuedThrough // issuedThroughは予約取引から補完する(2026-05-08~)
|
|
65
66
|
};
|
|
66
67
|
});
|
|
67
68
|
confirmedReservations = confirmedReservations.map((r) => {
|
|
@@ -189,25 +190,24 @@ params, options) {
|
|
|
189
190
|
if (reserveTransaction.object.disablePendingReservations === true) {
|
|
190
191
|
const reservationFor = reserveTransaction.object.reservationFor;
|
|
191
192
|
const subReservations = reserveTransaction.object.subReservation;
|
|
192
|
-
const issuedThrough = reserveTransaction.object.issuedThrough;
|
|
193
|
+
// const issuedThrough = reserveTransaction.object.issuedThrough;
|
|
193
194
|
if (Array.isArray(subReservations)
|
|
194
195
|
&& typeof reservationFor?.typeOf === 'string'
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
196
|
+
// && typeof issuedThrough?.typeOf === 'string'
|
|
197
|
+
) {
|
|
198
|
+
await repos.reservation.confirmManyIfNotExist({
|
|
198
199
|
bookingTime: reserveTransaction.startDate, // startDateに設定(2024-04-08~)
|
|
199
200
|
project: { id: reserveTransaction.project.id },
|
|
200
201
|
provider: (typeof reserveTransaction.object.provider?.id === 'string')
|
|
201
202
|
? reserveTransaction.object.provider
|
|
202
203
|
: { id: reserveTransaction.agent.id, typeOf: factory_1.factory.organizationType.Corporation },
|
|
203
204
|
subReservation: subReservations,
|
|
204
|
-
issuedThrough,
|
|
205
|
+
// issuedThrough,
|
|
205
206
|
reservationFor,
|
|
206
207
|
reservationNumber: reserveTransaction.object.reservationNumber,
|
|
207
208
|
underName,
|
|
208
209
|
broker: reserveTransaction.object.broker
|
|
209
210
|
});
|
|
210
|
-
debug('confirmManyIfNotExistResult:', confirmManyIfNotExistResult, 'reservationNumber:', reservationPackage.reservationNumber);
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
else {
|
|
@@ -21,7 +21,8 @@ function createCancelPendingReservationAction(params) {
|
|
|
21
21
|
const reservationPackage = {
|
|
22
22
|
typeOf: factory_1.factory.reservationType.ReservationPackage,
|
|
23
23
|
reservationNumber: transaction.transactionNumber,
|
|
24
|
-
|
|
24
|
+
// discontinue reservationFor(2026-05-09~)
|
|
25
|
+
// reservationFor: { typeOf: reservationFor.typeOf, id: String(reservationFor.id) },
|
|
25
26
|
reservationStatus: (typeof params.transaction.object.reservationStatus === 'string')
|
|
26
27
|
? params.transaction.object.reservationStatus
|
|
27
28
|
: factory_1.factory.reservationStatusType.ReservationPending
|
|
@@ -5,7 +5,7 @@ import type { OrderRepo } from '../../repo/order';
|
|
|
5
5
|
import type { ReservationRepo } from '../../repo/reservation';
|
|
6
6
|
type IReservationResult = Pick<factory.reservation.eventReservation.IReservation, 'id' | 'additionalTicketText' | 'checkedIn' | 'reservationStatus'> & {
|
|
7
7
|
reservedTicket: {
|
|
8
|
-
ticketType: Pick<factory.
|
|
8
|
+
ticketType: Pick<factory.assetTransaction.reserve.ITicketType, 'identifier'> & {
|
|
9
9
|
name: {
|
|
10
10
|
ja?: string;
|
|
11
11
|
};
|