@chevre/domain 24.1.0-alpha.9 → 25.0.0-alpha.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 (223) hide show
  1. package/lib/chevre/emailMessageBuilder.d.ts +1 -1
  2. package/lib/chevre/emailMessageBuilder.js +4 -12
  3. package/lib/chevre/factory/transaction/placeOrder.d.ts +2 -10
  4. package/lib/chevre/factory/transaction/placeOrder.js +1 -0
  5. package/lib/chevre/index.d.ts +1 -2
  6. package/lib/chevre/index.js +1 -3
  7. package/lib/chevre/repo/acceptedOffer.d.ts +25 -27
  8. package/lib/chevre/repo/acceptedOffer.js +102 -67
  9. package/lib/chevre/repo/acceptedOfferInReserve.d.ts +34 -0
  10. package/lib/chevre/repo/acceptedOfferInReserve.js +86 -0
  11. package/lib/chevre/repo/accountingReport.js +2 -30
  12. package/lib/chevre/repo/action/actionProcess.d.ts +1 -1
  13. package/lib/chevre/repo/assetTransaction/reserve.d.ts +1 -2
  14. package/lib/chevre/repo/assetTransaction/reserve.js +4 -50
  15. package/lib/chevre/repo/event.js +12 -8
  16. package/lib/chevre/repo/factory/acceptedOffer/reserveTransaction2itemOffered.d.ts +9 -0
  17. package/lib/chevre/repo/factory/acceptedOffer/reserveTransaction2itemOffered.js +76 -0
  18. package/lib/chevre/repo/factory/reservation/createMongoConditions.d.ts +1 -1
  19. package/lib/chevre/repo/factory/reservation/createMongoConditions.js +171 -363
  20. package/lib/chevre/repo/mongoose/schemas/accountingReport.js +42 -42
  21. package/lib/chevre/repo/mongoose/schemas/order.js +35 -32
  22. package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +3 -2
  23. package/lib/chevre/repo/mongoose/schemas/reservation.js +6 -57
  24. package/lib/chevre/repo/mongoose/schemas/setting.d.ts +84 -0
  25. package/lib/chevre/repo/mongoose/schemas/setting.js +2 -1
  26. package/lib/chevre/repo/order.d.ts +1 -82
  27. package/lib/chevre/repo/order.js +11 -372
  28. package/lib/chevre/repo/orderInTransaction.d.ts +58 -7
  29. package/lib/chevre/repo/orderInTransaction.js +58 -4
  30. package/lib/chevre/repo/place/hasPOS.js +2 -1
  31. package/lib/chevre/repo/reservation.d.ts +20 -9
  32. package/lib/chevre/repo/reservation.js +16 -12
  33. package/lib/chevre/repo/role.d.ts +1 -15
  34. package/lib/chevre/repo/role.js +7 -14
  35. package/lib/chevre/repo/setting/integration.d.ts +27 -0
  36. package/lib/chevre/repo/setting/integration.js +102 -0
  37. package/lib/chevre/repo/transaction/placeOrder.d.ts +8 -3
  38. package/lib/chevre/repo/transaction/placeOrder.js +5 -1
  39. package/lib/chevre/repo/transaction.d.ts +6 -6
  40. package/lib/chevre/repo/transaction.js +0 -776
  41. package/lib/chevre/repository.d.ts +5 -0
  42. package/lib/chevre/repository.js +11 -0
  43. package/lib/chevre/service/aggregation/event/aggregateOffers.js +6 -1
  44. package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +0 -1
  45. package/lib/chevre/service/assetTransaction/cancelReservation/factory.js +14 -11
  46. package/lib/chevre/service/assetTransaction/cancelReservation/start.d.ts +1 -1
  47. package/lib/chevre/service/assetTransaction/cancelReservation/start.js +1 -1
  48. package/lib/chevre/service/assetTransaction/pay/check.d.ts +1 -1
  49. package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.d.ts +1 -1
  50. package/lib/chevre/service/assetTransaction/pay/searchGMOTrade.d.ts +1 -1
  51. package/lib/chevre/service/assetTransaction/pay/start/processAuthorize.d.ts +1 -1
  52. package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeCreditCard.d.ts +1 -1
  53. package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeMovieTicket.d.ts +1 -1
  54. package/lib/chevre/service/assetTransaction/pay/start.d.ts +1 -1
  55. package/lib/chevre/service/assetTransaction/reserve/cancel.d.ts +1 -1
  56. package/lib/chevre/service/assetTransaction/reserve/confirm.d.ts +1 -1
  57. package/lib/chevre/service/assetTransaction/reserve/start/createSubReservations.js +2 -2
  58. package/lib/chevre/service/assetTransaction/reserve/start/factory/createReservation.d.ts +1 -8
  59. package/lib/chevre/service/assetTransaction/reserve/start/factory/createReservation.js +20 -32
  60. package/lib/chevre/service/assetTransaction/reserve/start/factory/price.d.ts +1 -1
  61. package/lib/chevre/service/assetTransaction/reserve/start.d.ts +1 -1
  62. package/lib/chevre/service/delivery/factory.d.ts +6 -1
  63. package/lib/chevre/service/delivery/factory.js +1 -1
  64. package/lib/chevre/service/delivery/reservation/factory.d.ts +1 -3
  65. package/lib/chevre/service/delivery/reservation/factory.js +0 -17
  66. package/lib/chevre/service/notification/notifyAbortedTasksByEmail.d.ts +2 -4
  67. package/lib/chevre/service/notification/notifyAbortedTasksByEmail.js +3 -3
  68. package/lib/chevre/service/notification/notifyByEmail.d.ts +3 -3
  69. package/lib/chevre/service/notification/notifyByEmail.js +7 -12
  70. package/lib/chevre/service/notification/sendEmailMessage.d.ts +2 -3
  71. package/lib/chevre/service/notification/sendEmailMessage.js +5 -4
  72. package/lib/chevre/service/offer/any.d.ts +7 -2
  73. package/lib/chevre/service/offer/event/authorize/factory.d.ts +6 -3
  74. package/lib/chevre/service/offer/event/authorize/factory.js +17 -18
  75. package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +1 -1
  76. package/lib/chevre/service/offer/event/authorize.d.ts +2 -2
  77. package/lib/chevre/service/offer/event/authorize.js +55 -107
  78. package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.d.ts +1 -1
  79. package/lib/chevre/service/offer/event/voidTransaction.d.ts +1 -1
  80. package/lib/chevre/service/offer/event/voidTransactionByActionId.d.ts +1 -1
  81. package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +1 -3
  82. package/lib/chevre/service/order/deleteOrder.d.ts +1 -1
  83. package/lib/chevre/service/order/deleteOrder.js +19 -46
  84. package/lib/chevre/service/order/{findPlaceOrderTransaction.d.ts → findConfirmedPlaceOrder.d.ts} +1 -1
  85. package/lib/chevre/service/order/{findPlaceOrderTransaction.js → findConfirmedPlaceOrder.js} +12 -7
  86. package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionCanceled.js +2 -2
  87. package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.d.ts +1 -1
  88. package/lib/chevre/service/order/onAssetTransactionStatusChanged/onReserveTransactionConfirmed.d.ts +1 -1
  89. package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.d.ts +1 -1
  90. package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.js +11 -18
  91. package/lib/chevre/service/order/onAssetTransactionStatusChanged/processing2inTransit.d.ts +1 -1
  92. package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +1 -1
  93. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered.js +0 -1
  94. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +6 -1
  95. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially.js +0 -1
  96. package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.d.ts +1 -1
  97. package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +1 -1
  98. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +1 -1
  99. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +2 -1
  100. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +0 -1
  101. package/lib/chevre/service/order/onOrderUpdated.js +0 -1
  102. package/lib/chevre/service/order/payOrder.d.ts +1 -1
  103. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.d.ts +1 -1
  104. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +19 -7
  105. package/lib/chevre/service/order/placeOrder/factory/orderedItem.d.ts +1 -1
  106. package/lib/chevre/service/order/placeOrder/factory/orderedItem.js +0 -5
  107. package/lib/chevre/service/order/placeOrder/factory.d.ts +1 -1
  108. package/lib/chevre/service/order/placeOrder/factory.js +33 -22
  109. package/lib/chevre/service/order/placeOrder.d.ts +3 -2
  110. package/lib/chevre/service/order/placeOrder.js +0 -9
  111. package/lib/chevre/service/order/returnOrder.js +0 -1
  112. package/lib/chevre/service/order/sendOrder.js +1 -7
  113. package/lib/chevre/service/payment/any/authorize.d.ts +1 -1
  114. package/lib/chevre/service/payment/any/factory.js +7 -6
  115. package/lib/chevre/service/payment/any/person2username.js +0 -1
  116. package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +1 -1
  117. package/lib/chevre/service/payment/creditCard/authorize.d.ts +1 -1
  118. package/lib/chevre/service/payment/creditCard/authorize.js +4 -3
  119. package/lib/chevre/service/payment/creditCard/payCreditCard.d.ts +1 -1
  120. package/lib/chevre/service/payment/creditCard/payCreditCard.js +1 -1
  121. package/lib/chevre/service/payment/creditCard/refundCreditCard.d.ts +1 -1
  122. package/lib/chevre/service/payment/creditCard/refundCreditCard.js +1 -1
  123. package/lib/chevre/service/payment/creditCard/searchGMOTrade.d.ts +1 -1
  124. package/lib/chevre/service/payment/creditCard/searchGMOTrade.js +1 -1
  125. package/lib/chevre/service/payment/creditCard/voidTransaction.d.ts +1 -1
  126. package/lib/chevre/service/payment/creditCard/voidTransaction.js +1 -1
  127. package/lib/chevre/service/payment/factory/createPayObjectServiceOutput.d.ts +8 -1
  128. package/lib/chevre/service/payment/factory/createPayObjectServiceOutput.js +1 -1
  129. package/lib/chevre/service/payment/movieTicket/authorize.d.ts +1 -1
  130. package/lib/chevre/service/payment/movieTicket/checkMovieTicket.d.ts +1 -1
  131. package/lib/chevre/service/payment/movieTicket/payMovieTicket.d.ts +1 -1
  132. package/lib/chevre/service/payment/movieTicket/payMovieTicket.js +1 -1
  133. package/lib/chevre/service/payment/movieTicket/processPurchaseNumberAuth.d.ts +1 -1
  134. package/lib/chevre/service/payment/movieTicket/processPurchaseNumberAuth.js +1 -1
  135. package/lib/chevre/service/payment/movieTicket/refundMovieTicket.d.ts +1 -1
  136. package/lib/chevre/service/payment/movieTicket/refundMovieTicket.js +2 -2
  137. package/lib/chevre/service/payment/movieTicket/voidTransaction.d.ts +1 -1
  138. package/lib/chevre/service/reserve/confirmReservation.js +7 -7
  139. package/lib/chevre/service/reserve/factory.js +2 -1
  140. package/lib/chevre/service/reserve/findByCode.d.ts +1 -1
  141. package/lib/chevre/service/reserve/findByCode.js +1 -1
  142. package/lib/chevre/service/reserve/findReservations.d.ts +14 -6
  143. package/lib/chevre/service/reserve/findReservations.js +26 -36
  144. package/lib/chevre/service/reserve/potentialActions/onPendingReservationCanceled.js +0 -1
  145. package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +0 -1
  146. package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.d.ts +4 -3
  147. package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +1 -10
  148. package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +0 -1
  149. package/lib/chevre/service/reserve/potentialActions/onReservationsCreated.js +0 -1
  150. package/lib/chevre/service/reserve/searchByOrder.js +7 -3
  151. package/lib/chevre/service/task/acceptCOAOffer.js +6 -3
  152. package/lib/chevre/service/task/authorizePayment.js +4 -2
  153. package/lib/chevre/service/task/cancelPendingReservation.js +4 -2
  154. package/lib/chevre/service/task/checkMovieTicket.js +4 -2
  155. package/lib/chevre/service/task/confirmReserveTransaction.d.ts +1 -1
  156. package/lib/chevre/service/task/confirmReserveTransaction.js +5 -3
  157. package/lib/chevre/service/task/createAccountingReport.js +0 -4
  158. package/lib/chevre/service/task/importEventCapacitiesFromCOA.js +4 -2
  159. package/lib/chevre/service/task/importEventsFromCOA.js +4 -2
  160. package/lib/chevre/service/task/importOffersFromCOA.js +4 -2
  161. package/lib/chevre/service/task/invalidatePaymentUrl.js +3 -1
  162. package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +3 -1
  163. package/lib/chevre/service/task/onOrderPaymentCompleted.js +3 -1
  164. package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +0 -1
  165. package/lib/chevre/service/task/pay.js +4 -2
  166. package/lib/chevre/service/task/payment/invalidatePaymentUrlByTask.d.ts +1 -1
  167. package/lib/chevre/service/task/payment/payByTask.d.ts +1 -1
  168. package/lib/chevre/service/task/payment/payByTask.js +6 -7
  169. package/lib/chevre/service/task/payment/refundByTask.d.ts +1 -1
  170. package/lib/chevre/service/task/payment/voidPaymentByTask.d.ts +1 -1
  171. package/lib/chevre/service/task/placeOrder.js +3 -1
  172. package/lib/chevre/service/task/publishPaymentUrl.js +3 -1
  173. package/lib/chevre/service/task/refund.js +4 -2
  174. package/lib/chevre/service/task/returnReserveTransaction.js +4 -2
  175. package/lib/chevre/service/task/sendEmailMessage.js +5 -3
  176. package/lib/chevre/service/task/syncResourcesFromCOA.js +4 -2
  177. package/lib/chevre/service/task/voidPayment.js +4 -2
  178. package/lib/chevre/service/task/voidReserveTransaction.js +4 -2
  179. package/lib/chevre/service/task.d.ts +0 -7
  180. package/lib/chevre/service/transaction/deleteTransaction.js +13 -7
  181. package/lib/chevre/service/transaction/placeOrder/confirm/factory/result.d.ts +0 -1
  182. package/lib/chevre/service/transaction/placeOrder/confirm/factory/result.js +7 -17
  183. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.d.ts +7 -1
  184. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.js +0 -1
  185. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.d.ts +7 -1
  186. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.js +0 -1
  187. package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateInvoiceReferencesOrder.d.ts +1 -1
  188. package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateMovieTicket.d.ts +1 -1
  189. package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +5 -4
  190. package/lib/chevre/service/transaction/placeOrder/confirm.d.ts +5 -4
  191. package/lib/chevre/service/transaction/placeOrder/confirm.js +55 -58
  192. package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +0 -1
  193. package/lib/chevre/service/transaction/placeOrder/start/factory.d.ts +11 -2
  194. package/lib/chevre/service/transaction/placeOrder/start/factory.js +12 -10
  195. package/lib/chevre/service/transaction/placeOrder/start/validateStartRequest.d.ts +1 -2
  196. package/lib/chevre/service/transaction/placeOrder/start/validateStartRequest.js +5 -16
  197. package/lib/chevre/service/transaction/placeOrder/start.d.ts +3 -4
  198. package/lib/chevre/service/transaction/placeOrder/start.js +2 -2
  199. package/lib/chevre/service/transaction/placeOrder/updateAgent.js +0 -1
  200. package/lib/chevre/service/transaction/placeOrder.d.ts +2 -2
  201. package/lib/chevre/service/transaction/returnOrder/exportTasks/factory.js +0 -1
  202. package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.d.ts +1 -1
  203. package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.js +0 -1
  204. package/lib/chevre/service/transaction/returnOrder/potentialActions/sendEmailMessage.d.ts +1 -1
  205. package/lib/chevre/service/transaction/returnOrder/potentialActions.d.ts +1 -1
  206. package/lib/chevre/service/transaction/returnOrder/potentialActions.js +0 -1
  207. package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -4
  208. package/lib/chevre/service/transaction/returnOrder.js +1 -1
  209. package/lib/chevre/service/transaction.js +3 -5
  210. package/lib/chevre/service/validation/validateOrder.js +4 -79
  211. package/lib/chevre/settings.d.ts +0 -55
  212. package/lib/chevre/settings.js +1 -29
  213. package/lib/chevre/taskSettings.d.ts +0 -22
  214. package/lib/chevre/taskSettings.js +1 -7
  215. package/package.json +2 -2
  216. package/lib/chevre/credentials/customSearch.d.ts +0 -13
  217. package/lib/chevre/credentials/customSearch.js +0 -16
  218. package/lib/chevre/credentials/lineNotify.d.ts +0 -17
  219. package/lib/chevre/credentials/lineNotify.js +0 -20
  220. package/lib/chevre/credentials/sendGrid.d.ts +0 -24
  221. package/lib/chevre/credentials/sendGrid.js +0 -18
  222. package/lib/chevre/credentials.d.ts +0 -20
  223. package/lib/chevre/credentials.js +0 -42
@@ -79,6 +79,7 @@ import type { SellerPaymentAcceptedRepo } from './repo/sellerPaymentAccepted';
79
79
  import type { SellerReturnPolicyRepo } from './repo/sellerReturnPolicy';
80
80
  import type { ServiceAvailableHourRepo } from './repo/service/availableHour';
81
81
  import type { SettingRepo } from './repo/setting';
82
+ import type { IntegrationSettingRepo } from './repo/setting/integration';
82
83
  import type { JWTSettingRepo } from './repo/setting/jwt';
83
84
  import type { StockHolderRepo } from './repo/stockHolder';
84
85
  import type { TaskRepo } from './repo/task';
@@ -437,6 +438,10 @@ export declare namespace Setting {
437
438
  function createInstance(...params: ConstructorParameters<typeof SettingRepo>): Promise<SettingRepo>;
438
439
  }
439
440
  export declare namespace setting {
441
+ type Integration = IntegrationSettingRepo;
442
+ namespace Integration {
443
+ function createInstance(...params: ConstructorParameters<typeof IntegrationSettingRepo>): Promise<IntegrationSettingRepo>;
444
+ }
440
445
  type JWT = JWTSettingRepo;
441
446
  namespace JWT {
442
447
  function createInstance(...params: ConstructorParameters<typeof JWTSettingRepo>): Promise<JWTSettingRepo>;
@@ -911,6 +911,17 @@ var Setting;
911
911
  })(Setting || (exports.Setting = Setting = {}));
912
912
  var setting;
913
913
  (function (setting) {
914
+ let Integration;
915
+ (function (Integration) {
916
+ let repo;
917
+ async function createInstance(...params) {
918
+ if (repo === undefined) {
919
+ repo = (await import('./repo/setting/integration.js')).IntegrationSettingRepo;
920
+ }
921
+ return new repo(...params);
922
+ }
923
+ Integration.createInstance = createInstance;
924
+ })(Integration = setting.Integration || (setting.Integration = {}));
914
925
  let JWT;
915
926
  (function (JWT) {
916
927
  let repo;
@@ -150,7 +150,12 @@ function aggregateReservationByOffer(params) {
150
150
  }
151
151
  }
152
152
  });
153
- console.log('aggregateReservationByOffer: reservationCount4offer:', reservationCount4offer, 'aggregateSeatingType:', aggregateSeatingType, 'offer.id:', params.offer.id, 'offer.category:', params.offer.category?.codeValue);
153
+ // console.log(
154
+ // 'aggregateReservationByOffer: reservationCount4offer:', reservationCount4offer,
155
+ // 'aggregateSeatingType:', aggregateSeatingType,
156
+ // 'offer.id:', params.offer.id,
157
+ // 'offer.category:', params.offer.category?.codeValue
158
+ // );
154
159
  }
155
160
  }
156
161
  const { maximumAttendeeCapacity, remainingAttendeeCapacity } = await calculateCapacityByOffer(params)(repos);
@@ -10,7 +10,6 @@ exports.aggregateScreeningEvent = aggregateScreeningEvent;
10
10
  const debug_1 = __importDefault(require("debug"));
11
11
  const moment_timezone_1 = __importDefault(require("moment-timezone"));
12
12
  const factory_1 = require("../../../factory");
13
- // import { Settings } from '../../../settings';
14
13
  const findEventOffers_1 = require("./findEventOffers");
15
14
  const debug = (0, debug_1.default)('chevre-domain:service:aggregation');
16
15
  /**
@@ -69,10 +69,11 @@ function createPotentialActions(params) {
69
69
  const reservationForByReserveTransaction = transaction.object.transaction?.object.reservationFor;
70
70
  if (reservationForByReserveTransaction !== undefined && typeof reservationNumber === 'string') {
71
71
  const cancelObject = {
72
- reservationFor: {
73
- typeOf: reservationForByReserveTransaction.typeOf,
74
- id: String(reservationForByReserveTransaction.id)
75
- },
72
+ // discontinue reservationFor(2026-05-09~)
73
+ // reservationFor: {
74
+ // typeOf: reservationForByReserveTransaction.typeOf,
75
+ // id: String(reservationForByReserveTransaction.id)
76
+ // },
76
77
  reservationNumber,
77
78
  // ReservationConfirmed->ReservationCancelledのみ処理されるように保証する
78
79
  reservationStatus: factory_1.factory.reservationStatusType.ReservationConfirmed,
@@ -100,13 +101,15 @@ function createPotentialActions(params) {
100
101
  cancelObject = {
101
102
  typeOf: reservation.typeOf,
102
103
  id: reservation.id,
103
- issuedThrough: {
104
- typeOf: reservation.issuedThrough?.typeOf
105
- },
106
- reservationFor: {
107
- typeOf: reservation.reservationFor.typeOf,
108
- id: String(reservation.reservationFor.id)
109
- },
104
+ // discontinue issuedThrough(2026-05-08~)
105
+ // issuedThrough: {
106
+ // typeOf: reservation.issuedThrough?.typeOf
107
+ // },
108
+ // discontinue reservationFor(2026-05-09~)
109
+ // reservationFor: {
110
+ // typeOf: reservation.reservationFor.typeOf,
111
+ // id: String(reservation.reservationFor.id)
112
+ // },
110
113
  reservationNumber: reservation.reservationNumber,
111
114
  // ReservationConfirmed->ReservationCancelledのみ処理されるように保証する
112
115
  reservationStatus: factory_1.factory.reservationStatusType.ReservationConfirmed
@@ -18,7 +18,7 @@ export declare function validateStartParams(params: IStartParams): (repos: {
18
18
  assetTransaction: AssetTransactionRepo;
19
19
  }) => Promise<{
20
20
  reserveTransaction: import("@chevre/factory/lib/chevre/assetTransaction/reserve").ITransaction | undefined;
21
- reservations: (Pick<import("@chevre/factory/lib/chevre/reservation/event").IReservation, "id" | "typeOf" | "issuedThrough" | "reservationNumber"> & {
21
+ reservations: (Pick<import("@chevre/factory/lib/chevre/reservation/event").IReservation, "id" | "typeOf" | "reservationNumber"> & {
22
22
  reservationFor: Pick<factory.reservation.eventReservation.IReservationForMinimized, "id" | "typeOf">;
23
23
  })[] | undefined;
24
24
  }>;
@@ -43,7 +43,7 @@ function validateStartParams(params) {
43
43
  const reservation = await repos.reservation.findReservationById({
44
44
  id: params.object.reservation.id,
45
45
  inclusion: [
46
- 'issuedThrough', 'typeOf', 'reservationNumber', 'reservationFor.id', 'reservationFor.typeOf', 'provider', 'reservationStatus'
46
+ 'typeOf', 'reservationNumber', 'reservationFor.id', 'reservationFor.typeOf', 'provider', 'reservationStatus'
47
47
  ]
48
48
  });
49
49
  // 販売者検証(2023-08-01~)
@@ -1,5 +1,5 @@
1
1
  import { factory } from '../../../factory';
2
- import { Settings } from '../../../settings';
2
+ import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
3
3
  import type { CheckMovieTicketActionRepo } from '../../../repo/action/checkMovieTicket';
4
4
  import type { CredentialsRepo } from '../../../repo/credentials';
5
5
  import type { EventRepo } from '../../../repo/event';
@@ -1,5 +1,5 @@
1
1
  import { factory } from '../../../factory';
2
- import { Settings } from '../../../settings';
2
+ import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
3
3
  import type { AcceptPayActionRepo } from '../../../repo/action/acceptPay';
4
4
  import type { AuthorizeInvoiceActionRepo } from '../../../repo/action/authorizeInvoice';
5
5
  import type { EventRepo } from '../../../repo/event';
@@ -2,7 +2,7 @@
2
2
  * 決済取引サービス
3
3
  */
4
4
  import type { GMO } from '@motionpicture/gmo-service';
5
- import { Settings } from '../../../settings';
5
+ import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
6
6
  import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
7
7
  import type { PaymentServiceRepo } from '../../../repo/paymentService';
8
8
  import type { PaymentServiceProviderRepo } from '../../../repo/paymentServiceProvider';
@@ -1,5 +1,5 @@
1
1
  import { factory } from '../../../../factory';
2
- import { Settings } from '../../../../settings';
2
+ import type { IntegrationSettingRepo as Settings } from '../../../../repo/setting/integration';
3
3
  import type { AccountingReportRepo } from '../../../../repo/accountingReport';
4
4
  import type { PayActionRepo } from '../../../../repo/action/pay';
5
5
  import type { RefundActionRepo } from '../../../../repo/action/refund';
@@ -1,5 +1,5 @@
1
1
  import { factory } from '../../../../factory';
2
- import { Settings } from '../../../../settings';
2
+ import type { IntegrationSettingRepo as Settings } from '../../../../repo/setting/integration';
3
3
  import type { AuthorizeInvoiceActionRepo } from '../../../../repo/action/authorizeInvoice';
4
4
  import type { AssetTransactionRepo } from '../../../../repo/assetTransaction';
5
5
  import type { PaymentServiceRepo } from '../../../../repo/paymentService';
@@ -1,5 +1,5 @@
1
1
  import { factory } from '../../../../factory';
2
- import { Settings } from '../../../../settings';
2
+ import type { IntegrationSettingRepo as Settings } from '../../../../repo/setting/integration';
3
3
  import type { AccountingReportRepo } from '../../../../repo/accountingReport';
4
4
  import type { PayActionRepo } from '../../../../repo/action/pay';
5
5
  import type { RefundActionRepo } from '../../../../repo/action/refund';
@@ -1,5 +1,5 @@
1
1
  import { factory } from '../../../factory';
2
- import { Settings } from '../../../settings';
2
+ import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
3
3
  import type { AccountingReportRepo } from '../../../repo/accountingReport';
4
4
  import type { PayActionRepo } from '../../../repo/action/pay';
5
5
  import type { RefundActionRepo } from '../../../repo/action/refund';
@@ -1,4 +1,4 @@
1
- import { Settings } from '../../../settings';
1
+ import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
2
2
  import type { ActionRepo } from '../../../repo/action';
3
3
  import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
4
4
  import type { OfferRateLimitRepo } from '../../../repo/rateLimit/offer';
@@ -1,5 +1,5 @@
1
1
  import { factory } from '../../../factory';
2
- import { Settings } from '../../../settings';
2
+ import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
3
3
  import type { ActionRepo } from '../../../repo/action';
4
4
  import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
5
5
  import type { AuthorizationRepo } from '../../../repo/authorization';
@@ -80,7 +80,7 @@ function createSubReservations(params) {
80
80
  ticketOffer: ticketOffer
81
81
  });
82
82
  const additionalTicketText = (0, createReservation_1.createAdditionalTicketText)({ acceptedOffer, reservedTicket });
83
- const additionalProperty = (0, createReservation_1.createAdditionalProperty)({ acceptedOffer });
83
+ // const additionalProperty = createAdditionalProperty({ acceptedOffer });
84
84
  // 座席指定であれば、座席タイプチャージを検索する
85
85
  const seatPriceComponent = [];
86
86
  // 区分加算料金を適用しないオプションを追加(2023-01-26~)
@@ -179,7 +179,7 @@ function createSubReservations(params) {
179
179
  id: reservationId,
180
180
  reservationFor: params.event,
181
181
  reservedTicket: reservedTicket,
182
- additionalProperty: additionalProperty,
182
+ // additionalProperty: additionalProperty,
183
183
  additionalTicketText: additionalTicketText,
184
184
  ticketOffer: ticketOffer,
185
185
  seatPriceComponent: seatPriceComponent,
@@ -20,12 +20,6 @@ declare function validateAppliesToMovieTicket(params: {
20
20
  availableOffer: factory.unitPriceOffer.IUnitPriceOffer;
21
21
  appliesToMovieTicket?: factory.assetTransaction.reserve.IAcceptedAppliesToMovieTicket;
22
22
  }): void;
23
- /**
24
- * 追加特性を生成する
25
- */
26
- declare function createAdditionalProperty(params: {
27
- acceptedOffer: factory.assetTransaction.reserve.IAcceptedTicketOfferWithoutDetail;
28
- }): factory.propertyValue.IPropertyValue<string>[];
29
23
  /**
30
24
  * 追加チケットテキストを生成する
31
25
  */
@@ -41,7 +35,6 @@ declare function createReservation(params: {
41
35
  id: string;
42
36
  reservationFor: IMinimizedIndividualEvent;
43
37
  reservedTicket: factory.assetTransaction.reserve.ISubReservationReservedTicket;
44
- additionalProperty?: factory.propertyValue.IPropertyValue<string>[];
45
38
  additionalTicketText?: string;
46
39
  ticketOffer: factory.product.ITicketOffer;
47
40
  seatPriceComponent: factory.place.seat.IPriceComponent[];
@@ -52,4 +45,4 @@ declare function createReservation(params: {
52
45
  appliesToMovieTicket?: factory.assetTransaction.reserve.IAcceptedAppliesToMovieTicket;
53
46
  validateAppliesToMovieTicket: boolean;
54
47
  }): IObjectSubReservation;
55
- export { createAdditionalProperty, createAdditionalTicketText, createReservation, createReservedTicket, IAcceptedAddOn, validateAppliesToMovieTicket };
48
+ export { createAdditionalTicketText, createReservation, createReservedTicket, IAcceptedAddOn, validateAppliesToMovieTicket };
@@ -3,7 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.createAdditionalProperty = createAdditionalProperty;
7
6
  exports.createAdditionalTicketText = createAdditionalTicketText;
8
7
  exports.createReservation = createReservation;
9
8
  exports.createReservedTicket = createReservedTicket;
@@ -16,14 +15,15 @@ const price_1 = require("./price");
16
15
  const debug = (0, debug_1.default)('chevre-domain:service:assetTransaction');
17
16
  function createTicketIdentifier(params) {
18
17
  // チケット識別子の規定値を作成
19
- let ticketIdentifier = (typeof params.ticketedSeat?.seatNumber === 'string')
18
+ const ticketIdentifier = (typeof params.ticketedSeat?.seatNumber === 'string')
20
19
  ? (0, util_1.format)('%s:%s:%s', params.reservationFor.id, params.ticketedSeat.seatSection, params.ticketedSeat.seatNumber)
21
20
  : (0, util_1.format)('%s:%s', params.reservationFor.id, params.id);
22
- // 指定があれば採用
23
- const ticketIdentifierByRequest = params.acceptedOffer.itemOffered?.serviceOutput?.reservedTicket?.identifier;
24
- if (typeof ticketIdentifierByRequest === 'string' && ticketIdentifierByRequest.length > 0) {
25
- ticketIdentifier = ticketIdentifierByRequest;
26
- }
21
+ // チケット識別子のカスタム指定を廃止(2026-06-08~)
22
+ // // 指定があれば採用
23
+ // const ticketIdentifierByRequest = params.acceptedOffer.itemOffered?.serviceOutput?.reservedTicket?.identifier;
24
+ // if (typeof ticketIdentifierByRequest === 'string' && ticketIdentifierByRequest.length > 0) {
25
+ // ticketIdentifier = ticketIdentifierByRequest;
26
+ // }
27
27
  return ticketIdentifier;
28
28
  }
29
29
  function createReservedTicket(params) {
@@ -295,16 +295,18 @@ function validateAppliesToMovieTicket(params) {
295
295
  // Arrayでないケースは廃止(2022-09-10~)
296
296
  }
297
297
  }
298
- /**
299
- * 追加特性を生成する
300
- */
301
- function createAdditionalProperty(params) {
302
- let additionalProperty = params.acceptedOffer.itemOffered?.serviceOutput?.additionalProperty;
303
- if (!Array.isArray(additionalProperty)) {
304
- additionalProperty = [];
305
- }
306
- return additionalProperty;
307
- }
298
+ // /**
299
+ // * 追加特性を生成する
300
+ // */
301
+ // function createAdditionalProperty(params: {
302
+ // acceptedOffer: factory.assetTransaction.reserve.IAcceptedTicketOfferWithoutDetail;
303
+ // }): factory.propertyValue.IPropertyValue<string>[] {
304
+ // let additionalProperty = params.acceptedOffer.itemOffered?.serviceOutput?.additionalProperty;
305
+ // if (!Array.isArray(additionalProperty)) {
306
+ // additionalProperty = [];
307
+ // }
308
+ // return additionalProperty;
309
+ // }
308
310
  /**
309
311
  * 追加チケットテキストを生成する
310
312
  */
@@ -328,27 +330,15 @@ function createReservation(params) {
328
330
  const price4reservation = (0, price_1.createPrice)(params);
329
331
  if (params.reservationFor.typeOf === factory_1.factory.eventType.ScreeningEvent) {
330
332
  return {
331
- // project: params.project, // 廃止(2024-04-08~)
332
333
  typeOf: factory_1.factory.reservationType.EventReservation,
333
334
  id: params.id,
334
- // reservationPackage保管に移行(2023-06-06~)
335
- // issuedThrough,
336
- additionalProperty: params.additionalProperty,
337
- // bookingTime: params.reserveDate, // 廃止(2024-04-08~)
338
- // modifiedTime: params.reserveDate, // 廃止(2024-04-08~)
335
+ // additionalProperty: params.additionalProperty, // discontinue(2026-06-07~)
339
336
  numSeats: 1,
340
337
  price: price4reservation,
341
338
  priceCurrency: factory_1.factory.priceCurrency.JPY,
342
- // reservationNumber: params.reservationNumber, // 廃止(2024-04-08~)
343
339
  // statusは不要なので削除(2023-07-19~)
344
340
  // reservationStatus: factory.reservationStatusType.ReservationPending,
345
341
  reservedTicket: params.reservedTicket,
346
- // underName: { // 廃止(2024-04-08~)
347
- // typeOf: params.agent.typeOf,
348
- // name: params.agent.name
349
- // },
350
- // checkedIn: false, // 廃止(2024-04-08~)
351
- // attended: false, // 廃止(2024-04-08~)
352
342
  ...(typeof params.additionalTicketText === 'string') ? { additionalTicketText: params.additionalTicketText } : undefined,
353
343
  ...(Array.isArray(params.subReservation))
354
344
  ? {
@@ -362,8 +352,6 @@ function createReservation(params) {
362
352
  })
363
353
  }
364
354
  : undefined,
365
- // reservationPackage保管に移行(2023-06-06~)
366
- // ...(typeof params.broker?.typeOf === 'string') ? { broker: params.broker } : undefined,
367
355
  ...(typeof params.programMembershipUsed?.identifier === 'string')
368
356
  ? { programMembershipUsed: params.programMembershipUsed }
369
357
  : undefined
@@ -14,4 +14,4 @@ export declare function createPrice(params: {
14
14
  seatPriceComponent: factory.place.seat.IPriceComponent[];
15
15
  acceptedAddOns: IAcceptedAddOn[];
16
16
  appliesToMovieTicket?: factory.assetTransaction.reserve.IAcceptedAppliesToMovieTicket;
17
- }): factory.reservation.eventReservation.IPrice;
17
+ }): factory.assetTransaction.reserve.IPrice;
@@ -1,5 +1,5 @@
1
1
  import { factory } from '../../../factory';
2
- import { Settings } from '../../../settings';
2
+ import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
3
3
  import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
4
4
  import type { AuthorizationRepo } from '../../../repo/authorization';
5
5
  import type { EventRepo } from '../../../repo/event';
@@ -5,7 +5,12 @@ export type IOwnershipInfo = factory.ownershipInfo.IOwnershipInfo<factory.owners
5
5
  */
6
6
  export declare function createOwnershipInfosFromOrder(params: {
7
7
  order: Pick<factory.order.IOrder, 'orderDate' | 'project' | 'customer' | 'orderNumber' | 'seller'> & {
8
- acceptedOffers: factory.order.IAcceptedOffer[];
8
+ acceptedOffers: (Omit<factory.order.IAcceptedOffer, 'priceSpecification' | 'name'> & {
9
+ /**
10
+ * COA以外では注文ドキュメントにpriceSpecificationが存在しないのでIFを補完
11
+ */
12
+ priceSpecification?: factory.order.ITicketPriceSpecification;
13
+ })[];
9
14
  };
10
15
  offerIndexBase: number;
11
16
  }): IOwnershipInfo[];
@@ -43,7 +43,7 @@ function createOwnershipInfosFromOrder(params) {
43
43
  ownershipInfo = (0, factory_2.createReservationOwnershipInfo)({
44
44
  project: params.order.project,
45
45
  ownedBy: ownedBy,
46
- acceptedOffer: { ...acceptedOffer, itemOffered },
46
+ acceptedOffer,
47
47
  ownedFrom: ownedFrom,
48
48
  identifier: identifier,
49
49
  acquiredFrom: acquiredFrom
@@ -6,9 +6,7 @@ export declare function createReservationOwnershipInfo(params: {
6
6
  id: string;
7
7
  };
8
8
  ownedBy: factory.ownershipInfo.IOwner[];
9
- acceptedOffer: factory.order.IAcceptedOffer & {
10
- itemOffered: factory.order.IReservation;
11
- };
9
+ acceptedOffer: Pick<factory.order.IAcceptedOffer, 'itemOffered'>;
12
10
  ownedFrom: Date;
13
11
  identifier: string;
14
12
  acquiredFrom: factory.ownershipInfo.IAcquiredFrom;
@@ -19,31 +19,14 @@ function createReservationOwnershipInfo(params) {
19
19
  else {
20
20
  throw new factory_1.factory.errors.NotImplemented(`itemOffered.typeOf '${itemOffered.typeOf}' not implemented`); // eslint-disable-line @typescript-eslint/no-explicit-any
21
21
  }
22
- // let bookingService = params.acceptedOffer.offeredThrough;
23
- // if (bookingService === undefined) {
24
- // // デフォルトブッキングサービスはChevre
25
- // bookingService = {
26
- // typeOf: 'WebAPI',
27
- // identifier: factory.service.webAPI.Identifier.Chevre
28
- // };
29
- // }
30
22
  let typeOfGood;
31
23
  if (itemOffered.typeOf === factory_1.factory.reservationType.EventReservation) {
32
24
  typeOfGood = {
33
25
  typeOf: itemOffered.typeOf,
34
26
  id: itemOffered.id,
35
27
  reservationNumber: itemOffered.reservationNumber,
36
- // bookingService: bookingService,
37
28
  ...(typeof itemOffered.issuedThrough?.typeOf === 'string') ? { issuedThrough: itemOffered.issuedThrough } : undefined
38
29
  };
39
- // } else if (itemOffered.typeOf === factory.reservationType.BusReservation) {
40
- // typeOfGood = {
41
- // typeOf: itemOffered.typeOf,
42
- // id: itemOffered.id,
43
- // reservationNumber: itemOffered.reservationNumber,
44
- // bookingService: bookingService,
45
- // ...(typeof itemOffered.issuedThrough?.typeOf === 'string') ? { issuedThrough: itemOffered.issuedThrough } : undefined
46
- // };
47
30
  }
48
31
  else {
49
32
  throw new factory_1.factory.errors.NotImplemented(`itemOffered.typeOf '${itemOffered.typeOf}' not implemented`); // eslint-disable-line @typescript-eslint/no-explicit-any
@@ -1,6 +1,5 @@
1
- import { SendGridCredentials } from '../../credentials/sendGrid';
2
1
  import type { TaskRepo } from '../../repo/task';
3
- import { Settings } from '../../settings';
2
+ import type { IntegrationSettingRepo } from '../../repo/setting/integration';
4
3
  /**
5
4
  * 中止されたタスクリストをEメールで通知する
6
5
  * add(2025-03-13~)
@@ -9,7 +8,6 @@ declare function notifyAbortedTasksByEmail(params: {
9
8
  dateAbortedGte: Date;
10
9
  }): (repos: {
11
10
  task: TaskRepo;
12
- }, settings: Pick<Settings, "abortedTasksWithoutReport">, credentials: {
13
- sendGrid: SendGridCredentials;
11
+ integrationSetting: IntegrationSettingRepo;
14
12
  }) => Promise<void>;
15
13
  export { notifyAbortedTasksByEmail };
@@ -14,8 +14,8 @@ const debug = (0, debug_1.default)('chevre-domain:service:notification');
14
14
  * add(2025-03-13~)
15
15
  */
16
16
  function notifyAbortedTasksByEmail(params) {
17
- return async (repos, settings, credentials) => {
18
- const { abortedTasksWithoutReport } = settings;
17
+ return async (repos) => {
18
+ const abortedTasksWithoutReport = await repos.integrationSetting.getByKey('abortedTasksWithoutReport');
19
19
  const abortedTasks = await repos.task.projectFields({
20
20
  status: { $eq: factory_1.factory.taskStatus.Aborted },
21
21
  dateAborted: { $gte: params.dateAbortedGte },
@@ -30,7 +30,7 @@ function notifyAbortedTasksByEmail(params) {
30
30
  const notifyResult = await (0, notifyByEmail_1.notifyByEmail)({
31
31
  subject: message.subject, content: message.content,
32
32
  logLevel: 'error'
33
- })({}, credentials);
33
+ })(repos);
34
34
  debug('notifyResult:', notifyResult);
35
35
  }
36
36
  };
@@ -1,10 +1,10 @@
1
- import { SendGridCredentials } from '../../credentials/sendGrid';
1
+ import type { IntegrationSettingRepo } from '../../repo/setting/integration';
2
2
  declare function notifyByEmail(params: {
3
3
  subject: string;
4
4
  content: string;
5
5
  logLevel: LineNotifyLogLevel;
6
- }): (__: Record<string, never>, credentials: {
7
- sendGrid: SendGridCredentials;
6
+ }): (repos: {
7
+ integrationSetting: IntegrationSettingRepo;
8
8
  }) => Promise<{
9
9
  result: import("@chevre/factory/lib/chevre/action/transfer/send/message/email").IResult;
10
10
  }>;
@@ -5,27 +5,22 @@ const client_1 = require("@sendgrid/client");
5
5
  const http_status_1 = require("http-status");
6
6
  const util_1 = require("util");
7
7
  const factory_1 = require("../../factory");
8
- // type ILineNotifyOperation<T> = (
9
- // repos: undefined,
10
- // credentials: {
11
- // lineNotify: LINENotifyCredentials;
12
- // }
13
- // ) => Promise<T>;
14
8
  function notifyByEmail(params) {
15
- return async (__, credentials) => {
9
+ return async (repos) => {
16
10
  const { logLevel } = params;
17
11
  const shortSubject = params.subject;
18
12
  const message = (0, util_1.format)('\n%s\n%s\n%s\n%s\n%s\n\n%s', `[${logLevel}] ${shortSubject}`, `now:${(new Date()).toISOString()}`, `pid:${process.pid}`, `GAE_APPLICATION:${process.env.GAE_APPLICATION}`,
19
13
  // `GAE_INSTANCE:${process.env.GAE_INSTANCE}`,
20
14
  `GAE_SERVICE:${process.env.GAE_SERVICE}`, params.content);
21
- const apiKey = credentials.sendGrid.apiKey;
15
+ const sendGridSettings = await repos.integrationSetting.getByKey('sendGrid');
16
+ const apiKey = sendGridSettings?.apiKey;
22
17
  if (typeof apiKey !== 'string') {
23
18
  throw new factory_1.factory.errors.Internal('API Key not found');
24
19
  }
25
- const senderName = credentials.sendGrid.alert?.sender?.name;
26
- const senderEmail = credentials.sendGrid.alert?.sender?.email;
27
- const toRecipientEmail = (Array.isArray(credentials.sendGrid.alert?.toRecipient))
28
- ? credentials.sendGrid.alert?.toRecipient.at(0)?.email
20
+ const senderName = sendGridSettings?.alert?.sender?.name;
21
+ const senderEmail = sendGridSettings?.alert?.sender?.email;
22
+ const toRecipientEmail = (Array.isArray(sendGridSettings?.alert?.toRecipient))
23
+ ? sendGridSettings.alert?.toRecipient.at(0)?.email
29
24
  : undefined;
30
25
  if (typeof senderName !== 'string') {
31
26
  throw new factory_1.factory.errors.Internal('senderName not found');
@@ -1,8 +1,8 @@
1
- import { SendGridCredentials } from '../../credentials/sendGrid';
2
1
  import { factory } from '../../factory';
3
2
  import type { ActionRepo } from '../../repo/action';
4
3
  import type { MessageRepo } from '../../repo/message';
5
4
  import type { ProjectRepo } from '../../repo/project';
5
+ import type { IntegrationSettingRepo } from '../../repo/setting/integration';
6
6
  /**
7
7
  * https://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/errors.html
8
8
  */
@@ -14,7 +14,6 @@ declare function sendEmailMessage(params: factory.task.sendEmailMessage.IActionA
14
14
  action: ActionRepo;
15
15
  message: MessageRepo;
16
16
  project: ProjectRepo;
17
- }, credentials: {
18
- sendGrid: SendGridCredentials;
17
+ integrationSetting: IntegrationSettingRepo;
19
18
  }) => Promise<void>;
20
19
  export { sendEmailMessage };
@@ -15,12 +15,13 @@ function createSendEmailMessageActionAttributes(params) {
15
15
  };
16
16
  }
17
17
  function createMailData(params) {
18
- return async (repos, credentials) => {
18
+ return async (repos) => {
19
19
  const project = await repos.project.findById({
20
20
  id: params.project.id,
21
21
  inclusion: ['settings']
22
22
  });
23
- let apiKey = credentials.sendGrid.apiKey;
23
+ const sendGridSettings = await repos.integrationSetting.getByKey('sendGrid');
24
+ let apiKey = sendGridSettings?.apiKey;
24
25
  // プロジェクト固有のSendGrid設定があれば、そちらを使用
25
26
  if (typeof project.settings?.sendgridApiKey === 'string' && project.settings.sendgridApiKey.length > 0) {
26
27
  apiKey = project.settings.sendgridApiKey;
@@ -71,8 +72,8 @@ function createMailData(params) {
71
72
  * https://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/errors.html
72
73
  */
73
74
  function sendEmailMessage(params) {
74
- return async (repos, credentials) => {
75
- const { mailData, emailMessage, apiKey } = await createMailData(params)(repos, credentials);
75
+ return async (repos) => {
76
+ const { mailData, emailMessage, apiKey } = await createMailData(params)(repos);
76
77
  // add recipe(2025-03-12~)
77
78
  let recipe = (0, factory_2.createSendEmailMessageRecipe)({
78
79
  mailData,
@@ -1,5 +1,5 @@
1
1
  import { factory } from '../../factory';
2
- import type { OrderInTransactionRepo } from '../../repo/orderInTransaction';
2
+ import type { IMinimizedAcceptedOffer, OrderInTransactionRepo } from '../../repo/orderInTransaction';
3
3
  interface IAcceptOfferOperationRepos {
4
4
  orderInTransaction: OrderInTransactionRepo;
5
5
  }
@@ -10,7 +10,12 @@ export declare function acceptOffer(params: {
10
10
  project: {
11
11
  id: string;
12
12
  };
13
- acceptedOffers: factory.order.IAcceptedOffer[];
13
+ acceptedOffers: IMinimizedAcceptedOffer[] | (Omit<factory.order.IAcceptedOffer, 'priceSpecification'> & {
14
+ /**
15
+ * COA以外では注文ドキュメントにpriceSpecificationが存在しないのでIFを補完
16
+ */
17
+ priceSpecification?: factory.order.ITicketPriceSpecification;
18
+ })[];
14
19
  }): IAcceptOfferOperation<void>;
15
20
  export declare function voidAcceptedOffer(params: {
16
21
  /**
@@ -23,7 +23,7 @@ declare function createAuthorizeSeatReservationActionAttributes(params: {
23
23
  transaction: Pick<factory.transaction.ITransaction<factory.transactionType.PlaceOrder>, 'agent' | 'id' | 'project' | 'seller' | 'typeOf'>;
24
24
  }): factory.action.authorize.offer.eventService.IAttributes;
25
25
  declare function acceptedOffers2amount(params: {
26
- acceptedOffers: IResultAcceptedOffer[];
26
+ acceptedOffers: Pick<IResultAcceptedOffer, 'priceSpecification' | 'id'>[];
27
27
  }): number;
28
28
  declare function acceptedOffers2authorizeResult(params: {
29
29
  acceptedOffers: factory.assetTransaction.reserve.IAcceptedTicketOfferWithoutDetail[];
@@ -32,8 +32,11 @@ declare function acceptedOffers2authorizeResult(params: {
32
32
  ticketOffers: factory.product.ITicketOffer[];
33
33
  }): factory.action.authorize.offer.eventService.IResult;
34
34
  type IObjectSubReservation = factory.assetTransaction.reserve.IObjectSubReservation;
35
- export type IResultAcceptedOffer = factory.order.IAcceptedOffer & {
36
- itemOffered: factory.order.IReservation;
35
+ export type IResultAcceptedOffer = Omit<factory.order.IOptimizedAcceptedOffer, 'priceSpecification'> & {
36
+ itemOffered: factory.order.IEventReservation;
37
+ offeredThrough: factory.offer.IOfferedThrough;
38
+ serialNumber: string;
39
+ priceSpecification?: factory.order.ITicketPriceSpecification;
37
40
  };
38
41
  declare function responseBody2acceptedOffers4result(params: {
39
42
  issuedThrough: factory.assetTransaction.reserve.IIssuedThrough;