@chevre/domain 24.0.0-alpha.20 → 24.0.0-alpha.22
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/checkMovieTicket.d.ts +53 -35
- package/lib/chevre/repo/action/checkMovieTicket.js +1 -1
- package/lib/chevre/repo/action.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/validation.js +7 -0
- package/lib/chevre/service/task/pay.js +3 -1
- package/lib/chevre/service/task/payment/payByTask.d.ts +15 -12
- package/lib/chevre/service/task/payment/payByTask.js +1 -1
- package/package.json +1 -1
|
@@ -4,6 +4,57 @@ import { ActionProcessRepo, IActionRecipe } from './actionProcess';
|
|
|
4
4
|
export type IMinimizedPurchaseNumberAuthResult = Pick<factory.action.check.paymentMethod.movieTicket.IPurchaseNumberAuthResult, 'mkknmiNumSum' | 'resultInfo' | 'ykknmiNumSum'> & {
|
|
5
5
|
knyknrNoInfoOut: Omit<factory.action.check.paymentMethod.movieTicket.IPurchaseNumberInfo, 'ykknInfo' | 'mkknInfo'>[] | null;
|
|
6
6
|
};
|
|
7
|
+
/**
|
|
8
|
+
* アクションIDで参照、あるいは、決済カードコード+イベントIDで参照
|
|
9
|
+
*/
|
|
10
|
+
type IFindCompletedCheckActionsParams = ({
|
|
11
|
+
/**
|
|
12
|
+
* アクションID
|
|
13
|
+
*/
|
|
14
|
+
id?: string;
|
|
15
|
+
purpose?: {
|
|
16
|
+
/**
|
|
17
|
+
* 注文取引ID
|
|
18
|
+
*/
|
|
19
|
+
id?: string;
|
|
20
|
+
};
|
|
21
|
+
object?: never;
|
|
22
|
+
sort?: never;
|
|
23
|
+
}) | (Pick<factory.action.ISearchConditions, 'sort'> & {
|
|
24
|
+
purpose?: {
|
|
25
|
+
/**
|
|
26
|
+
* 注文取引ID
|
|
27
|
+
*/
|
|
28
|
+
id?: string;
|
|
29
|
+
};
|
|
30
|
+
object?: {
|
|
31
|
+
/**
|
|
32
|
+
* 決済サービス
|
|
33
|
+
*/
|
|
34
|
+
id?: {
|
|
35
|
+
$eq?: string;
|
|
36
|
+
};
|
|
37
|
+
movieTickets?: {
|
|
38
|
+
identifier?: {
|
|
39
|
+
$eq?: string;
|
|
40
|
+
};
|
|
41
|
+
serviceOutput?: {
|
|
42
|
+
reservationFor?: {
|
|
43
|
+
id?: {
|
|
44
|
+
$eq?: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
typeOf?: {
|
|
50
|
+
$eq?: factory.service.paymentService.PaymentServiceType.MovieTicket;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* アクションID
|
|
55
|
+
*/
|
|
56
|
+
id?: never;
|
|
57
|
+
});
|
|
7
58
|
export type ICheckMovieTicketAction = factory.action.check.paymentMethod.movieTicket.IAction;
|
|
8
59
|
/**
|
|
9
60
|
* 決済カード認証アクションリポジトリ
|
|
@@ -55,39 +106,6 @@ export declare class CheckMovieTicketActionRepo extends ActionProcessRepo<ICheck
|
|
|
55
106
|
/**
|
|
56
107
|
* 認証済アクション参照
|
|
57
108
|
*/
|
|
58
|
-
findCompletedCheckActions(params: Pick<
|
|
59
|
-
/**
|
|
60
|
-
* アクションID
|
|
61
|
-
*/
|
|
62
|
-
id?: string;
|
|
63
|
-
purpose?: {
|
|
64
|
-
/**
|
|
65
|
-
* 注文取引ID
|
|
66
|
-
*/
|
|
67
|
-
id?: string;
|
|
68
|
-
};
|
|
69
|
-
object?: {
|
|
70
|
-
/**
|
|
71
|
-
* 決済サービス
|
|
72
|
-
*/
|
|
73
|
-
id?: {
|
|
74
|
-
$eq?: string;
|
|
75
|
-
};
|
|
76
|
-
movieTickets?: {
|
|
77
|
-
identifier?: {
|
|
78
|
-
$eq?: string;
|
|
79
|
-
};
|
|
80
|
-
serviceOutput?: {
|
|
81
|
-
reservationFor?: {
|
|
82
|
-
id?: {
|
|
83
|
-
$eq?: string;
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
typeOf?: {
|
|
89
|
-
$eq?: factory.service.paymentService.PaymentServiceType.MovieTicket;
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
}): Promise<Pick<ICheckMovieTicketAction, 'id'>[]>;
|
|
109
|
+
findCompletedCheckActions(params: IFindCompletedCheckActionsParams): Promise<Pick<ICheckMovieTicketAction, 'id'>[]>;
|
|
93
110
|
}
|
|
111
|
+
export {};
|
|
@@ -193,7 +193,7 @@ class CheckMovieTicketActionRepo extends actionProcess_1.ActionProcessRepo {
|
|
|
193
193
|
// const explainResult = await (<any>query).explain();
|
|
194
194
|
// console.log(explainResult[0].executionStats.allPlansExecution.map((e: any) => e.executionStages.inputStage));
|
|
195
195
|
return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
196
|
-
.lean()
|
|
196
|
+
.lean()
|
|
197
197
|
.exec();
|
|
198
198
|
}
|
|
199
199
|
}
|
|
@@ -7,7 +7,7 @@ export { ICancelActionAction };
|
|
|
7
7
|
* 汎用アクションリポジトリで開始可能なアクションタイプ
|
|
8
8
|
*/
|
|
9
9
|
type StartableActionType = Exclude<factory.actionType, factory.actionType.AcceptAction | factory.actionType.CheckAction>;
|
|
10
|
-
type IAvailableActionRecipe = IActionRecipe<Exclude<factory.recipe.RecipeCategory, factory.recipe.RecipeCategory.publishPaymentUrl>>;
|
|
10
|
+
type IAvailableActionRecipe = IActionRecipe<Exclude<factory.recipe.RecipeCategory, factory.recipe.RecipeCategory.publishPaymentUrl | factory.recipe.RecipeCategory.checkMovieTicket>>;
|
|
11
11
|
/**
|
|
12
12
|
* アクションリポジトリ
|
|
13
13
|
*/
|
|
@@ -137,6 +137,10 @@ function checkByIdentifierIfNotYet(params) {
|
|
|
137
137
|
if (typeof placeOrderId === 'string') {
|
|
138
138
|
// no op
|
|
139
139
|
}
|
|
140
|
+
else {
|
|
141
|
+
// 注文取引IDの未指定ケースがあるかどうか確認するためにlog
|
|
142
|
+
console.log('checkByIdentifierIfNotYet: placeOrderId undefined. params:', JSON.stringify(params));
|
|
143
|
+
}
|
|
140
144
|
const specifiedCheckedActionId = params.checkedAction?.id;
|
|
141
145
|
if (typeof specifiedCheckedActionId === 'string' && specifiedCheckedActionId !== '') {
|
|
142
146
|
alreadyCheckedAction = (await repos.checkMovieTicketAction.findCompletedCheckActions({
|
|
@@ -153,6 +157,8 @@ function checkByIdentifierIfNotYet(params) {
|
|
|
153
157
|
}
|
|
154
158
|
}
|
|
155
159
|
else {
|
|
160
|
+
// 認証IDの未指定ケースがあるかどうか確認するためにlog
|
|
161
|
+
console.log('checkByIdentifierIfNotYet: specifiedCheckedActionId undefined. params:', JSON.stringify(params));
|
|
156
162
|
alreadyCheckedAction = (await repos.checkMovieTicketAction.findCompletedCheckActions({
|
|
157
163
|
// limit: 1,
|
|
158
164
|
// page: 1,
|
|
@@ -173,6 +179,7 @@ function checkByIdentifierIfNotYet(params) {
|
|
|
173
179
|
...(typeof placeOrderId === 'string') ? { purpose: { id: placeOrderId } } : undefined
|
|
174
180
|
})).shift();
|
|
175
181
|
}
|
|
182
|
+
debug('checkByIdentifierIfNotYet: alreadyCheckedAction:', JSON.stringify(alreadyCheckedAction), 'params:', JSON.stringify(params));
|
|
176
183
|
if (alreadyCheckedAction !== undefined) {
|
|
177
184
|
const recipe = await repos.checkMovieTicketAction.findRecipeByAction({
|
|
178
185
|
project: { id: params.screeningEvent.project.id },
|
|
@@ -28,6 +28,7 @@ const factory = __importStar(require("../../factory"));
|
|
|
28
28
|
const acceptedOffer_1 = require("../../repo/acceptedOffer");
|
|
29
29
|
const accountingReport_1 = require("../../repo/accountingReport");
|
|
30
30
|
const action_1 = require("../../repo/action");
|
|
31
|
+
const checkMovieTicket_1 = require("../../repo/action/checkMovieTicket");
|
|
31
32
|
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
32
33
|
const credentials_1 = require("../../repo/credentials");
|
|
33
34
|
const event_1 = require("../../repo/event");
|
|
@@ -51,7 +52,8 @@ function call(params) {
|
|
|
51
52
|
...params.data,
|
|
52
53
|
sameAs: { id: params.id, typeOf: 'Task' } // タスクIDを関連付け(2024-04-20~)
|
|
53
54
|
})({
|
|
54
|
-
action: new
|
|
55
|
+
// action: new ActionRepo(connection),
|
|
56
|
+
checkMovieTicketAction: new checkMovieTicket_1.CheckMovieTicketActionRepo(connection),
|
|
55
57
|
acceptedOffer: new acceptedOffer_1.AcceptedOfferRepo(connection),
|
|
56
58
|
assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
|
|
57
59
|
order: new order_1.OrderRepo(connection)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AcceptedOfferRepo } from '../../../repo/acceptedOffer';
|
|
2
2
|
import type { AccountingReportRepo } from '../../../repo/accountingReport';
|
|
3
3
|
import type { ActionRepo } from '../../../repo/action';
|
|
4
|
+
import type { CheckMovieTicketActionRepo } from '../../../repo/action/checkMovieTicket';
|
|
4
5
|
import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
|
|
5
6
|
import type { CredentialsRepo } from '../../../repo/credentials';
|
|
6
7
|
import type { EventRepo } from '../../../repo/event';
|
|
@@ -13,6 +14,12 @@ import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccep
|
|
|
13
14
|
import type { TaskRepo } from '../../../repo/task';
|
|
14
15
|
import * as factory from '../../../factory';
|
|
15
16
|
import { Settings } from '../../../settings';
|
|
17
|
+
interface IPayTask2payActionAttributesRepos {
|
|
18
|
+
checkMovieTicketAction: CheckMovieTicketActionRepo;
|
|
19
|
+
acceptedOffer: AcceptedOfferRepo;
|
|
20
|
+
assetTransaction: AssetTransactionRepo;
|
|
21
|
+
order: OrderRepo;
|
|
22
|
+
}
|
|
16
23
|
declare function payTask2payActionAttributes(params: factory.task.pay.IData & {
|
|
17
24
|
sameAs?: {
|
|
18
25
|
/**
|
|
@@ -21,16 +28,8 @@ declare function payTask2payActionAttributes(params: factory.task.pay.IData & {
|
|
|
21
28
|
id: string;
|
|
22
29
|
typeOf: 'Task';
|
|
23
30
|
};
|
|
24
|
-
}): (repos:
|
|
25
|
-
|
|
26
|
-
acceptedOffer: AcceptedOfferRepo;
|
|
27
|
-
assetTransaction: AssetTransactionRepo;
|
|
28
|
-
order: OrderRepo;
|
|
29
|
-
}) => Promise<factory.action.trade.pay.IAttributes>;
|
|
30
|
-
/**
|
|
31
|
-
* 決済確定
|
|
32
|
-
*/
|
|
33
|
-
declare function payByTask(payActionAttributes: factory.action.trade.pay.IAttributes): (repos: {
|
|
31
|
+
}): (repos: IPayTask2payActionAttributesRepos) => Promise<factory.action.trade.pay.IAttributes>;
|
|
32
|
+
interface IPayByTaskRepos {
|
|
34
33
|
acceptedOffer: AcceptedOfferRepo;
|
|
35
34
|
action: ActionRepo;
|
|
36
35
|
accountingReport: AccountingReportRepo;
|
|
@@ -44,5 +43,9 @@ declare function payByTask(payActionAttributes: factory.action.trade.pay.IAttrib
|
|
|
44
43
|
product: ProductRepo;
|
|
45
44
|
project: ProjectRepo;
|
|
46
45
|
task: TaskRepo;
|
|
47
|
-
}
|
|
48
|
-
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* 決済確定
|
|
49
|
+
*/
|
|
50
|
+
declare function payByTask(payActionAttributes: factory.action.trade.pay.IAttributes): (repos: IPayByTaskRepos, settings: Settings) => Promise<void>;
|
|
51
|
+
export { IPayTask2payActionAttributesRepos, IPayByTaskRepos, payByTask, payTask2payActionAttributes };
|
|
@@ -125,7 +125,7 @@ function payTask2payActionAttributes(params) {
|
|
|
125
125
|
let checkResult;
|
|
126
126
|
const checkedActionId = transaction.object.checkedAction?.id;
|
|
127
127
|
if (typeof checkedActionId === 'string' && checkedActionId !== '') {
|
|
128
|
-
const recipe = await repos.
|
|
128
|
+
const recipe = await repos.checkMovieTicketAction.findRecipeByAction({
|
|
129
129
|
project: { id: transaction.project.id },
|
|
130
130
|
recipeFor: { id: checkedActionId }
|
|
131
131
|
});
|
package/package.json
CHANGED