@chevre/domain 24.0.0-alpha.41 → 24.0.0-alpha.43
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/repo/action/pay.d.ts +16 -0
- package/lib/chevre/repo/action/pay.js +41 -0
- package/lib/chevre/repo/action.d.ts +2 -11
- package/lib/chevre/repo/action.js +20 -13
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorize.d.ts +1 -2
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeMovieTicket.d.ts +1 -2
- package/lib/chevre/service/assetTransaction/pay/start.d.ts +1 -2
- package/lib/chevre/service/assetTransaction/refund.d.ts +5 -2
- package/lib/chevre/service/assetTransaction/refund.js +1 -1
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createStartParams.js +10 -4
- package/lib/chevre/service/assetTransaction/reserve/start.js +4 -2
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +14 -11
- package/lib/chevre/service/offer.js +10 -6
- package/lib/chevre/service/payment/any/authorize.d.ts +1 -2
- package/lib/chevre/service/payment/any/onPayActionCompleted.d.ts +1 -0
- package/lib/chevre/service/payment/any/onRefundActionCompletedOrFailed.d.ts +1 -0
- package/lib/chevre/service/payment/creditCard/payCreditCard.d.ts +1 -2
- package/lib/chevre/service/payment/creditCard/payCreditCard.js +8 -4
- package/lib/chevre/service/payment/creditCard/refundCreditCard.d.ts +1 -2
- package/lib/chevre/service/payment/creditCard/refundCreditCard.js +10 -6
- package/lib/chevre/service/payment/faceToFace.d.ts +2 -3
- package/lib/chevre/service/payment/faceToFace.js +16 -8
- package/lib/chevre/service/payment/movieTicket/authorize.d.ts +1 -2
- package/lib/chevre/service/payment/movieTicket/payMovieTicket.d.ts +1 -2
- package/lib/chevre/service/payment/movieTicket/payMovieTicket.js +10 -6
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket/createSeatInfoSyncCancelInOnRefund.d.ts +14 -0
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket/createSeatInfoSyncCancelInOnRefund.js +49 -0
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket/createSeatInfoSyncInOnRefund.d.ts +14 -0
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket/createSeatInfoSyncInOnRefund.js +46 -0
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket/processSeatInfoSync.d.ts +12 -0
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket/processSeatInfoSync.js +72 -0
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket/processSeatInfoSyncCancel.d.ts +8 -0
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket/processSeatInfoSyncCancel.js +60 -0
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket.d.ts +2 -3
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket.js +20 -125
- package/lib/chevre/service/payment/movieTicket/voidTransaction.d.ts +0 -2
- package/lib/chevre/service/payment/movieTicket/voidTransaction.js +1 -1
- package/lib/chevre/service/payment/paymentCard.d.ts +2 -3
- package/lib/chevre/service/payment/paymentCard.js +16 -8
- package/lib/chevre/service/task/authorizePayment.js +2 -2
- package/lib/chevre/service/task/invalidatePaymentUrl.js +2 -2
- package/lib/chevre/service/task/pay.js +2 -2
- package/lib/chevre/service/task/payment/invalidatePaymentUrlByTask.d.ts +1 -2
- package/lib/chevre/service/task/payment/payByTask.d.ts +1 -2
- package/lib/chevre/service/task/payment/refundByTask.d.ts +1 -2
- package/lib/chevre/service/task/refund.js +2 -2
- package/lib/chevre/service/task/returnPayTransaction.js +5 -2
- package/package.json +2 -2
|
@@ -6,4 +6,20 @@ export type IActionRecipe = factory.action.trade.pay.IPayCreditCardRecipe | fact
|
|
|
6
6
|
* 決済アクションリポジトリ
|
|
7
7
|
*/
|
|
8
8
|
export declare class PayActionRepo extends ActionProcessRepo<IPayAction, IActionRecipe> {
|
|
9
|
+
/**
|
|
10
|
+
* 決済方法IDから決済アクションをひとつ参照する
|
|
11
|
+
* デフォルトでCompletedActionStatusのみ参照
|
|
12
|
+
*/
|
|
13
|
+
findPayActionByPaymentMethodId(params: {
|
|
14
|
+
project: {
|
|
15
|
+
id: string;
|
|
16
|
+
};
|
|
17
|
+
paymentMethodId: string;
|
|
18
|
+
/**
|
|
19
|
+
* 未指定の場合CompletedActionStatusのみ
|
|
20
|
+
*/
|
|
21
|
+
actionStatus?: {
|
|
22
|
+
$in?: factory.actionStatusType[];
|
|
23
|
+
};
|
|
24
|
+
}): Promise<factory.action.trade.pay.IAction | undefined>;
|
|
9
25
|
}
|
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
26
|
exports.PayActionRepo = void 0;
|
|
27
|
+
const factory = __importStar(require("../../factory"));
|
|
4
28
|
// import { MONGO_MAX_TIME_MS } from '../settings';
|
|
5
29
|
// import { createSchema, IModel as IActionModel, modelName } from './mongoose/schemas/action';
|
|
6
30
|
// import { createSchema as createRecipeSchema, IModel as IActionRecipeModel, modelName as recipeModelName } from './mongoose/schemas/actionRecipe';
|
|
@@ -9,5 +33,22 @@ const actionProcess_1 = require("./actionProcess");
|
|
|
9
33
|
* 決済アクションリポジトリ
|
|
10
34
|
*/
|
|
11
35
|
class PayActionRepo extends actionProcess_1.ActionProcessRepo {
|
|
36
|
+
/**
|
|
37
|
+
* 決済方法IDから決済アクションをひとつ参照する
|
|
38
|
+
* デフォルトでCompletedActionStatusのみ参照
|
|
39
|
+
*/
|
|
40
|
+
async findPayActionByPaymentMethodId(params) {
|
|
41
|
+
const payActions = await this.findAnyActions({
|
|
42
|
+
limit: 1,
|
|
43
|
+
page: 1,
|
|
44
|
+
actionStatus: (Array.isArray(params.actionStatus?.$in))
|
|
45
|
+
? { $in: params.actionStatus?.$in }
|
|
46
|
+
: { $in: [factory.actionStatusType.CompletedActionStatus] },
|
|
47
|
+
project: { id: { $eq: params.project.id } },
|
|
48
|
+
typeOf: { $eq: factory.actionType.PayAction },
|
|
49
|
+
object: { paymentMethod: { paymentMethodId: { $eq: params.paymentMethodId } } }
|
|
50
|
+
}, []);
|
|
51
|
+
return payActions.shift();
|
|
52
|
+
}
|
|
12
53
|
}
|
|
13
54
|
exports.PayActionRepo = PayActionRepo;
|
|
@@ -7,8 +7,8 @@ export { ICancelActionAction };
|
|
|
7
7
|
/**
|
|
8
8
|
* 汎用アクションリポジトリで開始可能なアクションタイプ
|
|
9
9
|
*/
|
|
10
|
-
type StartableActionType = Exclude<factory.actionType, factory.actionType.AcceptAction | factory.actionType.CheckAction | factory.actionType.AuthorizeAction>;
|
|
11
|
-
type IAvailableActionRecipe = IActionRecipe<Exclude<factory.recipe.RecipeCategory, factory.recipe.RecipeCategory.publishPaymentUrl | factory.recipe.RecipeCategory.checkMovieTicket | factory.recipe.RecipeCategory.acceptCOAOffer | factory.recipe.RecipeCategory.authorizeInvoice | factory.recipe.RecipeCategory.authorizeInvoice3ds>>;
|
|
10
|
+
type StartableActionType = Exclude<factory.actionType, factory.actionType.AcceptAction | factory.actionType.CheckAction | factory.actionType.AuthorizeAction | factory.actionType.PayAction | factory.actionType.RefundAction>;
|
|
11
|
+
type IAvailableActionRecipe = IActionRecipe<Exclude<factory.recipe.RecipeCategory, factory.recipe.RecipeCategory.publishPaymentUrl | factory.recipe.RecipeCategory.checkMovieTicket | factory.recipe.RecipeCategory.acceptCOAOffer | factory.recipe.RecipeCategory.authorizeInvoice | factory.recipe.RecipeCategory.authorizeInvoice3ds | factory.recipe.RecipeCategory.payCreditCard | factory.recipe.RecipeCategory.payMovieTicket | factory.recipe.RecipeCategory.refundCreditCard | factory.recipe.RecipeCategory.refundMovieTicket>>;
|
|
12
12
|
/**
|
|
13
13
|
* アクションリポジトリ
|
|
14
14
|
*/
|
|
@@ -21,15 +21,6 @@ export declare class ActionRepo extends ActionProcessRepo<IAction<StartableActio
|
|
|
21
21
|
$eq?: T;
|
|
22
22
|
};
|
|
23
23
|
}, inclusion: IKeyOfProjection[]): Promise<IAction<T>[]>;
|
|
24
|
-
findPayAction(params: {
|
|
25
|
-
project: {
|
|
26
|
-
id: string;
|
|
27
|
-
};
|
|
28
|
-
paymentMethodId: string;
|
|
29
|
-
actionStatus?: {
|
|
30
|
-
$in?: factory.actionStatusType[];
|
|
31
|
-
};
|
|
32
|
-
}): Promise<factory.action.trade.pay.IAction | undefined>;
|
|
33
24
|
/**
|
|
34
25
|
* 取引に対するアクションを検索する
|
|
35
26
|
*/
|
|
@@ -280,19 +280,26 @@ class ActionRepo extends actionProcess_1.ActionProcessRepo {
|
|
|
280
280
|
// }
|
|
281
281
|
// return doc;
|
|
282
282
|
// }
|
|
283
|
-
async findPayAction(params
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
}
|
|
283
|
+
// public async findPayAction(params: {
|
|
284
|
+
// project: { id: string };
|
|
285
|
+
// paymentMethodId: string;
|
|
286
|
+
// actionStatus?: { $in?: factory.actionStatusType[] };
|
|
287
|
+
// }): Promise<factory.action.trade.pay.IAction | undefined> {
|
|
288
|
+
// const payActions = await this.findActionsByType<factory.actionType.PayAction>(
|
|
289
|
+
// {
|
|
290
|
+
// limit: 1,
|
|
291
|
+
// page: 1,
|
|
292
|
+
// actionStatus: (Array.isArray(params.actionStatus?.$in))
|
|
293
|
+
// ? { $in: params.actionStatus?.$in }
|
|
294
|
+
// : { $in: [factory.actionStatusType.CompletedActionStatus] },
|
|
295
|
+
// project: { id: { $eq: params.project.id } },
|
|
296
|
+
// typeOf: { $eq: factory.actionType.PayAction },
|
|
297
|
+
// object: { paymentMethod: { paymentMethodId: { $eq: params.paymentMethodId } } }
|
|
298
|
+
// },
|
|
299
|
+
// []
|
|
300
|
+
// ) as factory.action.trade.pay.IAction[];
|
|
301
|
+
// return payActions.shift();
|
|
302
|
+
// }
|
|
296
303
|
/**
|
|
297
304
|
* 取引に対するアクションを検索する
|
|
298
305
|
*/
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as factory from '../../../../factory';
|
|
2
2
|
import { Settings } from '../../../../settings';
|
|
3
3
|
import type { AccountingReportRepo } from '../../../../repo/accountingReport';
|
|
4
|
-
import type { ActionRepo } from '../../../../repo/action';
|
|
5
4
|
import type { PayActionRepo } from '../../../../repo/action/pay';
|
|
6
5
|
import type { RefundActionRepo } from '../../../../repo/action/refund';
|
|
7
6
|
import type { CheckMovieTicketActionRepo } from '../../../../repo/action/checkMovieTicket';
|
|
@@ -17,7 +16,7 @@ import type { TaskRepo } from '../../../../repo/task';
|
|
|
17
16
|
import { IPaymentAgencyTransaction } from '../../../payment/creditCard';
|
|
18
17
|
export interface IProcessAuthorizeOperationRepos {
|
|
19
18
|
accountingReport: AccountingReportRepo;
|
|
20
|
-
action
|
|
19
|
+
action?: never;
|
|
21
20
|
actions: {
|
|
22
21
|
pay: PayActionRepo;
|
|
23
22
|
refund: RefundActionRepo;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as factory from '../../../../factory';
|
|
2
2
|
import { Settings } from '../../../../settings';
|
|
3
3
|
import type { AccountingReportRepo } from '../../../../repo/accountingReport';
|
|
4
|
-
import type { ActionRepo } from '../../../../repo/action';
|
|
5
4
|
import type { PayActionRepo } from '../../../../repo/action/pay';
|
|
6
5
|
import type { RefundActionRepo } from '../../../../repo/action/refund';
|
|
7
6
|
import type { CheckMovieTicketActionRepo } from '../../../../repo/action/checkMovieTicket';
|
|
@@ -34,7 +33,7 @@ export declare function processAuthorizeMovieTicket(params: factory.assetTransac
|
|
|
34
33
|
};
|
|
35
34
|
}): (repos: {
|
|
36
35
|
accountingReport: AccountingReportRepo;
|
|
37
|
-
action
|
|
36
|
+
action?: never;
|
|
38
37
|
actions: {
|
|
39
38
|
pay: PayActionRepo;
|
|
40
39
|
refund: RefundActionRepo;
|
|
@@ -2,7 +2,6 @@ import * as factory from '../../../factory';
|
|
|
2
2
|
import { Settings } from '../../../settings';
|
|
3
3
|
import type { AcceptedPaymentMethodRepo } from '../../../repo/acceptedPaymentMethod';
|
|
4
4
|
import type { AccountingReportRepo } from '../../../repo/accountingReport';
|
|
5
|
-
import type { ActionRepo } from '../../../repo/action';
|
|
6
5
|
import type { PayActionRepo } from '../../../repo/action/pay';
|
|
7
6
|
import type { RefundActionRepo } from '../../../repo/action/refund';
|
|
8
7
|
import type { CheckMovieTicketActionRepo } from '../../../repo/action/checkMovieTicket';
|
|
@@ -21,7 +20,7 @@ import { IPaymentAgencyTransaction } from '../../payment/creditCard';
|
|
|
21
20
|
export interface IStartOperationRepos {
|
|
22
21
|
acceptedPaymentMethod: AcceptedPaymentMethodRepo;
|
|
23
22
|
accountingReport: AccountingReportRepo;
|
|
24
|
-
action
|
|
23
|
+
action?: never;
|
|
25
24
|
actions: {
|
|
26
25
|
pay: PayActionRepo;
|
|
27
26
|
refund: RefundActionRepo;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import * as factory from '../../factory';
|
|
2
|
-
import type {
|
|
2
|
+
import type { PayActionRepo } from '../../repo/action/pay';
|
|
3
3
|
import type { AssetTransactionRepo } from '../../repo/assetTransaction';
|
|
4
4
|
import type { PaymentServiceRepo } from '../../repo/paymentService';
|
|
5
5
|
import type { PotentialActionRepo } from '../../repo/potentialAction';
|
|
6
6
|
import type { ProductRepo } from '../../repo/product';
|
|
7
7
|
import type { TaskRepo } from '../../repo/task';
|
|
8
8
|
export interface IStartOperationRepos {
|
|
9
|
-
action
|
|
9
|
+
action?: never;
|
|
10
|
+
actions: {
|
|
11
|
+
pay: PayActionRepo;
|
|
12
|
+
};
|
|
10
13
|
paymentService: PaymentServiceRepo;
|
|
11
14
|
potentialAction: PotentialActionRepo;
|
|
12
15
|
product: ProductRepo;
|
|
@@ -54,7 +54,7 @@ function start(params) {
|
|
|
54
54
|
});
|
|
55
55
|
const paymentServiceType = payTransaction.object.typeOf;
|
|
56
56
|
// PayActionを確認する
|
|
57
|
-
const payAction = await repos.
|
|
57
|
+
const payAction = await repos.actions.pay.findPayActionByPaymentMethodId({ project: { id: params.project.id }, paymentMethodId });
|
|
58
58
|
if (payAction === undefined) {
|
|
59
59
|
throw new factory.errors.NotFound(factory.actionType.PayAction);
|
|
60
60
|
}
|
|
@@ -25,6 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.createStartParams = createStartParams;
|
|
27
27
|
const factory = __importStar(require("../../../../../factory"));
|
|
28
|
+
const USE_DEPRECATED_RESERVATION_AVAILABLE_CHANNEL = process.env.USE_DEPRECATED_RESERVATION_AVAILABLE_CHANNEL === '1';
|
|
28
29
|
function createStartParams(params) {
|
|
29
30
|
const { reservationNumber, acceptedOffers4transactionObject, objectSubReservations, agent, expires, project, instrument } = params;
|
|
30
31
|
const provider = {
|
|
@@ -126,18 +127,23 @@ function createIssuedThrough(params) {
|
|
|
126
127
|
}
|
|
127
128
|
: undefined;
|
|
128
129
|
const availableChannel = eventOffers.itemOffered.availableChannel;
|
|
129
|
-
|
|
130
|
+
// itemOffered.availableChannel: optional(20226-03-24~)
|
|
131
|
+
// if (availableChannel === undefined) {
|
|
132
|
+
// // availableChannelは必ず存在するはず
|
|
133
|
+
// throw new factory.errors.NotFound('reservationFor.offers.availableChannel');
|
|
134
|
+
// }
|
|
135
|
+
if (typeof eventOffers.itemOffered.id !== 'string') {
|
|
130
136
|
// availableChannelは必ず存在するはず
|
|
131
|
-
throw new factory.errors.NotFound('reservationFor.offers.
|
|
137
|
+
throw new factory.errors.NotFound('reservationFor.offers.itemOffered.id');
|
|
132
138
|
}
|
|
133
139
|
if (params.reservationFor.typeOf === factory.eventType.ScreeningEvent) {
|
|
134
140
|
const issuedThrough = {
|
|
135
141
|
typeOf: factory.product.ProductType.EventService,
|
|
136
142
|
// 興行IDを追加(2022-09-08~)
|
|
137
143
|
id: eventOffers.itemOffered.id,
|
|
138
|
-
availableChannel,
|
|
139
144
|
// issuedThrough.serviceTypeを連携
|
|
140
|
-
...(typeof serviceTypeOfIssuedThrough?.typeOf === 'string') ? { serviceType: serviceTypeOfIssuedThrough } : undefined
|
|
145
|
+
...(typeof serviceTypeOfIssuedThrough?.typeOf === 'string') ? { serviceType: serviceTypeOfIssuedThrough } : undefined,
|
|
146
|
+
...(USE_DEPRECATED_RESERVATION_AVAILABLE_CHANNEL) && { availableChannel }
|
|
141
147
|
};
|
|
142
148
|
return {
|
|
143
149
|
issuedThrough
|
|
@@ -244,8 +244,10 @@ function searchEventSeatOffers(params) {
|
|
|
244
244
|
const eventOffers = params.event.offers;
|
|
245
245
|
const reservedSeatsAvailable = eventOffers?.itemOffered.serviceOutput?.reservedTicket?.ticketedSeat !== undefined;
|
|
246
246
|
if (reservedSeatsAvailable) {
|
|
247
|
-
const roomBranchCode = String(eventOffers.itemOffered?.availableChannel?.serviceLocation.branchCode);
|
|
248
|
-
const movieTheaterBranchCode = String(eventOffers.itemOffered?.availableChannel?.serviceLocation.containedInPlace.branchCode);
|
|
247
|
+
// const roomBranchCode = String(eventOffers.itemOffered?.availableChannel?.serviceLocation.branchCode);
|
|
248
|
+
// const movieTheaterBranchCode = String(eventOffers.itemOffered?.availableChannel?.serviceLocation.containedInPlace.branchCode);
|
|
249
|
+
const roomBranchCode = params.event.location.branchCode;
|
|
250
|
+
const movieTheaterBranchCode = params.event.superEvent.location.branchCode;
|
|
249
251
|
// reimplement using projectSeatsByScreeningRoom
|
|
250
252
|
const seats = await repos.seat.projectSeatsByScreeningRoom({
|
|
251
253
|
project: { id: { $eq: params.event.project.id } },
|
|
@@ -32,6 +32,7 @@ exports.responseBody2acceptedOffers4result = responseBody2acceptedOffers4result;
|
|
|
32
32
|
const moment_1 = __importDefault(require("moment"));
|
|
33
33
|
const util = __importStar(require("util"));
|
|
34
34
|
const factory = __importStar(require("../../../../factory"));
|
|
35
|
+
const USE_DEPRECATED_RESERVATION_AVAILABLE_CHANNEL = process.env.USE_DEPRECATED_RESERVATION_AVAILABLE_CHANNEL === '1';
|
|
35
36
|
function createAuthorizeSeatReservationActionAttributes(params) {
|
|
36
37
|
const transaction = params.transaction;
|
|
37
38
|
// 最適化(2022-06-07~)
|
|
@@ -206,17 +207,19 @@ function responseBody2acceptedOffers4result(params) {
|
|
|
206
207
|
const issuedThrough = {
|
|
207
208
|
typeOf: factory.product.ProductType.EventService,
|
|
208
209
|
// id: '', // discontinue(2025-01-02~)
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
210
|
+
...(USE_DEPRECATED_RESERVATION_AVAILABLE_CHANNEL) && {
|
|
211
|
+
availableChannel: {
|
|
212
|
+
typeOf: 'ServiceChannel',
|
|
213
|
+
serviceLocation: {
|
|
214
|
+
typeOf: reservationFor.location.typeOf,
|
|
215
|
+
branchCode: reservationFor.location.branchCode,
|
|
216
|
+
name: reservationFor.location.name,
|
|
217
|
+
containedInPlace: {
|
|
218
|
+
typeOf: reservationFor.superEvent.location.typeOf,
|
|
219
|
+
id: reservationFor.superEvent.location.id,
|
|
220
|
+
branchCode: reservationFor.superEvent.location.branchCode,
|
|
221
|
+
name: reservationFor.superEvent.location.name
|
|
222
|
+
}
|
|
220
223
|
}
|
|
221
224
|
}
|
|
222
225
|
}
|
|
@@ -45,13 +45,15 @@ function searchEventSeatOffersWithPaging(params) {
|
|
|
45
45
|
const { includeSectionCodeOnlyFirstElement, useDefaultSection } = params.options;
|
|
46
46
|
let offers = [];
|
|
47
47
|
// optimize(2024-07-18~)
|
|
48
|
-
const event = await repos.event.projectEventFieldsById({ id: params.event.id }, ['project', 'startDate', 'offers.itemOffered', 'organizer']);
|
|
48
|
+
const event = await repos.event.projectEventFieldsById({ id: params.event.id }, ['project', 'startDate', 'offers.itemOffered', 'organizer', 'location', 'superEvent']);
|
|
49
49
|
// 座席指定利用可能かどうか
|
|
50
50
|
const eventOffers = event.offers;
|
|
51
51
|
const reservedSeatsAvailable = eventOffers?.itemOffered.serviceOutput?.reservedTicket?.ticketedSeat !== undefined;
|
|
52
52
|
if (reservedSeatsAvailable) {
|
|
53
|
-
const roomBranchCode = String(eventOffers.itemOffered?.availableChannel?.serviceLocation.branchCode);
|
|
54
|
-
const movieTheaterBranchCode = String(eventOffers.itemOffered?.availableChannel?.serviceLocation.containedInPlace.branchCode);
|
|
53
|
+
// const roomBranchCode = String(eventOffers.itemOffered?.availableChannel?.serviceLocation.branchCode);
|
|
54
|
+
// const movieTheaterBranchCode = String(eventOffers.itemOffered?.availableChannel?.serviceLocation.containedInPlace.branchCode);
|
|
55
|
+
const roomBranchCode = event.location.branchCode;
|
|
56
|
+
const movieTheaterBranchCode = event.superEvent.location.branchCode;
|
|
55
57
|
let defaultSectionCode;
|
|
56
58
|
if (useDefaultSection) {
|
|
57
59
|
const defaultSection = (await repos.section.findSectionsByRoom({
|
|
@@ -159,7 +161,7 @@ function findEventSeatOffersBySection(params) {
|
|
|
159
161
|
organizer: { id: { $eq: sellerId } },
|
|
160
162
|
id: { $eq: eventId },
|
|
161
163
|
typeOf: factory.eventType.ScreeningEvent
|
|
162
|
-
}, ['startDate', 'offers.itemOffered'])).shift();
|
|
164
|
+
}, ['startDate', 'offers.itemOffered', 'location', 'superEvent'])).shift();
|
|
163
165
|
if (event === undefined) {
|
|
164
166
|
throw new factory.errors.NotFound(factory.eventType.ScreeningEvent);
|
|
165
167
|
}
|
|
@@ -167,8 +169,10 @@ function findEventSeatOffersBySection(params) {
|
|
|
167
169
|
const eventOffers = event.offers;
|
|
168
170
|
const reservedSeatsAvailable = eventOffers?.itemOffered.serviceOutput?.reservedTicket?.ticketedSeat !== undefined;
|
|
169
171
|
if (reservedSeatsAvailable) {
|
|
170
|
-
const roomBranchCode = String(eventOffers.itemOffered?.availableChannel?.serviceLocation.branchCode);
|
|
171
|
-
const movieTheaterBranchCode = String(eventOffers.itemOffered?.availableChannel?.serviceLocation.containedInPlace.branchCode);
|
|
172
|
+
// const roomBranchCode = String(eventOffers.itemOffered?.availableChannel?.serviceLocation.branchCode);
|
|
173
|
+
// const movieTheaterBranchCode = String(eventOffers.itemOffered?.availableChannel?.serviceLocation.containedInPlace.branchCode);
|
|
174
|
+
const roomBranchCode = event.location.branchCode;
|
|
175
|
+
const movieTheaterBranchCode = event.superEvent.location.branchCode;
|
|
172
176
|
const seats = await repos.seat.projectSeatsByScreeningRoom({
|
|
173
177
|
limit,
|
|
174
178
|
page,
|
|
@@ -2,7 +2,6 @@ import * as factory from '../../../factory';
|
|
|
2
2
|
import { Settings } from '../../../settings';
|
|
3
3
|
import type { AcceptedPaymentMethodRepo } from '../../../repo/acceptedPaymentMethod';
|
|
4
4
|
import type { AccountingReportRepo } from '../../../repo/accountingReport';
|
|
5
|
-
import type { ActionRepo } from '../../../repo/action';
|
|
6
5
|
import type { PayActionRepo } from '../../../repo/action/pay';
|
|
7
6
|
import type { RefundActionRepo } from '../../../repo/action/refund';
|
|
8
7
|
import type { CheckMovieTicketActionRepo } from '../../../repo/action/checkMovieTicket';
|
|
@@ -29,7 +28,7 @@ import type { TransactionNumberRepo } from '../../../repo/transactionNumber';
|
|
|
29
28
|
interface IAuthorizeRepos {
|
|
30
29
|
acceptedPaymentMethod: AcceptedPaymentMethodRepo;
|
|
31
30
|
accountingReport: AccountingReportRepo;
|
|
32
|
-
action
|
|
31
|
+
action?: never;
|
|
33
32
|
actions: {
|
|
34
33
|
pay: PayActionRepo;
|
|
35
34
|
refund: RefundActionRepo;
|
|
@@ -7,6 +7,7 @@ import type { PayActionRepo } from '../../../repo/action/pay';
|
|
|
7
7
|
import type { RefundActionRepo } from '../../../repo/action/refund';
|
|
8
8
|
import type { TaskRepo } from '../../../repo/task';
|
|
9
9
|
interface IOnPayActionCompletedRepos {
|
|
10
|
+
action?: never;
|
|
10
11
|
actions: {
|
|
11
12
|
pay: PayActionRepo;
|
|
12
13
|
refund: RefundActionRepo;
|
|
@@ -4,6 +4,7 @@ import type { PayActionRepo } from '../../../repo/action/pay';
|
|
|
4
4
|
import type { RefundActionRepo } from '../../../repo/action/refund';
|
|
5
5
|
import type { TaskRepo } from '../../../repo/task';
|
|
6
6
|
interface IOnRefundActionCompletedOrFailedRepos {
|
|
7
|
+
action?: never;
|
|
7
8
|
actions: {
|
|
8
9
|
pay: PayActionRepo;
|
|
9
10
|
refund: RefundActionRepo;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { AccountingReportRepo } from '../../../repo/accountingReport';
|
|
2
|
-
import type { ActionRepo } from '../../../repo/action';
|
|
3
2
|
import type { PayActionRepo } from '../../../repo/action/pay';
|
|
4
3
|
import type { RefundActionRepo } from '../../../repo/action/refund';
|
|
5
4
|
import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
@@ -12,7 +11,7 @@ import { Settings } from '../../../settings';
|
|
|
12
11
|
* クレジットカード決済
|
|
13
12
|
*/
|
|
14
13
|
declare function payCreditCard(params: factory.action.trade.pay.IAttributes): (repos: {
|
|
15
|
-
action
|
|
14
|
+
action?: never;
|
|
16
15
|
actions: {
|
|
17
16
|
pay: PayActionRepo;
|
|
18
17
|
refund: RefundActionRepo;
|
|
@@ -55,7 +55,7 @@ function payCreditCard(params) {
|
|
|
55
55
|
paymentMethodType, seller: { id: sellerId }, paymentServiceId,
|
|
56
56
|
requirePaymentAccepted
|
|
57
57
|
})(repos);
|
|
58
|
-
const action = await repos.
|
|
58
|
+
const action = await repos.actions.pay.start(params);
|
|
59
59
|
const alterTranResults = [];
|
|
60
60
|
const processAlterTranResults = [];
|
|
61
61
|
let recipe;
|
|
@@ -86,7 +86,7 @@ function payCreditCard(params) {
|
|
|
86
86
|
try {
|
|
87
87
|
// add recipe(2024-06-29~)
|
|
88
88
|
recipe = (0, factory_1.processAlterTranResult2payRecipe)({ processAlterTranResults, project: { id: params.project.id } });
|
|
89
|
-
await repos.
|
|
89
|
+
await repos.actions.pay.giveUp({ typeOf: action.typeOf, id: action.id, error, recipe });
|
|
90
90
|
}
|
|
91
91
|
catch (__) {
|
|
92
92
|
// 失敗したら仕方ない
|
|
@@ -96,7 +96,7 @@ function payCreditCard(params) {
|
|
|
96
96
|
const actionResult = {
|
|
97
97
|
// creditCardSales: alterTranResults // discontinue(2024-06-10~)
|
|
98
98
|
};
|
|
99
|
-
await repos.
|
|
99
|
+
await repos.actions.pay.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: actionResult, recipe });
|
|
100
100
|
await (0, onPayActionCompleted_1.onPayActionCompleted)({
|
|
101
101
|
// actionStatus: factory.actionStatusType.CompletedActionStatus,
|
|
102
102
|
id: action.id,
|
|
@@ -105,7 +105,11 @@ function payCreditCard(params) {
|
|
|
105
105
|
project: params.project,
|
|
106
106
|
purpose: params.purpose,
|
|
107
107
|
typeOf: action.typeOf
|
|
108
|
-
})(
|
|
108
|
+
})({
|
|
109
|
+
actions: repos.actions,
|
|
110
|
+
accountingReport: repos.accountingReport,
|
|
111
|
+
task: repos.task
|
|
112
|
+
});
|
|
109
113
|
// return action;
|
|
110
114
|
};
|
|
111
115
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { AccountingReportRepo } from '../../../repo/accountingReport';
|
|
2
|
-
import type { ActionRepo } from '../../../repo/action';
|
|
3
2
|
import type { PayActionRepo } from '../../../repo/action/pay';
|
|
4
3
|
import type { RefundActionRepo } from '../../../repo/action/refund';
|
|
5
4
|
import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
@@ -17,7 +16,7 @@ declare function refundCreditCard(params: Pick<factory.action.trade.refund.IAttr
|
|
|
17
16
|
id: string;
|
|
18
17
|
};
|
|
19
18
|
}): (repos: {
|
|
20
|
-
action
|
|
19
|
+
action?: never;
|
|
21
20
|
actions: {
|
|
22
21
|
pay: PayActionRepo;
|
|
23
22
|
refund: RefundActionRepo;
|
|
@@ -53,11 +53,11 @@ function refundCreditCard(params
|
|
|
53
53
|
let payAction;
|
|
54
54
|
let alterTranResultByPayAction;
|
|
55
55
|
if (requirePayAction) {
|
|
56
|
-
payAction = await repos.
|
|
56
|
+
payAction = await repos.actions.pay.findPayActionByPaymentMethodId({ project: { id: params.project.id }, paymentMethodId });
|
|
57
57
|
if (payAction === undefined) {
|
|
58
58
|
throw new factory.errors.NotFound(factory.actionType.PayAction);
|
|
59
59
|
}
|
|
60
|
-
const payRecipe = await repos.
|
|
60
|
+
const payRecipe = await repos.actions.pay.findRecipeByAction({
|
|
61
61
|
project: { id: params.project.id },
|
|
62
62
|
recipeFor: { id: payAction.id }
|
|
63
63
|
});
|
|
@@ -73,7 +73,7 @@ function refundCreditCard(params
|
|
|
73
73
|
id: paymentServiceId
|
|
74
74
|
});
|
|
75
75
|
const { sameAs, ...startingActionParams } = params; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
76
|
-
const action = await repos.
|
|
76
|
+
const action = await repos.actions.refund.start({
|
|
77
77
|
...startingActionParams,
|
|
78
78
|
...(typeof params.sameAs?.id === 'string') ? { sameAs: { id: params.sameAs.id, typeOf: 'Task' } } : undefined
|
|
79
79
|
});
|
|
@@ -106,7 +106,7 @@ function refundCreditCard(params
|
|
|
106
106
|
}
|
|
107
107
|
catch (error) {
|
|
108
108
|
try {
|
|
109
|
-
await repos.
|
|
109
|
+
await repos.actions.refund.giveUp({
|
|
110
110
|
typeOf: action.typeOf, id: action.id, error,
|
|
111
111
|
...(recipe !== undefined) ? { recipe } : undefined
|
|
112
112
|
});
|
|
@@ -118,7 +118,7 @@ function refundCreditCard(params
|
|
|
118
118
|
}
|
|
119
119
|
const actionResult = {}; // optimize(2024-06-10~)
|
|
120
120
|
// add recipe(2024-06-04~)
|
|
121
|
-
await repos.
|
|
121
|
+
await repos.actions.refund.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: actionResult, recipe });
|
|
122
122
|
await (0, onRefundActionCompletedOrFailed_1.onRefundActionCompletedOrFailed)({
|
|
123
123
|
actionStatus: factory.actionStatusType.CompletedActionStatus,
|
|
124
124
|
id: action.id,
|
|
@@ -127,7 +127,11 @@ function refundCreditCard(params
|
|
|
127
127
|
project: startingActionParams.project,
|
|
128
128
|
purpose: startingActionParams.purpose,
|
|
129
129
|
typeOf: action.typeOf
|
|
130
|
-
})(
|
|
130
|
+
})({
|
|
131
|
+
actions: repos.actions,
|
|
132
|
+
accountingReport: repos.accountingReport,
|
|
133
|
+
task: repos.task
|
|
134
|
+
});
|
|
131
135
|
};
|
|
132
136
|
}
|
|
133
137
|
function processAlterTran(params) {
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as factory from '../../factory';
|
|
5
5
|
import type { AccountingReportRepo } from '../../repo/accountingReport';
|
|
6
|
-
import type { ActionRepo } from '../../repo/action';
|
|
7
6
|
import type { PayActionRepo } from '../../repo/action/pay';
|
|
8
7
|
import type { RefundActionRepo } from '../../repo/action/refund';
|
|
9
8
|
import type { ProductRepo } from '../../repo/product';
|
|
@@ -12,7 +11,7 @@ declare function voidTransaction(__: factory.task.voidPayment.IData): (___: {
|
|
|
12
11
|
product: ProductRepo;
|
|
13
12
|
}) => Promise<void>;
|
|
14
13
|
declare function payFaceToFace(params: factory.action.trade.pay.IAttributes): (repos: {
|
|
15
|
-
action
|
|
14
|
+
action?: never;
|
|
16
15
|
actions: {
|
|
17
16
|
pay: PayActionRepo;
|
|
18
17
|
refund: RefundActionRepo;
|
|
@@ -22,7 +21,7 @@ declare function payFaceToFace(params: factory.action.trade.pay.IAttributes): (r
|
|
|
22
21
|
task: TaskRepo;
|
|
23
22
|
}) => Promise<void>;
|
|
24
23
|
declare function refundFaceToFace(params: factory.task.refund.IData): (repos: {
|
|
25
|
-
action
|
|
24
|
+
action?: never;
|
|
26
25
|
actions: {
|
|
27
26
|
pay: PayActionRepo;
|
|
28
27
|
refund: RefundActionRepo;
|
|
@@ -39,13 +39,13 @@ function voidTransaction(__) {
|
|
|
39
39
|
}
|
|
40
40
|
function payFaceToFace(params) {
|
|
41
41
|
return async (repos) => {
|
|
42
|
-
const action = await repos.
|
|
42
|
+
const action = await repos.actions.pay.start(params);
|
|
43
43
|
try {
|
|
44
44
|
// no op
|
|
45
45
|
}
|
|
46
46
|
catch (error) {
|
|
47
47
|
try {
|
|
48
|
-
await repos.
|
|
48
|
+
await repos.actions.pay.giveUp({ typeOf: action.typeOf, id: action.id, error });
|
|
49
49
|
}
|
|
50
50
|
catch (__) {
|
|
51
51
|
// 失敗したら仕方ない
|
|
@@ -53,7 +53,7 @@ function payFaceToFace(params) {
|
|
|
53
53
|
throw error;
|
|
54
54
|
}
|
|
55
55
|
const actionResult = {};
|
|
56
|
-
await repos.
|
|
56
|
+
await repos.actions.pay.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: actionResult });
|
|
57
57
|
await (0, onPayActionCompleted_1.onPayActionCompleted)({
|
|
58
58
|
// actionStatus: factory.actionStatusType.CompletedActionStatus,
|
|
59
59
|
id: action.id,
|
|
@@ -62,19 +62,23 @@ function payFaceToFace(params) {
|
|
|
62
62
|
project: params.project,
|
|
63
63
|
purpose: params.purpose,
|
|
64
64
|
typeOf: action.typeOf
|
|
65
|
-
})(
|
|
65
|
+
})({
|
|
66
|
+
actions: repos.actions,
|
|
67
|
+
accountingReport: repos.accountingReport,
|
|
68
|
+
task: repos.task
|
|
69
|
+
});
|
|
66
70
|
// return action;
|
|
67
71
|
};
|
|
68
72
|
}
|
|
69
73
|
function refundFaceToFace(params) {
|
|
70
74
|
return async (repos) => {
|
|
71
|
-
const action = await repos.
|
|
75
|
+
const action = await repos.actions.refund.start(params);
|
|
72
76
|
try {
|
|
73
77
|
// no op
|
|
74
78
|
}
|
|
75
79
|
catch (error) {
|
|
76
80
|
try {
|
|
77
|
-
await repos.
|
|
81
|
+
await repos.actions.refund.giveUp({ typeOf: action.typeOf, id: action.id, error });
|
|
78
82
|
}
|
|
79
83
|
catch (__) {
|
|
80
84
|
// no op
|
|
@@ -82,7 +86,7 @@ function refundFaceToFace(params) {
|
|
|
82
86
|
throw error;
|
|
83
87
|
}
|
|
84
88
|
const actionResult = {};
|
|
85
|
-
await repos.
|
|
89
|
+
await repos.actions.refund.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: actionResult });
|
|
86
90
|
await (0, onRefundActionCompletedOrFailed_1.onRefundActionCompletedOrFailed)({
|
|
87
91
|
actionStatus: factory.actionStatusType.CompletedActionStatus,
|
|
88
92
|
id: action.id,
|
|
@@ -91,7 +95,11 @@ function refundFaceToFace(params) {
|
|
|
91
95
|
project: params.project,
|
|
92
96
|
purpose: params.purpose,
|
|
93
97
|
typeOf: action.typeOf
|
|
94
|
-
})(
|
|
98
|
+
})({
|
|
99
|
+
actions: repos.actions,
|
|
100
|
+
accountingReport: repos.accountingReport,
|
|
101
|
+
task: repos.task
|
|
102
|
+
});
|
|
95
103
|
// return action;
|
|
96
104
|
};
|
|
97
105
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { AccountingReportRepo } from '../../../repo/accountingReport';
|
|
2
|
-
import type { ActionRepo } from '../../../repo/action';
|
|
3
2
|
import type { PayActionRepo } from '../../../repo/action/pay';
|
|
4
3
|
import type { RefundActionRepo } from '../../../repo/action/refund';
|
|
5
4
|
import type { CheckMovieTicketActionRepo } from '../../../repo/action/checkMovieTicket';
|
|
@@ -40,7 +39,7 @@ declare function authorize(params: factory.assetTransaction.pay.IStartParamsWith
|
|
|
40
39
|
id: string;
|
|
41
40
|
};
|
|
42
41
|
}): (repos: {
|
|
43
|
-
action
|
|
42
|
+
action?: never;
|
|
44
43
|
actions: {
|
|
45
44
|
pay: PayActionRepo;
|
|
46
45
|
refund: RefundActionRepo;
|