UNPKG

@chevre/domain

Version:

Chevre Domain Library for Node.js

121 lines (120 loc) 4.12 kB
import type { BulkWriteResult } from 'mongodb'; import type { Connection, Document, FilterQuery } from 'mongoose'; import * as factory from '../factory'; type ISearchConditions = factory.event.ISearchConditions<factory.eventType.ScreeningEventSeries>; type IKeyOfProjection = Exclude<keyof factory.event.IEvent<factory.eventType.ScreeningEventSeries>, 'id'>; type IUnset = { [key in keyof factory.event.IEvent<factory.eventType.ScreeningEventSeries>]?: 1; }; /** * 施設コンテンツリポジトリ */ export declare class EventSeriesRepo { private readonly eventSeriesModel; constructor(connection: Connection); static CREATE_MONGO_CONDITIONS(conditions: ISearchConditions): FilterQuery<factory.event.IEvent<factory.eventType.ScreeningEventSeries>>[]; /** * 複数イベントを作成する */ createManyEventSeries(params: { attributes: factory.event.IAttributes<factory.eventType.ScreeningEventSeries>[]; expectsNoContent: boolean; }): Promise<string[] | void>; /** * コンテンツ+バージョンをキーにして、なければ作成する(複数対応) */ createIfNotExistByWorkPerformed(params: { attributes: factory.event.IAttributes<factory.eventType.ScreeningEventSeries>; }[]): Promise<BulkWriteResult | void>; /** * コンテンツ+バージョンをキーにして冪等置換 */ upsertByVersion(params: { $set: factory.event.IAttributes<factory.eventType.ScreeningEventSeries>; $unset?: IUnset; }[]): Promise<{ bulkWriteResult4insert: BulkWriteResult; modifiedEvents: { id: string; }[]; } | void>; saveEventSeries(params: { id?: string; attributes: factory.event.IAttributes<factory.eventType.ScreeningEventSeries>; /** * ドキュメント作成時には無視される */ $unset?: IUnset; }): Promise<{ id: string; }>; /** * sskts施設コンテンツ保管 */ upsertManyEventSeriesById4sskts(params: { id: string; attributes: factory.event.IAttributes<factory.eventType.ScreeningEventSeries>; }[]): Promise<void>; /** * イベントを検索する(inclusion projection) */ projectEventSeriesFields(params: ISearchConditions, inclusion: IKeyOfProjection[]): Promise<factory.event.IEvent<factory.eventType.ScreeningEventSeries>[]>; deleteEventSeriesById(params: { project: { id: string; }; id: string; }): Promise<void>; deleteManyByOrganizerId(params: { project: { id: string; }; organizer: { id: string; }; }): Promise<import("mongodb").DeleteResult>; deleteManyByLocationId(params: { project: { id: string; }; location: { id: string; }; }): Promise<import("mongodb").DeleteResult>; /** * 既存施設コンテンツの最大バージョンを集計する */ aggregateMaxVersion(params: { project: { id: { $eq: string; }; }; workPerformed: { identifier: { $eq: string; }; }; location: { branchCode: { $in: string[]; }; }; }): Promise<{ maxVersion: string; }>; getCursor(conditions: FilterQuery<any>, projection: any): import("mongoose").Cursor<Document<unknown, {}, import("@chevre/factory/lib/event/screeningEventSeries").IAttributes & { _id: string; }> & import("@chevre/factory/lib/event/screeningEventSeries").IAttributes & { _id: string; } & Required<{ _id: string; }>, import("mongoose").QueryOptions<Document<unknown, {}, import("@chevre/factory/lib/event/screeningEventSeries").IAttributes & { _id: string; }> & import("@chevre/factory/lib/event/screeningEventSeries").IAttributes & { _id: string; } & Required<{ _id: string; }>>>; } export {};