@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
@@ -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
+ }
@@ -0,0 +1,19 @@
1
+ import * as factory from '../../../factory';
2
+ import type { ActionRepo } from '../../../repo/action';
3
+ import type { AggregateOfferRepo } from '../../../repo/aggregateOffer';
4
+ import type { EventRepo } from '../../../repo/event';
5
+ import type { NoteRepo } from '../../../repo/note';
6
+ import type { ProductRepo } from '../../../repo/product';
7
+ export declare function deleteResourcesByProduct(params: {
8
+ project: {
9
+ id: string;
10
+ };
11
+ ids: string[];
12
+ typeOf: factory.product.ProductType;
13
+ }): (repos: {
14
+ action: ActionRepo;
15
+ aggregateOffer: AggregateOfferRepo;
16
+ event: EventRepo;
17
+ note: NoteRepo;
18
+ product: ProductRepo;
19
+ }) => Promise<void>;
@@ -0,0 +1,60 @@
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.deleteResourcesByProduct = deleteResourcesByProduct;
13
+ const factory = require("../../../factory");
14
+ function deleteResourcesByProduct(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 productId of params.ids) {
20
+ const deleteActionAttributes = {
21
+ agent: { id: params.project.id, typeOf: factory.organizationType.Project },
22
+ object: { id: productId, typeOf: params.typeOf },
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
+ let deleteEventResult;
30
+ let updateOfferResult;
31
+ let deleteNoteResult;
32
+ // 興行を設定されたイベント削除
33
+ deleteEventResult = yield repos.event.deleteManyEventsByItemOfferedId({
34
+ project: { id: params.project.id },
35
+ offers: { itemOffered: { id: { $in: [productId] } } }
36
+ });
37
+ // アドオンから除外
38
+ updateOfferResult = yield repos.aggregateOffer.pullAddOns({
39
+ project: { id: params.project.id },
40
+ addOn: { itemOffered: { id: { $in: [productId] } } }
41
+ });
42
+ // メモを削除(2025-09-18~)
43
+ deleteNoteResult = yield repos.note.deleteNotesByAbout({
44
+ about: { id: productId, typeOf: params.typeOf }
45
+ });
46
+ deleteResult = { deleteEventResult, updateOfferResult, deleteNoteResult };
47
+ }
48
+ catch (error) {
49
+ try {
50
+ yield repos.action.giveUp({ typeOf: deleteActionAttributes.typeOf, id: action.id, error });
51
+ }
52
+ catch (_) {
53
+ // no op
54
+ }
55
+ throw error;
56
+ }
57
+ yield repos.action.completeWithVoid({ typeOf: deleteActionAttributes.typeOf, id: action.id, result: deleteResult });
58
+ }
59
+ });
60
+ }
@@ -0,0 +1,20 @@
1
+ import type { ActionRepo } from '../../../repo/action';
2
+ import type { EventRepo } from '../../../repo/event';
3
+ export declare function deleteResourcesByRoom(params: {
4
+ project: {
5
+ id: string;
6
+ };
7
+ /**
8
+ * ルームコード
9
+ */
10
+ branchCode: string[];
11
+ containedInPlace: {
12
+ /**
13
+ * 施設ID
14
+ */
15
+ id: string;
16
+ };
17
+ }): (repos: {
18
+ action: ActionRepo;
19
+ event: EventRepo;
20
+ }) => Promise<void>;
@@ -0,0 +1,51 @@
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.deleteResourcesByRoom = deleteResourcesByRoom;
13
+ const factory = require("../../../factory");
14
+ function deleteResourcesByRoom(params) {
15
+ return (repos) => __awaiter(this, void 0, void 0, function* () {
16
+ // 現時点で、複数ルーム削除タスクは作成されない
17
+ const firstBranchCode = params.branchCode.at(0);
18
+ if (typeof firstBranchCode !== 'string') {
19
+ throw new factory.errors.ArgumentNull('branchCode');
20
+ }
21
+ const deleteActionAttributes = {
22
+ agent: { id: params.project.id, typeOf: factory.organizationType.Project },
23
+ object: { branchCode: firstBranchCode, containedInPlace: params.containedInPlace, typeOf: factory.placeType.ScreeningRoom },
24
+ project: { id: params.project.id, typeOf: factory.organizationType.Project },
25
+ typeOf: factory.actionType.DeleteAction
26
+ };
27
+ let deleteResult;
28
+ const action = yield repos.action.start(deleteActionAttributes);
29
+ try {
30
+ // イベント削除
31
+ const deleteScreeningEventResult = yield repos.event.deleteManyEventsByScreeningRoom({
32
+ project: { id: params.project.id },
33
+ location: {
34
+ branchCode: firstBranchCode,
35
+ containedInPlace: { id: params.containedInPlace.id }
36
+ }
37
+ });
38
+ deleteResult = { deleteScreeningEventResult };
39
+ }
40
+ catch (error) {
41
+ try {
42
+ yield repos.action.giveUp({ typeOf: deleteActionAttributes.typeOf, id: action.id, error });
43
+ }
44
+ catch (_) {
45
+ // no op
46
+ }
47
+ throw error;
48
+ }
49
+ yield repos.action.completeWithVoid({ typeOf: deleteActionAttributes.typeOf, id: action.id, result: deleteResult });
50
+ });
51
+ }
@@ -0,0 +1,27 @@
1
+ import type { AcceptedPaymentMethodRepo } from '../../../repo/acceptedPaymentMethod';
2
+ import type { ActionRepo } from '../../../repo/action';
3
+ import type { EventRepo } from '../../../repo/event';
4
+ import type { EventOfferRepo } from '../../../repo/eventOffer';
5
+ import type { EventSeriesRepo } from '../../../repo/eventSeries';
6
+ import type { MemberRepo } from '../../../repo/member';
7
+ import type { PaymentServiceProviderRepo } from '../../../repo/paymentServiceProvider';
8
+ import type { MovieTheaterRepo } from '../../../repo/place/movieTheater';
9
+ import type { ScreeningRoomRepo } from '../../../repo/place/screeningRoom';
10
+ import type { ProductOfferRepo } from '../../../repo/productOffer';
11
+ export declare function deleteResourcesBySeller(params: {
12
+ project: {
13
+ id: string;
14
+ };
15
+ ids: string[];
16
+ }): (repos: {
17
+ acceptedPaymentMethod: AcceptedPaymentMethodRepo;
18
+ action: ActionRepo;
19
+ event: EventRepo;
20
+ eventOffer: EventOfferRepo;
21
+ eventSeries: EventSeriesRepo;
22
+ member: MemberRepo;
23
+ movieTheater: MovieTheaterRepo;
24
+ screeningRoom: ScreeningRoomRepo;
25
+ paymentServiceProvider: PaymentServiceProviderRepo;
26
+ productOffer: ProductOfferRepo;
27
+ }) => Promise<void>;
@@ -0,0 +1,100 @@
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.deleteResourcesBySeller = deleteResourcesBySeller;
13
+ const factory = require("../../../factory");
14
+ // tslint:disable-next-line:max-func-body-length
15
+ function deleteResourcesBySeller(params) {
16
+ return (repos) => __awaiter(this, void 0, void 0, function* () {
17
+ if (params.ids.length !== 1) {
18
+ throw new factory.errors.Argument('id', 'id.length must be 1');
19
+ }
20
+ for (const sellerId of params.ids) {
21
+ const deleteActionAttributes = {
22
+ agent: { id: params.project.id, typeOf: factory.organizationType.Project },
23
+ object: { id: sellerId, typeOf: factory.organizationType.Corporation },
24
+ project: { id: params.project.id, typeOf: factory.organizationType.Project },
25
+ typeOf: factory.actionType.DeleteAction
26
+ };
27
+ let deleteResult;
28
+ const action = yield repos.action.start(deleteActionAttributes);
29
+ try {
30
+ // メンバー削除
31
+ const deleteMemberResult = yield repos.member.deleteManyByMemberOfId({
32
+ project: { id: params.project.id },
33
+ member: {
34
+ memberOf: {
35
+ id: { $eq: sellerId },
36
+ typeOf: { $eq: factory.organizationType.Corporation }
37
+ }
38
+ }
39
+ });
40
+ // 提供決済サービス削除
41
+ const deletePaymentServiceProviderResult = yield repos.paymentServiceProvider.deleteManyByProviderId({
42
+ project: { id: params.project.id },
43
+ id: sellerId
44
+ });
45
+ // イベントオファー削除(2026-01-16~)
46
+ const deleteEventOfferResult = yield repos.eventOffer.deleteEventOffersBySeller({
47
+ project: { id: params.project.id },
48
+ seller: { id: sellerId }
49
+ });
50
+ // 対応決済方法削除(2026-02-07~)
51
+ const deleteAcceptedPaymentMethodsResult = yield repos.acceptedPaymentMethod.deleteAcceptedPaymentMethodsBySeller({
52
+ project: { id: params.project.id },
53
+ seller: { id: sellerId }
54
+ });
55
+ // イベント削除
56
+ const deleteEventResult = yield repos.event.deleteManyEventByOrganizerId({
57
+ project: { id: params.project.id },
58
+ organizer: { id: sellerId }
59
+ });
60
+ // 施設コンテンツ削除
61
+ const deleteEventSeriesResult = yield repos.eventSeries.deleteManyByOrganizerId({
62
+ project: { id: params.project.id },
63
+ organizer: { id: sellerId }
64
+ });
65
+ // ルーム削除
66
+ const deleteScreeningRoomResult = yield repos.screeningRoom.deleteScreeningRoomsByParentOrganizationId({
67
+ project: { id: params.project.id },
68
+ parentOrganization: { id: sellerId }
69
+ });
70
+ // 施設削除
71
+ const deleteMovieTheaterResult = yield repos.movieTheater.deleteMovieTheatersByParentOrganizationId({
72
+ project: { id: params.project.id },
73
+ parentOrganization: { id: sellerId }
74
+ });
75
+ // プロダクトオファー削除(2025-10-02~)
76
+ const deleteProductOfferResult = yield repos.productOffer.deleteProductOffersBySeller({
77
+ project: { id: params.project.id },
78
+ offeredBy: { id: sellerId }
79
+ });
80
+ deleteResult = {
81
+ deleteMemberResult, deletePaymentServiceProviderResult,
82
+ deleteAcceptedPaymentMethodsResult,
83
+ deleteEventOfferResult,
84
+ deleteProductOfferResult,
85
+ deleteEventResult, deleteEventSeriesResult, deleteScreeningRoomResult, deleteMovieTheaterResult
86
+ };
87
+ }
88
+ catch (error) {
89
+ try {
90
+ yield repos.action.giveUp({ typeOf: deleteActionAttributes.typeOf, id: action.id, error });
91
+ }
92
+ catch (_) {
93
+ // no op
94
+ }
95
+ throw error;
96
+ }
97
+ yield repos.action.completeWithVoid({ typeOf: deleteActionAttributes.typeOf, id: action.id, result: deleteResult });
98
+ }
99
+ });
100
+ }
@@ -0,0 +1,6 @@
1
+ import * as factory from '../../factory';
2
+ import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../taskHandler';
3
+ /**
4
+ * タスク実行関数
5
+ */
6
+ export declare function call(params: Pick<factory.task.onResourceDeleted.ITask, IExecutableTaskKeys>): IOperationExecute<ICallResult>;