mirror of
https://github.com/jakobkordez/ham-reserve.git
synced 2025-08-07 13:47:43 +00:00
WIP
This commit is contained in:
41
nest-api/src/events/schemas/event.schema.ts
Normal file
41
nest-api/src/events/schemas/event.schema.ts
Normal 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);
|
Reference in New Issue
Block a user