@chevre/domain 21.12.0 → 21.13.0-alpha.1

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.
Files changed (219) hide show
  1. package/example/src/chevre/searchEvents.ts +1 -1
  2. package/example/src/chevre/searchOrders.ts +1 -1
  3. package/example/src/chevre/transaction/processReturnOrder.ts +8 -8
  4. package/example/src/chevre/transaction/startExportTasks.ts +1 -1
  5. package/example/src/chevre/unsetContainsInPlaceFromMovieTheater.ts +1 -1
  6. package/example/src/chevre/unsetUnnecessaryFields.ts +1 -1
  7. package/example/src/chevre/updateOfferCatalogs.ts +1 -1
  8. package/example/src/chevre/updateTransaction.ts +1 -1
  9. package/lib/chevre/index.d.ts +1 -2
  10. package/lib/chevre/index.js +2 -3
  11. package/lib/chevre/repo/account.js +1 -1
  12. package/lib/chevre/repo/accountTitle.js +1 -1
  13. package/lib/chevre/repo/accountTransaction.js +1 -1
  14. package/lib/chevre/repo/accountingReport.js +1 -1
  15. package/lib/chevre/repo/action.js +1 -1
  16. package/lib/chevre/repo/additionalProperty.js +1 -1
  17. package/lib/chevre/repo/aggregateOffer.js +1 -1
  18. package/lib/chevre/repo/aggregation.js +1 -1
  19. package/lib/chevre/repo/assetTransaction.js +1 -1
  20. package/lib/chevre/repo/categoryCode.js +1 -1
  21. package/lib/chevre/repo/code.js +1 -1
  22. package/lib/chevre/repo/comment.js +1 -1
  23. package/lib/chevre/repo/creativeWork.js +1 -1
  24. package/lib/chevre/repo/customer.js +1 -1
  25. package/lib/chevre/repo/emailMessage.js +1 -1
  26. package/lib/chevre/repo/event.d.ts +2 -2
  27. package/lib/chevre/repo/event.js +6 -2
  28. package/lib/chevre/repo/member.js +1 -1
  29. package/lib/chevre/repo/merchantReturnPolicy.js +1 -1
  30. package/lib/chevre/repo/mongoose/schemas/account.d.ts +4 -56
  31. package/lib/chevre/repo/mongoose/schemas/account.js +80 -32
  32. package/lib/chevre/repo/mongoose/schemas/accountTitle.d.ts +4 -90
  33. package/lib/chevre/repo/mongoose/schemas/accountTitle.js +81 -44
  34. package/lib/chevre/repo/mongoose/schemas/accountTransaction.d.ts +4 -95
  35. package/lib/chevre/repo/mongoose/schemas/accountTransaction.js +129 -62
  36. package/lib/chevre/repo/mongoose/schemas/accountingReport.d.ts +4 -68
  37. package/lib/chevre/repo/mongoose/schemas/accountingReport.js +108 -63
  38. package/lib/chevre/repo/mongoose/schemas/action.d.ts +4 -113
  39. package/lib/chevre/repo/mongoose/schemas/action.js +345 -215
  40. package/lib/chevre/repo/mongoose/schemas/additionalProperty.d.ts +4 -74
  41. package/lib/chevre/repo/mongoose/schemas/additionalProperty.js +65 -32
  42. package/lib/chevre/repo/mongoose/schemas/aggregateOffer.d.ts +4 -73
  43. package/lib/chevre/repo/mongoose/schemas/aggregateOffer.js +258 -155
  44. package/lib/chevre/repo/mongoose/schemas/aggregation.d.ts +4 -56
  45. package/lib/chevre/repo/mongoose/schemas/aggregation.js +28 -10
  46. package/lib/chevre/repo/mongoose/schemas/assetTransaction.d.ts +4 -113
  47. package/lib/chevre/repo/mongoose/schemas/assetTransaction.js +258 -146
  48. package/lib/chevre/repo/mongoose/schemas/authorization.d.ts +4 -77
  49. package/lib/chevre/repo/mongoose/schemas/authorization.js +110 -61
  50. package/lib/chevre/repo/mongoose/schemas/categoryCode.d.ts +4 -86
  51. package/lib/chevre/repo/mongoose/schemas/categoryCode.js +85 -46
  52. package/lib/chevre/repo/mongoose/schemas/comments.d.ts +4 -89
  53. package/lib/chevre/repo/mongoose/schemas/comments.js +59 -28
  54. package/lib/chevre/repo/mongoose/schemas/creativeWork.d.ts +4 -104
  55. package/lib/chevre/repo/mongoose/schemas/creativeWork.js +121 -70
  56. package/lib/chevre/repo/mongoose/schemas/customer.d.ts +4 -86
  57. package/lib/chevre/repo/mongoose/schemas/customer.js +56 -26
  58. package/lib/chevre/repo/mongoose/schemas/emailMessages.d.ts +4 -80
  59. package/lib/chevre/repo/mongoose/schemas/emailMessages.js +41 -17
  60. package/lib/chevre/repo/mongoose/schemas/event.d.ts +4 -158
  61. package/lib/chevre/repo/mongoose/schemas/event.js +307 -193
  62. package/lib/chevre/repo/mongoose/schemas/member.d.ts +4 -68
  63. package/lib/chevre/repo/mongoose/schemas/member.js +65 -37
  64. package/lib/chevre/repo/mongoose/schemas/merchantReturnPolicy.d.ts +4 -80
  65. package/lib/chevre/repo/mongoose/schemas/merchantReturnPolicy.js +29 -11
  66. package/lib/chevre/repo/mongoose/schemas/offerCatalog.d.ts +4 -91
  67. package/lib/chevre/repo/mongoose/schemas/offerCatalog.js +85 -45
  68. package/lib/chevre/repo/mongoose/schemas/offerCatalogItem.d.ts +4 -91
  69. package/lib/chevre/repo/mongoose/schemas/offerCatalogItem.js +29 -10
  70. package/lib/chevre/repo/mongoose/schemas/offerItemCondition.d.ts +4 -73
  71. package/lib/chevre/repo/mongoose/schemas/offerItemCondition.js +37 -12
  72. package/lib/chevre/repo/mongoose/schemas/order.d.ts +4 -128
  73. package/lib/chevre/repo/mongoose/schemas/order.js +407 -259
  74. package/lib/chevre/repo/mongoose/schemas/ownershipInfo.d.ts +4 -86
  75. package/lib/chevre/repo/mongoose/schemas/ownershipInfo.js +187 -111
  76. package/lib/chevre/repo/mongoose/schemas/place.d.ts +4 -128
  77. package/lib/chevre/repo/mongoose/schemas/place.js +159 -93
  78. package/lib/chevre/repo/mongoose/schemas/priceSpecification.d.ts +4 -92
  79. package/lib/chevre/repo/mongoose/schemas/priceSpecification.js +94 -49
  80. package/lib/chevre/repo/mongoose/schemas/product.d.ts +4 -95
  81. package/lib/chevre/repo/mongoose/schemas/product.js +109 -61
  82. package/lib/chevre/repo/mongoose/schemas/project.d.ts +4 -83
  83. package/lib/chevre/repo/mongoose/schemas/project.js +20 -9
  84. package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +4 -143
  85. package/lib/chevre/repo/mongoose/schemas/reservation.js +377 -229
  86. package/lib/chevre/repo/mongoose/schemas/role.d.ts +4 -65
  87. package/lib/chevre/repo/mongoose/schemas/role.js +43 -19
  88. package/lib/chevre/repo/mongoose/schemas/seller.d.ts +4 -95
  89. package/lib/chevre/repo/mongoose/schemas/seller.js +96 -51
  90. package/lib/chevre/repo/mongoose/schemas/serviceOutput.d.ts +4 -65
  91. package/lib/chevre/repo/mongoose/schemas/serviceOutput.js +112 -63
  92. package/lib/chevre/repo/mongoose/schemas/task.d.ts +4 -95
  93. package/lib/chevre/repo/mongoose/schemas/task.js +214 -126
  94. package/lib/chevre/repo/mongoose/schemas/telemetry.d.ts +4 -80
  95. package/lib/chevre/repo/mongoose/schemas/telemetry.js +44 -24
  96. package/lib/chevre/repo/mongoose/schemas/transaction.d.ts +4 -107
  97. package/lib/chevre/repo/mongoose/schemas/transaction.js +291 -176
  98. package/lib/chevre/repo/mongoose/schemas/trip.d.ts +4 -65
  99. package/lib/chevre/repo/mongoose/schemas/trip.js +20 -9
  100. package/lib/chevre/repo/offer.js +5 -4
  101. package/lib/chevre/repo/offerCatalog.d.ts +1 -1
  102. package/lib/chevre/repo/offerCatalog.js +2 -2
  103. package/lib/chevre/repo/offerCatalogItem.js +1 -1
  104. package/lib/chevre/repo/offerItemCondition.js +1 -1
  105. package/lib/chevre/repo/order.js +1 -1
  106. package/lib/chevre/repo/ownershipInfo.js +1 -1
  107. package/lib/chevre/repo/paymentServiceProvider.js +1 -1
  108. package/lib/chevre/repo/permit.js +1 -1
  109. package/lib/chevre/repo/place/hasPOS.js +1 -1
  110. package/lib/chevre/repo/place.js +1 -1
  111. package/lib/chevre/repo/priceSpecification.js +1 -1
  112. package/lib/chevre/repo/product.js +1 -1
  113. package/lib/chevre/repo/productOffer.js +1 -1
  114. package/lib/chevre/repo/project.js +1 -1
  115. package/lib/chevre/repo/reservation.js +1 -1
  116. package/lib/chevre/repo/role.js +1 -1
  117. package/lib/chevre/repo/seller.js +1 -1
  118. package/lib/chevre/repo/serviceOutput.js +1 -1
  119. package/lib/chevre/repo/task.js +1 -1
  120. package/lib/chevre/repo/telemetry.js +1 -1
  121. package/lib/chevre/repo/transaction.js +1 -1
  122. package/lib/chevre/repo/trip.js +1 -1
  123. package/lib/chevre/repository.d.ts +160 -137
  124. package/lib/chevre/repository.js +531 -223
  125. package/lib/chevre/service/account.d.ts +2 -2
  126. package/lib/chevre/service/accountTransaction/deposit.d.ts +2 -2
  127. package/lib/chevre/service/accountTransaction/transfer.d.ts +2 -2
  128. package/lib/chevre/service/accountTransaction/withdraw.d.ts +2 -2
  129. package/lib/chevre/service/accountTransaction.d.ts +1 -1
  130. package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.d.ts +7 -7
  131. package/lib/chevre/service/aggregation/event/aggregateUseActionsOnEvent.d.ts +6 -6
  132. package/lib/chevre/service/aggregation/event/findEventOffers.d.ts +4 -4
  133. package/lib/chevre/service/aggregation/event/importFromCOA.d.ts +1 -1
  134. package/lib/chevre/service/aggregation/project.d.ts +3 -3
  135. package/lib/chevre/service/aggregation/system.d.ts +5 -5
  136. package/lib/chevre/service/assetTransaction/cancelReservation.d.ts +4 -4
  137. package/lib/chevre/service/assetTransaction/moneyTransfer.d.ts +4 -4
  138. package/lib/chevre/service/assetTransaction/moneyTransfer.js +1 -1
  139. package/lib/chevre/service/assetTransaction/pay/account/validation.d.ts +1 -1
  140. package/lib/chevre/service/assetTransaction/pay.d.ts +10 -10
  141. package/lib/chevre/service/assetTransaction/refund.d.ts +4 -4
  142. package/lib/chevre/service/assetTransaction/registerService.d.ts +8 -8
  143. package/lib/chevre/service/assetTransaction/reserve.d.ts +14 -14
  144. package/lib/chevre/service/assetTransaction.d.ts +2 -2
  145. package/lib/chevre/service/code.d.ts +2 -2
  146. package/lib/chevre/service/code.js +1 -2
  147. package/lib/chevre/service/delivery.d.ts +5 -5
  148. package/lib/chevre/service/event/createEvent.d.ts +4 -4
  149. package/lib/chevre/service/event.d.ts +7 -7
  150. package/lib/chevre/service/iam.d.ts +2 -2
  151. package/lib/chevre/service/moneyTransfer.d.ts +5 -5
  152. package/lib/chevre/service/notification.d.ts +2 -2
  153. package/lib/chevre/service/offer/event/authorize.d.ts +15 -15
  154. package/lib/chevre/service/offer/event/cancel.d.ts +7 -7
  155. package/lib/chevre/service/offer/event/importFromCOA.d.ts +3 -3
  156. package/lib/chevre/service/offer/event/searchEventTicketOffers.d.ts +7 -7
  157. package/lib/chevre/service/offer/event/voidTransaction.d.ts +7 -7
  158. package/lib/chevre/service/offer/eventServiceByCOA/validateAcceptedOffers.d.ts +1 -1
  159. package/lib/chevre/service/offer/eventServiceByCOA.d.ts +5 -5
  160. package/lib/chevre/service/offer/moneyTransfer/authorize.d.ts +6 -6
  161. package/lib/chevre/service/offer/moneyTransfer/returnMoneyTransfer.d.ts +5 -5
  162. package/lib/chevre/service/offer/moneyTransfer/settleTransaction.d.ts +2 -2
  163. package/lib/chevre/service/offer/moneyTransfer/voidTransaction.d.ts +3 -3
  164. package/lib/chevre/service/offer/product/searchProductOffers.d.ts +3 -3
  165. package/lib/chevre/service/offer/product.d.ts +14 -14
  166. package/lib/chevre/service/offer.d.ts +6 -6
  167. package/lib/chevre/service/order/confirmPayTransaction.d.ts +10 -10
  168. package/lib/chevre/service/order/deleteOrder.d.ts +5 -5
  169. package/lib/chevre/service/order/findPlaceOrderTransaction.d.ts +1 -1
  170. package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +5 -5
  171. package/lib/chevre/service/order/onOrderStatusChanged.d.ts +2 -2
  172. package/lib/chevre/service/order/onOrderUpdated.d.ts +1 -1
  173. package/lib/chevre/service/order/payOrder.d.ts +4 -4
  174. package/lib/chevre/service/order/placeOrder.d.ts +6 -6
  175. package/lib/chevre/service/order/returnOrder.d.ts +6 -6
  176. package/lib/chevre/service/order/sendOrder.d.ts +6 -6
  177. package/lib/chevre/service/payment/any/onPaid.d.ts +3 -3
  178. package/lib/chevre/service/payment/any/onPaymentStatusChanged/onPaid.d.ts +1 -1
  179. package/lib/chevre/service/payment/any/onPaymentStatusChanged/onRefunded.d.ts +1 -1
  180. package/lib/chevre/service/payment/any/onPaymentStatusChanged.d.ts +2 -2
  181. package/lib/chevre/service/payment/any/onRefund.d.ts +3 -3
  182. package/lib/chevre/service/payment/any.d.ts +10 -10
  183. package/lib/chevre/service/payment/creditCard.d.ts +6 -6
  184. package/lib/chevre/service/payment/faceToFace.d.ts +6 -6
  185. package/lib/chevre/service/payment/movieTicket/checkByIdentifier.d.ts +2 -2
  186. package/lib/chevre/service/payment/movieTicket/getCredentials.d.ts +1 -1
  187. package/lib/chevre/service/payment/movieTicket/validation.d.ts +5 -5
  188. package/lib/chevre/service/payment/movieTicket.d.ts +6 -6
  189. package/lib/chevre/service/payment/paymentCard.d.ts +7 -7
  190. package/lib/chevre/service/payment.d.ts +9 -9
  191. package/lib/chevre/service/permit.d.ts +2 -2
  192. package/lib/chevre/service/product.d.ts +3 -3
  193. package/lib/chevre/service/project.d.ts +16 -16
  194. package/lib/chevre/service/report/telemetry.d.ts +19 -16
  195. package/lib/chevre/service/reserve/cancelReservation.d.ts +3 -3
  196. package/lib/chevre/service/reserve/checkInReservation.d.ts +5 -5
  197. package/lib/chevre/service/reserve/confirmReservation.d.ts +4 -4
  198. package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.d.ts +1 -1
  199. package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.d.ts +2 -2
  200. package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.d.ts +1 -1
  201. package/lib/chevre/service/reserve/potentialActions/onReservationUsed.d.ts +1 -1
  202. package/lib/chevre/service/reserve/useReservation.d.ts +5 -5
  203. package/lib/chevre/service/reserve/verifyToken4reservation.d.ts +1 -1
  204. package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.d.ts +2 -2
  205. package/lib/chevre/service/task/onResourceUpdated/onOfferCatalogUpdated.d.ts +3 -3
  206. package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.d.ts +15 -15
  207. package/lib/chevre/service/task/onResourceUpdated/syncOfferCatalog.d.ts +2 -2
  208. package/lib/chevre/service/task.d.ts +1 -1
  209. package/lib/chevre/service/task.js +3 -4
  210. package/lib/chevre/service/transaction/deleteTransaction.d.ts +9 -9
  211. package/lib/chevre/service/transaction/moneyTransfer.d.ts +9 -9
  212. package/lib/chevre/service/transaction/orderProgramMembership/findPaymentCardPermit.d.ts +2 -2
  213. package/lib/chevre/service/transaction/placeOrder.d.ts +2 -2
  214. package/lib/chevre/service/transaction/placeOrderInProgress.d.ts +7 -7
  215. package/lib/chevre/service/transaction/returnOrder.d.ts +10 -10
  216. package/lib/chevre/service/transaction.d.ts +2 -2
  217. package/lib/chevre/settings.d.ts +1 -0
  218. package/lib/chevre/settings.js +2 -1
  219. package/package.json +1 -1
@@ -1,15 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.schema = exports.modelName = void 0;
3
+ exports.createSchema = exports.indexes = exports.modelName = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  const writeConcern_1 = require("../writeConcern");
6
6
  const settings_1 = require("../../../settings");
7
7
  const modelName = 'Place';
8
8
  exports.modelName = modelName;
9
- /**
10
- * 場所スキーマ
11
- */
12
- const schema = new mongoose_1.Schema({
9
+ const schemaDefinition = {
13
10
  project: {
14
11
  type: mongoose_1.SchemaTypes.Mixed,
15
12
  required: true
@@ -44,14 +41,16 @@ const schema = new mongoose_1.Schema({
44
41
  // ↓ルームの施設からの分離に伴い属性追加(2023-06-22~)
45
42
  openSeatingAllowed: mongoose_1.SchemaTypes.Mixed,
46
43
  amenityFeature: mongoose_1.SchemaTypes.Mixed
47
- }, {
44
+ };
45
+ const schemaOptions = {
46
+ autoIndex: settings_1.MONGO_AUTO_INDEX,
47
+ autoCreate: false,
48
48
  collection: 'places',
49
49
  id: true,
50
50
  read: settings_1.MONGO_READ_PREFERENCE,
51
51
  writeConcern: writeConcern_1.writeConcern,
52
52
  strict: true,
53
53
  strictQuery: false,
54
- useNestedStrict: true,
55
54
  timestamps: {
56
55
  createdAt: 'createdAt',
57
56
  updatedAt: 'updatedAt'
@@ -68,90 +67,157 @@ const schema = new mongoose_1.Schema({
68
67
  minimize: false,
69
68
  versionKey: false
70
69
  }
71
- });
72
- exports.schema = schema;
73
- schema.index({ createdAt: 1 }, { name: 'searchByCreatedAt' });
74
- schema.index({ updatedAt: 1 }, { name: 'searchByUpdatedAt' });
75
- schema.index({ branchCode: 1 }, { name: 'searchByBranchCode-v2' });
76
- schema.index({ typeOf: 1, branchCode: 1 }, { name: 'searchByTypeOf-v2' });
77
- schema.index({ 'project.id': 1, branchCode: 1 }, {
78
- name: 'searchByProjectId-v20220721'
79
- });
80
- schema.index({ 'name.ja': 1, branchCode: 1 }, {
81
- name: 'searchByNameJa',
82
- partialFilterExpression: {
83
- 'name.ja': { $exists: true }
84
- }
85
- });
86
- schema.index({ 'name.en': 1, branchCode: 1 }, {
87
- name: 'searchByNameEn',
88
- partialFilterExpression: {
89
- 'name.en': { $exists: true }
90
- }
91
- });
92
- schema.index({ kanaName: 1, branchCode: 1 }, {
93
- name: 'searchByKanaName-v2',
94
- partialFilterExpression: {
95
- kanaName: { $exists: true }
96
- }
97
- });
98
- schema.index({ 'parentOrganization.id': 1, branchCode: 1 }, {
99
- name: 'searchByParentOrganization',
100
- partialFilterExpression: {
101
- 'parentOrganization.id': { $exists: true }
102
- }
103
- });
104
- schema.index({ 'containsPlace.branchCode': 1, branchCode: 1 }, {
105
- name: 'searchByContainsPlaceBranchCode',
106
- partialFilterExpression: {
107
- 'containsPlace.branchCode': { $exists: true }
108
- }
109
- });
110
- schema.index({ 'containsPlace.containsPlace.branchCode': 1, branchCode: 1 }, {
111
- name: 'searchByContainsPlaceContainsPlaceBranchCode',
112
- partialFilterExpression: {
113
- 'containsPlace.containsPlace.branchCode': { $exists: true }
114
- }
115
- });
116
- schema.index({ 'containsPlace.containsPlace.containsPlace.branchCode': 1, branchCode: 1 }, {
117
- name: 'searchByContainsPlaceContainsPlaceContainsPlaceBranchCode',
118
- partialFilterExpression: {
119
- 'containsPlace.containsPlace.containsPlace.branchCode': { $exists: true }
120
- }
121
- });
122
- schema.index({ additionalProperty: 1, branchCode: 1 }, {
123
- name: 'searchByAdditionalProperty',
124
- partialFilterExpression: {
125
- additionalProperty: { $exists: true }
126
- }
127
- });
128
- schema.index({ 'containsPlace.additionalProperty': 1, branchCode: 1 }, {
129
- name: 'searchByContainsPlaceAdditionalProperty',
130
- partialFilterExpression: {
131
- 'containsPlace.additionalProperty': { $exists: true }
132
- }
133
- });
134
- schema.index({ 'containsPlace.containsPlace.additionalProperty': 1, branchCode: 1 }, {
135
- name: 'searchByContainsPlaceContainsPlaceAdditionalProperty',
136
- partialFilterExpression: {
137
- 'containsPlace.containsPlace.additionalProperty': { $exists: true }
138
- }
139
- });
140
- schema.index({ 'containsPlace.containsPlace.containsPlace.additionalProperty': 1, branchCode: 1 }, {
141
- name: 'searchByContainsPlaceContainsPlaceContainsPlaceAdditionalProperty',
142
- partialFilterExpression: {
143
- 'containsPlace.containsPlace.containsPlace.additionalProperty': { $exists: true }
144
- }
145
- });
146
- schema.index({ 'containedInPlace.id': 1, branchCode: 1 }, {
147
- name: 'searchByContainedInPlaceId',
148
- partialFilterExpression: {
149
- 'containedInPlace.id': { $exists: true }
150
- }
151
- });
152
- schema.index({ 'containedInPlace.branchCode': 1, branchCode: 1 }, {
153
- name: 'searchByContainedInPlaceBranchCode',
154
- partialFilterExpression: {
155
- 'containedInPlace.branchCode': { $exists: true }
70
+ };
71
+ /**
72
+ * 場所スキーマ
73
+ */
74
+ let schema;
75
+ function createSchema() {
76
+ if (schema === undefined) {
77
+ schema = new mongoose_1.Schema(schemaDefinition, schemaOptions);
156
78
  }
157
- });
79
+ return schema;
80
+ }
81
+ exports.createSchema = createSchema;
82
+ const indexes = [
83
+ [
84
+ { createdAt: 1 },
85
+ { name: 'searchByCreatedAt' }
86
+ ],
87
+ [
88
+ { updatedAt: 1 },
89
+ { name: 'searchByUpdatedAt' }
90
+ ],
91
+ [
92
+ { branchCode: 1 },
93
+ { name: 'searchByBranchCode-v2' }
94
+ ],
95
+ [
96
+ { typeOf: 1, branchCode: 1 },
97
+ { name: 'searchByTypeOf-v2' }
98
+ ],
99
+ [
100
+ { 'project.id': 1, branchCode: 1 },
101
+ {
102
+ name: 'searchByProjectId-v20220721'
103
+ }
104
+ ],
105
+ [
106
+ { 'name.ja': 1, branchCode: 1 },
107
+ {
108
+ name: 'searchByNameJa',
109
+ partialFilterExpression: {
110
+ 'name.ja': { $exists: true }
111
+ }
112
+ }
113
+ ],
114
+ [
115
+ { 'name.en': 1, branchCode: 1 },
116
+ {
117
+ name: 'searchByNameEn',
118
+ partialFilterExpression: {
119
+ 'name.en': { $exists: true }
120
+ }
121
+ }
122
+ ],
123
+ [
124
+ { kanaName: 1, branchCode: 1 },
125
+ {
126
+ name: 'searchByKanaName-v2',
127
+ partialFilterExpression: {
128
+ kanaName: { $exists: true }
129
+ }
130
+ }
131
+ ],
132
+ [
133
+ { 'parentOrganization.id': 1, branchCode: 1 },
134
+ {
135
+ name: 'searchByParentOrganization',
136
+ partialFilterExpression: {
137
+ 'parentOrganization.id': { $exists: true }
138
+ }
139
+ }
140
+ ],
141
+ [
142
+ { 'containsPlace.branchCode': 1, branchCode: 1 },
143
+ {
144
+ name: 'searchByContainsPlaceBranchCode',
145
+ partialFilterExpression: {
146
+ 'containsPlace.branchCode': { $exists: true }
147
+ }
148
+ }
149
+ ],
150
+ [
151
+ { 'containsPlace.containsPlace.branchCode': 1, branchCode: 1 },
152
+ {
153
+ name: 'searchByContainsPlaceContainsPlaceBranchCode',
154
+ partialFilterExpression: {
155
+ 'containsPlace.containsPlace.branchCode': { $exists: true }
156
+ }
157
+ }
158
+ ],
159
+ [
160
+ { 'containsPlace.containsPlace.containsPlace.branchCode': 1, branchCode: 1 },
161
+ {
162
+ name: 'searchByContainsPlaceContainsPlaceContainsPlaceBranchCode',
163
+ partialFilterExpression: {
164
+ 'containsPlace.containsPlace.containsPlace.branchCode': { $exists: true }
165
+ }
166
+ }
167
+ ],
168
+ [
169
+ { additionalProperty: 1, branchCode: 1 },
170
+ {
171
+ name: 'searchByAdditionalProperty',
172
+ partialFilterExpression: {
173
+ additionalProperty: { $exists: true }
174
+ }
175
+ }
176
+ ],
177
+ [
178
+ { 'containsPlace.additionalProperty': 1, branchCode: 1 },
179
+ {
180
+ name: 'searchByContainsPlaceAdditionalProperty',
181
+ partialFilterExpression: {
182
+ 'containsPlace.additionalProperty': { $exists: true }
183
+ }
184
+ }
185
+ ],
186
+ [
187
+ { 'containsPlace.containsPlace.additionalProperty': 1, branchCode: 1 },
188
+ {
189
+ name: 'searchByContainsPlaceContainsPlaceAdditionalProperty',
190
+ partialFilterExpression: {
191
+ 'containsPlace.containsPlace.additionalProperty': { $exists: true }
192
+ }
193
+ }
194
+ ],
195
+ [
196
+ { 'containsPlace.containsPlace.containsPlace.additionalProperty': 1, branchCode: 1 },
197
+ {
198
+ name: 'searchByContainsPlaceContainsPlaceContainsPlaceAdditionalProperty',
199
+ partialFilterExpression: {
200
+ 'containsPlace.containsPlace.containsPlace.additionalProperty': { $exists: true }
201
+ }
202
+ }
203
+ ],
204
+ [
205
+ { 'containedInPlace.id': 1, branchCode: 1 },
206
+ {
207
+ name: 'searchByContainedInPlaceId',
208
+ partialFilterExpression: {
209
+ 'containedInPlace.id': { $exists: true }
210
+ }
211
+ }
212
+ ],
213
+ [
214
+ { 'containedInPlace.branchCode': 1, branchCode: 1 },
215
+ {
216
+ name: 'searchByContainedInPlaceBranchCode',
217
+ partialFilterExpression: {
218
+ 'containedInPlace.branchCode': { $exists: true }
219
+ }
220
+ }
221
+ ]
222
+ ];
223
+ exports.indexes = indexes;
@@ -1,93 +1,5 @@
1
- /// <reference types="mongoose/types/aggregate" />
2
- /// <reference types="mongoose/types/callback" />
3
- /// <reference types="mongoose/types/collection" />
4
- /// <reference types="mongoose/types/connection" />
5
- /// <reference types="mongoose/types/cursor" />
6
- /// <reference types="mongoose/types/document" />
7
- /// <reference types="mongoose/types/error" />
8
- /// <reference types="mongoose/types/expressions" />
9
- /// <reference types="mongoose/types/helpers" />
10
- /// <reference types="mongoose/types/middlewares" />
11
- /// <reference types="mongoose/types/indexes" />
12
- /// <reference types="mongoose/types/models" />
13
- /// <reference types="mongoose/types/mongooseoptions" />
14
- /// <reference types="mongoose/types/pipelinestage" />
15
- /// <reference types="mongoose/types/populate" />
16
- /// <reference types="mongoose/types/query" />
17
- /// <reference types="mongoose/types/schemaoptions" />
18
- /// <reference types="mongoose/types/schematypes" />
19
- /// <reference types="mongoose/types/session" />
20
- /// <reference types="mongoose/types/types" />
21
- /// <reference types="mongoose/types/utility" />
22
- /// <reference types="mongoose/types/validation" />
23
- /// <reference types="mongoose/types/virtuals" />
24
- /// <reference types="mongoose/types/inferschematype" />
25
- import { Schema } from 'mongoose';
1
+ import { IndexDefinition, IndexOptions, Schema } from 'mongoose';
26
2
  declare const modelName = "PriceSpecification";
27
- /**
28
- * 価格仕様スキーマ
29
- */
30
- declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
31
- collection: string;
32
- id: true;
33
- read: string;
34
- writeConcern: import("mongodb").WriteConcern;
35
- strict: true;
36
- strictQuery: false;
37
- useNestedStrict: boolean;
38
- timestamps: {
39
- createdAt: string;
40
- updatedAt: string;
41
- };
42
- toJSON: {
43
- getters: false;
44
- virtuals: false;
45
- minimize: false;
46
- versionKey: false;
47
- };
48
- toObject: {
49
- getters: false;
50
- virtuals: true;
51
- minimize: false;
52
- versionKey: false;
53
- };
54
- }, {
55
- typeOf: string;
56
- price: number;
57
- name?: any;
58
- project?: any;
59
- priceCurrency?: string | undefined;
60
- validFrom?: Date | undefined;
61
- validThrough?: Date | undefined;
62
- appliesToMovieTicket?: any;
63
- valueAddedTaxIncluded?: boolean | undefined;
64
- appliesToCategoryCode?: any;
65
- appliesToVideoFormat?: string | undefined;
66
- }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
67
- typeOf: string;
68
- price: number;
69
- name?: any;
70
- project?: any;
71
- priceCurrency?: string | undefined;
72
- validFrom?: Date | undefined;
73
- validThrough?: Date | undefined;
74
- appliesToMovieTicket?: any;
75
- valueAddedTaxIncluded?: boolean | undefined;
76
- appliesToCategoryCode?: any;
77
- appliesToVideoFormat?: string | undefined;
78
- }>> & Omit<import("mongoose").FlatRecord<{
79
- typeOf: string;
80
- price: number;
81
- name?: any;
82
- project?: any;
83
- priceCurrency?: string | undefined;
84
- validFrom?: Date | undefined;
85
- validThrough?: Date | undefined;
86
- appliesToMovieTicket?: any;
87
- valueAddedTaxIncluded?: boolean | undefined;
88
- appliesToCategoryCode?: any;
89
- appliesToVideoFormat?: string | undefined;
90
- }> & {
91
- _id: import("mongoose").Types.ObjectId;
92
- }, never>>;
93
- export { modelName, schema };
3
+ declare function createSchema(): Schema;
4
+ declare const indexes: [d: IndexDefinition, o: IndexOptions][];
5
+ export { modelName, indexes, createSchema };
@@ -1,15 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.schema = exports.modelName = void 0;
3
+ exports.createSchema = exports.indexes = exports.modelName = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  const writeConcern_1 = require("../writeConcern");
6
6
  const settings_1 = require("../../../settings");
7
7
  const modelName = 'PriceSpecification';
8
8
  exports.modelName = modelName;
9
- /**
10
- * 価格仕様スキーマ
11
- */
12
- const schema = new mongoose_1.Schema({
9
+ const schemaDefinition = {
13
10
  project: mongoose_1.SchemaTypes.Mixed,
14
11
  typeOf: { type: String, required: true },
15
12
  name: mongoose_1.SchemaTypes.Mixed,
@@ -23,14 +20,16 @@ const schema = new mongoose_1.Schema({
23
20
  appliesToCategoryCode: mongoose_1.SchemaTypes.Mixed,
24
21
  appliesToMovieTicket: mongoose_1.SchemaTypes.Mixed,
25
22
  appliesToVideoFormat: String
26
- }, {
23
+ };
24
+ const schemaOptions = {
25
+ autoIndex: settings_1.MONGO_AUTO_INDEX,
26
+ autoCreate: false,
27
27
  collection: 'priceSpecifications',
28
28
  id: true,
29
29
  read: settings_1.MONGO_READ_PREFERENCE,
30
30
  writeConcern: writeConcern_1.writeConcern,
31
31
  strict: true,
32
32
  strictQuery: false,
33
- useNestedStrict: true,
34
33
  timestamps: {
35
34
  createdAt: 'createdAt',
36
35
  updatedAt: 'updatedAt'
@@ -47,46 +46,92 @@ const schema = new mongoose_1.Schema({
47
46
  minimize: false,
48
47
  versionKey: false
49
48
  }
50
- });
51
- exports.schema = schema;
52
- schema.index({ createdAt: 1 }, { name: 'searchByCreatedAt' });
53
- schema.index({ updatedAt: 1 }, { name: 'searchByUpdatedAt' });
54
- schema.index({ price: 1 }, { name: 'searchByPrice' });
55
- schema.index({ 'project.id': 1, price: 1 }, { name: 'searchByProjectId' });
56
- schema.index({ typeOf: 1, price: 1 }, { name: 'searchByTypeOf' });
57
- schema.index({ appliesToVideoFormat: 1, price: 1 }, {
58
- name: 'searchByAppliesToVideoFormat',
59
- partialFilterExpression: {
60
- appliesToVideoFormat: { $exists: true }
61
- }
62
- });
63
- schema.index({ 'appliesToMovieTicket.serviceType': 1, price: 1 }, {
64
- name: 'searchByAppliesToMovieTicketServiceType',
65
- partialFilterExpression: {
66
- 'appliesToMovieTicket.serviceType': { $exists: true }
67
- }
68
- });
69
- schema.index({ 'appliesToMovieTicket.serviceOutput.typeOf': 1, price: 1 }, {
70
- name: 'searchByAppliesToMovieTicketServiceOutputTypeOf',
71
- partialFilterExpression: {
72
- 'appliesToMovieTicket.serviceOutput.typeOf': { $exists: true }
73
- }
74
- });
75
- schema.index({ appliesToCategoryCode: 1, price: 1 }, {
76
- name: 'searchByAppliesToCategoryCode',
77
- partialFilterExpression: {
78
- appliesToCategoryCode: { $exists: true }
79
- }
80
- });
81
- schema.index({ 'appliesToCategoryCode.codeValue': 1, price: 1 }, {
82
- name: 'searchByAppliesToCategoryCodeCodeValue',
83
- partialFilterExpression: {
84
- 'appliesToCategoryCode.codeValue': { $exists: true }
85
- }
86
- });
87
- schema.index({ 'appliesToCategoryCode.inCodeSet.identifier': 1, price: 1 }, {
88
- name: 'searchByAppliesToCategoryCodeInCodeSetIdentifier',
89
- partialFilterExpression: {
90
- 'appliesToCategoryCode.inCodeSet.identifier': { $exists: true }
49
+ };
50
+ /**
51
+ * 価格仕様スキーマ
52
+ */
53
+ let schema;
54
+ function createSchema() {
55
+ if (schema === undefined) {
56
+ schema = new mongoose_1.Schema(schemaDefinition, schemaOptions);
91
57
  }
92
- });
58
+ return schema;
59
+ }
60
+ exports.createSchema = createSchema;
61
+ const indexes = [
62
+ [
63
+ { createdAt: 1 },
64
+ { name: 'searchByCreatedAt' }
65
+ ],
66
+ [
67
+ { updatedAt: 1 },
68
+ { name: 'searchByUpdatedAt' }
69
+ ],
70
+ [
71
+ { price: 1 },
72
+ { name: 'searchByPrice' }
73
+ ],
74
+ [
75
+ { 'project.id': 1, price: 1 },
76
+ { name: 'searchByProjectId' }
77
+ ],
78
+ [
79
+ { typeOf: 1, price: 1 },
80
+ { name: 'searchByTypeOf' }
81
+ ],
82
+ [
83
+ { appliesToVideoFormat: 1, price: 1 },
84
+ {
85
+ name: 'searchByAppliesToVideoFormat',
86
+ partialFilterExpression: {
87
+ appliesToVideoFormat: { $exists: true }
88
+ }
89
+ }
90
+ ],
91
+ [
92
+ { 'appliesToMovieTicket.serviceType': 1, price: 1 },
93
+ {
94
+ name: 'searchByAppliesToMovieTicketServiceType',
95
+ partialFilterExpression: {
96
+ 'appliesToMovieTicket.serviceType': { $exists: true }
97
+ }
98
+ }
99
+ ],
100
+ [
101
+ { 'appliesToMovieTicket.serviceOutput.typeOf': 1, price: 1 },
102
+ {
103
+ name: 'searchByAppliesToMovieTicketServiceOutputTypeOf',
104
+ partialFilterExpression: {
105
+ 'appliesToMovieTicket.serviceOutput.typeOf': { $exists: true }
106
+ }
107
+ }
108
+ ],
109
+ [
110
+ { appliesToCategoryCode: 1, price: 1 },
111
+ {
112
+ name: 'searchByAppliesToCategoryCode',
113
+ partialFilterExpression: {
114
+ appliesToCategoryCode: { $exists: true }
115
+ }
116
+ }
117
+ ],
118
+ [
119
+ { 'appliesToCategoryCode.codeValue': 1, price: 1 },
120
+ {
121
+ name: 'searchByAppliesToCategoryCodeCodeValue',
122
+ partialFilterExpression: {
123
+ 'appliesToCategoryCode.codeValue': { $exists: true }
124
+ }
125
+ }
126
+ ],
127
+ [
128
+ { 'appliesToCategoryCode.inCodeSet.identifier': 1, price: 1 },
129
+ {
130
+ name: 'searchByAppliesToCategoryCodeInCodeSetIdentifier',
131
+ partialFilterExpression: {
132
+ 'appliesToCategoryCode.inCodeSet.identifier': { $exists: true }
133
+ }
134
+ }
135
+ ]
136
+ ];
137
+ exports.indexes = indexes;
@@ -1,96 +1,5 @@
1
- /// <reference types="mongoose/types/aggregate" />
2
- /// <reference types="mongoose/types/callback" />
3
- /// <reference types="mongoose/types/collection" />
4
- /// <reference types="mongoose/types/connection" />
5
- /// <reference types="mongoose/types/cursor" />
6
- /// <reference types="mongoose/types/document" />
7
- /// <reference types="mongoose/types/error" />
8
- /// <reference types="mongoose/types/expressions" />
9
- /// <reference types="mongoose/types/helpers" />
10
- /// <reference types="mongoose/types/middlewares" />
11
- /// <reference types="mongoose/types/indexes" />
12
- /// <reference types="mongoose/types/models" />
13
- /// <reference types="mongoose/types/mongooseoptions" />
14
- /// <reference types="mongoose/types/pipelinestage" />
15
- /// <reference types="mongoose/types/populate" />
16
- /// <reference types="mongoose/types/query" />
17
- /// <reference types="mongoose/types/schemaoptions" />
18
- /// <reference types="mongoose/types/schematypes" />
19
- /// <reference types="mongoose/types/session" />
20
- /// <reference types="mongoose/types/types" />
21
- /// <reference types="mongoose/types/utility" />
22
- /// <reference types="mongoose/types/validation" />
23
- /// <reference types="mongoose/types/virtuals" />
24
- /// <reference types="mongoose/types/inferschematype" />
25
- import { Schema } from 'mongoose';
1
+ import { IndexDefinition, IndexOptions, Schema } from 'mongoose';
26
2
  declare const modelName = "Product";
27
- /**
28
- * プロダクトスキーマ
29
- */
30
- declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
31
- collection: string;
32
- id: true;
33
- read: string;
34
- writeConcern: import("mongodb").WriteConcern;
35
- strict: true;
36
- strictQuery: false;
37
- useNestedStrict: boolean;
38
- timestamps: {
39
- createdAt: string;
40
- updatedAt: string;
41
- };
42
- toJSON: {
43
- getters: false;
44
- virtuals: false;
45
- minimize: false;
46
- versionKey: false;
47
- };
48
- toObject: {
49
- getters: false;
50
- virtuals: true;
51
- minimize: false;
52
- versionKey: false;
53
- };
54
- }, {
55
- typeOf: string;
56
- additionalProperty: any[];
57
- offers: any[];
58
- provider: any[];
59
- productID: string;
60
- name?: any;
61
- project?: any;
62
- description?: any;
63
- serviceOutput?: any;
64
- serviceType?: any;
65
- availableChannel?: any;
66
- hasOfferCatalog?: any;
67
- }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
68
- typeOf: string;
69
- additionalProperty: any[];
70
- offers: any[];
71
- provider: any[];
72
- productID: string;
73
- name?: any;
74
- project?: any;
75
- description?: any;
76
- serviceOutput?: any;
77
- serviceType?: any;
78
- availableChannel?: any;
79
- hasOfferCatalog?: any;
80
- }>> & Omit<import("mongoose").FlatRecord<{
81
- typeOf: string;
82
- additionalProperty: any[];
83
- offers: any[];
84
- provider: any[];
85
- productID: string;
86
- name?: any;
87
- project?: any;
88
- description?: any;
89
- serviceOutput?: any;
90
- serviceType?: any;
91
- availableChannel?: any;
92
- hasOfferCatalog?: any;
93
- }> & {
94
- _id: import("mongoose").Types.ObjectId;
95
- }, never>>;
96
- export { modelName, schema };
3
+ declare function createSchema(): Schema;
4
+ declare const indexes: [d: IndexDefinition, o: IndexOptions][];
5
+ export { modelName, indexes, createSchema };