/** * @author songxiwen * @date 2020/12/10 13:53 */ import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; import { Document } from 'mongoose'; import { MongoDBCollection } from '../../../constant'; @Schema({ collection: MongoDBCollection.ThirdPartyPlatform }) export class ThirdPartyPlatform extends Document { @Prop() isEnabled!: boolean; @Prop({ unique: true }) name!: string; @Prop() limit!: number; @Prop() cycle!: string; @Prop() authFields!: object; @Prop() createdAt!: Date; @Prop() updatedAt!: Date; } export const thirdPartyPlatformSchema = SchemaFactory.createForClass( ThirdPartyPlatform );