import { EN_AppEntities } from '@app_consts';
import { AppBaseEntity } from '@app_models/generic/app.baseentity';
import { AppBaseFilter } from '@app_models/generic/app.baseentityfilter';

export class Department extends AppBaseEntity {
  typeName = EN_AppEntities.Department;
  get entitytitle(): string {  //is used for messages
    return this.entityId ? `Abteilung "${this.departmentName}"` : 'Neue Abteilung';
  }
  departmentId: number;
  departmentName: string;
  costCentreId: number;
  departmentTypeId: number;
  headofDepartmentId: number;
  executiveDirectorId: number;
  managingDirectorId: number;
  departmentNameFolder: string;
  adGroupDepartmentName: string;
  clientId: number;
  isVirtual: boolean;
  costCentre: string;
  headofDepartment: string;
  executiveDirector: string;
  managingDirector: string;
  public get entityId() {
    return this.departmentId;
  }
  public set entityId(value) {
    this.departmentId = value;
  }

  insertWithIds() { return true; } //because departmentId is not autoincrement and is set explicetely
}


export class DepartmentFilter extends AppBaseFilter {
  departmentId: number;
  departmentName: number;
}
