@chevre/domain 24.1.0-alpha.7 → 24.1.0-alpha.9
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/factory/reservation/createMongoConditions.js +140 -139
- package/lib/chevre/repo/mongoose/schemas/order.js +117 -117
- package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +1 -0
- package/lib/chevre/repo/mongoose/schemas/reservation.js +117 -117
- package/lib/chevre/repo/order.d.ts +2 -1
- package/lib/chevre/repo/order.js +171 -170
- package/lib/chevre/repo/reservation.d.ts +2 -0
- package/package.json +2 -2
package/lib/chevre/repo/order.js
CHANGED
|
@@ -31,27 +31,27 @@ class OrderRepo {
|
|
|
31
31
|
if (typeof projectIdEq === 'string') {
|
|
32
32
|
andConditions.push({ 'project.id': { $eq: projectIdEq } });
|
|
33
33
|
}
|
|
34
|
-
/* istanbul ignore else */
|
|
35
|
-
if (params.identifier !== undefined) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
34
|
+
// /* istanbul ignore else */
|
|
35
|
+
// if (params.identifier !== undefined) {
|
|
36
|
+
// /* istanbul ignore else */
|
|
37
|
+
// if (Array.isArray(params.identifier.$all)) {
|
|
38
|
+
// andConditions.push({
|
|
39
|
+
// identifier: {
|
|
40
|
+
// $exists: true,
|
|
41
|
+
// $all: params.identifier.$all
|
|
42
|
+
// }
|
|
43
|
+
// });
|
|
44
|
+
// }
|
|
45
|
+
// /* istanbul ignore else */
|
|
46
|
+
// if (Array.isArray(params.identifier.$in)) {
|
|
47
|
+
// andConditions.push({
|
|
48
|
+
// identifier: {
|
|
49
|
+
// $exists: true,
|
|
50
|
+
// $in: params.identifier.$in
|
|
51
|
+
// }
|
|
52
|
+
// });
|
|
53
|
+
// }
|
|
54
|
+
// }
|
|
55
55
|
const providerIdEq = params.provider?.id?.$eq;
|
|
56
56
|
if (typeof providerIdEq === 'string') {
|
|
57
57
|
andConditions.push({ 'seller.id': { $exists: true, $eq: providerIdEq } });
|
|
@@ -129,44 +129,44 @@ class OrderRepo {
|
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
-
if (params.customer.additionalProperty !== undefined && params.customer.additionalProperty !== null) {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
150
|
-
if (params.customer.memberOf !== undefined && params.customer.memberOf !== null) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}
|
|
132
|
+
// if (params.customer.additionalProperty !== undefined && params.customer.additionalProperty !== null) {
|
|
133
|
+
// if (Array.isArray(params.customer.additionalProperty.$all)) {
|
|
134
|
+
// andConditions.push({
|
|
135
|
+
// 'customer.additionalProperty': {
|
|
136
|
+
// $exists: true,
|
|
137
|
+
// $all: params.customer.additionalProperty.$all
|
|
138
|
+
// }
|
|
139
|
+
// });
|
|
140
|
+
// }
|
|
141
|
+
// if (Array.isArray(params.customer.additionalProperty.$in)) {
|
|
142
|
+
// andConditions.push({
|
|
143
|
+
// 'customer.additionalProperty': {
|
|
144
|
+
// $exists: true,
|
|
145
|
+
// $in: params.customer.additionalProperty.$in
|
|
146
|
+
// }
|
|
147
|
+
// });
|
|
148
|
+
// }
|
|
149
|
+
// }
|
|
150
|
+
// if (params.customer.memberOf !== undefined && params.customer.memberOf !== null) {
|
|
151
|
+
// if (params.customer.memberOf.membershipNumber !== undefined && params.customer.memberOf.membershipNumber !== null) {
|
|
152
|
+
// if (typeof params.customer.memberOf.membershipNumber.$eq === 'string') {
|
|
153
|
+
// andConditions.push({
|
|
154
|
+
// 'customer.memberOf.membershipNumber': {
|
|
155
|
+
// $exists: true,
|
|
156
|
+
// $eq: params.customer.memberOf.membershipNumber.$eq
|
|
157
|
+
// }
|
|
158
|
+
// });
|
|
159
|
+
// }
|
|
160
|
+
// if (Array.isArray(params.customer.memberOf.membershipNumber.$in)) {
|
|
161
|
+
// andConditions.push({
|
|
162
|
+
// 'customer.memberOf.membershipNumber': {
|
|
163
|
+
// $exists: true,
|
|
164
|
+
// $in: params.customer.memberOf.membershipNumber.$in
|
|
165
|
+
// }
|
|
166
|
+
// });
|
|
167
|
+
// }
|
|
168
|
+
// }
|
|
169
|
+
// }
|
|
170
170
|
if (typeof params.customer.givenName === 'string') {
|
|
171
171
|
if (params.customer.givenName.length > 0) {
|
|
172
172
|
andConditions.push({
|
|
@@ -325,72 +325,73 @@ class OrderRepo {
|
|
|
325
325
|
andConditions.push({ confirmationNumber: { $exists: true, $in: params.confirmationNumbers } });
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
|
-
const orderedItemSize = params.orderedItem?.$size;
|
|
329
|
-
if (typeof orderedItemSize === 'number') {
|
|
330
|
-
|
|
331
|
-
}
|
|
332
|
-
const acceptedOffersSize = params.acceptedOffers?.$size;
|
|
333
|
-
if (typeof acceptedOffersSize === 'number') {
|
|
334
|
-
|
|
335
|
-
}
|
|
328
|
+
// const orderedItemSize = params.orderedItem?.$size;
|
|
329
|
+
// if (typeof orderedItemSize === 'number') {
|
|
330
|
+
// andConditions.push({ orderedItem: { $size: orderedItemSize } });
|
|
331
|
+
// }
|
|
332
|
+
// const acceptedOffersSize = params.acceptedOffers?.$size;
|
|
333
|
+
// if (typeof acceptedOffersSize === 'number') {
|
|
334
|
+
// andConditions.push({ acceptedOffers: { $size: acceptedOffersSize } });
|
|
335
|
+
// }
|
|
336
336
|
const serialNumberEq = params.acceptedOffers?.serialNumber?.$eq;
|
|
337
337
|
if (typeof serialNumberEq === 'string') {
|
|
338
338
|
andConditions.push({ 'acceptedOffers.serialNumber': { $exists: true, $eq: serialNumberEq } });
|
|
339
339
|
}
|
|
340
|
-
const itemOfferedIdentifierIn = params.acceptedOffers?.itemOffered?.identifier?.$in;
|
|
341
|
-
if (Array.isArray(itemOfferedIdentifierIn)) {
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
}
|
|
349
|
-
const itemOfferedTypeOfIn = params.acceptedOffers?.itemOffered?.typeOf?.$in;
|
|
350
|
-
if (Array.isArray(itemOfferedTypeOfIn)) {
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
}
|
|
358
|
-
const itemOfferedIssuedThroughTypeOfEq = params.acceptedOffers?.itemOffered?.issuedThrough?.typeOf?.$eq;
|
|
359
|
-
if (typeof itemOfferedIssuedThroughTypeOfEq === 'string') {
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
}
|
|
367
|
-
const itemOfferedIssuedThroughIdIn = params.acceptedOffers?.itemOffered?.issuedThrough?.id?.$in;
|
|
368
|
-
if (Array.isArray(itemOfferedIssuedThroughIdIn)) {
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
}
|
|
376
|
-
const itemOfferedProgramMembershipUsedIdentifierEq = params.acceptedOffers?.itemOffered?.programMembershipUsed?.identifier?.$eq;
|
|
377
|
-
if (typeof itemOfferedProgramMembershipUsedIdentifierEq === 'string') {
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
}
|
|
385
|
-
const itemOfferedProgramMembershipUsedIssuedThroughServiceTypeCodeValueEq =
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
}
|
|
340
|
+
// const itemOfferedIdentifierIn = params.acceptedOffers?.itemOffered?.identifier?.$in;
|
|
341
|
+
// if (Array.isArray(itemOfferedIdentifierIn)) {
|
|
342
|
+
// andConditions.push({
|
|
343
|
+
// 'acceptedOffers.itemOffered.identifier': {
|
|
344
|
+
// $exists: true,
|
|
345
|
+
// $in: itemOfferedIdentifierIn
|
|
346
|
+
// }
|
|
347
|
+
// });
|
|
348
|
+
// }
|
|
349
|
+
// const itemOfferedTypeOfIn = params.acceptedOffers?.itemOffered?.typeOf?.$in;
|
|
350
|
+
// if (Array.isArray(itemOfferedTypeOfIn)) {
|
|
351
|
+
// andConditions.push({
|
|
352
|
+
// 'acceptedOffers.itemOffered.typeOf': {
|
|
353
|
+
// $exists: true,
|
|
354
|
+
// $in: itemOfferedTypeOfIn
|
|
355
|
+
// }
|
|
356
|
+
// });
|
|
357
|
+
// }
|
|
358
|
+
// const itemOfferedIssuedThroughTypeOfEq = params.acceptedOffers?.itemOffered?.issuedThrough?.typeOf?.$eq;
|
|
359
|
+
// if (typeof itemOfferedIssuedThroughTypeOfEq === 'string') {
|
|
360
|
+
// andConditions.push({
|
|
361
|
+
// 'acceptedOffers.itemOffered.issuedThrough.typeOf': {
|
|
362
|
+
// $exists: true,
|
|
363
|
+
// $eq: itemOfferedIssuedThroughTypeOfEq
|
|
364
|
+
// }
|
|
365
|
+
// });
|
|
366
|
+
// }
|
|
367
|
+
// const itemOfferedIssuedThroughIdIn = params.acceptedOffers?.itemOffered?.issuedThrough?.id?.$in;
|
|
368
|
+
// if (Array.isArray(itemOfferedIssuedThroughIdIn)) {
|
|
369
|
+
// andConditions.push({
|
|
370
|
+
// 'acceptedOffers.itemOffered.issuedThrough.id': {
|
|
371
|
+
// $exists: true,
|
|
372
|
+
// $in: itemOfferedIssuedThroughIdIn
|
|
373
|
+
// }
|
|
374
|
+
// });
|
|
375
|
+
// }
|
|
376
|
+
// const itemOfferedProgramMembershipUsedIdentifierEq = params.acceptedOffers?.itemOffered?.programMembershipUsed?.identifier?.$eq;
|
|
377
|
+
// if (typeof itemOfferedProgramMembershipUsedIdentifierEq === 'string') {
|
|
378
|
+
// andConditions.push({
|
|
379
|
+
// 'acceptedOffers.itemOffered.programMembershipUsed.identifier': {
|
|
380
|
+
// $exists: true,
|
|
381
|
+
// $eq: itemOfferedProgramMembershipUsedIdentifierEq
|
|
382
|
+
// }
|
|
383
|
+
// });
|
|
384
|
+
// }
|
|
385
|
+
// const itemOfferedProgramMembershipUsedIssuedThroughServiceTypeCodeValueEq =
|
|
386
|
+
// params.acceptedOffers?.itemOffered?.programMembershipUsed?.issuedThrough?.serviceType?.codeValue?.$eq;
|
|
387
|
+
// if (typeof itemOfferedProgramMembershipUsedIssuedThroughServiceTypeCodeValueEq === 'string') {
|
|
388
|
+
// andConditions.push({
|
|
389
|
+
// 'acceptedOffers.itemOffered.programMembershipUsed.issuedThrough.serviceType.codeValue': {
|
|
390
|
+
// $exists: true,
|
|
391
|
+
// $eq: itemOfferedProgramMembershipUsedIssuedThroughServiceTypeCodeValueEq
|
|
392
|
+
// }
|
|
393
|
+
// });
|
|
394
|
+
// }
|
|
394
395
|
const itemOfferedReservedTicketIdentifierEq = params.acceptedOffers?.itemOffered?.reservedTicket?.identifier?.$eq;
|
|
395
396
|
if (typeof itemOfferedReservedTicketIdentifierEq === 'string') {
|
|
396
397
|
andConditions.push({
|
|
@@ -434,25 +435,25 @@ class OrderRepo {
|
|
|
434
435
|
}
|
|
435
436
|
});
|
|
436
437
|
}
|
|
437
|
-
/* istanbul ignore else */
|
|
438
|
-
if (typeof reservationForConditions.name === 'string' && reservationForConditions.name.length > 0) {
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
}
|
|
438
|
+
// /* istanbul ignore else */
|
|
439
|
+
// if (typeof reservationForConditions.name === 'string' && reservationForConditions.name.length > 0) {
|
|
440
|
+
// andConditions.push({
|
|
441
|
+
// $or: [
|
|
442
|
+
// {
|
|
443
|
+
// 'acceptedOffers.itemOffered.reservationFor.name.ja': {
|
|
444
|
+
// $exists: true,
|
|
445
|
+
// $regex: new RegExp(reservationForConditions.name)
|
|
446
|
+
// }
|
|
447
|
+
// },
|
|
448
|
+
// {
|
|
449
|
+
// 'acceptedOffers.itemOffered.reservationFor.name.en': {
|
|
450
|
+
// $exists: true,
|
|
451
|
+
// $regex: new RegExp(reservationForConditions.name)
|
|
452
|
+
// }
|
|
453
|
+
// }
|
|
454
|
+
// ]
|
|
455
|
+
// });
|
|
456
|
+
// }
|
|
456
457
|
/* istanbul ignore else */
|
|
457
458
|
if (reservationForConditions.location !== undefined) {
|
|
458
459
|
if (Array.isArray(reservationForConditions.location.branchCodes)) {
|
|
@@ -608,18 +609,18 @@ class OrderRepo {
|
|
|
608
609
|
}
|
|
609
610
|
});
|
|
610
611
|
}
|
|
611
|
-
/* istanbul ignore else */
|
|
612
|
-
if (params.orderDateFrom instanceof Date) {
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
}
|
|
617
|
-
/* istanbul ignore else */
|
|
618
|
-
if (params.orderDateThrough instanceof Date) {
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
}
|
|
612
|
+
// /* istanbul ignore else */
|
|
613
|
+
// if (params.orderDateFrom instanceof Date) {
|
|
614
|
+
// andConditions.push({
|
|
615
|
+
// orderDate: { $gte: params.orderDateFrom }
|
|
616
|
+
// });
|
|
617
|
+
// }
|
|
618
|
+
// /* istanbul ignore else */
|
|
619
|
+
// if (params.orderDateThrough instanceof Date) {
|
|
620
|
+
// andConditions.push({
|
|
621
|
+
// orderDate: { $lte: params.orderDateThrough }
|
|
622
|
+
// });
|
|
623
|
+
// }
|
|
623
624
|
if (params.orderDate !== undefined && params.orderDate !== null) {
|
|
624
625
|
if (params.orderDate.$gte instanceof Date) {
|
|
625
626
|
andConditions.push({
|
|
@@ -632,24 +633,24 @@ class OrderRepo {
|
|
|
632
633
|
});
|
|
633
634
|
}
|
|
634
635
|
}
|
|
635
|
-
if (params.price !== undefined && params.price !== null) {
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
}
|
|
636
|
+
// if (params.price !== undefined && params.price !== null) {
|
|
637
|
+
// if (typeof params.price.$gte === 'number') {
|
|
638
|
+
// andConditions.push({
|
|
639
|
+
// price: {
|
|
640
|
+
// $exists: true,
|
|
641
|
+
// $gte: params.price.$gte
|
|
642
|
+
// }
|
|
643
|
+
// });
|
|
644
|
+
// }
|
|
645
|
+
// if (typeof params.price.$lte === 'number') {
|
|
646
|
+
// andConditions.push({
|
|
647
|
+
// price: {
|
|
648
|
+
// $exists: true,
|
|
649
|
+
// $lte: params.price.$lte
|
|
650
|
+
// }
|
|
651
|
+
// });
|
|
652
|
+
// }
|
|
653
|
+
// }
|
|
653
654
|
return andConditions;
|
|
654
655
|
}
|
|
655
656
|
/**
|
|
@@ -147,6 +147,7 @@ export declare class ReservationRepo {
|
|
|
147
147
|
_id: string;
|
|
148
148
|
bookingAgent?: any;
|
|
149
149
|
previousReservationStatus?: factory.reservationStatusType;
|
|
150
|
+
priceCurrency?: factory.priceCurrency;
|
|
150
151
|
} & Required<{
|
|
151
152
|
_id: string;
|
|
152
153
|
}> & {
|
|
@@ -155,6 +156,7 @@ export declare class ReservationRepo {
|
|
|
155
156
|
_id: string;
|
|
156
157
|
bookingAgent?: any;
|
|
157
158
|
previousReservationStatus?: factory.reservationStatusType;
|
|
159
|
+
priceCurrency?: factory.priceCurrency;
|
|
158
160
|
} & Required<{
|
|
159
161
|
_id: string;
|
|
160
162
|
}> & {
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/client-cognito-identity-provider": "3.600.0",
|
|
13
13
|
"@aws-sdk/credential-providers": "3.600.0",
|
|
14
|
-
"@chevre/factory": "8.1.0-alpha.
|
|
14
|
+
"@chevre/factory": "8.1.0-alpha.4",
|
|
15
15
|
"@motionpicture/coa-service": "10.0.0",
|
|
16
16
|
"@motionpicture/gmo-service": "6.1.0-alpha.0",
|
|
17
17
|
"@sendgrid/client": "8.1.4",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"postversion": "git push origin --tags",
|
|
92
92
|
"prepublishOnly": "npm run clean && npm run build"
|
|
93
93
|
},
|
|
94
|
-
"version": "24.1.0-alpha.
|
|
94
|
+
"version": "24.1.0-alpha.9"
|
|
95
95
|
}
|