@chevre/domain 26.0.0-alpha.1 → 26.0.0-alpha.3
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/adminAsyncAction.d.ts +19 -0
- package/lib/chevre/repo/adminAsyncAction.js +86 -0
- package/lib/chevre/repo/asyncAction.d.ts +1 -6
- package/lib/chevre/repo/asyncAction.js +0 -108
- package/lib/chevre/repo/mongoose/schemas/setting.d.ts +0 -4
- package/lib/chevre/repository.d.ts +5 -0
- package/lib/chevre/repository.js +13 -2
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createStartParams.js +5 -25
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +1 -1
- package/lib/chevre/service/reserve/confirmReservation.js +19 -26
- package/lib/chevre/service/reserve/factory.d.ts +0 -3
- package/lib/chevre/service/reserve/factory.js +0 -4
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.d.ts +4 -13
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +20 -60
- package/lib/chevre/service/task/importEventCapacitiesFromCOA.js +4 -1
- package/lib/chevre/service/task/importEventsFromCOA.js +4 -1
- package/lib/chevre/service/task/importOffersFromCOA.js +5 -5
- package/lib/chevre/service/taskHandler.js +0 -34
- package/package.json +2 -2
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Connection, FilterQuery } from 'mongoose';
|
|
2
|
+
import { factory } from '../factory';
|
|
3
|
+
import { IModel, IDocType } from './mongoose/schemas/asyncAction';
|
|
4
|
+
import type { IExecutableTask } from '../taskSettings';
|
|
5
|
+
export type IExecutableAsyncAction = Pick<IExecutableTask<factory.taskName>, 'data' | 'expires' | 'id' | 'name' | 'project' | 'runsAt' | 'status'>;
|
|
6
|
+
type IKeyOfProjection = keyof factory.task.ITask<factory.taskName> | 'expires';
|
|
7
|
+
type IFindParams = Pick<factory.task.ISearchConditions, 'id' | 'name' | 'project' | 'runsFrom' | 'runsThrough' | 'status' | 'limit' | 'page' | 'sort'>;
|
|
8
|
+
/**
|
|
9
|
+
* 非同期アクション管理リポジトリ
|
|
10
|
+
*/
|
|
11
|
+
export declare class AdminAsyncActionRepo {
|
|
12
|
+
readonly asyncActionModel: IModel;
|
|
13
|
+
constructor(connection: Connection);
|
|
14
|
+
static CREATE_MONGO_CONDITIONS(params: Pick<IFindParams, 'id' | 'name' | 'project' | 'runsFrom' | 'runsThrough' | 'status'>): FilterQuery<import("@chevre/factory/lib/chevre/task").ITask | import("@chevre/factory/lib/chevre/task/confirmPayTransaction").ITask | import("@chevre/factory/lib/chevre/task/confirmReserveTransaction").ITask | import("@chevre/factory/lib/chevre/task/createAccountingReport").ITask | import("@chevre/factory/lib/chevre/task/onAssetTransactionStatusChanged").ITask | import("@chevre/factory/lib/chevre/task/onAuthorizationCreated").ITask | import("@chevre/factory/lib/chevre/task/onEventChanged").ITask | import("@chevre/factory/lib/chevre/task/onResourceDeleted").ITask | import("@chevre/factory/lib/chevre/task/onResourceUpdated").ITask | import("@chevre/factory/lib/chevre/task/onOrderPaymentCompleted").ITask | import("@chevre/factory/lib/chevre/task/placeOrder").ITask | import("@chevre/factory/lib/chevre/task/returnOrder").ITask | import("@chevre/factory/lib/chevre/task/returnPayTransaction").ITask | import("@chevre/factory/lib/chevre/task/returnReserveTransaction").ITask | import("@chevre/factory/lib/chevre/task/sendEmailMessage").ITask | import("@chevre/factory/lib/chevre/task/sendOrder").ITask | import("@chevre/factory/lib/chevre/task/triggerWebhook").ITask | import("@chevre/factory/lib/chevre/task/useReservation").ITask | import("@chevre/factory/lib/chevre/task/voidPayTransaction").ITask>[];
|
|
15
|
+
findAsyncActions(params: IFindParams, inclusion: IKeyOfProjection[]): Promise<(IDocType & {
|
|
16
|
+
id: string;
|
|
17
|
+
})[]>;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AdminAsyncActionRepo = void 0;
|
|
4
|
+
const settings_1 = require("../settings");
|
|
5
|
+
const asyncAction_1 = require("./mongoose/schemas/asyncAction");
|
|
6
|
+
const AVAILABLE_PROJECT_FIELDS = [
|
|
7
|
+
'project',
|
|
8
|
+
'name',
|
|
9
|
+
'status',
|
|
10
|
+
'runsAt',
|
|
11
|
+
'lastTriedAt',
|
|
12
|
+
'executionResults',
|
|
13
|
+
'executor',
|
|
14
|
+
'data',
|
|
15
|
+
'dateAborted',
|
|
16
|
+
'expires'
|
|
17
|
+
];
|
|
18
|
+
/**
|
|
19
|
+
* 非同期アクション管理リポジトリ
|
|
20
|
+
*/
|
|
21
|
+
class AdminAsyncActionRepo {
|
|
22
|
+
asyncActionModel;
|
|
23
|
+
constructor(connection) {
|
|
24
|
+
this.asyncActionModel = connection.model(asyncAction_1.modelName, (0, asyncAction_1.createSchema)());
|
|
25
|
+
}
|
|
26
|
+
static CREATE_MONGO_CONDITIONS(params) {
|
|
27
|
+
const andConditions = [];
|
|
28
|
+
const idEq = params.id?.$eq;
|
|
29
|
+
if (typeof idEq === 'string') {
|
|
30
|
+
andConditions.push({ _id: { $eq: idEq } });
|
|
31
|
+
}
|
|
32
|
+
const projectIdEq = params.project?.id?.$eq;
|
|
33
|
+
if (typeof projectIdEq === 'string') {
|
|
34
|
+
andConditions.push({ 'project.id': { $eq: projectIdEq } });
|
|
35
|
+
}
|
|
36
|
+
if (typeof params.name === 'string') {
|
|
37
|
+
andConditions.push({ name: { $eq: params.name } });
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
const nameIn = params.name?.$in;
|
|
41
|
+
if (Array.isArray(nameIn)) {
|
|
42
|
+
andConditions.push({ name: { $in: nameIn } });
|
|
43
|
+
}
|
|
44
|
+
const nameNin = params.name?.$nin;
|
|
45
|
+
if (Array.isArray(nameNin)) {
|
|
46
|
+
andConditions.push({ name: { $nin: nameNin } });
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const statusEq = params.status?.$eq;
|
|
50
|
+
if (typeof statusEq === 'string') {
|
|
51
|
+
andConditions.push({ status: { $eq: statusEq } });
|
|
52
|
+
}
|
|
53
|
+
if (params.runsFrom instanceof Date) {
|
|
54
|
+
andConditions.push({ runsAt: { $gte: params.runsFrom } });
|
|
55
|
+
}
|
|
56
|
+
if (params.runsThrough instanceof Date) {
|
|
57
|
+
andConditions.push({ runsAt: { $lte: params.runsThrough } });
|
|
58
|
+
}
|
|
59
|
+
return andConditions;
|
|
60
|
+
}
|
|
61
|
+
async findAsyncActions(params, inclusion) {
|
|
62
|
+
const conditions = AdminAsyncActionRepo.CREATE_MONGO_CONDITIONS(params);
|
|
63
|
+
let positiveProjectionFields = AVAILABLE_PROJECT_FIELDS;
|
|
64
|
+
if (Array.isArray(inclusion) && inclusion.length > 0) {
|
|
65
|
+
positiveProjectionFields = inclusion.filter((key) => AVAILABLE_PROJECT_FIELDS.includes(key));
|
|
66
|
+
}
|
|
67
|
+
const projection = {
|
|
68
|
+
_id: 0,
|
|
69
|
+
id: { $toString: '$_id' },
|
|
70
|
+
...Object.fromEntries(positiveProjectionFields.map((key) => ([key, 1])))
|
|
71
|
+
};
|
|
72
|
+
const query = this.asyncActionModel.find((conditions.length > 0) ? { $and: conditions } : {}, projection);
|
|
73
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
74
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
75
|
+
query.limit(params.limit)
|
|
76
|
+
.skip(params.limit * (page - 1));
|
|
77
|
+
}
|
|
78
|
+
if (params.sort?.runsAt !== undefined) {
|
|
79
|
+
query.sort({ runsAt: params.sort.runsAt });
|
|
80
|
+
}
|
|
81
|
+
return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
82
|
+
.lean()
|
|
83
|
+
.exec();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
exports.AdminAsyncActionRepo = AdminAsyncActionRepo;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Connection
|
|
1
|
+
import type { Connection } from 'mongoose';
|
|
2
2
|
import { factory } from '../factory';
|
|
3
3
|
import { IModel, IDocType } from './mongoose/schemas/asyncAction';
|
|
4
4
|
import type { IExecutableTask } from '../taskSettings';
|
|
@@ -7,17 +7,12 @@ type ISavingTask = Pick<factory.task.IAttributes<factory.taskName>, 'data' | 'ex
|
|
|
7
7
|
};
|
|
8
8
|
export type IExecutableAsyncAction = Pick<IExecutableTask<factory.taskName>, 'data' | 'expires' | 'id' | 'name' | 'project' | 'runsAt' | 'status'>;
|
|
9
9
|
type IKeyOfProjection = keyof factory.task.ITask<factory.taskName> | 'expires';
|
|
10
|
-
type IFindParams = Pick<factory.task.ISearchConditions, 'id' | 'name' | 'project' | 'runsFrom' | 'runsThrough' | 'status' | 'limit' | 'page' | 'sort'>;
|
|
11
10
|
/**
|
|
12
11
|
* 非同期アクションリポジトリ
|
|
13
12
|
*/
|
|
14
13
|
export declare class AsyncActionRepo {
|
|
15
14
|
readonly asyncActionModel: IModel;
|
|
16
15
|
constructor(connection: Connection);
|
|
17
|
-
static CREATE_MONGO_CONDITIONS(params: Pick<IFindParams, 'id' | 'name' | 'project' | 'runsFrom' | 'runsThrough' | 'status'>): FilterQuery<import("@chevre/factory/lib/chevre/task").ITask | import("@chevre/factory/lib/chevre/task/confirmPayTransaction").ITask | import("@chevre/factory/lib/chevre/task/confirmReserveTransaction").ITask | import("@chevre/factory/lib/chevre/task/createAccountingReport").ITask | import("@chevre/factory/lib/chevre/task/onAssetTransactionStatusChanged").ITask | import("@chevre/factory/lib/chevre/task/onAuthorizationCreated").ITask | import("@chevre/factory/lib/chevre/task/onEventChanged").ITask | import("@chevre/factory/lib/chevre/task/onResourceDeleted").ITask | import("@chevre/factory/lib/chevre/task/onResourceUpdated").ITask | import("@chevre/factory/lib/chevre/task/onOrderPaymentCompleted").ITask | import("@chevre/factory/lib/chevre/task/placeOrder").ITask | import("@chevre/factory/lib/chevre/task/returnOrder").ITask | import("@chevre/factory/lib/chevre/task/returnPayTransaction").ITask | import("@chevre/factory/lib/chevre/task/returnReserveTransaction").ITask | import("@chevre/factory/lib/chevre/task/sendEmailMessage").ITask | import("@chevre/factory/lib/chevre/task/sendOrder").ITask | import("@chevre/factory/lib/chevre/task/triggerWebhook").ITask | import("@chevre/factory/lib/chevre/task/useReservation").ITask | import("@chevre/factory/lib/chevre/task/voidPayTransaction").ITask>[];
|
|
18
|
-
findAsyncActions(params: IFindParams, inclusion: IKeyOfProjection[]): Promise<(IDocType & {
|
|
19
|
-
id: string;
|
|
20
|
-
})[]>;
|
|
21
16
|
/**
|
|
22
17
|
* Readyタスクをひとつ追加する
|
|
23
18
|
*/
|
|
@@ -35,65 +35,6 @@ class AsyncActionRepo {
|
|
|
35
35
|
constructor(connection) {
|
|
36
36
|
this.asyncActionModel = connection.model(asyncAction_1.modelName, (0, asyncAction_1.createSchema)());
|
|
37
37
|
}
|
|
38
|
-
static CREATE_MONGO_CONDITIONS(params) {
|
|
39
|
-
const andConditions = [];
|
|
40
|
-
const idEq = params.id?.$eq;
|
|
41
|
-
if (typeof idEq === 'string') {
|
|
42
|
-
andConditions.push({ _id: { $eq: idEq } });
|
|
43
|
-
}
|
|
44
|
-
const projectIdEq = params.project?.id?.$eq;
|
|
45
|
-
if (typeof projectIdEq === 'string') {
|
|
46
|
-
andConditions.push({ 'project.id': { $eq: projectIdEq } });
|
|
47
|
-
}
|
|
48
|
-
if (typeof params.name === 'string') {
|
|
49
|
-
andConditions.push({ name: { $eq: params.name } });
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
const nameIn = params.name?.$in;
|
|
53
|
-
if (Array.isArray(nameIn)) {
|
|
54
|
-
andConditions.push({ name: { $in: nameIn } });
|
|
55
|
-
}
|
|
56
|
-
const nameNin = params.name?.$nin;
|
|
57
|
-
if (Array.isArray(nameNin)) {
|
|
58
|
-
andConditions.push({ name: { $nin: nameNin } });
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
const statusEq = params.status?.$eq;
|
|
62
|
-
if (typeof statusEq === 'string') {
|
|
63
|
-
andConditions.push({ status: { $eq: statusEq } });
|
|
64
|
-
}
|
|
65
|
-
if (params.runsFrom instanceof Date) {
|
|
66
|
-
andConditions.push({ runsAt: { $gte: params.runsFrom } });
|
|
67
|
-
}
|
|
68
|
-
if (params.runsThrough instanceof Date) {
|
|
69
|
-
andConditions.push({ runsAt: { $lte: params.runsThrough } });
|
|
70
|
-
}
|
|
71
|
-
return andConditions;
|
|
72
|
-
}
|
|
73
|
-
async findAsyncActions(params, inclusion) {
|
|
74
|
-
const conditions = AsyncActionRepo.CREATE_MONGO_CONDITIONS(params);
|
|
75
|
-
let positiveProjectionFields = AVAILABLE_PROJECT_FIELDS;
|
|
76
|
-
if (Array.isArray(inclusion) && inclusion.length > 0) {
|
|
77
|
-
positiveProjectionFields = inclusion.filter((key) => AVAILABLE_PROJECT_FIELDS.includes(key));
|
|
78
|
-
}
|
|
79
|
-
const projection = {
|
|
80
|
-
_id: 0,
|
|
81
|
-
id: { $toString: '$_id' },
|
|
82
|
-
...Object.fromEntries(positiveProjectionFields.map((key) => ([key, 1])))
|
|
83
|
-
};
|
|
84
|
-
const query = this.asyncActionModel.find((conditions.length > 0) ? { $and: conditions } : {}, projection);
|
|
85
|
-
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
86
|
-
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
87
|
-
query.limit(params.limit)
|
|
88
|
-
.skip(params.limit * (page - 1));
|
|
89
|
-
}
|
|
90
|
-
if (params.sort?.runsAt !== undefined) {
|
|
91
|
-
query.sort({ runsAt: params.sort.runsAt });
|
|
92
|
-
}
|
|
93
|
-
return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
94
|
-
.lean()
|
|
95
|
-
.exec();
|
|
96
|
-
}
|
|
97
38
|
/**
|
|
98
39
|
* Readyタスクをひとつ追加する
|
|
99
40
|
*/
|
|
@@ -168,55 +109,6 @@ class AsyncActionRepo {
|
|
|
168
109
|
}
|
|
169
110
|
return doc;
|
|
170
111
|
}
|
|
171
|
-
// /**
|
|
172
|
-
// * Readyのままで期限切れのタスクをExpiredに変更する
|
|
173
|
-
// */
|
|
174
|
-
// public async makeExpiredMany(params: {
|
|
175
|
-
// expiresLt: Date;
|
|
176
|
-
// }): Promise<UpdateWriteOpResult> {
|
|
177
|
-
// const { expiresLt } = params;
|
|
178
|
-
// if (!(expiresLt instanceof Date)) {
|
|
179
|
-
// throw new factory.errors.Argument('expiresLt', 'must be Date');
|
|
180
|
-
// }
|
|
181
|
-
// return this.asyncActionModel.updateMany(
|
|
182
|
-
// {
|
|
183
|
-
// status: { $eq: factory.taskStatus.Ready },
|
|
184
|
-
// expires: { $lt: expiresLt }
|
|
185
|
-
// },
|
|
186
|
-
// {
|
|
187
|
-
// $set: {
|
|
188
|
-
// status: factory.taskStatus.Expired
|
|
189
|
-
// }
|
|
190
|
-
// }
|
|
191
|
-
// )
|
|
192
|
-
// .exec();
|
|
193
|
-
// }
|
|
194
|
-
// /**
|
|
195
|
-
// * taskNameに関わらず、Runningのまま放置された非同期アクションをAbortedに変更する
|
|
196
|
-
// */
|
|
197
|
-
// public async abortMany(params: {
|
|
198
|
-
// intervalInMinutes: number;
|
|
199
|
-
// }): Promise<UpdateWriteOpResult> {
|
|
200
|
-
// const lastTriedAtShoudBeLessThan = moment()
|
|
201
|
-
// .add(-params.intervalInMinutes, 'minutes')
|
|
202
|
-
// .toDate();
|
|
203
|
-
// return this.asyncActionModel.updateMany(
|
|
204
|
-
// {
|
|
205
|
-
// status: { $eq: factory.taskStatus.Running },
|
|
206
|
-
// lastTriedAt: {
|
|
207
|
-
// $exists: true,
|
|
208
|
-
// $lt: lastTriedAtShoudBeLessThan
|
|
209
|
-
// }
|
|
210
|
-
// },
|
|
211
|
-
// {
|
|
212
|
-
// $set: {
|
|
213
|
-
// status: factory.taskStatus.Aborted,
|
|
214
|
-
// dateAborted: new Date()
|
|
215
|
-
// }
|
|
216
|
-
// }
|
|
217
|
-
// )
|
|
218
|
-
// .exec();
|
|
219
|
-
// }
|
|
220
112
|
/**
|
|
221
113
|
* タスクIDから実行結果とステータスを保管する
|
|
222
114
|
* Abortedの場合、dateAbortedもセットする
|
|
@@ -17,6 +17,7 @@ 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
19
|
import type { AdditionalPropertyRepo } from './repo/additionalProperty';
|
|
20
|
+
import type { AdminAsyncActionRepo } from './repo/adminAsyncAction';
|
|
20
21
|
import type { AdminScheduledTaskRepo } from './repo/adminScheduledTask';
|
|
21
22
|
import type { AdminTaskRepo } from './repo/adminTask';
|
|
22
23
|
import type { AggregateActionRepo } from './repo/aggregateAction';
|
|
@@ -163,6 +164,10 @@ export type AdditionalProperty = AdditionalPropertyRepo;
|
|
|
163
164
|
export declare namespace AdditionalProperty {
|
|
164
165
|
function createInstance(...params: ConstructorParameters<typeof AdditionalPropertyRepo>): Promise<AdditionalPropertyRepo>;
|
|
165
166
|
}
|
|
167
|
+
export type AdminAsyncAction = AdminAsyncActionRepo;
|
|
168
|
+
export declare namespace AdminAsyncAction {
|
|
169
|
+
function createInstance(...params: ConstructorParameters<typeof AdminAsyncActionRepo>): Promise<AdminAsyncActionRepo>;
|
|
170
|
+
}
|
|
166
171
|
export type AdminScheduledTask = AdminScheduledTaskRepo;
|
|
167
172
|
export declare namespace AdminScheduledTask {
|
|
168
173
|
function createInstance(...params: ConstructorParameters<typeof AdminScheduledTaskRepo>): Promise<AdminScheduledTaskRepo>;
|
package/lib/chevre/repository.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.WebSite = exports.rateLimit = exports.TransactionProcess = exports.TransactionNumber = exports.transaction = exports.Transaction = exports.Ticket = exports.AsyncAction = 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 = void 0;
|
|
3
|
+
exports.PaymentServiceChannel = 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.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.AsyncAction = 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 = void 0;
|
|
5
5
|
var AcceptedOffer;
|
|
6
6
|
(function (AcceptedOffer) {
|
|
7
7
|
let repo;
|
|
@@ -170,6 +170,17 @@ var AdditionalProperty;
|
|
|
170
170
|
}
|
|
171
171
|
AdditionalProperty.createInstance = createInstance;
|
|
172
172
|
})(AdditionalProperty || (exports.AdditionalProperty = AdditionalProperty = {}));
|
|
173
|
+
var AdminAsyncAction;
|
|
174
|
+
(function (AdminAsyncAction) {
|
|
175
|
+
let repo;
|
|
176
|
+
async function createInstance(...params) {
|
|
177
|
+
if (repo === undefined) {
|
|
178
|
+
repo = (await import('./repo/adminAsyncAction.js')).AdminAsyncActionRepo;
|
|
179
|
+
}
|
|
180
|
+
return new repo(...params);
|
|
181
|
+
}
|
|
182
|
+
AdminAsyncAction.createInstance = createInstance;
|
|
183
|
+
})(AdminAsyncAction || (exports.AdminAsyncAction = AdminAsyncAction = {}));
|
|
173
184
|
var AdminScheduledTask;
|
|
174
185
|
(function (AdminScheduledTask) {
|
|
175
186
|
let repo;
|
|
@@ -9,7 +9,7 @@ function createStartParams(params) {
|
|
|
9
9
|
typeOf: factory_1.factory.organizationType.Corporation
|
|
10
10
|
};
|
|
11
11
|
// reservationFor,issuedThrough保管をaddReservationsから移行(2024-07-01~)
|
|
12
|
-
const reservationFor = createReservationFor(params.event
|
|
12
|
+
const reservationFor = createReservationFor(params.event);
|
|
13
13
|
const { issuedThrough } = createIssuedThrough({ reservationFor: params.event });
|
|
14
14
|
const reservationPackage = {
|
|
15
15
|
issuedThrough, // addReservationsから移行(2024-07-01~)
|
|
@@ -33,7 +33,7 @@ function createStartParams(params) {
|
|
|
33
33
|
instrument
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
function createReservationFor(params
|
|
36
|
+
function createReservationFor(params) {
|
|
37
37
|
if (params.typeOf === factory_1.factory.eventType.ScreeningEvent) {
|
|
38
38
|
return {
|
|
39
39
|
endDate: params.endDate,
|
|
@@ -41,7 +41,7 @@ function createReservationFor(params, useOptimizeReservation) {
|
|
|
41
41
|
location: params.location,
|
|
42
42
|
name: params.name,
|
|
43
43
|
startDate: params.startDate,
|
|
44
|
-
superEvent: optimizeReservationSuperEvent(params
|
|
44
|
+
superEvent: optimizeReservationSuperEvent(params),
|
|
45
45
|
typeOf: params.typeOf,
|
|
46
46
|
...(params.doorTime instanceof Date)
|
|
47
47
|
? { doorTime: params.doorTime }
|
|
@@ -52,38 +52,18 @@ function createReservationFor(params, useOptimizeReservation) {
|
|
|
52
52
|
throw new factory_1.factory.errors.NotImplemented(`typeOf: ${params.typeOf}`);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
function optimizeReservationSuperEvent(params
|
|
55
|
+
function optimizeReservationSuperEvent(params) {
|
|
56
56
|
const superEvent = params.superEvent;
|
|
57
57
|
return {
|
|
58
58
|
id: superEvent.id,
|
|
59
|
-
// kanaName: superEvent.kanaName, // 廃止(2024-01-26~)
|
|
60
59
|
location: superEvent.location,
|
|
61
60
|
name: superEvent.name,
|
|
62
|
-
soundFormat: superEvent.soundFormat,
|
|
61
|
+
// soundFormat: superEvent.soundFormat, // discontinue(2026-08-01~)
|
|
63
62
|
typeOf: superEvent.typeOf,
|
|
64
63
|
workPerformed: superEvent.workPerformed,
|
|
65
|
-
// 廃止(2024-01-26~)
|
|
66
|
-
// ...(superEvent.description !== undefined)
|
|
67
|
-
// ? { description: superEvent.description }
|
|
68
|
-
// : undefined,
|
|
69
64
|
...(superEvent.headline !== undefined)
|
|
70
65
|
? { headline: superEvent.headline }
|
|
71
66
|
: undefined,
|
|
72
|
-
// 最適化対応(2024-03-16~)
|
|
73
|
-
...(useOptimizeReservation)
|
|
74
|
-
? {}
|
|
75
|
-
: {
|
|
76
|
-
additionalProperty: (Array.isArray(superEvent.additionalProperty))
|
|
77
|
-
? superEvent.additionalProperty
|
|
78
|
-
: []
|
|
79
|
-
}
|
|
80
|
-
// videoFormatをデータとしても廃止(万が一に備えてUSE_DEPRECATED_VIDEO_FORMATで再設定可能)(2026-02-03~)
|
|
81
|
-
// ...(USE_DEPRECATED_VIDEO_FORMAT)
|
|
82
|
-
// ? {
|
|
83
|
-
// // 現時点で型廃止済だがデータとしては互換性維持(2026-01-15~)
|
|
84
|
-
// videoFormat: (<any>superEvent).videoFormat
|
|
85
|
-
// }
|
|
86
|
-
// : undefined
|
|
87
67
|
};
|
|
88
68
|
}
|
|
89
69
|
function createIssuedThrough(params) {
|
|
@@ -100,7 +100,7 @@ function responseBody2acceptedOffers4result(params) {
|
|
|
100
100
|
name: event.superEvent.name,
|
|
101
101
|
alternativeHeadline: event.superEvent.alternativeHeadline,
|
|
102
102
|
location: event.superEvent.location,
|
|
103
|
-
soundFormat: event.superEvent.soundFormat,
|
|
103
|
+
// soundFormat: event.superEvent.soundFormat, // discontinue(2026-08-01~)
|
|
104
104
|
workPerformed: workPerformed,
|
|
105
105
|
duration: event.superEvent.duration,
|
|
106
106
|
coaInfo: event.superEvent.coaInfo
|
|
@@ -12,9 +12,7 @@ const debug = (0, debug_1.default)('chevre-domain:service:reserve:confirmReserva
|
|
|
12
12
|
* 予約を確定する
|
|
13
13
|
*/
|
|
14
14
|
function confirmReservation(params) {
|
|
15
|
-
return async (repos
|
|
16
|
-
// settings: Settings
|
|
17
|
-
) => {
|
|
15
|
+
return async (repos) => {
|
|
18
16
|
// await Promise.all(params.actionAttributesList.map(async (potentialReserveAction) => {
|
|
19
17
|
// const actionAttributes = await reserveIfNotYet(potentialReserveAction, { byTask: params.byTask })(repos);
|
|
20
18
|
// if (params.useOnReservationConfirmed) {
|
|
@@ -23,7 +21,8 @@ function confirmReservation(params) {
|
|
|
23
21
|
// }));
|
|
24
22
|
const { actionAttributes, reserveTransaction } = await reserveIfNotYet(params.potentialReserveAction, { byTask: params.byTask })(repos);
|
|
25
23
|
if (params.useOnReservationConfirmed) {
|
|
26
|
-
|
|
24
|
+
// onReservationConfirmedByActionは廃止(2026-08-01~)
|
|
25
|
+
// await onReservationConfirmedByAction(actionAttributes)({ task: repos.task });
|
|
27
26
|
}
|
|
28
27
|
if (params.useOnReservationConfirmed) {
|
|
29
28
|
let confirmedReservations = [];
|
|
@@ -38,38 +37,32 @@ function confirmReservation(params) {
|
|
|
38
37
|
// project all fields
|
|
39
38
|
// {}
|
|
40
39
|
);
|
|
41
|
-
// price,underName,ticketTypeは予約取引から補完する(2026-03-25~)
|
|
42
40
|
confirmedReservations = rawReservations.map((rawReservation) => {
|
|
43
|
-
const subReservationByTransaction = reserveTransaction.object.subReservation?.find((s) => s.id === rawReservation.id);
|
|
44
|
-
// 予約取引内にsubReservationは必ず存在するはず
|
|
45
|
-
if (subReservationByTransaction === undefined) {
|
|
46
|
-
|
|
47
|
-
}
|
|
41
|
+
// const subReservationByTransaction = reserveTransaction.object.subReservation?.find((s) => s.id === rawReservation.id);
|
|
42
|
+
// // 予約取引内にsubReservationは必ず存在するはず
|
|
43
|
+
// if (subReservationByTransaction === undefined) {
|
|
44
|
+
// throw new factory.errors.NotFound('reserveTransaction.object.subReservation');
|
|
45
|
+
// }
|
|
48
46
|
// 予約取引内にreservationForは必ず存在するはず
|
|
49
47
|
if (reserveTransaction.object.reservationFor === undefined) {
|
|
50
48
|
throw new factory_1.factory.errors.NotFound('reserveTransaction.object.reservationFor');
|
|
51
49
|
}
|
|
52
|
-
const priceByTransaction = subReservationByTransaction.price;
|
|
53
|
-
const underNameByTransaction = reserveTransaction.object.underName;
|
|
54
|
-
const ticketTypeByTransaction = subReservationByTransaction.reservedTicket.ticketType;
|
|
55
|
-
// console.log('creating confirmedReservation...', rawReservation, priceByTransaction, underNameByTransaction, ticketTypeByTransaction);
|
|
50
|
+
// const priceByTransaction = subReservationByTransaction.price;
|
|
51
|
+
// const underNameByTransaction = reserveTransaction.object.underName;
|
|
52
|
+
// const ticketTypeByTransaction = subReservationByTransaction.reservedTicket.ticketType;
|
|
56
53
|
return {
|
|
57
54
|
...rawReservation,
|
|
58
|
-
price: priceByTransaction,
|
|
59
|
-
underName: underNameByTransaction,
|
|
60
|
-
reservedTicket: {
|
|
61
|
-
...rawReservation.reservedTicket,
|
|
62
|
-
ticketType: ticketTypeByTransaction
|
|
63
|
-
},
|
|
64
55
|
reservationFor: reserveTransaction.object.reservationFor, // reservationForは予約取引から参照する(2026-04-05~)
|
|
65
|
-
|
|
56
|
+
// price,underName,ticketTypeは予約取引から補完していたが(2026-03-25~)、もう廃止(2026-08-01~)
|
|
57
|
+
// reservedTicket: {
|
|
58
|
+
// ...rawReservation.reservedTicket,
|
|
59
|
+
// ticketType: ticketTypeByTransaction
|
|
60
|
+
// },
|
|
61
|
+
// price: priceByTransaction,
|
|
62
|
+
// underName: underNameByTransaction,
|
|
63
|
+
// issuedThrough: reserveTransaction.object.issuedThrough // issuedThroughは予約取引から補完する(2026-05-08~)
|
|
66
64
|
};
|
|
67
65
|
});
|
|
68
|
-
confirmedReservations = confirmedReservations.map((r) => {
|
|
69
|
-
// // _idは不要であり、存在すると予期せぬ影響を及ぼす可能性がある
|
|
70
|
-
// delete (r as any)._id;
|
|
71
|
-
return r;
|
|
72
|
-
});
|
|
73
66
|
}
|
|
74
67
|
await (0, onReservationConfirmed_1.onReservationConfirmed)(confirmedReservations, actionAttributes)(repos);
|
|
75
68
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { factory } from '../../factory';
|
|
2
|
-
export declare function optimizeUnderName4inform(params: {
|
|
3
|
-
underName: Pick<factory.reservation.IUnderName, 'id' | 'typeOf'>;
|
|
4
|
-
}): factory.notification.reservation.IMaskedUnderName;
|
|
5
2
|
export type IPotentialInformReservationAction = factory.task.triggerWebhook.IPotentialInformReservationAction;
|
|
6
3
|
export declare const NUM_TRY_INFORM_RESERVATION = 10;
|
|
7
4
|
export interface IPotentialCancelAction extends factory.action.cancel.reservation.IAttributes {
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NUM_TRY_INFORM_RESERVATION = void 0;
|
|
4
|
-
exports.optimizeUnderName4inform = optimizeUnderName4inform;
|
|
5
4
|
exports.createCancelPendingReservationAction = createCancelPendingReservationAction;
|
|
6
5
|
const factory_1 = require("../../factory");
|
|
7
|
-
function optimizeUnderName4inform(params) {
|
|
8
|
-
return { id: params.underName.id, typeOf: params.underName.typeOf };
|
|
9
|
-
}
|
|
10
6
|
exports.NUM_TRY_INFORM_RESERVATION = 10;
|
|
11
7
|
function createCancelPendingReservationAction(params) {
|
|
12
8
|
const transaction = params.transaction;
|
|
@@ -5,21 +5,12 @@ import { factory } from '../../../factory';
|
|
|
5
5
|
import { AuthorizationRepo } from '../../../repo/authorization';
|
|
6
6
|
import type { SettingRepo } from '../../../repo/setting';
|
|
7
7
|
import type { TaskRepo } from '../../../repo/task';
|
|
8
|
-
export type IConfirmedReservation =
|
|
9
|
-
price?: factory.assetTransaction.reserve.IPrice;
|
|
10
|
-
underName?: Pick<factory.reservation.IUnderName, 'id' | 'typeOf'>;
|
|
11
|
-
reservedTicket: Omit<factory.assetTransaction.reserve.ISubReservationReservedTicket, 'ticketType'> & {
|
|
12
|
-
ticketType: factory.assetTransaction.reserve.ITicketType;
|
|
13
|
-
};
|
|
8
|
+
export type IConfirmedReservation = Pick<factory.reservation.eventReservation.IReservation, 'additionalProperty' | 'additionalTicketText' | 'bookingTime' | 'id' | 'modifiedTime' | 'project' | 'provider' | 'reservationNumber' | 'subReservation' | 'typeOf' | 'reservedTicket'> & {
|
|
14
9
|
reservationFor: factory.assetTransaction.reserve.IReservationFor;
|
|
15
|
-
|
|
10
|
+
price?: never;
|
|
11
|
+
underName?: never;
|
|
12
|
+
issuedThrough?: never;
|
|
16
13
|
};
|
|
17
|
-
/**
|
|
18
|
-
* 予約確定後のアクション
|
|
19
|
-
*/
|
|
20
|
-
export declare function onReservationConfirmedByAction(actionAttributes: Pick<factory.action.reserve.IAttributes, 'potentialActions'>): (repos: {
|
|
21
|
-
task: TaskRepo;
|
|
22
|
-
}) => Promise<void>;
|
|
23
14
|
export declare function onReservationConfirmed(confirmedReservations: IConfirmedReservation[], reserveAction: Pick<factory.action.reserve.IAttributes, 'instrument'>): (repos: {
|
|
24
15
|
code: AuthorizationRepo;
|
|
25
16
|
setting: SettingRepo;
|
|
@@ -1,52 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.onReservationConfirmedByAction = onReservationConfirmedByAction;
|
|
4
3
|
exports.onReservationConfirmed = onReservationConfirmed;
|
|
5
4
|
/**
|
|
6
5
|
* 予約確定時アクション
|
|
7
6
|
*/
|
|
8
7
|
const factory_1 = require("../../../factory");
|
|
9
8
|
const factory_2 = require("../factory");
|
|
10
|
-
/**
|
|
11
|
-
* 予約確定後のアクション
|
|
12
|
-
*/
|
|
13
|
-
function onReservationConfirmedByAction(actionAttributes) {
|
|
14
|
-
return async (repos) => {
|
|
15
|
-
const potentialActions = actionAttributes.potentialActions;
|
|
16
|
-
// const now = new Date();
|
|
17
|
-
const taskAttributes = [];
|
|
18
|
-
/* istanbul ignore else */
|
|
19
|
-
if (potentialActions !== undefined) {
|
|
20
|
-
// discontinue(2026-04-18~)
|
|
21
|
-
// if (Array.isArray(potentialActions.moneyTransfer)) {
|
|
22
|
-
// taskAttributes.push(...potentialActions.moneyTransfer.map((a) => {
|
|
23
|
-
// return {
|
|
24
|
-
// project: a.project,
|
|
25
|
-
// name: factory.taskName.MoneyTransfer as factory.taskName.MoneyTransfer,
|
|
26
|
-
// status: factory.taskStatus.Ready,
|
|
27
|
-
// runsAt: now,
|
|
28
|
-
// remainingNumberOfTries: 10,
|
|
29
|
-
// numberOfTried: 0,
|
|
30
|
-
// executionResults: [],
|
|
31
|
-
// data: a
|
|
32
|
-
// };
|
|
33
|
-
// }));
|
|
34
|
-
// }
|
|
35
|
-
}
|
|
36
|
-
// タスク保管
|
|
37
|
-
if (taskAttributes.length > 0) {
|
|
38
|
-
await repos.task.saveMany(taskAttributes);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
9
|
function onReservationConfirmed(confirmedReservations, reserveAction) {
|
|
43
|
-
return async (repos
|
|
44
|
-
// settings: Settings
|
|
45
|
-
) => {
|
|
10
|
+
return async (repos) => {
|
|
46
11
|
const setting = await repos.setting.findOne({ project: { id: { $eq: '*' } } }, ['onReservationStatusChanged']);
|
|
47
|
-
// const informReservations = settings.onReservationStatusChanged.informReservation;
|
|
48
12
|
const informReservations = setting?.onReservationStatusChanged?.informReservation;
|
|
49
|
-
const minimizeReservation = setting?.onReservationStatusChanged?.minimizeReservation === true;
|
|
50
13
|
let orderAsAbout;
|
|
51
14
|
if (Array.isArray(reserveAction.instrument)) {
|
|
52
15
|
for (const eachInstrument of reserveAction.instrument) {
|
|
@@ -58,8 +21,7 @@ function onReservationConfirmed(confirmedReservations, reserveAction) {
|
|
|
58
21
|
}
|
|
59
22
|
if (Array.isArray(confirmedReservations) && confirmedReservations.length > 0) {
|
|
60
23
|
// ひとつめの予約からReservationPackageの共有属性を取り出す
|
|
61
|
-
const { bookingTime,
|
|
62
|
-
// create AggregateScreeningEvent task -> migrate to agg(2024-10-29~)
|
|
24
|
+
const { bookingTime, project, provider, reservationFor, reservationNumber } = confirmedReservations[0];
|
|
63
25
|
const now = new Date();
|
|
64
26
|
const taskAttributes = [];
|
|
65
27
|
let onAuthorizationCreatedTask;
|
|
@@ -98,15 +60,13 @@ function onReservationConfirmed(confirmedReservations, reserveAction) {
|
|
|
98
60
|
}
|
|
99
61
|
}
|
|
100
62
|
const subReservations4inform = confirmedReservations.map((r) => {
|
|
101
|
-
const {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
reservedTicket4inform = reservedTicket; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
109
|
-
}
|
|
63
|
+
const {
|
|
64
|
+
// additionalProperty: _additionalProperty,
|
|
65
|
+
// price: _price,
|
|
66
|
+
// programMembershipUsed: _programMembershipUsed,
|
|
67
|
+
additionalTicketText, id, modifiedTime, reservedTicket, subReservation, typeOf } = r;
|
|
68
|
+
const { ticketType: _ticketType, ...reservedTicketWithNoTicketType } = reservedTicket;
|
|
69
|
+
const reservedTicket4inform = reservedTicketWithNoTicketType;
|
|
110
70
|
return {
|
|
111
71
|
id,
|
|
112
72
|
typeOf,
|
|
@@ -114,15 +74,15 @@ function onReservationConfirmed(confirmedReservations, reserveAction) {
|
|
|
114
74
|
...(typeof additionalTicketText === 'string') ? { additionalTicketText } : undefined,
|
|
115
75
|
...(modifiedTime instanceof Date) ? { modifiedTime } : undefined,
|
|
116
76
|
...(Array.isArray(subReservation)) ? { subReservation } : undefined,
|
|
117
|
-
...(!minimizeReservation && Array.isArray(additionalProperty)) ? { additionalProperty } : undefined, //
|
|
118
|
-
...(!minimizeReservation && price !== undefined) ? { price } : undefined, //
|
|
119
|
-
...(!minimizeReservation && programMembershipUsed !== undefined) ? { programMembershipUsed } : undefined, //
|
|
77
|
+
// ...(!minimizeReservation && Array.isArray(additionalProperty)) ? { additionalProperty } : undefined, // discontinue(2026-08-01~)
|
|
78
|
+
// ...(!minimizeReservation && price !== undefined) ? { price } : undefined, // discontinue(2026-08-01~)
|
|
79
|
+
// ...(!minimizeReservation && programMembershipUsed !== undefined) ? { programMembershipUsed } : undefined, // discontinue(2026-08-01~)
|
|
120
80
|
};
|
|
121
81
|
});
|
|
122
|
-
if (typeof issuedThrough.id !== 'string') {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
82
|
+
// if (typeof issuedThrough.id !== 'string') {
|
|
83
|
+
// // COA予約では予約アクションを想定していないので、興行idは必ず存在するはず
|
|
84
|
+
// throw new factory.errors.Internal('reservation.issuedThrough.id must be string');
|
|
85
|
+
// }
|
|
126
86
|
const informObject = {
|
|
127
87
|
bookingTime,
|
|
128
88
|
project,
|
|
@@ -132,10 +92,10 @@ function onReservationConfirmed(confirmedReservations, reserveAction) {
|
|
|
132
92
|
reservationStatus: factory_1.factory.reservationStatusType.ReservationConfirmed,
|
|
133
93
|
subReservation: subReservations4inform,
|
|
134
94
|
typeOf: factory_1.factory.reservationType.ReservationPackage,
|
|
135
|
-
...(!minimizeReservation) ? { issuedThrough } : undefined, //
|
|
136
|
-
...(!minimizeReservation && typeof underName?.typeOf === 'string')
|
|
137
|
-
|
|
138
|
-
|
|
95
|
+
// ...(!minimizeReservation) ? { issuedThrough } : undefined, // discontinue(2026-08-01~)
|
|
96
|
+
// ...(!minimizeReservation && typeof underName?.typeOf === 'string')
|
|
97
|
+
// ? { underName: optimizeUnderName4inform({ underName }) }
|
|
98
|
+
// : undefined // discontinue(2026-08-01~)
|
|
139
99
|
};
|
|
140
100
|
const informIdentifier = `${factory_1.factory.reservationType.ReservationPackage}:${informObject.reservationNumber}:${informObject.reservationStatus}`;
|
|
141
101
|
// inform galobally
|
|
@@ -60,7 +60,10 @@ function call(params) {
|
|
|
60
60
|
endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
|
|
61
61
|
auth: coaAuthClient
|
|
62
62
|
}, { timeout: (await settings.getByKey('coa')).timeoutReserve });
|
|
63
|
-
await EventAggregationService.importFromCOA(
|
|
63
|
+
await EventAggregationService.importFromCOA({
|
|
64
|
+
...params.data,
|
|
65
|
+
project: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project }
|
|
66
|
+
})({
|
|
64
67
|
event: new event_1.EventRepo(connection),
|
|
65
68
|
reserveService
|
|
66
69
|
});
|
|
@@ -67,7 +67,10 @@ function call(params) {
|
|
|
67
67
|
endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
|
|
68
68
|
auth: coaAuthClient
|
|
69
69
|
}, { timeout: (await settings.getByKey('coa')).timeoutMaster });
|
|
70
|
-
await EventService.importFromCOA(
|
|
70
|
+
await EventService.importFromCOA({
|
|
71
|
+
...params.data,
|
|
72
|
+
project: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project }
|
|
73
|
+
})({
|
|
71
74
|
action: new action_1.ActionRepo(connection),
|
|
72
75
|
categoryCode: new categoryCode_1.CategoryCodeRepo(connection),
|
|
73
76
|
creativeWork: new creativeWork_1.CreativeWorkRepo(connection),
|
|
@@ -65,22 +65,22 @@ function call(params) {
|
|
|
65
65
|
const settings = new integration_1.IntegrationSettingRepo({ connection });
|
|
66
66
|
const aggregateOfferRepo = new aggregateOffer_1.AggregateOfferRepo(connection);
|
|
67
67
|
const categoryCodeRepo = new categoryCode_1.CategoryCodeRepo(connection);
|
|
68
|
-
// const taskRepo = new TaskRepo(connection);
|
|
69
68
|
const masterService = new coa_service_1.COA.service.Master({
|
|
70
69
|
endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
|
|
71
70
|
auth: coaAuthClient
|
|
72
71
|
}, { timeout: (await settings.getByKey('coa')).timeoutMaster });
|
|
73
72
|
await OfferService.event.importFromCOA({
|
|
74
|
-
project: { id: params.
|
|
73
|
+
project: { id: params.project.id },
|
|
75
74
|
theaterCode: params.data.theaterCode,
|
|
76
75
|
paymentMethodType4membershipCoupon
|
|
77
76
|
})({
|
|
78
|
-
// categoryCode: categoryCodeRepo,
|
|
79
77
|
aggregateOffer: aggregateOfferRepo,
|
|
80
|
-
// task: taskRepo,
|
|
81
78
|
masterService
|
|
82
79
|
});
|
|
83
|
-
await OfferService.event.importCategoryCodesFromCOA(
|
|
80
|
+
await OfferService.event.importCategoryCodesFromCOA({
|
|
81
|
+
...params.data,
|
|
82
|
+
project: { id: params.project.id }
|
|
83
|
+
})({
|
|
84
84
|
categoryCode: categoryCodeRepo,
|
|
85
85
|
masterService
|
|
86
86
|
});
|
|
@@ -44,40 +44,6 @@ function executeTask(task, next) {
|
|
|
44
44
|
const { call } = await exports.taskLoader.load(task.name); // testが書きづらいのでtaskLoader経由で呼ぶ
|
|
45
45
|
const callResult = await call(task)(settings, options);
|
|
46
46
|
// ICallableTaskOperationSimpleを廃止(2026-07-22~)
|
|
47
|
-
// let callResult: ICallResult | undefined;
|
|
48
|
-
// switch (task.name) {
|
|
49
|
-
// case factory.taskName.AcceptCOAOffer:
|
|
50
|
-
// case factory.taskName.AggregateOnSystem:
|
|
51
|
-
// case factory.taskName.AuthorizePayment:
|
|
52
|
-
// case factory.taskName.CancelPendingReservation:
|
|
53
|
-
// case factory.taskName.CheckMovieTicket:
|
|
54
|
-
// case factory.taskName.CheckResource:
|
|
55
|
-
// case factory.taskName.CreateAccountingReport:
|
|
56
|
-
// case factory.taskName.HandleNotification:
|
|
57
|
-
// case factory.taskName.ImportEventCapacitiesFromCOA:
|
|
58
|
-
// case factory.taskName.ImportEventsFromCOA:
|
|
59
|
-
// case factory.taskName.ImportOffersFromCOA:
|
|
60
|
-
// case factory.taskName.InvalidatePaymentUrl:
|
|
61
|
-
// case factory.taskName.OnAuthorizationCreated:
|
|
62
|
-
// case factory.taskName.OnResourceDeleted:
|
|
63
|
-
// case factory.taskName.Pay:
|
|
64
|
-
// case factory.taskName.PublishPaymentUrl:
|
|
65
|
-
// case factory.taskName.Refund:
|
|
66
|
-
// case factory.taskName.VoidPayTransaction:
|
|
67
|
-
// case factory.taskName.VoidReserveTransaction:
|
|
68
|
-
// case factory.taskName.ConfirmPayTransaction:
|
|
69
|
-
// case factory.taskName.ConfirmReserveTransaction:
|
|
70
|
-
// case factory.taskName.ReturnPayTransaction:
|
|
71
|
-
// case factory.taskName.ReturnReserveTransaction:
|
|
72
|
-
// case factory.taskName.SendEmailMessage:
|
|
73
|
-
// case factory.taskName.SyncResourcesFromCOA:
|
|
74
|
-
// case factory.taskName.TriggerWebhook:
|
|
75
|
-
// case factory.taskName.UseReservation:
|
|
76
|
-
// callResult = await (call as ICallableTaskOperation)(task)(settings, options);
|
|
77
|
-
// break;
|
|
78
|
-
// default:
|
|
79
|
-
// await (call as ICallableTaskOperationSimple)(task.data)(settings); // TODO discontinue
|
|
80
|
-
// }
|
|
81
47
|
const result = {
|
|
82
48
|
executedAt: now,
|
|
83
49
|
endDate: new Date(),
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/client-cognito-identity-provider": "3.1090.0",
|
|
13
13
|
"@aws-sdk/credential-providers": "3.1090.0",
|
|
14
|
-
"@chevre/factory": "10.1.0-alpha.
|
|
14
|
+
"@chevre/factory": "10.1.0-alpha.4",
|
|
15
15
|
"@motionpicture/coa-service": "10.0.0",
|
|
16
16
|
"@motionpicture/gmo-service": "6.1.0-alpha.0",
|
|
17
17
|
"@sendgrid/client": "8.1.4",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"postversion": "git push origin --tags",
|
|
89
89
|
"prepublishOnly": "npm run clean && npm run build"
|
|
90
90
|
},
|
|
91
|
-
"version": "26.0.0-alpha.
|
|
91
|
+
"version": "26.0.0-alpha.3"
|
|
92
92
|
}
|