import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
import { BookingVerification } from '../../domain/entities/booking-verification.entity';
@Entity('booking_verification')
export class VerificationModel implements BookingVerification {
  @PrimaryGeneratedColumn('uuid')
  id: string;

  @Column()
  name: string;

  @Column()
  phone_number: string;

  @Column({ nullable: true })
  code?: string;

  @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;
}
