@chevre/domain 21.4.0-alpha.17 → 21.4.0-alpha.18
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/order.js
CHANGED
|
@@ -24,7 +24,7 @@ class MongoRepository {
|
|
|
24
24
|
}
|
|
25
25
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
26
26
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
27
|
-
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;
|
|
27
|
+
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;
|
|
28
28
|
const andConditions = [];
|
|
29
29
|
const projectIdEq = (_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
|
|
30
30
|
if (typeof projectIdEq === 'string') {
|
|
@@ -70,31 +70,22 @@ class MongoRepository {
|
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
/* istanbul ignore else */
|
|
88
|
-
if (Array.isArray(params.seller.ids)) {
|
|
89
|
-
andConditions.push({
|
|
90
|
-
'seller.id': {
|
|
91
|
-
$exists: true,
|
|
92
|
-
$in: params.seller.ids
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
}
|
|
73
|
+
const providerIdEq = (_h = (_g = params.provider) === null || _g === void 0 ? void 0 : _g.id) === null || _h === void 0 ? void 0 : _h.$eq;
|
|
74
|
+
if (typeof providerIdEq === 'string') {
|
|
75
|
+
andConditions.push({ 'seller.id': { $exists: true, $eq: providerIdEq } });
|
|
76
|
+
}
|
|
77
|
+
const sellerIdEq = (_k = (_j = params.seller) === null || _j === void 0 ? void 0 : _j.id) === null || _k === void 0 ? void 0 : _k.$eq;
|
|
78
|
+
if (typeof sellerIdEq === 'string') {
|
|
79
|
+
andConditions.push({ 'seller.id': { $exists: true, $eq: sellerIdEq } });
|
|
80
|
+
}
|
|
81
|
+
const sellerIds = (_l = params.seller) === null || _l === void 0 ? void 0 : _l.ids;
|
|
82
|
+
if (Array.isArray(sellerIds)) {
|
|
83
|
+
andConditions.push({ 'seller.id': { $exists: true, $in: sellerIds } });
|
|
84
|
+
}
|
|
85
|
+
if (typeof ((_m = params.seller) === null || _m === void 0 ? void 0 : _m.typeOf) === 'string') {
|
|
86
|
+
andConditions.push({ 'seller.typeOf': { $exists: true, $eq: params.seller.typeOf } });
|
|
96
87
|
}
|
|
97
|
-
const brokerIdEq = (
|
|
88
|
+
const brokerIdEq = (_p = (_o = params.broker) === null || _o === void 0 ? void 0 : _o.id) === null || _p === void 0 ? void 0 : _p.$eq;
|
|
98
89
|
if (typeof brokerIdEq === 'string') {
|
|
99
90
|
andConditions.push({
|
|
100
91
|
'broker.id': {
|
|
@@ -311,7 +302,7 @@ class MongoRepository {
|
|
|
311
302
|
}
|
|
312
303
|
}
|
|
313
304
|
}
|
|
314
|
-
const nameEq = (
|
|
305
|
+
const nameEq = (_q = params.name) === null || _q === void 0 ? void 0 : _q.$eq;
|
|
315
306
|
if (typeof nameEq === 'string') {
|
|
316
307
|
andConditions.push({
|
|
317
308
|
name: {
|
|
@@ -320,7 +311,7 @@ class MongoRepository {
|
|
|
320
311
|
}
|
|
321
312
|
});
|
|
322
313
|
}
|
|
323
|
-
const nameRegex = (
|
|
314
|
+
const nameRegex = (_r = params.name) === null || _r === void 0 ? void 0 : _r.$regex;
|
|
324
315
|
if (typeof nameRegex === 'string' && nameRegex.length > 0) {
|
|
325
316
|
andConditions.push({
|
|
326
317
|
name: {
|
|
@@ -353,7 +344,7 @@ class MongoRepository {
|
|
|
353
344
|
}
|
|
354
345
|
});
|
|
355
346
|
}
|
|
356
|
-
const itemOfferedIdentifierIn = (
|
|
347
|
+
const itemOfferedIdentifierIn = (_u = (_t = (_s = params.acceptedOffers) === null || _s === void 0 ? void 0 : _s.itemOffered) === null || _t === void 0 ? void 0 : _t.identifier) === null || _u === void 0 ? void 0 : _u.$in;
|
|
357
348
|
if (Array.isArray(itemOfferedIdentifierIn)) {
|
|
358
349
|
andConditions.push({
|
|
359
350
|
'acceptedOffers.itemOffered.identifier': {
|
|
@@ -362,7 +353,7 @@ class MongoRepository {
|
|
|
362
353
|
}
|
|
363
354
|
});
|
|
364
355
|
}
|
|
365
|
-
const itemOfferedTypeOfIn = (
|
|
356
|
+
const itemOfferedTypeOfIn = (_x = (_w = (_v = params.acceptedOffers) === null || _v === void 0 ? void 0 : _v.itemOffered) === null || _w === void 0 ? void 0 : _w.typeOf) === null || _x === void 0 ? void 0 : _x.$in;
|
|
366
357
|
if (Array.isArray(itemOfferedTypeOfIn)) {
|
|
367
358
|
andConditions.push({
|
|
368
359
|
'acceptedOffers.itemOffered.typeOf': {
|
|
@@ -371,7 +362,7 @@ class MongoRepository {
|
|
|
371
362
|
}
|
|
372
363
|
});
|
|
373
364
|
}
|
|
374
|
-
const itemOfferedIssuedThroughTypeOfEq = (
|
|
365
|
+
const itemOfferedIssuedThroughTypeOfEq = (_1 = (_0 = (_z = (_y = params.acceptedOffers) === null || _y === void 0 ? void 0 : _y.itemOffered) === null || _z === void 0 ? void 0 : _z.issuedThrough) === null || _0 === void 0 ? void 0 : _0.typeOf) === null || _1 === void 0 ? void 0 : _1.$eq;
|
|
375
366
|
if (typeof itemOfferedIssuedThroughTypeOfEq === 'string') {
|
|
376
367
|
andConditions.push({
|
|
377
368
|
'acceptedOffers.itemOffered.issuedThrough.typeOf': {
|
|
@@ -380,7 +371,7 @@ class MongoRepository {
|
|
|
380
371
|
}
|
|
381
372
|
});
|
|
382
373
|
}
|
|
383
|
-
const itemOfferedIssuedThroughIdIn = (
|
|
374
|
+
const itemOfferedIssuedThroughIdIn = (_5 = (_4 = (_3 = (_2 = params.acceptedOffers) === null || _2 === void 0 ? void 0 : _2.itemOffered) === null || _3 === void 0 ? void 0 : _3.issuedThrough) === null || _4 === void 0 ? void 0 : _4.id) === null || _5 === void 0 ? void 0 : _5.$in;
|
|
384
375
|
if (Array.isArray(itemOfferedIssuedThroughIdIn)) {
|
|
385
376
|
andConditions.push({
|
|
386
377
|
'acceptedOffers.itemOffered.issuedThrough.id': {
|
|
@@ -389,7 +380,7 @@ class MongoRepository {
|
|
|
389
380
|
}
|
|
390
381
|
});
|
|
391
382
|
}
|
|
392
|
-
const itemOfferedProgramMembershipUsedIdentifierEq = (
|
|
383
|
+
const itemOfferedProgramMembershipUsedIdentifierEq = (_9 = (_8 = (_7 = (_6 = params.acceptedOffers) === null || _6 === void 0 ? void 0 : _6.itemOffered) === null || _7 === void 0 ? void 0 : _7.programMembershipUsed) === null || _8 === void 0 ? void 0 : _8.identifier) === null || _9 === void 0 ? void 0 : _9.$eq;
|
|
393
384
|
if (typeof itemOfferedProgramMembershipUsedIdentifierEq === 'string') {
|
|
394
385
|
andConditions.push({
|
|
395
386
|
'acceptedOffers.itemOffered.programMembershipUsed.identifier': {
|
|
@@ -398,7 +389,7 @@ class MongoRepository {
|
|
|
398
389
|
}
|
|
399
390
|
});
|
|
400
391
|
}
|
|
401
|
-
const itemOfferedProgramMembershipUsedIssuedThroughServiceTypeCodeValueEq = (
|
|
392
|
+
const itemOfferedProgramMembershipUsedIssuedThroughServiceTypeCodeValueEq = (_15 = (_14 = (_13 = (_12 = (_11 = (_10 = params.acceptedOffers) === null || _10 === void 0 ? void 0 : _10.itemOffered) === null || _11 === void 0 ? void 0 : _11.programMembershipUsed) === null || _12 === void 0 ? void 0 : _12.issuedThrough) === null || _13 === void 0 ? void 0 : _13.serviceType) === null || _14 === void 0 ? void 0 : _14.codeValue) === null || _15 === void 0 ? void 0 : _15.$eq;
|
|
402
393
|
if (typeof itemOfferedProgramMembershipUsedIssuedThroughServiceTypeCodeValueEq === 'string') {
|
|
403
394
|
andConditions.push({
|
|
404
395
|
'acceptedOffers.itemOffered.programMembershipUsed.issuedThrough.serviceType.codeValue': {
|
|
@@ -594,7 +585,7 @@ class MongoRepository {
|
|
|
594
585
|
});
|
|
595
586
|
}
|
|
596
587
|
}
|
|
597
|
-
const paymentMethodAdditionalPropertyAll = (
|
|
588
|
+
const paymentMethodAdditionalPropertyAll = (_17 = (_16 = params.paymentMethods) === null || _16 === void 0 ? void 0 : _16.additionalProperty) === null || _17 === void 0 ? void 0 : _17.$all;
|
|
598
589
|
if (Array.isArray(paymentMethodAdditionalPropertyAll)) {
|
|
599
590
|
andConditions.push({
|
|
600
591
|
'paymentMethods.additionalProperty': {
|
|
@@ -603,7 +594,7 @@ class MongoRepository {
|
|
|
603
594
|
}
|
|
604
595
|
});
|
|
605
596
|
}
|
|
606
|
-
const paymentMethodAdditionalPropertyIn = (
|
|
597
|
+
const paymentMethodAdditionalPropertyIn = (_19 = (_18 = params.paymentMethods) === null || _18 === void 0 ? void 0 : _18.additionalProperty) === null || _19 === void 0 ? void 0 : _19.$in;
|
|
607
598
|
if (Array.isArray(paymentMethodAdditionalPropertyIn)) {
|
|
608
599
|
andConditions.push({
|
|
609
600
|
'paymentMethods.additionalProperty': {
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@chevre/factory": "4.316.0-alpha.
|
|
12
|
+
"@chevre/factory": "4.316.0-alpha.1",
|
|
13
13
|
"@cinerino/sdk": "3.160.0-alpha.5",
|
|
14
14
|
"@motionpicture/coa-service": "9.2.0",
|
|
15
15
|
"@motionpicture/gmo-service": "5.2.0",
|
|
@@ -117,5 +117,5 @@
|
|
|
117
117
|
"postversion": "git push origin --tags",
|
|
118
118
|
"prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
|
|
119
119
|
},
|
|
120
|
-
"version": "21.4.0-alpha.
|
|
120
|
+
"version": "21.4.0-alpha.18"
|
|
121
121
|
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// tslint:disable:no-console
|
|
2
|
-
import * as mongoose from 'mongoose';
|
|
3
|
-
|
|
4
|
-
import { chevre } from '../../../lib/index';
|
|
5
|
-
|
|
6
|
-
async function main() {
|
|
7
|
-
await mongoose.connect(<string>process.env.MONGOLAB_URI);
|
|
8
|
-
|
|
9
|
-
const orderRepo = new chevre.repository.Order(mongoose.connection);
|
|
10
|
-
|
|
11
|
-
const order = await orderRepo.findByOrderNumberAndReservationId({
|
|
12
|
-
orderNumber: 'CIN9-4783801-1618274',
|
|
13
|
-
reservationId: '139787058570943-0'
|
|
14
|
-
});
|
|
15
|
-
console.log('order found', order);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
main()
|
|
19
|
-
.then()
|
|
20
|
-
.catch(console.error);
|