@chevre/domain 24.1.0-alpha.3 → 24.1.0-alpha.31
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/README.md +0 -2
- package/lib/chevre/repo/acceptedOffer.d.ts +14 -13
- package/lib/chevre/repo/acceptedOffer.js +135 -51
- package/lib/chevre/repo/acceptedOfferInReserve.d.ts +30 -0
- package/lib/chevre/repo/acceptedOfferInReserve.js +78 -0
- package/lib/chevre/repo/accountingReport.d.ts +9 -2
- package/lib/chevre/repo/accountingReport.js +6 -34
- package/lib/chevre/repo/action/actionProcess.d.ts +1 -1
- package/lib/chevre/repo/assetTransaction/reserve.d.ts +0 -1
- 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.js +155 -180
- 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 +43 -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 +171 -364
- package/lib/chevre/repo/orderInTransaction.d.ts +39 -3
- package/lib/chevre/repo/orderInTransaction.js +43 -1
- package/lib/chevre/repo/reservation.d.ts +20 -7
- package/lib/chevre/repo/reservation.js +14 -10
- 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 +19 -0
- package/lib/chevre/repo/setting/integration.js +72 -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 +22 -26
- 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 -2
- package/lib/chevre/service/notification/notifyAbortedTasksByEmail.js +1 -1
- package/lib/chevre/service/offer/any.d.ts +6 -1
- package/lib/chevre/service/offer/event/authorize/factory.d.ts +6 -3
- package/lib/chevre/service/offer/event/authorize/factory.js +4 -7
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +1 -1
- package/lib/chevre/service/offer/event/authorize.d.ts +7 -1
- package/lib/chevre/service/offer/event/authorize.js +11 -3
- 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 -3
- package/lib/chevre/service/order/createAccountingReportIfNotExist.js +67 -72
- package/lib/chevre/service/order/deleteOrder.js +21 -44
- 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/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 +2 -5
- 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 +3 -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 +2 -1
- package/lib/chevre/service/reserve/findReservations.d.ts +4 -4
- package/lib/chevre/service/reserve/findReservations.js +16 -26
- 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 +8 -3
- package/lib/chevre/service/reserve/useReservation.d.ts +1 -1
- package/lib/chevre/service/reserve/useReservation.js +20 -24
- package/lib/chevre/service/task/acceptCOAOffer.js +2 -2
- package/lib/chevre/service/task/authorizePayment.js +1 -1
- package/lib/chevre/service/task/cancelPendingReservation.js +1 -1
- package/lib/chevre/service/task/checkMovieTicket.js +1 -1
- package/lib/chevre/service/task/confirmReserveTransaction.d.ts +1 -1
- package/lib/chevre/service/task/confirmReserveTransaction.js +3 -2
- package/lib/chevre/service/task/createAccountingReport.js +7 -9
- package/lib/chevre/service/task/importEventCapacitiesFromCOA.js +1 -1
- package/lib/chevre/service/task/importEventsFromCOA.js +1 -1
- package/lib/chevre/service/task/importOffersFromCOA.js +1 -1
- package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +0 -1
- package/lib/chevre/service/task/pay.js +1 -1
- 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 +3 -2
- 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/refund.js +1 -1
- package/lib/chevre/service/task/returnReserveTransaction.js +1 -1
- package/lib/chevre/service/task/syncResourcesFromCOA.js +1 -1
- package/lib/chevre/service/task/useReservation.d.ts +2 -2
- package/lib/chevre/service/task/useReservation.js +6 -18
- package/lib/chevre/service/task/voidPayment.js +1 -1
- package/lib/chevre/service/task/voidReserveTransaction.js +1 -1
- package/lib/chevre/service/task.d.ts +1 -1
- 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 +2 -4
- package/lib/chevre/service/validation/validateOrder.js +5 -79
- package/lib/chevre/settings.d.ts +0 -55
- package/lib/chevre/settings.js +1 -29
- package/lib/chevre/taskSettings.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { factory } from '../../factory';
|
|
2
2
|
import type { ReserveTransactionRepo } from '../../repo/assetTransaction/reserve';
|
|
3
|
-
import type {
|
|
3
|
+
import type { IKeyOfProjection, ReservationRepo } from '../../repo/reservation';
|
|
4
4
|
/**
|
|
5
5
|
* 予約検索レスポンスとしての予約
|
|
6
6
|
* 予約ドキュメントに予約取引の情報を補完する
|
|
7
7
|
*/
|
|
8
|
-
type IReservationAsFindResult = Omit<factory.reservation.eventReservation.IReservation, '
|
|
9
|
-
price?: factory.reservation.eventReservation.IPrice;
|
|
8
|
+
type IReservationAsFindResult = Omit<factory.reservation.eventReservation.IReservation, 'underName' | 'reservedTicket' | 'reservationFor'> & {
|
|
10
9
|
underName?: factory.assetTransaction.reserve.IUnderName;
|
|
11
10
|
reservedTicket?: factory.assetTransaction.reserve.IObjectSubReservation['reservedTicket'];
|
|
12
11
|
reservationFor?: factory.assetTransaction.reserve.IReservationFor;
|
|
12
|
+
price?: never;
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
15
|
* 予約を検索する
|
|
16
16
|
*/
|
|
17
17
|
export declare function findReservations(params: factory.reservation.eventReservation.ISearchConditions, options: {
|
|
18
|
-
inclusion: Partial<Record<IKeyOfProjection |
|
|
18
|
+
inclusion: Partial<Record<IKeyOfProjection | 'underName', 1>>;
|
|
19
19
|
}): (repos: {
|
|
20
20
|
assetTransaction: {
|
|
21
21
|
reserve: ReserveTransactionRepo;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.findReservations = findReservations;
|
|
7
|
-
const debug_1 = __importDefault(require("debug"));
|
|
8
|
-
const debug = (0, debug_1.default)('chevre-domain:service:reserve:findReservations');
|
|
9
4
|
/**
|
|
10
5
|
* 予約を検索する
|
|
11
6
|
*/
|
|
@@ -17,41 +12,28 @@ function findReservations(params, options) {
|
|
|
17
12
|
return [];
|
|
18
13
|
}
|
|
19
14
|
else {
|
|
20
|
-
const requirePrice = Object.keys(inclusion).includes('price');
|
|
21
15
|
const requireUnderName = Object.keys(inclusion).includes('underName');
|
|
22
16
|
const requireReservedTicket = Object.keys(inclusion).includes('reservedTicket');
|
|
23
17
|
const requireReservationFor = Object.keys(inclusion).includes('reservationFor');
|
|
18
|
+
// const requirePrice = Object.keys(inclusion).includes('price');
|
|
19
|
+
// const requirePriceCurrency = Object.keys(inclusion).includes('priceCurrency');
|
|
20
|
+
// const requireIssuedThrough = Object.keys(inclusion).includes('issuedThrough');
|
|
21
|
+
// const requireNumSeats = Object.keys(inclusion).includes('numSeats');
|
|
24
22
|
const reservationIds = rawReservations.map(({ id }) => id);
|
|
25
23
|
const subReservations = await repos.assetTransaction.reserve.findSubReservationsById({
|
|
26
24
|
ids: reservationIds
|
|
27
25
|
});
|
|
28
|
-
// 予約取引から参照した予約数と同じはず
|
|
29
|
-
debug('useReserveTransaction: true. reservations.length === subReservations.length?', rawReservations.length === subReservations.length);
|
|
30
26
|
return rawReservations.map((reservation) => {
|
|
31
27
|
const subReservationByTransaction = subReservations.find((s) => s.id === reservation.id);
|
|
32
|
-
const priceByTransaction = subReservationByTransaction?.price;
|
|
33
28
|
const underNameByTransaction = subReservationByTransaction?.underName;
|
|
34
29
|
const ticketTypeByTransaction = subReservationByTransaction?.reservedTicket?.ticketType;
|
|
35
30
|
const reservationForByTransaction = subReservationByTransaction?.reservationFor;
|
|
36
|
-
//
|
|
37
|
-
//
|
|
38
|
-
//
|
|
39
|
-
|
|
40
|
-
// if (requireUnderName) {
|
|
41
|
-
// }
|
|
42
|
-
// if (requireReservedTicket) {
|
|
43
|
-
// }
|
|
44
|
-
// if (requireReservationFor) {
|
|
45
|
-
// const reservationForMatched = isDeepStrictEqual(reservation.reservationFor, reservationForByTransaction);
|
|
46
|
-
// debug('requireReservationFor. reservationForMatched?', reservationForMatched);
|
|
47
|
-
// if (!reservationForMatched) {
|
|
48
|
-
// console.error('reservationForMatched: false!!!', reservation.id);
|
|
49
|
-
// }
|
|
50
|
-
// }
|
|
51
|
-
const { reservationFor, reservedTicket, ...rawReservation4result } = reservation; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
31
|
+
// const priceByTransaction = subReservationByTransaction?.price;
|
|
32
|
+
// const issuedThroughByTransaction = subReservationByTransaction?.issuedThrough;
|
|
33
|
+
// const numSeatsByTransaction = subReservationByTransaction?.numSeats;
|
|
34
|
+
const { reservationFor: _reservationFor, issuedThrough: _issuedThrough, priceCurrency: _priceCurrency, numSeats: _numSeats, reservedTicket, ...rawReservation4result } = reservation;
|
|
52
35
|
return {
|
|
53
36
|
...rawReservation4result, // 予約ドキュメントはそのまま返す
|
|
54
|
-
...(requirePrice && priceByTransaction !== undefined) ? { price: priceByTransaction } : undefined, // priceがあれば上書き
|
|
55
37
|
...(requireUnderName && underNameByTransaction !== undefined) ? { underName: underNameByTransaction } : undefined, // underNameがあれば上書き
|
|
56
38
|
...(requireReservedTicket && ticketTypeByTransaction !== undefined) // ticketTypeがあれば上書き
|
|
57
39
|
? {
|
|
@@ -64,6 +46,14 @@ function findReservations(params, options) {
|
|
|
64
46
|
...(requireReservationFor && reservationForByTransaction !== undefined)
|
|
65
47
|
? { reservationFor: reservationForByTransaction }
|
|
66
48
|
: undefined, // reservationForがあれば上書き(2026-04-06~)
|
|
49
|
+
// ...(requirePrice && priceByTransaction !== undefined) ? { price: priceByTransaction } : undefined, // priceがあれば上書き
|
|
50
|
+
// ...(requirePriceCurrency) ? { priceCurrency: factory.priceCurrency.JPY } : undefined, // 必要あらば固定値を補完(2026-05-08~)
|
|
51
|
+
// ...(requireIssuedThrough && issuedThroughByTransaction !== undefined)
|
|
52
|
+
// ? { issuedThrough: issuedThroughByTransaction }
|
|
53
|
+
// : undefined, // issuedThroughがあれば上書き(2026-05-09~)
|
|
54
|
+
// ...(requireNumSeats && numSeatsByTransaction !== undefined)
|
|
55
|
+
// ? { numSeats: numSeatsByTransaction }
|
|
56
|
+
// : undefined, // issuedThroughがあれば上書き(2026-05-09~)
|
|
67
57
|
};
|
|
68
58
|
});
|
|
69
59
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.onPendingReservationCanceled = onPendingReservationCanceled;
|
|
4
4
|
const factory_1 = require("../../../factory");
|
|
5
|
-
// import { Settings } from '../../../settings';
|
|
6
5
|
const factory_2 = require("../factory");
|
|
7
6
|
function onPendingReservationCanceled(params) {
|
|
8
7
|
return async (repos
|
|
@@ -5,13 +5,14 @@ import { factory } from '../../../factory';
|
|
|
5
5
|
import { AuthorizationRepo } from '../../../repo/authorization';
|
|
6
6
|
import type { SettingRepo } from '../../../repo/setting';
|
|
7
7
|
import type { TaskRepo } from '../../../repo/task';
|
|
8
|
-
export type IConfirmedReservation = Omit<factory.reservation.eventReservation.IReservation, 'price' | 'underName' | 'reservedTicket' | 'reservationFor'> & {
|
|
9
|
-
price?: factory.
|
|
8
|
+
export type IConfirmedReservation = Omit<factory.reservation.eventReservation.IReservation, 'price' | 'underName' | 'reservedTicket' | 'reservationFor' | 'issuedThrough'> & {
|
|
9
|
+
price?: factory.assetTransaction.reserve.IPrice;
|
|
10
10
|
underName?: Pick<factory.reservation.IUnderName, 'id' | 'typeOf'>;
|
|
11
11
|
reservedTicket: Omit<factory.assetTransaction.reserve.ISubReservationReservedTicket, 'ticketType'> & {
|
|
12
|
-
ticketType: factory.
|
|
12
|
+
ticketType: factory.assetTransaction.reserve.ITicketType;
|
|
13
13
|
};
|
|
14
14
|
reservationFor: factory.assetTransaction.reserve.IReservationFor;
|
|
15
|
+
issuedThrough: factory.assetTransaction.reserve.IIssuedThrough;
|
|
15
16
|
};
|
|
16
17
|
/**
|
|
17
18
|
* 予約確定後のアクション
|
|
@@ -6,7 +6,6 @@ exports.onReservationConfirmed = onReservationConfirmed;
|
|
|
6
6
|
* 予約確定時アクション
|
|
7
7
|
*/
|
|
8
8
|
const factory_1 = require("../../../factory");
|
|
9
|
-
// import { Settings } from '../../../settings';
|
|
10
9
|
const factory_2 = require("../factory");
|
|
11
10
|
/**
|
|
12
11
|
* 予約確定後のアクション
|
|
@@ -98,22 +97,14 @@ function onReservationConfirmed(confirmedReservations, reserveAction) {
|
|
|
98
97
|
}
|
|
99
98
|
}
|
|
100
99
|
const subReservations4inform = confirmedReservations.map((r) => {
|
|
101
|
-
const { additionalProperty, additionalTicketText,
|
|
102
|
-
// attended, checkedIn,
|
|
103
|
-
id, modifiedTime,
|
|
104
|
-
// numSeats,
|
|
105
|
-
price, programMembershipUsed, reservedTicket, subReservation, typeOf } = r;
|
|
100
|
+
const { additionalProperty, additionalTicketText, id, modifiedTime, price, programMembershipUsed, reservedTicket, subReservation, typeOf } = r;
|
|
106
101
|
return {
|
|
107
|
-
// bookingTime, // discontinue(2024-10-27~)
|
|
108
102
|
id,
|
|
109
103
|
typeOf,
|
|
110
104
|
reservedTicket,
|
|
111
105
|
...(Array.isArray(additionalProperty)) ? { additionalProperty } : undefined,
|
|
112
106
|
...(typeof additionalTicketText === 'string') ? { additionalTicketText } : undefined,
|
|
113
|
-
// ...(typeof attended === 'boolean') ? { attended } : undefined, // discontinue(2024-10-27~)
|
|
114
|
-
// ...(typeof checkedIn === 'boolean') ? { checkedIn } : undefined, // discontinue(2024-10-27~)
|
|
115
107
|
...(modifiedTime instanceof Date) ? { modifiedTime } : undefined,
|
|
116
|
-
// ...(typeof numSeats === 'number') ? { numSeats } : undefined, // discontinue(2024-10-27~)
|
|
117
108
|
...(price !== undefined) ? { price } : undefined,
|
|
118
109
|
...(programMembershipUsed !== undefined) ? { programMembershipUsed } : undefined,
|
|
119
110
|
...(Array.isArray(subReservation)) ? { subReservation } : undefined
|
|
@@ -9,7 +9,6 @@ exports.onReservationUsed = onReservationUsed;
|
|
|
9
9
|
*/
|
|
10
10
|
const moment_1 = __importDefault(require("moment"));
|
|
11
11
|
const factory_1 = require("../../../factory");
|
|
12
|
-
// import { Settings } from '../../../settings';
|
|
13
12
|
const factory_2 = require("../factory");
|
|
14
13
|
/**
|
|
15
14
|
* 予約使用
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.onReservationsCreated = onReservationsCreated;
|
|
4
4
|
const factory_1 = require("../../../factory");
|
|
5
|
-
// import { Settings } from '../../../settings';
|
|
6
5
|
const factory_2 = require("../factory");
|
|
7
6
|
/**
|
|
8
7
|
* 予約作成時イベント
|
|
@@ -11,14 +11,19 @@ function searchByOrder(params) {
|
|
|
11
11
|
page: params.page,
|
|
12
12
|
project: { id: { $eq: params.project.id } },
|
|
13
13
|
orderNumber: { $eq: params.orderNumber },
|
|
14
|
-
acceptedOffers: {
|
|
15
|
-
|
|
14
|
+
acceptedOffers: {
|
|
15
|
+
itemOffered: {
|
|
16
|
+
// typeOf: { $in: [reservationType] }
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}, { useReserveTransaction: true } // 予約取引参照(2026-05-18~)
|
|
20
|
+
);
|
|
16
21
|
const reservationIds = acceptedOffers.map((offer) => {
|
|
17
22
|
if (offer.itemOffered.typeOf === reservationType) {
|
|
18
23
|
return offer.itemOffered.id;
|
|
19
24
|
}
|
|
20
25
|
else {
|
|
21
|
-
//
|
|
26
|
+
// EventReservationしか存在しないので、ありえないケース
|
|
22
27
|
throw new factory_1.factory.errors.Internal(`unexpected itemOffered.typeOf ${offer.itemOffered.typeOf}`);
|
|
23
28
|
}
|
|
24
29
|
});
|
|
@@ -20,7 +20,7 @@ export declare function useReservation(params: {
|
|
|
20
20
|
*/
|
|
21
21
|
id: string;
|
|
22
22
|
};
|
|
23
|
-
instrument
|
|
23
|
+
instrument: factory.action.consume.use.reservation.IInstrument[];
|
|
24
24
|
location?: {
|
|
25
25
|
identifier?: string;
|
|
26
26
|
};
|
|
@@ -16,7 +16,6 @@ function useReservation(params) {
|
|
|
16
16
|
return async (repos) => {
|
|
17
17
|
const reservationId = params.object.id;
|
|
18
18
|
let ticketToken;
|
|
19
|
-
// const ticketToken = params?.instrument?.ticketToken;
|
|
20
19
|
if (Array.isArray(params.instrument)) {
|
|
21
20
|
for (const eachInstrument of params.instrument) {
|
|
22
21
|
if (eachInstrument.typeOf === 'Ticket' && typeof eachInstrument.ticketToken === 'string') {
|
|
@@ -24,9 +23,8 @@ function useReservation(params) {
|
|
|
24
23
|
break;
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
ticketToken = params?.instrument?.ticketToken;
|
|
26
|
+
// } else {
|
|
27
|
+
// ticketToken = params?.instrument?.ticketToken;
|
|
30
28
|
}
|
|
31
29
|
// if (params.verifyToken === true) {} // タスク作成前に検証済なので検証不要
|
|
32
30
|
// confirmReservationが間に合わない可能性を考慮する(2023-06-01~)
|
|
@@ -34,36 +32,34 @@ function useReservation(params) {
|
|
|
34
32
|
// 予約検索
|
|
35
33
|
const reservation = await repos.reservation.findReservationById({
|
|
36
34
|
id: reservationId,
|
|
37
|
-
inclusion: [
|
|
35
|
+
inclusion: [
|
|
36
|
+
// 'issuedThrough',
|
|
37
|
+
// 'reservedTicket',
|
|
38
|
+
'project', 'reservationFor', 'reservationNumber', 'typeOf'
|
|
39
|
+
]
|
|
38
40
|
});
|
|
39
|
-
if (typeof reservation.issuedThrough.id !== 'string') {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
const { reservedTicket } = reservation;
|
|
44
|
-
// optimize(
|
|
41
|
+
// if (typeof reservation.issuedThrough.id !== 'string') {
|
|
42
|
+
// // COA予約では予約使用アクションを想定していないので、興行idは必ず存在するはず
|
|
43
|
+
// throw new factory.errors.Internal('reservation.issuedThrough.id must be string');
|
|
44
|
+
// }
|
|
45
|
+
// const { reservedTicket } = reservation;
|
|
46
|
+
// optimize(2026-05-06~)
|
|
45
47
|
const reservationAsObject = {
|
|
46
48
|
id: reservation.id,
|
|
47
49
|
reservationNumber: reservation.reservationNumber,
|
|
48
50
|
typeOf: reservation.typeOf,
|
|
49
|
-
issuedThrough: { id: reservation.issuedThrough.id, typeOf: reservation.issuedThrough.typeOf },
|
|
50
51
|
reservationFor: { id: reservation.reservationFor.id, typeOf: reservation.reservationFor.typeOf },
|
|
51
|
-
reservedTicket
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
// },
|
|
59
|
-
...(typeof reservedTicket.identifier === 'string') ? { identifier: reservedTicket.identifier } : undefined,
|
|
60
|
-
...(typeof reservedTicket.ticketedSeat?.typeOf === 'string') ? { ticketedSeat: reservedTicket.ticketedSeat } : undefined
|
|
61
|
-
}
|
|
52
|
+
// discontinue issuedThrough,reservedTicket(2026-05-06~)
|
|
53
|
+
// issuedThrough: { id: reservation.issuedThrough.id, typeOf: reservation.issuedThrough.typeOf },
|
|
54
|
+
// reservedTicket: {
|
|
55
|
+
// typeOf: reservedTicket.typeOf,
|
|
56
|
+
// ...(typeof reservedTicket.identifier === 'string') ? { identifier: reservedTicket.identifier } : undefined,
|
|
57
|
+
// ...(typeof reservedTicket.ticketedSeat?.typeOf === 'string') ? { ticketedSeat: reservedTicket.ticketedSeat } : undefined
|
|
58
|
+
// }
|
|
62
59
|
};
|
|
63
60
|
// extend instrument to array(2025-02-18~)
|
|
64
61
|
const instrument = [
|
|
65
62
|
{
|
|
66
|
-
// ...(typeof token === 'string') ? { token } : undefined, // discontinue token(2024-10-03~)
|
|
67
63
|
...(typeof ticketToken === 'string') ? { ticketToken } : undefined,
|
|
68
64
|
typeOf: 'Ticket'
|
|
69
65
|
},
|
|
@@ -61,11 +61,11 @@ function call(params) {
|
|
|
61
61
|
const reserveService = new coa_service_1.COA.service.Reserve({
|
|
62
62
|
endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
|
|
63
63
|
auth: coaAuthClient
|
|
64
|
-
}, { timeout: settings.coa.
|
|
64
|
+
}, { timeout: (await settings.getByKey('coa')).timeoutReserve });
|
|
65
65
|
const masterService = new coa_service_1.COA.service.Master({
|
|
66
66
|
endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
|
|
67
67
|
auth: coaAuthClient
|
|
68
|
-
}, { timeout: settings.coa.
|
|
68
|
+
}, { timeout: (await settings.getByKey('coa')).timeoutMaster });
|
|
69
69
|
const { agent, object, potentialActions, purpose } = params.data;
|
|
70
70
|
// agent.idからflgMemberを自動セット(2024-12-16~)
|
|
71
71
|
const isMember = memberClients.includes(agent.id);
|
|
@@ -48,7 +48,7 @@ function call(params) {
|
|
|
48
48
|
const authorizePaymentMethodActionRepo = new authorizePaymentMethod_1.AuthorizePaymentMethodActionRepo(connection);
|
|
49
49
|
// const transactionProcessRepo = new TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
|
|
50
50
|
const paymentServiceId = params.data.object.issuedThrough.id;
|
|
51
|
-
const credentialsExpireInSeconds = settings.movieticketReserve.credentialsExpireInSeconds;
|
|
51
|
+
const credentialsExpireInSeconds = (await settings.getByKey('movieticketReserve')).credentialsExpireInSeconds;
|
|
52
52
|
const useCredentialsRepo = typeof paymentServiceId === 'string' && paymentServiceId !== ''
|
|
53
53
|
&& typeof credentialsExpireInSeconds === 'number' && credentialsExpireInSeconds > 0;
|
|
54
54
|
try {
|
|
@@ -54,7 +54,7 @@ function call(params) {
|
|
|
54
54
|
const reserveService = new coa_service_1.COA.service.Reserve({
|
|
55
55
|
endpoint: coaAuthClient.options.endpoint,
|
|
56
56
|
auth: coaAuthClient
|
|
57
|
-
}, { timeout: settings.coa.
|
|
57
|
+
}, { timeout: (await settings.getByKey('coa')).timeoutReserve });
|
|
58
58
|
const { object, instrument } = data;
|
|
59
59
|
await (0, cancelReservation_2.cancelPendingReservation)({
|
|
60
60
|
object,
|
|
@@ -25,7 +25,7 @@ function call(params) {
|
|
|
25
25
|
const actionRepo = new checkMovieTicket_1.CheckMovieTicketActionRepo(connection);
|
|
26
26
|
// const transactionProcessRepo = new TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
|
|
27
27
|
const paymentServiceId = params.data.object[0]?.id;
|
|
28
|
-
const credentialsExpireInSeconds = settings.movieticketReserve.credentialsExpireInSeconds;
|
|
28
|
+
const credentialsExpireInSeconds = (await settings.getByKey('movieticketReserve')).credentialsExpireInSeconds;
|
|
29
29
|
const useCredentialsRepo = typeof paymentServiceId === 'string' && paymentServiceId !== ''
|
|
30
30
|
&& typeof credentialsExpireInSeconds === 'number' && credentialsExpireInSeconds > 0;
|
|
31
31
|
try {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { COA } from '@motionpicture/coa-service';
|
|
2
2
|
import { factory } from '../../factory';
|
|
3
|
-
import { Settings } from '../../
|
|
3
|
+
import type { IntegrationSettingRepo as Settings } from '../../repo/setting/integration';
|
|
4
4
|
import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../taskHandler';
|
|
5
5
|
import { AcceptedOfferRepo } from '../../repo/acceptedOffer';
|
|
6
6
|
import { ActionRepo } from '../../repo/action';
|
|
@@ -41,7 +41,7 @@ function call(params) {
|
|
|
41
41
|
const reserveService = new coa_service_1.COA.service.Reserve({
|
|
42
42
|
endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
|
|
43
43
|
auth: coaAuthClient
|
|
44
|
-
}, { timeout: settings.coa.
|
|
44
|
+
}, { timeout: (await settings.getByKey('coa')).timeoutReserve });
|
|
45
45
|
await confirmReserveTransaction({
|
|
46
46
|
...params.data,
|
|
47
47
|
project: params.project,
|
|
@@ -137,7 +137,8 @@ function fixOrderAsPurpose(params) {
|
|
|
137
137
|
const acceptedOffers = await repos.acceptedOffer.searchAcceptedOffersByOrderNumber({
|
|
138
138
|
orderNumber: { $eq: order.orderNumber },
|
|
139
139
|
project: { id: { $eq: params.project.id } }
|
|
140
|
-
},
|
|
140
|
+
}, { useReserveTransaction: true } // 予約取引参照(2026-05-18~)
|
|
141
|
+
);
|
|
141
142
|
return {
|
|
142
143
|
...order,
|
|
143
144
|
acceptedOffers
|
|
@@ -27,9 +27,12 @@ function createAccountingReport(params) {
|
|
|
27
27
|
orderNumber: data.object.mainEntity.orderNumber,
|
|
28
28
|
project: { id: params.project.id },
|
|
29
29
|
inclusion: [
|
|
30
|
-
'orderNumber', 'project', '
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
'orderNumber', 'project', 'paymentMethods', 'seller', 'typeOf', 'orderDate'
|
|
31
|
+
// 'customer', 'confirmationNumber',
|
|
32
|
+
// 'orderedItem',
|
|
33
|
+
// 'broker',
|
|
34
|
+
// 'price', 'priceCurrency',
|
|
35
|
+
]
|
|
33
36
|
});
|
|
34
37
|
const simpleOrder = {
|
|
35
38
|
typeOf: order.typeOf,
|
|
@@ -37,7 +40,6 @@ function createAccountingReport(params) {
|
|
|
37
40
|
orderDate: order.orderDate
|
|
38
41
|
};
|
|
39
42
|
const actionObject = {
|
|
40
|
-
// ...params,
|
|
41
43
|
mainEntity: { orderNumber: simpleOrder.orderNumber },
|
|
42
44
|
typeOf: 'Report'
|
|
43
45
|
};
|
|
@@ -51,13 +53,9 @@ function createAccountingReport(params) {
|
|
|
51
53
|
};
|
|
52
54
|
const action = await repos.action.start(actionAttributes);
|
|
53
55
|
try {
|
|
54
|
-
const acceptedOffers = await repos.acceptedOffer.searchAcceptedOffersByOrderNumber({
|
|
55
|
-
orderNumber: { $eq: data.object.mainEntity.orderNumber },
|
|
56
|
-
project: { id: { $eq: params.project.id } }
|
|
57
|
-
});
|
|
58
56
|
await (0, createAccountingReportIfNotExist_1.createAccountingReportIfNotExist)({
|
|
59
57
|
...order,
|
|
60
|
-
acceptedOffers
|
|
58
|
+
// acceptedOffers
|
|
61
59
|
})(repos);
|
|
62
60
|
}
|
|
63
61
|
catch (error) {
|
|
@@ -57,7 +57,7 @@ function call(params) {
|
|
|
57
57
|
const reserveService = new coa_service_1.COA.service.Reserve({
|
|
58
58
|
endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
|
|
59
59
|
auth: coaAuthClient
|
|
60
|
-
}, { timeout: settings.coa.
|
|
60
|
+
}, { timeout: (await settings.getByKey('coa')).timeoutReserve });
|
|
61
61
|
await EventAggregationService.importFromCOA(params.data)({
|
|
62
62
|
event: new event_1.EventRepo(connection),
|
|
63
63
|
reserveService
|
|
@@ -64,7 +64,7 @@ function call(params) {
|
|
|
64
64
|
const masterService = new coa_service_1.COA.service.Master({
|
|
65
65
|
endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
|
|
66
66
|
auth: coaAuthClient
|
|
67
|
-
}, { timeout: settings.coa.
|
|
67
|
+
}, { timeout: (await settings.getByKey('coa')).timeoutMaster });
|
|
68
68
|
await EventService.importFromCOA(params.data)({
|
|
69
69
|
action: new action_1.ActionRepo(connection),
|
|
70
70
|
categoryCode: new categoryCode_1.CategoryCodeRepo(connection),
|
|
@@ -67,7 +67,7 @@ function call(params) {
|
|
|
67
67
|
const masterService = new coa_service_1.COA.service.Master({
|
|
68
68
|
endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
|
|
69
69
|
auth: coaAuthClient
|
|
70
|
-
}, { timeout: settings.coa.
|
|
70
|
+
}, { timeout: (await settings.getByKey('coa')).timeoutMaster });
|
|
71
71
|
await OfferService.event.importFromCOA({
|
|
72
72
|
project: { id: params.data.project.id },
|
|
73
73
|
theaterCode: params.data.theaterCode,
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createInformHasPOSTasks = createInformHasPOSTasks;
|
|
4
4
|
const factory_1 = require("../../../factory");
|
|
5
|
-
// import { Settings } from '../../../settings';
|
|
6
5
|
function createInformHasPOSTasks(params) {
|
|
7
6
|
return async (repos
|
|
8
7
|
// settings: Settings
|
|
@@ -38,7 +38,7 @@ function call(params) {
|
|
|
38
38
|
order: new order_1.OrderRepo(connection)
|
|
39
39
|
});
|
|
40
40
|
const paymentServiceId = payActionAttributes.object.at(0)?.id;
|
|
41
|
-
const credentialsExpireInSeconds = settings.movieticketReserve.credentialsExpireInSeconds;
|
|
41
|
+
const credentialsExpireInSeconds = (await settings.getByKey('movieticketReserve')).credentialsExpireInSeconds;
|
|
42
42
|
const useCredentialsRepo = typeof paymentServiceId === 'string' && paymentServiceId !== ''
|
|
43
43
|
&& typeof credentialsExpireInSeconds === 'number' && credentialsExpireInSeconds > 0;
|
|
44
44
|
await (0, payByTask_1.payByTask)(
|
|
@@ -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';
|
|
@@ -14,7 +14,7 @@ import type { ProjectRepo } from '../../../repo/project';
|
|
|
14
14
|
import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccepted';
|
|
15
15
|
import type { TaskRepo } from '../../../repo/task';
|
|
16
16
|
import { factory } from '../../../factory';
|
|
17
|
-
import { Settings } from '../../../
|
|
17
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
18
18
|
interface IPayTask2payActionAttributesRepos {
|
|
19
19
|
checkMovieTicketAction: CheckMovieTicketActionRepo;
|
|
20
20
|
acceptedOffer: AcceptedOfferRepo;
|
|
@@ -71,13 +71,14 @@ function fixOrderAsPurpose(params, transaction) {
|
|
|
71
71
|
project: { id: { $eq: transaction.project.id } },
|
|
72
72
|
acceptedOffers: {
|
|
73
73
|
itemOffered: {
|
|
74
|
-
typeOf: { $in: [
|
|
74
|
+
// typeOf: { $in: [factory.reservationType.EventReservation] }, // EventReservationしか存在しないので不要(2026-05-12~)
|
|
75
75
|
// movieTicketsに結合されたイベントID,座席コードで絞る
|
|
76
76
|
reservationFor: { id: { $in: [reservationForId] } },
|
|
77
77
|
reservedTicket: { ticketedSeat: { seatNumber: { $in: seatNumbers } } }
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
},
|
|
80
|
+
}, { useReserveTransaction: true } // 予約取引参照(2026-05-18~)
|
|
81
|
+
);
|
|
81
82
|
}
|
|
82
83
|
return {
|
|
83
84
|
...orderWithoutAcceptedOffers,
|
|
@@ -11,7 +11,7 @@ import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccep
|
|
|
11
11
|
import type { TaskRepo } from '../../../repo/task';
|
|
12
12
|
import type { TransactionNumberRepo } from '../../../repo/transactionNumber';
|
|
13
13
|
import { factory } from '../../../factory';
|
|
14
|
-
import { Settings } from '../../../
|
|
14
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
15
15
|
declare function refundByTask(params: factory.task.refund.IData & {
|
|
16
16
|
sameAs?: {
|
|
17
17
|
id: string;
|
|
@@ -11,7 +11,7 @@ import type { ProjectRepo } from '../../../repo/project';
|
|
|
11
11
|
import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccepted';
|
|
12
12
|
import type { TaskRepo } from '../../../repo/task';
|
|
13
13
|
import { factory } from '../../../factory';
|
|
14
|
-
import { Settings } from '../../../
|
|
14
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
15
15
|
declare function voidPaymentByTask(params: factory.task.voidPayment.IData): (repos: {
|
|
16
16
|
action: ActionRepo;
|
|
17
17
|
actions: {
|
|
@@ -35,7 +35,7 @@ function call(params) {
|
|
|
35
35
|
data = params;
|
|
36
36
|
}
|
|
37
37
|
const paymentServiceId = data.object.at(0)?.id;
|
|
38
|
-
const credentialsExpireInSeconds = settings.movieticketReserve.credentialsExpireInSeconds;
|
|
38
|
+
const credentialsExpireInSeconds = (await settings.getByKey('movieticketReserve')).credentialsExpireInSeconds;
|
|
39
39
|
const useCredentialsRepo = typeof paymentServiceId === 'string' && paymentServiceId !== ''
|
|
40
40
|
&& typeof credentialsExpireInSeconds === 'number' && credentialsExpireInSeconds > 0;
|
|
41
41
|
await (0, refundByTask_1.refundByTask)(data)({
|
|
@@ -75,7 +75,7 @@ function call(params) {
|
|
|
75
75
|
const reserveService = new coa_service_1.COA.service.Reserve({
|
|
76
76
|
endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
|
|
77
77
|
auth: coaAuthClient
|
|
78
|
-
}, { timeout: settings.coa.
|
|
78
|
+
}, { timeout: (await settings.getByKey('coa')).timeoutReserve });
|
|
79
79
|
await returnReserve({
|
|
80
80
|
...params.data,
|
|
81
81
|
sameAs: { id: params.id }
|
|
@@ -60,7 +60,7 @@ function call(params) {
|
|
|
60
60
|
const masterService = new coa_service_1.COA.service.Master({
|
|
61
61
|
endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
|
|
62
62
|
auth: coaAuthClient
|
|
63
|
-
}, { timeout: settings.coa.
|
|
63
|
+
}, { timeout: (await settings.getByKey('coa')).timeoutMaster });
|
|
64
64
|
const { agent, object } = params.data;
|
|
65
65
|
if (object.typeOf === factory_1.factory.eventType.ScreeningEventSeries) {
|
|
66
66
|
await syncEventSeries({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { IExecutableTaskKeys, IOperationExecute } from '../taskHandler';
|
|
1
2
|
import { factory } from '../../factory';
|
|
2
|
-
import type { IOperationExecute } from '../taskHandler';
|
|
3
3
|
/**
|
|
4
4
|
* タスク実行関数
|
|
5
5
|
*/
|
|
6
|
-
export declare function call(
|
|
6
|
+
export declare function call(params: Pick<factory.task.useReservation.ITask, IExecutableTaskKeys>): IOperationExecute<void>;
|
|
@@ -12,25 +12,15 @@ const useReservation_1 = require("../reserve/useReservation");
|
|
|
12
12
|
/**
|
|
13
13
|
* タスク実行関数
|
|
14
14
|
*/
|
|
15
|
-
function call(
|
|
15
|
+
function call(params) {
|
|
16
16
|
return async ({ connection }) => {
|
|
17
|
-
|
|
18
|
-
// support array(2025-02-17~)
|
|
19
|
-
if (Array.isArray(data.instrument)) {
|
|
20
|
-
instrument = data.instrument;
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
if (data.instrument?.typeOf === 'Ticket') {
|
|
24
|
-
instrument = [data.instrument];
|
|
25
|
-
}
|
|
26
|
-
}
|
|
17
|
+
const { data, project } = params;
|
|
27
18
|
await (0, useReservation_1.useReservation)({
|
|
28
|
-
project
|
|
19
|
+
project,
|
|
29
20
|
agent: data.agent,
|
|
30
21
|
object: data.object,
|
|
31
|
-
instrument,
|
|
32
|
-
|
|
33
|
-
...(typeof data.location?.typeOf === 'string') ? { location: data.location } : undefined
|
|
22
|
+
instrument: data.instrument,
|
|
23
|
+
...(typeof data.location?.identifier === 'string') ? { location: data.location } : undefined
|
|
34
24
|
})({
|
|
35
25
|
action: new action_1.ActionRepo(connection),
|
|
36
26
|
assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
|
|
@@ -39,8 +29,6 @@ function call(data) {
|
|
|
39
29
|
reservation: new reservation_1.ReservationRepo(connection),
|
|
40
30
|
setting: new setting_1.SettingRepo(connection),
|
|
41
31
|
task: new task_1.TaskRepo(connection)
|
|
42
|
-
}
|
|
43
|
-
// settings
|
|
44
|
-
);
|
|
32
|
+
});
|
|
45
33
|
};
|
|
46
34
|
}
|
|
@@ -24,7 +24,7 @@ function call(data) {
|
|
|
24
24
|
throw new factory_1.factory.errors.Argument('settings', 'redisClient required');
|
|
25
25
|
}
|
|
26
26
|
const paymentServiceId = data.object.object.id;
|
|
27
|
-
const credentialsExpireInSeconds = settings.movieticketReserve.credentialsExpireInSeconds;
|
|
27
|
+
const credentialsExpireInSeconds = (await settings.getByKey('movieticketReserve')).credentialsExpireInSeconds;
|
|
28
28
|
const useCredentialsRepo = typeof paymentServiceId === 'string' && paymentServiceId !== ''
|
|
29
29
|
&& typeof credentialsExpireInSeconds === 'number' && credentialsExpireInSeconds > 0;
|
|
30
30
|
await (0, voidPaymentByTask_1.voidPaymentByTask)(data)({
|