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

@Entity('roles')
export class Roles {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ length: 100 })
  name: string;

  @Column({ name: 'role_levels_id', type: 'int', nullable: true })
  roleLevelsId?: number;

  @Column({
    type: 'enum',
    enum: ['blue_collar', 'white_collar'],
    nullable: true,
  })
  category: 'blue_collar' | 'white_collar';

  @Column({ type: 'tinyint', default: 1, comment: '0=inactive,1=active' })
  status: number;

  @CreateDateColumn({ name: 'created_at' })
  createdAt: Date;

  @UpdateDateColumn({ name: 'updated_at' })
  updatedAt: Date;

  @Column({ name: 'role_definition', length: 255 })
  roleDefinition: string;

  @Column({ name: 'is_popular', type: 'boolean', default: false })
  isPopular: boolean;
  @Column({ name: 'for_mock', type: 'tinyint', default: 0 })
  forMock: number;
}
