@wearesage/schema
Version:
A flexible schema definition and validation system for TypeScript with multi-database support
53 lines (41 loc) • 857 B
text/typescript
import "reflect-metadata";
import { Entity, Id, Property, ManyToOne, ManyToMany } from "../..";
import { User } from "./User";
import { Group } from "./Group";
()
export class Event {
()
id: string;
({ required: true })
title: string;
()
description: string;
()
location: string;
({ required: true })
startTime: Date;
()
endTime: Date;
()
imageUrl: string;
()
isPublic: boolean = true;
({
target: () => User,
inverse: "hostedEvents",
name: "HOSTED_BY",
})
host: User;
({
target: () => User,
inverse: "eventsAttending",
name: "HAS_ATTENDEE",
})
attendees: User[] = [];
({
target: () => Group,
inverse: "events",
name: "BELONGS_TO_GROUP",
})
group: Group;
}