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

@Entity('contacts')
export class Contact {
  @PrimaryGeneratedColumn('uuid')
  id!: string;

  @Column({ type: 'varchar', length: 20 })
  tenantId!: string;

  @Column({ type: 'uuid' })
  userId!: string;

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

  @Column({ type: 'varchar', length: 20, nullable: true })
  phone?: string;

  @Column({ type: 'varchar', length: 200, nullable: true })
  email?: string;

  @Column({ type: 'varchar', length: 100, nullable: true })
  telegramId?: string;

  @Column({ type: 'varchar', length: 100, nullable: true })
  wechatId?: string;

  @Column({ type: 'varchar', length: 50, nullable: true })
  role?: string;

  @Column({ type: 'varchar', length: 20, default: 'websocket' })
  preferredChannel!: string;

  @Column({ type: 'boolean', default: true })
  isActive!: boolean;
}
