@chevre/domain 23.2.0-alpha.6 → 23.2.0-alpha.61

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 (173) hide show
  1. package/example/src/chevre/acceptedPaymentMethodOffer/adminAcceptedPaymentMethodOffers.ts +25 -17
  2. package/example/src/chevre/confirmationNumber/testRandomness.ts +49 -0
  3. package/example/src/chevre/emailMessage/createEmailMessageText.ts +63 -0
  4. package/example/src/chevre/event/importEventsFromCOAByTitle.ts +2 -2
  5. package/example/src/chevre/event/unsetSuperEventVideoFormat.ts +30 -0
  6. package/example/src/chevre/eventSeries/unsetVideoFormat.ts +31 -0
  7. package/example/src/chevre/{upsertScreeningEventSeriesByVersion.ts → eventSeries/upsertScreeningEventSeriesByVersion.ts} +47 -43
  8. package/example/src/chevre/{upsertOfferCatalogItemsByIdentifier.ts → offerCatalog/upsertOfferCatalogItemsByIdentifier.ts} +6 -3
  9. package/example/src/chevre/{upsertOfferCatalogsByIdentifier.ts → offerCatalog/upsertOfferCatalogsByIdentifier.ts} +8 -3
  10. package/example/src/chevre/{upsertOffersByIdentifier.ts → offers/upsertOffersByIdentifier.ts} +5 -3
  11. package/example/src/chevre/orderNumber/testRandomness.ts +54 -0
  12. package/example/src/chevre/place/adminEntranceGates.ts +69 -0
  13. package/example/src/chevre/place/checkEntranceGatesCount.ts +82 -0
  14. package/example/src/chevre/place/findRooms.ts +24 -0
  15. package/example/src/chevre/place/findSections.ts +28 -0
  16. package/example/src/chevre/place/migrateSectionIdentifier.ts +92 -0
  17. package/example/src/chevre/place/seatsJson2csv.ts +63 -0
  18. package/example/src/chevre/place/upsertMovieTheatersByBranchCode.ts +41 -0
  19. package/example/src/chevre/place/upsertRoomsByBranchCode.ts +40 -0
  20. package/example/src/chevre/place/upsertSeatSectionsByBranchCode.ts +56 -0
  21. package/example/src/chevre/reIndex.ts +1 -1
  22. package/example/src/chevre/roles/addAdminAcceptedPaymentMethodReadPermissionIfNotExists.ts +33 -0
  23. package/example/src/chevre/roles/addAdminAcceptedPaymentMethodWritePermissionIfNotExists.ts +33 -0
  24. package/example/src/chevre/roles/addAdminMovieReadPermissionIfNotExists.ts +49 -0
  25. package/example/src/chevre/roles/addAdminRoomReadPermissionIfNotExists.ts +34 -0
  26. package/example/src/chevre/roles/addAdminRoomWritePermissionIfNotExists.ts +34 -0
  27. package/example/src/chevre/settings/addOrderNumberSetting.ts +44 -0
  28. package/example/src/chevre/settings/addTransactionNumberSetting.ts +40 -0
  29. package/example/src/chevre/transactionNumber/publishByTimestamp.ts +23 -0
  30. package/example/src/chevre/transactionNumber/testRandomness.ts +42 -0
  31. package/example/src/chevre/unsetUnnecessaryFields.ts +8 -4
  32. package/lib/chevre/emailMessageBuilder.js +1 -0
  33. package/lib/chevre/factory/event.d.ts +1 -1
  34. package/lib/chevre/factory/event.js +11 -5
  35. package/lib/chevre/factory/transactionNumber.d.ts +19 -0
  36. package/lib/chevre/factory/transactionNumber.js +54 -0
  37. package/lib/chevre/repo/acceptedPaymentMethod.d.ts +41 -8
  38. package/lib/chevre/repo/acceptedPaymentMethod.js +72 -27
  39. package/lib/chevre/repo/aggregateOffer.d.ts +6 -1
  40. package/lib/chevre/repo/aggregateOffer.js +11 -3
  41. package/lib/chevre/repo/aggregateOrder.js +0 -93
  42. package/lib/chevre/repo/aggregateReservation.d.ts +0 -1
  43. package/lib/chevre/repo/aggregateReservation.js +0 -2
  44. package/lib/chevre/repo/confirmationNumber.d.ts +1 -0
  45. package/lib/chevre/repo/confirmationNumber.js +32 -25
  46. package/lib/chevre/repo/event.d.ts +3 -18
  47. package/lib/chevre/repo/event.js +94 -83
  48. package/lib/chevre/repo/eventOffer.d.ts +8 -0
  49. package/lib/chevre/repo/eventOffer.js +11 -0
  50. package/lib/chevre/repo/eventSeries.d.ts +17 -30
  51. package/lib/chevre/repo/eventSeries.js +204 -146
  52. package/lib/chevre/repo/mongoose/schemas/aggregateReservation.js +0 -1
  53. package/lib/chevre/repo/mongoose/schemas/eventSeries.js +20 -5
  54. package/lib/chevre/repo/mongoose/schemas/offerCatalog.js +2 -8
  55. package/lib/chevre/repo/mongoose/schemas/offerCatalogItem.js +28 -2
  56. package/lib/chevre/repo/mongoose/schemas/place.d.ts +6 -2
  57. package/lib/chevre/repo/mongoose/schemas/setting.d.ts +40 -0
  58. package/lib/chevre/repo/mongoose/schemas/setting.js +3 -0
  59. package/lib/chevre/repo/offerCatalog.d.ts +14 -1
  60. package/lib/chevre/repo/offerCatalog.js +41 -19
  61. package/lib/chevre/repo/offerCatalogItem.d.ts +10 -1
  62. package/lib/chevre/repo/offerCatalogItem.js +32 -17
  63. package/lib/chevre/repo/orderNumber.d.ts +6 -0
  64. package/lib/chevre/repo/orderNumber.js +110 -35
  65. package/lib/chevre/repo/place/entranceGate.d.ts +57 -0
  66. package/lib/chevre/repo/place/entranceGate.js +172 -0
  67. package/lib/chevre/repo/place/movieTheater.d.ts +40 -3
  68. package/lib/chevre/repo/place/movieTheater.js +77 -6
  69. package/lib/chevre/repo/place/screeningRoom.d.ts +60 -31
  70. package/lib/chevre/repo/place/screeningRoom.js +227 -135
  71. package/lib/chevre/repo/place/seat.d.ts +47 -45
  72. package/lib/chevre/repo/place/seat.js +175 -45
  73. package/lib/chevre/repo/place/section.d.ts +60 -30
  74. package/lib/chevre/repo/place/section.js +337 -127
  75. package/lib/chevre/repo/serviceOutputIdentifier.d.ts +3 -1
  76. package/lib/chevre/repo/serviceOutputIdentifier.js +42 -27
  77. package/lib/chevre/repo/setting.d.ts +1 -1
  78. package/lib/chevre/repo/setting.js +2 -2
  79. package/lib/chevre/repo/task.d.ts +1 -1
  80. package/lib/chevre/repo/transactionNumber.d.ts +5 -0
  81. package/lib/chevre/repo/transactionNumber.js +63 -27
  82. package/lib/chevre/repository.d.ts +8 -0
  83. package/lib/chevre/repository.js +16 -0
  84. package/lib/chevre/service/assetTransaction/fixInformAction.d.ts +3 -0
  85. package/lib/chevre/service/assetTransaction/fixInformAction.js +3 -0
  86. package/lib/chevre/service/assetTransaction/pay/cancel.d.ts +12 -0
  87. package/lib/chevre/service/assetTransaction/pay/cancel.js +25 -0
  88. package/lib/chevre/service/assetTransaction/pay/check.d.ts +23 -0
  89. package/lib/chevre/service/assetTransaction/pay/check.js +37 -0
  90. package/lib/chevre/service/assetTransaction/pay/confirm.d.ts +24 -0
  91. package/lib/chevre/service/assetTransaction/pay/confirm.js +72 -0
  92. package/lib/chevre/service/assetTransaction/pay/exportTasksById.d.ts +18 -0
  93. package/lib/chevre/service/assetTransaction/pay/exportTasksById.js +111 -0
  94. package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.d.ts +48 -0
  95. package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.js +164 -0
  96. package/lib/chevre/service/assetTransaction/pay/searchGMOTrade.d.ts +20 -0
  97. package/lib/chevre/service/assetTransaction/pay/searchGMOTrade.js +59 -0
  98. package/lib/chevre/service/assetTransaction/pay/{account → start/account}/validation.d.ts +2 -2
  99. package/lib/chevre/service/assetTransaction/pay/{account → start/account}/validation.js +1 -1
  100. package/lib/chevre/service/assetTransaction/pay/{factory.d.ts → start/factory.d.ts} +1 -1
  101. package/lib/chevre/service/assetTransaction/pay/{factory.js → start/factory.js} +1 -1
  102. package/lib/chevre/service/assetTransaction/pay/{validateAcceptedPaymentMethodIfNeeded.d.ts → start/preStart/validateAcceptedPaymentMethodIfNeeded.d.ts} +4 -4
  103. package/lib/chevre/service/assetTransaction/pay/{validateAcceptedPaymentMethodIfNeeded.js → start/preStart/validateAcceptedPaymentMethodIfNeeded.js} +1 -4
  104. package/lib/chevre/service/assetTransaction/pay/start/preStart/validateSeller.d.ts +8 -0
  105. package/lib/chevre/service/assetTransaction/pay/start/preStart/validateSeller.js +54 -0
  106. package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeAccount.d.ts +13 -0
  107. package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeAccount.js +49 -0
  108. package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeCreditCard.d.ts +29 -0
  109. package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeCreditCard.js +37 -0
  110. package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeMovieTicket.d.ts +42 -0
  111. package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeMovieTicket.js +31 -0
  112. package/lib/chevre/service/assetTransaction/pay/start.d.ts +60 -0
  113. package/lib/chevre/service/assetTransaction/pay/start.js +145 -0
  114. package/lib/chevre/service/assetTransaction/pay.d.ts +8 -170
  115. package/lib/chevre/service/assetTransaction/pay.js +16 -623
  116. package/lib/chevre/service/assetTransaction/reserve/start/factory/createStartParams.js +10 -2
  117. package/lib/chevre/service/event/processUpdateMovieTheater.d.ts +1 -1
  118. package/lib/chevre/service/event/processUpdateMovieTheater.js +13 -11
  119. package/lib/chevre/service/event/saveScreeningEventSeries.js +4 -5
  120. package/lib/chevre/service/event/saveScreeningEvents.d.ts +2 -2
  121. package/lib/chevre/service/event/saveScreeningEvents.js +16 -12
  122. package/lib/chevre/service/offer/event/authorize/factory.js +9 -1
  123. package/lib/chevre/service/offer/event/searchEventTicketOffers.js +7 -4
  124. package/lib/chevre/service/offer/event/searchOfferAppliesToMovieTicket.js +9 -6
  125. package/lib/chevre/service/offer/event/searchOffersByIds.js +7 -4
  126. package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +7 -1
  127. package/lib/chevre/service/offer/onEventChanged.js +10 -6
  128. package/lib/chevre/service/offer/product.js +1 -1
  129. package/lib/chevre/service/offer.d.ts +5 -0
  130. package/lib/chevre/service/offer.js +34 -9
  131. package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled/factory.d.ts +1 -1
  132. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +1 -1
  133. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.d.ts +1 -1
  134. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByAggregateOffer.d.ts +13 -0
  135. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByAggregateOffer.js +53 -0
  136. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByEventSeries.d.ts +13 -0
  137. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByEventSeries.js +56 -0
  138. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByMovieTheater.d.ts +15 -0
  139. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByMovieTheater.js +58 -0
  140. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByOfferCatalog.d.ts +17 -0
  141. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByOfferCatalog.js +75 -0
  142. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByProduct.d.ts +19 -0
  143. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByProduct.js +60 -0
  144. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByRoom.d.ts +20 -0
  145. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByRoom.js +51 -0
  146. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.d.ts +27 -0
  147. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.js +100 -0
  148. package/lib/chevre/service/task/onResourceDeleted.d.ts +6 -0
  149. package/lib/chevre/service/task/onResourceDeleted.js +168 -0
  150. package/lib/chevre/service/task/onResourceUpdated.js +205 -42
  151. package/lib/chevre/service/task/syncResourcesFromCOA.js +4 -2
  152. package/lib/chevre/service/taskHandler.js +1 -0
  153. package/package.json +9 -9
  154. package/example/src/chevre/event/upsertManyScreeningEventByIdentifier.ts +0 -191
  155. package/example/src/chevre/eventSeries/migrateEventSeriesUnacceptedPaymentMethod.ts +0 -93
  156. package/example/src/chevre/offers/createSampleOffers.ts +0 -154
  157. package/example/src/chevre/settings/addSettings.ts +0 -46
  158. package/lib/chevre/service/eventOld.d.ts +0 -60
  159. package/lib/chevre/service/eventOld.js +0 -864
  160. package/lib/chevre/service/task/createEvent/createEvent.d.ts +0 -25
  161. package/lib/chevre/service/task/createEvent/createEvent.js +0 -45
  162. package/lib/chevre/service/task/createEvent/createEventBySchedule/factory.d.ts +0 -22
  163. package/lib/chevre/service/task/createEvent/createEventBySchedule/factory.js +0 -188
  164. package/lib/chevre/service/task/createEvent/createEventBySchedule/schedule2events.d.ts +0 -15
  165. package/lib/chevre/service/task/createEvent/createEventBySchedule/schedule2events.js +0 -116
  166. package/lib/chevre/service/task/createEvent/createEventBySchedule.d.ts +0 -25
  167. package/lib/chevre/service/task/createEvent/createEventBySchedule.js +0 -107
  168. package/lib/chevre/service/task/createEvent/createEventSeries.d.ts +0 -13
  169. package/lib/chevre/service/task/createEvent/createEventSeries.js +0 -118
  170. package/lib/chevre/service/task/createEvent.d.ts +0 -6
  171. package/lib/chevre/service/task/createEvent.js +0 -46
  172. package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.d.ts +0 -45
  173. package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +0 -447
@@ -19,6 +19,6 @@ declare function processUpdateMovieTheater(params: IImportFromCOAParams): (repos
19
19
  id: string;
20
20
  };
21
21
  movieTheater: IMovieTheater;
22
- screeningRooms: Omit<factory.place.screeningRoom.IPlace, "containsPlace" | "parentOrganization">[];
22
+ screeningRooms: Pick<factory.place.screeningRoom.IPlace, "additionalProperty" | "address" | "branchCode" | "name" | "openSeatingAllowed">[];
23
23
  }>;
24
24
  export { processUpdateMovieTheater };
@@ -65,7 +65,7 @@ function processUpdateMovieTheater(params) {
65
65
  if (movieTheater === undefined) {
66
66
  throw new factory.errors.NotFound(factory.placeType.MovieTheater);
67
67
  }
68
- screeningRooms = yield repos.screeningRoom.searchScreeningRooms({
68
+ screeningRooms = yield repos.screeningRoom.findRooms({
69
69
  project: { id: { $eq: params.project.id } },
70
70
  containedInPlace: { branchCode: { $eq: movieTheater.branchCode } }
71
71
  });
@@ -124,17 +124,19 @@ function createMovieTheaterFromCOA(project, seller, theaterFromCOA, screensFromC
124
124
  typeOf: 'QuantitativeValue',
125
125
  value: 1200,
126
126
  unitCode: factory.unitCode.Sec
127
- },
128
- availabilityStartsGraceTimeOnPOS: {
129
- typeOf: 'QuantitativeValue',
130
- value: -93,
131
- unitCode: factory.unitCode.Day
132
- },
133
- availabilityEndsGraceTimeOnPOS: {
134
- typeOf: 'QuantitativeValue',
135
- value: 2678400,
136
- unitCode: factory.unitCode.Sec
137
127
  }
128
+ // discontinue(2026-01-15~)
129
+ // availabilityStartsGraceTimeOnPOS: {
130
+ // typeOf: 'QuantitativeValue',
131
+ // value: -93,
132
+ // unitCode: factory.unitCode.Day
133
+ // },
134
+ // discontinue(2026-01-15~)
135
+ // availabilityEndsGraceTimeOnPOS: {
136
+ // typeOf: 'QuantitativeValue',
137
+ // value: 2678400,
138
+ // unitCode: factory.unitCode.Sec
139
+ // }
138
140
  },
139
141
  parentOrganization: { id: seller.id, typeOf: factory.organizationType.Corporation }
140
142
  };
@@ -188,10 +188,9 @@ function createScreeningEventSeriesFromCOA(params) {
188
188
  ? { version: params.filmFromCOA.titleBranchNum } // add version(2024-01-31~)
189
189
  : undefined);
190
190
  // redefine videoFormat(2024-09-18~)
191
- // const videoFormat: factory.event.screeningEventSeries.ICOAKubun =
192
- // params.eizouKubuns.filter((kubun) => kubun.kubunCode === params.filmFromCOA.kbnEizou)[0];
193
- const videoFormat = params.joueihousikiKubuns.filter(({ kubunCode }) => kubunCode === params.filmFromCOA.kbnJoueihousiki)
194
- .map(({ kubunCode }) => ({ typeOf: kubunCode, name: kubunCode }));
191
+ // const videoFormat: factory.eventSeries.IVideoFormat[] =
192
+ // params.joueihousikiKubuns.filter(({ kubunCode }) => kubunCode === params.filmFromCOA.kbnJoueihousiki)
193
+ // .map(({ kubunCode }) => ({ typeOf: kubunCode, name: kubunCode }));
195
194
  return {
196
195
  project: { typeOf: params.project.typeOf, id: params.project.id },
197
196
  typeOf: factory.eventType.ScreeningEventSeries,
@@ -214,7 +213,7 @@ function createScreeningEventSeriesFromCOA(params) {
214
213
  },
215
214
  // 必須化(2023-07-12~)
216
215
  organizer: { id: params.seller.id },
217
- videoFormat,
216
+ // videoFormat, // discontinue(2026-02-10~)
218
217
  soundFormat: [],
219
218
  workPerformed,
220
219
  duration: moment.duration(params.filmFromCOA.showTime, 'm')
@@ -7,8 +7,8 @@ import * as factory from '../../factory';
7
7
  type IMovieTheater = Pick<factory.place.movieTheater.IPlace, 'id' | 'typeOf' | 'branchCode' | 'name' | 'kanaName'>;
8
8
  declare function saveScreeningEvents(params: {
9
9
  movieTheater: IMovieTheater;
10
- screeningRooms: Pick<factory.place.screeningRoom.IPlace, 'typeOf' | 'branchCode' | 'name' | 'maximumAttendeeCapacity'>[];
11
- screeningEventSerieses?: factory.eventSeries.IEvent[];
10
+ screeningRooms: Pick<factory.place.screeningRoom.IPlace, 'branchCode' | 'name' | 'maximumAttendeeCapacity'>[];
11
+ screeningEventSerieses?: Omit<factory.eventSeries.IEvent, 'videoFormat'>[];
12
12
  project: {
13
13
  id: string;
14
14
  typeOf: factory.organizationType.Project;
@@ -101,7 +101,9 @@ function createScreeningEvents(params, options) {
101
101
  }, [
102
102
  'project', 'typeOf', 'eventStatus', 'identifier',
103
103
  'name', 'kanaName', 'alternativeHeadline', 'location',
104
- 'organizer', 'videoFormat', 'soundFormat', 'workPerformed',
104
+ 'organizer',
105
+ // 'videoFormat', // 参照廃止(2026-02-10~)
106
+ 'soundFormat', 'workPerformed',
105
107
  'duration', 'endDate', 'startDate', 'coaInfo',
106
108
  'offers', 'additionalProperty'
107
109
  ]);
@@ -170,20 +172,22 @@ function createScreeningEvents(params, options) {
170
172
  });
171
173
  }
172
174
  function minimizeSuperEvent(params) {
173
- const { workPerformed, videoFormat, startDate, soundFormat, name, location, kanaName, identifier, endDate, duration, coaInfo, alternativeHeadline,
174
- // additionalProperty,
175
- typeOf, id
176
- // project,
177
- // organizer,
178
- // offers,
179
- // eventStatus
180
- } = params.superEvent;
175
+ const { workPerformed,
176
+ // videoFormat,
177
+ startDate, soundFormat, name, location, kanaName, identifier, endDate, duration, coaInfo, alternativeHeadline, typeOf, id } = params.superEvent;
181
178
  return {
182
- workPerformed, videoFormat, startDate, soundFormat,
179
+ workPerformed, startDate, soundFormat,
183
180
  name, location, kanaName, identifier,
184
181
  endDate, duration, coaInfo, alternativeHeadline,
185
- // additionalProperty,
186
182
  typeOf, id
183
+ // 完全に廃止(2026-02-10~)
184
+ // // videoFormatをデータとしても廃止(万が一に備えてUSE_DEPRECATED_VIDEO_FORMAT_EVENTSで再設定可能)(2026-02-03~)
185
+ // ...(USE_DEPRECATED_VIDEO_FORMAT_EVENTS)
186
+ // ? {
187
+ // // 現時点で型廃止済だがデータとしては互換性維持(2026-01-15~)
188
+ // videoFormat
189
+ // }
190
+ // : undefined
187
191
  };
188
192
  }
189
193
  /**
@@ -266,7 +270,7 @@ function createScreeningEventFromCOA(params) {
266
270
  name: params.superEvent.name,
267
271
  eventStatus: factory.eventStatusType.EventScheduled,
268
272
  location: {
269
- typeOf: params.screenRoom.typeOf,
273
+ typeOf: factory.placeType.ScreeningRoom,
270
274
  branchCode: params.screenRoom.branchCode,
271
275
  name: params.screenRoom.name
272
276
  },
@@ -297,7 +297,15 @@ function createReservation(params) {
297
297
  startDate: moment(event.startDate)
298
298
  .toDate(),
299
299
  // 最適化(2022-05-31~)
300
- superEvent: Object.assign(Object.assign({ typeOf: event.superEvent.typeOf, id: event.superEvent.id, location: event.superEvent.location, name: event.superEvent.name, soundFormat: event.superEvent.soundFormat, videoFormat: event.superEvent.videoFormat, workPerformed }, (typeof event.superEvent.duration === 'string') ? { duration: event.superEvent.duration } : undefined), (event.superEvent.headline !== undefined) ? { headline: event.superEvent.headline } : undefined)
300
+ superEvent: Object.assign(Object.assign({ typeOf: event.superEvent.typeOf, id: event.superEvent.id, location: event.superEvent.location, name: event.superEvent.name, soundFormat: event.superEvent.soundFormat, workPerformed }, (typeof event.superEvent.duration === 'string') ? { duration: event.superEvent.duration } : undefined), (event.superEvent.headline !== undefined) ? { headline: event.superEvent.headline } : undefined
301
+ // videoFormatをデータとしても廃止(万が一に備えてUSE_DEPRECATED_VIDEO_FORMATで再設定可能)(2026-02-03~)
302
+ // ...(USE_DEPRECATED_VIDEO_FORMAT)
303
+ // ? {
304
+ // // 現時点で型廃止済だがデータとしては互換性維持(2026-01-15~)
305
+ // videoFormat: (<any>event.superEvent).videoFormat
306
+ // }
307
+ // : undefined
308
+ )
301
309
  };
302
310
  if (params.issuedThrough.typeOf !== factory.product.ProductType.EventService) {
303
311
  throw new factory.errors.Argument('issuedThrough', `issuedThrough.typeOf must be ${factory.product.ProductType.EventService}`);
@@ -127,7 +127,7 @@ function searchTicketOffersByItemOffered(params) {
127
127
  function searchEventTicketOffersByEvent(params) {
128
128
  // tslint:disable-next-line:max-func-body-length
129
129
  return (repos) => __awaiter(this, void 0, void 0, function* () {
130
- var _a;
130
+ var _a, _b;
131
131
  const event = params.event;
132
132
  let soundFormatTypes = [];
133
133
  let videoFormatTypes = [];
@@ -137,13 +137,16 @@ function searchEventTicketOffersByEvent(params) {
137
137
  page: 1,
138
138
  id: { $eq: event.superEvent.id }
139
139
  // typeOf: factory.eventType.ScreeningEventSeries
140
- }, ['soundFormat', 'videoFormat']);
140
+ },
141
+ // ['soundFormat', 'videoFormat', 'subEvent']
142
+ ['soundFormat', 'subEvent']);
141
143
  const superEvent = superEvents.shift();
142
144
  if (superEvent === undefined) {
143
145
  throw new factory.errors.NotFound(factory.eventType.ScreeningEventSeries);
144
146
  }
145
147
  soundFormatTypes = (Array.isArray(superEvent.soundFormat)) ? superEvent.soundFormat.map((f) => f.typeOf) : [];
146
- videoFormatTypes = (Array.isArray(superEvent.videoFormat)) ? superEvent.videoFormat.map((f) => f.typeOf) : [];
148
+ // videoFormatTypes = (Array.isArray(superEvent.videoFormat)) ? superEvent.videoFormat.map((f) => f.typeOf) : [];
149
+ videoFormatTypes = (Array.isArray((_a = superEvent.subEvent) === null || _a === void 0 ? void 0 : _a.videoFormat)) ? superEvent.subEvent.videoFormat : [];
147
150
  }
148
151
  const unacceptedPaymentMethod = getUnacceptedPaymentMethodByEvent({ event });
149
152
  // 上映方式がなければMovieTicket除外(2023-02-21~)
@@ -151,7 +154,7 @@ function searchEventTicketOffersByEvent(params) {
151
154
  // 興行設定があれば興行のカタログを参照する(2022-08-31~)
152
155
  const eventOffers = event.offers;
153
156
  const { availableOffers, sortedOfferIds } = yield searchTicketOffersByItemOffered({
154
- itemOffered: { id: String((_a = eventOffers === null || eventOffers === void 0 ? void 0 : eventOffers.itemOffered) === null || _a === void 0 ? void 0 : _a.id) },
157
+ itemOffered: { id: String((_b = eventOffers === null || eventOffers === void 0 ? void 0 : eventOffers.itemOffered) === null || _b === void 0 ? void 0 : _b.id) },
155
158
  // ids: params.ids,
156
159
  store: params.store,
157
160
  limit: params.limit,
@@ -28,7 +28,7 @@ function getUnacceptedPaymentMethodByEvent(params) {
28
28
  */
29
29
  function searchOfferAppliesToMovieTicket(params) {
30
30
  return (repos) => __awaiter(this, void 0, void 0, function* () {
31
- var _a, _b, _c, _d;
31
+ var _a, _b, _c, _d, _e;
32
32
  // optimize(2024-07-18~)
33
33
  const event = yield repos.event.projectEventFieldsById({ id: params.event.id }, ['project', 'startDate', 'typeOf', 'superEvent.id', 'offers.itemOffered.id', 'offers.unacceptedPaymentMethod']);
34
34
  // let soundFormatTypes: string[] = [];
@@ -39,13 +39,16 @@ function searchOfferAppliesToMovieTicket(params) {
39
39
  page: 1,
40
40
  id: { $eq: event.superEvent.id }
41
41
  // typeOf: factory.eventType.ScreeningEventSeries
42
- }, ['soundFormat', 'videoFormat']);
42
+ },
43
+ // ['soundFormat', 'videoFormat', 'subEvent']
44
+ ['soundFormat', 'subEvent']);
43
45
  const superEvent = superEvents.shift();
44
46
  if (superEvent === undefined) {
45
47
  throw new factory.errors.NotFound(factory.eventType.ScreeningEventSeries);
46
48
  }
47
49
  // soundFormatTypes = (Array.isArray(superEvent.soundFormat)) ? superEvent.soundFormat.map((f) => f.typeOf) : [];
48
- videoFormatTypes = (Array.isArray(superEvent.videoFormat)) ? superEvent.videoFormat.map((f) => f.typeOf) : [];
50
+ // videoFormatTypes = (Array.isArray(superEvent.videoFormat)) ? superEvent.videoFormat.map((f) => f.typeOf) : [];
51
+ videoFormatTypes = (Array.isArray((_a = superEvent.subEvent) === null || _a === void 0 ? void 0 : _a.videoFormat)) ? superEvent.subEvent.videoFormat : [];
49
52
  }
50
53
  const unacceptedPaymentMethod = getUnacceptedPaymentMethodByEvent({ event });
51
54
  // 上映方式がなければMovieTicket除外
@@ -53,7 +56,7 @@ function searchOfferAppliesToMovieTicket(params) {
53
56
  // 興行設定があれば興行のカタログを参照する
54
57
  const eventOffers = event.offers;
55
58
  let catalogId;
56
- if (typeof ((_a = eventOffers.itemOffered) === null || _a === void 0 ? void 0 : _a.id) === 'string') {
59
+ if (typeof ((_b = eventOffers.itemOffered) === null || _b === void 0 ? void 0 : _b.id) === 'string') {
57
60
  const eventService = (yield repos.product.projectFields({
58
61
  limit: 1,
59
62
  page: 1,
@@ -65,7 +68,7 @@ function searchOfferAppliesToMovieTicket(params) {
65
68
  throw new factory.errors.NotFound(factory.product.ProductType.EventService);
66
69
  }
67
70
  // const firstCatalogIdOfProduct = eventService.hasOfferCatalog?.id; // migrate to itemListElement(2024-09-30~)
68
- const firstCatalogIdOfProduct = (_c = (_b = eventService.hasOfferCatalog) === null || _b === void 0 ? void 0 : _b.itemListElement.at(0)) === null || _c === void 0 ? void 0 : _c.id;
71
+ const firstCatalogIdOfProduct = (_d = (_c = eventService.hasOfferCatalog) === null || _c === void 0 ? void 0 : _c.itemListElement.at(0)) === null || _d === void 0 ? void 0 : _d.id;
69
72
  if (typeof firstCatalogIdOfProduct === 'string') {
70
73
  catalogId = firstCatalogIdOfProduct;
71
74
  }
@@ -83,7 +86,7 @@ function searchOfferAppliesToMovieTicket(params) {
83
86
  }
84
87
  return repos.offer.searchAvaialbleAppliesToMovieTicketByOfferCatalogId({
85
88
  subOfferCatalog: { id: subOfferCatalogId, isOfferCatalogItem },
86
- availableAtOrFrom: { id: (_d = params.store) === null || _d === void 0 ? void 0 : _d.id },
89
+ availableAtOrFrom: { id: (_e = params.store) === null || _e === void 0 ? void 0 : _e.id },
87
90
  unacceptedPaymentMethod: unacceptedPaymentMethod,
88
91
  excludeAppliesToMovieTicket: excludeAppliesToMovieTicket,
89
92
  onlyValid: params.onlyValid === true,
@@ -110,7 +110,7 @@ function searchTicketOffersByItemOffered(params) {
110
110
  function searchEventTicketOffersByEvent(params) {
111
111
  // tslint:disable-next-line:max-func-body-length
112
112
  return (repos) => __awaiter(this, void 0, void 0, function* () {
113
- var _a;
113
+ var _a, _b;
114
114
  const event = params.event;
115
115
  let soundFormatTypes = [];
116
116
  let videoFormatTypes = [];
@@ -120,13 +120,16 @@ function searchEventTicketOffersByEvent(params) {
120
120
  page: 1,
121
121
  id: { $eq: event.superEvent.id }
122
122
  // typeOf: factory.eventType.ScreeningEventSeries
123
- }, ['soundFormat', 'videoFormat']);
123
+ },
124
+ // ['soundFormat', 'videoFormat', 'subEvent']
125
+ ['soundFormat', 'subEvent']);
124
126
  const superEvent = superEvents.shift();
125
127
  if (superEvent === undefined) {
126
128
  throw new factory.errors.NotFound(factory.eventType.ScreeningEventSeries);
127
129
  }
128
130
  soundFormatTypes = (Array.isArray(superEvent.soundFormat)) ? superEvent.soundFormat.map((f) => f.typeOf) : [];
129
- videoFormatTypes = (Array.isArray(superEvent.videoFormat)) ? superEvent.videoFormat.map((f) => f.typeOf) : [];
131
+ // videoFormatTypes = (Array.isArray(superEvent.videoFormat)) ? superEvent.videoFormat.map((f) => f.typeOf) : [];
132
+ videoFormatTypes = (Array.isArray((_a = superEvent.subEvent) === null || _a === void 0 ? void 0 : _a.videoFormat)) ? superEvent.subEvent.videoFormat : [];
130
133
  }
131
134
  const unacceptedPaymentMethod = getUnacceptedPaymentMethodByEvent({ event });
132
135
  // 上映方式がなければMovieTicket除外(2023-02-21~)
@@ -134,7 +137,7 @@ function searchEventTicketOffersByEvent(params) {
134
137
  // 興行設定があれば興行のカタログを参照する(2022-08-31~)
135
138
  const eventOffers = event.offers;
136
139
  const { availableOffers } = yield searchTicketOffersByItemOffered({
137
- itemOffered: { id: String((_a = eventOffers === null || eventOffers === void 0 ? void 0 : eventOffers.itemOffered) === null || _a === void 0 ? void 0 : _a.id) },
140
+ itemOffered: { id: String((_b = eventOffers === null || eventOffers === void 0 ? void 0 : eventOffers.itemOffered) === null || _b === void 0 ? void 0 : _b.id) },
138
141
  ids: params.ids,
139
142
  store: params.store,
140
143
  // limit: params.limit,
@@ -129,11 +129,17 @@ function responseBody2acceptedOffers4result(params) {
129
129
  name: event.superEvent.name,
130
130
  alternativeHeadline: event.superEvent.alternativeHeadline,
131
131
  location: event.superEvent.location,
132
- videoFormat: event.superEvent.videoFormat,
133
132
  soundFormat: event.superEvent.soundFormat,
134
133
  workPerformed: workPerformed,
135
134
  duration: event.superEvent.duration,
136
135
  coaInfo: event.superEvent.coaInfo
136
+ // videoFormatをデータとしても廃止(万が一に備えてUSE_DEPRECATED_VIDEO_FORMATで再設定可能)(2026-02-03~)
137
+ // ...(USE_DEPRECATED_VIDEO_FORMAT)
138
+ // ? {
139
+ // // 現時点で型廃止済だがデータとしては互換性維持(2026-01-15~)
140
+ // videoFormat: (<any>event.superEvent).videoFormat
141
+ // }
142
+ // : undefined
137
143
  }, id: event.id });
138
144
  const ticketNumber = util.format('%s:%s:%s', reservationFor.id, tmpReserve.seatSection, tmpReserve.seatNum);
139
145
  const ticketedSeat = {
@@ -81,7 +81,9 @@ function syncEventSeries2screeningEvents(params) {
81
81
  }, [
82
82
  'additionalProperty', 'alternativeHeadline', 'description', 'dubLanguage',
83
83
  'endDate', 'headline', 'kanaName', 'location', 'name',
84
- 'soundFormat', 'startDate', 'subtitleLanguage', 'typeOf', 'videoFormat', 'workPerformed'
84
+ 'soundFormat', 'startDate', 'subtitleLanguage', 'typeOf',
85
+ // 'videoFormat', // 参照廃止(2026-02-10~)
86
+ 'workPerformed'
85
87
  ]);
86
88
  const superEventFromDB = superEvents.shift();
87
89
  if (superEventFromDB === undefined) {
@@ -165,15 +167,17 @@ function createInformTasks(params, setting) {
165
167
  id: { $in: params.ids }
166
168
  // typeOf: params.typeOf
167
169
  }, [
168
- 'project', 'organizer', 'typeOf', 'name', 'location', 'videoFormat', 'soundFormat', 'workPerformed', 'kanaName', 'eventStatus',
170
+ 'project', 'organizer', 'typeOf', 'name', 'location', 'soundFormat', 'workPerformed', 'kanaName', 'eventStatus',
169
171
  'endDate', 'startDate', 'additionalProperty', 'subtitleLanguage', 'dubLanguage',
170
- 'alternativeHeadline', 'description', 'duration', 'headline'
172
+ 'alternativeHeadline', 'description', 'duration', 'headline', 'subEvent'
171
173
  ] // inclusion(2024-07-30~)
172
174
  );
173
175
  // 最適化(2024-03-25~)
174
- events4inform = screeningEventSeries4inform.map(({ project, organizer, typeOf, name, location, id, videoFormat, soundFormat, workPerformed, kanaName, eventStatus, endDate, startDate, additionalProperty, subtitleLanguage, dubLanguage, alternativeHeadline, description, duration, headline }) => {
175
- return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ project, organizer, typeOf, name, location, id, videoFormat, soundFormat, workPerformed, kanaName, eventStatus,
176
- endDate, startDate }, (Array.isArray(additionalProperty)) ? { additionalProperty } : undefined), (subtitleLanguage !== undefined) ? {} : undefined), (dubLanguage !== undefined) ? { dubLanguage } : undefined), (alternativeHeadline !== undefined) ? { alternativeHeadline } : undefined), (description !== undefined) ? { description } : undefined), (typeof duration === 'string') ? { duration } : undefined), (headline !== undefined) ? { headline } : undefined);
176
+ events4inform = screeningEventSeries4inform.map(({ project, organizer, typeOf, name, location, id, soundFormat, workPerformed, kanaName, eventStatus, endDate, startDate, additionalProperty, subtitleLanguage, dubLanguage, alternativeHeadline, description, duration, headline, subEvent }) => {
177
+ return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ project, organizer, typeOf, name, location, id, soundFormat, workPerformed, kanaName, eventStatus,
178
+ endDate, startDate, videoFormat: (Array.isArray(subEvent === null || subEvent === void 0 ? void 0 : subEvent.videoFormat))
179
+ ? subEvent.videoFormat.map((codeValue) => ({ typeOf: codeValue, name: codeValue }))
180
+ : [] }, (Array.isArray(additionalProperty)) ? { additionalProperty } : undefined), (subtitleLanguage !== undefined) ? {} : undefined), (dubLanguage !== undefined) ? { dubLanguage } : undefined), (alternativeHeadline !== undefined) ? { alternativeHeadline } : undefined), (description !== undefined) ? { description } : undefined), (typeof duration === 'string') ? { duration } : undefined), (headline !== undefined) ? { headline } : undefined);
177
181
  });
178
182
  }
179
183
  if (events4inform.length > 0) {
@@ -373,7 +373,7 @@ function createServiceOutputIdentifier(params) {
373
373
  return { project: { id: params.product.project.id } };
374
374
  });
375
375
  const publishIdentifierResult = yield Promise.all(publishParams.map(() => __awaiter(this, void 0, void 0, function* () {
376
- const identifier = yield repos.serviceOutputIdentifier.publishByTimestamp({ startDate: new Date() });
376
+ const identifier = yield repos.serviceOutputIdentifier.issueServiceOutputIdentifier({ startDate: new Date() });
377
377
  return { identifier };
378
378
  })));
379
379
  // 識別子を発行
@@ -50,6 +50,11 @@ export declare function searchEventSeatOffersWithPaging(params: {
50
50
  };
51
51
  $projection?: factory.place.seat.IProjection;
52
52
  options: {
53
+ /**
54
+ * レスポンスにセクションコードを含める要素をひとつめのみにするかどうか
55
+ * 2026-01-14~
56
+ */
57
+ includeSectionCodeOnlyFirstElement: boolean;
53
58
  /**
54
59
  * 自動的にひとつめのセクションに絞るかどうか
55
60
  */
@@ -58,9 +58,10 @@ function addOffers2Seat(params) {
58
58
  * イベントに対する座席オファーを検索する
59
59
  */
60
60
  function searchEventSeatOffersWithPaging(params) {
61
+ // tslint:disable-next-line:max-func-body-length
61
62
  return (repos) => __awaiter(this, void 0, void 0, function* () {
62
63
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
63
- const { useDefaultSection } = params.options;
64
+ const { includeSectionCodeOnlyFirstElement, useDefaultSection } = params.options;
64
65
  let offers = [];
65
66
  // optimize(2024-07-18~)
66
67
  const event = yield repos.event.projectEventFieldsById({ id: params.event.id }, ['project', 'startDate', 'offers.itemOffered', 'organizer']);
@@ -115,14 +116,38 @@ function searchEventSeatOffersWithPaging(params) {
115
116
  };
116
117
  })
117
118
  });
118
- offers = seats.map((seat, index) => {
119
- return addOffers2Seat({
120
- seat,
121
- availability: (typeof availabilities[index] === 'string')
122
- ? factory.itemAvailability.OutOfStock // ホルダーが存在すればOutOfStock
123
- : factory.itemAvailability.InStock,
124
- priceSpecs: [] // priceSpecsをレスポンスから廃止(2024-12-22~)
125
- });
119
+ offers = seats.map(({ branchCode, name, containedInPlace, seatingType }, index) => {
120
+ let includeSectionCode = false;
121
+ if (includeSectionCodeOnlyFirstElement) {
122
+ if (useDefaultSection) {
123
+ // デフォルトセクション指定の場合、first elementのみセクションコードを含める
124
+ if (index === 0) {
125
+ includeSectionCode = true;
126
+ }
127
+ }
128
+ else {
129
+ includeSectionCode = true;
130
+ }
131
+ }
132
+ else {
133
+ includeSectionCode = true;
134
+ }
135
+ return Object.assign({ branchCode,
136
+ name,
137
+ seatingType,
138
+ // ...seat,
139
+ offers: [{
140
+ availability: (typeof availabilities[index] === 'string')
141
+ ? factory.itemAvailability.OutOfStock // ホルダーが存在すればOutOfStock
142
+ : factory.itemAvailability.InStock
143
+ }] }, (includeSectionCode) ? { containedInPlace } : undefined);
144
+ // return addOffers2Seat({
145
+ // seat,
146
+ // availability: (typeof availabilities[index] === 'string')
147
+ // ? factory.itemAvailability.OutOfStock // ホルダーが存在すればOutOfStock
148
+ // : factory.itemAvailability.InStock,
149
+ // priceSpecs: [] // priceSpecsをレスポンスから廃止(2024-12-22~)
150
+ // });
126
151
  });
127
152
  }
128
153
  }
@@ -7,5 +7,5 @@ import * as factory from '../../../../factory';
7
7
  */
8
8
  declare function createOnOrderCancelledTasksByTransaction(params: {
9
9
  transaction: Pick<factory.transaction.placeOrder.ITransaction, 'id' | 'project' | 'typeOf'>;
10
- }): (import("@chevre/factory/lib/task").IAttributes | import("@chevre/factory/lib/task/confirmMoneyTransfer").IAttributes | import("@chevre/factory/lib/task/confirmRegisterService").IAttributes | import("@chevre/factory/lib/task/confirmPayTransaction").IAttributes | import("@chevre/factory/lib/task/confirmRegisterServiceTransaction").IAttributes | import("@chevre/factory/lib/task/confirmReserveTransaction").IAttributes | import("@chevre/factory/lib/task/createAccountingReport").IAttributes | import("@chevre/factory/lib/task/createEvent").IAttributes | import("@chevre/factory/lib/task/deletePerson").IAttributes | import("@chevre/factory/lib/task/deleteTransaction").IAttributes | import("@chevre/factory/lib/task/givePointAward").IAttributes | import("@chevre/factory/lib/task/onAssetTransactionStatusChanged").IAttributes | import("@chevre/factory/lib/task/onAuthorizationCreated").IAttributes | import("@chevre/factory/lib/task/onEventChanged").IAttributes | import("@chevre/factory/lib/task/onResourceUpdated").IAttributes | import("@chevre/factory/lib/task/onOrderPaymentCompleted").IAttributes | import("@chevre/factory/lib/task/placeOrder").IAttributes | import("@chevre/factory/lib/task/returnOrder").IAttributes | import("@chevre/factory/lib/task/returnMoneyTransfer").IAttributes | import("@chevre/factory/lib/task/returnPayTransaction").IAttributes | import("@chevre/factory/lib/task/returnPointAward").IAttributes | import("@chevre/factory/lib/task/returnReserveTransaction").IAttributes | import("@chevre/factory/lib/task/sendEmailMessage").IAttributes | import("@chevre/factory/lib/task/sendOrder").IAttributes | import("@chevre/factory/lib/task/triggerWebhook").IAttributes | import("@chevre/factory/lib/task/useReservation").IAttributes | import("@chevre/factory/lib/task/voidMoneyTransferTransaction").IAttributes | import("@chevre/factory/lib/task/voidPayTransaction").IAttributes | import("@chevre/factory/lib/task/voidRegisterServiceTransaction").IAttributes | import("@chevre/factory/lib/task/voidReserveTransaction").IAttributes)[];
10
+ }): (import("@chevre/factory/lib/task").IAttributes | import("@chevre/factory/lib/task/confirmMoneyTransfer").IAttributes | import("@chevre/factory/lib/task/confirmRegisterService").IAttributes | import("@chevre/factory/lib/task/confirmPayTransaction").IAttributes | import("@chevre/factory/lib/task/confirmRegisterServiceTransaction").IAttributes | import("@chevre/factory/lib/task/confirmReserveTransaction").IAttributes | import("@chevre/factory/lib/task/createAccountingReport").IAttributes | import("@chevre/factory/lib/task/deletePerson").IAttributes | import("@chevre/factory/lib/task/deleteTransaction").IAttributes | import("@chevre/factory/lib/task/givePointAward").IAttributes | import("@chevre/factory/lib/task/onAssetTransactionStatusChanged").IAttributes | import("@chevre/factory/lib/task/onAuthorizationCreated").IAttributes | import("@chevre/factory/lib/task/onEventChanged").IAttributes | import("@chevre/factory/lib/task/onResourceDeleted").IAttributes | import("@chevre/factory/lib/task/onResourceUpdated").IAttributes | import("@chevre/factory/lib/task/onOrderPaymentCompleted").IAttributes | import("@chevre/factory/lib/task/placeOrder").IAttributes | import("@chevre/factory/lib/task/returnOrder").IAttributes | import("@chevre/factory/lib/task/returnMoneyTransfer").IAttributes | import("@chevre/factory/lib/task/returnPayTransaction").IAttributes | import("@chevre/factory/lib/task/returnPointAward").IAttributes | import("@chevre/factory/lib/task/returnReserveTransaction").IAttributes | import("@chevre/factory/lib/task/sendEmailMessage").IAttributes | import("@chevre/factory/lib/task/sendOrder").IAttributes | import("@chevre/factory/lib/task/triggerWebhook").IAttributes | import("@chevre/factory/lib/task/useReservation").IAttributes | import("@chevre/factory/lib/task/voidMoneyTransferTransaction").IAttributes | import("@chevre/factory/lib/task/voidPayTransaction").IAttributes | import("@chevre/factory/lib/task/voidRegisterServiceTransaction").IAttributes | import("@chevre/factory/lib/task/voidReserveTransaction").IAttributes)[];
11
11
  export { createOnOrderCancelledTasksByTransaction };
@@ -13,5 +13,5 @@ declare function createInformTasks(params: {
13
13
  }, setting: Pick<ISetting, 'onOrderStatusChanged'> | null): factory.task.IAttributes<factory.taskName.TriggerWebhook>[];
14
14
  declare function createNextSendOrderTasks(params: {
15
15
  order: IInTransitOrder;
16
- }): (import("@chevre/factory/lib/task").IAttributes | import("@chevre/factory/lib/task/confirmMoneyTransfer").IAttributes | import("@chevre/factory/lib/task/confirmRegisterService").IAttributes | import("@chevre/factory/lib/task/confirmPayTransaction").IAttributes | import("@chevre/factory/lib/task/confirmRegisterServiceTransaction").IAttributes | import("@chevre/factory/lib/task/confirmReserveTransaction").IAttributes | import("@chevre/factory/lib/task/createAccountingReport").IAttributes | import("@chevre/factory/lib/task/createEvent").IAttributes | import("@chevre/factory/lib/task/deletePerson").IAttributes | import("@chevre/factory/lib/task/deleteTransaction").IAttributes | import("@chevre/factory/lib/task/givePointAward").IAttributes | import("@chevre/factory/lib/task/onAssetTransactionStatusChanged").IAttributes | import("@chevre/factory/lib/task/onAuthorizationCreated").IAttributes | import("@chevre/factory/lib/task/onEventChanged").IAttributes | import("@chevre/factory/lib/task/onResourceUpdated").IAttributes | import("@chevre/factory/lib/task/onOrderPaymentCompleted").IAttributes | import("@chevre/factory/lib/task/placeOrder").IAttributes | import("@chevre/factory/lib/task/returnOrder").IAttributes | import("@chevre/factory/lib/task/returnMoneyTransfer").IAttributes | import("@chevre/factory/lib/task/returnPayTransaction").IAttributes | import("@chevre/factory/lib/task/returnPointAward").IAttributes | import("@chevre/factory/lib/task/returnReserveTransaction").IAttributes | import("@chevre/factory/lib/task/sendEmailMessage").IAttributes | import("@chevre/factory/lib/task/sendOrder").IAttributes | import("@chevre/factory/lib/task/triggerWebhook").IAttributes | import("@chevre/factory/lib/task/useReservation").IAttributes | import("@chevre/factory/lib/task/voidMoneyTransferTransaction").IAttributes | import("@chevre/factory/lib/task/voidPayTransaction").IAttributes | import("@chevre/factory/lib/task/voidRegisterServiceTransaction").IAttributes | import("@chevre/factory/lib/task/voidReserveTransaction").IAttributes)[];
16
+ }): (import("@chevre/factory/lib/task").IAttributes | import("@chevre/factory/lib/task/confirmMoneyTransfer").IAttributes | import("@chevre/factory/lib/task/confirmRegisterService").IAttributes | import("@chevre/factory/lib/task/confirmPayTransaction").IAttributes | import("@chevre/factory/lib/task/confirmRegisterServiceTransaction").IAttributes | import("@chevre/factory/lib/task/confirmReserveTransaction").IAttributes | import("@chevre/factory/lib/task/createAccountingReport").IAttributes | import("@chevre/factory/lib/task/deletePerson").IAttributes | import("@chevre/factory/lib/task/deleteTransaction").IAttributes | import("@chevre/factory/lib/task/givePointAward").IAttributes | import("@chevre/factory/lib/task/onAssetTransactionStatusChanged").IAttributes | import("@chevre/factory/lib/task/onAuthorizationCreated").IAttributes | import("@chevre/factory/lib/task/onEventChanged").IAttributes | import("@chevre/factory/lib/task/onResourceDeleted").IAttributes | import("@chevre/factory/lib/task/onResourceUpdated").IAttributes | import("@chevre/factory/lib/task/onOrderPaymentCompleted").IAttributes | import("@chevre/factory/lib/task/placeOrder").IAttributes | import("@chevre/factory/lib/task/returnOrder").IAttributes | import("@chevre/factory/lib/task/returnMoneyTransfer").IAttributes | import("@chevre/factory/lib/task/returnPayTransaction").IAttributes | import("@chevre/factory/lib/task/returnPointAward").IAttributes | import("@chevre/factory/lib/task/returnReserveTransaction").IAttributes | import("@chevre/factory/lib/task/sendEmailMessage").IAttributes | import("@chevre/factory/lib/task/sendOrder").IAttributes | import("@chevre/factory/lib/task/triggerWebhook").IAttributes | import("@chevre/factory/lib/task/useReservation").IAttributes | import("@chevre/factory/lib/task/voidMoneyTransferTransaction").IAttributes | import("@chevre/factory/lib/task/voidPayTransaction").IAttributes | import("@chevre/factory/lib/task/voidRegisterServiceTransaction").IAttributes | import("@chevre/factory/lib/task/voidReserveTransaction").IAttributes)[];
17
17
  export { createInformTasks, createNextSendOrderTasks, IInTransitOrder };
@@ -11,5 +11,5 @@ declare function createInformTasks(order: IReturnedOrder, returnOrderAction: IRe
11
11
  declare function createOnOrderReturnedTasksByTransaction(params: {
12
12
  order: Pick<factory.order.IOrder, 'project' | 'typeOf' | 'orderNumber' | 'customer' | 'price' | 'priceCurrency' | 'orderDate'>;
13
13
  potentialActions?: factory.action.transfer.returnAction.order.IPotentialActions;
14
- }): (import("@chevre/factory/lib/task").IAttributes | import("@chevre/factory/lib/task/confirmMoneyTransfer").IAttributes | import("@chevre/factory/lib/task/confirmRegisterService").IAttributes | import("@chevre/factory/lib/task/confirmPayTransaction").IAttributes | import("@chevre/factory/lib/task/confirmRegisterServiceTransaction").IAttributes | import("@chevre/factory/lib/task/confirmReserveTransaction").IAttributes | import("@chevre/factory/lib/task/createAccountingReport").IAttributes | import("@chevre/factory/lib/task/createEvent").IAttributes | import("@chevre/factory/lib/task/deletePerson").IAttributes | import("@chevre/factory/lib/task/deleteTransaction").IAttributes | import("@chevre/factory/lib/task/givePointAward").IAttributes | import("@chevre/factory/lib/task/onAssetTransactionStatusChanged").IAttributes | import("@chevre/factory/lib/task/onAuthorizationCreated").IAttributes | import("@chevre/factory/lib/task/onEventChanged").IAttributes | import("@chevre/factory/lib/task/onResourceUpdated").IAttributes | import("@chevre/factory/lib/task/onOrderPaymentCompleted").IAttributes | import("@chevre/factory/lib/task/placeOrder").IAttributes | import("@chevre/factory/lib/task/returnOrder").IAttributes | import("@chevre/factory/lib/task/returnMoneyTransfer").IAttributes | import("@chevre/factory/lib/task/returnPayTransaction").IAttributes | import("@chevre/factory/lib/task/returnPointAward").IAttributes | import("@chevre/factory/lib/task/returnReserveTransaction").IAttributes | import("@chevre/factory/lib/task/sendEmailMessage").IAttributes | import("@chevre/factory/lib/task/sendOrder").IAttributes | import("@chevre/factory/lib/task/triggerWebhook").IAttributes | import("@chevre/factory/lib/task/useReservation").IAttributes | import("@chevre/factory/lib/task/voidMoneyTransferTransaction").IAttributes | import("@chevre/factory/lib/task/voidPayTransaction").IAttributes | import("@chevre/factory/lib/task/voidRegisterServiceTransaction").IAttributes | import("@chevre/factory/lib/task/voidReserveTransaction").IAttributes)[];
14
+ }): (import("@chevre/factory/lib/task").IAttributes | import("@chevre/factory/lib/task/confirmMoneyTransfer").IAttributes | import("@chevre/factory/lib/task/confirmRegisterService").IAttributes | import("@chevre/factory/lib/task/confirmPayTransaction").IAttributes | import("@chevre/factory/lib/task/confirmRegisterServiceTransaction").IAttributes | import("@chevre/factory/lib/task/confirmReserveTransaction").IAttributes | import("@chevre/factory/lib/task/createAccountingReport").IAttributes | import("@chevre/factory/lib/task/deletePerson").IAttributes | import("@chevre/factory/lib/task/deleteTransaction").IAttributes | import("@chevre/factory/lib/task/givePointAward").IAttributes | import("@chevre/factory/lib/task/onAssetTransactionStatusChanged").IAttributes | import("@chevre/factory/lib/task/onAuthorizationCreated").IAttributes | import("@chevre/factory/lib/task/onEventChanged").IAttributes | import("@chevre/factory/lib/task/onResourceDeleted").IAttributes | import("@chevre/factory/lib/task/onResourceUpdated").IAttributes | import("@chevre/factory/lib/task/onOrderPaymentCompleted").IAttributes | import("@chevre/factory/lib/task/placeOrder").IAttributes | import("@chevre/factory/lib/task/returnOrder").IAttributes | import("@chevre/factory/lib/task/returnMoneyTransfer").IAttributes | import("@chevre/factory/lib/task/returnPayTransaction").IAttributes | import("@chevre/factory/lib/task/returnPointAward").IAttributes | import("@chevre/factory/lib/task/returnReserveTransaction").IAttributes | import("@chevre/factory/lib/task/sendEmailMessage").IAttributes | import("@chevre/factory/lib/task/sendOrder").IAttributes | import("@chevre/factory/lib/task/triggerWebhook").IAttributes | import("@chevre/factory/lib/task/useReservation").IAttributes | import("@chevre/factory/lib/task/voidMoneyTransferTransaction").IAttributes | import("@chevre/factory/lib/task/voidPayTransaction").IAttributes | import("@chevre/factory/lib/task/voidRegisterServiceTransaction").IAttributes | import("@chevre/factory/lib/task/voidReserveTransaction").IAttributes)[];
15
15
  export { createInformTasks, createOnOrderReturnedTasksByTransaction, IReturnAction };
@@ -0,0 +1,13 @@
1
+ import type { ActionRepo } from '../../../repo/action';
2
+ import type { OfferCatalogRepo } from '../../../repo/offerCatalog';
3
+ import type { OfferCatalogItemRepo } from '../../../repo/offerCatalogItem';
4
+ export declare function deleteResourcesByAggregateOffer(params: {
5
+ project: {
6
+ id: string;
7
+ };
8
+ ids: string[];
9
+ }): (repos: {
10
+ action: ActionRepo;
11
+ offerCatalog: OfferCatalogRepo;
12
+ offerCatalogItem: OfferCatalogItemRepo;
13
+ }) => Promise<void>;
@@ -0,0 +1,53 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.deleteResourcesByAggregateOffer = deleteResourcesByAggregateOffer;
13
+ const factory = require("../../../factory");
14
+ function deleteResourcesByAggregateOffer(params) {
15
+ return (repos) => __awaiter(this, void 0, void 0, function* () {
16
+ if (params.ids.length !== 1) {
17
+ throw new factory.errors.Argument('id', 'id.length must be 1');
18
+ }
19
+ for (const offerId of params.ids) {
20
+ const deleteActionAttributes = {
21
+ agent: { id: params.project.id, typeOf: factory.organizationType.Project },
22
+ object: { id: offerId, typeOf: factory.offerType.AggregateOffer },
23
+ project: { id: params.project.id, typeOf: factory.organizationType.Project },
24
+ typeOf: factory.actionType.DeleteAction
25
+ };
26
+ let deleteResult;
27
+ const action = yield repos.action.start(deleteActionAttributes);
28
+ try {
29
+ // カタログからpullItemListElement
30
+ const updateCatalogResult = yield repos.offerCatalog.pullItemListElement({
31
+ project: { id: params.project.id },
32
+ $pull: { itemListElement: { $elemMatch: { id: { $in: [offerId] } } } }
33
+ });
34
+ // サブカタログ対応
35
+ const updateCatalogItemResult = yield repos.offerCatalogItem.pullItemListElement({
36
+ project: { id: params.project.id },
37
+ $pull: { itemListElement: { $elemMatch: { id: { $in: [offerId] } } } }
38
+ });
39
+ deleteResult = { updateCatalogResult, updateCatalogItemResult };
40
+ }
41
+ catch (error) {
42
+ try {
43
+ yield repos.action.giveUp({ typeOf: deleteActionAttributes.typeOf, id: action.id, error });
44
+ }
45
+ catch (_) {
46
+ // no op
47
+ }
48
+ throw error;
49
+ }
50
+ yield repos.action.completeWithVoid({ typeOf: deleteActionAttributes.typeOf, id: action.id, result: deleteResult });
51
+ }
52
+ });
53
+ }
@@ -0,0 +1,13 @@
1
+ import type { AcceptedPaymentMethodRepo } from '../../../repo/acceptedPaymentMethod';
2
+ import type { ActionRepo } from '../../../repo/action';
3
+ import type { EventRepo } from '../../../repo/event';
4
+ export declare function deleteResourcesByEventSeries(params: {
5
+ project: {
6
+ id: string;
7
+ };
8
+ ids: string[];
9
+ }): (repos: {
10
+ acceptedPaymentMethod: AcceptedPaymentMethodRepo;
11
+ action: ActionRepo;
12
+ event: EventRepo;
13
+ }) => Promise<void>;