import {
  Table,
  Model,
  Column,
  DataType,
  CreatedAt,
  UpdatedAt,
} from 'sequelize-typescript';
import { CustomerTypeEnum } from '../enum/customer-type.enum';
import { CustomerStatusEnum } from '../enum/customer-status.enum';

@Table({ tableName: 'customer_Base' })
export class CustomerBaseModel extends Model {
  @Column({ primaryKey: true, allowNull: false, type: DataType.STRING(30) })
  declare CustomerId: string;

  @Column({
    allowNull: false,
    type: DataType.ENUM(...Object.values(CustomerTypeEnum)),
  })
  declare Type: CustomerTypeEnum;

  @Column({ type: DataType.STRING(50) })
  declare Email: string;

  @Column({ type: DataType.STRING(20) })
  declare ContactNo: string;

  @Column({
    allowNull: false,
    type: DataType.ENUM(...Object.values(CustomerStatusEnum)),
  })
  declare Status: CustomerStatusEnum;

  @Column({ type: DataType.STRING(30) })
  declare CreatedByUserId: string;

  @Column({ type: DataType.STRING(30) })
  declare CreatedByCustomerId: string;

  @CreatedAt
  declare CreatedAt: Date;

  @Column({ type: DataType.STRING(30) })
  declare UpdatedByUserId: string;

  @Column({ type: DataType.STRING(30) })
  declare UpdatedByCustomerId: string;

  @UpdatedAt
  declare UpdatedAt: Date;

  @Column({ type: DataType.STRING(5) })
  declare UpdatedBySystemCode: string;
}
