@chevre/domain 26.1.0-alpha.0 → 26.1.0-alpha.2
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/accountingReport.d.ts +1 -32
- package/lib/chevre/repo/accountingReport.js +4 -85
- package/lib/chevre/repo/action/checkMovieTicket.d.ts +44 -54
- package/lib/chevre/repo/action/checkMovieTicket.js +71 -66
- package/lib/chevre/repo/action/dedicatedAction/dedicatedActionProcess.d.ts +5 -5
- package/lib/chevre/repo/adminAccountingReport.d.ts +40 -0
- package/lib/chevre/repo/adminAccountingReport.js +89 -0
- package/lib/chevre/repo/adminCheckMovieTicketAction.d.ts +29 -0
- package/lib/chevre/repo/adminCheckMovieTicketAction.js +87 -0
- package/lib/chevre/repo/aggregateAction.d.ts +1 -10
- package/lib/chevre/repo/aggregateAction.js +0 -25
- package/lib/chevre/repo/aggregateCheckMovieTicketAction.d.ts +31 -0
- package/lib/chevre/repo/aggregateCheckMovieTicketAction.js +138 -0
- package/lib/chevre/repo/aggregateUseAction.d.ts +0 -9
- package/lib/chevre/repo/aggregateUseAction.js +0 -25
- package/lib/chevre/repo/mongoose/schemas/action/checkMovieTicket.d.ts +11 -0
- package/lib/chevre/repo/mongoose/schemas/action/checkMovieTicket.js +108 -0
- package/lib/chevre/repository.d.ts +15 -0
- package/lib/chevre/repository.js +35 -2
- package/lib/chevre/service/aggregation/system.d.ts +2 -1
- package/lib/chevre/service/aggregation/system.js +1 -2
- package/lib/chevre/service/order/deleteOrder.d.ts +2 -2
- package/lib/chevre/service/order/deleteOrder.js +1 -1
- package/lib/chevre/service/payment/movieTicket/checkMovieTicket.js +4 -4
- package/lib/chevre/service/payment/movieTicket/validation.js +13 -43
- package/lib/chevre/service/task/deleteTransaction.js +2 -2
- package/lib/chevre/service/transaction/deleteTransaction.d.ts +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Connection, FilterQuery } from 'mongoose';
|
|
2
|
+
import { factory } from '../factory';
|
|
3
|
+
import { IDocType } from './mongoose/schemas/action/checkMovieTicket';
|
|
4
|
+
type IAction = IDocType & {
|
|
5
|
+
id: string;
|
|
6
|
+
};
|
|
7
|
+
type IKeyOfProjection = keyof IDocType;
|
|
8
|
+
type IFindParams = Pick<factory.action.ISearchConditions, 'limit' | 'page' | 'project' | 'sort' | 'startFrom' | 'startThrough'> & {
|
|
9
|
+
id?: string;
|
|
10
|
+
sameAs?: {
|
|
11
|
+
id?: string;
|
|
12
|
+
};
|
|
13
|
+
purpose?: {
|
|
14
|
+
id?: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* 決済カード認証アクション(専用コレクション分離済)管理リポジトリ
|
|
19
|
+
*/
|
|
20
|
+
export declare class AdminCheckMovieTicketActionRepo {
|
|
21
|
+
/**
|
|
22
|
+
* 専用アクションモデル
|
|
23
|
+
*/
|
|
24
|
+
private readonly checkMovieTicketActionModel;
|
|
25
|
+
constructor(connection: Connection);
|
|
26
|
+
static CREATE_MONGO_CONDITIONS(params: Pick<IFindParams, 'id' | 'project' | 'purpose' | 'sameAs' | 'startFrom' | 'startThrough'>): FilterQuery<Pick<import("@chevre/factory/lib/chevre/action/check/paymentMethod/movieTicket").IAction, "object" | "error" | "project" | "typeOf" | "expires" | "startDate" | "endDate" | "instrument" | "agent" | "purpose" | "sameAs" | "actionStatus">>[];
|
|
27
|
+
findCheckMovieTicketActions(params: IFindParams, inclusion: IKeyOfProjection[]): Promise<IAction[]>;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AdminCheckMovieTicketActionRepo = void 0;
|
|
4
|
+
const settings_1 = require("../settings");
|
|
5
|
+
const checkMovieTicket_1 = require("./mongoose/schemas/action/checkMovieTicket");
|
|
6
|
+
const AVAILABLE_PROJECT_FIELDS = [
|
|
7
|
+
'project',
|
|
8
|
+
'actionStatus',
|
|
9
|
+
'typeOf',
|
|
10
|
+
'agent',
|
|
11
|
+
'error',
|
|
12
|
+
'object',
|
|
13
|
+
'startDate',
|
|
14
|
+
'endDate',
|
|
15
|
+
'instrument',
|
|
16
|
+
'expires',
|
|
17
|
+
'purpose',
|
|
18
|
+
'typeOf'
|
|
19
|
+
];
|
|
20
|
+
/**
|
|
21
|
+
* 決済カード認証アクション(専用コレクション分離済)管理リポジトリ
|
|
22
|
+
*/
|
|
23
|
+
class AdminCheckMovieTicketActionRepo {
|
|
24
|
+
/**
|
|
25
|
+
* 専用アクションモデル
|
|
26
|
+
*/
|
|
27
|
+
checkMovieTicketActionModel;
|
|
28
|
+
constructor(connection) {
|
|
29
|
+
this.checkMovieTicketActionModel = connection.model(checkMovieTicket_1.modelName, (0, checkMovieTicket_1.createSchema)());
|
|
30
|
+
}
|
|
31
|
+
static CREATE_MONGO_CONDITIONS(params) {
|
|
32
|
+
const andConditions = [];
|
|
33
|
+
const idEq = params.id;
|
|
34
|
+
if (typeof idEq === 'string') {
|
|
35
|
+
andConditions.push({ _id: { $eq: idEq } });
|
|
36
|
+
}
|
|
37
|
+
const projectIdEq = params.project?.id?.$eq;
|
|
38
|
+
if (typeof projectIdEq === 'string') {
|
|
39
|
+
andConditions.push({ 'project.id': { $eq: projectIdEq } });
|
|
40
|
+
}
|
|
41
|
+
const startDateGte = params.startFrom;
|
|
42
|
+
if (startDateGte instanceof Date) {
|
|
43
|
+
andConditions.push({ startDate: { $gte: startDateGte } });
|
|
44
|
+
}
|
|
45
|
+
const startDateLte = params.startThrough;
|
|
46
|
+
if (startDateLte instanceof Date) {
|
|
47
|
+
andConditions.push({ startDate: { $lte: startDateLte } });
|
|
48
|
+
}
|
|
49
|
+
const sameAsIdEq = params.sameAs?.id;
|
|
50
|
+
if (typeof sameAsIdEq === 'string') {
|
|
51
|
+
andConditions.push({ 'sameAs.id': { $exists: true, $eq: sameAsIdEq } });
|
|
52
|
+
}
|
|
53
|
+
const purposeIdEq = params.purpose?.id;
|
|
54
|
+
if (typeof purposeIdEq === 'string') {
|
|
55
|
+
andConditions.push({ 'purpose.id': { $exists: true, $eq: purposeIdEq } });
|
|
56
|
+
}
|
|
57
|
+
return andConditions;
|
|
58
|
+
}
|
|
59
|
+
async findCheckMovieTicketActions(params, inclusion) {
|
|
60
|
+
const conditions = AdminCheckMovieTicketActionRepo.CREATE_MONGO_CONDITIONS(params);
|
|
61
|
+
let positiveProjectionFields = AVAILABLE_PROJECT_FIELDS;
|
|
62
|
+
if (Array.isArray(inclusion) && inclusion.length > 0) {
|
|
63
|
+
positiveProjectionFields = inclusion.filter((key) => AVAILABLE_PROJECT_FIELDS.includes(key));
|
|
64
|
+
}
|
|
65
|
+
const projection = {
|
|
66
|
+
_id: 0,
|
|
67
|
+
id: { $toString: '$_id' },
|
|
68
|
+
...Object.fromEntries(positiveProjectionFields.map((key) => ([key, 1])))
|
|
69
|
+
};
|
|
70
|
+
const query = this.checkMovieTicketActionModel.find((conditions.length > 0) ? { $and: conditions } : {}, projection);
|
|
71
|
+
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
72
|
+
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
73
|
+
query.limit(params.limit)
|
|
74
|
+
.skip(params.limit * (page - 1));
|
|
75
|
+
}
|
|
76
|
+
/* istanbul ignore else */
|
|
77
|
+
if (params.sort?.startDate !== undefined) {
|
|
78
|
+
query.sort({ startDate: params.sort.startDate });
|
|
79
|
+
}
|
|
80
|
+
// const explainResult = await (<any>query).explain();
|
|
81
|
+
// console.log(explainResult[0].executionStats.allPlansExecution.map((e: any) => e.executionStages.inputStage));
|
|
82
|
+
return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
83
|
+
.lean() // 2024-08-26~
|
|
84
|
+
.exec();
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
exports.AdminCheckMovieTicketActionRepo = AdminCheckMovieTicketActionRepo;
|
|
@@ -17,7 +17,7 @@ export interface IStatus {
|
|
|
17
17
|
export interface IAggregateAction {
|
|
18
18
|
statuses: IStatus[];
|
|
19
19
|
}
|
|
20
|
-
type IAvailableActionType = Exclude<factory.actionType, factory.actionType.AddAction | factory.actionType.UpdateAction | factory.actionType.ReplaceAction | factory.actionType.DeleteAction | factory.actionType.InformAction | factory.actionType.UseAction>;
|
|
20
|
+
type IAvailableActionType = Exclude<factory.actionType, factory.actionType.AddAction | factory.actionType.UpdateAction | factory.actionType.ReplaceAction | factory.actionType.DeleteAction | factory.actionType.InformAction | factory.actionType.UseAction | factory.actionType.CheckAction>;
|
|
21
21
|
/**
|
|
22
22
|
* アクション集計リポジトリ
|
|
23
23
|
*/
|
|
@@ -76,15 +76,6 @@ export declare class AggregateActionRepo {
|
|
|
76
76
|
startThrough: Date;
|
|
77
77
|
typeOf: IAvailableActionType;
|
|
78
78
|
}): Promise<IAggregateAction>;
|
|
79
|
-
aggregateCheckMovieTicketAction(params: {
|
|
80
|
-
project?: {
|
|
81
|
-
id?: {
|
|
82
|
-
$ne?: string;
|
|
83
|
-
};
|
|
84
|
-
};
|
|
85
|
-
startFrom: Date;
|
|
86
|
-
startThrough: Date;
|
|
87
|
-
}): Promise<IAggregateAction>;
|
|
88
79
|
aggregatePayMovieTicketAction(params: {
|
|
89
80
|
project?: {
|
|
90
81
|
id?: {
|
|
@@ -140,31 +140,6 @@ class AggregateActionRepo {
|
|
|
140
140
|
}));
|
|
141
141
|
return { statuses };
|
|
142
142
|
}
|
|
143
|
-
async aggregateCheckMovieTicketAction(params) {
|
|
144
|
-
const statuses = await Promise.all([
|
|
145
|
-
factory_1.factory.actionStatusType.CompletedActionStatus,
|
|
146
|
-
factory_1.factory.actionStatusType.CanceledActionStatus,
|
|
147
|
-
factory_1.factory.actionStatusType.FailedActionStatus
|
|
148
|
-
].map(async (actionStatus) => {
|
|
149
|
-
const matchConditions = {
|
|
150
|
-
startDate: {
|
|
151
|
-
$gte: params.startFrom,
|
|
152
|
-
$lte: params.startThrough
|
|
153
|
-
},
|
|
154
|
-
typeOf: { $eq: factory_1.factory.actionType.CheckAction },
|
|
155
|
-
'object.typeOf': {
|
|
156
|
-
$exists: true,
|
|
157
|
-
$eq: factory_1.factory.service.paymentService.PaymentServiceType.MovieTicket
|
|
158
|
-
},
|
|
159
|
-
actionStatus: { $eq: actionStatus },
|
|
160
|
-
...(typeof params.project?.id?.$ne === 'string')
|
|
161
|
-
? { 'project.id': { $ne: params.project.id.$ne } }
|
|
162
|
-
: undefined
|
|
163
|
-
};
|
|
164
|
-
return this.agggregateByStatus({ matchConditions, actionStatus });
|
|
165
|
-
}));
|
|
166
|
-
return { statuses };
|
|
167
|
-
}
|
|
168
143
|
async aggregatePayMovieTicketAction(params) {
|
|
169
144
|
const statuses = await Promise.all([
|
|
170
145
|
factory_1.factory.actionStatusType.CompletedActionStatus,
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Connection } from 'mongoose';
|
|
2
|
+
import { factory } from '../factory';
|
|
3
|
+
export interface IAggregationByStatus {
|
|
4
|
+
actionCount: number;
|
|
5
|
+
avgDuration: number;
|
|
6
|
+
maxDuration: number;
|
|
7
|
+
minDuration: number;
|
|
8
|
+
percentilesDuration: {
|
|
9
|
+
name: string;
|
|
10
|
+
value: number;
|
|
11
|
+
}[];
|
|
12
|
+
}
|
|
13
|
+
export interface IStatus {
|
|
14
|
+
status: factory.actionStatusType;
|
|
15
|
+
aggregation: IAggregationByStatus;
|
|
16
|
+
}
|
|
17
|
+
export interface IAggregateAction {
|
|
18
|
+
statuses: IStatus[];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 認証アクション(専用コレクション分離済)集計リポジトリ
|
|
22
|
+
*/
|
|
23
|
+
export declare class AggregateCheckMovieTicketActionRepo {
|
|
24
|
+
private readonly checkMovieTicketActionModel;
|
|
25
|
+
constructor(connection: Connection);
|
|
26
|
+
aggregateCheckMovieTicketAction(params: {
|
|
27
|
+
startFrom: Date;
|
|
28
|
+
startThrough: Date;
|
|
29
|
+
}): Promise<IAggregateAction>;
|
|
30
|
+
private agggregateByStatus;
|
|
31
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AggregateCheckMovieTicketActionRepo = void 0;
|
|
4
|
+
const factory_1 = require("../factory");
|
|
5
|
+
const checkMovieTicket_1 = require("./mongoose/schemas/action/checkMovieTicket");
|
|
6
|
+
/**
|
|
7
|
+
* 認証アクション(専用コレクション分離済)集計リポジトリ
|
|
8
|
+
*/
|
|
9
|
+
class AggregateCheckMovieTicketActionRepo {
|
|
10
|
+
checkMovieTicketActionModel;
|
|
11
|
+
constructor(connection) {
|
|
12
|
+
this.checkMovieTicketActionModel = connection.model(checkMovieTicket_1.modelName, (0, checkMovieTicket_1.createSchema)());
|
|
13
|
+
}
|
|
14
|
+
async aggregateCheckMovieTicketAction(params) {
|
|
15
|
+
const statuses = await Promise.all([
|
|
16
|
+
factory_1.factory.actionStatusType.CompletedActionStatus,
|
|
17
|
+
factory_1.factory.actionStatusType.CanceledActionStatus,
|
|
18
|
+
factory_1.factory.actionStatusType.FailedActionStatus
|
|
19
|
+
].map(async (actionStatus) => {
|
|
20
|
+
const matchConditions = {
|
|
21
|
+
startDate: {
|
|
22
|
+
$gte: params.startFrom,
|
|
23
|
+
$lte: params.startThrough
|
|
24
|
+
},
|
|
25
|
+
// 専用アクションリポジトリへ移行につき検索条件は不要(2026-08-21~)
|
|
26
|
+
// typeOf: { $eq: factory.actionType.CheckAction },
|
|
27
|
+
// 'object.typeOf': {
|
|
28
|
+
// $exists: true,
|
|
29
|
+
// $eq: factory.service.paymentService.PaymentServiceType.MovieTicket
|
|
30
|
+
// },
|
|
31
|
+
actionStatus: { $eq: actionStatus }
|
|
32
|
+
};
|
|
33
|
+
return this.agggregateByStatus({ matchConditions, actionStatus });
|
|
34
|
+
}));
|
|
35
|
+
return { statuses };
|
|
36
|
+
}
|
|
37
|
+
async agggregateByStatus(params) {
|
|
38
|
+
const aggregations = await this.checkMovieTicketActionModel.aggregate([
|
|
39
|
+
{ $match: params.matchConditions },
|
|
40
|
+
{
|
|
41
|
+
$project: {
|
|
42
|
+
duration: { $subtract: ['$endDate', '$startDate'] },
|
|
43
|
+
actionStatus: '$actionStatus',
|
|
44
|
+
startDate: '$startDate',
|
|
45
|
+
endDate: '$endDate',
|
|
46
|
+
typeOf: '$typeOf'
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
$group: {
|
|
51
|
+
_id: '$typeOf',
|
|
52
|
+
actionCount: { $sum: 1 },
|
|
53
|
+
maxDuration: { $max: '$duration' },
|
|
54
|
+
minDuration: { $min: '$duration' },
|
|
55
|
+
avgDuration: { $avg: '$duration' }
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
$project: {
|
|
60
|
+
_id: 0,
|
|
61
|
+
actionCount: '$actionCount',
|
|
62
|
+
avgDuration: '$avgDuration',
|
|
63
|
+
maxDuration: '$maxDuration',
|
|
64
|
+
minDuration: '$minDuration'
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
])
|
|
68
|
+
.exec();
|
|
69
|
+
const percents = [50, 95, 99];
|
|
70
|
+
if (aggregations.length === 0) {
|
|
71
|
+
return {
|
|
72
|
+
status: params.actionStatus,
|
|
73
|
+
aggregation: {
|
|
74
|
+
actionCount: 0,
|
|
75
|
+
avgDuration: 0,
|
|
76
|
+
maxDuration: 0,
|
|
77
|
+
minDuration: 0,
|
|
78
|
+
percentilesDuration: percents.map((percent) => {
|
|
79
|
+
return {
|
|
80
|
+
name: String(percent),
|
|
81
|
+
value: 0
|
|
82
|
+
};
|
|
83
|
+
})
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
const ranks4percentile = percents.map((percentile) => {
|
|
88
|
+
return {
|
|
89
|
+
percentile,
|
|
90
|
+
rank: Math.floor(aggregations[0].actionCount * percentile / 100)
|
|
91
|
+
};
|
|
92
|
+
});
|
|
93
|
+
const aggregations2 = await this.checkMovieTicketActionModel.aggregate([
|
|
94
|
+
{
|
|
95
|
+
$match: params.matchConditions
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
$project: {
|
|
99
|
+
duration: { $subtract: ['$endDate', '$startDate'] },
|
|
100
|
+
actionStatus: '$actionStatus',
|
|
101
|
+
startDate: '$startDate',
|
|
102
|
+
endDate: '$endDate',
|
|
103
|
+
typeOf: '$typeOf'
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
{ $sort: { duration: 1 } },
|
|
107
|
+
{
|
|
108
|
+
$group: {
|
|
109
|
+
_id: '$typeOf',
|
|
110
|
+
durations: { $push: '$duration' }
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
$project: {
|
|
115
|
+
_id: 0,
|
|
116
|
+
avgSmallDuration: '$avgSmallDuration',
|
|
117
|
+
avgMediumDuration: '$avgMediumDuration',
|
|
118
|
+
avgLargeDuration: '$avgLargeDuration',
|
|
119
|
+
percentilesDuration: ranks4percentile.map((rank) => {
|
|
120
|
+
return {
|
|
121
|
+
name: String(rank.percentile),
|
|
122
|
+
value: { $arrayElemAt: ['$durations', rank.rank] }
|
|
123
|
+
};
|
|
124
|
+
})
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
])
|
|
128
|
+
.exec();
|
|
129
|
+
return {
|
|
130
|
+
status: params.actionStatus,
|
|
131
|
+
aggregation: {
|
|
132
|
+
...aggregations[0],
|
|
133
|
+
...aggregations2[0]
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
exports.AggregateCheckMovieTicketActionRepo = AggregateCheckMovieTicketActionRepo;
|
|
@@ -21,15 +21,6 @@ export declare class AggregateUseActionRepo {
|
|
|
21
21
|
startThrough: Date;
|
|
22
22
|
typeOf: IAvailableActionType;
|
|
23
23
|
}): Promise<IAggregateAction>;
|
|
24
|
-
aggregateCheckMovieTicketAction(params: {
|
|
25
|
-
project?: {
|
|
26
|
-
id?: {
|
|
27
|
-
$ne?: string;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
startFrom: Date;
|
|
31
|
-
startThrough: Date;
|
|
32
|
-
}): Promise<IAggregateAction>;
|
|
33
24
|
private agggregateByStatus;
|
|
34
25
|
}
|
|
35
26
|
export {};
|
|
@@ -35,31 +35,6 @@ class AggregateUseActionRepo {
|
|
|
35
35
|
}));
|
|
36
36
|
return { statuses };
|
|
37
37
|
}
|
|
38
|
-
async aggregateCheckMovieTicketAction(params) {
|
|
39
|
-
const statuses = await Promise.all([
|
|
40
|
-
factory_1.factory.actionStatusType.CompletedActionStatus,
|
|
41
|
-
factory_1.factory.actionStatusType.CanceledActionStatus,
|
|
42
|
-
factory_1.factory.actionStatusType.FailedActionStatus
|
|
43
|
-
].map(async (actionStatus) => {
|
|
44
|
-
const matchConditions = {
|
|
45
|
-
startDate: {
|
|
46
|
-
$gte: params.startFrom,
|
|
47
|
-
$lte: params.startThrough
|
|
48
|
-
},
|
|
49
|
-
typeOf: { $eq: factory_1.factory.actionType.CheckAction },
|
|
50
|
-
'object.typeOf': {
|
|
51
|
-
$exists: true,
|
|
52
|
-
$eq: factory_1.factory.service.paymentService.PaymentServiceType.MovieTicket
|
|
53
|
-
},
|
|
54
|
-
actionStatus: { $eq: actionStatus },
|
|
55
|
-
...(typeof params.project?.id?.$ne === 'string')
|
|
56
|
-
? { 'project.id': { $ne: params.project.id.$ne } }
|
|
57
|
-
: undefined
|
|
58
|
-
};
|
|
59
|
-
return this.agggregateByStatus({ matchConditions, actionStatus });
|
|
60
|
-
}));
|
|
61
|
-
return { statuses };
|
|
62
|
-
}
|
|
63
38
|
async agggregateByStatus(params) {
|
|
64
39
|
const aggregations = await this.useActionModel.aggregate([
|
|
65
40
|
{ $match: params.matchConditions },
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
|
|
2
|
+
import { IVirtuals } from '../../virtuals';
|
|
3
|
+
import { factory } from '../../../../factory';
|
|
4
|
+
type IDocType = Pick<factory.action.check.paymentMethod.movieTicket.IAction, 'actionStatus' | 'agent' | 'endDate' | 'error' | 'expires' | 'instrument' | 'object' | 'project' | 'purpose' | 'sameAs' | 'startDate' | 'typeOf'> & {};
|
|
5
|
+
type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
|
|
6
|
+
type ISchemaDefinition = SchemaDefinition<IDocType>;
|
|
7
|
+
type ISchema = Schema<IDocType, IModel, Record<string, never>, Record<string, never>, IVirtuals, Record<string, never>, ISchemaDefinition, IDocType>;
|
|
8
|
+
declare const modelName = "Action.CheckMovieTicket";
|
|
9
|
+
declare const indexes: [d: IndexDefinition, o: IndexOptions][];
|
|
10
|
+
declare function createSchema(): ISchema;
|
|
11
|
+
export { createSchema, IDocType, IModel, indexes, modelName };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.modelName = exports.indexes = void 0;
|
|
4
|
+
exports.createSchema = createSchema;
|
|
5
|
+
const mongoose_1 = require("mongoose");
|
|
6
|
+
const writeConcern_1 = require("../../writeConcern");
|
|
7
|
+
const settings_1 = require("../../../../settings");
|
|
8
|
+
const modelName = 'Action.CheckMovieTicket';
|
|
9
|
+
exports.modelName = modelName;
|
|
10
|
+
const schemaDefinition = {
|
|
11
|
+
project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
12
|
+
actionStatus: { type: String, required: true },
|
|
13
|
+
typeOf: { type: String, required: true },
|
|
14
|
+
agent: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
15
|
+
object: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
16
|
+
startDate: { type: Date, required: true },
|
|
17
|
+
expires: { type: Date, required: true },
|
|
18
|
+
error: mongoose_1.SchemaTypes.Mixed,
|
|
19
|
+
endDate: Date,
|
|
20
|
+
purpose: mongoose_1.SchemaTypes.Mixed,
|
|
21
|
+
instrument: mongoose_1.SchemaTypes.Mixed,
|
|
22
|
+
sameAs: mongoose_1.SchemaTypes.Mixed,
|
|
23
|
+
// potentialActions: SchemaTypes.Mixed,
|
|
24
|
+
// result: SchemaTypes.Mixed,
|
|
25
|
+
};
|
|
26
|
+
const schemaOptions = {
|
|
27
|
+
autoIndex: settings_1.MONGO_AUTO_INDEX,
|
|
28
|
+
autoCreate: false,
|
|
29
|
+
collection: 'actions.checkMovieTicket',
|
|
30
|
+
id: true,
|
|
31
|
+
read: 'primary',
|
|
32
|
+
writeConcern: writeConcern_1.writeConcern,
|
|
33
|
+
strict: true,
|
|
34
|
+
strictQuery: false,
|
|
35
|
+
timestamps: false,
|
|
36
|
+
versionKey: false,
|
|
37
|
+
toJSON: {
|
|
38
|
+
getters: false,
|
|
39
|
+
virtuals: false,
|
|
40
|
+
minimize: false,
|
|
41
|
+
versionKey: false
|
|
42
|
+
},
|
|
43
|
+
toObject: {
|
|
44
|
+
getters: false,
|
|
45
|
+
virtuals: true,
|
|
46
|
+
minimize: false,
|
|
47
|
+
versionKey: false
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const indexes = [
|
|
51
|
+
[
|
|
52
|
+
{ expires: 1 },
|
|
53
|
+
{
|
|
54
|
+
name: 'expires',
|
|
55
|
+
expireAfterSeconds: 0
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
[
|
|
59
|
+
{ startDate: -1 },
|
|
60
|
+
{ name: 'startDate' }
|
|
61
|
+
],
|
|
62
|
+
[
|
|
63
|
+
{ 'project.id': 1, startDate: -1 },
|
|
64
|
+
{ name: 'projectId' }
|
|
65
|
+
],
|
|
66
|
+
[
|
|
67
|
+
{ typeOf: 1, startDate: -1 },
|
|
68
|
+
{ name: 'typeOf' }
|
|
69
|
+
],
|
|
70
|
+
[
|
|
71
|
+
{ actionStatus: 1, startDate: -1 },
|
|
72
|
+
{ name: 'actionStatus' }
|
|
73
|
+
],
|
|
74
|
+
[
|
|
75
|
+
{ 'sameAs.id': 1, startDate: -1 },
|
|
76
|
+
{
|
|
77
|
+
name: 'sameAsId',
|
|
78
|
+
partialFilterExpression: {
|
|
79
|
+
'sameAs.id': { $exists: true }
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
[
|
|
84
|
+
{ 'purpose.id': 1, startDate: -1 },
|
|
85
|
+
{
|
|
86
|
+
name: 'purposeId',
|
|
87
|
+
partialFilterExpression: {
|
|
88
|
+
'purpose.id': { $exists: true }
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
];
|
|
93
|
+
exports.indexes = indexes;
|
|
94
|
+
/**
|
|
95
|
+
* サーフロック認証アクションスキーマ
|
|
96
|
+
*/
|
|
97
|
+
let schema;
|
|
98
|
+
function createSchema() {
|
|
99
|
+
if (schema === undefined) {
|
|
100
|
+
schema = new mongoose_1.Schema(schemaDefinition, schemaOptions);
|
|
101
|
+
}
|
|
102
|
+
if (settings_1.MONGO_AUTO_INDEX) {
|
|
103
|
+
indexes.forEach((indexParams) => {
|
|
104
|
+
schema?.index(...indexParams);
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
return schema;
|
|
108
|
+
}
|
|
@@ -21,13 +21,16 @@ import type { OrderActionRepo } from './repo/action/order';
|
|
|
21
21
|
import type { ConfirmActionRepo } from './repo/action/confirm';
|
|
22
22
|
import type { AsyncActionRepo } from './repo/asyncAction';
|
|
23
23
|
import type { AdditionalPropertyRepo } from './repo/additionalProperty';
|
|
24
|
+
import type { AdminAccountingReportRepo } from './repo/adminAccountingReport';
|
|
24
25
|
import type { AdminActionRepo } from './repo/adminAction';
|
|
25
26
|
import type { AdminAssetTransactionRepo } from './repo/adminAssetTransaction';
|
|
27
|
+
import type { AdminCheckMovieTicketActionRepo } from './repo/adminCheckMovieTicketAction';
|
|
26
28
|
import type { AdminAsyncActionRepo } from './repo/adminAsyncAction';
|
|
27
29
|
import type { AdminScheduledTaskRepo } from './repo/adminScheduledTask';
|
|
28
30
|
import type { AdminTaskRepo } from './repo/adminTask';
|
|
29
31
|
import type { AdminTransactionRepo } from './repo/adminTransaction';
|
|
30
32
|
import type { AggregateActionRepo } from './repo/aggregateAction';
|
|
33
|
+
import type { AggregateCheckMovieTicketActionRepo } from './repo/aggregateCheckMovieTicketAction';
|
|
31
34
|
import type { AggregateUseActionRepo } from './repo/aggregateUseAction';
|
|
32
35
|
import type { AggregateAssetTransactionRepo } from './repo/aggregateAssetTransaction';
|
|
33
36
|
import type { AggregateOfferRepo } from './repo/aggregateOffer';
|
|
@@ -191,10 +194,18 @@ export type AdditionalProperty = AdditionalPropertyRepo;
|
|
|
191
194
|
export declare namespace AdditionalProperty {
|
|
192
195
|
function createInstance(...params: ConstructorParameters<typeof AdditionalPropertyRepo>): Promise<AdditionalPropertyRepo>;
|
|
193
196
|
}
|
|
197
|
+
export type AdminAccountingReport = AdminAccountingReportRepo;
|
|
198
|
+
export declare namespace AdminAccountingReport {
|
|
199
|
+
function createInstance(...params: ConstructorParameters<typeof AdminAccountingReportRepo>): Promise<AdminAccountingReportRepo>;
|
|
200
|
+
}
|
|
194
201
|
export type AdminAction = AdminActionRepo;
|
|
195
202
|
export declare namespace AdminAction {
|
|
196
203
|
function createInstance(...params: ConstructorParameters<typeof AdminActionRepo>): Promise<AdminActionRepo>;
|
|
197
204
|
}
|
|
205
|
+
export type AdminCheckMovieTicketAction = AdminCheckMovieTicketActionRepo;
|
|
206
|
+
export declare namespace AdminCheckMovieTicketAction {
|
|
207
|
+
function createInstance(...params: ConstructorParameters<typeof AdminCheckMovieTicketActionRepo>): Promise<AdminCheckMovieTicketActionRepo>;
|
|
208
|
+
}
|
|
198
209
|
export type AdminAssetTransaction = AdminAssetTransactionRepo;
|
|
199
210
|
export declare namespace AdminAssetTransaction {
|
|
200
211
|
function createInstance(...params: ConstructorParameters<typeof AdminAssetTransactionRepo>): Promise<AdminAssetTransactionRepo>;
|
|
@@ -219,6 +230,10 @@ export type AggregateAction = AggregateActionRepo;
|
|
|
219
230
|
export declare namespace AggregateAction {
|
|
220
231
|
function createInstance(...params: ConstructorParameters<typeof AggregateActionRepo>): Promise<AggregateActionRepo>;
|
|
221
232
|
}
|
|
233
|
+
export type AggregateCheckMovieTicketAction = AggregateCheckMovieTicketActionRepo;
|
|
234
|
+
export declare namespace AggregateCheckMovieTicketAction {
|
|
235
|
+
function createInstance(...params: ConstructorParameters<typeof AggregateCheckMovieTicketActionRepo>): Promise<AggregateCheckMovieTicketActionRepo>;
|
|
236
|
+
}
|
|
222
237
|
export type AggregateUseAction = AggregateUseActionRepo;
|
|
223
238
|
export declare namespace AggregateUseAction {
|
|
224
239
|
function createInstance(...params: ConstructorParameters<typeof AggregateUseActionRepo>): Promise<AggregateUseActionRepo>;
|
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.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 = exports.PaymentService = exports.Passport = exports.OrderNumber = exports.OrderInTransaction = void 0;
|
|
3
|
+
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.AggregateAssetTransaction = exports.AggregateTransaction = exports.AggregateTask = exports.AggregateScheduledTask = exports.AggregateUseAction = exports.AggregateCheckMovieTicketAction = exports.AggregateAction = exports.AdminTransaction = exports.AdminTask = exports.AdminScheduledTask = exports.AdminAsyncAction = exports.AdminAssetTransaction = exports.AdminCheckMovieTicketAction = exports.AdminAction = exports.AdminAccountingReport = exports.AdditionalProperty = 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.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 = exports.PaymentService = exports.Passport = exports.OrderNumber = exports.OrderInTransaction = exports.Order = exports.Offer = exports.OfferItemCondition = void 0;
|
|
5
5
|
var AcceptedOffer;
|
|
6
6
|
(function (AcceptedOffer) {
|
|
7
7
|
let repo;
|
|
@@ -214,6 +214,17 @@ var AdditionalProperty;
|
|
|
214
214
|
}
|
|
215
215
|
AdditionalProperty.createInstance = createInstance;
|
|
216
216
|
})(AdditionalProperty || (exports.AdditionalProperty = AdditionalProperty = {}));
|
|
217
|
+
var AdminAccountingReport;
|
|
218
|
+
(function (AdminAccountingReport) {
|
|
219
|
+
let repo;
|
|
220
|
+
async function createInstance(...params) {
|
|
221
|
+
if (repo === undefined) {
|
|
222
|
+
repo = (await import('./repo/adminAccountingReport.js')).AdminAccountingReportRepo;
|
|
223
|
+
}
|
|
224
|
+
return new repo(...params);
|
|
225
|
+
}
|
|
226
|
+
AdminAccountingReport.createInstance = createInstance;
|
|
227
|
+
})(AdminAccountingReport || (exports.AdminAccountingReport = AdminAccountingReport = {}));
|
|
217
228
|
var AdminAction;
|
|
218
229
|
(function (AdminAction) {
|
|
219
230
|
let repo;
|
|
@@ -225,6 +236,17 @@ var AdminAction;
|
|
|
225
236
|
}
|
|
226
237
|
AdminAction.createInstance = createInstance;
|
|
227
238
|
})(AdminAction || (exports.AdminAction = AdminAction = {}));
|
|
239
|
+
var AdminCheckMovieTicketAction;
|
|
240
|
+
(function (AdminCheckMovieTicketAction) {
|
|
241
|
+
let repo;
|
|
242
|
+
async function createInstance(...params) {
|
|
243
|
+
if (repo === undefined) {
|
|
244
|
+
repo = (await import('./repo/adminCheckMovieTicketAction.js')).AdminCheckMovieTicketActionRepo;
|
|
245
|
+
}
|
|
246
|
+
return new repo(...params);
|
|
247
|
+
}
|
|
248
|
+
AdminCheckMovieTicketAction.createInstance = createInstance;
|
|
249
|
+
})(AdminCheckMovieTicketAction || (exports.AdminCheckMovieTicketAction = AdminCheckMovieTicketAction = {}));
|
|
228
250
|
var AdminAssetTransaction;
|
|
229
251
|
(function (AdminAssetTransaction) {
|
|
230
252
|
let repo;
|
|
@@ -291,6 +313,17 @@ var AggregateAction;
|
|
|
291
313
|
}
|
|
292
314
|
AggregateAction.createInstance = createInstance;
|
|
293
315
|
})(AggregateAction || (exports.AggregateAction = AggregateAction = {}));
|
|
316
|
+
var AggregateCheckMovieTicketAction;
|
|
317
|
+
(function (AggregateCheckMovieTicketAction) {
|
|
318
|
+
let repo;
|
|
319
|
+
async function createInstance(...params) {
|
|
320
|
+
if (repo === undefined) {
|
|
321
|
+
repo = (await import('./repo/aggregateCheckMovieTicketAction.js')).AggregateCheckMovieTicketActionRepo;
|
|
322
|
+
}
|
|
323
|
+
return new repo(...params);
|
|
324
|
+
}
|
|
325
|
+
AggregateCheckMovieTicketAction.createInstance = createInstance;
|
|
326
|
+
})(AggregateCheckMovieTicketAction || (exports.AggregateCheckMovieTicketAction = AggregateCheckMovieTicketAction = {}));
|
|
294
327
|
var AggregateUseAction;
|
|
295
328
|
(function (AggregateUseAction) {
|
|
296
329
|
let repo;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AggregateActionRepo } from '../../repo/aggregateAction';
|
|
2
|
+
import type { AggregateCheckMovieTicketActionRepo } from '../../repo/aggregateCheckMovieTicketAction';
|
|
2
3
|
import type { AggregateUseActionRepo } from '../../repo/aggregateUseAction';
|
|
3
4
|
import type { AggregateAssetTransactionRepo } from '../../repo/aggregateAssetTransaction';
|
|
4
5
|
import type { AggregateScheduledTaskRepo } from '../../repo/aggregateScheduledTask';
|
|
@@ -112,7 +113,7 @@ declare function aggregateCancelReservationAction(params: IAggregateParams): (re
|
|
|
112
113
|
}>;
|
|
113
114
|
declare function aggregateCheckMovieTicketAction(params: IAggregateParams): (repos: {
|
|
114
115
|
agregation: AggregationRepo;
|
|
115
|
-
|
|
116
|
+
aggregateCheckMovieTicketAction: AggregateCheckMovieTicketActionRepo;
|
|
116
117
|
}) => Promise<{
|
|
117
118
|
aggregationCount: number;
|
|
118
119
|
aggregateDuration: string;
|
|
@@ -505,8 +505,7 @@ function aggregateCheckMovieTicketAction(params) {
|
|
|
505
505
|
.add(-i, params.aggregateDurationUnit)
|
|
506
506
|
.endOf(params.aggregateDurationUnit)
|
|
507
507
|
.toDate();
|
|
508
|
-
const aggregateResult = await repos.
|
|
509
|
-
project: { id: { $ne: params.excludedProjectId } },
|
|
508
|
+
const aggregateResult = await repos.aggregateCheckMovieTicketAction.aggregateCheckMovieTicketAction({
|
|
510
509
|
startFrom,
|
|
511
510
|
startThrough
|
|
512
511
|
});
|