@wearesage/schema
Version:
A flexible schema definition and validation system for TypeScript with multi-database support
50 lines (39 loc) • 1.29 kB
text/typescript
import { Conversation } from './Conversation';
import { Entity, Property, Id, OneToMany, ManyToMany, Index, Email, Timestamp, Auth, Labels } from '../core/decorators';
import { Space } from './Space';
import { Team } from './Team';
// Authenticated users only
export class User {
id!: string;
email!: string;
name!: string;
status?: 'active' | 'inactive' | 'pending';
// Teams owned by this user
ownedTeams!: Team[];
// Teams this user is a member of
teams!: Team[];
// Spaces owned by this user
ownedSpaces!: Space[];
// Spaces this user participates in
participatingSpaces!: Space[];
// Conversations this user participates in
conversations!: Conversation[];
createdAt!: Date;
updatedAt!: Date;
}