@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.
- package/example/src/chevre/acceptedPaymentMethodOffer/adminAcceptedPaymentMethodOffers.ts +25 -17
- package/example/src/chevre/confirmationNumber/testRandomness.ts +49 -0
- package/example/src/chevre/emailMessage/createEmailMessageText.ts +63 -0
- package/example/src/chevre/event/importEventsFromCOAByTitle.ts +2 -2
- package/example/src/chevre/event/unsetSuperEventVideoFormat.ts +30 -0
- package/example/src/chevre/eventSeries/unsetVideoFormat.ts +31 -0
- package/example/src/chevre/{upsertScreeningEventSeriesByVersion.ts → eventSeries/upsertScreeningEventSeriesByVersion.ts} +47 -43
- package/example/src/chevre/{upsertOfferCatalogItemsByIdentifier.ts → offerCatalog/upsertOfferCatalogItemsByIdentifier.ts} +6 -3
- package/example/src/chevre/{upsertOfferCatalogsByIdentifier.ts → offerCatalog/upsertOfferCatalogsByIdentifier.ts} +8 -3
- package/example/src/chevre/{upsertOffersByIdentifier.ts → offers/upsertOffersByIdentifier.ts} +5 -3
- package/example/src/chevre/orderNumber/decryptOrderNumber.ts +14 -0
- package/example/src/chevre/orderNumber/testRandomness.ts +54 -0
- package/example/src/chevre/place/adminEntranceGates.ts +69 -0
- package/example/src/chevre/place/checkEntranceGatesCount.ts +82 -0
- package/example/src/chevre/place/findRooms.ts +24 -0
- package/example/src/chevre/place/findSections.ts +28 -0
- package/example/src/chevre/place/migrateSectionIdentifier.ts +92 -0
- package/example/src/chevre/place/seatsJson2csv.ts +63 -0
- package/example/src/chevre/place/upsertMovieTheatersByBranchCode.ts +41 -0
- package/example/src/chevre/place/upsertRoomsByBranchCode.ts +40 -0
- package/example/src/chevre/place/upsertSeatSectionsByBranchCode.ts +56 -0
- package/example/src/chevre/reIndex.ts +1 -1
- package/example/src/chevre/roles/addAdminAcceptedPaymentMethodReadPermissionIfNotExists.ts +33 -0
- package/example/src/chevre/roles/addAdminAcceptedPaymentMethodWritePermissionIfNotExists.ts +33 -0
- package/example/src/chevre/roles/addAdminMovieReadPermissionIfNotExists.ts +49 -0
- package/example/src/chevre/roles/addAdminRoomReadPermissionIfNotExists.ts +34 -0
- package/example/src/chevre/roles/addAdminRoomWritePermissionIfNotExists.ts +34 -0
- package/example/src/chevre/settings/addOrderNumberSetting.ts +44 -0
- package/example/src/chevre/settings/addTransactionNumberSetting.ts +40 -0
- package/example/src/chevre/transactionNumber/publishByTimestamp.ts +23 -0
- package/example/src/chevre/transactionNumber/testRandomness.ts +42 -0
- package/example/src/chevre/unsetUnnecessaryFields.ts +8 -4
- package/lib/chevre/emailMessageBuilder.js +1 -0
- package/lib/chevre/factory/event.d.ts +1 -1
- package/lib/chevre/factory/event.js +11 -5
- package/lib/chevre/factory/transactionNumber.d.ts +19 -0
- package/lib/chevre/factory/transactionNumber.js +54 -0
- package/lib/chevre/repo/acceptedPaymentMethod.d.ts +41 -8
- package/lib/chevre/repo/acceptedPaymentMethod.js +72 -27
- package/lib/chevre/repo/aggregateOffer.d.ts +6 -1
- package/lib/chevre/repo/aggregateOffer.js +11 -3
- package/lib/chevre/repo/aggregateOrder.js +0 -93
- package/lib/chevre/repo/aggregateReservation.d.ts +0 -1
- package/lib/chevre/repo/aggregateReservation.js +0 -2
- package/lib/chevre/repo/confirmationNumber.d.ts +1 -0
- package/lib/chevre/repo/confirmationNumber.js +32 -25
- package/lib/chevre/repo/event.d.ts +3 -3
- package/lib/chevre/repo/event.js +20 -8
- package/lib/chevre/repo/eventOffer.d.ts +8 -0
- package/lib/chevre/repo/eventOffer.js +11 -0
- package/lib/chevre/repo/eventSeries.d.ts +18 -25
- package/lib/chevre/repo/eventSeries.js +155 -101
- package/lib/chevre/repo/mongoose/schemas/aggregateReservation.js +0 -1
- package/lib/chevre/repo/mongoose/schemas/eventSeries.js +13 -25
- package/lib/chevre/repo/mongoose/schemas/offerCatalog.js +2 -8
- package/lib/chevre/repo/mongoose/schemas/offerCatalogItem.js +28 -2
- package/lib/chevre/repo/mongoose/schemas/place.d.ts +6 -2
- package/lib/chevre/repo/mongoose/schemas/setting.d.ts +40 -0
- package/lib/chevre/repo/mongoose/schemas/setting.js +3 -0
- package/lib/chevre/repo/offerCatalog.d.ts +14 -1
- package/lib/chevre/repo/offerCatalog.js +41 -19
- package/lib/chevre/repo/offerCatalogItem.d.ts +10 -1
- package/lib/chevre/repo/offerCatalogItem.js +32 -17
- package/lib/chevre/repo/orderNumber.d.ts +7 -0
- package/lib/chevre/repo/orderNumber.js +110 -34
- package/lib/chevre/repo/place/entranceGate.d.ts +57 -0
- package/lib/chevre/repo/place/entranceGate.js +172 -0
- package/lib/chevre/repo/place/movieTheater.d.ts +40 -3
- package/lib/chevre/repo/place/movieTheater.js +77 -6
- package/lib/chevre/repo/place/screeningRoom.d.ts +60 -31
- package/lib/chevre/repo/place/screeningRoom.js +227 -135
- package/lib/chevre/repo/place/seat.d.ts +47 -45
- package/lib/chevre/repo/place/seat.js +175 -45
- package/lib/chevre/repo/place/section.d.ts +60 -30
- package/lib/chevre/repo/place/section.js +337 -127
- package/lib/chevre/repo/serviceOutputIdentifier.d.ts +3 -1
- package/lib/chevre/repo/serviceOutputIdentifier.js +42 -27
- package/lib/chevre/repo/setting.d.ts +1 -1
- package/lib/chevre/repo/setting.js +2 -2
- package/lib/chevre/repo/task.d.ts +1 -1
- package/lib/chevre/repo/transactionNumber.d.ts +5 -0
- package/lib/chevre/repo/transactionNumber.js +63 -27
- package/lib/chevre/repository.d.ts +8 -0
- package/lib/chevre/repository.js +16 -0
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createStartParams.js +10 -2
- package/lib/chevre/service/event/processUpdateMovieTheater.d.ts +1 -1
- package/lib/chevre/service/event/processUpdateMovieTheater.js +13 -11
- package/lib/chevre/service/event/saveScreeningEventSeries.js +4 -5
- package/lib/chevre/service/event/saveScreeningEvents.d.ts +2 -2
- package/lib/chevre/service/event/saveScreeningEvents.js +16 -12
- package/lib/chevre/service/offer/event/authorize/factory.js +9 -1
- package/lib/chevre/service/offer/event/searchEventTicketOffers.js +7 -4
- package/lib/chevre/service/offer/event/searchOfferAppliesToMovieTicket.js +9 -6
- package/lib/chevre/service/offer/event/searchOffersByIds.js +7 -4
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +7 -1
- package/lib/chevre/service/offer/onEventChanged.js +10 -6
- package/lib/chevre/service/offer/product.js +1 -1
- package/lib/chevre/service/offer.d.ts +5 -0
- package/lib/chevre/service/offer.js +34 -9
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.d.ts +1 -1
- package/lib/chevre/service/task/createEvent/createEventBySchedule/factory.d.ts +2 -2
- package/lib/chevre/service/task/createEvent/createEventBySchedule/factory.js +5 -3
- package/lib/chevre/service/task/createEvent/createEventBySchedule/schedule2events.js +4 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByAggregateOffer.d.ts +13 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByAggregateOffer.js +53 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByEventSeries.d.ts +13 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByEventSeries.js +56 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByMovieTheater.d.ts +15 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByMovieTheater.js +58 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByOfferCatalog.d.ts +17 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByOfferCatalog.js +75 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByProduct.d.ts +19 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByProduct.js +60 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByRoom.d.ts +20 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByRoom.js +51 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.d.ts +27 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.js +100 -0
- package/lib/chevre/service/task/onResourceDeleted.d.ts +6 -0
- package/lib/chevre/service/task/onResourceDeleted.js +168 -0
- package/lib/chevre/service/task/onResourceUpdated.js +205 -42
- package/lib/chevre/service/task/syncResourcesFromCOA.js +4 -2
- package/lib/chevre/service/taskHandler.js +1 -0
- package/package.json +10 -8
- package/example/src/chevre/event/upsertManyScreeningEventByIdentifier.ts +0 -191
- package/example/src/chevre/eventSeries/migrateEventSeriesUnacceptedPaymentMethod.ts +0 -93
- package/example/src/chevre/offers/createSampleOffers.ts +0 -154
- package/example/src/chevre/settings/addSettings.ts +0 -46
- package/lib/chevre/service/eventOld.d.ts +0 -60
- package/lib/chevre/service/eventOld.js +0 -864
- package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.d.ts +0 -45
- 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
|
-
},
|
|
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((
|
|
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',
|
|
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', '
|
|
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,
|
|
175
|
-
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ project, organizer, typeOf, name, location, id,
|
|
176
|
-
endDate, startDate
|
|
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.
|
|
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((
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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 };
|
package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts
CHANGED
|
@@ -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:
|
|
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' | '
|
|
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:
|
|
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,
|
|
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:
|
|
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',
|
|
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.
|
|
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
|
+
}
|