@chevre/domain 21.0.0-alpha.1 → 21.0.0-alpha.11

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 (263) hide show
  1. package/lib/chevre/errorHandler.d.ts +1 -0
  2. package/lib/chevre/errorHandler.js +6 -2
  3. package/lib/chevre/factory/event.d.ts +1 -1
  4. package/lib/chevre/index.d.ts +1 -2
  5. package/lib/chevre/index.js +1 -3
  6. package/lib/chevre/repo/account.d.ts +0 -2
  7. package/lib/chevre/repo/account.js +10 -6
  8. package/lib/chevre/repo/accountTitle.js +6 -2
  9. package/lib/chevre/repo/accountTransaction.d.ts +0 -2
  10. package/lib/chevre/repo/accountTransaction.js +9 -6
  11. package/lib/chevre/repo/accountingReport.d.ts +1 -1
  12. package/lib/chevre/repo/accountingReport.js +7 -3
  13. package/lib/chevre/repo/action/registerServiceInProgress.js +1 -1
  14. package/lib/chevre/repo/action.d.ts +3 -4
  15. package/lib/chevre/repo/action.js +9 -6
  16. package/lib/chevre/repo/additionalProperty.js +8 -4
  17. package/lib/chevre/repo/aggregation.js +6 -2
  18. package/lib/chevre/repo/assetTransaction.d.ts +1 -2
  19. package/lib/chevre/repo/assetTransaction.js +9 -6
  20. package/lib/chevre/repo/categoryCode.js +8 -4
  21. package/lib/chevre/repo/code.d.ts +3 -3
  22. package/lib/chevre/repo/code.js +10 -5
  23. package/lib/chevre/repo/comment.js +8 -4
  24. package/lib/chevre/repo/confirmationNumber.js +1 -1
  25. package/lib/chevre/repo/creativeWork.d.ts +0 -2
  26. package/lib/chevre/repo/creativeWork.js +9 -6
  27. package/lib/chevre/repo/customer.js +8 -4
  28. package/lib/chevre/repo/emailMessage.d.ts +1 -1
  29. package/lib/chevre/repo/emailMessage.js +8 -4
  30. package/lib/chevre/repo/event.d.ts +1 -1
  31. package/lib/chevre/repo/event.js +8 -4
  32. package/lib/chevre/repo/itemAvailability/screeningEvent.js +1 -1
  33. package/lib/chevre/repo/member.js +16 -9
  34. package/lib/chevre/repo/merchantReturnPolicy.d.ts +0 -2
  35. package/lib/chevre/repo/merchantReturnPolicy.js +9 -6
  36. package/lib/chevre/repo/mongoose/onIndexCreated.d.ts +2 -0
  37. package/lib/chevre/repo/mongoose/onIndexCreated.js +11 -0
  38. package/lib/chevre/repo/mongoose/schemas/account.d.ts +54 -0
  39. package/lib/chevre/repo/mongoose/{model → schemas}/account.js +4 -14
  40. package/lib/chevre/repo/mongoose/schemas/accountTitle.d.ts +64 -0
  41. package/lib/chevre/repo/mongoose/{model → schemas}/accountTitle.js +10 -35
  42. package/lib/chevre/repo/mongoose/schemas/accountTransaction.d.ts +67 -0
  43. package/lib/chevre/repo/mongoose/{model → schemas}/accountTransaction.js +9 -19
  44. package/lib/chevre/repo/mongoose/schemas/accountingReport.d.ts +58 -0
  45. package/lib/chevre/repo/mongoose/{model → schemas}/accountingReport.js +7 -17
  46. package/lib/chevre/repo/mongoose/schemas/action.d.ts +73 -0
  47. package/lib/chevre/repo/mongoose/{model → schemas}/action.js +17 -27
  48. package/lib/chevre/repo/mongoose/schemas/additionalProperty.d.ts +60 -0
  49. package/lib/chevre/repo/mongoose/{model → schemas}/additionalProperty.js +7 -17
  50. package/lib/chevre/repo/mongoose/schemas/aggregation.d.ts +54 -0
  51. package/lib/chevre/repo/mongoose/{model → schemas}/aggregation.js +4 -14
  52. package/lib/chevre/repo/mongoose/schemas/assetTransaction.d.ts +72 -0
  53. package/lib/chevre/repo/mongoose/{model → schemas}/assetTransaction.js +13 -23
  54. package/lib/chevre/repo/mongoose/schemas/authorization.d.ts +61 -0
  55. package/lib/chevre/repo/mongoose/{model → schemas}/authorization.js +6 -16
  56. package/lib/chevre/repo/mongoose/schemas/categoryCode.d.ts +64 -0
  57. package/lib/chevre/repo/mongoose/{model → schemas}/categoryCode.js +9 -19
  58. package/lib/chevre/repo/mongoose/schemas/comments.d.ts +65 -0
  59. package/lib/chevre/repo/mongoose/{model → schemas}/comments.js +9 -19
  60. package/lib/chevre/repo/mongoose/schemas/creativeWork.d.ts +73 -0
  61. package/lib/chevre/repo/mongoose/{model → schemas}/creativeWork.js +10 -20
  62. package/lib/chevre/repo/mongoose/schemas/customer.d.ts +64 -0
  63. package/lib/chevre/repo/mongoose/{model → schemas}/customer.js +8 -18
  64. package/lib/chevre/repo/mongoose/schemas/emailMessages.d.ts +62 -0
  65. package/lib/chevre/repo/mongoose/{model → schemas}/emailMessages.js +8 -18
  66. package/lib/chevre/repo/mongoose/{model → schemas}/event.d.ts +26 -2
  67. package/lib/chevre/repo/mongoose/{model → schemas}/event.js +24 -34
  68. package/lib/chevre/repo/mongoose/schemas/member.d.ts +58 -0
  69. package/lib/chevre/repo/mongoose/{model → schemas}/member.js +6 -16
  70. package/lib/chevre/repo/mongoose/schemas/merchantReturnPolicy.d.ts +62 -0
  71. package/lib/chevre/repo/mongoose/{model → schemas}/merchantReturnPolicy.js +7 -17
  72. package/lib/chevre/repo/mongoose/schemas/offer.d.ts +83 -0
  73. package/lib/chevre/repo/mongoose/{model → schemas}/offer.js +28 -38
  74. package/lib/chevre/repo/mongoose/schemas/offerCatalog.d.ts +64 -0
  75. package/lib/chevre/repo/mongoose/{model → schemas}/offerCatalog.js +11 -21
  76. package/lib/chevre/repo/mongoose/schemas/order.d.ts +77 -0
  77. package/lib/chevre/repo/mongoose/{model → schemas}/order.js +15 -25
  78. package/lib/chevre/repo/mongoose/schemas/ownershipInfo.d.ts +64 -0
  79. package/lib/chevre/repo/mongoose/{model → schemas}/ownershipInfo.js +9 -19
  80. package/lib/chevre/repo/mongoose/schemas/place.d.ts +76 -0
  81. package/lib/chevre/repo/mongoose/{model → schemas}/place.js +17 -27
  82. package/lib/chevre/repo/mongoose/schemas/priceSpecification.d.ts +66 -0
  83. package/lib/chevre/repo/mongoose/{model → schemas}/priceSpecification.js +9 -19
  84. package/lib/chevre/repo/mongoose/schemas/product.d.ts +67 -0
  85. package/lib/chevre/repo/mongoose/{model → schemas}/product.js +14 -24
  86. package/lib/chevre/repo/mongoose/schemas/project.d.ts +63 -0
  87. package/lib/chevre/repo/mongoose/{model → schemas}/project.js +7 -17
  88. package/lib/chevre/repo/mongoose/{model → schemas}/reservation.d.ts +26 -2
  89. package/lib/chevre/repo/mongoose/{model → schemas}/reservation.js +15 -25
  90. package/lib/chevre/repo/mongoose/schemas/role.d.ts +57 -0
  91. package/lib/chevre/repo/mongoose/{model → schemas}/role.js +4 -14
  92. package/lib/chevre/repo/mongoose/schemas/seller.d.ts +67 -0
  93. package/lib/chevre/repo/mongoose/{model → schemas}/seller.js +12 -22
  94. package/lib/chevre/repo/mongoose/schemas/serviceOutput.d.ts +57 -0
  95. package/lib/chevre/repo/mongoose/{model → schemas}/serviceOutput.js +5 -15
  96. package/lib/chevre/repo/mongoose/schemas/task.d.ts +65 -0
  97. package/lib/chevre/repo/mongoose/{model → schemas}/task.js +7 -17
  98. package/lib/chevre/repo/mongoose/schemas/telemetry.d.ts +62 -0
  99. package/lib/chevre/repo/mongoose/{model → schemas}/telemetry.js +9 -19
  100. package/lib/chevre/repo/mongoose/schemas/transaction.d.ts +70 -0
  101. package/lib/chevre/repo/mongoose/{model → schemas}/transaction.js +12 -22
  102. package/lib/chevre/repo/mongoose/schemas/trip.d.ts +57 -0
  103. package/lib/chevre/repo/mongoose/{model → schemas}/trip.js +5 -15
  104. package/lib/chevre/repo/mongoose/writeConcern.d.ts +3 -0
  105. package/lib/chevre/repo/mongoose/writeConcern.js +5 -0
  106. package/lib/chevre/repo/offer.js +11 -6
  107. package/lib/chevre/repo/offerCatalog.js +8 -4
  108. package/lib/chevre/repo/order.d.ts +0 -2
  109. package/lib/chevre/repo/order.js +12 -9
  110. package/lib/chevre/repo/orderNumber.js +1 -1
  111. package/lib/chevre/repo/ownershipInfo.d.ts +1 -3
  112. package/lib/chevre/repo/ownershipInfo.js +10 -7
  113. package/lib/chevre/repo/paymentMethod/creditCard.d.ts +3 -3
  114. package/lib/chevre/repo/permit.js +6 -2
  115. package/lib/chevre/repo/person.d.ts +2 -2
  116. package/lib/chevre/repo/place.d.ts +2 -2
  117. package/lib/chevre/repo/place.js +16 -12
  118. package/lib/chevre/repo/priceSpecification.js +8 -4
  119. package/lib/chevre/repo/product.d.ts +1 -1
  120. package/lib/chevre/repo/product.js +8 -4
  121. package/lib/chevre/repo/project.js +7 -3
  122. package/lib/chevre/repo/rateLimit/offer.js +1 -1
  123. package/lib/chevre/repo/reservation.d.ts +1 -1
  124. package/lib/chevre/repo/reservation.js +8 -21
  125. package/lib/chevre/repo/role.js +8 -4
  126. package/lib/chevre/repo/seller.d.ts +1 -1
  127. package/lib/chevre/repo/seller.js +8 -4
  128. package/lib/chevre/repo/serviceOutput.js +8 -4
  129. package/lib/chevre/repo/serviceOutputIdentifier.js +1 -1
  130. package/lib/chevre/repo/task.js +8 -4
  131. package/lib/chevre/repo/telemetry.js +6 -2
  132. package/lib/chevre/repo/transaction.d.ts +1 -2
  133. package/lib/chevre/repo/transaction.js +9 -6
  134. package/lib/chevre/repo/transactionNumber.js +1 -1
  135. package/lib/chevre/repo/trip.d.ts +1 -1
  136. package/lib/chevre/repo/trip.js +8 -4
  137. package/lib/chevre/service/account.d.ts +1 -1
  138. package/lib/chevre/service/accountTransaction/deposit.d.ts +1 -1
  139. package/lib/chevre/service/accountTransaction/deposit.js +0 -5
  140. package/lib/chevre/service/accountTransaction/transfer.d.ts +1 -1
  141. package/lib/chevre/service/accountTransaction/transfer.js +0 -5
  142. package/lib/chevre/service/accountTransaction/withdraw.d.ts +1 -1
  143. package/lib/chevre/service/accountTransaction/withdraw.js +0 -5
  144. package/lib/chevre/service/accountTransaction.d.ts +1 -1
  145. package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.d.ts +1 -1
  146. package/lib/chevre/service/aggregation/event/aggregateUseActionsOnEvent.d.ts +1 -1
  147. package/lib/chevre/service/aggregation/project.d.ts +1 -1
  148. package/lib/chevre/service/assetTransaction/cancelReservation.d.ts +3 -3
  149. package/lib/chevre/service/assetTransaction/moneyTransfer.d.ts +4 -4
  150. package/lib/chevre/service/assetTransaction/moneyTransfer.js +0 -5
  151. package/lib/chevre/service/assetTransaction/pay/potentialActions.d.ts +1 -1
  152. package/lib/chevre/service/assetTransaction/pay.d.ts +7 -7
  153. package/lib/chevre/service/assetTransaction/refund.d.ts +4 -4
  154. package/lib/chevre/service/assetTransaction/refund.js +0 -5
  155. package/lib/chevre/service/assetTransaction/registerService/factory.d.ts +1 -1
  156. package/lib/chevre/service/assetTransaction/registerService.d.ts +4 -4
  157. package/lib/chevre/service/assetTransaction/registerService.js +0 -5
  158. package/lib/chevre/service/assetTransaction/reserve/factory/price.d.ts +1 -1
  159. package/lib/chevre/service/assetTransaction/reserve/factory.d.ts +2 -2
  160. package/lib/chevre/service/assetTransaction/reserve.d.ts +6 -6
  161. package/lib/chevre/service/assetTransaction/reserve.js +0 -10
  162. package/lib/chevre/service/code.d.ts +2 -2
  163. package/lib/chevre/service/code.js +6 -1
  164. package/lib/chevre/service/delivery/factory.d.ts +1 -1
  165. package/lib/chevre/service/delivery/product/factory.d.ts +1 -1
  166. package/lib/chevre/service/delivery/reservation/factory.d.ts +1 -1
  167. package/lib/chevre/service/iam.d.ts +1 -1
  168. package/lib/chevre/service/moneyTransfer.d.ts +1 -1
  169. package/lib/chevre/service/notification.d.ts +1 -1
  170. package/lib/chevre/service/offer/event/authorize.d.ts +2 -2
  171. package/lib/chevre/service/offer/event/factory.d.ts +5 -5
  172. package/lib/chevre/service/offer/event/searchEventTicketOffers.d.ts +2 -2
  173. package/lib/chevre/service/offer/eventServiceByCOA/factory.d.ts +2 -2
  174. package/lib/chevre/service/offer/eventServiceByCOA/validateAcceptedOffers.d.ts +1 -1
  175. package/lib/chevre/service/offer/eventServiceByCOA.d.ts +2 -2
  176. package/lib/chevre/service/offer/factory.d.ts +2 -2
  177. package/lib/chevre/service/offer/moneyTransfer/authorize.d.ts +1 -1
  178. package/lib/chevre/service/offer/product.d.ts +2 -2
  179. package/lib/chevre/service/order/onOrderStatusChanged/factory.d.ts +1 -1
  180. package/lib/chevre/service/order/onOrderStatusChanged/factory.js +6 -1
  181. package/lib/chevre/service/order/onOrderStatusChanged.d.ts +2 -2
  182. package/lib/chevre/service/order/placeOrder.d.ts +1 -1
  183. package/lib/chevre/service/order/sendOrder.d.ts +1 -1
  184. package/lib/chevre/service/payment/any/factory.d.ts +1 -1
  185. package/lib/chevre/service/payment/any/onPaymentStatusChanged/onPaid.d.ts +1 -1
  186. package/lib/chevre/service/payment/any/onPaymentStatusChanged/onRefunded.d.ts +1 -1
  187. package/lib/chevre/service/payment/any.d.ts +3 -3
  188. package/lib/chevre/service/payment/creditCard.js +5 -0
  189. package/lib/chevre/service/payment/movieTicket.d.ts +4 -4
  190. package/lib/chevre/service/payment/paymentCard.d.ts +1 -1
  191. package/lib/chevre/service/permit.d.ts +1 -1
  192. package/lib/chevre/service/report/ownershipInfo.js +4 -0
  193. package/lib/chevre/service/report/telemetry.d.ts +7 -7
  194. package/lib/chevre/service/reserve/cancelReservation.d.ts +1 -1
  195. package/lib/chevre/service/reserve/factory.d.ts +5 -5
  196. package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.d.ts +1 -1
  197. package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.d.ts +1 -1
  198. package/lib/chevre/service/reserve/potentialActions/onReservationUsed.d.ts +2 -2
  199. package/lib/chevre/service/task/aggregateScreeningEvent.d.ts +1 -1
  200. package/lib/chevre/service/task/aggregateUseActionsOnEvent.d.ts +1 -1
  201. package/lib/chevre/service/task/cancelMoneyTransfer.d.ts +1 -1
  202. package/lib/chevre/service/task/cancelPendingReservation.d.ts +1 -1
  203. package/lib/chevre/service/task/cancelReservation.d.ts +1 -1
  204. package/lib/chevre/service/task/importEventCapacitiesFromCOA.d.ts +1 -1
  205. package/lib/chevre/service/task/importEventsFromCOA.d.ts +1 -1
  206. package/lib/chevre/service/task/importOffersFromCOA.d.ts +1 -1
  207. package/lib/chevre/service/task/moneyTransfer.d.ts +1 -1
  208. package/lib/chevre/service/task/registerService.d.ts +1 -1
  209. package/lib/chevre/service/task/reserve.d.ts +1 -1
  210. package/lib/chevre/service/task.d.ts +2 -2
  211. package/lib/chevre/service/task.js +1 -1
  212. package/lib/chevre/service/transaction/moneyTransfer/potentialActions.d.ts +1 -1
  213. package/lib/chevre/service/transaction/moneyTransfer.d.ts +6 -6
  214. package/lib/chevre/service/transaction/moneyTransfer.js +0 -5
  215. package/lib/chevre/service/transaction/orderProgramMembership.d.ts +1 -1
  216. package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.d.ts +1 -1
  217. package/lib/chevre/service/transaction/placeOrder.d.ts +1 -1
  218. package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/moneyTransfer.d.ts +1 -1
  219. package/lib/chevre/service/transaction/placeOrderInProgress/result/acceptedOffers.d.ts +2 -2
  220. package/lib/chevre/service/transaction/placeOrderInProgress/result.d.ts +1 -1
  221. package/lib/chevre/service/transaction/placeOrderInProgress/validation.d.ts +8 -8
  222. package/lib/chevre/service/transaction/placeOrderInProgress.d.ts +7 -7
  223. package/lib/chevre/service/transaction/placeOrderInProgress.js +2 -2
  224. package/lib/chevre/service/transaction/returnOrder/potentialActions/returnMoneyTransfer.d.ts +1 -1
  225. package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPointAward.d.ts +1 -1
  226. package/lib/chevre/service/transaction/returnOrder/potentialActions.d.ts +1 -1
  227. package/lib/chevre/service/transaction/returnOrder.d.ts +2 -2
  228. package/lib/chevre/service/transaction/returnOrder.js +1 -1
  229. package/lib/chevre/service/transaction/validation.d.ts +2 -2
  230. package/lib/chevre/service/transaction.d.ts +2 -2
  231. package/lib/chevre/settings.d.ts +1 -1
  232. package/package.json +11 -11
  233. package/lib/chevre/repo/mongoose/model/account.d.ts +0 -30
  234. package/lib/chevre/repo/mongoose/model/accountTitle.d.ts +0 -40
  235. package/lib/chevre/repo/mongoose/model/accountTransaction.d.ts +0 -43
  236. package/lib/chevre/repo/mongoose/model/accountingReport.d.ts +0 -34
  237. package/lib/chevre/repo/mongoose/model/action.d.ts +0 -49
  238. package/lib/chevre/repo/mongoose/model/additionalProperty.d.ts +0 -36
  239. package/lib/chevre/repo/mongoose/model/aggregation.d.ts +0 -30
  240. package/lib/chevre/repo/mongoose/model/assetTransaction.d.ts +0 -48
  241. package/lib/chevre/repo/mongoose/model/authorization.d.ts +0 -37
  242. package/lib/chevre/repo/mongoose/model/categoryCode.d.ts +0 -40
  243. package/lib/chevre/repo/mongoose/model/comments.d.ts +0 -41
  244. package/lib/chevre/repo/mongoose/model/creativeWork.d.ts +0 -49
  245. package/lib/chevre/repo/mongoose/model/customer.d.ts +0 -40
  246. package/lib/chevre/repo/mongoose/model/emailMessages.d.ts +0 -38
  247. package/lib/chevre/repo/mongoose/model/member.d.ts +0 -34
  248. package/lib/chevre/repo/mongoose/model/merchantReturnPolicy.d.ts +0 -38
  249. package/lib/chevre/repo/mongoose/model/offer.d.ts +0 -59
  250. package/lib/chevre/repo/mongoose/model/offerCatalog.d.ts +0 -40
  251. package/lib/chevre/repo/mongoose/model/order.d.ts +0 -53
  252. package/lib/chevre/repo/mongoose/model/ownershipInfo.d.ts +0 -40
  253. package/lib/chevre/repo/mongoose/model/place.d.ts +0 -52
  254. package/lib/chevre/repo/mongoose/model/priceSpecification.d.ts +0 -42
  255. package/lib/chevre/repo/mongoose/model/product.d.ts +0 -43
  256. package/lib/chevre/repo/mongoose/model/project.d.ts +0 -39
  257. package/lib/chevre/repo/mongoose/model/role.d.ts +0 -33
  258. package/lib/chevre/repo/mongoose/model/seller.d.ts +0 -43
  259. package/lib/chevre/repo/mongoose/model/serviceOutput.d.ts +0 -33
  260. package/lib/chevre/repo/mongoose/model/task.d.ts +0 -41
  261. package/lib/chevre/repo/mongoose/model/telemetry.d.ts +0 -38
  262. package/lib/chevre/repo/mongoose/model/transaction.d.ts +0 -46
  263. package/lib/chevre/repo/mongoose/model/trip.d.ts +0 -33
@@ -21,14 +21,18 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  };
22
22
  Object.defineProperty(exports, "__esModule", { value: true });
23
23
  exports.MongoRepository = void 0;
24
- const emailMessages_1 = require("./mongoose/model/emailMessages");
24
+ const onIndexCreated_1 = require("./mongoose/onIndexCreated");
25
+ const emailMessages_1 = require("./mongoose/schemas/emailMessages");
25
26
  const factory = require("../factory");
26
27
  /**
27
28
  * Eメールメッセージリポジトリ
28
29
  */
29
30
  class MongoRepository {
30
31
  constructor(connection) {
31
- this.emailMessageModel = connection.model(emailMessages_1.modelName);
32
+ this.emailMessageModel = connection.model(emailMessages_1.modelName, emailMessages_1.schema);
33
+ if (connection.get('autoIndex') === true) {
34
+ this.emailMessageModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
35
+ }
32
36
  }
33
37
  static CREATE_MONGO_CONDITIONS(params) {
34
38
  var _a, _b, _c, _d, _e;
@@ -97,8 +101,8 @@ class MongoRepository {
97
101
  createdAt: 0,
98
102
  updatedAt: 0
99
103
  });
100
- if (typeof params.limit === 'number') {
101
- const page = (typeof params.page === 'number') ? params.page : 1;
104
+ if (typeof params.limit === 'number' && params.limit > 0) {
105
+ const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
102
106
  query.limit(params.limit)
103
107
  .skip(params.limit * (page - 1));
104
108
  }
@@ -55,7 +55,7 @@ export interface IUpdateAggregateUseActionsParams {
55
55
  noExistingAttributeName: 1;
56
56
  };
57
57
  }
58
- export declare type ISearchConditions<T extends factory.eventType> = factory.event.ISearchConditions<T>;
58
+ export type ISearchConditions<T extends factory.eventType> = factory.event.ISearchConditions<T>;
59
59
  interface IAggregationByStatus {
60
60
  eventCount: number;
61
61
  reservationCount: number;
@@ -23,7 +23,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
23
23
  exports.MongoRepository = exports.PROJECTION_MINIMIZED_EVENT = void 0;
24
24
  const uniqid = require("uniqid");
25
25
  const factory = require("../factory");
26
- const event_1 = require("./mongoose/model/event");
26
+ const onIndexCreated_1 = require("./mongoose/onIndexCreated");
27
+ const event_1 = require("./mongoose/schemas/event");
27
28
  exports.PROJECTION_MINIMIZED_EVENT = {
28
29
  project: 1,
29
30
  _id: 1,
@@ -45,7 +46,10 @@ exports.PROJECTION_MINIMIZED_EVENT = {
45
46
  */
46
47
  class MongoRepository {
47
48
  constructor(connection) {
48
- this.eventModel = connection.model(event_1.modelName);
49
+ this.eventModel = connection.model(event_1.modelName, event_1.schema);
50
+ if (connection.get('autoIndex') === true) {
51
+ this.eventModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
52
+ }
49
53
  }
50
54
  // tslint:disable-next-line:cyclomatic-complexity max-func-body-length
51
55
  static CREATE_MONGO_CONDITIONS(conditions) {
@@ -647,8 +651,8 @@ class MongoRepository {
647
651
  (positiveProjectionExists)
648
652
  ? projection
649
653
  : Object.assign(Object.assign({}, projection), { __v: 0, createdAt: 0, updatedAt: 0 }));
650
- if (typeof params.limit === 'number') {
651
- const page = (typeof params.page === 'number') ? params.page : 1;
654
+ if (typeof params.limit === 'number' && params.limit > 0) {
655
+ const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
652
656
  query.limit(params.limit)
653
657
  .skip(params.limit * (page - 1));
654
658
  }
@@ -251,5 +251,5 @@ class RedisRepository {
251
251
  });
252
252
  }
253
253
  }
254
- exports.RedisRepository = RedisRepository;
255
254
  RedisRepository.KEY_PREFIX = 'chevre:itemAvailability:screeningEvent';
255
+ exports.RedisRepository = RedisRepository;
@@ -11,13 +11,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.MongoRepository = void 0;
13
13
  const factory = require("../factory");
14
- const member_1 = require("./mongoose/model/member");
14
+ const onIndexCreated_1 = require("./mongoose/onIndexCreated");
15
+ const member_1 = require("./mongoose/schemas/member");
15
16
  /**
16
17
  * IAMメンバーリポジトリ
17
18
  */
18
19
  class MongoRepository {
19
20
  constructor(connection) {
20
- this.memberModel = connection.model(member_1.modelName);
21
+ this.memberModel = connection.model(member_1.modelName, member_1.schema);
22
+ if (connection.get('autoIndex') === true) {
23
+ this.memberModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
24
+ }
21
25
  }
22
26
  // tslint:disable-next-line:cyclomatic-complexity max-func-body-length
23
27
  static CREATE_MONGO_CONDITIONS(params) {
@@ -114,8 +118,8 @@ class MongoRepository {
114
118
  createdAt: 0,
115
119
  updatedAt: 0
116
120
  });
117
- if (typeof params.limit === 'number') {
118
- const page = (typeof params.page === 'number') ? params.page : 1;
121
+ if (typeof params.limit === 'number' && params.limit > 0) {
122
+ const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
119
123
  query.limit(params.limit)
120
124
  .skip(params.limit * (page - 1));
121
125
  }
@@ -219,12 +223,15 @@ class MongoRepository {
219
223
  const searchConditions = Object.assign({ 'member.id': { $eq: params.member.id } }, (typeof ((_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$regex) === 'string' && params.project.id.$regex.length > 0)
220
224
  ? { 'project.id': { $regex: new RegExp(params.project.id.$regex) } }
221
225
  : undefined);
222
- const projectMembers = yield this.memberModel.find(searchConditions, { project: 1 })
226
+ const query = this.memberModel.find(searchConditions, { project: 1 })
223
227
  // sortを保証する
224
- .sort({ 'project.id': factory.sortType.Ascending })
225
- .limit(params.limit)
226
- .skip(params.limit * (params.page - 1))
227
- .setOptions({ maxTimeMS: 10000 })
228
+ .sort({ 'project.id': factory.sortType.Ascending });
229
+ if (typeof params.limit === 'number' && params.limit > 0) {
230
+ const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
231
+ query.limit(params.limit)
232
+ .skip(params.limit * (page - 1));
233
+ }
234
+ const projectMembers = yield query.setOptions({ maxTimeMS: 10000 })
228
235
  .exec()
229
236
  .then((docs) => docs.map((doc) => doc.toObject()));
230
237
  return projectMembers.map((m) => m.project.id);
@@ -23,9 +23,7 @@
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
25
  import { Connection } from 'mongoose';
26
- import { modelName } from './mongoose/model/merchantReturnPolicy';
27
26
  import * as factory from '../factory';
28
- export { modelName };
29
27
  /**
30
28
  * 返品ポリシーリポジトリ
31
29
  */
@@ -20,16 +20,19 @@ var __rest = (this && this.__rest) || function (s, e) {
20
20
  return t;
21
21
  };
22
22
  Object.defineProperty(exports, "__esModule", { value: true });
23
- exports.MongoRepository = exports.modelName = void 0;
24
- const merchantReturnPolicy_1 = require("./mongoose/model/merchantReturnPolicy");
25
- Object.defineProperty(exports, "modelName", { enumerable: true, get: function () { return merchantReturnPolicy_1.modelName; } });
23
+ exports.MongoRepository = void 0;
24
+ const onIndexCreated_1 = require("./mongoose/onIndexCreated");
25
+ const merchantReturnPolicy_1 = require("./mongoose/schemas/merchantReturnPolicy");
26
26
  const factory = require("../factory");
27
27
  /**
28
28
  * 返品ポリシーリポジトリ
29
29
  */
30
30
  class MongoRepository {
31
31
  constructor(connection) {
32
- this.merchantReturnPolicyModel = connection.model(merchantReturnPolicy_1.modelName);
32
+ this.merchantReturnPolicyModel = connection.model(merchantReturnPolicy_1.modelName, merchantReturnPolicy_1.schema);
33
+ if (connection.get('autoIndex') === true) {
34
+ this.merchantReturnPolicyModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
35
+ }
33
36
  }
34
37
  // tslint:disable-next-line:max-func-body-length
35
38
  static CREATE_MONGO_CONDITIONS(params) {
@@ -135,8 +138,8 @@ class MongoRepository {
135
138
  createdAt: 0,
136
139
  updatedAt: 0
137
140
  });
138
- if (typeof params.limit === 'number') {
139
- const page = (typeof params.page === 'number') ? params.page : 1;
141
+ if (typeof params.limit === 'number' && params.limit > 0) {
142
+ const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
140
143
  query.limit(params.limit)
141
144
  .skip(params.limit * (page - 1));
142
145
  }
@@ -0,0 +1,2 @@
1
+ export declare const INDEX_EVENT = "index";
2
+ export declare function onIndexCreated(error: any): void;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.onIndexCreated = exports.INDEX_EVENT = void 0;
4
+ exports.INDEX_EVENT = 'index';
5
+ function onIndexCreated(error) {
6
+ if (error !== undefined) {
7
+ // tslint:disable-next-line:no-console
8
+ console.error('index event emitted.', error);
9
+ }
10
+ }
11
+ exports.onIndexCreated = onIndexCreated;
@@ -0,0 +1,54 @@
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';
26
+ declare const modelName = "Account";
27
+ /**
28
+ * 口座スキーマ
29
+ */
30
+ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").ResolveSchemaOptions<{
31
+ collection: string;
32
+ id: true;
33
+ read: string;
34
+ writeConcern: import("mongodb").WriteConcern;
35
+ strict: false;
36
+ useNestedStrict: boolean;
37
+ timestamps: {
38
+ createdAt: string;
39
+ updatedAt: string;
40
+ };
41
+ toJSON: {
42
+ getters: false;
43
+ virtuals: false;
44
+ minimize: false;
45
+ versionKey: false;
46
+ };
47
+ toObject: {
48
+ getters: false;
49
+ virtuals: true;
50
+ minimize: false;
51
+ versionKey: false;
52
+ };
53
+ }>, {}>;
54
+ export { modelName, schema };
@@ -1,18 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.schema = exports.modelName = void 0;
4
- const mongoose = require("mongoose");
4
+ const mongoose_1 = require("mongoose");
5
+ const writeConcern_1 = require("../writeConcern");
5
6
  const modelName = 'Account';
6
7
  exports.modelName = modelName;
7
- const writeConcern = { j: true, w: 'majority', wtimeout: 10000 };
8
8
  /**
9
9
  * 口座スキーマ
10
10
  */
11
- const schema = new mongoose.Schema({}, {
11
+ const schema = new mongoose_1.Schema({}, {
12
12
  collection: 'accounts',
13
13
  id: true,
14
14
  read: 'primaryPreferred',
15
- writeConcern: writeConcern,
15
+ writeConcern: writeConcern_1.writeConcern,
16
16
  strict: false,
17
17
  useNestedStrict: true,
18
18
  timestamps: {
@@ -58,13 +58,3 @@ schema.index({ name: 1, openDate: -1 }, { name: 'searchByName-v2' });
58
58
  schema.index({ openDate: -1 }, { name: 'searchByOpenDate-v2' });
59
59
  schema.index({ status: 1, openDate: -1 }, { name: 'searchByStatus-v2' });
60
60
  schema.index({ accountType: 1, accountNumber: 1, status: 1 }, { name: 'authorizeAmount' });
61
- mongoose.model(modelName, schema)
62
- .on('index',
63
- // tslint:disable-next-line:no-single-line-block-comment
64
- /* istanbul ignore next */
65
- (error) => {
66
- if (error !== undefined) {
67
- // tslint:disable-next-line:no-console
68
- console.error(error);
69
- }
70
- });
@@ -0,0 +1,64 @@
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';
26
+ declare const modelName = "AccountTitle";
27
+ /**
28
+ * 勘定科目スキーマ
29
+ */
30
+ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").ResolveSchemaOptions<{
31
+ collection: string;
32
+ id: true;
33
+ read: string;
34
+ writeConcern: import("mongodb").WriteConcern;
35
+ timestamps: {
36
+ createdAt: string;
37
+ updatedAt: string;
38
+ };
39
+ toJSON: {
40
+ getters: false;
41
+ virtuals: false;
42
+ minimize: false;
43
+ versionKey: false;
44
+ };
45
+ toObject: {
46
+ getters: false;
47
+ virtuals: true;
48
+ minimize: false;
49
+ versionKey: false;
50
+ };
51
+ }>, {
52
+ typeOf: string;
53
+ name?: string | undefined;
54
+ project?: any;
55
+ codeValue?: string | undefined;
56
+ alternateName?: string | undefined;
57
+ description?: string | undefined;
58
+ inCodeSet?: any;
59
+ hasCategoryCode?: any;
60
+ inDefinedTermSet?: any;
61
+ hasDefinedTerm?: any;
62
+ additionalProperty?: any;
63
+ }>;
64
+ export { modelName, schema };
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.schema = exports.modelName = void 0;
4
- const mongoose = require("mongoose");
4
+ const mongoose_1 = require("mongoose");
5
+ const writeConcern_1 = require("../writeConcern");
5
6
  const modelName = 'AccountTitle';
6
7
  exports.modelName = modelName;
7
- const writeConcern = { j: true, w: 'majority', wtimeout: 10000 };
8
8
  /**
9
9
  * 勘定科目スキーマ
10
10
  */
11
- const schema = new mongoose.Schema({
12
- project: mongoose.SchemaTypes.Mixed,
11
+ const schema = new mongoose_1.Schema({
12
+ project: mongoose_1.SchemaTypes.Mixed,
13
13
  typeOf: {
14
14
  type: String,
15
15
  required: true
@@ -18,16 +18,16 @@ const schema = new mongoose.Schema({
18
18
  alternateName: String,
19
19
  name: String,
20
20
  description: String,
21
- inCodeSet: mongoose.SchemaTypes.Mixed,
22
- hasCategoryCode: mongoose.SchemaTypes.Mixed,
23
- inDefinedTermSet: mongoose.SchemaTypes.Mixed,
24
- hasDefinedTerm: mongoose.SchemaTypes.Mixed,
25
- additionalProperty: mongoose.SchemaTypes.Mixed
21
+ inCodeSet: mongoose_1.SchemaTypes.Mixed,
22
+ hasCategoryCode: mongoose_1.SchemaTypes.Mixed,
23
+ inDefinedTermSet: mongoose_1.SchemaTypes.Mixed,
24
+ hasDefinedTerm: mongoose_1.SchemaTypes.Mixed,
25
+ additionalProperty: mongoose_1.SchemaTypes.Mixed
26
26
  }, {
27
27
  collection: 'accountTitles',
28
28
  id: true,
29
29
  read: 'primaryPreferred',
30
- writeConcern: writeConcern,
30
+ writeConcern: writeConcern_1.writeConcern,
31
31
  timestamps: {
32
32
  createdAt: 'createdAt',
33
33
  updatedAt: 'updatedAt'
@@ -83,28 +83,3 @@ schema.index({ 'project.id': 1, 'hasCategoryCode.codeValue': 1 }, {
83
83
  'hasCategoryCode.codeValue': { $exists: true }
84
84
  }
85
85
  });
86
- // 'hasCategoryCode.hasCategoryCode.codeValue': null のインデックスは作成されてうまくいかないので保留
87
- // schema.index(
88
- // {
89
- // 'project.id': 1,
90
- // 'hasCategoryCode.hasCategoryCode.codeValue': 1
91
- // },
92
- // {
93
- // name: 'uniqueHasCategoryCodeHasCategoryCodeCodeValue',
94
- // unique: true,
95
- // partialFilterExpression: {
96
- // 'project.id': { $exists: true },
97
- // 'hasCategoryCode.hasCategoryCode.codeValue': { $exists: true }
98
- // }
99
- // }
100
- // );
101
- mongoose.model(modelName, schema)
102
- .on('index',
103
- // tslint:disable-next-line:no-single-line-block-comment
104
- /* istanbul ignore next */
105
- (error) => {
106
- if (error !== undefined) {
107
- // tslint:disable-next-line:no-console
108
- console.error(error);
109
- }
110
- });
@@ -0,0 +1,67 @@
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';
26
+ declare const modelName = "AccountTransaction";
27
+ /**
28
+ * 口座取引スキーマ
29
+ */
30
+ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").ResolveSchemaOptions<{
31
+ collection: string;
32
+ id: true;
33
+ read: string;
34
+ writeConcern: import("mongodb").WriteConcern;
35
+ strict: true;
36
+ useNestedStrict: boolean;
37
+ timestamps: {
38
+ createdAt: string;
39
+ updatedAt: string;
40
+ };
41
+ toJSON: {
42
+ getters: false;
43
+ virtuals: false;
44
+ minimize: false;
45
+ versionKey: false;
46
+ };
47
+ toObject: {
48
+ getters: false;
49
+ virtuals: true;
50
+ minimize: false;
51
+ versionKey: false;
52
+ };
53
+ }>, {
54
+ typeOf: string;
55
+ status: string;
56
+ transactionNumber: string;
57
+ object?: any;
58
+ expires?: Date | undefined;
59
+ project?: any;
60
+ identifier?: string | undefined;
61
+ agent?: any;
62
+ recipient?: any;
63
+ startDate?: Date | undefined;
64
+ endDate?: Date | undefined;
65
+ potentialActions?: any;
66
+ }>;
67
+ export { modelName, schema };
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.schema = exports.modelName = void 0;
4
- const mongoose = require("mongoose");
4
+ const mongoose_1 = require("mongoose");
5
+ const writeConcern_1 = require("../writeConcern");
5
6
  const modelName = 'AccountTransaction';
6
7
  exports.modelName = modelName;
7
- const writeConcern = { j: true, w: 'majority', wtimeout: 10000 };
8
8
  /**
9
9
  * 口座取引スキーマ
10
10
  */
11
- const schema = new mongoose.Schema({
12
- project: mongoose.SchemaTypes.Mixed,
11
+ const schema = new mongoose_1.Schema({
12
+ project: mongoose_1.SchemaTypes.Mixed,
13
13
  status: {
14
14
  type: String,
15
15
  required: true
@@ -23,18 +23,18 @@ const schema = new mongoose.Schema({
23
23
  type: String,
24
24
  required: true
25
25
  },
26
- agent: mongoose.SchemaTypes.Mixed,
27
- recipient: mongoose.SchemaTypes.Mixed,
28
- object: mongoose.SchemaTypes.Mixed,
26
+ agent: mongoose_1.SchemaTypes.Mixed,
27
+ recipient: mongoose_1.SchemaTypes.Mixed,
28
+ object: mongoose_1.SchemaTypes.Mixed,
29
29
  expires: Date,
30
30
  startDate: Date,
31
31
  endDate: Date,
32
- potentialActions: mongoose.SchemaTypes.Mixed
32
+ potentialActions: mongoose_1.SchemaTypes.Mixed
33
33
  }, {
34
34
  collection: 'accountTransactions',
35
35
  id: true,
36
36
  read: 'primaryPreferred',
37
- writeConcern: writeConcern,
37
+ writeConcern: writeConcern_1.writeConcern,
38
38
  strict: true,
39
39
  useNestedStrict: true,
40
40
  timestamps: {
@@ -109,13 +109,3 @@ schema.index({ tasksExportationStatus: 1, updatedAt: 1 }, {
109
109
  schema.index({ status: 1, expires: 1 }, {
110
110
  name: 'makeExpired'
111
111
  });
112
- mongoose.model(modelName, schema)
113
- .on('index',
114
- // tslint:disable-next-line:no-single-line-block-comment
115
- /* istanbul ignore next */
116
- (error) => {
117
- if (error !== undefined) {
118
- // tslint:disable-next-line:no-console
119
- console.error(error);
120
- }
121
- });
@@ -0,0 +1,58 @@
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';
26
+ declare const modelName = "AccountingReport";
27
+ /**
28
+ * 経理レポートスキーマ
29
+ */
30
+ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").ResolveSchemaOptions<{
31
+ collection: string;
32
+ id: true;
33
+ read: string;
34
+ writeConcern: import("mongodb").WriteConcern;
35
+ strict: false;
36
+ useNestedStrict: boolean;
37
+ timestamps: {
38
+ createdAt: string;
39
+ updatedAt: string;
40
+ };
41
+ toJSON: {
42
+ getters: false;
43
+ virtuals: false;
44
+ minimize: false;
45
+ versionKey: false;
46
+ };
47
+ toObject: {
48
+ getters: false;
49
+ virtuals: true;
50
+ minimize: false;
51
+ versionKey: false;
52
+ };
53
+ }>, {
54
+ hasPart: (typeof Schema.Types.Mixed)[];
55
+ mainEntity: typeof Schema.Types.Mixed;
56
+ project: typeof Schema.Types.Mixed;
57
+ }>;
58
+ export { modelName, schema };
@@ -1,22 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.schema = exports.modelName = void 0;
4
- const mongoose = require("mongoose");
4
+ const mongoose_1 = require("mongoose");
5
+ const writeConcern_1 = require("../writeConcern");
5
6
  const modelName = 'AccountingReport';
6
7
  exports.modelName = modelName;
7
- const writeConcern = { j: true, w: 'majority', wtimeout: 10000 };
8
8
  /**
9
9
  * 経理レポートスキーマ
10
10
  */
11
- const schema = new mongoose.Schema({
12
- hasPart: [mongoose.SchemaTypes.Mixed],
13
- mainEntity: mongoose.SchemaTypes.Mixed,
14
- project: mongoose.SchemaTypes.Mixed
11
+ const schema = new mongoose_1.Schema({
12
+ hasPart: [mongoose_1.SchemaTypes.Mixed],
13
+ mainEntity: mongoose_1.SchemaTypes.Mixed,
14
+ project: mongoose_1.SchemaTypes.Mixed
15
15
  }, {
16
16
  collection: 'accountingReports',
17
17
  id: true,
18
18
  read: 'primaryPreferred',
19
- writeConcern: writeConcern,
19
+ writeConcern: writeConcern_1.writeConcern,
20
20
  strict: false,
21
21
  useNestedStrict: true,
22
22
  timestamps: {
@@ -92,13 +92,3 @@ schema.index({ 'mainEntity.acceptedOffers.itemOffered.reservationFor.startDate':
92
92
  'mainEntity.acceptedOffers.itemOffered.reservationFor.startDate': { $exists: true }
93
93
  }
94
94
  });
95
- mongoose.model(modelName, schema)
96
- .on('index',
97
- // tslint:disable-next-line:no-single-line-block-comment
98
- /* istanbul ignore next */
99
- (error) => {
100
- if (error !== undefined) {
101
- // tslint:disable-next-line:no-console
102
- console.error(error);
103
- }
104
- });