@wearesage/schema
Version:
A flexible schema definition and validation system for TypeScript with multi-database support
31 lines (25 loc) • 507 B
text/typescript
import "reflect-metadata";
import { Entity, Id, Property, ManyToOne } from "../..";
import { Task } from "./Task";
import { User } from "./User";
()
export class Comment {
()
id: string;
({ required: true })
content: string;
()
createdAt: Date;
({
target: () => Task,
inverse: "comments",
name: "BELONGS_TO_TASK",
})
task: Task;
({
target: () => User,
inverse: null,
name: "CREATED_BY",
})
author: User;
}