import {
  Table,
  Column,
  DataType,
  CreatedAt,
  UpdatedAt,
  Model,
} from 'sequelize-typescript';

@Table({ tableName: 'object_Address' })
export class ObjectAddressModel extends Model {
  @Column({
    primaryKey: true,
    allowNull: false,
    type: DataType.STRING(255),
  })
  declare AddressId: string;

  @Column({ allowNull: false, type: DataType.STRING(30) })
  declare ObjectId: string;

  @Column({ allowNull: false, type: DataType.STRING(30) })
  declare ObjectType: string;

  @Column({ allowNull: false, type: DataType.STRING(255) })
  declare AddressLine1: string;

  @Column({ type: DataType.STRING(255) })
  declare AddressLine2: string;

  @Column({ allowNull: false, type: DataType.STRING(255) })
  declare City: string;

  @Column({ type: DataType.STRING(255) })
  declare State: string;

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

  @Column({ allowNull: false, type: DataType.STRING(255) })
  declare Country: string;

  @Column({ type: DataType.DECIMAL(10, 2) })
  declare Latitude: number;

  @Column({ type: DataType.DECIMAL(10, 2) })
  declare Longitude: number;

  @Column({ type: DataType.STRING(255) })
  declare AddressType: string;

  @Column({ type: DataType.STRING(1) })
  declare IsDefaultYN: string;

  @Column({
    allowNull: false,
    type: DataType.ENUM('Active', 'Inactive', 'Deleted', 'Suspended'),
  })
  declare Status: string;

  @Column({ allowNull: false, type: DataType.STRING(30) })
  declare CreatedById: string;

  @CreatedAt
  declare CreatedAt: Date;

  @Column({ allowNull: false, type: DataType.STRING(30) })
  declare UpdatedById: string;

  @UpdatedAt
  declare UpdatedAt: Date;
}
