import type { Connection, PipelineStage } from 'mongoose'; import { factory } from '../factory'; import { IAggregateReservation } from './mongoose/schemas/aggregateReservation'; type IMatchStage = PipelineStage.Match; export interface IUpdateAggregateReservationParams { $set: { aggregateOffer?: factory.event.screeningEvent.IAggregateOffer; }; } type ISearchWithReservationForIdResult = Pick & { /** * イベントID */ id: string; }; export interface ISortOrder { 'reservationFor.startDate'?: factory.sortType; } export interface ISearchConditions { limit?: number; page?: number; sort?: ISortOrder; project?: { id?: { $eq?: string; }; }; reservationFor?: { id?: { $eq?: string; $in?: string[]; }; typeOf?: factory.eventType; startFrom?: Date; startThrough?: Date; }; } /** * 予約集計リポジトリ */ export declare class AggregateReservationRepo { private readonly aggregateReservationModel; constructor(connection: Connection); static CREATE_MONGO_CONDITIONS(conditions: ISearchConditions): IMatchStage[]; /** * 予約集計を検索する */ searchWithReservationForId(params: ISearchConditions, inclusion: ('aggregateOffer')[]): Promise; /** * 予約集計を保管する */ save(filter: Pick, update: IUpdateAggregateReservationParams): Promise; unsetUnnecessaryFields(params: { filter: any; $unset: any; }): Promise; /** * イベント開始日時が指定以前の集計を削除する */ deleteManyByEventStartDate(params: { reservationForStartDateLte: Date; }): Promise; } export {};