import { Column, CreateDateColumn, Entity, Index, PrimaryColumn } from 'typeorm';

@Entity({ name: 'identity_users' })
export class UserOrmEntity {
  @PrimaryColumn({ type: 'uuid' })
  id!: string;

  @Index({ unique: true })
  @Column({ type: 'text' })
  email!: string;

  @Column({ type: 'text' })
  displayName!: string;

  @Column({ type: 'text' })
  passwordHash!: string;

  @Column({ type: 'text' })
  salt!: string;

  @Column({ type: 'text', nullable: true })
  primaryDriverId!: string | null;

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