@chevre/domain 21.20.0-alpha.39 → 21.20.0-alpha.40

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.
@@ -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;
27
+ var _a, _b, _c, _d, _e, _f, _g, _h;
28
28
  const andConditions = [];
29
29
  // tslint:disable-next-line:no-single-line-block-comment
30
30
  /* istanbul ignore else */
@@ -177,47 +177,24 @@ class MongoRepository {
177
177
  }
178
178
  switch (params.typeOf) {
179
179
  case factory.transactionType.PlaceOrder:
180
- // tslint:disable-next-line:no-single-line-block-comment
181
- /* istanbul ignore else */
182
- if (params.seller !== undefined) {
183
- // tslint:disable-next-line:no-single-line-block-comment
184
- /* istanbul ignore else */
185
- if (Array.isArray(params.seller.ids)) {
186
- andConditions.push({
187
- 'seller.id': {
188
- $exists: true,
189
- $in: params.seller.ids
190
- }
191
- });
192
- }
180
+ const sellerIdIn = (_a = params.seller) === null || _a === void 0 ? void 0 : _a.ids;
181
+ if (Array.isArray(sellerIdIn)) {
182
+ andConditions.push({ 'seller.id': { $exists: true, $in: sellerIdIn } });
193
183
  }
194
- // tslint:disable-next-line:no-single-line-block-comment
195
- /* istanbul ignore else */
196
- if (params.result !== undefined) {
197
- // tslint:disable-next-line:no-single-line-block-comment
198
- /* istanbul ignore else */
199
- if (params.result.order !== undefined) {
200
- // tslint:disable-next-line:no-single-line-block-comment
201
- /* istanbul ignore else */
202
- if (Array.isArray(params.result.order.orderNumbers)) {
203
- andConditions.push({
204
- 'result.order.orderNumber': {
205
- $exists: true,
206
- $in: params.result.order.orderNumbers
207
- }
208
- });
209
- }
210
- }
184
+ const resultOrderNumberIn = (_c = (_b = params.result) === null || _b === void 0 ? void 0 : _b.order) === null || _c === void 0 ? void 0 : _c.orderNumbers;
185
+ if (Array.isArray(resultOrderNumberIn)) {
186
+ andConditions.push({ 'result.order.orderNumber': { $exists: true, $in: resultOrderNumberIn } });
211
187
  }
212
- const resultOrderConfirmationNumberEq = (_c = (_b = (_a = params.result) === null || _a === void 0 ? void 0 : _a.order) === null || _b === void 0 ? void 0 : _b.confirmationNumber) === null || _c === void 0 ? void 0 : _c.$eq;
188
+ const resultOrderConfirmationNumberEq = (_f = (_e = (_d = params.result) === null || _d === void 0 ? void 0 : _d.order) === null || _e === void 0 ? void 0 : _e.confirmationNumber) === null || _f === void 0 ? void 0 : _f.$eq;
213
189
  if (typeof resultOrderConfirmationNumberEq === 'string') {
214
190
  andConditions.push({
215
- 'result.order.confirmationNumber': {
216
- $exists: true,
217
- $eq: resultOrderConfirmationNumberEq
218
- }
191
+ 'result.order.confirmationNumber': { $exists: true, $eq: resultOrderConfirmationNumberEq }
219
192
  });
220
193
  }
194
+ const objectOrderNumberEq = (_h = (_g = params.object) === null || _g === void 0 ? void 0 : _g.orderNumber) === null || _h === void 0 ? void 0 : _h.$eq;
195
+ if (typeof objectOrderNumberEq === 'string') {
196
+ andConditions.push({ 'object.orderNumber': { $exists: true, $eq: objectOrderNumberEq } });
197
+ }
221
198
  break;
222
199
  case factory.transactionType.ReturnOrder:
223
200
  // tslint:disable-next-line:no-single-line-block-comment
@@ -14,8 +14,7 @@ const givePointAward_1 = require("./potentialActions/givePointAward");
14
14
  const moneyTransfer_1 = require("./potentialActions/moneyTransfer");
15
15
  const registerService_1 = require("./potentialActions/registerService");
16
16
  const sendEmailMessage_1 = require("./potentialActions/sendEmailMessage");
17
- const factory = require("../../../factory");
18
- const order_1 = require("../../../factory/order");
17
+ // import { createMaskedCustomer } from '../../../factory/order';
19
18
  /**
20
19
  * 取引のポストアクションを作成する
21
20
  */
@@ -28,21 +27,21 @@ function createPotentialActions(params) {
28
27
  const givePointAwardActions = yield (0, givePointAward_1.createGivePointAwardActions)(params);
29
28
  // 注文配送メール送信設定
30
29
  const sendEmailMessageActions = yield (0, sendEmailMessage_1.createSendEmailMessageActions)(params);
31
- const maskedCustomer = (0, order_1.createMaskedCustomer)(params.order, { noProfile: true });
32
- const simpleOrder = {
33
- typeOf: params.order.typeOf,
34
- seller: {
35
- id: params.order.seller.id,
36
- typeOf: params.order.seller.typeOf,
37
- name: params.order.seller.name
38
- },
39
- // mask
40
- customer: { typeOf: maskedCustomer.typeOf, id: maskedCustomer.id },
41
- orderNumber: params.order.orderNumber,
42
- price: params.order.price,
43
- priceCurrency: params.order.priceCurrency,
44
- orderDate: params.order.orderDate
45
- };
30
+ // const maskedCustomer = createMaskedCustomer(params.order, { noProfile: true });
31
+ // const simpleOrder: factory.order.ISimpleOrder = {
32
+ // typeOf: params.order.typeOf,
33
+ // seller: {
34
+ // id: params.order.seller.id,
35
+ // typeOf: params.order.seller.typeOf,
36
+ // name: params.order.seller.name
37
+ // },
38
+ // // mask
39
+ // customer: { typeOf: maskedCustomer.typeOf, id: maskedCustomer.id },
40
+ // orderNumber: params.order.orderNumber,
41
+ // price: params.order.price,
42
+ // priceCurrency: params.order.priceCurrency,
43
+ // orderDate: params.order.orderDate
44
+ // };
46
45
  const sendOrderActionAttributes = {
47
46
  potentialActions: {
48
47
  moneyTransfer: moneyTransferActions,
@@ -50,19 +49,26 @@ function createPotentialActions(params) {
50
49
  sendEmailMessage: sendEmailMessageActions
51
50
  }
52
51
  };
52
+ // optimize(2024-01-22~)
53
53
  return {
54
+ // order: {
55
+ // project: params.transaction.project,
56
+ // typeOf: factory.actionType.OrderAction,
57
+ // object: simpleOrder,
58
+ // agent: params.transaction.project,
59
+ // potentialActions: {
60
+ // givePointAward: givePointAwardActions,
61
+ // sendOrder: sendOrderActionAttributes // optimize(2024-01-16~)
62
+ // },
63
+ // purpose: {
64
+ // typeOf: params.transaction.typeOf,
65
+ // id: params.transaction.id
66
+ // }
67
+ // }
54
68
  order: {
55
- project: params.transaction.project,
56
- typeOf: factory.actionType.OrderAction,
57
- object: simpleOrder,
58
- agent: params.transaction.project,
59
69
  potentialActions: {
60
70
  givePointAward: givePointAwardActions,
61
71
  sendOrder: sendOrderActionAttributes // optimize(2024-01-16~)
62
- },
63
- purpose: {
64
- typeOf: params.transaction.typeOf,
65
- id: params.transaction.id
66
72
  }
67
73
  }
68
74
  };
package/package.json CHANGED
@@ -10,8 +10,8 @@
10
10
  ],
11
11
  "dependencies": {
12
12
  "@aws-sdk/credential-providers": "3.433.0",
13
- "@chevre/factory": "4.352.0-alpha.2",
14
- "@cinerino/sdk": "5.9.0-alpha.0",
13
+ "@chevre/factory": "4.352.0-alpha.3",
14
+ "@cinerino/sdk": "5.9.0-alpha.1",
15
15
  "@motionpicture/coa-service": "9.2.0",
16
16
  "@motionpicture/gmo-service": "5.3.0-alpha.0",
17
17
  "@sendgrid/mail": "6.4.0",
@@ -112,5 +112,5 @@
112
112
  "postversion": "git push origin --tags",
113
113
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
114
114
  },
115
- "version": "21.20.0-alpha.39"
115
+ "version": "21.20.0-alpha.40"
116
116
  }