@chevre/domain 22.14.0-alpha.9 → 23.0.0-alpha.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/{createEventBySchedule.ts → addEventBySchedule.ts} +2 -2
- package/example/src/chevre/aggregateEventPublicFields.ts +1 -1
- package/example/src/chevre/aggregation/createAggregateEventTasks.ts +1 -1
- package/example/src/chevre/authorizeEventServiceOffer.ts +119 -0
- package/example/src/chevre/findAnyEventById.ts +1 -1
- package/example/src/chevre/findReservationByCode.ts +0 -1
- package/example/src/chevre/productOffer/publishMemberTierToken.ts +92 -0
- package/example/src/chevre/reIndex.ts +3 -1
- package/example/src/chevre/roles/addAdminProductOfferPermissionIfNotExists.ts +48 -0
- package/example/src/chevre/roles/removeConsolePermissionIfExists.ts +1 -2
- package/example/src/chevre/updateEventPartiallyById.ts +1 -1
- package/lib/chevre/factory/event.d.ts +2 -4
- package/lib/chevre/repo/accountingReport.d.ts +4 -4
- package/lib/chevre/repo/accountingReport.js +1 -1
- package/lib/chevre/repo/action.d.ts +1 -1
- package/lib/chevre/repo/aggregateReservation.d.ts +2 -2
- package/lib/chevre/repo/creativeWork.d.ts +1 -3
- package/lib/chevre/repo/creativeWork.js +65 -47
- package/lib/chevre/repo/event.d.ts +44 -48
- package/lib/chevre/repo/event.js +13 -111
- package/lib/chevre/repo/eventSeries.d.ts +14 -14
- package/lib/chevre/repo/mongoose/schemas/accountingReport.d.ts +2 -15
- package/lib/chevre/repo/mongoose/schemas/aggregateReservation.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/event.d.ts +2 -5
- package/lib/chevre/repo/mongoose/schemas/eventSeries.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/place.js +13 -14
- package/lib/chevre/repo/mongoose/schemas/product.js +14 -4
- package/lib/chevre/repo/mongoose/schemas/{offer/event.d.ts → productOffer.d.ts} +6 -3
- package/lib/chevre/repo/mongoose/schemas/{offer/event.js → productOffer.js} +26 -29
- package/lib/chevre/repo/mongoose/schemas/seller.js +17 -6
- package/lib/chevre/repo/productOffer.d.ts +36 -61
- package/lib/chevre/repo/productOffer.js +163 -157
- package/lib/chevre/repository.d.ts +0 -5
- package/lib/chevre/repository.js +2 -15
- package/lib/chevre/service/aggregation/event/aggregateOffers.d.ts +1 -1
- package/lib/chevre/service/aggregation/event/aggregateOffers.js +2 -6
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +3 -19
- package/lib/chevre/service/assetTransaction/reserve/start/createSubReservations.d.ts +1 -3
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createReservation.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createStartParams.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createStartParams.js +1 -6
- package/lib/chevre/service/assetTransaction/reserve/start.d.ts +0 -2
- package/lib/chevre/service/assetTransaction/reserve/start.js +4 -4
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.d.ts +3 -3
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.js +57 -32
- package/lib/chevre/service/offer/event/authorize/factory.d.ts +2 -2
- package/lib/chevre/service/offer/event/authorize/factory.js +2 -2
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +2 -4
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.js +2 -2
- package/lib/chevre/service/offer/event/authorize.d.ts +0 -2
- package/lib/chevre/service/offer/event/authorize.js +2 -2
- package/lib/chevre/service/offer/event/checkAvailability.d.ts +1 -1
- package/lib/chevre/service/offer/event/searchEventTicketOffers.d.ts +1 -1
- package/lib/chevre/service/offer/event/searchOffersByIds.d.ts +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +1 -1
- package/lib/chevre/service/offer/onEventChanged.js +2 -19
- package/lib/chevre/service/offer/product.d.ts +0 -3
- package/lib/chevre/service/offer/product.js +29 -38
- package/lib/chevre/service/order/createAccountingReportIfNotExist.js +0 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.js +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.js +1 -1
- package/lib/chevre/service/payment/movieTicket/factory.d.ts +2 -2
- package/lib/chevre/service/payment/movieTicket/processPurchaseNumberAuth.d.ts +1 -1
- package/lib/chevre/service/reserve/useReservation.js +2 -3
- package/lib/chevre/service/reserve/verifyToken4reservation.d.ts +0 -2
- package/lib/chevre/service/task/checkResource.d.ts +2 -2
- package/lib/chevre/service/task/checkResource.js +8 -6
- package/lib/chevre/service/task/createAccountingReport.d.ts +2 -2
- package/lib/chevre/service/task/createAccountingReport.js +15 -15
- package/lib/chevre/service/task/createEvent/createEventBySchedule/factory.d.ts +1 -1
- package/lib/chevre/service/task/createEvent/createEventBySchedule.d.ts +1 -1
- package/lib/chevre/service/task/createEvent/createEventBySchedule.js +2 -1
- package/lib/chevre/service/task/createEvent/createEventSeries.d.ts +1 -1
- package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +7 -6
- package/lib/chevre/service/task/useReservation.js +1 -2
- package/lib/chevre/service/taskHandler.js +2 -0
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPointAward.d.ts +0 -1
- package/package.json +3 -3
- package/example/src/chevre/eventOffer/adminEventOffers.ts +0 -67
- package/example/src/chevre/roles/addPermissionIfNotExists.ts +0 -48
- package/example/src/chevre/upsertMoviesByIdentifier.ts +0 -58
- package/lib/chevre/repo/offer/event.d.ts +0 -38
- package/lib/chevre/repo/offer/event.js +0 -142
|
@@ -34,7 +34,6 @@ import type { MerchantReturnPolicyRepo } from './repo/merchantReturnPolicy';
|
|
|
34
34
|
import type { MessageRepo } from './repo/message';
|
|
35
35
|
import type { NoteRepo } from './repo/note';
|
|
36
36
|
import type { NoteAboutOrderRepo } from './repo/noteAboutOrder';
|
|
37
|
-
import type { EventOfferRepo } from './repo/offer/event';
|
|
38
37
|
import type { OfferRepo } from './repo/offer/unitPriceInCatalog';
|
|
39
38
|
import type { OfferCatalogRepo } from './repo/offerCatalog';
|
|
40
39
|
import type { OfferCatalogItemRepo } from './repo/offerCatalogItem';
|
|
@@ -180,10 +179,6 @@ export type Event = EventRepo;
|
|
|
180
179
|
export declare namespace Event {
|
|
181
180
|
function createInstance(...params: ConstructorParameters<typeof EventRepo>): Promise<EventRepo>;
|
|
182
181
|
}
|
|
183
|
-
export type EventOffer = EventOfferRepo;
|
|
184
|
-
export declare namespace EventOffer {
|
|
185
|
-
function createInstance(...params: ConstructorParameters<typeof EventOfferRepo>): Promise<EventOfferRepo>;
|
|
186
|
-
}
|
|
187
182
|
export type EventSellerMakesOffer = EventSellerMakesOfferRepo;
|
|
188
183
|
export declare namespace EventSellerMakesOffer {
|
|
189
184
|
function createInstance(...params: ConstructorParameters<typeof EventSellerMakesOfferRepo>): Promise<EventSellerMakesOfferRepo>;
|
package/lib/chevre/repository.js
CHANGED
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Person = exports.paymentMethod = exports.PendingReservation = exports.PaymentServiceProvider = exports.PaymentServiceChannel = exports.PaymentService = exports.Passport = exports.OwnershipInfo = exports.OrderNumber = exports.OrderInTransaction = exports.Order = exports.Offer = exports.OfferItemCondition = exports.OfferCatalogItem = exports.OfferCatalog = exports.NoteAboutOrder = exports.Note = exports.Message = exports.MerchantReturnPolicy = exports.MemberProgram = exports.Member = exports.Issuer = exports.IdentityProvider = exports.Identity = exports.EventSeries = exports.EventSellerMakesOffer = exports.
|
|
13
|
-
exports.WebSite = exports.rateLimit = exports.Trip = exports.TransactionProcess = exports.TransactionNumber = exports.Transaction = exports.Ticket = exports.Telemetry = exports.Task = exports.StockHolder = exports.setting = exports.Setting = exports.ServiceOutputIdentifier = exports.ServiceOutput = exports.ServiceAvailableHour = exports.SellerReturnPolicy = exports.SellerPaymentAccepted = exports.SellerMakesOffer = exports.Seller = exports.Schedule = exports.Role = exports.ReserveInterface = exports.Reservation = exports.ProjectMakesOffer = exports.Project = exports.ProductOffer = exports.ProductModel = exports.Product = exports.PriceSpecification = exports.PotentialAction = exports.place =
|
|
12
|
+
exports.Permit = exports.Person = exports.paymentMethod = exports.PendingReservation = exports.PaymentServiceProvider = exports.PaymentServiceChannel = exports.PaymentService = exports.Passport = exports.OwnershipInfo = exports.OrderNumber = exports.OrderInTransaction = exports.Order = exports.Offer = exports.OfferItemCondition = exports.OfferCatalogItem = exports.OfferCatalog = exports.NoteAboutOrder = exports.Note = exports.Message = exports.MerchantReturnPolicy = exports.MemberProgram = exports.Member = exports.Issuer = exports.IdentityProvider = exports.Identity = exports.EventSeries = exports.EventSellerMakesOffer = exports.Event = exports.EmailMessage = exports.CustomerType = exports.Customer = exports.Credentials = exports.CreativeWork = exports.ConfirmationNumber = exports.Comment = exports.Authorization = exports.CategoryCode = exports.AssetTransaction = exports.Aggregation = exports.AggregateReservation = exports.AggregateOrder = exports.AggregateOffer = exports.AdvanceBookingRequirement = exports.AdditionalProperty = exports.Action = exports.AccountTransaction = exports.AccountTitle = exports.AccountingReport = exports.Account = exports.AcceptedOffer = void 0;
|
|
13
|
+
exports.WebSite = exports.rateLimit = exports.Trip = exports.TransactionProcess = exports.TransactionNumber = exports.Transaction = exports.Ticket = exports.Telemetry = exports.Task = exports.StockHolder = exports.setting = exports.Setting = exports.ServiceOutputIdentifier = exports.ServiceOutput = exports.ServiceAvailableHour = exports.SellerReturnPolicy = exports.SellerPaymentAccepted = exports.SellerMakesOffer = exports.Seller = exports.Schedule = exports.Role = exports.ReserveInterface = exports.Reservation = exports.ProjectMakesOffer = exports.Project = exports.ProductOffer = exports.ProductModel = exports.Product = exports.PriceSpecification = exports.PotentialAction = exports.place = void 0;
|
|
14
14
|
var AcceptedOffer;
|
|
15
15
|
(function (AcceptedOffer) {
|
|
16
16
|
let repo;
|
|
@@ -310,19 +310,6 @@ var Event;
|
|
|
310
310
|
}
|
|
311
311
|
Event.createInstance = createInstance;
|
|
312
312
|
})(Event || (exports.Event = Event = {}));
|
|
313
|
-
var EventOffer;
|
|
314
|
-
(function (EventOffer) {
|
|
315
|
-
let repo;
|
|
316
|
-
function createInstance(...params) {
|
|
317
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
318
|
-
if (repo === undefined) {
|
|
319
|
-
repo = (yield Promise.resolve().then(() => require('./repo/offer/event'))).EventOfferRepo;
|
|
320
|
-
}
|
|
321
|
-
return new repo(...params);
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
|
-
EventOffer.createInstance = createInstance;
|
|
325
|
-
})(EventOffer || (exports.EventOffer = EventOffer = {}));
|
|
326
313
|
var EventSellerMakesOffer;
|
|
327
314
|
(function (EventSellerMakesOffer) {
|
|
328
315
|
let repo;
|
|
@@ -24,6 +24,6 @@ type IAggregateOffersOperation<T> = (repos: {
|
|
|
24
24
|
*/
|
|
25
25
|
declare function aggregateOffers(params: {
|
|
26
26
|
id: string;
|
|
27
|
-
typeOf: factory.eventType.ScreeningEvent
|
|
27
|
+
typeOf: factory.eventType.ScreeningEvent;
|
|
28
28
|
}): IAggregateOffersOperation<void>;
|
|
29
29
|
export { aggregateOffers };
|
|
@@ -43,7 +43,6 @@ function aggregateOffers(params) {
|
|
|
43
43
|
}
|
|
44
44
|
function aggregateOffersByEvent(params) {
|
|
45
45
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
46
|
-
var _a;
|
|
47
46
|
const now = new Date();
|
|
48
47
|
const event = params.event;
|
|
49
48
|
// 施設取得は冗長なので、ルーム検索に変更(2023-01-30~)
|
|
@@ -52,7 +51,7 @@ function aggregateOffersByEvent(params) {
|
|
|
52
51
|
movieTheaterId = params.event.superEvent.location.id;
|
|
53
52
|
}
|
|
54
53
|
else {
|
|
55
|
-
|
|
54
|
+
throw new factory.errors.NotImplemented(`typeOf: ${params.event.typeOf}`);
|
|
56
55
|
}
|
|
57
56
|
const screeningRoom = yield repos.screeningRoom.findScreeningRoomsByBranchCode({
|
|
58
57
|
project: { id: event.project.id },
|
|
@@ -123,10 +122,7 @@ function aggregateReservationByOffer(params) {
|
|
|
123
122
|
let reservationCount4offer;
|
|
124
123
|
// let attendeeCount4offer: number | undefined;
|
|
125
124
|
// let checkInCount4offer: number | undefined;
|
|
126
|
-
|
|
127
|
-
if (params.event.typeOf === factory.eventType.Event) {
|
|
128
|
-
reservationType = factory.reservationType.BusReservation;
|
|
129
|
-
}
|
|
125
|
+
const reservationType = factory.reservationType.EventReservation;
|
|
130
126
|
const offerIdsWithSameCategory = params.availableOffers.filter(({ category }) => {
|
|
131
127
|
var _a;
|
|
132
128
|
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);
|
|
@@ -56,19 +56,7 @@ function aggregateScreeningEvent(params) {
|
|
|
56
56
|
.add(1, 'hour')
|
|
57
57
|
.add(-1, 'second')
|
|
58
58
|
.toDate();
|
|
59
|
-
if (event.typeOf === factory.eventType.
|
|
60
|
-
aggregatingEvents = yield repos.event.projectEventFields({
|
|
61
|
-
limit: 100,
|
|
62
|
-
page: 1,
|
|
63
|
-
project: { id: { $eq: event.project.id } },
|
|
64
|
-
typeOf: event.typeOf,
|
|
65
|
-
eventStatuses: [factory.eventStatusType.EventScheduled],
|
|
66
|
-
startFrom: startFrom,
|
|
67
|
-
startThrough: startThrough,
|
|
68
|
-
location: { branchCode: { $eq: event.location.branchCode } }
|
|
69
|
-
}, ['location', 'project', 'startDate', 'typeOf', 'superEvent.location.id', 'offers.itemOffered', 'maximumPhysicalAttendeeCapacity']);
|
|
70
|
-
}
|
|
71
|
-
else if (event.typeOf === factory.eventType.ScreeningEvent) {
|
|
59
|
+
if (event.typeOf === factory.eventType.ScreeningEvent) {
|
|
72
60
|
aggregatingEvents = yield repos.event.projectEventFields({
|
|
73
61
|
limit: 100,
|
|
74
62
|
page: 1,
|
|
@@ -95,7 +83,6 @@ function aggregateByEvent(params, options) {
|
|
|
95
83
|
return (repos
|
|
96
84
|
// settings: Settings
|
|
97
85
|
) => __awaiter(this, void 0, void 0, function* () {
|
|
98
|
-
var _a;
|
|
99
86
|
const now = new Date();
|
|
100
87
|
const event = params.event;
|
|
101
88
|
// 施設取得は冗長なので、ルーム検索に変更(2023-01-30~)
|
|
@@ -104,7 +91,7 @@ function aggregateByEvent(params, options) {
|
|
|
104
91
|
movieTheaterId = params.event.superEvent.location.id;
|
|
105
92
|
}
|
|
106
93
|
else {
|
|
107
|
-
|
|
94
|
+
throw new factory.errors.NotImplemented(`typeOf: ${params.event.typeOf}`);
|
|
108
95
|
}
|
|
109
96
|
const screeningRoom = yield repos.screeningRoom.findScreeningRoomsByBranchCode({
|
|
110
97
|
project: { id: event.project.id },
|
|
@@ -224,10 +211,7 @@ function aggregateReservationByEvent(params) {
|
|
|
224
211
|
let attendeeCount;
|
|
225
212
|
let checkInCount;
|
|
226
213
|
let reservationCount;
|
|
227
|
-
|
|
228
|
-
if (params.event.typeOf === factory.eventType.Event) {
|
|
229
|
-
reservationType = factory.reservationType.BusReservation;
|
|
230
|
-
}
|
|
214
|
+
const reservationType = factory.reservationType.EventReservation;
|
|
231
215
|
reservationCount = yield repos.reservation.count({
|
|
232
216
|
typeOf: reservationType,
|
|
233
217
|
reservationFor: { id: { $eq: params.event.id } },
|
|
@@ -5,14 +5,13 @@ import type { OfferRepo } from '../../../../repo/offer/unitPriceInCatalog';
|
|
|
5
5
|
import type { OfferCatalogRepo } from '../../../../repo/offerCatalog';
|
|
6
6
|
import type { PaymentServiceRepo } from '../../../../repo/paymentService';
|
|
7
7
|
import type { ProductRepo } from '../../../../repo/product';
|
|
8
|
-
import type { ProductOfferRepo } from '../../../../repo/productOffer';
|
|
9
8
|
type IObjectSubReservation = factory.assetTransaction.reserve.IObjectSubReservation;
|
|
10
9
|
declare function createSubReservations(params: {
|
|
11
10
|
acceptedOffers: factory.assetTransaction.reserve.IAcceptedTicketOfferWithoutDetail[];
|
|
12
11
|
ticketOffers: factory.product.ITicketOffer[];
|
|
13
12
|
availableOffers: factory.unitPriceOffer.IUnitPriceOffer[];
|
|
14
13
|
now: Date;
|
|
15
|
-
event: IMinimizedIndividualEvent
|
|
14
|
+
event: IMinimizedIndividualEvent;
|
|
16
15
|
availableSeatOffers: factory.place.seat.IPlaceWithOffer[];
|
|
17
16
|
reservationNumber: string;
|
|
18
17
|
availableAtOrFrom?: {
|
|
@@ -25,6 +24,5 @@ declare function createSubReservations(params: {
|
|
|
25
24
|
offerCatalog: OfferCatalogRepo;
|
|
26
25
|
paymentService: PaymentServiceRepo;
|
|
27
26
|
product: ProductRepo;
|
|
28
|
-
productOffer: ProductOfferRepo;
|
|
29
27
|
}) => Promise<IObjectSubReservation[]>;
|
|
30
28
|
export { createSubReservations };
|
|
@@ -42,7 +42,7 @@ declare function createReservation(params: {
|
|
|
42
42
|
typeOf: factory.organizationType.Project;
|
|
43
43
|
};
|
|
44
44
|
id: string;
|
|
45
|
-
reservationFor: IMinimizedIndividualEvent
|
|
45
|
+
reservationFor: IMinimizedIndividualEvent;
|
|
46
46
|
reservedTicket: IReservedTicket;
|
|
47
47
|
additionalProperty?: factory.propertyValue.IPropertyValue<string>[];
|
|
48
48
|
additionalTicketText?: string;
|
|
@@ -13,7 +13,7 @@ declare function createStartParams(params: factory.assetTransaction.reserve.ISta
|
|
|
13
13
|
id: string;
|
|
14
14
|
};
|
|
15
15
|
reservationNumber: string;
|
|
16
|
-
event: IMinimizedIndividualEvent
|
|
16
|
+
event: IMinimizedIndividualEvent;
|
|
17
17
|
acceptedOffers4transactionObject: factory.assetTransaction.reserve.IAcceptedOffer4object[];
|
|
18
18
|
objectSubReservations: IObjectSubReservation[];
|
|
19
19
|
instrument: factory.assetTransaction.reserve.IInstrument[];
|
|
@@ -25,18 +25,13 @@ function createStartParams(params) {
|
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
function createReservationFor(params, useOptimizeReservation) {
|
|
28
|
-
var _a, _b;
|
|
29
28
|
if (params.typeOf === factory.eventType.ScreeningEvent) {
|
|
30
29
|
return Object.assign({ endDate: params.endDate, id: params.id, location: params.location, name: params.name, startDate: params.startDate, superEvent: optimizeReservationSuperEvent(params, useOptimizeReservation), typeOf: params.typeOf }, (params.doorTime instanceof Date)
|
|
31
30
|
? { doorTime: params.doorTime }
|
|
32
31
|
: undefined);
|
|
33
32
|
}
|
|
34
33
|
else {
|
|
35
|
-
|
|
36
|
-
if (typeof (tripByEvent === null || tripByEvent === void 0 ? void 0 : tripByEvent.typeOf) !== 'string') {
|
|
37
|
-
throw new factory.errors.NotFound('event.offers.itemOffered.serviceOutput?.reservationFor');
|
|
38
|
-
}
|
|
39
|
-
return Object.assign(Object.assign({}, tripByEvent), { arrivalTime: params.endDate, id: params.id, name: params.name, departureTime: params.startDate });
|
|
34
|
+
throw new factory.errors.NotImplemented(`typeOf: ${params.typeOf}`);
|
|
40
35
|
}
|
|
41
36
|
}
|
|
42
37
|
function optimizeReservationSuperEvent(params, useOptimizeReservation) {
|
|
@@ -6,7 +6,6 @@ import type { EventRepo } from '../../../repo/event';
|
|
|
6
6
|
import type { EventSeriesRepo } from '../../../repo/eventSeries';
|
|
7
7
|
import type { IssuerRepo } from '../../../repo/issuer';
|
|
8
8
|
import type { MemberProgramRepo } from '../../../repo/memberProgram';
|
|
9
|
-
import type { EventOfferRepo } from '../../../repo/offer/event';
|
|
10
9
|
import type { OfferRepo } from '../../../repo/offer/unitPriceInCatalog';
|
|
11
10
|
import type { OfferCatalogRepo } from '../../../repo/offerCatalog';
|
|
12
11
|
import type { OfferCatalogItemRepo } from '../../../repo/offerCatalogItem';
|
|
@@ -24,7 +23,6 @@ interface IStartOperationRepos {
|
|
|
24
23
|
advanceBookingRequirement: AdvanceBookingRequirementRepo;
|
|
25
24
|
stockHolder: StockHolderRepo;
|
|
26
25
|
event: EventRepo;
|
|
27
|
-
eventOffer: EventOfferRepo;
|
|
28
26
|
eventSeries: EventSeriesRepo;
|
|
29
27
|
issuer: IssuerRepo;
|
|
30
28
|
memberProgram: MemberProgramRepo;
|
|
@@ -47,9 +47,9 @@ function start(params, options) {
|
|
|
47
47
|
now,
|
|
48
48
|
store: { id: (_a = params.availableAtOrFrom) === null || _a === void 0 ? void 0 : _a.id }
|
|
49
49
|
})({
|
|
50
|
-
eventOffer: repos.eventOffer,
|
|
51
50
|
issuer: repos.issuer,
|
|
52
|
-
memberProgram: repos.memberProgram
|
|
51
|
+
memberProgram: repos.memberProgram,
|
|
52
|
+
productOffer: repos.productOffer
|
|
53
53
|
});
|
|
54
54
|
// objectに必要な情報をそろえる
|
|
55
55
|
const { acceptedOffers4transactionObject, objectSubReservations } = yield createObjectAttributes({
|
|
@@ -117,10 +117,10 @@ function createObjectAttributes(params, options) {
|
|
|
117
117
|
const { event, now } = params;
|
|
118
118
|
const reservationNumber = params.transaction.transactionNumber;
|
|
119
119
|
const acceptedOffers = (Array.isArray(params.object.acceptedOffer)) ? params.object.acceptedOffer : [];
|
|
120
|
-
if (event.typeOf !== factory.eventType.ScreeningEvent
|
|
120
|
+
if (event.typeOf !== factory.eventType.ScreeningEvent) {
|
|
121
121
|
throw new factory.errors.Argument('object.reservationFor.id', `invalid event type ${event.typeOf}`);
|
|
122
122
|
}
|
|
123
|
-
if (event.typeOf === factory.eventType.ScreeningEvent
|
|
123
|
+
if (event.typeOf === factory.eventType.ScreeningEvent) {
|
|
124
124
|
validateEvent({ now, event }, options);
|
|
125
125
|
}
|
|
126
126
|
// 受け入れたオファーIDだけ取得する(2023-01-26~)
|
|
@@ -2,10 +2,10 @@ import * as factory from '../../../factory';
|
|
|
2
2
|
import { IMinimizedIndividualEvent } from '../../../factory/event';
|
|
3
3
|
import type { IssuerRepo } from '../../../repo/issuer';
|
|
4
4
|
import type { MemberProgramRepo } from '../../../repo/memberProgram';
|
|
5
|
-
import type {
|
|
5
|
+
import type { ProductOfferRepo } from '../../../repo/productOffer';
|
|
6
6
|
declare function validateStartRequest(params: {
|
|
7
7
|
object: factory.assetTransaction.reserve.IObjectWithoutDetail;
|
|
8
|
-
event: Pick<IMinimizedIndividualEvent
|
|
8
|
+
event: Pick<IMinimizedIndividualEvent, 'offers' | 'id' | 'project'>;
|
|
9
9
|
validateEventOfferPeriod?: boolean;
|
|
10
10
|
validateEvent?: boolean;
|
|
11
11
|
now: Date;
|
|
@@ -16,8 +16,8 @@ declare function validateStartRequest(params: {
|
|
|
16
16
|
id?: string;
|
|
17
17
|
};
|
|
18
18
|
}): (repos: {
|
|
19
|
-
eventOffer: EventOfferRepo;
|
|
20
19
|
issuer: IssuerRepo;
|
|
21
20
|
memberProgram: MemberProgramRepo;
|
|
21
|
+
productOffer: ProductOfferRepo;
|
|
22
22
|
}) => Promise<void>;
|
|
23
23
|
export { validateStartRequest };
|
|
@@ -13,7 +13,6 @@ exports.validateStartRequest = validateStartRequest;
|
|
|
13
13
|
const jwt = require("jsonwebtoken");
|
|
14
14
|
const moment = require("moment");
|
|
15
15
|
const factory = require("../../../factory");
|
|
16
|
-
const ROLE_DATE_FORMAT = 'YYYY-MM-DDTHH:mm:ssZ';
|
|
17
16
|
function verifyOfferedByToken(params) {
|
|
18
17
|
return __awaiter(this, void 0, void 0, function* () {
|
|
19
18
|
let result;
|
|
@@ -55,9 +54,9 @@ function validateStartRequest(params) {
|
|
|
55
54
|
if (typeof ((_a = params.store) === null || _a === void 0 ? void 0 : _a.id) !== 'string') {
|
|
56
55
|
throw new factory.errors.NotFound('store.id');
|
|
57
56
|
}
|
|
58
|
-
const
|
|
57
|
+
const tokenizedMemberProgramTier = (_c = (_b = params.object.reservationFor) === null || _b === void 0 ? void 0 : _b.offers) === null || _c === void 0 ? void 0 : _c.validForMemberTier;
|
|
59
58
|
yield validateEventOfferPeriod(Object.assign({ event,
|
|
60
|
-
now, availableAt: { id: params.store.id } }, (typeof
|
|
59
|
+
now, availableAt: { id: params.store.id } }, (typeof (tokenizedMemberProgramTier === null || tokenizedMemberProgramTier === void 0 ? void 0 : tokenizedMemberProgramTier.token) === 'string') ? { tokenizedMemberProgramTier } : undefined))(repos);
|
|
61
60
|
}
|
|
62
61
|
if (params.validateEvent === true) {
|
|
63
62
|
validateEvent({ event, object: params.object });
|
|
@@ -67,7 +66,7 @@ function validateStartRequest(params) {
|
|
|
67
66
|
function validateMemberTier(params) {
|
|
68
67
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
69
68
|
var _a, _b, _c, _d, _e;
|
|
70
|
-
const { acceptedDate, event,
|
|
69
|
+
const { acceptedDate, event, verifiedValidForMemberTier, memberProgramIdentifierMustBe, aggregateOfferIdentifier } = params;
|
|
71
70
|
const tierIdentifier = (_b = (_a = verifiedValidForMemberTier.member) === null || _a === void 0 ? void 0 : _a.memberOf) === null || _b === void 0 ? void 0 : _b.identifier;
|
|
72
71
|
const memberProgramIdentifier = (_e = (_d = (_c = verifiedValidForMemberTier.member) === null || _c === void 0 ? void 0 : _c.memberOf) === null || _d === void 0 ? void 0 : _d.isTierOf) === null || _e === void 0 ? void 0 : _e.identifier;
|
|
73
72
|
if (typeof tierIdentifier !== 'string') {
|
|
@@ -79,28 +78,41 @@ function validateMemberTier(params) {
|
|
|
79
78
|
if (memberProgramIdentifier !== memberProgramIdentifierMustBe) {
|
|
80
79
|
throw new factory.errors.Argument('reservationFor.offers.validForMemberTier', 'member program not matched');
|
|
81
80
|
}
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
const sellerId = event.offers.seller.id;
|
|
82
|
+
if (typeof sellerId !== 'string' || sellerId === '') {
|
|
83
|
+
throw new factory.errors.NotFound('event.offers.seller.id');
|
|
84
|
+
}
|
|
85
|
+
// 有効なプロダクトオファーを検証
|
|
86
|
+
const productOfferForMemberTier = (yield repos.productOffer.findProductOffers({
|
|
84
87
|
limit: 1,
|
|
85
88
|
page: 1,
|
|
86
89
|
project: { id: { $eq: event.project.id } },
|
|
87
|
-
availableAtOrFrom: { id: { $eq: availableAt.id } },
|
|
88
|
-
itemOffered: {
|
|
89
|
-
validForMemberTier: { identifier: { $eq: tierIdentifier } }
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
validThroughMoment = moment(eventOfferForMemberTier.validThrough, ROLE_DATE_FORMAT, true);
|
|
97
|
-
validFromMoment = moment(eventOfferForMemberTier.validFrom, ROLE_DATE_FORMAT, true);
|
|
98
|
-
if (acceptedDate.isBefore(validFromMoment)) {
|
|
99
|
-
throw new factory.errors.Argument('reservationFor.offers.validForMemberTier', `the offer id valid from ${validFromMoment}`);
|
|
100
|
-
}
|
|
101
|
-
if (acceptedDate.isAfter(validThroughMoment)) {
|
|
102
|
-
throw new factory.errors.Argument('reservationFor.offers.validForMemberTier', `the offer id valid through ${validThroughMoment}`);
|
|
90
|
+
// availableAtOrFrom: { id: { $eq: availableAt.id } },
|
|
91
|
+
itemOffered: { identifier: { $eq: aggregateOfferIdentifier } }, // オファーコレクションコード
|
|
92
|
+
validForMemberTier: { identifier: { $eq: tierIdentifier } },
|
|
93
|
+
validFrom: { $lte: acceptedDate.toDate() },
|
|
94
|
+
validThrough: { $gte: acceptedDate.toDate() },
|
|
95
|
+
offeredBy: { id: { $eq: sellerId } } // オファー提供者も検証する
|
|
96
|
+
}, ['identifier'])).shift();
|
|
97
|
+
if (productOfferForMemberTier === undefined) {
|
|
98
|
+
throw new factory.errors.NotFound(factory.offerType.Offer, 'valid product offers for member tier not found');
|
|
103
99
|
}
|
|
100
|
+
// let validThroughMoment: moment.Moment;
|
|
101
|
+
// let validFromMoment: moment.Moment;
|
|
102
|
+
// validThroughMoment = moment(productOfferForMemberTier.validThrough, ROLE_DATE_FORMAT, true);
|
|
103
|
+
// validFromMoment = moment(productOfferForMemberTier.validFrom, ROLE_DATE_FORMAT, true);
|
|
104
|
+
// if (acceptedDate.isBefore(validFromMoment)) {
|
|
105
|
+
// throw new factory.errors.Argument(
|
|
106
|
+
// 'reservationFor.offers.validForMemberTier',
|
|
107
|
+
// `the offer id valid from ${validFromMoment}`
|
|
108
|
+
// );
|
|
109
|
+
// }
|
|
110
|
+
// if (acceptedDate.isAfter(validThroughMoment)) {
|
|
111
|
+
// throw new factory.errors.Argument(
|
|
112
|
+
// 'reservationFor.offers.validForMemberTier',
|
|
113
|
+
// `the offer id valid through ${validThroughMoment}`
|
|
114
|
+
// );
|
|
115
|
+
// }
|
|
104
116
|
});
|
|
105
117
|
}
|
|
106
118
|
/**
|
|
@@ -109,18 +121,18 @@ function validateMemberTier(params) {
|
|
|
109
121
|
function validateEventOfferPeriod(params) {
|
|
110
122
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
111
123
|
var _a, _b;
|
|
112
|
-
const { event, availableAt,
|
|
124
|
+
const { event, availableAt, tokenizedMemberProgramTier } = params;
|
|
113
125
|
const acceptedDate = moment(params.now);
|
|
114
126
|
const eventOffers = event.offers;
|
|
115
127
|
// アプリケーションごとの設定を参照する(2022-11-19~)
|
|
116
128
|
const makesOfferOnApplication = eventOffers === null || eventOffers === void 0 ? void 0 : eventOffers.seller.makesOffer.find((offer) => {
|
|
117
129
|
var _a, _b;
|
|
118
130
|
// support non-array(2024-10-11~)
|
|
119
|
-
return (Array.isArray(offer.availableAtOrFrom) && ((_a = offer.availableAtOrFrom.at(0)) === null || _a === void 0 ? void 0 : _a.id) ===
|
|
120
|
-
|| (!Array.isArray(offer.availableAtOrFrom) && ((_b = offer.availableAtOrFrom) === null || _b === void 0 ? void 0 : _b.id) ===
|
|
131
|
+
return (Array.isArray(offer.availableAtOrFrom) && ((_a = offer.availableAtOrFrom.at(0)) === null || _a === void 0 ? void 0 : _a.id) === availableAt.id)
|
|
132
|
+
|| (!Array.isArray(offer.availableAtOrFrom) && ((_b = offer.availableAtOrFrom) === null || _b === void 0 ? void 0 : _b.id) === availableAt.id);
|
|
121
133
|
});
|
|
122
134
|
if (makesOfferOnApplication === undefined) {
|
|
123
|
-
throw new factory.errors.Argument('reservationFor.id', `seller makes no available offer at ${
|
|
135
|
+
throw new factory.errors.Argument('reservationFor.id', `seller makes no available offer at ${availableAt.id}`);
|
|
124
136
|
}
|
|
125
137
|
const validFrom = makesOfferOnApplication.validFrom;
|
|
126
138
|
const validThrough = makesOfferOnApplication.validThrough;
|
|
@@ -136,11 +148,24 @@ function validateEventOfferPeriod(params) {
|
|
|
136
148
|
throw new factory.errors.Argument('reservationFor.id', `Offer of ${params.event.id} is valid through ${validThrough}`);
|
|
137
149
|
}
|
|
138
150
|
}
|
|
151
|
+
// 有効メンバープログラムティアが存在する場合
|
|
139
152
|
// support validForMemberTier(2025-05-14~)
|
|
140
|
-
const
|
|
141
|
-
if (
|
|
153
|
+
const validForMemberTierExists = ((_a = makesOfferOnApplication.validForMemberTier) === null || _a === void 0 ? void 0 : _a.typeOf) === 'MemberProgramTier';
|
|
154
|
+
if (validForMemberTierExists) {
|
|
155
|
+
const validForMemberTierToken = tokenizedMemberProgramTier === null || tokenizedMemberProgramTier === void 0 ? void 0 : tokenizedMemberProgramTier.token;
|
|
156
|
+
const memberProgramIdentifierMustBe = (_b = tokenizedMemberProgramTier === null || tokenizedMemberProgramTier === void 0 ? void 0 : tokenizedMemberProgramTier.isTierOf) === null || _b === void 0 ? void 0 : _b.identifier;
|
|
157
|
+
// ティアトークンが必須
|
|
142
158
|
if (typeof validForMemberTierToken !== 'string' || validForMemberTierToken === '') {
|
|
143
|
-
throw new factory.errors.ArgumentNull('reservationFor.offers.validForMemberTier');
|
|
159
|
+
throw new factory.errors.ArgumentNull('reservationFor.offers.validForMemberTier.token');
|
|
160
|
+
}
|
|
161
|
+
// メンバープログラムコード指定が必須
|
|
162
|
+
if (typeof memberProgramIdentifierMustBe !== 'string' || memberProgramIdentifierMustBe === '') {
|
|
163
|
+
throw new factory.errors.ArgumentNull('reservationFor.offers.validForMemberTier.isTierOf.identifier');
|
|
164
|
+
}
|
|
165
|
+
// 有効メンバープログラムティアが存在する場合、オファーコレクションコードが必須
|
|
166
|
+
const aggregateOfferIdentifier = eventOffers.identifier;
|
|
167
|
+
if (typeof aggregateOfferIdentifier !== 'string' || aggregateOfferIdentifier === '') {
|
|
168
|
+
throw new factory.errors.NotFound('makesOfferOnApplication.identifier');
|
|
144
169
|
}
|
|
145
170
|
// トークン検証
|
|
146
171
|
const memberProgram = (yield repos.memberProgram.projectMemberPrograms({
|
|
@@ -150,7 +175,7 @@ function validateEventOfferPeriod(params) {
|
|
|
150
175
|
identifier: { $eq: memberProgramIdentifierMustBe }
|
|
151
176
|
})).shift();
|
|
152
177
|
if (memberProgram === undefined) {
|
|
153
|
-
throw new factory.errors.NotFound('MemberProgram');
|
|
178
|
+
throw new factory.errors.NotFound('MemberProgram', `MemberProgram '${memberProgramIdentifierMustBe}' not found`);
|
|
154
179
|
}
|
|
155
180
|
const issuer = yield repos.issuer.findByIdentifier({
|
|
156
181
|
project: { id: params.event.project.id },
|
|
@@ -165,8 +190,8 @@ function validateEventOfferPeriod(params) {
|
|
|
165
190
|
token: validForMemberTierToken
|
|
166
191
|
});
|
|
167
192
|
yield validateMemberTier({
|
|
168
|
-
event,
|
|
169
|
-
memberProgramIdentifierMustBe
|
|
193
|
+
event, acceptedDate, verifiedValidForMemberTier,
|
|
194
|
+
memberProgramIdentifierMustBe, aggregateOfferIdentifier
|
|
170
195
|
})(repos);
|
|
171
196
|
}
|
|
172
197
|
});
|
|
@@ -8,7 +8,7 @@ declare function createReserveTransactionStartParams(params: {
|
|
|
8
8
|
event: {
|
|
9
9
|
id: string;
|
|
10
10
|
offers?: {
|
|
11
|
-
validForMemberTier?:
|
|
11
|
+
validForMemberTier?: factory.assetTransaction.reserve.ITokenizedMemberProgramTier;
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
broker?: factory.reservation.IBroker<factory.reservationType>;
|
|
@@ -16,7 +16,7 @@ declare function createReserveTransactionStartParams(params: {
|
|
|
16
16
|
transactionNumber: string;
|
|
17
17
|
}): factory.assetTransaction.reserve.IStartParamsWithoutDetail;
|
|
18
18
|
declare function createAuthorizeSeatReservationActionAttributes(params: {
|
|
19
|
-
event: Pick<IMinimizedIndividualEvent
|
|
19
|
+
event: Pick<IMinimizedIndividualEvent, 'id'>;
|
|
20
20
|
instrument: {
|
|
21
21
|
/**
|
|
22
22
|
* 予約取引番号
|
|
@@ -48,8 +48,8 @@ function createReserveTransactionStartParams(params) {
|
|
|
48
48
|
// }
|
|
49
49
|
// ]
|
|
50
50
|
};
|
|
51
|
-
const
|
|
52
|
-
const object = Object.assign({ acceptedOffer: acceptedTicketOffersWithoutDetail, reservationFor: Object.assign({ id: params.event.id }, (typeof
|
|
51
|
+
const validForMemberTier = (_b = params.event.offers) === null || _b === void 0 ? void 0 : _b.validForMemberTier;
|
|
52
|
+
const object = Object.assign({ acceptedOffer: acceptedTicketOffersWithoutDetail, reservationFor: Object.assign({ id: params.event.id }, (typeof (validForMemberTier === null || validForMemberTier === void 0 ? void 0 : validForMemberTier.token) === 'string') ? { offers: { validForMemberTier } } : undefined) }, (params.broker !== undefined) ? { broker: params.broker } : undefined);
|
|
53
53
|
return {
|
|
54
54
|
project: { typeOf: factory.organizationType.Project, id: params.project.id },
|
|
55
55
|
typeOf: factory.assetTransactionType.Reserve,
|
|
@@ -8,7 +8,6 @@ import type { EventRepo, IMinimizedIndividualEvent } from '../../../../repo/even
|
|
|
8
8
|
import { EventSeriesRepo } from '../../../../repo/eventSeries';
|
|
9
9
|
import type { IssuerRepo } from '../../../../repo/issuer';
|
|
10
10
|
import type { MemberProgramRepo } from '../../../../repo/memberProgram';
|
|
11
|
-
import type { EventOfferRepo } from '../../../../repo/offer/event';
|
|
12
11
|
import type { OfferRepo } from '../../../../repo/offer/unitPriceInCatalog';
|
|
13
12
|
import type { OfferCatalogRepo } from '../../../../repo/offerCatalog';
|
|
14
13
|
import type { OfferCatalogItemRepo } from '../../../../repo/offerCatalogItem';
|
|
@@ -26,9 +25,9 @@ import type { TicketRepo } from '../../../../repo/ticket';
|
|
|
26
25
|
import { IResultAcceptedOffer } from './factory';
|
|
27
26
|
declare function processStartReserve4chevre(params: {
|
|
28
27
|
acceptedOffers: factory.assetTransaction.reserve.IAcceptedTicketOfferWithoutDetail[];
|
|
29
|
-
event: Pick<IMinimizedIndividualEvent
|
|
28
|
+
event: Pick<IMinimizedIndividualEvent, 'id'> & {
|
|
30
29
|
offers?: {
|
|
31
|
-
validForMemberTier?:
|
|
30
|
+
validForMemberTier?: factory.assetTransaction.reserve.ITokenizedMemberProgramTier;
|
|
32
31
|
};
|
|
33
32
|
};
|
|
34
33
|
broker?: factory.reservation.IBroker<factory.reservationType>;
|
|
@@ -53,7 +52,6 @@ declare function processStartReserve4chevre(params: {
|
|
|
53
52
|
authorization: AuthorizationRepo;
|
|
54
53
|
stockHolder: StockHolderRepo;
|
|
55
54
|
event: EventRepo;
|
|
56
|
-
eventOffer: EventOfferRepo;
|
|
57
55
|
eventSeries: EventSeriesRepo;
|
|
58
56
|
issuer: IssuerRepo;
|
|
59
57
|
memberProgram: MemberProgramRepo;
|
|
@@ -20,13 +20,13 @@ function processStartReserve4chevre(params, options) {
|
|
|
20
20
|
// jwt: JWTCredentials;
|
|
21
21
|
// }
|
|
22
22
|
) => __awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
var _a;
|
|
23
|
+
var _a, _b;
|
|
24
24
|
const { event, transaction, transactionNumber } = params;
|
|
25
25
|
let acceptedOffers4result = [];
|
|
26
26
|
// 予約取引開始
|
|
27
27
|
const startParams = (0, factory_1.createReserveTransactionStartParams)(Object.assign({ project: transaction.project,
|
|
28
28
|
// object: <IObjectWithDetail>action.object,
|
|
29
|
-
acceptedOffers: params.acceptedOffers, event: Object.assign({ id: event.id }, (typeof ((_a = event.offers) === null || _a === void 0 ? void 0 : _a.validForMemberTier) === 'string')
|
|
29
|
+
acceptedOffers: params.acceptedOffers, event: Object.assign({ id: event.id }, (typeof ((_b = (_a = event.offers) === null || _a === void 0 ? void 0 : _a.validForMemberTier) === null || _b === void 0 ? void 0 : _b.token) === 'string')
|
|
30
30
|
? { offers: { validForMemberTier: event.offers.validForMemberTier } }
|
|
31
31
|
: undefined), transaction,
|
|
32
32
|
transactionNumber }, (params.broker !== undefined) ? { broker: params.broker } : undefined));
|
|
@@ -8,7 +8,6 @@ import type { EventRepo } from '../../../repo/event';
|
|
|
8
8
|
import { EventSeriesRepo } from '../../../repo/eventSeries';
|
|
9
9
|
import type { IssuerRepo } from '../../../repo/issuer';
|
|
10
10
|
import type { MemberProgramRepo } from '../../../repo/memberProgram';
|
|
11
|
-
import type { EventOfferRepo } from '../../../repo/offer/event';
|
|
12
11
|
import type { OfferRepo } from '../../../repo/offer/unitPriceInCatalog';
|
|
13
12
|
import type { OfferCatalogRepo } from '../../../repo/offerCatalog';
|
|
14
13
|
import type { OfferCatalogItemRepo } from '../../../repo/offerCatalogItem';
|
|
@@ -33,7 +32,6 @@ interface IAuthorizeRepos {
|
|
|
33
32
|
assetTransaction: AssetTransactionRepo;
|
|
34
33
|
authorization: AuthorizationRepo;
|
|
35
34
|
event: EventRepo;
|
|
36
|
-
eventOffer: EventOfferRepo;
|
|
37
35
|
eventSeries: EventSeriesRepo;
|
|
38
36
|
issuer: IssuerRepo;
|
|
39
37
|
memberProgram: MemberProgramRepo;
|
|
@@ -99,8 +99,8 @@ function validateCreateRequest(params) {
|
|
|
99
99
|
throw new factory.errors.ArgumentNull('object.reservationFor.id');
|
|
100
100
|
}
|
|
101
101
|
// support validForMemberTier(2025-05-14~)
|
|
102
|
-
const
|
|
103
|
-
const event = Object.assign({ id: params.object.reservationFor.id, typeOf: factory.eventType.ScreeningEvent }, (typeof
|
|
102
|
+
const validForMemberTier = (_c = params.object.reservationFor.offers) === null || _c === void 0 ? void 0 : _c.validForMemberTier;
|
|
103
|
+
const event = Object.assign({ id: params.object.reservationFor.id, typeOf: factory.eventType.ScreeningEvent }, (typeof (validForMemberTier === null || validForMemberTier === void 0 ? void 0 : validForMemberTier.token) === 'string') ? { offers: { validForMemberTier } } : undefined);
|
|
104
104
|
return { transaction, event };
|
|
105
105
|
});
|
|
106
106
|
}
|
|
@@ -2,7 +2,7 @@ import type { IMinimizedIndividualEvent } from '../../../repo/event';
|
|
|
2
2
|
import type { OfferRateLimitRepo } from '../../../repo/rateLimit/offer';
|
|
3
3
|
import * as factory from '../../../factory';
|
|
4
4
|
declare function checkAvailability(params: {
|
|
5
|
-
event: Pick<IMinimizedIndividualEvent
|
|
5
|
+
event: Pick<IMinimizedIndividualEvent, 'startDate' | 'project'>;
|
|
6
6
|
unitPriceOffer: factory.unitPriceOffer.IUnitPriceOffer;
|
|
7
7
|
}): (repos: {
|
|
8
8
|
offerRateLimit: OfferRateLimitRepo;
|
|
@@ -32,7 +32,7 @@ export declare function responseBody2acceptedOffers4result(params: {
|
|
|
32
32
|
};
|
|
33
33
|
responseBody: IResponseBody;
|
|
34
34
|
acceptedOffer: IAcceptedOffer4COA[];
|
|
35
|
-
event: Pick<IMinimizedIndividualEvent
|
|
35
|
+
event: Pick<IMinimizedIndividualEvent, 'coaInfo' | 'doorTime' | 'endDate' | 'id' | 'location' | 'startDate' | 'superEvent' | 'typeOf' | 'identifier' | 'name'>;
|
|
36
36
|
seller: Pick<factory.transaction.placeOrder.ISeller, 'typeOf' | 'name'>;
|
|
37
37
|
bookingTime: Date;
|
|
38
38
|
totalPrice: number;
|
|
@@ -52,7 +52,7 @@ function onEventChanged(params) {
|
|
|
52
52
|
// no op
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
if (params.typeOf === factory.eventType.
|
|
55
|
+
if (params.typeOf === factory.eventType.ScreeningEvent) {
|
|
56
56
|
if (repos.pendingReservation !== undefined) {
|
|
57
57
|
// sync pendingReservations.expires(2025-05-08~)
|
|
58
58
|
yield syncEventEndDate2pendingReservations({
|
|
@@ -105,24 +105,7 @@ function createInformTasks(params, setting) {
|
|
|
105
105
|
let events4inform;
|
|
106
106
|
// const informEvents = settings.onEventChanged.informEvent;
|
|
107
107
|
const informEvents = (_a = setting === null || setting === void 0 ? void 0 : setting.onResourceUpdated) === null || _a === void 0 ? void 0 : _a.informResource;
|
|
108
|
-
if (params.typeOf === factory.eventType.
|
|
109
|
-
const eventsFromDB = yield repos.event.projectEventFields({
|
|
110
|
-
id: { $in: params.ids },
|
|
111
|
-
typeOf: params.typeOf
|
|
112
|
-
}, [
|
|
113
|
-
'project', 'organizer', 'typeOf', 'name', 'doorTime', 'endDate',
|
|
114
|
-
'eventStatus', 'location', 'startDate', 'additionalProperty'
|
|
115
|
-
] // inclusion(2024-07-30~)
|
|
116
|
-
);
|
|
117
|
-
// 最適化(2024-03-26~)
|
|
118
|
-
events4inform = eventsFromDB.map(({ project, organizer, typeOf, name, doorTime, endDate, eventStatus, location, startDate, id, additionalProperty }) => {
|
|
119
|
-
return {
|
|
120
|
-
project, organizer, typeOf, name, doorTime, endDate,
|
|
121
|
-
eventStatus, location, startDate, id, additionalProperty
|
|
122
|
-
};
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
else if (params.typeOf === factory.eventType.ScreeningEvent) {
|
|
108
|
+
if (params.typeOf === factory.eventType.ScreeningEvent) {
|
|
126
109
|
const screeningEvents4inform = yield repos.event.projectEventFields({
|
|
127
110
|
id: { $in: params.ids },
|
|
128
111
|
typeOf: params.typeOf
|