UNPKG

@wearesage/schema

Version:

A flexible schema definition and validation system for TypeScript with multi-database support

23 lines (18 loc) 368 B
import "reflect-metadata"; import { Entity, Id, Property, ManyToMany } from "../.."; import { Task } from "./Task"; @Entity() export class Label { @Id() id: string; @Property({ required: true }) name: string; @Property() color: string; @ManyToMany({ target: () => Task, inverse: "labels", name: "APPLIED_TO", }) tasks: Task[] = []; }