This commit is contained in:
Jakob Kordež
2023-09-07 18:46:32 +02:00
parent f24d39b4e1
commit 08a27fb4fc
46 changed files with 1065 additions and 72 deletions

View File

@ -0,0 +1,41 @@
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { User } from 'src/users/schemas/user.schema';
export type EventDocument = Event & Document;
@Schema()
export class Event {
_id: string;
@Prop({ required: true })
callsign: string;
@Prop()
description: string;
@Prop()
fromDateTime: Date;
@Prop()
toDateTime: Date;
@Prop({
type: [{ type: String, ref: User.name }],
default: [],
})
access: User[];
@Prop({
required: true,
default: Date.now,
})
createdAt: Date;
@Prop({
required: true,
default: false,
})
isDeleted: boolean;
}
export const EventSchema = SchemaFactory.createForClass(Event);