@chevre/domain 20.1.0-alpha.28 → 20.1.0-alpha.29
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/example/src/chevre/migrateAccountTitleAdditionalProperties.ts +157 -0
- package/example/src/chevre/migrateCreativeWorkAdditionalProperties.ts +8 -4
- package/example/src/chevre/migratePlaceAdditionalProperties.ts +2 -2
- package/example/src/chevre/migrateSSKTEventCOAEndpoint.ts +3 -2
- package/lib/chevre/repo/accountAction.d.ts +0 -18
- package/lib/chevre/repo/accountAction.js +402 -355
- package/lib/chevre/repo/accountTitle.d.ts +1 -0
- package/lib/chevre/repo/accountTitle.js +6 -1
- package/lib/chevre/repo/merchantReturnPolicy.d.ts +1 -0
- package/lib/chevre/repo/merchantReturnPolicy.js +5 -0
- package/package.json +3 -3
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
// tslint:disable:no-console
|
|
2
|
+
// import * as moment from 'moment';
|
|
3
|
+
import * as mongoose from 'mongoose';
|
|
4
|
+
|
|
5
|
+
import { chevre } from '../../../lib/index';
|
|
6
|
+
|
|
7
|
+
// const project = { id: String(process.env.PROJECT_ID) };
|
|
8
|
+
const EXCLUDED_PROJECT_ID = process.env.EXCLUDED_PROJECT_ID;
|
|
9
|
+
|
|
10
|
+
// tslint:disable-next-line:max-func-body-length
|
|
11
|
+
async function main() {
|
|
12
|
+
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
13
|
+
|
|
14
|
+
const accountTitleRepo = new chevre.repository.AccountTitle(mongoose.connection);
|
|
15
|
+
|
|
16
|
+
const cursor = accountTitleRepo.getCursor(
|
|
17
|
+
{
|
|
18
|
+
// 'project.id': { $eq: project.id },
|
|
19
|
+
'project.id': { $ne: EXCLUDED_PROJECT_ID }
|
|
20
|
+
// typeOf: { $eq: chevre.factory.eventType.ScreeningEventSeries },
|
|
21
|
+
// starDate: { $gte: new Date() }
|
|
22
|
+
// _id: { $eq: 'al6aff83w' }
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
// _id: 1,
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
console.log('accountTitles found');
|
|
29
|
+
|
|
30
|
+
const additionalPropertyNamesOnCategories: string[] = [];
|
|
31
|
+
const additionalPropertyNames: string[] = [];
|
|
32
|
+
const additionalPropertyNamesOnTitles: string[] = [];
|
|
33
|
+
const projectIdsOnCategories: string[] = [];
|
|
34
|
+
const projectIds: string[] = [];
|
|
35
|
+
const projectIdsOnTitles: string[] = [];
|
|
36
|
+
const unexpextedprojectIdsOnCategories: string[] = [];
|
|
37
|
+
const unexpextedprojectIds: string[] = [];
|
|
38
|
+
const unexpextedprojectIdsOnTitles: string[] = [];
|
|
39
|
+
|
|
40
|
+
let i = 0;
|
|
41
|
+
let updateCount = 0;
|
|
42
|
+
// tslint:disable-next-line:max-func-body-length
|
|
43
|
+
await cursor.eachAsync(async (doc) => {
|
|
44
|
+
i += 1;
|
|
45
|
+
const accountTitleCategory: chevre.factory.accountTitle.IAccountTitle = doc.toObject();
|
|
46
|
+
|
|
47
|
+
const additionalPropertyNamesOnCategory = accountTitleCategory.additionalProperty?.map((p) => p.name);
|
|
48
|
+
console.log(
|
|
49
|
+
(Array.isArray(additionalPropertyNamesOnCategory)) ? additionalPropertyNamesOnCategory.length : 0,
|
|
50
|
+
'additionalPropertyNamesOnCategory found',
|
|
51
|
+
accountTitleCategory.project.id,
|
|
52
|
+
accountTitleCategory.codeValue
|
|
53
|
+
);
|
|
54
|
+
if (Array.isArray(additionalPropertyNamesOnCategory) && additionalPropertyNamesOnCategory.length > 0) {
|
|
55
|
+
console.log(
|
|
56
|
+
additionalPropertyNamesOnCategory.length,
|
|
57
|
+
'additionalPropertyNamesOnResource found',
|
|
58
|
+
accountTitleCategory.project.id,
|
|
59
|
+
accountTitleCategory.codeValue
|
|
60
|
+
);
|
|
61
|
+
additionalPropertyNamesOnCategories.push(...additionalPropertyNamesOnCategory);
|
|
62
|
+
projectIdsOnCategories.push(accountTitleCategory.project.id);
|
|
63
|
+
additionalPropertyNamesOnCategory.forEach((name) => {
|
|
64
|
+
if (!name.match(/^[a-zA-Z]*$/)) {
|
|
65
|
+
// throw new Error(`not matched ${creativeWork.project.id} ${creativeWork.id}`);
|
|
66
|
+
unexpextedprojectIdsOnCategories.push(accountTitleCategory.project.id);
|
|
67
|
+
}
|
|
68
|
+
// tslint:disable-next-line:no-magic-numbers
|
|
69
|
+
if (name.length < 5) {
|
|
70
|
+
// throw new Error(`length matched ${creativeWork.project.id} ${creativeWork.id} ${name}`);
|
|
71
|
+
unexpextedprojectIdsOnCategories.push(accountTitleCategory.project.id);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (Array.isArray(accountTitleCategory.hasCategoryCode)) {
|
|
77
|
+
accountTitleCategory.hasCategoryCode.forEach((accountTitleSet) => {
|
|
78
|
+
const additionalPropertyNamesOnResource = accountTitleSet.additionalProperty?.map((p) => p.name);
|
|
79
|
+
console.log(
|
|
80
|
+
(Array.isArray(additionalPropertyNamesOnResource)) ? additionalPropertyNamesOnResource.length : 0,
|
|
81
|
+
'additionalPropertyNamesOnResource found',
|
|
82
|
+
accountTitleCategory.project.id,
|
|
83
|
+
accountTitleCategory.codeValue
|
|
84
|
+
);
|
|
85
|
+
if (Array.isArray(additionalPropertyNamesOnResource) && additionalPropertyNamesOnResource.length > 0) {
|
|
86
|
+
console.log(
|
|
87
|
+
additionalPropertyNamesOnResource.length,
|
|
88
|
+
'additionalPropertyNamesOnResource found',
|
|
89
|
+
accountTitleCategory.project.id,
|
|
90
|
+
accountTitleCategory.codeValue
|
|
91
|
+
);
|
|
92
|
+
additionalPropertyNames.push(...additionalPropertyNamesOnResource);
|
|
93
|
+
projectIds.push(accountTitleCategory.project.id);
|
|
94
|
+
additionalPropertyNamesOnResource.forEach((name) => {
|
|
95
|
+
if (!name.match(/^[a-zA-Z]*$/)) {
|
|
96
|
+
// throw new Error(`not matched ${creativeWork.project.id} ${creativeWork.id}`);
|
|
97
|
+
unexpextedprojectIds.push(accountTitleCategory.project.id);
|
|
98
|
+
}
|
|
99
|
+
// tslint:disable-next-line:no-magic-numbers
|
|
100
|
+
if (name.length < 5) {
|
|
101
|
+
// throw new Error(`length matched ${creativeWork.project.id} ${creativeWork.id} ${name}`);
|
|
102
|
+
unexpextedprojectIds.push(accountTitleCategory.project.id);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (Array.isArray(accountTitleSet.hasCategoryCode)) {
|
|
108
|
+
accountTitleSet.hasCategoryCode.forEach((accountTitl) => {
|
|
109
|
+
const additionalPropertyNamesOnSection = accountTitl.additionalProperty?.map((p) => p.name);
|
|
110
|
+
console.log(
|
|
111
|
+
(Array.isArray(additionalPropertyNamesOnSection)) ? additionalPropertyNamesOnSection.length : 0,
|
|
112
|
+
'additionalPropertyNamesOnSection found',
|
|
113
|
+
accountTitleCategory.project.id,
|
|
114
|
+
accountTitleCategory.codeValue
|
|
115
|
+
);
|
|
116
|
+
if (Array.isArray(additionalPropertyNamesOnSection) && additionalPropertyNamesOnSection.length > 0) {
|
|
117
|
+
console.log(
|
|
118
|
+
additionalPropertyNamesOnSection.length,
|
|
119
|
+
'additionalPropertyNamesOnSection found',
|
|
120
|
+
accountTitleCategory.project.id,
|
|
121
|
+
accountTitleCategory.codeValue
|
|
122
|
+
);
|
|
123
|
+
additionalPropertyNamesOnTitles.push(...additionalPropertyNamesOnSection);
|
|
124
|
+
projectIdsOnTitles.push(accountTitleCategory.project.id);
|
|
125
|
+
additionalPropertyNamesOnSection.forEach((name) => {
|
|
126
|
+
if (!name.match(/^[a-zA-Z]*$/)) {
|
|
127
|
+
// throw new Error(`not matched ${creativeWork.project.id} ${creativeWork.id}`);
|
|
128
|
+
unexpextedprojectIdsOnTitles.push(accountTitleCategory.project.id);
|
|
129
|
+
}
|
|
130
|
+
// tslint:disable-next-line:no-magic-numbers
|
|
131
|
+
if (name.length < 5) {
|
|
132
|
+
// throw new Error(`length matched ${creativeWork.project.id} ${creativeWork.id} ${name}`);
|
|
133
|
+
unexpextedprojectIdsOnTitles.push(accountTitleCategory.project.id);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
console.log(i, 'places checked');
|
|
143
|
+
console.log(updateCount, 'places updated');
|
|
144
|
+
console.log([...new Set(additionalPropertyNamesOnCategories)], 'categories');
|
|
145
|
+
console.log([...new Set(projectIdsOnCategories)], 'categories');
|
|
146
|
+
console.log([...new Set(unexpextedprojectIdsOnCategories)], 'categories');
|
|
147
|
+
console.log([...new Set(additionalPropertyNames)], 'sets');
|
|
148
|
+
console.log([...new Set(projectIds)], 'sets');
|
|
149
|
+
console.log([...new Set(unexpextedprojectIds)], 'sets');
|
|
150
|
+
console.log([...new Set(additionalPropertyNamesOnTitles)], 'titles');
|
|
151
|
+
console.log([...new Set(projectIdsOnTitles)], 'titles');
|
|
152
|
+
console.log([...new Set(unexpextedprojectIdsOnTitles)], 'titles');
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
main()
|
|
156
|
+
.then()
|
|
157
|
+
.catch(console.error);
|
|
@@ -9,24 +9,28 @@ const EXCLUDED_PROJECT_ID = process.env.EXCLUDED_PROJECT_ID;
|
|
|
9
9
|
|
|
10
10
|
// tslint:disable-next-line:max-func-body-length
|
|
11
11
|
async function main() {
|
|
12
|
-
await mongoose.connect(<string>process.env.MONGOLAB_URI);
|
|
12
|
+
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
13
13
|
|
|
14
14
|
// const customerRepo = new chevre.repository.Customer(mongoose.connection);
|
|
15
15
|
// const sellerRepo = new chevre.repository.Seller(mongoose.connection);
|
|
16
16
|
// const eventRepo = new chevre.repository.Event(mongoose.connection);
|
|
17
|
-
const creativeWorkRepo = new chevre.repository.CreativeWork(mongoose.connection);
|
|
17
|
+
// const creativeWorkRepo = new chevre.repository.CreativeWork(mongoose.connection);
|
|
18
18
|
// const placeRepo = new chevre.repository.Place(mongoose.connection);
|
|
19
19
|
// const offerRepo = new chevre.repository.Offer(mongoose.connection);
|
|
20
20
|
// const categoryCodeRepo = new chevre.repository.CategoryCode(mongoose.connection);
|
|
21
21
|
// const additionalPropertyRepo = new chevre.repository.AdditionalProperty(mongoose.connection);
|
|
22
|
+
// const offerCatalogRepo = new chevre.repository.OfferCatalog(mongoose.connection);
|
|
23
|
+
const merchantReturnPolicyRepo = new chevre.repository.MerchantReturnPolicy(mongoose.connection);
|
|
22
24
|
|
|
23
25
|
// const cursor = customerRepo.getCursor(
|
|
24
26
|
// const cursor = sellerRepo.getCursor(
|
|
25
27
|
// const cursor = eventRepo.getCursor(
|
|
26
28
|
// const cursor = categoryCodeRepo.getCursor(
|
|
27
29
|
// const cursor = offerRepo.getCursor(
|
|
28
|
-
const cursor = creativeWorkRepo.getCursor(
|
|
29
|
-
|
|
30
|
+
// const cursor = creativeWorkRepo.getCursor(
|
|
31
|
+
// const cursor = placeRepo.getCursor(
|
|
32
|
+
// const cursor = offerCatalogRepo.getCursor(
|
|
33
|
+
const cursor = merchantReturnPolicyRepo.getCursor(
|
|
30
34
|
{
|
|
31
35
|
// 'project.id': { $eq: project.id },
|
|
32
36
|
'project.id': { $ne: EXCLUDED_PROJECT_ID },
|
|
@@ -9,14 +9,14 @@ const EXCLUDED_PROJECT_ID = process.env.EXCLUDED_PROJECT_ID;
|
|
|
9
9
|
|
|
10
10
|
// tslint:disable-next-line:max-func-body-length
|
|
11
11
|
async function main() {
|
|
12
|
-
await mongoose.connect(<string>process.env.MONGOLAB_URI);
|
|
12
|
+
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
13
13
|
|
|
14
14
|
const placeRepo = new chevre.repository.Place(mongoose.connection);
|
|
15
15
|
|
|
16
16
|
const cursor = placeRepo.getCursor(
|
|
17
17
|
{
|
|
18
18
|
// 'project.id': { $eq: project.id },
|
|
19
|
-
'project.id': { $ne: EXCLUDED_PROJECT_ID }
|
|
19
|
+
'project.id': { $ne: EXCLUDED_PROJECT_ID }
|
|
20
20
|
// typeOf: { $eq: chevre.factory.eventType.ScreeningEventSeries },
|
|
21
21
|
// starDate: { $gte: new Date() }
|
|
22
22
|
// _id: { $eq: 'al6aff83w' }
|
|
@@ -7,7 +7,7 @@ const project = { id: String(process.env.PROJECT_ID) };
|
|
|
7
7
|
const DELETING_PROPERTY_NAME: string = 'COA_ENDPOINT';
|
|
8
8
|
|
|
9
9
|
async function main() {
|
|
10
|
-
await mongoose.connect(<string>process.env.MONGOLAB_URI);
|
|
10
|
+
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
11
11
|
|
|
12
12
|
const eventRepo = new chevre.repository.Event(mongoose.connection);
|
|
13
13
|
|
|
@@ -15,7 +15,8 @@ async function main() {
|
|
|
15
15
|
{
|
|
16
16
|
'project.id': { $eq: project.id },
|
|
17
17
|
typeOf: { $eq: chevre.factory.eventType.ScreeningEventSeries }
|
|
18
|
-
// typeOf: { $eq: chevre.factory.eventType.ScreeningEvent }
|
|
18
|
+
// typeOf: { $eq: chevre.factory.eventType.ScreeningEvent },
|
|
19
|
+
// startDate: { $gte: new Date() }
|
|
19
20
|
},
|
|
20
21
|
{
|
|
21
22
|
// _id: 1,
|
|
@@ -9,46 +9,28 @@ export declare type IAction<T extends factory.actionType> = T extends factory.ac
|
|
|
9
9
|
export declare class MongoRepository {
|
|
10
10
|
private readonly actionModel;
|
|
11
11
|
constructor(connection: Connection);
|
|
12
|
-
static CREATE_MONEY_TRANSFER_ACTIONS_MONGO_CONDITIONS(params: factory.account.action.moneyTransfer.ISearchConditions): any[];
|
|
13
12
|
/**
|
|
14
13
|
* アクション開始
|
|
15
14
|
*/
|
|
16
|
-
startByIdentifier<T extends factory.actionType>(params: factory.account.action.moneyTransfer.IAttributes): Promise<IAction<T>>;
|
|
17
15
|
/**
|
|
18
16
|
* アクション完了
|
|
19
17
|
*/
|
|
20
|
-
complete<T extends factory.actionType>(typeOf: T, actionId: string, result: any): Promise<IAction<T>>;
|
|
21
18
|
/**
|
|
22
19
|
* アクション中止
|
|
23
20
|
*/
|
|
24
|
-
cancel<T extends factory.actionType>(typeOf: T, actionId: string): Promise<IAction<T>>;
|
|
25
21
|
/**
|
|
26
22
|
* アクション失敗
|
|
27
23
|
*/
|
|
28
|
-
giveUp<T extends factory.actionType>(typeOf: T, actionId: string, error: any): Promise<IAction<T>>;
|
|
29
24
|
/**
|
|
30
25
|
* アクション検索
|
|
31
26
|
*/
|
|
32
|
-
findById<T extends factory.actionType>(typeOf: T, actionId: string): Promise<IAction<T>>;
|
|
33
|
-
countTransferActions(params: factory.account.action.moneyTransfer.ISearchConditions): Promise<number>;
|
|
34
27
|
/**
|
|
35
28
|
* 転送アクションを検索する
|
|
36
29
|
*/
|
|
37
|
-
searchTransferActions(params: factory.account.action.moneyTransfer.ISearchConditions): Promise<factory.account.action.moneyTransfer.IAction[]>;
|
|
38
30
|
/**
|
|
39
31
|
* アクションを検索する
|
|
40
32
|
* @param searchConditions 検索条件
|
|
41
33
|
*/
|
|
42
|
-
search<T extends factory.actionType>(searchConditions: {
|
|
43
|
-
typeOf: T;
|
|
44
|
-
actionStatuses?: factory.account.AccountStatusType[];
|
|
45
|
-
startDateFrom?: Date;
|
|
46
|
-
startDateThrough?: Date;
|
|
47
|
-
purposeTypeOfs?: factory.account.transactionType[];
|
|
48
|
-
fromLocationAccountNumbers?: string[];
|
|
49
|
-
toLocationAccountNumbers?: string[];
|
|
50
|
-
limit: number;
|
|
51
|
-
}): Promise<IAction<T>[]>;
|
|
52
34
|
clean(params: {
|
|
53
35
|
project?: {
|
|
54
36
|
id?: string;
|
|
@@ -21,174 +21,175 @@ class MongoRepository {
|
|
|
21
21
|
this.actionModel = connection.model(accountAction_1.modelName);
|
|
22
22
|
}
|
|
23
23
|
// tslint:disable-next-line:max-func-body-length
|
|
24
|
-
static CREATE_MONEY_TRANSFER_ACTIONS_MONGO_CONDITIONS(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
24
|
+
// public static CREATE_MONEY_TRANSFER_ACTIONS_MONGO_CONDITIONS(
|
|
25
|
+
// params: factory.account.action.moneyTransfer.ISearchConditions
|
|
26
|
+
// ) {
|
|
27
|
+
// const andConditions: any[] = [
|
|
28
|
+
// { typeOf: factory.actionType.MoneyTransfer }
|
|
29
|
+
// ];
|
|
30
|
+
// // tslint:disable-next-line:no-single-line-block-comment
|
|
31
|
+
// /* istanbul ignore else */
|
|
32
|
+
// if (params.project !== undefined && params.project !== null) {
|
|
33
|
+
// // tslint:disable-next-line:no-single-line-block-comment
|
|
34
|
+
// /* istanbul ignore else */
|
|
35
|
+
// if (params.project.id !== undefined && params.project.id !== null) {
|
|
36
|
+
// // tslint:disable-next-line:no-single-line-block-comment
|
|
37
|
+
// /* istanbul ignore else */
|
|
38
|
+
// if (typeof params.project.id.$eq === 'string') {
|
|
39
|
+
// andConditions.push({
|
|
40
|
+
// 'project.id': {
|
|
41
|
+
// $eq: params.project.id.$eq
|
|
42
|
+
// }
|
|
43
|
+
// });
|
|
44
|
+
// }
|
|
45
|
+
// // tslint:disable-next-line:no-single-line-block-comment
|
|
46
|
+
// /* istanbul ignore else */
|
|
47
|
+
// if (typeof params.project.id.$ne === 'string') {
|
|
48
|
+
// andConditions.push({
|
|
49
|
+
// 'project.id': {
|
|
50
|
+
// $ne: params.project.id.$ne
|
|
51
|
+
// }
|
|
52
|
+
// });
|
|
53
|
+
// }
|
|
54
|
+
// }
|
|
55
|
+
// }
|
|
56
|
+
// // tslint:disable-next-line:no-single-line-block-comment
|
|
57
|
+
// /* istanbul ignore else */
|
|
58
|
+
// // if (typeof params.accountNumber === 'string') {
|
|
59
|
+
// // andConditions.push({
|
|
60
|
+
// // $or: [
|
|
61
|
+
// // {
|
|
62
|
+
// // 'fromLocation.accountNumber': {
|
|
63
|
+
// // $exists: true,
|
|
64
|
+
// // $eq: params.accountNumber
|
|
65
|
+
// // }
|
|
66
|
+
// // },
|
|
67
|
+
// // {
|
|
68
|
+
// // 'toLocation.accountNumber': {
|
|
69
|
+
// // $exists: true,
|
|
70
|
+
// // $eq: params.accountNumber
|
|
71
|
+
// // }
|
|
72
|
+
// // }
|
|
73
|
+
// // ]
|
|
74
|
+
// // });
|
|
75
|
+
// // }
|
|
76
|
+
// const actionStatusIn = params.actionStatus?.$in;
|
|
77
|
+
// // tslint:disable-next-line:no-single-line-block-comment
|
|
78
|
+
// /* istanbul ignore else */
|
|
79
|
+
// if (Array.isArray(actionStatusIn)) {
|
|
80
|
+
// andConditions.push({
|
|
81
|
+
// actionStatus: { $in: actionStatusIn }
|
|
82
|
+
// });
|
|
83
|
+
// }
|
|
84
|
+
// const amountCurrencyEq = params.amount?.currency?.$eq;
|
|
85
|
+
// if (typeof amountCurrencyEq === 'string') {
|
|
86
|
+
// andConditions.push({
|
|
87
|
+
// 'amount.currency': {
|
|
88
|
+
// $exists: true,
|
|
89
|
+
// $eq: amountCurrencyEq
|
|
90
|
+
// }
|
|
91
|
+
// });
|
|
92
|
+
// }
|
|
93
|
+
// const locationAccountNumberEq = params.location?.accountNumber?.$eq;
|
|
94
|
+
// if (typeof locationAccountNumberEq === 'string') {
|
|
95
|
+
// andConditions.push({
|
|
96
|
+
// $or: [
|
|
97
|
+
// {
|
|
98
|
+
// 'fromLocation.accountNumber': {
|
|
99
|
+
// $exists: true,
|
|
100
|
+
// $eq: locationAccountNumberEq
|
|
101
|
+
// }
|
|
102
|
+
// },
|
|
103
|
+
// {
|
|
104
|
+
// 'toLocation.accountNumber': {
|
|
105
|
+
// $exists: true,
|
|
106
|
+
// $eq: locationAccountNumberEq
|
|
107
|
+
// }
|
|
108
|
+
// }
|
|
109
|
+
// ]
|
|
110
|
+
// });
|
|
111
|
+
// }
|
|
112
|
+
// const locationTypeOfEq = params.location?.typeOf?.$eq;
|
|
113
|
+
// if (typeof locationTypeOfEq === 'string') {
|
|
114
|
+
// andConditions.push({
|
|
115
|
+
// $or: [
|
|
116
|
+
// {
|
|
117
|
+
// 'fromLocation.typeOf': {
|
|
118
|
+
// $exists: true,
|
|
119
|
+
// $eq: locationTypeOfEq
|
|
120
|
+
// }
|
|
121
|
+
// },
|
|
122
|
+
// {
|
|
123
|
+
// 'toLocation.typeOf': {
|
|
124
|
+
// $exists: true,
|
|
125
|
+
// $eq: locationTypeOfEq
|
|
126
|
+
// }
|
|
127
|
+
// }
|
|
128
|
+
// ]
|
|
129
|
+
// });
|
|
130
|
+
// }
|
|
131
|
+
// const purposeTypeOfEq = params.purpose?.typeOf?.$eq;
|
|
132
|
+
// // tslint:disable-next-line:no-single-line-block-comment
|
|
133
|
+
// /* istanbul ignore else */
|
|
134
|
+
// if (typeof purposeTypeOfEq === 'string') {
|
|
135
|
+
// andConditions.push({
|
|
136
|
+
// 'purpose.typeOf': {
|
|
137
|
+
// $exists: true,
|
|
138
|
+
// $eq: purposeTypeOfEq
|
|
139
|
+
// }
|
|
140
|
+
// });
|
|
141
|
+
// }
|
|
142
|
+
// const purposeIdEq = params.purpose?.id?.$eq;
|
|
143
|
+
// // tslint:disable-next-line:no-single-line-block-comment
|
|
144
|
+
// /* istanbul ignore else */
|
|
145
|
+
// if (typeof purposeIdEq === 'string') {
|
|
146
|
+
// andConditions.push({
|
|
147
|
+
// 'purpose.id': {
|
|
148
|
+
// $exists: true,
|
|
149
|
+
// $eq: purposeIdEq
|
|
150
|
+
// }
|
|
151
|
+
// });
|
|
152
|
+
// }
|
|
153
|
+
// const purposeIdentifierEq = params.purpose?.identifier?.$eq;
|
|
154
|
+
// // tslint:disable-next-line:no-single-line-block-comment
|
|
155
|
+
// /* istanbul ignore else */
|
|
156
|
+
// if (typeof purposeIdentifierEq === 'string') {
|
|
157
|
+
// andConditions.push({
|
|
158
|
+
// 'purpose.identifier': {
|
|
159
|
+
// $exists: true,
|
|
160
|
+
// $eq: purposeIdentifierEq
|
|
161
|
+
// }
|
|
162
|
+
// });
|
|
163
|
+
// }
|
|
164
|
+
// const purposeTransactionNumberEq = params.purpose?.transactionNumber?.$eq;
|
|
165
|
+
// // tslint:disable-next-line:no-single-line-block-comment
|
|
166
|
+
// /* istanbul ignore else */
|
|
167
|
+
// if (typeof purposeTransactionNumberEq === 'string') {
|
|
168
|
+
// andConditions.push({
|
|
169
|
+
// 'purpose.transactionNumber': {
|
|
170
|
+
// $exists: true,
|
|
171
|
+
// $eq: purposeTransactionNumberEq
|
|
172
|
+
// }
|
|
173
|
+
// });
|
|
174
|
+
// }
|
|
175
|
+
// const startDateGte = params.startDate?.$gte;
|
|
176
|
+
// // tslint:disable-next-line:no-single-line-block-comment
|
|
177
|
+
// /* istanbul ignore else */
|
|
178
|
+
// if (startDateGte instanceof Date) {
|
|
179
|
+
// andConditions.push({
|
|
180
|
+
// startDate: { $gte: startDateGte }
|
|
181
|
+
// });
|
|
182
|
+
// }
|
|
183
|
+
// const startDateLte = params.startDate?.$lte;
|
|
184
|
+
// // tslint:disable-next-line:no-single-line-block-comment
|
|
185
|
+
// /* istanbul ignore else */
|
|
186
|
+
// if (startDateLte instanceof Date) {
|
|
187
|
+
// andConditions.push({
|
|
188
|
+
// startDate: { $lte: startDateLte }
|
|
189
|
+
// });
|
|
190
|
+
// }
|
|
191
|
+
// return andConditions;
|
|
192
|
+
// }
|
|
192
193
|
/**
|
|
193
194
|
* アクション開始
|
|
194
195
|
*/
|
|
@@ -204,212 +205,258 @@ class MongoRepository {
|
|
|
204
205
|
// (doc) => doc.toObject()
|
|
205
206
|
// );
|
|
206
207
|
// }
|
|
207
|
-
startByIdentifier(
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
}
|
|
208
|
+
// public async startByIdentifier<T extends factory.actionType>(
|
|
209
|
+
// params: factory.account.action.moneyTransfer.IAttributes
|
|
210
|
+
// ): Promise<IAction<T>> {
|
|
211
|
+
// if (typeof params.identifier === 'string') {
|
|
212
|
+
// return this.actionModel.findOneAndUpdate(
|
|
213
|
+
// {
|
|
214
|
+
// identifier: {
|
|
215
|
+
// $exists: true,
|
|
216
|
+
// $eq: params.identifier
|
|
217
|
+
// }
|
|
218
|
+
// },
|
|
219
|
+
// {
|
|
220
|
+
// $setOnInsert: {
|
|
221
|
+
// ...params,
|
|
222
|
+
// actionStatus: factory.actionStatusType.ActiveActionStatus,
|
|
223
|
+
// startDate: new Date()
|
|
224
|
+
// }
|
|
225
|
+
// },
|
|
226
|
+
// {
|
|
227
|
+
// new: true,
|
|
228
|
+
// upsert: true
|
|
229
|
+
// }
|
|
230
|
+
// )
|
|
231
|
+
// .exec()
|
|
232
|
+
// .then((doc) => {
|
|
233
|
+
// if (doc === null) {
|
|
234
|
+
// throw new factory.errors.NotFound(this.actionModel.modelName);
|
|
235
|
+
// }
|
|
236
|
+
// return doc.toObject();
|
|
237
|
+
// });
|
|
238
|
+
// } else {
|
|
239
|
+
// return this.actionModel.create({
|
|
240
|
+
// ...params,
|
|
241
|
+
// actionStatus: factory.actionStatusType.ActiveActionStatus,
|
|
242
|
+
// startDate: new Date()
|
|
243
|
+
// })
|
|
244
|
+
// .then(
|
|
245
|
+
// (doc) => doc.toObject()
|
|
246
|
+
// );
|
|
247
|
+
// }
|
|
248
|
+
// }
|
|
235
249
|
/**
|
|
236
250
|
* アクション完了
|
|
237
251
|
*/
|
|
238
|
-
complete
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
252
|
+
// public async complete<T extends factory.actionType>(
|
|
253
|
+
// typeOf: T,
|
|
254
|
+
// actionId: string,
|
|
255
|
+
// result: any
|
|
256
|
+
// ): Promise<IAction<T>> {
|
|
257
|
+
// return this.actionModel.findOneAndUpdate(
|
|
258
|
+
// {
|
|
259
|
+
// typeOf: typeOf,
|
|
260
|
+
// _id: actionId
|
|
261
|
+
// },
|
|
262
|
+
// {
|
|
263
|
+
// actionStatus: factory.actionStatusType.CompletedActionStatus,
|
|
264
|
+
// result: result,
|
|
265
|
+
// endDate: new Date()
|
|
266
|
+
// },
|
|
267
|
+
// { new: true }
|
|
268
|
+
// )
|
|
269
|
+
// .exec()
|
|
270
|
+
// .then((doc) => {
|
|
271
|
+
// if (doc === null) {
|
|
272
|
+
// throw new factory.errors.NotFound(this.actionModel.modelName);
|
|
273
|
+
// }
|
|
274
|
+
// return doc.toObject();
|
|
275
|
+
// });
|
|
276
|
+
// }
|
|
257
277
|
/**
|
|
258
278
|
* アクション中止
|
|
259
279
|
*/
|
|
260
|
-
cancel
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
280
|
+
// public async cancel<T extends factory.actionType>(
|
|
281
|
+
// typeOf: T,
|
|
282
|
+
// actionId: string
|
|
283
|
+
// ): Promise<IAction<T>> {
|
|
284
|
+
// return this.actionModel.findOneAndUpdate(
|
|
285
|
+
// {
|
|
286
|
+
// typeOf: typeOf,
|
|
287
|
+
// _id: actionId
|
|
288
|
+
// },
|
|
289
|
+
// { actionStatus: factory.actionStatusType.CanceledActionStatus },
|
|
290
|
+
// { new: true }
|
|
291
|
+
// )
|
|
292
|
+
// .exec()
|
|
293
|
+
// .then((doc) => {
|
|
294
|
+
// if (doc === null) {
|
|
295
|
+
// throw new factory.errors.NotFound(this.actionModel.modelName);
|
|
296
|
+
// }
|
|
297
|
+
// return doc.toObject();
|
|
298
|
+
// });
|
|
299
|
+
// }
|
|
275
300
|
/**
|
|
276
301
|
* アクション失敗
|
|
277
302
|
*/
|
|
278
|
-
giveUp
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
303
|
+
// public async giveUp<T extends factory.actionType>(
|
|
304
|
+
// typeOf: T,
|
|
305
|
+
// actionId: string,
|
|
306
|
+
// error: any
|
|
307
|
+
// ): Promise<IAction<T>> {
|
|
308
|
+
// return this.actionModel.findOneAndUpdate(
|
|
309
|
+
// {
|
|
310
|
+
// typeOf: typeOf,
|
|
311
|
+
// _id: actionId
|
|
312
|
+
// },
|
|
313
|
+
// {
|
|
314
|
+
// actionStatus: factory.actionStatusType.FailedActionStatus,
|
|
315
|
+
// error: error,
|
|
316
|
+
// endDate: new Date()
|
|
317
|
+
// },
|
|
318
|
+
// { new: true }
|
|
319
|
+
// )
|
|
320
|
+
// .exec()
|
|
321
|
+
// .then((doc) => {
|
|
322
|
+
// if (doc === null) {
|
|
323
|
+
// throw new factory.errors.NotFound(this.actionModel.modelName);
|
|
324
|
+
// }
|
|
325
|
+
// return doc.toObject();
|
|
326
|
+
// });
|
|
327
|
+
// }
|
|
297
328
|
/**
|
|
298
329
|
* アクション検索
|
|
299
330
|
*/
|
|
300
|
-
findById
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
}
|
|
331
|
+
// public async findById<T extends factory.actionType>(
|
|
332
|
+
// typeOf: T,
|
|
333
|
+
// actionId: string
|
|
334
|
+
// ): Promise<IAction<T>> {
|
|
335
|
+
// return this.actionModel.findOne(
|
|
336
|
+
// {
|
|
337
|
+
// typeOf: typeOf,
|
|
338
|
+
// _id: actionId
|
|
339
|
+
// }
|
|
340
|
+
// )
|
|
341
|
+
// .exec()
|
|
342
|
+
// .then((doc) => {
|
|
343
|
+
// if (doc === null) {
|
|
344
|
+
// throw new factory.errors.NotFound(this.actionModel.modelName);
|
|
345
|
+
// }
|
|
346
|
+
// return doc.toObject();
|
|
347
|
+
// });
|
|
348
|
+
// }
|
|
349
|
+
// public async countTransferActions(
|
|
350
|
+
// params: factory.account.action.moneyTransfer.ISearchConditions
|
|
351
|
+
// ): Promise<number> {
|
|
352
|
+
// const conditions = MongoRepository.CREATE_MONEY_TRANSFER_ACTIONS_MONGO_CONDITIONS(params);
|
|
353
|
+
// return this.actionModel.countDocuments({ $and: conditions })
|
|
354
|
+
// .setOptions({ maxTimeMS: 10000 })
|
|
355
|
+
// .exec();
|
|
356
|
+
// }
|
|
323
357
|
/**
|
|
324
358
|
* 転送アクションを検索する
|
|
325
359
|
*/
|
|
326
|
-
searchTransferActions(
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
}
|
|
360
|
+
// public async searchTransferActions(
|
|
361
|
+
// params: factory.account.action.moneyTransfer.ISearchConditions
|
|
362
|
+
// ): Promise<factory.account.action.moneyTransfer.IAction[]> {
|
|
363
|
+
// const conditions = MongoRepository.CREATE_MONEY_TRANSFER_ACTIONS_MONGO_CONDITIONS(params);
|
|
364
|
+
// const query = this.actionModel.find(
|
|
365
|
+
// { $and: conditions },
|
|
366
|
+
// {
|
|
367
|
+
// __v: 0,
|
|
368
|
+
// createdAt: 0,
|
|
369
|
+
// updatedAt: 0
|
|
370
|
+
// }
|
|
371
|
+
// );
|
|
372
|
+
// // tslint:disable-next-line:no-single-line-block-comment
|
|
373
|
+
// /* istanbul ignore else */
|
|
374
|
+
// if (params.limit !== undefined && params.page !== undefined) {
|
|
375
|
+
// query.limit(params.limit)
|
|
376
|
+
// .skip(params.limit * (params.page - 1));
|
|
377
|
+
// }
|
|
378
|
+
// // tslint:disable-next-line:no-single-line-block-comment
|
|
379
|
+
// /* istanbul ignore else */
|
|
380
|
+
// if (params.sort !== undefined) {
|
|
381
|
+
// query.sort(params.sort);
|
|
382
|
+
// }
|
|
383
|
+
// return query.setOptions({ maxTimeMS: 10000 })
|
|
384
|
+
// .exec()
|
|
385
|
+
// .then((docs) => docs.map((doc) => doc.toObject()));
|
|
386
|
+
// }
|
|
350
387
|
/**
|
|
351
388
|
* アクションを検索する
|
|
352
389
|
* @param searchConditions 検索条件
|
|
353
390
|
*/
|
|
354
|
-
search(searchConditions
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
}
|
|
391
|
+
// public async search<T extends factory.actionType>(searchConditions: {
|
|
392
|
+
// typeOf: T;
|
|
393
|
+
// actionStatuses?: factory.account.AccountStatusType[];
|
|
394
|
+
// startDateFrom?: Date;
|
|
395
|
+
// startDateThrough?: Date;
|
|
396
|
+
// purposeTypeOfs?: factory.account.transactionType[];
|
|
397
|
+
// fromLocationAccountNumbers?: string[];
|
|
398
|
+
// toLocationAccountNumbers?: string[];
|
|
399
|
+
// limit: number;
|
|
400
|
+
// }): Promise<IAction<T>[]> {
|
|
401
|
+
// const andConditions: any[] = [
|
|
402
|
+
// { typeOf: searchConditions.typeOf },
|
|
403
|
+
// {
|
|
404
|
+
// startDate: {
|
|
405
|
+
// $exists: true,
|
|
406
|
+
// $gte: searchConditions.startDateFrom,
|
|
407
|
+
// $lte: searchConditions.startDateThrough
|
|
408
|
+
// }
|
|
409
|
+
// }
|
|
410
|
+
// ];
|
|
411
|
+
// // tslint:disable-next-line:no-single-line-block-comment
|
|
412
|
+
// /* istanbul ignore else */
|
|
413
|
+
// if (Array.isArray(searchConditions.actionStatuses) && searchConditions.actionStatuses.length > 0) {
|
|
414
|
+
// andConditions.push({
|
|
415
|
+
// actionStatus: { $in: searchConditions.actionStatuses }
|
|
416
|
+
// });
|
|
417
|
+
// }
|
|
418
|
+
// // tslint:disable-next-line:no-single-line-block-comment
|
|
419
|
+
// /* istanbul ignore else */
|
|
420
|
+
// if (Array.isArray(searchConditions.purposeTypeOfs) && searchConditions.purposeTypeOfs.length > 0) {
|
|
421
|
+
// andConditions.push({
|
|
422
|
+
// 'purpose.typeOf': {
|
|
423
|
+
// $exists: true,
|
|
424
|
+
// $in: searchConditions.purposeTypeOfs
|
|
425
|
+
// }
|
|
426
|
+
// });
|
|
427
|
+
// }
|
|
428
|
+
// // tslint:disable-next-line:no-single-line-block-comment
|
|
429
|
+
// /* istanbul ignore else */
|
|
430
|
+
// if (Array.isArray(searchConditions.fromLocationAccountNumbers) && searchConditions.fromLocationAccountNumbers.length > 0) {
|
|
431
|
+
// andConditions.push({
|
|
432
|
+
// 'fromLocation.accountNumber': {
|
|
433
|
+
// $exists: true,
|
|
434
|
+
// $in: searchConditions.fromLocationAccountNumbers
|
|
435
|
+
// }
|
|
436
|
+
// });
|
|
437
|
+
// }
|
|
438
|
+
// // tslint:disable-next-line:no-single-line-block-comment
|
|
439
|
+
// /* istanbul ignore else */
|
|
440
|
+
// if (Array.isArray(searchConditions.toLocationAccountNumbers) && searchConditions.toLocationAccountNumbers.length > 0) {
|
|
441
|
+
// andConditions.push({
|
|
442
|
+
// 'toLocation.accountNumber': {
|
|
443
|
+
// $exists: true,
|
|
444
|
+
// $in: searchConditions.toLocationAccountNumbers
|
|
445
|
+
// }
|
|
446
|
+
// });
|
|
447
|
+
// }
|
|
448
|
+
// return this.actionModel.find(
|
|
449
|
+
// { $and: andConditions },
|
|
450
|
+
// {
|
|
451
|
+
// __v: 0,
|
|
452
|
+
// createdAt: 0,
|
|
453
|
+
// updatedAt: 0
|
|
454
|
+
// }
|
|
455
|
+
// )
|
|
456
|
+
// .limit(searchConditions.limit)
|
|
457
|
+
// .exec()
|
|
458
|
+
// .then((docs) => docs.map((doc) => doc.toObject()));
|
|
459
|
+
// }
|
|
413
460
|
clean(params) {
|
|
414
461
|
var _a;
|
|
415
462
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.MongoRepository = void 0;
|
|
13
|
-
|
|
13
|
+
const factory = require("../factory");
|
|
14
14
|
const accountTitle_1 = require("./mongoose/model/accountTitle");
|
|
15
15
|
/**
|
|
16
16
|
* 科目リポジトリ
|
|
@@ -27,5 +27,10 @@ class MongoRepository {
|
|
|
27
27
|
.exec();
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
|
+
getCursor(conditions, projection) {
|
|
31
|
+
return this.accountTitleModel.find(conditions, projection)
|
|
32
|
+
.sort({ codeValue: factory.sortType.Descending })
|
|
33
|
+
.cursor();
|
|
34
|
+
}
|
|
30
35
|
}
|
|
31
36
|
exports.MongoRepository = MongoRepository;
|
|
@@ -163,5 +163,10 @@ class MongoRepository {
|
|
|
163
163
|
.exec();
|
|
164
164
|
});
|
|
165
165
|
}
|
|
166
|
+
getCursor(conditions, projection) {
|
|
167
|
+
return this.merchantReturnPolicyModel.find(conditions, projection)
|
|
168
|
+
.sort({ identifier: factory.sortType.Descending })
|
|
169
|
+
.cursor();
|
|
170
|
+
}
|
|
166
171
|
}
|
|
167
172
|
exports.MongoRepository = MongoRepository;
|
package/package.json
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@chevre/factory": "4.
|
|
13
|
-
"@cinerino/sdk": "3.134.0
|
|
12
|
+
"@chevre/factory": "4.280.0-alpha.0",
|
|
13
|
+
"@cinerino/sdk": "3.134.0",
|
|
14
14
|
"@motionpicture/coa-service": "9.2.0",
|
|
15
15
|
"@motionpicture/gmo-service": "5.2.0",
|
|
16
16
|
"@sendgrid/mail": "6.4.0",
|
|
@@ -120,5 +120,5 @@
|
|
|
120
120
|
"postversion": "git push origin --tags",
|
|
121
121
|
"prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
|
|
122
122
|
},
|
|
123
|
-
"version": "20.1.0-alpha.
|
|
123
|
+
"version": "20.1.0-alpha.29"
|
|
124
124
|
}
|