@chevre/domain 21.4.0-alpha.27 → 21.4.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.
@@ -48,7 +48,7 @@ export declare class MongoRepository {
48
48
  $eq: string;
49
49
  };
50
50
  typeOf: {
51
- $eq: factory.organizationType.Project;
51
+ $eq: factory.organizationType.Corporation | factory.organizationType.Project;
52
52
  };
53
53
  };
54
54
  };
@@ -142,7 +142,7 @@ export declare class MongoRepository {
142
142
  member: {
143
143
  id: string;
144
144
  memberOf: {
145
- typeOf: factory.organizationType.Project | factory.organizationType.Corporation;
145
+ typeOf: factory.organizationType.Corporation | factory.organizationType.Project;
146
146
  };
147
147
  };
148
148
  project: {
@@ -25,13 +25,25 @@
25
25
  import { Connection } from 'mongoose';
26
26
  import * as factory from '../factory';
27
27
  export type ISeller = factory.seller.ISeller;
28
+ export interface IMemberSearchConditions {
29
+ /**
30
+ * 販売者メンバーで絞る場合
31
+ */
32
+ member?: {
33
+ memberOf?: {
34
+ id?: {
35
+ $in?: string[];
36
+ };
37
+ };
38
+ };
39
+ }
28
40
  /**
29
41
  * 販売者リポジトリ
30
42
  */
31
43
  export declare class MongoRepository {
32
44
  private readonly organizationModel;
33
45
  constructor(connection: Connection);
34
- static CREATE_MONGO_CONDITIONS(params: factory.seller.ISearchConditions): any[];
46
+ static CREATE_MONGO_CONDITIONS(params: factory.seller.ISearchConditions & IMemberSearchConditions): any[];
35
47
  /**
36
48
  * 特定販売者検索
37
49
  * searchに置き換え(2023-07-13~)
@@ -46,7 +58,7 @@ export declare class MongoRepository {
46
58
  /**
47
59
  * 販売者検索
48
60
  */
49
- search(conditions: factory.seller.ISearchConditions, inclusion: string[], exclusion: string[]): Promise<ISeller[]>;
61
+ search(conditions: factory.seller.ISearchConditions & IMemberSearchConditions, inclusion: string[], exclusion: string[]): Promise<ISeller[]>;
50
62
  /**
51
63
  * 対応決済方法を検索する
52
64
  */
@@ -34,7 +34,7 @@ class MongoRepository {
34
34
  }
35
35
  // tslint:disable-next-line:max-func-body-length
36
36
  static CREATE_MONGO_CONDITIONS(params) {
37
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
37
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
38
38
  // MongoDB検索条件
39
39
  const andConditions = [];
40
40
  const projectIdEq = (_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
@@ -45,6 +45,11 @@ class MongoRepository {
45
45
  if (typeof idEq === 'string') {
46
46
  andConditions.push({ _id: { $eq: idEq } });
47
47
  }
48
+ // メンバー条件追加(2023-07-24~)
49
+ const memberMemberOfIdIn = (_f = (_e = (_d = params.member) === null || _d === void 0 ? void 0 : _d.memberOf) === null || _e === void 0 ? void 0 : _e.id) === null || _f === void 0 ? void 0 : _f.$in;
50
+ if (Array.isArray(memberMemberOfIdIn)) {
51
+ andConditions.push({ _id: { $in: memberMemberOfIdIn } });
52
+ }
48
53
  const nameRegex = params.name;
49
54
  if (typeof nameRegex === 'string' && nameRegex.length > 0) {
50
55
  andConditions.push({
@@ -64,7 +69,7 @@ class MongoRepository {
64
69
  ]
65
70
  });
66
71
  }
67
- const branchCodeEq = (_d = params.branchCode) === null || _d === void 0 ? void 0 : _d.$eq;
72
+ const branchCodeEq = (_g = params.branchCode) === null || _g === void 0 ? void 0 : _g.$eq;
68
73
  if (typeof branchCodeEq === 'string') {
69
74
  andConditions.push({
70
75
  branchCode: {
@@ -72,7 +77,7 @@ class MongoRepository {
72
77
  }
73
78
  });
74
79
  }
75
- const branchCodeRegex = (_e = params.branchCode) === null || _e === void 0 ? void 0 : _e.$regex;
80
+ const branchCodeRegex = (_h = params.branchCode) === null || _h === void 0 ? void 0 : _h.$regex;
76
81
  if (typeof branchCodeRegex === 'string' && branchCodeRegex.length > 0) {
77
82
  andConditions.push({
78
83
  branchCode: {
@@ -80,7 +85,7 @@ class MongoRepository {
80
85
  }
81
86
  });
82
87
  }
83
- const additionalPropertyAll = (_f = params.additionalProperty) === null || _f === void 0 ? void 0 : _f.$all;
88
+ const additionalPropertyAll = (_j = params.additionalProperty) === null || _j === void 0 ? void 0 : _j.$all;
84
89
  if (Array.isArray(additionalPropertyAll)) {
85
90
  andConditions.push({
86
91
  additionalProperty: {
@@ -89,7 +94,7 @@ class MongoRepository {
89
94
  }
90
95
  });
91
96
  }
92
- const additionalPropertyIn = (_g = params.additionalProperty) === null || _g === void 0 ? void 0 : _g.$in;
97
+ const additionalPropertyIn = (_k = params.additionalProperty) === null || _k === void 0 ? void 0 : _k.$in;
93
98
  if (Array.isArray(additionalPropertyIn)) {
94
99
  andConditions.push({
95
100
  additionalProperty: {
@@ -98,7 +103,7 @@ class MongoRepository {
98
103
  }
99
104
  });
100
105
  }
101
- const additionalPropertyNin = (_h = params.additionalProperty) === null || _h === void 0 ? void 0 : _h.$nin;
106
+ const additionalPropertyNin = (_l = params.additionalProperty) === null || _l === void 0 ? void 0 : _l.$nin;
102
107
  if (Array.isArray(additionalPropertyNin)) {
103
108
  andConditions.push({
104
109
  additionalProperty: {
@@ -106,7 +111,7 @@ class MongoRepository {
106
111
  }
107
112
  });
108
113
  }
109
- const additionalPropertyElemMatch = (_j = params.additionalProperty) === null || _j === void 0 ? void 0 : _j.$elemMatch;
114
+ const additionalPropertyElemMatch = (_m = params.additionalProperty) === null || _m === void 0 ? void 0 : _m.$elemMatch;
110
115
  if (additionalPropertyElemMatch !== undefined && additionalPropertyElemMatch !== null) {
111
116
  andConditions.push({
112
117
  additionalProperty: {
@@ -115,7 +120,7 @@ class MongoRepository {
115
120
  }
116
121
  });
117
122
  }
118
- const hasMerchantReturnPolicyItemConditionIdEq = (_m = (_l = (_k = params.hasMerchantReturnPolicy) === null || _k === void 0 ? void 0 : _k.itemCondition) === null || _l === void 0 ? void 0 : _l.id) === null || _m === void 0 ? void 0 : _m.$eq;
123
+ const hasMerchantReturnPolicyItemConditionIdEq = (_q = (_p = (_o = params.hasMerchantReturnPolicy) === null || _o === void 0 ? void 0 : _o.itemCondition) === null || _p === void 0 ? void 0 : _p.id) === null || _q === void 0 ? void 0 : _q.$eq;
119
124
  if (typeof hasMerchantReturnPolicyItemConditionIdEq === 'string') {
120
125
  andConditions.push({
121
126
  'hasMerchantReturnPolicy.itemCondition.id': {
@@ -16,7 +16,7 @@ export declare function searchPermissions(params: {
16
16
  id: string;
17
17
  memberOf: {
18
18
  id: string;
19
- typeOf: factory.organizationType.Project;
19
+ typeOf: factory.organizationType.Corporation | factory.organizationType.Project;
20
20
  };
21
21
  };
22
22
  }): (repos: {
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  }
10
10
  ],
11
11
  "dependencies": {
12
- "@chevre/factory": "4.316.0-alpha.5",
12
+ "@chevre/factory": "4.316.0-alpha.6",
13
13
  "@cinerino/sdk": "3.162.0-alpha.1",
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.27"
120
+ "version": "21.4.0-alpha.29"
121
121
  }