import { DB_SCHEMA } from 'src/utils';
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';

@Entity('our_products', { schema: DB_SCHEMA })
export class OurProductsEntity {
  @PrimaryGeneratedColumn({ type: 'tinyint', name: 'id' })
  id: number;

  @Column('varchar', { name: 'title', nullable: true, length: 30 })
  title: string | null;

  @Column('varchar', { name: 'image', length: 255 })
  image: string;

  @Column('varchar', { name: 'pagetype', length: 25 })
  pagetype: string;

  @Column('smallint', { name: 'visa_product_country_id', nullable: true })
  visa_product_country_id: number | null;

  @Column('tinyint', {
    name: 'active',
    nullable: true,
    width: 1,
    default: () => "'1'",
  })
  active: boolean | null;

  @Column('smallint', { name: 'by_user', nullable: true })
  by_user: number | null;

  @Column('timestamp', { name: 'created', default: () => 'CURRENT_TIMESTAMP' })
  created: Date;

  @Column('datetime', { name: 'modified', default: () => 'CURRENT_TIMESTAMP' })
  modified: Date;
}
