@chevre/domain 21.2.0-alpha.10 → 21.2.0-alpha.101

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 (257) hide show
  1. package/example/src/chevre/aggregation/aggregateSystem.ts +58 -31
  2. package/example/src/chevre/createManyEventsIfNotExist.ts +4 -1
  3. package/example/src/chevre/deleteTasksByName.ts +10 -2
  4. package/example/src/chevre/importEventsFromCOA.ts +3 -4
  5. package/example/src/chevre/migrateOrderAdditionalProperties.ts +85 -0
  6. package/example/src/chevre/processPay.ts +5 -1
  7. package/example/src/chevre/processReserve.ts +4 -1
  8. package/example/src/chevre/saveTasks.ts +13 -10
  9. package/example/src/chevre/searchAbortedTasks.ts +36 -0
  10. package/example/src/chevre/searchActions.ts +33 -0
  11. package/example/src/chevre/searchReservationNumbersByOrderNumbers.ts +37 -1
  12. package/example/src/chevre/searchSendEmailActions.ts +44 -0
  13. package/example/src/chevre/task/executeTasks.ts +26 -0
  14. package/example/src/chevre/transaction/findCreditCard.ts +1 -1
  15. package/example/src/chevre/transaction/orderMembershipService.ts +1 -1
  16. package/example/src/chevre/transaction/processReturnOrder.ts +40 -0
  17. package/example/src/chevre/transaction/startExportTasks.ts +20 -0
  18. package/example/src/chevre/updateTransaction.ts +1 -1
  19. package/example/src/playOnMoment.ts +24 -0
  20. package/lib/chevre/credentials.d.ts +1 -0
  21. package/lib/chevre/credentials.js +2 -1
  22. package/lib/chevre/eventEmitter/assetTransaction.d.ts +21 -0
  23. package/lib/chevre/eventEmitter/assetTransaction.js +25 -0
  24. package/lib/chevre/eventEmitter/task.d.ts +18 -0
  25. package/lib/chevre/eventEmitter/task.js +25 -0
  26. package/lib/chevre/eventEmitter/transaction.d.ts +21 -0
  27. package/lib/chevre/eventEmitter/transaction.js +25 -0
  28. package/lib/chevre/eventEmitter.d.ts +4 -0
  29. package/lib/chevre/eventEmitter.js +9 -0
  30. package/lib/chevre/index.d.ts +3 -2
  31. package/lib/chevre/index.js +5 -3
  32. package/lib/chevre/repo/account.js +3 -2
  33. package/lib/chevre/repo/accountTransaction.d.ts +3 -11
  34. package/lib/chevre/repo/accountTransaction.js +3 -55
  35. package/lib/chevre/repo/action.d.ts +29 -1
  36. package/lib/chevre/repo/action.js +100 -56
  37. package/lib/chevre/repo/additionalProperty.js +2 -1
  38. package/lib/chevre/repo/assetTransaction.d.ts +25 -9
  39. package/lib/chevre/repo/assetTransaction.js +259 -87
  40. package/lib/chevre/repo/categoryCode.js +3 -2
  41. package/lib/chevre/repo/code.js +3 -2
  42. package/lib/chevre/repo/comment.d.ts +4 -1
  43. package/lib/chevre/repo/comment.js +22 -6
  44. package/lib/chevre/repo/confirmationNumber.d.ts +0 -1
  45. package/lib/chevre/repo/confirmationNumber.js +3 -15
  46. package/lib/chevre/repo/creativeWork.d.ts +1 -3
  47. package/lib/chevre/repo/creativeWork.js +3 -2
  48. package/lib/chevre/repo/customer.js +2 -1
  49. package/lib/chevre/repo/emailMessage.d.ts +1 -27
  50. package/lib/chevre/repo/emailMessage.js +2 -1
  51. package/lib/chevre/repo/event.d.ts +5 -1
  52. package/lib/chevre/repo/event.js +4 -3
  53. package/lib/chevre/repo/member.js +4 -3
  54. package/lib/chevre/repo/merchantReturnPolicy.d.ts +1 -3
  55. package/lib/chevre/repo/merchantReturnPolicy.js +2 -1
  56. package/lib/chevre/repo/mongoose/schemas/account.d.ts +4 -2
  57. package/lib/chevre/repo/mongoose/schemas/accountTitle.d.ts +29 -3
  58. package/lib/chevre/repo/mongoose/schemas/accountTransaction.d.ts +31 -3
  59. package/lib/chevre/repo/mongoose/schemas/accountTransaction.js +1 -1
  60. package/lib/chevre/repo/mongoose/schemas/accountingReport.d.ts +13 -3
  61. package/lib/chevre/repo/mongoose/schemas/action.d.ts +43 -3
  62. package/lib/chevre/repo/mongoose/schemas/action.js +19 -1
  63. package/lib/chevre/repo/mongoose/schemas/additionalProperty.d.ts +17 -3
  64. package/lib/chevre/repo/mongoose/schemas/aggregation.d.ts +4 -2
  65. package/lib/chevre/repo/mongoose/schemas/assetTransaction.d.ts +44 -3
  66. package/lib/chevre/repo/mongoose/schemas/assetTransaction.js +32 -19
  67. package/lib/chevre/repo/mongoose/schemas/authorization.d.ts +19 -3
  68. package/lib/chevre/repo/mongoose/schemas/authorization.js +1 -1
  69. package/lib/chevre/repo/mongoose/schemas/categoryCode.d.ts +25 -3
  70. package/lib/chevre/repo/mongoose/schemas/comments.d.ts +27 -3
  71. package/lib/chevre/repo/mongoose/schemas/comments.js +1 -1
  72. package/lib/chevre/repo/mongoose/schemas/creativeWork.d.ts +43 -3
  73. package/lib/chevre/repo/mongoose/schemas/customer.d.ts +25 -3
  74. package/lib/chevre/repo/mongoose/schemas/emailMessages.d.ts +21 -3
  75. package/lib/chevre/repo/mongoose/schemas/event.d.ts +71 -3
  76. package/lib/chevre/repo/mongoose/schemas/member.d.ts +13 -3
  77. package/lib/chevre/repo/mongoose/schemas/merchantReturnPolicy.d.ts +21 -3
  78. package/lib/chevre/repo/mongoose/schemas/offer.d.ts +65 -3
  79. package/lib/chevre/repo/mongoose/schemas/offerCatalog.d.ts +27 -3
  80. package/lib/chevre/repo/mongoose/schemas/offerItemCondition.d.ts +74 -0
  81. package/lib/chevre/repo/mongoose/schemas/offerItemCondition.js +45 -0
  82. package/lib/chevre/repo/mongoose/schemas/order.d.ts +51 -3
  83. package/lib/chevre/repo/mongoose/schemas/order.js +1 -1
  84. package/lib/chevre/repo/mongoose/schemas/ownershipInfo.d.ts +25 -3
  85. package/lib/chevre/repo/mongoose/schemas/ownershipInfo.js +1 -1
  86. package/lib/chevre/repo/mongoose/schemas/place.d.ts +49 -3
  87. package/lib/chevre/repo/mongoose/schemas/priceSpecification.d.ts +29 -3
  88. package/lib/chevre/repo/mongoose/schemas/product.d.ts +31 -3
  89. package/lib/chevre/repo/mongoose/schemas/project.d.ts +23 -3
  90. package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +63 -5
  91. package/lib/chevre/repo/mongoose/schemas/reservation.js +1 -1
  92. package/lib/chevre/repo/mongoose/schemas/role.d.ts +11 -3
  93. package/lib/chevre/repo/mongoose/schemas/seller.d.ts +31 -3
  94. package/lib/chevre/repo/mongoose/schemas/seller.js +6 -0
  95. package/lib/chevre/repo/mongoose/schemas/serviceOutput.d.ts +11 -3
  96. package/lib/chevre/repo/mongoose/schemas/serviceOutput.js +1 -1
  97. package/lib/chevre/repo/mongoose/schemas/task.d.ts +30 -3
  98. package/lib/chevre/repo/mongoose/schemas/task.js +2 -1
  99. package/lib/chevre/repo/mongoose/schemas/telemetry.d.ts +21 -3
  100. package/lib/chevre/repo/mongoose/schemas/transaction.d.ts +40 -3
  101. package/lib/chevre/repo/mongoose/schemas/transaction.js +2 -1
  102. package/lib/chevre/repo/mongoose/schemas/trip.d.ts +11 -3
  103. package/lib/chevre/repo/offer.js +3 -2
  104. package/lib/chevre/repo/offerCatalog.js +0 -27
  105. package/lib/chevre/repo/offerItemCondition.d.ts +22 -0
  106. package/lib/chevre/repo/offerItemCondition.js +121 -0
  107. package/lib/chevre/repo/order.d.ts +55 -3
  108. package/lib/chevre/repo/order.js +62 -10
  109. package/lib/chevre/repo/ownershipInfo.js +2 -7
  110. package/lib/chevre/repo/place.js +3 -2
  111. package/lib/chevre/repo/priceSpecification.js +3 -2
  112. package/lib/chevre/repo/product.js +2 -1
  113. package/lib/chevre/repo/project.js +2 -1
  114. package/lib/chevre/repo/reservation.d.ts +12 -4
  115. package/lib/chevre/repo/reservation.js +20 -59
  116. package/lib/chevre/repo/role.js +3 -2
  117. package/lib/chevre/repo/seller.js +22 -21
  118. package/lib/chevre/repo/serviceOutput.js +2 -1
  119. package/lib/chevre/repo/task.d.ts +42 -2
  120. package/lib/chevre/repo/task.js +93 -11
  121. package/lib/chevre/repo/transaction.d.ts +23 -3
  122. package/lib/chevre/repo/transaction.js +177 -56
  123. package/lib/chevre/repo/trip.js +2 -1
  124. package/lib/chevre/repository.d.ts +5 -2
  125. package/lib/chevre/repository.js +8 -4
  126. package/lib/chevre/service/aggregation/system.d.ts +67 -22
  127. package/lib/chevre/service/aggregation/system.js +101 -89
  128. package/lib/chevre/service/assetTransaction/cancelReservation.js +1 -28
  129. package/lib/chevre/service/assetTransaction/moneyTransfer.js +1 -23
  130. package/lib/chevre/service/assetTransaction/pay/potentialActions.js +17 -1
  131. package/lib/chevre/service/assetTransaction/pay.d.ts +5 -1
  132. package/lib/chevre/service/assetTransaction/pay.js +18 -32
  133. package/lib/chevre/service/assetTransaction/refund.js +1 -23
  134. package/lib/chevre/service/assetTransaction/registerService.js +1 -25
  135. package/lib/chevre/service/assetTransaction/reserve/factory.d.ts +15 -5
  136. package/lib/chevre/service/assetTransaction/reserve/factory.js +122 -58
  137. package/lib/chevre/service/assetTransaction/reserve.d.ts +10 -1
  138. package/lib/chevre/service/assetTransaction/reserve.js +85 -69
  139. package/lib/chevre/service/assetTransaction.d.ts +6 -2
  140. package/lib/chevre/service/assetTransaction.js +9 -5
  141. package/lib/chevre/service/event.js +3 -1
  142. package/lib/chevre/service/notification/factory.js +2 -2
  143. package/lib/chevre/service/notification.d.ts +3 -1
  144. package/lib/chevre/service/notification.js +41 -7
  145. package/lib/chevre/service/offer/event/authorize.d.ts +3 -0
  146. package/lib/chevre/service/offer/event/authorize.js +8 -2
  147. package/lib/chevre/service/offer/event/factory.d.ts +3 -0
  148. package/lib/chevre/service/offer/event/factory.js +16 -5
  149. package/lib/chevre/service/offer/event/voidTransaction.d.ts +2 -0
  150. package/lib/chevre/service/offer/event/voidTransaction.js +17 -1
  151. package/lib/chevre/service/offer.d.ts +12 -7
  152. package/lib/chevre/service/offer.js +57 -2
  153. package/lib/chevre/service/order/deleteOrder.d.ts +3 -1
  154. package/lib/chevre/service/order/deleteOrder.js +8 -8
  155. package/lib/chevre/service/order/onOrderStatusChanged/factory.d.ts +5 -2
  156. package/lib/chevre/service/order/onOrderStatusChanged/factory.js +41 -81
  157. package/lib/chevre/service/order/onOrderStatusChanged.js +1 -3
  158. package/lib/chevre/service/order/onOrderUpdated.d.ts +16 -0
  159. package/lib/chevre/service/order/onOrderUpdated.js +22 -0
  160. package/lib/chevre/service/order/placeOrder.d.ts +1 -0
  161. package/lib/chevre/service/order/placeOrder.js +41 -24
  162. package/lib/chevre/service/order/returnOrder.d.ts +1 -0
  163. package/lib/chevre/service/order/returnOrder.js +7 -12
  164. package/lib/chevre/service/order/sendOrder.d.ts +1 -0
  165. package/lib/chevre/service/order/sendOrder.js +7 -10
  166. package/lib/chevre/service/order.d.ts +2 -1
  167. package/lib/chevre/service/order.js +3 -1
  168. package/lib/chevre/service/payment/any/onPaid.js +1 -1
  169. package/lib/chevre/service/payment/any/onRefund.js +1 -1
  170. package/lib/chevre/service/payment/any.d.ts +9 -5
  171. package/lib/chevre/service/payment/any.js +80 -18
  172. package/lib/chevre/service/payment/creditCard.d.ts +1 -1
  173. package/lib/chevre/service/payment/creditCard.js +21 -15
  174. package/lib/chevre/service/payment/movieTicket/checkByIdentifier.d.ts +7 -6
  175. package/lib/chevre/service/payment/movieTicket/validation.d.ts +6 -6
  176. package/lib/chevre/service/payment/movieTicket/validation.js +54 -31
  177. package/lib/chevre/service/payment/movieTicket.d.ts +2 -2
  178. package/lib/chevre/service/payment/movieTicket.js +5 -4
  179. package/lib/chevre/service/product.js +1 -5
  180. package/lib/chevre/service/report/telemetry.d.ts +0 -11
  181. package/lib/chevre/service/report/telemetry.js +21 -24
  182. package/lib/chevre/service/reserve/cancelReservation.d.ts +5 -3
  183. package/lib/chevre/service/reserve/cancelReservation.js +147 -139
  184. package/lib/chevre/service/reserve/checkInReservation.d.ts +9 -4
  185. package/lib/chevre/service/reserve/checkInReservation.js +77 -3
  186. package/lib/chevre/service/reserve/confirmReservation.d.ts +7 -4
  187. package/lib/chevre/service/reserve/confirmReservation.js +125 -58
  188. package/lib/chevre/service/reserve/factory.d.ts +1 -1
  189. package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.d.ts +17 -5
  190. package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +26 -24
  191. package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.js +2 -3
  192. package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +2 -31
  193. package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +2 -3
  194. package/lib/chevre/service/reserve/useReservation.d.ts +7 -3
  195. package/lib/chevre/service/reserve/useReservation.js +61 -71
  196. package/lib/chevre/service/reserve/verifyToken4reservation.d.ts +15 -0
  197. package/lib/chevre/service/reserve/verifyToken4reservation.js +56 -0
  198. package/lib/chevre/service/reserve.d.ts +3 -2
  199. package/lib/chevre/service/reserve.js +4 -2
  200. package/lib/chevre/service/task/cancelPendingReservation.js +5 -1
  201. package/lib/chevre/service/task/confirmRegisterServiceTransaction.js +1 -1
  202. package/lib/chevre/service/task/deleteTransaction.js +10 -8
  203. package/lib/chevre/service/task/importOffersFromCOA.js +4 -0
  204. package/lib/chevre/service/task/onAuthorizationCreated.d.ts +7 -0
  205. package/lib/chevre/service/task/onAuthorizationCreated.js +108 -0
  206. package/lib/chevre/service/task/onEventChanged.d.ts +7 -0
  207. package/lib/chevre/service/task/{deleteOrder.js → onEventChanged.js} +8 -14
  208. package/lib/chevre/service/task/placeOrder.js +1 -1
  209. package/lib/chevre/service/task/reserve.js +10 -7
  210. package/lib/chevre/service/task/returnOrder.js +1 -1
  211. package/lib/chevre/service/task/returnPayTransaction.js +2 -12
  212. package/lib/chevre/service/task/sendOrder.js +1 -1
  213. package/lib/chevre/service/task/useReservation.d.ts +7 -0
  214. package/lib/chevre/service/task/useReservation.js +36 -0
  215. package/lib/chevre/service/task/voidReserveTransaction.js +3 -1
  216. package/lib/chevre/service/task.d.ts +9 -0
  217. package/lib/chevre/service/task.js +43 -4
  218. package/lib/chevre/service/transaction/deleteTransaction.d.ts +21 -0
  219. package/lib/chevre/service/transaction/deleteTransaction.js +232 -0
  220. package/lib/chevre/service/transaction/moneyTransfer/exportTasks/factory.js +11 -1
  221. package/lib/chevre/service/transaction/moneyTransfer/factory.js +3 -1
  222. package/lib/chevre/service/transaction/moneyTransfer/potentialActions.d.ts +1 -0
  223. package/lib/chevre/service/transaction/moneyTransfer/potentialActions.js +1 -1
  224. package/lib/chevre/service/transaction/moneyTransfer.js +9 -12
  225. package/lib/chevre/service/transaction/orderProgramMembership.js +6 -2
  226. package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.js +42 -30
  227. package/lib/chevre/service/transaction/placeOrder.js +1 -5
  228. package/lib/chevre/service/transaction/placeOrderInProgress/factory.js +1 -1
  229. package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/moneyTransfer.d.ts +1 -0
  230. package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/moneyTransfer.js +1 -1
  231. package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/registerService.d.ts +1 -0
  232. package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/registerService.js +1 -1
  233. package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions.d.ts +1 -0
  234. package/lib/chevre/service/transaction/placeOrderInProgress/result/acceptedOffers.d.ts +3 -0
  235. package/lib/chevre/service/transaction/placeOrderInProgress/result/acceptedOffers.js +7 -3
  236. package/lib/chevre/service/transaction/placeOrderInProgress/result.d.ts +1 -0
  237. package/lib/chevre/service/transaction/placeOrderInProgress/result.js +2 -2
  238. package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateMovieTicket.d.ts +1 -1
  239. package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateMovieTicket.js +2 -2
  240. package/lib/chevre/service/transaction/placeOrderInProgress/validation.d.ts +2 -1
  241. package/lib/chevre/service/transaction/placeOrderInProgress/validation.js +23 -17
  242. package/lib/chevre/service/transaction/placeOrderInProgress.d.ts +0 -3
  243. package/lib/chevre/service/transaction/placeOrderInProgress.js +22 -11
  244. package/lib/chevre/service/transaction/returnOrder/exportTasks/factory.js +10 -1
  245. package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.js +25 -17
  246. package/lib/chevre/service/transaction/returnOrder.d.ts +4 -0
  247. package/lib/chevre/service/transaction/returnOrder.js +225 -35
  248. package/lib/chevre/service/transaction.d.ts +8 -13
  249. package/lib/chevre/service/transaction.js +12 -145
  250. package/lib/chevre/settings.d.ts +8 -1
  251. package/lib/chevre/settings.js +35 -6
  252. package/package.json +5 -5
  253. package/example/src/chevre/migrateMoneyTransferPendingTransactionIdentifier.ts +0 -96
  254. package/example/src/chevre/migrateMovieAdditionalProperties.ts +0 -98
  255. package/lib/chevre/service/task/deleteAssetTransaction.d.ts +0 -12
  256. package/lib/chevre/service/task/deleteAssetTransaction.js +0 -65
  257. package/lib/chevre/service/task/deleteOrder.d.ts +0 -6
@@ -27,7 +27,7 @@ declare const modelName = "Reservation";
27
27
  /**
28
28
  * 予約スキーマ
29
29
  */
30
- declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").ResolveSchemaOptions<{
30
+ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
31
31
  collection: string;
32
32
  id: true;
33
33
  read: string;
@@ -51,7 +51,7 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
51
51
  minimize: false;
52
52
  versionKey: false;
53
53
  };
54
- }>, {
54
+ }, {
55
55
  typeOf: string;
56
56
  reservationNumber: string;
57
57
  reservationStatus: string;
@@ -61,23 +61,81 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
61
61
  project?: any;
62
62
  additionalProperty?: any;
63
63
  reservationFor?: any;
64
+ underName?: any;
65
+ issuedThrough?: any;
66
+ subReservation?: any;
67
+ broker?: any;
64
68
  price?: any;
65
69
  priceCurrency?: string | undefined;
66
- issuedThrough?: any;
67
70
  reservedTicket?: any;
68
- subReservation?: any;
69
71
  additionalTicketText?: string | undefined;
70
72
  bookingTime?: Date | undefined;
73
+ modifiedTime?: Date | undefined;
74
+ numSeats?: number | undefined;
75
+ programMembershipUsed?: any;
76
+ bookingAgent?: any;
77
+ cancelReservationUrl?: string | undefined;
78
+ checkinUrl?: string | undefined;
79
+ confirmReservationUrl?: string | undefined;
80
+ modifyReservationUrl?: string | undefined;
81
+ previousReservationStatus?: string | undefined;
82
+ }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
83
+ typeOf: string;
84
+ reservationNumber: string;
85
+ reservationStatus: string;
86
+ checkedIn: boolean;
87
+ attended: boolean;
88
+ _id?: string | undefined;
89
+ project?: any;
90
+ additionalProperty?: any;
91
+ reservationFor?: any;
92
+ underName?: any;
93
+ issuedThrough?: any;
94
+ subReservation?: any;
71
95
  broker?: any;
96
+ price?: any;
97
+ priceCurrency?: string | undefined;
98
+ reservedTicket?: any;
99
+ additionalTicketText?: string | undefined;
100
+ bookingTime?: Date | undefined;
72
101
  modifiedTime?: Date | undefined;
73
102
  numSeats?: number | undefined;
74
103
  programMembershipUsed?: any;
104
+ bookingAgent?: any;
105
+ cancelReservationUrl?: string | undefined;
106
+ checkinUrl?: string | undefined;
107
+ confirmReservationUrl?: string | undefined;
108
+ modifyReservationUrl?: string | undefined;
109
+ previousReservationStatus?: string | undefined;
110
+ }>> & Omit<import("mongoose").FlatRecord<{
111
+ typeOf: string;
112
+ reservationNumber: string;
113
+ reservationStatus: string;
114
+ checkedIn: boolean;
115
+ attended: boolean;
116
+ _id?: string | undefined;
117
+ project?: any;
118
+ additionalProperty?: any;
119
+ reservationFor?: any;
75
120
  underName?: any;
121
+ issuedThrough?: any;
122
+ subReservation?: any;
123
+ broker?: any;
124
+ price?: any;
125
+ priceCurrency?: string | undefined;
126
+ reservedTicket?: any;
127
+ additionalTicketText?: string | undefined;
128
+ bookingTime?: Date | undefined;
129
+ modifiedTime?: Date | undefined;
130
+ numSeats?: number | undefined;
131
+ programMembershipUsed?: any;
76
132
  bookingAgent?: any;
77
133
  cancelReservationUrl?: string | undefined;
78
134
  checkinUrl?: string | undefined;
79
135
  confirmReservationUrl?: string | undefined;
80
136
  modifyReservationUrl?: string | undefined;
81
137
  previousReservationStatus?: string | undefined;
82
- }>;
138
+ }> & Required<{
139
+ _id: string;
140
+ }>, never>>;
83
141
  export { modelName, schema };
@@ -48,7 +48,7 @@ const schema = new mongoose_1.Schema({
48
48
  }, {
49
49
  collection: 'reservations',
50
50
  id: true,
51
- read: 'primaryPreferred',
51
+ read: 'primary',
52
52
  writeConcern: writeConcern_1.writeConcern,
53
53
  strict: true,
54
54
  strictQuery: false,
@@ -27,7 +27,7 @@ declare const modelName = "Role";
27
27
  /**
28
28
  * ロールスキーマ
29
29
  */
30
- declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").ResolveSchemaOptions<{
30
+ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
31
31
  collection: string;
32
32
  id: true;
33
33
  read: string;
@@ -51,8 +51,16 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
51
51
  minimize: false;
52
52
  versionKey: false;
53
53
  };
54
- }>, {
54
+ }, {
55
55
  permissions: string[];
56
56
  typeOf?: string | undefined;
57
- }>;
57
+ }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
58
+ permissions: string[];
59
+ typeOf?: string | undefined;
60
+ }>> & Omit<import("mongoose").FlatRecord<{
61
+ permissions: string[];
62
+ typeOf?: string | undefined;
63
+ }> & {
64
+ _id: import("mongoose").Types.ObjectId;
65
+ }, never>>;
58
66
  export { modelName, schema };
@@ -27,7 +27,7 @@ declare const modelName = "Seller";
27
27
  /**
28
28
  * 販売者スキーマ
29
29
  */
30
- declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").ResolveSchemaOptions<{
30
+ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
31
31
  collection: string;
32
32
  id: true;
33
33
  read: string;
@@ -51,7 +51,7 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
51
51
  minimize: false;
52
52
  versionKey: false;
53
53
  };
54
- }>, {
54
+ }, {
55
55
  typeOf: string;
56
56
  additionalProperty: any[];
57
57
  hasMerchantReturnPolicy: any[];
@@ -64,5 +64,33 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
64
64
  branchCode?: string | undefined;
65
65
  telephone?: string | undefined;
66
66
  parentOrganization?: any;
67
- }>;
67
+ }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
68
+ typeOf: string;
69
+ additionalProperty: any[];
70
+ hasMerchantReturnPolicy: any[];
71
+ areaServed: any[];
72
+ makesOffer: any[];
73
+ paymentAccepted: any[];
74
+ name?: any;
75
+ url?: string | undefined;
76
+ project?: any;
77
+ branchCode?: string | undefined;
78
+ telephone?: string | undefined;
79
+ parentOrganization?: any;
80
+ }>> & Omit<import("mongoose").FlatRecord<{
81
+ typeOf: string;
82
+ additionalProperty: any[];
83
+ hasMerchantReturnPolicy: any[];
84
+ areaServed: any[];
85
+ makesOffer: any[];
86
+ paymentAccepted: any[];
87
+ name?: any;
88
+ url?: string | undefined;
89
+ project?: any;
90
+ branchCode?: string | undefined;
91
+ telephone?: string | undefined;
92
+ parentOrganization?: any;
93
+ }> & {
94
+ _id: import("mongoose").Types.ObjectId;
95
+ }, never>>;
68
96
  export { modelName, schema };
@@ -75,3 +75,9 @@ schema.index({ additionalProperty: 1, branchCode: 1 }, {
75
75
  additionalProperty: { $exists: true }
76
76
  }
77
77
  });
78
+ schema.index({ 'hasMerchantReturnPolicy.itemCondition.id': 1, branchCode: 1 }, {
79
+ name: 'searchByHasMerchantReturnPolicyItemConditionId',
80
+ partialFilterExpression: {
81
+ 'hasMerchantReturnPolicy.itemCondition.id': { $exists: true }
82
+ }
83
+ });
@@ -27,7 +27,7 @@ declare const modelName = "ServiceOutput";
27
27
  /**
28
28
  * 許可証スキーマ
29
29
  */
30
- declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").ResolveSchemaOptions<{
30
+ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
31
31
  collection: string;
32
32
  id: true;
33
33
  read: string;
@@ -51,8 +51,16 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
51
51
  minimize: false;
52
52
  versionKey: false;
53
53
  };
54
- }>, {
54
+ }, {
55
55
  typeOf: string;
56
56
  project?: any;
57
- }>;
57
+ }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
58
+ typeOf: string;
59
+ project?: any;
60
+ }>> & Omit<import("mongoose").FlatRecord<{
61
+ typeOf: string;
62
+ project?: any;
63
+ }> & {
64
+ _id: import("mongoose").Types.ObjectId;
65
+ }, never>>;
58
66
  export { modelName, schema };
@@ -17,7 +17,7 @@ const schema = new mongoose_1.Schema({
17
17
  }, {
18
18
  collection: 'serviceOutputs',
19
19
  id: true,
20
- read: 'primaryPreferred',
20
+ read: 'primary',
21
21
  writeConcern: writeConcern_1.writeConcern,
22
22
  strict: false,
23
23
  strictQuery: false,
@@ -27,7 +27,7 @@ declare const modelName = "Task";
27
27
  /**
28
28
  * タスクスキーマ
29
29
  */
30
- declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").ResolveSchemaOptions<{
30
+ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
31
31
  collection: string;
32
32
  id: true;
33
33
  read: string;
@@ -51,7 +51,7 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
51
51
  minimize: false;
52
52
  versionKey: false;
53
53
  };
54
- }>, {
54
+ }, {
55
55
  executionResults: any[];
56
56
  name?: string | undefined;
57
57
  status?: string | undefined;
@@ -61,6 +61,33 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
61
61
  remainingNumberOfTries?: number | undefined;
62
62
  lastTriedAt?: Date | undefined;
63
63
  numberOfTried?: number | undefined;
64
+ executor?: any;
64
65
  dateAborted?: Date | undefined;
65
- }>;
66
+ }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
67
+ executionResults: any[];
68
+ name?: string | undefined;
69
+ status?: string | undefined;
70
+ data?: any;
71
+ project?: any;
72
+ runsAt?: Date | undefined;
73
+ remainingNumberOfTries?: number | undefined;
74
+ lastTriedAt?: Date | undefined;
75
+ numberOfTried?: number | undefined;
76
+ executor?: any;
77
+ dateAborted?: Date | undefined;
78
+ }>> & Omit<import("mongoose").FlatRecord<{
79
+ executionResults: any[];
80
+ name?: string | undefined;
81
+ status?: string | undefined;
82
+ data?: any;
83
+ project?: any;
84
+ runsAt?: Date | undefined;
85
+ remainingNumberOfTries?: number | undefined;
86
+ lastTriedAt?: Date | undefined;
87
+ numberOfTried?: number | undefined;
88
+ executor?: any;
89
+ dateAborted?: Date | undefined;
90
+ }> & {
91
+ _id: import("mongoose").Types.ObjectId;
92
+ }, never>>;
66
93
  export { modelName, schema };
@@ -17,12 +17,13 @@ const schema = new mongoose_1.Schema({
17
17
  lastTriedAt: Date,
18
18
  numberOfTried: Number,
19
19
  executionResults: [mongoose_1.SchemaTypes.Mixed],
20
+ executor: mongoose_1.SchemaTypes.Mixed,
20
21
  data: mongoose_1.SchemaTypes.Mixed,
21
22
  dateAborted: Date
22
23
  }, {
23
24
  collection: 'tasks',
24
25
  id: true,
25
- read: 'primaryPreferred',
26
+ read: 'primary',
26
27
  writeConcern: writeConcern_1.writeConcern,
27
28
  strict: true,
28
29
  strictQuery: false,
@@ -27,7 +27,7 @@ declare const modelName = "Telemetry";
27
27
  /**
28
28
  * 測定スキーマ
29
29
  */
30
- declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").ResolveSchemaOptions<{
30
+ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
31
31
  collection: string;
32
32
  id: true;
33
33
  read: string;
@@ -51,13 +51,31 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
51
51
  minimize: false;
52
52
  versionKey: false;
53
53
  };
54
- }>, {
54
+ }, {
55
55
  object?: any;
56
56
  error?: any;
57
+ result?: any;
58
+ project?: any;
59
+ startDate?: Date | undefined;
60
+ endDate?: Date | undefined;
61
+ purpose?: any;
62
+ }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
63
+ object?: any;
64
+ error?: any;
65
+ result?: any;
57
66
  project?: any;
58
67
  startDate?: Date | undefined;
59
68
  endDate?: Date | undefined;
69
+ purpose?: any;
70
+ }>> & Omit<import("mongoose").FlatRecord<{
71
+ object?: any;
72
+ error?: any;
60
73
  result?: any;
74
+ project?: any;
75
+ startDate?: Date | undefined;
76
+ endDate?: Date | undefined;
61
77
  purpose?: any;
62
- }>;
78
+ }> & {
79
+ _id: import("mongoose").Types.ObjectId;
80
+ }, never>>;
63
81
  export { modelName, schema };
@@ -27,7 +27,7 @@ declare const modelName = "Transaction";
27
27
  /**
28
28
  * 取引スキーマ
29
29
  */
30
- declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").ResolveSchemaOptions<{
30
+ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
31
31
  collection: string;
32
32
  id: true;
33
33
  read: string;
@@ -51,11 +51,29 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
51
51
  minimize: false;
52
52
  versionKey: false;
53
53
  };
54
- }>, {
54
+ }, {
55
55
  object?: any;
56
+ error?: any;
56
57
  typeOf?: string | undefined;
57
58
  status?: string | undefined;
59
+ result?: any;
60
+ expires?: Date | undefined;
61
+ project?: any;
62
+ agent?: any;
63
+ recipient?: any;
64
+ startDate?: Date | undefined;
65
+ endDate?: Date | undefined;
66
+ potentialActions?: any;
67
+ tasksExportationStatus?: string | undefined;
68
+ tasksExportedAt?: Date | undefined;
69
+ seller?: any;
70
+ tasksExportAction?: any;
71
+ }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
72
+ object?: any;
58
73
  error?: any;
74
+ typeOf?: string | undefined;
75
+ status?: string | undefined;
76
+ result?: any;
59
77
  expires?: Date | undefined;
60
78
  project?: any;
61
79
  agent?: any;
@@ -65,7 +83,26 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
65
83
  potentialActions?: any;
66
84
  tasksExportationStatus?: string | undefined;
67
85
  tasksExportedAt?: Date | undefined;
86
+ seller?: any;
87
+ tasksExportAction?: any;
88
+ }>> & Omit<import("mongoose").FlatRecord<{
89
+ object?: any;
90
+ error?: any;
91
+ typeOf?: string | undefined;
92
+ status?: string | undefined;
68
93
  result?: any;
94
+ expires?: Date | undefined;
95
+ project?: any;
96
+ agent?: any;
97
+ recipient?: any;
98
+ startDate?: Date | undefined;
99
+ endDate?: Date | undefined;
100
+ potentialActions?: any;
101
+ tasksExportationStatus?: string | undefined;
102
+ tasksExportedAt?: Date | undefined;
69
103
  seller?: any;
70
- }>;
104
+ tasksExportAction?: any;
105
+ }> & {
106
+ _id: import("mongoose").Types.ObjectId;
107
+ }, never>>;
71
108
  export { modelName, schema };
@@ -22,13 +22,14 @@ const schema = new mongoose_1.Schema({
22
22
  expires: Date,
23
23
  startDate: Date,
24
24
  endDate: Date,
25
+ tasksExportAction: mongoose_1.SchemaTypes.Mixed,
25
26
  tasksExportedAt: Date,
26
27
  tasksExportationStatus: String,
27
28
  potentialActions: mongoose_1.SchemaTypes.Mixed
28
29
  }, {
29
30
  collection: 'transactions',
30
31
  id: true,
31
- read: 'primaryPreferred',
32
+ read: 'primary',
32
33
  writeConcern: writeConcern_1.writeConcern,
33
34
  strict: true,
34
35
  strictQuery: false,
@@ -27,7 +27,7 @@ declare const modelName = "Trip";
27
27
  /**
28
28
  * トリップスキーマ
29
29
  */
30
- declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").ResolveSchemaOptions<{
30
+ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
31
31
  collection: string;
32
32
  id: true;
33
33
  read: string;
@@ -51,8 +51,16 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
51
51
  minimize: false;
52
52
  versionKey: false;
53
53
  };
54
- }>, {
54
+ }, {
55
55
  typeOf: string;
56
56
  project?: any;
57
- }>;
57
+ }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
58
+ typeOf: string;
59
+ project?: any;
60
+ }>> & Omit<import("mongoose").FlatRecord<{
61
+ typeOf: string;
62
+ project?: any;
63
+ }> & {
64
+ _id: import("mongoose").Types.ObjectId;
65
+ }, never>>;
58
66
  export { modelName, schema };
@@ -25,6 +25,7 @@ const uniqid = require("uniqid");
25
25
  const factory = require("../factory");
26
26
  const offer_1 = require("./mongoose/schemas/offer");
27
27
  const offerCatalog_1 = require("./mongoose/schemas/offerCatalog");
28
+ const settings_1 = require("../settings");
28
29
  /**
29
30
  * オファーリポジトリ
30
31
  */
@@ -409,7 +410,7 @@ class MongoRepository {
409
410
  return __awaiter(this, void 0, void 0, function* () {
410
411
  const conditions = MongoRepository.CREATE_OFFER_MONGO_CONDITIONS(params);
411
412
  return this.offerModel.countDocuments((conditions.length > 0) ? { $and: conditions } : {})
412
- .setOptions({ maxTimeMS: 10000 })
413
+ .setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
413
414
  .exec();
414
415
  });
415
416
  }
@@ -434,7 +435,7 @@ class MongoRepository {
434
435
  if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a['priceSpecification.price']) !== undefined) {
435
436
  query.sort({ 'priceSpecification.price': params.sort['priceSpecification.price'] });
436
437
  }
437
- return query.setOptions({ maxTimeMS: 10000 })
438
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
438
439
  .exec()
439
440
  .then((docs) => docs.map((doc) => doc.toObject()));
440
441
  });
@@ -178,33 +178,6 @@ class MongoRepository {
178
178
  .exec();
179
179
  });
180
180
  }
181
- // public async findById(params: {
182
- // id: string;
183
- // }): Promise<factory.offerCatalog.IOfferCatalog> {
184
- // const doc = await this.offerCatalogModel.findOne(
185
- // {
186
- // _id: params.id
187
- // },
188
- // {
189
- // __v: 0,
190
- // createdAt: 0,
191
- // updatedAt: 0
192
- // }
193
- // )
194
- // .exec();
195
- // if (doc === null) {
196
- // throw new factory.errors.NotFound(this.offerCatalogModel.modelName);
197
- // }
198
- // return doc.toObject();
199
- // }
200
- // public async count(
201
- // params: factory.offerCatalog.ISearchConditions
202
- // ): Promise<number> {
203
- // const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
204
- // return this.offerCatalogModel.countDocuments((conditions.length > 0) ? { $and: conditions } : {})
205
- // .setOptions({ maxTimeMS: 10000 })
206
- // .exec();
207
- // }
208
181
  search(params) {
209
182
  var _a;
210
183
  return __awaiter(this, void 0, void 0, function* () {
@@ -0,0 +1,22 @@
1
+ import { Connection } from 'mongoose';
2
+ import * as factory from '../factory';
3
+ interface IProjection {
4
+ [key: string]: 0 | 1;
5
+ }
6
+ /**
7
+ * アイテムコンディションリポジトリ
8
+ */
9
+ export declare class MongoRepository {
10
+ private readonly offerItemConditionModel;
11
+ constructor(connection: Connection);
12
+ static CREATE_MONGO_CONDITIONS(params: factory.offerItemCondition.ISearchConditions): any[];
13
+ findById(params: {
14
+ id: string;
15
+ }): Promise<factory.offerItemCondition.IOfferItemCondition>;
16
+ search(params: factory.offerItemCondition.ISearchConditions, projection?: IProjection): Promise<factory.offerItemCondition.IOfferItemCondition[]>;
17
+ save(params: factory.offerItemCondition.IOfferItemCondition): Promise<factory.offerItemCondition.IOfferItemCondition>;
18
+ deleteById(params: {
19
+ id: string;
20
+ }): Promise<void>;
21
+ }
22
+ export {};
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __rest = (this && this.__rest) || function (s, e) {
12
+ var t = {};
13
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
14
+ t[p] = s[p];
15
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
16
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
17
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
18
+ t[p[i]] = s[p[i]];
19
+ }
20
+ return t;
21
+ };
22
+ Object.defineProperty(exports, "__esModule", { value: true });
23
+ exports.MongoRepository = void 0;
24
+ const factory = require("../factory");
25
+ const offerItemCondition_1 = require("./mongoose/schemas/offerItemCondition");
26
+ const settings_1 = require("../settings");
27
+ /**
28
+ * アイテムコンディションリポジトリ
29
+ */
30
+ class MongoRepository {
31
+ constructor(connection) {
32
+ this.offerItemConditionModel = connection.model(offerItemCondition_1.modelName, offerItemCondition_1.schema);
33
+ }
34
+ static CREATE_MONGO_CONDITIONS(params) {
35
+ var _a, _b, _c, _d, _e, _f;
36
+ const andConditions = [];
37
+ const projectIdEq = (_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
38
+ if (typeof projectIdEq === 'string') {
39
+ andConditions.push({ 'project.id': { $eq: projectIdEq } });
40
+ }
41
+ const idEq = (_c = params.id) === null || _c === void 0 ? void 0 : _c.$eq;
42
+ if (typeof idEq === 'string') {
43
+ andConditions.push({ _id: { $eq: idEq } });
44
+ }
45
+ const idIn = (_d = params.id) === null || _d === void 0 ? void 0 : _d.$in;
46
+ if (Array.isArray(idIn)) {
47
+ andConditions.push({ _id: { $in: idIn } });
48
+ }
49
+ const identifierEq = (_e = params.identifier) === null || _e === void 0 ? void 0 : _e.$eq;
50
+ if (typeof identifierEq === 'string') {
51
+ andConditions.push({ identifier: { $eq: identifierEq } });
52
+ }
53
+ const identifierIn = (_f = params.identifier) === null || _f === void 0 ? void 0 : _f.$in;
54
+ if (Array.isArray(identifierIn)) {
55
+ andConditions.push({ identifier: { $in: identifierIn } });
56
+ }
57
+ return andConditions;
58
+ }
59
+ findById(params) {
60
+ return __awaiter(this, void 0, void 0, function* () {
61
+ const doc = yield this.offerItemConditionModel.findOne({ _id: params.id }, {
62
+ __v: 0,
63
+ createdAt: 0,
64
+ updatedAt: 0
65
+ })
66
+ .exec();
67
+ if (doc === null) {
68
+ throw new factory.errors.NotFound(this.offerItemConditionModel.modelName);
69
+ }
70
+ return doc.toObject();
71
+ });
72
+ }
73
+ search(params, projection) {
74
+ var _a;
75
+ return __awaiter(this, void 0, void 0, function* () {
76
+ const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
77
+ const positiveProjectionExists = (projection !== undefined && projection !== null)
78
+ ? Object.values(projection)
79
+ .some((value) => value !== 0)
80
+ : false;
81
+ const query = this.offerItemConditionModel.find((conditions.length > 0) ? { $and: conditions } : {}, (positiveProjectionExists)
82
+ ? projection
83
+ : Object.assign(Object.assign({}, projection), { __v: 0, createdAt: 0, updatedAt: 0 }));
84
+ if (typeof params.limit === 'number' && params.limit > 0) {
85
+ const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
86
+ query.limit(params.limit)
87
+ .skip(params.limit * (page - 1));
88
+ }
89
+ if (((_a = params.sort) === null || _a === void 0 ? void 0 : _a.identifier) !== undefined) {
90
+ query.sort({ identifier: params.sort.identifier });
91
+ }
92
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
93
+ .exec()
94
+ .then((docs) => docs.map((doc) => doc.toObject()));
95
+ });
96
+ }
97
+ save(params) {
98
+ return __awaiter(this, void 0, void 0, function* () {
99
+ let doc;
100
+ if (params.id === '') {
101
+ doc = yield this.offerItemConditionModel.create(params);
102
+ }
103
+ else {
104
+ const { id, identifier, project, typeOf } = params, updateFields = __rest(params, ["id", "identifier", "project", "typeOf"]);
105
+ doc = yield this.offerItemConditionModel.findOneAndUpdate({ _id: params.id }, updateFields, { upsert: false, new: true })
106
+ .exec();
107
+ }
108
+ if (doc === null) {
109
+ throw new factory.errors.NotFound(this.offerItemConditionModel.modelName);
110
+ }
111
+ return doc.toObject();
112
+ });
113
+ }
114
+ deleteById(params) {
115
+ return __awaiter(this, void 0, void 0, function* () {
116
+ yield this.offerItemConditionModel.findOneAndRemove({ _id: params.id })
117
+ .exec();
118
+ });
119
+ }
120
+ }
121
+ exports.MongoRepository = MongoRepository;