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

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 (133) 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/decryptOrderNumber.ts +14 -0
  12. package/example/src/chevre/orderNumber/testRandomness.ts +54 -0
  13. package/example/src/chevre/place/adminEntranceGates.ts +69 -0
  14. package/example/src/chevre/place/checkEntranceGatesCount.ts +82 -0
  15. package/example/src/chevre/place/findRooms.ts +24 -0
  16. package/example/src/chevre/place/findSections.ts +28 -0
  17. package/example/src/chevre/place/migrateSectionIdentifier.ts +92 -0
  18. package/example/src/chevre/place/seatsJson2csv.ts +63 -0
  19. package/example/src/chevre/place/upsertMovieTheatersByBranchCode.ts +41 -0
  20. package/example/src/chevre/place/upsertRoomsByBranchCode.ts +40 -0
  21. package/example/src/chevre/place/upsertSeatSectionsByBranchCode.ts +56 -0
  22. package/example/src/chevre/reIndex.ts +1 -1
  23. package/example/src/chevre/roles/addAdminAcceptedPaymentMethodReadPermissionIfNotExists.ts +33 -0
  24. package/example/src/chevre/roles/addAdminAcceptedPaymentMethodWritePermissionIfNotExists.ts +33 -0
  25. package/example/src/chevre/roles/addAdminMovieReadPermissionIfNotExists.ts +49 -0
  26. package/example/src/chevre/roles/addAdminRoomReadPermissionIfNotExists.ts +34 -0
  27. package/example/src/chevre/roles/addAdminRoomWritePermissionIfNotExists.ts +34 -0
  28. package/example/src/chevre/settings/addOrderNumberSetting.ts +44 -0
  29. package/example/src/chevre/settings/addTransactionNumberSetting.ts +40 -0
  30. package/example/src/chevre/transactionNumber/publishByTimestamp.ts +23 -0
  31. package/example/src/chevre/transactionNumber/testRandomness.ts +42 -0
  32. package/example/src/chevre/unsetUnnecessaryFields.ts +8 -4
  33. package/lib/chevre/emailMessageBuilder.js +1 -0
  34. package/lib/chevre/factory/event.d.ts +1 -1
  35. package/lib/chevre/factory/event.js +11 -5
  36. package/lib/chevre/factory/transactionNumber.d.ts +19 -0
  37. package/lib/chevre/factory/transactionNumber.js +54 -0
  38. package/lib/chevre/repo/acceptedPaymentMethod.d.ts +41 -8
  39. package/lib/chevre/repo/acceptedPaymentMethod.js +72 -27
  40. package/lib/chevre/repo/aggregateOffer.d.ts +6 -1
  41. package/lib/chevre/repo/aggregateOffer.js +11 -3
  42. package/lib/chevre/repo/aggregateOrder.js +0 -93
  43. package/lib/chevre/repo/aggregateReservation.d.ts +0 -1
  44. package/lib/chevre/repo/aggregateReservation.js +0 -2
  45. package/lib/chevre/repo/confirmationNumber.d.ts +1 -0
  46. package/lib/chevre/repo/confirmationNumber.js +32 -25
  47. package/lib/chevre/repo/event.d.ts +3 -3
  48. package/lib/chevre/repo/event.js +20 -8
  49. package/lib/chevre/repo/eventOffer.d.ts +8 -0
  50. package/lib/chevre/repo/eventOffer.js +11 -0
  51. package/lib/chevre/repo/eventSeries.d.ts +18 -25
  52. package/lib/chevre/repo/eventSeries.js +155 -101
  53. package/lib/chevre/repo/mongoose/schemas/aggregateReservation.js +0 -1
  54. package/lib/chevre/repo/mongoose/schemas/eventSeries.js +13 -25
  55. package/lib/chevre/repo/mongoose/schemas/offerCatalog.js +2 -8
  56. package/lib/chevre/repo/mongoose/schemas/offerCatalogItem.js +28 -2
  57. package/lib/chevre/repo/mongoose/schemas/place.d.ts +6 -2
  58. package/lib/chevre/repo/mongoose/schemas/setting.d.ts +40 -0
  59. package/lib/chevre/repo/mongoose/schemas/setting.js +3 -0
  60. package/lib/chevre/repo/offerCatalog.d.ts +14 -1
  61. package/lib/chevre/repo/offerCatalog.js +41 -19
  62. package/lib/chevre/repo/offerCatalogItem.d.ts +10 -1
  63. package/lib/chevre/repo/offerCatalogItem.js +32 -17
  64. package/lib/chevre/repo/orderNumber.d.ts +7 -0
  65. package/lib/chevre/repo/orderNumber.js +110 -34
  66. package/lib/chevre/repo/place/entranceGate.d.ts +57 -0
  67. package/lib/chevre/repo/place/entranceGate.js +172 -0
  68. package/lib/chevre/repo/place/movieTheater.d.ts +40 -3
  69. package/lib/chevre/repo/place/movieTheater.js +77 -6
  70. package/lib/chevre/repo/place/screeningRoom.d.ts +60 -31
  71. package/lib/chevre/repo/place/screeningRoom.js +227 -135
  72. package/lib/chevre/repo/place/seat.d.ts +47 -45
  73. package/lib/chevre/repo/place/seat.js +175 -45
  74. package/lib/chevre/repo/place/section.d.ts +60 -30
  75. package/lib/chevre/repo/place/section.js +337 -127
  76. package/lib/chevre/repo/serviceOutputIdentifier.d.ts +3 -1
  77. package/lib/chevre/repo/serviceOutputIdentifier.js +42 -27
  78. package/lib/chevre/repo/setting.d.ts +1 -1
  79. package/lib/chevre/repo/setting.js +2 -2
  80. package/lib/chevre/repo/task.d.ts +1 -1
  81. package/lib/chevre/repo/transactionNumber.d.ts +5 -0
  82. package/lib/chevre/repo/transactionNumber.js +63 -27
  83. package/lib/chevre/repository.d.ts +8 -0
  84. package/lib/chevre/repository.js +16 -0
  85. package/lib/chevre/service/assetTransaction/reserve/start/factory/createStartParams.js +10 -2
  86. package/lib/chevre/service/event/processUpdateMovieTheater.d.ts +1 -1
  87. package/lib/chevre/service/event/processUpdateMovieTheater.js +13 -11
  88. package/lib/chevre/service/event/saveScreeningEventSeries.js +4 -5
  89. package/lib/chevre/service/event/saveScreeningEvents.d.ts +2 -2
  90. package/lib/chevre/service/event/saveScreeningEvents.js +16 -12
  91. package/lib/chevre/service/offer/event/authorize/factory.js +9 -1
  92. package/lib/chevre/service/offer/event/searchEventTicketOffers.js +7 -4
  93. package/lib/chevre/service/offer/event/searchOfferAppliesToMovieTicket.js +9 -6
  94. package/lib/chevre/service/offer/event/searchOffersByIds.js +7 -4
  95. package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +7 -1
  96. package/lib/chevre/service/offer/onEventChanged.js +10 -6
  97. package/lib/chevre/service/offer/product.js +1 -1
  98. package/lib/chevre/service/offer.d.ts +5 -0
  99. package/lib/chevre/service/offer.js +34 -9
  100. package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled/factory.d.ts +1 -1
  101. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +1 -1
  102. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.d.ts +1 -1
  103. package/lib/chevre/service/task/createEvent/createEventBySchedule/factory.d.ts +2 -2
  104. package/lib/chevre/service/task/createEvent/createEventBySchedule/factory.js +5 -3
  105. package/lib/chevre/service/task/createEvent/createEventBySchedule/schedule2events.js +4 -2
  106. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByAggregateOffer.d.ts +13 -0
  107. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByAggregateOffer.js +53 -0
  108. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByEventSeries.d.ts +13 -0
  109. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByEventSeries.js +56 -0
  110. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByMovieTheater.d.ts +15 -0
  111. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByMovieTheater.js +58 -0
  112. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByOfferCatalog.d.ts +17 -0
  113. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByOfferCatalog.js +75 -0
  114. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByProduct.d.ts +19 -0
  115. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByProduct.js +60 -0
  116. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByRoom.d.ts +20 -0
  117. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByRoom.js +51 -0
  118. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.d.ts +27 -0
  119. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.js +100 -0
  120. package/lib/chevre/service/task/onResourceDeleted.d.ts +6 -0
  121. package/lib/chevre/service/task/onResourceDeleted.js +168 -0
  122. package/lib/chevre/service/task/onResourceUpdated.js +205 -42
  123. package/lib/chevre/service/task/syncResourcesFromCOA.js +4 -2
  124. package/lib/chevre/service/taskHandler.js +1 -0
  125. package/package.json +10 -8
  126. package/example/src/chevre/event/upsertManyScreeningEventByIdentifier.ts +0 -191
  127. package/example/src/chevre/eventSeries/migrateEventSeriesUnacceptedPaymentMethod.ts +0 -93
  128. package/example/src/chevre/offers/createSampleOffers.ts +0 -154
  129. package/example/src/chevre/settings/addSettings.ts +0 -46
  130. package/lib/chevre/service/eventOld.d.ts +0 -60
  131. package/lib/chevre/service/eventOld.js +0 -864
  132. package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.d.ts +0 -45
  133. package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +0 -447
@@ -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/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/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/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/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/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/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 };
@@ -1,11 +1,11 @@
1
1
  import type { ICreatingEvent4ttts } from '../../../../repo/event';
2
2
  import type { ICustomerMember } from '../../../../repo/member';
3
3
  import * as factory from '../../../../factory';
4
- declare function tour2creatingEvent(tour: ITourBySchedule, movieTheater: Pick<factory.place.movieTheater.IPlace, 'id' | 'branchCode' | 'parentOrganization'>, screeningRoom: Omit<factory.place.screeningRoom.IPlace, 'containsPlace' | 'parentOrganization'>, existingApplicationMembers: {
4
+ declare function tour2creatingEvent(tour: ITourBySchedule, movieTheater: Pick<factory.place.movieTheater.IPlace, 'id' | 'branchCode' | 'parentOrganization'>, screeningRoom: Pick<factory.place.screeningRoom.IPlace, 'additionalProperty' | 'address' | 'branchCode' | 'name' | 'maximumAttendeeCapacity'>, existingApplicationMembers: {
5
5
  member: ICustomerMember;
6
6
  }[], maxValue: number, eventService: Pick<factory.product.IProduct, 'id' | 'name'> & {
7
7
  id: string;
8
- }, screeningEventSeries: Pick<factory.eventSeries.IEvent, 'location' | 'additionalProperty' | 'description' | 'endDate' | 'headline' | 'id' | 'kanaName' | 'name' | 'soundFormat' | 'startDate' | 'typeOf' | 'videoFormat' | 'workPerformed'>, project: {
8
+ }, screeningEventSeries: Pick<factory.eventSeries.IEvent, 'location' | 'additionalProperty' | 'description' | 'endDate' | 'headline' | 'id' | 'kanaName' | 'name' | 'soundFormat' | 'startDate' | 'typeOf' | 'workPerformed'>, project: {
9
9
  id: string;
10
10
  }): ICreatingEvent4ttts;
11
11
  interface ITourBySchedule {
@@ -83,7 +83,7 @@ function tour2creatingEvent(tour, movieTheater, screeningRoom, existingApplicati
83
83
  }, typeOf: factory.product.ProductType.EventService, availableChannel: {
84
84
  typeOf: 'ServiceChannel',
85
85
  serviceLocation: {
86
- typeOf: screeningRoom.typeOf,
86
+ typeOf: factory.placeType.ScreeningRoom,
87
87
  branchCode: screeningRoom.branchCode,
88
88
  name: screeningRoom.name,
89
89
  containedInPlace: Object.assign({ typeOf: screeningEventSeries.location.typeOf, id: screeningEventSeries.location.id, branchCode: screeningEventSeries.location.branchCode }, (screeningEventSeries.location.name !== undefined)
@@ -93,7 +93,9 @@ function tour2creatingEvent(tour, movieTheater, screeningRoom, existingApplicati
93
93
  } }, { name: { ja: (typeof eventService.name === 'string') ? eventService.name : String((_a = eventService.name) === null || _a === void 0 ? void 0 : _a.ja) } }),
94
94
  seller: offersSeller
95
95
  };
96
- const screeningEventSuperEvent = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ typeOf: screeningEventSeries.typeOf, id: screeningEventSeries.id, videoFormat: screeningEventSeries.videoFormat, soundFormat: screeningEventSeries.soundFormat, workPerformed: screeningEventSeries.workPerformed, location: screeningEventSeries.location, kanaName: screeningEventSeries.kanaName, name: screeningEventSeries.name }, (Array.isArray(screeningEventSeries.additionalProperty))
96
+ const screeningEventSuperEvent = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ typeOf: screeningEventSeries.typeOf, id: screeningEventSeries.id,
97
+ // videoFormat: screeningEventSeries.videoFormat, // discontinue(2026-01-15~)
98
+ soundFormat: screeningEventSeries.soundFormat, workPerformed: screeningEventSeries.workPerformed, location: screeningEventSeries.location, kanaName: screeningEventSeries.kanaName, name: screeningEventSeries.name }, (Array.isArray(screeningEventSeries.additionalProperty))
97
99
  ? { additionalProperty: screeningEventSeries.additionalProperty }
98
100
  : undefined), (screeningEventSeries.startDate !== undefined)
99
101
  ? { startDate: screeningEventSeries.startDate }
@@ -104,7 +106,7 @@ function tour2creatingEvent(tour, movieTheater, screeningRoom, existingApplicati
104
106
  : undefined), (screeningEventSeries.headline !== undefined)
105
107
  ? { headline: screeningEventSeries.headline }
106
108
  : undefined);
107
- const location = Object.assign({ typeOf: screeningRoom.typeOf, branchCode: screeningRoom.branchCode, name: screeningRoom.name }, (screeningRoom.address !== undefined) ? { address: screeningRoom.address } : undefined);
109
+ const location = Object.assign({ typeOf: factory.placeType.ScreeningRoom, branchCode: screeningRoom.branchCode, name: screeningRoom.name }, (screeningRoom.address !== undefined) ? { address: screeningRoom.address } : undefined);
108
110
  return {
109
111
  project: { id: project.id, typeOf: factory.organizationType.Project },
110
112
  typeOf: factory.eventType.ScreeningEvent,
@@ -46,7 +46,9 @@ function schedule2relatedResources(schedule) {
46
46
  id: { $eq: eventSeriesId }
47
47
  }, [
48
48
  'location', 'additionalProperty', 'description', 'endDate', 'headline', 'kanaName', 'name',
49
- 'soundFormat', 'startDate', 'typeOf', 'videoFormat', 'workPerformed'
49
+ 'soundFormat', 'startDate', 'typeOf',
50
+ // 'videoFormat', // 参照廃止(2026-02-10~)
51
+ 'workPerformed'
50
52
  ])).shift();
51
53
  if (screeningEventSeries === undefined) {
52
54
  throw new factory.errors.NotFound(factory.eventType.ScreeningEventSeries);
@@ -61,7 +63,7 @@ function schedule2relatedResources(schedule) {
61
63
  if (movieTheater === undefined) {
62
64
  throw new factory.errors.NotFound(factory.placeType.MovieTheater);
63
65
  }
64
- const screeningRoom = (yield repos.screeningRoom.searchScreeningRooms({
66
+ const screeningRoom = (yield repos.screeningRoom.findRooms({
65
67
  limit: 1,
66
68
  page: 1,
67
69
  project: { id: { $eq: project.id } },
@@ -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>;
@@ -0,0 +1,56 @@
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.deleteResourcesByEventSeries = deleteResourcesByEventSeries;
13
+ const factory = require("../../../factory");
14
+ function deleteResourcesByEventSeries(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 eventSeriesId of params.ids) {
20
+ const deleteActionAttributes = {
21
+ agent: { id: params.project.id, typeOf: factory.organizationType.Project },
22
+ object: { id: eventSeriesId, typeOf: factory.eventType.ScreeningEventSeries },
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
+ // 対応決済方法削除(2026-02-07~)
30
+ const deleteAcceptedPaymentMethodsResult = yield repos.acceptedPaymentMethod.deleteAcceptedPaymentMethodsByItemOffered({
31
+ project: { id: params.project.id },
32
+ itemOffered: { id: eventSeriesId }
33
+ });
34
+ // イベント削除
35
+ const deleteScreeningEventResult = yield repos.event.deleteManyBySuperEventId({
36
+ project: { id: params.project.id },
37
+ superEvent: { id: eventSeriesId }
38
+ });
39
+ deleteResult = {
40
+ deleteAcceptedPaymentMethodsResult,
41
+ deleteScreeningEventResult
42
+ };
43
+ }
44
+ catch (error) {
45
+ try {
46
+ yield repos.action.giveUp({ typeOf: deleteActionAttributes.typeOf, id: action.id, error });
47
+ }
48
+ catch (_) {
49
+ // no op
50
+ }
51
+ throw error;
52
+ }
53
+ yield repos.action.completeWithVoid({ typeOf: deleteActionAttributes.typeOf, id: action.id, result: deleteResult });
54
+ }
55
+ });
56
+ }
@@ -0,0 +1,15 @@
1
+ import type { ActionRepo } from '../../../repo/action';
2
+ import type { EventRepo } from '../../../repo/event';
3
+ import type { EventSeriesRepo } from '../../../repo/eventSeries';
4
+ import type { ScreeningRoomRepo } from '../../../repo/place/screeningRoom';
5
+ export declare function deleteResourcesByMovieTheater(params: {
6
+ project: {
7
+ id: string;
8
+ };
9
+ ids: string[];
10
+ }): (repos: {
11
+ action: ActionRepo;
12
+ event: EventRepo;
13
+ eventSeries: EventSeriesRepo;
14
+ screeningRoom: ScreeningRoomRepo;
15
+ }) => Promise<void>;
@@ -0,0 +1,58 @@
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.deleteResourcesByMovieTheater = deleteResourcesByMovieTheater;
13
+ const factory = require("../../../factory");
14
+ function deleteResourcesByMovieTheater(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 placeId of params.ids) {
20
+ const deleteActionAttributes = {
21
+ agent: { id: params.project.id, typeOf: factory.organizationType.Project },
22
+ object: { id: placeId, typeOf: factory.placeType.MovieTheater },
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
+ // イベント削除
30
+ const deleteScreeningEventResult = yield repos.event.deleteManyBySuperEventLocationId({
31
+ project: { id: params.project.id },
32
+ superEvent: { location: { id: placeId } }
33
+ });
34
+ // 施設コンテンツ削除
35
+ const deleteScreeningEventSeriesResult = yield repos.eventSeries.deleteManyByLocationId({
36
+ project: { id: params.project.id },
37
+ location: { id: placeId }
38
+ });
39
+ // ルーム削除
40
+ const deletePlaceResult = yield repos.screeningRoom.deleteScreeningRoomsByMovieTheaterId({
41
+ project: { id: params.project.id },
42
+ containedInPlace: { id: placeId }
43
+ });
44
+ deleteResult = { deleteScreeningEventResult, deleteScreeningEventSeriesResult, deletePlaceResult };
45
+ }
46
+ catch (error) {
47
+ try {
48
+ yield repos.action.giveUp({ typeOf: deleteActionAttributes.typeOf, id: action.id, error });
49
+ }
50
+ catch (_) {
51
+ // no op
52
+ }
53
+ throw error;
54
+ }
55
+ yield repos.action.completeWithVoid({ typeOf: deleteActionAttributes.typeOf, id: action.id, result: deleteResult });
56
+ }
57
+ });
58
+ }
@@ -0,0 +1,17 @@
1
+ import type { ActionRepo } from '../../../repo/action';
2
+ import type { AggregateOfferRepo } from '../../../repo/aggregateOffer';
3
+ import type { EventRepo } from '../../../repo/event';
4
+ import type { OfferCatalogRepo } from '../../../repo/offerCatalog';
5
+ import type { ProductRepo } from '../../../repo/product';
6
+ export declare function deleteResourcesByOfferCatalog(params: {
7
+ project: {
8
+ id: string;
9
+ };
10
+ ids: string[];
11
+ }): (repos: {
12
+ action: ActionRepo;
13
+ aggregateOffer: AggregateOfferRepo;
14
+ event: EventRepo;
15
+ offerCatalog: OfferCatalogRepo;
16
+ product: ProductRepo;
17
+ }) => Promise<void>;
@@ -0,0 +1,75 @@
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.deleteResourcesByOfferCatalog = deleteResourcesByOfferCatalog;
13
+ const factory = require("../../../factory");
14
+ function deleteResourcesByOfferCatalog(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 catalogId of params.ids) {
20
+ const deleteActionAttributes = {
21
+ agent: { id: params.project.id, typeOf: factory.organizationType.Project },
22
+ object: { id: catalogId, typeOf: 'OfferCatalog' },
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
+ // カタログからプロダクト検索
30
+ const productsWithCatalog = yield repos.product.projectFields({
31
+ project: { id: { $eq: params.project.id } },
32
+ hasOfferCatalog: { id: { $eq: catalogId } }
33
+ }, ['id']
34
+ // []
35
+ );
36
+ let deleteEventResult;
37
+ let updateOfferResult;
38
+ if (productsWithCatalog.length > 0) {
39
+ const deletingProductIds = productsWithCatalog.map((product) => product.id);
40
+ // 興行を設定されたイベント削除
41
+ deleteEventResult = yield repos.event.deleteManyEventsByItemOfferedId({
42
+ project: { id: params.project.id },
43
+ offers: { itemOffered: { id: { $in: deletingProductIds } } }
44
+ });
45
+ // アドオンから除外
46
+ updateOfferResult = yield repos.aggregateOffer.pullAddOns({
47
+ project: { id: params.project.id },
48
+ addOn: { itemOffered: { id: { $in: deletingProductIds } } }
49
+ });
50
+ }
51
+ // プロダクト削除
52
+ const deleteProductResult = yield repos.product.deleteByHasOfferCatalog({
53
+ project: { id: params.project.id },
54
+ hasOfferCatalog: { id: catalogId }
55
+ });
56
+ // カタログからpullItemListElement(サブカタログ対応)
57
+ const updateCatalogResult = yield repos.offerCatalog.pullItemListElement({
58
+ project: { id: params.project.id },
59
+ $pull: { itemListElement: { $elemMatch: { id: { $in: [catalogId] } } } }
60
+ });
61
+ deleteResult = { deleteEventResult, deleteProductResult, updateOfferResult, updateCatalogResult };
62
+ }
63
+ catch (error) {
64
+ try {
65
+ yield repos.action.giveUp({ typeOf: deleteActionAttributes.typeOf, id: action.id, error });
66
+ }
67
+ catch (_) {
68
+ // no op
69
+ }
70
+ throw error;
71
+ }
72
+ yield repos.action.completeWithVoid({ typeOf: deleteActionAttributes.typeOf, id: action.id, result: deleteResult });
73
+ }
74
+ });
75
+ }