import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
import { RescheduleVerification } from '../../domain/entities/reschedule-verification.entity';

@Entity('reschedule_verification')
export class RescheduleVerificationModel implements RescheduleVerification {
  @PrimaryGeneratedColumn('uuid')
  id: string;

  @Column()
  name: string;

  @Column()
  phone_number: string;

  @Column()
  booking_id: string;

  @Column()
  reschedule_date: string;

  @Column()
  code: number;

  @Column({ default: 0 })
  tried: number;

  @Column({ type: 'bigint', default: () => 'EXTRACT(EPOCH FROM NOW()) * 1000' })
  created_at: number;

  @Column({
    type: 'bigint',
    default: () => 'EXTRACT(EPOCH FROM NOW()) * 1000',
    onUpdate: 'EXTRACT(EPOCH FROM NOW()) * 1000',
  })
  updated_at: number;
}
