import { Component } from '@angular/core';
import { PopupBaseComponent } from '@app_core/components/popup-base/popup-base.component';
import { Department } from '@app_models/basedata/department';
import { EmployeeToDepartment } from '@app_models/employee-to-department';
import { AppDataService } from '@app_services/app.data.service';

@Component({
  selector: 'app-employee-department-popupedit',
  templateUrl: 'employee-department.popupedit.component.html',
  styleUrls: ['employee-department.popupedit.component.scss']
})

export class EmployeeToDepartmentPopupeditComponent extends PopupBaseComponent {

  constructor(
    public appDataService: AppDataService,
  ) {
    super();
  }


  public get focusedItem(): EmployeeToDepartment {
    return <EmployeeToDepartment>(this._focusedItem);
  }

  getNotUsedDepartments = (dep: Department) => {
    return !this.list.items.find((item) => item['departmentId'] === dep.entityId);
  }

}
