feat: replace tenants with organization management

This commit is contained in:
2026-07-10 21:27:26 +08:00
parent 8ed1682b90
commit 8f0991a51f
49 changed files with 1292 additions and 698 deletions

View File

@@ -0,0 +1,46 @@
import {
Entity,
PrimaryGeneratedColumn,
Column,
CreateDateColumn,
UpdateDateColumn,
} from 'typeorm';
@Entity('organizations')
export class Organization {
@PrimaryGeneratedColumn()
id: number;
@Column({ name: 'public_id', type: 'varchar', length: 36, unique: true })
publicId: string;
@Column({ length: 50, unique: true })
code: string;
@Column({ length: 100 })
name: string;
@Column({ name: 'is_host', default: false })
isHost: boolean;
@Column({ name: 'contact_name', length: 50, nullable: true })
contactName: string;
@Column({ length: 30, nullable: true })
phone: string;
@Column({ length: 20, nullable: true })
color: string;
@Column({ type: 'text', nullable: true })
notes: string;
@Column({ type: 'varchar', length: 20, default: 'active' })
status: 'active' | 'archived';
@CreateDateColumn({ name: 'created_at' })
createdAt: Date;
@UpdateDateColumn({ name: 'updated_at' })
updatedAt: Date;
}