import {
  Table,
  Model,
  Column,
  DataType,
  ForeignKey,
  BelongsTo,
} from 'sequelize-typescript';
import { CustomerBaseModel } from './customer-base.entity';

@Table({ tableName: 'customer_Individual', createdAt: false, updatedAt: false })
export class CustomerIndividualModel extends Model {
  @ForeignKey(() => CustomerBaseModel)
  @Column({ primaryKey: true, allowNull: false, type: DataType.STRING(30) })
  CustomerId: string;

  @Column({ allowNull: false, type: DataType.STRING(200) })
  FullName: string;

  @Column({ allowNull: false, type: DataType.STRING(20) })
  IdType: string;

  @Column({ allowNull: false, type: DataType.STRING(50) })
  IdNo: string;

  @Column({ type: DataType.STRING(10) })
  Title: string;

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

  @Column({ type: DataType.DATE })
  Birthdate: Date;

  @Column({ type: DataType.ENUM('Male', 'Female') })
  Gender: 'Male' | 'Female';

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

  @Column({ type: DataType.STRING(100) })
  Nationality: string;

  @Column({ type: DataType.STRING(10) })
  PreferredLanguage: string;

  @BelongsTo(() => CustomerBaseModel)
  CustomerBase: CustomerBaseModel;
}
