@wearesage/schema
Version:
A flexible schema definition and validation system for TypeScript with multi-database support
25 lines (19 loc) • 562 B
text/typescript
import { Entity, Property, Id, Auth, OneToMany } from "../../core/decorators";
import { TestConversation } from "./TestConversation";
()
({ permissions: ['user'] })
export class TestUser {
()
id!: string;
({ required: true })
name!: string;
({ required: true })
email!: string;
()
createdAt!: Date;
()
updatedAt!: Date;
// One-to-many relationship: user has many conversations
({ target: () => TestConversation, inverse: 'owner' })
conversations?: TestConversation[];
}