UNPKG

@chevre/domain

Version:

Chevre Domain Library for Node.js

29 lines (28 loc) 956 B
import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose'; import * as factory from '../../../factory'; export interface ITicketIssuedBy { id: string; typeOf: factory.organizationType.Corporation | factory.organizationType.Project; } export interface ITicket { /** * チケットID(jti) */ id: string; project: { id: string; typeOf: factory.organizationType.Project; }; typeOf: 'Ticket'; ticketToken: string; dateIssued: Date; issuedBy: ITicketIssuedBy; } type IDocType = Omit<ITicket, 'id'>; type IModel = Model<IDocType>; type ISchemaDefinition = SchemaDefinition<IDocType>; type ISchema = Schema<IDocType, IModel, {}, {}, {}, {}, ISchemaDefinition, IDocType>; declare const modelName = "Ticket"; declare const indexes: [d: IndexDefinition, o: IndexOptions][]; declare function createSchema(): ISchema; export { createSchema, IModel, indexes, modelName };