import { DB_SCHEMA } from 'src/utils';
import {
  Column,
  Entity,
  JoinColumn,
  ManyToOne,
  PrimaryGeneratedColumn,
} from 'typeorm';
import { DesignationMastersEntity } from './DesignationMasters.entity';
import { WebMediaCategoryEntity } from './WebMediaCategory.entity';

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

  @Column('text', { name: 'testimonial_text' })
  testimonial_text: string;

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

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

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

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

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

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

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

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

  @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;

  @ManyToOne(() => DesignationMastersEntity, { eager: true, nullable: true })
  @JoinColumn({ name: 'designation' })
  user_designation: DesignationMastersEntity;

  @ManyToOne(() => WebMediaCategoryEntity, { eager: true })
  @JoinColumn({ name: 'web_catId' })
  web_category: WebMediaCategoryEntity;
}
