@chevre/domain 26.0.0-alpha.13 → 26.0.0-alpha.15
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/eventEmitter/task.d.ts +5 -4
- package/lib/chevre/eventEmitter/task.js +2 -2
- package/lib/chevre/repo/adminTask.d.ts +12 -0
- package/lib/chevre/repo/adminTask.js +24 -0
- package/lib/chevre/repo/assetTransaction.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/task.js +4 -0
- package/lib/chevre/repo/scheduledTask.js +0 -21
- package/lib/chevre/repo/task.d.ts +1 -77
- package/lib/chevre/repo/task.js +3 -384
- package/lib/chevre/repo/taskDelayed.d.ts +67 -0
- package/lib/chevre/repo/taskDelayed.js +148 -0
- package/lib/chevre/repo/transaction.d.ts +9 -9
- package/lib/chevre/repository.d.ts +5 -10
- package/lib/chevre/repository.js +11 -22
- package/lib/chevre/service/asyncAction.d.ts +2 -2
- package/lib/chevre/service/asyncAction.js +2 -2
- package/lib/chevre/service/asyncActionHandler.d.ts +4 -4
- package/lib/chevre/service/asyncActionHandler.js +11 -13
- package/lib/chevre/service/order/confirmPayTransaction.js +4 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/processOrder.js +1 -1
- package/lib/chevre/service/project.d.ts +0 -3
- package/lib/chevre/service/project.js +0 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +1 -1
- package/lib/chevre/service/scheduledTask.js +1 -1
- package/lib/chevre/service/task/acceptCOAOffer.js +1 -14
- package/lib/chevre/service/task/authorizePayment.js +1 -7
- package/lib/chevre/service/task/checkMovieTicket.js +1 -7
- package/lib/chevre/service/task/confirmReserveTransaction.js +3 -1
- package/lib/chevre/service/task/publishPaymentUrl.js +1 -10
- package/lib/chevre/service/task/syncResourcesFromCOA.js +1 -5
- package/lib/chevre/service/task/voidReserveTransaction.js +5 -8
- package/lib/chevre/service/task.d.ts +3 -3
- package/lib/chevre/service/task.js +3 -3
- package/lib/chevre/service/taskHandler/onOperationFailed.d.ts +1 -2
- package/lib/chevre/service/taskHandler/onOperationFailed.js +8 -7
- package/lib/chevre/service/taskHandler.d.ts +1 -2
- package/lib/chevre/service/taskHandler.js +6 -5
- package/lib/chevre/taskSettings.d.ts +4 -2
- package/package.json +1 -1
- package/lib/chevre/repo/asyncActionLegacy.d.ts +0 -23
- package/lib/chevre/repo/asyncActionLegacy.js +0 -59
- package/lib/chevre/repo/scheduledTaskLegacy.d.ts +0 -39
- package/lib/chevre/repo/scheduledTaskLegacy.js +0 -96
|
@@ -73,7 +73,7 @@ export declare class TransactionRepo {
|
|
|
73
73
|
$in: factory.transactionStatusType[];
|
|
74
74
|
};
|
|
75
75
|
limit: number;
|
|
76
|
-
}): Promise<Pick<import("@chevre/factory/lib/chevre/transaction/placeOrder").ITransaction | import("@chevre/factory/lib/chevre/transaction/returnOrder").ITransaction, "id" | "
|
|
76
|
+
}): Promise<Pick<import("@chevre/factory/lib/chevre/transaction/placeOrder").ITransaction | import("@chevre/factory/lib/chevre/transaction/returnOrder").ITransaction, "id" | "status" | "typeOf">[]>;
|
|
77
77
|
/**
|
|
78
78
|
* set task status exported by transaction id
|
|
79
79
|
* IDでタスクをエクスポート済に変更する
|
|
@@ -133,16 +133,16 @@ export declare class TransactionRepo {
|
|
|
133
133
|
getCursor(conditions: any, projection: any, sort?: factory.sortType): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & (({
|
|
134
134
|
object: import("@chevre/factory/lib/chevre/transaction/placeOrder").IObject;
|
|
135
135
|
error?: any;
|
|
136
|
+
status: factory.transactionStatusType;
|
|
137
|
+
expires: Date;
|
|
136
138
|
project: import("@chevre/factory/lib/chevre/transaction").IProject;
|
|
137
139
|
seller: import("@chevre/factory/lib/chevre/transaction/placeOrder").ISeller;
|
|
138
140
|
typeOf: factory.transactionType.PlaceOrder;
|
|
139
|
-
expires: Date;
|
|
140
141
|
result?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IResult | undefined;
|
|
141
142
|
startDate: Date;
|
|
142
143
|
endDate?: Date | undefined;
|
|
143
144
|
instrument?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IInstrument | undefined;
|
|
144
145
|
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
145
|
-
status: factory.transactionStatusType;
|
|
146
146
|
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
147
147
|
potentialActions?: undefined;
|
|
148
148
|
} & {
|
|
@@ -152,16 +152,16 @@ export declare class TransactionRepo {
|
|
|
152
152
|
}) | ({
|
|
153
153
|
object: import("@chevre/factory/lib/chevre/transaction/returnOrder").IObject;
|
|
154
154
|
error?: any;
|
|
155
|
+
status: factory.transactionStatusType;
|
|
156
|
+
expires: Date;
|
|
155
157
|
project: import("@chevre/factory/lib/chevre/transaction").IProject;
|
|
156
158
|
seller: import("@chevre/factory/lib/chevre/transaction").ISeller;
|
|
157
159
|
typeOf: factory.transactionType.ReturnOrder;
|
|
158
|
-
expires: Date;
|
|
159
160
|
result?: import("@chevre/factory/lib/chevre/transaction/returnOrder").IResult | undefined;
|
|
160
161
|
startDate: Date;
|
|
161
162
|
endDate?: Date | undefined;
|
|
162
163
|
agent: import("@chevre/factory/lib/chevre/transaction").IAgent;
|
|
163
164
|
recipient?: undefined;
|
|
164
|
-
status: factory.transactionStatusType;
|
|
165
165
|
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
166
166
|
potentialActions?: import("@chevre/factory/lib/chevre/transaction/returnOrder").IPotentialActions | undefined;
|
|
167
167
|
} & {
|
|
@@ -171,16 +171,16 @@ export declare class TransactionRepo {
|
|
|
171
171
|
})), import("mongoose").QueryOptions<IDocType>, (import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & (({
|
|
172
172
|
object: import("@chevre/factory/lib/chevre/transaction/placeOrder").IObject;
|
|
173
173
|
error?: any;
|
|
174
|
+
status: factory.transactionStatusType;
|
|
175
|
+
expires: Date;
|
|
174
176
|
project: import("@chevre/factory/lib/chevre/transaction").IProject;
|
|
175
177
|
seller: import("@chevre/factory/lib/chevre/transaction/placeOrder").ISeller;
|
|
176
178
|
typeOf: factory.transactionType.PlaceOrder;
|
|
177
|
-
expires: Date;
|
|
178
179
|
result?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IResult | undefined;
|
|
179
180
|
startDate: Date;
|
|
180
181
|
endDate?: Date | undefined;
|
|
181
182
|
instrument?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IInstrument | undefined;
|
|
182
183
|
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
183
|
-
status: factory.transactionStatusType;
|
|
184
184
|
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
185
185
|
potentialActions?: undefined;
|
|
186
186
|
} & {
|
|
@@ -190,16 +190,16 @@ export declare class TransactionRepo {
|
|
|
190
190
|
}) | ({
|
|
191
191
|
object: import("@chevre/factory/lib/chevre/transaction/returnOrder").IObject;
|
|
192
192
|
error?: any;
|
|
193
|
+
status: factory.transactionStatusType;
|
|
194
|
+
expires: Date;
|
|
193
195
|
project: import("@chevre/factory/lib/chevre/transaction").IProject;
|
|
194
196
|
seller: import("@chevre/factory/lib/chevre/transaction").ISeller;
|
|
195
197
|
typeOf: factory.transactionType.ReturnOrder;
|
|
196
|
-
expires: Date;
|
|
197
198
|
result?: import("@chevre/factory/lib/chevre/transaction/returnOrder").IResult | undefined;
|
|
198
199
|
startDate: Date;
|
|
199
200
|
endDate?: Date | undefined;
|
|
200
201
|
agent: import("@chevre/factory/lib/chevre/transaction").IAgent;
|
|
201
202
|
recipient?: undefined;
|
|
202
|
-
status: factory.transactionStatusType;
|
|
203
203
|
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
204
204
|
potentialActions?: import("@chevre/factory/lib/chevre/transaction/returnOrder").IPotentialActions | undefined;
|
|
205
205
|
} & {
|
|
@@ -16,7 +16,6 @@ import type { CheckThingActionRepo } from './repo/action/checkThing';
|
|
|
16
16
|
import type { PayActionRepo } from './repo/action/pay';
|
|
17
17
|
import type { RefundActionRepo } from './repo/action/refund';
|
|
18
18
|
import type { AsyncActionRepo } from './repo/asyncAction';
|
|
19
|
-
import type { AsyncActionLegacyRepo } from './repo/asyncActionLegacy';
|
|
20
19
|
import type { AdditionalPropertyRepo } from './repo/additionalProperty';
|
|
21
20
|
import type { AdminAsyncActionRepo } from './repo/adminAsyncAction';
|
|
22
21
|
import type { AdminScheduledTaskRepo } from './repo/adminScheduledTask';
|
|
@@ -93,8 +92,8 @@ import type { RateLimitSettingRepo } from './repo/setting/rateLimit';
|
|
|
93
92
|
import type { WaiterSettingRepo } from './repo/setting/waiter';
|
|
94
93
|
import type { StockHolderRepo } from './repo/stockHolder';
|
|
95
94
|
import type { ScheduledTaskRepo } from './repo/scheduledTask';
|
|
96
|
-
import type { ScheduledTaskLegacyRepo } from './repo/scheduledTaskLegacy';
|
|
97
95
|
import type { TaskRepo } from './repo/task';
|
|
96
|
+
import type { TaskDelayedRepo } from './repo/taskDelayed';
|
|
98
97
|
import type { TicketRepo } from './repo/ticket';
|
|
99
98
|
import type { TransactionRepo } from './repo/transaction';
|
|
100
99
|
import type { PlaceOrderRepo } from './repo/transaction/placeOrder';
|
|
@@ -499,22 +498,18 @@ export type ScheduledTask = ScheduledTaskRepo;
|
|
|
499
498
|
export declare namespace ScheduledTask {
|
|
500
499
|
function createInstance(...params: ConstructorParameters<typeof ScheduledTaskRepo>): Promise<ScheduledTaskRepo>;
|
|
501
500
|
}
|
|
502
|
-
export type ScheduledTaskLegacy = ScheduledTaskLegacyRepo;
|
|
503
|
-
export declare namespace ScheduledTaskLegacy {
|
|
504
|
-
function createInstance(...params: ConstructorParameters<typeof ScheduledTaskLegacyRepo>): Promise<ScheduledTaskLegacyRepo>;
|
|
505
|
-
}
|
|
506
501
|
export type Task = TaskRepo;
|
|
507
502
|
export declare namespace Task {
|
|
508
503
|
function createInstance(...params: ConstructorParameters<typeof TaskRepo>): Promise<TaskRepo>;
|
|
509
504
|
}
|
|
505
|
+
export type TaskDelayed = TaskDelayedRepo;
|
|
506
|
+
export declare namespace TaskDelayed {
|
|
507
|
+
function createInstance(...params: ConstructorParameters<typeof TaskDelayedRepo>): Promise<TaskDelayedRepo>;
|
|
508
|
+
}
|
|
510
509
|
export type AsyncAction = AsyncActionRepo;
|
|
511
510
|
export declare namespace AsyncAction {
|
|
512
511
|
function createInstance(...params: ConstructorParameters<typeof AsyncActionRepo>): Promise<AsyncActionRepo>;
|
|
513
512
|
}
|
|
514
|
-
export type AsyncActionLegacy = AsyncActionLegacyRepo;
|
|
515
|
-
export declare namespace AsyncActionLegacy {
|
|
516
|
-
function createInstance(...params: ConstructorParameters<typeof AsyncActionLegacyRepo>): Promise<AsyncActionLegacyRepo>;
|
|
517
|
-
}
|
|
518
513
|
export type Ticket = TicketRepo;
|
|
519
514
|
export declare namespace Ticket {
|
|
520
515
|
function createInstance(...params: ConstructorParameters<typeof TicketRepo>): Promise<TicketRepo>;
|
package/lib/chevre/repository.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PaymentService = exports.Passport = exports.OwnershipInfo = exports.OrderNumber = exports.OrderInTransaction = exports.Order = exports.Offer = exports.OfferItemCondition = exports.OfferCatalogItem = exports.OfferCatalog = exports.NoteAboutOrder = exports.Note = exports.MovieTicketType = exports.Message = exports.MerchantReturnPolicy = exports.MemberProgram = exports.Member = exports.Issuer = exports.IdentityProvider = exports.Identity = exports.EventSeries = exports.EventSellerMakesOffer = exports.EventOffer = exports.Event = exports.EmailMessage = exports.CustomerType = exports.Customer = exports.Credentials = exports.CreativeWork = exports.ConfirmationNumber = exports.Authorization = exports.CategoryCode = exports.assetTransaction = exports.AssetTransaction = exports.Aggregation = exports.AggregateReservation = exports.AggregateOrder = exports.AggregateOffer = exports.AggregateTask = exports.AggregateScheduledTask = exports.AggregateAction = exports.AdminTask = exports.AdminScheduledTask = exports.AdminAsyncAction = exports.AdditionalProperty = exports.action = exports.Action = exports.AccountTitle = exports.AccountingReport = exports.AcceptedOffer = void 0;
|
|
4
|
-
exports.WebSite = exports.rateLimit = exports.TransactionProcess = exports.TransactionNumber = exports.transaction = exports.Transaction = exports.Ticket = exports.
|
|
4
|
+
exports.WebSite = exports.rateLimit = exports.TransactionProcess = exports.TransactionNumber = exports.transaction = exports.Transaction = exports.Ticket = exports.AsyncAction = exports.TaskDelayed = exports.Task = exports.ScheduledTask = exports.StockHolder = exports.setting = exports.Setting = exports.ServiceAvailableHour = exports.SellerReturnPolicy = exports.SellerPaymentAccepted = exports.SellerMakesOffer = exports.Seller = exports.Schedule = exports.Role = exports.ReserveInterface = exports.Reservation = exports.ProjectMakesOffer = exports.Project = exports.ProductHasOfferCatalog = exports.Product = exports.PriceSpecification = exports.PotentialAction = exports.place = exports.Person = exports.PendingReservation = exports.PaymentServiceProvider = exports.PaymentServiceChannel = void 0;
|
|
5
5
|
var AcceptedOffer;
|
|
6
6
|
(function (AcceptedOffer) {
|
|
7
7
|
let repo;
|
|
@@ -1044,17 +1044,6 @@ var ScheduledTask;
|
|
|
1044
1044
|
}
|
|
1045
1045
|
ScheduledTask.createInstance = createInstance;
|
|
1046
1046
|
})(ScheduledTask || (exports.ScheduledTask = ScheduledTask = {}));
|
|
1047
|
-
var ScheduledTaskLegacy;
|
|
1048
|
-
(function (ScheduledTaskLegacy) {
|
|
1049
|
-
let repo;
|
|
1050
|
-
async function createInstance(...params) {
|
|
1051
|
-
if (repo === undefined) {
|
|
1052
|
-
repo = (await import('./repo/scheduledTaskLegacy.js')).ScheduledTaskLegacyRepo;
|
|
1053
|
-
}
|
|
1054
|
-
return new repo(...params);
|
|
1055
|
-
}
|
|
1056
|
-
ScheduledTaskLegacy.createInstance = createInstance;
|
|
1057
|
-
})(ScheduledTaskLegacy || (exports.ScheduledTaskLegacy = ScheduledTaskLegacy = {}));
|
|
1058
1047
|
var Task;
|
|
1059
1048
|
(function (Task) {
|
|
1060
1049
|
let repo;
|
|
@@ -1066,28 +1055,28 @@ var Task;
|
|
|
1066
1055
|
}
|
|
1067
1056
|
Task.createInstance = createInstance;
|
|
1068
1057
|
})(Task || (exports.Task = Task = {}));
|
|
1069
|
-
var
|
|
1070
|
-
(function (
|
|
1058
|
+
var TaskDelayed;
|
|
1059
|
+
(function (TaskDelayed) {
|
|
1071
1060
|
let repo;
|
|
1072
1061
|
async function createInstance(...params) {
|
|
1073
1062
|
if (repo === undefined) {
|
|
1074
|
-
repo = (await import('./repo/
|
|
1063
|
+
repo = (await import('./repo/taskDelayed.js')).TaskDelayedRepo;
|
|
1075
1064
|
}
|
|
1076
1065
|
return new repo(...params);
|
|
1077
1066
|
}
|
|
1078
|
-
|
|
1079
|
-
})(
|
|
1080
|
-
var
|
|
1081
|
-
(function (
|
|
1067
|
+
TaskDelayed.createInstance = createInstance;
|
|
1068
|
+
})(TaskDelayed || (exports.TaskDelayed = TaskDelayed = {}));
|
|
1069
|
+
var AsyncAction;
|
|
1070
|
+
(function (AsyncAction) {
|
|
1082
1071
|
let repo;
|
|
1083
1072
|
async function createInstance(...params) {
|
|
1084
1073
|
if (repo === undefined) {
|
|
1085
|
-
repo = (await import('./repo/
|
|
1074
|
+
repo = (await import('./repo/asyncAction.js')).AsyncActionRepo;
|
|
1086
1075
|
}
|
|
1087
1076
|
return new repo(...params);
|
|
1088
1077
|
}
|
|
1089
|
-
|
|
1090
|
-
})(
|
|
1078
|
+
AsyncAction.createInstance = createInstance;
|
|
1079
|
+
})(AsyncAction || (exports.AsyncAction = AsyncAction = {}));
|
|
1091
1080
|
var Ticket;
|
|
1092
1081
|
(function (Ticket) {
|
|
1093
1082
|
let repo;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IExecuteSettings as IMinimumExecuteSettings,
|
|
1
|
+
import type { IExecuteSettings as IMinimumExecuteSettings, IAsyncActionNextFunction } from '../eventEmitter/task';
|
|
2
2
|
type IExecuteSettings = IMinimumExecuteSettings;
|
|
3
3
|
type IOperation<T> = (settings: IExecuteSettings) => Promise<T>;
|
|
4
4
|
declare function executeAsyncActionById(params: {
|
|
@@ -12,5 +12,5 @@ declare function executeAsyncActionById(params: {
|
|
|
12
12
|
*/
|
|
13
13
|
name: string;
|
|
14
14
|
};
|
|
15
|
-
}, next
|
|
15
|
+
}, next: IAsyncActionNextFunction): IOperation<void>;
|
|
16
16
|
export { executeAsyncActionById };
|
|
@@ -27,9 +27,9 @@ function executeAsyncActionById(params, next) {
|
|
|
27
27
|
}
|
|
28
28
|
// タスクがなければ終了
|
|
29
29
|
if (task !== null) {
|
|
30
|
-
await (0, asyncActionHandler_1.executeAsyncAction)(task,
|
|
30
|
+
await (0, asyncActionHandler_1.executeAsyncAction)(task, next)(settings, {
|
|
31
31
|
executeById: true,
|
|
32
|
-
executeByName: false
|
|
32
|
+
// executeByName: false // discontinue(2026-08-05~)
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { IAsyncActionNextFunction } from '../eventEmitter/task';
|
|
2
|
+
import type { ICallableTaskOperation, IOperationExecute } from '../taskSettings';
|
|
3
3
|
import type { IExecutableAsyncAction } from '../repo/asyncAction';
|
|
4
4
|
export declare const taskLoader: {
|
|
5
5
|
load: (taskName: string) => Promise<{
|
|
@@ -9,5 +9,5 @@ export declare const taskLoader: {
|
|
|
9
9
|
/**
|
|
10
10
|
* 非同期アクションを実行する
|
|
11
11
|
*/
|
|
12
|
-
declare function executeAsyncAction(task: IExecutableAsyncAction, next
|
|
13
|
-
export {
|
|
12
|
+
declare function executeAsyncAction(task: IExecutableAsyncAction, next: IAsyncActionNextFunction): IOperationExecute<void>;
|
|
13
|
+
export { executeAsyncAction };
|
|
@@ -5,11 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.taskLoader = void 0;
|
|
7
7
|
exports.executeAsyncAction = executeAsyncAction;
|
|
8
|
-
const debug_1 = __importDefault(require("debug"));
|
|
9
8
|
const moment_1 = __importDefault(require("moment"));
|
|
10
9
|
const factory_1 = require("../factory");
|
|
11
10
|
const onOperationFailed_1 = require("./asyncActionHandler/onOperationFailed");
|
|
12
|
-
const debug = (0, debug_1.default)('chevre-domain:service:asyncActionHandler');
|
|
13
11
|
exports.taskLoader = {
|
|
14
12
|
load: (taskName) => {
|
|
15
13
|
return import(`./task/${taskName}.js`);
|
|
@@ -20,10 +18,9 @@ exports.taskLoader = {
|
|
|
20
18
|
*/
|
|
21
19
|
function executeAsyncAction(task, next) {
|
|
22
20
|
const now = new Date();
|
|
23
|
-
debug('executing an executableTask...', task, now);
|
|
24
21
|
return async (settings, options) => {
|
|
25
22
|
const asyncActionRepo = new (await import('../repo/asyncAction.js')).AsyncActionRepo(settings.connection);
|
|
26
|
-
let
|
|
23
|
+
let taskAsNextFunctionParam;
|
|
27
24
|
try {
|
|
28
25
|
// 期限検証(2024-04-23~)
|
|
29
26
|
if (task.expires instanceof Date) {
|
|
@@ -57,32 +54,33 @@ function executeAsyncAction(task, next) {
|
|
|
57
54
|
status: factory_1.factory.taskStatus.Executed,
|
|
58
55
|
executionResult: result
|
|
59
56
|
});
|
|
60
|
-
|
|
57
|
+
taskAsNextFunctionParam = {
|
|
61
58
|
id: task.id,
|
|
62
|
-
remainingNumberOfTries: 0, // one timeの前提なのでひとまず固定で0
|
|
63
59
|
name: task.name,
|
|
64
60
|
status: factory_1.factory.taskStatus.Executed,
|
|
65
|
-
executionResult: result
|
|
66
61
|
};
|
|
67
62
|
}
|
|
68
63
|
catch (error) {
|
|
69
64
|
const onOperationFailedResult = await (0, onOperationFailed_1.onOperationFailed)({
|
|
70
65
|
task, now, error,
|
|
71
66
|
})({ asyncAction: asyncActionRepo });
|
|
72
|
-
|
|
67
|
+
taskAsNextFunctionParam = {
|
|
68
|
+
id: onOperationFailedResult.executedTask.id,
|
|
69
|
+
name: onOperationFailedResult.executedTask.name,
|
|
70
|
+
status: onOperationFailedResult.executedTask.status
|
|
71
|
+
};
|
|
72
|
+
;
|
|
73
73
|
}
|
|
74
74
|
finally {
|
|
75
75
|
if (typeof next === 'function') {
|
|
76
|
-
if (
|
|
77
|
-
|
|
76
|
+
if (taskAsNextFunctionParam === undefined) {
|
|
77
|
+
taskAsNextFunctionParam = {
|
|
78
78
|
id: task.id,
|
|
79
|
-
remainingNumberOfTries: 0, // one timeの前提なのでひとまず固定で0
|
|
80
79
|
name: task.name,
|
|
81
80
|
status: factory_1.factory.taskStatus.Aborted,
|
|
82
|
-
executionResult: {} // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
83
81
|
};
|
|
84
82
|
}
|
|
85
|
-
await next(
|
|
83
|
+
await next(taskAsNextFunctionParam)(settings);
|
|
86
84
|
}
|
|
87
85
|
}
|
|
88
86
|
};
|
|
@@ -34,6 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.confirmPayTransaction = confirmPayTransaction;
|
|
37
|
+
const util_1 = require("util");
|
|
37
38
|
const factory_1 = require("../../factory");
|
|
38
39
|
// import type { TransactionRepo } from '../../repo/transaction';
|
|
39
40
|
const PayTransactionService = __importStar(require("../assetTransaction/pay"));
|
|
@@ -112,7 +113,9 @@ function onConfirmed(params) {
|
|
|
112
113
|
},
|
|
113
114
|
useOnOrderStatusChanged: params.useOnOrderStatusChanged === true
|
|
114
115
|
};
|
|
116
|
+
const taskIdentifier = (0, util_1.format)('%s:%s:%s:%s', params.project.id, factory_1.factory.taskName.OnAssetTransactionStatusChanged, onAssetTransactionStatusChangedTaskData.purpose.orderNumber, onAssetTransactionStatusChangedTaskData.object.transactionNumber);
|
|
115
117
|
const onAssetTransactionStatusChangedTask = {
|
|
118
|
+
identifier: taskIdentifier,
|
|
116
119
|
project: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project },
|
|
117
120
|
name: factory_1.factory.taskName.OnAssetTransactionStatusChanged,
|
|
118
121
|
status: factory_1.factory.taskStatus.Ready,
|
|
@@ -122,7 +125,7 @@ function onConfirmed(params) {
|
|
|
122
125
|
executionResults: [],
|
|
123
126
|
data: onAssetTransactionStatusChangedTaskData
|
|
124
127
|
};
|
|
125
|
-
await repos.task.
|
|
128
|
+
await repos.task.runTaskByIdentifier(onAssetTransactionStatusChangedTask);
|
|
126
129
|
}
|
|
127
130
|
}
|
|
128
131
|
};
|
|
@@ -62,7 +62,7 @@ function createSendOrderTaskIfNotExist(params) {
|
|
|
62
62
|
};
|
|
63
63
|
const taskIdentifier = `${sendOrderTaskData.project.id}:${factory_1.factory.taskName.SendOrder}:${sendOrderTaskData.object.typeOf}:${sendOrderTaskData.object.orderNumber}`;
|
|
64
64
|
const sendOrderTask = {
|
|
65
|
-
alternateName: taskIdentifier,
|
|
65
|
+
// alternateName: taskIdentifier,
|
|
66
66
|
identifier: taskIdentifier,
|
|
67
67
|
project: params.order.project,
|
|
68
68
|
name: factory_1.factory.taskName.SendOrder,
|
|
@@ -92,7 +92,7 @@ function createOnAuthorizationCreatedTask(order) {
|
|
|
92
92
|
const taskRunsAt = new Date();
|
|
93
93
|
const taskIdentifier = `${order.project.id}:${factory_1.factory.taskName.OnAuthorizationCreated}:${factory_1.factory.transactionType.PlaceOrder}:${placeOrderTransaction?.id}`;
|
|
94
94
|
const task = {
|
|
95
|
-
alternateName: taskIdentifier,
|
|
95
|
+
// alternateName: taskIdentifier,
|
|
96
96
|
identifier: taskIdentifier,
|
|
97
97
|
name: factory_1.factory.taskName.OnAuthorizationCreated,
|
|
98
98
|
status: factory_1.factory.taskStatus.Ready,
|
|
@@ -53,7 +53,7 @@ function createConfirmPayTransactionTasks(order, simpleOrder) {
|
|
|
53
53
|
};
|
|
54
54
|
const taskIdentifier = (0, util_1.format)('%s:%s:%s:%s:%s:%s', order.project.id, factory_1.factory.taskName.ConfirmPayTransaction, data.purpose.typeOf, data.purpose.orderNumber, factory_1.factory.assetTransactionType.Pay, invoice.paymentMethodId);
|
|
55
55
|
const confirmPayTransactionTask = {
|
|
56
|
-
alternateName: taskIdentifier,
|
|
56
|
+
// alternateName: taskIdentifier,
|
|
57
57
|
identifier: taskIdentifier,
|
|
58
58
|
project: order.project,
|
|
59
59
|
name: factory_1.factory.taskName.ConfirmPayTransaction,
|
|
@@ -48,7 +48,7 @@ function createSendEmailMessageTaskIfNotExist(params) {
|
|
|
48
48
|
purpose: simpleOrder
|
|
49
49
|
};
|
|
50
50
|
const sendEmailMessageTask = {
|
|
51
|
-
alternateName: taskIdentifier,
|
|
51
|
+
// alternateName: taskIdentifier,
|
|
52
52
|
identifier: taskIdentifier,
|
|
53
53
|
project: params.order.project,
|
|
54
54
|
name: factory_1.factory.taskName.SendEmailMessage,
|
|
@@ -6,7 +6,7 @@ type IProcessingOrder = Pick<factory.order.IOrder, 'id' | 'orderNumber' | 'broke
|
|
|
6
6
|
orderStatus: factory.orderStatus.OrderProcessing;
|
|
7
7
|
};
|
|
8
8
|
type ICreatingCheckResourceTask = Pick<factory.task.checkResource.IAttributes, 'alternateName' | 'data' | 'executionResults' | 'identifier' | 'name' | 'numberOfTried' | 'project' | 'remainingNumberOfTries' | 'runsAt' | 'status'> & {
|
|
9
|
-
alternateName
|
|
9
|
+
alternateName?: never;
|
|
10
10
|
identifier: string;
|
|
11
11
|
};
|
|
12
12
|
type ICreatingInformProcessingOrderTask = Pick<factory.task.IAttributes<factory.taskName.TriggerWebhook>, 'data' | 'executionResults' | 'name' | 'numberOfTried' | 'project' | 'remainingNumberOfTries' | 'runsAt' | 'status'>;
|
|
@@ -142,7 +142,7 @@ function createCheckResourceTask(order) {
|
|
|
142
142
|
};
|
|
143
143
|
const taskIdentifier = (0, util_1.format)('%s:%s:%s:%s', order.project.id, factory_1.factory.taskName.CheckResource, order.typeOf, order.orderNumber);
|
|
144
144
|
return {
|
|
145
|
-
alternateName: taskIdentifier, // add identifier(2025-03-29~)
|
|
145
|
+
// alternateName: taskIdentifier, // add identifier(2025-03-29~)
|
|
146
146
|
identifier: taskIdentifier, // add identifier(2025-03-29~)
|
|
147
147
|
project: order.project,
|
|
148
148
|
name: factory_1.factory.taskName.CheckResource,
|
|
@@ -50,7 +50,7 @@ function createConfirmReserveTransactionTasksIfNotExist(order, simpleOrder, opti
|
|
|
50
50
|
};
|
|
51
51
|
const taskIdentifier = (0, util_1.format)('%s:%s:%s:%s:%s:%s', order.project.id, factory_1.factory.taskName.ConfirmReserveTransaction, data.purpose.typeOf, data.purpose.orderNumber, data.object.typeOf, data.object.transactionNumber);
|
|
52
52
|
const confirmReserveTransactionTask = {
|
|
53
|
-
alternateName: taskIdentifier,
|
|
53
|
+
// alternateName: taskIdentifier,
|
|
54
54
|
identifier: taskIdentifier,
|
|
55
55
|
project: order.project,
|
|
56
56
|
name: factory_1.factory.taskName.ConfirmReserveTransaction,
|
|
@@ -18,7 +18,6 @@ import type { ProductRepo } from '../repo/product';
|
|
|
18
18
|
import type { ProjectRepo } from '../repo/project';
|
|
19
19
|
import type { ReservationRepo } from '../repo/reservation';
|
|
20
20
|
import type { SellerRepo } from '../repo/seller';
|
|
21
|
-
import type { TaskRepo } from '../repo/task';
|
|
22
21
|
export declare function deleteProject(params: {
|
|
23
22
|
id: string;
|
|
24
23
|
}): (repos: {
|
|
@@ -38,7 +37,6 @@ export declare function deleteProject(params: {
|
|
|
38
37
|
movieTheater: MovieTheaterRepo;
|
|
39
38
|
screeningRoom: ScreeningRoomRepo;
|
|
40
39
|
seller: SellerRepo;
|
|
41
|
-
task: TaskRepo;
|
|
42
40
|
assetTransaction: AssetTransactionRepo;
|
|
43
41
|
}) => Promise<void>;
|
|
44
42
|
export declare function cleanUpDatabaseByProject(params: {
|
|
@@ -59,5 +57,4 @@ export declare function cleanUpDatabaseByProject(params: {
|
|
|
59
57
|
movieTheater: MovieTheaterRepo;
|
|
60
58
|
screeningRoom: ScreeningRoomRepo;
|
|
61
59
|
seller: SellerRepo;
|
|
62
|
-
task: TaskRepo;
|
|
63
60
|
}) => Promise<void>;
|
|
@@ -26,6 +26,5 @@ function cleanUpDatabaseByProject(params) {
|
|
|
26
26
|
await repos.product.deleteByProject({ project: { id: params.id } });
|
|
27
27
|
await repos.reservation.deleteByProject({ project: { id: params.id } });
|
|
28
28
|
await repos.seller.deleteByProject({ project: { id: params.id } });
|
|
29
|
-
await repos.task.deleteByProject({ project: { id: params.id } });
|
|
30
29
|
};
|
|
31
30
|
}
|
|
@@ -42,7 +42,7 @@ function onReservationConfirmed(confirmedReservations, reserveAction) {
|
|
|
42
42
|
// );
|
|
43
43
|
const taskIdentifier = `${project.id}:${factory_1.factory.taskName.OnAuthorizationCreated}:${factory_1.factory.assetTransactionType.Reserve}:${reservationNumber}:onReservationConfirmed`;
|
|
44
44
|
onAuthorizationCreatedTask = {
|
|
45
|
-
alternateName: taskIdentifier,
|
|
45
|
+
// alternateName: taskIdentifier,
|
|
46
46
|
identifier: taskIdentifier,
|
|
47
47
|
name: factory_1.factory.taskName.OnAuthorizationCreated,
|
|
48
48
|
status: factory_1.factory.taskStatus.Ready,
|
|
@@ -33,7 +33,7 @@ function executeScheduledTaskById(params) {
|
|
|
33
33
|
if (task !== null) {
|
|
34
34
|
await (0, scheduledTaskHandler_1.executeScheduledTask)(task)(settings, {
|
|
35
35
|
executeById: true,
|
|
36
|
-
executeByName: false
|
|
36
|
+
// executeByName: false // discontinue(2026-08-05~)
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
};
|
|
@@ -7,9 +7,6 @@ const acceptCOAOffer_1 = require("../../repo/action/acceptCOAOffer");
|
|
|
7
7
|
const authorizeOffer_1 = require("../../repo/action/authorizeOffer");
|
|
8
8
|
const credentials_1 = require("../../repo/credentials");
|
|
9
9
|
const event_1 = require("../../repo/event");
|
|
10
|
-
// import { OrderInTransactionRepo } from '../../repo/orderInTransaction';
|
|
11
|
-
// import { OrderNumberRepo } from '../../repo/orderNumber';
|
|
12
|
-
// import { ProjectRepo } from '../../repo/project';
|
|
13
10
|
const reserveInterface_1 = require("../../repo/reserveInterface");
|
|
14
11
|
const integration_1 = require("../../repo/setting/integration");
|
|
15
12
|
const placeOrder_1 = require("../../repo/transaction/placeOrder");
|
|
@@ -19,14 +16,10 @@ let coaAuthClient;
|
|
|
19
16
|
* タスク実行関数
|
|
20
17
|
*/
|
|
21
18
|
function call(params) {
|
|
22
|
-
return async ({ connection, redisClient }
|
|
19
|
+
return async ({ connection, redisClient }) => {
|
|
23
20
|
if (redisClient === undefined) {
|
|
24
21
|
throw new factory_1.factory.errors.Argument('settings', 'redisClient required');
|
|
25
22
|
}
|
|
26
|
-
// 遅延実行(executeByName)には対応しない
|
|
27
|
-
if (!options.executeById) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
23
|
const settings = new integration_1.IntegrationSettingRepo({ connection });
|
|
31
24
|
const reserveInterfaceRepo = new reserveInterface_1.ReserveInterfaceRepo(connection);
|
|
32
25
|
const coaAPI = await reserveInterfaceRepo.findOne({ project: { id: { $eq: params.project.id } } });
|
|
@@ -57,7 +50,6 @@ function call(params) {
|
|
|
57
50
|
});
|
|
58
51
|
}
|
|
59
52
|
const actionRepo = new acceptCOAOffer_1.AcceptCOAOfferActionRepo(connection);
|
|
60
|
-
// const transactionProcessRepo = new TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
|
|
61
53
|
try {
|
|
62
54
|
const coaIntegrationSettings = await settings.getByKey('coa');
|
|
63
55
|
const reserveService = new coa_service_1.COA.service.Reserve({
|
|
@@ -86,8 +78,6 @@ function call(params) {
|
|
|
86
78
|
action: actionRepo,
|
|
87
79
|
authorizeOfferAction: new authorizeOffer_1.AuthorizeOfferActionRepo(connection),
|
|
88
80
|
event: new event_1.EventRepo(connection),
|
|
89
|
-
// orderNumber: new OrderNumberRepo({ connection }),
|
|
90
|
-
// project: new ProjectRepo(connection),
|
|
91
81
|
placeOrder: new placeOrder_1.PlaceOrderRepo(connection),
|
|
92
82
|
reserveService,
|
|
93
83
|
masterService
|
|
@@ -104,9 +94,6 @@ function call(params) {
|
|
|
104
94
|
})({
|
|
105
95
|
action: actionRepo,
|
|
106
96
|
event: new event_1.EventRepo(connection),
|
|
107
|
-
// orderInTransaction: new OrderInTransactionRepo(connection),
|
|
108
|
-
// orderNumber: new OrderNumberRepo({ connection }),
|
|
109
|
-
// project: new ProjectRepo(connection),
|
|
110
97
|
placeOrder: new placeOrder_1.PlaceOrderRepo(connection),
|
|
111
98
|
reserveService,
|
|
112
99
|
masterService
|
|
@@ -34,19 +34,13 @@ const any_1 = require("../payment/any");
|
|
|
34
34
|
* タスク実行関数
|
|
35
35
|
*/
|
|
36
36
|
function call(params) {
|
|
37
|
-
return async ({ connection, redisClient }
|
|
37
|
+
return async ({ connection, redisClient }) => {
|
|
38
38
|
if (redisClient === undefined) {
|
|
39
39
|
throw new factory_1.factory.errors.Argument('settings', 'redisClient required');
|
|
40
40
|
}
|
|
41
|
-
// 遅延実行(executeByName)には対応しない
|
|
42
|
-
if (!options.executeById) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
41
|
let callResult;
|
|
46
42
|
const settings = new integration_1.IntegrationSettingRepo({ connection });
|
|
47
|
-
// const actionRepo = new ActionRepo(connection);
|
|
48
43
|
const authorizePaymentMethodActionRepo = new authorizePaymentMethod_1.AuthorizePaymentMethodActionRepo(connection);
|
|
49
|
-
// const transactionProcessRepo = new TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
|
|
50
44
|
const paymentServiceId = params.data.object.issuedThrough.id;
|
|
51
45
|
const credentialsExpireInSeconds = (await settings.getByKey('movieticketReserve')).credentialsExpireInSeconds;
|
|
52
46
|
const useCredentialsRepo = typeof paymentServiceId === 'string' && paymentServiceId !== ''
|
|
@@ -9,23 +9,17 @@ const paymentService_1 = require("../../repo/paymentService");
|
|
|
9
9
|
const paymentServiceProvider_1 = require("../../repo/paymentServiceProvider");
|
|
10
10
|
const sellerPaymentAccepted_1 = require("../../repo/sellerPaymentAccepted");
|
|
11
11
|
const integration_1 = require("../../repo/setting/integration");
|
|
12
|
-
// import { TransactionProcessRepo } from '../../repo/transactionProcess';
|
|
13
12
|
const pay_1 = require("../assetTransaction/pay");
|
|
14
13
|
/**
|
|
15
14
|
* タスク実行関数
|
|
16
15
|
*/
|
|
17
16
|
function call(params) {
|
|
18
|
-
return async ({ connection, redisClient }
|
|
17
|
+
return async ({ connection, redisClient }) => {
|
|
19
18
|
if (redisClient === undefined) {
|
|
20
19
|
throw new factory_1.factory.errors.Argument('settings', 'redisClient required');
|
|
21
20
|
}
|
|
22
|
-
// 遅延実行(executeByName)には対応しない
|
|
23
|
-
if (!options.executeById) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
21
|
const settings = new integration_1.IntegrationSettingRepo({ connection });
|
|
27
22
|
const actionRepo = new checkMovieTicket_1.CheckMovieTicketActionRepo(connection);
|
|
28
|
-
// const transactionProcessRepo = new TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
|
|
29
23
|
const paymentServiceId = params.data.object[0]?.id;
|
|
30
24
|
const credentialsExpireInSeconds = (await settings.getByKey('movieticketReserve')).credentialsExpireInSeconds;
|
|
31
25
|
const useCredentialsRepo = typeof paymentServiceId === 'string' && paymentServiceId !== ''
|
|
@@ -247,7 +247,9 @@ function onConfirmed(params, options) {
|
|
|
247
247
|
},
|
|
248
248
|
useOnOrderStatusChanged: options.useOnOrderStatusChanged === true
|
|
249
249
|
};
|
|
250
|
+
const taskIdentifier = (0, util_1.format)('%s:%s:%s:%s', params.project.id, factory_1.factory.taskName.OnAssetTransactionStatusChanged, onAssetTransactionStatusChangedTaskData.purpose.orderNumber, onAssetTransactionStatusChangedTaskData.object.transactionNumber);
|
|
250
251
|
const onAssetTransactionStatusChangedTask = {
|
|
252
|
+
identifier: taskIdentifier,
|
|
251
253
|
project: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project },
|
|
252
254
|
name: factory_1.factory.taskName.OnAssetTransactionStatusChanged,
|
|
253
255
|
status: factory_1.factory.taskStatus.Ready,
|
|
@@ -257,7 +259,7 @@ function onConfirmed(params, options) {
|
|
|
257
259
|
executionResults: [],
|
|
258
260
|
data: onAssetTransactionStatusChangedTaskData
|
|
259
261
|
};
|
|
260
|
-
await repos.task.
|
|
262
|
+
await repos.task.runTaskByIdentifier(onAssetTransactionStatusChangedTask);
|
|
261
263
|
}
|
|
262
264
|
};
|
|
263
265
|
}
|
|
@@ -10,10 +10,8 @@ const event_1 = require("../../repo/event");
|
|
|
10
10
|
const eventSeries_1 = require("../../repo/eventSeries");
|
|
11
11
|
const issuer_1 = require("../../repo/issuer");
|
|
12
12
|
const orderInTransaction_1 = require("../../repo/orderInTransaction");
|
|
13
|
-
// import { OrderNumberRepo } from '../../repo/orderNumber';
|
|
14
13
|
const paymentService_1 = require("../../repo/paymentService");
|
|
15
14
|
const paymentServiceProvider_1 = require("../../repo/paymentServiceProvider");
|
|
16
|
-
// import { ProjectRepo } from '../../repo/project';
|
|
17
15
|
const sellerPaymentAccepted_1 = require("../../repo/sellerPaymentAccepted");
|
|
18
16
|
const integration_1 = require("../../repo/setting/integration");
|
|
19
17
|
const ticket_1 = require("../../repo/ticket");
|
|
@@ -24,17 +22,12 @@ const any_1 = require("../payment/any");
|
|
|
24
22
|
* タスク実行関数
|
|
25
23
|
*/
|
|
26
24
|
function call(params) {
|
|
27
|
-
return async ({ connection, redisClient }
|
|
25
|
+
return async ({ connection, redisClient }) => {
|
|
28
26
|
if (redisClient === undefined) {
|
|
29
27
|
throw new factory_1.factory.errors.Argument('settings', 'redisClient required');
|
|
30
28
|
}
|
|
31
|
-
// 遅延実行(executeByName)には対応しない
|
|
32
|
-
if (!options.executeById) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
29
|
const settings = new integration_1.IntegrationSettingRepo({ connection });
|
|
36
30
|
const actionRepo = new acceptPay_1.AcceptPayActionRepo(connection);
|
|
37
|
-
// const transactionProcessRepo = new TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
|
|
38
31
|
try {
|
|
39
32
|
const { savePaymentMethodIdInTransaction: _savePaymentMethodIdInTransaction, project: _project, ...publishPaymentUrlParams } = params.data;
|
|
40
33
|
await (0, any_1.publishPaymentUrl)({
|
|
@@ -51,11 +44,9 @@ function call(params) {
|
|
|
51
44
|
eventSeries: new eventSeries_1.EventSeriesRepo(connection),
|
|
52
45
|
issuer: new issuer_1.IssuerRepo(connection),
|
|
53
46
|
orderInTransaction: new orderInTransaction_1.OrderInTransactionRepo(connection),
|
|
54
|
-
// orderNumber: new OrderNumberRepo({ connection }),
|
|
55
47
|
paymentAccepted: new sellerPaymentAccepted_1.SellerPaymentAcceptedRepo(connection),
|
|
56
48
|
paymentService: new paymentService_1.PaymentServiceRepo(connection),
|
|
57
49
|
paymentServiceProvider: new paymentServiceProvider_1.PaymentServiceProviderRepo(connection),
|
|
58
|
-
// project: new ProjectRepo(connection),
|
|
59
50
|
ticket: new ticket_1.TicketRepo(connection),
|
|
60
51
|
placeOrder: new placeOrder_1.PlaceOrderRepo(connection),
|
|
61
52
|
transactionNumber: new transactionNumber_1.TransactionNumberRepo({ connection })
|