@chevre/domain 25.2.0-alpha.52 → 25.2.0-alpha.53
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.
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { factory } from '../../../factory';
|
|
2
2
|
import type { CheckMovieTicketActionRepo, IMinimizedPurchaseNumberAuthResult } from '../../../repo/action/checkMovieTicket';
|
|
3
|
+
import type { AsyncActionRepo } from '../../../repo/asyncAction';
|
|
3
4
|
import type { TaskRepo } from '../../../repo/task';
|
|
4
5
|
interface IFindCheckActionRepos {
|
|
5
6
|
checkMovieTicketAction: CheckMovieTicketActionRepo;
|
|
7
|
+
asyncAction: AsyncActionRepo;
|
|
6
8
|
task: TaskRepo;
|
|
7
9
|
}
|
|
8
10
|
interface IFindCheckActionResult {
|
|
@@ -41,5 +43,7 @@ declare function findCheckAction(params: {
|
|
|
41
43
|
*/
|
|
42
44
|
id: string;
|
|
43
45
|
};
|
|
46
|
+
}, options: {
|
|
47
|
+
useAsyncAction: boolean;
|
|
44
48
|
}): (repos: IFindCheckActionRepos) => Promise<IFindCheckActionResult>;
|
|
45
49
|
export { IFindCheckActionRepos, findCheckAction, };
|
|
@@ -2,16 +2,29 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.findCheckAction = findCheckAction;
|
|
4
4
|
const factory_1 = require("../../../factory");
|
|
5
|
-
function findCheckAction(params) {
|
|
5
|
+
function findCheckAction(params, options) {
|
|
6
6
|
return async (repos) => {
|
|
7
|
-
//
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
// 非同期アクションに対応(2026-07-28~)
|
|
8
|
+
const { useAsyncAction } = options;
|
|
9
|
+
let task;
|
|
10
|
+
if (useAsyncAction) {
|
|
11
|
+
// まず非同期アクションを参照
|
|
12
|
+
task = await repos.asyncAction.findAsyncActionById({
|
|
13
|
+
id: { $eq: params.sameAs.id },
|
|
14
|
+
project: { id: { $eq: params.project.id } },
|
|
15
|
+
name: factory_1.factory.taskName.CheckMovieTicket
|
|
16
|
+
}, ['status', 'executionResults']);
|
|
17
|
+
}
|
|
18
|
+
// 非同期アクションが存在しなければタスクを参照
|
|
19
|
+
if (task === undefined) {
|
|
20
|
+
task = (await repos.task.projectFields({
|
|
21
|
+
limit: 1,
|
|
22
|
+
page: 1,
|
|
23
|
+
id: { $eq: params.sameAs.id },
|
|
24
|
+
project: { id: { $eq: params.project.id } },
|
|
25
|
+
name: factory_1.factory.taskName.CheckMovieTicket
|
|
26
|
+
}, ['status', 'executionResults'])).shift();
|
|
27
|
+
}
|
|
15
28
|
if (task === undefined) {
|
|
16
29
|
throw new factory_1.factory.errors.NotFound(factory_1.factory.taskName.CheckMovieTicket);
|
|
17
30
|
}
|
package/package.json
CHANGED