@chevre/domain 26.0.0-alpha.2 → 26.0.0-alpha.4
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/aggregateScheduledTask.d.ts +32 -0
- package/lib/chevre/repo/aggregateScheduledTask.js +136 -0
- package/lib/chevre/repository.d.ts +5 -0
- package/lib/chevre/repository.js +13 -2
- package/lib/chevre/service/aggregation/system.d.ts +10 -2
- package/lib/chevre/service/aggregation/system.js +42 -0
- 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/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,32 @@
|
|
|
1
|
+
import type { Connection } from 'mongoose';
|
|
2
|
+
import { factory } from '../factory';
|
|
3
|
+
interface IAggregationByStatus {
|
|
4
|
+
taskCount: number;
|
|
5
|
+
avgLatency: number;
|
|
6
|
+
maxLatency: number;
|
|
7
|
+
minLatency: number;
|
|
8
|
+
percentilesLatency: {
|
|
9
|
+
name: string;
|
|
10
|
+
value: number;
|
|
11
|
+
}[];
|
|
12
|
+
}
|
|
13
|
+
interface IStatus {
|
|
14
|
+
status: factory.taskStatus;
|
|
15
|
+
aggregation: IAggregationByStatus;
|
|
16
|
+
}
|
|
17
|
+
interface IAggregateTask {
|
|
18
|
+
statuses: IStatus[];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 予定タスク集計リポジトリ
|
|
22
|
+
*/
|
|
23
|
+
export declare class AggregateScheduledTaskRepo {
|
|
24
|
+
private readonly scheduledTaskModel;
|
|
25
|
+
constructor(connection: Connection);
|
|
26
|
+
aggregateScheduledTask(params: {
|
|
27
|
+
runsFrom: Date;
|
|
28
|
+
runsThrough: Date;
|
|
29
|
+
}): Promise<IAggregateTask>;
|
|
30
|
+
private agggregateByStatus;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AggregateScheduledTaskRepo = void 0;
|
|
4
|
+
const factory_1 = require("../factory");
|
|
5
|
+
const scheduledTasks_1 = require("./mongoose/schemas/scheduledTasks");
|
|
6
|
+
/**
|
|
7
|
+
* 予定タスク集計リポジトリ
|
|
8
|
+
*/
|
|
9
|
+
class AggregateScheduledTaskRepo {
|
|
10
|
+
scheduledTaskModel;
|
|
11
|
+
constructor(connection) {
|
|
12
|
+
this.scheduledTaskModel = connection.model(scheduledTasks_1.modelName, (0, scheduledTasks_1.createSchema)());
|
|
13
|
+
}
|
|
14
|
+
async aggregateScheduledTask(params) {
|
|
15
|
+
const statuses = await Promise.all([
|
|
16
|
+
factory_1.factory.taskStatus.Executed,
|
|
17
|
+
factory_1.factory.taskStatus.Aborted
|
|
18
|
+
].map(async (taskStatus) => {
|
|
19
|
+
const matchConditions = {
|
|
20
|
+
status: { $eq: taskStatus },
|
|
21
|
+
runsAt: {
|
|
22
|
+
$gte: params.runsFrom,
|
|
23
|
+
$lte: params.runsThrough
|
|
24
|
+
},
|
|
25
|
+
// ...(typeof params.project?.id?.$ne === 'string')
|
|
26
|
+
// ? { 'project.id': { $ne: params.project.id.$ne } }
|
|
27
|
+
// : undefined
|
|
28
|
+
};
|
|
29
|
+
return this.agggregateByStatus({ matchConditions, status: taskStatus });
|
|
30
|
+
}));
|
|
31
|
+
return { statuses };
|
|
32
|
+
}
|
|
33
|
+
async agggregateByStatus(params) {
|
|
34
|
+
const matchConditions = params.matchConditions;
|
|
35
|
+
const taskStatus = params.status;
|
|
36
|
+
const aggregate1 = this.scheduledTaskModel.aggregate([
|
|
37
|
+
{
|
|
38
|
+
$match: matchConditions
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
$project: {
|
|
42
|
+
latency: { $subtract: ['$lastTriedAt', '$runsAt'] },
|
|
43
|
+
status: '$status',
|
|
44
|
+
runsAt: '$runsAt',
|
|
45
|
+
lastTriedAt: '$lastTriedAt'
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
$group: {
|
|
50
|
+
_id: '$status',
|
|
51
|
+
taskCount: { $sum: 1 },
|
|
52
|
+
maxLatency: { $max: '$latency' },
|
|
53
|
+
minLatency: { $min: '$latency' },
|
|
54
|
+
avgLatency: { $avg: '$latency' }
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
$project: {
|
|
59
|
+
_id: 0,
|
|
60
|
+
taskCount: '$taskCount',
|
|
61
|
+
avgLatency: '$avgLatency',
|
|
62
|
+
maxLatency: '$maxLatency',
|
|
63
|
+
minLatency: '$minLatency'
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
]);
|
|
67
|
+
// const explainResult = await aggregate1.explain();
|
|
68
|
+
// console.dir(explainResult, { depth: null });
|
|
69
|
+
// return;
|
|
70
|
+
const aggregations = await aggregate1.exec();
|
|
71
|
+
const percents = [50, 95, 99];
|
|
72
|
+
if (aggregations.length === 0) {
|
|
73
|
+
return {
|
|
74
|
+
status: taskStatus,
|
|
75
|
+
aggregation: {
|
|
76
|
+
taskCount: 0,
|
|
77
|
+
avgLatency: 0,
|
|
78
|
+
maxLatency: 0,
|
|
79
|
+
minLatency: 0,
|
|
80
|
+
percentilesLatency: percents.map((percent) => {
|
|
81
|
+
return {
|
|
82
|
+
name: String(percent),
|
|
83
|
+
value: 0
|
|
84
|
+
};
|
|
85
|
+
})
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
const ranks4percentile = percents.map((percentile) => {
|
|
90
|
+
return {
|
|
91
|
+
percentile,
|
|
92
|
+
rank: Math.floor(aggregations[0].taskCount * percentile / 100)
|
|
93
|
+
};
|
|
94
|
+
});
|
|
95
|
+
const aggregate2 = this.scheduledTaskModel.aggregate([
|
|
96
|
+
{
|
|
97
|
+
$match: matchConditions
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
$project: {
|
|
101
|
+
latency: { $subtract: ['$lastTriedAt', '$runsAt'] },
|
|
102
|
+
status: '$status',
|
|
103
|
+
runsAt: '$runsAt',
|
|
104
|
+
lastTriedAt: '$lastTriedAt'
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
{ $sort: { latency: 1 } },
|
|
108
|
+
{
|
|
109
|
+
$group: {
|
|
110
|
+
_id: '$status',
|
|
111
|
+
latencies: { $push: '$latency' }
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
$project: {
|
|
116
|
+
_id: 0,
|
|
117
|
+
percentilesLatency: ranks4percentile.map((rank) => {
|
|
118
|
+
return {
|
|
119
|
+
name: String(rank.percentile),
|
|
120
|
+
value: { $arrayElemAt: ['$latencies', rank.rank] }
|
|
121
|
+
};
|
|
122
|
+
})
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
]);
|
|
126
|
+
const aggregations2 = await aggregate2.exec();
|
|
127
|
+
return {
|
|
128
|
+
status: taskStatus,
|
|
129
|
+
aggregation: {
|
|
130
|
+
...aggregations[0],
|
|
131
|
+
...aggregations2[0]
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
exports.AggregateScheduledTaskRepo = AggregateScheduledTaskRepo;
|
|
@@ -24,6 +24,7 @@ import type { AggregateActionRepo } from './repo/aggregateAction';
|
|
|
24
24
|
import type { AggregateOfferRepo } from './repo/aggregateOffer';
|
|
25
25
|
import type { AggregateOrderRepo } from './repo/aggregateOrder';
|
|
26
26
|
import type { AggregateReservationRepo } from './repo/aggregateReservation';
|
|
27
|
+
import type { AggregateScheduledTaskRepo } from './repo/aggregateScheduledTask';
|
|
27
28
|
import type { AggregateTaskRepo } from './repo/aggregateTask';
|
|
28
29
|
import type { AggregationRepo } from './repo/aggregation';
|
|
29
30
|
import type { AssetTransactionRepo } from './repo/assetTransaction';
|
|
@@ -180,6 +181,10 @@ export type AggregateAction = AggregateActionRepo;
|
|
|
180
181
|
export declare namespace AggregateAction {
|
|
181
182
|
function createInstance(...params: ConstructorParameters<typeof AggregateActionRepo>): Promise<AggregateActionRepo>;
|
|
182
183
|
}
|
|
184
|
+
export type AggregateScheduledTask = AggregateScheduledTaskRepo;
|
|
185
|
+
export declare namespace AggregateScheduledTask {
|
|
186
|
+
function createInstance(...params: ConstructorParameters<typeof AggregateScheduledTaskRepo>): Promise<AggregateScheduledTaskRepo>;
|
|
187
|
+
}
|
|
183
188
|
export type AggregateTask = AggregateTaskRepo;
|
|
184
189
|
export declare namespace AggregateTask {
|
|
185
190
|
function createInstance(...params: ConstructorParameters<typeof AggregateTaskRepo>): Promise<AggregateTaskRepo>;
|
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 = exports.PaymentServiceProvider = void 0;
|
|
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.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 = exports.PaymentServiceChannel = void 0;
|
|
5
5
|
var AcceptedOffer;
|
|
6
6
|
(function (AcceptedOffer) {
|
|
7
7
|
let repo;
|
|
@@ -214,6 +214,17 @@ var AggregateAction;
|
|
|
214
214
|
}
|
|
215
215
|
AggregateAction.createInstance = createInstance;
|
|
216
216
|
})(AggregateAction || (exports.AggregateAction = AggregateAction = {}));
|
|
217
|
+
var AggregateScheduledTask;
|
|
218
|
+
(function (AggregateScheduledTask) {
|
|
219
|
+
let repo;
|
|
220
|
+
async function createInstance(...params) {
|
|
221
|
+
if (repo === undefined) {
|
|
222
|
+
repo = (await import('./repo/aggregateScheduledTask.js')).AggregateScheduledTaskRepo;
|
|
223
|
+
}
|
|
224
|
+
return new repo(...params);
|
|
225
|
+
}
|
|
226
|
+
AggregateScheduledTask.createInstance = createInstance;
|
|
227
|
+
})(AggregateScheduledTask || (exports.AggregateScheduledTask = AggregateScheduledTask = {}));
|
|
217
228
|
var AggregateTask;
|
|
218
229
|
(function (AggregateTask) {
|
|
219
230
|
let repo;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AggregateActionRepo } from '../../repo/aggregateAction';
|
|
2
|
+
import type { AggregateScheduledTaskRepo } from '../../repo/aggregateScheduledTask';
|
|
2
3
|
import type { AggregateTaskRepo } from '../../repo/aggregateTask';
|
|
3
4
|
import { AggregationRepo } from '../../repo/aggregation';
|
|
4
5
|
import type { AssetTransactionRepo } from '../../repo/assetTransaction';
|
|
@@ -10,7 +11,7 @@ interface IAggregateParams {
|
|
|
10
11
|
aggregateDate: Date;
|
|
11
12
|
aggregateDurationUnit: AggregateDurationUnit;
|
|
12
13
|
aggregationCount: number;
|
|
13
|
-
excludedProjectId?:
|
|
14
|
+
excludedProjectId?: never;
|
|
14
15
|
}
|
|
15
16
|
declare function aggregateEvent(params: IAggregateParams): (repos: {
|
|
16
17
|
agregation: AggregationRepo;
|
|
@@ -146,4 +147,11 @@ declare function aggregateTask(params: IAggregateParams): (repos: {
|
|
|
146
147
|
aggregationCount: number;
|
|
147
148
|
aggregateDuration: string;
|
|
148
149
|
}>;
|
|
149
|
-
|
|
150
|
+
declare function aggregateScheduledTask(params: IAggregateParams): (repos: {
|
|
151
|
+
agregation: AggregationRepo;
|
|
152
|
+
aggregateScheduledTask: AggregateScheduledTaskRepo;
|
|
153
|
+
}) => Promise<{
|
|
154
|
+
aggregationCount: number;
|
|
155
|
+
aggregateDuration: string;
|
|
156
|
+
}>;
|
|
157
|
+
export { aggregateAuthorizeEventServiceOfferAction, aggregateAuthorizeOrderAction, aggregateAuthorizePaymentAction, aggregateCancelReservationAction, aggregateCheckMovieTicketAction, aggregateEvent, aggregateOrder, aggregateOrderAction, aggregatePayMovieTicketAction, aggregatePayTransaction, aggregatePlaceOrder, aggregateReserveAction, aggregateReserveTransaction, aggregateTask, aggregateScheduledTask, aggregateUseAction };
|
|
@@ -17,6 +17,7 @@ exports.aggregatePlaceOrder = aggregatePlaceOrder;
|
|
|
17
17
|
exports.aggregateReserveAction = aggregateReserveAction;
|
|
18
18
|
exports.aggregateReserveTransaction = aggregateReserveTransaction;
|
|
19
19
|
exports.aggregateTask = aggregateTask;
|
|
20
|
+
exports.aggregateScheduledTask = aggregateScheduledTask;
|
|
20
21
|
exports.aggregateUseAction = aggregateUseAction;
|
|
21
22
|
const debug_1 = __importDefault(require("debug"));
|
|
22
23
|
const moment_timezone_1 = __importDefault(require("moment-timezone"));
|
|
@@ -692,3 +693,44 @@ function aggregateTask(params) {
|
|
|
692
693
|
return { aggregationCount: i, aggregateDuration };
|
|
693
694
|
};
|
|
694
695
|
}
|
|
696
|
+
function aggregateScheduledTask(params) {
|
|
697
|
+
return async (repos) => {
|
|
698
|
+
const { aggregateDate } = params;
|
|
699
|
+
if (!(aggregateDate instanceof Date)) {
|
|
700
|
+
throw new factory_1.factory.errors.Argument('aggregateDate', 'must be Date');
|
|
701
|
+
}
|
|
702
|
+
const aggregateDuration = moment_timezone_1.default.duration(1, params.aggregateDurationUnit)
|
|
703
|
+
.toISOString();
|
|
704
|
+
let i = -1;
|
|
705
|
+
while (i < params.aggregationCount) {
|
|
706
|
+
i += 1;
|
|
707
|
+
const runsFrom = (0, moment_timezone_1.default)(aggregateDate)
|
|
708
|
+
.utc()
|
|
709
|
+
// .tz('Asia/Tokyo')
|
|
710
|
+
.add(-i, params.aggregateDurationUnit)
|
|
711
|
+
.startOf(params.aggregateDurationUnit)
|
|
712
|
+
.toDate();
|
|
713
|
+
const runsThrough = (0, moment_timezone_1.default)(aggregateDate)
|
|
714
|
+
.utc()
|
|
715
|
+
// .tz('Asia/Tokyo')
|
|
716
|
+
.add(-i, params.aggregateDurationUnit)
|
|
717
|
+
.endOf(params.aggregateDurationUnit)
|
|
718
|
+
.toDate();
|
|
719
|
+
const aggregateResult = await repos.aggregateScheduledTask.aggregateScheduledTask({
|
|
720
|
+
// project: { id: { $ne: params.excludedProjectId } },
|
|
721
|
+
runsFrom,
|
|
722
|
+
runsThrough
|
|
723
|
+
});
|
|
724
|
+
await repos.agregation.saveAggregation({
|
|
725
|
+
typeOf: factory_1.factory.aggregation.AggregationType.AggregateScheduledTask,
|
|
726
|
+
project: { id: '*', typeOf: factory_1.factory.organizationType.Project },
|
|
727
|
+
aggregateDuration,
|
|
728
|
+
aggregateStart: runsFrom,
|
|
729
|
+
aggregateDate,
|
|
730
|
+
...aggregateResult
|
|
731
|
+
});
|
|
732
|
+
}
|
|
733
|
+
debug(i, 'aggregations saved');
|
|
734
|
+
return { aggregationCount: i, aggregateDuration };
|
|
735
|
+
};
|
|
736
|
+
}
|
|
@@ -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
|
|
@@ -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.5",
|
|
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.4"
|
|
92
92
|
}
|