@chevre/domain 21.28.0 → 21.29.0-alpha.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.
|
@@ -32,7 +32,7 @@ const schemaDefinition = {
|
|
|
32
32
|
isGift: Boolean,
|
|
33
33
|
dateReturned: Date,
|
|
34
34
|
orderedItem: [mongoose_1.SchemaTypes.Mixed],
|
|
35
|
-
additionalProperty:
|
|
35
|
+
additionalProperty: mongoose_1.SchemaTypes.Mixed // 追加(2023-02-13~) // 廃止(2024-04-12~)
|
|
36
36
|
};
|
|
37
37
|
const schemaOptions = {
|
|
38
38
|
autoIndex: settings_1.MONGO_AUTO_INDEX,
|
|
@@ -69,12 +69,10 @@ export declare class MongoRepository {
|
|
|
69
69
|
/**
|
|
70
70
|
* 変更可能な属性を更新する
|
|
71
71
|
*/
|
|
72
|
-
updateChangeableAttributes(params: {
|
|
72
|
+
updateChangeableAttributes(params: Pick<factory.order.IOrder, 'name'> & {
|
|
73
73
|
project: {
|
|
74
74
|
id: string;
|
|
75
75
|
};
|
|
76
|
-
additionalProperty?: factory.propertyValue.IPropertyValue<string>[];
|
|
77
|
-
name?: string;
|
|
78
76
|
orderNumber: string;
|
|
79
77
|
}): Promise<{
|
|
80
78
|
updatedAt: Date;
|
|
@@ -144,7 +142,7 @@ export declare class MongoRepository {
|
|
|
144
142
|
})[]>;
|
|
145
143
|
getCursor(conditions: any, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;
|
|
146
144
|
unsetUnnecessaryFields(params: {
|
|
147
|
-
filter: FilterQuery<
|
|
145
|
+
filter: FilterQuery<factory.order.IOrder>;
|
|
148
146
|
$unset: any;
|
|
149
147
|
}): Promise<import("mongodb").UpdateResult>;
|
|
150
148
|
}
|
package/lib/chevre/repo/order.js
CHANGED
|
@@ -23,7 +23,7 @@ class MongoRepository {
|
|
|
23
23
|
}
|
|
24
24
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
25
25
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
26
|
-
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
|
|
26
|
+
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;
|
|
27
27
|
const andConditions = [
|
|
28
28
|
{ typeOf: { $eq: factory.order.OrderType.Order } }
|
|
29
29
|
];
|
|
@@ -31,22 +31,22 @@ class MongoRepository {
|
|
|
31
31
|
if (typeof projectIdEq === 'string') {
|
|
32
32
|
andConditions.push({ 'project.id': { $eq: projectIdEq } });
|
|
33
33
|
}
|
|
34
|
-
const additionalPropertyAll =
|
|
35
|
-
if (Array.isArray(additionalPropertyAll)) {
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
const additionalPropertyIn =
|
|
39
|
-
if (Array.isArray(additionalPropertyIn)) {
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
const additionalPropertyNin =
|
|
43
|
-
if (Array.isArray(additionalPropertyNin)) {
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
const additionalPropertyElemMatch =
|
|
47
|
-
if (additionalPropertyElemMatch !== undefined && additionalPropertyElemMatch !== null) {
|
|
48
|
-
|
|
49
|
-
}
|
|
34
|
+
// const additionalPropertyAll = params.additionalProperty?.$all; // 廃止(2024-04-12~)
|
|
35
|
+
// if (Array.isArray(additionalPropertyAll)) {
|
|
36
|
+
// andConditions.push({ additionalProperty: { $exists: true, $all: additionalPropertyAll } });
|
|
37
|
+
// }
|
|
38
|
+
// const additionalPropertyIn = params.additionalProperty?.$in; // 廃止(2024-04-12~)
|
|
39
|
+
// if (Array.isArray(additionalPropertyIn)) {
|
|
40
|
+
// andConditions.push({ additionalProperty: { $exists: true, $in: additionalPropertyIn } });
|
|
41
|
+
// }
|
|
42
|
+
// const additionalPropertyNin = params.additionalProperty?.$nin; // 廃止(2024-04-12~)
|
|
43
|
+
// if (Array.isArray(additionalPropertyNin)) {
|
|
44
|
+
// andConditions.push({ additionalProperty: { $nin: additionalPropertyNin } });
|
|
45
|
+
// }
|
|
46
|
+
// const additionalPropertyElemMatch = params.additionalProperty?.$elemMatch; // 廃止(2024-04-12~)
|
|
47
|
+
// if (additionalPropertyElemMatch !== undefined && additionalPropertyElemMatch !== null) {
|
|
48
|
+
// andConditions.push({ additionalProperty: { $exists: true, $elemMatch: additionalPropertyElemMatch } });
|
|
49
|
+
// }
|
|
50
50
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
51
51
|
/* istanbul ignore else */
|
|
52
52
|
if (params.identifier !== undefined) {
|
|
@@ -71,15 +71,15 @@ class MongoRepository {
|
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
const providerIdEq = (
|
|
74
|
+
const providerIdEq = (_d = (_c = params.provider) === null || _c === void 0 ? void 0 : _c.id) === null || _d === void 0 ? void 0 : _d.$eq;
|
|
75
75
|
if (typeof providerIdEq === 'string') {
|
|
76
76
|
andConditions.push({ 'seller.id': { $exists: true, $eq: providerIdEq } });
|
|
77
77
|
}
|
|
78
|
-
const sellerIdEq = (
|
|
78
|
+
const sellerIdEq = (_f = (_e = params.seller) === null || _e === void 0 ? void 0 : _e.id) === null || _f === void 0 ? void 0 : _f.$eq;
|
|
79
79
|
if (typeof sellerIdEq === 'string') {
|
|
80
80
|
andConditions.push({ 'seller.id': { $exists: true, $eq: sellerIdEq } });
|
|
81
81
|
}
|
|
82
|
-
const sellerIds = (
|
|
82
|
+
const sellerIds = (_g = params.seller) === null || _g === void 0 ? void 0 : _g.ids;
|
|
83
83
|
if (Array.isArray(sellerIds)) {
|
|
84
84
|
andConditions.push({ 'seller.id': { $exists: true, $in: sellerIds } });
|
|
85
85
|
}
|
|
@@ -87,7 +87,7 @@ class MongoRepository {
|
|
|
87
87
|
// if (typeof params.seller?.typeOf === 'string') {
|
|
88
88
|
// andConditions.push({ 'seller.typeOf': { $exists: true, $eq: params.seller.typeOf } });
|
|
89
89
|
// }
|
|
90
|
-
const brokerIdEq = (
|
|
90
|
+
const brokerIdEq = (_j = (_h = params.broker) === null || _h === void 0 ? void 0 : _h.id) === null || _j === void 0 ? void 0 : _j.$eq;
|
|
91
91
|
if (typeof brokerIdEq === 'string') {
|
|
92
92
|
andConditions.push({
|
|
93
93
|
'broker.id': {
|
|
@@ -304,7 +304,7 @@ class MongoRepository {
|
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
|
-
const nameEq = (
|
|
307
|
+
const nameEq = (_k = params.name) === null || _k === void 0 ? void 0 : _k.$eq;
|
|
308
308
|
if (typeof nameEq === 'string') {
|
|
309
309
|
andConditions.push({
|
|
310
310
|
name: {
|
|
@@ -313,7 +313,7 @@ class MongoRepository {
|
|
|
313
313
|
}
|
|
314
314
|
});
|
|
315
315
|
}
|
|
316
|
-
const nameRegex = (
|
|
316
|
+
const nameRegex = (_l = params.name) === null || _l === void 0 ? void 0 : _l.$regex;
|
|
317
317
|
if (typeof nameRegex === 'string' && nameRegex.length > 0) {
|
|
318
318
|
andConditions.push({
|
|
319
319
|
name: {
|
|
@@ -346,19 +346,19 @@ class MongoRepository {
|
|
|
346
346
|
}
|
|
347
347
|
});
|
|
348
348
|
}
|
|
349
|
-
const orderedItemSize = (
|
|
349
|
+
const orderedItemSize = (_m = params.orderedItem) === null || _m === void 0 ? void 0 : _m.$size;
|
|
350
350
|
if (typeof orderedItemSize === 'number') {
|
|
351
351
|
andConditions.push({ orderedItem: { $size: orderedItemSize } });
|
|
352
352
|
}
|
|
353
|
-
const acceptedOffersSize = (
|
|
353
|
+
const acceptedOffersSize = (_o = params.acceptedOffers) === null || _o === void 0 ? void 0 : _o.$size;
|
|
354
354
|
if (typeof acceptedOffersSize === 'number') {
|
|
355
355
|
andConditions.push({ acceptedOffers: { $size: acceptedOffersSize } });
|
|
356
356
|
}
|
|
357
|
-
const serialNumberEq = (
|
|
357
|
+
const serialNumberEq = (_q = (_p = params.acceptedOffers) === null || _p === void 0 ? void 0 : _p.serialNumber) === null || _q === void 0 ? void 0 : _q.$eq;
|
|
358
358
|
if (typeof serialNumberEq === 'string') {
|
|
359
359
|
andConditions.push({ 'acceptedOffers.serialNumber': { $exists: true, $eq: serialNumberEq } });
|
|
360
360
|
}
|
|
361
|
-
const itemOfferedIdentifierIn = (
|
|
361
|
+
const itemOfferedIdentifierIn = (_t = (_s = (_r = params.acceptedOffers) === null || _r === void 0 ? void 0 : _r.itemOffered) === null || _s === void 0 ? void 0 : _s.identifier) === null || _t === void 0 ? void 0 : _t.$in;
|
|
362
362
|
if (Array.isArray(itemOfferedIdentifierIn)) {
|
|
363
363
|
andConditions.push({
|
|
364
364
|
'acceptedOffers.itemOffered.identifier': {
|
|
@@ -367,7 +367,7 @@ class MongoRepository {
|
|
|
367
367
|
}
|
|
368
368
|
});
|
|
369
369
|
}
|
|
370
|
-
const itemOfferedTypeOfIn = (
|
|
370
|
+
const itemOfferedTypeOfIn = (_w = (_v = (_u = params.acceptedOffers) === null || _u === void 0 ? void 0 : _u.itemOffered) === null || _v === void 0 ? void 0 : _v.typeOf) === null || _w === void 0 ? void 0 : _w.$in;
|
|
371
371
|
if (Array.isArray(itemOfferedTypeOfIn)) {
|
|
372
372
|
andConditions.push({
|
|
373
373
|
'acceptedOffers.itemOffered.typeOf': {
|
|
@@ -376,7 +376,7 @@ class MongoRepository {
|
|
|
376
376
|
}
|
|
377
377
|
});
|
|
378
378
|
}
|
|
379
|
-
const itemOfferedIssuedThroughTypeOfEq = (
|
|
379
|
+
const itemOfferedIssuedThroughTypeOfEq = (_0 = (_z = (_y = (_x = params.acceptedOffers) === null || _x === void 0 ? void 0 : _x.itemOffered) === null || _y === void 0 ? void 0 : _y.issuedThrough) === null || _z === void 0 ? void 0 : _z.typeOf) === null || _0 === void 0 ? void 0 : _0.$eq;
|
|
380
380
|
if (typeof itemOfferedIssuedThroughTypeOfEq === 'string') {
|
|
381
381
|
andConditions.push({
|
|
382
382
|
'acceptedOffers.itemOffered.issuedThrough.typeOf': {
|
|
@@ -385,7 +385,7 @@ class MongoRepository {
|
|
|
385
385
|
}
|
|
386
386
|
});
|
|
387
387
|
}
|
|
388
|
-
const itemOfferedIssuedThroughIdIn = (
|
|
388
|
+
const itemOfferedIssuedThroughIdIn = (_4 = (_3 = (_2 = (_1 = params.acceptedOffers) === null || _1 === void 0 ? void 0 : _1.itemOffered) === null || _2 === void 0 ? void 0 : _2.issuedThrough) === null || _3 === void 0 ? void 0 : _3.id) === null || _4 === void 0 ? void 0 : _4.$in;
|
|
389
389
|
if (Array.isArray(itemOfferedIssuedThroughIdIn)) {
|
|
390
390
|
andConditions.push({
|
|
391
391
|
'acceptedOffers.itemOffered.issuedThrough.id': {
|
|
@@ -394,7 +394,7 @@ class MongoRepository {
|
|
|
394
394
|
}
|
|
395
395
|
});
|
|
396
396
|
}
|
|
397
|
-
const itemOfferedProgramMembershipUsedIdentifierEq = (
|
|
397
|
+
const itemOfferedProgramMembershipUsedIdentifierEq = (_8 = (_7 = (_6 = (_5 = params.acceptedOffers) === null || _5 === void 0 ? void 0 : _5.itemOffered) === null || _6 === void 0 ? void 0 : _6.programMembershipUsed) === null || _7 === void 0 ? void 0 : _7.identifier) === null || _8 === void 0 ? void 0 : _8.$eq;
|
|
398
398
|
if (typeof itemOfferedProgramMembershipUsedIdentifierEq === 'string') {
|
|
399
399
|
andConditions.push({
|
|
400
400
|
'acceptedOffers.itemOffered.programMembershipUsed.identifier': {
|
|
@@ -403,7 +403,7 @@ class MongoRepository {
|
|
|
403
403
|
}
|
|
404
404
|
});
|
|
405
405
|
}
|
|
406
|
-
const itemOfferedProgramMembershipUsedIssuedThroughServiceTypeCodeValueEq = (
|
|
406
|
+
const itemOfferedProgramMembershipUsedIssuedThroughServiceTypeCodeValueEq = (_14 = (_13 = (_12 = (_11 = (_10 = (_9 = params.acceptedOffers) === null || _9 === void 0 ? void 0 : _9.itemOffered) === null || _10 === void 0 ? void 0 : _10.programMembershipUsed) === null || _11 === void 0 ? void 0 : _11.issuedThrough) === null || _12 === void 0 ? void 0 : _12.serviceType) === null || _13 === void 0 ? void 0 : _13.codeValue) === null || _14 === void 0 ? void 0 : _14.$eq;
|
|
407
407
|
if (typeof itemOfferedProgramMembershipUsedIssuedThroughServiceTypeCodeValueEq === 'string') {
|
|
408
408
|
andConditions.push({
|
|
409
409
|
'acceptedOffers.itemOffered.programMembershipUsed.issuedThrough.serviceType.codeValue': {
|
|
@@ -565,11 +565,11 @@ class MongoRepository {
|
|
|
565
565
|
}
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
|
-
const paymentMethodIdentifierIn = (
|
|
568
|
+
const paymentMethodIdentifierIn = (_17 = (_16 = (_15 = params.paymentMethods) === null || _15 === void 0 ? void 0 : _15.paymentMethod) === null || _16 === void 0 ? void 0 : _16.identifier) === null || _17 === void 0 ? void 0 : _17.$in;
|
|
569
569
|
if (Array.isArray(paymentMethodIdentifierIn)) {
|
|
570
570
|
andConditions.push({ 'paymentMethods.paymentMethod.identifier': { $exists: true, $in: paymentMethodIdentifierIn } });
|
|
571
571
|
}
|
|
572
|
-
const paymentMethodsTypeOfIn = (
|
|
572
|
+
const paymentMethodsTypeOfIn = (_18 = params.paymentMethods) === null || _18 === void 0 ? void 0 : _18.typeOfs;
|
|
573
573
|
if (Array.isArray(paymentMethodsTypeOfIn)) {
|
|
574
574
|
// paymentMethod.identifierで検索(2023-11-15~)
|
|
575
575
|
// andConditions.push({ 'paymentMethods.typeOf': { $exists: true, $in: paymentMethodsTypeOfIn } });
|
|
@@ -599,7 +599,7 @@ class MongoRepository {
|
|
|
599
599
|
});
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
|
-
const paymentMethodAdditionalPropertyAll = (
|
|
602
|
+
const paymentMethodAdditionalPropertyAll = (_20 = (_19 = params.paymentMethods) === null || _19 === void 0 ? void 0 : _19.additionalProperty) === null || _20 === void 0 ? void 0 : _20.$all;
|
|
603
603
|
if (Array.isArray(paymentMethodAdditionalPropertyAll)) {
|
|
604
604
|
andConditions.push({
|
|
605
605
|
'paymentMethods.additionalProperty': {
|
|
@@ -608,7 +608,7 @@ class MongoRepository {
|
|
|
608
608
|
}
|
|
609
609
|
});
|
|
610
610
|
}
|
|
611
|
-
const paymentMethodAdditionalPropertyIn = (
|
|
611
|
+
const paymentMethodAdditionalPropertyIn = (_22 = (_21 = params.paymentMethods) === null || _21 === void 0 ? void 0 : _21.additionalProperty) === null || _22 === void 0 ? void 0 : _22.$in;
|
|
612
612
|
if (Array.isArray(paymentMethodAdditionalPropertyIn)) {
|
|
613
613
|
andConditions.push({
|
|
614
614
|
'paymentMethods.additionalProperty': {
|
|
@@ -802,7 +802,7 @@ class MongoRepository {
|
|
|
802
802
|
'project.id': { $eq: params.project.id },
|
|
803
803
|
typeOf: { $eq: factory.order.OrderType.Order }
|
|
804
804
|
}, {
|
|
805
|
-
$set: Object.assign(
|
|
805
|
+
$set: Object.assign({}, (typeof params.name === 'string') ? { name: params.name } : undefined)
|
|
806
806
|
}, {
|
|
807
807
|
new: true,
|
|
808
808
|
projection: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as factory from '../../../factory';
|
|
2
|
-
export type IUpdatedOrder4inform = Pick<factory.order.IOrder, 'typeOf' | 'orderNumber' | 'name' | '
|
|
2
|
+
export type IUpdatedOrder4inform = Pick<factory.order.IOrder, 'typeOf' | 'orderNumber' | 'name' | 'project'> & {
|
|
3
3
|
updatedAt: Date;
|
|
4
4
|
};
|
|
5
5
|
declare function createInformTasks(order: IUpdatedOrder4inform): factory.task.IAttributes<factory.taskName.TriggerWebhook>[];
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/credential-providers": "3.433.0",
|
|
13
|
-
"@chevre/factory": "4.
|
|
13
|
+
"@chevre/factory": "4.367.0-alpha.1",
|
|
14
14
|
"@cinerino/sdk": "5.17.1",
|
|
15
15
|
"@motionpicture/coa-service": "9.4.0",
|
|
16
16
|
"@motionpicture/gmo-service": "5.3.0",
|
|
@@ -110,5 +110,5 @@
|
|
|
110
110
|
"postversion": "git push origin --tags",
|
|
111
111
|
"prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
|
|
112
112
|
},
|
|
113
|
-
"version": "21.
|
|
113
|
+
"version": "21.29.0-alpha.0"
|
|
114
114
|
}
|