UNPKG

@wearesage/schema

Version:

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

25 lines (19 loc) 562 B
import { Entity, Property, Id, Auth, OneToMany } from "../../core/decorators"; import { TestConversation } from "./TestConversation"; @Entity() @Auth({ permissions: ['user'] }) export class TestUser { @Id() id!: string; @Property({ required: true }) name!: string; @Property({ required: true }) email!: string; @Property() createdAt!: Date; @Property() updatedAt!: Date; // One-to-many relationship: user has many conversations @OneToMany({ target: () => TestConversation, inverse: 'owner' }) conversations?: TestConversation[]; }