@chevre/domain 24.0.0-alpha.17 → 24.0.0-alpha.18
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/acceptCOAOffer.d.ts +2 -2
- package/lib/chevre/repo/action/acceptPay.d.ts +8 -0
- package/lib/chevre/repo/action/acceptPay.js +13 -0
- package/lib/chevre/repo/action/actionProcess.d.ts +28 -10
- package/lib/chevre/repo/action/actionProcess.js +24 -1
- package/lib/chevre/repo/action/authorizeOffer.d.ts +3 -3
- package/lib/chevre/repo/action/authorizeOffer.js +4 -4
- package/lib/chevre/repo/action/checkMovieTicket.d.ts +55 -0
- package/lib/chevre/repo/action/checkMovieTicket.js +145 -0
- package/lib/chevre/repo/action/checkThing.d.ts +8 -0
- package/lib/chevre/repo/action/checkThing.js +13 -0
- package/lib/chevre/repo/action.d.ts +8 -88
- package/lib/chevre/repo/action.js +0 -128
- package/lib/chevre/repository.d.ts +10 -0
- package/lib/chevre/repository.js +22 -0
- package/lib/chevre/service/assetTransaction/pay/check.d.ts +5 -4
- package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.d.ts +5 -2
- package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.js +3 -3
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.d.ts +14 -3
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.js +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.d.ts +2 -2
- package/lib/chevre/service/payment/any/findAcceptAction.d.ts +2 -2
- package/lib/chevre/service/payment/any/findAcceptAction.js +2 -2
- package/lib/chevre/service/payment/any/findCheckAction.d.ts +7 -6
- package/lib/chevre/service/payment/any/findCheckAction.js +2 -2
- package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +2 -0
- package/lib/chevre/service/payment/movieTicket/checkMovieTicket.d.ts +3 -3
- package/lib/chevre/service/payment/movieTicket/checkMovieTicket.js +3 -3
- package/lib/chevre/service/task/acceptCOAOffer.js +5 -2
- package/lib/chevre/service/task/checkMovieTicket.js +3 -3
- package/lib/chevre/service/task/checkResource.js +2 -2
- package/lib/chevre/service/task/publishPaymentUrl.js +4 -2
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as factory from '../../factory';
|
|
2
|
-
import { IKeyOfProjection, ActionProcessRepo } from './actionProcess';
|
|
2
|
+
import { IActionRecipe, IKeyOfProjection, ActionProcessRepo } from './actionProcess';
|
|
3
3
|
export type IAcceptCOAOfferAction = factory.action.accept.coaOffer.IAction;
|
|
4
4
|
/**
|
|
5
5
|
* COAオファー採用リポジトリ
|
|
6
6
|
*/
|
|
7
|
-
export declare class AcceptCOAOfferActionRepo extends ActionProcessRepo<IAcceptCOAOfferAction
|
|
7
|
+
export declare class AcceptCOAOfferActionRepo extends ActionProcessRepo<IAcceptCOAOfferAction, IActionRecipe<factory.recipe.RecipeCategory.acceptCOAOffer>> {
|
|
8
8
|
/**
|
|
9
9
|
* 完了済の採用アクションを参照する
|
|
10
10
|
*/
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as factory from '../../factory';
|
|
2
|
+
import { IActionRecipe, ActionProcessRepo } from './actionProcess';
|
|
3
|
+
export type IAcceptPayAction = factory.action.accept.pay.IAction;
|
|
4
|
+
/**
|
|
5
|
+
* 決済採用リポジトリ
|
|
6
|
+
*/
|
|
7
|
+
export declare class AcceptPayActionRepo extends ActionProcessRepo<IAcceptPayAction, IActionRecipe<factory.recipe.RecipeCategory.publishPaymentUrl>> {
|
|
8
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AcceptPayActionRepo = void 0;
|
|
4
|
+
// import { MONGO_MAX_TIME_MS } from '../settings';
|
|
5
|
+
// import { createSchema, IModel as IActionModel, modelName } from './mongoose/schemas/action';
|
|
6
|
+
// import { createSchema as createRecipeSchema, IModel as IActionRecipeModel, modelName as recipeModelName } from './mongoose/schemas/actionRecipe';
|
|
7
|
+
const actionProcess_1 = require("./actionProcess");
|
|
8
|
+
/**
|
|
9
|
+
* 決済採用リポジトリ
|
|
10
|
+
*/
|
|
11
|
+
class AcceptPayActionRepo extends actionProcess_1.ActionProcessRepo {
|
|
12
|
+
}
|
|
13
|
+
exports.AcceptPayActionRepo = AcceptPayActionRepo;
|
|
@@ -17,7 +17,7 @@ export interface ICancelActionAction {
|
|
|
17
17
|
typeOf: 'Task';
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
export type IActionRecipe<T extends factory.recipe.RecipeCategory> = T extends factory.recipe.RecipeCategory.checkMovieTicket ? factory.action.check.paymentMethod.movieTicket.IRecipe : T extends factory.recipe.RecipeCategory.payCreditCard ? factory.action.trade.pay.IPayCreditCardRecipe : T extends factory.recipe.RecipeCategory.payMovieTicket ? factory.action.trade.pay.IPayMovieTicketRecipe : T extends factory.recipe.RecipeCategory.publishPaymentUrl ? factory.action.accept.pay.IRecipe : T extends factory.recipe.RecipeCategory.refundCreditCard ? factory.action.trade.refund.IRefundCreditCardRecipe : T extends factory.recipe.RecipeCategory.refundMovieTicket ? factory.action.trade.refund.IRefundMovieTicketRecipe : T extends factory.recipe.RecipeCategory.acceptCOAOffer ? factory.action.accept.coaOffer.IRecipe : T extends factory.recipe.RecipeCategory.confirmCOAReserve ? factory.action.interact.confirm.reservation.IConfirmCOAReserveRecipe : never;
|
|
20
|
+
export type IActionRecipe<T extends factory.recipe.RecipeCategory> = T extends factory.recipe.RecipeCategory.checkMovieTicket ? factory.action.check.paymentMethod.movieTicket.IRecipe : T extends factory.recipe.RecipeCategory.payCreditCard ? factory.action.trade.pay.IPayCreditCardRecipe : T extends factory.recipe.RecipeCategory.payMovieTicket ? factory.action.trade.pay.IPayMovieTicketRecipe : T extends factory.recipe.RecipeCategory.publishPaymentUrl ? factory.action.accept.pay.IRecipe : T extends factory.recipe.RecipeCategory.refundCreditCard ? factory.action.trade.refund.IRefundCreditCardRecipe : T extends factory.recipe.RecipeCategory.refundMovieTicket ? factory.action.trade.refund.IRefundMovieTicketRecipe : T extends factory.recipe.RecipeCategory.authorizeInvoice ? factory.action.authorize.invoice.IAuthorizeInvoiceRecipe : T extends factory.recipe.RecipeCategory.authorizeInvoice3ds ? factory.action.authorize.invoice.IAuthorizeInvoice3dsRecipe : T extends factory.recipe.RecipeCategory.acceptCOAOffer ? factory.action.accept.coaOffer.IRecipe : T extends factory.recipe.RecipeCategory.confirmCOAReserve ? factory.action.interact.confirm.reservation.IConfirmCOAReserveRecipe : T extends factory.recipe.RecipeCategory.cancelPendingCOAReserve ? factory.action.cancel.coaReserve.ICancelPendingCOAReserveRecipe : T extends factory.recipe.RecipeCategory.returnCOAReserve ? factory.action.transfer.returnAction.reserveTransaction.IReturnCOAReserveRecipe : T extends factory.recipe.RecipeCategory.sendEmailMessage ? factory.action.transfer.send.message.email.IRecipe : never;
|
|
21
21
|
export type IRecipeAsDocument = factory.recipe.IRecipe & {
|
|
22
22
|
recipeFor: {
|
|
23
23
|
id: string;
|
|
@@ -26,7 +26,7 @@ export type IRecipeAsDocument = factory.recipe.IRecipe & {
|
|
|
26
26
|
dateCreated: Date;
|
|
27
27
|
dateModified?: Date;
|
|
28
28
|
};
|
|
29
|
-
export type IRecipeAsActionAttributes
|
|
29
|
+
export type IRecipeAsActionAttributes<T extends factory.recipe.RecipeCategory> = Pick<IActionRecipe<T>, 'project' | 'recipeCategory' | 'step' | 'typeOf'>;
|
|
30
30
|
export type IMinimizedPurchaseNumberAuthResult = Pick<factory.action.check.paymentMethod.movieTicket.IPurchaseNumberAuthResult, 'mkknmiNumSum' | 'resultInfo' | 'ykknmiNumSum'> & {
|
|
31
31
|
knyknrNoInfoOut: Omit<factory.action.check.paymentMethod.movieTicket.IPurchaseNumberInfo, 'ykknInfo' | 'mkknInfo'>[] | null;
|
|
32
32
|
};
|
|
@@ -35,7 +35,7 @@ export declare const AVAILABLE_PROJECT_FIELDS: IKeyOfProjection[];
|
|
|
35
35
|
/**
|
|
36
36
|
* アクション状態管理リポジトリ
|
|
37
37
|
*/
|
|
38
|
-
export declare class ActionProcessRepo<TAction extends
|
|
38
|
+
export declare class ActionProcessRepo<TAction extends IAction<factory.actionType>, TActionRecipe extends IActionRecipe<factory.recipe.RecipeCategory>> {
|
|
39
39
|
protected readonly actionModel: IActionModel;
|
|
40
40
|
protected readonly actionRecipeModel: IActionRecipeModel;
|
|
41
41
|
constructor(connection: Connection);
|
|
@@ -43,13 +43,13 @@ export declare class ActionProcessRepo<TAction extends factory.action.IAction<fa
|
|
|
43
43
|
* アクション開始
|
|
44
44
|
*/
|
|
45
45
|
start<T extends TAction['typeOf']>(attributes: factory.action.IAttributes<T, any, any>, options?: {
|
|
46
|
-
recipe?: IRecipeAsActionAttributes
|
|
46
|
+
recipe?: IRecipeAsActionAttributes<TActionRecipe['recipeCategory']>;
|
|
47
47
|
}): Promise<Pick<IAction<T>, 'id' | 'typeOf' | 'startDate'>>;
|
|
48
48
|
completeWithVoid(params: {
|
|
49
49
|
typeOf: TAction['typeOf'];
|
|
50
50
|
id: string;
|
|
51
51
|
result: any;
|
|
52
|
-
recipe?: IRecipeAsActionAttributes
|
|
52
|
+
recipe?: IRecipeAsActionAttributes<TActionRecipe['recipeCategory']>;
|
|
53
53
|
}): Promise<void>;
|
|
54
54
|
/**
|
|
55
55
|
* アクション取消
|
|
@@ -66,7 +66,7 @@ export declare class ActionProcessRepo<TAction extends factory.action.IAction<fa
|
|
|
66
66
|
typeOf: TAction['typeOf'];
|
|
67
67
|
id: string;
|
|
68
68
|
error: Error | Error[];
|
|
69
|
-
recipe?: IRecipeAsActionAttributes
|
|
69
|
+
recipe?: IRecipeAsActionAttributes<TActionRecipe['recipeCategory']>;
|
|
70
70
|
}): Promise<void>;
|
|
71
71
|
/**
|
|
72
72
|
* 一定期間ActiveActionStatusのアクションをFailedActionStatusにする
|
|
@@ -80,7 +80,7 @@ export declare class ActionProcessRepo<TAction extends factory.action.IAction<fa
|
|
|
80
80
|
$lt: Date;
|
|
81
81
|
};
|
|
82
82
|
}): Promise<any>;
|
|
83
|
-
findRecipeByAction<T extends
|
|
83
|
+
findRecipeByAction<T extends TActionRecipe['recipeCategory']>(params: {
|
|
84
84
|
project: {
|
|
85
85
|
id: string;
|
|
86
86
|
};
|
|
@@ -88,10 +88,28 @@ export declare class ActionProcessRepo<TAction extends factory.action.IAction<fa
|
|
|
88
88
|
id: string;
|
|
89
89
|
};
|
|
90
90
|
}): Promise<Pick<IActionRecipe<T>, 'step' | 'recipeCategory'> | null>;
|
|
91
|
-
findById
|
|
92
|
-
typeOf:
|
|
91
|
+
findById(params: {
|
|
92
|
+
typeOf: TAction['typeOf'];
|
|
93
93
|
id: string;
|
|
94
|
-
}, inclusion?: IKeyOfProjection[], exclusion?: IKeyOfProjection[]): Promise<
|
|
94
|
+
}, inclusion?: IKeyOfProjection[], exclusion?: IKeyOfProjection[]): Promise<TAction>;
|
|
95
|
+
searchBySameAs(params: {
|
|
96
|
+
sameAs: {
|
|
97
|
+
id: {
|
|
98
|
+
$eq: string;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
purpose?: {
|
|
102
|
+
id: {
|
|
103
|
+
$eq: string;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* 1taskから複数actionが発生する可能性があるので、typeOf指定が必須
|
|
108
|
+
*/
|
|
109
|
+
typeOf: {
|
|
110
|
+
$eq: TAction['typeOf'];
|
|
111
|
+
};
|
|
112
|
+
}): Promise<Pick<TAction, 'id' | 'actionStatus' | 'error' | 'purpose'>[]>;
|
|
95
113
|
private findActionStatusById;
|
|
96
114
|
protected upsertRecipe(savingRecipe: Pick<IRecipeAsDocument, 'project' | 'recipeCategory' | 'recipeFor' | 'step' | 'typeOf'>): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
97
115
|
}
|
|
@@ -68,7 +68,9 @@ class ActionProcessRepo {
|
|
|
68
68
|
/**
|
|
69
69
|
* アクション開始
|
|
70
70
|
*/
|
|
71
|
-
async start(
|
|
71
|
+
async start(
|
|
72
|
+
// public async start<T extends Exclude<TAction['typeOf'], factory.actionType.AcceptAction>>(
|
|
73
|
+
attributes, options) {
|
|
72
74
|
const startDate = new Date();
|
|
73
75
|
const creatingAction = {
|
|
74
76
|
...attributes,
|
|
@@ -228,6 +230,27 @@ class ActionProcessRepo {
|
|
|
228
230
|
}
|
|
229
231
|
return doc;
|
|
230
232
|
}
|
|
233
|
+
async searchBySameAs(params) {
|
|
234
|
+
const projection = {
|
|
235
|
+
_id: 0,
|
|
236
|
+
id: { $toString: '$_id' },
|
|
237
|
+
actionStatus: 1,
|
|
238
|
+
error: 1,
|
|
239
|
+
purpose: 1
|
|
240
|
+
};
|
|
241
|
+
const query = this.actionModel.find({
|
|
242
|
+
typeOf: { $eq: params.typeOf.$eq },
|
|
243
|
+
'sameAs.id': { $exists: true, $eq: params.sameAs.id.$eq },
|
|
244
|
+
...(typeof params.purpose?.id.$eq === 'string')
|
|
245
|
+
? { 'purpose.id': { $exists: true, $eq: params.purpose.id.$eq } }
|
|
246
|
+
: undefined
|
|
247
|
+
}, projection)
|
|
248
|
+
// .select({ _id: 1, actionStatus: 1, error: 1, purpose: 1 })
|
|
249
|
+
.limit(1);
|
|
250
|
+
return query
|
|
251
|
+
.lean() // 2024-08-26~
|
|
252
|
+
.exec();
|
|
253
|
+
}
|
|
231
254
|
async findActionStatusById(params) {
|
|
232
255
|
const projection = {
|
|
233
256
|
_id: 0,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import * as factory from '../../factory';
|
|
2
|
-
import {
|
|
2
|
+
import { ActionProcessRepo } from './actionProcess';
|
|
3
3
|
export type IAuthorizeOfferAction = factory.action.authorize.offer.eventService.IAction;
|
|
4
4
|
/**
|
|
5
5
|
* オファー承認リポジトリ
|
|
6
6
|
*/
|
|
7
|
-
export declare class AuthorizeOfferActionRepo extends ActionProcessRepo<IAuthorizeOfferAction> {
|
|
7
|
+
export declare class AuthorizeOfferActionRepo extends ActionProcessRepo<IAuthorizeOfferAction, never> {
|
|
8
8
|
/**
|
|
9
9
|
* アクション再開
|
|
10
10
|
*/
|
|
11
11
|
reStart(params: {
|
|
12
12
|
typeOf: factory.actionType;
|
|
13
13
|
id: string;
|
|
14
|
-
recipe?:
|
|
14
|
+
recipe?: never;
|
|
15
15
|
}): Promise<void>;
|
|
16
16
|
reCompleteAuthorizeEventOfferAction(params: {
|
|
17
17
|
id: string;
|
|
@@ -53,10 +53,10 @@ class AuthorizeOfferActionRepo extends actionProcess_1.ActionProcessRepo {
|
|
|
53
53
|
if (doc === null) {
|
|
54
54
|
throw new factory.errors.NotFound(this.actionModel.modelName);
|
|
55
55
|
}
|
|
56
|
-
// add recipe(2024-06-09~)
|
|
57
|
-
if (params.recipe?.typeOf === 'Recipe') {
|
|
58
|
-
|
|
59
|
-
}
|
|
56
|
+
// // add recipe(2024-06-09~)
|
|
57
|
+
// if (params.recipe?.typeOf === 'Recipe') {
|
|
58
|
+
// await this.upsertRecipe({ ...params.recipe, recipeFor: { id: params.id, typeOf: params.typeOf } });
|
|
59
|
+
// }
|
|
60
60
|
}
|
|
61
61
|
async reCompleteAuthorizeEventOfferAction(params) {
|
|
62
62
|
return this.actionModel.findOneAndUpdate({
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { factory as surfrockFactory } from '@surfrock/sdk';
|
|
2
|
+
import * as factory from '../../factory';
|
|
3
|
+
import { ActionProcessRepo, IActionRecipe } from './actionProcess';
|
|
4
|
+
export type IMinimizedPurchaseNumberAuthResult = Pick<factory.action.check.paymentMethod.movieTicket.IPurchaseNumberAuthResult, 'mkknmiNumSum' | 'resultInfo' | 'ykknmiNumSum'> & {
|
|
5
|
+
knyknrNoInfoOut: Omit<factory.action.check.paymentMethod.movieTicket.IPurchaseNumberInfo, 'ykknInfo' | 'mkknInfo'>[] | null;
|
|
6
|
+
};
|
|
7
|
+
export type ICheckMovieTicketAction = factory.action.check.paymentMethod.movieTicket.IAction;
|
|
8
|
+
/**
|
|
9
|
+
* 決済カード認証アクションリポジトリ
|
|
10
|
+
*/
|
|
11
|
+
export declare class CheckMovieTicketActionRepo extends ActionProcessRepo<ICheckMovieTicketAction, IActionRecipe<factory.recipe.RecipeCategory.checkMovieTicket>> {
|
|
12
|
+
/**
|
|
13
|
+
* アクションIDからレシピのafterMediaを参照する
|
|
14
|
+
*/
|
|
15
|
+
findIMinimizedPurchaseNumberAuthResultByCheckMovieTicketRecipe(params: {
|
|
16
|
+
project: {
|
|
17
|
+
id: string;
|
|
18
|
+
};
|
|
19
|
+
recipeFor: {
|
|
20
|
+
id: string;
|
|
21
|
+
};
|
|
22
|
+
}): Promise<IMinimizedPurchaseNumberAuthResult | undefined>;
|
|
23
|
+
searchYkknInfoByCheckRecipe(filter: {
|
|
24
|
+
limit: number;
|
|
25
|
+
page: number;
|
|
26
|
+
/**
|
|
27
|
+
* 認証アクションID
|
|
28
|
+
*/
|
|
29
|
+
id: string;
|
|
30
|
+
project: {
|
|
31
|
+
id: string;
|
|
32
|
+
};
|
|
33
|
+
purpose: {
|
|
34
|
+
id: string;
|
|
35
|
+
};
|
|
36
|
+
}): Promise<(surfrockFactory.service.auth.purchaseNumberAuth.IValidTicket & {
|
|
37
|
+
knyknrNo: string;
|
|
38
|
+
})[]>;
|
|
39
|
+
searchMkknInfoByCheckRecipe(filter: {
|
|
40
|
+
limit: number;
|
|
41
|
+
page: number;
|
|
42
|
+
/**
|
|
43
|
+
* 認証アクションID
|
|
44
|
+
*/
|
|
45
|
+
id: string;
|
|
46
|
+
project: {
|
|
47
|
+
id: string;
|
|
48
|
+
};
|
|
49
|
+
purpose: {
|
|
50
|
+
id: string;
|
|
51
|
+
};
|
|
52
|
+
}): Promise<(surfrockFactory.service.auth.purchaseNumberAuth.INvalidTicket & {
|
|
53
|
+
knyknrNo: string;
|
|
54
|
+
})[]>;
|
|
55
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
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
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.CheckMovieTicketActionRepo = void 0;
|
|
27
|
+
const factory = __importStar(require("../../factory"));
|
|
28
|
+
const settings_1 = require("../../settings");
|
|
29
|
+
const actionProcess_1 = require("./actionProcess");
|
|
30
|
+
/**
|
|
31
|
+
* 決済カード認証アクションリポジトリ
|
|
32
|
+
*/
|
|
33
|
+
class CheckMovieTicketActionRepo extends actionProcess_1.ActionProcessRepo {
|
|
34
|
+
/**
|
|
35
|
+
* アクションIDからレシピのafterMediaを参照する
|
|
36
|
+
*/
|
|
37
|
+
async findIMinimizedPurchaseNumberAuthResultByCheckMovieTicketRecipe(params) {
|
|
38
|
+
const recipe = await this.actionRecipeModel.findOne({
|
|
39
|
+
'project.id': { $eq: params.project.id },
|
|
40
|
+
'recipeFor.id': { $eq: params.recipeFor.id }
|
|
41
|
+
}, {
|
|
42
|
+
project: 0,
|
|
43
|
+
typeOf: 0,
|
|
44
|
+
recipeCategory: 0,
|
|
45
|
+
recipeFor: 0,
|
|
46
|
+
dateCreated: 0,
|
|
47
|
+
dateModified: 0,
|
|
48
|
+
'step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.ykknInfo': 0,
|
|
49
|
+
'step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.mkknInfo': 0
|
|
50
|
+
}, { lean: true })
|
|
51
|
+
.exec();
|
|
52
|
+
return recipe?.step[0]?.itemListElement[0]?.itemListElement[0]?.afterMedia;
|
|
53
|
+
}
|
|
54
|
+
async searchYkknInfoByCheckRecipe(filter) {
|
|
55
|
+
const filterQuery = {
|
|
56
|
+
_id: { $eq: filter.id },
|
|
57
|
+
'project.id': { $eq: filter.project.id },
|
|
58
|
+
'purpose.id': { $exists: true, $eq: filter.purpose.id },
|
|
59
|
+
typeOf: { $eq: factory.actionType.CheckAction },
|
|
60
|
+
actionStatus: { $eq: factory.actionStatusType.CompletedActionStatus }
|
|
61
|
+
};
|
|
62
|
+
const actionDoc = await this.actionModel.findOne(filterQuery, { _id: 1 }, { lean: true })
|
|
63
|
+
.exec();
|
|
64
|
+
if (actionDoc === null) {
|
|
65
|
+
throw new factory.errors.NotFound(this.actionModel.modelName);
|
|
66
|
+
}
|
|
67
|
+
const filterQuery4recipe = {
|
|
68
|
+
'recipeFor.id': { $eq: filter.id }
|
|
69
|
+
};
|
|
70
|
+
const projectStage = {
|
|
71
|
+
_id: 0,
|
|
72
|
+
knyknrNo: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.knyknrNo',
|
|
73
|
+
ykknshTyp: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.ykknInfo.ykknshTyp',
|
|
74
|
+
eishhshkTyp: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.ykknInfo.eishhshkTyp',
|
|
75
|
+
ykknKnshbtsmiNum: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.ykknInfo.ykknKnshbtsmiNum',
|
|
76
|
+
knshknhmbiUnip: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.ykknInfo.knshknhmbiUnip',
|
|
77
|
+
kijUnip: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.ykknInfo.kijUnip'
|
|
78
|
+
};
|
|
79
|
+
const aggregate = this.actionRecipeModel.aggregate([
|
|
80
|
+
{ $unwind: '$step' },
|
|
81
|
+
{ $unwind: '$step.itemListElement' },
|
|
82
|
+
{ $unwind: '$step.itemListElement.itemListElement' },
|
|
83
|
+
{ $unwind: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut' },
|
|
84
|
+
{ $unwind: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.ykknInfo' },
|
|
85
|
+
{ $match: filterQuery4recipe },
|
|
86
|
+
{ $project: projectStage }
|
|
87
|
+
]);
|
|
88
|
+
if (typeof filter.limit === 'number' && filter.limit > 0) {
|
|
89
|
+
const page = (typeof filter.page === 'number' && filter.page > 0) ? filter.page : 1;
|
|
90
|
+
aggregate.limit(filter.limit * page)
|
|
91
|
+
.skip(filter.limit * (page - 1));
|
|
92
|
+
}
|
|
93
|
+
return aggregate
|
|
94
|
+
.option({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
95
|
+
.exec();
|
|
96
|
+
}
|
|
97
|
+
async searchMkknInfoByCheckRecipe(filter) {
|
|
98
|
+
const filterQuery = {
|
|
99
|
+
_id: { $eq: filter.id },
|
|
100
|
+
'project.id': { $eq: filter.project.id },
|
|
101
|
+
'purpose.id': { $exists: true, $eq: filter.purpose.id },
|
|
102
|
+
typeOf: { $eq: factory.actionType.CheckAction },
|
|
103
|
+
actionStatus: { $eq: factory.actionStatusType.CompletedActionStatus }
|
|
104
|
+
};
|
|
105
|
+
const actionDoc = this.actionModel.findOne(filterQuery, { _id: 1 }, { lean: true })
|
|
106
|
+
.exec();
|
|
107
|
+
if (actionDoc === null) {
|
|
108
|
+
throw new factory.errors.NotFound(this.actionModel.modelName);
|
|
109
|
+
}
|
|
110
|
+
const filterQuery4recipe = {
|
|
111
|
+
'recipeFor.id': { $eq: filter.id }
|
|
112
|
+
};
|
|
113
|
+
const projectStage = {
|
|
114
|
+
_id: 0,
|
|
115
|
+
knyknrNo: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.knyknrNo',
|
|
116
|
+
mkknshTyp: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.mkknInfo.mkknshTyp',
|
|
117
|
+
mkknKnshbtsmiNum: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.mkknInfo.mkknKnshbtsmiNum',
|
|
118
|
+
mkjyTyp: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.mkknInfo.mkjyTyp',
|
|
119
|
+
yykDt: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.mkknInfo.yykDt',
|
|
120
|
+
shyJeiDt: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.mkknInfo.shyJeiDt',
|
|
121
|
+
shyStCd: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.mkknInfo.shyStCd',
|
|
122
|
+
shyScrnCd: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.mkknInfo.shyScrnCd',
|
|
123
|
+
shySkhnCd: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.mkknInfo.shySkhnCd',
|
|
124
|
+
shySkhnNm: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.mkknInfo.shySkhnNm'
|
|
125
|
+
};
|
|
126
|
+
const aggregate = this.actionRecipeModel.aggregate([
|
|
127
|
+
{ $unwind: '$step' },
|
|
128
|
+
{ $unwind: '$step.itemListElement' },
|
|
129
|
+
{ $unwind: '$step.itemListElement.itemListElement' },
|
|
130
|
+
{ $unwind: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut' },
|
|
131
|
+
{ $unwind: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.mkknInfo' },
|
|
132
|
+
{ $match: filterQuery4recipe },
|
|
133
|
+
{ $project: projectStage }
|
|
134
|
+
]);
|
|
135
|
+
if (typeof filter.limit === 'number' && filter.limit > 0) {
|
|
136
|
+
const page = (typeof filter.page === 'number' && filter.page > 0) ? filter.page : 1;
|
|
137
|
+
aggregate.limit(filter.limit * page)
|
|
138
|
+
.skip(filter.limit * (page - 1));
|
|
139
|
+
}
|
|
140
|
+
return aggregate
|
|
141
|
+
.option({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
142
|
+
.exec();
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
exports.CheckMovieTicketActionRepo = CheckMovieTicketActionRepo;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as factory from '../../factory';
|
|
2
|
+
import { ActionProcessRepo } from './actionProcess';
|
|
3
|
+
export type ICheckThingAction = factory.action.check.thing.IAction;
|
|
4
|
+
/**
|
|
5
|
+
* 汎用リソース検証アクションリポジトリ
|
|
6
|
+
*/
|
|
7
|
+
export declare class CheckThingActionRepo extends ActionProcessRepo<ICheckThingAction, never> {
|
|
8
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CheckThingActionRepo = void 0;
|
|
4
|
+
// import { MONGO_MAX_TIME_MS } from '../settings';
|
|
5
|
+
// import { createSchema, IModel as IActionModel, modelName } from './mongoose/schemas/action';
|
|
6
|
+
// import { createSchema as createRecipeSchema, IModel as IActionRecipeModel, modelName as recipeModelName } from './mongoose/schemas/actionRecipe';
|
|
7
|
+
const actionProcess_1 = require("./actionProcess");
|
|
8
|
+
/**
|
|
9
|
+
* 汎用リソース検証アクションリポジトリ
|
|
10
|
+
*/
|
|
11
|
+
class CheckThingActionRepo extends actionProcess_1.ActionProcessRepo {
|
|
12
|
+
}
|
|
13
|
+
exports.CheckThingActionRepo = CheckThingActionRepo;
|
|
@@ -1,39 +1,17 @@
|
|
|
1
|
-
import { factory as surfrockFactory } from '@surfrock/sdk';
|
|
2
1
|
import { FilterQuery, UpdateQuery } from 'mongoose';
|
|
3
2
|
import * as factory from '../factory';
|
|
4
|
-
import { IKeyOfProjection, ActionProcessRepo } from './action/actionProcess';
|
|
3
|
+
import { IAction, IKeyOfProjection, ActionProcessRepo, ICancelActionAction, IActionRecipe } from './action/actionProcess';
|
|
5
4
|
export type IAction4transaction<T extends factory.actionType.AcceptAction | factory.actionType.AuthorizeAction> = T extends factory.actionType.AcceptAction ? factory.action.accept.coaOffer.IAction | factory.action.accept.pay.IAction : T extends factory.actionType.AuthorizeAction ? (factory.action.authorize.offer.eventService.IAction | factory.action.authorize.offer.moneyTransfer.IAction | factory.action.authorize.offer.product.IAction | factory.action.authorize.paymentMethod.any.IAction) : never;
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
agent: factory.action.IParticipantAsPerson | factory.action.IParticipantAsProject | factory.action.IParticipantAsWebApplication;
|
|
13
|
-
endTime: Date;
|
|
14
|
-
startTime: Date;
|
|
15
|
-
sameAs?: {
|
|
16
|
-
id: string;
|
|
17
|
-
typeOf: 'Task';
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
export type IActionRecipe<T extends factory.recipe.RecipeCategory> = T extends factory.recipe.RecipeCategory.checkMovieTicket ? factory.action.check.paymentMethod.movieTicket.IRecipe : T extends factory.recipe.RecipeCategory.payCreditCard ? factory.action.trade.pay.IPayCreditCardRecipe : T extends factory.recipe.RecipeCategory.payMovieTicket ? factory.action.trade.pay.IPayMovieTicketRecipe : T extends factory.recipe.RecipeCategory.publishPaymentUrl ? factory.action.accept.pay.IRecipe : T extends factory.recipe.RecipeCategory.refundCreditCard ? factory.action.trade.refund.IRefundCreditCardRecipe : T extends factory.recipe.RecipeCategory.refundMovieTicket ? factory.action.trade.refund.IRefundMovieTicketRecipe : T extends factory.recipe.RecipeCategory.acceptCOAOffer ? factory.action.accept.coaOffer.IRecipe : T extends factory.recipe.RecipeCategory.confirmCOAReserve ? factory.action.interact.confirm.reservation.IConfirmCOAReserveRecipe : never;
|
|
21
|
-
export type IRecipeAsDocument = factory.recipe.IRecipe & {
|
|
22
|
-
recipeFor: {
|
|
23
|
-
id: string;
|
|
24
|
-
typeOf: factory.actionType;
|
|
25
|
-
};
|
|
26
|
-
dateCreated: Date;
|
|
27
|
-
dateModified?: Date;
|
|
28
|
-
};
|
|
29
|
-
export type IRecipeAsActionAttributes = Pick<factory.recipe.IRecipe, 'project' | 'recipeCategory' | 'step' | 'typeOf'>;
|
|
30
|
-
export type IMinimizedPurchaseNumberAuthResult = Pick<factory.action.check.paymentMethod.movieTicket.IPurchaseNumberAuthResult, 'mkknmiNumSum' | 'resultInfo' | 'ykknmiNumSum'> & {
|
|
31
|
-
knyknrNoInfoOut: Omit<factory.action.check.paymentMethod.movieTicket.IPurchaseNumberInfo, 'ykknInfo' | 'mkknInfo'>[] | null;
|
|
32
|
-
};
|
|
5
|
+
export { ICancelActionAction };
|
|
6
|
+
/**
|
|
7
|
+
* 汎用アクションリポジトリで開始可能なアクションタイプ
|
|
8
|
+
*/
|
|
9
|
+
type StartableActionType = Exclude<factory.actionType, factory.actionType.AcceptAction | factory.actionType.CheckAction>;
|
|
10
|
+
type IAvailableActionRecipe = IActionRecipe<Exclude<factory.recipe.RecipeCategory, factory.recipe.RecipeCategory.publishPaymentUrl>>;
|
|
33
11
|
/**
|
|
34
12
|
* アクションリポジトリ
|
|
35
13
|
*/
|
|
36
|
-
export declare class ActionRepo extends ActionProcessRepo<
|
|
14
|
+
export declare class ActionRepo extends ActionProcessRepo<IAction<StartableActionType>, IAvailableActionRecipe> {
|
|
37
15
|
static CREATE_MONGO_CONDITIONS(params: factory.action.ISearchConditions): any[];
|
|
38
16
|
/**
|
|
39
17
|
* アクション検索
|
|
@@ -77,24 +55,6 @@ export declare class ActionRepo extends ActionProcessRepo<factory.action.IAction
|
|
|
77
55
|
orderNumber: string;
|
|
78
56
|
sort?: factory.action.ISortOrder;
|
|
79
57
|
}): Promise<IAction<factory.actionType>[]>;
|
|
80
|
-
searchBySameAs<T extends factory.actionType>(params: {
|
|
81
|
-
sameAs: {
|
|
82
|
-
id: {
|
|
83
|
-
$eq: string;
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
purpose?: {
|
|
87
|
-
id: {
|
|
88
|
-
$eq: string;
|
|
89
|
-
};
|
|
90
|
-
};
|
|
91
|
-
/**
|
|
92
|
-
* 1taskから複数actionが発生する可能性があるので、typeOf指定が必須
|
|
93
|
-
*/
|
|
94
|
-
typeOf: {
|
|
95
|
-
$eq: T;
|
|
96
|
-
};
|
|
97
|
-
}): Promise<Pick<IAction<T>, 'id' | 'actionStatus' | 'error' | 'purpose'>[]>;
|
|
98
58
|
deleteByProject(params: {
|
|
99
59
|
project: {
|
|
100
60
|
id: string;
|
|
@@ -112,38 +72,6 @@ export declare class ActionRepo extends ActionProcessRepo<factory.action.IAction
|
|
|
112
72
|
* イベントと入場ゲート指定で予約使用アクションを集計する
|
|
113
73
|
* discontinue(2024-12-26~)
|
|
114
74
|
*/
|
|
115
|
-
searchYkknInfoByCheckRecipe(filter: {
|
|
116
|
-
limit: number;
|
|
117
|
-
page: number;
|
|
118
|
-
/**
|
|
119
|
-
* 認証アクションID
|
|
120
|
-
*/
|
|
121
|
-
id: string;
|
|
122
|
-
project: {
|
|
123
|
-
id: string;
|
|
124
|
-
};
|
|
125
|
-
purpose: {
|
|
126
|
-
id: string;
|
|
127
|
-
};
|
|
128
|
-
}): Promise<(surfrockFactory.service.auth.purchaseNumberAuth.IValidTicket & {
|
|
129
|
-
knyknrNo: string;
|
|
130
|
-
})[]>;
|
|
131
|
-
searchMkknInfoByCheckRecipe(filter: {
|
|
132
|
-
limit: number;
|
|
133
|
-
page: number;
|
|
134
|
-
/**
|
|
135
|
-
* 認証アクションID
|
|
136
|
-
*/
|
|
137
|
-
id: string;
|
|
138
|
-
project: {
|
|
139
|
-
id: string;
|
|
140
|
-
};
|
|
141
|
-
purpose: {
|
|
142
|
-
id: string;
|
|
143
|
-
};
|
|
144
|
-
}): Promise<(surfrockFactory.service.auth.purchaseNumberAuth.INvalidTicket & {
|
|
145
|
-
knyknrNo: string;
|
|
146
|
-
})[]>;
|
|
147
75
|
/**
|
|
148
76
|
* 開始日時を一定期間過ぎたアクションを削除する
|
|
149
77
|
*/
|
|
@@ -174,14 +102,6 @@ export declare class ActionRepo extends ActionProcessRepo<factory.action.IAction
|
|
|
174
102
|
}): Promise<{
|
|
175
103
|
deletedCount?: number;
|
|
176
104
|
} | null>;
|
|
177
|
-
findIMinimizedPurchaseNumberAuthResultByCheckMovieTicketRecipe(params: {
|
|
178
|
-
project: {
|
|
179
|
-
id: string;
|
|
180
|
-
};
|
|
181
|
-
recipeFor: {
|
|
182
|
-
id: string;
|
|
183
|
-
};
|
|
184
|
-
}): Promise<IMinimizedPurchaseNumberAuthResult | undefined>;
|
|
185
105
|
getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, Omit<import("@chevre/factory/lib/action").IAction<import("@chevre/factory/lib/action").IAttributes<factory.actionType, any, any>>, "id"> & {
|
|
186
106
|
identifier?: string;
|
|
187
107
|
}> & Omit<import("@chevre/factory/lib/action").IAction<import("@chevre/factory/lib/action").IAttributes<factory.actionType, any, any>>, "id"> & {
|
|
@@ -836,27 +836,6 @@ class ActionRepo extends actionProcess_1.ActionProcessRepo {
|
|
|
836
836
|
.lean() // 2024-08-26~
|
|
837
837
|
.exec();
|
|
838
838
|
}
|
|
839
|
-
async searchBySameAs(params) {
|
|
840
|
-
const projection = {
|
|
841
|
-
_id: 0,
|
|
842
|
-
id: { $toString: '$_id' },
|
|
843
|
-
actionStatus: 1,
|
|
844
|
-
error: 1,
|
|
845
|
-
purpose: 1
|
|
846
|
-
};
|
|
847
|
-
const query = this.actionModel.find({
|
|
848
|
-
typeOf: { $eq: params.typeOf.$eq },
|
|
849
|
-
'sameAs.id': { $exists: true, $eq: params.sameAs.id.$eq },
|
|
850
|
-
...(typeof params.purpose?.id.$eq === 'string')
|
|
851
|
-
? { 'purpose.id': { $exists: true, $eq: params.purpose.id.$eq } }
|
|
852
|
-
: undefined
|
|
853
|
-
}, projection)
|
|
854
|
-
// .select({ _id: 1, actionStatus: 1, error: 1, purpose: 1 })
|
|
855
|
-
.limit(1);
|
|
856
|
-
return query
|
|
857
|
-
.lean() // 2024-08-26~
|
|
858
|
-
.exec();
|
|
859
|
-
}
|
|
860
839
|
async deleteByProject(params) {
|
|
861
840
|
await this.actionModel.deleteMany({
|
|
862
841
|
'project.id': { $eq: params.project.id }
|
|
@@ -968,96 +947,6 @@ class ActionRepo extends actionProcess_1.ActionProcessRepo {
|
|
|
968
947
|
// ])
|
|
969
948
|
// .exec();
|
|
970
949
|
// }
|
|
971
|
-
async searchYkknInfoByCheckRecipe(filter) {
|
|
972
|
-
const filterQuery = {
|
|
973
|
-
_id: { $eq: filter.id },
|
|
974
|
-
'project.id': { $eq: filter.project.id },
|
|
975
|
-
'purpose.id': { $exists: true, $eq: filter.purpose.id },
|
|
976
|
-
typeOf: { $eq: factory.actionType.CheckAction },
|
|
977
|
-
actionStatus: { $eq: factory.actionStatusType.CompletedActionStatus }
|
|
978
|
-
};
|
|
979
|
-
const actionDoc = await this.actionModel.findOne(filterQuery, { _id: 1 }, { lean: true })
|
|
980
|
-
.exec();
|
|
981
|
-
if (actionDoc === null) {
|
|
982
|
-
throw new factory.errors.NotFound(this.actionModel.modelName);
|
|
983
|
-
}
|
|
984
|
-
const filterQuery4recipe = {
|
|
985
|
-
'recipeFor.id': { $eq: filter.id }
|
|
986
|
-
};
|
|
987
|
-
const projectStage = {
|
|
988
|
-
_id: 0,
|
|
989
|
-
knyknrNo: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.knyknrNo',
|
|
990
|
-
ykknshTyp: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.ykknInfo.ykknshTyp',
|
|
991
|
-
eishhshkTyp: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.ykknInfo.eishhshkTyp',
|
|
992
|
-
ykknKnshbtsmiNum: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.ykknInfo.ykknKnshbtsmiNum',
|
|
993
|
-
knshknhmbiUnip: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.ykknInfo.knshknhmbiUnip',
|
|
994
|
-
kijUnip: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.ykknInfo.kijUnip'
|
|
995
|
-
};
|
|
996
|
-
const aggregate = this.actionRecipeModel.aggregate([
|
|
997
|
-
{ $unwind: '$step' },
|
|
998
|
-
{ $unwind: '$step.itemListElement' },
|
|
999
|
-
{ $unwind: '$step.itemListElement.itemListElement' },
|
|
1000
|
-
{ $unwind: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut' },
|
|
1001
|
-
{ $unwind: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.ykknInfo' },
|
|
1002
|
-
{ $match: filterQuery4recipe },
|
|
1003
|
-
{ $project: projectStage }
|
|
1004
|
-
]);
|
|
1005
|
-
if (typeof filter.limit === 'number' && filter.limit > 0) {
|
|
1006
|
-
const page = (typeof filter.page === 'number' && filter.page > 0) ? filter.page : 1;
|
|
1007
|
-
aggregate.limit(filter.limit * page)
|
|
1008
|
-
.skip(filter.limit * (page - 1));
|
|
1009
|
-
}
|
|
1010
|
-
return aggregate
|
|
1011
|
-
.option({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
1012
|
-
.exec();
|
|
1013
|
-
}
|
|
1014
|
-
async searchMkknInfoByCheckRecipe(filter) {
|
|
1015
|
-
const filterQuery = {
|
|
1016
|
-
_id: { $eq: filter.id },
|
|
1017
|
-
'project.id': { $eq: filter.project.id },
|
|
1018
|
-
'purpose.id': { $exists: true, $eq: filter.purpose.id },
|
|
1019
|
-
typeOf: { $eq: factory.actionType.CheckAction },
|
|
1020
|
-
actionStatus: { $eq: factory.actionStatusType.CompletedActionStatus }
|
|
1021
|
-
};
|
|
1022
|
-
const actionDoc = this.actionModel.findOne(filterQuery, { _id: 1 }, { lean: true })
|
|
1023
|
-
.exec();
|
|
1024
|
-
if (actionDoc === null) {
|
|
1025
|
-
throw new factory.errors.NotFound(this.actionModel.modelName);
|
|
1026
|
-
}
|
|
1027
|
-
const filterQuery4recipe = {
|
|
1028
|
-
'recipeFor.id': { $eq: filter.id }
|
|
1029
|
-
};
|
|
1030
|
-
const projectStage = {
|
|
1031
|
-
_id: 0,
|
|
1032
|
-
knyknrNo: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.knyknrNo',
|
|
1033
|
-
mkknshTyp: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.mkknInfo.mkknshTyp',
|
|
1034
|
-
mkknKnshbtsmiNum: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.mkknInfo.mkknKnshbtsmiNum',
|
|
1035
|
-
mkjyTyp: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.mkknInfo.mkjyTyp',
|
|
1036
|
-
yykDt: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.mkknInfo.yykDt',
|
|
1037
|
-
shyJeiDt: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.mkknInfo.shyJeiDt',
|
|
1038
|
-
shyStCd: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.mkknInfo.shyStCd',
|
|
1039
|
-
shyScrnCd: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.mkknInfo.shyScrnCd',
|
|
1040
|
-
shySkhnCd: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.mkknInfo.shySkhnCd',
|
|
1041
|
-
shySkhnNm: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.mkknInfo.shySkhnNm'
|
|
1042
|
-
};
|
|
1043
|
-
const aggregate = this.actionRecipeModel.aggregate([
|
|
1044
|
-
{ $unwind: '$step' },
|
|
1045
|
-
{ $unwind: '$step.itemListElement' },
|
|
1046
|
-
{ $unwind: '$step.itemListElement.itemListElement' },
|
|
1047
|
-
{ $unwind: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut' },
|
|
1048
|
-
{ $unwind: '$step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.mkknInfo' },
|
|
1049
|
-
{ $match: filterQuery4recipe },
|
|
1050
|
-
{ $project: projectStage }
|
|
1051
|
-
]);
|
|
1052
|
-
if (typeof filter.limit === 'number' && filter.limit > 0) {
|
|
1053
|
-
const page = (typeof filter.page === 'number' && filter.page > 0) ? filter.page : 1;
|
|
1054
|
-
aggregate.limit(filter.limit * page)
|
|
1055
|
-
.skip(filter.limit * (page - 1));
|
|
1056
|
-
}
|
|
1057
|
-
return aggregate
|
|
1058
|
-
.option({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
1059
|
-
.exec();
|
|
1060
|
-
}
|
|
1061
950
|
/**
|
|
1062
951
|
* 開始日時を一定期間過ぎたアクションを削除する
|
|
1063
952
|
*/
|
|
@@ -1157,23 +1046,6 @@ class ActionRepo extends actionProcess_1.ActionProcessRepo {
|
|
|
1157
1046
|
// // }
|
|
1158
1047
|
// // return result;
|
|
1159
1048
|
// }
|
|
1160
|
-
async findIMinimizedPurchaseNumberAuthResultByCheckMovieTicketRecipe(params) {
|
|
1161
|
-
const recipe = await this.actionRecipeModel.findOne({
|
|
1162
|
-
'project.id': { $eq: params.project.id },
|
|
1163
|
-
'recipeFor.id': { $eq: params.recipeFor.id }
|
|
1164
|
-
}, {
|
|
1165
|
-
project: 0,
|
|
1166
|
-
typeOf: 0,
|
|
1167
|
-
recipeCategory: 0,
|
|
1168
|
-
recipeFor: 0,
|
|
1169
|
-
dateCreated: 0,
|
|
1170
|
-
dateModified: 0,
|
|
1171
|
-
'step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.ykknInfo': 0,
|
|
1172
|
-
'step.itemListElement.itemListElement.afterMedia.knyknrNoInfoOut.mkknInfo': 0
|
|
1173
|
-
}, { lean: true })
|
|
1174
|
-
.exec();
|
|
1175
|
-
return recipe?.step[0]?.itemListElement[0]?.itemListElement[0]?.afterMedia;
|
|
1176
|
-
}
|
|
1177
1049
|
getCursor(conditions, projection) {
|
|
1178
1050
|
return this.actionModel.find(conditions, projection)
|
|
1179
1051
|
.sort({ startDate: factory.sortType.Descending })
|
|
@@ -10,6 +10,8 @@ import type { AccountTransactionRepo } from './repo/accountTransaction';
|
|
|
10
10
|
import type { ActionRepo } from './repo/action';
|
|
11
11
|
import type { AcceptCOAOfferActionRepo } from './repo/action/acceptCOAOffer';
|
|
12
12
|
import type { AuthorizeOfferActionRepo } from './repo/action/authorizeOffer';
|
|
13
|
+
import type { CheckMovieTicketActionRepo } from './repo/action/checkMovieTicket';
|
|
14
|
+
import type { CheckThingActionRepo } from './repo/action/checkThing';
|
|
13
15
|
import type { AdditionalPropertyRepo } from './repo/additionalProperty';
|
|
14
16
|
import type { AdvanceBookingRequirementRepo } from './repo/advanceBookingRequirement';
|
|
15
17
|
import type { AggregateActionRepo } from './repo/aggregateAction';
|
|
@@ -135,6 +137,14 @@ export declare namespace action {
|
|
|
135
137
|
namespace AuthorizeOffer {
|
|
136
138
|
function createInstance(...params: ConstructorParameters<typeof AuthorizeOfferActionRepo>): Promise<AuthorizeOfferActionRepo>;
|
|
137
139
|
}
|
|
140
|
+
type CheckMovieTicket = CheckMovieTicketActionRepo;
|
|
141
|
+
namespace CheckMovieTicket {
|
|
142
|
+
function createInstance(...params: ConstructorParameters<typeof CheckMovieTicketActionRepo>): Promise<CheckMovieTicketActionRepo>;
|
|
143
|
+
}
|
|
144
|
+
type CheckThing = CheckThingActionRepo;
|
|
145
|
+
namespace CheckThing {
|
|
146
|
+
function createInstance(...params: ConstructorParameters<typeof CheckThingActionRepo>): Promise<CheckThingActionRepo>;
|
|
147
|
+
}
|
|
138
148
|
}
|
|
139
149
|
export type AdditionalProperty = AdditionalPropertyRepo;
|
|
140
150
|
export declare namespace AdditionalProperty {
|
package/lib/chevre/repository.js
CHANGED
|
@@ -126,6 +126,28 @@ var action;
|
|
|
126
126
|
}
|
|
127
127
|
AuthorizeOffer.createInstance = createInstance;
|
|
128
128
|
})(AuthorizeOffer = action.AuthorizeOffer || (action.AuthorizeOffer = {}));
|
|
129
|
+
let CheckMovieTicket;
|
|
130
|
+
(function (CheckMovieTicket) {
|
|
131
|
+
let repo;
|
|
132
|
+
async function createInstance(...params) {
|
|
133
|
+
if (repo === undefined) {
|
|
134
|
+
repo = (await Promise.resolve().then(() => __importStar(require('./repo/action/checkMovieTicket')))).CheckMovieTicketActionRepo;
|
|
135
|
+
}
|
|
136
|
+
return new repo(...params);
|
|
137
|
+
}
|
|
138
|
+
CheckMovieTicket.createInstance = createInstance;
|
|
139
|
+
})(CheckMovieTicket = action.CheckMovieTicket || (action.CheckMovieTicket = {}));
|
|
140
|
+
let CheckThing;
|
|
141
|
+
(function (CheckThing) {
|
|
142
|
+
let repo;
|
|
143
|
+
async function createInstance(...params) {
|
|
144
|
+
if (repo === undefined) {
|
|
145
|
+
repo = (await Promise.resolve().then(() => __importStar(require('./repo/action/checkThing')))).CheckThingActionRepo;
|
|
146
|
+
}
|
|
147
|
+
return new repo(...params);
|
|
148
|
+
}
|
|
149
|
+
CheckThing.createInstance = createInstance;
|
|
150
|
+
})(CheckThing = action.CheckThing || (action.CheckThing = {}));
|
|
129
151
|
})(action || (exports.action = action = {}));
|
|
130
152
|
var AdditionalProperty;
|
|
131
153
|
(function (AdditionalProperty) {
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import * as factory from '../../../factory';
|
|
2
2
|
import { Settings } from '../../../settings';
|
|
3
|
-
import type {
|
|
3
|
+
import type { CheckMovieTicketActionRepo } from '../../../repo/action/checkMovieTicket';
|
|
4
4
|
import type { CredentialsRepo } from '../../../repo/credentials';
|
|
5
5
|
import type { EventRepo } from '../../../repo/event';
|
|
6
6
|
import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
7
7
|
import type { PaymentServiceProviderRepo } from '../../../repo/paymentServiceProvider';
|
|
8
8
|
import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccepted';
|
|
9
9
|
import * as MovieTicketPayment from '../../payment/movieTicket';
|
|
10
|
-
export
|
|
11
|
-
|
|
10
|
+
export interface ICheckRepos {
|
|
11
|
+
checkMovieTicketAction: CheckMovieTicketActionRepo;
|
|
12
12
|
credentials: CredentialsRepo;
|
|
13
13
|
event: EventRepo;
|
|
14
14
|
paymentAccepted: SellerPaymentAcceptedRepo;
|
|
15
15
|
paymentService: PaymentServiceRepo;
|
|
16
16
|
paymentServiceProvider: PaymentServiceProviderRepo;
|
|
17
|
-
}
|
|
17
|
+
}
|
|
18
|
+
export type ICheckOperation<T> = (repos: ICheckRepos, settings: Settings) => Promise<T>;
|
|
18
19
|
/**
|
|
19
20
|
* 決済方法認証
|
|
20
21
|
*/
|
|
@@ -2,21 +2,24 @@ import * as factory from '../../../factory';
|
|
|
2
2
|
import { Settings } from '../../../settings';
|
|
3
3
|
import type { AcceptedPaymentMethodRepo } from '../../../repo/acceptedPaymentMethod';
|
|
4
4
|
import type { ActionRepo } from '../../../repo/action';
|
|
5
|
+
import type { AcceptPayActionRepo } from '../../../repo/action/acceptPay';
|
|
5
6
|
import type { EventRepo } from '../../../repo/event';
|
|
6
7
|
import type { EventSeriesRepo } from '../../../repo/eventSeries';
|
|
7
8
|
import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
8
9
|
import type { PaymentServiceProviderRepo } from '../../../repo/paymentServiceProvider';
|
|
9
10
|
import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccepted';
|
|
10
11
|
import * as CreditCardPayment from '../../payment/creditCard';
|
|
11
|
-
export
|
|
12
|
+
export interface IPublishPaymentUrlRepos {
|
|
12
13
|
acceptedPaymentMethod: AcceptedPaymentMethodRepo;
|
|
13
14
|
action: ActionRepo;
|
|
15
|
+
acceptPayAction: AcceptPayActionRepo;
|
|
14
16
|
event: EventRepo;
|
|
15
17
|
eventSeries: EventSeriesRepo;
|
|
16
18
|
paymentAccepted: SellerPaymentAcceptedRepo;
|
|
17
19
|
paymentService: PaymentServiceRepo;
|
|
18
20
|
paymentServiceProvider: PaymentServiceProviderRepo;
|
|
19
|
-
}
|
|
21
|
+
}
|
|
22
|
+
export type IPublishPaymentUrlOperation<T> = (repos: IPublishPaymentUrlRepos, settings: Settings) => Promise<T>;
|
|
20
23
|
export type IPublishPaymentUrlResult = CreditCardPayment.IPaymentAgencyTransaction & {
|
|
21
24
|
paymentMethodId: string;
|
|
22
25
|
paymentUrl: string;
|
|
@@ -102,7 +102,7 @@ function publishPaymentUrl(params, options) {
|
|
|
102
102
|
: undefined,
|
|
103
103
|
...(typeof params.identifier === 'string') ? { identifier: params.identifier } : undefined
|
|
104
104
|
};
|
|
105
|
-
const action = await repos.
|
|
105
|
+
const action = await repos.acceptPayAction.start(actionAttributes);
|
|
106
106
|
let result;
|
|
107
107
|
let recipe;
|
|
108
108
|
try {
|
|
@@ -147,7 +147,7 @@ function publishPaymentUrl(params, options) {
|
|
|
147
147
|
}
|
|
148
148
|
catch (error) {
|
|
149
149
|
try {
|
|
150
|
-
await repos.
|
|
150
|
+
await repos.acceptPayAction.giveUp({ typeOf: actionAttributes.typeOf, id: action.id, error });
|
|
151
151
|
}
|
|
152
152
|
catch (__) {
|
|
153
153
|
// 失敗したら仕方ない
|
|
@@ -158,7 +158,7 @@ function publishPaymentUrl(params, options) {
|
|
|
158
158
|
paymentMethodId: result.paymentMethodId,
|
|
159
159
|
paymentUrl: result.paymentUrl
|
|
160
160
|
};
|
|
161
|
-
await repos.
|
|
161
|
+
await repos.acceptPayAction.completeWithVoid({ typeOf: actionAttributes.typeOf, id: action.id, result: actionResult, recipe });
|
|
162
162
|
return result;
|
|
163
163
|
};
|
|
164
164
|
}
|
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
import type * as COA from '@motionpicture/coa-service';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AcceptCOAOfferActionRepo } from '../../../repo/action/acceptCOAOffer';
|
|
3
|
+
import type { AuthorizeOfferActionRepo } from '../../../repo/action/authorizeOffer';
|
|
3
4
|
import type { EventRepo } from '../../../repo/event';
|
|
4
5
|
import type { OrderNumberRepo } from '../../../repo/orderNumber';
|
|
5
6
|
import type { ProjectRepo } from '../../../repo/project';
|
|
6
7
|
import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
|
|
7
8
|
import * as factory from '../../../factory';
|
|
8
9
|
interface IAcceptRepos {
|
|
9
|
-
action:
|
|
10
|
+
action: AcceptCOAOfferActionRepo;
|
|
11
|
+
event: EventRepo;
|
|
12
|
+
orderNumber: OrderNumberRepo;
|
|
13
|
+
project: ProjectRepo;
|
|
14
|
+
placeOrder: PlaceOrderRepo;
|
|
15
|
+
reserveService: COA.service.Reserve;
|
|
16
|
+
masterService: COA.service.Master;
|
|
17
|
+
}
|
|
18
|
+
interface IReAcceptRepos {
|
|
19
|
+
action: AcceptCOAOfferActionRepo;
|
|
20
|
+
authorizeOfferAction: AuthorizeOfferActionRepo;
|
|
10
21
|
event: EventRepo;
|
|
11
22
|
orderNumber: OrderNumberRepo;
|
|
12
23
|
project: ProjectRepo;
|
|
@@ -34,5 +45,5 @@ declare function reAcceptOffer(params: IAccepteOfferParams & {
|
|
|
34
45
|
*/
|
|
35
46
|
id: string;
|
|
36
47
|
};
|
|
37
|
-
}): (repos:
|
|
48
|
+
}): (repos: IReAcceptRepos) => Promise<void>;
|
|
38
49
|
export { acceptOffer, reAcceptOffer };
|
|
@@ -155,7 +155,7 @@ function reAcceptOffer(params) {
|
|
|
155
155
|
}
|
|
156
156
|
const coaInfo = await findCOAInfo({ id: params.object.event.id, project: { id: transaction.project.id } })(repos);
|
|
157
157
|
// 承認アクション存在検証
|
|
158
|
-
await repos.
|
|
158
|
+
await repos.authorizeOfferAction.findById({ id: params.potentialActions.id, typeOf: factory.actionType.AuthorizeAction }, ['id'], []);
|
|
159
159
|
const actionAttributes = {
|
|
160
160
|
project: transaction.project,
|
|
161
161
|
typeOf: factory.actionType.AcceptAction,
|
|
@@ -75,7 +75,7 @@ function authorizeByAcceptAction(params) {
|
|
|
75
75
|
}
|
|
76
76
|
else {
|
|
77
77
|
// recipe依存へ変更(2024-06-11~)
|
|
78
|
-
const recipe = await repos.
|
|
78
|
+
const recipe = await repos.accpetCOAOfferAction.findRecipeByAction({
|
|
79
79
|
project: { id: params.project.id },
|
|
80
80
|
recipeFor: { id: params.object.id }
|
|
81
81
|
});
|
|
@@ -135,7 +135,7 @@ function changeOffers(params) {
|
|
|
135
135
|
// authorizeAction.object.acceptedOffer = acceptedOffers; // discontinue acceptedOffers(2024-06-21~)
|
|
136
136
|
// recipe依存へ変更(2024-06-11~)
|
|
137
137
|
// const updTmpReserveSeatResult = authorizeAction.result?.responseBody;
|
|
138
|
-
const recipe = await repos.
|
|
138
|
+
const recipe = await repos.accpetCOAOfferAction.findRecipeByAction({
|
|
139
139
|
project: { id: transaction.project.id },
|
|
140
140
|
recipeFor: { id: originalAcceptActionId }
|
|
141
141
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as factory from '../../../factory';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AcceptCOAOfferActionRepo } from '../../../repo/action/acceptCOAOffer';
|
|
3
3
|
import type { TaskRepo } from '../../../repo/task';
|
|
4
4
|
interface IFindAcceptActionResult {
|
|
5
5
|
/**
|
|
@@ -35,7 +35,7 @@ declare function findAcceptAction(params: {
|
|
|
35
35
|
id: string;
|
|
36
36
|
};
|
|
37
37
|
}): (repos: {
|
|
38
|
-
action:
|
|
38
|
+
action: AcceptCOAOfferActionRepo;
|
|
39
39
|
task: TaskRepo;
|
|
40
40
|
}) => Promise<IFindAcceptActionResult>;
|
|
41
41
|
export { findAcceptAction };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as factory from '../../../factory';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AcceptPayActionRepo } from '../../../repo/action/acceptPay';
|
|
3
3
|
import type { TaskRepo } from '../../../repo/task';
|
|
4
4
|
interface IFindAcceptActionResult {
|
|
5
5
|
/**
|
|
@@ -37,7 +37,7 @@ declare function findAcceptAction(params: {
|
|
|
37
37
|
id: string;
|
|
38
38
|
};
|
|
39
39
|
}): (repos: {
|
|
40
|
-
|
|
40
|
+
acceptPayAction: AcceptPayActionRepo;
|
|
41
41
|
task: TaskRepo;
|
|
42
42
|
}) => Promise<IFindAcceptActionResult>;
|
|
43
43
|
export { findAcceptAction, };
|
|
@@ -55,7 +55,7 @@ function findAcceptAction(params) {
|
|
|
55
55
|
break;
|
|
56
56
|
default:
|
|
57
57
|
// タスクがReadyでなければアクション検索
|
|
58
|
-
const acceptAction = (await repos.
|
|
58
|
+
const acceptAction = (await repos.acceptPayAction.searchBySameAs({
|
|
59
59
|
sameAs: { id: { $eq: task.id } },
|
|
60
60
|
typeOf: { $eq: factory.actionType.AcceptAction }
|
|
61
61
|
// purpose: { id: { $eq: String(params.purpose.id) } }
|
|
@@ -65,7 +65,7 @@ function findAcceptAction(params) {
|
|
|
65
65
|
if (acceptAction.purpose?.id !== params.purpose.id) {
|
|
66
66
|
throw new factory.errors.NotFound('Action');
|
|
67
67
|
}
|
|
68
|
-
const acceptActionWithResult = await repos.
|
|
68
|
+
const acceptActionWithResult = await repos.acceptPayAction.findById({ id: acceptAction.id, typeOf: factory.actionType.AcceptAction }, ['result', 'object'], []);
|
|
69
69
|
action = {
|
|
70
70
|
id: acceptAction.id,
|
|
71
71
|
actionStatus: acceptAction.actionStatus,
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import * as factory from '../../../factory';
|
|
2
|
-
import type {
|
|
2
|
+
import type { CheckMovieTicketActionRepo, IMinimizedPurchaseNumberAuthResult } from '../../../repo/action/checkMovieTicket';
|
|
3
3
|
import type { TaskRepo } from '../../../repo/task';
|
|
4
|
+
interface IFindCheckActionRepos {
|
|
5
|
+
checkMovieTicketAction: CheckMovieTicketActionRepo;
|
|
6
|
+
task: TaskRepo;
|
|
7
|
+
}
|
|
4
8
|
interface IFindCheckActionResult {
|
|
5
9
|
/**
|
|
6
10
|
* アクションID
|
|
@@ -37,8 +41,5 @@ declare function findCheckAction(params: {
|
|
|
37
41
|
*/
|
|
38
42
|
id: string;
|
|
39
43
|
};
|
|
40
|
-
}): (repos:
|
|
41
|
-
|
|
42
|
-
task: TaskRepo;
|
|
43
|
-
}) => Promise<IFindCheckActionResult>;
|
|
44
|
-
export { findCheckAction, };
|
|
44
|
+
}): (repos: IFindCheckActionRepos) => Promise<IFindCheckActionResult>;
|
|
45
|
+
export { IFindCheckActionRepos, findCheckAction, };
|
|
@@ -55,7 +55,7 @@ function findCheckAction(params) {
|
|
|
55
55
|
break;
|
|
56
56
|
default:
|
|
57
57
|
// タスクがReadyでなければアクション検索
|
|
58
|
-
const authorizeAction = (await repos.
|
|
58
|
+
const authorizeAction = (await repos.checkMovieTicketAction.searchBySameAs({
|
|
59
59
|
sameAs: { id: { $eq: task.id } },
|
|
60
60
|
typeOf: { $eq: factory.actionType.CheckAction }
|
|
61
61
|
// purpose: { id: { $eq: String(params.purpose.id) } }
|
|
@@ -66,7 +66,7 @@ function findCheckAction(params) {
|
|
|
66
66
|
throw new factory.errors.NotFound('Action');
|
|
67
67
|
}
|
|
68
68
|
// result from recipe(2024-06-10~)
|
|
69
|
-
const purchaseNumberAuthResult = await repos.
|
|
69
|
+
const purchaseNumberAuthResult = await repos.checkMovieTicketAction.findIMinimizedPurchaseNumberAuthResultByCheckMovieTicketRecipe({
|
|
70
70
|
project: { id: params.project.id },
|
|
71
71
|
recipeFor: { id: authorizeAction.id }
|
|
72
72
|
});
|
|
@@ -2,6 +2,7 @@ import * as factory from '../../../factory';
|
|
|
2
2
|
import { Settings } from '../../../settings';
|
|
3
3
|
import type { AcceptedPaymentMethodRepo } from '../../../repo/acceptedPaymentMethod';
|
|
4
4
|
import type { ActionRepo } from '../../../repo/action';
|
|
5
|
+
import type { AcceptPayActionRepo } from '../../../repo/action/acceptPay';
|
|
5
6
|
import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
|
|
6
7
|
import type { AuthorizationRepo } from '../../../repo/authorization';
|
|
7
8
|
import type { EventRepo } from '../../../repo/event';
|
|
@@ -18,6 +19,7 @@ import * as PayTransactionService from '../../assetTransaction/pay';
|
|
|
18
19
|
interface IPublishPaymentUrlRepos {
|
|
19
20
|
acceptedPaymentMethod: AcceptedPaymentMethodRepo;
|
|
20
21
|
action: ActionRepo;
|
|
22
|
+
acceptPayAction: AcceptPayActionRepo;
|
|
21
23
|
assetTransaction: AssetTransactionRepo;
|
|
22
24
|
authorization: AuthorizationRepo;
|
|
23
25
|
event: EventRepo;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CheckMovieTicketActionRepo } from '../../../repo/action/checkMovieTicket';
|
|
2
2
|
import type { CredentialsRepo } from '../../../repo/credentials';
|
|
3
3
|
import type { EventRepo } from '../../../repo/event';
|
|
4
4
|
import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
@@ -8,7 +8,7 @@ import * as factory from '../../../factory';
|
|
|
8
8
|
import { Settings } from '../../../settings';
|
|
9
9
|
import { ICheckResult } from './processPurchaseNumberAuth';
|
|
10
10
|
interface ICheckOperationRepos {
|
|
11
|
-
|
|
11
|
+
checkMovieTicketAction: CheckMovieTicketActionRepo;
|
|
12
12
|
credentials: CredentialsRepo;
|
|
13
13
|
event: EventRepo;
|
|
14
14
|
paymentAccepted: SellerPaymentAcceptedRepo;
|
|
@@ -22,4 +22,4 @@ type ICheckOperation<T> = (repos: ICheckOperationRepos, settings: Settings) => P
|
|
|
22
22
|
declare function checkMovieTicket(params: factory.action.check.paymentMethod.movieTicket.IAttributes): ICheckOperation<{
|
|
23
23
|
result: ICheckResult;
|
|
24
24
|
}>;
|
|
25
|
-
export { checkMovieTicket };
|
|
25
|
+
export { ICheckOperationRepos, checkMovieTicket };
|
|
@@ -65,7 +65,7 @@ function checkMovieTicket(params) {
|
|
|
65
65
|
? { sameAs: { id: params.sameAs.id, typeOf: 'Task' } } // タスク関連付け(2024-05-21~)
|
|
66
66
|
: undefined
|
|
67
67
|
};
|
|
68
|
-
const action = await repos.
|
|
68
|
+
const action = await repos.checkMovieTicketAction.start(actionAttributes);
|
|
69
69
|
let processPurchaseNumberAuthResult;
|
|
70
70
|
let recipe;
|
|
71
71
|
try {
|
|
@@ -99,7 +99,7 @@ function checkMovieTicket(params) {
|
|
|
99
99
|
// アクション保管用のエラーと両方保管(2024-05-22~)
|
|
100
100
|
const errors = [(0, errorHandler_1.handleMvtkReserveError)(error), error];
|
|
101
101
|
try {
|
|
102
|
-
await repos.
|
|
102
|
+
await repos.checkMovieTicketAction.giveUp({ typeOf: actionAttributes.typeOf, id: action.id, error: errors });
|
|
103
103
|
}
|
|
104
104
|
catch (__) {
|
|
105
105
|
// 失敗したら仕方ない
|
|
@@ -107,7 +107,7 @@ function checkMovieTicket(params) {
|
|
|
107
107
|
throw errors[0];
|
|
108
108
|
}
|
|
109
109
|
const result = {};
|
|
110
|
-
await repos.
|
|
110
|
+
await repos.checkMovieTicketAction.completeWithVoid({ typeOf: actionAttributes.typeOf, id: action.id, result, recipe });
|
|
111
111
|
return { result: processPurchaseNumberAuthResult };
|
|
112
112
|
};
|
|
113
113
|
}
|
|
@@ -26,7 +26,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.call = call;
|
|
27
27
|
const COA = __importStar(require("@motionpicture/coa-service"));
|
|
28
28
|
const factory = __importStar(require("../../factory"));
|
|
29
|
-
|
|
29
|
+
// import { ActionRepo } from '../../repo/action';
|
|
30
|
+
const acceptCOAOffer_1 = require("../../repo/action/acceptCOAOffer");
|
|
31
|
+
const authorizeOffer_1 = require("../../repo/action/authorizeOffer");
|
|
30
32
|
const credentials_1 = require("../../repo/credentials");
|
|
31
33
|
const event_1 = require("../../repo/event");
|
|
32
34
|
const orderNumber_1 = require("../../repo/orderNumber");
|
|
@@ -76,7 +78,7 @@ function call(params) {
|
|
|
76
78
|
...(credentialsRepo !== undefined) ? { credentialsRepo } : undefined
|
|
77
79
|
});
|
|
78
80
|
}
|
|
79
|
-
const actionRepo = new
|
|
81
|
+
const actionRepo = new acceptCOAOffer_1.AcceptCOAOfferActionRepo(connection);
|
|
80
82
|
// const transactionProcessRepo = new TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
|
|
81
83
|
try {
|
|
82
84
|
const reserveService = new COA.service.Reserve({
|
|
@@ -103,6 +105,7 @@ function call(params) {
|
|
|
103
105
|
isMember
|
|
104
106
|
})({
|
|
105
107
|
action: actionRepo,
|
|
108
|
+
authorizeOfferAction: new authorizeOffer_1.AuthorizeOfferActionRepo(connection),
|
|
106
109
|
event: new event_1.EventRepo(connection),
|
|
107
110
|
orderNumber: new orderNumber_1.OrderNumberRepo({ connection }),
|
|
108
111
|
project: new project_1.ProjectRepo(connection),
|
|
@@ -25,7 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.call = call;
|
|
27
27
|
const factory = __importStar(require("../../factory"));
|
|
28
|
-
const
|
|
28
|
+
const checkMovieTicket_1 = require("../../repo/action/checkMovieTicket");
|
|
29
29
|
const credentials_1 = require("../../repo/credentials");
|
|
30
30
|
const event_1 = require("../../repo/event");
|
|
31
31
|
const paymentService_1 = require("../../repo/paymentService");
|
|
@@ -45,7 +45,7 @@ function call(params) {
|
|
|
45
45
|
if (!options.executeById) {
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
|
-
const actionRepo = new
|
|
48
|
+
const actionRepo = new checkMovieTicket_1.CheckMovieTicketActionRepo(connection);
|
|
49
49
|
// const transactionProcessRepo = new TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
|
|
50
50
|
const paymentServiceId = params.data.object[0]?.id;
|
|
51
51
|
const credentialsExpireInSeconds = settings.movieticketReserve.credentialsExpireInSeconds;
|
|
@@ -56,7 +56,7 @@ function call(params) {
|
|
|
56
56
|
...params.data,
|
|
57
57
|
sameAs: { id: params.id, typeOf: 'Task' }
|
|
58
58
|
})({
|
|
59
|
-
|
|
59
|
+
checkMovieTicketAction: actionRepo,
|
|
60
60
|
credentials: new credentials_1.CredentialsRepo(redisClient, {
|
|
61
61
|
scope: `${factory.service.paymentService.PaymentServiceType.MovieTicket}:${paymentServiceId}`,
|
|
62
62
|
expireInSeconds: (useCredentialsRepo) ? credentialsExpireInSeconds : 0
|
|
@@ -26,7 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.call = call;
|
|
27
27
|
const factory = __importStar(require("../../factory"));
|
|
28
28
|
const acceptedOffer_1 = require("../../repo/acceptedOffer");
|
|
29
|
-
const
|
|
29
|
+
const checkThing_1 = require("../../repo/action/checkThing");
|
|
30
30
|
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
31
31
|
const event_1 = require("../../repo/event");
|
|
32
32
|
const order_1 = require("../../repo/order");
|
|
@@ -43,7 +43,7 @@ function call(params) {
|
|
|
43
43
|
if (redisClient === undefined) {
|
|
44
44
|
throw new factory.errors.Argument('settings', 'redisClient required');
|
|
45
45
|
}
|
|
46
|
-
const actionRepo = new
|
|
46
|
+
const actionRepo = new checkThing_1.CheckThingActionRepo(connection);
|
|
47
47
|
const { data } = params;
|
|
48
48
|
const actionAttributes = {
|
|
49
49
|
agent: { id: params.project.id, typeOf: factory.organizationType.Project },
|
|
@@ -27,6 +27,7 @@ exports.call = call;
|
|
|
27
27
|
const factory = __importStar(require("../../factory"));
|
|
28
28
|
const acceptedPaymentMethod_1 = require("../../repo/acceptedPaymentMethod");
|
|
29
29
|
const action_1 = require("../../repo/action");
|
|
30
|
+
const acceptPay_1 = require("../../repo/action/acceptPay");
|
|
30
31
|
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
31
32
|
const authorization_1 = require("../../repo/authorization");
|
|
32
33
|
const event_1 = require("../../repo/event");
|
|
@@ -54,7 +55,7 @@ function call(params) {
|
|
|
54
55
|
if (!options.executeById) {
|
|
55
56
|
return;
|
|
56
57
|
}
|
|
57
|
-
const actionRepo = new
|
|
58
|
+
const actionRepo = new acceptPay_1.AcceptPayActionRepo(connection);
|
|
58
59
|
// const transactionProcessRepo = new TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
|
|
59
60
|
try {
|
|
60
61
|
await (0, any_1.publishPaymentUrl)({
|
|
@@ -63,7 +64,8 @@ function call(params) {
|
|
|
63
64
|
sameAs: { id: params.id }
|
|
64
65
|
})({
|
|
65
66
|
acceptedPaymentMethod: new acceptedPaymentMethod_1.AcceptedPaymentMethodRepo(connection),
|
|
66
|
-
action:
|
|
67
|
+
action: new action_1.ActionRepo(connection),
|
|
68
|
+
acceptPayAction: actionRepo,
|
|
67
69
|
assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
|
|
68
70
|
authorization: new authorization_1.AuthorizationRepo(connection),
|
|
69
71
|
event: new event_1.EventRepo(connection),
|
package/package.json
CHANGED