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

@Entity('web_banner_details', { schema: DB_SCHEMA })
export class WebBannerDetailsEntity {
  @PrimaryGeneratedColumn({ type: 'smallint', name: 'id' })
  id: number;

  @Column('char', { name: 'section_bg_color', nullable: true, length: 7 })
  section_bg_color: string | null;

  @Column('char', { name: 'section_bg_color2', nullable: true, length: 7 })
  section_bg_color2: string | null;

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

  @Column('char', { name: 'heading_text_color', nullable: true, length: 7 })
  heading_text_color: string | null;

  @Column('tinytext', { name: 'desp', nullable: true })
  desp: string | null;

  @Column('tinyint', { name: 'sequence' })
  sequence: number;

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

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

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

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

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

  @Column('char', { name: 'btn_bg_color', nullable: true, length: 7 })
  btn_bg_color: string | null;

  @Column('char', { name: 'btn_border_color', nullable: true, length: 7 })
  btn_border_color: string | null;

  @Column('tinyint', {
    name: 'btn_link_type',
    nullable: true,
    comment: '1=internal,2=external',
    width: 1,
    default: () => "'1'",
  })
  btn_link_type: boolean | null;

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

  @Column('tinyint', {
    name: 'upload_type',
    comment: '1=Image,2=Video',
    width: 1,
  })
  upload_type: boolean;

  @Column('char', {
    name: 'image_video',
    nullable: true,
    comment: 'either image/video file name store',
    length: 37,
  })
  image_video: string | null;

  @Column('char', { name: 'video_screenshot', nullable: true, length: 37 })
  video_screenshot: string | null;

  @Column('tinyint', { name: 'active', width: 1 })
  active: boolean;

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

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

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