@chevre/domain 22.14.0-alpha.8 → 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 +3 -2
- 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
|
@@ -2,16 +2,14 @@ import type { BulkWriteResult } from 'mongodb';
|
|
|
2
2
|
import type { Connection, Document, FilterQuery } from 'mongoose';
|
|
3
3
|
import * as factory from '../factory';
|
|
4
4
|
import * as EventFactory from '../factory/event';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export interface IAttributes4patchUpdate<T extends AvailableEventType> {
|
|
8
|
-
typeOf: T;
|
|
5
|
+
export interface IAttributes4patchUpdate {
|
|
6
|
+
typeOf: factory.eventType.ScreeningEvent;
|
|
9
7
|
eventStatus?: factory.eventStatusType;
|
|
10
8
|
}
|
|
11
9
|
export interface IUpdateAggregateReservationParams {
|
|
12
10
|
$set: {
|
|
13
|
-
aggregateReservation: factory.event.
|
|
14
|
-
aggregateOffer?: Pick<factory.event.
|
|
11
|
+
aggregateReservation: factory.event.screeningEvent.IAggregateReservation;
|
|
12
|
+
aggregateOffer?: Pick<factory.event.screeningEvent.IAggregateOffer, 'aggregateDate' | 'offerCount' | 'typeOf'>;
|
|
15
13
|
maximumAttendeeCapacity?: number;
|
|
16
14
|
remainingAttendeeCapacity?: number;
|
|
17
15
|
checkInCount?: number;
|
|
@@ -23,7 +21,7 @@ export interface IUpdateAggregateReservationParams {
|
|
|
23
21
|
remainingAttendeeCapacity?: '';
|
|
24
22
|
};
|
|
25
23
|
}
|
|
26
|
-
export type ISearchConditions
|
|
24
|
+
export type ISearchConditions = factory.event.ISearchConditions<factory.eventType.ScreeningEvent>;
|
|
27
25
|
interface IAggregationByStatus {
|
|
28
26
|
eventCount: number;
|
|
29
27
|
reservationCount: number;
|
|
@@ -46,15 +44,15 @@ interface IAggregateEvent {
|
|
|
46
44
|
statuses: IStatus[];
|
|
47
45
|
}
|
|
48
46
|
export import IMinimizedIndividualEvent = EventFactory.IMinimizedIndividualEvent;
|
|
49
|
-
type IKeyOfProjection
|
|
50
|
-
type IKeyOfProjection4publicFields
|
|
47
|
+
type IKeyOfProjection = Exclude<keyof factory.event.IEvent<factory.eventType.ScreeningEvent>, 'id'> | 'aggregateOffer' | 'superEvent.location.id' | 'offers.itemOffered' | 'offers.itemOffered.id';
|
|
48
|
+
type IKeyOfProjection4publicFields = Exclude<keyof factory.event.IEvent<factory.eventType.ScreeningEvent>, 'id' | 'offers'>;
|
|
51
49
|
/**
|
|
52
50
|
* minimizedEvent検索時のprojection候補
|
|
53
51
|
* add(2024-07-18~)
|
|
54
52
|
*/
|
|
55
|
-
type IKeyOfProjection4minimizedEvent
|
|
56
|
-
type IUnset
|
|
57
|
-
[key in keyof factory.event.IEvent<
|
|
53
|
+
type IKeyOfProjection4minimizedEvent = Exclude<keyof IMinimizedIndividualEvent, 'additionalProperty' | 'id'> | 'superEvent.id' | 'location.branchCode' | 'superEvent.workPerformed.identifier' | 'superEvent.location.id' | 'offers.itemOffered' | 'offers.itemOffered.id' | 'offers.offeredThrough' | 'offers.unacceptedPaymentMethod' | 'offers.eligibleQuantity';
|
|
54
|
+
type IUnset = {
|
|
55
|
+
[key in keyof factory.event.IEvent<factory.eventType.ScreeningEvent>]?: 1;
|
|
58
56
|
};
|
|
59
57
|
export type ICreatingEvent4ttts = Pick<factory.event.IAttributes<factory.eventType.ScreeningEvent>, 'additionalProperty' | 'doorTime' | 'endDate' | 'eventStatus' | 'location' | 'name' | 'offers' | 'organizer' | 'project' | 'startDate' | 'superEvent' | 'typeOf'> & {
|
|
60
58
|
identifier: string;
|
|
@@ -65,12 +63,12 @@ export type ICreatingEvent4ttts = Pick<factory.event.IAttributes<factory.eventTy
|
|
|
65
63
|
export declare class EventRepo {
|
|
66
64
|
private readonly eventModel;
|
|
67
65
|
constructor(connection: Connection);
|
|
68
|
-
static CREATE_MONGO_CONDITIONS
|
|
66
|
+
static CREATE_MONGO_CONDITIONS(conditions: ISearchConditions): FilterQuery<factory.event.IEvent<factory.eventType.ScreeningEvent>>[];
|
|
69
67
|
/**
|
|
70
68
|
* 複数イベントを作成する
|
|
71
69
|
*/
|
|
72
|
-
createManyEvents
|
|
73
|
-
attributes: factory.event.IAttributes<
|
|
70
|
+
createManyEvents(params: {
|
|
71
|
+
attributes: factory.event.IAttributes<factory.eventType.ScreeningEvent>[];
|
|
74
72
|
expectsNoContent: boolean;
|
|
75
73
|
}): Promise<string[] | void>;
|
|
76
74
|
/**
|
|
@@ -114,7 +112,7 @@ export declare class EventRepo {
|
|
|
114
112
|
$set: factory.event.screeningEvent.IAttributes & {
|
|
115
113
|
id?: never;
|
|
116
114
|
};
|
|
117
|
-
$unset: IUnset
|
|
115
|
+
$unset: IUnset;
|
|
118
116
|
}[], options: {
|
|
119
117
|
/**
|
|
120
118
|
* falseの場合setOnInsertのみ
|
|
@@ -130,23 +128,23 @@ export declare class EventRepo {
|
|
|
130
128
|
/**
|
|
131
129
|
* イベント部分更新
|
|
132
130
|
*/
|
|
133
|
-
updatePartiallyById
|
|
131
|
+
updatePartiallyById(params: {
|
|
134
132
|
project: {
|
|
135
133
|
id: string;
|
|
136
134
|
};
|
|
137
135
|
id: string;
|
|
138
|
-
attributes: IAttributes4patchUpdate
|
|
136
|
+
attributes: IAttributes4patchUpdate;
|
|
139
137
|
}): Promise<void>;
|
|
140
138
|
/**
|
|
141
139
|
* イベントを保管する
|
|
142
140
|
*/
|
|
143
|
-
saveEvent
|
|
141
|
+
saveEvent(params: {
|
|
144
142
|
id?: string;
|
|
145
|
-
attributes: factory.event.IAttributes<
|
|
143
|
+
attributes: factory.event.IAttributes<factory.eventType.ScreeningEvent>;
|
|
146
144
|
/**
|
|
147
145
|
* ドキュメント作成時には無視される
|
|
148
146
|
*/
|
|
149
|
-
$unset?: IUnset
|
|
147
|
+
$unset?: IUnset;
|
|
150
148
|
upsert: false;
|
|
151
149
|
}): Promise<{
|
|
152
150
|
id: string;
|
|
@@ -157,7 +155,7 @@ export declare class EventRepo {
|
|
|
157
155
|
saveManyEvents(params: {
|
|
158
156
|
id: string;
|
|
159
157
|
attributes: factory.event.IAttributes<factory.eventType.ScreeningEvent>;
|
|
160
|
-
$unset?: IUnset
|
|
158
|
+
$unset?: IUnset;
|
|
161
159
|
upsert: boolean;
|
|
162
160
|
}[]): Promise<void>;
|
|
163
161
|
/**
|
|
@@ -171,11 +169,11 @@ export declare class EventRepo {
|
|
|
171
169
|
/**
|
|
172
170
|
* イベントを検索する(inclusion projection)
|
|
173
171
|
*/
|
|
174
|
-
projectEventFields
|
|
172
|
+
projectEventFields(params: ISearchConditions, inclusion: IKeyOfProjection[]): Promise<Omit<factory.event.IEvent<factory.eventType.ScreeningEvent>, 'aggregateOffer'>[]>;
|
|
175
173
|
/**
|
|
176
174
|
* apiで公開属性を検索する(2024-10-13~)
|
|
177
175
|
*/
|
|
178
|
-
aggregatePublicFields
|
|
176
|
+
aggregatePublicFields(params: ISearchConditions, inclusion: IKeyOfProjection4publicFields[], options: {
|
|
179
177
|
/**
|
|
180
178
|
* offersを属性をprojectするかどうか
|
|
181
179
|
*/
|
|
@@ -188,12 +186,12 @@ export declare class EventRepo {
|
|
|
188
186
|
* offers.seller.makesOfferをavailableAtOrFromでfilterする
|
|
189
187
|
*/
|
|
190
188
|
sellerMakesOfferAvailableAtIn?: string[];
|
|
191
|
-
}): Promise<Omit<factory.event.IEvent<
|
|
189
|
+
}): Promise<Omit<factory.event.IEvent<factory.eventType.ScreeningEvent>, 'aggregateOffer'>[]>;
|
|
192
190
|
/**
|
|
193
191
|
* IDのみで検索する
|
|
194
192
|
* projectionなし
|
|
195
193
|
*/
|
|
196
|
-
findAnyEventById
|
|
194
|
+
findAnyEventById(params: {
|
|
197
195
|
id: {
|
|
198
196
|
$eq: string;
|
|
199
197
|
};
|
|
@@ -207,15 +205,15 @@ export declare class EventRepo {
|
|
|
207
205
|
$eq: string;
|
|
208
206
|
};
|
|
209
207
|
};
|
|
210
|
-
}): Promise<Omit<factory.event.IEvent<
|
|
211
|
-
searchEventIds
|
|
208
|
+
}): Promise<Omit<factory.event.IEvent<factory.eventType.ScreeningEvent>, 'aggregateOffer'>>;
|
|
209
|
+
searchEventIds(params: ISearchConditions): Promise<string[]>;
|
|
212
210
|
/**
|
|
213
211
|
* 特定イベントから指定フィールドのみ取得する
|
|
214
212
|
* イベント IDは必ず返ります
|
|
215
213
|
*/
|
|
216
|
-
projectEventFieldsById
|
|
214
|
+
projectEventFieldsById(params: {
|
|
217
215
|
id: string;
|
|
218
|
-
}, inclusion: IKeyOfProjection4minimizedEvent
|
|
216
|
+
}, inclusion: IKeyOfProjection4minimizedEvent[]): Promise<IMinimizedIndividualEvent>;
|
|
219
217
|
/**
|
|
220
218
|
* イベントをキャンセルする
|
|
221
219
|
*/
|
|
@@ -232,7 +230,7 @@ export declare class EventRepo {
|
|
|
232
230
|
project: {
|
|
233
231
|
id: string;
|
|
234
232
|
};
|
|
235
|
-
superEventFromDB: Pick<factory.
|
|
233
|
+
superEventFromDB: Pick<factory.eventSeries.IEvent, 'additionalProperty' | 'alternativeHeadline' | 'description' | 'dubLanguage' | 'endDate' | 'headline' | 'id' | 'kanaName' | 'location' | 'name' | 'soundFormat' | 'startDate' | 'subtitleLanguage' | 'typeOf' | 'videoFormat' | 'workPerformed'>;
|
|
236
234
|
startDate: {
|
|
237
235
|
$gte: Date;
|
|
238
236
|
};
|
|
@@ -303,7 +301,7 @@ export declare class EventRepo {
|
|
|
303
301
|
}): Promise<import("mongodb").DeleteResult>;
|
|
304
302
|
deleteManyEventsEndedByProject(params: {
|
|
305
303
|
typeOf: {
|
|
306
|
-
$in:
|
|
304
|
+
$in: factory.eventType.ScreeningEvent[];
|
|
307
305
|
};
|
|
308
306
|
project: {
|
|
309
307
|
id: string;
|
|
@@ -314,7 +312,7 @@ export declare class EventRepo {
|
|
|
314
312
|
}): Promise<import("mongodb").DeleteResult>;
|
|
315
313
|
deleteManyEventsEnded(params: {
|
|
316
314
|
typeOf: {
|
|
317
|
-
$eq:
|
|
315
|
+
$eq: factory.eventType.ScreeningEvent;
|
|
318
316
|
};
|
|
319
317
|
endDate: {
|
|
320
318
|
$lte: Date;
|
|
@@ -336,25 +334,23 @@ export declare class EventRepo {
|
|
|
336
334
|
validationErrors: import("mongoose").Error[];
|
|
337
335
|
} | undefined;
|
|
338
336
|
}>;
|
|
339
|
-
getCursor(conditions: FilterQuery<any>, projection: any): import("mongoose").Cursor<Document<unknown, {},
|
|
340
|
-
_id: string;
|
|
341
|
-
} & Required<{
|
|
337
|
+
getCursor(conditions: FilterQuery<any>, projection: any): import("mongoose").Cursor<Document<unknown, {}, import("@chevre/factory/lib/event/screeningEvent").IAttributes & {
|
|
342
338
|
_id: string;
|
|
343
|
-
|
|
339
|
+
aggregateOffer?: factory.event.screeningEvent.IAggregateOffer;
|
|
340
|
+
}> & import("@chevre/factory/lib/event/screeningEvent").IAttributes & {
|
|
344
341
|
_id: string;
|
|
345
|
-
aggregateOffer?: factory.event.
|
|
342
|
+
aggregateOffer?: factory.event.screeningEvent.IAggregateOffer;
|
|
346
343
|
} & Required<{
|
|
347
344
|
_id: string;
|
|
348
|
-
}
|
|
349
|
-
_id: string;
|
|
350
|
-
} & Required<{
|
|
345
|
+
}>, import("mongoose").QueryOptions<Document<unknown, {}, import("@chevre/factory/lib/event/screeningEvent").IAttributes & {
|
|
351
346
|
_id: string;
|
|
352
|
-
|
|
347
|
+
aggregateOffer?: factory.event.screeningEvent.IAggregateOffer;
|
|
348
|
+
}> & import("@chevre/factory/lib/event/screeningEvent").IAttributes & {
|
|
353
349
|
_id: string;
|
|
354
|
-
aggregateOffer?: factory.event.
|
|
350
|
+
aggregateOffer?: factory.event.screeningEvent.IAggregateOffer;
|
|
355
351
|
} & Required<{
|
|
356
352
|
_id: string;
|
|
357
|
-
}
|
|
353
|
+
}>>>;
|
|
358
354
|
addAvailableAtOrFrom(params: {
|
|
359
355
|
id: string;
|
|
360
356
|
offers: {
|
|
@@ -363,9 +359,9 @@ export declare class EventRepo {
|
|
|
363
359
|
};
|
|
364
360
|
};
|
|
365
361
|
}): Promise<void>;
|
|
366
|
-
unsetUnnecessaryFields
|
|
367
|
-
filter: FilterQuery<factory.event.IEvent<
|
|
368
|
-
$unset: IUnset
|
|
362
|
+
unsetUnnecessaryFields(params: {
|
|
363
|
+
filter: FilterQuery<factory.event.IEvent<factory.eventType.ScreeningEvent>>;
|
|
364
|
+
$unset: IUnset;
|
|
369
365
|
}): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
370
366
|
aggregateEvent(params: {
|
|
371
367
|
project?: {
|
|
@@ -375,7 +371,7 @@ export declare class EventRepo {
|
|
|
375
371
|
};
|
|
376
372
|
startFrom: Date;
|
|
377
373
|
startThrough: Date;
|
|
378
|
-
typeOf:
|
|
374
|
+
typeOf: factory.eventType.ScreeningEvent;
|
|
379
375
|
}): Promise<IAggregateEvent>;
|
|
380
376
|
private agggregateByStatus;
|
|
381
377
|
}
|
package/lib/chevre/repo/event.js
CHANGED
|
@@ -43,7 +43,7 @@ class EventRepo {
|
|
|
43
43
|
}
|
|
44
44
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
45
45
|
static CREATE_MONGO_CONDITIONS(conditions) {
|
|
46
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4
|
|
46
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
|
|
47
47
|
const andConditions = [];
|
|
48
48
|
const typeOfEq = conditions.typeOf;
|
|
49
49
|
if (typeof typeOfEq === 'string') {
|
|
@@ -145,98 +145,6 @@ class EventRepo {
|
|
|
145
145
|
}
|
|
146
146
|
let params;
|
|
147
147
|
switch (conditions.typeOf) {
|
|
148
|
-
case factory.eventType.Event:
|
|
149
|
-
params = conditions;
|
|
150
|
-
// tslint:disable-next-line:no-single-line-block-comment
|
|
151
|
-
/* istanbul ignore else */
|
|
152
|
-
if (params.offers !== undefined) {
|
|
153
|
-
const itemOfferedIdIn4event = (_o = (_m = params.offers.itemOffered) === null || _m === void 0 ? void 0 : _m.id) === null || _o === void 0 ? void 0 : _o.$in;
|
|
154
|
-
if (Array.isArray(itemOfferedIdIn4event)) {
|
|
155
|
-
andConditions.push({
|
|
156
|
-
'offers.itemOffered.id': {
|
|
157
|
-
$exists: true,
|
|
158
|
-
$in: itemOfferedIdIn4event
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
// tslint:disable-next-line:no-single-line-block-comment
|
|
163
|
-
/* istanbul ignore else */
|
|
164
|
-
if (params.offers.itemOffered !== undefined) {
|
|
165
|
-
// tslint:disable-next-line:no-single-line-block-comment
|
|
166
|
-
/* istanbul ignore else */
|
|
167
|
-
if (params.offers.itemOffered.serviceOutput !== undefined) {
|
|
168
|
-
// tslint:disable-next-line:no-single-line-block-comment
|
|
169
|
-
/* istanbul ignore else */
|
|
170
|
-
if (params.offers.itemOffered.serviceOutput.reservedTicket !== undefined) {
|
|
171
|
-
// tslint:disable-next-line:no-single-line-block-comment
|
|
172
|
-
/* istanbul ignore else */
|
|
173
|
-
if (params.offers.itemOffered.serviceOutput.reservedTicket.ticketedSeat !== undefined) {
|
|
174
|
-
// tslint:disable-next-line:no-single-line-block-comment
|
|
175
|
-
/* istanbul ignore else */
|
|
176
|
-
if (Array.isArray(params.offers.itemOffered.serviceOutput.reservedTicket.ticketedSeat.typeOfs)) {
|
|
177
|
-
andConditions.push({
|
|
178
|
-
'offers.itemOffered.serviceOutput.reservedTicket.ticketedSeat.typeOf': {
|
|
179
|
-
$exists: true,
|
|
180
|
-
$in: params.offers.itemOffered.serviceOutput.reservedTicket.ticketedSeat.typeOfs
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
// tslint:disable-next-line:no-single-line-block-comment
|
|
188
|
-
/* istanbul ignore else */
|
|
189
|
-
if (params.offers.itemOffered.serviceType !== undefined) {
|
|
190
|
-
// tslint:disable-next-line:no-single-line-block-comment
|
|
191
|
-
/* istanbul ignore else */
|
|
192
|
-
if (Array.isArray(params.offers.itemOffered.serviceType.ids)) {
|
|
193
|
-
andConditions.push({
|
|
194
|
-
'offers.itemOffered.serviceType.id': {
|
|
195
|
-
$exists: true,
|
|
196
|
-
$in: params.offers.itemOffered.serviceType.ids
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
const sellerMakesOfferElemMatch4event = (_r = (_q = (_p = params.offers) === null || _p === void 0 ? void 0 : _p.seller) === null || _q === void 0 ? void 0 : _q.makesOffer) === null || _r === void 0 ? void 0 : _r.$elemMatch;
|
|
204
|
-
if (typeof ((_s = sellerMakesOfferElemMatch4event === null || sellerMakesOfferElemMatch4event === void 0 ? void 0 : sellerMakesOfferElemMatch4event['availableAtOrFrom.id']) === null || _s === void 0 ? void 0 : _s.$eq) === 'string') {
|
|
205
|
-
andConditions.push({
|
|
206
|
-
'offers.seller.makesOffer': {
|
|
207
|
-
$exists: true,
|
|
208
|
-
$elemMatch: sellerMakesOfferElemMatch4event
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
const reservationForIdentifierEq = (_x = (_w = (_v = (_u = (_t = params.offers) === null || _t === void 0 ? void 0 : _t.itemOffered) === null || _u === void 0 ? void 0 : _u.serviceOutput) === null || _v === void 0 ? void 0 : _v.reservationFor) === null || _w === void 0 ? void 0 : _w.identifier) === null || _x === void 0 ? void 0 : _x.$eq;
|
|
213
|
-
if (typeof reservationForIdentifierEq === 'string') {
|
|
214
|
-
andConditions.push({
|
|
215
|
-
'offers.itemOffered.serviceOutput.reservationFor.identifier': {
|
|
216
|
-
$exists: true,
|
|
217
|
-
$eq: reservationForIdentifierEq
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
const reservationForArrivalBusStopBranchCodeEq = (_3 = (_2 = (_1 = (_0 = (_z = (_y = params.offers) === null || _y === void 0 ? void 0 : _y.itemOffered) === null || _z === void 0 ? void 0 : _z.serviceOutput) === null || _0 === void 0 ? void 0 : _0.reservationFor) === null || _1 === void 0 ? void 0 : _1.arrivalBusStop) === null || _2 === void 0 ? void 0 : _2.branchCode) === null || _3 === void 0 ? void 0 : _3.$eq;
|
|
222
|
-
if (typeof reservationForArrivalBusStopBranchCodeEq === 'string') {
|
|
223
|
-
andConditions.push({
|
|
224
|
-
'offers.itemOffered.serviceOutput.reservationFor.arrivalBusStop.branchCode': {
|
|
225
|
-
$exists: true,
|
|
226
|
-
$eq: reservationForArrivalBusStopBranchCodeEq
|
|
227
|
-
}
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
const reservationForDepartureBusStopBranchCodeEq = (_9 = (_8 = (_7 = (_6 = (_5 = (_4 = params.offers) === null || _4 === void 0 ? void 0 : _4.itemOffered) === null || _5 === void 0 ? void 0 : _5.serviceOutput) === null || _6 === void 0 ? void 0 : _6.reservationFor) === null || _7 === void 0 ? void 0 : _7.departureBusStop) === null || _8 === void 0 ? void 0 : _8.branchCode) === null || _9 === void 0 ? void 0 : _9.$eq;
|
|
231
|
-
if (typeof reservationForDepartureBusStopBranchCodeEq === 'string') {
|
|
232
|
-
andConditions.push({
|
|
233
|
-
'offers.itemOffered.serviceOutput.reservationFor.departureBusStop.branchCode': {
|
|
234
|
-
$exists: true,
|
|
235
|
-
$eq: reservationForDepartureBusStopBranchCodeEq
|
|
236
|
-
}
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
break;
|
|
240
148
|
case factory.eventType.ScreeningEvent:
|
|
241
149
|
params = conditions;
|
|
242
150
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
@@ -261,7 +169,7 @@ class EventRepo {
|
|
|
261
169
|
}
|
|
262
170
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
263
171
|
/* istanbul ignore else */
|
|
264
|
-
const superEventLocationIdEq = (
|
|
172
|
+
const superEventLocationIdEq = (_p = (_o = (_m = params.superEvent) === null || _m === void 0 ? void 0 : _m.location) === null || _o === void 0 ? void 0 : _o.id) === null || _p === void 0 ? void 0 : _p.$eq;
|
|
265
173
|
if (typeof superEventLocationIdEq === 'string') {
|
|
266
174
|
andConditions.push({
|
|
267
175
|
'superEvent.location.id': {
|
|
@@ -304,7 +212,7 @@ class EventRepo {
|
|
|
304
212
|
});
|
|
305
213
|
}
|
|
306
214
|
}
|
|
307
|
-
const itemOfferedIdIn = (
|
|
215
|
+
const itemOfferedIdIn = (_s = (_r = (_q = params.offers) === null || _q === void 0 ? void 0 : _q.itemOffered) === null || _r === void 0 ? void 0 : _r.id) === null || _s === void 0 ? void 0 : _s.$in;
|
|
308
216
|
if (Array.isArray(itemOfferedIdIn)) {
|
|
309
217
|
andConditions.push({
|
|
310
218
|
'offers.itemOffered.id': {
|
|
@@ -313,7 +221,7 @@ class EventRepo {
|
|
|
313
221
|
}
|
|
314
222
|
});
|
|
315
223
|
}
|
|
316
|
-
const itemOfferedTicketedSeatTypeOfIn = (
|
|
224
|
+
const itemOfferedTicketedSeatTypeOfIn = (_x = (_w = (_v = (_u = (_t = params.offers) === null || _t === void 0 ? void 0 : _t.itemOffered) === null || _u === void 0 ? void 0 : _u.serviceOutput) === null || _v === void 0 ? void 0 : _v.reservedTicket) === null || _w === void 0 ? void 0 : _w.ticketedSeat) === null || _x === void 0 ? void 0 : _x.typeOfs;
|
|
317
225
|
if (Array.isArray(itemOfferedTicketedSeatTypeOfIn)) {
|
|
318
226
|
andConditions.push({
|
|
319
227
|
'offers.itemOffered.serviceOutput.reservedTicket.ticketedSeat.typeOf': {
|
|
@@ -322,7 +230,7 @@ class EventRepo {
|
|
|
322
230
|
}
|
|
323
231
|
});
|
|
324
232
|
}
|
|
325
|
-
const itemOfferedServiceTypeIdIn = (
|
|
233
|
+
const itemOfferedServiceTypeIdIn = (_0 = (_z = (_y = params.offers) === null || _y === void 0 ? void 0 : _y.itemOffered) === null || _z === void 0 ? void 0 : _z.serviceType) === null || _0 === void 0 ? void 0 : _0.ids;
|
|
326
234
|
if (Array.isArray(itemOfferedServiceTypeIdIn)) {
|
|
327
235
|
andConditions.push({
|
|
328
236
|
'offers.itemOffered.serviceType.id': {
|
|
@@ -331,8 +239,8 @@ class EventRepo {
|
|
|
331
239
|
}
|
|
332
240
|
});
|
|
333
241
|
}
|
|
334
|
-
const sellerMakesOfferElemMatch = (
|
|
335
|
-
if (typeof ((
|
|
242
|
+
const sellerMakesOfferElemMatch = (_3 = (_2 = (_1 = params.offers) === null || _1 === void 0 ? void 0 : _1.seller) === null || _2 === void 0 ? void 0 : _2.makesOffer) === null || _3 === void 0 ? void 0 : _3.$elemMatch;
|
|
243
|
+
if (typeof ((_4 = sellerMakesOfferElemMatch === null || sellerMakesOfferElemMatch === void 0 ? void 0 : sellerMakesOfferElemMatch['availableAtOrFrom.id']) === null || _4 === void 0 ? void 0 : _4.$eq) === 'string') {
|
|
336
244
|
andConditions.push({
|
|
337
245
|
'offers.seller.makesOffer': {
|
|
338
246
|
$exists: true,
|
|
@@ -704,12 +612,12 @@ class EventRepo {
|
|
|
704
612
|
return __awaiter(this, void 0, void 0, function* () {
|
|
705
613
|
var _a;
|
|
706
614
|
const conditions = EventRepo.CREATE_MONGO_CONDITIONS(params);
|
|
707
|
-
let projection
|
|
615
|
+
let projection;
|
|
708
616
|
const positiveProjectionFields = (Array.isArray(inclusion))
|
|
709
|
-
? inclusion.filter((key) => key !== 'id' && key !== '_id')
|
|
617
|
+
? inclusion.filter((key) => String(key) !== 'id' && String(key) !== '_id')
|
|
710
618
|
: [];
|
|
711
619
|
if (Array.isArray(inclusion) && inclusion.length > 0) {
|
|
712
|
-
projection = Object.assign({
|
|
620
|
+
projection = Object.assign(Object.assign({}, Object.fromEntries(positiveProjectionFields.map((key) => ([key, 1])))), { _id: 0, id: { $toString: '$_id' } });
|
|
713
621
|
}
|
|
714
622
|
else {
|
|
715
623
|
// discontinue(2024-07-24~)
|
|
@@ -753,13 +661,7 @@ class EventRepo {
|
|
|
753
661
|
positiveProjectionFields = inclusion.filter((key) => AVAILABLE_PUBLIC_PROJECT_FIELDS.includes(key));
|
|
754
662
|
projection = Object.assign({ _id: 0, id: { $toString: '$_id' } }, Object.fromEntries(positiveProjectionFields.map((key) => ([key, 1]))));
|
|
755
663
|
if (includeOffers) {
|
|
756
|
-
projection = Object.assign(Object.assign(Object.assign({}, projection), { 'offers.typeOf': 1,
|
|
757
|
-
// 'offers.availabilityEnds': 1,
|
|
758
|
-
// 'offers.availabilityStarts': 1,
|
|
759
|
-
'offers.eligibleQuantity': 1, 'offers.itemOffered': 1, 'offers.offeredThrough': 1,
|
|
760
|
-
// 'offers.validFrom': 1,
|
|
761
|
-
// 'offers.validThrough': 1,
|
|
762
|
-
'offers.unacceptedPaymentMethod': 1, 'offers.seller.typeOf': 1, 'offers.seller.id': 1, 'offers.seller.name': 1 }), (includeSellerMakesOffer)
|
|
664
|
+
projection = Object.assign(Object.assign(Object.assign({}, projection), { 'offers.typeOf': 1, 'offers.eligibleQuantity': 1, 'offers.itemOffered': 1, 'offers.identifier': 1, 'offers.offeredThrough': 1, 'offers.unacceptedPaymentMethod': 1, 'offers.seller.typeOf': 1, 'offers.seller.id': 1, 'offers.seller.name': 1 }), (includeSellerMakesOffer)
|
|
763
665
|
? Object.assign({}, (Array.isArray(sellerMakesOfferAvailableAtIn))
|
|
764
666
|
? {
|
|
765
667
|
'offers.seller.makesOffer': {
|
|
@@ -806,7 +708,7 @@ class EventRepo {
|
|
|
806
708
|
findAnyEventById(params) {
|
|
807
709
|
return __awaiter(this, void 0, void 0, function* () {
|
|
808
710
|
var _a;
|
|
809
|
-
const doc = yield this.eventModel.findOne(Object.assign({ _id: { $eq: params.id.$eq }, 'project.id': { $eq: params.project.id.$eq }, typeOf: { $in: [factory.eventType.
|
|
711
|
+
const doc = yield this.eventModel.findOne(Object.assign({ _id: { $eq: params.id.$eq }, 'project.id': { $eq: params.project.id.$eq }, typeOf: { $in: [factory.eventType.ScreeningEvent] } }, (typeof ((_a = params.organizer) === null || _a === void 0 ? void 0 : _a.id.$eq) === 'string')
|
|
810
712
|
? { 'organizer.id': { $exists: true, $eq: params.organizer.id.$eq } }
|
|
811
713
|
: undefined), {
|
|
812
714
|
__v: 0,
|
|
@@ -846,7 +748,7 @@ class EventRepo {
|
|
|
846
748
|
};
|
|
847
749
|
if (Array.isArray(inclusion) && inclusion.length > 0) {
|
|
848
750
|
inclusion.forEach((field) => {
|
|
849
|
-
if (field !== '_id' && field !== 'id') {
|
|
751
|
+
if (String(field) !== '_id' && String(field) !== 'id') {
|
|
850
752
|
projection[field] = 1;
|
|
851
753
|
}
|
|
852
754
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { BulkWriteResult } from 'mongodb';
|
|
2
2
|
import type { Connection, Document, FilterQuery } from 'mongoose';
|
|
3
3
|
import * as factory from '../factory';
|
|
4
|
-
type ISearchConditions = factory.
|
|
5
|
-
type IKeyOfProjection = Exclude<keyof factory.
|
|
4
|
+
type ISearchConditions = factory.eventSeries.ISearchConditions;
|
|
5
|
+
type IKeyOfProjection = Exclude<keyof factory.eventSeries.IEvent, 'id'>;
|
|
6
6
|
type IUnset = {
|
|
7
|
-
[key in keyof factory.
|
|
7
|
+
[key in keyof factory.eventSeries.IEvent]?: 1;
|
|
8
8
|
};
|
|
9
9
|
/**
|
|
10
10
|
* 施設コンテンツリポジトリ
|
|
@@ -12,25 +12,25 @@ type IUnset = {
|
|
|
12
12
|
export declare class EventSeriesRepo {
|
|
13
13
|
private readonly eventSeriesModel;
|
|
14
14
|
constructor(connection: Connection);
|
|
15
|
-
static CREATE_MONGO_CONDITIONS(conditions: ISearchConditions): FilterQuery<factory.
|
|
15
|
+
static CREATE_MONGO_CONDITIONS(conditions: ISearchConditions): FilterQuery<factory.eventSeries.IEvent>[];
|
|
16
16
|
/**
|
|
17
17
|
* 複数イベントを作成する
|
|
18
18
|
*/
|
|
19
19
|
createManyEventSeries(params: {
|
|
20
|
-
attributes: factory.
|
|
20
|
+
attributes: factory.eventSeries.IAttributes[];
|
|
21
21
|
expectsNoContent: boolean;
|
|
22
22
|
}): Promise<string[] | void>;
|
|
23
23
|
/**
|
|
24
24
|
* コンテンツ+バージョンをキーにして、なければ作成する(複数対応)
|
|
25
25
|
*/
|
|
26
26
|
createIfNotExistByWorkPerformed(params: {
|
|
27
|
-
attributes: factory.
|
|
27
|
+
attributes: factory.eventSeries.IAttributes;
|
|
28
28
|
}[]): Promise<BulkWriteResult | void>;
|
|
29
29
|
/**
|
|
30
30
|
* コンテンツ+バージョンをキーにして冪等置換
|
|
31
31
|
*/
|
|
32
32
|
upsertByVersion(params: {
|
|
33
|
-
$set: factory.
|
|
33
|
+
$set: factory.eventSeries.IAttributes;
|
|
34
34
|
$unset?: IUnset;
|
|
35
35
|
}[]): Promise<{
|
|
36
36
|
bulkWriteResult4insert: BulkWriteResult;
|
|
@@ -40,7 +40,7 @@ export declare class EventSeriesRepo {
|
|
|
40
40
|
} | void>;
|
|
41
41
|
saveEventSeries(params: {
|
|
42
42
|
id?: string;
|
|
43
|
-
attributes: factory.
|
|
43
|
+
attributes: factory.eventSeries.IAttributes;
|
|
44
44
|
/**
|
|
45
45
|
* ドキュメント作成時には無視される
|
|
46
46
|
*/
|
|
@@ -53,12 +53,12 @@ export declare class EventSeriesRepo {
|
|
|
53
53
|
*/
|
|
54
54
|
upsertManyEventSeriesById4sskts(params: {
|
|
55
55
|
id: string;
|
|
56
|
-
attributes: factory.
|
|
56
|
+
attributes: factory.eventSeries.IAttributes;
|
|
57
57
|
}[]): Promise<void>;
|
|
58
58
|
/**
|
|
59
59
|
* イベントを検索する(inclusion projection)
|
|
60
60
|
*/
|
|
61
|
-
projectEventSeriesFields(params: ISearchConditions, inclusion: IKeyOfProjection[]): Promise<factory.
|
|
61
|
+
projectEventSeriesFields(params: ISearchConditions, inclusion: IKeyOfProjection[]): Promise<factory.eventSeries.IEvent[]>;
|
|
62
62
|
deleteEventSeriesById(params: {
|
|
63
63
|
project: {
|
|
64
64
|
id: string;
|
|
@@ -103,15 +103,15 @@ export declare class EventSeriesRepo {
|
|
|
103
103
|
}): Promise<{
|
|
104
104
|
maxVersion: string;
|
|
105
105
|
}>;
|
|
106
|
-
getCursor(conditions: FilterQuery<any>, projection: any): import("mongoose").Cursor<Document<unknown, {},
|
|
106
|
+
getCursor(conditions: FilterQuery<any>, projection: any): import("mongoose").Cursor<Document<unknown, {}, factory.eventSeries.IAttributes & {
|
|
107
107
|
_id: string;
|
|
108
|
-
}> &
|
|
108
|
+
}> & factory.eventSeries.IAttributes & {
|
|
109
109
|
_id: string;
|
|
110
110
|
} & Required<{
|
|
111
111
|
_id: string;
|
|
112
|
-
}>, import("mongoose").QueryOptions<Document<unknown, {},
|
|
112
|
+
}>, import("mongoose").QueryOptions<Document<unknown, {}, factory.eventSeries.IAttributes & {
|
|
113
113
|
_id: string;
|
|
114
|
-
}> &
|
|
114
|
+
}> & factory.eventSeries.IAttributes & {
|
|
115
115
|
_id: string;
|
|
116
116
|
} & Required<{
|
|
117
117
|
_id: string;
|
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
|
|
2
2
|
import * as factory from '../../../factory';
|
|
3
|
-
|
|
4
|
-
export interface IChildReport {
|
|
5
|
-
typeOf: 'Report';
|
|
6
|
-
mainEntity: factory.report.accountingReport.IAction;
|
|
7
|
-
}
|
|
8
|
-
export interface IAccountingReport {
|
|
9
|
-
project: {
|
|
10
|
-
id: string;
|
|
11
|
-
typeOf: factory.organizationType.Project;
|
|
12
|
-
};
|
|
13
|
-
typeOf: 'Report';
|
|
14
|
-
hasPart: IChildReport[];
|
|
15
|
-
mainEntity: IOrder4report;
|
|
16
|
-
}
|
|
3
|
+
type IAccountingReport = factory.report.accountingReport.IReportDocument;
|
|
17
4
|
type IDocType = IAccountingReport;
|
|
18
5
|
type IModel = Model<IDocType>;
|
|
19
6
|
type ISchemaDefinition = SchemaDefinition<IDocType>;
|
|
@@ -21,4 +8,4 @@ type ISchema = Schema<IDocType, IModel, {}, {}, {}, {}, ISchemaDefinition, IDocT
|
|
|
21
8
|
declare const modelName = "AccountingReport";
|
|
22
9
|
declare const indexes: [d: IndexDefinition, o: IndexOptions][];
|
|
23
10
|
declare function createSchema(): ISchema;
|
|
24
|
-
export { createSchema, IModel, indexes, modelName };
|
|
11
|
+
export { createSchema, IDocType, IModel, indexes, modelName };
|
|
@@ -11,7 +11,7 @@ export interface IAggregateReservation {
|
|
|
11
11
|
typeOf: factory.eventType;
|
|
12
12
|
startDate: Date;
|
|
13
13
|
};
|
|
14
|
-
aggregateOffer?: factory.event.
|
|
14
|
+
aggregateOffer?: factory.event.screeningEvent.IAggregateOffer;
|
|
15
15
|
}
|
|
16
16
|
type IDocType = IAggregateReservation;
|
|
17
17
|
type IModel = Model<IDocType>;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
|
|
2
2
|
import * as factory from '../../../factory';
|
|
3
|
-
type IDocTypeAsEvent = factory.event.IAttributes<factory.eventType.Event> & {
|
|
4
|
-
_id: string;
|
|
5
|
-
};
|
|
6
3
|
type IDocTypeAsScreeningEvent = factory.event.IAttributes<factory.eventType.ScreeningEvent> & {
|
|
7
4
|
_id: string;
|
|
8
|
-
aggregateOffer?: factory.event.
|
|
5
|
+
aggregateOffer?: factory.event.screeningEvent.IAggregateOffer;
|
|
9
6
|
};
|
|
10
|
-
export type IDocType =
|
|
7
|
+
export type IDocType = IDocTypeAsScreeningEvent;
|
|
11
8
|
type IModel = Model<IDocType>;
|
|
12
9
|
type ISchemaDefinition = SchemaDefinition<IDocType>;
|
|
13
10
|
type ISchema = Schema<IDocType, IModel, {}, {}, {}, {}, ISchemaDefinition, IDocType>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
|
|
2
2
|
import * as factory from '../../../factory';
|
|
3
|
-
type IDocTypeAsEventSeries = factory.
|
|
3
|
+
type IDocTypeAsEventSeries = factory.eventSeries.IAttributes & {
|
|
4
4
|
_id: string;
|
|
5
5
|
};
|
|
6
6
|
export type IDocType = IDocTypeAsEventSeries;
|
|
@@ -25,7 +25,7 @@ const schemaDefinition = {
|
|
|
25
25
|
description: mongoose_1.SchemaTypes.Mixed,
|
|
26
26
|
address: mongoose_1.SchemaTypes.Mixed,
|
|
27
27
|
branchCode: { type: String, required: true },
|
|
28
|
-
containedInPlace: mongoose_1.SchemaTypes.Mixed,
|
|
28
|
+
containedInPlace: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
29
29
|
containsPlace: [mongoose_1.SchemaTypes.Mixed],
|
|
30
30
|
maximumAttendeeCapacity: Number,
|
|
31
31
|
openingHoursSpecification: mongoose_1.SchemaTypes.Mixed,
|
|
@@ -170,20 +170,19 @@ const indexes = [
|
|
|
170
170
|
'containedInPlace.branchCode': { $exists: true }
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
+
],
|
|
174
|
+
[
|
|
175
|
+
// unique index(2025-10-01~)
|
|
176
|
+
{
|
|
177
|
+
// 'project.id': 1,
|
|
178
|
+
'containedInPlace.id': 1, // 施設内ユニーク
|
|
179
|
+
branchCode: 1
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
unique: true,
|
|
183
|
+
name: 'uniqueBranchCode'
|
|
184
|
+
}
|
|
173
185
|
]
|
|
174
|
-
// [
|
|
175
|
-
// {
|
|
176
|
-
// typeOf: 1,
|
|
177
|
-
// 'project.id': 1,
|
|
178
|
-
// 'containedInPlace.branchCode': 1,
|
|
179
|
-
// branchCode: 1,
|
|
180
|
-
// 'containsPlace.branchCode': 1,
|
|
181
|
-
// 'containsPlace.containsPlace.branchCode': 1
|
|
182
|
-
// },
|
|
183
|
-
// {
|
|
184
|
-
// name: 'projectSeatsUsingSort'
|
|
185
|
-
// }
|
|
186
|
-
// ]
|
|
187
186
|
];
|
|
188
187
|
exports.indexes = indexes;
|
|
189
188
|
/**
|