@chevre/domain 21.0.0-alpha.8 → 21.0.0

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 (227) 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/repo/account.d.ts +0 -2
  5. package/lib/chevre/repo/account.js +6 -3
  6. package/lib/chevre/repo/accountTitle.js +5 -1
  7. package/lib/chevre/repo/accountTransaction.d.ts +0 -2
  8. package/lib/chevre/repo/accountTransaction.js +6 -3
  9. package/lib/chevre/repo/accountingReport.d.ts +1 -1
  10. package/lib/chevre/repo/accountingReport.js +6 -2
  11. package/lib/chevre/repo/action/registerServiceInProgress.js +1 -1
  12. package/lib/chevre/repo/action.d.ts +3 -4
  13. package/lib/chevre/repo/action.js +6 -3
  14. package/lib/chevre/repo/additionalProperty.js +5 -1
  15. package/lib/chevre/repo/aggregation.js +5 -1
  16. package/lib/chevre/repo/assetTransaction.d.ts +1 -2
  17. package/lib/chevre/repo/assetTransaction.js +6 -3
  18. package/lib/chevre/repo/categoryCode.js +5 -1
  19. package/lib/chevre/repo/code.d.ts +3 -3
  20. package/lib/chevre/repo/code.js +5 -1
  21. package/lib/chevre/repo/comment.js +5 -1
  22. package/lib/chevre/repo/confirmationNumber.js +1 -1
  23. package/lib/chevre/repo/creativeWork.d.ts +0 -2
  24. package/lib/chevre/repo/creativeWork.js +6 -3
  25. package/lib/chevre/repo/customer.js +5 -1
  26. package/lib/chevre/repo/emailMessage.d.ts +1 -1
  27. package/lib/chevre/repo/emailMessage.js +5 -1
  28. package/lib/chevre/repo/event.d.ts +7 -1
  29. package/lib/chevre/repo/event.js +104 -27
  30. package/lib/chevre/repo/itemAvailability/screeningEvent.js +1 -1
  31. package/lib/chevre/repo/member.js +5 -1
  32. package/lib/chevre/repo/merchantReturnPolicy.d.ts +0 -2
  33. package/lib/chevre/repo/merchantReturnPolicy.js +6 -3
  34. package/lib/chevre/repo/mongoose/onIndexCreated.d.ts +2 -0
  35. package/lib/chevre/repo/mongoose/onIndexCreated.js +11 -0
  36. package/lib/chevre/repo/mongoose/{model → schemas}/event.js +23 -0
  37. package/lib/chevre/repo/offer.js +7 -2
  38. package/lib/chevre/repo/offerCatalog.js +5 -1
  39. package/lib/chevre/repo/order.d.ts +0 -2
  40. package/lib/chevre/repo/order.js +7 -4
  41. package/lib/chevre/repo/orderNumber.js +1 -1
  42. package/lib/chevre/repo/ownershipInfo.d.ts +1 -3
  43. package/lib/chevre/repo/ownershipInfo.js +7 -4
  44. package/lib/chevre/repo/paymentMethod/creditCard.d.ts +3 -3
  45. package/lib/chevre/repo/permit.js +5 -1
  46. package/lib/chevre/repo/person.d.ts +2 -2
  47. package/lib/chevre/repo/place.d.ts +2 -2
  48. package/lib/chevre/repo/place.js +5 -1
  49. package/lib/chevre/repo/priceSpecification.js +5 -1
  50. package/lib/chevre/repo/product.d.ts +1 -1
  51. package/lib/chevre/repo/product.js +5 -1
  52. package/lib/chevre/repo/project.js +5 -1
  53. package/lib/chevre/repo/rateLimit/offer.js +1 -1
  54. package/lib/chevre/repo/reservation.d.ts +1 -1
  55. package/lib/chevre/repo/reservation.js +5 -1
  56. package/lib/chevre/repo/role.js +5 -1
  57. package/lib/chevre/repo/seller.d.ts +1 -1
  58. package/lib/chevre/repo/seller.js +5 -1
  59. package/lib/chevre/repo/serviceOutput.js +5 -1
  60. package/lib/chevre/repo/serviceOutputIdentifier.js +1 -1
  61. package/lib/chevre/repo/task.js +5 -1
  62. package/lib/chevre/repo/telemetry.js +5 -1
  63. package/lib/chevre/repo/transaction.d.ts +1 -2
  64. package/lib/chevre/repo/transaction.js +6 -3
  65. package/lib/chevre/repo/transactionNumber.js +1 -1
  66. package/lib/chevre/repo/trip.d.ts +1 -1
  67. package/lib/chevre/repo/trip.js +5 -1
  68. package/lib/chevre/service/account.d.ts +1 -1
  69. package/lib/chevre/service/accountTransaction/deposit.d.ts +1 -1
  70. package/lib/chevre/service/accountTransaction/deposit.js +0 -5
  71. package/lib/chevre/service/accountTransaction/transfer.d.ts +1 -1
  72. package/lib/chevre/service/accountTransaction/transfer.js +0 -5
  73. package/lib/chevre/service/accountTransaction/withdraw.d.ts +1 -1
  74. package/lib/chevre/service/accountTransaction/withdraw.js +0 -5
  75. package/lib/chevre/service/accountTransaction.d.ts +1 -1
  76. package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.d.ts +1 -1
  77. package/lib/chevre/service/aggregation/event/aggregateUseActionsOnEvent.d.ts +1 -1
  78. package/lib/chevre/service/aggregation/project.d.ts +1 -1
  79. package/lib/chevre/service/assetTransaction/cancelReservation.d.ts +3 -3
  80. package/lib/chevre/service/assetTransaction/moneyTransfer.d.ts +4 -4
  81. package/lib/chevre/service/assetTransaction/moneyTransfer.js +0 -5
  82. package/lib/chevre/service/assetTransaction/pay/potentialActions.d.ts +1 -1
  83. package/lib/chevre/service/assetTransaction/pay.d.ts +7 -7
  84. package/lib/chevre/service/assetTransaction/refund.d.ts +4 -4
  85. package/lib/chevre/service/assetTransaction/refund.js +0 -5
  86. package/lib/chevre/service/assetTransaction/registerService/factory.d.ts +1 -1
  87. package/lib/chevre/service/assetTransaction/registerService.d.ts +4 -4
  88. package/lib/chevre/service/assetTransaction/registerService.js +0 -5
  89. package/lib/chevre/service/assetTransaction/reserve/factory/price.d.ts +1 -1
  90. package/lib/chevre/service/assetTransaction/reserve/factory.d.ts +2 -2
  91. package/lib/chevre/service/assetTransaction/reserve.d.ts +6 -6
  92. package/lib/chevre/service/assetTransaction/reserve.js +0 -10
  93. package/lib/chevre/service/code.d.ts +2 -2
  94. package/lib/chevre/service/code.js +6 -1
  95. package/lib/chevre/service/delivery/factory.d.ts +1 -1
  96. package/lib/chevre/service/delivery/product/factory.d.ts +1 -1
  97. package/lib/chevre/service/delivery/reservation/factory.d.ts +1 -1
  98. package/lib/chevre/service/iam.d.ts +1 -1
  99. package/lib/chevre/service/moneyTransfer.d.ts +1 -1
  100. package/lib/chevre/service/notification.d.ts +1 -1
  101. package/lib/chevre/service/offer/event/authorize.d.ts +2 -2
  102. package/lib/chevre/service/offer/event/factory.d.ts +5 -5
  103. package/lib/chevre/service/offer/event/searchEventTicketOffers.d.ts +2 -2
  104. package/lib/chevre/service/offer/eventServiceByCOA/factory.d.ts +2 -2
  105. package/lib/chevre/service/offer/eventServiceByCOA/validateAcceptedOffers.d.ts +1 -1
  106. package/lib/chevre/service/offer/eventServiceByCOA.d.ts +2 -2
  107. package/lib/chevre/service/offer/factory.d.ts +2 -2
  108. package/lib/chevre/service/offer/moneyTransfer/authorize.d.ts +1 -1
  109. package/lib/chevre/service/offer/product.d.ts +2 -2
  110. package/lib/chevre/service/order/onOrderStatusChanged/factory.d.ts +1 -1
  111. package/lib/chevre/service/order/onOrderStatusChanged/factory.js +6 -1
  112. package/lib/chevre/service/order/onOrderStatusChanged.d.ts +2 -2
  113. package/lib/chevre/service/order/placeOrder.d.ts +1 -1
  114. package/lib/chevre/service/order/sendOrder.d.ts +1 -1
  115. package/lib/chevre/service/payment/any/factory.d.ts +1 -1
  116. package/lib/chevre/service/payment/any/onPaymentStatusChanged/onPaid.d.ts +1 -1
  117. package/lib/chevre/service/payment/any/onPaymentStatusChanged/onRefunded.d.ts +1 -1
  118. package/lib/chevre/service/payment/any.d.ts +3 -3
  119. package/lib/chevre/service/payment/creditCard.js +5 -0
  120. package/lib/chevre/service/payment/movieTicket.d.ts +4 -4
  121. package/lib/chevre/service/payment/paymentCard.d.ts +1 -1
  122. package/lib/chevre/service/permit.d.ts +1 -1
  123. package/lib/chevre/service/report/telemetry.d.ts +7 -7
  124. package/lib/chevre/service/reserve/cancelReservation.d.ts +1 -1
  125. package/lib/chevre/service/reserve/factory.d.ts +5 -5
  126. package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.d.ts +1 -1
  127. package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.d.ts +1 -1
  128. package/lib/chevre/service/reserve/potentialActions/onReservationUsed.d.ts +2 -2
  129. package/lib/chevre/service/task/aggregateScreeningEvent.d.ts +1 -1
  130. package/lib/chevre/service/task/aggregateUseActionsOnEvent.d.ts +1 -1
  131. package/lib/chevre/service/task/cancelMoneyTransfer.d.ts +1 -1
  132. package/lib/chevre/service/task/cancelPendingReservation.d.ts +1 -1
  133. package/lib/chevre/service/task/cancelReservation.d.ts +1 -1
  134. package/lib/chevre/service/task/importEventCapacitiesFromCOA.d.ts +1 -1
  135. package/lib/chevre/service/task/importEventsFromCOA.d.ts +1 -1
  136. package/lib/chevre/service/task/importOffersFromCOA.d.ts +1 -1
  137. package/lib/chevre/service/task/moneyTransfer.d.ts +1 -1
  138. package/lib/chevre/service/task/registerService.d.ts +1 -1
  139. package/lib/chevre/service/task/reserve.d.ts +1 -1
  140. package/lib/chevre/service/task.d.ts +2 -2
  141. package/lib/chevre/service/task.js +1 -1
  142. package/lib/chevre/service/transaction/moneyTransfer/potentialActions.d.ts +1 -1
  143. package/lib/chevre/service/transaction/moneyTransfer.d.ts +6 -6
  144. package/lib/chevre/service/transaction/moneyTransfer.js +0 -5
  145. package/lib/chevre/service/transaction/orderProgramMembership.d.ts +1 -1
  146. package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.d.ts +1 -1
  147. package/lib/chevre/service/transaction/placeOrder.d.ts +1 -1
  148. package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/moneyTransfer.d.ts +1 -1
  149. package/lib/chevre/service/transaction/placeOrderInProgress/result/acceptedOffers.d.ts +2 -2
  150. package/lib/chevre/service/transaction/placeOrderInProgress/result.d.ts +1 -1
  151. package/lib/chevre/service/transaction/placeOrderInProgress/validation.d.ts +8 -8
  152. package/lib/chevre/service/transaction/placeOrderInProgress.d.ts +7 -7
  153. package/lib/chevre/service/transaction/placeOrderInProgress.js +2 -2
  154. package/lib/chevre/service/transaction/returnOrder/potentialActions/returnMoneyTransfer.d.ts +1 -1
  155. package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPointAward.d.ts +1 -1
  156. package/lib/chevre/service/transaction/returnOrder/potentialActions.d.ts +1 -1
  157. package/lib/chevre/service/transaction/returnOrder.d.ts +2 -2
  158. package/lib/chevre/service/transaction/returnOrder.js +1 -1
  159. package/lib/chevre/service/transaction/validation.d.ts +2 -2
  160. package/lib/chevre/service/transaction.d.ts +2 -2
  161. package/lib/chevre/settings.d.ts +1 -1
  162. package/package.json +12 -12
  163. /package/lib/chevre/repo/mongoose/{model → schemas}/account.d.ts +0 -0
  164. /package/lib/chevre/repo/mongoose/{model → schemas}/account.js +0 -0
  165. /package/lib/chevre/repo/mongoose/{model → schemas}/accountTitle.d.ts +0 -0
  166. /package/lib/chevre/repo/mongoose/{model → schemas}/accountTitle.js +0 -0
  167. /package/lib/chevre/repo/mongoose/{model → schemas}/accountTransaction.d.ts +0 -0
  168. /package/lib/chevre/repo/mongoose/{model → schemas}/accountTransaction.js +0 -0
  169. /package/lib/chevre/repo/mongoose/{model → schemas}/accountingReport.d.ts +0 -0
  170. /package/lib/chevre/repo/mongoose/{model → schemas}/accountingReport.js +0 -0
  171. /package/lib/chevre/repo/mongoose/{model → schemas}/action.d.ts +0 -0
  172. /package/lib/chevre/repo/mongoose/{model → schemas}/action.js +0 -0
  173. /package/lib/chevre/repo/mongoose/{model → schemas}/additionalProperty.d.ts +0 -0
  174. /package/lib/chevre/repo/mongoose/{model → schemas}/additionalProperty.js +0 -0
  175. /package/lib/chevre/repo/mongoose/{model → schemas}/aggregation.d.ts +0 -0
  176. /package/lib/chevre/repo/mongoose/{model → schemas}/aggregation.js +0 -0
  177. /package/lib/chevre/repo/mongoose/{model → schemas}/assetTransaction.d.ts +0 -0
  178. /package/lib/chevre/repo/mongoose/{model → schemas}/assetTransaction.js +0 -0
  179. /package/lib/chevre/repo/mongoose/{model → schemas}/authorization.d.ts +0 -0
  180. /package/lib/chevre/repo/mongoose/{model → schemas}/authorization.js +0 -0
  181. /package/lib/chevre/repo/mongoose/{model → schemas}/categoryCode.d.ts +0 -0
  182. /package/lib/chevre/repo/mongoose/{model → schemas}/categoryCode.js +0 -0
  183. /package/lib/chevre/repo/mongoose/{model → schemas}/comments.d.ts +0 -0
  184. /package/lib/chevre/repo/mongoose/{model → schemas}/comments.js +0 -0
  185. /package/lib/chevre/repo/mongoose/{model → schemas}/creativeWork.d.ts +0 -0
  186. /package/lib/chevre/repo/mongoose/{model → schemas}/creativeWork.js +0 -0
  187. /package/lib/chevre/repo/mongoose/{model → schemas}/customer.d.ts +0 -0
  188. /package/lib/chevre/repo/mongoose/{model → schemas}/customer.js +0 -0
  189. /package/lib/chevre/repo/mongoose/{model → schemas}/emailMessages.d.ts +0 -0
  190. /package/lib/chevre/repo/mongoose/{model → schemas}/emailMessages.js +0 -0
  191. /package/lib/chevre/repo/mongoose/{model → schemas}/event.d.ts +0 -0
  192. /package/lib/chevre/repo/mongoose/{model → schemas}/member.d.ts +0 -0
  193. /package/lib/chevre/repo/mongoose/{model → schemas}/member.js +0 -0
  194. /package/lib/chevre/repo/mongoose/{model → schemas}/merchantReturnPolicy.d.ts +0 -0
  195. /package/lib/chevre/repo/mongoose/{model → schemas}/merchantReturnPolicy.js +0 -0
  196. /package/lib/chevre/repo/mongoose/{model → schemas}/offer.d.ts +0 -0
  197. /package/lib/chevre/repo/mongoose/{model → schemas}/offer.js +0 -0
  198. /package/lib/chevre/repo/mongoose/{model → schemas}/offerCatalog.d.ts +0 -0
  199. /package/lib/chevre/repo/mongoose/{model → schemas}/offerCatalog.js +0 -0
  200. /package/lib/chevre/repo/mongoose/{model → schemas}/order.d.ts +0 -0
  201. /package/lib/chevre/repo/mongoose/{model → schemas}/order.js +0 -0
  202. /package/lib/chevre/repo/mongoose/{model → schemas}/ownershipInfo.d.ts +0 -0
  203. /package/lib/chevre/repo/mongoose/{model → schemas}/ownershipInfo.js +0 -0
  204. /package/lib/chevre/repo/mongoose/{model → schemas}/place.d.ts +0 -0
  205. /package/lib/chevre/repo/mongoose/{model → schemas}/place.js +0 -0
  206. /package/lib/chevre/repo/mongoose/{model → schemas}/priceSpecification.d.ts +0 -0
  207. /package/lib/chevre/repo/mongoose/{model → schemas}/priceSpecification.js +0 -0
  208. /package/lib/chevre/repo/mongoose/{model → schemas}/product.d.ts +0 -0
  209. /package/lib/chevre/repo/mongoose/{model → schemas}/product.js +0 -0
  210. /package/lib/chevre/repo/mongoose/{model → schemas}/project.d.ts +0 -0
  211. /package/lib/chevre/repo/mongoose/{model → schemas}/project.js +0 -0
  212. /package/lib/chevre/repo/mongoose/{model → schemas}/reservation.d.ts +0 -0
  213. /package/lib/chevre/repo/mongoose/{model → schemas}/reservation.js +0 -0
  214. /package/lib/chevre/repo/mongoose/{model → schemas}/role.d.ts +0 -0
  215. /package/lib/chevre/repo/mongoose/{model → schemas}/role.js +0 -0
  216. /package/lib/chevre/repo/mongoose/{model → schemas}/seller.d.ts +0 -0
  217. /package/lib/chevre/repo/mongoose/{model → schemas}/seller.js +0 -0
  218. /package/lib/chevre/repo/mongoose/{model → schemas}/serviceOutput.d.ts +0 -0
  219. /package/lib/chevre/repo/mongoose/{model → schemas}/serviceOutput.js +0 -0
  220. /package/lib/chevre/repo/mongoose/{model → schemas}/task.d.ts +0 -0
  221. /package/lib/chevre/repo/mongoose/{model → schemas}/task.js +0 -0
  222. /package/lib/chevre/repo/mongoose/{model → schemas}/telemetry.d.ts +0 -0
  223. /package/lib/chevre/repo/mongoose/{model → schemas}/telemetry.js +0 -0
  224. /package/lib/chevre/repo/mongoose/{model → schemas}/transaction.d.ts +0 -0
  225. /package/lib/chevre/repo/mongoose/{model → schemas}/transaction.js +0 -0
  226. /package/lib/chevre/repo/mongoose/{model → schemas}/trip.d.ts +0 -0
  227. /package/lib/chevre/repo/mongoose/{model → schemas}/trip.js +0 -0
@@ -3,6 +3,7 @@ export declare enum MongoErrorCode {
3
3
  MaxTimeMSExpired = 50,
4
4
  ExceededTimeLimit = 262
5
5
  }
6
+ export declare function isMongoError(error: unknown): boolean;
6
7
  export declare function handleMongoError(error: unknown): unknown;
7
8
  /**
8
9
  * 汎用的なCOAエラーハンドリング
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.handleAWSError = exports.handleMvtkReserveError = exports.handlePecorinoError = exports.handleCOAError = exports.handleMongoError = exports.MongoErrorCode = void 0;
3
+ exports.handleAWSError = exports.handleMvtkReserveError = exports.handlePecorinoError = exports.handleCOAError = exports.handleMongoError = exports.isMongoError = exports.MongoErrorCode = void 0;
4
4
  /**
5
5
  * エラーハンドラー
6
6
  * 外部サービスと連携している場合に、サービス(API)のエラーを本ドメインのエラーに変換する責任を担います。
@@ -14,9 +14,13 @@ var MongoErrorCode;
14
14
  MongoErrorCode[MongoErrorCode["MaxTimeMSExpired"] = 50] = "MaxTimeMSExpired";
15
15
  MongoErrorCode[MongoErrorCode["ExceededTimeLimit"] = 262] = "ExceededTimeLimit";
16
16
  })(MongoErrorCode = exports.MongoErrorCode || (exports.MongoErrorCode = {}));
17
+ function isMongoError(error) {
18
+ return (error instanceof mongoose_1.mongo.MongoError || error instanceof mongoose_1.mongo.MongoServerError);
19
+ }
20
+ exports.isMongoError = isMongoError;
17
21
  function handleMongoError(error) {
18
22
  let handledError = error;
19
- if (handledError instanceof mongoose_1.mongo.MongoError) {
23
+ if (handledError instanceof mongoose_1.mongo.MongoError || handledError instanceof mongoose_1.mongo.MongoServerError) {
20
24
  switch (handledError.code) {
21
25
  case MongoErrorCode.DuplicateKey:
22
26
  handledError = new factory_1.errors.AlreadyInUse('', [], `Some fields already in use. code:${handledError.code} message:${handledError.message}`);
@@ -1,2 +1,2 @@
1
1
  import * as factory from '../factory';
2
- export declare type IMinimizedIndividualEvent<T extends factory.eventType.ScreeningEvent | factory.eventType.Event> = T extends factory.eventType.ScreeningEvent ? Pick<factory.event.IEvent<T>, 'project' | 'id' | 'typeOf' | 'additionalProperty' | 'name' | 'doorTime' | 'endDate' | 'eventStatus' | 'location' | 'startDate' | 'superEvent' | 'offers' | 'coaInfo' | 'identifier'> : T extends factory.eventType.Event ? Pick<factory.event.IEvent<T>, 'project' | 'id' | 'typeOf' | 'additionalProperty' | 'name' | 'doorTime' | 'endDate' | 'eventStatus' | 'location' | 'startDate' | 'offers'> : never;
2
+ export type IMinimizedIndividualEvent<T extends factory.eventType.ScreeningEvent | factory.eventType.Event> = T extends factory.eventType.ScreeningEvent ? Pick<factory.event.IEvent<T>, 'project' | 'id' | 'typeOf' | 'additionalProperty' | 'name' | 'doorTime' | 'endDate' | 'eventStatus' | 'location' | 'startDate' | 'superEvent' | 'offers' | 'coaInfo' | 'identifier'> : T extends factory.eventType.Event ? Pick<factory.event.IEvent<T>, 'project' | 'id' | 'typeOf' | 'additionalProperty' | 'name' | 'doorTime' | 'endDate' | 'eventStatus' | 'location' | 'startDate' | 'offers'> : never;
@@ -1,7 +1,5 @@
1
1
  import { Connection } from 'mongoose';
2
- import { modelName } from './mongoose/model/account';
3
2
  import * as factory from '../factory';
4
- export { modelName };
5
3
  /**
6
4
  * 口座リポジトリ
7
5
  */
@@ -9,9 +9,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.MongoRepository = exports.modelName = void 0;
13
- const account_1 = require("./mongoose/model/account");
14
- Object.defineProperty(exports, "modelName", { enumerable: true, get: function () { return account_1.modelName; } });
12
+ exports.MongoRepository = void 0;
13
+ const onIndexCreated_1 = require("./mongoose/onIndexCreated");
14
+ const account_1 = require("./mongoose/schemas/account");
15
15
  const factory = require("../factory");
16
16
  /**
17
17
  * 口座リポジトリ
@@ -19,6 +19,9 @@ const factory = require("../factory");
19
19
  class MongoRepository {
20
20
  constructor(connection) {
21
21
  this.accountModel = connection.model(account_1.modelName, account_1.schema);
22
+ if (connection.get('autoIndex') === true) {
23
+ this.accountModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
24
+ }
22
25
  }
23
26
  // tslint:disable-next-line:cyclomatic-complexity max-func-body-length
24
27
  static CREATE_MONGO_CONDITIONS(params) {
@@ -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 accountTitle_1 = require("./mongoose/model/accountTitle");
14
+ const onIndexCreated_1 = require("./mongoose/onIndexCreated");
15
+ const accountTitle_1 = require("./mongoose/schemas/accountTitle");
15
16
  /**
16
17
  * 科目リポジトリ
17
18
  */
18
19
  class MongoRepository {
19
20
  constructor(connection) {
20
21
  this.accountTitleModel = connection.model(accountTitle_1.modelName, accountTitle_1.schema);
22
+ if (connection.get('autoIndex') === true) {
23
+ this.accountTitleModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
24
+ }
21
25
  }
22
26
  deleteByProject(params) {
23
27
  return __awaiter(this, void 0, void 0, function* () {
@@ -1,7 +1,5 @@
1
1
  import { Connection } from 'mongoose';
2
- import { modelName } from './mongoose/model/accountTransaction';
3
2
  import * as factory from '../factory';
4
- export { modelName };
5
3
  /**
6
4
  * 口座取引リポジトリ
7
5
  */
@@ -9,10 +9,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.MongoRepository = exports.modelName = void 0;
12
+ exports.MongoRepository = void 0;
13
13
  const moment = require("moment");
14
- const accountTransaction_1 = require("./mongoose/model/accountTransaction");
15
- Object.defineProperty(exports, "modelName", { enumerable: true, get: function () { return accountTransaction_1.modelName; } });
14
+ const onIndexCreated_1 = require("./mongoose/onIndexCreated");
15
+ const accountTransaction_1 = require("./mongoose/schemas/accountTransaction");
16
16
  const factory = require("../factory");
17
17
  /**
18
18
  * 口座取引リポジトリ
@@ -20,6 +20,9 @@ const factory = require("../factory");
20
20
  class MongoRepository {
21
21
  constructor(connection) {
22
22
  this.transactionModel = connection.model(accountTransaction_1.modelName, accountTransaction_1.schema);
23
+ if (connection.get('autoIndex') === true) {
24
+ this.transactionModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
25
+ }
23
26
  }
24
27
  static CREATE_MONGO_CONDITIONS(params) {
25
28
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
@@ -1,6 +1,6 @@
1
1
  import { Connection, Model } from 'mongoose';
2
2
  import * as factory from '../factory';
3
- export declare type IOrder4report = factory.order.IOrder & {
3
+ export type IOrder4report = factory.order.IOrder & {
4
4
  numItems: number;
5
5
  };
6
6
  export interface IAccountingReport {
@@ -10,7 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.MongoRepository = void 0;
13
- const accountingReport_1 = require("./mongoose/model/accountingReport");
13
+ const onIndexCreated_1 = require("./mongoose/onIndexCreated");
14
+ const accountingReport_1 = require("./mongoose/schemas/accountingReport");
14
15
  const errorHandler_1 = require("../errorHandler");
15
16
  /**
16
17
  * 経理レポートリポジトリ
@@ -18,6 +19,9 @@ const errorHandler_1 = require("../errorHandler");
18
19
  class MongoRepository {
19
20
  constructor(connection) {
20
21
  this.accountingReportModel = connection.model(accountingReport_1.modelName, accountingReport_1.schema);
22
+ if (connection.get('autoIndex') === true) {
23
+ this.accountingReportModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
24
+ }
21
25
  }
22
26
  /**
23
27
  * なければ作成する
@@ -30,7 +34,7 @@ class MongoRepository {
30
34
  }
31
35
  catch (error) {
32
36
  let throwsError = true;
33
- if (error.name === 'MongoError') {
37
+ if ((0, errorHandler_1.isMongoError)(error)) {
34
38
  // すでにorderNumberが存在する場合ok
35
39
  if (error.code === errorHandler_1.MongoErrorCode.DuplicateKey) {
36
40
  throwsError = false;
@@ -91,5 +91,5 @@ class RedisRepository {
91
91
  });
92
92
  }
93
93
  }
94
- exports.RedisRepository = RedisRepository;
95
94
  RedisRepository.KEY_PREFIX = 'cinerino:registerProgramMembershipActionInProgress';
95
+ exports.RedisRepository = RedisRepository;
@@ -1,8 +1,7 @@
1
1
  import { Connection } from 'mongoose';
2
2
  import * as factory from '../factory';
3
- import { modelName } from './mongoose/model/action';
4
- export declare type IAction<T extends factory.actionType> = T extends factory.actionType.OrderAction ? factory.action.trade.order.IAction : T extends factory.actionType.AuthorizeAction ? factory.action.authorize.IAction<factory.action.authorize.IAttributes<any, any>> : factory.action.IAction<factory.action.IAttributes<T, any, any>>;
5
- export declare type IPayAction = factory.action.trade.pay.IAction;
3
+ export type IAction<T extends factory.actionType> = T extends factory.actionType.OrderAction ? factory.action.trade.order.IAction : T extends factory.actionType.AuthorizeAction ? factory.action.authorize.IAction<factory.action.authorize.IAttributes<any, any>> : factory.action.IAction<factory.action.IAttributes<T, any, any>>;
4
+ export type IPayAction = factory.action.trade.pay.IAction;
6
5
  export interface IUseActionCountByOffer {
7
6
  _id: string[];
8
7
  useActionCount?: number;
@@ -24,7 +23,6 @@ interface IStatus {
24
23
  interface IAggregateAction {
25
24
  statuses: IStatus[];
26
25
  }
27
- export { modelName };
28
26
  /**
29
27
  * アクションリポジトリ
30
28
  */
@@ -184,3 +182,4 @@ export declare class MongoRepository {
184
182
  }): Promise<IAggregateAction>;
185
183
  private agggregateByStatus;
186
184
  }
185
+ export {};
@@ -9,16 +9,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.MongoRepository = exports.modelName = void 0;
12
+ exports.MongoRepository = void 0;
13
13
  const factory = require("../factory");
14
- const action_1 = require("./mongoose/model/action");
15
- Object.defineProperty(exports, "modelName", { enumerable: true, get: function () { return action_1.modelName; } });
14
+ const onIndexCreated_1 = require("./mongoose/onIndexCreated");
15
+ const action_1 = require("./mongoose/schemas/action");
16
16
  /**
17
17
  * アクションリポジトリ
18
18
  */
19
19
  class MongoRepository {
20
20
  constructor(connection) {
21
21
  this.actionModel = connection.model(action_1.modelName, action_1.schema);
22
+ if (connection.get('autoIndex') === true) {
23
+ this.actionModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
24
+ }
22
25
  }
23
26
  // tslint:disable-next-line:cyclomatic-complexity max-func-body-length
24
27
  static CREATE_MONGO_CONDITIONS(params) {
@@ -21,7 +21,8 @@ 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 additionalProperty_1 = require("./mongoose/model/additionalProperty");
24
+ const onIndexCreated_1 = require("./mongoose/onIndexCreated");
25
+ const additionalProperty_1 = require("./mongoose/schemas/additionalProperty");
25
26
  const factory = require("../factory");
26
27
  /**
27
28
  * 追加特性リポジトリ
@@ -29,6 +30,9 @@ const factory = require("../factory");
29
30
  class MongoRepository {
30
31
  constructor(connection) {
31
32
  this.additionalPropertyModel = connection.model(additionalProperty_1.modelName, additionalProperty_1.schema);
33
+ if (connection.get('autoIndex') === true) {
34
+ this.additionalPropertyModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
35
+ }
32
36
  }
33
37
  // tslint:disable-next-line:cyclomatic-complexity max-func-body-length
34
38
  static CREATE_MONGO_CONDITIONS(params) {
@@ -21,7 +21,8 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  };
22
22
  Object.defineProperty(exports, "__esModule", { value: true });
23
23
  exports.MongoRepository = exports.AggregationType = void 0;
24
- const aggregation_1 = require("./mongoose/model/aggregation");
24
+ const onIndexCreated_1 = require("./mongoose/onIndexCreated");
25
+ const aggregation_1 = require("./mongoose/schemas/aggregation");
25
26
  var AggregationType;
26
27
  (function (AggregationType) {
27
28
  AggregationType["AggregateAuthorizeEventServiceOfferAction"] = "AggregateAuthorizeEventServiceOfferAction";
@@ -42,6 +43,9 @@ var AggregationType;
42
43
  class MongoRepository {
43
44
  constructor(connection) {
44
45
  this.aggregationModel = connection.model(aggregation_1.modelName, aggregation_1.schema);
46
+ if (connection.get('autoIndex') === true) {
47
+ this.aggregationModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
48
+ }
45
49
  }
46
50
  saveAggregation(params) {
47
51
  return __awaiter(this, void 0, void 0, function* () {
@@ -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/assetTransaction';
27
26
  import * as factory from '../factory';
28
- export { modelName };
29
27
  interface IAggregationByStatus {
30
28
  transactionCount: number;
31
29
  avgDuration: number;
@@ -181,3 +179,4 @@ export declare class MongoRepository {
181
179
  }): Promise<IAggregateReserve>;
182
180
  private agggregateByStatus;
183
181
  }
182
+ export {};
@@ -9,10 +9,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.MongoRepository = exports.modelName = void 0;
12
+ exports.MongoRepository = void 0;
13
13
  const moment = require("moment");
14
- const assetTransaction_1 = require("./mongoose/model/assetTransaction");
15
- Object.defineProperty(exports, "modelName", { enumerable: true, get: function () { return assetTransaction_1.modelName; } });
14
+ const onIndexCreated_1 = require("./mongoose/onIndexCreated");
15
+ const assetTransaction_1 = require("./mongoose/schemas/assetTransaction");
16
16
  const factory = require("../factory");
17
17
  /**
18
18
  * 資産取引リポジトリ
@@ -20,6 +20,9 @@ const factory = require("../factory");
20
20
  class MongoRepository {
21
21
  constructor(connection) {
22
22
  this.transactionModel = connection.model(assetTransaction_1.modelName, assetTransaction_1.schema);
23
+ if (connection.get('autoIndex') === true) {
24
+ this.transactionModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
25
+ }
23
26
  }
24
27
  // tslint:disable-next-line:cyclomatic-complexity max-func-body-length
25
28
  static CREATE_MONGO_CONDITIONS(params) {
@@ -21,7 +21,8 @@ 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 categoryCode_1 = require("./mongoose/model/categoryCode");
24
+ const onIndexCreated_1 = require("./mongoose/onIndexCreated");
25
+ const categoryCode_1 = require("./mongoose/schemas/categoryCode");
25
26
  const factory = require("../factory");
26
27
  /**
27
28
  * 区分リポジトリ
@@ -29,6 +30,9 @@ const factory = require("../factory");
29
30
  class MongoRepository {
30
31
  constructor(connection) {
31
32
  this.categoryCodeModel = connection.model(categoryCode_1.modelName, categoryCode_1.schema);
33
+ if (connection.get('autoIndex') === true) {
34
+ this.categoryCodeModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
35
+ }
32
36
  }
33
37
  // tslint:disable-next-line:cyclomatic-complexity max-func-body-length
34
38
  static CREATE_MONGO_CONDITIONS(params) {
@@ -1,8 +1,8 @@
1
1
  import { Connection } from 'mongoose';
2
2
  import * as factory from '../factory';
3
- import { modelName } from './mongoose/model/authorization';
4
- export declare type IObject = factory.authorization.IObject;
5
- export declare type ICode = string;
3
+ import { modelName } from './mongoose/schemas/authorization';
4
+ export type IObject = factory.authorization.IObject;
5
+ export type ICode = string;
6
6
  export { modelName };
7
7
  /**
8
8
  * 承認コードリポジトリ
@@ -13,7 +13,8 @@ exports.MongoRepository = exports.modelName = void 0;
13
13
  const moment = require("moment");
14
14
  const uuid = require("uuid");
15
15
  const factory = require("../factory");
16
- const authorization_1 = require("./mongoose/model/authorization");
16
+ const onIndexCreated_1 = require("./mongoose/onIndexCreated");
17
+ const authorization_1 = require("./mongoose/schemas/authorization");
17
18
  Object.defineProperty(exports, "modelName", { enumerable: true, get: function () { return authorization_1.modelName; } });
18
19
  /**
19
20
  * 承認コードリポジトリ
@@ -21,6 +22,9 @@ Object.defineProperty(exports, "modelName", { enumerable: true, get: function ()
21
22
  class MongoRepository {
22
23
  constructor(connection) {
23
24
  this.authorizationModel = connection.model(authorization_1.modelName, authorization_1.schema);
25
+ if (connection.get('autoIndex') === true) {
26
+ this.authorizationModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
27
+ }
24
28
  }
25
29
  // tslint:disable-next-line:max-func-body-length
26
30
  static CREATE_MONGO_CONDITIONS(params) {
@@ -10,7 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.MongoRepository = void 0;
13
- const comments_1 = require("./mongoose/model/comments");
13
+ const onIndexCreated_1 = require("./mongoose/onIndexCreated");
14
+ const comments_1 = require("./mongoose/schemas/comments");
14
15
  const factory = require("../factory");
15
16
  /**
16
17
  * コメントリポジトリ
@@ -18,6 +19,9 @@ const factory = require("../factory");
18
19
  class MongoRepository {
19
20
  constructor(connection) {
20
21
  this.commentModel = connection.model(comments_1.modelName, comments_1.schema);
22
+ if (connection.get('autoIndex') === true) {
23
+ this.commentModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
24
+ }
21
25
  }
22
26
  static CREATE_MONGO_CONDITIONS(params) {
23
27
  var _a, _b, _c, _d, _e, _f;
@@ -93,5 +93,5 @@ class RedisRepository {
93
93
  });
94
94
  }
95
95
  }
96
- exports.RedisRepository = RedisRepository;
97
96
  RedisRepository.REDIS_KEY_PREFIX = 'cinerino:confirmationNumber';
97
+ exports.RedisRepository = RedisRepository;
@@ -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/creativeWork';
27
26
  import * as factory from '../factory';
28
- export { modelName };
29
27
  /**
30
28
  * コンテンツリポジトリ
31
29
  */
@@ -20,9 +20,9 @@ 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 creativeWork_1 = require("./mongoose/model/creativeWork");
25
- Object.defineProperty(exports, "modelName", { enumerable: true, get: function () { return creativeWork_1.modelName; } });
23
+ exports.MongoRepository = void 0;
24
+ const onIndexCreated_1 = require("./mongoose/onIndexCreated");
25
+ const creativeWork_1 = require("./mongoose/schemas/creativeWork");
26
26
  const factory = require("../factory");
27
27
  /**
28
28
  * コンテンツリポジトリ
@@ -30,6 +30,9 @@ const factory = require("../factory");
30
30
  class MongoRepository {
31
31
  constructor(connection) {
32
32
  this.creativeWorkModel = connection.model(creativeWork_1.modelName, creativeWork_1.schema);
33
+ if (connection.get('autoIndex') === true) {
34
+ this.creativeWorkModel.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) {
@@ -21,7 +21,8 @@ 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 customer_1 = require("./mongoose/model/customer");
24
+ const onIndexCreated_1 = require("./mongoose/onIndexCreated");
25
+ const customer_1 = require("./mongoose/schemas/customer");
25
26
  const factory = require("../factory");
26
27
  /**
27
28
  * 顧客リポジトリ
@@ -29,6 +30,9 @@ const factory = require("../factory");
29
30
  class MongoRepository {
30
31
  constructor(connection) {
31
32
  this.customerModel = connection.model(customer_1.modelName, customer_1.schema);
33
+ if (connection.get('autoIndex') === true) {
34
+ this.customerModel.on(onIndexCreated_1.INDEX_EVENT, onIndexCreated_1.onIndexCreated);
35
+ }
32
36
  }
33
37
  // tslint:disable-next-line:max-func-body-length
34
38
  static CREATE_MONGO_CONDITIONS(params) {
@@ -24,7 +24,7 @@
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
25
  import { Connection } from 'mongoose';
26
26
  import * as factory from '../factory';
27
- export declare type IEmailMessage = factory.creativeWork.message.email.ICreativeWork;
27
+ export type IEmailMessage = factory.creativeWork.message.email.ICreativeWork;
28
28
  export interface ISearchConditions {
29
29
  limit?: number;
30
30
  page?: number;
@@ -21,7 +21,8 @@ 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メールメッセージリポジトリ
@@ -29,6 +30,9 @@ const factory = require("../factory");
29
30
  class MongoRepository {
30
31
  constructor(connection) {
31
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;
@@ -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;
@@ -105,6 +105,12 @@ export declare class MongoRepository {
105
105
  name: string;
106
106
  };
107
107
  }[]): Promise<BulkWriteOpResultObject | void>;
108
+ /**
109
+ * コンテンツ+バージョンをキーにして、なければ作成する(複数対応)
110
+ */
111
+ createScreeningEventSeriesIfNotExistByWorkPerformed(params: {
112
+ attributes: factory.event.IAttributes<factory.eventType.ScreeningEventSeries>;
113
+ }[]): Promise<BulkWriteOpResultObject | void>;
108
114
  /**
109
115
  * イベント部分更新
110
116
  */