import { BaseModel } from 'src/core/modules/data/model/base.model';
import { Entity, Column } from 'typeorm';
import { ReportBookmarkEntity } from '../entities/report-bookmark.entity';
import { TABLE_NAME } from 'src/core/strings/constants/table.constants';
import { REPORT_BOOKMARK_TYPE } from '../constant';

@Entity(TABLE_NAME.REPORT_BOOKMARK)
export class ReportBookmarkModel
  extends BaseModel<ReportBookmarkEntity>
  implements ReportBookmarkEntity
{
  @Column('varchar')
  group_name: string;

  @Column('varchar')
  unique_name: string;

  @Column('varchar')
  label: string;

  @Column('bool', { nullable: true, default: false })
  applied: boolean;

  @Column('json', { nullable: true })
  configuration: any;

  @Column('enum', {
    name: 'type',
    enum: REPORT_BOOKMARK_TYPE,
    default: REPORT_BOOKMARK_TYPE.TABLE_CONFIG,
  })
  type: REPORT_BOOKMARK_TYPE;
}
