import {
  Entity,
  PrimaryGeneratedColumn,
  Column,
  CreateDateColumn,
} from 'typeorm';

/**
 * Corp — top-level brand/legal-entity grouping for cross-domain analytics.
 * One corp owns 1..N domains. Cross-corp flow queries pivot on this.
 */
@Entity('corps')
export class Corp {
  @PrimaryGeneratedColumn({ type: 'smallint' })
  id!: number;

  @Column({ type: 'varchar', length: 64, unique: true })
  slug!: string;

  @Column({ type: 'varchar', length: 255, name: 'legal_name' })
  legalName!: string;

  @CreateDateColumn({ type: 'timestamptz', name: 'created_at' })
  createdAt!: Date;
}
