import {
  Entity,
  PrimaryGeneratedColumn,
  Column,
  CreateDateColumn,
  UpdateDateColumn,
} from 'typeorm';

@Entity('city')
export class City {
  @PrimaryGeneratedColumn({ name: 'city_id' })
  city_id: number;

  @Column({ type: 'int', nullable: true })
  state_id: number | null;

  @Column({ type: 'varchar', length: 250, nullable: true })
  city_name: string | null;

  @Column({ type: 'int', default: 1 })
  status: number;

  @Column({ default: 0 })
  is_featured: number;

  @Column({ type: 'int', nullable: true })
  front_order: number | null;

  @Column({ type: 'varchar', length: 500, nullable: true })
  image: string | null;

  @Column({ type: 'varchar', length: 150, nullable: true })
  city_latitude: string | null;

  @Column({ type: 'varchar', length: 150, nullable: true })
  city_longitude: string | null;

  @Column({ type: 'varchar', length: 30, default: 'Asia/Kolkata' })
  timezone: string;

  @Column({ type: 'varchar', length: 30, default: 'INR' })
  currency: string;

  @CreateDateColumn({
    name: 'created_at',
    type: 'timestamp',
    default: () => 'CURRENT_TIMESTAMP',
  })
  createdAt: Date;

  @UpdateDateColumn({
    name: 'updated_at',
    type: 'timestamp',
    default: () => 'CURRENT_TIMESTAMP',
    onUpdate: 'CURRENT_TIMESTAMP',
  })
  updatedAt: Date;
}
