import { TABLE_NAME } from 'src/core/strings/constants/table.constants';
import {
  OTP_ACTION_TYPE,
  OtpVerifierEntity,
} from '../../domain/entities/otp-verification.entity';
import { Column, Entity } from 'typeorm';
import { BaseModel } from 'src/core/modules/data/model/base.model';

@Entity(TABLE_NAME.OTP_VERIFIER)
export class OtpVerifierModel
  extends BaseModel<OtpVerifierEntity>
  implements OtpVerifierEntity
{
  @Column({ type: 'varchar', nullable: true })
  name: string;

  @Column({ type: 'varchar', nullable: false })
  phone_number: string;

  @Column({ default: false })
  is_all_action: boolean;

  @Column({ type: 'enum', enum: OTP_ACTION_TYPE, array: true, nullable: true })
  action_types: OTP_ACTION_TYPE[] | null;
}
