@chevre/domain 22.2.0-alpha.3 → 22.2.0-alpha.30

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 (260) hide show
  1. package/example/src/chevre/createProject.ts +19 -0
  2. package/example/src/chevre/findValidAuthorization.ts +1 -2
  3. package/example/src/chevre/migrateDeleteTransactionTasks.ts +1 -1
  4. package/example/src/chevre/{migrateMovieTheaterAdditionalProperties.ts → migrateRoomAdditionalProperties.ts} +17 -17
  5. package/example/src/chevre/migrateRoomSectionAdditionalProperties.ts +119 -0
  6. package/example/src/chevre/playAroundTicket.ts +3 -2
  7. package/example/src/chevre/processAction.ts +3 -1
  8. package/example/src/chevre/projectFields.ts +42 -0
  9. package/example/src/chevre/{projectEventFieldsById.ts → projectFieldsById.ts} +7 -12
  10. package/example/src/chevre/{projectReservationFieldsById.ts → projectOwnershipInfoFieldsById.ts} +4 -4
  11. package/example/src/chevre/searchActionsByPurpose.ts +38 -0
  12. package/example/src/chevre/searchProjects.ts +9 -4
  13. package/example/src/chevre/searchSellersByAggregate.ts +3 -3
  14. package/example/src/chevre/searchTransactions.ts +1 -1
  15. package/example/src/chevre/unsetUnnecessaryFields.ts +2 -41
  16. package/lib/chevre/repo/accountTitle.d.ts +9 -3
  17. package/lib/chevre/repo/accountingReport.d.ts +2 -15
  18. package/lib/chevre/repo/action.d.ts +64 -47
  19. package/lib/chevre/repo/action.js +170 -133
  20. package/lib/chevre/repo/aggregateReservation.d.ts +1 -14
  21. package/lib/chevre/repo/assetTransaction.d.ts +134 -7
  22. package/lib/chevre/repo/assetTransaction.js +2 -2
  23. package/lib/chevre/repo/authorization.d.ts +3 -1
  24. package/lib/chevre/repo/authorization.js +21 -10
  25. package/lib/chevre/repo/categoryCode.d.ts +18 -2
  26. package/lib/chevre/repo/categoryCode.js +47 -19
  27. package/lib/chevre/repo/comment.d.ts +5 -1
  28. package/lib/chevre/repo/creativeWork.d.ts +14 -2
  29. package/lib/chevre/repo/customer.d.ts +5 -1
  30. package/lib/chevre/repo/customerType.d.ts +1 -1
  31. package/lib/chevre/repo/event.d.ts +49 -2
  32. package/lib/chevre/repo/member.d.ts +5 -1
  33. package/lib/chevre/repo/merchantReturnPolicy.d.ts +22 -2
  34. package/lib/chevre/repo/message.d.ts +1 -15
  35. package/lib/chevre/repo/mongoose/schemas/account.d.ts +8 -3
  36. package/lib/chevre/repo/mongoose/schemas/account.js +1 -1
  37. package/lib/chevre/repo/mongoose/schemas/accountTitle.d.ts +8 -3
  38. package/lib/chevre/repo/mongoose/schemas/accountTitle.js +2 -2
  39. package/lib/chevre/repo/mongoose/schemas/accountTransaction.d.ts +8 -3
  40. package/lib/chevre/repo/mongoose/schemas/accountTransaction.js +1 -1
  41. package/lib/chevre/repo/mongoose/schemas/accountingReport.d.ts +22 -3
  42. package/lib/chevre/repo/mongoose/schemas/accountingReport.js +1 -1
  43. package/lib/chevre/repo/mongoose/schemas/action.d.ts +12 -3
  44. package/lib/chevre/repo/mongoose/schemas/action.js +1 -1
  45. package/lib/chevre/repo/mongoose/schemas/actionRecipe.d.ts +14 -3
  46. package/lib/chevre/repo/mongoose/schemas/actionRecipe.js +2 -5
  47. package/lib/chevre/repo/mongoose/schemas/additionalProperty.d.ts +8 -3
  48. package/lib/chevre/repo/mongoose/schemas/additionalProperty.js +12 -12
  49. package/lib/chevre/repo/mongoose/schemas/aggregateOffer.d.ts +11 -3
  50. package/lib/chevre/repo/mongoose/schemas/aggregateOffer.js +1 -1
  51. package/lib/chevre/repo/mongoose/schemas/aggregateReservation.d.ts +22 -3
  52. package/lib/chevre/repo/mongoose/schemas/aggregateReservation.js +1 -1
  53. package/lib/chevre/repo/mongoose/schemas/aggregation.d.ts +7 -3
  54. package/lib/chevre/repo/mongoose/schemas/aggregation.js +2 -1
  55. package/lib/chevre/repo/mongoose/schemas/assetTransaction.d.ts +10 -3
  56. package/lib/chevre/repo/mongoose/schemas/assetTransaction.js +1 -1
  57. package/lib/chevre/repo/mongoose/schemas/authorization.d.ts +8 -3
  58. package/lib/chevre/repo/mongoose/schemas/authorization.js +1 -1
  59. package/lib/chevre/repo/mongoose/schemas/categoryCode.d.ts +8 -3
  60. package/lib/chevre/repo/mongoose/schemas/categoryCode.js +22 -24
  61. package/lib/chevre/repo/mongoose/schemas/comments.d.ts +8 -3
  62. package/lib/chevre/repo/mongoose/schemas/comments.js +1 -1
  63. package/lib/chevre/repo/mongoose/schemas/creativeWork.d.ts +10 -3
  64. package/lib/chevre/repo/mongoose/schemas/creativeWork.js +2 -2
  65. package/lib/chevre/repo/mongoose/schemas/customer.d.ts +8 -3
  66. package/lib/chevre/repo/mongoose/schemas/customer.js +1 -1
  67. package/lib/chevre/repo/mongoose/schemas/customerType.d.ts +9 -3
  68. package/lib/chevre/repo/mongoose/schemas/customerType.js +1 -1
  69. package/lib/chevre/repo/mongoose/schemas/emailMessages.d.ts +8 -3
  70. package/lib/chevre/repo/mongoose/schemas/emailMessages.js +1 -1
  71. package/lib/chevre/repo/mongoose/schemas/event.d.ts +19 -3
  72. package/lib/chevre/repo/mongoose/schemas/event.js +1 -1
  73. package/lib/chevre/repo/mongoose/schemas/member.d.ts +8 -3
  74. package/lib/chevre/repo/mongoose/schemas/member.js +1 -1
  75. package/lib/chevre/repo/mongoose/schemas/merchantReturnPolicy.d.ts +8 -3
  76. package/lib/chevre/repo/mongoose/schemas/merchantReturnPolicy.js +1 -1
  77. package/lib/chevre/repo/mongoose/schemas/message.d.ts +23 -3
  78. package/lib/chevre/repo/mongoose/schemas/message.js +1 -1
  79. package/lib/chevre/repo/mongoose/schemas/note.d.ts +8 -3
  80. package/lib/chevre/repo/mongoose/schemas/note.js +1 -1
  81. package/lib/chevre/repo/mongoose/schemas/offerCatalog.d.ts +12 -3
  82. package/lib/chevre/repo/mongoose/schemas/offerCatalog.js +1 -1
  83. package/lib/chevre/repo/mongoose/schemas/offerCatalogItem.d.ts +12 -3
  84. package/lib/chevre/repo/mongoose/schemas/offerCatalogItem.js +1 -1
  85. package/lib/chevre/repo/mongoose/schemas/offerItemCondition.d.ts +8 -3
  86. package/lib/chevre/repo/mongoose/schemas/offerItemCondition.js +1 -1
  87. package/lib/chevre/repo/mongoose/schemas/order.d.ts +10 -3
  88. package/lib/chevre/repo/mongoose/schemas/order.js +1 -1
  89. package/lib/chevre/repo/mongoose/schemas/ownershipInfo.d.ts +10 -3
  90. package/lib/chevre/repo/mongoose/schemas/ownershipInfo.js +1 -1
  91. package/lib/chevre/repo/mongoose/schemas/paymentService.d.ts +10 -3
  92. package/lib/chevre/repo/mongoose/schemas/paymentService.js +13 -4
  93. package/lib/chevre/repo/mongoose/schemas/place.d.ts +16 -3
  94. package/lib/chevre/repo/mongoose/schemas/place.js +1 -1
  95. package/lib/chevre/repo/mongoose/schemas/priceSpecification.d.ts +11 -3
  96. package/lib/chevre/repo/mongoose/schemas/priceSpecification.js +1 -1
  97. package/lib/chevre/repo/mongoose/schemas/product.d.ts +12 -3
  98. package/lib/chevre/repo/mongoose/schemas/product.js +6 -13
  99. package/lib/chevre/repo/mongoose/schemas/productModel.d.ts +30 -3
  100. package/lib/chevre/repo/mongoose/schemas/productModel.js +1 -1
  101. package/lib/chevre/repo/mongoose/schemas/project.d.ts +12 -3
  102. package/lib/chevre/repo/mongoose/schemas/project.js +3 -3
  103. package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +12 -3
  104. package/lib/chevre/repo/mongoose/schemas/reservation.js +5 -5
  105. package/lib/chevre/repo/mongoose/schemas/role.d.ts +9 -3
  106. package/lib/chevre/repo/mongoose/schemas/role.js +1 -1
  107. package/lib/chevre/repo/mongoose/schemas/seller.d.ts +8 -3
  108. package/lib/chevre/repo/mongoose/schemas/seller.js +22 -24
  109. package/lib/chevre/repo/mongoose/schemas/serviceOutput.d.ts +8 -3
  110. package/lib/chevre/repo/mongoose/schemas/serviceOutput.js +1 -1
  111. package/lib/chevre/repo/mongoose/schemas/task.d.ts +8 -3
  112. package/lib/chevre/repo/mongoose/schemas/task.js +1 -1
  113. package/lib/chevre/repo/mongoose/schemas/telemetry.d.ts +7 -3
  114. package/lib/chevre/repo/mongoose/schemas/telemetry.js +2 -1
  115. package/lib/chevre/repo/mongoose/schemas/ticket.d.ts +26 -3
  116. package/lib/chevre/repo/mongoose/schemas/ticket.js +1 -1
  117. package/lib/chevre/repo/mongoose/schemas/transaction.d.ts +8 -3
  118. package/lib/chevre/repo/mongoose/schemas/transaction.js +2 -2
  119. package/lib/chevre/repo/mongoose/schemas/trip.d.ts +8 -3
  120. package/lib/chevre/repo/mongoose/schemas/trip.js +3 -3
  121. package/lib/chevre/repo/offer.d.ts +13 -4
  122. package/lib/chevre/repo/offerCatalog.d.ts +15 -2
  123. package/lib/chevre/repo/order.d.ts +13 -1
  124. package/lib/chevre/repo/ownershipInfo.d.ts +23 -7
  125. package/lib/chevre/repo/ownershipInfo.js +75 -19
  126. package/lib/chevre/repo/paymentService.d.ts +2 -2
  127. package/lib/chevre/repo/paymentService.js +108 -58
  128. package/lib/chevre/repo/paymentServiceProvider.d.ts +1 -10
  129. package/lib/chevre/repo/place/movieTheater.d.ts +54 -2
  130. package/lib/chevre/repo/priceSpecification.d.ts +42 -1
  131. package/lib/chevre/repo/product.d.ts +8 -3
  132. package/lib/chevre/repo/product.js +67 -33
  133. package/lib/chevre/repo/productModel.d.ts +1 -22
  134. package/lib/chevre/repo/project.d.ts +25 -5
  135. package/lib/chevre/repo/project.js +69 -28
  136. package/lib/chevre/repo/reservation.d.ts +35 -3
  137. package/lib/chevre/repo/reservation.js +1 -1
  138. package/lib/chevre/repo/role.d.ts +2 -9
  139. package/lib/chevre/repo/role.js +20 -10
  140. package/lib/chevre/repo/seller.d.ts +64 -14
  141. package/lib/chevre/repo/seller.js +61 -27
  142. package/lib/chevre/repo/task.d.ts +64 -3
  143. package/lib/chevre/repo/telemetry.d.ts +3 -2
  144. package/lib/chevre/repo/ticket.d.ts +4 -20
  145. package/lib/chevre/repo/ticket.js +23 -10
  146. package/lib/chevre/repo/transaction.d.ts +30 -14
  147. package/lib/chevre/repo/transaction.js +106 -77
  148. package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +1 -1
  149. package/lib/chevre/service/aggregation/event/findEventOffers.js +1 -1
  150. package/lib/chevre/service/aggregation/project.js +1 -1
  151. package/lib/chevre/service/assetTransaction/cancelReservation.d.ts +1 -1
  152. package/lib/chevre/service/assetTransaction/cancelReservation.js +2 -2
  153. package/lib/chevre/service/assetTransaction/moneyTransfer.js +1 -1
  154. package/lib/chevre/service/assetTransaction/pay/factory.d.ts +1 -1
  155. package/lib/chevre/service/assetTransaction/pay/factory.js +1 -1
  156. package/lib/chevre/service/assetTransaction/pay.js +3 -3
  157. package/lib/chevre/service/assetTransaction/refund/factory.d.ts +1 -1
  158. package/lib/chevre/service/assetTransaction/refund/factory.js +1 -1
  159. package/lib/chevre/service/assetTransaction/refund.js +3 -3
  160. package/lib/chevre/service/assetTransaction/registerService.js +4 -6
  161. package/lib/chevre/service/assetTransaction/reserve/start/createSubReservations.js +26 -23
  162. package/lib/chevre/service/assetTransaction/reserve/start/factory/createReservation.js +4 -1
  163. package/lib/chevre/service/assetTransaction/reserve/start.js +1 -3
  164. package/lib/chevre/service/code.d.ts +0 -4
  165. package/lib/chevre/service/code.js +22 -18
  166. package/lib/chevre/service/event.js +4 -4
  167. package/lib/chevre/service/moneyTransfer.js +3 -5
  168. package/lib/chevre/service/notification.js +2 -2
  169. package/lib/chevre/service/offer/event/authorize/factory.d.ts +3 -3
  170. package/lib/chevre/service/offer/event/authorize/factory.js +34 -6
  171. package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre/requestedProgramMembershipUsed2permit.d.ts +0 -2
  172. package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre/requestedProgramMembershipUsed2permit.js +22 -22
  173. package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +3 -4
  174. package/lib/chevre/service/offer/event/authorize.d.ts +4 -4
  175. package/lib/chevre/service/offer/event/authorize.js +3 -2
  176. package/lib/chevre/service/offer/event/importFromCOA/factory.d.ts +3 -1
  177. package/lib/chevre/service/offer/event/importFromCOA.js +2 -2
  178. package/lib/chevre/service/offer/event/searchEventTicketOffers.js +4 -12
  179. package/lib/chevre/service/offer/event/voidTransaction.js +2 -2
  180. package/lib/chevre/service/offer/event/voidTransactionByActionId.js +1 -1
  181. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer/authorize.d.ts +2 -2
  182. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer/authorize.js +41 -4
  183. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer/factory.d.ts +3 -3
  184. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +3 -3
  185. package/lib/chevre/service/offer/eventServiceByCOA/authorize.d.ts +7 -3
  186. package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +10 -5
  187. package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.d.ts +3 -1
  188. package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.d.ts +3 -1
  189. package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +14 -6
  190. package/lib/chevre/service/offer/eventServiceByCOA/factory.d.ts +8 -5
  191. package/lib/chevre/service/offer/eventServiceByCOA/validateAcceptedOffers.d.ts +1 -1
  192. package/lib/chevre/service/offer/moneyTransfer/authorize.js +1 -1
  193. package/lib/chevre/service/offer/moneyTransfer/voidTransaction.js +1 -1
  194. package/lib/chevre/service/offer/product/searchProductOffers.js +1 -3
  195. package/lib/chevre/service/offer/product.d.ts +4 -2
  196. package/lib/chevre/service/offer/product.js +12 -12
  197. package/lib/chevre/service/order/findPlaceOrderTransaction.js +1 -1
  198. package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled/factory.d.ts +1 -1
  199. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +1 -1
  200. package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +1 -1
  201. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.d.ts +1 -1
  202. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +3 -3
  203. package/lib/chevre/service/order/placeOrder.js +1 -1
  204. package/lib/chevre/service/order/returnOrder.js +1 -1
  205. package/lib/chevre/service/order/sendOrder.js +9 -5
  206. package/lib/chevre/service/payment/any/factory.d.ts +1 -1
  207. package/lib/chevre/service/payment/any/onPaid.d.ts +1 -1
  208. package/lib/chevre/service/payment/any/onRefund.d.ts +1 -1
  209. package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.d.ts +1 -6
  210. package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.js +26 -34
  211. package/lib/chevre/service/payment/any.d.ts +3 -3
  212. package/lib/chevre/service/payment/any.js +21 -13
  213. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.js +1 -1
  214. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard3ds.js +1 -1
  215. package/lib/chevre/service/payment/creditCard/payCreditCard.d.ts +1 -2
  216. package/lib/chevre/service/payment/creditCard/payCreditCard.js +12 -5
  217. package/lib/chevre/service/payment/creditCard/refundCreditCard.js +13 -3
  218. package/lib/chevre/service/payment/creditCard/voidTransaction.js +1 -1
  219. package/lib/chevre/service/payment/faceToFace.d.ts +2 -2
  220. package/lib/chevre/service/payment/faceToFace.js +28 -10
  221. package/lib/chevre/service/payment/movieTicket/authorize.d.ts +0 -1
  222. package/lib/chevre/service/payment/movieTicket/authorize.js +8 -3
  223. package/lib/chevre/service/payment/movieTicket/payMovieTicket.d.ts +1 -2
  224. package/lib/chevre/service/payment/movieTicket/payMovieTicket.js +12 -4
  225. package/lib/chevre/service/payment/movieTicket/refundMovieTicket.js +15 -4
  226. package/lib/chevre/service/payment/movieTicket/validation.js +1 -1
  227. package/lib/chevre/service/payment/paymentCard.d.ts +2 -2
  228. package/lib/chevre/service/payment/paymentCard.js +29 -16
  229. package/lib/chevre/service/payment.d.ts +1 -1
  230. package/lib/chevre/service/report/ownershipInfo.d.ts +3 -1
  231. package/lib/chevre/service/report/telemetry.js +2 -2
  232. package/lib/chevre/service/reserve/cancelReservation.js +1 -1
  233. package/lib/chevre/service/reserve/confirmReservation.js +1 -1
  234. package/lib/chevre/service/task/authorizePayment.js +0 -2
  235. package/lib/chevre/service/task/onAuthorizationCreated.js +20 -16
  236. package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +2 -2
  237. package/lib/chevre/service/task/onResourceUpdated/syncCategoryCode.js +1 -1
  238. package/lib/chevre/service/task/onResourceUpdated.js +16 -4
  239. package/lib/chevre/service/task/publishPaymentUrl.js +4 -0
  240. package/lib/chevre/service/task/returnPayTransaction.js +1 -1
  241. package/lib/chevre/service/transaction/deleteTransaction.js +2 -2
  242. package/lib/chevre/service/transaction/moneyTransfer.js +4 -4
  243. package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +1 -1
  244. package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +36 -2
  245. package/lib/chevre/service/transaction/placeOrder/confirm.js +2 -2
  246. package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +1 -1
  247. package/lib/chevre/service/transaction/placeOrder/start/validateStartRequest.d.ts +2 -2
  248. package/lib/chevre/service/transaction/placeOrder/start/validateStartRequest.js +1 -1
  249. package/lib/chevre/service/transaction/placeOrder/start.js +1 -1
  250. package/lib/chevre/service/transaction/returnOrder/preStart.d.ts +2 -2
  251. package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -1
  252. package/lib/chevre/service/transaction/returnOrder.js +2 -2
  253. package/lib/chevre/service/transaction.js +1 -1
  254. package/package.json +4 -4
  255. package/example/src/chevre/findTransactionById.ts +0 -23
  256. package/example/src/chevre/findTransactionInProgressById.ts +0 -23
  257. package/example/src/chevre/migrateTransactionObjectPaymentMethods.ts +0 -154
  258. package/example/src/chevre/projectReservationFields.ts +0 -31
  259. package/example/src/chevre/searchActions.ts +0 -40
  260. package/example/src/chevre/searchProducts.ts +0 -28
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createSchema = exports.indexes = exports.modelName = void 0;
3
+ exports.modelName = exports.indexes = exports.createSchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  const writeConcern_1 = require("../writeConcern");
6
6
  const settings_1 = require("../../../settings");
@@ -22,6 +22,9 @@ const schemaDefinition = {
22
22
  },
23
23
  url: String,
24
24
  telephone: String
25
+ // createdAt: SchemaTypes.Mixed,
26
+ // updatedAt: SchemaTypes.Mixed,
27
+ // __v: SchemaTypes.Mixed
25
28
  };
26
29
  const schemaOptions = {
27
30
  autoIndex: settings_1.MONGO_AUTO_INDEX,
@@ -32,10 +35,8 @@ const schemaOptions = {
32
35
  writeConcern: writeConcern_1.writeConcern,
33
36
  strict: true,
34
37
  strictQuery: false,
35
- timestamps: {
36
- createdAt: 'createdAt',
37
- updatedAt: 'updatedAt'
38
- },
38
+ timestamps: false,
39
+ versionKey: false,
39
40
  toJSON: {
40
41
  getters: false,
41
42
  virtuals: false,
@@ -49,26 +50,7 @@ const schemaOptions = {
49
50
  versionKey: false
50
51
  }
51
52
  };
52
- /**
53
- * 販売者スキーマ
54
- */
55
- let schema;
56
- function createSchema() {
57
- if (schema === undefined) {
58
- schema = new mongoose_1.Schema(schemaDefinition, schemaOptions);
59
- }
60
- return schema;
61
- }
62
- exports.createSchema = createSchema;
63
53
  const indexes = [
64
- [
65
- { createdAt: 1 },
66
- { name: 'searchByCreatedAt' }
67
- ],
68
- [
69
- { updatedAt: 1 },
70
- { name: 'searchByUpdatedAt' }
71
- ],
72
54
  [
73
55
  { branchCode: 1 },
74
56
  { name: 'searchByBranchCode' }
@@ -139,3 +121,19 @@ const indexes = [
139
121
  ]
140
122
  ];
141
123
  exports.indexes = indexes;
124
+ /**
125
+ * 販売者スキーマ
126
+ */
127
+ let schema;
128
+ function createSchema() {
129
+ if (schema === undefined) {
130
+ schema = new mongoose_1.Schema(schemaDefinition, schemaOptions);
131
+ if (settings_1.MONGO_AUTO_INDEX) {
132
+ indexes.forEach((indexParams) => {
133
+ schema === null || schema === void 0 ? void 0 : schema.index(...indexParams);
134
+ });
135
+ }
136
+ }
137
+ return schema;
138
+ }
139
+ exports.createSchema = createSchema;
@@ -1,5 +1,10 @@
1
- import { IndexDefinition, IndexOptions, Schema } from 'mongoose';
1
+ import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
2
+ import * as factory from '../../../factory';
3
+ type IDocType = factory.permit.IPermit;
4
+ type IModel = Model<IDocType>;
5
+ type ISchemaDefinition = SchemaDefinition<IDocType>;
6
+ type ISchema = Schema<IDocType, IModel, {}, {}, {}, {}, ISchemaDefinition, IDocType>;
2
7
  declare const modelName = "ServiceOutput";
3
- declare function createSchema(): Schema;
8
+ declare function createSchema(): ISchema;
4
9
  declare const indexes: [d: IndexDefinition, o: IndexOptions][];
5
- export { modelName, indexes, createSchema };
10
+ export { createSchema, IModel, indexes, modelName };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createSchema = exports.indexes = exports.modelName = void 0;
3
+ exports.modelName = exports.indexes = exports.createSchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  const writeConcern_1 = require("../writeConcern");
6
6
  const settings_1 = require("../../../settings");
@@ -1,5 +1,10 @@
1
- import { IndexDefinition, IndexOptions, Schema } from 'mongoose';
1
+ import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
2
+ import * as factory from '../../../factory';
3
+ type IDocType = Omit<factory.task.ITask<factory.taskName>, 'id'>;
4
+ type IModel = Model<IDocType>;
5
+ type ISchemaDefinition = SchemaDefinition<IDocType>;
6
+ type ISchema = Schema<IDocType, IModel, {}, {}, {}, {}, ISchemaDefinition, IDocType>;
2
7
  declare const modelName = "Task";
3
8
  declare const indexes: [d: IndexDefinition, o: IndexOptions][];
4
- declare function createSchema(): Schema;
5
- export { modelName, indexes, createSchema };
9
+ declare function createSchema(): ISchema;
10
+ export { createSchema, IModel, indexes, modelName };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createSchema = exports.indexes = exports.modelName = void 0;
3
+ exports.modelName = exports.indexes = exports.createSchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  const writeConcern_1 = require("../writeConcern");
6
6
  const settings_1 = require("../../../settings");
@@ -1,5 +1,9 @@
1
- import { IndexDefinition, IndexOptions, Schema } from 'mongoose';
1
+ import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
2
+ type IDocType = any;
3
+ type IModel = Model<IDocType>;
4
+ type ISchemaDefinition = SchemaDefinition<IDocType>;
5
+ type ISchema = Schema<IDocType, IModel, {}, {}, {}, {}, ISchemaDefinition, IDocType>;
2
6
  declare const modelName = "Telemetry";
3
- declare function createSchema(): Schema;
7
+ declare function createSchema(): ISchema;
4
8
  declare const indexes: [d: IndexDefinition, o: IndexOptions][];
5
- export { modelName, indexes, createSchema };
9
+ export { createSchema, IModel, indexes, modelName };
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createSchema = exports.indexes = exports.modelName = void 0;
3
+ exports.modelName = exports.indexes = exports.createSchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  const writeConcern_1 = require("../writeConcern");
6
+ // import * as factory from '../../../factory';
6
7
  const settings_1 = require("../../../settings");
7
8
  const modelName = 'Telemetry';
8
9
  exports.modelName = modelName;
@@ -1,5 +1,28 @@
1
- import { IndexDefinition, IndexOptions, Schema } from 'mongoose';
1
+ import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
2
+ import * as factory from '../../../factory';
3
+ export interface ITicketIssuedBy {
4
+ id: string;
5
+ typeOf: factory.organizationType.Corporation | factory.organizationType.Project;
6
+ }
7
+ export interface ITicket {
8
+ /**
9
+ * チケットID(jti)
10
+ */
11
+ id: string;
12
+ project: {
13
+ id: string;
14
+ typeOf: factory.organizationType.Project;
15
+ };
16
+ typeOf: 'Ticket';
17
+ ticketToken: string;
18
+ dateIssued: Date;
19
+ issuedBy: ITicketIssuedBy;
20
+ }
21
+ type IDocType = Omit<ITicket, 'id'>;
22
+ type IModel = Model<IDocType>;
23
+ type ISchemaDefinition = SchemaDefinition<IDocType>;
24
+ type ISchema = Schema<IDocType, IModel, {}, {}, {}, {}, ISchemaDefinition, IDocType>;
2
25
  declare const modelName = "Ticket";
3
26
  declare const indexes: [d: IndexDefinition, o: IndexOptions][];
4
- declare function createSchema(): Schema;
5
- export { modelName, indexes, createSchema };
27
+ declare function createSchema(): ISchema;
28
+ export { createSchema, IModel, indexes, modelName };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createSchema = exports.indexes = exports.modelName = void 0;
3
+ exports.modelName = exports.indexes = exports.createSchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  const writeConcern_1 = require("../writeConcern");
6
6
  const settings_1 = require("../../../settings");
@@ -1,5 +1,10 @@
1
- import { IndexDefinition, IndexOptions, Schema } from 'mongoose';
1
+ import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
2
+ import * as factory from '../../../factory';
3
+ type IDocType = factory.transaction.ITransaction<factory.transactionType>;
4
+ type IModel = Model<IDocType>;
5
+ type ISchemaDefinition = SchemaDefinition<IDocType>;
6
+ type ISchema = Schema<IDocType, IModel, {}, {}, {}, {}, ISchemaDefinition, IDocType>;
2
7
  declare const modelName = "Transaction";
3
8
  declare const indexes: [d: IndexDefinition, o: IndexOptions][];
4
- declare function createSchema(): Schema;
5
- export { modelName, indexes, createSchema };
9
+ declare function createSchema(): ISchema;
10
+ export { createSchema, IModel, indexes, modelName };
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createSchema = exports.indexes = exports.modelName = void 0;
3
+ exports.modelName = exports.indexes = exports.createSchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
- const factory = require("../../../factory");
6
5
  const writeConcern_1 = require("../writeConcern");
6
+ const factory = require("../../../factory");
7
7
  const settings_1 = require("../../../settings");
8
8
  const modelName = 'Transaction';
9
9
  exports.modelName = modelName;
@@ -1,5 +1,10 @@
1
- import { IndexDefinition, IndexOptions, Schema } from 'mongoose';
1
+ import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
2
+ import * as factory from '../../../factory';
3
+ type IDocType = Omit<factory.trip.ITrip<factory.tripType>, 'id'>;
4
+ type IModel = Model<IDocType>;
5
+ type ISchemaDefinition = SchemaDefinition<IDocType>;
6
+ type ISchema = Schema<IDocType, IModel, {}, {}, {}, {}, ISchemaDefinition, IDocType>;
2
7
  declare const modelName = "Trip";
3
- declare function createSchema(): Schema;
4
8
  declare const indexes: [d: IndexDefinition, o: IndexOptions][];
5
- export { modelName, indexes, createSchema };
9
+ declare function createSchema(): ISchema;
10
+ export { createSchema, IModel, indexes, modelName };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createSchema = exports.indexes = exports.modelName = void 0;
3
+ exports.modelName = exports.indexes = exports.createSchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  const writeConcern_1 = require("../writeConcern");
6
6
  const settings_1 = require("../../../settings");
@@ -39,6 +39,8 @@ const schemaOptions = {
39
39
  versionKey: false
40
40
  }
41
41
  };
42
+ const indexes = [];
43
+ exports.indexes = indexes;
42
44
  /**
43
45
  * トリップスキーマ
44
46
  */
@@ -50,5 +52,3 @@ function createSchema() {
50
52
  return schema;
51
53
  }
52
54
  exports.createSchema = createSchema;
53
- const indexes = [];
54
- exports.indexes = indexes;
@@ -23,8 +23,9 @@
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
25
  import type { BulkWriteResult } from 'mongodb';
26
- import { AnyExpression, Connection, PipelineStage } from 'mongoose';
26
+ import { AnyExpression, Connection, Document, PipelineStage } from 'mongoose';
27
27
  import * as factory from '../factory';
28
+ import { IDocType as IAggregateOfferDocType } from './mongoose/schemas/aggregateOffer';
28
29
  type IMatchStage = PipelineStage.Match;
29
30
  type KeyOfUnitPriceOffer = keyof Omit<factory.unitPriceOffer.IUnitPriceOffer, 'id'>;
30
31
  type IProjection = {
@@ -216,7 +217,11 @@ export declare class OfferRepo {
216
217
  };
217
218
  };
218
219
  }): Promise<import("mongodb").UpdateResult | undefined>;
219
- getCursor(conditions: any, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;
220
+ getCursor(conditions: any, projection: any): import("mongoose").Cursor<Document<unknown, {}, IAggregateOfferDocType> & Omit<IAggregateOfferDocType & Required<{
221
+ _id: string;
222
+ }>, never>, import("mongoose").QueryOptions<Document<unknown, {}, IAggregateOfferDocType> & Omit<IAggregateOfferDocType & Required<{
223
+ _id: string;
224
+ }>, never>>>;
220
225
  addAvailableAtOrFrom(params: {
221
226
  id: string;
222
227
  identifier: string;
@@ -225,7 +230,9 @@ export declare class OfferRepo {
225
230
  id: string;
226
231
  };
227
232
  };
228
- }): Promise<any>;
233
+ }): Promise<(Document<unknown, {}, IAggregateOfferDocType> & Omit<IAggregateOfferDocType & Required<{
234
+ _id: string;
235
+ }>, never>) | null>;
229
236
  deleteAvailableAtOrFrom(params: {
230
237
  id: string;
231
238
  offers: {
@@ -233,7 +240,9 @@ export declare class OfferRepo {
233
240
  id: string;
234
241
  };
235
242
  };
236
- }): Promise<any>;
243
+ }): Promise<(Document<unknown, {}, IAggregateOfferDocType> & Omit<IAggregateOfferDocType & Required<{
244
+ _id: string;
245
+ }>, never>) | null>;
237
246
  /**
238
247
  * サブカタログから集計オファーIDリストを検索する
239
248
  */
@@ -23,8 +23,9 @@
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
25
  import type { BulkWriteResult } from 'mongodb';
26
- import type { Connection } from 'mongoose';
26
+ import type { Connection, Document } from 'mongoose';
27
27
  import * as factory from '../factory';
28
+ import { IDocType } from './mongoose/schemas/offerCatalog';
28
29
  export type IAggregatedOfferCatalog = Pick<factory.offerCatalog.IOfferCatalog, 'id' | 'name' | 'description' | 'project' | 'typeOf' | 'identifier' | 'itemOffered' | 'additionalProperty'> & {
29
30
  numberOfItems?: number;
30
31
  itemListElementTypeOf: factory.offerType.Offer | 'OfferCatalog';
@@ -136,5 +137,17 @@ export declare class OfferCatalogRepo {
136
137
  id: string;
137
138
  };
138
139
  }): Promise<void>;
139
- getCursor(conditions: any, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;
140
+ getCursor(conditions: any, projection: any): import("mongoose").Cursor<Document<unknown, {}, IDocType> & Omit<factory.offerCatalog.IOfferCatalog & {
141
+ _id: string;
142
+ alternateName?: any;
143
+ dateSynced?: Date | undefined;
144
+ } & Required<{
145
+ _id: string;
146
+ }>, never>, import("mongoose").QueryOptions<Document<unknown, {}, IDocType> & Omit<factory.offerCatalog.IOfferCatalog & {
147
+ _id: string;
148
+ alternateName?: any;
149
+ dateSynced?: Date | undefined;
150
+ } & Required<{
151
+ _id: string;
152
+ }>, never>>>;
140
153
  }
@@ -160,7 +160,19 @@ export declare class OrderRepo {
160
160
  }): Promise<(IOrderWithoutAcceptedOffers & {
161
161
  id: string;
162
162
  })[]>;
163
- getCursor(conditions: any, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;
163
+ getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, Omit<factory.order.IOrder, "id"> & {
164
+ acceptedOffers?: factory.order.IAcceptedOffer<factory.order.IItemOffered>[] | undefined;
165
+ }> & Omit<Omit<factory.order.IOrder, "id"> & {
166
+ acceptedOffers?: factory.order.IAcceptedOffer<factory.order.IItemOffered>[] | undefined;
167
+ } & {
168
+ _id: import("mongoose").Types.ObjectId;
169
+ }, never>, import("mongoose").QueryOptions<import("mongoose").Document<unknown, {}, Omit<factory.order.IOrder, "id"> & {
170
+ acceptedOffers?: factory.order.IAcceptedOffer<factory.order.IItemOffered>[] | undefined;
171
+ }> & Omit<Omit<factory.order.IOrder, "id"> & {
172
+ acceptedOffers?: factory.order.IAcceptedOffer<factory.order.IItemOffered>[] | undefined;
173
+ } & {
174
+ _id: import("mongoose").Types.ObjectId;
175
+ }, never>>>;
164
176
  unsetUnnecessaryFields(params: {
165
177
  filter: FilterQuery<factory.order.IOrder>;
166
178
  $unset: any;
@@ -24,7 +24,9 @@
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
25
  import type { Connection } from 'mongoose';
26
26
  import * as factory from '../factory';
27
- export type IOwnershipInfo = factory.ownershipInfo.IOwnershipInfo<factory.ownershipInfo.IGood>;
27
+ export type IOwnershipInfoWithId = factory.ownershipInfo.IOwnershipInfo<factory.ownershipInfo.IGood> & {
28
+ id: string;
29
+ };
28
30
  /**
29
31
  * 所有権リポジトリ
30
32
  */
@@ -35,14 +37,16 @@ export declare class OwnershipInfoRepo {
35
37
  /**
36
38
  * なければ作成する
37
39
  */
38
- createIfNotExistByIdentifier(ownershipInfo: IOwnershipInfo): Promise<IOwnershipInfo>;
39
- findById(params: {
40
+ createIfNotExistByIdentifier(ownershipInfo: Omit<IOwnershipInfoWithId, 'id'>): Promise<{
40
41
  id: string;
41
- }, projection?: any): Promise<IOwnershipInfo>;
42
+ }>;
43
+ projectFieldsById(params: {
44
+ id: string;
45
+ }, inclusion?: (keyof IOwnershipInfoWithId)[]): Promise<IOwnershipInfoWithId>;
42
46
  /**
43
47
  * 所有権を検索する
44
48
  */
45
- search(params: factory.ownershipInfo.ISearchConditions, projection?: any): Promise<IOwnershipInfo[]>;
49
+ projectFields(params: factory.ownershipInfo.ISearchConditions, inclusion?: (keyof IOwnershipInfoWithId)[]): Promise<IOwnershipInfoWithId[]>;
46
50
  /**
47
51
  * 識別子から所有期限を変更する
48
52
  * 存在しない場合undefinedを返す
@@ -53,7 +57,7 @@ export declare class OwnershipInfoRepo {
53
57
  };
54
58
  identifier: string;
55
59
  ownedThrough: Date;
56
- }): Promise<IOwnershipInfo | undefined>;
60
+ }): Promise<Pick<IOwnershipInfoWithId, 'id' | 'identifier'> | undefined>;
57
61
  /**
58
62
  * 所有者の所有権を全て削除する
59
63
  */
@@ -93,7 +97,19 @@ export declare class OwnershipInfoRepo {
93
97
  $lt: Date;
94
98
  };
95
99
  }): Promise<void>;
96
- getCursor(conditions: any, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;
100
+ getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, factory.ownershipInfo.IOwnershipInfo<factory.ownershipInfo.IGood> & {
101
+ _id: string;
102
+ }> & Omit<factory.ownershipInfo.IOwnershipInfo<factory.ownershipInfo.IGood> & {
103
+ _id: string;
104
+ } & Required<{
105
+ _id: string;
106
+ }>, never>, import("mongoose").QueryOptions<import("mongoose").Document<unknown, {}, factory.ownershipInfo.IOwnershipInfo<factory.ownershipInfo.IGood> & {
107
+ _id: string;
108
+ }> & Omit<factory.ownershipInfo.IOwnershipInfo<factory.ownershipInfo.IGood> & {
109
+ _id: string;
110
+ } & Required<{
111
+ _id: string;
112
+ }>, never>>>;
97
113
  /**
98
114
  * 所有者を追加する
99
115
  */
@@ -233,11 +233,14 @@ class OwnershipInfoRepo {
233
233
  new: true,
234
234
  upsert: true,
235
235
  projection: {
236
- __v: 0,
237
- createdAt: 0,
238
- updatedAt: 0
236
+ _id: 0,
237
+ id: { $toString: '$_id' }
238
+ // __v: 0,
239
+ // createdAt: 0,
240
+ // updatedAt: 0
239
241
  }
240
242
  })
243
+ .lean()
241
244
  .exec();
242
245
  }
243
246
  catch (error) {
@@ -254,36 +257,76 @@ class OwnershipInfoRepo {
254
257
  if (duplicate) {
255
258
  // 重複の場合、再度取得
256
259
  doc = yield this.ownershipInfoModel.findOne({ identifier: { $eq: ownershipInfo.identifier } }, {
257
- __v: 0,
258
- createdAt: 0,
259
- updatedAt: 0
260
+ _id: 0,
261
+ id: { $toString: '$_id' }
262
+ // __v: 0,
263
+ // createdAt: 0,
264
+ // updatedAt: 0
260
265
  })
266
+ .lean()
261
267
  .exec();
262
268
  }
263
269
  if (doc === undefined || doc === null) {
264
270
  throw new factory.errors.NotFound(this.ownershipInfoModel.modelName);
265
271
  }
266
- return doc.toObject();
272
+ return { id: doc.id };
267
273
  });
268
274
  }
269
- findById(params, projection) {
275
+ projectFieldsById(params, inclusion) {
270
276
  return __awaiter(this, void 0, void 0, function* () {
271
- const doc = yield this.ownershipInfoModel.findById(params.id, Object.assign({ __v: 0, createdAt: 0, updatedAt: 0 }, projection))
277
+ let projection = {
278
+ _id: 0,
279
+ id: { $toString: '$_id' },
280
+ project: 1,
281
+ typeOf: 1,
282
+ identifier: 1,
283
+ ownedBy: 1,
284
+ acquiredFrom: 1,
285
+ ownedFrom: 1,
286
+ ownedThrough: 1,
287
+ typeOfGood: 1
288
+ };
289
+ const positiveProjectionFields = (Array.isArray(inclusion))
290
+ ? inclusion.filter((key) => key !== 'id' && String(key) !== '_id')
291
+ : undefined;
292
+ if (Array.isArray(positiveProjectionFields)) {
293
+ projection = Object.assign({ _id: 0, id: { $toString: '$_id' } }, Object.fromEntries(positiveProjectionFields.map((key) => ([key, 1]))));
294
+ }
295
+ const doc = yield this.ownershipInfoModel.findOne({ _id: { $eq: params.id } }, projection)
296
+ .lean() // lean(2024-08-15~)
272
297
  .exec();
273
298
  if (doc === null) {
274
299
  throw new factory.errors.NotFound(this.ownershipInfoModel.modelName);
275
300
  }
276
- return doc.toObject();
301
+ return doc;
277
302
  });
278
303
  }
279
304
  /**
280
305
  * 所有権を検索する
281
306
  */
282
- search(params, projection) {
307
+ projectFields(params, inclusion) {
283
308
  var _a;
284
309
  return __awaiter(this, void 0, void 0, function* () {
285
310
  const conditions = OwnershipInfoRepo.CREATE_MONGO_CONDITIONS(params);
286
- const query = this.ownershipInfoModel.find((conditions.length > 0) ? { $and: conditions } : {}, Object.assign({ __v: 0, createdAt: 0, updatedAt: 0 }, projection));
311
+ let projection = {
312
+ _id: 0,
313
+ id: { $toString: '$_id' },
314
+ project: 1,
315
+ typeOf: 1,
316
+ identifier: 1,
317
+ ownedBy: 1,
318
+ acquiredFrom: 1,
319
+ ownedFrom: 1,
320
+ ownedThrough: 1,
321
+ typeOfGood: 1
322
+ };
323
+ const positiveProjectionFields = (Array.isArray(inclusion))
324
+ ? inclusion.filter((key) => key !== 'id' && String(key) !== '_id')
325
+ : undefined;
326
+ if (Array.isArray(positiveProjectionFields)) {
327
+ projection = Object.assign({ _id: 0, id: { $toString: '$_id' } }, Object.fromEntries(positiveProjectionFields.map((key) => ([key, 1]))));
328
+ }
329
+ const query = this.ownershipInfoModel.find((conditions.length > 0) ? { $and: conditions } : {}, projection);
287
330
  if (typeof params.limit === 'number' && params.limit > 0) {
288
331
  const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
289
332
  query.limit(params.limit)
@@ -295,8 +338,8 @@ class OwnershipInfoRepo {
295
338
  query.sort({ ownedFrom: params.sort.ownedFrom });
296
339
  }
297
340
  return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
298
- .exec()
299
- .then((docs) => docs.map((doc) => doc.toObject()));
341
+ .lean() // lean(2024-08-19~)
342
+ .exec();
300
343
  });
301
344
  }
302
345
  /**
@@ -308,8 +351,15 @@ class OwnershipInfoRepo {
308
351
  return this.ownershipInfoModel.findOneAndUpdate({
309
352
  'project.id': { $eq: params.project.id },
310
353
  identifier: { $eq: String(params.identifier) }
311
- }, { ownedThrough: params.ownedThrough }, { new: true })
312
- .select({ __v: 0, createdAt: 0, updatedAt: 0 })
354
+ }, { ownedThrough: params.ownedThrough }, {
355
+ new: true,
356
+ projection: {
357
+ _id: 0,
358
+ id: { $toString: '$_id' },
359
+ identifier: 1
360
+ }
361
+ })
362
+ .lean()
313
363
  .exec()
314
364
  .then((doc) => {
315
365
  // 存在しない場合も正常にハンドルする
@@ -317,7 +367,7 @@ class OwnershipInfoRepo {
317
367
  return;
318
368
  }
319
369
  else {
320
- return doc.toObject();
370
+ return doc;
321
371
  }
322
372
  });
323
373
  });
@@ -404,7 +454,10 @@ class OwnershipInfoRepo {
404
454
  };
405
455
  }
406
456
  if (newOwner !== undefined) {
407
- const doc = yield this.ownershipInfoModel.findOneAndUpdate({ _id: { $eq: params.id } }, { $addToSet: { ownedBy: newOwner } }, { new: true })
457
+ const doc = yield this.ownershipInfoModel.findOneAndUpdate({ _id: { $eq: params.id } }, { $addToSet: { ownedBy: newOwner } }, {
458
+ new: true,
459
+ projection: { _id: 1 }
460
+ })
408
461
  .exec();
409
462
  if (doc === null) {
410
463
  throw new factory.errors.NotFound(this.ownershipInfoModel.modelName);
@@ -420,7 +473,10 @@ class OwnershipInfoRepo {
420
473
  if (typeof params.ownedBy.id !== 'string' || params.ownedBy.id.length === 0) {
421
474
  throw new factory.errors.ArgumentNull('ownedBy.id');
422
475
  }
423
- const doc = yield this.ownershipInfoModel.findOneAndUpdate({ _id: { $eq: params.id } }, { $pull: { ownedBy: { id: params.ownedBy.id } } }, { new: true })
476
+ const doc = yield this.ownershipInfoModel.findOneAndUpdate({ _id: { $eq: params.id } }, { $pull: { ownedBy: { id: params.ownedBy.id } } }, {
477
+ new: true,
478
+ projection: { _id: 1 }
479
+ })
424
480
  .exec();
425
481
  if (doc === null) {
426
482
  throw new factory.errors.NotFound(this.ownershipInfoModel.modelName);
@@ -1,7 +1,7 @@
1
1
  import type { Connection, FilterQuery } from 'mongoose';
2
2
  import * as factory from '../factory';
3
3
  type IUnsetKey = keyof Pick<factory.service.paymentService.IService, 'additionalProperty' | 'availableChannel' | 'serviceOutput' | 'serviceType'>;
4
- type IKeyOfProjection4paymentService = keyof factory.service.paymentService.IService | '_id';
4
+ type IKeyOfProjection4paymentService = keyof factory.service.paymentService.IService;
5
5
  /**
6
6
  * 決済サービス検索条件
7
7
  */
@@ -37,7 +37,7 @@ export declare class PaymentServiceRepo {
37
37
  /**
38
38
  * 決済サービスを検索する
39
39
  */
40
- searchPaymentServices(conditions: ISearchConditions4paymentService, inclusion: IKeyOfProjection4paymentService[], exclusion: IKeyOfProjection4paymentService[]): Promise<(factory.service.paymentService.IService & {
40
+ projectFields(conditions: ISearchConditions4paymentService, inclusion: IKeyOfProjection4paymentService[], exclusion: IKeyOfProjection4paymentService[]): Promise<(factory.service.paymentService.IService & {
41
41
  id: string;
42
42
  })[]>;
43
43
  deletePaymentServiceById(params: {