@chevre/domain 21.19.0-alpha.8 → 21.19.0
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/deleteOldPaymentServices.ts +18 -0
- package/example/src/chevre/processAction.ts +42 -0
- package/example/src/chevre/searchOffers.ts +2 -1
- package/example/src/chevre/upsertProductsByProductId.ts +99 -0
- package/lib/chevre/repo/action.d.ts +9 -4
- package/lib/chevre/repo/action.js +24 -3
- package/lib/chevre/repo/aggregateOffer.js +28 -22
- package/lib/chevre/repo/offer.js +28 -22
- package/lib/chevre/repo/offerCatalog.js +13 -9
- package/lib/chevre/repo/offerCatalogItem.js +14 -10
- package/lib/chevre/repo/paymentService.d.ts +3 -7
- package/lib/chevre/repo/paymentService.js +28 -55
- package/lib/chevre/repo/paymentServiceProvider.js +1 -4
- package/lib/chevre/repo/product.d.ts +19 -7
- package/lib/chevre/repo/product.js +47 -14
- package/lib/chevre/service/code.js +1 -3
- package/lib/chevre/service/delivery.js +2 -6
- package/lib/chevre/service/event/createEvent.js +1 -3
- package/lib/chevre/service/event.js +2 -6
- package/lib/chevre/service/moneyTransfer.js +1 -3
- package/lib/chevre/service/notification.js +2 -6
- package/lib/chevre/service/offer/event/authorize.js +1 -2
- package/lib/chevre/service/offer/eventServiceByCOA.js +2 -4
- package/lib/chevre/service/offer/moneyTransfer/authorize.js +1 -3
- package/lib/chevre/service/offer/moneyTransfer/returnMoneyTransfer.js +1 -3
- package/lib/chevre/service/offer/moneyTransfer/settleTransaction.js +1 -3
- package/lib/chevre/service/offer/product.js +1 -2
- package/lib/chevre/service/order/confirmPayTransaction.js +1 -3
- package/lib/chevre/service/order/placeOrder.js +2 -6
- package/lib/chevre/service/order/returnOrder.js +1 -3
- package/lib/chevre/service/order/sendOrder.js +1 -2
- package/lib/chevre/service/payment/any.js +1 -2
- package/lib/chevre/service/payment/creditCard.js +2 -5
- package/lib/chevre/service/payment/faceToFace.js +2 -5
- package/lib/chevre/service/payment/movieTicket.js +2 -6
- package/lib/chevre/service/payment/paymentCard.js +2 -4
- package/lib/chevre/service/product.js +1 -3
- package/lib/chevre/service/reserve/cancelReservation.js +2 -6
- package/lib/chevre/service/reserve/confirmReservation.js +1 -3
- package/lib/chevre/service/reserve/useReservation.js +1 -3
- package/lib/chevre/service/task/confirmRegisterServiceTransaction.js +1 -3
- package/lib/chevre/service/task/confirmReserveTransaction.js +1 -3
- package/lib/chevre/service/task/onResourceUpdated/onOfferCatalogUpdated.d.ts +2 -0
- package/lib/chevre/service/task/onResourceUpdated/onOfferCatalogUpdated.js +9 -5
- package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +7 -14
- package/lib/chevre/service/task/onResourceUpdated.js +2 -1
- package/lib/chevre/service/task/returnPayTransaction.js +1 -2
- package/lib/chevre/service/task/returnReserveTransaction.js +1 -2
- package/lib/chevre/service/transaction/deleteTransaction.js +1 -3
- package/lib/chevre/service/transaction/moneyTransfer.js +1 -2
- package/lib/chevre/settings.d.ts +0 -2
- package/lib/chevre/settings.js +1 -3
- package/package.json +3 -3
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// tslint:disable:no-console
|
|
2
|
+
import * as mongoose from 'mongoose';
|
|
3
|
+
|
|
4
|
+
import { chevre } from '../../../lib/index';
|
|
5
|
+
|
|
6
|
+
// tslint:disable-next-line:max-func-body-length
|
|
7
|
+
async function main() {
|
|
8
|
+
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
9
|
+
|
|
10
|
+
const paymentServiceRepo = await chevre.repository.PaymentService.createInstance(mongoose.connection);
|
|
11
|
+
|
|
12
|
+
const result = await paymentServiceRepo.deleteOldPaymentServices();
|
|
13
|
+
console.log(result);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
main()
|
|
17
|
+
.then()
|
|
18
|
+
.catch(console.error);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// tslint:disable:no-console
|
|
2
|
+
import * as mongoose from 'mongoose';
|
|
3
|
+
|
|
4
|
+
import { chevre } from '../../../lib/index';
|
|
5
|
+
|
|
6
|
+
const project = { id: String(process.env.PROJECT_ID) };
|
|
7
|
+
|
|
8
|
+
// tslint:disable-next-line:max-func-body-length
|
|
9
|
+
async function main() {
|
|
10
|
+
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
11
|
+
|
|
12
|
+
const actionRepo = await chevre.repository.Action.createInstance(mongoose.connection);
|
|
13
|
+
const action = await actionRepo.start({
|
|
14
|
+
project: { typeOf: chevre.factory.organizationType.Project, id: project.id },
|
|
15
|
+
typeOf: chevre.factory.actionType.CreateAction,
|
|
16
|
+
agent: {
|
|
17
|
+
id: project.id,
|
|
18
|
+
name: 'sample',
|
|
19
|
+
typeOf: chevre.factory.organizationType.Project
|
|
20
|
+
},
|
|
21
|
+
object: { typeOf: chevre.factory.offerType.Offer },
|
|
22
|
+
...{
|
|
23
|
+
targetCollection: { typeOf: chevre.factory.offerType.Offer }
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
// const error = new Error('sample error');
|
|
27
|
+
// await actionRepo.giveUp({
|
|
28
|
+
// typeOf: action.typeOf,
|
|
29
|
+
// id: action.id,
|
|
30
|
+
// // error: { ...error, message: error.message, name: error.name }
|
|
31
|
+
// error
|
|
32
|
+
// });
|
|
33
|
+
await actionRepo.completeWithVoid({
|
|
34
|
+
typeOf: action.typeOf,
|
|
35
|
+
id: action.id,
|
|
36
|
+
result: {}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
main()
|
|
41
|
+
.then()
|
|
42
|
+
.catch(console.error);
|
|
@@ -28,6 +28,7 @@ async function main() {
|
|
|
28
28
|
},
|
|
29
29
|
priceSpecification: {
|
|
30
30
|
appliesToMovieTicket: {
|
|
31
|
+
$size: 2,
|
|
31
32
|
serviceOutput: {
|
|
32
33
|
typeOf: {
|
|
33
34
|
// $eq: '',
|
|
@@ -54,7 +55,7 @@ async function main() {
|
|
|
54
55
|
// ]
|
|
55
56
|
// }
|
|
56
57
|
},
|
|
57
|
-
{ project: 1 }
|
|
58
|
+
{ project: 1, name: 1 }
|
|
58
59
|
);
|
|
59
60
|
console.log(offers.map((offer) => {
|
|
60
61
|
return `${offer.project?.id} ${offer.id} ${offer.parentOffer?.id} ${offer.identifier} ${offer.name?.ja}`;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// tslint:disable:no-console
|
|
2
|
+
import * as mongoose from 'mongoose';
|
|
3
|
+
|
|
4
|
+
import { chevre } from '../../../lib/index';
|
|
5
|
+
|
|
6
|
+
const PROJECT_ID = String(process.env.PROJECT_ID);
|
|
7
|
+
|
|
8
|
+
// tslint:disable-next-line:max-func-body-length
|
|
9
|
+
async function main() {
|
|
10
|
+
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
11
|
+
|
|
12
|
+
const productRepo = await chevre.repository.Product.createInstance(mongoose.connection);
|
|
13
|
+
|
|
14
|
+
const result = await productRepo.upsertManyByProductId(
|
|
15
|
+
[
|
|
16
|
+
{
|
|
17
|
+
$set: {
|
|
18
|
+
project: {
|
|
19
|
+
typeOf: chevre.factory.organizationType.Project,
|
|
20
|
+
id: PROJECT_ID
|
|
21
|
+
},
|
|
22
|
+
typeOf: chevre.factory.product.ProductType.EventService,
|
|
23
|
+
productID: '2023122601EventService',
|
|
24
|
+
name: {
|
|
25
|
+
en: 'xxx',
|
|
26
|
+
ja: 'xxx'
|
|
27
|
+
},
|
|
28
|
+
// hasOfferCatalog: {
|
|
29
|
+
// id: 'blpc770py',
|
|
30
|
+
// typeOf: 'OfferCatalog'
|
|
31
|
+
// },
|
|
32
|
+
// serviceType: {
|
|
33
|
+
// codeValue: '0001',
|
|
34
|
+
// typeOf: 'CategoryCode',
|
|
35
|
+
// inCodeSet: {
|
|
36
|
+
// identifier: chevre.factory.categoryCode.CategorySetIdentifier.ServiceType,
|
|
37
|
+
// typeOf: 'CategoryCodeSet'
|
|
38
|
+
// }
|
|
39
|
+
// },
|
|
40
|
+
availableChannel: {
|
|
41
|
+
typeOf: 'ServiceChannel',
|
|
42
|
+
credentials: {}
|
|
43
|
+
},
|
|
44
|
+
description: {
|
|
45
|
+
en: 'xxx',
|
|
46
|
+
ja: 'xxx'
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
$unset: {
|
|
50
|
+
hasOfferCatalog: 1,
|
|
51
|
+
serviceType: 1
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
$set: {
|
|
56
|
+
project: {
|
|
57
|
+
typeOf: chevre.factory.organizationType.Project,
|
|
58
|
+
id: PROJECT_ID
|
|
59
|
+
},
|
|
60
|
+
typeOf: chevre.factory.product.ProductType.EventService,
|
|
61
|
+
productID: '2023122602EventService',
|
|
62
|
+
name: {
|
|
63
|
+
en: 'xxx',
|
|
64
|
+
ja: 'xxx'
|
|
65
|
+
},
|
|
66
|
+
hasOfferCatalog: {
|
|
67
|
+
id: 'blpc770py',
|
|
68
|
+
typeOf: 'OfferCatalog'
|
|
69
|
+
},
|
|
70
|
+
// serviceType: {
|
|
71
|
+
// codeValue: '0001',
|
|
72
|
+
// typeOf: 'CategoryCode',
|
|
73
|
+
// inCodeSet: {
|
|
74
|
+
// identifier: chevre.factory.categoryCode.CategorySetIdentifier.ServiceType,
|
|
75
|
+
// typeOf: 'CategoryCodeSet'
|
|
76
|
+
// }
|
|
77
|
+
// },
|
|
78
|
+
availableChannel: {
|
|
79
|
+
typeOf: 'ServiceChannel',
|
|
80
|
+
credentials: {}
|
|
81
|
+
},
|
|
82
|
+
description: {
|
|
83
|
+
en: 'xxx',
|
|
84
|
+
ja: 'xxx'
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
$unset: {
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
// { replace: true }
|
|
92
|
+
);
|
|
93
|
+
// tslint:disable-next-line:no-null-keyword
|
|
94
|
+
console.log(result);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
main()
|
|
98
|
+
.then(console.log)
|
|
99
|
+
.catch(console.error);
|
|
@@ -70,6 +70,11 @@ export declare class MongoRepository {
|
|
|
70
70
|
id: string;
|
|
71
71
|
result: any;
|
|
72
72
|
}): Promise<IAction<T>>;
|
|
73
|
+
completeWithVoid(params: {
|
|
74
|
+
typeOf: factory.actionType;
|
|
75
|
+
id: string;
|
|
76
|
+
result: any;
|
|
77
|
+
}): Promise<void>;
|
|
73
78
|
/**
|
|
74
79
|
* アクション取消
|
|
75
80
|
*/
|
|
@@ -80,11 +85,11 @@ export declare class MongoRepository {
|
|
|
80
85
|
/**
|
|
81
86
|
* アクション失敗
|
|
82
87
|
*/
|
|
83
|
-
giveUp
|
|
84
|
-
typeOf:
|
|
88
|
+
giveUp(params: {
|
|
89
|
+
typeOf: factory.actionType;
|
|
85
90
|
id: string;
|
|
86
|
-
error:
|
|
87
|
-
}): Promise<
|
|
91
|
+
error: Error;
|
|
92
|
+
}): Promise<void>;
|
|
88
93
|
/**
|
|
89
94
|
* 一定期間ActiveActionStatusのアクションをFailedActionStatusにする
|
|
90
95
|
*/
|
|
@@ -492,6 +492,22 @@ class MongoRepository {
|
|
|
492
492
|
return doc.toObject();
|
|
493
493
|
});
|
|
494
494
|
}
|
|
495
|
+
completeWithVoid(params) {
|
|
496
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
497
|
+
const doc = yield this.actionModel.findOneAndUpdate({
|
|
498
|
+
_id: { $eq: params.id },
|
|
499
|
+
typeOf: { $eq: params.typeOf }
|
|
500
|
+
}, {
|
|
501
|
+
actionStatus: factory.actionStatusType.CompletedActionStatus,
|
|
502
|
+
result: params.result,
|
|
503
|
+
endDate: new Date()
|
|
504
|
+
}, { new: false, projection: { _id: 1 } })
|
|
505
|
+
.exec();
|
|
506
|
+
if (doc === null) {
|
|
507
|
+
throw new factory.errors.NotFound(this.actionModel.modelName);
|
|
508
|
+
}
|
|
509
|
+
});
|
|
510
|
+
}
|
|
495
511
|
/**
|
|
496
512
|
* アクション取消
|
|
497
513
|
*/
|
|
@@ -514,20 +530,25 @@ class MongoRepository {
|
|
|
514
530
|
*/
|
|
515
531
|
giveUp(params) {
|
|
516
532
|
return __awaiter(this, void 0, void 0, function* () {
|
|
533
|
+
const actionError = Object.assign(Object.assign({}, params.error), { message: params.error.message, name: params.error.name });
|
|
534
|
+
// const actionError: Object = params.error;
|
|
535
|
+
// if (params.error instanceof Error) {
|
|
536
|
+
// actionError = { ...params.error, message: params.error.message, name: params.error.name };
|
|
537
|
+
// }
|
|
517
538
|
const doc = yield this.actionModel.findOneAndUpdate({
|
|
518
539
|
typeOf: params.typeOf,
|
|
519
540
|
_id: params.id
|
|
520
541
|
}, {
|
|
521
542
|
actionStatus: factory.actionStatusType.FailedActionStatus,
|
|
522
|
-
error:
|
|
543
|
+
error: actionError,
|
|
523
544
|
endDate: new Date()
|
|
524
545
|
}, { new: true })
|
|
525
|
-
.select({
|
|
546
|
+
.select({ _id: 1 })
|
|
526
547
|
.exec();
|
|
527
548
|
if (doc === null) {
|
|
528
549
|
throw new factory.errors.NotFound(this.actionModel.modelName);
|
|
529
550
|
}
|
|
530
|
-
return doc.toObject();
|
|
551
|
+
// return doc.toObject();
|
|
531
552
|
});
|
|
532
553
|
}
|
|
533
554
|
/**
|
|
@@ -22,7 +22,7 @@ class MongoRepository {
|
|
|
22
22
|
}
|
|
23
23
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
24
24
|
static CREATE_AGGREGATE_OFFERS_MATCH_CONDITIONS(params) {
|
|
25
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42;
|
|
25
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44;
|
|
26
26
|
const matchStages = [];
|
|
27
27
|
const projectIdEq = (_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
|
|
28
28
|
if (typeof projectIdEq === 'string') {
|
|
@@ -172,7 +172,13 @@ class MongoRepository {
|
|
|
172
172
|
}
|
|
173
173
|
});
|
|
174
174
|
}
|
|
175
|
-
const
|
|
175
|
+
const appliesToMovieTicketSize = (_v = (_u = params.priceSpecification) === null || _u === void 0 ? void 0 : _u.appliesToMovieTicket) === null || _v === void 0 ? void 0 : _v.$size;
|
|
176
|
+
if (typeof appliesToMovieTicketSize === 'number') {
|
|
177
|
+
matchStages.push({
|
|
178
|
+
$match: { 'offers.priceSpecification.appliesToMovieTicket': { $exists: true, $size: appliesToMovieTicketSize } }
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
const appliesToMovieTicketServiceTypeExist = (_y = (_x = (_w = params.priceSpecification) === null || _w === void 0 ? void 0 : _w.appliesToMovieTicket) === null || _x === void 0 ? void 0 : _x.serviceType) === null || _y === void 0 ? void 0 : _y.$exists;
|
|
176
182
|
if (typeof appliesToMovieTicketServiceTypeExist === 'boolean') {
|
|
177
183
|
matchStages.push({
|
|
178
184
|
$match: {
|
|
@@ -182,7 +188,7 @@ class MongoRepository {
|
|
|
182
188
|
}
|
|
183
189
|
});
|
|
184
190
|
}
|
|
185
|
-
const appliesToMovieTicketServiceTypeEq = (
|
|
191
|
+
const appliesToMovieTicketServiceTypeEq = (_1 = (_0 = (_z = params.priceSpecification) === null || _z === void 0 ? void 0 : _z.appliesToMovieTicket) === null || _0 === void 0 ? void 0 : _0.serviceType) === null || _1 === void 0 ? void 0 : _1.$eq;
|
|
186
192
|
if (typeof appliesToMovieTicketServiceTypeEq === 'string') {
|
|
187
193
|
matchStages.push({
|
|
188
194
|
$match: {
|
|
@@ -193,7 +199,7 @@ class MongoRepository {
|
|
|
193
199
|
}
|
|
194
200
|
});
|
|
195
201
|
}
|
|
196
|
-
const appliesToMovieTicketServiceOutputTypeOfEq = (
|
|
202
|
+
const appliesToMovieTicketServiceOutputTypeOfEq = (_5 = (_4 = (_3 = (_2 = params.priceSpecification) === null || _2 === void 0 ? void 0 : _2.appliesToMovieTicket) === null || _3 === void 0 ? void 0 : _3.serviceOutput) === null || _4 === void 0 ? void 0 : _4.typeOf) === null || _5 === void 0 ? void 0 : _5.$eq;
|
|
197
203
|
if (typeof appliesToMovieTicketServiceOutputTypeOfEq === 'string') {
|
|
198
204
|
matchStages.push({
|
|
199
205
|
$match: {
|
|
@@ -204,7 +210,7 @@ class MongoRepository {
|
|
|
204
210
|
}
|
|
205
211
|
});
|
|
206
212
|
}
|
|
207
|
-
const appliesToMovieTicketServiceOutputTypeOfAll = (
|
|
213
|
+
const appliesToMovieTicketServiceOutputTypeOfAll = (_9 = (_8 = (_7 = (_6 = params.priceSpecification) === null || _6 === void 0 ? void 0 : _6.appliesToMovieTicket) === null || _7 === void 0 ? void 0 : _7.serviceOutput) === null || _8 === void 0 ? void 0 : _8.typeOf) === null || _9 === void 0 ? void 0 : _9.$all;
|
|
208
214
|
if (Array.isArray(appliesToMovieTicketServiceOutputTypeOfAll)) {
|
|
209
215
|
matchStages.push({
|
|
210
216
|
$match: {
|
|
@@ -215,7 +221,7 @@ class MongoRepository {
|
|
|
215
221
|
}
|
|
216
222
|
});
|
|
217
223
|
}
|
|
218
|
-
const appliesToMovieTicketServiceOutputTypeOfNin = (
|
|
224
|
+
const appliesToMovieTicketServiceOutputTypeOfNin = (_13 = (_12 = (_11 = (_10 = params.priceSpecification) === null || _10 === void 0 ? void 0 : _10.appliesToMovieTicket) === null || _11 === void 0 ? void 0 : _11.serviceOutput) === null || _12 === void 0 ? void 0 : _12.typeOf) === null || _13 === void 0 ? void 0 : _13.$nin;
|
|
219
225
|
if (Array.isArray(appliesToMovieTicketServiceOutputTypeOfNin)) {
|
|
220
226
|
matchStages.push({
|
|
221
227
|
$match: {
|
|
@@ -226,7 +232,7 @@ class MongoRepository {
|
|
|
226
232
|
});
|
|
227
233
|
}
|
|
228
234
|
if (params.priceSpecification !== undefined && params.priceSpecification !== null) {
|
|
229
|
-
const priceSpecificationPriceGte = (
|
|
235
|
+
const priceSpecificationPriceGte = (_14 = params.priceSpecification.price) === null || _14 === void 0 ? void 0 : _14.$gte;
|
|
230
236
|
if (typeof priceSpecificationPriceGte === 'number') {
|
|
231
237
|
matchStages.push({
|
|
232
238
|
$match: {
|
|
@@ -237,7 +243,7 @@ class MongoRepository {
|
|
|
237
243
|
}
|
|
238
244
|
});
|
|
239
245
|
}
|
|
240
|
-
const priceSpecificationPriceLte = (
|
|
246
|
+
const priceSpecificationPriceLte = (_15 = params.priceSpecification.price) === null || _15 === void 0 ? void 0 : _15.$lte;
|
|
241
247
|
if (typeof priceSpecificationPriceLte === 'number') {
|
|
242
248
|
matchStages.push({
|
|
243
249
|
$match: {
|
|
@@ -248,7 +254,7 @@ class MongoRepository {
|
|
|
248
254
|
}
|
|
249
255
|
});
|
|
250
256
|
}
|
|
251
|
-
const accountsReceivableGte = (
|
|
257
|
+
const accountsReceivableGte = (_17 = (_16 = params.priceSpecification.accounting) === null || _16 === void 0 ? void 0 : _16.accountsReceivable) === null || _17 === void 0 ? void 0 : _17.$gte;
|
|
252
258
|
if (typeof accountsReceivableGte === 'number') {
|
|
253
259
|
matchStages.push({
|
|
254
260
|
$match: {
|
|
@@ -259,7 +265,7 @@ class MongoRepository {
|
|
|
259
265
|
}
|
|
260
266
|
});
|
|
261
267
|
}
|
|
262
|
-
const accountsReceivableLte = (
|
|
268
|
+
const accountsReceivableLte = (_19 = (_18 = params.priceSpecification.accounting) === null || _18 === void 0 ? void 0 : _18.accountsReceivable) === null || _19 === void 0 ? void 0 : _19.$lte;
|
|
263
269
|
if (typeof accountsReceivableLte === 'number') {
|
|
264
270
|
matchStages.push({
|
|
265
271
|
$match: {
|
|
@@ -270,7 +276,7 @@ class MongoRepository {
|
|
|
270
276
|
}
|
|
271
277
|
});
|
|
272
278
|
}
|
|
273
|
-
const accountingCodeValueEq = (
|
|
279
|
+
const accountingCodeValueEq = (_22 = (_21 = (_20 = params.priceSpecification.accounting) === null || _20 === void 0 ? void 0 : _20.operatingRevenue) === null || _21 === void 0 ? void 0 : _21.codeValue) === null || _22 === void 0 ? void 0 : _22.$eq;
|
|
274
280
|
if (typeof accountingCodeValueEq === 'string') {
|
|
275
281
|
matchStages.push({
|
|
276
282
|
$match: {
|
|
@@ -281,7 +287,7 @@ class MongoRepository {
|
|
|
281
287
|
}
|
|
282
288
|
});
|
|
283
289
|
}
|
|
284
|
-
const accountingCodeValueIn = (
|
|
290
|
+
const accountingCodeValueIn = (_25 = (_24 = (_23 = params.priceSpecification.accounting) === null || _23 === void 0 ? void 0 : _23.operatingRevenue) === null || _24 === void 0 ? void 0 : _24.codeValue) === null || _25 === void 0 ? void 0 : _25.$in;
|
|
285
291
|
if (Array.isArray(accountingCodeValueIn)) {
|
|
286
292
|
matchStages.push({
|
|
287
293
|
$match: {
|
|
@@ -292,7 +298,7 @@ class MongoRepository {
|
|
|
292
298
|
}
|
|
293
299
|
});
|
|
294
300
|
}
|
|
295
|
-
const referenceQuantityValueEq = (
|
|
301
|
+
const referenceQuantityValueEq = (_27 = (_26 = params.priceSpecification.referenceQuantity) === null || _26 === void 0 ? void 0 : _26.value) === null || _27 === void 0 ? void 0 : _27.$eq;
|
|
296
302
|
if (typeof referenceQuantityValueEq === 'number') {
|
|
297
303
|
matchStages.push({
|
|
298
304
|
$match: {
|
|
@@ -304,7 +310,7 @@ class MongoRepository {
|
|
|
304
310
|
});
|
|
305
311
|
}
|
|
306
312
|
}
|
|
307
|
-
const availabilityEq = (
|
|
313
|
+
const availabilityEq = (_28 = params.availability) === null || _28 === void 0 ? void 0 : _28.$eq;
|
|
308
314
|
if (typeof availabilityEq === 'string') {
|
|
309
315
|
matchStages.push({
|
|
310
316
|
$match: {
|
|
@@ -312,7 +318,7 @@ class MongoRepository {
|
|
|
312
318
|
}
|
|
313
319
|
});
|
|
314
320
|
}
|
|
315
|
-
const availableAtOrFromIdEq = (
|
|
321
|
+
const availableAtOrFromIdEq = (_30 = (_29 = params.availableAtOrFrom) === null || _29 === void 0 ? void 0 : _29.id) === null || _30 === void 0 ? void 0 : _30.$eq;
|
|
316
322
|
if (typeof availableAtOrFromIdEq === 'string') {
|
|
317
323
|
matchStages.push({
|
|
318
324
|
$match: {
|
|
@@ -323,7 +329,7 @@ class MongoRepository {
|
|
|
323
329
|
}
|
|
324
330
|
});
|
|
325
331
|
}
|
|
326
|
-
const availableAtOrFromIdIn = (
|
|
332
|
+
const availableAtOrFromIdIn = (_32 = (_31 = params.availableAtOrFrom) === null || _31 === void 0 ? void 0 : _31.id) === null || _32 === void 0 ? void 0 : _32.$in;
|
|
327
333
|
if (Array.isArray(availableAtOrFromIdIn)) {
|
|
328
334
|
matchStages.push({
|
|
329
335
|
$match: {
|
|
@@ -334,7 +340,7 @@ class MongoRepository {
|
|
|
334
340
|
}
|
|
335
341
|
});
|
|
336
342
|
}
|
|
337
|
-
const addOnItemOfferedIdEq = (
|
|
343
|
+
const addOnItemOfferedIdEq = (_35 = (_34 = (_33 = params.addOn) === null || _33 === void 0 ? void 0 : _33.itemOffered) === null || _34 === void 0 ? void 0 : _34.id) === null || _35 === void 0 ? void 0 : _35.$eq;
|
|
338
344
|
if (typeof addOnItemOfferedIdEq === 'string') {
|
|
339
345
|
matchStages.push({
|
|
340
346
|
$match: {
|
|
@@ -342,7 +348,7 @@ class MongoRepository {
|
|
|
342
348
|
}
|
|
343
349
|
});
|
|
344
350
|
}
|
|
345
|
-
const addOnItemOfferedIdIn = (
|
|
351
|
+
const addOnItemOfferedIdIn = (_38 = (_37 = (_36 = params.addOn) === null || _36 === void 0 ? void 0 : _36.itemOffered) === null || _37 === void 0 ? void 0 : _37.id) === null || _38 === void 0 ? void 0 : _38.$in;
|
|
346
352
|
if (Array.isArray(addOnItemOfferedIdIn)) {
|
|
347
353
|
matchStages.push({
|
|
348
354
|
$match: {
|
|
@@ -350,7 +356,7 @@ class MongoRepository {
|
|
|
350
356
|
}
|
|
351
357
|
});
|
|
352
358
|
}
|
|
353
|
-
const hasMerchantReturnPolicyIdEq = (
|
|
359
|
+
const hasMerchantReturnPolicyIdEq = (_40 = (_39 = params.hasMerchantReturnPolicy) === null || _39 === void 0 ? void 0 : _39.id) === null || _40 === void 0 ? void 0 : _40.$eq;
|
|
354
360
|
if (typeof hasMerchantReturnPolicyIdEq === 'string') {
|
|
355
361
|
matchStages.push({
|
|
356
362
|
$match: {
|
|
@@ -361,7 +367,7 @@ class MongoRepository {
|
|
|
361
367
|
}
|
|
362
368
|
});
|
|
363
369
|
}
|
|
364
|
-
const acceptedPaymentMethodIdentifierIn = (
|
|
370
|
+
const acceptedPaymentMethodIdentifierIn = (_42 = (_41 = params.acceptedPaymentMethod) === null || _41 === void 0 ? void 0 : _41.identifier) === null || _42 === void 0 ? void 0 : _42.$in;
|
|
365
371
|
if (Array.isArray(acceptedPaymentMethodIdentifierIn)) {
|
|
366
372
|
matchStages.push({
|
|
367
373
|
$match: {
|
|
@@ -372,7 +378,7 @@ class MongoRepository {
|
|
|
372
378
|
}
|
|
373
379
|
});
|
|
374
380
|
}
|
|
375
|
-
const additionalPropertyAll = (
|
|
381
|
+
const additionalPropertyAll = (_43 = params.additionalProperty) === null || _43 === void 0 ? void 0 : _43.$all;
|
|
376
382
|
if (Array.isArray(additionalPropertyAll)) {
|
|
377
383
|
matchStages.push({
|
|
378
384
|
$match: {
|
|
@@ -383,7 +389,7 @@ class MongoRepository {
|
|
|
383
389
|
}
|
|
384
390
|
});
|
|
385
391
|
}
|
|
386
|
-
const additionalPropertyElemMatch = (
|
|
392
|
+
const additionalPropertyElemMatch = (_44 = params.additionalProperty) === null || _44 === void 0 ? void 0 : _44.$elemMatch;
|
|
387
393
|
if (additionalPropertyElemMatch !== undefined && additionalPropertyElemMatch !== null) {
|
|
388
394
|
matchStages.push({
|
|
389
395
|
$match: {
|