import { Injectable } from '@angular/core';
import { EN_AppEntities } from '@app_consts';
import { CostCentre } from '@app_models/basedata/cost-centre';
import { Department } from '@app_models/basedata/department';
import { DocumentArt } from '@app_models/basedata/document-art';
import { EmployeeAttribute } from '@app_models/basedata/employee-attribute';
import { EmployeeStatus } from '@app_models/basedata/employee-status';
import { Project } from '@app_models/basedata/project';
import { Rang } from '@app_models/basedata/rang';
import { WebApp } from '@app_models/basedata/webapp';
import { WebAppToWebAppRoleFilter } from '@app_models/basedata/webapp-to-webapprole';
import { WebAppRole } from '@app_models/basedata/webapprole';
import { Subsidiary } from '@app_models/subsidiary';
import { AppBaseEntityListWrapper } from './app.baseentitylist.wrapper';

@Injectable({
  providedIn: 'root'
})


export class AppDataService {
  costCentreList: AppBaseEntityListWrapper<CostCentre> = new AppBaseEntityListWrapper<CostCentre>(CostCentre, 'Kostenstellenliste', EN_AppEntities.CostCentre + '/all');
  departmentList: AppBaseEntityListWrapper<Department> = new AppBaseEntityListWrapper<Department>(Department, 'Abteilungsliste', EN_AppEntities.Department + '/all');
  documentArtList: AppBaseEntityListWrapper<DocumentArt> = new AppBaseEntityListWrapper<DocumentArt>(DocumentArt, 'Dokumentartenliste', EN_AppEntities.DocumentArt + '/all');
  employeeStatusList: AppBaseEntityListWrapper<EmployeeStatus> = new AppBaseEntityListWrapper<EmployeeStatus>(EmployeeStatus, 'Mitarbeiterstatusliste', EN_AppEntities.EmployeeStatus + '/all');
  projectList: AppBaseEntityListWrapper<Project> = new AppBaseEntityListWrapper<Project>(Project, 'Projektliste', EN_AppEntities.Project + '/all');
  rangList: AppBaseEntityListWrapper<Rang> = new AppBaseEntityListWrapper<Rang>(Rang, 'Rangenliste', EN_AppEntities.Rang + '/all');
  webAppList: AppBaseEntityListWrapper<WebApp> = new AppBaseEntityListWrapper<WebApp>(WebApp, 'Web Applikationen Liste', EN_AppEntities.WebApp + '/all');
  roleList: AppBaseEntityListWrapper<WebAppRole> = new AppBaseEntityListWrapper<WebAppRole>(WebAppRole, 'Rolenliste', EN_AppEntities.WebAppRole + '/all');
  employeeAttributeList: AppBaseEntityListWrapper<EmployeeAttribute> = new AppBaseEntityListWrapper<EmployeeAttribute>(EmployeeAttribute, 'Merkmalliste', EN_AppEntities.EmployeeAttribute + '/all');
  webAppFilter: WebAppToWebAppRoleFilter = new WebAppToWebAppRoleFilter('WebAppFilter');
  subsidiaryList: AppBaseEntityListWrapper<Subsidiary> = new AppBaseEntityListWrapper<Subsidiary>(Subsidiary, 'Subsidiary', EN_AppEntities.Subsidiary + '/all');


  showIds: boolean = false;

  constructor() {
  }

  loadData(listLoadedCallBack: () => void) {
    this.costCentreList.load(null, null, listLoadedCallBack);
    this.departmentList.load(null, null, listLoadedCallBack);
    this.documentArtList.load(null, null, listLoadedCallBack);
    this.employeeStatusList.load(null, null, listLoadedCallBack);
    this.projectList.load(null, null, listLoadedCallBack);
    this.rangList.load(null, null, listLoadedCallBack);
    this.webAppList.load(null, null, listLoadedCallBack);
    this.roleList.load(null, null, listLoadedCallBack);
    this.employeeAttributeList.load(null, null, listLoadedCallBack);
    this.subsidiaryList.load(null, null, listLoadedCallBack);

}
}
