mirror of
https://github.com/jakobkordez/ham-reserve.git
synced 2025-08-06 05:07:40 +00:00
42 lines
679 B
TypeScript
42 lines
679 B
TypeScript
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);
|