@chevre/domain 22.6.0-alpha.8 → 22.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/example/src/chevre/aggregateAllEvents2.ts +0 -19
- package/example/src/chevre/createEventBySchedule.ts +53 -0
- package/example/src/chevre/findSchedule.ts +23 -19
- package/example/src/chevre/findSetting.ts +75 -0
- package/example/src/chevre/projectEventFieldsById.ts +23 -0
- package/example/src/chevre/reIndex.ts +20 -0
- package/example/src/chevre/retryTasks.ts +6 -4
- package/example/src/chevre/searchAuthorizations.ts +35 -0
- package/example/src/chevre/unsetUnnecessaryFields.ts +34 -16
- package/lib/chevre/credentials.js +0 -13
- package/lib/chevre/emailMessageBuilder.d.ts +5 -5
- package/lib/chevre/emailMessageBuilder.js +20 -8
- package/lib/chevre/repo/action.d.ts +11 -5
- package/lib/chevre/repo/authorization.js +5 -1
- package/lib/chevre/repo/credentials.d.ts +19 -0
- package/lib/chevre/repo/credentials.js +70 -0
- package/lib/chevre/repo/event.d.ts +0 -5
- package/lib/chevre/repo/event.js +0 -26
- package/lib/chevre/repo/interface.d.ts +25 -0
- package/lib/chevre/repo/interface.js +62 -0
- package/lib/chevre/repo/mongoose/schemas/aggregateOffer.js +5 -21
- package/lib/chevre/repo/mongoose/schemas/authorization.js +9 -0
- package/lib/chevre/repo/mongoose/schemas/categoryCode.js +36 -11
- package/lib/chevre/repo/mongoose/schemas/civicStructure.js +9 -1
- package/lib/chevre/repo/mongoose/schemas/creativeWork.js +9 -1
- package/lib/chevre/repo/mongoose/schemas/interface.d.ts +11 -0
- package/lib/chevre/repo/mongoose/schemas/interface.js +55 -0
- package/lib/chevre/repo/mongoose/schemas/offerCatalog.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/offerCatalog.js +29 -25
- package/lib/chevre/repo/mongoose/schemas/offerCatalogItem.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/offerCatalogItem.js +21 -15
- package/lib/chevre/repo/mongoose/schemas/place.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/reservation.js +25 -19
- package/lib/chevre/repo/mongoose/schemas/schedule.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/setting.d.ts +41 -0
- package/lib/chevre/repo/mongoose/schemas/setting.js +61 -0
- package/lib/chevre/repo/offerCatalog.d.ts +5 -1
- package/lib/chevre/repo/offerCatalog.js +6 -0
- package/lib/chevre/repo/offerCatalogItem.d.ts +5 -1
- package/lib/chevre/repo/offerCatalogItem.js +6 -0
- package/lib/chevre/repo/place/movieTheater.d.ts +0 -6
- package/lib/chevre/repo/place/movieTheater.js +0 -14
- package/lib/chevre/repo/reservation.d.ts +2 -1
- package/lib/chevre/repo/reservation.js +13 -3
- package/lib/chevre/repo/schedule.d.ts +13 -2
- package/lib/chevre/repo/schedule.js +24 -4
- package/lib/chevre/repo/setting.d.ts +50 -0
- package/lib/chevre/repo/setting.js +60 -0
- package/lib/chevre/repository.d.ts +15 -0
- package/lib/chevre/repository.js +41 -2
- package/lib/chevre/service/aggregation/event/aggregateOffers.js +44 -29
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +10 -4
- package/lib/chevre/service/aggregation/event/aggregateUseActionsOnEvent.js +17 -9
- package/lib/chevre/service/assetTransaction/pay.d.ts +6 -1
- package/lib/chevre/service/assetTransaction/pay.js +9 -4
- package/lib/chevre/service/assetTransaction/reserve/cancel.d.ts +2 -0
- package/lib/chevre/service/assetTransaction/reserve/cancel.js +4 -2
- package/lib/chevre/service/assetTransaction/reserve/confirm.d.ts +2 -0
- package/lib/chevre/service/assetTransaction/reserve/confirm.js +11 -11
- package/lib/chevre/service/assetTransaction/reserve/exportTasksById.js +31 -39
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createReservation.d.ts +7 -3
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createReservation.js +3 -1
- package/lib/chevre/service/assetTransaction/reserve/start.d.ts +2 -0
- package/lib/chevre/service/assetTransaction/reserve/start.js +6 -4
- package/lib/chevre/service/event.d.ts +4 -4
- package/lib/chevre/service/event.js +8 -10
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +2 -0
- package/lib/chevre/service/offer/event/authorize.d.ts +2 -0
- package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.d.ts +2 -0
- package/lib/chevre/service/offer/event/voidTransaction.d.ts +2 -0
- package/lib/chevre/service/offer/event/voidTransactionByActionId.d.ts +2 -0
- package/lib/chevre/service/offer/onEventChanged.d.ts +3 -2
- package/lib/chevre/service/offer/onEventChanged.js +22 -11
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +3 -0
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered/factory.d.ts +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered/factory.js +5 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered.d.ts +3 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered.js +6 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.js +5 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially.d.ts +3 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially.js +6 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.d.ts +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.js +5 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +2 -0
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +2 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.d.ts +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.js +5 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.d.ts +3 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +6 -2
- package/lib/chevre/service/order/onOrderUpdated/factory.d.ts +2 -2
- package/lib/chevre/service/order/onOrderUpdated/factory.js +5 -2
- package/lib/chevre/service/order/onOrderUpdated.d.ts +3 -2
- package/lib/chevre/service/order/onOrderUpdated.js +8 -2
- package/lib/chevre/service/order/payOrder.d.ts +2 -0
- package/lib/chevre/service/order/placeOrder.d.ts +2 -0
- package/lib/chevre/service/order/returnOrder.d.ts +3 -2
- package/lib/chevre/service/order/returnOrder.js +7 -5
- package/lib/chevre/service/order/sendOrder.d.ts +2 -0
- package/lib/chevre/service/order/sendOrder.js +5 -3
- package/lib/chevre/service/payment/any/onRefund.js +30 -17
- package/lib/chevre/service/payment/any/person2username.d.ts +2 -2
- package/lib/chevre/service/payment/any/person2username.js +10 -2
- package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.d.ts +2 -1
- package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.js +26 -17
- package/lib/chevre/service/payment/any.d.ts +5 -1
- package/lib/chevre/service/payment/any.js +31 -12
- package/lib/chevre/service/payment/movieTicket/authorize.d.ts +6 -1
- package/lib/chevre/service/payment/movieTicket/authorize.js +4 -2
- package/lib/chevre/service/payment/movieTicket/checkMovieTicket.d.ts +2 -0
- package/lib/chevre/service/payment/movieTicket/checkMovieTicket.js +9 -12
- package/lib/chevre/service/payment/movieTicket/factory.js +12 -16
- package/lib/chevre/service/payment/movieTicket/payMovieTicket.d.ts +2 -0
- package/lib/chevre/service/payment/movieTicket/payMovieTicket.js +2 -1
- package/lib/chevre/service/payment/movieTicket/processPurchaseNumberAuth.d.ts +2 -0
- package/lib/chevre/service/payment/movieTicket/processPurchaseNumberAuth.js +2 -1
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket.d.ts +2 -0
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket.js +2 -1
- package/lib/chevre/service/payment/movieTicket/validation.d.ts +5 -1
- package/lib/chevre/service/payment/movieTicket/validation.js +47 -40
- package/lib/chevre/service/payment/movieTicket/voidTransaction.d.ts +2 -0
- package/lib/chevre/service/payment.d.ts +13 -4
- package/lib/chevre/service/payment.js +15 -11
- package/lib/chevre/service/reserve/cancelReservation.d.ts +5 -3
- package/lib/chevre/service/reserve/cancelReservation.js +8 -4
- package/lib/chevre/service/reserve/checkInReservation.d.ts +3 -2
- package/lib/chevre/service/reserve/checkInReservation.js +18 -21
- package/lib/chevre/service/reserve/confirmReservation.d.ts +3 -2
- package/lib/chevre/service/reserve/confirmReservation.js +4 -2
- package/lib/chevre/service/reserve/potentialActions/onPendingReservationCanceled.d.ts +3 -2
- package/lib/chevre/service/reserve/potentialActions/onPendingReservationCanceled.js +8 -2
- package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.d.ts +3 -2
- package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +8 -2
- package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.d.ts +6 -3
- package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.js +10 -9
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.d.ts +3 -2
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +8 -2
- package/lib/chevre/service/reserve/potentialActions/onReservationUsed.d.ts +7 -3
- package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +28 -13
- package/lib/chevre/service/reserve/potentialActions/onReservationsCreated.d.ts +3 -2
- package/lib/chevre/service/reserve/potentialActions/onReservationsCreated.js +8 -2
- package/lib/chevre/service/reserve/useReservation.d.ts +3 -2
- package/lib/chevre/service/reserve/useReservation.js +11 -7
- package/lib/chevre/service/task/acceptCOAOffer.d.ts +1 -1
- package/lib/chevre/service/task/acceptCOAOffer.js +27 -4
- package/lib/chevre/service/task/authorizePayment.js +9 -0
- package/lib/chevre/service/task/cancelPendingReservation.js +12 -14
- package/lib/chevre/service/task/cancelReservation.js +12 -14
- package/lib/chevre/service/task/checkMovieTicket.js +12 -3
- package/lib/chevre/service/task/confirmReserveTransaction.d.ts +3 -1
- package/lib/chevre/service/task/confirmReserveTransaction.js +22 -6
- package/lib/chevre/service/task/createEvent/createEvent.d.ts +25 -0
- package/lib/chevre/service/task/createEvent/createEvent.js +46 -0
- package/lib/chevre/service/task/createEvent/createEventBySchedule.d.ts +25 -0
- package/lib/chevre/service/task/createEvent/createEventBySchedule.js +371 -0
- package/lib/chevre/service/task/createEvent/createEventSeries.d.ts +13 -0
- package/lib/chevre/service/{event/createEvent.js → task/createEvent/createEventSeries.js} +4 -4
- package/lib/chevre/service/task/createEvent.js +17 -3
- package/lib/chevre/service/task/deletePerson.js +28 -10
- package/lib/chevre/service/task/importEventCapacitiesFromCOA.d.ts +2 -2
- package/lib/chevre/service/task/importEventCapacitiesFromCOA.js +14 -5
- package/lib/chevre/service/task/importEventsFromCOA.d.ts +2 -2
- package/lib/chevre/service/task/importEventsFromCOA.js +14 -5
- package/lib/chevre/service/task/importOffersFromCOA.d.ts +2 -2
- package/lib/chevre/service/task/importOffersFromCOA.js +15 -6
- package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +2 -0
- package/lib/chevre/service/task/onAuthorizationCreated.js +13 -12
- package/lib/chevre/service/task/onEventChanged.js +6 -2
- package/lib/chevre/service/task/onOrderPaymentCompleted.js +2 -0
- package/lib/chevre/service/task/onResourceUpdated/onAggregateOfferUpdated.d.ts +3 -3
- package/lib/chevre/service/task/onResourceUpdated/onAggregateOfferUpdated.js +7 -3
- package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.d.ts +3 -2
- package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +8 -3
- package/lib/chevre/service/task/onResourceUpdated/onOfferCatalogUpdated.d.ts +4 -3
- package/lib/chevre/service/task/onResourceUpdated/onOfferCatalogUpdated.js +7 -3
- package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.d.ts +3 -2
- package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +7 -3
- package/lib/chevre/service/task/onResourceUpdated.js +61 -33
- package/lib/chevre/service/task/pay.js +27 -2
- package/lib/chevre/service/task/placeOrder.js +2 -0
- package/lib/chevre/service/task/refund.js +10 -0
- package/lib/chevre/service/task/reserve.js +6 -2
- package/lib/chevre/service/task/returnOrder.js +6 -2
- package/lib/chevre/service/task/returnReserveTransaction.d.ts +1 -1
- package/lib/chevre/service/task/returnReserveTransaction.js +21 -7
- package/lib/chevre/service/task/sendOrder.js +2 -0
- package/lib/chevre/service/task/useReservation.js +6 -2
- package/lib/chevre/service/task/voidPayment.js +14 -1
- package/lib/chevre/service/task/voidReserveTransaction.d.ts +1 -1
- package/lib/chevre/service/task/voidReserveTransaction.js +21 -6
- package/lib/chevre/service/task.d.ts +0 -5
- package/lib/chevre/service/task.js +6 -0
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.d.ts +2 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.js +5 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.d.ts +2 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.js +5 -2
- package/lib/chevre/service/transaction/placeOrder/confirm.d.ts +3 -2
- package/lib/chevre/service/transaction/placeOrder/confirm.js +11 -2
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.d.ts +2 -2
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.js +14 -7
- package/lib/chevre/service/transaction/returnOrder/potentialActions/sendEmailMessage.d.ts +2 -2
- package/lib/chevre/service/transaction/returnOrder/potentialActions/sendEmailMessage.js +4 -2
- package/lib/chevre/service/transaction/returnOrder/potentialActions.d.ts +2 -2
- package/lib/chevre/service/transaction/returnOrder/potentialActions.js +6 -3
- package/lib/chevre/service/transaction/returnOrder.d.ts +3 -1
- package/lib/chevre/service/transaction/returnOrder.js +10 -2
- package/lib/chevre/settings.d.ts +20 -66
- package/lib/chevre/settings.js +21 -10
- package/package.json +5 -5
- package/example/src/chevre/searchAssetTransactions.ts +0 -38
- package/lib/chevre/service/event/createEvent.d.ts +0 -13
|
@@ -97,21 +97,24 @@ function aggregateOfferByEvent(params) {
|
|
|
97
97
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
98
98
|
var _a;
|
|
99
99
|
const availableOffers = yield (0, findEventOffers_1.findEventOffers)(params)(repos);
|
|
100
|
+
// 集計対象のオファーにフィルター(2024-11-09~)
|
|
101
|
+
const offersIncludedInAggregateReservation = availableOffers.filter(({ settings }) => (settings === null || settings === void 0 ? void 0 : settings.includedInAggregateReservation) === true);
|
|
100
102
|
// オファーごとの予約集計
|
|
101
103
|
const offersWithAggregateReservation = [];
|
|
102
|
-
for (const o of
|
|
104
|
+
for (const o of offersIncludedInAggregateReservation) {
|
|
103
105
|
const { maximumAttendeeCapacity, remainingAttendeeCapacity, aggregateReservation } = yield aggregateReservationByOffer({
|
|
104
106
|
aggregateDate: params.aggregateDate,
|
|
105
107
|
event: params.event,
|
|
106
108
|
screeningRoom: params.screeningRoom,
|
|
107
|
-
offer: o
|
|
109
|
+
offer: o,
|
|
110
|
+
availableOffers
|
|
108
111
|
})(repos);
|
|
109
112
|
offersWithAggregateReservation.push(Object.assign(Object.assign(Object.assign({ typeOf: o.typeOf, id: o.id, identifier: o.identifier, aggregateReservation: aggregateReservation }, (typeof maximumAttendeeCapacity === 'number') ? { maximumAttendeeCapacity } : undefined), (typeof remainingAttendeeCapacity === 'number') ? { remainingAttendeeCapacity } : undefined), (typeof ((_a = o.category) === null || _a === void 0 ? void 0 : _a.codeValue) === 'string') ? { category: o.category } : undefined));
|
|
110
113
|
}
|
|
111
114
|
return {
|
|
112
115
|
typeOf: factory.offerType.AggregateOffer,
|
|
113
116
|
aggregateDate: params.aggregateDate,
|
|
114
|
-
offerCount:
|
|
117
|
+
offerCount: offersIncludedInAggregateReservation.length,
|
|
115
118
|
offers: offersWithAggregateReservation
|
|
116
119
|
};
|
|
117
120
|
});
|
|
@@ -119,39 +122,51 @@ function aggregateOfferByEvent(params) {
|
|
|
119
122
|
function aggregateReservationByOffer(params) {
|
|
120
123
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
121
124
|
let reservationCount4offer;
|
|
122
|
-
let attendeeCount4offer;
|
|
123
|
-
let checkInCount4offer;
|
|
125
|
+
// let attendeeCount4offer: number | undefined;
|
|
126
|
+
// let checkInCount4offer: number | undefined;
|
|
124
127
|
let reservationType = factory.reservationType.EventReservation;
|
|
125
128
|
if (params.event.typeOf === factory.eventType.Event) {
|
|
126
129
|
reservationType = factory.reservationType.BusReservation;
|
|
127
130
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
131
|
+
const offerIdsWithSameCategory = params.availableOffers.filter(({ category }) => {
|
|
132
|
+
var _a;
|
|
133
|
+
return typeof (category === null || category === void 0 ? void 0 : category.codeValue) === 'string' && category.codeValue === ((_a = params.offer.category) === null || _a === void 0 ? void 0 : _a.codeValue);
|
|
134
|
+
})
|
|
135
|
+
.map(({ id }) => id);
|
|
136
|
+
if (offerIdsWithSameCategory.length > 0) {
|
|
137
|
+
reservationCount4offer = yield repos.reservation.count({
|
|
138
|
+
typeOf: reservationType,
|
|
139
|
+
reservationFor: { id: { $eq: params.event.id } },
|
|
140
|
+
reservationStatuses: [factory.reservationStatusType.ReservationConfirmed],
|
|
141
|
+
// オファーカテゴリーごとに集計する(2024-11-10~)
|
|
142
|
+
// reservedTicket: { ticketType: { ids: [<string>params.offer.id] } }
|
|
143
|
+
reservedTicket: { ticketType: { ids: offerIdsWithSameCategory } }
|
|
144
|
+
});
|
|
145
|
+
// attendeeCount4offer = await repos.reservation.count({
|
|
146
|
+
// typeOf: reservationType,
|
|
147
|
+
// reservationFor: { id: { $eq: params.event.id } },
|
|
148
|
+
// reservationStatuses: [factory.reservationStatusType.ReservationConfirmed],
|
|
149
|
+
// // オファーカテゴリーごとに集計する(2024-11-10~)
|
|
150
|
+
// // reservedTicket: { ticketType: { ids: [<string>params.offer.id] } },
|
|
151
|
+
// reservedTicket: { ticketType: { ids: offerIdsWithSameCategory } },
|
|
152
|
+
// attended: true
|
|
153
|
+
// });
|
|
154
|
+
// checkInCount4offer = await repos.reservation.count({
|
|
155
|
+
// typeOf: reservationType,
|
|
156
|
+
// reservationFor: { id: { $eq: params.event.id } },
|
|
157
|
+
// reservationStatuses: [factory.reservationStatusType.ReservationConfirmed],
|
|
158
|
+
// // オファーカテゴリーごとに集計する(2024-11-10~)
|
|
159
|
+
// // reservedTicket: { ticketType: { ids: [<string>params.offer.id] } },
|
|
160
|
+
// reservedTicket: { ticketType: { ids: offerIdsWithSameCategory } },
|
|
161
|
+
// checkedIn: true
|
|
162
|
+
// });
|
|
163
|
+
}
|
|
148
164
|
const { maximumAttendeeCapacity, remainingAttendeeCapacity } = yield calculateCapacityByOffer(params)(repos);
|
|
149
165
|
return Object.assign(Object.assign({ aggregateReservation: {
|
|
150
166
|
typeOf: 'AggregateReservation',
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
checkInCount: checkInCount4offer
|
|
167
|
+
reservationCount: reservationCount4offer
|
|
168
|
+
// attendeeCount: attendeeCount4offer, // discontinue(2024-11-10~)
|
|
169
|
+
// checkInCount: checkInCount4offer // discontinue(2024-11-10~)
|
|
155
170
|
} }, (typeof maximumAttendeeCapacity === 'number') ? { maximumAttendeeCapacity } : undefined), (typeof remainingAttendeeCapacity === 'number') ? { remainingAttendeeCapacity } : undefined);
|
|
156
171
|
});
|
|
157
172
|
}
|
|
@@ -26,16 +26,22 @@ function aggregateScreeningEvent(params) {
|
|
|
26
26
|
return (repos
|
|
27
27
|
// settings: Settings
|
|
28
28
|
) => __awaiter(this, void 0, void 0, function* () {
|
|
29
|
-
var _a, _b;
|
|
29
|
+
var _a, _b, _c, _d;
|
|
30
30
|
// 集計対象イベント検索
|
|
31
|
-
const event = yield repos.event.projectEventFieldsById({ id: params.id }, ['location', 'project', 'startDate', 'typeOf', 'superEvent.location.id', 'offers.itemOffered']);
|
|
31
|
+
const event = yield repos.event.projectEventFieldsById({ id: params.id }, ['location', 'project', 'startDate', 'typeOf', 'superEvent.id', 'superEvent.location.id', 'offers.itemOffered']);
|
|
32
32
|
// プロジェクト設定検索
|
|
33
33
|
const project = yield repos.project.findById({
|
|
34
34
|
id: event.project.id,
|
|
35
35
|
inclusion: ['settings']
|
|
36
36
|
});
|
|
37
|
-
const
|
|
38
|
-
|
|
37
|
+
const useOfferRateLimit = ((_a = project.settings) === null || _a === void 0 ? void 0 : _a.useOfferRateLimit) === true;
|
|
38
|
+
let useAggregateOffer = false;
|
|
39
|
+
if (event.typeOf === factory.eventType.ScreeningEvent) {
|
|
40
|
+
const eventSeriesIdsByProject = (_c = (_b = project.settings) === null || _b === void 0 ? void 0 : _b.useAggregateReservation) === null || _c === void 0 ? void 0 : _c.eventSeriesIds;
|
|
41
|
+
const eventSeriesIdIncluded = Array.isArray(eventSeriesIdsByProject) && eventSeriesIdsByProject.includes(event.superEvent.id);
|
|
42
|
+
const useAggregateOfferByProject = ((_d = project.settings) === null || _d === void 0 ? void 0 : _d.useAggregateOffer) === true;
|
|
43
|
+
useAggregateOffer = eventSeriesIdIncluded && useAggregateOfferByProject;
|
|
44
|
+
}
|
|
39
45
|
let aggregatingEvents = [event];
|
|
40
46
|
// dependent on project settings(2024-10-29~)
|
|
41
47
|
if (useOfferRateLimit) {
|
|
@@ -92,6 +92,8 @@ function aggregateEntranceGateByEvent(params) {
|
|
|
92
92
|
const places = [];
|
|
93
93
|
if (Array.isArray(params.entranceGates) && params.entranceGates.length > 0) {
|
|
94
94
|
const availableOffers = yield (0, findEventOffers_1.findEventOffers)(params)(repos);
|
|
95
|
+
// 集計対象のオファーにフィルター(2024-11-09~)
|
|
96
|
+
const offersIncludedInAggregateReservation = availableOffers.filter(({ settings }) => (settings === null || settings === void 0 ? void 0 : settings.includedInAggregateReservation) === true);
|
|
95
97
|
// 念のため、identifierの存在する入場ゲートに絞る
|
|
96
98
|
const entranceGates = params.entranceGates.filter((e) => {
|
|
97
99
|
return typeof e.identifier === 'string' && e.identifier.length > 0;
|
|
@@ -103,17 +105,23 @@ function aggregateEntranceGateByEvent(params) {
|
|
|
103
105
|
entranceGateIdentifier
|
|
104
106
|
});
|
|
105
107
|
debug('aggregateResult:', aggregateResult);
|
|
106
|
-
const offersOnEntranceGate = yield Promise.all(
|
|
107
|
-
var _a
|
|
108
|
-
//
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
108
|
+
const offersOnEntranceGate = yield Promise.all(offersIncludedInAggregateReservation.map((offer) => __awaiter(this, void 0, void 0, function* () {
|
|
109
|
+
var _a;
|
|
110
|
+
// オファーカテゴリーごとに集計する(2024-11-10~)
|
|
111
|
+
const offerIdsWithSameCategory = availableOffers.filter(({ category }) => {
|
|
112
|
+
var _a;
|
|
113
|
+
return typeof (category === null || category === void 0 ? void 0 : category.codeValue) === 'string' && category.codeValue === ((_a = offer.category) === null || _a === void 0 ? void 0 : _a.codeValue);
|
|
114
|
+
})
|
|
115
|
+
.map(({ id }) => id);
|
|
116
|
+
const useActionCount = aggregateResult.filter((a) => offerIdsWithSameCategory.includes(a._id[0]))
|
|
117
|
+
.reduce((a, b) => a + ((typeof b.useActionCount === 'number') ? b.useActionCount : 0), 0);
|
|
118
|
+
// let useActionCount: number | undefined = aggregateResult.find((a) => a._id[0] === offer.id)?.useActionCount;
|
|
119
|
+
// if (typeof useActionCount !== 'number') {
|
|
120
|
+
// useActionCount = 0;
|
|
121
|
+
// }
|
|
113
122
|
debug('useActionCount:', useActionCount, entranceGateIdentifier, offer.id);
|
|
114
|
-
return Object.assign(Object.assign({ typeOf: offer.typeOf, id: offer.id, identifier: offer.identifier }, (typeof ((
|
|
123
|
+
return Object.assign(Object.assign({ typeOf: offer.typeOf, id: offer.id, identifier: offer.identifier }, (typeof ((_a = offer.category) === null || _a === void 0 ? void 0 : _a.codeValue) === 'string') ? { category: offer.category } : undefined), { aggregateReservation: {
|
|
115
124
|
typeOf: 'AggregateReservation',
|
|
116
|
-
// aggregateDate: params.aggregateDate, // 最適化につき廃止(2024-03-26~)
|
|
117
125
|
useActionCount
|
|
118
126
|
} });
|
|
119
127
|
})));
|
|
@@ -8,6 +8,7 @@ import type { AcceptedOfferRepo } from '../../repo/acceptedOffer';
|
|
|
8
8
|
import type { AccountingReportRepo } from '../../repo/accountingReport';
|
|
9
9
|
import type { ActionRepo } from '../../repo/action';
|
|
10
10
|
import type { AssetTransactionRepo } from '../../repo/assetTransaction';
|
|
11
|
+
import type { CredentialsRepo } from '../../repo/credentials';
|
|
11
12
|
import type { EventRepo } from '../../repo/event';
|
|
12
13
|
import type { OrderRepo } from '../../repo/order';
|
|
13
14
|
import type { PaymentServiceRepo } from '../../repo/paymentService';
|
|
@@ -20,6 +21,7 @@ import * as MovieTicketPayment from '../payment/movieTicket';
|
|
|
20
21
|
export interface IStartOperationRepos {
|
|
21
22
|
accountingReport: AccountingReportRepo;
|
|
22
23
|
action: ActionRepo;
|
|
24
|
+
credentials: CredentialsRepo;
|
|
23
25
|
event: EventRepo;
|
|
24
26
|
paymentAccepted: SellerPaymentAcceptedRepo;
|
|
25
27
|
paymentService: PaymentServiceRepo;
|
|
@@ -49,6 +51,7 @@ export type IExportTasksOperation<T> = (repos: {
|
|
|
49
51
|
}) => Promise<T>;
|
|
50
52
|
export type ICheckOperation<T> = (repos: {
|
|
51
53
|
action: ActionRepo;
|
|
54
|
+
credentials: CredentialsRepo;
|
|
52
55
|
event: EventRepo;
|
|
53
56
|
paymentAccepted: SellerPaymentAcceptedRepo;
|
|
54
57
|
paymentService: PaymentServiceRepo;
|
|
@@ -111,7 +114,6 @@ export import IPaymentAgencyTransaction = CreditCardPayment.IPaymentAgencyTransa
|
|
|
111
114
|
* 取引開始
|
|
112
115
|
*/
|
|
113
116
|
export declare function start(params: factory.assetTransaction.pay.IStartParamsWithoutDetail, options: {
|
|
114
|
-
useCheckByIdentifierIfNotYet: boolean;
|
|
115
117
|
pendingPaymentAgencyTransaction?: CreditCardPayment.IPaymentAgencyTransaction;
|
|
116
118
|
/**
|
|
117
119
|
* 実行者
|
|
@@ -129,6 +131,9 @@ export declare function start(params: factory.assetTransaction.pay.IStartParamsW
|
|
|
129
131
|
*/
|
|
130
132
|
id?: string;
|
|
131
133
|
};
|
|
134
|
+
checkedAction: {
|
|
135
|
+
id: string;
|
|
136
|
+
};
|
|
132
137
|
}): IStartOperation<factory.assetTransaction.pay.ITransaction>;
|
|
133
138
|
/**
|
|
134
139
|
* 取引確定
|
|
@@ -221,9 +221,12 @@ function start(params, options) {
|
|
|
221
221
|
: undefined))(repos, settings);
|
|
222
222
|
break;
|
|
223
223
|
case factory.service.paymentService.PaymentServiceType.MovieTicket:
|
|
224
|
-
transaction = yield processAuthorizeMovieTicket(params, transaction, String(paymentService === null || paymentService === void 0 ? void 0 : paymentService.id),
|
|
224
|
+
transaction = yield processAuthorizeMovieTicket(params, transaction, String(paymentService === null || paymentService === void 0 ? void 0 : paymentService.id),
|
|
225
|
+
// options.useCheckByIdentifierIfNotYet,
|
|
226
|
+
{
|
|
225
227
|
executor: (typeof ((_d = options.executor) === null || _d === void 0 ? void 0 : _d.id) === 'string') ? { id: options.executor.id } : {},
|
|
226
|
-
purpose: options.purpose
|
|
228
|
+
purpose: options.purpose,
|
|
229
|
+
checkedAction: options.checkedAction
|
|
227
230
|
})(repos, settings);
|
|
228
231
|
break;
|
|
229
232
|
default:
|
|
@@ -400,9 +403,11 @@ function processAuthorizeCreditCard(params, transaction, paymentServiceId, optio
|
|
|
400
403
|
// })(repos);
|
|
401
404
|
});
|
|
402
405
|
}
|
|
403
|
-
function processAuthorizeMovieTicket(params, transaction, paymentServiceId,
|
|
406
|
+
function processAuthorizeMovieTicket(params, transaction, paymentServiceId,
|
|
407
|
+
// useCheckByIdentifierIfNotYet: boolean,
|
|
408
|
+
options) {
|
|
404
409
|
return (repos, settings) => __awaiter(this, void 0, void 0, function* () {
|
|
405
|
-
const { accountsReceivablesByServiceType } = yield MovieTicketPayment.authorize(params, transaction, paymentServiceId,
|
|
410
|
+
const { accountsReceivablesByServiceType } = yield MovieTicketPayment.authorize(params, transaction, paymentServiceId, options)(repos, settings);
|
|
406
411
|
// const payActionInObject: factory.assetTransaction.pay.IPayActionInObject = {
|
|
407
412
|
// actionStatus: payAction.actionStatus,
|
|
408
413
|
// id: payAction.id,
|
|
@@ -3,6 +3,7 @@ import type { ActionRepo } from '../../../repo/action';
|
|
|
3
3
|
import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
|
|
4
4
|
import type { OfferRateLimitRepo } from '../../../repo/rateLimit/offer';
|
|
5
5
|
import type { ReservationRepo } from '../../../repo/reservation';
|
|
6
|
+
import type { SettingRepo } from '../../../repo/setting';
|
|
6
7
|
import type { StockHolderRepo } from '../../../repo/stockHolder';
|
|
7
8
|
import type { TaskRepo } from '../../../repo/task';
|
|
8
9
|
type ICancelOperation<T> = (repos: {
|
|
@@ -10,6 +11,7 @@ type ICancelOperation<T> = (repos: {
|
|
|
10
11
|
stockHolder: StockHolderRepo;
|
|
11
12
|
offerRateLimit: OfferRateLimitRepo;
|
|
12
13
|
reservation: ReservationRepo;
|
|
14
|
+
setting: SettingRepo;
|
|
13
15
|
task: TaskRepo;
|
|
14
16
|
assetTransaction: AssetTransactionRepo;
|
|
15
17
|
}, settings: Settings) => Promise<T>;
|
|
@@ -16,7 +16,9 @@ const cancelReservation_1 = require("../../reserve/cancelReservation");
|
|
|
16
16
|
* 取引中止
|
|
17
17
|
*/
|
|
18
18
|
function cancel(params) {
|
|
19
|
-
return (repos
|
|
19
|
+
return (repos
|
|
20
|
+
// settings: Settings
|
|
21
|
+
) => __awaiter(this, void 0, void 0, function* () {
|
|
20
22
|
// まず取引状態変更
|
|
21
23
|
const { id } = yield repos.assetTransaction.cancel({
|
|
22
24
|
typeOf: factory.assetTransactionType.Reserve,
|
|
@@ -35,7 +37,7 @@ function cancel(params) {
|
|
|
35
37
|
id,
|
|
36
38
|
typeOf: factory.assetTransactionType.Reserve
|
|
37
39
|
}
|
|
38
|
-
})(repos
|
|
40
|
+
})(repos);
|
|
39
41
|
});
|
|
40
42
|
}
|
|
41
43
|
exports.cancel = cancel;
|
|
@@ -4,12 +4,14 @@ import type { ActionRepo } from '../../../repo/action';
|
|
|
4
4
|
import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
|
|
5
5
|
import type { OrderRepo } from '../../../repo/order';
|
|
6
6
|
import type { ReservationRepo } from '../../../repo/reservation';
|
|
7
|
+
import type { SettingRepo } from '../../../repo/setting';
|
|
7
8
|
import type { TaskRepo } from '../../../repo/task';
|
|
8
9
|
interface IConfirmRepo {
|
|
9
10
|
action: ActionRepo;
|
|
10
11
|
assetTransaction: AssetTransactionRepo;
|
|
11
12
|
order: OrderRepo;
|
|
12
13
|
reservation: ReservationRepo;
|
|
14
|
+
setting: SettingRepo;
|
|
13
15
|
task: TaskRepo;
|
|
14
16
|
}
|
|
15
17
|
type IConfirmOperation<T> = (repos: IConfirmRepo, settings: Settings) => Promise<T>;
|
|
@@ -17,7 +17,9 @@ const factory_1 = require("./confirm/factory");
|
|
|
17
17
|
* 取引確定
|
|
18
18
|
*/
|
|
19
19
|
function confirm(params) {
|
|
20
|
-
return (repos
|
|
20
|
+
return (repos
|
|
21
|
+
// settings: Settings
|
|
22
|
+
) => __awaiter(this, void 0, void 0, function* () {
|
|
21
23
|
let transaction;
|
|
22
24
|
// 取引存在確認
|
|
23
25
|
if (typeof params.id === 'string') {
|
|
@@ -52,16 +54,14 @@ function confirm(params) {
|
|
|
52
54
|
potentialActions }, (typeof (underName === null || underName === void 0 ? void 0 : underName.typeOf) === 'string')
|
|
53
55
|
? { object: { underName } }
|
|
54
56
|
: undefined));
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
})(repos, settings);
|
|
64
|
-
}
|
|
57
|
+
// sync対応(2023-01-13~)
|
|
58
|
+
yield (0, confirmReservation_1.confirmReservation)({
|
|
59
|
+
// optimize(2024-07-01~)
|
|
60
|
+
// actionAttributesList: potentialActions.reserve,
|
|
61
|
+
potentialReserveAction: { object: { reservationNumber: transaction.transactionNumber } },
|
|
62
|
+
useOnReservationConfirmed: true,
|
|
63
|
+
byTask: true
|
|
64
|
+
})(repos);
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
exports.confirm = confirm;
|
|
@@ -16,8 +16,10 @@ const factory = require("../../../factory");
|
|
|
16
16
|
*/
|
|
17
17
|
function exportTasksById(params) {
|
|
18
18
|
// tslint:disable-next-line:max-func-body-length
|
|
19
|
-
return (repos
|
|
20
|
-
|
|
19
|
+
return (repos
|
|
20
|
+
// settings: Settings
|
|
21
|
+
) => __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
// const { useAssetTransactionSyncProcessing } = settings;
|
|
21
23
|
const transaction = yield repos.assetTransaction.findById({
|
|
22
24
|
typeOf: factory.assetTransactionType.Reserve,
|
|
23
25
|
id: params.id
|
|
@@ -28,47 +30,37 @@ function exportTasksById(params) {
|
|
|
28
30
|
let cancelPendingReservationTask;
|
|
29
31
|
switch (transaction.status) {
|
|
30
32
|
case factory.transactionStatusType.Confirmed:
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
//
|
|
33
|
+
// if (!useAssetTransactionSyncProcessing) {
|
|
34
|
+
// const reserveTask: factory.task.reserve.IAttributes = {
|
|
35
|
+
// project: transaction.project,
|
|
36
|
+
// name: factory.taskName.Reserve,
|
|
37
|
+
// status: factory.taskStatus.Ready,
|
|
38
|
+
// runsAt: new Date(), // なるはやで実行
|
|
39
|
+
// remainingNumberOfTries: 10,
|
|
40
|
+
// numberOfTried: 0,
|
|
41
|
+
// executionResults: [],
|
|
42
|
+
// data: { object: { reservationNumber: transaction.transactionNumber } } // optimize(2024-07-01~)
|
|
43
|
+
// };
|
|
44
|
+
// taskAttributes.push(reserveTask);
|
|
35
45
|
// }
|
|
36
|
-
if (!useAssetTransactionSyncProcessing) {
|
|
37
|
-
const reserveTask = {
|
|
38
|
-
project: transaction.project,
|
|
39
|
-
name: factory.taskName.Reserve,
|
|
40
|
-
status: factory.taskStatus.Ready,
|
|
41
|
-
runsAt: new Date(),
|
|
42
|
-
remainingNumberOfTries: 10,
|
|
43
|
-
numberOfTried: 0,
|
|
44
|
-
executionResults: [],
|
|
45
|
-
data: { object: { reservationNumber: transaction.transactionNumber } } // optimize(2024-07-01~)
|
|
46
|
-
};
|
|
47
|
-
taskAttributes.push(reserveTask);
|
|
48
|
-
}
|
|
49
46
|
break;
|
|
50
47
|
case factory.transactionStatusType.Canceled:
|
|
51
48
|
// sync対応(2023-01-13~)
|
|
52
|
-
if (!useAssetTransactionSyncProcessing) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
purpose: { id: transaction.id, typeOf: transaction.typeOf }
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
taskAttributes.push(cancelPendingReservationTask);
|
|
71
|
-
}
|
|
49
|
+
// if (!useAssetTransactionSyncProcessing) {
|
|
50
|
+
// cancelPendingReservationTask = {
|
|
51
|
+
// project: transaction.project,
|
|
52
|
+
// name: factory.taskName.CancelPendingReservation,
|
|
53
|
+
// status: factory.taskStatus.Ready,
|
|
54
|
+
// runsAt: new Date(), // なるはやで実行
|
|
55
|
+
// remainingNumberOfTries: 10,
|
|
56
|
+
// numberOfTried: 0,
|
|
57
|
+
// executionResults: [],
|
|
58
|
+
// data: {
|
|
59
|
+
// purpose: { id: transaction.id, typeOf: transaction.typeOf }
|
|
60
|
+
// }
|
|
61
|
+
// };
|
|
62
|
+
// taskAttributes.push(cancelPendingReservationTask);
|
|
63
|
+
// }
|
|
72
64
|
break;
|
|
73
65
|
case factory.transactionStatusType.Expired:
|
|
74
66
|
// const cancelActionAttributes = createCancelPendingReservationAction({ transaction });
|
|
@@ -2,6 +2,10 @@ import * as factory from '../../../../../factory';
|
|
|
2
2
|
import { IMinimizedIndividualEvent } from '../../../../../factory/event';
|
|
3
3
|
import { IAcceptedAddOn } from './price';
|
|
4
4
|
type IObjectSubReservation = factory.assetTransaction.reserve.IObjectSubReservation;
|
|
5
|
+
/**
|
|
6
|
+
* 確定時予約のITicket
|
|
7
|
+
*/
|
|
8
|
+
type IReservedTicket = Pick<factory.reservation.ITicket, 'identifier' | 'issuedBy' | 'ticketType' | 'ticketedSeat' | 'typeOf'>;
|
|
5
9
|
declare function createReservedTicket(params: {
|
|
6
10
|
id: string;
|
|
7
11
|
acceptedOffer: factory.assetTransaction.reserve.IAcceptedTicketOfferWithoutDetail;
|
|
@@ -14,7 +18,7 @@ declare function createReservedTicket(params: {
|
|
|
14
18
|
screeningRoomSections?: factory.place.screeningRoomSection.IPlace[];
|
|
15
19
|
availableSeatOffers: factory.place.seat.IPlaceWithOffer[];
|
|
16
20
|
ticketOffer: factory.product.ITicketOffer;
|
|
17
|
-
}):
|
|
21
|
+
}): IReservedTicket;
|
|
18
22
|
declare function validateAppliesToMovieTicket(params: {
|
|
19
23
|
availableOffer: factory.unitPriceOffer.IUnitPriceOffer;
|
|
20
24
|
appliesToMovieTicket?: factory.assetTransaction.reserve.IAcceptedAppliesToMovieTicket;
|
|
@@ -30,7 +34,7 @@ declare function createAdditionalProperty(params: {
|
|
|
30
34
|
*/
|
|
31
35
|
declare function createAdditionalTicketText(params: {
|
|
32
36
|
acceptedOffer: factory.assetTransaction.reserve.IAcceptedTicketOfferWithoutDetail;
|
|
33
|
-
reservedTicket:
|
|
37
|
+
reservedTicket: IReservedTicket;
|
|
34
38
|
}): string | undefined;
|
|
35
39
|
declare function createReservation(params: {
|
|
36
40
|
project: {
|
|
@@ -39,7 +43,7 @@ declare function createReservation(params: {
|
|
|
39
43
|
};
|
|
40
44
|
id: string;
|
|
41
45
|
reservationFor: IMinimizedIndividualEvent<factory.eventType.ScreeningEvent> | IMinimizedIndividualEvent<factory.eventType.Event>;
|
|
42
|
-
reservedTicket:
|
|
46
|
+
reservedTicket: IReservedTicket;
|
|
43
47
|
additionalProperty?: factory.propertyValue.IPropertyValue<string>[];
|
|
44
48
|
additionalTicketText?: string;
|
|
45
49
|
ticketOffer: factory.product.ITicketOffer;
|
|
@@ -82,7 +82,9 @@ function createReservedTicket(params) {
|
|
|
82
82
|
reservationFor: params.reservationFor,
|
|
83
83
|
ticketedSeat
|
|
84
84
|
});
|
|
85
|
-
return Object.assign({
|
|
85
|
+
return Object.assign({
|
|
86
|
+
// dateIssued: params.dateIssued, // discontinue(2024-12-03~)
|
|
87
|
+
identifier: ticketIdentifier, issuedBy,
|
|
86
88
|
ticketType, typeOf: 'Ticket' }, (ticketedSeat !== undefined) ? { ticketedSeat } : {});
|
|
87
89
|
}
|
|
88
90
|
exports.createReservedTicket = createReservedTicket;
|
|
@@ -13,6 +13,7 @@ import type { ProductRepo } from '../../../repo/product';
|
|
|
13
13
|
import type { ProductOfferRepo } from '../../../repo/productOffer';
|
|
14
14
|
import type { ProjectRepo } from '../../../repo/project';
|
|
15
15
|
import type { OfferRateLimitRepo } from '../../../repo/rateLimit/offer';
|
|
16
|
+
import type { SettingRepo } from '../../../repo/setting';
|
|
16
17
|
import type { StockHolderRepo } from '../../../repo/stockHolder';
|
|
17
18
|
import type { TaskRepo } from '../../../repo/task';
|
|
18
19
|
interface IStartOperationRepos {
|
|
@@ -29,6 +30,7 @@ interface IStartOperationRepos {
|
|
|
29
30
|
priceSpecification: PriceSpecificationRepo;
|
|
30
31
|
project: ProjectRepo;
|
|
31
32
|
seat: SeatRepo;
|
|
33
|
+
setting: SettingRepo;
|
|
32
34
|
task: TaskRepo;
|
|
33
35
|
assetTransaction: AssetTransactionRepo;
|
|
34
36
|
}
|
|
@@ -28,7 +28,7 @@ const ONE_MONTH_IN_DAYS = 31;
|
|
|
28
28
|
* 取引開始
|
|
29
29
|
*/
|
|
30
30
|
function start(params, options) {
|
|
31
|
-
return (repos
|
|
31
|
+
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
32
32
|
var _a, _b;
|
|
33
33
|
const now = new Date();
|
|
34
34
|
const reservationNumber = params.transactionNumber;
|
|
@@ -70,7 +70,7 @@ function start(params, options) {
|
|
|
70
70
|
stockHoldUntilDaysAfterEventEnd: params.stockHoldUntilDaysAfterEventEnd,
|
|
71
71
|
// acceptedOffers4transactionObject,
|
|
72
72
|
objectSubReservations
|
|
73
|
-
})(repos
|
|
73
|
+
})(repos);
|
|
74
74
|
return {
|
|
75
75
|
transaction: { id },
|
|
76
76
|
objectSubReservations,
|
|
@@ -154,7 +154,9 @@ function createObjectAttributes(params, options) {
|
|
|
154
154
|
* 予約追加
|
|
155
155
|
*/
|
|
156
156
|
function addReservations(params) {
|
|
157
|
-
return (repos
|
|
157
|
+
return (repos
|
|
158
|
+
// settings: Settings
|
|
159
|
+
) => __awaiter(this, void 0, void 0, function* () {
|
|
158
160
|
const reservationNumber = params.transaction.transactionNumber;
|
|
159
161
|
const { event, reservationFor, objectSubReservations } = params;
|
|
160
162
|
let lockedOfferRateLimitKeys = [];
|
|
@@ -197,7 +199,7 @@ function addReservations(params) {
|
|
|
197
199
|
transaction: {
|
|
198
200
|
transactionNumber: reservationNumber
|
|
199
201
|
}
|
|
200
|
-
})(repos
|
|
202
|
+
})(repos);
|
|
201
203
|
});
|
|
202
204
|
}
|
|
203
205
|
/**
|
|
@@ -11,10 +11,9 @@ import type { MovieTheaterRepo } from '../repo/place/movieTheater';
|
|
|
11
11
|
import type { ScreeningRoomRepo } from '../repo/place/screeningRoom';
|
|
12
12
|
import type { ProjectRepo } from '../repo/project';
|
|
13
13
|
import type { SellerRepo } from '../repo/seller';
|
|
14
|
+
import type { SettingRepo } from '../repo/setting';
|
|
14
15
|
import type { TaskRepo } from '../repo/task';
|
|
15
16
|
import * as factory from '../factory';
|
|
16
|
-
import { Settings } from '../settings';
|
|
17
|
-
import { createEvent } from './event/createEvent';
|
|
18
17
|
interface IImportFromCOAParams {
|
|
19
18
|
project: {
|
|
20
19
|
id: string;
|
|
@@ -85,6 +84,7 @@ export declare function updateEvent4ttts(params: {
|
|
|
85
84
|
event: EventRepo;
|
|
86
85
|
eventSeries: EventSeriesRepo;
|
|
87
86
|
project: ProjectRepo;
|
|
87
|
+
setting: SettingRepo;
|
|
88
88
|
task: TaskRepo;
|
|
89
|
-
}
|
|
90
|
-
export {
|
|
89
|
+
}) => Promise<void>;
|
|
90
|
+
export {};
|
|
@@ -9,15 +9,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.updateEvent4ttts = exports.createScreeningEventIdFromCOA = exports.minimizeSuperEvent = exports.importFromCOA = void 0;
|
|
13
13
|
const createDebug = require("debug");
|
|
14
14
|
// @ts-ignore
|
|
15
15
|
const difference = require("lodash.difference");
|
|
16
16
|
// import { google } from 'googleapis';
|
|
17
17
|
const moment = require("moment-timezone");
|
|
18
18
|
const factory = require("../factory");
|
|
19
|
-
|
|
20
|
-
Object.defineProperty(exports, "createEvent", { enumerable: true, get: function () { return createEvent_1.createEvent; } });
|
|
19
|
+
// import { Settings } from '../settings';
|
|
21
20
|
const onEventChanged_1 = require("./offer/onEventChanged");
|
|
22
21
|
const debug = createDebug('chevre-domain:service:event');
|
|
23
22
|
/**
|
|
@@ -858,7 +857,9 @@ function createScreeningRoomFromCOA(project, seller, screenFromCOA) {
|
|
|
858
857
|
};
|
|
859
858
|
}
|
|
860
859
|
function updateEvent4ttts(params) {
|
|
861
|
-
return (repos
|
|
860
|
+
return (repos
|
|
861
|
+
// settings: Settings
|
|
862
|
+
) => __awaiter(this, void 0, void 0, function* () {
|
|
862
863
|
const actionAttributes = Object.assign({ project: { typeOf: factory.organizationType.Project, id: params.project.id }, typeOf: factory.actionType.UpdateAction, agent: params.agent, object: {
|
|
863
864
|
id: params.oldEventId,
|
|
864
865
|
typeOf: factory.eventType.ScreeningEvent
|
|
@@ -895,12 +896,9 @@ function updateEvent4ttts(params) {
|
|
|
895
896
|
typeOf: factory.eventType.ScreeningEvent,
|
|
896
897
|
isNew: false,
|
|
897
898
|
useInform: true
|
|
898
|
-
})(
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
project: repos.project,
|
|
902
|
-
task: repos.task
|
|
903
|
-
}, settings);
|
|
899
|
+
})(repos
|
|
900
|
+
// settings
|
|
901
|
+
);
|
|
904
902
|
});
|
|
905
903
|
}
|
|
906
904
|
exports.updateEvent4ttts = updateEvent4ttts;
|
|
@@ -16,6 +16,7 @@ import type { ProductRepo } from '../../../../repo/product';
|
|
|
16
16
|
import type { ProductOfferRepo } from '../../../../repo/productOffer';
|
|
17
17
|
import type { ProjectRepo } from '../../../../repo/project';
|
|
18
18
|
import type { OfferRateLimitRepo } from '../../../../repo/rateLimit/offer';
|
|
19
|
+
import type { SettingRepo } from '../../../../repo/setting';
|
|
19
20
|
import type { StockHolderRepo } from '../../../../repo/stockHolder';
|
|
20
21
|
import type { TaskRepo } from '../../../../repo/task';
|
|
21
22
|
import type { TicketRepo } from '../../../../repo/ticket';
|
|
@@ -55,6 +56,7 @@ declare function processStartReserve4chevre(params: {
|
|
|
55
56
|
priceSpecification: PriceSpecificationRepo;
|
|
56
57
|
project: ProjectRepo;
|
|
57
58
|
seat: SeatRepo;
|
|
59
|
+
setting: SettingRepo;
|
|
58
60
|
task: TaskRepo;
|
|
59
61
|
ticket: TicketRepo;
|
|
60
62
|
assetTransaction: AssetTransactionRepo;
|