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) })
  CustomerId: string;

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

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

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

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

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

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

  @CreatedAt
  CreatedAt: Date;

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

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

  @UpdatedAt
  UpdatedAt: Date;

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