@chevre/domain 20.1.0-alpha.5 → 20.1.0-alpha.6

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.
@@ -89,6 +89,24 @@ schema.index({ 'parentOrganization.id': 1, branchCode: 1 }, {
89
89
  'parentOrganization.id': { $exists: true }
90
90
  }
91
91
  });
92
+ schema.index({ 'containsPlace.branchCode': 1, branchCode: 1 }, {
93
+ name: 'searchByContainsPlaceBranchCode',
94
+ partialFilterExpression: {
95
+ 'containsPlace.branchCode': { $exists: true }
96
+ }
97
+ });
98
+ schema.index({ 'containsPlace.containsPlace.branchCode': 1, branchCode: 1 }, {
99
+ name: 'searchByContainsPlaceContainsPlaceBranchCode',
100
+ partialFilterExpression: {
101
+ 'containsPlace.containsPlace.branchCode': { $exists: true }
102
+ }
103
+ });
104
+ schema.index({ 'containsPlace.containsPlace.containsPlace.branchCode': 1, branchCode: 1 }, {
105
+ name: 'searchByContainsPlaceContainsPlaceContainsPlaceBranchCode',
106
+ partialFilterExpression: {
107
+ 'containsPlace.containsPlace.containsPlace.branchCode': { $exists: true }
108
+ }
109
+ });
92
110
  mongoose.model(modelName, schema)
93
111
  .on('index',
94
112
  // tslint:disable-next-line:no-single-line-block-comment
@@ -63,7 +63,8 @@ function createAcquiredFrom(params) {
63
63
  // 最低限の情報に絞る
64
64
  const seller = params.order.seller;
65
65
  return {
66
- project: { typeOf: params.order.project.typeOf, id: params.order.project.id },
66
+ // 最適化(2022-11-15~)
67
+ // project: { typeOf: params.order.project.typeOf, id: params.order.project.id },
67
68
  id: seller.id,
68
69
  typeOf: seller.typeOf,
69
70
  name: (typeof seller.name === 'string')
@@ -42,7 +42,8 @@ function getOrderWithToken(params) {
42
42
  };
43
43
  const seller4orderToken = {
44
44
  id: params.order.seller.id,
45
- project: params.order.seller.project,
45
+ // 最適化(2022-11-15~)
46
+ // project: params.order.seller.project,
46
47
  typeOf: params.order.seller.typeOf
47
48
  };
48
49
  const order4token = {
@@ -120,9 +120,6 @@ function createStartPlaceOrderInProgressParams(params) {
120
120
  id: customer.id,
121
121
  identifier: customer.identifier,
122
122
  memberOf: customer.memberOf
123
- // ↓不要なので廃止(2022-05-26~)
124
- // paramsにadditionalPropertyの指定があれば反映する
125
- // ...(Array.isArray(params.agent.additionalProperty)) ? { additionalProperty: params.agent.additionalProperty } : []
126
123
  };
127
124
  return {
128
125
  project: { typeOf: factory.organizationType.Project, id: params.project.id },
@@ -34,13 +34,11 @@ function createSeller(params) {
34
34
  var _a;
35
35
  const seller = params.transaction.seller;
36
36
  return {
37
- project: { typeOf: params.transaction.project.typeOf, id: params.transaction.project.id },
37
+ // 最適化(2022-11-15~)
38
+ // project: { typeOf: params.transaction.project.typeOf, id: params.transaction.project.id },
38
39
  id: seller.id,
39
40
  name: (typeof seller.name === 'string') ? seller.name : String((_a = seller.name) === null || _a === void 0 ? void 0 : _a.ja),
40
41
  typeOf: seller.typeOf
41
- // ↓最適化(2022-05-20~)
42
- // ...(typeof seller.telephone === 'string') ? { telephone: seller.telephone } : undefined,
43
- // ...(typeof seller.url === 'string') ? { url: seller.url } : undefined
44
42
  };
45
43
  }
46
44
  function createCustomer(params) {
@@ -53,26 +53,13 @@ function updateAgent(params) {
53
53
  const newAgent = {
54
54
  typeOf: transaction.agent.typeOf,
55
55
  id: transaction.agent.id
56
- // 不要なので廃止(2022-05-26~)
57
- // ...(Array.isArray(params.agent.additionalProperty)) ? { additionalProperty: params.agent.additionalProperty } : {},
58
- // ...(typeof params.agent.age === 'string') ? { age: params.agent.age } : {},
59
- // ...(typeof params.agent.address === 'string') ? { address: params.agent.address } : {},
60
- // ...(typeof params.agent.email === 'string') ? { email: params.agent.email } : {},
61
- // ...(typeof params.agent.familyName === 'string') ? { familyName: params.agent.familyName } : {},
62
- // ...(typeof params.agent.gender === 'string') ? { gender: params.agent.gender } : {},
63
- // ...(typeof params.agent.givenName === 'string') ? { givenName: params.agent.givenName } : {},
64
- // ...(typeof params.agent.name === 'string') ? { name: params.agent.name } : {},
65
- // ...(typeof formattedTelephone === 'string') ? { telephone: formattedTelephone } : {},
66
- // ...(typeof params.agent.url === 'string') ? { url: params.agent.url } : {}
67
56
  };
68
57
  // 注文取引の場合、object.customerにも適用
69
58
  let customer;
70
59
  if (transaction.typeOf === factory.transactionType.PlaceOrder) {
71
60
  // いったんtransaction.object.customer?.typeOfは取引開始時にセットされている前提
72
61
  if (typeof ((_a = transaction.object.customer) === null || _a === void 0 ? void 0 : _a.typeOf) === 'string') {
73
- customer = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ typeOf: transaction.object.customer.typeOf, id: transaction.object.customer.id }, (transaction.object.customer.typeOf === factory.organizationType.Organization)
74
- ? { project: transaction.object.customer.project }
75
- : undefined), (Array.isArray(transaction.object.customer.identifier))
62
+ customer = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ typeOf: transaction.object.customer.typeOf, id: transaction.object.customer.id }, (Array.isArray(transaction.object.customer.identifier))
76
63
  ? { identifier: transaction.object.customer.identifier }
77
64
  : undefined), (transaction.object.customer.typeOf === factory.personType.Person
78
65
  && typeof ((_b = transaction.object.customer.memberOf) === null || _b === void 0 ? void 0 : _b.typeOf) === 'string')
package/package.json CHANGED
@@ -9,8 +9,8 @@
9
9
  }
10
10
  ],
11
11
  "dependencies": {
12
- "@chevre/factory": "4.277.0-alpha.1",
13
- "@cinerino/sdk": "3.132.0",
12
+ "@chevre/factory": "4.277.0",
13
+ "@cinerino/sdk": "3.132.1",
14
14
  "@motionpicture/coa-service": "9.2.0",
15
15
  "@motionpicture/gmo-service": "5.2.0",
16
16
  "@sendgrid/mail": "6.4.0",
@@ -120,5 +120,5 @@
120
120
  "postversion": "git push origin --tags",
121
121
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
122
122
  },
123
- "version": "20.1.0-alpha.5"
123
+ "version": "20.1.0-alpha.6"
124
124
  }