109 lines
2.6 KiB
TypeScript
109 lines
2.6 KiB
TypeScript
import { HrDepartment } from "../types/hr";
|
||
|
||
export const mockDepartments: HrDepartment[] = [
|
||
{
|
||
id: "1",
|
||
code: "ÜRT",
|
||
name: "Üretim",
|
||
description: "Üretim departmanı",
|
||
parentDepartmentId: undefined,
|
||
parentDepartment: undefined,
|
||
subDepartments: [],
|
||
managerId: "1",
|
||
manager: undefined,
|
||
costCenterId: "cc-005",
|
||
costCenter: undefined,
|
||
budget: 8500000,
|
||
isActive: true,
|
||
creationTime: new Date("2022-03-15"),
|
||
lastModificationTime: new Date("2024-01-15"),
|
||
},
|
||
{
|
||
id: "2",
|
||
code: "BAK",
|
||
name: "Bakım",
|
||
description: "Bakım departmanı",
|
||
parentDepartmentId: undefined,
|
||
parentDepartment: undefined,
|
||
subDepartments: [],
|
||
managerId: "7",
|
||
manager: undefined,
|
||
costCenterId: "cc-011",
|
||
costCenter: undefined,
|
||
budget: 2200000,
|
||
isActive: true,
|
||
creationTime: new Date("2022-03-15"),
|
||
lastModificationTime: new Date("2024-01-15"),
|
||
},
|
||
{
|
||
id: "3",
|
||
code: "KAL",
|
||
name: "Kalite Kontrol",
|
||
description: "Kalite kontrol departmanı",
|
||
parentDepartmentId: "1",
|
||
parentDepartment: undefined,
|
||
subDepartments: [],
|
||
managerId: "5",
|
||
manager: undefined,
|
||
costCenterId: "cc-007",
|
||
costCenter: undefined,
|
||
budget: 1200000,
|
||
isActive: true,
|
||
creationTime: new Date("2022-03-15"),
|
||
lastModificationTime: new Date("2024-01-15"),
|
||
},
|
||
{
|
||
id: "4",
|
||
code: "DEP",
|
||
name: "Depo",
|
||
description: "Depo departmanı",
|
||
parentDepartmentId: "1",
|
||
parentDepartment: undefined,
|
||
subDepartments: [],
|
||
managerId: "3",
|
||
manager: undefined,
|
||
costCenterId: "cc-008",
|
||
costCenter: undefined,
|
||
budget: 2800000,
|
||
isActive: true,
|
||
creationTime: new Date("2022-03-15"),
|
||
lastModificationTime: new Date("2024-01-15"),
|
||
},
|
||
{
|
||
id: "5",
|
||
code: "IDR",
|
||
name: "İdari İşler",
|
||
description: "İdari işler departmanı",
|
||
parentDepartmentId: undefined,
|
||
parentDepartment: undefined,
|
||
subDepartments: [],
|
||
managerId: "2",
|
||
manager: undefined,
|
||
costCenterId: "cc-001",
|
||
costCenter: undefined,
|
||
budget: 2500000,
|
||
isActive: true,
|
||
creationTime: new Date("2022-03-15"),
|
||
lastModificationTime: new Date("2024-01-15"),
|
||
},
|
||
];
|
||
|
||
mockDepartments.forEach((dept) => {
|
||
if (dept.parentDepartmentId) {
|
||
dept.parentDepartment = mockDepartments.find(
|
||
(d) => d.id === dept.parentDepartmentId
|
||
);
|
||
}
|
||
});
|
||
|
||
mockDepartments.forEach((dept) => {
|
||
if (dept.parentDepartmentId) {
|
||
const parent = mockDepartments.find(
|
||
(d) => d.id === dept.parentDepartmentId
|
||
);
|
||
if (parent) {
|
||
dept.parentDepartment = parent;
|
||
parent.subDepartments.push(dept); // subDepartments bağlantısı
|
||
}
|
||
}
|
||
});
|