@chevre/domain 26.1.0-alpha.1 → 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 +10 -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 +1 -1
- package/lib/chevre/repo/mongoose/schemas/action/checkMovieTicket.js +2 -2
- 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 +2 -2
- package/lib/chevre/service/task/deleteTransaction.js +2 -2
- package/lib/chevre/service/transaction/deleteTransaction.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,32 +1,13 @@
|
|
|
1
|
-
import type { Connection
|
|
1
|
+
import type { Connection } from 'mongoose';
|
|
2
2
|
import { factory } from '../factory';
|
|
3
3
|
import { IDocType } from './mongoose/schemas/accountingReport';
|
|
4
|
-
type IMatchStage = PipelineStage.Match;
|
|
5
|
-
type IReportAsFindResult = Pick<factory.report.accountingReport.IReport, 'mainEntity'> & {
|
|
6
|
-
isPartOf: {
|
|
7
|
-
mainEntity: factory.report.accountingReport.IOrderAsMainEntity;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
4
|
/**
|
|
11
5
|
* 経理レポートリポジトリ
|
|
12
6
|
*/
|
|
13
7
|
export declare class AccountingReportRepo {
|
|
14
8
|
private readonly accountingReportModel;
|
|
15
9
|
constructor(connection: Connection);
|
|
16
|
-
static CREATE_MONGO_CONDITIONS(params: factory.report.accountingReport.ISearchConditions & {
|
|
17
|
-
seller?: {
|
|
18
|
-
id?: string;
|
|
19
|
-
};
|
|
20
|
-
}): IMatchStage[];
|
|
21
10
|
syncMainEntity(params: IDocType): Promise<void>;
|
|
22
|
-
/**
|
|
23
|
-
* 注文番号で削除する
|
|
24
|
-
*/
|
|
25
|
-
deleteByOrderNumber(params: {
|
|
26
|
-
mainEntity: {
|
|
27
|
-
orderNumber: string;
|
|
28
|
-
};
|
|
29
|
-
}): Promise<void>;
|
|
30
11
|
/**
|
|
31
12
|
* 注文にアクションレポートを追加する
|
|
32
13
|
* 注文に対する経理レポート自体が未作成であれば自動的に作成する
|
|
@@ -40,16 +21,4 @@ export declare class AccountingReportRepo {
|
|
|
40
21
|
};
|
|
41
22
|
hasPart: factory.report.accountingReport.IChildReport;
|
|
42
23
|
}): Promise<void>;
|
|
43
|
-
findAccountingReports(params: factory.report.accountingReport.ISearchConditions & {
|
|
44
|
-
seller?: {
|
|
45
|
-
id?: string;
|
|
46
|
-
};
|
|
47
|
-
limit: number;
|
|
48
|
-
page: number;
|
|
49
|
-
}): Promise<IReportAsFindResult[]>;
|
|
50
|
-
unsetUnnecessaryFields(params: {
|
|
51
|
-
filter: any;
|
|
52
|
-
$unset: any;
|
|
53
|
-
}): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
54
24
|
}
|
|
55
|
-
export {};
|
|
@@ -12,44 +12,6 @@ class AccountingReportRepo {
|
|
|
12
12
|
constructor(connection) {
|
|
13
13
|
this.accountingReportModel = connection.model(accountingReport_1.modelName, (0, accountingReport_1.createSchema)());
|
|
14
14
|
}
|
|
15
|
-
static CREATE_MONGO_CONDITIONS(params) {
|
|
16
|
-
const matchStages = [];
|
|
17
|
-
const projectIdEq = params.project?.id?.$eq;
|
|
18
|
-
if (typeof projectIdEq === 'string') {
|
|
19
|
-
matchStages.push({ $match: { 'project.id': { $eq: projectIdEq } } });
|
|
20
|
-
}
|
|
21
|
-
// req.seller.idを考慮(2023-07-21~)
|
|
22
|
-
if (typeof params.seller?.id === 'string') {
|
|
23
|
-
matchStages.push({ $match: { 'mainEntity.seller.id': { $exists: true, $eq: params.seller.id } } });
|
|
24
|
-
}
|
|
25
|
-
const orderNumberEq = params.order?.orderNumber?.$eq;
|
|
26
|
-
if (typeof orderNumberEq === 'string') {
|
|
27
|
-
matchStages.push({ $match: { 'mainEntity.orderNumber': { $eq: orderNumberEq } } });
|
|
28
|
-
}
|
|
29
|
-
const sellerIdEq = params.order?.seller?.id?.$eq;
|
|
30
|
-
if (typeof sellerIdEq === 'string') {
|
|
31
|
-
matchStages.push({ $match: { 'mainEntity.seller.id': { $exists: true, $eq: sellerIdEq } } });
|
|
32
|
-
}
|
|
33
|
-
const paymentMethodIdEq = params.order?.paymentMethods?.paymentMethodId?.$eq;
|
|
34
|
-
if (typeof paymentMethodIdEq === 'string') {
|
|
35
|
-
matchStages.push({
|
|
36
|
-
$match: { 'mainEntity.paymentMethods.paymentMethodId': { $exists: true, $eq: paymentMethodIdEq } }
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
const orderDateGte = params.order?.orderDate?.$gte;
|
|
40
|
-
if (orderDateGte instanceof Date) {
|
|
41
|
-
matchStages.push({
|
|
42
|
-
$match: { 'mainEntity.orderDate': { $gte: orderDateGte } }
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
const orderDateLte = params.order?.orderDate?.$lte;
|
|
46
|
-
if (orderDateLte instanceof Date) {
|
|
47
|
-
matchStages.push({
|
|
48
|
-
$match: { 'mainEntity.orderDate': { $lte: orderDateLte } }
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
return matchStages;
|
|
52
|
-
}
|
|
53
15
|
async syncMainEntity(params) {
|
|
54
16
|
const setOnInsert = {
|
|
55
17
|
project: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project },
|
|
@@ -57,7 +19,7 @@ class AccountingReportRepo {
|
|
|
57
19
|
hasPart: [],
|
|
58
20
|
mainEntity: {
|
|
59
21
|
orderNumber: params.mainEntity.orderNumber // orderNumberのみが最低限必要なのでなければ作成
|
|
60
|
-
}
|
|
22
|
+
}
|
|
61
23
|
};
|
|
62
24
|
try {
|
|
63
25
|
// なければ作成
|
|
@@ -80,13 +42,6 @@ class AccountingReportRepo {
|
|
|
80
42
|
await this.accountingReportModel.updateOne({ 'mainEntity.orderNumber': { $eq: params.mainEntity.orderNumber } }, { $set: { mainEntity: params.mainEntity } })
|
|
81
43
|
.exec();
|
|
82
44
|
}
|
|
83
|
-
/**
|
|
84
|
-
* 注文番号で削除する
|
|
85
|
-
*/
|
|
86
|
-
async deleteByOrderNumber(params) {
|
|
87
|
-
await this.accountingReportModel.deleteOne({ 'mainEntity.orderNumber': params.mainEntity.orderNumber })
|
|
88
|
-
.exec();
|
|
89
|
-
}
|
|
90
45
|
/**
|
|
91
46
|
* 注文にアクションレポートを追加する
|
|
92
47
|
* 注文に対する経理レポート自体が未作成であれば自動的に作成する
|
|
@@ -95,50 +50,14 @@ class AccountingReportRepo {
|
|
|
95
50
|
const setOnInsert = {
|
|
96
51
|
project: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project },
|
|
97
52
|
typeOf: 'Report',
|
|
98
|
-
// hasPart: [],
|
|
99
53
|
mainEntity: {
|
|
100
54
|
orderNumber: params.mainEntity.orderNumber // orderNumberのみが最低限必要なのでなければ作成
|
|
101
|
-
}
|
|
55
|
+
}
|
|
102
56
|
};
|
|
103
|
-
|
|
57
|
+
await this.accountingReportModel.updateOne({ 'mainEntity.orderNumber': { $eq: params.mainEntity.orderNumber } }, {
|
|
104
58
|
$addToSet: { hasPart: params.hasPart },
|
|
105
59
|
$setOnInsert: setOnInsert
|
|
106
|
-
}, {
|
|
107
|
-
projection: { _id: 1 },
|
|
108
|
-
upsert: true
|
|
109
|
-
})
|
|
110
|
-
.exec();
|
|
111
|
-
if (doc === null) {
|
|
112
|
-
throw new factory_1.factory.errors.NotFound(this.accountingReportModel.modelName);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
async findAccountingReports(params) {
|
|
116
|
-
const { limit, page } = params;
|
|
117
|
-
const matchStages = AccountingReportRepo.CREATE_MONGO_CONDITIONS(params);
|
|
118
|
-
const aggregate = this.accountingReportModel.aggregate([
|
|
119
|
-
...matchStages,
|
|
120
|
-
// pipelineの順序に注意
|
|
121
|
-
// @see https://docs.mongodb.com/manual/reference/operator/aggregation/sort/
|
|
122
|
-
{ $sort: { 'mainEntity.orderDate': factory_1.factory.sortType.Descending } },
|
|
123
|
-
{ $unwind: '$hasPart' },
|
|
124
|
-
// hasPart内に対する検索条件は存在しないため、unwind後のmatchは不要
|
|
125
|
-
{
|
|
126
|
-
$project: {
|
|
127
|
-
_id: 0,
|
|
128
|
-
mainEntity: '$hasPart.mainEntity',
|
|
129
|
-
isPartOf: {
|
|
130
|
-
mainEntity: '$mainEntity'
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
]);
|
|
135
|
-
return aggregate
|
|
136
|
-
.skip(limit * (page - 1))
|
|
137
|
-
.limit(limit)
|
|
138
|
-
.exec();
|
|
139
|
-
}
|
|
140
|
-
async unsetUnnecessaryFields(params) {
|
|
141
|
-
return this.accountingReportModel.updateMany(params.filter, { $unset: params.$unset }, { timestamps: false })
|
|
60
|
+
}, { upsert: true })
|
|
142
61
|
.exec();
|
|
143
62
|
}
|
|
144
63
|
}
|
|
@@ -6,7 +6,10 @@ export type IMinimizedPurchaseNumberAuthResult = Pick<factory.action.check.payme
|
|
|
6
6
|
knyknrNoInfoOut: Omit<factory.action.check.paymentMethod.movieTicket.IPurchaseNumberInfo, 'ykknInfo' | 'mkknInfo'>[] | null;
|
|
7
7
|
};
|
|
8
8
|
type StartableActionType = factory.actionType.CheckAction;
|
|
9
|
-
|
|
9
|
+
type ICheckMovieTicketAction = Pick<factory.action.check.paymentMethod.movieTicket.IAction, 'actionStatus' | 'agent' | 'endDate' | 'error' | 'expires' | 'id' | 'instrument' | 'object' | 'project' | 'purpose' | 'sameAs' | 'startDate' | 'typeOf'> & {
|
|
10
|
+
potentialActions?: never;
|
|
11
|
+
result?: never;
|
|
12
|
+
};
|
|
10
13
|
/**
|
|
11
14
|
* 決済カード認証アクションリポジトリ
|
|
12
15
|
*/
|
|
@@ -20,13 +23,15 @@ export declare class CheckMovieTicketActionRepo extends DedicatedActionProcessRe
|
|
|
20
23
|
*/
|
|
21
24
|
private readonly legacyActionModel;
|
|
22
25
|
constructor(connection: Connection);
|
|
23
|
-
startCheckMovieTicketAction(attributes: factory.action.check.paymentMethod.movieTicket.IAttributes,
|
|
26
|
+
startCheckMovieTicketAction(attributes: Pick<factory.action.check.paymentMethod.movieTicket.IAttributes, 'agent' | 'instrument' | 'object' | 'project' | 'purpose' | 'sameAs' | 'typeOf'> & {
|
|
27
|
+
potentialActions?: never;
|
|
28
|
+
}, options?: {
|
|
24
29
|
recipe?: IRecipeAsActionAttributes<factory.recipe.RecipeCategory.checkMovieTicket>;
|
|
25
30
|
}): Promise<Pick<ICheckMovieTicketAction, 'id' | 'typeOf' | 'startDate'>>;
|
|
26
31
|
completeCheckMovieTicketAction(params: {
|
|
27
32
|
typeOf: StartableActionType;
|
|
28
33
|
id: string;
|
|
29
|
-
result
|
|
34
|
+
result?: never;
|
|
30
35
|
recipe?: IRecipeAsActionAttributes<factory.recipe.RecipeCategory.checkMovieTicket>;
|
|
31
36
|
}): Promise<void>;
|
|
32
37
|
giveUpCheckMovieTicketAction(params: {
|
|
@@ -42,7 +47,7 @@ export declare class CheckMovieTicketActionRepo extends DedicatedActionProcessRe
|
|
|
42
47
|
purpose?: {
|
|
43
48
|
id: string;
|
|
44
49
|
};
|
|
45
|
-
}): Promise<Pick<
|
|
50
|
+
}): Promise<Pick<ICheckMovieTicketAction, "error" | "id" | "purpose" | "actionStatus"> | null>;
|
|
46
51
|
/**
|
|
47
52
|
* アクションIDからレシピのafterMediaを参照する
|
|
48
53
|
*/
|
|
@@ -101,6 +106,6 @@ export declare class CheckMovieTicketActionRepo extends DedicatedActionProcessRe
|
|
|
101
106
|
*/
|
|
102
107
|
id: string;
|
|
103
108
|
};
|
|
104
|
-
}): Promise<Pick<
|
|
109
|
+
}): Promise<Pick<ICheckMovieTicketAction, "id"> | null>;
|
|
105
110
|
}
|
|
106
111
|
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Connection, PipelineStage } from 'mongoose';
|
|
2
|
+
import { factory } from '../factory';
|
|
3
|
+
type IMatchStage = PipelineStage.Match;
|
|
4
|
+
type IReportAsFindResult = Pick<factory.report.accountingReport.IReport, 'mainEntity'> & {
|
|
5
|
+
isPartOf: {
|
|
6
|
+
mainEntity: factory.report.accountingReport.IOrderAsMainEntity;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* 経理レポート管理リポジトリ
|
|
11
|
+
*/
|
|
12
|
+
export declare class AdminAccountingReportRepo {
|
|
13
|
+
private readonly accountingReportModel;
|
|
14
|
+
constructor(connection: Connection);
|
|
15
|
+
static CREATE_MONGO_CONDITIONS(params: factory.report.accountingReport.ISearchConditions & {
|
|
16
|
+
seller?: {
|
|
17
|
+
id?: string;
|
|
18
|
+
};
|
|
19
|
+
}): IMatchStage[];
|
|
20
|
+
findAccountingReports(params: factory.report.accountingReport.ISearchConditions & {
|
|
21
|
+
seller?: {
|
|
22
|
+
id?: string;
|
|
23
|
+
};
|
|
24
|
+
limit: number;
|
|
25
|
+
page: number;
|
|
26
|
+
}): Promise<IReportAsFindResult[]>;
|
|
27
|
+
/**
|
|
28
|
+
* 注文番号で削除する
|
|
29
|
+
*/
|
|
30
|
+
deleteByOrderNumber(params: {
|
|
31
|
+
mainEntity: {
|
|
32
|
+
orderNumber: string;
|
|
33
|
+
};
|
|
34
|
+
}): Promise<void>;
|
|
35
|
+
unsetUnnecessaryFields(params: {
|
|
36
|
+
filter: any;
|
|
37
|
+
$unset: any;
|
|
38
|
+
}): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
39
|
+
}
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AdminAccountingReportRepo = void 0;
|
|
4
|
+
const factory_1 = require("../factory");
|
|
5
|
+
const accountingReport_1 = require("./mongoose/schemas/accountingReport");
|
|
6
|
+
/**
|
|
7
|
+
* 経理レポート管理リポジトリ
|
|
8
|
+
*/
|
|
9
|
+
class AdminAccountingReportRepo {
|
|
10
|
+
accountingReportModel;
|
|
11
|
+
constructor(connection) {
|
|
12
|
+
this.accountingReportModel = connection.model(accountingReport_1.modelName, (0, accountingReport_1.createSchema)());
|
|
13
|
+
}
|
|
14
|
+
static CREATE_MONGO_CONDITIONS(params) {
|
|
15
|
+
const matchStages = [];
|
|
16
|
+
const projectIdEq = params.project?.id?.$eq;
|
|
17
|
+
if (typeof projectIdEq === 'string') {
|
|
18
|
+
matchStages.push({ $match: { 'project.id': { $eq: projectIdEq } } });
|
|
19
|
+
}
|
|
20
|
+
// req.seller.idを考慮(2023-07-21~)
|
|
21
|
+
if (typeof params.seller?.id === 'string') {
|
|
22
|
+
matchStages.push({ $match: { 'mainEntity.seller.id': { $exists: true, $eq: params.seller.id } } });
|
|
23
|
+
}
|
|
24
|
+
const orderNumberEq = params.order?.orderNumber?.$eq;
|
|
25
|
+
if (typeof orderNumberEq === 'string') {
|
|
26
|
+
matchStages.push({ $match: { 'mainEntity.orderNumber': { $eq: orderNumberEq } } });
|
|
27
|
+
}
|
|
28
|
+
const sellerIdEq = params.order?.seller?.id?.$eq;
|
|
29
|
+
if (typeof sellerIdEq === 'string') {
|
|
30
|
+
matchStages.push({ $match: { 'mainEntity.seller.id': { $exists: true, $eq: sellerIdEq } } });
|
|
31
|
+
}
|
|
32
|
+
const paymentMethodIdEq = params.order?.paymentMethods?.paymentMethodId?.$eq;
|
|
33
|
+
if (typeof paymentMethodIdEq === 'string') {
|
|
34
|
+
matchStages.push({
|
|
35
|
+
$match: { 'mainEntity.paymentMethods.paymentMethodId': { $exists: true, $eq: paymentMethodIdEq } }
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
const orderDateGte = params.order?.orderDate?.$gte;
|
|
39
|
+
if (orderDateGte instanceof Date) {
|
|
40
|
+
matchStages.push({
|
|
41
|
+
$match: { 'mainEntity.orderDate': { $gte: orderDateGte } }
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
const orderDateLte = params.order?.orderDate?.$lte;
|
|
45
|
+
if (orderDateLte instanceof Date) {
|
|
46
|
+
matchStages.push({
|
|
47
|
+
$match: { 'mainEntity.orderDate': { $lte: orderDateLte } }
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
return matchStages;
|
|
51
|
+
}
|
|
52
|
+
async findAccountingReports(params) {
|
|
53
|
+
const { limit, page } = params;
|
|
54
|
+
const matchStages = AdminAccountingReportRepo.CREATE_MONGO_CONDITIONS(params);
|
|
55
|
+
const aggregate = this.accountingReportModel.aggregate([
|
|
56
|
+
...matchStages,
|
|
57
|
+
// pipelineの順序に注意
|
|
58
|
+
// @see https://docs.mongodb.com/manual/reference/operator/aggregation/sort/
|
|
59
|
+
{ $sort: { 'mainEntity.orderDate': factory_1.factory.sortType.Descending } },
|
|
60
|
+
{ $unwind: '$hasPart' },
|
|
61
|
+
// hasPart内に対する検索条件は存在しないため、unwind後のmatchは不要
|
|
62
|
+
{
|
|
63
|
+
$project: {
|
|
64
|
+
_id: 0,
|
|
65
|
+
mainEntity: '$hasPart.mainEntity',
|
|
66
|
+
isPartOf: {
|
|
67
|
+
mainEntity: '$mainEntity'
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
]);
|
|
72
|
+
return aggregate
|
|
73
|
+
.skip(limit * (page - 1))
|
|
74
|
+
.limit(limit)
|
|
75
|
+
.exec();
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* 注文番号で削除する
|
|
79
|
+
*/
|
|
80
|
+
async deleteByOrderNumber(params) {
|
|
81
|
+
await this.accountingReportModel.deleteOne({ 'mainEntity.orderNumber': params.mainEntity.orderNumber })
|
|
82
|
+
.exec();
|
|
83
|
+
}
|
|
84
|
+
async unsetUnnecessaryFields(params) {
|
|
85
|
+
return this.accountingReportModel.updateMany(params.filter, { $unset: params.$unset }, { timestamps: false })
|
|
86
|
+
.exec();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
exports.AdminAccountingReportRepo = AdminAccountingReportRepo;
|
|
@@ -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 },
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
|
|
2
2
|
import { IVirtuals } from '../../virtuals';
|
|
3
3
|
import { factory } from '../../../../factory';
|
|
4
|
-
type IDocType = Pick<factory.action.check.paymentMethod.movieTicket.IAction, 'actionStatus' | 'agent' | 'endDate' | 'error' | 'expires' | 'instrument' | 'object' | '
|
|
4
|
+
type IDocType = Pick<factory.action.check.paymentMethod.movieTicket.IAction, 'actionStatus' | 'agent' | 'endDate' | 'error' | 'expires' | 'instrument' | 'object' | 'project' | 'purpose' | 'sameAs' | 'startDate' | 'typeOf'> & {};
|
|
5
5
|
type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
|
|
6
6
|
type ISchemaDefinition = SchemaDefinition<IDocType>;
|
|
7
7
|
type ISchema = Schema<IDocType, IModel, Record<string, never>, Record<string, never>, IVirtuals, Record<string, never>, ISchemaDefinition, IDocType>;
|
|
@@ -15,13 +15,13 @@ const schemaDefinition = {
|
|
|
15
15
|
object: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
16
16
|
startDate: { type: Date, required: true },
|
|
17
17
|
expires: { type: Date, required: true },
|
|
18
|
-
result: mongoose_1.SchemaTypes.Mixed,
|
|
19
18
|
error: mongoose_1.SchemaTypes.Mixed,
|
|
20
19
|
endDate: Date,
|
|
21
20
|
purpose: mongoose_1.SchemaTypes.Mixed,
|
|
22
|
-
potentialActions: mongoose_1.SchemaTypes.Mixed,
|
|
23
21
|
instrument: mongoose_1.SchemaTypes.Mixed,
|
|
24
22
|
sameAs: mongoose_1.SchemaTypes.Mixed,
|
|
23
|
+
// potentialActions: SchemaTypes.Mixed,
|
|
24
|
+
// result: SchemaTypes.Mixed,
|
|
25
25
|
};
|
|
26
26
|
const schemaOptions = {
|
|
27
27
|
autoIndex: settings_1.MONGO_AUTO_INDEX,
|
|
@@ -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
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AcceptedOfferRepo } from '../../repo/acceptedOffer';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AdminAccountingReportRepo } from '../../repo/adminAccountingReport';
|
|
3
3
|
import type { IDeleteActionResult, AdminActionRepo } from '../../repo/adminAction';
|
|
4
4
|
import type { NoteRepo } from '../../repo/note';
|
|
5
5
|
import type { OrderRepo } from '../../repo/order';
|
|
@@ -17,7 +17,7 @@ declare function deleteOrder(params: {
|
|
|
17
17
|
};
|
|
18
18
|
}): (repos: {
|
|
19
19
|
acceptedOffer: AcceptedOfferRepo;
|
|
20
|
-
|
|
20
|
+
adminAccountingReport: AdminAccountingReportRepo;
|
|
21
21
|
adminAction: AdminActionRepo;
|
|
22
22
|
note: NoteRepo;
|
|
23
23
|
order: OrderRepo;
|
|
@@ -35,7 +35,7 @@ function deleteOrder(params) {
|
|
|
35
35
|
// console.error('deleteOwnershipInfosByOrder throws', error);
|
|
36
36
|
// }
|
|
37
37
|
// 経理レポート削除
|
|
38
|
-
await repos.
|
|
38
|
+
await repos.adminAccountingReport.deleteByOrderNumber({ mainEntity: { orderNumber: order.orderNumber } });
|
|
39
39
|
// メモ削除(2024-02-15~)
|
|
40
40
|
await repos.note.deleteNotesByAbout({
|
|
41
41
|
about: {
|
|
@@ -83,8 +83,8 @@ function checkMovieTicket(params) {
|
|
|
83
83
|
}
|
|
84
84
|
throw errors[0];
|
|
85
85
|
}
|
|
86
|
-
const result = {};
|
|
87
|
-
await repos.actions.checkMovieTicket.completeCheckMovieTicketAction({ typeOf: actionAttributes.typeOf, id: action.id,
|
|
86
|
+
// const result: factory.action.check.paymentMethod.movieTicket.IResult = {};
|
|
87
|
+
await repos.actions.checkMovieTicket.completeCheckMovieTicketAction({ typeOf: actionAttributes.typeOf, id: action.id, recipe });
|
|
88
88
|
return { result: processPurchaseNumberAuthResult };
|
|
89
89
|
};
|
|
90
90
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.call = call;
|
|
4
4
|
const acceptedOffer_1 = require("../../repo/acceptedOffer");
|
|
5
|
-
const
|
|
5
|
+
const adminAccountingReport_1 = require("../../repo/adminAccountingReport");
|
|
6
6
|
const update_1 = require("../../repo/action/update");
|
|
7
7
|
const adminAction_1 = require("../../repo/adminAction");
|
|
8
8
|
const adminTransaction_1 = require("../../repo/adminTransaction");
|
|
@@ -21,7 +21,7 @@ function call(params) {
|
|
|
21
21
|
const { data } = params;
|
|
22
22
|
await (0, transaction_1.deleteTransaction)(data)({
|
|
23
23
|
acceptedOffer: new acceptedOffer_1.AcceptedOfferRepo(connection),
|
|
24
|
-
|
|
24
|
+
adminAccountingReport: new adminAccountingReport_1.AdminAccountingReportRepo(connection),
|
|
25
25
|
actions: {
|
|
26
26
|
update: new update_1.UpdateActionRepo(connection),
|
|
27
27
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { factory } from '../../factory';
|
|
2
2
|
import type { AcceptedOfferRepo } from '../../repo/acceptedOffer';
|
|
3
|
-
import type {
|
|
3
|
+
import type { AdminAccountingReportRepo } from '../../repo/adminAccountingReport';
|
|
4
4
|
import type { UpdateActionRepo } from '../../repo/action/update';
|
|
5
5
|
import type { AdminActionRepo } from '../../repo/adminAction';
|
|
6
6
|
import type { AdminTransactionRepo } from '../../repo/adminTransaction';
|
|
@@ -12,7 +12,7 @@ import type { PlaceOrderRepo } from '../../repo/transaction/placeOrder';
|
|
|
12
12
|
import type { ReturnOrderRepo } from '../../repo/transaction/returnOrder';
|
|
13
13
|
interface IDeleteTransactionRepos {
|
|
14
14
|
acceptedOffer: AcceptedOfferRepo;
|
|
15
|
-
|
|
15
|
+
adminAccountingReport: AdminAccountingReportRepo;
|
|
16
16
|
actions: {
|
|
17
17
|
update: UpdateActionRepo;
|
|
18
18
|
};
|
package/package.json
CHANGED