@chevre/domain 22.8.0-alpha.21 → 22.8.0-alpha.22

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.
@@ -16,6 +16,11 @@ const onOrderStatusChanged_1 = require("./onOrderStatusChanged");
16
16
  const factory = require("../../factory");
17
17
  // import { Settings } from '../../settings';
18
18
  const debug = createDebug('chevre-domain:service:order');
19
+ function createReturnPolicy(params) {
20
+ const { identifier, returnFees, restockingFee, typeOf } = params.returnOrderTransaction.object.returnPolicy;
21
+ return Object.assign(Object.assign({ returnFees,
22
+ typeOf }, (typeof identifier === 'string') ? { identifier } : undefined), (typeof (restockingFee === null || restockingFee === void 0 ? void 0 : restockingFee.value) === 'number') ? { restockingFee } : undefined);
23
+ }
19
24
  function returnOrder(params) {
20
25
  // tslint:disable-next-line:max-func-body-length
21
26
  return (repos
@@ -54,7 +59,7 @@ function returnOrder(params) {
54
59
  typeOf: factory.transactionType.ReturnOrder,
55
60
  statuses: [factory.transactionStatusType.Confirmed],
56
61
  object: { order: { orderNumbers: [orderNumber] } },
57
- inclusion: ['typeOf', 'potentialActions']
62
+ inclusion: ['typeOf', 'potentialActions', 'object']
58
63
  });
59
64
  const returnOrderTransaction = returnOrderTransactions.shift();
60
65
  if (returnOrderTransaction === undefined) {
@@ -62,23 +67,22 @@ function returnOrder(params) {
62
67
  }
63
68
  const simpleOrder = {
64
69
  typeOf: order.typeOf,
65
- // seller: {
66
- // id: order.seller.id,
67
- // typeOf: order.seller.typeOf,
68
- // name: order.seller.name
69
- // }, // 廃止(2024-03-06~)
70
- // customer: createMaskedCustomer(order, { noProfile: true }), // 廃止(2024-03-06~)
71
70
  orderNumber: order.orderNumber,
72
- // price: order.price,
73
- // priceCurrency: order.priceCurrency,
74
71
  orderDate: order.orderDate,
75
72
  dateReturned
76
73
  };
74
+ const recipient = {
75
+ id: order.seller.id,
76
+ name: order.seller.name,
77
+ typeOf: order.seller.typeOf
78
+ };
79
+ const returnPolicyAsInstrument = createReturnPolicy({ returnOrderTransaction });
77
80
  const returnOrderActionAttributes = {
78
81
  agent: returner,
82
+ instrument: [returnPolicyAsInstrument], // add returnPolicy(2025-01-21~)
79
83
  object: simpleOrder,
80
84
  project: order.project,
81
- recipient: order.seller,
85
+ recipient,
82
86
  typeOf: factory.actionType.ReturnAction
83
87
  };
84
88
  let returnedOwnershipInfos = [];
package/package.json CHANGED
@@ -11,8 +11,8 @@
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": "4.392.0-alpha.14",
15
- "@cinerino/sdk": "10.20.0-alpha.9",
14
+ "@chevre/factory": "4.392.0-alpha.15",
15
+ "@cinerino/sdk": "10.20.0-alpha.10",
16
16
  "@motionpicture/coa-service": "9.6.0",
17
17
  "@motionpicture/gmo-service": "5.3.0",
18
18
  "@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": "22.8.0-alpha.21"
115
+ "version": "22.8.0-alpha.22"
116
116
  }