import {
  AllowNull,
  BelongsToMany,
  Column,
  Default,
  DefaultScope,
  DeletedAt,
  HasMany,
  Table,
} from "sequelize-typescript";
import { TimestampModel } from "src/database/models/timestamp.model";

@DefaultScope(() => ({
  attributes: {exclude: ['profilePhotoFile']},
  include: [],
}))
@Table({ timestamps: true, tableName: "roles" })
export class Role extends TimestampModel {
  @AllowNull(false)
  @Column
  name: string;

  @AllowNull(true)
  @Column({ field: "display_name" })
  displayName: string;

  @AllowNull(false)
  @Default(true)
  @Column
  active: boolean;

  @DeletedAt
  @Column({ field: "deleted_at" })
  deletedAt?: Date;
}
