UNPKG

@chevre/domain

Version:

Chevre Domain Library for Node.js

18 lines (17 loc) 839 B
import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose'; import * as factory from '../../../factory'; type IDocTypeAsEvent = factory.event.IAttributes<factory.eventType.Event> & { _id: string; }; type IDocTypeAsScreeningEvent = factory.event.IAttributes<factory.eventType.ScreeningEvent> & { _id: string; aggregateOffer?: factory.event.event.IAggregateOffer; }; export type IDocType = IDocTypeAsEvent | IDocTypeAsScreeningEvent; type IModel = Model<IDocType>; type ISchemaDefinition = SchemaDefinition<IDocType>; type ISchema = Schema<IDocType, IModel, {}, {}, {}, {}, ISchemaDefinition, IDocType>; declare const modelName = "Event"; declare const indexes: [d: IndexDefinition, o: IndexOptions][]; declare function createSchema(): ISchema; export { createSchema, IModel, indexes, modelName };