erp-platform/ui/src/mocks/mockDepartments.ts
2025-09-15 12:31:47 +03:00

109 lines
2.6 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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ı
}
}
});