import { Connection, FilterQuery } from 'mongoose'; import { factory } from '../factory'; import * as EventFactory from '../factory/event'; export type ISearchConditions = Pick & {}; export import IMinimizedIndividualEvent = EventFactory.IMinimizedIndividualEvent; type IKeyOfProjection = Exclude | 'aggregateOffer' | 'superEvent.location.id' | 'offers.itemOffered' | 'offers.itemOffered.id' | 'offers.typeOf'; type IKeyOfProjection4publicFields = Exclude; /** * minimizedEvent検索時のprojection候補 * add(2024-07-18~) */ type IKeyOfProjection4minimizedEvent = Exclude | 'superEvent.id' | 'location.branchCode' | 'superEvent.workPerformed.identifier' | 'superEvent.location.id' | 'offers.itemOffered' | 'offers.itemOffered.id' | 'offers.offeredThrough' | 'offers.unacceptedPaymentMethod' | 'offers.eligibleQuantity'; /** * イベントリポジトリ */ export declare class EventRepo { private readonly eventModel; constructor(connection: Connection); static CREATE_MONGO_CONDITIONS(conditions: ISearchConditions): FilterQuery[]; /** * イベントを検索する(inclusion projection) */ projectEventFields(params: ISearchConditions, inclusion: IKeyOfProjection[]): Promise[]>; /** * apiで公開属性を検索する(2024-10-13~) */ aggregatePublicFields(params: ISearchConditions, inclusion: IKeyOfProjection4publicFields[], options: { /** * offersを属性をprojectするかどうか */ includeOffers: boolean; /** * offers.seller.makesOfferをprojectするかどうか */ includeSellerMakesOffer: boolean; /** * offers.seller.makesOfferをavailableAtOrFromでfilterする */ sellerMakesOfferAvailableAtIn?: string[]; }): Promise[]>; /** * IDのみで検索する * projectionなし */ findAnyEventById(params: { id: { $eq: string; }; project: { id: { $eq: string; }; }; organizer?: { id: { $eq: string; }; }; }): Promise>; /** * COAイベントキャンセル時に使用 */ searchEventIds(params: Pick): Promise; /** * 特定イベントから指定フィールドのみ取得する * イベント IDは必ず返ります */ projectEventFieldsById(params: { id: string; }, inclusion: IKeyOfProjection4minimizedEvent[]): Promise; } export {};