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

@Entity('temp_franchise')
export class TempFranchise {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ type: 'varchar', length: 255 })
  full_name: string;

  @Column({ type: 'varchar', length: 255 })
  email: string;

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

  @Column({ type: 'varchar', length: 255, nullable: true })
  company_name: string | null;

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

  @Column({ type: 'int' })
  country_id: number;

  @Column({ type: 'int' })
  state_id: number;

  @Column({ type: 'int' })
  city_id: number;

  @Column({ type: 'varchar', length: 20, nullable: true })
  postal_code: string | null;

  @Column({ type: 'int', nullable: true })
  area_id: number | null;

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

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

  @Column({ type: 'varchar', length: 255 })
  preferred_location: string;

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

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

  @Column({ type: 'varchar', length: 20, nullable: true })
  gst_number: string | null;

  @Column({
    type: 'enum',
    enum: ['applied', 'approved', 'rejected'],
    default: 'applied',
  })
  status: 'applied' | 'approved' | 'rejected';

  @Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
  created_at: Date;

  @Column({
    type: 'timestamp',
    default: () => 'CURRENT_TIMESTAMP',
    onUpdate: 'CURRENT_TIMESTAMP',
  })
  updated_at: Date;
}
