From a4f4a8d3382f5c575be810224ad6bab7e2b6321c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sedat=20=C3=96ZT=C3=9CRK?= <76204082+iamsedatozturk@users.noreply.github.com> Date: Mon, 15 Sep 2025 12:31:47 +0300 Subject: [PATCH] =?UTF-8?q?erp=20mod=C3=BClleri=20initial?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/dev-dist/sw.js | 2 +- ui/src/components/common/DataTable.tsx | 165 + ui/src/components/common/InfoSection.tsx | 61 + ui/src/components/common/LoadingSpinner.tsx | 41 + ui/src/components/common/ModuleHeader.tsx | 64 + .../components/common/MultiSelectEmployee.tsx | 180 + ui/src/components/common/MultiSelectTeam.tsx | 190 + ui/src/components/common/StatusBadge.tsx | 89 + ui/src/components/common/Widget.tsx | 100 + ui/src/components/common/WidgetGroup.tsx | 47 + ui/src/components/common/iconList.ts | 1613 +++++++++ ui/src/mocks/mockActivities.ts | 174 + ui/src/mocks/mockActivityTypes.ts | 92 + ui/src/mocks/mockApprovalWorkflows.ts | 193 ++ ui/src/mocks/mockBOMs.ts | 319 ++ ui/src/mocks/mockBadges.ts | 88 + ui/src/mocks/mockBankMovements.ts | 43 + ui/src/mocks/mockBanks.ts | 45 + ui/src/mocks/mockBusinessParties.ts | 524 +++ ui/src/mocks/mockCashAccounts.ts | 26 + ui/src/mocks/mockCashMovements.ts | 29 + ui/src/mocks/mockChecks.ts | 44 + ui/src/mocks/mockCostCenters.ts | 184 + ui/src/mocks/mockCurrencies.ts | 5 + ui/src/mocks/mockCurrentAccountMovements.ts | 154 + ui/src/mocks/mockCurrentAccounts.ts | 115 + ui/src/mocks/mockDeliveries.ts | 149 + ui/src/mocks/mockDemandPlanning.ts | 163 + ui/src/mocks/mockDepartments.ts | 109 + ui/src/mocks/mockEmployeeLeaves.ts | 71 + ui/src/mocks/mockEmployeeTypes.ts | 59 + ui/src/mocks/mockEmployees.ts | 592 ++++ ui/src/mocks/mockEvaluation360.ts | 148 + ui/src/mocks/mockEvaluation360Results.ts | 519 +++ ui/src/mocks/mockEvaluation360Templates.ts | 283 ++ ui/src/mocks/mockFaultNotifications.ts | 131 + ui/src/mocks/mockInventoryCounts.ts | 112 + ui/src/mocks/mockInvoices.ts | 55 + ui/src/mocks/mockJobPositions.ts | 310 ++ ui/src/mocks/mockLocations.ts | 110 + ui/src/mocks/mockLossReasons.ts | 52 + ui/src/mocks/mockLotNumbers.ts | 42 + ui/src/mocks/mockMRP.ts | 168 + ui/src/mocks/mockMaintenanceCalendarEvent.ts | 86 + ui/src/mocks/mockMaintenancePlans.ts | 80 + ui/src/mocks/mockMaintenanceTeams.ts | 144 + ui/src/mocks/mockMaintenanceWorkOrders.ts | 204 ++ ui/src/mocks/mockMaterialGroups.ts | 68 + ui/src/mocks/mockMaterialTypes.ts | 52 + ui/src/mocks/mockMaterials.ts | 429 +++ ui/src/mocks/mockOperationTypes.ts | 79 + ui/src/mocks/mockOperations.ts | 106 + ui/src/mocks/mockOpportunities.ts | 56 + ui/src/mocks/mockOvertimes.ts | 151 + ui/src/mocks/mockPayrolls.ts | 95 + ui/src/mocks/mockProductionOrders.ts | 84 + ui/src/mocks/mockProjectCostTracking.ts | 80 + ui/src/mocks/mockProjectPhases.ts | 180 + ui/src/mocks/mockProjectTaskDailyUpdates.ts | 158 + ui/src/mocks/mockProjectTasks.ts | 85 + ui/src/mocks/mockProjects.ts | 233 ++ ui/src/mocks/mockPromissoryNotes.ts | 40 + ui/src/mocks/mockPurchaseOrders.ts | 217 ++ ui/src/mocks/mockPurchaseRequests.ts | 190 + ui/src/mocks/mockPurchaseRequisitions.ts | 50 + ui/src/mocks/mockPutawayRules.ts | 124 + ui/src/mocks/mockQuotations.ts | 198 ++ ui/src/mocks/mockRecentActivities.ts | 29 + ui/src/mocks/mockSalesOrders.ts | 675 ++++ ui/src/mocks/mockSalesTeams.ts | 241 ++ ui/src/mocks/mockSerialNumbers.ts | 40 + ui/src/mocks/mockStockItems.ts | 95 + ui/src/mocks/mockStockMovements.ts | 303 ++ ui/src/mocks/mockUnits.ts | 12 + ui/src/mocks/mockWarehouses.ts | 132 + ui/src/mocks/mockWaybills.ts | 220 ++ ui/src/mocks/mockWorkCenterTypes.ts | 32 + ui/src/mocks/mockWorkCenters.ts | 368 ++ ui/src/mocks/mockWorkOrders.ts | 217 ++ ui/src/mocks/mockZones.ts | 40 + ui/src/types/common.ts | 222 ++ ui/src/types/crm.ts | 269 ++ ui/src/types/fi.ts | 362 ++ ui/src/types/hr.ts | 702 ++++ ui/src/types/mm.ts | 662 ++++ ui/src/types/mrp.ts | 457 +++ ui/src/types/pm.ts | 278 ++ ui/src/types/ps.ts | 342 ++ ui/src/types/wm.ts | 246 ++ ui/src/utils/erp.tsx | 2700 +++++++++++++++ .../views/accounting/AccountingManagement.tsx | 42 + ui/src/views/accounting/BankPage.tsx | 226 ++ ui/src/views/accounting/CashPage.tsx | 184 + ui/src/views/accounting/CheckNotePage.tsx | 159 + .../views/accounting/CurrentAccountPage.tsx | 15 + ui/src/views/accounting/InvoicePage.tsx | 180 + ui/src/views/accounting/WaybillPage.tsx | 142 + .../components/BankAccountDetails.tsx | 477 +++ .../accounting/components/BankAccountForm.tsx | 467 +++ .../accounting/components/BankManagement.tsx | 676 ++++ .../components/BankMovementForm.tsx | 524 +++ .../components/CashAccountDetails.tsx | 331 ++ .../accounting/components/CashAccountForm.tsx | 291 ++ .../accounting/components/CashManagement.tsx | 543 +++ .../components/CashMovementForm.tsx | 374 ++ .../views/accounting/components/CheckForm.tsx | 456 +++ .../components/CheckNoteDetails.tsx | 390 +++ .../components/CheckNoteManagement.tsx | 1022 ++++++ .../components/CollectionDialog.tsx | 176 + .../components/CurrentAccountDetails.tsx | 312 ++ .../components/CurrentAccountForm.tsx | 465 +++ .../components/CurrentAccountManagement.tsx | 869 +++++ .../components/CurrentAccountMovementForm.tsx | 393 +++ .../components/EndorsementDialog.tsx | 182 + .../accounting/components/InvoiceDetails.tsx | 394 +++ .../accounting/components/InvoiceForm.tsx | 560 +++ .../components/InvoiceManagement.tsx | 568 +++ .../accounting/components/PaymentForm.tsx | 362 ++ .../components/PromissoryNoteForm.tsx | 398 +++ .../accounting/components/WaybillDetails.tsx | 380 ++ .../accounting/components/WaybillForm.tsx | 643 ++++ .../components/WaybillManagement.tsx | 531 +++ .../components/WaybillToInvoice.tsx | 275 ++ ui/src/views/crm/CRMManagement.tsx | 49 + .../views/crm/components/ActivityDetails.tsx | 420 +++ ui/src/views/crm/components/ActivityForm.tsx | 535 +++ .../views/crm/components/ActivityRecords.tsx | 674 ++++ ui/src/views/crm/components/CustomerCards.tsx | 532 +++ ui/src/views/crm/components/CustomerEdit.tsx | 781 +++++ ui/src/views/crm/components/CustomerForm.tsx | 560 +++ .../views/crm/components/CustomerFormNew.tsx | 553 +++ ui/src/views/crm/components/CustomerList.tsx | 451 +++ .../crm/components/CustomerListWithToggle.tsx | 60 + ui/src/views/crm/components/CustomerView.tsx | 1050 ++++++ .../crm/components/LossReasonCardView.tsx | 163 + .../views/crm/components/LossReasonModal.tsx | 259 ++ ui/src/views/crm/components/LossReasons.tsx | 519 +++ .../crm/components/OpportunityDetails.tsx | 371 ++ .../views/crm/components/OpportunityForm.tsx | 475 +++ .../crm/components/OpportunityManagement.tsx | 470 +++ .../views/crm/components/SalesOrderForm.tsx | 916 +++++ .../views/crm/components/SalesOrderView.tsx | 456 +++ ui/src/views/crm/components/SalesOrders.tsx | 414 +++ .../views/crm/components/SalesTeamCreate.tsx | 481 +++ ui/src/views/crm/components/SalesTeamEdit.tsx | 535 +++ ui/src/views/crm/components/SalesTeamView.tsx | 485 +++ ui/src/views/crm/components/SalesTeams.tsx | 496 +++ ui/src/views/hr/HRManagement.tsx | 49 + .../hr/components/BadgeAssignmentModal.tsx | 336 ++ ui/src/views/hr/components/BadgeEditModal.tsx | 426 +++ .../views/hr/components/BadgeManagement.tsx | 489 +++ .../hr/components/CostCenterFormModal.tsx | 311 ++ .../hr/components/CostCenterManagement.tsx | 513 +++ .../hr/components/CostCenterViewModal.tsx | 273 ++ .../hr/components/Degree360Evaluation.tsx | 3070 +++++++++++++++++ .../hr/components/Degree360Templates.tsx | 862 +++++ .../hr/components/DepartmentFormModal.tsx | 296 ++ .../hr/components/DepartmentManagement.tsx | 492 +++ .../hr/components/DepartmentViewModal.tsx | 272 ++ ui/src/views/hr/components/EmployeeCards.tsx | 202 ++ ui/src/views/hr/components/EmployeeForm.tsx | 894 +++++ ui/src/views/hr/components/EmployeeList.tsx | 637 ++++ ui/src/views/hr/components/EmployeeView.tsx | 77 + .../views/hr/components/EmployeeViewModal.tsx | 497 +++ .../views/hr/components/EmploymentTypes.tsx | 488 +++ .../hr/components/JobPositionFormModal.tsx | 549 +++ .../hr/components/JobPositionViewModal.tsx | 226 ++ ui/src/views/hr/components/JobPositions.tsx | 565 +++ .../views/hr/components/LeaveManagement.tsx | 1175 +++++++ .../views/hr/components/OrganizationChart.tsx | 720 ++++ .../hr/components/OvertimeManagement.tsx | 1240 +++++++ .../views/hr/components/PayrollManagement.tsx | 1490 ++++++++ .../maintenance/MaintenanceManagement.tsx | 41 + .../components/AssignNotificationModal.tsx | 250 ++ .../components/AssignWorkOrderModal.tsx | 268 ++ .../components/AssignWorkOrdersModal.tsx | 422 +++ .../ChangeNotificationStatusModal.tsx | 244 ++ .../components/ChangeWorkOrderStatusModal.tsx | 421 +++ .../CreateWorkOrderFromNotificationModal.tsx | 393 +++ .../components/CreateWorkOrderModal.tsx | 483 +++ .../components/EditFaultNotificationModal.tsx | 559 +++ .../components/EditMaintenancePlanModal.tsx | 518 +++ .../maintenance/components/EditTeamModal.tsx | 409 +++ .../components/EditWorkCenterModal.tsx | 506 +++ .../components/EditWorkOrderModal.tsx | 908 +++++ .../components/FaultNotifications.tsx | 625 ++++ .../components/MaintenanceCalendar.tsx | 535 +++ .../components/MaintenancePlanModal.tsx | 247 ++ .../components/MaintenancePlans.tsx | 537 +++ .../components/MaintenanceTeams.tsx | 534 +++ .../components/MaintenanceWorkOrders.tsx | 722 ++++ .../components/NewCalendarEventModal.tsx | 434 +++ .../components/NewFaultNotificationModal.tsx | 482 +++ .../components/NewMaintenancePlanModal.tsx | 512 +++ .../maintenance/components/NewTeamModal.tsx | 419 +++ .../components/NewWorkCenterModal.tsx | 430 +++ .../components/NewWorkOrderModal.tsx | 669 ++++ .../components/PlanStatusChangeModal.tsx | 349 ++ .../components/StartWorkOrderModal.tsx | 337 ++ .../components/StatusUpdateModal.tsx | 255 ++ .../components/TeamStatusChangeModal.tsx | 295 ++ .../components/ViewFaultNotificationModal.tsx | 342 ++ .../components/ViewMaintenancePlanModal.tsx | 412 +++ .../maintenance/components/ViewTeamModal.tsx | 289 ++ .../components/ViewWorkCenterModal.tsx | 373 ++ .../components/ViewWorkOrderModal.tsx | 483 +++ .../components/WorkCenterCards.tsx | 751 ++++ .../maintenance/components/WorkCenterForm.tsx | 718 ++++ .../maintenance/components/WorkCenterList.tsx | 457 +++ ui/src/views/mrp/MRPManagement.tsx | 41 + ui/src/views/mrp/components/BOMFormModal.tsx | 1018 ++++++ ui/src/views/mrp/components/BOMManagement.tsx | 367 ++ .../mrp/components/CompleteWorkOrderModal.tsx | 168 + .../components/DemandForecastFormModal.tsx | 225 ++ .../views/mrp/components/DemandPlanning.tsx | 837 +++++ .../mrp/components/EditWorkOrderForm.tsx | 353 ++ .../MaterialRequirementFormModal.tsx | 231 ++ .../mrp/components/MaterialRequirements.tsx | 267 ++ .../views/mrp/components/NewWorkOrderForm.tsx | 325 ++ .../mrp/components/OperationDefinitions.tsx | 422 +++ ui/src/views/mrp/components/OperationForm.tsx | 623 ++++ .../mrp/components/OperationFormModal.tsx | 364 ++ .../mrp/components/OperationTypeFormModal.tsx | 209 ++ .../views/mrp/components/OperationTypes.tsx | 375 ++ ui/src/views/mrp/components/PlanningGantt.tsx | 623 ++++ .../mrp/components/ProductionOrderForm.tsx | 718 ++++ .../mrp/components/ProductionOrderList.tsx | 1342 +++++++ .../mrp/components/ProductionOrderView.tsx | 506 +++ .../mrp/components/ProductionSuggestions.tsx | 442 +++ .../mrp/components/PurchaseSuggestions.tsx | 428 +++ ui/src/views/mrp/components/Requirements.tsx | 209 ++ ui/src/views/mrp/components/RunMrpModal.tsx | 214 ++ .../mrp/components/ViewWorkOrderModal.tsx | 353 ++ ui/src/views/mrp/components/WorkOrders.tsx | 521 +++ ui/src/views/project/ProjectManagement.tsx | 44 + .../components/ActivityTypeFormModal.tsx | 293 ++ .../project/components/ActivityTypes.tsx | 507 +++ .../project/components/CostTimeTracking.tsx | 530 +++ .../components/DocumentUploadModal.tsx | 225 ++ .../components/DocumentViewerModal.tsx | 205 ++ .../project/components/PhaseEditModal.tsx | 461 +++ .../project/components/PhaseViewModal.tsx | 198 ++ .../views/project/components/ProjectForm.tsx | 1942 +++++++++++ .../views/project/components/ProjectGantt.tsx | 713 ++++ .../views/project/components/ProjectList.tsx | 679 ++++ .../project/components/ProjectPhases.tsx | 1113 ++++++ .../views/project/components/ProjectTasks.tsx | 1163 +++++++ .../views/project/components/ProjectView.tsx | 1126 ++++++ ui/src/views/project/components/RiskModal.tsx | 365 ++ .../project/components/TaskDailyUpdates.tsx | 601 ++++ .../project/components/TaskEditModal.tsx | 518 +++ .../project/components/TaskViewModal.tsx | 238 ++ .../supplyChain/SupplyChainManagement.tsx | 55 + .../components/ApprovalWorkflowModal.tsx | 429 +++ .../components/ApprovalWorkflows.tsx | 404 +++ .../components/DeliveryTracking.tsx | 611 ++++ .../components/DeliveryTrackingModal.tsx | 553 +++ .../supplyChain/components/MaterialCard.tsx | 550 +++ .../supplyChain/components/MaterialForm.tsx | 1325 +++++++ .../supplyChain/components/MaterialGroup.tsx | 614 ++++ .../supplyChain/components/MaterialList.tsx | 686 ++++ .../supplyChain/components/MaterialTypes.tsx | 411 +++ .../components/OrderManagement.tsx | 676 ++++ .../components/OrderManagementForm.tsx | 857 +++++ .../components/PurchaseRequestForm.tsx | 661 ++++ .../components/PurchaseRequests.tsx | 334 ++ .../components/PurchaseRequisitionList.tsx | 437 +++ .../supplyChain/components/QuotationForm.tsx | 780 +++++ .../components/QuotationManagement.tsx | 792 +++++ .../components/SupplierCardModal.tsx | 411 +++ .../supplyChain/components/SupplierCards.tsx | 556 +++ .../supplyChain/components/SupplierForm.tsx | 902 +++++ .../supplyChain/components/SupplierList.tsx | 458 +++ .../views/warehouse/WarehouseManagement.tsx | 43 + .../components/InventoryTracking.tsx | 528 +++ .../warehouse/components/LocationTracking.tsx | 547 +++ ui/src/views/warehouse/components/LotForm.tsx | 272 ++ .../components/MaterialMovements.tsx | 382 ++ .../warehouse/components/PutawayRules.tsx | 1066 ++++++ .../views/warehouse/components/SerialForm.tsx | 233 ++ .../components/StockLevelsInventory.tsx | 2695 +++++++++++++++ .../components/WarehouseDefinitions.tsx | 1225 +++++++ .../warehouse/components/WarehouseForm.tsx | 595 ++++ .../warehouse/components/WarehouseIssue.tsx | 1709 +++++++++ .../warehouse/components/WarehouseList.tsx | 448 +++ .../warehouse/components/WarehouseReceipt.tsx | 1506 ++++++++ .../components/WarehouseTransfer.tsx | 1889 ++++++++++ .../components/modals/LocationModal.tsx | 615 ++++ .../components/modals/WarehouseModal.tsx | 419 +++ .../warehouse/components/modals/ZoneModal.tsx | 363 ++ .../warehouse/components/modals/index.ts | 3 + 291 files changed, 126124 insertions(+), 1 deletion(-) create mode 100644 ui/src/components/common/DataTable.tsx create mode 100644 ui/src/components/common/InfoSection.tsx create mode 100644 ui/src/components/common/LoadingSpinner.tsx create mode 100644 ui/src/components/common/ModuleHeader.tsx create mode 100644 ui/src/components/common/MultiSelectEmployee.tsx create mode 100644 ui/src/components/common/MultiSelectTeam.tsx create mode 100644 ui/src/components/common/StatusBadge.tsx create mode 100644 ui/src/components/common/Widget.tsx create mode 100644 ui/src/components/common/WidgetGroup.tsx create mode 100644 ui/src/components/common/iconList.ts create mode 100644 ui/src/mocks/mockActivities.ts create mode 100644 ui/src/mocks/mockActivityTypes.ts create mode 100644 ui/src/mocks/mockApprovalWorkflows.ts create mode 100644 ui/src/mocks/mockBOMs.ts create mode 100644 ui/src/mocks/mockBadges.ts create mode 100644 ui/src/mocks/mockBankMovements.ts create mode 100644 ui/src/mocks/mockBanks.ts create mode 100644 ui/src/mocks/mockBusinessParties.ts create mode 100644 ui/src/mocks/mockCashAccounts.ts create mode 100644 ui/src/mocks/mockCashMovements.ts create mode 100644 ui/src/mocks/mockChecks.ts create mode 100644 ui/src/mocks/mockCostCenters.ts create mode 100644 ui/src/mocks/mockCurrencies.ts create mode 100644 ui/src/mocks/mockCurrentAccountMovements.ts create mode 100644 ui/src/mocks/mockCurrentAccounts.ts create mode 100644 ui/src/mocks/mockDeliveries.ts create mode 100644 ui/src/mocks/mockDemandPlanning.ts create mode 100644 ui/src/mocks/mockDepartments.ts create mode 100644 ui/src/mocks/mockEmployeeLeaves.ts create mode 100644 ui/src/mocks/mockEmployeeTypes.ts create mode 100644 ui/src/mocks/mockEmployees.ts create mode 100644 ui/src/mocks/mockEvaluation360.ts create mode 100644 ui/src/mocks/mockEvaluation360Results.ts create mode 100644 ui/src/mocks/mockEvaluation360Templates.ts create mode 100644 ui/src/mocks/mockFaultNotifications.ts create mode 100644 ui/src/mocks/mockInventoryCounts.ts create mode 100644 ui/src/mocks/mockInvoices.ts create mode 100644 ui/src/mocks/mockJobPositions.ts create mode 100644 ui/src/mocks/mockLocations.ts create mode 100644 ui/src/mocks/mockLossReasons.ts create mode 100644 ui/src/mocks/mockLotNumbers.ts create mode 100644 ui/src/mocks/mockMRP.ts create mode 100644 ui/src/mocks/mockMaintenanceCalendarEvent.ts create mode 100644 ui/src/mocks/mockMaintenancePlans.ts create mode 100644 ui/src/mocks/mockMaintenanceTeams.ts create mode 100644 ui/src/mocks/mockMaintenanceWorkOrders.ts create mode 100644 ui/src/mocks/mockMaterialGroups.ts create mode 100644 ui/src/mocks/mockMaterialTypes.ts create mode 100644 ui/src/mocks/mockMaterials.ts create mode 100644 ui/src/mocks/mockOperationTypes.ts create mode 100644 ui/src/mocks/mockOperations.ts create mode 100644 ui/src/mocks/mockOpportunities.ts create mode 100644 ui/src/mocks/mockOvertimes.ts create mode 100644 ui/src/mocks/mockPayrolls.ts create mode 100644 ui/src/mocks/mockProductionOrders.ts create mode 100644 ui/src/mocks/mockProjectCostTracking.ts create mode 100644 ui/src/mocks/mockProjectPhases.ts create mode 100644 ui/src/mocks/mockProjectTaskDailyUpdates.ts create mode 100644 ui/src/mocks/mockProjectTasks.ts create mode 100644 ui/src/mocks/mockProjects.ts create mode 100644 ui/src/mocks/mockPromissoryNotes.ts create mode 100644 ui/src/mocks/mockPurchaseOrders.ts create mode 100644 ui/src/mocks/mockPurchaseRequests.ts create mode 100644 ui/src/mocks/mockPurchaseRequisitions.ts create mode 100644 ui/src/mocks/mockPutawayRules.ts create mode 100644 ui/src/mocks/mockQuotations.ts create mode 100644 ui/src/mocks/mockRecentActivities.ts create mode 100644 ui/src/mocks/mockSalesOrders.ts create mode 100644 ui/src/mocks/mockSalesTeams.ts create mode 100644 ui/src/mocks/mockSerialNumbers.ts create mode 100644 ui/src/mocks/mockStockItems.ts create mode 100644 ui/src/mocks/mockStockMovements.ts create mode 100644 ui/src/mocks/mockUnits.ts create mode 100644 ui/src/mocks/mockWarehouses.ts create mode 100644 ui/src/mocks/mockWaybills.ts create mode 100644 ui/src/mocks/mockWorkCenterTypes.ts create mode 100644 ui/src/mocks/mockWorkCenters.ts create mode 100644 ui/src/mocks/mockWorkOrders.ts create mode 100644 ui/src/mocks/mockZones.ts create mode 100644 ui/src/types/common.ts create mode 100644 ui/src/types/crm.ts create mode 100644 ui/src/types/fi.ts create mode 100644 ui/src/types/hr.ts create mode 100644 ui/src/types/mm.ts create mode 100644 ui/src/types/mrp.ts create mode 100644 ui/src/types/pm.ts create mode 100644 ui/src/types/ps.ts create mode 100644 ui/src/types/wm.ts create mode 100644 ui/src/utils/erp.tsx create mode 100644 ui/src/views/accounting/AccountingManagement.tsx create mode 100644 ui/src/views/accounting/BankPage.tsx create mode 100644 ui/src/views/accounting/CashPage.tsx create mode 100644 ui/src/views/accounting/CheckNotePage.tsx create mode 100644 ui/src/views/accounting/CurrentAccountPage.tsx create mode 100644 ui/src/views/accounting/InvoicePage.tsx create mode 100644 ui/src/views/accounting/WaybillPage.tsx create mode 100644 ui/src/views/accounting/components/BankAccountDetails.tsx create mode 100644 ui/src/views/accounting/components/BankAccountForm.tsx create mode 100644 ui/src/views/accounting/components/BankManagement.tsx create mode 100644 ui/src/views/accounting/components/BankMovementForm.tsx create mode 100644 ui/src/views/accounting/components/CashAccountDetails.tsx create mode 100644 ui/src/views/accounting/components/CashAccountForm.tsx create mode 100644 ui/src/views/accounting/components/CashManagement.tsx create mode 100644 ui/src/views/accounting/components/CashMovementForm.tsx create mode 100644 ui/src/views/accounting/components/CheckForm.tsx create mode 100644 ui/src/views/accounting/components/CheckNoteDetails.tsx create mode 100644 ui/src/views/accounting/components/CheckNoteManagement.tsx create mode 100644 ui/src/views/accounting/components/CollectionDialog.tsx create mode 100644 ui/src/views/accounting/components/CurrentAccountDetails.tsx create mode 100644 ui/src/views/accounting/components/CurrentAccountForm.tsx create mode 100644 ui/src/views/accounting/components/CurrentAccountManagement.tsx create mode 100644 ui/src/views/accounting/components/CurrentAccountMovementForm.tsx create mode 100644 ui/src/views/accounting/components/EndorsementDialog.tsx create mode 100644 ui/src/views/accounting/components/InvoiceDetails.tsx create mode 100644 ui/src/views/accounting/components/InvoiceForm.tsx create mode 100644 ui/src/views/accounting/components/InvoiceManagement.tsx create mode 100644 ui/src/views/accounting/components/PaymentForm.tsx create mode 100644 ui/src/views/accounting/components/PromissoryNoteForm.tsx create mode 100644 ui/src/views/accounting/components/WaybillDetails.tsx create mode 100644 ui/src/views/accounting/components/WaybillForm.tsx create mode 100644 ui/src/views/accounting/components/WaybillManagement.tsx create mode 100644 ui/src/views/accounting/components/WaybillToInvoice.tsx create mode 100644 ui/src/views/crm/CRMManagement.tsx create mode 100644 ui/src/views/crm/components/ActivityDetails.tsx create mode 100644 ui/src/views/crm/components/ActivityForm.tsx create mode 100644 ui/src/views/crm/components/ActivityRecords.tsx create mode 100644 ui/src/views/crm/components/CustomerCards.tsx create mode 100644 ui/src/views/crm/components/CustomerEdit.tsx create mode 100644 ui/src/views/crm/components/CustomerForm.tsx create mode 100644 ui/src/views/crm/components/CustomerFormNew.tsx create mode 100644 ui/src/views/crm/components/CustomerList.tsx create mode 100644 ui/src/views/crm/components/CustomerListWithToggle.tsx create mode 100644 ui/src/views/crm/components/CustomerView.tsx create mode 100644 ui/src/views/crm/components/LossReasonCardView.tsx create mode 100644 ui/src/views/crm/components/LossReasonModal.tsx create mode 100644 ui/src/views/crm/components/LossReasons.tsx create mode 100644 ui/src/views/crm/components/OpportunityDetails.tsx create mode 100644 ui/src/views/crm/components/OpportunityForm.tsx create mode 100644 ui/src/views/crm/components/OpportunityManagement.tsx create mode 100644 ui/src/views/crm/components/SalesOrderForm.tsx create mode 100644 ui/src/views/crm/components/SalesOrderView.tsx create mode 100644 ui/src/views/crm/components/SalesOrders.tsx create mode 100644 ui/src/views/crm/components/SalesTeamCreate.tsx create mode 100644 ui/src/views/crm/components/SalesTeamEdit.tsx create mode 100644 ui/src/views/crm/components/SalesTeamView.tsx create mode 100644 ui/src/views/crm/components/SalesTeams.tsx create mode 100644 ui/src/views/hr/HRManagement.tsx create mode 100644 ui/src/views/hr/components/BadgeAssignmentModal.tsx create mode 100644 ui/src/views/hr/components/BadgeEditModal.tsx create mode 100644 ui/src/views/hr/components/BadgeManagement.tsx create mode 100644 ui/src/views/hr/components/CostCenterFormModal.tsx create mode 100644 ui/src/views/hr/components/CostCenterManagement.tsx create mode 100644 ui/src/views/hr/components/CostCenterViewModal.tsx create mode 100644 ui/src/views/hr/components/Degree360Evaluation.tsx create mode 100644 ui/src/views/hr/components/Degree360Templates.tsx create mode 100644 ui/src/views/hr/components/DepartmentFormModal.tsx create mode 100644 ui/src/views/hr/components/DepartmentManagement.tsx create mode 100644 ui/src/views/hr/components/DepartmentViewModal.tsx create mode 100644 ui/src/views/hr/components/EmployeeCards.tsx create mode 100644 ui/src/views/hr/components/EmployeeForm.tsx create mode 100644 ui/src/views/hr/components/EmployeeList.tsx create mode 100644 ui/src/views/hr/components/EmployeeView.tsx create mode 100644 ui/src/views/hr/components/EmployeeViewModal.tsx create mode 100644 ui/src/views/hr/components/EmploymentTypes.tsx create mode 100644 ui/src/views/hr/components/JobPositionFormModal.tsx create mode 100644 ui/src/views/hr/components/JobPositionViewModal.tsx create mode 100644 ui/src/views/hr/components/JobPositions.tsx create mode 100644 ui/src/views/hr/components/LeaveManagement.tsx create mode 100644 ui/src/views/hr/components/OrganizationChart.tsx create mode 100644 ui/src/views/hr/components/OvertimeManagement.tsx create mode 100644 ui/src/views/hr/components/PayrollManagement.tsx create mode 100644 ui/src/views/maintenance/MaintenanceManagement.tsx create mode 100644 ui/src/views/maintenance/components/AssignNotificationModal.tsx create mode 100644 ui/src/views/maintenance/components/AssignWorkOrderModal.tsx create mode 100644 ui/src/views/maintenance/components/AssignWorkOrdersModal.tsx create mode 100644 ui/src/views/maintenance/components/ChangeNotificationStatusModal.tsx create mode 100644 ui/src/views/maintenance/components/ChangeWorkOrderStatusModal.tsx create mode 100644 ui/src/views/maintenance/components/CreateWorkOrderFromNotificationModal.tsx create mode 100644 ui/src/views/maintenance/components/CreateWorkOrderModal.tsx create mode 100644 ui/src/views/maintenance/components/EditFaultNotificationModal.tsx create mode 100644 ui/src/views/maintenance/components/EditMaintenancePlanModal.tsx create mode 100644 ui/src/views/maintenance/components/EditTeamModal.tsx create mode 100644 ui/src/views/maintenance/components/EditWorkCenterModal.tsx create mode 100644 ui/src/views/maintenance/components/EditWorkOrderModal.tsx create mode 100644 ui/src/views/maintenance/components/FaultNotifications.tsx create mode 100644 ui/src/views/maintenance/components/MaintenanceCalendar.tsx create mode 100644 ui/src/views/maintenance/components/MaintenancePlanModal.tsx create mode 100644 ui/src/views/maintenance/components/MaintenancePlans.tsx create mode 100644 ui/src/views/maintenance/components/MaintenanceTeams.tsx create mode 100644 ui/src/views/maintenance/components/MaintenanceWorkOrders.tsx create mode 100644 ui/src/views/maintenance/components/NewCalendarEventModal.tsx create mode 100644 ui/src/views/maintenance/components/NewFaultNotificationModal.tsx create mode 100644 ui/src/views/maintenance/components/NewMaintenancePlanModal.tsx create mode 100644 ui/src/views/maintenance/components/NewTeamModal.tsx create mode 100644 ui/src/views/maintenance/components/NewWorkCenterModal.tsx create mode 100644 ui/src/views/maintenance/components/NewWorkOrderModal.tsx create mode 100644 ui/src/views/maintenance/components/PlanStatusChangeModal.tsx create mode 100644 ui/src/views/maintenance/components/StartWorkOrderModal.tsx create mode 100644 ui/src/views/maintenance/components/StatusUpdateModal.tsx create mode 100644 ui/src/views/maintenance/components/TeamStatusChangeModal.tsx create mode 100644 ui/src/views/maintenance/components/ViewFaultNotificationModal.tsx create mode 100644 ui/src/views/maintenance/components/ViewMaintenancePlanModal.tsx create mode 100644 ui/src/views/maintenance/components/ViewTeamModal.tsx create mode 100644 ui/src/views/maintenance/components/ViewWorkCenterModal.tsx create mode 100644 ui/src/views/maintenance/components/ViewWorkOrderModal.tsx create mode 100644 ui/src/views/maintenance/components/WorkCenterCards.tsx create mode 100644 ui/src/views/maintenance/components/WorkCenterForm.tsx create mode 100644 ui/src/views/maintenance/components/WorkCenterList.tsx create mode 100644 ui/src/views/mrp/MRPManagement.tsx create mode 100644 ui/src/views/mrp/components/BOMFormModal.tsx create mode 100644 ui/src/views/mrp/components/BOMManagement.tsx create mode 100644 ui/src/views/mrp/components/CompleteWorkOrderModal.tsx create mode 100644 ui/src/views/mrp/components/DemandForecastFormModal.tsx create mode 100644 ui/src/views/mrp/components/DemandPlanning.tsx create mode 100644 ui/src/views/mrp/components/EditWorkOrderForm.tsx create mode 100644 ui/src/views/mrp/components/MaterialRequirementFormModal.tsx create mode 100644 ui/src/views/mrp/components/MaterialRequirements.tsx create mode 100644 ui/src/views/mrp/components/NewWorkOrderForm.tsx create mode 100644 ui/src/views/mrp/components/OperationDefinitions.tsx create mode 100644 ui/src/views/mrp/components/OperationForm.tsx create mode 100644 ui/src/views/mrp/components/OperationFormModal.tsx create mode 100644 ui/src/views/mrp/components/OperationTypeFormModal.tsx create mode 100644 ui/src/views/mrp/components/OperationTypes.tsx create mode 100644 ui/src/views/mrp/components/PlanningGantt.tsx create mode 100644 ui/src/views/mrp/components/ProductionOrderForm.tsx create mode 100644 ui/src/views/mrp/components/ProductionOrderList.tsx create mode 100644 ui/src/views/mrp/components/ProductionOrderView.tsx create mode 100644 ui/src/views/mrp/components/ProductionSuggestions.tsx create mode 100644 ui/src/views/mrp/components/PurchaseSuggestions.tsx create mode 100644 ui/src/views/mrp/components/Requirements.tsx create mode 100644 ui/src/views/mrp/components/RunMrpModal.tsx create mode 100644 ui/src/views/mrp/components/ViewWorkOrderModal.tsx create mode 100644 ui/src/views/mrp/components/WorkOrders.tsx create mode 100644 ui/src/views/project/ProjectManagement.tsx create mode 100644 ui/src/views/project/components/ActivityTypeFormModal.tsx create mode 100644 ui/src/views/project/components/ActivityTypes.tsx create mode 100644 ui/src/views/project/components/CostTimeTracking.tsx create mode 100644 ui/src/views/project/components/DocumentUploadModal.tsx create mode 100644 ui/src/views/project/components/DocumentViewerModal.tsx create mode 100644 ui/src/views/project/components/PhaseEditModal.tsx create mode 100644 ui/src/views/project/components/PhaseViewModal.tsx create mode 100644 ui/src/views/project/components/ProjectForm.tsx create mode 100644 ui/src/views/project/components/ProjectGantt.tsx create mode 100644 ui/src/views/project/components/ProjectList.tsx create mode 100644 ui/src/views/project/components/ProjectPhases.tsx create mode 100644 ui/src/views/project/components/ProjectTasks.tsx create mode 100644 ui/src/views/project/components/ProjectView.tsx create mode 100644 ui/src/views/project/components/RiskModal.tsx create mode 100644 ui/src/views/project/components/TaskDailyUpdates.tsx create mode 100644 ui/src/views/project/components/TaskEditModal.tsx create mode 100644 ui/src/views/project/components/TaskViewModal.tsx create mode 100644 ui/src/views/supplyChain/SupplyChainManagement.tsx create mode 100644 ui/src/views/supplyChain/components/ApprovalWorkflowModal.tsx create mode 100644 ui/src/views/supplyChain/components/ApprovalWorkflows.tsx create mode 100644 ui/src/views/supplyChain/components/DeliveryTracking.tsx create mode 100644 ui/src/views/supplyChain/components/DeliveryTrackingModal.tsx create mode 100644 ui/src/views/supplyChain/components/MaterialCard.tsx create mode 100644 ui/src/views/supplyChain/components/MaterialForm.tsx create mode 100644 ui/src/views/supplyChain/components/MaterialGroup.tsx create mode 100644 ui/src/views/supplyChain/components/MaterialList.tsx create mode 100644 ui/src/views/supplyChain/components/MaterialTypes.tsx create mode 100644 ui/src/views/supplyChain/components/OrderManagement.tsx create mode 100644 ui/src/views/supplyChain/components/OrderManagementForm.tsx create mode 100644 ui/src/views/supplyChain/components/PurchaseRequestForm.tsx create mode 100644 ui/src/views/supplyChain/components/PurchaseRequests.tsx create mode 100644 ui/src/views/supplyChain/components/PurchaseRequisitionList.tsx create mode 100644 ui/src/views/supplyChain/components/QuotationForm.tsx create mode 100644 ui/src/views/supplyChain/components/QuotationManagement.tsx create mode 100644 ui/src/views/supplyChain/components/SupplierCardModal.tsx create mode 100644 ui/src/views/supplyChain/components/SupplierCards.tsx create mode 100644 ui/src/views/supplyChain/components/SupplierForm.tsx create mode 100644 ui/src/views/supplyChain/components/SupplierList.tsx create mode 100644 ui/src/views/warehouse/WarehouseManagement.tsx create mode 100644 ui/src/views/warehouse/components/InventoryTracking.tsx create mode 100644 ui/src/views/warehouse/components/LocationTracking.tsx create mode 100644 ui/src/views/warehouse/components/LotForm.tsx create mode 100644 ui/src/views/warehouse/components/MaterialMovements.tsx create mode 100644 ui/src/views/warehouse/components/PutawayRules.tsx create mode 100644 ui/src/views/warehouse/components/SerialForm.tsx create mode 100644 ui/src/views/warehouse/components/StockLevelsInventory.tsx create mode 100644 ui/src/views/warehouse/components/WarehouseDefinitions.tsx create mode 100644 ui/src/views/warehouse/components/WarehouseForm.tsx create mode 100644 ui/src/views/warehouse/components/WarehouseIssue.tsx create mode 100644 ui/src/views/warehouse/components/WarehouseList.tsx create mode 100644 ui/src/views/warehouse/components/WarehouseReceipt.tsx create mode 100644 ui/src/views/warehouse/components/WarehouseTransfer.tsx create mode 100644 ui/src/views/warehouse/components/modals/LocationModal.tsx create mode 100644 ui/src/views/warehouse/components/modals/WarehouseModal.tsx create mode 100644 ui/src/views/warehouse/components/modals/ZoneModal.tsx create mode 100644 ui/src/views/warehouse/components/modals/index.ts diff --git a/ui/dev-dist/sw.js b/ui/dev-dist/sw.js index 3f4009b6..df068850 100644 --- a/ui/dev-dist/sw.js +++ b/ui/dev-dist/sw.js @@ -82,7 +82,7 @@ define(['./workbox-a959eb95'], (function (workbox) { 'use strict'; "revision": "3ca0b8505b4bec776b69afdba2768812" }, { "url": "/index.html", - "revision": "0.g281p2a917g" + "revision": "0.jnromdj77f8" }], {}); workbox.cleanupOutdatedCaches(); workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("/index.html"), { diff --git a/ui/src/components/common/DataTable.tsx b/ui/src/components/common/DataTable.tsx new file mode 100644 index 00000000..055ac409 --- /dev/null +++ b/ui/src/components/common/DataTable.tsx @@ -0,0 +1,165 @@ +import React from "react"; +import classNames from "classnames"; +import { FaChevronUp, FaChevronDown, FaBox } from "react-icons/fa"; + +export interface Column { + key: keyof T | string; + header: string; + width?: string; + sortable?: boolean; + render?: (item: T) => React.ReactNode; +} + +interface DataTableProps { + data: T[]; + columns: Column[]; + loading?: boolean; + sortBy?: string; + sortDirection?: "asc" | "desc"; + onSort?: (key: string) => void; + className?: string; + selectable?: boolean; // ✅ ekledik + selectedKeys?: string[]; // ✅ ekledik + onSelectionChange?: (keys: string[]) => void; // ✅ ekledik +} + +function DataTable({ + data, + columns, + loading = false, + sortBy, + sortDirection, + onSort, + className, + selectable = false, + selectedKeys = [], + onSelectionChange, +}: DataTableProps) { + const allSelected = data.length > 0 && selectedKeys.length === data.length; + + const handleSelectAll = (checked: boolean) => { + if (!onSelectionChange) return; + if (checked) { + onSelectionChange(data.map((d) => d.id)); + } else { + onSelectionChange([]); + } + }; + + const handleSelectRow = (id: string, checked: boolean) => { + if (!onSelectionChange) return; + if (checked) { + onSelectionChange([...selectedKeys, id]); + } else { + onSelectionChange(selectedKeys.filter((k) => k !== id)); + } + }; + + if (loading) { + // (loading skeleton senin kodundaki gibi kalabilir) + } + + return ( +
+
+ + + + {selectable && ( + + )} + {columns.map((column) => ( + + ))} + + + + + {data.map((item) => ( + + {selectable && ( + + )} + {columns.map((column) => ( + + ))} + + ))} + +
+ handleSelectAll(e.target.checked)} + /> + + column.sortable && onSort && onSort(String(column.key)) + } + > +
+ {column.header} + {column.sortable && onSort && ( +
+ {sortBy === column.key ? ( + sortDirection === "asc" ? ( + + ) : ( + + ) + ) : ( +
+ )} +
+ )} +
+
+ + handleSelectRow(item.id, e.target.checked) + } + /> + + {column.render + ? column.render(item) + : String((item as any)[column.key] || "-")} +
+
+ + {data.length === 0 && ( +
+
+ +
+

Veri bulunamadı

+

+ Kriterlere uygun kayıt bulunmuyor. +

+
+ )} +
+ ); +} + +export default DataTable; diff --git a/ui/src/components/common/InfoSection.tsx b/ui/src/components/common/InfoSection.tsx new file mode 100644 index 00000000..b01715dd --- /dev/null +++ b/ui/src/components/common/InfoSection.tsx @@ -0,0 +1,61 @@ +import classNames from "classnames"; + +interface InfoSectionProps { + title: string; + children: React.ReactNode; +} + +export const InfoSection: React.FC = ({ + title, + children, +}) => ( +
+

+ {title} +

+
{children}
+
+); + +interface InfoItemProps { + label: string; + value: string | number; + isMono?: boolean; + isBold?: boolean; + isBadge?: boolean; + badgeColor?: string; +} + +export const InfoItem: React.FC = ({ + label, + value, + isMono, + isBold, + isBadge, + badgeColor, +}) => ( +
+ + {isBadge ? ( +

+ + {value} + +

+ ) : ( +

+ {value} +

+ )} +
+); diff --git a/ui/src/components/common/LoadingSpinner.tsx b/ui/src/components/common/LoadingSpinner.tsx new file mode 100644 index 00000000..80d8ccc7 --- /dev/null +++ b/ui/src/components/common/LoadingSpinner.tsx @@ -0,0 +1,41 @@ +import React from 'react'; +import classNames from 'classnames'; + +interface LoadingSpinnerProps { + size?: 'sm' | 'md' | 'lg'; + color?: 'blue' | 'white' | 'gray'; + text?: string; +} + +const LoadingSpinner: React.FC = ({ + size = 'md', + color = 'blue', + text +}) => { + const sizeClasses = { + sm: 'h-4 w-4', + md: 'h-6 w-6', + lg: 'h-8 w-8' + }; + + const colorClasses = { + blue: 'border-blue-600', + white: 'border-white', + gray: 'border-gray-600' + }; + + return ( +
+
+ {text && {text}} +
+ ); +}; + +export default LoadingSpinner; \ No newline at end of file diff --git a/ui/src/components/common/ModuleHeader.tsx b/ui/src/components/common/ModuleHeader.tsx new file mode 100644 index 00000000..dc23c191 --- /dev/null +++ b/ui/src/components/common/ModuleHeader.tsx @@ -0,0 +1,64 @@ +import React from "react"; + +interface ModuleHeaderProps { + title: string; + breadcrumbs?: Array<{ + name: string; + href?: string; + }>; +} + +const ModuleHeader: React.FC = ({ + title, + breadcrumbs = [], +}) => { + return ( +
+ {/* Breadcrumb Navigation */} + +
+ ); +}; + +export default ModuleHeader; diff --git a/ui/src/components/common/MultiSelectEmployee.tsx b/ui/src/components/common/MultiSelectEmployee.tsx new file mode 100644 index 00000000..3e6d5aee --- /dev/null +++ b/ui/src/components/common/MultiSelectEmployee.tsx @@ -0,0 +1,180 @@ +import React, { useState, useRef, useEffect } from "react"; +import { FaChevronDown, FaTimes } from "react-icons/fa"; +import { mockEmployees } from "../../mocks/mockEmployees"; +import { HrEmployee } from "../../types/hr"; + +interface MultiSelectEmployeeProps { + selectedEmployees: string[]; + onChange: (employeeIds: string[]) => void; + placeholder?: string; + disabled?: boolean; + className?: string; +} + +const MultiSelectEmployee: React.FC = ({ + selectedEmployees, + onChange, + placeholder = "Personel seçin", + disabled = false, + className = "", +}) => { + const [isOpen, setIsOpen] = useState(false); + const [searchTerm, setSearchTerm] = useState(""); + const dropdownRef = useRef(null); + + useEffect(() => { + const handleClickOutside = (event: MouseEvent) => { + if ( + dropdownRef.current && + !dropdownRef.current.contains(event.target as Node) + ) { + setIsOpen(false); + setSearchTerm(""); + } + }; + + document.addEventListener("mousedown", handleClickOutside); + return () => { + document.removeEventListener("mousedown", handleClickOutside); + }; + }, []); + + const filteredEmployees = mockEmployees.filter( + (employee: HrEmployee) => + employee.fullName.toLowerCase().includes(searchTerm.toLowerCase()) || + employee.code.toLowerCase().includes(searchTerm.toLowerCase()) + ); + + const handleEmployeeToggle = (employeeId: string) => { + if (selectedEmployees.includes(employeeId)) { + onChange(selectedEmployees.filter((id) => id !== employeeId)); + } else { + onChange([...selectedEmployees, employeeId]); + } + }; + + const handleRemoveEmployee = (employeeId: string, e: React.MouseEvent) => { + e.stopPropagation(); + onChange(selectedEmployees.filter((id) => id !== employeeId)); + }; + + const selectedEmployeeObjects = mockEmployees.filter((emp: HrEmployee) => + selectedEmployees.includes(emp.id) + ); + + return ( +
+
!disabled && setIsOpen(!isOpen)} + > +
+
+ {selectedEmployeeObjects.length > 0 ? ( + selectedEmployeeObjects.map((employee: HrEmployee) => ( + + {employee.fullName} + {!disabled && ( + + )} + + )) + ) : ( + {placeholder} + )} +
+ {!disabled && ( + + )} +
+
+ + {isOpen && !disabled && ( +
+ {/* Search Input */} +
+ setSearchTerm(e.target.value)} + className="w-full px-3 py-2 text-sm border border-gray-300 rounded focus:ring-1 focus:ring-blue-500 focus:border-blue-500" + onClick={(e) => e.stopPropagation()} + /> +
+ + {/* Options List */} +
+ {filteredEmployees.length > 0 ? ( + filteredEmployees.map((employee: HrEmployee) => ( +
handleEmployeeToggle(employee.id)} + > +
+
+ {employee.fullName} +
+
+ {employee.code} - {employee.jobPosition?.name} +
+
+ {selectedEmployees.includes(employee.id) && ( +
+ + + +
+ )} +
+ )) + ) : ( +
+ Personel bulunamadı +
+ )} +
+
+ )} +
+ ); +}; + +export default MultiSelectEmployee; diff --git a/ui/src/components/common/MultiSelectTeam.tsx b/ui/src/components/common/MultiSelectTeam.tsx new file mode 100644 index 00000000..7eb3eec3 --- /dev/null +++ b/ui/src/components/common/MultiSelectTeam.tsx @@ -0,0 +1,190 @@ +import React, { useState, useRef, useEffect } from "react"; +import { FaChevronDown, FaTimes } from "react-icons/fa"; +import { mockMaintenanceTeams } from "../../mocks/mockMaintenanceTeams"; +import { Team } from "../../types/common"; + +interface MultiSelectTeamProps { + selectedTeams: string[]; + onChange: (teams: string[]) => void; + placeholder?: string; + disabled?: boolean; + className?: string; +} + +const MultiSelectTeam: React.FC = ({ + selectedTeams, + onChange, + placeholder = "Ekip seçin", + disabled = false, + className = "", +}) => { + const [isOpen, setIsOpen] = useState(false); + const [searchTerm, setSearchTerm] = useState(""); + const dropdownRef = useRef(null); + + useEffect(() => { + const handleClickOutside = (event: MouseEvent) => { + if ( + dropdownRef.current && + !dropdownRef.current.contains(event.target as Node) + ) { + setIsOpen(false); + setSearchTerm(""); + } + }; + + document.addEventListener("mousedown", handleClickOutside); + return () => { + document.removeEventListener("mousedown", handleClickOutside); + }; + }, []); + + const filteredTeams = mockMaintenanceTeams.filter( + (team: Team) => + team.name.toLowerCase().includes(searchTerm.toLowerCase()) || + team.code.toLowerCase().includes(searchTerm.toLowerCase()) + ); + + const handleTeamToggle = (teamName: string) => { + if (selectedTeams.includes(teamName)) { + onChange(selectedTeams.filter((name) => name !== teamName)); + } else { + onChange([...selectedTeams, teamName]); + } + }; + + const handleRemoveTeam = (teamName: string, e: React.MouseEvent) => { + e.stopPropagation(); + onChange(selectedTeams.filter((name) => name !== teamName)); + }; + + const selectedTeamObjects = mockMaintenanceTeams.filter((team: Team) => + selectedTeams.includes(team.name) + ); + + return ( +
+
!disabled && setIsOpen(!isOpen)} + > +
+
+ {selectedTeamObjects.length > 0 ? ( + selectedTeamObjects.map((team: Team) => ( + + {team.name} + {!disabled && ( + + )} + + )) + ) : ( + {placeholder} + )} +
+ {!disabled && ( + + )} +
+
+ + {isOpen && !disabled && ( +
+ {/* Search Input */} +
+ setSearchTerm(e.target.value)} + className="w-full px-3 py-2 text-sm border border-gray-300 rounded focus:ring-1 focus:ring-blue-500 focus:border-blue-500" + onClick={(e) => e.stopPropagation()} + /> +
+ + {/* Options List */} +
+ {filteredTeams.length > 0 ? ( + filteredTeams.map((team: Team) => ( +
handleTeamToggle(team.name)} + > +
+
+ {team.name} +
+
+ {team.code} - {team.description} +
+
+ + {team.isActive ? "Aktif" : "Pasif"} + + + {team.members.filter((m) => m.isActive).length} üye + +
+
+ {selectedTeams.includes(team.name) && ( +
+ + + +
+ )} +
+ )) + ) : ( +
+ Ekip bulunamadı +
+ )} +
+
+ )} +
+ ); +}; + +export default MultiSelectTeam; diff --git a/ui/src/components/common/StatusBadge.tsx b/ui/src/components/common/StatusBadge.tsx new file mode 100644 index 00000000..5590a007 --- /dev/null +++ b/ui/src/components/common/StatusBadge.tsx @@ -0,0 +1,89 @@ +import React from "react"; +import classNames from "classnames"; +import { + FaCheckCircle, + FaExclamationTriangle, + FaClock, + FaTimes, +} from "react-icons/fa"; + +interface StatusBadgeProps { + status: string; + size?: "sm" | "md"; + showIcon?: boolean; +} + +const StatusBadge: React.FC = ({ + status, + size = "md", + showIcon = true, +}) => { + const sizeClasses = { + sm: "px-1.5 py-0.5 text-xs", + md: "px-2 py-0.5 text-xs", + }; + + const getStatusConfig = (status: string) => { + switch (status) { + case "active": + return { + color: "bg-green-100 text-green-800", + icon: , + text: "Aktif", + }; + case "inactive": + return { + color: "bg-red-100 text-red-800", + icon: , + text: "Pasif", + }; + case "pending": + return { + color: "bg-yellow-100 text-yellow-800", + icon: , + text: "Beklemede", + }; + case "critical": + return { + color: "bg-red-100 text-red-800", + icon: , + text: "Kritik", + }; + case "low": + return { + color: "bg-yellow-100 text-yellow-800", + icon: , + text: "Düşük", + }; + case "normal": + return { + color: "bg-green-100 text-green-800", + icon: , + text: "Normal", + }; + default: + return { + color: "bg-gray-100 text-gray-800", + icon: , + text: "Bilinmiyor", + }; + } + }; + + const config = getStatusConfig(status); + + return ( + + {showIcon && {config.icon}} + {config.text} + + ); +}; + +export default StatusBadge; diff --git a/ui/src/components/common/Widget.tsx b/ui/src/components/common/Widget.tsx new file mode 100644 index 00000000..1129f6cf --- /dev/null +++ b/ui/src/components/common/Widget.tsx @@ -0,0 +1,100 @@ +import { useEffect, useState } from "react"; +import classNames from "classnames"; +import { iconList } from "./iconList"; + +export type colorType = + | "blue" + | "green" + | "purple" + | "gray" + | "red" + | "yellow" + | "pink" + | "indigo" + | "teal" + | "orange"; + +interface WidgetProps { + title: string; + value: string | number; + valueClassName?: string; + color?: colorType; + icon?: (typeof iconList)[number]; + subTitle?: string; + onClick?: () => void; + className?: string; +} + +export default function Widget({ + title, + value, + valueClassName = "text-3xl", + color = "blue", + icon = "FaChartBar", + subTitle = "-", + onClick, + className, +}: WidgetProps) { + const [IconComponent, setIconComponent] = useState | null>(null); + + useEffect(() => { + let isMounted = true; + import("react-icons/fa").then((icons) => { + if (isMounted && icon && icon in icons) { + setIconComponent(() => (icons as any)[icon]); + } + }); + return () => { + isMounted = false; + }; + }, [icon]); + + const colorMap: Record = { + blue: { bg: "from-blue-100 to-blue-200", text: "text-blue-600" }, + green: { bg: "from-green-100 to-green-200", text: "text-green-600" }, + purple: { bg: "from-purple-100 to-purple-200", text: "text-purple-600" }, + gray: { bg: "from-gray-100 to-gray-200", text: "text-gray-600" }, + red: { bg: "from-red-100 to-red-200", text: "text-red-600" }, + yellow: { bg: "from-yellow-100 to-yellow-200", text: "text-yellow-600" }, + pink: { bg: "from-pink-100 to-pink-200", text: "text-pink-600" }, + indigo: { bg: "from-indigo-100 to-indigo-200", text: "text-indigo-600" }, + teal: { bg: "from-teal-100 to-teal-200", text: "text-teal-600" }, + orange: { bg: "from-orange-100 to-orange-200", text: "text-orange-600" }, + }; + + const safeColor = color && colorMap[color] ? color : "green"; + + return ( +
+
+
+

+ {title} +

+

+ {value} +

+

{subTitle}

+
+
+ {IconComponent ? ( + + ) : null} +
+
+
+ ); +} diff --git a/ui/src/components/common/WidgetGroup.tsx b/ui/src/components/common/WidgetGroup.tsx new file mode 100644 index 00000000..dadd6eb5 --- /dev/null +++ b/ui/src/components/common/WidgetGroup.tsx @@ -0,0 +1,47 @@ +import classNames from "classnames"; +import Widget, { type colorType } from "./Widget"; +import { useNavigate } from "react-router-dom"; +import { WidgetEditDto, WidgetGroupDto } from "../../types/common"; + +export default function WidgetGroup({ + widgetGroups, +}: { + widgetGroups: WidgetGroupDto[]; +}) { + const navigate = useNavigate(); + + return ( +
+ {widgetGroups.map((group, gIdx) => ( +
+ {group.items.map((item: WidgetEditDto, order: number) => ( +
+ { + if (item.onClick) { + // eslint-disable-next-line no-eval + eval(item.onClick); + } + }} + /> +
+ ))} +
+ ))} +
+ ); +} diff --git a/ui/src/components/common/iconList.ts b/ui/src/components/common/iconList.ts new file mode 100644 index 00000000..eb76df96 --- /dev/null +++ b/ui/src/components/common/iconList.ts @@ -0,0 +1,1613 @@ +export const iconList = [ + "Fa500Px", + "FaAccessibleIcon", + "FaAccusoft", + "FaAcquisitionsIncorporated", + "FaAd", + "FaAddressBook", + "FaAddressCard", + "FaAdjust", + "FaAdn", + "FaAdversal", + "FaAffiliatetheme", + "FaAirFreshener", + "FaAirbnb", + "FaAlgolia", + "FaAlignCenter", + "FaAlignJustify", + "FaAlignLeft", + "FaAlignRight", + "FaAlipay", + "FaAllergies", + "FaAmazon", + "FaAmazonPay", + "FaAmbulance", + "FaAmericanSignLanguageInterpreting", + "FaAmilia", + "FaAnchor", + "FaAndroid", + "FaAngellist", + "FaAngleDoubleDown", + "FaAngleDoubleLeft", + "FaAngleDoubleRight", + "FaAngleDoubleUp", + "FaAngleDown", + "FaAngleLeft", + "FaAngleRight", + "FaAngleUp", + "FaAngry", + "FaAngrycreative", + "FaAngular", + "FaAnkh", + "FaAppStore", + "FaAppStoreIos", + "FaApper", + "FaApple", + "FaAppleAlt", + "FaApplePay", + "FaArchive", + "FaArchway", + "FaArrowAltCircleDown", + "FaArrowAltCircleLeft", + "FaArrowAltCircleRight", + "FaArrowAltCircleUp", + "FaArrowCircleDown", + "FaArrowCircleLeft", + "FaArrowCircleRight", + "FaArrowCircleUp", + "FaArrowDown", + "FaArrowLeft", + "FaArrowRight", + "FaArrowUp", + "FaArrowsAlt", + "FaArrowsAltH", + "FaArrowsAltV", + "FaArtstation", + "FaAssistiveListeningSystems", + "FaAsterisk", + "FaAsymmetrik", + "FaAt", + "FaAtlas", + "FaAtlassian", + "FaAtom", + "FaAudible", + "FaAudioDescription", + "FaAutoprefixer", + "FaAvianex", + "FaAviato", + "FaAward", + "FaAws", + "FaBaby", + "FaBabyCarriage", + "FaBackspace", + "FaBackward", + "FaBacon", + "FaBacteria", + "FaBacterium", + "FaBahai", + "FaBalanceScale", + "FaBalanceScaleLeft", + "FaBalanceScaleRight", + "FaBan", + "FaBandAid", + "FaBandcamp", + "FaBarcode", + "FaBars", + "FaBaseballBall", + "FaBasketballBall", + "FaBath", + "FaBatteryEmpty", + "FaBatteryFull", + "FaBatteryHalf", + "FaBatteryQuarter", + "FaBatteryThreeQuarters", + "FaBattleNet", + "FaBed", + "FaBeer", + "FaBehance", + "FaBehanceSquare", + "FaBell", + "FaBellSlash", + "FaBezierCurve", + "FaBible", + "FaBicycle", + "FaBiking", + "FaBimobject", + "FaBinoculars", + "FaBiohazard", + "FaBirthdayCake", + "FaBitbucket", + "FaBitcoin", + "FaBity", + "FaBlackTie", + "FaBlackberry", + "FaBlender", + "FaBlenderPhone", + "FaBlind", + "FaBlog", + "FaBlogger", + "FaBloggerB", + "FaBluetooth", + "FaBluetoothB", + "FaBold", + "FaBolt", + "FaBomb", + "FaBone", + "FaBong", + "FaBook", + "FaBookDead", + "FaBookMedical", + "FaBookOpen", + "FaBookReader", + "FaBookmark", + "FaBootstrap", + "FaBorderAll", + "FaBorderNone", + "FaBorderStyle", + "FaBowlingBall", + "FaBox", + "FaBoxOpen", + "FaBoxTissue", + "FaBoxes", + "FaBraille", + "FaBrain", + "FaBreadSlice", + "FaBriefcase", + "FaBriefcaseMedical", + "FaBroadcastTower", + "FaBroom", + "FaBrush", + "FaBtc", + "FaBuffer", + "FaBug", + "FaBuilding", + "FaBullhorn", + "FaBullseye", + "FaBurn", + "FaBuromobelexperte", + "FaBus", + "FaBusAlt", + "FaBusinessTime", + "FaBuyNLarge", + "FaBuysellads", + "FaCalculator", + "FaCalendar", + "FaCalendarAlt", + "FaCalendarCheck", + "FaCalendarDay", + "FaCalendarMinus", + "FaCalendarPlus", + "FaCalendarTimes", + "FaCalendarWeek", + "FaCamera", + "FaCameraRetro", + "FaCampground", + "FaCanadianMapleLeaf", + "FaCandyCane", + "FaCannabis", + "FaCapsules", + "FaCar", + "FaCarAlt", + "FaCarBattery", + "FaCarCrash", + "FaCarSide", + "FaCaravan", + "FaCaretDown", + "FaCaretLeft", + "FaCaretRight", + "FaCaretSquareDown", + "FaCaretSquareLeft", + "FaCaretSquareRight", + "FaCaretSquareUp", + "FaCaretUp", + "FaCarrot", + "FaCartArrowDown", + "FaCartPlus", + "FaCashRegister", + "FaCat", + "FaCcAmazonPay", + "FaCcAmex", + "FaCcApplePay", + "FaCcDinersClub", + "FaCcDiscover", + "FaCcJcb", + "FaCcMastercard", + "FaCcPaypal", + "FaCcStripe", + "FaCcVisa", + "FaCentercode", + "FaCentos", + "FaCertificate", + "FaChair", + "FaChalkboard", + "FaChalkboardTeacher", + "FaChargingStation", + "FaChartArea", + "FaChartBar", + "FaChartLine", + "FaChartPie", + "FaCheck", + "FaCheckCircle", + "FaCheckDouble", + "FaCheckSquare", + "FaCheese", + "FaChess", + "FaChessBishop", + "FaChessBoard", + "FaChessKing", + "FaChessKnight", + "FaChessPawn", + "FaChessQueen", + "FaChessRook", + "FaChevronCircleDown", + "FaChevronCircleLeft", + "FaChevronCircleRight", + "FaChevronCircleUp", + "FaChevronDown", + "FaChevronLeft", + "FaChevronRight", + "FaChevronUp", + "FaChild", + "FaChrome", + "FaChromecast", + "FaChurch", + "FaCircle", + "FaCircleNotch", + "FaCity", + "FaClinicMedical", + "FaClipboard", + "FaClipboardCheck", + "FaClipboardList", + "FaClock", + "FaClone", + "FaClosedCaptioning", + "FaCloud", + "FaCloudDownloadAlt", + "FaCloudMeatball", + "FaCloudMoon", + "FaCloudMoonRain", + "FaCloudRain", + "FaCloudShowersHeavy", + "FaCloudSun", + "FaCloudSunRain", + "FaCloudUploadAlt", + "FaCloudflare", + "FaCloudscale", + "FaCloudsmith", + "FaCloudversify", + "FaCocktail", + "FaCode", + "FaCodeBranch", + "FaCodepen", + "FaCodiepie", + "FaCoffee", + "FaCog", + "FaCogs", + "FaCoins", + "FaColumns", + "FaComment", + "FaCommentAlt", + "FaCommentDollar", + "FaCommentDots", + "FaCommentMedical", + "FaCommentSlash", + "FaComments", + "FaCommentsDollar", + "FaCompactDisc", + "FaCompass", + "FaCompress", + "FaCompressAlt", + "FaCompressArrowsAlt", + "FaConciergeBell", + "FaConfluence", + "FaConnectdevelop", + "FaContao", + "FaCookie", + "FaCookieBite", + "FaCopy", + "FaCopyright", + "FaCottonBureau", + "FaCouch", + "FaCpanel", + "FaCreativeCommons", + "FaCreativeCommonsBy", + "FaCreativeCommonsNc", + "FaCreativeCommonsNcEu", + "FaCreativeCommonsNcJp", + "FaCreativeCommonsNd", + "FaCreativeCommonsPd", + "FaCreativeCommonsPdAlt", + "FaCreativeCommonsRemix", + "FaCreativeCommonsSa", + "FaCreativeCommonsSampling", + "FaCreativeCommonsSamplingPlus", + "FaCreativeCommonsShare", + "FaCreativeCommonsZero", + "FaCreditCard", + "FaCriticalRole", + "FaCrop", + "FaCropAlt", + "FaCross", + "FaCrosshairs", + "FaCrow", + "FaCrown", + "FaCrutch", + "FaCss3", + "FaCss3Alt", + "FaCube", + "FaCubes", + "FaCut", + "FaCuttlefish", + "FaDAndD", + "FaDAndDBeyond", + "FaDailymotion", + "FaDashcube", + "FaDatabase", + "FaDeaf", + "FaDeezer", + "FaDelicious", + "FaDemocrat", + "FaDeploydog", + "FaDeskpro", + "FaDesktop", + "FaDev", + "FaDeviantart", + "FaDharmachakra", + "FaDhl", + "FaDiagnoses", + "FaDiaspora", + "FaDice", + "FaDiceD20", + "FaDiceD6", + "FaDiceFive", + "FaDiceFour", + "FaDiceOne", + "FaDiceSix", + "FaDiceThree", + "FaDiceTwo", + "FaDigg", + "FaDigitalOcean", + "FaDigitalTachograph", + "FaDirections", + "FaDiscord", + "FaDiscourse", + "FaDisease", + "FaDivide", + "FaDizzy", + "FaDna", + "FaDochub", + "FaDocker", + "FaDog", + "FaDollarSign", + "FaDolly", + "FaDollyFlatbed", + "FaDonate", + "FaDoorClosed", + "FaDoorOpen", + "FaDotCircle", + "FaDove", + "FaDownload", + "FaDraft2Digital", + "FaDraftingCompass", + "FaDragon", + "FaDrawPolygon", + "FaDribbble", + "FaDribbbleSquare", + "FaDropbox", + "FaDrum", + "FaDrumSteelpan", + "FaDrumstickBite", + "FaDrupal", + "FaDumbbell", + "FaDumpster", + "FaDumpsterFire", + "FaDungeon", + "FaDyalog", + "FaEarlybirds", + "FaEbay", + "FaEdge", + "FaEdgeLegacy", + "FaEdit", + "FaEgg", + "FaEject", + "FaElementor", + "FaEllipsisH", + "FaEllipsisV", + "FaEllo", + "FaEmber", + "FaEmpire", + "FaEnvelope", + "FaEnvelopeOpen", + "FaEnvelopeOpenText", + "FaEnvelopeSquare", + "FaEnvira", + "FaEquals", + "FaEraser", + "FaErlang", + "FaEthereum", + "FaEthernet", + "FaEtsy", + "FaEuroSign", + "FaEvernote", + "FaExchangeAlt", + "FaExclamation", + "FaExclamationCircle", + "FaExclamationTriangle", + "FaExpand", + "FaExpandAlt", + "FaExpandArrowsAlt", + "FaExpeditedssl", + "FaExternalLinkAlt", + "FaExternalLinkSquareAlt", + "FaEye", + "FaEyeDropper", + "FaEyeSlash", + "FaFacebook", + "FaFacebookF", + "FaFacebookMessenger", + "FaFacebookSquare", + "FaFan", + "FaFantasyFlightGames", + "FaFastBackward", + "FaFastForward", + "FaFaucet", + "FaFax", + "FaFeather", + "FaFeatherAlt", + "FaFedex", + "FaFedora", + "FaFemale", + "FaFighterJet", + "FaFigma", + "FaFile", + "FaFileAlt", + "FaFileArchive", + "FaFileAudio", + "FaFileCode", + "FaFileContract", + "FaFileCsv", + "FaFileDownload", + "FaFileExcel", + "FaFileExport", + "FaFileImage", + "FaFileImport", + "FaFileInvoice", + "FaFileInvoiceDollar", + "FaFileMedical", + "FaFileMedicalAlt", + "FaFilePdf", + "FaFilePowerpoint", + "FaFilePrescription", + "FaFileSignature", + "FaFileUpload", + "FaFileVideo", + "FaFileWord", + "FaFill", + "FaFillDrip", + "FaFilm", + "FaFilter", + "FaFingerprint", + "FaFire", + "FaFireAlt", + "FaFireExtinguisher", + "FaFirefox", + "FaFirefoxBrowser", + "FaFirstAid", + "FaFirstOrder", + "FaFirstOrderAlt", + "FaFirstdraft", + "FaFish", + "FaFistRaised", + "FaFlag", + "FaFlagCheckered", + "FaFlagUsa", + "FaFlask", + "FaFlickr", + "FaFlipboard", + "FaFlushed", + "FaFly", + "FaFolder", + "FaFolderMinus", + "FaFolderOpen", + "FaFolderPlus", + "FaFont", + "FaFontAwesome", + "FaFontAwesomeAlt", + "FaFontAwesomeFlag", + "FaFontAwesomeLogoFull", + "FaFonticons", + "FaFonticonsFi", + "FaFootballBall", + "FaFortAwesome", + "FaFortAwesomeAlt", + "FaForumbee", + "FaForward", + "FaFoursquare", + "FaFreeCodeCamp", + "FaFreebsd", + "FaFrog", + "FaFrown", + "FaFrownOpen", + "FaFulcrum", + "FaFunnelDollar", + "FaFutbol", + "FaGalacticRepublic", + "FaGalacticSenate", + "FaGamepad", + "FaGasPump", + "FaGavel", + "FaGem", + "FaGenderless", + "FaGetPocket", + "FaGg", + "FaGgCircle", + "FaGhost", + "FaGift", + "FaGifts", + "FaGit", + "FaGitAlt", + "FaGitSquare", + "FaGithub", + "FaGithubAlt", + "FaGithubSquare", + "FaGitkraken", + "FaGitlab", + "FaGitter", + "FaGlassCheers", + "FaGlassMartini", + "FaGlassMartiniAlt", + "FaGlassWhiskey", + "FaGlasses", + "FaGlide", + "FaGlideG", + "FaGlobe", + "FaGlobeAfrica", + "FaGlobeAmericas", + "FaGlobeAsia", + "FaGlobeEurope", + "FaGofore", + "FaGolfBall", + "FaGoodreads", + "FaGoodreadsG", + "FaGoogle", + "FaGoogleDrive", + "FaGooglePay", + "FaGooglePlay", + "FaGooglePlus", + "FaGooglePlusG", + "FaGooglePlusSquare", + "FaGoogleWallet", + "FaGopuram", + "FaGraduationCap", + "FaGratipay", + "FaGrav", + "FaGreaterThan", + "FaGreaterThanEqual", + "FaGrimace", + "FaGrin", + "FaGrinAlt", + "FaGrinBeam", + "FaGrinBeamSweat", + "FaGrinHearts", + "FaGrinSquint", + "FaGrinSquintTears", + "FaGrinStars", + "FaGrinTears", + "FaGrinTongue", + "FaGrinTongueSquint", + "FaGrinTongueWink", + "FaGrinWink", + "FaGripHorizontal", + "FaGripLines", + "FaGripLinesVertical", + "FaGripVertical", + "FaGripfire", + "FaGrunt", + "FaGuilded", + "FaGuitar", + "FaGulp", + "FaHSquare", + "FaHackerNews", + "FaHackerNewsSquare", + "FaHackerrank", + "FaHamburger", + "FaHammer", + "FaHamsa", + "FaHandHolding", + "FaHandHoldingHeart", + "FaHandHoldingMedical", + "FaHandHoldingUsd", + "FaHandHoldingWater", + "FaHandLizard", + "FaHandMiddleFinger", + "FaHandPaper", + "FaHandPeace", + "FaHandPointDown", + "FaHandPointLeft", + "FaHandPointRight", + "FaHandPointUp", + "FaHandPointer", + "FaHandRock", + "FaHandScissors", + "FaHandSparkles", + "FaHandSpock", + "FaHands", + "FaHandsHelping", + "FaHandsWash", + "FaHandshake", + "FaHandshakeAltSlash", + "FaHandshakeSlash", + "FaHanukiah", + "FaHardHat", + "FaHashtag", + "FaHatCowboy", + "FaHatCowboySide", + "FaHatWizard", + "FaHdd", + "FaHeadSideCough", + "FaHeadSideCoughSlash", + "FaHeadSideMask", + "FaHeadSideVirus", + "FaHeading", + "FaHeadphones", + "FaHeadphonesAlt", + "FaHeadset", + "FaHeart", + "FaHeartBroken", + "FaHeartbeat", + "FaHelicopter", + "FaHighlighter", + "FaHiking", + "FaHippo", + "FaHips", + "FaHireAHelper", + "FaHistory", + "FaHive", + "FaHockeyPuck", + "FaHollyBerry", + "FaHome", + "FaHooli", + "FaHornbill", + "FaHorse", + "FaHorseHead", + "FaHospital", + "FaHospitalAlt", + "FaHospitalSymbol", + "FaHospitalUser", + "FaHotTub", + "FaHotdog", + "FaHotel", + "FaHotjar", + "FaHourglass", + "FaHourglassEnd", + "FaHourglassHalf", + "FaHourglassStart", + "FaHouseDamage", + "FaHouseUser", + "FaHouzz", + "FaHryvnia", + "FaHtml5", + "FaHubspot", + "FaICursor", + "FaIceCream", + "FaIcicles", + "FaIcons", + "FaIdBadge", + "FaIdCard", + "FaIdCardAlt", + "FaIdeal", + "FaIgloo", + "FaImage", + "FaImages", + "FaImdb", + "FaInbox", + "FaIndent", + "FaIndustry", + "FaInfinity", + "FaInfo", + "FaInfoCircle", + "FaInnosoft", + "FaInstagram", + "FaInstagramSquare", + "FaInstalod", + "FaIntercom", + "FaInternetExplorer", + "FaInvision", + "FaIoxhost", + "FaItalic", + "FaItchIo", + "FaItunes", + "FaItunesNote", + "FaJava", + "FaJedi", + "FaJediOrder", + "FaJenkins", + "FaJira", + "FaJoget", + "FaJoint", + "FaJoomla", + "FaJournalWhills", + "FaJs", + "FaJsSquare", + "FaJsfiddle", + "FaKaaba", + "FaKaggle", + "FaKey", + "FaKeybase", + "FaKeyboard", + "FaKeycdn", + "FaKhanda", + "FaKickstarter", + "FaKickstarterK", + "FaKiss", + "FaKissBeam", + "FaKissWinkHeart", + "FaKiwiBird", + "FaKorvue", + "FaLandmark", + "FaLanguage", + "FaLaptop", + "FaLaptopCode", + "FaLaptopHouse", + "FaLaptopMedical", + "FaLaravel", + "FaLastfm", + "FaLastfmSquare", + "FaLaugh", + "FaLaughBeam", + "FaLaughSquint", + "FaLaughWink", + "FaLayerGroup", + "FaLeaf", + "FaLeanpub", + "FaLemon", + "FaLess", + "FaLessThan", + "FaLessThanEqual", + "FaLevelDownAlt", + "FaLevelUpAlt", + "FaLifeRing", + "FaLightbulb", + "FaLine", + "FaLink", + "FaLinkedin", + "FaLinkedinIn", + "FaLinode", + "FaLinux", + "FaLiraSign", + "FaList", + "FaListAlt", + "FaListOl", + "FaListUl", + "FaLocationArrow", + "FaLock", + "FaLockOpen", + "FaLongArrowAltDown", + "FaLongArrowAltLeft", + "FaLongArrowAltRight", + "FaLongArrowAltUp", + "FaLowVision", + "FaLuggageCart", + "FaLungs", + "FaLungsVirus", + "FaLyft", + "FaMagento", + "FaMagic", + "FaMagnet", + "FaMailBulk", + "FaMailchimp", + "FaMale", + "FaMandalorian", + "FaMap", + "FaMapMarked", + "FaMapMarkedAlt", + "FaMapMarker", + "FaMapMarkerAlt", + "FaMapPin", + "FaMapSigns", + "FaMarkdown", + "FaMarker", + "FaMars", + "FaMarsDouble", + "FaMarsStroke", + "FaMarsStrokeH", + "FaMarsStrokeV", + "FaMask", + "FaMastodon", + "FaMaxcdn", + "FaMdb", + "FaMedal", + "FaMedapps", + "FaMedium", + "FaMediumM", + "FaMedkit", + "FaMedrt", + "FaMeetup", + "FaMegaport", + "FaMeh", + "FaMehBlank", + "FaMehRollingEyes", + "FaMemory", + "FaMendeley", + "FaMenorah", + "FaMercury", + "FaMeteor", + "FaMicroblog", + "FaMicrochip", + "FaMicrophone", + "FaMicrophoneAlt", + "FaMicrophoneAltSlash", + "FaMicrophoneSlash", + "FaMicroscope", + "FaMicrosoft", + "FaMinus", + "FaMinusCircle", + "FaMinusSquare", + "FaMitten", + "FaMix", + "FaMixcloud", + "FaMixer", + "FaMizuni", + "FaMobile", + "FaMobileAlt", + "FaModx", + "FaMonero", + "FaMoneyBill", + "FaMoneyBillAlt", + "FaMoneyBillWave", + "FaMoneyBillWaveAlt", + "FaMoneyCheck", + "FaMoneyCheckAlt", + "FaMonument", + "FaMoon", + "FaMortarPestle", + "FaMosque", + "FaMotorcycle", + "FaMountain", + "FaMouse", + "FaMousePointer", + "FaMugHot", + "FaMusic", + "FaNapster", + "FaNeos", + "FaNetworkWired", + "FaNeuter", + "FaNewspaper", + "FaNimblr", + "FaNode", + "FaNodeJs", + "FaNotEqual", + "FaNotesMedical", + "FaNpm", + "FaNs8", + "FaNutritionix", + "FaObjectGroup", + "FaObjectUngroup", + "FaOctopusDeploy", + "FaOdnoklassniki", + "FaOdnoklassnikiSquare", + "FaOilCan", + "FaOldRepublic", + "FaOm", + "FaOpencart", + "FaOpenid", + "FaOpera", + "FaOptinMonster", + "FaOrcid", + "FaOsi", + "FaOtter", + "FaOutdent", + "FaPage4", + "FaPagelines", + "FaPager", + "FaPaintBrush", + "FaPaintRoller", + "FaPalette", + "FaPalfed", + "FaPallet", + "FaPaperPlane", + "FaPaperclip", + "FaParachuteBox", + "FaParagraph", + "FaParking", + "FaPassport", + "FaPastafarianism", + "FaPaste", + "FaPatreon", + "FaPause", + "FaPauseCircle", + "FaPaw", + "FaPaypal", + "FaPeace", + "FaPen", + "FaPenAlt", + "FaPenFancy", + "FaPenNib", + "FaPenSquare", + "FaPencilAlt", + "FaPencilRuler", + "FaPennyArcade", + "FaPeopleArrows", + "FaPeopleCarry", + "FaPepperHot", + "FaPerbyte", + "FaPercent", + "FaPercentage", + "FaPeriscope", + "FaPersonBooth", + "FaPhabricator", + "FaPhoenixFramework", + "FaPhoenixSquadron", + "FaPhone", + "FaPhoneAlt", + "FaPhoneSlash", + "FaPhoneSquare", + "FaPhoneSquareAlt", + "FaPhoneVolume", + "FaPhotoVideo", + "FaPhp", + "FaPiedPiper", + "FaPiedPiperAlt", + "FaPiedPiperHat", + "FaPiedPiperPp", + "FaPiedPiperSquare", + "FaPiggyBank", + "FaPills", + "FaPinterest", + "FaPinterestP", + "FaPinterestSquare", + "FaPizzaSlice", + "FaPlaceOfWorship", + "FaPlane", + "FaPlaneArrival", + "FaPlaneDeparture", + "FaPlaneSlash", + "FaPlay", + "FaPlayCircle", + "FaPlaystation", + "FaPlug", + "FaPlus", + "FaPlusCircle", + "FaPlusSquare", + "FaPodcast", + "FaPoll", + "FaPollH", + "FaPoo", + "FaPooStorm", + "FaPoop", + "FaPortrait", + "FaPoundSign", + "FaPowerOff", + "FaPray", + "FaPrayingHands", + "FaPrescription", + "FaPrescriptionBottle", + "FaPrescriptionBottleAlt", + "FaPrint", + "FaProcedures", + "FaProductHunt", + "FaProjectDiagram", + "FaPumpMedical", + "FaPumpSoap", + "FaPushed", + "FaPuzzlePiece", + "FaPython", + "FaQq", + "FaQrcode", + "FaQuestion", + "FaQuestionCircle", + "FaQuidditch", + "FaQuinscape", + "FaQuora", + "FaQuoteLeft", + "FaQuoteRight", + "FaQuran", + "FaRProject", + "FaRadiation", + "FaRadiationAlt", + "FaRainbow", + "FaRandom", + "FaRaspberryPi", + "FaRavelry", + "FaReact", + "FaReacteurope", + "FaReadme", + "FaRebel", + "FaReceipt", + "FaRecordVinyl", + "FaRecycle", + "FaRedRiver", + "FaReddit", + "FaRedditAlien", + "FaRedditSquare", + "FaRedhat", + "FaRedo", + "FaRedoAlt", + "FaRegAddressBook", + "FaRegAddressCard", + "FaRegAngry", + "FaRegArrowAltCircleDown", + "FaRegArrowAltCircleLeft", + "FaRegArrowAltCircleRight", + "FaRegArrowAltCircleUp", + "FaRegBell", + "FaRegBellSlash", + "FaRegBookmark", + "FaRegBuilding", + "FaRegCalendar", + "FaRegCalendarAlt", + "FaRegCalendarCheck", + "FaRegCalendarMinus", + "FaRegCalendarPlus", + "FaRegCalendarTimes", + "FaRegCaretSquareDown", + "FaRegCaretSquareLeft", + "FaRegCaretSquareRight", + "FaRegCaretSquareUp", + "FaRegChartBar", + "FaRegCheckCircle", + "FaRegCheckSquare", + "FaRegCircle", + "FaRegClipboard", + "FaRegClock", + "FaRegClone", + "FaRegClosedCaptioning", + "FaRegComment", + "FaRegCommentAlt", + "FaRegCommentDots", + "FaRegComments", + "FaRegCompass", + "FaRegCopy", + "FaRegCopyright", + "FaRegCreditCard", + "FaRegDizzy", + "FaRegDotCircle", + "FaRegEdit", + "FaRegEnvelope", + "FaRegEnvelopeOpen", + "FaRegEye", + "FaRegEyeSlash", + "FaRegFile", + "FaRegFileAlt", + "FaRegFileArchive", + "FaRegFileAudio", + "FaRegFileCode", + "FaRegFileExcel", + "FaRegFileImage", + "FaRegFilePdf", + "FaRegFilePowerpoint", + "FaRegFileVideo", + "FaRegFileWord", + "FaRegFlag", + "FaRegFlushed", + "FaRegFolder", + "FaRegFolderOpen", + "FaRegFontAwesomeLogoFull", + "FaRegFrown", + "FaRegFrownOpen", + "FaRegFutbol", + "FaRegGem", + "FaRegGrimace", + "FaRegGrin", + "FaRegGrinAlt", + "FaRegGrinBeam", + "FaRegGrinBeamSweat", + "FaRegGrinHearts", + "FaRegGrinSquint", + "FaRegGrinSquintTears", + "FaRegGrinStars", + "FaRegGrinTears", + "FaRegGrinTongue", + "FaRegGrinTongueSquint", + "FaRegGrinTongueWink", + "FaRegGrinWink", + "FaRegHandLizard", + "FaRegHandPaper", + "FaRegHandPeace", + "FaRegHandPointDown", + "FaRegHandPointLeft", + "FaRegHandPointRight", + "FaRegHandPointUp", + "FaRegHandPointer", + "FaRegHandRock", + "FaRegHandScissors", + "FaRegHandSpock", + "FaRegHandshake", + "FaRegHdd", + "FaRegHeart", + "FaRegHospital", + "FaRegHourglass", + "FaRegIdBadge", + "FaRegIdCard", + "FaRegImage", + "FaRegImages", + "FaRegKeyboard", + "FaRegKiss", + "FaRegKissBeam", + "FaRegKissWinkHeart", + "FaRegLaugh", + "FaRegLaughBeam", + "FaRegLaughSquint", + "FaRegLaughWink", + "FaRegLemon", + "FaRegLifeRing", + "FaRegLightbulb", + "FaRegListAlt", + "FaRegMap", + "FaRegMeh", + "FaRegMehBlank", + "FaRegMehRollingEyes", + "FaRegMinusSquare", + "FaRegMoneyBillAlt", + "FaRegMoon", + "FaRegNewspaper", + "FaRegObjectGroup", + "FaRegObjectUngroup", + "FaRegPaperPlane", + "FaRegPauseCircle", + "FaRegPlayCircle", + "FaRegPlusSquare", + "FaRegQuestionCircle", + "FaRegRegistered", + "FaRegSadCry", + "FaRegSadTear", + "FaRegSave", + "FaRegShareSquare", + "FaRegSmile", + "FaRegSmileBeam", + "FaRegSmileWink", + "FaRegSnowflake", + "FaRegSquare", + "FaRegStar", + "FaRegStarHalf", + "FaRegStickyNote", + "FaRegStopCircle", + "FaRegSun", + "FaRegSurprise", + "FaRegThumbsDown", + "FaRegThumbsUp", + "FaRegTimesCircle", + "FaRegTired", + "FaRegTrashAlt", + "FaRegUser", + "FaRegUserCircle", + "FaRegWindowClose", + "FaRegWindowMaximize", + "FaRegWindowMinimize", + "FaRegWindowRestore", + "FaRegistered", + "FaRemoveFormat", + "FaRenren", + "FaReply", + "FaReplyAll", + "FaReplyd", + "FaRepublican", + "FaResearchgate", + "FaResolving", + "FaRestroom", + "FaRetweet", + "FaRev", + "FaRibbon", + "FaRing", + "FaRoad", + "FaRobot", + "FaRocket", + "FaRocketchat", + "FaRockrms", + "FaRoute", + "FaRss", + "FaRssSquare", + "FaRubleSign", + "FaRuler", + "FaRulerCombined", + "FaRulerHorizontal", + "FaRulerVertical", + "FaRunning", + "FaRupeeSign", + "FaRust", + "FaSadCry", + "FaSadTear", + "FaSafari", + "FaSalesforce", + "FaSass", + "FaSatellite", + "FaSatelliteDish", + "FaSave", + "FaSchlix", + "FaSchool", + "FaScrewdriver", + "FaScribd", + "FaScroll", + "FaSdCard", + "FaSearch", + "FaSearchDollar", + "FaSearchLocation", + "FaSearchMinus", + "FaSearchPlus", + "FaSearchengin", + "FaSeedling", + "FaSellcast", + "FaSellsy", + "FaServer", + "FaServicestack", + "FaShapes", + "FaShare", + "FaShareAlt", + "FaShareAltSquare", + "FaShareSquare", + "FaShekelSign", + "FaShieldAlt", + "FaShieldVirus", + "FaShip", + "FaShippingFast", + "FaShirtsinbulk", + "FaShoePrints", + "FaShopify", + "FaShoppingBag", + "FaShoppingBasket", + "FaShoppingCart", + "FaShopware", + "FaShower", + "FaShuttleVan", + "FaSign", + "FaSignInAlt", + "FaSignLanguage", + "FaSignOutAlt", + "FaSignal", + "FaSignature", + "FaSimCard", + "FaSimplybuilt", + "FaSink", + "FaSistrix", + "FaSitemap", + "FaSith", + "FaSkating", + "FaSketch", + "FaSkiing", + "FaSkiingNordic", + "FaSkull", + "FaSkullCrossbones", + "FaSkyatlas", + "FaSkype", + "FaSlack", + "FaSlackHash", + "FaSlash", + "FaSleigh", + "FaSlidersH", + "FaSlideshare", + "FaSmile", + "FaSmileBeam", + "FaSmileWink", + "FaSmog", + "FaSmoking", + "FaSmokingBan", + "FaSms", + "FaSnapchat", + "FaSnapchatGhost", + "FaSnapchatSquare", + "FaSnowboarding", + "FaSnowflake", + "FaSnowman", + "FaSnowplow", + "FaSoap", + "FaSocks", + "FaSolarPanel", + "FaSort", + "FaSortAlphaDown", + "FaSortAlphaDownAlt", + "FaSortAlphaUp", + "FaSortAlphaUpAlt", + "FaSortAmountDown", + "FaSortAmountDownAlt", + "FaSortAmountUp", + "FaSortAmountUpAlt", + "FaSortDown", + "FaSortNumericDown", + "FaSortNumericDownAlt", + "FaSortNumericUp", + "FaSortNumericUpAlt", + "FaSortUp", + "FaSoundcloud", + "FaSourcetree", + "FaSpa", + "FaSpaceShuttle", + "FaSpeakap", + "FaSpeakerDeck", + "FaSpellCheck", + "FaSpider", + "FaSpinner", + "FaSplotch", + "FaSpotify", + "FaSprayCan", + "FaSquare", + "FaSquareFull", + "FaSquareRootAlt", + "FaSquarespace", + "FaStackExchange", + "FaStackOverflow", + "FaStackpath", + "FaStamp", + "FaStar", + "FaStarAndCrescent", + "FaStarHalf", + "FaStarHalfAlt", + "FaStarOfDavid", + "FaStarOfLife", + "FaStaylinked", + "FaSteam", + "FaSteamSquare", + "FaSteamSymbol", + "FaStepBackward", + "FaStepForward", + "FaStethoscope", + "FaStickerMule", + "FaStickyNote", + "FaStop", + "FaStopCircle", + "FaStopwatch", + "FaStopwatch20", + "FaStore", + "FaStoreAlt", + "FaStoreAltSlash", + "FaStoreSlash", + "FaStrava", + "FaStream", + "FaStreetView", + "FaStrikethrough", + "FaStripe", + "FaStripeS", + "FaStroopwafel", + "FaStudiovinari", + "FaStumbleupon", + "FaStumbleuponCircle", + "FaSubscript", + "FaSubway", + "FaSuitcase", + "FaSuitcaseRolling", + "FaSun", + "FaSuperpowers", + "FaSuperscript", + "FaSupple", + "FaSurprise", + "FaSuse", + "FaSwatchbook", + "FaSwift", + "FaSwimmer", + "FaSwimmingPool", + "FaSymfony", + "FaSynagogue", + "FaSync", + "FaSyncAlt", + "FaSyringe", + "FaTable", + "FaTableTennis", + "FaTablet", + "FaTabletAlt", + "FaTablets", + "FaTachometerAlt", + "FaTag", + "FaTags", + "FaTape", + "FaTasks", + "FaTaxi", + "FaTeamspeak", + "FaTeeth", + "FaTeethOpen", + "FaTelegram", + "FaTelegramPlane", + "FaTemperatureHigh", + "FaTemperatureLow", + "FaTencentWeibo", + "FaTenge", + "FaTerminal", + "FaTextHeight", + "FaTextWidth", + "FaTh", + "FaThLarge", + "FaThList", + "FaTheRedYeti", + "FaTheaterMasks", + "FaThemeco", + "FaThemeisle", + "FaThermometer", + "FaThermometerEmpty", + "FaThermometerFull", + "FaThermometerHalf", + "FaThermometerQuarter", + "FaThermometerThreeQuarters", + "FaThinkPeaks", + "FaThumbsDown", + "FaThumbsUp", + "FaThumbtack", + "FaTicketAlt", + "FaTiktok", + "FaTimes", + "FaTimesCircle", + "FaTint", + "FaTintSlash", + "FaTired", + "FaToggleOff", + "FaToggleOn", + "FaToilet", + "FaToiletPaper", + "FaToiletPaperSlash", + "FaToolbox", + "FaTools", + "FaTooth", + "FaTorah", + "FaToriiGate", + "FaTractor", + "FaTradeFederation", + "FaTrademark", + "FaTrafficLight", + "FaTrailer", + "FaTrain", + "FaTram", + "FaTransgender", + "FaTransgenderAlt", + "FaTrash", + "FaTrashAlt", + "FaTrashRestore", + "FaTrashRestoreAlt", + "FaTree", + "FaTrello", + "FaTripadvisor", + "FaTrophy", + "FaTruck", + "FaTruckLoading", + "FaTruckMonster", + "FaTruckMoving", + "FaTruckPickup", + "FaTshirt", + "FaTty", + "FaTumblr", + "FaTumblrSquare", + "FaTv", + "FaTwitch", + "FaTwitter", + "FaTwitterSquare", + "FaTypo3", + "FaUber", + "FaUbuntu", + "FaUikit", + "FaUmbraco", + "FaUmbrella", + "FaUmbrellaBeach", + "FaUncharted", + "FaUnderline", + "FaUndo", + "FaUndoAlt", + "FaUniregistry", + "FaUnity", + "FaUniversalAccess", + "FaUniversity", + "FaUnlink", + "FaUnlock", + "FaUnlockAlt", + "FaUnsplash", + "FaUntappd", + "FaUpload", + "FaUps", + "FaUsb", + "FaUser", + "FaUserAlt", + "FaUserAltSlash", + "FaUserAstronaut", + "FaUserCheck", + "FaUserCircle", + "FaUserClock", + "FaUserCog", + "FaUserEdit", + "FaUserFriends", + "FaUserGraduate", + "FaUserInjured", + "FaUserLock", + "FaUserMd", + "FaUserMinus", + "FaUserNinja", + "FaUserNurse", + "FaUserPlus", + "FaUserSecret", + "FaUserShield", + "FaUserSlash", + "FaUserTag", + "FaUserTie", + "FaUserTimes", + "FaUsers", + "FaUsersCog", + "FaUsersSlash", + "FaUsps", + "FaUssunnah", + "FaUtensilSpoon", + "FaUtensils", + "FaVaadin", + "FaVectorSquare", + "FaVenus", + "FaVenusDouble", + "FaVenusMars", + "FaVest", + "FaVestPatches", + "FaViacoin", + "FaViadeo", + "FaViadeoSquare", + "FaVial", + "FaVials", + "FaViber", + "FaVideo", + "FaVideoSlash", + "FaVihara", + "FaVimeo", + "FaVimeoSquare", + "FaVimeoV", + "FaVine", + "FaVirus", + "FaVirusSlash", + "FaViruses", + "FaVk", + "FaVnv", + "FaVoicemail", + "FaVolleyballBall", + "FaVolumeDown", + "FaVolumeMute", + "FaVolumeOff", + "FaVolumeUp", + "FaVoteYea", + "FaVrCardboard", + "FaVuejs", + "FaWalking", + "FaWallet", + "FaWarehouse", + "FaWatchmanMonitoring", + "FaWater", + "FaWaveSquare", + "FaWaze", + "FaWeebly", + "FaWeibo", + "FaWeight", + "FaWeightHanging", + "FaWeixin", + "FaWhatsapp", + "FaWhatsappSquare", + "FaWheelchair", + "FaWhmcs", + "FaWifi", + "FaWikipediaW", + "FaWind", + "FaWindowClose", + "FaWindowMaximize", + "FaWindowMinimize", + "FaWindowRestore", + "FaWindows", + "FaWineBottle", + "FaWineGlass", + "FaWineGlassAlt", + "FaWix", + "FaWizardsOfTheCoast", + "FaWodu", + "FaWolfPackBattalion", + "FaWonSign", + "FaWordpress", + "FaWordpressSimple", + "FaWpbeginner", + "FaWpexplorer", + "FaWpforms", + "FaWpressr", + "FaWrench", + "FaXRay", + "FaXbox", + "FaXing", + "FaXingSquare", + "FaYCombinator", + "FaYahoo", + "FaYammer", + "FaYandex", + "FaYandexInternational", + "FaYarn", + "FaYelp", + "FaYenSign", + "FaYinYang", + "FaYoast", + "FaYoutube", + "FaYoutubeSquare", + "FaZhihu", +]; diff --git a/ui/src/mocks/mockActivities.ts b/ui/src/mocks/mockActivities.ts new file mode 100644 index 00000000..20689763 --- /dev/null +++ b/ui/src/mocks/mockActivities.ts @@ -0,0 +1,174 @@ +import { PriorityEnum } from "../types/common"; +import { + CrmActivity, + CrmActivityTypeEnum, + ActivityStatusEnum, +} from "../types/crm"; +import { mockBusinessParties } from "./mockBusinessParties"; +import { mockEmployees } from "./mockEmployees"; + +export const mockActivities: CrmActivity[] = [ + { + id: "act_001", + activityType: CrmActivityTypeEnum.Call, + subject: "Teklif Görüşmesi - ABC Şirketi", + description: "Yeni proje için teklif sunumu ve fiyat görüşmesi yapılacak.", + customerId: "6", + customer: mockBusinessParties.find((cust) => cust.id === "6"), + activityDate: new Date("2024-01-25T10:00:00"), + startTime: new Date("2024-01-25T10:00:00"), + endTime: new Date("2024-01-25T11:00:00"), + duration: 60, + assignedTo: "1", + assigned: mockEmployees.find((emp) => emp.id === "1"), + participants: ["3", "2"], + status: ActivityStatusEnum.Planned, + priority: PriorityEnum.High, + followUpDate: new Date("2024-01-30"), + followUpActivity: "Teklif cevabı takip edilecek", + creationTime: new Date("2024-01-20T09:00:00"), + lastModificationTime: new Date("2024-01-20T09:00:00"), + }, + { + id: "act_002", + activityType: CrmActivityTypeEnum.Meeting, + subject: "Proje Kickoff Toplantısı", + description: "XYZ projesi için başlangıç toplantısı düzenlenecek.", + customerId: "5", + customer: mockBusinessParties.find((cust) => cust.id === "5"), + activityDate: new Date("2024-01-24T14:00:00"), + startTime: new Date("2024-01-24T14:00:00"), + endTime: new Date("2024-01-24T16:00:00"), + duration: 120, + assignedTo: "2", + assigned: mockEmployees.find((emp) => emp.id === "2"), + participants: ["3", "2", "4"], + status: ActivityStatusEnum.Completed, + priority: PriorityEnum.Normal, + outcome: "Proje kapsamı netleştirildi ve görev dağılımı yapıldı.", + nextSteps: "Detaylı proje planı hazırlanacak.", + creationTime: new Date("2024-01-18T11:30:00"), + lastModificationTime: new Date("2024-01-24T16:15:00"), + }, + { + id: "act_003", + activityType: CrmActivityTypeEnum.Email, + subject: "Ürün Katalogu Gönderimi", + description: + "Müşteriye güncel ürün katalogu ve fiyat listesi e-posta ile gönderildi.", + customerId: "5", + customer: mockBusinessParties.find((cust) => cust.id === "5"), + activityDate: new Date("2024-01-23T09:30:00"), + duration: 15, + assignedTo: "3", + assigned: mockEmployees.find((emp) => emp.id === "3"), + participants: [], + status: ActivityStatusEnum.Completed, + priority: PriorityEnum.Low, + outcome: "Katalog başarıyla gönderildi, müşteri geri dönüş yaptı.", + creationTime: new Date("2024-01-23T09:15:00"), + lastModificationTime: new Date("2024-01-23T09:45:00"), + }, + { + id: "act_004", + activityType: CrmActivityTypeEnum.Demo, + subject: "Yazılım Demo Sunumu", + description: + "ERP sisteminin demo sunumu müşteri lokasyonunda gerçekleştirilecek.", + customerId: "5", + customer: mockBusinessParties.find((cust) => cust.id === "5"), + activityDate: new Date("2024-01-26T13:00:00"), + startTime: new Date("2024-01-26T13:00:00"), + endTime: new Date("2024-01-26T15:00:00"), + duration: 120, + assignedTo: "4", + assigned: mockEmployees.find((emp) => emp.id === "4"), + participants: ["5", "10"], + status: ActivityStatusEnum.InProgress, + priority: PriorityEnum.High, + followUpDate: new Date("2024-01-29"), + followUpActivity: "Demo sonrası müşteri geri bildirimlerini al", + creationTime: new Date("2024-01-19T16:00:00"), + lastModificationTime: new Date("2024-01-22T10:30:00"), + }, + { + id: "act_005", + activityType: CrmActivityTypeEnum.Task, + subject: "Müşteri Memnuniyet Anketi", + description: + "Proje teslimi sonrası müşteri memnuniyet anketi düzenlenecek.", + customerId: "6", + customer: mockBusinessParties.find((cust) => cust.id === "6"), + activityDate: new Date("2024-01-28T10:00:00"), + duration: 30, + assignedTo: "5", + assigned: mockEmployees.find((emp) => emp.id === "5"), + participants: [], + status: ActivityStatusEnum.Planned, + priority: PriorityEnum.Normal, + followUpDate: new Date("2024-02-05"), + followUpActivity: "Anket sonuçlarını değerlendir ve rapor hazırla", + creationTime: new Date("2024-01-21T14:20:00"), + lastModificationTime: new Date("2024-01-21T14:20:00"), + }, + { + id: "act_006", + activityType: CrmActivityTypeEnum.Note, + subject: "Müşteri Taleplerini Değerlendirme", + description: + "Müşterinin ek özellik talepleri not alındı ve teknik ekiple paylaşıldı.", + customerId: "6", + customer: mockBusinessParties.find((cust) => cust.id === "6"), + activityDate: new Date("2024-01-22T15:45:00"), + assignedTo: "6", + assigned: mockEmployees.find((emp) => emp.id === "6"), + participants: [], + status: ActivityStatusEnum.Completed, + priority: PriorityEnum.Normal, + outcome: + "Talepler teknik ekiple değerlendirildi, uygulama planı oluşturuldu.", + nextSteps: "Müşteriye geri dönüş yapılacak ve timeline paylaşılacak.", + creationTime: new Date("2024-01-22T15:30:00"), + lastModificationTime: new Date("2024-01-22T16:00:00"), + }, + { + id: "act_007", + activityType: CrmActivityTypeEnum.Proposal, + subject: "Yıllık Bakım Sözleşmesi Teklifi", + description: + "Sistemin yıllık bakım ve destek hizmetleri için teklif hazırlandı.", + customerId: "5", + customer: mockBusinessParties.find((cust) => cust.id === "5"), + activityDate: new Date("2024-01-27T11:00:00"), + duration: 45, + assignedTo: "7", + assigned: mockEmployees.find((emp) => emp.id === "7"), + participants: ["7"], + status: ActivityStatusEnum.Planned, + priority: PriorityEnum.Normal, + followUpDate: new Date("2024-02-03"), + followUpActivity: "Teklif sunumu yapılacak", + creationTime: new Date("2024-01-24T09:30:00"), + lastModificationTime: new Date("2024-01-24T09:30:00"), + }, + { + id: "act_008", + activityType: CrmActivityTypeEnum.Call, + subject: "Ödeme Planı Görüşmesi", + description: + "Projenin ödeme planı ve faturalandırma detayları görüşülecek.", + customerId: "5", + customer: mockBusinessParties.find((cust) => cust.id === "5"), + activityDate: new Date("2024-01-29T09:00:00"), + startTime: new Date("2024-01-29T09:00:00"), + endTime: new Date("2024-01-29T09:30:00"), + duration: 30, + assignedTo: "8", + assigned: mockEmployees.find((emp) => emp.id === "8"), + participants: [], + status: ActivityStatusEnum.Planned, + priority: PriorityEnum.High, + creationTime: new Date("2024-01-25T13:15:00"), + lastModificationTime: new Date("2024-01-25T13:15:00"), + }, +]; diff --git a/ui/src/mocks/mockActivityTypes.ts b/ui/src/mocks/mockActivityTypes.ts new file mode 100644 index 00000000..42de6072 --- /dev/null +++ b/ui/src/mocks/mockActivityTypes.ts @@ -0,0 +1,92 @@ +import { PsActivityTypeEnum, PsActivity } from "../types/ps"; + +export const activityTypes: PsActivity[] = [ + { + id: "1", + activityType: PsActivityTypeEnum.TaskCreated, + name: "Görev Oluşturma", + description: "Yeni bir görev oluşturulması", + category: "Görev Yönetimi", + defaultDuration: 0.5, + isActive: true, + creationTime: new Date("2024-01-15"), + lastModificationTime: new Date("2024-01-15"), + }, + { + id: "2", + activityType: PsActivityTypeEnum.TaskUpdated, + name: "Görev Güncelleme", + description: "Mevcut görevde değişiklik yapılması", + category: "Görev Yönetimi", + defaultDuration: 0.25, + isActive: true, + creationTime: new Date("2024-01-15"), + lastModificationTime: new Date("2024-01-15"), + }, + { + id: "3", + activityType: PsActivityTypeEnum.TaskCompleted, + name: "Görev Tamamlama", + description: "Görevin tamamlanarak kapatılması", + category: "Görev Yönetimi", + defaultDuration: 0.5, + isActive: true, + creationTime: new Date("2024-01-15"), + lastModificationTime: new Date("2024-01-15"), + }, + { + id: "4", + activityType: PsActivityTypeEnum.CommentAdded, + name: "Yorum Ekleme", + description: "Görev veya projeye yorum eklenmesi", + category: "İletişim", + defaultDuration: 0.1, + isActive: true, + creationTime: new Date("2024-01-15"), + lastModificationTime: new Date("2024-01-15"), + }, + { + id: "5", + activityType: PsActivityTypeEnum.FileUploaded, + name: "Dosya Yükleme", + description: "Proje veya göreve dosya eklenmesi", + category: "Dokümantasyon", + defaultDuration: 0.25, + isActive: true, + creationTime: new Date("2024-01-15"), + lastModificationTime: new Date("2024-01-15"), + }, + { + id: "6", + activityType: PsActivityTypeEnum.StatusChanged, + name: "Durum Değişikliği", + description: "Görev veya proje durumunun değiştirilmesi", + category: "Durum Yönetimi", + defaultDuration: 0.1, + isActive: true, + creationTime: new Date("2024-01-15"), + lastModificationTime: new Date("2024-01-15"), + }, + { + id: "7", + activityType: PsActivityTypeEnum.AssignmentChanged, + name: "Atama Değişikliği", + description: "Görevin farklı bir kişiye atanması", + category: "Kaynak Yönetimi", + defaultDuration: 0.1, + isActive: true, + creationTime: new Date("2024-01-15"), + lastModificationTime: new Date("2024-01-15"), + }, + { + id: "8", + activityType: PsActivityTypeEnum.MeetingScheduled, + name: "Toplantı Planlama", + description: "Proje ile ilgili toplantı planlanması", + category: "Toplantı", + defaultDuration: 1.0, + isActive: true, + creationTime: new Date("2024-01-15"), + lastModificationTime: new Date("2024-01-15"), + }, +]; diff --git a/ui/src/mocks/mockApprovalWorkflows.ts b/ui/src/mocks/mockApprovalWorkflows.ts new file mode 100644 index 00000000..bc66b7cf --- /dev/null +++ b/ui/src/mocks/mockApprovalWorkflows.ts @@ -0,0 +1,193 @@ +import { + ApprovalLevelEnum, + MmApprovalWorkflow, + RequestTypeEnum, +} from "../types/mm"; +import { mockDepartments } from "./mockDepartments"; + +export const mockApprovalWorkflows: MmApprovalWorkflow[] = [ + { + id: "1", + name: "Üretim Malzeme Onayı", + departmentId: "1", + department: mockDepartments.find((d) => d.id === "1"), + requestType: RequestTypeEnum.Material, + amountThreshold: 50000, + approvalLevels: [ + { + id: "AL001", + workflowId: "1", + level: ApprovalLevelEnum.Supervisor, + approverUserIds: ["USR001", "USR002"], + approverNames: ["Mehmet Yılmaz", "Ali Kaya"], + sequence: 1, + isRequired: true, + isParallel: false, + timeoutDays: 2, + }, + { + id: "AL002", + workflowId: "1", + level: ApprovalLevelEnum.Manager, + approverUserIds: ["USR003"], + approverNames: ["Ayşe Demir"], + sequence: 2, + isRequired: true, + isParallel: false, + timeoutDays: 3, + }, + { + id: "AL003", + workflowId: "1", + level: ApprovalLevelEnum.FinanceManager, + approverUserIds: ["USR004"], + approverNames: ["Fatma Özkan"], + sequence: 3, + isRequired: false, + isParallel: false, + timeoutDays: 5, + }, + ], + isActive: true, + creationTime: new Date(), + lastModificationTime: new Date(), + }, + { + id: "2", + name: "IT İş Merkezi Onayı", + departmentId: "2", + department: mockDepartments.find((d) => d.id === "2"), + requestType: RequestTypeEnum.WorkCenter, + amountThreshold: 100000, + approvalLevels: [ + { + id: "AL004", + workflowId: "2", + level: ApprovalLevelEnum.TechnicalManager, + approverUserIds: ["USR005"], + approverNames: ["Murat Şen"], + sequence: 1, + isRequired: true, + isParallel: false, + timeoutDays: 3, + }, + { + id: "AL005", + workflowId: "2", + level: ApprovalLevelEnum.Director, + approverUserIds: ["USR006", "USR007"], + approverNames: ["Hasan Kara", "Zeynep Akın"], + sequence: 2, + isRequired: true, + isParallel: true, + timeoutDays: 5, + }, + { + id: "AL006", + workflowId: "2", + level: ApprovalLevelEnum.GeneralManager, + approverUserIds: ["USR008"], + approverNames: ["Ahmet Yıldız"], + sequence: 3, + isRequired: true, + isParallel: false, + timeoutDays: 7, + }, + ], + isActive: true, + creationTime: new Date(), + lastModificationTime: new Date(), + }, + { + id: "3", + name: "Bakım Hizmet Onayı", + departmentId: "3", + department: mockDepartments.find((d) => d.id === "3"), + requestType: RequestTypeEnum.Service, + amountThreshold: 25000, + approvalLevels: [ + { + id: "AL007", + workflowId: "3", + level: ApprovalLevelEnum.Supervisor, + approverUserIds: ["USR009"], + approverNames: ["Kemal Özdemir"], + sequence: 1, + isRequired: true, + isParallel: false, + timeoutDays: 1, + }, + { + id: "AL008", + workflowId: "3", + level: ApprovalLevelEnum.Manager, + approverUserIds: ["USR010"], + approverNames: ["Leyla Çelik"], + sequence: 2, + isRequired: true, + isParallel: false, + timeoutDays: 2, + }, + ], + isActive: true, + creationTime: new Date(), + lastModificationTime: new Date(), + }, + { + id: "4", + name: "Yüksek Tutar Onayı", + departmentId: "4", + department: mockDepartments.find((d) => d.id === "4"), + requestType: RequestTypeEnum.Material, + amountThreshold: 500000, + approvalLevels: [ + { + id: "AL009", + workflowId: "4", + level: ApprovalLevelEnum.Manager, + approverUserIds: ["USR011"], + approverNames: ["Selim Yağcı"], + sequence: 1, + isRequired: true, + isParallel: false, + timeoutDays: 2, + }, + { + id: "AL010", + workflowId: "4", + level: ApprovalLevelEnum.FinanceManager, + approverUserIds: ["USR012"], + approverNames: ["Burcu Arslan"], + sequence: 2, + isRequired: true, + isParallel: false, + timeoutDays: 3, + }, + { + id: "AL011", + workflowId: "4", + level: ApprovalLevelEnum.Director, + approverUserIds: ["USR013"], + approverNames: ["Can Demirtaş"], + sequence: 3, + isRequired: true, + isParallel: false, + timeoutDays: 5, + }, + { + id: "AL012", + workflowId: "4", + level: ApprovalLevelEnum.GeneralManager, + approverUserIds: ["USR014"], + approverNames: ["Eda Yurtseven"], + sequence: 4, + isRequired: true, + isParallel: false, + timeoutDays: 7, + }, + ], + isActive: false, + creationTime: new Date(), + lastModificationTime: new Date(), + }, +]; diff --git a/ui/src/mocks/mockBOMs.ts b/ui/src/mocks/mockBOMs.ts new file mode 100644 index 00000000..151b210e --- /dev/null +++ b/ui/src/mocks/mockBOMs.ts @@ -0,0 +1,319 @@ +import { MrpBOM, BOMTypeEnum } from "../types/mrp"; +import { mockMaterials } from "./mockMaterials"; +import { mockOperations } from "./mockOperations"; + +// Mock data +export const mockBOMs: MrpBOM[] = [ + { + id: "1", + bomCode: "BOM-MOT-001", + materialId: "1", // Motor Blok - Workflow ile eşleştirilen malzeme + material: mockMaterials.find((m) => m.id === "1")!, + version: "1.0", + validFrom: new Date("2024-01-01"), + validTo: new Date("2024-12-31"), + isActive: true, + bomType: BOMTypeEnum.Production, + baseQuantity: 1, + components: [ + { + id: "COMP001", + bomId: "1", + materialId: "3", // Çelik Levha + material: mockMaterials.find((m) => m.id === "3")!, + quantity: 2, + unitId: "PCS", + scrapPercentage: 5, + isPhantom: false, + position: 10, + validFrom: new Date("2024-01-01"), + isActive: true, + }, + { + id: "COMP002", + bomId: "1", + materialId: "4", // Alüminyum Profil + material: mockMaterials.find((m) => m.id === "4")!, + quantity: 1, + unitId: "PCS", + scrapPercentage: 2, + isPhantom: false, + position: 20, + validFrom: new Date("2024-01-01"), + isActive: true, + }, + { + id: "COMP003", + bomId: "1", + materialId: "5", // Plastik Kapak + material: mockMaterials.find((m) => m.id === "5")!, + quantity: 1, + unitId: "PCS", + scrapPercentage: 3, + isPhantom: false, + position: 30, + validFrom: new Date("2024-01-01"), + isActive: true, + }, + ], + operations: [ + // Workflow RT001 ile eşleştirilen operasyonlar + { + id: "BOMOP001", + bomId: "1", + operationId: "1", // CNC Torna + operation: mockOperations.find((op) => op.id === "1")!, + sequence: 10, + setupTime: 30, + runTime: 45, + queueTime: 15, + moveTime: 5, + isActive: true, + waitTime: 0, + workCenterId: "", + isParallel: false, + prerequisites: [], + qualityChecks: [], + tools: [], + skills: [], + }, + { + id: "BOMOP002", + bomId: "1", + operationId: "2", // Kaynak + operation: mockOperations.find((op) => op.id === "2")!, + sequence: 20, + setupTime: 15, + runTime: 60, + queueTime: 10, + moveTime: 5, + isActive: true, + waitTime: 0, + workCenterId: "", + isParallel: false, + prerequisites: [], + qualityChecks: [], + tools: [], + skills: [], + }, + { + id: "BOMOP003", + bomId: "1", + operationId: "3", // Kalite Kontrolü + operation: mockOperations.find((op) => op.id === "3")!, + sequence: 30, + setupTime: 5, + runTime: 20, + queueTime: 5, + moveTime: 3, + isActive: true, + waitTime: 0, + workCenterId: "", + isParallel: false, + prerequisites: [], + qualityChecks: [], + tools: [], + skills: [], + }, + ], + creationTime: new Date(), + lastModificationTime: new Date(), + }, + { + id: "2", + bomCode: "BOM-GEAR-001", + materialId: "2", // Şanzıman Kasası - Workflow ile eşleştirilen malzeme + material: mockMaterials.find((m) => m.id === "2")!, + version: "2.1", + validFrom: new Date("2024-02-01"), + validTo: new Date("2024-12-31"), + isActive: true, + bomType: BOMTypeEnum.Production, + baseQuantity: 1, + components: [ + { + id: "COMP004", + bomId: "2", + materialId: "1", // Motor Blok + material: mockMaterials.find((m) => m.id === "1")!, + quantity: 1, + unitId: "PCS", + scrapPercentage: 3, + isPhantom: false, + position: 10, + validFrom: new Date("2024-02-01"), + isActive: true, + }, + { + id: "COMP005", + bomId: "2", + materialId: "3", // Çelik Levha + material: mockMaterials.find((m) => m.id === "3")!, + quantity: 3, + unitId: "KG", + scrapPercentage: 4, + isPhantom: false, + position: 20, + validFrom: new Date("2024-02-01"), + isActive: true, + }, + { + id: "COMP006", + bomId: "2", + materialId: "4", // Alüminyum Profil + material: mockMaterials.find((m) => m.id === "4")!, + quantity: 2, + unitId: "M", + scrapPercentage: 2, + isPhantom: false, + position: 30, + validFrom: new Date("2024-02-01"), + isActive: true, + }, + ], + operations: [ + // Workflow RT002 ile eşleştirilen operasyonlar + { + id: "BOMOP004", + bomId: "2", + operationId: "4", // Paketleme + operation: mockOperations.find((op) => op.id === "4")!, + sequence: 10, + setupTime: 20, + runTime: 45, + queueTime: 10, + moveTime: 5, + isActive: true, + waitTime: 0, + workCenterId: "", + isParallel: false, + prerequisites: [], + qualityChecks: [], + tools: [], + skills: [], + }, + { + id: "BOMOP005", + bomId: "2", + operationId: "1", // CNC Torna + operation: mockOperations.find((op) => op.id === "1")!, + sequence: 20, + setupTime: 25, + runTime: 70, + queueTime: 12, + moveTime: 8, + isActive: true, + waitTime: 0, + workCenterId: "", + isParallel: false, + prerequisites: [], + qualityChecks: [], + tools: [], + skills: [], + }, + { + id: "BOMOP006", + bomId: "2", + operationId: "3", // Kalite Kontrolü + operation: mockOperations.find((op) => op.id === "3")!, + sequence: 30, + setupTime: 10, + runTime: 30, + queueTime: 8, + moveTime: 5, + isActive: true, + waitTime: 0, + workCenterId: "", + isParallel: false, + prerequisites: [], + qualityChecks: [], + tools: [], + skills: [], + }, + ], + creationTime: new Date(), + lastModificationTime: new Date(), + }, + { + id: "3", + bomCode: "BOM-PCB-001", + materialId: "5", // Plastik Kapak - yeni workflow ekleyelim + material: mockMaterials.find((m) => m.id === "5")!, + version: "1.0", + validFrom: new Date("2024-03-01"), + isActive: true, + bomType: BOMTypeEnum.Production, + baseQuantity: 1, + components: [ + { + id: "COMP007", + bomId: "3", + materialId: "3", // Çelik Levha + material: mockMaterials.find((m) => m.id === "3")!, + quantity: 0.5, + unitId: "KG", + scrapPercentage: 5, + isPhantom: false, + position: 10, + validFrom: new Date("2024-03-01"), + isActive: true, + }, + { + id: "COMP008", + bomId: "3", + materialId: "4", // Alüminyum Profil + material: mockMaterials.find((m) => m.id === "4")!, + quantity: 0.2, + unitId: "M", + scrapPercentage: 3, + isPhantom: false, + position: 20, + validFrom: new Date("2024-03-01"), + isActive: true, + }, + ], + operations: [ + // Basit plastik kapak işlemleri + { + id: "BOMOP007", + bomId: "3", + operationId: "5", // Bakım/Kalıp işlemi + operation: mockOperations.find((op) => op.id === "5")!, + sequence: 10, + setupTime: 15, + runTime: 25, + queueTime: 5, + moveTime: 3, + isActive: true, + waitTime: 0, + workCenterId: "", + isParallel: false, + prerequisites: [], + qualityChecks: [], + tools: [], + skills: [], + }, + { + id: "BOMOP008", + bomId: "3", + operationId: "4", // Paketleme + operation: mockOperations.find((op) => op.id === "4")!, + sequence: 20, + setupTime: 5, + runTime: 10, + queueTime: 3, + moveTime: 2, + isActive: true, + waitTime: 0, + workCenterId: "", + isParallel: false, + prerequisites: [], + qualityChecks: [], + tools: [], + skills: [], + }, + ], + creationTime: new Date(), + lastModificationTime: new Date(), + }, +]; diff --git a/ui/src/mocks/mockBadges.ts b/ui/src/mocks/mockBadges.ts new file mode 100644 index 00000000..6003ba97 --- /dev/null +++ b/ui/src/mocks/mockBadges.ts @@ -0,0 +1,88 @@ +import { HrBadge, BadgeCategoryEnum, BadgeRarityEnum } from "../types/hr"; + +export const mockBadges: HrBadge[] = [ + { + id: "badge-001", + code: "STAR_PERFORMER", + name: "Yıldız Performans", + description: + "Üstün performans sergileyen çalışanlara verilen prestijli rozet", + icon: "⭐", + color: "#FFD700", + backgroundColor: "#FFF8DC", + category: BadgeCategoryEnum.Performance, + criteria: "3 çeyrek üst üste hedefleri %110 üzerinde tamamlama", + points: 100, + rarity: BadgeRarityEnum.Epic, + isActive: true, + creationTime: new Date("2024-01-15"), + lastModificationTime: new Date("2024-01-15"), + }, + { + id: "badge-002", + code: "TEAM_LEADER", + name: "Takım Lideri", + description: + "Takım arkadaşlarına öncülük eden ve onları motive eden çalışanlar için", + icon: "👑", + color: "#4B0082", + backgroundColor: "#E6E6FA", + category: BadgeCategoryEnum.Leadership, + criteria: "Takım projelerinde liderlik gösterme ve ekip başarısına katkı", + points: 75, + rarity: BadgeRarityEnum.Rare, + isActive: true, + creationTime: new Date("2024-02-10"), + lastModificationTime: new Date("2024-02-10"), + }, + { + id: "badge-003", + code: "INNOVATOR", + name: "İnovatör", + description: + "Yaratıcı çözümler üreten ve yenilikçi yaklaşımlar sergileyen çalışanlar", + icon: "💡", + color: "#FF6B35", + backgroundColor: "#FFF0E6", + category: BadgeCategoryEnum.Innovation, + criteria: "Şirkete değer katan yenilikçi fikirler sunma", + points: 80, + rarity: BadgeRarityEnum.Rare, + isActive: true, + creationTime: new Date("2024-03-05"), + lastModificationTime: new Date("2024-03-05"), + }, + { + id: "badge-004", + code: "PERFECT_ATTENDANCE", + name: "Mükemmel Devam", + description: + "Düzenli ve zamanında işe gelen, devamsızlık yapmayan çalışanlar", + icon: "📅", + color: "#28A745", + backgroundColor: "#E8F5E8", + category: BadgeCategoryEnum.Attendance, + criteria: "6 ay boyunca devamsızlık yapmama", + points: 50, + rarity: BadgeRarityEnum.Uncommon, + isActive: true, + creationTime: new Date("2024-04-20"), + lastModificationTime: new Date("2024-04-20"), + }, + { + id: "badge-005", + code: "CUSTOMER_CHAMPION", + name: "Müşteri Şampiyonu", + description: "Müşteri memnuniyetinde üstün başarı gösteren çalışanlar", + icon: "🏆", + color: "#DC3545", + backgroundColor: "#FFEBEE", + category: BadgeCategoryEnum.Customer, + criteria: "Müşteri memnuniyet puanı %95 üzerinde alma", + points: 90, + rarity: BadgeRarityEnum.Epic, + isActive: true, + creationTime: new Date("2024-05-12"), + lastModificationTime: new Date("2024-05-12"), + }, +]; diff --git a/ui/src/mocks/mockBankMovements.ts b/ui/src/mocks/mockBankMovements.ts new file mode 100644 index 00000000..2b357f15 --- /dev/null +++ b/ui/src/mocks/mockBankMovements.ts @@ -0,0 +1,43 @@ +import { + FiBankMovement, + BankTransactionTypeEnum, + TransactionStatusEnum, +} from "../types/fi"; +import { mockBanks } from "./mockBanks"; + +export const mockBankMovements: FiBankMovement[] = [ + { + id: "1", + bankAccountId: "1", + bankAccount: mockBanks.find((acc) => acc.id === "1"), + transactionDate: new Date("2024-01-20"), + valueDate: new Date("2024-01-20"), + description: "Müşteri havale ödemesi", + referenceNumber: "EFT-001", + transactionType: BankTransactionTypeEnum.EFT, + amount: 25000, + currency: "TRY", + status: TransactionStatusEnum.Completed, + recipientName: "ABC Şirket", + recipientIban: "TR120006400000112345678901", + recipientBank: "İş Bankası", + creationTime: new Date("2024-01-20"), + }, + { + id: "2", + bankAccountId: "1", + bankAccount: mockBanks.find((acc) => acc.id === "1"), + transactionDate: new Date("2024-01-19"), + valueDate: new Date("2024-01-19"), + description: "Tedarikçi ödeme", + referenceNumber: "EFT-002", + transactionType: BankTransactionTypeEnum.Transfer, + amount: 15000, + currency: "TRY", + status: TransactionStatusEnum.Completed, + recipientName: "Tedarikçi Ltd.", + recipientIban: "TR980006200012600006298453", + recipientBank: "Garanti BBVA", + creationTime: new Date("2024-01-19"), + }, +]; diff --git a/ui/src/mocks/mockBanks.ts b/ui/src/mocks/mockBanks.ts new file mode 100644 index 00000000..2d52c6d3 --- /dev/null +++ b/ui/src/mocks/mockBanks.ts @@ -0,0 +1,45 @@ +import { BankAccountTypeEnum } from "../types/fi"; +import { BankAccount } from "../types/common"; + +export const mockBanks: BankAccount[] = [ + { + id: "1", + accountCode: "BANKA001", + bankName: "İş Bankası", + branchName: "Levent Şubesi", + accountNumber: "1234567890", + iban: "TR120006400000112345678901", + accountType: BankAccountTypeEnum.Current, + currency: "TRY", + balance: 125000, + overdraftLimit: 50000, + dailyTransferLimit: 100000, + isActive: true, + contactPerson: "Mehmet Ak", + phone: "+90 212 555 1111", + creationTime: new Date("2024-01-01"), + lastModificationTime: new Date("2024-01-20"), + swiftCode: "ISBKTRIS", + isDefault: true, + }, + { + id: "2", + accountCode: "BANKA002", + bankName: "Garanti BBVA", + branchName: "Şişli Şubesi", + accountNumber: "9876543210", + iban: "TR980006200012600006298453", + accountType: BankAccountTypeEnum.Deposit, + currency: "USD", + balance: 15000, + overdraftLimit: 0, + dailyTransferLimit: 50000, + isActive: true, + contactPerson: "Ayşe Yıldız", + phone: "+90 212 555 2222", + creationTime: new Date("2024-01-01"), + lastModificationTime: new Date("2024-01-18"), + swiftCode: "TGBATRIS", + isDefault: false, + }, +]; diff --git a/ui/src/mocks/mockBusinessParties.ts b/ui/src/mocks/mockBusinessParties.ts new file mode 100644 index 00000000..388e1743 --- /dev/null +++ b/ui/src/mocks/mockBusinessParties.ts @@ -0,0 +1,524 @@ +import { BankAccountTypeEnum } from "../types/fi"; +import { BusinessParty, BusinessPartyStatusEnum, PartyType, PaymentTerms } from "../types/common"; +import { + CustomerSegmentEnum, + CustomerTypeEnum, +} from "../types/crm"; +import { SupplierTypeEnum, SupplierCardTypeEnum } from "../types/mm"; + +export const mockBusinessParties: BusinessParty[] = [ + { + id: "1", + code: "SUP001", + supplierType: SupplierTypeEnum.Material, + name: "ABC Malzeme Ltd.", + primaryContact: { + id: "2", + firstName: "Fatma", + lastName: "Demir", + fullName: "Fatma Demir", + title: "Genel Müdür", + department: "Yönetim", + email: "fatma.demir@uretim.com", + phone: "+90 312 555 0202", + mobile: "+90 532 555 0202", + isPrimary: true, + isActive: true, + creationTime: new Date(), + lastModificationTime: new Date(), + }, + email: "aliveli@gmail.com", + phone: "+90 212 555 1234", + address: { + street: "İstiklal Cad. No:10", + city: "İstanbul", + state: "İstanbul", + postalCode: "34430", + country: "Türkiye", + }, + taxNumber: "1234567890", + paymentTerms: PaymentTerms.Net30, + currency: "TRY", + cardNumber: "SC-2024-001", + cardType: SupplierCardTypeEnum.Standard, + validFrom: new Date("2024-01-01"), + validTo: new Date("2024-12-31"), + creditLimit: 500000, + isActive: true, + currentBalance: 120000, + discountRate: 5, + specialConditions: ["Toplu sipariş indirimi", "Öncelikli teslimat"], + lastOrderDate: new Date("2024-08-15"), + performanceMetrics: { + deliveryPerformance: 95, + qualityRating: 90, + priceCompetitiveness: 85, + responsiveness: 67, + complianceRating: 88, + overallScore: 100, + lastEvaluationDate: new Date("2024-08-01"), + }, + certifications: ["ISO 9001", "ISO 14001"], + bankAccounts: [ + { + id: "BA001", + bankName: "Garanti BBVA", + accountNumber: "1234567890", + iban: "TR330006100519786457841326", + swiftCode: "TGBATRIS", + isDefault: true, + accountCode: "", + branchName: "", + accountType: BankAccountTypeEnum.Current, + currency: "", + balance: 0, + overdraftLimit: 0, + dailyTransferLimit: 0, + isActive: false, + creationTime: new Date(), + lastModificationTime: new Date(), + }, + ], + contacts: [ + { + id: "C001", + firstName: "Ali", + lastName: "Veli", + fullName: "Ali Veli", + title: "Satınalma Müdürü", + email: "aliveli@gmail.com", + phone: "+90 212 555 1234", + department: "Satınalma", + isPrimary: true, + isActive: false, + creationTime: new Date(), + lastModificationTime: new Date(), + }, + ], + creationTime: new Date(), + lastModificationTime: new Date(), + partyType: PartyType.Supplier, + }, + { + id: "2", + code: "SUP002", + supplierType: SupplierTypeEnum.Service, + name: "XYZ Teknoloji A.Ş.", + primaryContact: { + id: "2", + firstName: "Fatma", + lastName: "Demir", + fullName: "Fatma Demir", + title: "Genel Müdür", + department: "Yönetim", + email: "fatma.demir@uretim.com", + phone: "+90 312 555 0202", + mobile: "+90 532 555 0202", + isPrimary: true, + isActive: true, + creationTime: new Date(), + lastModificationTime: new Date(), + }, + email: "aysedemir@gmail.com", + phone: "+90 216 555 5678", + address: { + street: "Barbaros Bulv. No:20", + city: "İstanbul", + state: "İstanbul", + postalCode: "34746", + country: "Türkiye", + }, + taxNumber: "0987654321", + paymentTerms: PaymentTerms.Net15, + currency: "TRY", + cardNumber: "SC-2024-002", + cardType: SupplierCardTypeEnum.Premium, + validFrom: new Date("2024-02-01"), + validTo: new Date("2024-12-31"), + creditLimit: 250000, + isActive: true, + currentBalance: 75000, + discountRate: 3, + specialConditions: ["Hızlı teslimat", "Kalite garantisi"], + lastOrderDate: new Date("2024-08-20"), + performanceMetrics: { + deliveryPerformance: 88, + qualityRating: 90, + priceCompetitiveness: 85, + responsiveness: 87, + complianceRating: 91, + overallScore: 88, + lastEvaluationDate: new Date("2024-08-01"), + }, + certifications: ["ISO 9001"], + bankAccounts: [ + { + id: "BA002", + bankName: "İş Bankası", + accountNumber: "0987654321", + iban: "TR440006200519786457841327", + swiftCode: "ISBKTRIS", + isDefault: true, + accountCode: "", + branchName: "", + accountType: BankAccountTypeEnum.Current, + currency: "", + balance: 0, + overdraftLimit: 0, + dailyTransferLimit: 0, + isActive: false, + creationTime: new Date(), + lastModificationTime: new Date(), + }, + ], + contacts: [ + { + id: "C002", + firstName: "Ayşe", + lastName: "Demir", + fullName: "Ayşe Demir", + title: "Satış Müdürü", + email: "aysedemir@gmail.com", + phone: "+90 216 555 5678", + department: "Satış", + isPrimary: true, + isActive: false, + creationTime: new Date(), + lastModificationTime: new Date(), + }, + ], + creationTime: new Date(), + lastModificationTime: new Date(), + partyType: PartyType.Supplier, + }, + { + id: "3", + code: "SUP003", + supplierType: SupplierTypeEnum.Both, + name: "LMN Endüstri A.Ş.", + primaryContact: { + id: "2", + firstName: "Fatma", + lastName: "Demir", + fullName: "Fatma Demir", + title: "Genel Müdür", + department: "Yönetim", + email: "fatma.demir@uretim.com", + phone: "+90 312 555 0202", + mobile: "+90 532 555 0202", + isPrimary: true, + isActive: true, + creationTime: new Date(), + lastModificationTime: new Date(), + }, + email: "mehmetyilmaz@gmail.com", + phone: "+90 232 555 7890", + address: { + street: "Atatürk Cad. No:5", + city: "İzmir", + state: "İzmir", + postalCode: "35210", + country: "Türkiye", + }, + taxNumber: "1122334455", + paymentTerms: PaymentTerms.Net45, + currency: "TRY", + cardNumber: "SC-2024-003", + cardType: SupplierCardTypeEnum.Preferred, + validFrom: new Date("2024-03-01"), + validTo: new Date("2024-12-31"), + creditLimit: 150000, + isActive: true, + currentBalance: 45000, + discountRate: 2, + specialConditions: ["Toplu sipariş indirimi"], + lastOrderDate: new Date("2024-08-18"), + performanceMetrics: { + deliveryPerformance: 82, + qualityRating: 85, + priceCompetitiveness: 90, + responsiveness: 80, + complianceRating: 88, + overallScore: 85, + lastEvaluationDate: new Date("2024-07-15"), + }, + certifications: ["ISO 9001", "OHSAS 18001"], + bankAccounts: [ + { + id: "BA003", + bankName: "Yapı Kredi", + accountNumber: "1122334455", + iban: "TR550006300519786457841328", + swiftCode: "YAPITRIS", + isDefault: true, + accountCode: "", + branchName: "", + accountType: BankAccountTypeEnum.Current, + currency: "", + balance: 0, + overdraftLimit: 0, + dailyTransferLimit: 0, + isActive: false, + creationTime: new Date(), + lastModificationTime: new Date(), + }, + ], + contacts: [ + { + id: "C003", + firstName: "Mehmet", + lastName: "Yılmaz", + fullName: "Mehmet Yılmaz", + title: "Genel Müdür", + email: "mehmetyilmaz@gmail.com", + phone: "+90 232 555 7890", + department: "Yönetim", + isPrimary: true, + isActive: false, + creationTime: new Date(), + lastModificationTime: new Date(), + }, + ], + creationTime: new Date(), + lastModificationTime: new Date(), + partyType: PartyType.Supplier, + }, + { + id: "4", + code: "SUP004", + supplierType: SupplierTypeEnum.Material, + name: "OPQ Ticaret Ltd.", + primaryContact: { + id: "2", + firstName: "Fatma", + lastName: "Demir", + fullName: "Fatma Demir", + title: "Genel Müdür", + department: "Yönetim", + email: "fatma.demir@uretim.com", + phone: "+90 312 555 0202", + mobile: "+90 532 555 0202", + isPrimary: true, + isActive: true, + creationTime: new Date(), + lastModificationTime: new Date(), + }, + email: "fatmacelik@gmail.com", + phone: "+90 312 555 3456", + address: { + street: "Kızılay Meydanı No:15", + city: "Ankara", + state: "Ankara", + postalCode: "06690", + country: "Türkiye", + }, + taxNumber: "6677889900", + paymentTerms: PaymentTerms.Net30, + currency: "TRY", + cardNumber: "SC-2024-004", + cardType: SupplierCardTypeEnum.Standard, + validFrom: new Date("2024-04-01"), + validTo: new Date("2024-12-31"), + creditLimit: 100000, + isActive: false, + currentBalance: 30000, + discountRate: 4, + specialConditions: ["Öncelikli sipariş", "Hızlı teslimat"], + lastOrderDate: new Date("2024-06-30"), + performanceMetrics: { + deliveryPerformance: 75, + qualityRating: 78, + priceCompetitiveness: 82, + responsiveness: 76, + complianceRating: 80, + overallScore: 78, + lastEvaluationDate: new Date("2024-07-01"), + }, + certifications: ["ISO 9001"], + bankAccounts: [ + { + id: "BA004", + bankName: "Halkbank", + accountNumber: "6677889900", + iban: "TR660006400519786457841329", + swiftCode: "HALKTRIS", + isDefault: true, + accountCode: "", + branchName: "", + accountType: BankAccountTypeEnum.Current, + currency: "", + balance: 0, + overdraftLimit: 0, + dailyTransferLimit: 0, + isActive: false, + creationTime: new Date(), + lastModificationTime: new Date(), + }, + ], + contacts: [ + { + id: "C004", + firstName: "Fatma", + lastName: "Çelik", + fullName: "Fatma Çelik", + title: "Finans Müdürü", + email: "fatmacelik@gmail.com", + phone: "+90 312 555 3456", + department: "Finans", + isPrimary: true, + isActive: false, + creationTime: new Date(), + lastModificationTime: new Date(), + }, + ], + creationTime: new Date(), + lastModificationTime: new Date(), + partyType: PartyType.Supplier, + }, + { + id: "5", + code: "CUST-002", + name: "Üretim Ltd.", + customerType: CustomerTypeEnum.Company, + industry: "İmalat", + website: "www.uretim.com", + primaryContact: { + id: "2", + firstName: "Fatma", + lastName: "Demir", + fullName: "Fatma Demir", + title: "Genel Müdür", + department: "Yönetim", + email: "fatma.demir@uretim.com", + phone: "+90 312 555 0202", + mobile: "+90 532 555 0202", + isPrimary: true, + isActive: true, + creationTime: new Date(), + lastModificationTime: new Date(), + }, + contacts: [], + address: { + street: "Sanayi Sitesi 5. Cadde No:25", + city: "Ankara", + state: "Ankara", + postalCode: "06000", + country: "Türkiye", + }, + taxNumber: "0987654321", + registrationNumber: "REG-002", + creditLimit: 500000, + paymentTerms: PaymentTerms.Net60, + currency: "TRY", + status: BusinessPartyStatusEnum.Active, + customerSegment: CustomerSegmentEnum.SMB, + assignedSalesRep: "REP-002", + teamId: "TEAM-001", + totalRevenue: 850000, + lastOrderDate: new Date("2024-01-10"), + averageOrderValue: 42500, + lifetimeValue: 1700000, + opportunities: [], + orders: [], + activities: [], + isActive: true, + creationTime: new Date("2023-09-20"), + lastModificationTime: new Date("2024-01-18"), + partyType: PartyType.Customer, + }, + { + id: "6", + code: "CUST-001", + name: "Teknoloji A.Ş.", + customerType: CustomerTypeEnum.Company, + industry: "Teknoloji", + website: "www.teknoloji.com", + primaryContact: { + id: "1", + firstName: "Ali", + lastName: "Yılmaz", + fullName: "Ali Yılmaz", + title: "Satınalma Müdürü", + department: "Satınalma", + email: "ali.yilmaz@teknoloji.com", + phone: "+90 212 555 0201", + mobile: "+90 532 555 0201", + isPrimary: true, + isActive: true, + creationTime: new Date(), + lastModificationTime: new Date(), + }, + contacts: [], + address: { + street: "Teknoloji Caddesi No:100", + city: "İstanbul", + state: "İstanbul", + postalCode: "34000", + country: "Türkiye", + }, + taxNumber: "1234567890", + registrationNumber: "REG-001", + creditLimit: 1000000, + paymentTerms: PaymentTerms.Net30, + currency: "TRY", + status: BusinessPartyStatusEnum.Active, + customerSegment: CustomerSegmentEnum.Enterprise, + assignedSalesRep: "REP-001", + teamId: "TEAM-001", + totalRevenue: 2500000, + lastOrderDate: new Date("2024-01-15"), + averageOrderValue: 125000, + lifetimeValue: 5000000, + opportunities: [], + orders: [], + activities: [], + isActive: true, + creationTime: new Date("2023-06-15"), + lastModificationTime: new Date("2024-01-20"), + partyType: PartyType.Customer, + }, +]; + +export const mockBusinessPartyNew: BusinessParty = { + id: "", + code: "", + supplierType: SupplierTypeEnum.Both, + name: "", + email: "", + phone: "", + address: { + street: "", + city: "", + state: "", + postalCode: "", + country: "", + }, + taxNumber: "", + paymentTerms: PaymentTerms.Cash, + currency: "TRY", + cardNumber: "", + cardType: SupplierCardTypeEnum.Standard, + validTo: new Date(), + validFrom: new Date(), + creditLimit: 0, + isActive: true, + currentBalance: 0, + discountRate: 0, + specialConditions: [], + lastOrderDate: new Date(), + performanceMetrics: { + deliveryPerformance: 0, + qualityRating: 0, + priceCompetitiveness: 0, + responsiveness: 0, + complianceRating: 0, + overallScore: 0, + lastEvaluationDate: new Date(), + }, + certifications: [], + bankAccounts: [], + contacts: [], + creationTime: new Date(), + lastModificationTime: new Date(), + partyType: PartyType.Supplier, +}; diff --git a/ui/src/mocks/mockCashAccounts.ts b/ui/src/mocks/mockCashAccounts.ts new file mode 100644 index 00000000..1632edff --- /dev/null +++ b/ui/src/mocks/mockCashAccounts.ts @@ -0,0 +1,26 @@ +import { FiCashAccount } from "../types/fi"; + + export const mockCashAccounts: FiCashAccount[] = [ + { + id: "1", + accountCode: "KASA001", + name: "Ana Kasa", + description: "Ana nakit kasası", + currency: "TRY", + balance: 15000, + isActive: true, + creationTime: new Date("2024-01-01"), + lastModificationTime: new Date("2024-01-20"), + }, + { + id: "2", + accountCode: "KASA002", + name: "USD Kasa", + description: "Döviz kasası", + currency: "USD", + balance: 2500, + isActive: true, + creationTime: new Date("2024-01-01"), + lastModificationTime: new Date("2024-01-18"), + }, + ]; \ No newline at end of file diff --git a/ui/src/mocks/mockCashMovements.ts b/ui/src/mocks/mockCashMovements.ts new file mode 100644 index 00000000..e26d2aff --- /dev/null +++ b/ui/src/mocks/mockCashMovements.ts @@ -0,0 +1,29 @@ +import { FiCashMovement, CashMovementTypeEnum } from "../types/fi"; +import { mockCashAccounts } from "./mockCashAccounts"; + +export const mockCashMovements: FiCashMovement[] = [ + { + id: "1", + cashAccountId: "1", + cashAccount: mockCashAccounts[0], + transactionDate: new Date("2024-01-20"), + description: "Müşteri nakit ödemesi", + referenceNumber: "NAK-001", + movementType: CashMovementTypeEnum.Income, + amount: 5000, + currency: "TRY", + creationTime: new Date("2024-01-20"), + }, + { + id: "2", + cashAccountId: "1", + cashAccount: mockCashAccounts[0], + transactionDate: new Date("2024-01-19"), + description: "Kasa gider", + referenceNumber: "NAK-002", + movementType: CashMovementTypeEnum.Expense, + amount: 1000, + currency: "TRY", + creationTime: new Date("2024-01-19"), + }, +]; diff --git a/ui/src/mocks/mockChecks.ts b/ui/src/mocks/mockChecks.ts new file mode 100644 index 00000000..7504736b --- /dev/null +++ b/ui/src/mocks/mockChecks.ts @@ -0,0 +1,44 @@ +import { FiCheck, CheckStatusEnum, CheckTypeEnum } from "../types/fi"; +import { mockCurrentAccounts } from "./mockCurrentAccounts"; + +export const mockChecks: FiCheck[] = [ + { + id: "1", + checkNumber: "CHK-001", + bankName: "İş Bankası", + branchName: "Levent Şubesi", + accountNumber: "1234567890", + type: CheckTypeEnum.Received, + drawerName: "XYZ Müşteri A.Ş.", + payeeName: "ABC Şirket", + issueDate: new Date("2024-01-15"), + dueDate: new Date("2024-02-15"), + amount: 25000, + currency: "TRY", + status: CheckStatusEnum.InHand, + currentAccountId: "1", + currentAccount: mockCurrentAccounts.find((ca) => ca.id === "1"), + creationTime: new Date("2024-01-15"), + lastModificationTime: new Date("2024-01-15"), + }, + { + id: "2", + checkNumber: "CHK-002", + bankName: "Garanti BBVA", + branchName: "Şişli Şubesi", + accountNumber: "9876543210", + type: CheckTypeEnum.Issued, + drawerName: "ABC Şirket", + payeeName: "Tedarikçi Ltd.", + issueDate: new Date("2024-01-10"), + dueDate: new Date("2024-02-10"), + amount: 15000, + currency: "TRY", + status: CheckStatusEnum.Deposited, + bankingDate: new Date("2024-01-20"), + currentAccountId: "2", + currentAccount: mockCurrentAccounts.find((ca) => ca.id === "2"), + creationTime: new Date("2024-01-10"), + lastModificationTime: new Date("2024-01-20"), + }, +]; diff --git a/ui/src/mocks/mockCostCenters.ts b/ui/src/mocks/mockCostCenters.ts new file mode 100644 index 00000000..14c63885 --- /dev/null +++ b/ui/src/mocks/mockCostCenters.ts @@ -0,0 +1,184 @@ +import { HrCostCenter, CostCenterType } from "../types/hr"; + +export const mockCostCenters: HrCostCenter[] = [ + { + id: "cc-001", + code: "CC-ADM-001", + name: "Genel Yönetim", + description: "Şirket genel yönetim masrafları", + costCenterType: CostCenterType.Administrative, + budgetedAmount: 2500000, + actualAmount: 2350000, + currency: "TRY", + fiscalYear: "2025", + isActive: true, + creationTime: new Date("2024-01-15"), + lastModificationTime: new Date("2024-12-01"), + subCostCenters: [], + }, + { + id: "cc-002", + code: "CC-HR-001", + name: "İnsan Kaynakları", + description: "İnsan kaynakları departmanı masrafları", + costCenterType: CostCenterType.Support, + budgetedAmount: 1800000, + actualAmount: 1650000, + currency: "TRY", + fiscalYear: "2025", + isActive: true, + creationTime: new Date("2024-01-15"), + lastModificationTime: new Date("2024-11-15"), + subCostCenters: [], + }, + { + id: "cc-003", + code: "CC-FIN-001", + name: "Finans ve Muhasebe", + description: "Mali işler ve muhasebe masrafları", + costCenterType: CostCenterType.Support, + budgetedAmount: 1500000, + actualAmount: 1420000, + currency: "TRY", + fiscalYear: "2025", + isActive: true, + creationTime: new Date("2024-01-15"), + lastModificationTime: new Date("2024-11-20"), + subCostCenters: [], + }, + { + id: "cc-004", + code: "CC-IT-001", + name: "Bilgi İşlem", + description: "IT altyapı ve yazılım masrafları", + costCenterType: CostCenterType.Support, + budgetedAmount: 3200000, + actualAmount: 3100000, + currency: "TRY", + fiscalYear: "2025", + isActive: true, + creationTime: new Date("2024-01-15"), + lastModificationTime: new Date("2024-12-05"), + subCostCenters: [], + }, + { + id: "cc-005", + code: "CC-PROD-001", + name: "Üretim Departmanı", + description: "Üretim faaliyetleri masrafları", + costCenterType: CostCenterType.Production, + budgetedAmount: 8500000, + actualAmount: 8200000, + currency: "TRY", + fiscalYear: "2025", + isActive: true, + creationTime: new Date("2024-01-15"), + lastModificationTime: new Date("2024-12-10"), + subCostCenters: [], + }, + { + id: "cc-006", + code: "CC-SAL-001", + name: "Satış ve Pazarlama", + description: "Satış ve pazarlama faaliyetleri", + costCenterType: CostCenterType.Revenue, + budgetedAmount: 4200000, + actualAmount: 4050000, + currency: "TRY", + fiscalYear: "2025", + isActive: true, + creationTime: new Date("2024-01-15"), + lastModificationTime: new Date("2024-12-08"), + subCostCenters: [], + }, + { + id: "cc-007", + code: "CC-QUA-001", + name: "Kalite Kontrol", + description: "Kalite kontrol ve güvence masrafları", + costCenterType: CostCenterType.Support, + budgetedAmount: 1200000, + actualAmount: 1150000, + currency: "TRY", + fiscalYear: "2025", + isActive: true, + creationTime: new Date("2024-01-15"), + lastModificationTime: new Date("2024-11-25"), + subCostCenters: [], + }, + { + id: "cc-008", + code: "CC-LOG-001", + name: "Lojistik ve Depo", + description: "Lojistik operasyonları ve depo masrafları", + costCenterType: CostCenterType.Support, + budgetedAmount: 2800000, + actualAmount: 2650000, + currency: "TRY", + fiscalYear: "2025", + isActive: true, + creationTime: new Date("2024-01-15"), + lastModificationTime: new Date("2024-12-03"), + subCostCenters: [], + }, + { + id: "cc-009", + code: "CC-RND-001", + name: "Ar-Ge Departmanı", + description: "Araştırma ve geliştirme masrafları", + costCenterType: CostCenterType.Investment, + budgetedAmount: 3500000, + actualAmount: 3300000, + currency: "TRY", + fiscalYear: "2025", + isActive: true, + creationTime: new Date("2024-01-15"), + lastModificationTime: new Date("2024-12-07"), + subCostCenters: [], + }, + { + id: "cc-010", + code: "CC-PUR-001", + name: "Satın Alma", + description: "Satın alma ve tedarik masrafları", + costCenterType: CostCenterType.Support, + budgetedAmount: 1600000, + actualAmount: 1520000, + currency: "TRY", + fiscalYear: "2025", + isActive: true, + creationTime: new Date("2024-01-15"), + lastModificationTime: new Date("2024-11-30"), + subCostCenters: [], + }, + { + id: "cc-011", + code: "CC-MAI-001", + name: "Bakım ve Onarım", + description: "Bakım ve onarım masrafları", + costCenterType: CostCenterType.Service, + budgetedAmount: 2200000, + actualAmount: 2100000, + currency: "TRY", + fiscalYear: "2025", + isActive: true, + creationTime: new Date("2024-01-15"), + lastModificationTime: new Date("2024-12-02"), + subCostCenters: [], + }, + { + id: "cc-012", + code: "CC-CUS-001", + name: "Müşteri Hizmetleri", + description: "Müşteri hizmetleri masrafları", + costCenterType: CostCenterType.Service, + budgetedAmount: 1000000, + actualAmount: 950000, + currency: "TRY", + fiscalYear: "2025", + isActive: true, + creationTime: new Date("2024-01-15"), + lastModificationTime: new Date("2024-11-28"), + subCostCenters: [], + }, +]; diff --git a/ui/src/mocks/mockCurrencies.ts b/ui/src/mocks/mockCurrencies.ts new file mode 100644 index 00000000..18467021 --- /dev/null +++ b/ui/src/mocks/mockCurrencies.ts @@ -0,0 +1,5 @@ +export const mockCurrencies = [ + { value: "TRY", label: "Türk Lirası (₺)" }, + { value: "USD", label: "Amerikan Doları ($)" }, + { value: "EUR", label: "Euro (€)" }, +]; diff --git a/ui/src/mocks/mockCurrentAccountMovements.ts b/ui/src/mocks/mockCurrentAccountMovements.ts new file mode 100644 index 00000000..2b1ff697 --- /dev/null +++ b/ui/src/mocks/mockCurrentAccountMovements.ts @@ -0,0 +1,154 @@ +import { FiCurrentAccountMovement, FiDocumentTypeEnum } from "../types/fi"; + +export const mockCurrentAccountMovements: FiCurrentAccountMovement[] = [ + { + id: "am1", + accountId: "1", + transactionDate: new Date("2024-11-01"), + description: "Satış faturası - SF2024/001", + referenceNumber: "SF2024/001", + documentType: FiDocumentTypeEnum.Invoice, + documentNumber: "SF2024/001", + debitAmount: 0, + creditAmount: 25000, + balance: -15000, + currency: "TRY", + invoiceId: "inv1", + creationTime: new Date("2024-11-01T10:30:00"), + }, + { + id: "am2", + accountId: "1", + transactionDate: new Date("2024-10-28"), + description: "Tahsilat - Nakit", + referenceNumber: "TH2024/001", + documentType: FiDocumentTypeEnum.Payment, + documentNumber: "TH2024/001", + debitAmount: 10000, + creditAmount: 0, + balance: 10000, + currency: "TRY", + paymentId: "pay1", + creationTime: new Date("2024-10-28T14:15:00"), + }, + { + id: "am3", + accountId: "2", + transactionDate: new Date("2024-11-02"), + description: "Alış faturası - AF2024/003", + referenceNumber: "AF2024/003", + documentType: FiDocumentTypeEnum.Invoice, + documentNumber: "AF2024/003", + debitAmount: 15000, + creditAmount: 0, + balance: 25000, + currency: "TRY", + invoiceId: "inv2", + creationTime: new Date("2024-11-02T09:45:00"), + }, + { + id: "am4", + accountId: "2", + transactionDate: new Date("2024-10-30"), + description: "Ödeme - Banka Havalesi", + referenceNumber: "OD2024/005", + documentType: FiDocumentTypeEnum.Payment, + documentNumber: "OD2024/005", + debitAmount: 0, + creditAmount: 12000, + balance: 10000, + currency: "TRY", + paymentId: "pay2", + creationTime: new Date("2024-10-30T16:20:00"), + }, + { + id: "am5", + accountId: "1", + transactionDate: new Date("2024-10-25"), + description: "Satış faturası - SF2024/002", + referenceNumber: "SF2024/002", + documentType: FiDocumentTypeEnum.Invoice, + documentNumber: "SF2024/002", + debitAmount: 0, + creditAmount: 18000, + balance: 0, + currency: "TRY", + invoiceId: "inv3", + creationTime: new Date("2024-10-25T11:10:00"), + }, + { + id: "am6", + accountId: "3", + transactionDate: new Date("2024-11-03"), + description: "Alış faturası - AF2024/004", + referenceNumber: "AF2024/004", + documentType: FiDocumentTypeEnum.Invoice, + documentNumber: "AF2024/004", + debitAmount: 8500, + creditAmount: 0, + balance: 8500, + currency: "TRY", + invoiceId: "inv4", + creationTime: new Date("2024-11-03T13:30:00"), + }, + { + id: "am7", + accountId: "2", + transactionDate: new Date("2024-10-22"), + description: "Tahsilat - Çek", + referenceNumber: "TH2024/002", + documentType: FiDocumentTypeEnum.Check, + documentNumber: "TH2024/002", + debitAmount: 22000, + creditAmount: 0, + balance: 22000, + currency: "TRY", + paymentId: "pay3", + creationTime: new Date("2024-10-22T15:45:00"), + }, + { + id: "am8", + accountId: "1", + transactionDate: new Date("2024-10-20"), + description: "İade faturası - IF2024/001", + referenceNumber: "IF2024/001", + documentType: FiDocumentTypeEnum.Invoice, + documentNumber: "IF2024/001", + debitAmount: 3000, + creditAmount: 0, + balance: 18000, + currency: "TRY", + invoiceId: "inv5", + creationTime: new Date("2024-10-20T12:20:00"), + }, + { + id: "am9", + accountId: "3", + transactionDate: new Date("2024-10-18"), + description: "Ödeme - Kredi Kartı", + referenceNumber: "OD2024/006", + documentType: FiDocumentTypeEnum.Payment, + documentNumber: "OD2024/006", + debitAmount: 0, + creditAmount: 5000, + balance: 0, + currency: "TRY", + paymentId: "pay4", + creationTime: new Date("2024-10-18T14:00:00"), + }, + { + id: "am10", + accountId: "4", + transactionDate: new Date("2024-11-04"), + description: "Satış faturası - SF2024/003", + referenceNumber: "SF2024/003", + documentType: FiDocumentTypeEnum.Invoice, + documentNumber: "SF2024/003", + debitAmount: 0, + creditAmount: 32000, + balance: -32000, + currency: "TRY", + invoiceId: "inv6", + creationTime: new Date("2024-11-04T10:15:00"), + }, +]; diff --git a/ui/src/mocks/mockCurrentAccounts.ts b/ui/src/mocks/mockCurrentAccounts.ts new file mode 100644 index 00000000..98809525 --- /dev/null +++ b/ui/src/mocks/mockCurrentAccounts.ts @@ -0,0 +1,115 @@ +import { AccountTypeEnum, FiCurrentAccount, RiskGroupEnum } from "../types/fi"; +import { mockBusinessParties } from "./mockBusinessParties"; + +export const mockCurrentAccounts: FiCurrentAccount[] = [ + { + id: "1", + accountCode: "CA001", + businessPartyId: "1", + businessParty: mockBusinessParties.find((bp) => bp.id === "1"), + type: AccountTypeEnum.Supplier, + taxNumber: "1234567890", + taxOffice: "Beylikdüzü V.D.", + contactPerson: "Ahmet Yılmaz", + phone: "+90 212 555 1234", + email: "info@abctedarik.com", + address: "Beylikdüzü Organize Sanayi Bölgesi, İstanbul", + creditLimit: 50000, + balance: -15000, + currency: "TRY", + riskGroup: RiskGroupEnum.Low, + paymentTerm: 30, + isActive: true, + creationTime: new Date("2024-01-15"), + lastModificationTime: new Date("2024-01-20"), + lastTransactionDate: new Date("2024-11-01"), + }, + { + id: "2", + accountCode: "CA002", + businessPartyId: "2", + businessParty: mockBusinessParties.find((bp) => bp.id === "2"), + type: AccountTypeEnum.Customer, + taxNumber: "9876543210", + taxOffice: "Kadıköy V.D.", + contactPerson: "Fatma Demir", + phone: "+90 216 888 5678", + email: "satis@xyzmuster.com", + address: "Kadıköy, İstanbul", + creditLimit: 100000, + balance: 25000, + currency: "TRY", + riskGroup: RiskGroupEnum.Medium, + paymentTerm: 45, + isActive: true, + creationTime: new Date("2024-02-01"), + lastModificationTime: new Date("2024-02-10"), + lastTransactionDate: new Date("2024-11-02"), + }, + { + id: "3", + accountCode: "CA003", + businessPartyId: "3", + businessParty: mockBusinessParties.find((bp) => bp.id === "3"), + type: AccountTypeEnum.Both, + taxNumber: "5555666677", + taxOffice: "Ümraniye V.D.", + contactPerson: "Mehmet Kaya", + phone: "+90 216 333 4455", + email: "info@definsaat.com", + address: "Ümraniye, İstanbul", + creditLimit: 75000, + balance: 8500, + currency: "TRY", + riskGroup: RiskGroupEnum.Low, + paymentTerm: 30, + isActive: true, + creationTime: new Date("2024-03-10"), + lastModificationTime: new Date("2024-03-15"), + lastTransactionDate: new Date("2024-11-03"), + }, + { + id: "4", + accountCode: "CA004", + businessPartyId: "4", + businessParty: mockBusinessParties.find((bp) => bp.id === "4"), + type: AccountTypeEnum.Customer, + taxNumber: "1111222233", + taxOffice: "Beşiktaş V.D.", + contactPerson: "Ayşe Özkan", + phone: "+90 212 777 8899", + email: "info@ghiteknoloji.com", + address: "Beşiktaş, İstanbul", + creditLimit: 200000, + balance: -32000, + currency: "TRY", + riskGroup: RiskGroupEnum.Low, + paymentTerm: 60, + isActive: true, + creationTime: new Date("2024-04-05"), + lastModificationTime: new Date("2024-04-12"), + lastTransactionDate: new Date("2024-11-04"), + }, + { + id: "5", + accountCode: "CA005", + businessPartyId: "5", + businessParty: mockBusinessParties.find((bp) => bp.id === "5"), + type: AccountTypeEnum.Supplier, + taxNumber: "9999888877", + taxOffice: "Maltepe V.D.", + contactPerson: "Ali Öz", + phone: "+90 216 555 1122", + email: "info@jklgida.com", + address: "Maltepe, İstanbul", + creditLimit: 30000, + balance: 45000, + currency: "TRY", + riskGroup: RiskGroupEnum.High, + paymentTerm: 15, + isActive: true, + creationTime: new Date("2024-05-20"), + lastModificationTime: new Date("2024-05-25"), + lastTransactionDate: new Date("2024-10-28"), + }, +]; diff --git a/ui/src/mocks/mockDeliveries.ts b/ui/src/mocks/mockDeliveries.ts new file mode 100644 index 00000000..70ca1d84 --- /dev/null +++ b/ui/src/mocks/mockDeliveries.ts @@ -0,0 +1,149 @@ +import { MmDelivery, DeliveryStatusEnum, RequestTypeEnum } from "../types/mm"; + +export const mockDeliveries: MmDelivery[] = [ + { + id: "DEL001", + deliveryNumber: "TES-2024-001", + orderId: "ORD001", + orderNumber: "SIP-2024-001", + requestType: RequestTypeEnum.Material, + supplierId: "SUP001", + supplierName: "ABC Malzeme Ltd.", + courierCompany: "Hızlı Kargo", + trackingNumber: "HK123456789", + deliveryDate: new Date("2024-02-03"), + expectedDeliveryDate: new Date("2024-02-05"), + actualDeliveryDate: new Date("2024-02-03"), + status: DeliveryStatusEnum.Delivered, + deliveryAddress: "Organize Sanayi Bölgesi, 1. Cadde No:15, İstanbul", + receivedBy: "Ahmet Yıldız - Depo Sorumlusu", + items: [ + { + id: "DELI001", + materialId: "MAL001", + materialName: "Çelik Profil 40x40", + orderedQuantity: 100, + deliveredQuantity: 100, + unit: "adet", + condition: "Good", // ✅ artık DeliveryItem union tipine uygun + notes: "Tam ve hasarsız teslim alındı", + }, + { + id: "DELI002", + materialId: "MAL002", + materialName: "Kaynak Elektrodu", + orderedQuantity: 200, + deliveredQuantity: 200, + unit: "kg", + condition: "Good", + notes: "Ambalaj intact", + }, + ], + notes: "Öncelikli teslimat - 2 gün erken teslim edildi.", + attachments: ["teslimat_tutanagi.pdf", "kalite_kontrol_raporu.pdf"], + creationTime: new Date("2024-02-01"), + lastModificationTime: new Date("2024-02-03"), + }, + { + id: "DEL002", + deliveryNumber: "TES-2024-002", + orderId: "ORD002", + orderNumber: "SIP-2024-002", + requestType: RequestTypeEnum.WorkCenter, + supplierId: "SUP002", + supplierName: "XYZ Teknoloji A.Ş.", + courierCompany: "Güvenli Nakliyat", + trackingNumber: "GN987654321", + deliveryDate: new Date("2024-02-08"), + expectedDeliveryDate: new Date("2024-02-12"), + status: DeliveryStatusEnum.PartiallyDelivered, + deliveryAddress: "İş Merkezi, 3. Kat, Levent, İstanbul", + receivedBy: "Zeynep Kaya - IT Sorumlusu", + items: [ + { + id: "DELI003", + materialId: "EQP001", + materialName: "Masaüstü Bilgisayar", + orderedQuantity: 10, + deliveredQuantity: 7, + unit: "adet", + condition: "Good", + notes: "3 adet gecikecek - tedarikçi bilgilendirildi", + }, + { + id: "DELI004", + materialId: "EQP002", + materialName: "Monitör", + orderedQuantity: 10, + deliveredQuantity: 10, + unit: "adet", + condition: "Good", + notes: "Tam teslimat", + }, + ], + notes: "Kısmi teslimat - kalan 3 adet bilgisayar sonraki hafta gelecek.", + attachments: ["kismi_teslimat_tutanagi.pdf"], + creationTime: new Date("2024-02-05"), + lastModificationTime: new Date("2024-02-08"), + }, + { + id: "DEL003", + deliveryNumber: "TES-2024-003", + orderId: "ORD003", + orderNumber: "SIP-2024-003", + requestType: RequestTypeEnum.Service, + supplierId: "SUP003", + supplierName: "DEF Bakım Ltd.", + deliveryDate: new Date("2024-02-01"), + expectedDeliveryDate: new Date("2024-02-01"), + status: DeliveryStatusEnum.InTransit, + deliveryAddress: "Fabrika Sahası, Makine Atölyesi, Gebze, Kocaeli", + items: [ + { + id: "DELI005", + materialId: "SRV001", + materialName: "Preventif Bakım Hizmeti", + orderedQuantity: 1, + deliveredQuantity: 0, + unit: "hizmet", + condition: "Good", + notes: "Teknisyen yolda", + }, + ], + notes: "Tekniker ekibi fabrikaya doğru yola çıktı.", + attachments: [], + creationTime: new Date("2024-01-30"), + lastModificationTime: new Date("2024-02-01"), + }, + { + id: "DEL004", + deliveryNumber: "TES-2024-004", + orderId: "ORD004", + orderNumber: "SIP-2024-004", + requestType: RequestTypeEnum.Material, + supplierId: "SUP004", + supplierName: "GHI Kimya San.", + courierCompany: "Özel Taşıma", + trackingNumber: "OT456789123", + deliveryDate: new Date("2024-02-10"), + expectedDeliveryDate: new Date("2024-02-08"), + status: DeliveryStatusEnum.Delayed, + deliveryAddress: "Kimya Fabrikası, Yarışlı Mah., İzmit, Kocaeli", + items: [ + { + id: "DELI006", + materialId: "CHE001", + materialName: "Endüstriyel Temizlik Kimyasalı", + orderedQuantity: 500, + deliveredQuantity: 0, + unit: "litre", + condition: "Good", + notes: "Özel izin bekliyor", + }, + ], + notes: "Kimyasal madde izni bekleniyor - 2 gün gecikme var.", + attachments: ["gecikme_bildirimi.pdf"], + creationTime: new Date("2024-02-05"), + lastModificationTime: new Date("2024-02-10"), + }, +]; diff --git a/ui/src/mocks/mockDemandPlanning.ts b/ui/src/mocks/mockDemandPlanning.ts new file mode 100644 index 00000000..ec8702bb --- /dev/null +++ b/ui/src/mocks/mockDemandPlanning.ts @@ -0,0 +1,163 @@ +import { + MrpDemandForecast, + ForecastMethodEnum, + MrpMaterialRequirement, + RequirementSourceTypeEnum, +} from "../types/mrp"; +import { mockMaterials } from "./mockMaterials"; + +export const mockDemandForecasts: MrpDemandForecast[] = [ + { + id: "1", + materialId: "1", + material: mockMaterials.find((m) => m.id === "1"), + forecastPeriod: "Ocak 2025", + startDate: new Date("2025-01-01"), + endDate: new Date("2025-01-31"), + forecastMethod: ForecastMethodEnum.MovingAverage, + forecastQuantity: 1200, + actualQuantity: 1150, + accuracy: 95.8, + seasonalityFactor: 1.1, + trendFactor: 1.02, + creationTime: new Date("2024-12-15"), + lastModificationTime: new Date("2024-12-20"), + notes: "Geçen senenin aynı dönemine göre %10 artış öngörüldü.", + }, + { + id: "2", + materialId: "2", + material: mockMaterials.find((m) => m.id === "2"), + forecastPeriod: "Ocak 2025", + startDate: new Date("2025-01-01"), + endDate: new Date("2025-01-31"), + forecastMethod: ForecastMethodEnum.ExponentialSmoothing, + forecastQuantity: 800, + actualQuantity: 820, + accuracy: 97.5, + trendFactor: 1.05, + creationTime: new Date("2024-12-18"), + lastModificationTime: new Date("2024-12-22"), + notes: "Yeni pazarlama kampanyasının etkisiyle talep artışı bekleniyor.", + }, + { + id: "3", + materialId: "3", + material: mockMaterials.find((m) => m.id === "3"), + forecastPeriod: "Şubat 2025", + startDate: new Date("2025-02-01"), + endDate: new Date("2025-02-28"), + forecastMethod: ForecastMethodEnum.LinearRegression, + forecastQuantity: 2500, + creationTime: new Date("2024-12-20"), + lastModificationTime: new Date("2024-12-25"), + notes: "Tarihsel satış verilerine dayalı regresyon analizi sonucu.", + }, + { + id: "4", + materialId: "4", + material: mockMaterials.find((m) => m.id === "4"), + forecastPeriod: "Şubat 2025", + startDate: new Date("2025-02-01"), + endDate: new Date("2025-02-28"), + forecastMethod: ForecastMethodEnum.Seasonal, + forecastQuantity: 550, + seasonalityFactor: 1.4, + creationTime: new Date("2024-12-22"), + lastModificationTime: new Date("2024-12-28"), + notes: "Kış sezonu nedeniyle talepte mevsimsel artış.", + }, + { + id: "df-005", + materialId: "3", + material: mockMaterials.find((m) => m.id === "3"), + forecastPeriod: "Şubat 2025", + startDate: new Date("2025-02-01"), + endDate: new Date("2025-02-28"), + forecastMethod: ForecastMethodEnum.MovingAverage, + forecastQuantity: 1300, + accuracy: 88.0, + creationTime: new Date("2025-01-05"), + lastModificationTime: new Date("2025-01-10"), + notes: "Ocak ayı verileriyle güncellenmiş hareketli ortalama.", + }, +]; + +export const mockMaterialRequirements: MrpMaterialRequirement[] = [ + { + id: "1", + mrpRunId: "", + materialId: "1", + material: mockMaterials.find((m) => m.id === "1"), + grossRequirement: 1200, + scheduledReceipts: 200, + projectedAvailable: 150, + netRequirement: 850, + plannedOrderReceipt: 900, + plannedOrderRelease: 900, + requirementDate: new Date("2025-01-05"), + plannedReceiptDate: new Date("2025-01-10"), + plannedReleaseDate: new Date("2025-01-05"), + sourceType: RequirementSourceTypeEnum.Forecast, + sourceDocumentId: "df-001", + creationTime: new Date("2024-12-20"), + lastModificationTime: new Date("2024-12-22"), + }, + { + id: "2", + mrpRunId: "", + materialId: "2", + material: mockMaterials.find((m) => m.id === "2"), + grossRequirement: 500, + scheduledReceipts: 0, + projectedAvailable: 50, + netRequirement: 450, + plannedOrderReceipt: 500, + plannedOrderRelease: 500, + plannedReceiptDate: new Date("2025-01-05"), + plannedReleaseDate: new Date("2025-01-10"), + requirementDate: new Date("2025-01-20"), + sourceType: RequirementSourceTypeEnum.SalesOrder, + sourceDocumentId: "SO-2025-001", + creationTime: new Date("2025-01-10"), + lastModificationTime: new Date("2025-01-15"), + }, + { + id: "3", + mrpRunId: "", + materialId: "3", + material: mockMaterials.find((m) => m.id === "3"), + grossRequirement: 300, + scheduledReceipts: 100, + projectedAvailable: 350, + netRequirement: 0, // Stok yeterli + plannedOrderReceipt: 0, + plannedOrderRelease: 0, + plannedReceiptDate: new Date("2025-01-25"), + plannedReleaseDate: new Date("2025-01-20"), + requirementDate: new Date("2025-01-15"), + sourceType: RequirementSourceTypeEnum.Forecast, + sourceDocumentId: "df-003", + creationTime: new Date("2025-01-30"), + lastModificationTime: new Date("2025-01-30"), + }, + { + id: "4", + mrpRunId: "", + materialId: "4", + material: mockMaterials.find((m) => m.id === "4"), + grossRequirement: 400, + scheduledReceipts: 0, + projectedAvailable: 20, + netRequirement: 380, + plannedOrderReceipt: 400, + plannedOrderRelease: 400, + plannedReceiptDate: new Date("2025-02-05"), + plannedReleaseDate: new Date("2025-01-30"), + requirementDate: new Date("2025-02-10"), + sourceType: RequirementSourceTypeEnum.SafetyStock, + sourceDocumentId: "SS-2025-001", + creationTime: new Date("2025-01-15"), + lastModificationTime: new Date("2025-01-20"), + }, +]; diff --git a/ui/src/mocks/mockDepartments.ts b/ui/src/mocks/mockDepartments.ts new file mode 100644 index 00000000..c1365ed0 --- /dev/null +++ b/ui/src/mocks/mockDepartments.ts @@ -0,0 +1,109 @@ +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ı + } + } +}); diff --git a/ui/src/mocks/mockEmployeeLeaves.ts b/ui/src/mocks/mockEmployeeLeaves.ts new file mode 100644 index 00000000..9fc0f237 --- /dev/null +++ b/ui/src/mocks/mockEmployeeLeaves.ts @@ -0,0 +1,71 @@ +import { HrLeave, LeaveStatusEnum, LeaveTypeEnum } from "../types/hr"; +import { mockEmployees } from "./mockEmployees"; + +export const mockEmployeeLeaves: HrLeave[] = [ + { + id: "1", + employeeId: "1", + employee: mockEmployees.find((e) => e.id === "1"), + leaveType: LeaveTypeEnum.Annual, + startDate: new Date("2024-12-20"), + endDate: new Date("2024-12-24"), + totalDays: 5, + reason: "Yıllık izin talebi", + status: LeaveStatusEnum.Pending, + appliedDate: new Date("2024-11-15"), + isHalfDay: false, + attachments: [], + creationTime: new Date("2024-11-15"), + lastModificationTime: new Date("2024-11-15"), + }, + { + id: "2", + employeeId: "2", + employee: mockEmployees.find((e) => e.id === "2"), + leaveType: LeaveTypeEnum.Sick, + startDate: new Date("2024-11-10"), + endDate: new Date("2024-11-12"), + totalDays: 3, + reason: "Sağlık kontrolü", + status: LeaveStatusEnum.Approved, + appliedDate: new Date("2024-11-08"), + approvedDate: new Date("2024-11-09"), + isHalfDay: false, + attachments: [], + creationTime: new Date("2024-11-08"), + lastModificationTime: new Date("2024-11-09"), + }, + { + id: "3", + employeeId: "3", + employee: mockEmployees.find((e) => e.id === "3"), + leaveType: LeaveTypeEnum.Personal, + startDate: new Date("2024-12-01"), + endDate: new Date("2024-12-01"), + totalDays: 0.5, + reason: "Kişisel işler", + status: LeaveStatusEnum.Rejected, + appliedDate: new Date("2024-11-20"), + rejectionReason: "Proje teslim tarihi nedeniyle uygun değil", + isHalfDay: true, + attachments: [], + creationTime: new Date("2024-11-20"), + lastModificationTime: new Date("2024-11-21"), + }, + { + id: "4", + employeeId: "4", + employee: mockEmployees.find((e) => e.id === "4"), + leaveType: LeaveTypeEnum.Emergency, + startDate: new Date("2024-11-25"), + endDate: new Date("2024-11-26"), + totalDays: 2, + reason: "Acil aile durumu", + status: LeaveStatusEnum.Pending, + appliedDate: new Date("2024-11-24"), + isHalfDay: false, + attachments: [], + creationTime: new Date("2024-11-24"), + lastModificationTime: new Date("2024-11-24"), + }, +]; diff --git a/ui/src/mocks/mockEmployeeTypes.ts b/ui/src/mocks/mockEmployeeTypes.ts new file mode 100644 index 00000000..b235c8d6 --- /dev/null +++ b/ui/src/mocks/mockEmployeeTypes.ts @@ -0,0 +1,59 @@ +import { HrEmploymentType, EmploymentTypeEnum } from "../types/hr"; +import { mockEmployees } from "./mockEmployees"; + +export const mockEmployeeTypes: HrEmploymentType[] = [ + { + id: "1", + name: "FULL_TIME", + count: mockEmployees.filter( + (a) => a.employmentType == EmploymentTypeEnum.FullTime + ).length, + creationTime: new Date("2023-01-01T10:00:00Z"), + lastModificationTime: new Date("2023-01-01T10:00:00Z"), + }, + { + id: "2", + name: "PART_TIME", + count: mockEmployees.filter( + (a) => a.employmentType == EmploymentTypeEnum.PartTime + ).length, + creationTime: new Date("2023-01-01T10:00:00Z"), + lastModificationTime: new Date("2023-01-01T10:00:00Z"), + }, + { + id: "3", + name: "CONTRACT", + count: mockEmployees.filter( + (a) => a.employmentType == EmploymentTypeEnum.Contract + ).length, + creationTime: new Date("2023-01-01T10:00:00Z"), + lastModificationTime: new Date("2023-01-01T10:00:00Z"), + }, + { + id: "4", + name: "INTERN", + count: mockEmployees.filter( + (a) => a.employmentType == EmploymentTypeEnum.Intern + ).length, + creationTime: new Date("2023-01-01T10:00:00Z"), + lastModificationTime: new Date("2023-01-01T10:00:00Z"), + }, + { + id: "5", + name: "TEMPORARY", + count: mockEmployees.filter( + (a) => a.employmentType == EmploymentTypeEnum.Temporary + ).length, + creationTime: new Date("2023-01-01T10:00:00Z"), + lastModificationTime: new Date("2023-01-01T10:00:00Z"), + }, + { + id: "6", + name: "CONSULTANT", + count: mockEmployees.filter( + (a) => a.employmentType == EmploymentTypeEnum.Consultant + ).length, + creationTime: new Date("2023-01-01T10:00:00Z"), + lastModificationTime: new Date("2023-01-01T10:00:00Z"), + }, +]; diff --git a/ui/src/mocks/mockEmployees.ts b/ui/src/mocks/mockEmployees.ts new file mode 100644 index 00000000..54e2a976 --- /dev/null +++ b/ui/src/mocks/mockEmployees.ts @@ -0,0 +1,592 @@ +import { + HrEmployee, + EmployeeStatusEnum, + EmploymentTypeEnum, + GenderEnum, + MaritalStatusEnum, +} from "../types/hr"; +import { mockBanks } from "./mockBanks"; +import { mockDepartments } from "./mockDepartments"; +import { mockJobPositions } from "./mockJobPositions"; + +export const mockEmployees: HrEmployee[] = [ + { + id: "1", + code: "EMP-001", + firstName: "Ali", + lastName: "Öztürk", + fullName: "Ali Öztürk", + email: "ali.ozturk@company.com", + phone: "+90 212 555 0100", + personalPhone: "+90 532 555 0101", + nationalId: "12345678901", + birthDate: new Date("1988-02-14"), + gender: GenderEnum.Male, + maritalStatus: MaritalStatusEnum.Married, + address: { + street: "Kızılay Cd. No:12", + city: "Ankara", + state: "Ankara", + postalCode: "06050", + country: "Türkiye", + }, + emergencyContact: { + name: "Ayşe Öztürk", + relationship: "Eşi", + phone: "+90 532 555 0100", + }, + hireDate: new Date("2020-01-15"), + employmentType: EmploymentTypeEnum.FullTime, + jobPositionId: "1", + jobPosition: mockJobPositions.find((jp) => jp.id === "1")!, + departmantId: "1", + department: mockDepartments.find((d) => d.id === "1")!, + baseSalary: 65000, + currency: "TRY", + payrollGroup: "MONTHLY", + bankAccountId: "1", + bankAccount: mockBanks.find((b) => b.id === "1")!, + workLocation: "Ankara Merkez", + workSchedule: { + id: "1", + scheduleCode: "STD", + name: "Standart Mesai", + description: "08:30-17:30 Pazartesi-Cuma", + workingDays: [], + totalHoursPerWeek: 40, + isFlexible: false, + isActive: true, + }, + badgeNumber: "B001", + employeeStatus: EmployeeStatusEnum.Active, + isActive: true, + leaves: [], + evaluations: [], + trainings: [], + disciplinaryActions: [], + creationTime: new Date("2020-01-15"), + lastModificationTime: new Date("2024-01-18"), + }, + { + id: "2", + code: "EMP-002", + firstName: "Ayşe", + lastName: "Kaya", + fullName: "Ayşe Kaya", + email: "ayse.kaya@company.com", + phone: "+90 212 555 0102", + personalPhone: "+90 532 555 0103", + nationalId: "12345678902", + birthDate: new Date("1990-08-22"), + gender: GenderEnum.Female, + maritalStatus: MaritalStatusEnum.Single, + address: { + street: "İnönü Bulvarı No:456", + city: "Ankara", + state: "Ankara", + postalCode: "06000", + country: "Türkiye", + }, + emergencyContact: { + name: "Fatma Kaya", + relationship: "Anne", + phone: "+90 532 555 0104", + }, + hireDate: new Date("2021-06-01"), + employmentType: EmploymentTypeEnum.FullTime, + jobPositionId: "2", + jobPosition: mockJobPositions.find((jp) => jp.id === "2")!, + + departmantId: "1", + department: mockDepartments.find((d) => d.id === "1")!, + baseSalary: 72000, + currency: "TRY", + payrollGroup: "MONTHLY", + bankAccountId: "2", + bankAccount: mockBanks.find((b) => b.id === "2")!, + workLocation: "Ankara Şube", + workSchedule: { + id: "2", + scheduleCode: "STD", + name: "Standart Mesai", + description: "08:30-17:30 Pazartesi-Cuma", + workingDays: [], + totalHoursPerWeek: 40, + isFlexible: false, + isActive: true, + }, + badgeNumber: "B002", + employeeStatus: EmployeeStatusEnum.Active, + isActive: true, + leaves: [], + evaluations: [], + trainings: [], + disciplinaryActions: [], + creationTime: new Date("2021-06-01"), + lastModificationTime: new Date("2024-01-18"), + }, + { + id: "3", + code: "EMP-003", + firstName: "Mehmet", + lastName: "Yılmaz", + fullName: "Mehmet Yılmaz", + email: "mehmet.yilmaz@company.com", + phone: "+90 212 555 0105", + personalPhone: "+90 532 555 0106", + nationalId: "12345678903", + birthDate: new Date("1987-03-12"), + gender: GenderEnum.Male, + maritalStatus: MaritalStatusEnum.Married, + address: { + street: "Cumhuriyet Cad. No:123", + city: "İstanbul", + state: "İstanbul", + postalCode: "34000", + country: "Türkiye", + }, + emergencyContact: { + name: "Zeynep Yılmaz", + relationship: "Eşi", + phone: "+90 532 555 0107", + }, + hireDate: new Date("2020-02-15"), + employmentType: EmploymentTypeEnum.FullTime, + jobPositionId: "3", + jobPosition: mockJobPositions.find((jp) => jp.id === "3")!, + + departmantId: "1", + department: mockDepartments.find((d) => d.id === "1")!, + baseSalary: 85000, + currency: "TRY", + payrollGroup: "MONTHLY", + bankAccountId: "2", + bankAccount: mockBanks.find((b) => b.id === "2")!, + workLocation: "İstanbul HQ", + workSchedule: { + id: "2", + scheduleCode: "FLEX", + name: "Esnek Çalışma", + description: "09:00-18:00 Pazartesi-Cuma", + workingDays: [], + totalHoursPerWeek: 40, + isFlexible: true, + isActive: true, + }, + badgeNumber: "B003", + employeeStatus: EmployeeStatusEnum.Active, + isActive: true, + leaves: [], + evaluations: [], + trainings: [], + disciplinaryActions: [], + creationTime: new Date("2020-02-15"), + lastModificationTime: new Date("2024-02-01"), + }, + { + id: "4", + code: "EMP-004", + firstName: "Selin", + lastName: "Demir", + fullName: "Selin Demir", + email: "selin.demir@company.com", + phone: "+90 312 555 0108", + personalPhone: "+90 542 555 0109", + nationalId: "12345678904", + birthDate: new Date("1993-05-25"), + gender: GenderEnum.Female, + maritalStatus: MaritalStatusEnum.Single, + address: { + street: "Atatürk Bulvarı No:78", + city: "Ankara", + state: "Ankara", + postalCode: "06100", + country: "Türkiye", + }, + emergencyContact: { + name: "Ali Demir", + relationship: "Baba", + phone: "+90 532 555 0110", + }, + hireDate: new Date("2022-01-10"), + employmentType: EmploymentTypeEnum.PartTime, + jobPositionId: "4", + jobPosition: mockJobPositions.find((jp) => jp.id === "4")!, + + departmantId: "1", + department: mockDepartments.find((d) => d.id === "1")!, + baseSalary: 60000, + currency: "TRY", + payrollGroup: "MONTHLY", + bankAccountId: "3", + bankAccount: mockBanks.find((b) => b.id === "3")!, + workLocation: "Ankara Şube", + workSchedule: { + id: "3", + scheduleCode: "PT", + name: "Yarı Zamanlı", + description: "09:00-13:00 Pazartesi-Cuma", + workingDays: [], + totalHoursPerWeek: 20, + isFlexible: false, + isActive: true, + }, + badgeNumber: "B004", + employeeStatus: EmployeeStatusEnum.Active, + isActive: true, + leaves: [], + evaluations: [], + trainings: [], + disciplinaryActions: [], + creationTime: new Date("2022-01-10"), + lastModificationTime: new Date("2024-01-20"), + }, + { + id: "5", + code: "EMP-005", + firstName: "Ahmet", + lastName: "Çelik", + fullName: "Ahmet Çelik", + email: "ahmet.celik@company.com", + phone: "+90 212 555 0111", + personalPhone: "+90 532 555 0112", + nationalId: "12345678905", + birthDate: new Date("1985-09-10"), + gender: GenderEnum.Male, + maritalStatus: MaritalStatusEnum.Married, + address: { + street: "Bağdat Cad. No:25", + city: "İstanbul", + state: "İstanbul", + postalCode: "34728", + country: "Türkiye", + }, + emergencyContact: { + name: "Emine Çelik", + relationship: "Eşi", + phone: "+90 532 555 0113", + }, + hireDate: new Date("2019-04-01"), + employmentType: EmploymentTypeEnum.FullTime, + jobPositionId: "5", + jobPosition: mockJobPositions.find((jp) => jp.id === "5")!, + + departmantId: "1", + department: mockDepartments.find((d) => d.id === "1")!, + baseSalary: 95000, + currency: "TRY", + payrollGroup: "MONTHLY", + bankAccountId: "4", + bankAccount: mockBanks.find((b) => b.id === "4")!, + workLocation: "İstanbul HQ", + workSchedule: { + id: "4", + scheduleCode: "STD", + name: "Standart Mesai", + description: "08:30-17:30 Pazartesi-Cuma", + workingDays: [], + totalHoursPerWeek: 40, + isFlexible: false, + isActive: true, + }, + badgeNumber: "B005", + employeeStatus: EmployeeStatusEnum.Active, + isActive: true, + leaves: [], + evaluations: [], + trainings: [], + disciplinaryActions: [], + creationTime: new Date("2019-04-01"), + lastModificationTime: new Date("2024-01-10"), + }, + { + id: "6", + code: "EMP-006", + firstName: "Zeynep", + lastName: "Arslan", + fullName: "Zeynep Arslan", + email: "zeynep.arslan@company.com", + phone: "+90 216 555 0114", + personalPhone: "+90 532 555 0115", + nationalId: "12345678906", + birthDate: new Date("1995-01-30"), + gender: GenderEnum.Female, + maritalStatus: MaritalStatusEnum.Single, + address: { + street: "Yıldız Mah. No:19", + city: "İzmir", + state: "İzmir", + postalCode: "35000", + country: "Türkiye", + }, + emergencyContact: { + name: "Hasan Arslan", + relationship: "Baba", + phone: "+90 532 555 0116", + }, + hireDate: new Date("2023-03-20"), + employmentType: EmploymentTypeEnum.Intern, + jobPositionId: "6", + jobPosition: mockJobPositions.find((jp) => jp.id === "6")!, + + departmantId: "1", + department: mockDepartments.find((d) => d.id === "1")!, + baseSalary: 15000, + currency: "TRY", + payrollGroup: "MONTHLY", + bankAccountId: "1", + bankAccount: mockBanks.find((b) => b.id === "1")!, + workLocation: "İzmir Ofis", + workSchedule: { + id: "5", + scheduleCode: "INT", + name: "Staj Programı", + description: "09:00-16:00 Pazartesi-Perşembe", + workingDays: [], + totalHoursPerWeek: 30, + isFlexible: true, + isActive: true, + }, + badgeNumber: "B006", + employeeStatus: EmployeeStatusEnum.Active, + isActive: true, + leaves: [], + evaluations: [], + trainings: [], + disciplinaryActions: [], + creationTime: new Date("2023-03-20"), + lastModificationTime: new Date("2024-02-15"), + }, + { + id: "7", + code: "EMP-007", + firstName: "Burak", + lastName: "Koç", + fullName: "Burak Koç", + email: "burak.koc@company.com", + phone: "+90 224 555 0117", + personalPhone: "+90 532 555 0118", + nationalId: "12345678907", + birthDate: new Date("1991-06-18"), + gender: GenderEnum.Male, + maritalStatus: MaritalStatusEnum.Married, + address: { + street: "Osmangazi Mah. No:45", + city: "Bursa", + state: "Bursa", + postalCode: "16000", + country: "Türkiye", + }, + emergencyContact: { + name: "Elif Koç", + relationship: "Eşi", + phone: "+90 532 555 0119", + }, + hireDate: new Date("2021-07-12"), + employmentType: EmploymentTypeEnum.FullTime, + jobPositionId: "7", + jobPosition: mockJobPositions.find((jp) => jp.id === "7")!, + + departmantId: "2", + department: mockDepartments.find((d) => d.id === "2")!, + baseSalary: 75000, + currency: "TRY", + payrollGroup: "MONTHLY", + bankAccountId: "3", + bankAccount: mockBanks.find((b) => b.id === "3")!, + workLocation: "Bursa Depo", + workSchedule: { + id: "6", + scheduleCode: "STD", + name: "Standart Mesai", + description: "08:00-17:00 Pazartesi-Cumartesi", + workingDays: [], + totalHoursPerWeek: 45, + isFlexible: false, + isActive: true, + }, + badgeNumber: "B007", + employeeStatus: EmployeeStatusEnum.Active, + isActive: true, + leaves: [], + evaluations: [], + trainings: [], + disciplinaryActions: [], + creationTime: new Date("2021-07-12"), + lastModificationTime: new Date("2024-01-05"), + }, + { + id: "8", + code: "EMP-008", + firstName: "Elif", + lastName: "Şahin", + fullName: "Elif Şahin", + email: "elif.sahin@company.com", + phone: "+90 232 555 0120", + personalPhone: "+90 532 555 0121", + nationalId: "12345678908", + birthDate: new Date("1989-11-05"), + gender: GenderEnum.Female, + maritalStatus: MaritalStatusEnum.Married, + address: { + street: "Alsancak Mah. No:88", + city: "İzmir", + state: "İzmir", + postalCode: "35220", + country: "Türkiye", + }, + emergencyContact: { + name: "Murat Şahin", + relationship: "Eşi", + phone: "+90 532 555 0122", + }, + hireDate: new Date("2018-09-01"), + employmentType: EmploymentTypeEnum.FullTime, + jobPositionId: "8", + jobPosition: mockJobPositions.find((jp) => jp.id === "8")!, + + departmantId: "2", + department: mockDepartments.find((d) => d.id === "2")!, + baseSalary: 130000, + currency: "TRY", + payrollGroup: "MONTHLY", + bankAccountId: "2", + bankAccount: mockBanks.find((b) => b.id === "2")!, + workLocation: "İzmir Bölge Ofisi", + workSchedule: { + id: "7", + scheduleCode: "STD", + name: "Standart Mesai", + description: "08:30-17:30 Pazartesi-Cuma", + workingDays: [], + totalHoursPerWeek: 40, + isFlexible: false, + isActive: true, + }, + badgeNumber: "B008", + employeeStatus: EmployeeStatusEnum.Active, + isActive: true, + leaves: [], + evaluations: [], + trainings: [], + disciplinaryActions: [], + creationTime: new Date("2018-09-01"), + lastModificationTime: new Date("2024-01-12"), + }, + { + id: "9", + code: "EMP-009", + firstName: "Canan", + lastName: "Öztürk", + fullName: "Canan Öztürk", + email: "canan.ozturk@company.com", + phone: "+90 312 555 0123", + personalPhone: "+90 532 555 0124", + nationalId: "12345678909", + birthDate: new Date("1992-04-14"), + gender: GenderEnum.Female, + maritalStatus: MaritalStatusEnum.Single, + address: { + street: "Bahçelievler Mah. No:55", + city: "Ankara", + state: "Ankara", + postalCode: "06490", + country: "Türkiye", + }, + emergencyContact: { + name: "Hüseyin Öztürk", + relationship: "Baba", + phone: "+90 532 555 0125", + }, + hireDate: new Date("2020-11-02"), + employmentType: EmploymentTypeEnum.FullTime, + jobPositionId: "9", + jobPosition: mockJobPositions.find((jp) => jp.id === "9")!, + + departmantId: "1", + department: mockDepartments.find((d) => d.id === "1")!, + baseSalary: 50000, + currency: "TRY", + payrollGroup: "MONTHLY", + bankAccountId: "1", + bankAccount: mockBanks.find((b) => b.id === "1")!, + workLocation: "Ankara Çağrı Merkezi", + workSchedule: { + id: "8", + scheduleCode: "SHIFT", + name: "Vardiya", + description: "3 vardiya sistemi", + workingDays: [], + totalHoursPerWeek: 40, + isFlexible: true, + isActive: true, + }, + badgeNumber: "B009", + employeeStatus: EmployeeStatusEnum.Active, + isActive: true, + leaves: [], + evaluations: [], + trainings: [], + disciplinaryActions: [], + creationTime: new Date("2020-11-02"), + lastModificationTime: new Date("2024-01-18"), + }, + { + id: "10", + code: "EMP-010", + firstName: "Murat", + lastName: "Aydın", + fullName: "Murat Aydın", + email: "murat.aydin@company.com", + phone: "+90 212 555 0126", + personalPhone: "+90 532 555 0127", + nationalId: "12345678910", + birthDate: new Date("1984-12-22"), + gender: GenderEnum.Male, + maritalStatus: MaritalStatusEnum.Married, + address: { + street: "Şişli Mah. No:101", + city: "İstanbul", + state: "İstanbul", + postalCode: "34360", + country: "Türkiye", + }, + emergencyContact: { + name: "Ayten Aydın", + relationship: "Eşi", + phone: "+90 532 555 0128", + }, + hireDate: new Date("2017-05-15"), + employmentType: EmploymentTypeEnum.FullTime, + jobPositionId: "10", + jobPosition: mockJobPositions.find((jp) => jp.id === "10")!, + + departmantId: "1", + department: mockDepartments.find((d) => d.id === "1")!, + baseSalary: 250000, + currency: "TRY", + payrollGroup: "MONTHLY", + bankAccountId: "4", + bankAccount: mockBanks.find((b) => b.id === "4")!, + workLocation: "İstanbul Genel Merkez", + workSchedule: { + id: "9", + scheduleCode: "EXEC", + name: "Yönetici Çalışma Programı", + description: "Esnek yönetici programı", + workingDays: [], + totalHoursPerWeek: 50, + isFlexible: true, + isActive: true, + }, + badgeNumber: "B010", + employeeStatus: EmployeeStatusEnum.Active, + isActive: true, + leaves: [], + evaluations: [], + trainings: [], + disciplinaryActions: [], + creationTime: new Date("2017-05-15"), + lastModificationTime: new Date("2024-01-22"), + }, +]; diff --git a/ui/src/mocks/mockEvaluation360.ts b/ui/src/mocks/mockEvaluation360.ts new file mode 100644 index 00000000..c8ae73f8 --- /dev/null +++ b/ui/src/mocks/mockEvaluation360.ts @@ -0,0 +1,148 @@ +import { HrEvaluation360, CampaignStatusEnum } from "../types/hr"; + +// Örnek 360° Derece Değerlendirme +export const mockEvaluation360: HrEvaluation360[] = [ + { + id: "campaign-001", + name: "2024 Q4 360° Derece Değerlendirme", + description: "2024 yılı son çeyrek 360° derece performans değerlendirmesi", + templateId: "template-001", + evaluationPeriod: "2024 Q4", + startDate: new Date("2024-11-01"), + endDate: new Date("2024-12-15"), + status: CampaignStatusEnum.Active, + departmentId: "1", // Üretim departmanı + targetEmployees: ["1", "2", "3", "4", "5"], + settings: { + allowSelfEvaluation: true, + requireManagerEvaluation: true, + minPeerEvaluations: 2, + minSubordinateEvaluations: 1, + allowAnonymousFeedback: true, + sendReminderEmails: true, + reminderIntervalDays: 3, + }, + creationTime: new Date("2024-10-15"), + lastModificationTime: new Date("2024-11-15"), + }, + { + id: "campaign-002", + name: "2025 Q1 Liderlik Değerlendirmesi", + description: + "Liderlik pozisyonları için özel 360° derece değerlendirme kampanyası", + templateId: "template-001", + evaluationPeriod: "2025 Q1", + startDate: new Date("2025-01-01"), + endDate: new Date("2025-02-28"), + status: CampaignStatusEnum.Active, + departmentId: "2", // Bakım departmanı + targetEmployees: ["7", "8", "9"], + settings: { + allowSelfEvaluation: true, + requireManagerEvaluation: true, + minPeerEvaluations: 3, + minSubordinateEvaluations: 2, + allowAnonymousFeedback: true, + sendReminderEmails: true, + reminderIntervalDays: 5, + }, + creationTime: new Date("2024-12-01"), + lastModificationTime: new Date("2024-12-01"), + }, + { + id: "campaign-003", + name: "2023 Kalite Departmanı Değerlendirme", + description: + "Kalite kontrol departmanı personeli için 360° derece değerlendirme", + templateId: "template-001", + evaluationPeriod: "2023 Annual", + startDate: new Date("2023-10-01"), + endDate: new Date("2023-11-30"), + status: CampaignStatusEnum.Active, + departmentId: "3", // Kalite Kontrol departmanı + targetEmployees: ["5", "6"], + settings: { + allowSelfEvaluation: true, + requireManagerEvaluation: true, + minPeerEvaluations: 2, + minSubordinateEvaluations: 0, + allowAnonymousFeedback: true, + sendReminderEmails: true, + reminderIntervalDays: 3, + }, + creationTime: new Date("2024-09-15"), + lastModificationTime: new Date("2024-11-30"), + }, + { + id: "campaign-004", + name: "2022 Kalite Departmanı Değerlendirme", + description: + "Kalite kontrol departmanı personeli için 360° derece değerlendirme", + templateId: "template-001", + evaluationPeriod: "2022 Annual", + startDate: new Date("2022-10-01"), + endDate: new Date("2024-11-30"), + status: CampaignStatusEnum.Active, + departmentId: "3", // Kalite Kontrol departmanı + targetEmployees: ["5", "6"], + settings: { + allowSelfEvaluation: true, + requireManagerEvaluation: true, + minPeerEvaluations: 2, + minSubordinateEvaluations: 0, + allowAnonymousFeedback: true, + sendReminderEmails: true, + reminderIntervalDays: 3, + }, + creationTime: new Date("2024-09-15"), + lastModificationTime: new Date("2024-11-30"), + }, + { + id: "campaign-005", + name: "2021 Kalite Departmanı Değerlendirme", + description: + "Kalite kontrol departmanı personeli için 360° derece değerlendirme", + templateId: "template-001", + evaluationPeriod: "2021 Annual", + startDate: new Date("2021-10-01"), + endDate: new Date("2021-11-30"), + status: CampaignStatusEnum.Active, + departmentId: "3", // Kalite Kontrol departmanı + targetEmployees: ["5", "6"], + settings: { + allowSelfEvaluation: true, + requireManagerEvaluation: true, + minPeerEvaluations: 2, + minSubordinateEvaluations: 0, + allowAnonymousFeedback: true, + sendReminderEmails: true, + reminderIntervalDays: 3, + }, + creationTime: new Date("2024-09-15"), + lastModificationTime: new Date("2024-11-30"), + }, + { + id: "campaign-006", + name: "2020 Kalite Departmanı Değerlendirme", + description: + "Kalite kontrol departmanı personeli için 360° derece değerlendirme", + templateId: "template-001", + evaluationPeriod: "2020 Annual", + startDate: new Date("2020-10-01"), + endDate: new Date("2020-11-30"), + status: CampaignStatusEnum.Active, + departmentId: "3", // Kalite Kontrol departmanı + targetEmployees: ["5", "6"], + settings: { + allowSelfEvaluation: true, + requireManagerEvaluation: true, + minPeerEvaluations: 2, + minSubordinateEvaluations: 0, + allowAnonymousFeedback: true, + sendReminderEmails: true, + reminderIntervalDays: 3, + }, + creationTime: new Date("2024-09-15"), + lastModificationTime: new Date("2024-11-30"), + }, +]; diff --git a/ui/src/mocks/mockEvaluation360Results.ts b/ui/src/mocks/mockEvaluation360Results.ts new file mode 100644 index 00000000..759da911 --- /dev/null +++ b/ui/src/mocks/mockEvaluation360Results.ts @@ -0,0 +1,519 @@ +import { + AssessorTypeEnum, + HrEvaluation360Result, + ResultStatusEnum, + ParticipantStatusEnum, +} from "../types/hr"; + +// Örnek Sonuçlar +export const mockEvaluation360Results: HrEvaluation360Result[] = [ + { + id: "result-001", + campaignId: "campaign-001", + employeeId: "1", + participants: [ + // Ali Öztürk'ün kendisi tarafından değerlendirme + { + id: "part-001", + campaignId: "campaign-001", + evaluatedEmployeeId: "1", + evaluatorId: "1", // Kendi değerlendirmesi + evaluatorType: AssessorTypeEnum.Self, + status: ParticipantStatusEnum.Completed, + invitedDate: new Date("2024-11-01"), + startedDate: new Date("2024-11-05"), + completedDate: new Date("2024-11-10"), + responses: [ + { + id: "resp-001", + participantId: "part-001", + questionId: "q-001", // İletişim Becerileri - İletişim kurar + responseValue: 4, + score: 4, + submittedDate: new Date("2024-11-10"), + }, + { + id: "resp-002", + participantId: "part-001", + questionId: "q-002", // İletişim Becerileri - Dinleme + responseValue: 4, + score: 4, + submittedDate: new Date("2024-11-10"), + }, + { + id: "resp-003", + participantId: "part-001", + questionId: "q-005", // Takım Çalışması + responseValue: 4, + score: 4, + submittedDate: new Date("2024-11-10"), + }, + { + id: "resp-004", + participantId: "part-001", + questionId: "q-008", // Liderlik - Motivasyon + responseValue: 3, + score: 3, + submittedDate: new Date("2024-11-10"), + }, + { + id: "resp-005", + participantId: "part-001", + questionId: "q-010", // Problem Çözme + responseValue: 5, + score: 5, + submittedDate: new Date("2024-11-10"), + }, + ], + overallScore: 85, + notes: "Genel olarak kendimi başarılı buluyorum", + }, + // Yönetici tarafından değerlendirme + { + id: "part-002", + campaignId: "campaign-001", + evaluatedEmployeeId: "1", + evaluatorId: "2", // Yönetici değerlendirmesi + evaluatorType: AssessorTypeEnum.Manager, + status: ParticipantStatusEnum.Completed, + invitedDate: new Date("2024-11-01"), + startedDate: new Date("2024-11-08"), + completedDate: new Date("2024-11-12"), + responses: [ + { + id: "resp-006", + participantId: "part-002", + questionId: "q-001", + responseValue: 5, + score: 5, + submittedDate: new Date("2024-11-12"), + }, + { + id: "resp-007", + participantId: "part-002", + questionId: "q-002", + responseValue: 4, + score: 4, + submittedDate: new Date("2024-11-12"), + }, + { + id: "resp-008", + participantId: "part-002", + questionId: "q-005", + responseValue: 5, + score: 5, + submittedDate: new Date("2024-11-12"), + }, + { + id: "resp-009", + participantId: "part-002", + questionId: "q-008", + responseValue: 4, + score: 4, + submittedDate: new Date("2024-11-12"), + }, + { + id: "resp-010", + participantId: "part-002", + questionId: "q-010", + responseValue: 5, + score: 5, + submittedDate: new Date("2024-11-12"), + }, + ], + overallScore: 92, + notes: "Çok başarılı bir ekip üyesi", + }, + // Meslektaş değerlendirmeleri + { + id: "part-003", + campaignId: "campaign-001", + evaluatedEmployeeId: "1", + evaluatorId: "3", // Meslektaş değerlendirmesi + evaluatorType: AssessorTypeEnum.Peer, + status: ParticipantStatusEnum.Completed, + invitedDate: new Date("2024-11-01"), + startedDate: new Date("2024-11-06"), + completedDate: new Date("2024-11-11"), + responses: [ + { + id: "resp-011", + participantId: "part-003", + questionId: "q-001", + responseValue: 4, + score: 4, + submittedDate: new Date("2024-11-11"), + }, + { + id: "resp-012", + participantId: "part-003", + questionId: "q-002", + responseValue: 5, + score: 5, + submittedDate: new Date("2024-11-11"), + }, + { + id: "resp-013", + participantId: "part-003", + questionId: "q-005", + responseValue: 4, + score: 4, + submittedDate: new Date("2024-11-11"), + }, + { + id: "resp-014", + participantId: "part-003", + questionId: "q-008", + responseValue: 3, + score: 3, + submittedDate: new Date("2024-11-11"), + }, + { + id: "resp-015", + participantId: "part-003", + questionId: "q-010", + responseValue: 4, + score: 4, + submittedDate: new Date("2024-11-11"), + }, + ], + overallScore: 87, + notes: "İşbirliğinde çok başarılı", + }, + ], + overallScore: 88.5, + maxPossibleScore: 100, + scorePercentage: 88.5, + groupScores: [ + { + groupId: "group-001", + groupName: "İletişim Becerileri", + score: 22, + maxScore: 25, + percentage: 88, + responseCount: 3, + }, + { + groupId: "group-002", + groupName: "Takım Çalışması", + score: 23, + maxScore: 25, + percentage: 92, + responseCount: 3, + }, + { + groupId: "group-003", + groupName: "Liderlik", + score: 20, + maxScore: 25, + percentage: 80, + responseCount: 3, + }, + { + groupId: "group-004", + groupName: "Problem Çözme", + score: 23.5, + maxScore: 25, + percentage: 94, + responseCount: 3, + }, + ], + assessorTypeScores: [ + { + assessorType: AssessorTypeEnum.Self, + assessorCount: 1, + averageScore: 85, + maxScore: 100, + percentage: 85, + }, + { + assessorType: AssessorTypeEnum.Manager, + assessorCount: 1, + averageScore: 92, + maxScore: 100, + percentage: 92, + }, + { + assessorType: AssessorTypeEnum.Peer, + assessorCount: 2, + averageScore: 87, + maxScore: 100, + percentage: 87, + }, + ], + strengths: [ + "Problem çözme konusunda çok başarılı", + "Takım çalışmasında öne çıkıyor", + "İletişim becerileri güçlü", + ], + developmentAreas: [ + "Liderlik becerilerini geliştirmeli", + "Zaman yönetimi konusunda iyileştirme yapabilir", + ], + actionPlan: [ + "Liderlik eğitimi alması öneriliyor", + "Zaman yönetimi workshop'una katılmalı", + "Mentorluk programına dahil edilmeli", + ], + managerComments: "Genel olarak çok başarılı. Liderlik potansiyeli yüksek.", + status: ResultStatusEnum.Pending, + generatedDate: new Date("2024-11-20"), + approvedBy: "hr-manager", + approvedDate: new Date("2024-11-22"), + }, + { + id: "result-002", + campaignId: "campaign-003", + employeeId: "5", + participants: [ + // Fatma Yıldız'ın kendisi tarafından değerlendirme + { + id: "part-101", + campaignId: "campaign-003", + evaluatedEmployeeId: "5", + evaluatorId: "5", // Kendi değerlendirmesi + evaluatorType: AssessorTypeEnum.Self, + status: ParticipantStatusEnum.Declined, + invitedDate: new Date("2024-10-01"), + startedDate: new Date("2024-10-05"), + completedDate: new Date("2024-10-15"), + responses: [ + { + id: "resp-101", + participantId: "part-101", + questionId: "q-001", + responseValue: 4, + score: 4, + submittedDate: new Date("2024-10-15"), + }, + { + id: "resp-102", + participantId: "part-101", + questionId: "q-002", + responseValue: 4, + score: 4, + submittedDate: new Date("2024-10-15"), + }, + { + id: "resp-103", + participantId: "part-101", + questionId: "q-005", + responseValue: 4, + score: 4, + submittedDate: new Date("2024-10-15"), + }, + { + id: "resp-104", + participantId: "part-101", + questionId: "q-008", + responseValue: 4, + score: 4, + submittedDate: new Date("2024-10-15"), + }, + { + id: "resp-105", + participantId: "part-101", + questionId: "q-010", + responseValue: 5, + score: 5, + submittedDate: new Date("2024-10-15"), + }, + ], + overallScore: 88, + notes: "Kalite standartlarına uyum konusunda kendimi başarılı buluyorum", + }, + // Yönetici tarafından değerlendirme + { + id: "part-102", + campaignId: "campaign-003", + evaluatedEmployeeId: "5", + evaluatorId: "1", // Yönetici değerlendirmesi + evaluatorType: AssessorTypeEnum.Manager, + status: ParticipantStatusEnum.Invited, + invitedDate: new Date("2024-10-01"), + startedDate: new Date("2024-10-10"), + completedDate: new Date("2024-10-20"), + responses: [ + { + id: "resp-106", + participantId: "part-102", + questionId: "q-001", + responseValue: 5, + score: 5, + submittedDate: new Date("2024-10-20"), + }, + { + id: "resp-107", + participantId: "part-102", + questionId: "q-002", + responseValue: 5, + score: 5, + submittedDate: new Date("2024-10-20"), + }, + { + id: "resp-108", + participantId: "part-102", + questionId: "q-005", + responseValue: 4, + score: 4, + submittedDate: new Date("2024-10-20"), + }, + { + id: "resp-109", + participantId: "part-102", + questionId: "q-008", + responseValue: 4, + score: 4, + submittedDate: new Date("2024-10-20"), + }, + { + id: "resp-110", + participantId: "part-102", + questionId: "q-010", + responseValue: 5, + score: 5, + submittedDate: new Date("2024-10-20"), + }, + ], + overallScore: 91, + notes: "Kalite kontrol süreçlerinde çok titiz ve başarılı", + }, + // Meslektaş değerlendirmesi + { + id: "part-103", + campaignId: "campaign-003", + evaluatedEmployeeId: "5", + evaluatorId: "6", // Meslektaş değerlendirmesi + evaluatorType: AssessorTypeEnum.Peer, + status: ParticipantStatusEnum.Started, + invitedDate: new Date("2024-10-01"), + startedDate: new Date("2024-10-12"), + completedDate: new Date("2024-10-18"), + responses: [ + { + id: "resp-111", + participantId: "part-103", + questionId: "q-001", + responseValue: 5, + score: 5, + submittedDate: new Date("2024-10-18"), + }, + { + id: "resp-112", + participantId: "part-103", + questionId: "q-002", + responseValue: 4, + score: 4, + submittedDate: new Date("2024-10-18"), + }, + { + id: "resp-113", + participantId: "part-103", + questionId: "q-005", + responseValue: 4, + score: 4, + submittedDate: new Date("2024-10-18"), + }, + { + id: "resp-114", + participantId: "part-103", + questionId: "q-008", + responseValue: 4, + score: 4, + submittedDate: new Date("2024-10-18"), + }, + { + id: "resp-115", + participantId: "part-103", + questionId: "q-010", + responseValue: 5, + score: 5, + submittedDate: new Date("2024-10-18"), + }, + ], + overallScore: 89, + notes: "Detaycı ve kalite odaklı çalışıyor", + }, + ], + overallScore: 450, + maxPossibleScore: 500, + scorePercentage: 90, + groupScores: [ + { + groupId: "group-001", + groupName: "İletişim Becerileri", + score: 115, + maxScore: 125, + percentage: 92, + responseCount: 3, + }, + { + groupId: "group-002", + groupName: "Takım Çalışması", + score: 110, + maxScore: 125, + percentage: 88, + responseCount: 3, + }, + { + groupId: "group-003", + groupName: "Liderlik", + score: 105, + maxScore: 125, + percentage: 84, + responseCount: 3, + }, + { + groupId: "group-004", + groupName: "Problem Çözme", + score: 120, + maxScore: 125, + percentage: 96, + responseCount: 3, + }, + ], + assessorTypeScores: [ + { + assessorType: AssessorTypeEnum.Self, + assessorCount: 1, + averageScore: 88, + maxScore: 100, + percentage: 88, + }, + { + assessorType: AssessorTypeEnum.Manager, + assessorCount: 1, + averageScore: 91, + maxScore: 100, + percentage: 91, + }, + { + assessorType: AssessorTypeEnum.Peer, + assessorCount: 2, + averageScore: 89, + maxScore: 100, + percentage: 89, + }, + ], + strengths: [ + "Kalite standartlarına titizlikle uyuyor", + "Analitik düşünce becerisi güçlü", + "Detaycı ve organizeli çalışıyor", + ], + developmentAreas: [ + "Takım motivasyonu konusunda gelişim gösterebilir", + "Yaratıcı çözümler üretme konusunda iyileştirme yapabilir", + ], + actionPlan: [ + "Takım liderliği eğitimi alması öneriliyor", + "Yaratıcı düşünce workshop'una katılmalı", + "Cross-functional projelerde yer almalı", + ], + managerComments: "Kalite kontrol süreçlerinde mükemmel performans gösteriyor.", + hrComments: "Liderlik potansiyeli geliştirilmeli.", + status: ResultStatusEnum.Pending, + generatedDate: new Date("2024-12 -01"), + approvedBy: "quality-manager", + approvedDate: new Date("2024-12-03"), + }, +]; diff --git a/ui/src/mocks/mockEvaluation360Templates.ts b/ui/src/mocks/mockEvaluation360Templates.ts new file mode 100644 index 00000000..68852884 --- /dev/null +++ b/ui/src/mocks/mockEvaluation360Templates.ts @@ -0,0 +1,283 @@ +import { + HrEvaluation360Template, + QuestionTypeEnum, + AssessorTypeEnum, +} from "../types/hr"; + +// Örnek Değerlendirme Şablonu +export const mockEvaluation360Templates: HrEvaluation360Template[] = [ + { + id: "template-001", + name: "Genel Yetkinlik Değerlendirmesi", + description: + "Tüm pozisyonlar için kullanılabilecek genel 360° derece değerlendirme şablonu", + isActive: true, + assessorTypes: [ + AssessorTypeEnum.Self, + AssessorTypeEnum.Manager, + AssessorTypeEnum.Peer, + AssessorTypeEnum.Subordinate, + AssessorTypeEnum.Customer, + AssessorTypeEnum.External, + AssessorTypeEnum.HRUpperManagement, + AssessorTypeEnum.OtherDepartment, + ], + questionGroups: [ + { + id: "group-001", + templateId: "template-001", + groupName: "İletişim Becerileri", + description: "Sözlü ve yazılı iletişim, dinleme becerileri", + weight: 25, + order: 1, + questions: [ + { + id: "q-001", + groupId: "group-001", + questionText: + "Bu kişi açık ve anlaşılır bir şekilde iletişim kurar", + questionType: QuestionTypeEnum.Rating, + isRequired: true, + weight: 20, + order: 1, + minRating: 1, + maxRating: 5, + ratingLabels: [ + "Hiç Katılmıyorum", + "Katılmıyorum", + "Kararsızım", + "Katılıyorum", + "Tamamen Katılıyorum", + ], + }, + { + id: "q-002", + groupId: "group-001", + questionText: "Bu kişi diğerlerini etkin bir şekilde dinler", + questionType: QuestionTypeEnum.Rating, + isRequired: true, + weight: 20, + order: 2, + minRating: 1, + maxRating: 5, + ratingLabels: [ + "Hiç Katılmıyorum", + "Katılmıyorum", + "Kararsızım", + "Katılıyorum", + "Tamamen Katılıyorum", + ], + }, + { + id: "q-003", + groupId: "group-001", + questionText: "Bu kişinin yazılı iletişim becerileri nasıldır?", + questionType: QuestionTypeEnum.MultipleChoice, + isRequired: true, + weight: 15, + order: 3, + options: [ + { + id: "opt-001", + questionId: "q-003", + optionText: "Çok Zayıf", + value: 1, + order: 1, + }, + { + id: "opt-002", + questionId: "q-003", + optionText: "Zayıf", + value: 2, + order: 2, + }, + { + id: "opt-003", + questionId: "q-003", + optionText: "Orta", + value: 3, + order: 3, + }, + { + id: "opt-004", + questionId: "q-003", + optionText: "İyi", + value: 4, + order: 4, + }, + { + id: "opt-005", + questionId: "q-003", + optionText: "Mükemmel", + value: 5, + order: 5, + }, + ], + }, + { + id: "q-004", + groupId: "group-001", + questionText: "İletişim konusunda özel yorumlarınız:", + questionType: QuestionTypeEnum.Text, + isRequired: false, + weight: 5, + order: 4, + }, + ], + }, + { + id: "group-002", + templateId: "template-001", + groupName: "Takım Çalışması", + description: "İşbirliği, team work, ortak hedeflere odaklanma", + weight: 25, + order: 2, + questions: [ + { + id: "q-005", + groupId: "group-002", + questionText: "Bu kişi takım içinde yapıcı bir rol oynar", + questionType: QuestionTypeEnum.Rating, + isRequired: true, + weight: 25, + order: 1, + minRating: 1, + maxRating: 5, + ratingLabels: [ + "Hiç Katılmıyorum", + "Katılmıyorum", + "Kararsızım", + "Katılıyorum", + "Tamamen Katılıyorum", + ], + }, + { + id: "q-006", + groupId: "group-002", + questionText: "Bu kişi çatışma durumlarında yapıcı çözümler önerir", + questionType: QuestionTypeEnum.Rating, + isRequired: true, + weight: 25, + order: 2, + minRating: 1, + maxRating: 5, + ratingLabels: [ + "Hiç Katılmıyorum", + "Katılmıyorum", + "Kararsızım", + "Katılıyorum", + "Tamamen Katılıyorum", + ], + }, + { + id: "q-007", + groupId: "group-002", + questionText: + "Takım çalışması konusundaki gözlemlerinizi paylaşın:", + questionType: QuestionTypeEnum.Text, + isRequired: false, + weight: 10, + order: 3, + }, + ], + }, + { + id: "group-003", + templateId: "template-001", + groupName: "Liderlik", + description: "Vizyon oluşturma, yönlendirme, motivasyon", + weight: 25, + order: 3, + questions: [ + { + id: "q-008", + groupId: "group-003", + questionText: "Bu kişi takımı motive etme konusunda başarılıdır", + questionType: QuestionTypeEnum.Rating, + isRequired: true, + weight: 30, + order: 1, + minRating: 1, + maxRating: 5, + ratingLabels: [ + "Hiç Katılmıyorum", + "Katılmıyorum", + "Kararsızım", + "Katılıyorum", + "Tamamen Katılıyorum", + ], + }, + { + id: "q-009", + groupId: "group-003", + questionText: "Bu kişi zor durumlarda liderlik gösterir", + questionType: QuestionTypeEnum.Rating, + isRequired: true, + weight: 30, + order: 2, + minRating: 1, + maxRating: 5, + ratingLabels: [ + "Hiç Katılmıyorum", + "Katılmıyorum", + "Kararsızım", + "Katılıyorum", + "Tamamen Katılıyorum", + ], + }, + ], + }, + { + id: "group-004", + templateId: "template-001", + groupName: "Problem Çözme", + description: "Analitik düşünme, yaratıcı çözümler üretme", + weight: 25, + order: 4, + questions: [ + { + id: "q-010", + groupId: "group-004", + questionText: + "Bu kişi karmaşık problemleri etkili bir şekilde analiz eder", + questionType: QuestionTypeEnum.Rating, + isRequired: true, + weight: 30, + order: 1, + minRating: 1, + maxRating: 5, + ratingLabels: [ + "Hiç Katılmıyorum", + "Katılmıyorum", + "Kararsızım", + "Katılıyorum", + "Tamamen Katılıyorum", + ], + }, + { + id: "q-011", + groupId: "group-004", + questionText: "Bu kişi yaratıcı ve inovatif çözümler üretir", + questionType: QuestionTypeEnum.Rating, + isRequired: true, + weight: 30, + order: 2, + minRating: 1, + maxRating: 5, + ratingLabels: [ + "Hiç Katılmıyorum", + "Katılmıyorum", + "Kararsızım", + "Katılıyorum", + "Tamamen Katılıyorum", + ], + }, + ], + }, + ], + applicablePositions: [], + applicableDepartments: [], + creationTime: new Date("2024-01-15"), + lastModificationTime: new Date("2024-01-15"), + }, +]; diff --git a/ui/src/mocks/mockFaultNotifications.ts b/ui/src/mocks/mockFaultNotifications.ts new file mode 100644 index 00000000..02c5c9e5 --- /dev/null +++ b/ui/src/mocks/mockFaultNotifications.ts @@ -0,0 +1,131 @@ +import { PriorityEnum } from "../types/common"; +import { + CriticalityLevelEnum, + PmFaultNotification, + FaultTypeEnum, + NotificationStatusEnum, +} from "../types/pm"; +import { mockWorkCenters } from "./mockWorkCenters"; + +export const mockFaultNotifications: PmFaultNotification[] = [ + { + id: "FN001", + notificationCode: "ARZ-2024-001", + workCenterId: "1", + workCenter: mockWorkCenters.find((wc) => wc.id === "1")!, + location: "Atölye A - Hat 1", + faultType: FaultTypeEnum.Mechanical, + priority: PriorityEnum.High, + severity: CriticalityLevelEnum.High, + title: "Motor Aşırı Titreşim", + description: + "CNC torna tezgahında motor aşırı titreşim yapıyor. Ses seviyesi normalden yüksek ve hassas işlemlerde problem yaşanıyor.", + reportedBy: "Operator Mustafa Koç", + reportedAt: new Date("2024-02-08T09:30:00"), + assignedTo: "Mehmet Kaya - Mekanik Ekibi", + status: NotificationStatusEnum.InProgress, + images: ["fault_image_1.jpg", "fault_image_2.jpg"], + estimatedRepairTime: 180, + workOrderId: "WO-2024-045", + followUpRequired: true, + isActive: true, + creationTime: new Date("2024-02-08T09:30:00"), + lastModificationTime: new Date("2024-02-08T14:15:00"), + }, + { + id: "FN002", + notificationCode: "ARZ-2024-002", + workCenterId: "2", + workCenter: mockWorkCenters.find((wc) => wc.id === "2")!, + location: "Kompresör Odası", + faultType: FaultTypeEnum.Electrical, + priority: PriorityEnum.Urgent, + severity: CriticalityLevelEnum.Critical, + title: "Elektrik Panosu Arızası", + description: + "Kompresör elektrik panosunda kısa devre meydana geldi. Sistem tamamen durdu.", + reportedBy: "Vardiya Amiri Ali Demir", + reportedAt: new Date("2024-02-07T16:45:00"), + assignedTo: "Ahmet Yılmaz - Elektrik Ekibi", + status: NotificationStatusEnum.Resolved, + estimatedRepairTime: 240, + actualRepairTime: 195, + resolutionNotes: + "Yanık sigorta değiştirildi ve pano kontrolleri yapıldı. Sistem normal çalışıyor.", + closedBy: "Ahmet Yılmaz", + closedAt: new Date("2024-02-07T20:00:00"), + workOrderId: "WO-2024-044", + followUpRequired: false, + isActive: true, + creationTime: new Date("2024-02-07T16:45:00"), + lastModificationTime: new Date("2024-02-07T20:00:00"), + }, + { + id: "FN003", + notificationCode: "ARZ-2024-003", + workCenterId: "3", + workCenter: mockWorkCenters.find((wc) => wc.id === "3")!, + location: "Ana Üretim Hattı", + faultType: FaultTypeEnum.Mechanical, + priority: PriorityEnum.Normal, + severity: CriticalityLevelEnum.Medium, + title: "Kayış Gerilimi Azaldı", + description: + "Konveyör kayışında gevşeme tespit edildi. Hız düşüklüğü gözlemleniyor.", + reportedBy: "Hat Sorumlusu Fatma Özkan", + reportedAt: new Date("2024-02-06T11:20:00"), + status: NotificationStatusEnum.Open, + estimatedRepairTime: 60, + followUpRequired: false, + isActive: true, + creationTime: new Date("2024-02-06T11:20:00"), + lastModificationTime: new Date("2024-02-06T11:20:00"), + }, + { + id: "FN004", + notificationCode: "ARZ-2024-004", + workCenterId: "3", + workCenter: mockWorkCenters.find((wc) => wc.id === "3")!, + location: "Kaynak Atölyesi", + faultType: FaultTypeEnum.Software, + priority: PriorityEnum.High, + severity: CriticalityLevelEnum.High, + title: "Program Kalibrasyon Hatası", + description: + "Robot kaynak pozisyonlarında sapma var. Kalibrasyon gerekiyor.", + reportedBy: "Kaynak Operatörü Hasan Çelik", + reportedAt: new Date("2024-02-05T14:10:00"), + assignedTo: "Sema Korkmaz - Robot Teknisyeni", + status: NotificationStatusEnum.Assigned, + estimatedRepairTime: 120, + followUpRequired: true, + isActive: true, + creationTime: new Date("2024-02-05T14:10:00"), + lastModificationTime: new Date("2024-02-05T15:30:00"), + }, + { + id: "FN005", + notificationCode: "ARZ-2024-005", + workCenterId: "4", + workCenter: mockWorkCenters.find((wc) => wc.id === "4")!, + location: "Pres Atölyesi", + faultType: FaultTypeEnum.Hydraulic, + priority: PriorityEnum.Low, + severity: CriticalityLevelEnum.Low, + title: "Yağ Sızıntısı", + description: + "Hidrolik sistem borularında hafif yağ sızıntısı tespit edildi.", + reportedBy: "Temizlik Personeli Zeynep Aktaş", + reportedAt: new Date("2024-02-04T08:45:00"), + status: NotificationStatusEnum.Closed, + estimatedRepairTime: 45, + actualRepairTime: 30, + resolutionNotes: "Boru bağlantıları sıkılaştırıldı. Sızıntı durduruldu.", + closedBy: "Ali Demir", + closedAt: new Date("2024-02-04T10:15:00"), + followUpRequired: true, + isActive: true, + creationTime: new Date("2024-02-04T08:45:00"), + lastModificationTime: new Date("2024-02-04T10:15:00"), + }, +]; diff --git a/ui/src/mocks/mockInventoryCounts.ts b/ui/src/mocks/mockInventoryCounts.ts new file mode 100644 index 00000000..5fc3fe69 --- /dev/null +++ b/ui/src/mocks/mockInventoryCounts.ts @@ -0,0 +1,112 @@ +import { + CountStatusEnum, + CountTypeEnum, + WmInventoryCount, + WmInventoryCountItem, +} from "../types/wm"; +import { mockLocations } from "./mockLocations"; +import { mockMaterials } from "./mockMaterials"; +import { mockWarehouses } from "./mockWarehouses"; +import { mockZones } from "./mockZones"; + +export const mockInventoryCounts: WmInventoryCount[] = [ + { + id: "1", + countNumber: "INV2024001", + warehouseId: "1", + warehouse: mockWarehouses.find((m) => m.id === "1"), + zoneId: "1", + zone: mockZones.find((m) => m.id === "1"), + locationId: "3", + location: mockLocations.find((m) => m.id === "3"), + countType: CountTypeEnum.Full, + status: CountStatusEnum.Completed, + scheduledDate: new Date("2024-11-01"), + startDate: new Date("2024-11-01"), + endDate: new Date("2024-11-03"), + countedBy: ["user1", "user2"], + approvedBy: "manager1", + items: [], + variances: [], + notes: "Aylık tam sayım", + creationTime: new Date("2024-10-25"), + lastModificationTime: new Date("2024-11-03"), + }, + { + id: "2", + countNumber: "INV2024002", + warehouseId: "1", + warehouse: mockWarehouses.find((m) => m.id === "1"), + zoneId: "1", + zone: mockZones.find((m) => m.id === "1"), + locationId: "3", + location: mockLocations.find((m) => m.id === "3"), + countType: CountTypeEnum.Cycle, + status: CountStatusEnum.InProgress, + scheduledDate: new Date("2024-11-25"), + startDate: new Date("2024-11-25"), + endDate: undefined, + countedBy: ["user3"], + approvedBy: undefined, + items: [], + variances: [], + notes: "A grubu malzemeler döngüsel sayım", + creationTime: new Date("2024-11-20"), + lastModificationTime: new Date("2024-11-25"), + }, + { + id: "3", + countNumber: "INV2024003", + warehouseId: "1", + warehouse: mockWarehouses.find((m) => m.id === "1"), + zoneId: "2", + zone: mockZones.find((m) => m.id === "2"), + locationId: "2", + location: mockLocations.find((m) => m.id === "2"), + countType: CountTypeEnum.Spot, + status: CountStatusEnum.Planned, + scheduledDate: new Date("2024-12-05"), + startDate: undefined, + endDate: undefined, + countedBy: [], + approvedBy: undefined, + items: [], + variances: [], + notes: "Şüpheli stoklar için nokta sayım", + creationTime: new Date("2024-11-30"), + lastModificationTime: new Date("2024-11-30"), + }, +]; + +export const mockCountItems: WmInventoryCountItem[] = [ + { + id: "1", + countId: "1", + materialId: "1", + material: mockMaterials.find((m) => m.id === "1"), + locationId: "1", + systemQuantity: 15, + countedQuantity: 14, + variance: -1, + variancePercentage: -6.67, + lotNumber: "LOT2024001", + countedBy: "user1", + countedAt: new Date("2024-11-01"), + notes: "Hasarlı 1 adet tespit edildi", + }, + { + id: "2", + countId: "1", + materialId: "2", + material: mockMaterials.find((m) => m.id === "2"), + locationId: "1", + systemQuantity: 8, + countedQuantity: 8, + variance: 0, + variancePercentage: 0, + lotNumber: "LOT2024002", + countedBy: "user2", + countedAt: new Date("2024-11-01"), + notes: "Sayım doğru", + }, +]; diff --git a/ui/src/mocks/mockInvoices.ts b/ui/src/mocks/mockInvoices.ts new file mode 100644 index 00000000..05484743 --- /dev/null +++ b/ui/src/mocks/mockInvoices.ts @@ -0,0 +1,55 @@ +import { + FiInvoice, + InvoiceStatusEnum, + InvoiceTypeEnum, + PaymentStatusEnum, +} from "../types/fi"; +import { mockCurrentAccounts } from "./mockCurrentAccounts"; + +export const mockInvoices: FiInvoice[] = [ + { + id: "1", + invoiceNumber: "SAT-2024-001", + invoiceType: InvoiceTypeEnum.Sales, + currentAccountId: "1", + currentAccount: mockCurrentAccounts.find((acc) => acc.id === "1")!, + invoiceDate: new Date("2024-01-15"), + dueDate: new Date("2024-02-14"), + subtotal: 10000, + taxAmount: 1800, + discountAmount: 0, + totalAmount: 11800, + paidAmount: 5000, + remainingAmount: 6800, + currency: "TRY", + status: InvoiceStatusEnum.Sent, + paymentStatus: PaymentStatusEnum.PartiallyPaid, + items: [], + waybillNumber: "IRS-2024-001", + creationTime: new Date("2024-01-15"), + lastModificationTime: new Date("2024-01-20"), + }, + { + id: "2", + invoiceNumber: "AL-2024-001", + invoiceType: InvoiceTypeEnum.Purchase, + currentAccountId: "2", + currentAccount: mockCurrentAccounts.find((acc) => acc.id === "2")!, + invoiceDate: new Date("2024-01-10"), + dueDate: new Date("2024-02-09"), + subtotal: 15000, + taxAmount: 2700, + discountAmount: 0, + totalAmount: 17700, + paidAmount: 17700, + remainingAmount: 0, + currency: "TRY", + status: InvoiceStatusEnum.Approved, + paymentStatus: PaymentStatusEnum.Paid, + items: [], + waybillNumber: "IRS-2024-002", + waybillDate: new Date("2024-01-10"), + creationTime: new Date("2024-01-10"), + lastModificationTime: new Date("2024-01-15"), + }, +]; diff --git a/ui/src/mocks/mockJobPositions.ts b/ui/src/mocks/mockJobPositions.ts new file mode 100644 index 00000000..d28bdf6f --- /dev/null +++ b/ui/src/mocks/mockJobPositions.ts @@ -0,0 +1,310 @@ +import { HrJobPosition, JobLevelEnum } from "../types/hr"; +import { mockDepartments } from "./mockDepartments"; + +export const mockJobPositions: HrJobPosition[] = [ + { + id: "1", + code: "DEV-001", + name: "Software Developer", + description: "Responsible for developing and maintaining web applications", + departmentId: "1", + department: mockDepartments.find((dept) => dept.id === "1"), + level: JobLevelEnum.Mid, + minSalary: 80000, + maxSalary: 120000, + currency: "USD", + requiredSkills: ["JavaScript", "TypeScript", "React", "Node.js"], + responsibilities: [ + "Develop frontend and backend applications", + "Write clean and maintainable code", + "Participate in code reviews", + "Collaborate with team members", + ], + qualifications: [ + "Bachelor's degree in Computer Science or related field", + "3+ years of experience in web development", + "Strong knowledge of JavaScript and TypeScript", + ], + isActive: true, + employees: [], + creationTime: new Date("2024-01-15T08:00:00Z"), + lastModificationTime: new Date("2024-01-15T08:00:00Z"), + }, + { + id: "2", + code: "MGR-001", + name: "Project Manager", + description: "Lead and manage software development projects", + departmentId: "1", + department: mockDepartments.find((dept) => dept.id === "1"), + level: JobLevelEnum.Manager, + minSalary: 100000, + maxSalary: 150000, + currency: "USD", + requiredSkills: ["Project Management", "Agile", "Scrum", "Leadership"], + responsibilities: [ + "Plan and execute project timelines", + "Coordinate with cross-functional teams", + "Manage project budgets and resources", + "Ensure project delivery within scope and timeline", + ], + qualifications: [ + "Bachelor's degree in Business or related field", + "5+ years of project management experience", + "PMP certification preferred", + ], + isActive: true, + employees: [], + creationTime: new Date("2024-01-16T08:00:00Z"), + lastModificationTime: new Date("2024-01-16T08:00:00Z"), + }, + { + id: "3", + code: "QA-001", + name: "Quality Assurance Engineer", + description: "Ensure software quality through testing and automation", + departmentId: "1", + department: mockDepartments.find((dept) => dept.id === "1"), + level: JobLevelEnum.Mid, + minSalary: 70000, + maxSalary: 100000, + currency: "USD", + requiredSkills: ["Testing", "Automation", "Selenium", "API Testing"], + responsibilities: [ + "Design and execute test cases", + "Automate testing processes", + "Report and track bugs", + "Collaborate with development team", + ], + qualifications: [ + "Bachelor's degree in Computer Science or related field", + "3+ years of QA experience", + "Experience with automation tools", + ], + isActive: true, + employees: [], + creationTime: new Date("2024-01-17T08:00:00Z"), + lastModificationTime: new Date("2024-01-17T08:00:00Z"), + }, + { + id: "4", + code: "UX-001", + name: "UX/UI Designer", + description: "Design user interfaces and improve user experience", + departmentId: "2", + department: mockDepartments.find((dept) => dept.id === "2"), + level: JobLevelEnum.Mid, + minSalary: 75000, + maxSalary: 110000, + currency: "USD", + requiredSkills: [ + "Figma", + "Adobe Creative Suite", + "User Research", + "Prototyping", + ], + responsibilities: [ + "Create wireframes and prototypes", + "Conduct user research", + "Design intuitive user interfaces", + "Collaborate with development team", + ], + qualifications: [ + "Bachelor's degree in Design or related field", + "3+ years of UX/UI design experience", + "Strong portfolio demonstrating design skills", + ], + isActive: true, + employees: [], + creationTime: new Date("2024-01-18T08:00:00Z"), + lastModificationTime: new Date("2024-01-18T08:00:00Z"), + }, + { + id: "5", + code: "DA-001", + name: "Data Analyst", + description: "Analyze business data and provide insights", + departmentId: "1", + department: mockDepartments.find((dept) => dept.id === "1"), + level: JobLevelEnum.Mid, + minSalary: 85000, + maxSalary: 125000, + currency: "USD", + requiredSkills: ["SQL", "Python", "Excel", "Tableau", "Statistics"], + responsibilities: [ + "Analyze large datasets", + "Create reports and dashboards", + "Identify trends and patterns", + "Present findings to stakeholders", + ], + qualifications: [ + "Bachelor's degree in Statistics, Mathematics, or related field", + "3+ years of data analysis experience", + "Strong analytical and problem-solving skills", + ], + isActive: true, + employees: [], + creationTime: new Date("2024-01-19T08:00:00Z"), + lastModificationTime: new Date("2024-01-19T08:00:00Z"), + }, + { + id: "6", + code: "HR-001", + name: "HR Specialist", + description: "Support human resources operations and employee relations", + departmentId: "4", + department: mockDepartments.find((dept) => dept.id === "4"), + level: JobLevelEnum.Mid, + minSalary: 60000, + maxSalary: 85000, + currency: "USD", + requiredSkills: [ + "HR Management", + "Recruitment", + "Employee Relations", + "HRIS", + ], + responsibilities: [ + "Manage recruitment processes", + "Handle employee relations issues", + "Maintain HR records and policies", + "Support employee onboarding", + ], + qualifications: [ + "Bachelor's degree in Human Resources or related field", + "2+ years of HR experience", + "Knowledge of employment laws and regulations", + ], + isActive: true, + employees: [], + creationTime: new Date("2024-01-20T08:00:00Z"), + lastModificationTime: new Date("2024-01-20T08:00:00Z"), + }, + { + id: "7", + code: "SA-001", + name: "Sales Associate", + description: "Generate sales leads and maintain customer relationships", + departmentId: "2", + department: mockDepartments.find((dept) => dept.id === "2"), + level: JobLevelEnum.Junior, + minSalary: 45000, + maxSalary: 70000, + currency: "USD", + requiredSkills: ["Sales", "CRM", "Communication", "Customer Service"], + responsibilities: [ + "Identify and pursue sales opportunities", + "Maintain customer relationships", + "Prepare sales proposals", + "Meet monthly sales targets", + ], + qualifications: [ + "Bachelor's degree in Business or related field", + "1+ years of sales experience", + "Excellent communication skills", + ], + isActive: true, + employees: [], + creationTime: new Date("2024-01-21T08:00:00Z"), + lastModificationTime: new Date("2024-01-21T08:00:00Z"), + }, + { + id: "8", + code: "ACC-001", + name: "Accountant", + description: "Manage financial records and ensure compliance", + departmentId: "3", + department: mockDepartments.find((dept) => dept.id === "3"), + level: JobLevelEnum.Mid, + minSalary: 55000, + maxSalary: 80000, + currency: "USD", + requiredSkills: [ + "Accounting", + "Excel", + "Financial Analysis", + "Tax Preparation", + ], + responsibilities: [ + "Maintain financial records", + "Prepare financial statements", + "Ensure regulatory compliance", + "Assist with budget planning", + ], + qualifications: [ + "Bachelor's degree in Accounting or Finance", + "CPA certification preferred", + "3+ years of accounting experience", + ], + isActive: true, + employees: [], + creationTime: new Date("2024-01-22T08:00:00Z"), + lastModificationTime: new Date("2024-01-22T08:00:00Z"), + }, + { + id: "9", + code: "CS-001", + name: "Customer Support Representative", + description: "Provide excellent customer service and technical support", + departmentId: "2", + department: mockDepartments.find((dept) => dept.id === "2"), + level: JobLevelEnum.Entry, + minSalary: 35000, + maxSalary: 50000, + currency: "USD", + requiredSkills: [ + "Customer Service", + "Communication", + "Problem Solving", + "CRM", + ], + responsibilities: [ + "Respond to customer inquiries", + "Resolve technical issues", + "Document customer interactions", + "Escalate complex issues when needed", + ], + qualifications: [ + "High school diploma or equivalent", + "1+ years of customer service experience", + "Strong communication skills", + ], + isActive: true, + employees: [], + creationTime: new Date("2024-01-23T08:00:00Z"), + lastModificationTime: new Date("2024-01-23T08:00:00Z"), + }, + { + id: "10", + code: "IT-001", + name: "IT Support Specialist", + description: "Provide technical support and maintain IT infrastructure", + departmentId: "1", + department: mockDepartments.find((dept) => dept.id === "1"), + level: JobLevelEnum.Junior, + minSalary: 50000, + maxSalary: 75000, + currency: "USD", + requiredSkills: [ + "Windows", + "Network Administration", + "Hardware", + "Troubleshooting", + ], + responsibilities: [ + "Provide technical support to employees", + "Maintain computer systems and networks", + "Install and configure software", + "Document IT procedures", + ], + qualifications: [ + "Associate degree in Information Technology or related field", + "2+ years of IT support experience", + "CompTIA A+ certification preferred", + ], + isActive: true, + employees: [], + creationTime: new Date("2024-01-24T08:00:00Z"), + lastModificationTime: new Date("2024-01-24T08:00:00Z"), + }, +]; diff --git a/ui/src/mocks/mockLocations.ts b/ui/src/mocks/mockLocations.ts new file mode 100644 index 00000000..cbb80273 --- /dev/null +++ b/ui/src/mocks/mockLocations.ts @@ -0,0 +1,110 @@ +import { LocationTypeEnum } from "../types/wm"; +import { WmLocation } from "../types/wm"; + +export const mockLocations: WmLocation[] = [ + { + id: "1", + warehouseId: "1", + zoneId: "2", + locationCode: "A01-01-01", + name: "A Blok 1. Koridor 1. Raf", + description: "Yüksek raf - Ağır malzemeler", + locationType: LocationTypeEnum.Rack, + capacity: 100, + currentStock: 75, + dimensions: { + length: 2.5, + width: 1.2, + height: 3.0, + weight: 1000, + unit: "kg", + }, + restrictions: ["Ağır malzemeler", "Palet kullanımı zorunlu"], + stockItems: [], + isActive: true, + }, + { + id: "2", + warehouseId: "1", + zoneId: "2", + locationCode: "A01-01-02", + name: "A Blok 1. Koridor 2. Raf", + description: "Orta raf - Orta ağırlık malzemeler", + locationType: LocationTypeEnum.Shelf, + capacity: 50, + currentStock: 30, + dimensions: { + length: 2.0, + width: 0.8, + height: 2.0, + weight: 500, + unit: "kg", + }, + restrictions: ["Orta ağırlık malzemeler"], + stockItems: [], + isActive: true, + }, + { + id: "3", + warehouseId: "1", + zoneId: "1", + locationCode: "B02-02-01", + name: "B Blok 2. Koridor 1. Raf", + description: "Küçük parçalar rafı", + locationType: LocationTypeEnum.Bin, + capacity: 200, + currentStock: 180, + dimensions: { + length: 1.5, + width: 0.6, + height: 1.5, + weight: 200, + unit: "kg", + }, + restrictions: ["Küçük parçalar"], + stockItems: [], + isActive: true, + }, + { + id: "4", + warehouseId: "2", + zoneId: "1", + locationCode: "B02-02-01", + name: "B Blok 2. Koridor 1. Raf", + description: "Küçük parçalar rafı", + locationType: LocationTypeEnum.Bin, + capacity: 200, + currentStock: 180, + dimensions: { + length: 1.5, + width: 0.6, + height: 1.5, + weight: 200, + unit: "kg", + }, + restrictions: ["Küçük parçalar"], + stockItems: [], + isActive: true, + }, + { + id: "4", + warehouseId: "2", + zoneId: "3", + locationCode: "C01-02-01", + name: "C Blok 2. Koridor 1. Raf", + description: "Büyük parçalar rafı", + locationType: LocationTypeEnum.Bin, + capacity: 200, + currentStock: 180, + dimensions: { + length: 1.5, + width: 0.6, + height: 1.5, + weight: 200, + unit: "kg", + }, + restrictions: ["Küçük parçalar"], + stockItems: [], + isActive: true, + }, +]; diff --git a/ui/src/mocks/mockLossReasons.ts b/ui/src/mocks/mockLossReasons.ts new file mode 100644 index 00000000..728d29a2 --- /dev/null +++ b/ui/src/mocks/mockLossReasons.ts @@ -0,0 +1,52 @@ +import { CrmLostReason, LostReasonCategoryEnum } from "../types/crm"; + +export const mockLossReasons: CrmLostReason[] = [ + { + id: "1", + code: "LR001", + name: "Fiyat Rekabetsizliği", + description: "Müşteri daha uygun fiyatlı alternatif buldu", + category: LostReasonCategoryEnum.Price, + isActive: true, + }, + { + id: "2", + code: "LR002", + name: "Ürün Özellik Eksikliği", + description: "Ürünümüzde müşterinin istediği özellik bulunmuyor", + category: LostReasonCategoryEnum.Product, + isActive: true, + }, + { + id: "3", + code: "LR003", + name: "Destek Kalitesi", + description: "Müşteri destek kalitemizden memnun değil", + category: LostReasonCategoryEnum.Service, + isActive: true, + }, + { + id: "4", + code: "LR004", + name: "Rakip Avantajı", + description: "Rakip daha iyi şartlar sundu", + category: LostReasonCategoryEnum.Competitor, + isActive: true, + }, + { + id: "5", + code: "LR005", + name: "Yanlış Zamanlama", + description: "Müşteri zamanlaması uygun değil", + category: LostReasonCategoryEnum.Timing, + isActive: false, + }, + { + id: "6", + code: "LR006", + name: "Bütçe Kısıtlaması", + description: "Müşteri bütçesi yetersiz", + category: LostReasonCategoryEnum.Budget, + isActive: true, + }, +]; diff --git a/ui/src/mocks/mockLotNumbers.ts b/ui/src/mocks/mockLotNumbers.ts new file mode 100644 index 00000000..bf522e70 --- /dev/null +++ b/ui/src/mocks/mockLotNumbers.ts @@ -0,0 +1,42 @@ +import { MmLotNumber, QualityStatusEnum } from "../types/mm"; +import { mockMaterials } from "./mockMaterials"; + +export const mockLotNumbers: MmLotNumber[] = [ + { + id: "1", + materialId: "1", + material: mockMaterials.find((m) => m.id === "1"), + lotNumber: "LOT-2024-001", + productionDate: new Date("2024-01-01"), + expiryDate: new Date("2024-12-31"), + quantity: 100, + unitId: "KG", + supplierId: "SUP-001", + qualityStatus: QualityStatusEnum.Approved, + isActive: true, + }, + { + id: "2", + materialId: "2", + material: mockMaterials.find((m) => m.id === "2"), + lotNumber: "LOT-2024-002", + productionDate: new Date("2024-01-15"), + expiryDate: new Date("2025-01-14"), + quantity: 75, + unitId: "KG", + supplierId: "SUP-002", + qualityStatus: QualityStatusEnum.Pending, + isActive: true, + }, + { + id: "3", + materialId: "3", + material: mockMaterials.find((m) => m.id === "3"), + lotNumber: "LOT-2024-003", + productionDate: new Date("2024-01-10"), + quantity: 50, + unitId: "ADET", + qualityStatus: QualityStatusEnum.Quarantine, + isActive: true, + }, +]; diff --git a/ui/src/mocks/mockMRP.ts b/ui/src/mocks/mockMRP.ts new file mode 100644 index 00000000..9e0ef57f --- /dev/null +++ b/ui/src/mocks/mockMRP.ts @@ -0,0 +1,168 @@ +import { PriorityEnum } from "../types/common"; +import { mockMaterials } from "./../mocks/mockMaterials"; +import { + MrpMaterialRequirement, + MrpProductionSuggestion, + MrpPurchaseSuggestion, + RecommendationStatusEnum, + RecommendationTypeEnum, + RequirementSourceTypeEnum, +} from "./../types/mrp"; + +export const mockMaterialRequirements: MrpMaterialRequirement[] = [ + { + id: "1", + mrpRunId: "mrp-run-123", + materialId: mockMaterials[0].id, + material: mockMaterials[0], + sourceType: RequirementSourceTypeEnum.SalesOrder, + sourceDocumentId: "SO-2024-001", + grossRequirement: 150, + projectedAvailable: 50, + scheduledReceipts: 20, + netRequirement: 80, + plannedOrderReceipt: 80, + plannedOrderRelease: 80, + requirementDate: new Date("2024-08-15"), + plannedReceiptDate: new Date("2024-08-10"), + plannedReleaseDate: new Date("2024-08-01"), + creationTime: new Date(), + lastModificationTime: new Date(), + }, + { + id: "2", + mrpRunId: "mrp-run-123", + materialId: mockMaterials[2].id, + material: mockMaterials[2], + sourceType: RequirementSourceTypeEnum.Forecast, + sourceDocumentId: "F-2024-Q3", + grossRequirement: 500, + projectedAvailable: 200, + scheduledReceipts: 100, + netRequirement: 200, + plannedOrderReceipt: 200, + plannedOrderRelease: 200, + requirementDate: new Date("2024-09-01"), + plannedReceiptDate: new Date("2024-08-25"), + plannedReleaseDate: new Date("2024-08-10"), + creationTime: new Date(), + lastModificationTime: new Date(), + }, + { + id: "3", + mrpRunId: "mrp-run-123", + materialId: mockMaterials[4].id, + material: mockMaterials[4], + sourceType: RequirementSourceTypeEnum.SafetyStock, + sourceDocumentId: "SS-RULE-1", + grossRequirement: 100, + projectedAvailable: 30, + scheduledReceipts: 0, + netRequirement: 70, + plannedOrderReceipt: 70, + plannedOrderRelease: 70, + requirementDate: new Date("2024-07-30"), + plannedReceiptDate: new Date("2024-07-25"), + plannedReleaseDate: new Date("2024-07-15"), + creationTime: new Date(), + lastModificationTime: new Date(), + }, +]; + +export const mockPurchaseSuggestions: MrpPurchaseSuggestion[] = [ + { + id: "rec-pur-1", + mrpRunId: "mrp-run-123", + materialId: mockMaterials[2].id, + material: mockMaterials[2], + recommendationType: RecommendationTypeEnum.PurchaseRequisition, + recommendedAction: "200 adet satın al", + reason: "Tahmin bazlı ihtiyaç", + quantity: 200, + dueDate: new Date("2024-08-25"), + priority: PriorityEnum.Normal, + status: RecommendationStatusEnum.Open, + creationTime: new Date(), + lastModificationTime: new Date(), + supplierId: "1", + supplier: mockMaterials + .find((m) => m.id === mockMaterials[2].id) + ?.suppliers?.find((s) => s.id === "1"), + estimatedCost: + 200 * + (mockMaterials + .find((m) => m.id === mockMaterials[2].id) + ?.suppliers?.find((s) => s.id === "1")?.price || 12.5), + leadTime: + mockMaterials + .find((m) => m.id === mockMaterials[2].id) + ?.suppliers?.find((s) => s.id === "1")?.leadTime || 15, + minimumOrderQuantity: 0, + suggestedQuantity: 0, + economicOrderQuantity: 0, + }, + { + id: "rec-pur-2", + mrpRunId: "mrp-run-123", + materialId: mockMaterials[4].id, + material: mockMaterials[4], + recommendationType: RecommendationTypeEnum.PurchaseRequisition, + recommendedAction: "70 adet satın al", + reason: "Güvenlik stoku altına düştü", + quantity: 70, + dueDate: new Date("2024-07-25"), + priority: PriorityEnum.High, + status: RecommendationStatusEnum.Open, + creationTime: new Date(), + lastModificationTime: new Date(), + supplier: mockMaterials + .find((m) => m.id === mockMaterials[1].id) + ?.suppliers?.find((s) => s.id === "1"), + estimatedCost: + 200 * + (mockMaterials + .find((m) => m.id === mockMaterials[2].id) + ?.suppliers?.find((s) => s.id === "1")?.price || 5.5), + leadTime: + mockMaterials + .find((m) => m.id === mockMaterials[2].id) + ?.suppliers?.find((s) => s.id === "1")?.leadTime || 10, + minimumOrderQuantity: 20, + suggestedQuantity: 70, + economicOrderQuantity: 100, + supplierId: "", + }, +]; + +export const mockProductionSuggestions: MrpProductionSuggestion[] = [ + { + id: "rec-prod-1", + mrpRunId: "mrp-run-123", + materialId: mockMaterials[0].id, + material: mockMaterials[0], + recommendationType: RecommendationTypeEnum.PlannedOrder, + recommendedAction: "80 adet üret", + reason: "Satış siparişi ihtiyacı", + quantity: 80, + dueDate: new Date("2024-08-10"), + priority: PriorityEnum.Urgent, + status: RecommendationStatusEnum.Open, + creationTime: new Date(), + lastModificationTime: new Date(), + estimatedDuration: 40, // hours + resourceRequirements: [ + { workCenter: "MONTAJ-01", capacity: 40, efficiency: 95 }, + ], + bom: { + id: "bom-1", + version: "1.2", + materialCount: 5, + totalCost: 1500, + }, + productionCost: 80 * 25.5, + setupTime: 2, + cycleTime: 0.5, + suggestedStartDate: "2024-08-01", + suggestedCompletionDate: "2024-08-05", + }, +]; diff --git a/ui/src/mocks/mockMaintenanceCalendarEvent.ts b/ui/src/mocks/mockMaintenanceCalendarEvent.ts new file mode 100644 index 00000000..c1e6ae18 --- /dev/null +++ b/ui/src/mocks/mockMaintenanceCalendarEvent.ts @@ -0,0 +1,86 @@ +import { PriorityEnum } from "../types/common"; +import { + PmCalendarEvent as MaintenanceCalendarEvent, + WorkOrderStatusEnum, +} from "../types/pm"; + +export const mockCalendarEvents: MaintenanceCalendarEvent[] = [ + { + id: "E001", + title: "CNC Torna Rutin Bakım", + type: "plan", + date: new Date("2024-02-12"), + startTime: "09:00", + endTime: "11:00", + status: "scheduled", + priority: PriorityEnum.High, + assignedTo: "Mehmet Kaya", + workCenterCode: "CNC-001", + duration: 120, + }, + { + id: "E002", + title: "Kompresör Aylık Bakım", + type: "plan", + date: new Date("2024-02-15"), + startTime: "08:00", + endTime: "12:00", + status: "scheduled", + priority: PriorityEnum.Urgent, + assignedTo: "Ali Demir", + workCenterCode: "COMP-001", + duration: 240, + }, + { + id: "E003", + title: "Konveyör Arıza Onarım", + type: "workorder", + date: new Date("2024-02-10"), + startTime: "14:00", + endTime: "17:00", + status: WorkOrderStatusEnum.InProgress, + priority: PriorityEnum.High, + assignedTo: "Ahmet Yılmaz", + workCenterCode: "CONV-001", + duration: 180, + }, + { + id: "E004", + title: "Robot Kaynak Kalibrasyon", + type: "workorder", + date: new Date("2024-02-08"), + startTime: "10:00", + endTime: "18:00", + status: WorkOrderStatusEnum.Completed, + priority: PriorityEnum.Normal, + assignedTo: "Fatma Özkan", + workCenterCode: "WELD-001", + duration: 480, + }, + { + id: "E005", + title: "Hidrolik Sistem Kontrol", + type: "plan", + date: new Date("2024-02-14"), + startTime: "13:00", + endTime: "15:00", + status: "scheduled", + priority: PriorityEnum.Normal, + assignedTo: "Sema Korkmaz", + workCenterCode: "HYD-001", + duration: 120, + }, + { + id: "E006", + title: "Elektrik Panosu Bakım", + type: "plan", + date: new Date("2024-02-16"), + startTime: "16:00", + endTime: "18:00", + status: "scheduled", + priority: PriorityEnum.Low, + assignedTo: "Hasan Çelik", + workCenterCode: "ELEC-001", + duration: 120, + }, +]; diff --git a/ui/src/mocks/mockMaintenancePlans.ts b/ui/src/mocks/mockMaintenancePlans.ts new file mode 100644 index 00000000..c8896bc3 --- /dev/null +++ b/ui/src/mocks/mockMaintenancePlans.ts @@ -0,0 +1,80 @@ +import { PriorityEnum } from "../types/common"; +import { + FrequencyUnitEnum, + PmMaintenancePlan, + MaintenancePlanTypeEnum, +} from "../types/pm"; + +export const mockMaintenancePlans: PmMaintenancePlan[] = [ + { + id: "MP001", + planCode: "PM-CNC-001", + workCenterId: "EQP001", + planType: MaintenancePlanTypeEnum.Preventive, + description: "CNC torna tezgahı için haftalık rutin bakım planı", + frequency: 1, + frequencyUnit: FrequencyUnitEnum.Weeks, + estimatedDuration: 120, + priority: PriorityEnum.High, + requiredMaterials: [], + requiredSkills: ["Torna Operatörü", "Mekanik"], + lastExecuted: new Date("2024-02-05"), + nextDue: new Date("2024-02-12"), + isActive: true, + creationTime: new Date("2024-01-15"), + lastModificationTime: new Date("2024-02-01"), + }, + { + id: "MP002", + planCode: "PM-COMP-001", + workCenterId: "EQP002", + planType: MaintenancePlanTypeEnum.Preventive, + description: "Hava kompresörü aylık bakım ve kontrol planı", + frequency: 1, + frequencyUnit: FrequencyUnitEnum.Months, + estimatedDuration: 240, + priority: PriorityEnum.Urgent, + requiredMaterials: [], + requiredSkills: ["Kompresör Teknisyeni", "Elektrikçi"], + lastExecuted: new Date("2024-01-15"), + nextDue: new Date("2024-02-15"), + isActive: true, + creationTime: new Date("2024-01-10"), + lastModificationTime: new Date("2024-01-25"), + }, + { + id: "MP003", + planCode: "CM-CONV-001", + workCenterId: "EQP003", + planType: MaintenancePlanTypeEnum.Corrective, + description: "Konveyör sistemi arıza durumunda müdahale planı", + frequency: 0, + frequencyUnit: FrequencyUnitEnum.Days, + estimatedDuration: 180, + priority: PriorityEnum.High, + requiredMaterials: [], + requiredSkills: ["Mekanik", "Elektrikçi", "PLC Teknisyeni"], + nextDue: new Date("2024-02-10"), + isActive: false, + creationTime: new Date("2024-02-05"), + lastModificationTime: new Date("2024-02-06"), + }, + { + id: "MP004", + planCode: "PM-WELD-001", + workCenterId: "EQP004", + planType: MaintenancePlanTypeEnum.Predictive, + description: "Robot kaynak sistemi 6 aylık periyodik bakımı", + frequency: 6, + frequencyUnit: FrequencyUnitEnum.Months, + estimatedDuration: 480, + priority: PriorityEnum.High, + requiredMaterials: [], + requiredSkills: ["Robot Teknisyeni", "Kaynak Uzmanı", "Elektrikçi"], + lastExecuted: new Date("2023-08-15"), + nextDue: new Date("2024-02-15"), + isActive: true, + creationTime: new Date("2023-08-01"), + lastModificationTime: new Date("2024-01-20"), + }, +]; diff --git a/ui/src/mocks/mockMaintenanceTeams.ts b/ui/src/mocks/mockMaintenanceTeams.ts new file mode 100644 index 00000000..d5ca9cdd --- /dev/null +++ b/ui/src/mocks/mockMaintenanceTeams.ts @@ -0,0 +1,144 @@ +import { Team, TeamRoleEnum } from "../types/common"; +import { mockEmployees } from "./mockEmployees"; + +export const mockMaintenanceTeams: Team[] = [ + { + id: "1", + code: "MEC-001", + name: "Mekanik Bakım Ekibi", + description: "Genel mekanik bakım ve onarım işleri", + managerId: "1", + members: [ + { + id: "TM001", + teamId: "1", + employeeId: "1", + employee: mockEmployees.find((emp) => emp.id === "1")!, + role: TeamRoleEnum.Lead, + joinDate: new Date("2023-01-15"), + isActive: true, + }, + { + id: "TM002", + teamId: "1", + employeeId: "2", + employee: mockEmployees.find((emp) => emp.id === "2")!, + role: TeamRoleEnum.Member, + joinDate: new Date("2023-03-20"), + isActive: true, + }, + { + id: "TM003", + teamId: "1", + employeeId: "3", + employee: mockEmployees.find((emp) => emp.id === "3")!, + role: TeamRoleEnum.Specialist, + joinDate: new Date("2023-02-10"), + isActive: true, + }, + ], + specializations: [ + "Torna Tezgahı", + "Freze Makinesi", + "CNC Sistemleri", + "Hidrolik Sistemler", + ], + isActive: true, + creationTime: new Date("2023-01-15"), + lastModificationTime: new Date("2024-01-20"), + }, + { + id: "2", + code: "ELE-001", + name: "Elektrik Bakım Ekibi", + description: "Elektrik sistemleri ve otomasyon bakımı", + managerId: "4", + members: [ + { + id: "TM004", + teamId: "2", + employeeId: "4", + employee: mockEmployees.find((emp) => emp.id === "4")!, + role: TeamRoleEnum.Lead, + joinDate: new Date("2023-01-20"), + isActive: true, + }, + { + id: "TM005", + teamId: "2", + employeeId: "5", + employee: mockEmployees.find((emp) => emp.id === "5")!, + role: TeamRoleEnum.Member, + joinDate: new Date("2023-02-15"), + isActive: true, + }, + ], + specializations: [ + "PLC Programlama", + "Motor Kontrolü", + "Pano Montajı", + "Sensör Sistemleri", + ], + isActive: true, + creationTime: new Date("2023-01-20"), + lastModificationTime: new Date("2024-01-25"), + }, + { + id: "3", + code: "WEL-001", + name: "Kaynak Ekibi", + description: "Kaynak ve metal işleri uzmanları", + managerId: "6", + members: [ + { + id: "TM006", + teamId: "3", + employeeId: "6", + employee: mockEmployees.find((emp) => emp.id === "6")!, + role: TeamRoleEnum.Lead, + joinDate: new Date("2023-01-10"), + isActive: true, + }, + { + id: "TM007", + teamId: "3", + employeeId: "7", + employee: mockEmployees.find((emp) => emp.id === "7")!, + role: TeamRoleEnum.Member, + joinDate: new Date("2023-04-05"), + isActive: true, + }, + ], + specializations: [ + "Robot Kaynak", + "TIG Kaynak", + "MIG Kaynak", + "Argon Kaynak", + ], + isActive: true, + creationTime: new Date("2023-01-10"), + lastModificationTime: new Date("2024-02-01"), + }, + { + id: "4", + code: "GEN-001", + name: "Genel Bakım Ekibi", + description: "Genel bakım ve temizlik işleri", + managerId: "8", + members: [ + { + id: "TM008", + teamId: "4", + employeeId: "8", + employee: mockEmployees.find((emp) => emp.id === "8")!, + role: TeamRoleEnum.Lead, + joinDate: new Date("2023-01-05"), + isActive: true, + }, + ], + specializations: ["Genel Temizlik", "Yağlama", "Basit Onarımlar"], + isActive: false, + creationTime: new Date("2023-01-05"), + lastModificationTime: new Date("2024-01-30"), + }, +]; diff --git a/ui/src/mocks/mockMaintenanceWorkOrders.ts b/ui/src/mocks/mockMaintenanceWorkOrders.ts new file mode 100644 index 00000000..a97967d6 --- /dev/null +++ b/ui/src/mocks/mockMaintenanceWorkOrders.ts @@ -0,0 +1,204 @@ +import { PriorityEnum } from "../types/common"; +import { + PmMaintenanceWorkOrder, + WorkOrderStatusEnum, + WorkOrderTypeEnum, +} from "../types/pm"; + +export const mockMaintenanceWorkOrders: PmMaintenanceWorkOrder[] = [ + { + id: "1", + workOrderNumber: "WO-2024-045", + workCenterId: "1", + orderType: WorkOrderTypeEnum.Corrective, + priority: PriorityEnum.High, + status: WorkOrderStatusEnum.InProgress, + description: "CNC Torna Tezgahı Motor Titreşim Sorunu Giderilmesi", + reportedBy: "Operator Mustafa Koç", + assignedTo: "Mehmet Kaya", + scheduledStart: new Date("2024-02-08T10:00:00"), + scheduledEnd: new Date("2024-02-08T13:00:00"), + actualStart: new Date("2024-02-08T10:15:00"), + estimatedCost: 500, + actualCost: 350, + materials: [ + { + id: "WOM001", + workOrderId: "WO001", + materialId: "MAT001", + materialCode: "BEARING-001", + materialName: "Rulman 6205", + plannedQuantity: 2, + actualQuantity: 2, + unitCost: 45.5, + totalCost: 91.0, + }, + { + id: "WOM002", + workOrderId: "WO001", + materialId: "MAT002", + materialCode: "OIL-002", + materialName: "Motor Yağı", + plannedQuantity: 3, + actualQuantity: 2, + unitCost: 35.0, + totalCost: 70.0, + }, + ], + activities: [ + { + id: "WOA001", + workOrderId: "WO001", + activityDescription: "Motor sökme ve inceleme", + plannedDuration: 60, + actualDuration: 45, + performedBy: "Mehmet Kaya", + completedAt: new Date("2024-02-08T11:00:00"), + notes: "Motor rulmanlarında aşınma tespit edildi", + }, + { + id: "WOA002", + workOrderId: "WO001", + activityDescription: "Rulman değişimi", + plannedDuration: 90, + actualDuration: 75, + performedBy: "Mehmet Kaya", + notes: "Yeni rulmanlar takıldı ve yağlama yapıldı", + }, + ], + notes: "Motor titreşim sorunu rulman değişimi ile çözüldü.", + creationTime: new Date("2024-02-08T09:30:00"), + lastModificationTime: new Date("2024-02-08T12:00:00"), + }, + { + id: "2", + workOrderNumber: "WO-2024-046", + workCenterId: "2", + planId: "MP002", + orderType: WorkOrderTypeEnum.Preventive, + priority: PriorityEnum.Normal, + status: WorkOrderStatusEnum.Planned, + description: "Hava Kompresörü Aylık Rutin Bakım", + reportedBy: "Sistem (Otomatik)", + assignedTo: "Ali Demir", + scheduledStart: new Date("2024-02-15T08:00:00"), + scheduledEnd: new Date("2024-02-15T12:00:00"), + estimatedCost: 200, + actualCost: 0, + materials: [ + { + id: "WOM003", + workOrderId: "WO002", + materialId: "MAT003", + materialCode: "FILTER-001", + materialName: "Hava Filtresi", + plannedQuantity: 2, + actualQuantity: 0, + unitCost: 25.0, + totalCost: 50.0, + }, + ], + activities: [ + { + id: "WOA003", + workOrderId: "WO002", + activityDescription: "Hava filtresi değişimi", + plannedDuration: 30, + actualDuration: 0, + performedBy: "Ali Demir", + }, + { + id: "WOA004", + workOrderId: "WO002", + activityDescription: "Basınç kontrolü ve kalibrasyon", + plannedDuration: 60, + actualDuration: 0, + performedBy: "Ali Demir", + }, + ], + creationTime: new Date("2024-02-01T09:00:00"), + lastModificationTime: new Date("2024-02-01T09:00:00"), + }, + { + id: "3", + workOrderNumber: "WO-2024-047", + workCenterId: "3", + orderType: WorkOrderTypeEnum.Emergency, + priority: PriorityEnum.Urgent, + status: WorkOrderStatusEnum.Completed, + description: "Konveyör Sistemi Acil Onarım - Üretim Durduruldu", + reportedBy: "Vardiya Amiri", + assignedTo: "Fatma Özkan", + scheduledStart: new Date("2024-02-06T14:00:00"), + scheduledEnd: new Date("2024-02-06T17:00:00"), + actualStart: new Date("2024-02-06T14:10:00"), + actualEnd: new Date("2024-02-06T16:45:00"), + estimatedCost: 800, + actualCost: 750, + materials: [ + { + id: "WOM004", + workOrderId: "WO003", + materialId: "MAT004", + materialCode: "MOTOR-001", + materialName: "Konveyör Motoru 3kW", + plannedQuantity: 1, + actualQuantity: 1, + unitCost: 650.0, + totalCost: 650.0, + }, + ], + activities: [ + { + id: "WOA005", + workOrderId: "WO003", + activityDescription: "Arızalı motor sökme", + plannedDuration: 45, + actualDuration: 40, + performedBy: "Fatma Özkan", + completedAt: new Date("2024-02-06T14:50:00"), + notes: "Motor sargıları yanmış", + }, + { + id: "WOA006", + workOrderId: "WO003", + activityDescription: "Yeni motor montajı", + plannedDuration: 90, + actualDuration: 85, + performedBy: "Fatma Özkan", + completedAt: new Date("2024-02-06T16:15:00"), + notes: "Motor takıldı ve test edildi", + }, + ], + notes: "Acil onarım başarıyla tamamlandı. Üretim normale döndü.", + completionNotes: + "Motor arızası nedeniyle değişim yapıldı. Sistem test edildi ve normal çalışıyor.", + creationTime: new Date("2024-02-06T13:45:00"), + lastModificationTime: new Date("2024-02-06T16:45:00"), + }, + { + id: "4", + workOrderNumber: "WO-2024-048", + workCenterId: "4", + orderType: WorkOrderTypeEnum.Calibration, + priority: PriorityEnum.Normal, + status: WorkOrderStatusEnum.Created, + description: "Robot Kaynak Makinesi Kalibrasyon", + reportedBy: "Kalite Kontrol", + estimatedCost: 300, + actualCost: 0, + materials: [], + activities: [ + { + id: "WOA007", + workOrderId: "WO004", + activityDescription: "Robot pozisyon kalibrasyonu", + plannedDuration: 120, + actualDuration: 0, + performedBy: "Sema Korkmaz", + }, + ], + creationTime: new Date("2024-02-05T11:20:00"), + lastModificationTime: new Date("2024-02-05T11:20:00"), + }, +]; diff --git a/ui/src/mocks/mockMaterialGroups.ts b/ui/src/mocks/mockMaterialGroups.ts new file mode 100644 index 00000000..9f956a62 --- /dev/null +++ b/ui/src/mocks/mockMaterialGroups.ts @@ -0,0 +1,68 @@ +import { MmMaterialGroup } from "../types/mm"; + +// Define your mock data +export const mockMaterialGroups: MmMaterialGroup[] = [ + { + id: "1", + code: "METAL", + name: "Metal Malzemeler", + description: "Çelik, alüminyum gibi metal ürün grupları.", + isActive: true, + }, + { + id: "2", + code: "MOTOR", + name: "Elektrik Motorları", + description: "AC, DC ve servo motor grupları.", + isActive: true, + }, + { + id: "3", + code: "PLASTIK", + name: "Plastik Malzemeler", + isActive: true, + }, + { + id: "4", + code: "KIMYA", + name: "Kimyasal Maddeler", + description: "Yağlar, solventler ve diğer kimyasallar.", + isActive: true, + }, + { + id: "5", + code: "YARI-MAMUL", + name: "Yarı Mamuller", + parentGroupId: "1", + isActive: false, + }, + { + id: "6", + code: "MAMUL", + name: "Mamuller", + parentGroupId: "1", + isActive: false, + }, +]; + +// Function to populate the parentGroup field +export function populateParentGroups(groups: MmMaterialGroup[]): MmMaterialGroup[] { + const groupMap = new Map(); + + // First, map each group by their id for quick lookup + groups.forEach((group) => { + groupMap.set(group.id, group); + }); + + // Then, for each group, set the parentGroup if it has a parentGroupId + groups.forEach((group) => { + if (group.parentGroupId) { + group.parentGroup = groupMap.get(group.parentGroupId); + } + }); + + return groups; +} + +// Now you can use the function to populate parentGroup +populateParentGroups(mockMaterialGroups); \ No newline at end of file diff --git a/ui/src/mocks/mockMaterialTypes.ts b/ui/src/mocks/mockMaterialTypes.ts new file mode 100644 index 00000000..a0ce38e8 --- /dev/null +++ b/ui/src/mocks/mockMaterialTypes.ts @@ -0,0 +1,52 @@ +import { MmMaterialType, MaterialTypeEnum } from "../types/mm"; + +export const mockMaterialTypes: MmMaterialType[] = [ + { + id: "1", + code: MaterialTypeEnum.RawMaterial, + name: "Hammadde", + description: "Üretimde kullanılan temel malzemeler", + isActive: true, + className: "bg-blue-100 text-blue-800", + }, + { + id: "2", + code: MaterialTypeEnum.SemiFinished, + name: "Yarı Mamul", + description: "Kısmen işlenmiş ürünler", + isActive: true, + className: "bg-yellow-100 text-yellow-800", + }, + { + id: "3", + code: MaterialTypeEnum.Finished, + name: "Mamul", + description: "Satışa hazır nihai ürünler", + isActive: true, + className: "bg-green-100 text-green-800", + }, + { + id: "4", + code: MaterialTypeEnum.Consumable, + name: "Sarf Malzemesi", + description: "Tüketilen yardımcı malzemeler", + isActive: true, + className: "bg-gray-100 text-gray-800", + }, + { + id: "5", + code: MaterialTypeEnum.Service, + name: "Hizmet", + description: "Hizmet türü kalemler", + isActive: true, + className: "bg-purple-100 text-purple-800", + }, + { + id: "6", + code: MaterialTypeEnum.Spare, + name: "Yedek Parça", + description: "Bakım ve onarım parçaları", + isActive: true, + className: "bg-orange-100 text-orange-800", + }, +]; diff --git a/ui/src/mocks/mockMaterials.ts b/ui/src/mocks/mockMaterials.ts new file mode 100644 index 00000000..e4d16caf --- /dev/null +++ b/ui/src/mocks/mockMaterials.ts @@ -0,0 +1,429 @@ +import { MmMaterial } from "../types/mm"; +import { mockBusinessParties } from "./mockBusinessParties"; +import { mockLocations } from "./mockLocations"; +import { mockMaterialGroups } from "./mockMaterialGroups"; +import { mockMaterialTypes } from "./mockMaterialTypes"; +import { mockUnits } from "./mockUnits"; +import { mockWarehouses } from "./mockWarehouses"; +import { mockZones } from "./mockZones"; + +export const mockMaterials: MmMaterial[] = [ + { + id: "1", + code: "MT001", + name: "Yüksek Kaliteli Çelik Levha 10mm", + description: "Çelik Levha 2mm", + baseUnitId: "KG", + baseUnit: mockUnits.find((u) => u.id === "KG"), + costPrice: 15.5, + salesPrice: 18.75, + currency: "TRY", + isActive: true, + totalStock: 2500.0, + materialTypeId: "1", + materialType: mockMaterialTypes.find((mt) => mt.id === "1"), + materialGroupId: "1", + materialGroup: mockMaterialGroups.find((mg) => mg.id === "1"), + barcode: "1234567890123", + trackingType: "Quantity", + creationTime: new Date("2024-01-15"), + lastModificationTime: new Date("2024-01-20"), + alternativeUnits: [ + { + id: "1", + materialId: "1", + unitId: "KOLI", + unit: mockUnits.find((u) => u.id === "KOLI"), + conversionFactor: 1, + isDefault: true, + }, + { + id: "1", + materialId: "1", + unitId: "PAKET", + unit: mockUnits.find((u) => u.id === "PAKET"), + conversionFactor: 1, + isDefault: false, + }, + ], + stockLevels: [ + { + id: "1", + materialId: "1", + warehouseId: "1", + warehouse: mockWarehouses.find((w) => w.id === "1"), + zoneId: "2", + zone: mockZones.find((z) => z.id === "2"), + locationId: "1", + location: mockLocations.find((l) => l.id === "1"), + availableQuantity: 1250, + reservedQuantity: 200, + inTransitQuantity: 500, + minimumStock: 100, + maximumStock: 2000, + reorderPoint: 300, + lastUpdated: new Date(), + }, + ], + specifications: [ + { + id: "1", + materialId: "1", + specificationName: "Kalınlık", + specificationValue: "2", + unitId: "mm", + isRequired: true, + }, + { + id: "2", + materialId: "1", + specificationName: "Genişlik", + specificationValue: "1000", + unitId: "mm", + isRequired: true, + }, + { + id: "3", + materialId: "1", + specificationName: "Uzunluk", + specificationValue: "2000", + unitId: "mm", + isRequired: true, + }, + ], + suppliers: [ + { + id: "1", + materialId: "1", + supplierId: "1", + supplier: mockBusinessParties.find((bp) => bp.id === "1"), + supplierMaterialCode: "S-MAT-001", + leadTime: 7, + minimumOrderQuantity: 100, + price: 24.0, + currency: "TRY", + isPreferred: true, + }, + ], + }, + { + id: "2", + code: "MT002", + name: "Alüminyum Profil 40x40", + description: "Alüminyum Profil 40x40", + materialTypeId: "2", + materialType: mockMaterialTypes.find((mt) => mt.id === "2"), + baseUnitId: "MT", + baseUnit: mockUnits.find((u) => u.id === "MT"), + costPrice: 45.0, + salesPrice: 55.0, + currency: "TRY", + isActive: true, + totalStock: 1200.0, + creationTime: new Date("2024-01-15"), + lastModificationTime: new Date("2024-01-20"), + materialGroupId: "1", + materialGroup: mockMaterialGroups.find((mg) => mg.id === "1"), + trackingType: "Lot", + barcode: "1234567890124", + stockLevels: [ + { + id: "2", + materialId: "2", + warehouseId: "1", + warehouse: mockWarehouses.find((w) => w.id === "1"), + zoneId: "2", + zone: mockZones.find((z) => z.id === "2"), + locationId: "2", + location: mockLocations.find((l) => l.id === "2"), + availableQuantity: 800, + reservedQuantity: 150, + inTransitQuantity: 200, + minimumStock: 50, + maximumStock: 1500, + reorderPoint: 200, + lastUpdated: new Date(), + }, + ], + specifications: [ + { + id: "4", + materialId: "2", + specificationName: "Genişlik", + specificationValue: "40", + unitId: "mm", + isRequired: true, + }, + { + id: "5", + materialId: "2", + specificationName: "Yükseklik", + specificationValue: "40", + unitId: "mm", + isRequired: true, + }, + { + id: "6", + materialId: "2", + specificationName: "Alaşım", + specificationValue: "6061", + unitId: "", + isRequired: true, + }, + ], + suppliers: [ + { + id: "2", + materialId: "2", + supplierId: "2", + supplier: mockBusinessParties.find((bp) => bp.id === "2"), + supplierMaterialCode: "S-ALU-002", + leadTime: 10, + minimumOrderQuantity: 50, + price: 42.0, + currency: "TRY", + isPreferred: true, + }, + ], + }, + { + id: "3", + code: "PR001", + name: "Montajlı Motor Grubu A-Type", + description: "Motor Grubu A-Type", + materialTypeId: "1", + materialType: mockMaterialTypes.find((mt) => mt.id === "1"), + baseUnitId: "AD", + baseUnit: mockUnits.find((u) => u.id === "AD"), + costPrice: 850.0, + salesPrice: 1200.0, + currency: "TRY", + isActive: true, + totalStock: 45.0, + creationTime: new Date("2024-01-15"), + lastModificationTime: new Date("2024-01-20"), + materialGroupId: "2", + materialGroup: mockMaterialGroups.find((mg) => mg.id === "2"), + trackingType: "Lot", + barcode: "1234567890125", + stockLevels: [ + { + id: "3", + materialId: "3", + warehouseId: "1", + warehouse: mockWarehouses.find((w) => w.id === "1"), + zoneId: "1", + zone: mockZones.find((z) => z.id === "1"), + locationId: "3", + location: mockLocations.find((l) => l.id === "3"), + availableQuantity: 30, + reservedQuantity: 10, + inTransitQuantity: 5, + minimumStock: 5, + maximumStock: 100, + reorderPoint: 15, + lastUpdated: new Date(), + }, + ], + specifications: [ + { + id: "7", + materialId: "3", + specificationName: "Güç", + specificationValue: "5.5", + unitId: "kW", + isRequired: true, + }, + { + id: "8", + materialId: "3", + specificationName: "Devir", + specificationValue: "1450", + unitId: "rpm", + isRequired: true, + }, + { + id: "9", + materialId: "3", + specificationName: "Voltaj", + specificationValue: "380", + unitId: "V", + isRequired: true, + }, + ], + suppliers: [ + { + id: "3", + materialId: "3", + supplierId: "3", + supplier: mockBusinessParties.find((bp) => bp.id === "3"), + supplierMaterialCode: "S-MOT-003", + leadTime: 21, + minimumOrderQuantity: 1, + price: 800.0, + currency: "TRY", + isPreferred: true, + }, + ], + }, + { + id: "4", + code: "SF001", + name: "Kesme Yağı Premium", + description: "Kesme Yağı Premium", + materialTypeId: "1", + materialType: mockMaterialTypes.find((mt) => mt.id === "1"), + baseUnitId: "LT", + baseUnit: mockUnits.find((u) => u.id === "LT"), + costPrice: 25.0, + salesPrice: 35.0, + currency: "TRY", + isActive: true, + totalStock: 150.0, + creationTime: new Date("2024-01-15"), + lastModificationTime: new Date("2024-01-20"), + materialGroupId: "4", + materialGroup: mockMaterialGroups.find((mg) => mg.id === "4"), + trackingType: "Quantity", + barcode: "1234567890126", + stockLevels: [ + { + id: "4", + materialId: "4", + warehouseId: "2", + warehouse: mockWarehouses.find((w) => w.id === "2"), + zoneId: "1", + zone: mockZones.find((z) => z.id === "1"), + locationId: "4", + location: mockLocations.find((l) => l.id === "4"), + availableQuantity: 120, + reservedQuantity: 20, + inTransitQuantity: 10, + minimumStock: 25, + maximumStock: 300, + reorderPoint: 50, + lastUpdated: new Date(), + }, + ], + specifications: [ + { + id: "10", + materialId: "4", + specificationName: "Viskozite", + specificationValue: "32", + unitId: "cSt", + isRequired: true, + }, + { + id: "11", + materialId: "4", + specificationName: "Yoğunluk", + specificationValue: "0.85", + unitId: "g/cm³", + isRequired: true, + }, + { + id: "12", + materialId: "4", + specificationName: "Parlama Noktası", + specificationValue: "210", + unitId: "°C", + isRequired: true, + }, + ], + suppliers: [ + { + id: "4", + materialId: "4", + supplierId: "3", + supplier: mockBusinessParties.find((bp) => bp.id === "3"), + supplierMaterialCode: "S-OIL-004", + leadTime: 5, + minimumOrderQuantity: 20, + price: 22.0, + currency: "TRY", + isPreferred: true, + }, + ], + }, + { + id: "5", + code: "PK001", + name: "Plastik Kapak Komponenti", + description: "Plastik Kapak", + materialTypeId: "1", + materialType: mockMaterialTypes.find((mt) => mt.id === "1"), + materialGroupId: "5", + materialGroup: mockMaterialGroups.find((mg) => mg.id === "5"), + baseUnitId: "AD", + baseUnit: mockUnits.find((u) => u.id === "AD"), + costPrice: 8.5, + salesPrice: 15.0, + currency: "TRY", + isActive: true, + totalStock: 850.0, + creationTime: new Date("2024-01-15"), + lastModificationTime: new Date("2024-01-20"), + trackingType: "Serial", + barcode: "1234567890127", + stockLevels: [ + { + id: "5", + materialId: "5", + warehouseId: "2", + warehouse: mockWarehouses.find((w) => w.id === "2"), + zoneId: "3", + zone: mockZones.find((z) => z.id === "3"), + locationId: "4", + location: mockLocations.find((l) => l.id === "4"), + availableQuantity: 750, + reservedQuantity: 50, + inTransitQuantity: 50, + minimumStock: 100, + maximumStock: 1000, + reorderPoint: 200, + lastUpdated: new Date(), + }, + ], + specifications: [ + { + id: "13", + materialId: "5", + specificationName: "Malzeme", + specificationValue: "PP Polypropylene", + unitId: "", + isRequired: true, + }, + { + id: "14", + materialId: "5", + specificationName: "Ağırlık", + specificationValue: "5.2", + unitId: "kg", + isRequired: true, + }, + { + id: "15", + materialId: "5", + specificationName: "Boyut", + specificationValue: "300x200x50", + unitId: "mm", + isRequired: true, + }, + ], + suppliers: [ + { + id: "5", + materialId: "5", + supplierId: "2", + supplier: mockBusinessParties.find((bp) => bp.id === "2"), + supplierMaterialCode: "S-SEM-005", + leadTime: 14, + minimumOrderQuantity: 5, + price: 110.0, + currency: "TRY", + isPreferred: true, + }, + ], + }, +]; diff --git a/ui/src/mocks/mockOperationTypes.ts b/ui/src/mocks/mockOperationTypes.ts new file mode 100644 index 00000000..ed655c42 --- /dev/null +++ b/ui/src/mocks/mockOperationTypes.ts @@ -0,0 +1,79 @@ +import { OperationCategoryEnum, MrpOperationTypeDefinition } from "../types/mrp"; + +export const mockOperationTypes: MrpOperationTypeDefinition[] = [ + { + id: "1", + code: "CUT001", + name: "Kesme İşlemi", + description: "Malzeme kesme operasyonu", + category: OperationCategoryEnum.Production, + defaultDuration: 30, + requiresSetup: true, + allowsParallelOperation: false, + qualityCheckRequired: true, + skillLevelRequired: 3, + isActive: true, + creationTime: new Date(), + lastModificationTime: new Date(), + }, + { + id: "2", + code: "WELD001", + name: "Kaynak İşlemi", + description: "Metal kaynak operasyonu", + category: OperationCategoryEnum.Maintenance, + defaultDuration: 45, + requiresSetup: true, + allowsParallelOperation: false, + qualityCheckRequired: true, + skillLevelRequired: 4, + isActive: true, + creationTime: new Date(), + lastModificationTime: new Date(), + }, + { + id: "3", + code: "ASSY001", + name: "Montaj İşlemi", + description: "Parça montaj operasyonu", + category: OperationCategoryEnum.Production, + defaultDuration: 20, + requiresSetup: false, + allowsParallelOperation: true, + qualityCheckRequired: false, + skillLevelRequired: 2, + isActive: true, + creationTime: new Date(), + lastModificationTime: new Date(), + }, + { + id: "4", + code: "QC001", + name: "Kalite Kontrolü", + description: "Ürün kalite kontrol işlemi", + category: OperationCategoryEnum.Quality, + defaultDuration: 15, + requiresSetup: false, + allowsParallelOperation: false, + qualityCheckRequired: true, + skillLevelRequired: 3, + isActive: true, + creationTime: new Date(), + lastModificationTime: new Date(), + }, + { + id: "5", + code: "PACK001", + name: "Paketleme", + description: "Ürün paketleme işlemi", + category: OperationCategoryEnum.Setup, + defaultDuration: 10, + requiresSetup: false, + allowsParallelOperation: true, + qualityCheckRequired: false, + skillLevelRequired: 1, + isActive: true, + creationTime: new Date(), + lastModificationTime: new Date(), + }, +]; diff --git a/ui/src/mocks/mockOperations.ts b/ui/src/mocks/mockOperations.ts new file mode 100644 index 00000000..c129f55a --- /dev/null +++ b/ui/src/mocks/mockOperations.ts @@ -0,0 +1,106 @@ +import { MrpOperation } from "../types/mrp"; +import { mockWorkCenters } from "./mockWorkCenters"; +import { mockOperationTypes } from "./mockOperationTypes"; + +export const mockOperations: MrpOperation[] = [ + { + id: "1", + code: "OP001", + name: "CNC Torna Tezgahı İşlemi", + description: "Metal parçaların CNC torna tezgahında işlenmesi", + operationTypeId: "1", + operationType: mockOperationTypes.find((ot) => ot.code === "1"), + workCenterId: "1", + workCenter: mockWorkCenters.find((wc) => wc.id === "1"), + standardTime: 45, + setupTime: 30, + laborCost: 50, + machineCost: 100, + overheadCost: 25, + isActive: true, + instructions: "Torna tezgahında hassas işleme yapılacak", + qualityCheckRequired: true, + creationTime: new Date(), + lastModificationTime: new Date(), + }, + { + id: "2", + code: "OP002", + name: "Kaynak İşlemi", + description: "Argon kaynak ile metal birleştirme", + operationTypeId: "2", + operationType: mockOperationTypes.find((ot) => ot.code === "2"), + workCenterId: "2", + workCenter: mockWorkCenters.find((wc) => wc.id === "2"), + standardTime: 60, + setupTime: 15, + laborCost: 80, + machineCost: 40, + overheadCost: 20, + isActive: true, + instructions: "Argon gazı ile koruyucu atmosferde kaynak yapılacak", + qualityCheckRequired: true, + creationTime: new Date(), + lastModificationTime: new Date(), + }, + { + id: "3", + code: "OP003", + name: "Kalite Kontrolü", + description: "Boyutsal ve görsel kalite kontrolü", + operationTypeId: "3", + operationType: mockOperationTypes.find((ot) => ot.code === "3"), + workCenterId: "3", + workCenter: mockWorkCenters.find((wc) => wc.id === "3"), + standardTime: 20, + setupTime: 5, + laborCost: 60, + machineCost: 20, + overheadCost: 10, + isActive: true, + instructions: "Teknik çizimlere göre boyutsal kontrol yapılacak", + qualityCheckRequired: false, + creationTime: new Date(), + lastModificationTime: new Date(), + }, + { + id: "4", + code: "OP004", + name: "Paketleme İşlemi", + description: "Ürünlerin paketlenmesi", + operationTypeId: "4", + operationType: mockOperationTypes.find((ot) => ot.code === "4"), + workCenterId: "4", + workCenter: mockWorkCenters.find((wc) => wc.id === "4"), + standardTime: 20, + setupTime: 5, + laborCost: 60, + machineCost: 20, + overheadCost: 10, + isActive: true, + instructions: "Teknik çizimlere göre boyutsal kontrol yapılacak", + qualityCheckRequired: false, + creationTime: new Date(), + lastModificationTime: new Date(), + }, + { + id: "5", + code: "OP005", + name: "Bakım İşlemi", + description: "Preventif bakım işlemleri", + operationTypeId: "5", + operationType: mockOperationTypes.find((ot) => ot.code === "5"), + workCenterId: "3", + workCenter: mockWorkCenters.find((wc) => wc.id === "3"), + standardTime: 120, + setupTime: 20, + laborCost: 70, + machineCost: 30, + overheadCost: 20, + isActive: true, + instructions: "Periyodik bakım planına göre işlem yapılacak", + qualityCheckRequired: false, + creationTime: new Date(), + lastModificationTime: new Date(), + }, +]; diff --git a/ui/src/mocks/mockOpportunities.ts b/ui/src/mocks/mockOpportunities.ts new file mode 100644 index 00000000..1ff25525 --- /dev/null +++ b/ui/src/mocks/mockOpportunities.ts @@ -0,0 +1,56 @@ +import { + LeadSourceEnum, + CrmOpportunity, + OpportunityStageEnum, + OpportunityStatusEnum, +} from "../types/crm"; +import { mockBusinessParties } from "./mockBusinessParties"; +import { mockEmployees } from "./mockEmployees"; +import { mockLossReasons } from "./mockLossReasons"; + +export const mockOpportunities: CrmOpportunity[] = [ + { + id: "opp1", + opportunityNumber: "OPP-2024-001", + title: "ABC Şirketi Yazılım Projesi", + customerId: "5", + customer: mockBusinessParties.find((c) => c.id === "5"), + stage: OpportunityStageEnum.ClosedLost, + probability: 0, + estimatedValue: 150000, + currency: "TRY", + expectedCloseDate: new Date("2024-03-15"), + assignedTo: "1", + assigned: mockEmployees.find((e) => e.id === "1"), + leadSource: LeadSourceEnum.Website, + status: OpportunityStatusEnum.Lost, + lostReason: mockLossReasons[0], + activities: [], + quotes: [], + competitors: [], + creationTime: new Date("2024-01-10"), + lastModificationTime: new Date("2024-03-15"), + }, + { + id: "opp2", + opportunityNumber: "OPP-2024-002", + title: "XYZ Kurumu ERP Sistemi", + customerId: "6", + customer: mockBusinessParties.find((c) => c.id === "6"), + stage: OpportunityStageEnum.ClosedLost, + probability: 0, + estimatedValue: 300000, + currency: "TRY", + expectedCloseDate: new Date("2024-04-20"), + assignedTo: "2", + assigned: mockEmployees.find((e) => e.id === "2"), + leadSource: LeadSourceEnum.Referral, + status: OpportunityStatusEnum.Lost, + lostReason: mockLossReasons[1], + activities: [], + quotes: [], + competitors: [], + creationTime: new Date("2024-02-05"), + lastModificationTime: new Date("2024-04-20"), + }, +]; diff --git a/ui/src/mocks/mockOvertimes.ts b/ui/src/mocks/mockOvertimes.ts new file mode 100644 index 00000000..a227b437 --- /dev/null +++ b/ui/src/mocks/mockOvertimes.ts @@ -0,0 +1,151 @@ +import { HrOvertime, LeaveStatusEnum } from "../types/hr"; + +export const mockOvertimes: HrOvertime[] = [ + { + id: "1", + employeeId: "1", + date: new Date("2024-12-15"), + startTime: "18:00", + endTime: "21:00", + totalHours: 3, + reason: "Proje deadline'ı nedeniyle acil çalışma", + status: LeaveStatusEnum.Approved, + approvedBy: "emp_002", + rate: 1.5, + amount: 450, // 3 saat * 100 TL/saat * 1.5 kat + creationTime: new Date("2024-12-15T09:00:00"), + lastModificationTime: new Date("2024-12-15T10:30:00"), + }, + { + id: "2", + employeeId: "3", + date: new Date("2024-12-14"), + startTime: "17:30", + endTime: "20:00", + totalHours: 2.5, + reason: "Müşteri talep değişikliği nedeniyle ek çalışma", + status: LeaveStatusEnum.Pending, + rate: 1.5, + amount: 375, // 2.5 saat * 100 TL/saat * 1.5 kat + creationTime: new Date("2024-12-14T17:30:00"), + lastModificationTime: new Date("2024-12-14T17:30:00"), + }, + { + id: "3", + employeeId: "4", + date: new Date("2024-12-13"), + startTime: "19:00", + endTime: "22:30", + totalHours: 3.5, + reason: "Sistem bakımı ve güncelleme çalışmaları", + status: LeaveStatusEnum.Approved, + approvedBy: "emp_002", + rate: 1.5, + amount: 525, // 3.5 saat * 100 TL/saat * 1.5 kat + creationTime: new Date("2024-12-13T19:00:00"), + lastModificationTime: new Date("2024-12-13T22:35:00"), + }, + { + id: "4", + employeeId: "5", + date: new Date("2024-12-12"), + startTime: "17:00", + endTime: "19:00", + totalHours: 2, + reason: "Rapor hazırlama ve sunum düzenleme", + status: LeaveStatusEnum.Rejected, + approvedBy: "emp_002", + rate: 1.5, + amount: 0, // Reddedildiği için ücret hesaplanmadı + creationTime: new Date("2024-12-12T17:00:00"), + lastModificationTime: new Date("2024-12-12T08:30:00"), + }, + { + id: "5", + employeeId: "6", + date: new Date("2024-12-11"), + startTime: "18:30", + endTime: "21:00", + totalHours: 2.5, + reason: "Acil hata düzeltme ve test çalışmaları", + status: LeaveStatusEnum.Approved, + approvedBy: "emp_001", + rate: 2.0, // Hafta sonu çalışması + amount: 500, // 2.5 saat * 100 TL/saat * 2.0 kat + creationTime: new Date("2024-12-11T18:30:00"), + lastModificationTime: new Date("2024-12-11T21:05:00"), + }, + { + id: "6", + employeeId: "7", + date: new Date("2024-12-10"), + startTime: "16:00", + endTime: "20:00", + totalHours: 4, + reason: "Yeni müşteri onboarding süreci", + status: LeaveStatusEnum.Pending, + rate: 1.5, + amount: 600, // 4 saat * 100 TL/saat * 1.5 kat + creationTime: new Date("2024-12-10T16:00:00"), + lastModificationTime: new Date("2024-12-10T16:00:00"), + }, + { + id: "7", + employeeId: "8", + date: new Date("2024-12-09"), + startTime: "17:45", + endTime: "21:15", + totalHours: 3.5, + reason: "Veri analizi ve raporlama çalışmaları", + status: LeaveStatusEnum.Approved, + approvedBy: "emp_002", + rate: 1.5, + amount: 525, // 3.5 saat * 100 TL/saat * 1.5 kat + creationTime: new Date("2024-12-09T17:45:00"), + lastModificationTime: new Date("2024-12-09T21:20:00"), + }, + { + id: "8", + employeeId: "9", + date: new Date("2024-12-08"), + startTime: "18:00", + endTime: "20:30", + totalHours: 2.5, + reason: "Eğitim materyali hazırlama", + status: LeaveStatusEnum.Pending, + rate: 1.5, + amount: 375, // 2.5 saat * 100 TL/saat * 1.5 kat + creationTime: new Date("2024-12-08T18:00:00"), + lastModificationTime: new Date("2024-12-08T18:00:00"), + }, + { + id: "9", + employeeId: "10", + date: new Date("2024-12-07"), + startTime: "19:30", + endTime: "23:00", + totalHours: 3.5, + reason: "Kritik sistem güvenlik yaması uygulaması", + status: LeaveStatusEnum.Approved, + approvedBy: "emp_001", + rate: 1.5, + amount: 525, // 3.5 saat * 100 TL/saat * 1.5 kat + creationTime: new Date("2024-12-07T19:30:00"), + lastModificationTime: new Date("2024-12-07T23:05:00"), + }, + { + id: "10", + employeeId: "1", + date: new Date("2024-12-06"), + startTime: "17:30", + endTime: "20:00", + totalHours: 2.5, + reason: "Stratejik planlama toplantısı hazırlığı", + status: LeaveStatusEnum.Rejected, + approvedBy: "emp_002", + rate: 1.5, + amount: 0, // Reddedildiği için ücret hesaplanmadı + creationTime: new Date("2024-12-06T17:30:00"), + lastModificationTime: new Date("2024-12-06T08:15:00"), + }, +]; diff --git a/ui/src/mocks/mockPayrolls.ts b/ui/src/mocks/mockPayrolls.ts new file mode 100644 index 00000000..6b278cd7 --- /dev/null +++ b/ui/src/mocks/mockPayrolls.ts @@ -0,0 +1,95 @@ +import { HrPayroll, PayrollStatusEnum } from "../types/hr"; +import { mockEmployees } from "./mockEmployees"; + +export const mockPayrolls: HrPayroll[] = [ + { + id: "1", + employeeId: "1", + employee: mockEmployees.find((emp) => emp.id === "1"), + period: "2023-01", + baseSalary: 3000, + allowances: [], + deductions: [], + overtime: 0, + bonus: 0, + grossSalary: 0, + netSalary: 0, + tax: 0, + socialSecurity: 0, + status: PayrollStatusEnum.Cancelled, + creationTime: new Date(), + lastModificationTime: new Date(), + }, + { + id: "2", + employeeId: "2", + employee: mockEmployees.find((emp) => emp.id === "2"), + period: "2023-01", + baseSalary: 3200, + allowances: [], + deductions: [], + overtime: 0, + bonus: 0, + grossSalary: 0, + netSalary: 0, + tax: 0, + socialSecurity: 0, + status: PayrollStatusEnum.Paid, + creationTime: new Date(), + lastModificationTime: new Date(), + }, + { + id: "3", + employeeId: "3", + employee: mockEmployees.find((emp) => emp.id === "3"), + period: "2023-01", + baseSalary: 2800, + allowances: [], + deductions: [], + overtime: 0, + bonus: 0, + grossSalary: 0, + netSalary: 0, + tax: 0, + socialSecurity: 0, + status: PayrollStatusEnum.Approved, + creationTime: new Date(), + lastModificationTime: new Date(), + }, + { + id: "4", + employeeId: "4", + employee: mockEmployees.find((emp) => emp.id === "4"), + period: "2023-01", + baseSalary: 3500, + allowances: [], + deductions: [], + overtime: 0, + bonus: 0, + grossSalary: 0, + netSalary: 0, + tax: 0, + socialSecurity: 0, + status: PayrollStatusEnum.Calculated, + creationTime: new Date(), + lastModificationTime: new Date(), + }, + { + id: "5", + employeeId: "4", + employee: mockEmployees.find((emp) => emp.id === "4"), + period: "2023-01", + baseSalary: 4000, + allowances: [], + deductions: [], + overtime: 0, + bonus: 0, + grossSalary: 0, + netSalary: 0, + tax: 0, + socialSecurity: 0, + status: PayrollStatusEnum.Draft, + creationTime: new Date(), + lastModificationTime: new Date(), + }, +]; diff --git a/ui/src/mocks/mockProductionOrders.ts b/ui/src/mocks/mockProductionOrders.ts new file mode 100644 index 00000000..911917f9 --- /dev/null +++ b/ui/src/mocks/mockProductionOrders.ts @@ -0,0 +1,84 @@ +import { PriorityEnum } from "../types/common"; +import { + MrpProductionOrder, + ProductionOrderStatusEnum, + ProductionOrderTypeEnum, +} from "../types/mrp"; +import { mockMaterials } from "./mockMaterials"; +import { mockSalesOrders } from "./mockSalesOrders"; + +export const mockProductionOrders: MrpProductionOrder[] = [ + { + id: "1", + orderNumber: "PO-2024-001", + orderType: ProductionOrderTypeEnum.Standard, + plannedStartDate: new Date("2024-01-15"), + plannedEndDate: new Date("2024-01-30"), + actualStartDate: new Date("2024-01-16"), + status: ProductionOrderStatusEnum.InProgress, + priority: PriorityEnum.High, + plannedQuantity: 100, + confirmedQuantity: 65, + requiredQuantity: 100, + scrapQuantity: 2, + unitId: "ADET", + plannedCost: 125000, + actualCost: 82000, + currency: "TRY", + materials: [ + { + id: "1", + productionOrderId: "1", + materialId: "2", + material: mockMaterials.find((m) => m.id === "2")!, + salesOrderId: "1", + salesOrder: mockSalesOrders.find((so) => so.id === "1"), + customerRequirement: "Acil teslimat gerekli", + plannedQuantity: 100, + confirmedQuantity: 65, + requiredQuantity: 100, + scrapQuantity: 2, + unitId: "ADET", + }, + ], + workOrders: [], + creationTime: new Date("2024-01-10"), + lastModificationTime: new Date("2024-01-20"), + }, + { + id: "2", + orderNumber: "PO-2024-002", + orderType: ProductionOrderTypeEnum.Standard, + plannedStartDate: new Date("2024-02-01"), + plannedEndDate: new Date("2024-02-15"), + status: ProductionOrderStatusEnum.Created, + priority: PriorityEnum.Normal, + plannedQuantity: 50, + confirmedQuantity: 0, + requiredQuantity: 50, + scrapQuantity: 1, + unitId: "ADET", + plannedCost: 75000, + actualCost: 0, + currency: "TRY", + materials: [ + { + id: "1", + productionOrderId: "1", + materialId: "3", + material: mockMaterials.find((m) => m.id === "3")!, + salesOrderId: "1", + salesOrder: mockSalesOrders.find((so) => so.id === "1"), + customerRequirement: "Acil teslimat gerekli", + plannedQuantity: 50, + confirmedQuantity: 0, + requiredQuantity: 0, + scrapQuantity: 2, + unitId: "ADET", + }, + ], + workOrders: [], + creationTime: new Date("2024-01-25"), + lastModificationTime: new Date("2024-01-25"), + }, +]; diff --git a/ui/src/mocks/mockProjectCostTracking.ts b/ui/src/mocks/mockProjectCostTracking.ts new file mode 100644 index 00000000..cbaec6a8 --- /dev/null +++ b/ui/src/mocks/mockProjectCostTracking.ts @@ -0,0 +1,80 @@ +import { PsProjectCostTracking } from "../types/ps"; + +export const mockProjectCostTracking: PsProjectCostTracking[] = [ + { + id: "1", + projectId: "1", + projectName: "ERP Sistemi Geliştirme", + projectCode: "PRJ-2024-001", + plannedBudget: 500000, + actualCost: 325000, + remainingBudget: 175000, + plannedStartDate: new Date("2024-01-15"), + plannedEndDate: new Date("2024-12-31"), + actualStartDate: new Date("2024-01-20"), + actualEndDate: undefined, + plannedDuration: 351, + actualDuration: 300, + progress: 65, + status: "ON_TRACK", + currency: "TRY", + lastUpdated: new Date("2024-11-25"), + }, + { + id: "2", + projectId: "2", + projectName: "Mobil Uygulama Geliştirme", + projectCode: "PRJ-2024-002", + plannedBudget: 250000, + actualCost: 200000, + remainingBudget: 50000, + plannedStartDate: new Date("2024-03-01"), + plannedEndDate: new Date("2024-08-31"), + actualStartDate: new Date("2024-03-15"), + actualEndDate: undefined, + plannedDuration: 184, + actualDuration: 200, + progress: 80, + status: "AT_RISK", + currency: "TRY", + lastUpdated: new Date("2024-11-20"), + }, + { + id: "3", + projectId: "3", + projectName: "Web Sitesi Yenileme", + projectCode: "PRJ-2024-003", + plannedBudget: 150000, + actualCost: 180000, + remainingBudget: -30000, + plannedStartDate: new Date("2024-02-01"), + plannedEndDate: new Date("2024-06-30"), + actualStartDate: new Date("2024-02-10"), + actualEndDate: new Date("2024-07-15"), + plannedDuration: 150, + actualDuration: 156, + progress: 100, + status: "COMPLETED", + currency: "TRY", + lastUpdated: new Date("2024-07-15"), + }, + { + id: "4", + projectId: "4", + projectName: "Veri Analizi Platformu", + projectCode: "PRJ-2024-004", + plannedBudget: 400000, + actualCost: 120000, + remainingBudget: 280000, + plannedStartDate: new Date("2024-06-01"), + plannedEndDate: new Date("2024-12-31"), + actualStartDate: new Date("2024-06-15"), + actualEndDate: undefined, + plannedDuration: 214, + actualDuration: 163, + progress: 30, + status: "DELAYED", + currency: "TRY", + lastUpdated: new Date("2024-11-22"), + }, + ]; \ No newline at end of file diff --git a/ui/src/mocks/mockProjectPhases.ts b/ui/src/mocks/mockProjectPhases.ts new file mode 100644 index 00000000..e8285ea0 --- /dev/null +++ b/ui/src/mocks/mockProjectPhases.ts @@ -0,0 +1,180 @@ +import { PhaseStatusEnum, PsProjectPhase } from "../types/ps"; +import { mockMaintenanceTeams } from "./mockMaintenanceTeams"; +import { mockProjects } from "./mockProjects"; + +export const mockProjectPhases: PsProjectPhase[] = [ + { + id: "1", + code: "PH-001", + name: "Analiz ve Tasarım", + description: "Sistem analizi ve tasarım dokümantasyonu hazırlanması", + projectId: "1", + project: mockProjects.find((p) => p.id === "1")!, + status: PhaseStatusEnum.Completed, + startDate: new Date("2024-01-15"), + endDate: new Date("2024-02-28"), + actualStartDate: new Date("2024-01-15"), + actualEndDate: new Date("2024-02-25"), + budget: 150000, + actualCost: 145000, + progress: 100, + milestones: 4, + completedMilestones: 4, + assignedTeams: [ + mockMaintenanceTeams.find((t) => t.id === "1")!.name, + mockMaintenanceTeams.find((t) => t.id === "2")!.name, + ], + deliverables: [ + "Sistem Analiz Raporu", + "Teknik Tasarım Dokümanı", + "UI/UX Tasarımları", + ], + risks: ["Gereksinim değişiklikleri"], + category: "Planning", + sequence: 0, + tasks: [], + isActive: false, + }, + { + id: "2", + code: "PH-002", + name: "Geliştirme - Faz 1", + description: "Backend altyapısı ve temel modüllerin geliştirilmesi", + projectId: "1", + project: mockProjects.find((p) => p.id === "1")!, + status: PhaseStatusEnum.Cancelled, + startDate: new Date("2024-03-01"), + endDate: new Date("2024-05-15"), + actualStartDate: new Date("2024-03-01"), + actualEndDate: new Date("2024-05-10"), + budget: 400000, + actualCost: 280000, + progress: 70, + milestones: 6, + completedMilestones: 4, + assignedTeams: [ + mockMaintenanceTeams.find((t) => t.id === "1")!.name, + mockMaintenanceTeams.find((t) => t.id === "2")!.name, + ], + deliverables: ["API Framework", "Veritabanı Şeması", "Güvenlik Modülü"], + risks: ["Performans sorunları", "Üçüncü parti entegrasyon gecikmeleri"], + category: "Development", + sequence: 0, + tasks: [], + isActive: false, + }, + { + id: "3", + code: "PH-003", + name: "Geliştirme - Faz 2", + description: "Frontend geliştirme ve kullanıcı arayüzleri", + projectId: "1", + project: mockProjects.find((p) => p.id === "1")!, + status: PhaseStatusEnum.NotStarted, + startDate: new Date("2024-04-15"), + endDate: new Date("2024-07-30"), + budget: 350000, + actualCost: 0, + progress: 0, + milestones: 5, + completedMilestones: 0, + assignedTeams: [ + mockMaintenanceTeams.find((t) => t.id === "1")!.name, + mockMaintenanceTeams.find((t) => t.id === "2")!.name, + ], + deliverables: [ + "React Bileşenleri", + "Responsive Tasarım", + "Mobil Uyumluluk", + ], + risks: ["Tarayıcı uyumluluk sorunları", "Performans optimizasyonu"], + category: "Development", + sequence: 0, + tasks: [], + isActive: false, + }, + { + id: "4", + code: "PH-004", + name: "Test ve Kalite Güvence", + description: "Kapsamlı test süreçleri ve kalite kontrolleri", + projectId: "2", + project: mockProjects.find((p) => p.id === "2")!, + status: PhaseStatusEnum.NotStarted, + startDate: new Date("2024-07-01"), + endDate: new Date("2024-09-15"), + budget: 120000, + actualCost: 0, + progress: 0, + milestones: 3, + completedMilestones: 0, + assignedTeams: [ + mockMaintenanceTeams.find((t) => t.id === "3")!.name, + mockMaintenanceTeams.find((t) => t.id === "4")!.name, + ], + deliverables: [ + "Test Senaryoları", + "Otomatik Test Süitleri", + "Kalite Raporu", + ], + risks: ["Kritik hataların geç tespit edilmesi"], + category: "Testing", + sequence: 0, + tasks: [], + isActive: false, + }, + { + id: "5", + code: "PH-005", + name: "Deployment ve Go-Live", + description: "Üretime alma ve kullanıcı eğitimleri", + projectId: "2", + project: mockProjects.find((p) => p.id === "2")!, + status: PhaseStatusEnum.NotStarted, + startDate: new Date("2024-09-15"), + endDate: new Date("2024-10-31"), + budget: 80000, + actualCost: 0, + progress: 0, + milestones: 2, + completedMilestones: 0, + assignedTeams: [ + mockMaintenanceTeams.find((t) => t.id === "2")!.name, + mockMaintenanceTeams.find((t) => t.id === "4")!.name, + ], + deliverables: [ + "Prodüksiyon Ortamı", + "Kullanıcı Eğitimleri", + "Dokümentasyon", + ], + risks: ["Sistem kesintileri", "Kullanıcı adaptasyon sorunları"], + category: "Deployment", + sequence: 0, + tasks: [], + isActive: false, + }, + { + id: "6", + code: "PH-006", + name: "Mobil UI Tasarımı", + description: "Mobil uygulama kullanıcı arayüzü tasarımı", + projectId: "2", + project: mockProjects.find((p) => p.id === "2")!, + status: PhaseStatusEnum.OnHold, + startDate: new Date("2024-03-01"), + endDate: new Date("2024-04-15"), + actualStartDate: new Date("2024-03-05"), + budget: 75000, + actualCost: 25000, + progress: 35, + milestones: 3, + completedMilestones: 1, + assignedTeams: [mockMaintenanceTeams.find((t) => t.id === "1")!.name], + deliverables: ["Wireframe'ler", "Mobil Tasarım Kılavuzu", "Prototype"], + risks: ["Platformlar arası tutarlılık sorunları"], + category: "Design", + sequence: 0, + tasks: [], + isActive: false, + }, +]; diff --git a/ui/src/mocks/mockProjectTaskDailyUpdates.ts b/ui/src/mocks/mockProjectTaskDailyUpdates.ts new file mode 100644 index 00000000..25b771e9 --- /dev/null +++ b/ui/src/mocks/mockProjectTaskDailyUpdates.ts @@ -0,0 +1,158 @@ +import { + PsTaskDailyUpdate, + WorkTypeEnum, + DailyUpdateStatusEnum, +} from "../types/ps"; +import { mockEmployees } from "./mockEmployees"; +import { mockProjectTasks } from "./mockProjectTasks"; + +export const mockProjectTaskDailyUpdates: PsTaskDailyUpdate[] = [ + { + id: "1", + taskId: "1", + task: mockProjectTasks.find((t) => t.id === "1"), + employeeId: "1", + employee: mockEmployees.find((e) => e.id === "1"), + date: new Date("2024-12-05"), + hoursWorked: 6, + description: + "Backend API geliştirme işleri tamamlandı. User authentication servisleri oluşturuldu.", + workType: WorkTypeEnum.Development, + progress: 75, + challenges: "OAuth2 entegrasyonunda bazı sorunlar yaşandı", + nextSteps: "Token yenileme mekanizması geliştirilecek", + status: DailyUpdateStatusEnum.Submitted, + attachments: [], + creationTime: new Date("2024-12-05T17:30:00"), + lastModificationTime: new Date("2024-12-05T17:30:00"), + }, + { + id: "2", + taskId: "1", + task: mockProjectTasks.find((t) => t.id === "1"), + employeeId: "1", + employee: mockEmployees.find((e) => e.id === "1"), + date: new Date("2024-12-04"), + hoursWorked: 7, + description: "Database şema tasarımı ve migration scriptleri hazırlandı.", + workType: WorkTypeEnum.Development, + progress: 60, + challenges: "Performans optimizasyonu için index stratejileri belirlendi", + nextSteps: "API endpoint'leri geliştirilmeye başlanacak", + status: DailyUpdateStatusEnum.Approved, + attachments: [], + creationTime: new Date("2024-12-04T18:00:00"), + lastModificationTime: new Date("2024-12-04T18:00:00"), + }, + { + id: "3", + taskId: "2", + task: mockProjectTasks.find((t) => t.id === "2"), + employeeId: "2", + employee: mockEmployees.find((e) => e.id === "2"), + date: new Date("2024-12-05"), + hoursWorked: 4, + description: "API dokümantasyonu için swagger entegrasyonu yapıldı.", + workType: WorkTypeEnum.Documentation, + progress: 40, + challenges: "Mevcut API endpoint'lerinin belirlenmesi zaman aldı", + nextSteps: "Detaylı endpoint dokümantasyonu yazılacak", + status: DailyUpdateStatusEnum.Draft, + attachments: [], + creationTime: new Date("2024-12-05T16:45:00"), + lastModificationTime: new Date("2024-12-05T16:45:00"), + }, + { + id: "4", + taskId: "3", + task: mockProjectTasks.find((t) => t.id === "3"), + employeeId: "3", + employee: mockEmployees.find((e) => e.id === "3"), + date: new Date("2024-12-05"), + hoursWorked: 5.5, + description: + "Frontend arayüz tasarımında kullanıcı deneyimi optimizasyonu yapıldı.", + workType: WorkTypeEnum.Design, + progress: 65, + challenges: "Responsive tasarım gereksinimlerinin belirlenmesi", + nextSteps: "Mobile uyumlu tasarım geliştirilecek", + status: DailyUpdateStatusEnum.Submitted, + attachments: [], + creationTime: new Date("2024-12-05T17:00:00"), + lastModificationTime: new Date("2024-12-05T17:00:00"), + }, + { + id: "5", + taskId: "4", + task: mockProjectTasks.find((t) => t.id === "4"), + employeeId: "4", + employee: mockEmployees.find((e) => e.id === "4"), + date: new Date("2024-12-05"), + hoursWorked: 3, + description: + "Unit test scenarioları oluşturuldu ve test coverage analizi yapıldı.", + workType: WorkTypeEnum.Testing, + progress: 30, + challenges: "Complex business logic için test senaryoları karmaşık", + nextSteps: "Integration testlere başlanacak", + status: DailyUpdateStatusEnum.Draft, + attachments: [], + creationTime: new Date("2024-12-05T15:20:00"), + lastModificationTime: new Date("2024-12-05T15:20:00"), + }, + { + id: "6", + taskId: "1", + task: mockProjectTasks.find((t) => t.id === "1"), + employeeId: "1", + employee: mockEmployees.find((e) => e.id === "1"), + date: new Date("2024-12-03"), + hoursWorked: 8, + description: + "Veritabanı tablolarının oluşturulması ve ilişkilerin kurulması tamamlandı.", + workType: WorkTypeEnum.Development, + progress: 45, + challenges: "Foreign key constraints'lerin optimize edilmesi gerekti", + nextSteps: "Stored procedure'lar yazılacak", + status: DailyUpdateStatusEnum.Approved, + attachments: [], + creationTime: new Date("2024-12-03T18:30:00"), + lastModificationTime: new Date("2024-12-03T18:30:00"), + }, + { + id: "7", + taskId: "2", + task: mockProjectTasks.find((t) => t.id === "2"), + employeeId: "2", + employee: mockEmployees.find((e) => e.id === "2"), + date: new Date("2024-12-04"), + hoursWorked: 6, + description: "REST API endpoint'lerinin dokümantasyonuna başlandı.", + workType: WorkTypeEnum.Documentation, + progress: 20, + challenges: "API specification'ların güncel olmama durumu", + nextSteps: "Developer'larla koordinasyon kurulacak", + status: DailyUpdateStatusEnum.Submitted, + attachments: [], + creationTime: new Date("2024-12-04T17:15:00"), + lastModificationTime: new Date("2024-12-04T17:15:00"), + }, + { + id: "8", + taskId: "5", + task: mockProjectTasks.find((t) => t.id === "5"), + employeeId: "5", + employee: mockEmployees.find((e) => e.id === "5"), + date: new Date("2024-12-05"), + hoursWorked: 7, + description: "Mobil uygulama için React Native setup'ı tamamlandı.", + workType: WorkTypeEnum.Development, + progress: 55, + challenges: "iOS ve Android build configuration farklılıkları", + nextSteps: "Navigation structure implementasyonu", + status: DailyUpdateStatusEnum.Approved, + attachments: [], + creationTime: new Date("2024-12-05T18:00:00"), + lastModificationTime: new Date("2024-12-05T18:00:00"), + }, +]; diff --git a/ui/src/mocks/mockProjectTasks.ts b/ui/src/mocks/mockProjectTasks.ts new file mode 100644 index 00000000..5084bbfc --- /dev/null +++ b/ui/src/mocks/mockProjectTasks.ts @@ -0,0 +1,85 @@ +import { PriorityEnum } from "../types/common"; +import { PsProjectTask, TaskStatusEnum, TaskTypeEnum } from "../types/ps"; +import { mockEmployees } from "./mockEmployees"; +import { mockProjectPhases } from "./mockProjectPhases"; + +export const mockProjectTasks: PsProjectTask[] = [ + { + id: "1", + projectId: "1", + phaseId: "1", + phase: mockProjectPhases.find((phase) => phase.id === "1"), + taskCode: "TSK-001", + name: "Veritabanı Tasarımı", + description: "ERP sistemi için veritabanı şemasının tasarlanması", + taskType: TaskTypeEnum.Development, + status: TaskStatusEnum.InProgress, + priority: PriorityEnum.High, + assignedTo: "1", + assignee: mockEmployees.find((emp) => emp.id === "1"), + startDate: new Date("2024-01-15"), + endDate: new Date("2024-02-15"), + actualStartDate: new Date("2024-01-16"), + actualEndDate: undefined, + estimatedHours: 80, + actualHours: 45, + progress: 60, + activities: [], + comments: [], + isActive: true, + creationTime: new Date("2024-01-10"), + lastModificationTime: new Date("2024-01-20"), + }, + { + id: "2", + projectId: "1", + phaseId: "1", + phase: mockProjectPhases.find((phase) => phase.id === "1"), + taskCode: "TSK-002", + name: "API Dokümantasyonu", + description: "REST API endpoints dokümantasyonunun hazırlanması", + taskType: TaskTypeEnum.Documentation, + status: TaskStatusEnum.NotStarted, + priority: PriorityEnum.Normal, + assignedTo: "2", + assignee: mockEmployees.find((emp) => emp.id === "2"), + startDate: new Date("2024-02-01"), + endDate: new Date("2024-02-20"), + actualStartDate: undefined, + actualEndDate: undefined, + estimatedHours: 40, + actualHours: 0, + progress: 0, + activities: [], + comments: [], + isActive: true, + creationTime: new Date("2024-01-25"), + lastModificationTime: new Date("2024-01-25"), + }, + { + id: "3", + projectId: "2", + phaseId: "2", + phase: mockProjectPhases.find((phase) => phase.id === "2"), + taskCode: "TSK-003", + name: "Unit Test Yazımı", + description: "Backend servisler için unit testlerin yazılması", + taskType: TaskTypeEnum.Testing, + status: TaskStatusEnum.Completed, + priority: PriorityEnum.High, + assignedTo: "3", + assignee: mockEmployees.find((emp) => emp.id === "3"), + startDate: new Date("2024-01-20"), + endDate: new Date("2024-02-10"), + actualStartDate: new Date("2024-01-20"), + actualEndDate: new Date("2024-02-08"), + estimatedHours: 60, + actualHours: 58, + progress: 100, + activities: [], + comments: [], + isActive: true, + creationTime: new Date("2024-01-15"), + lastModificationTime: new Date("2024-02-08"), + }, +]; diff --git a/ui/src/mocks/mockProjects.ts b/ui/src/mocks/mockProjects.ts new file mode 100644 index 00000000..fee5fec2 --- /dev/null +++ b/ui/src/mocks/mockProjects.ts @@ -0,0 +1,233 @@ +import { PriorityEnum } from "../types/common"; +import { + PsDocumentTypeEnum, + PsProject, + ProjectStatusEnum, + ProjectTypeEnum, + RiskCategoryEnum, + RiskImpactEnum, + RiskLevelEnum, + RiskProbabilityEnum, + RiskStatusEnum, +} from "../types/ps"; +import { mockBusinessParties } from "./mockBusinessParties"; +import { mockEmployees } from "./mockEmployees"; + +export const mockProjects: PsProject[] = [ + { + id: "1", + code: "PRJ-2024-001", + name: "ERP Sistemi Geliştirme", + description: "Kurumsal kaynak planlama sistemi geliştirilmesi", + projectType: ProjectTypeEnum.Internal, + status: ProjectStatusEnum.Active, + priority: PriorityEnum.High, + customerId: "6", + customer: mockBusinessParties.find((c) => c.id === "6"), + projectManagerId: "1", + projectManager: mockEmployees.find((e) => e.id === "1"), + startDate: new Date("2024-01-15"), + endDate: new Date("2024-12-31"), + actualStartDate: new Date("2024-01-20"), + actualEndDate: undefined, + budget: 500000, + actualCost: 250000, + currency: "TRY", + progress: 65, + phases: [], + tasks: [], + risks: [ + { + id: "1", + title: "Teknik Ekip Yetersizliği", + description: + "Projenin gerektirdiği teknik uzmanlığa sahip personel eksikliği", + probability: RiskProbabilityEnum.Medium, + status: RiskStatusEnum.Analyzing, + ownerId: "1", + identifiedDate: new Date("2024-01-20"), + mitigationPlan: "Eksternal danışman alımı planlanıyor", + projectId: "1", + riskCode: "005-TEKN", + category: RiskCategoryEnum.Technical, + impact: RiskImpactEnum.VeryLow, + riskLevel: RiskLevelEnum.Low, + identifiedBy: "", + isActive: false, + }, + { + id: "2", + title: "Bütçe Aşımı", + description: + "Beklenenden fazla kaynak kullanımı nedeniyle bütçe aşımı riski", + probability: RiskProbabilityEnum.Medium, + status: RiskStatusEnum.Analyzing, + ownerId: "2", + identifiedDate: new Date("2024-01-20"), + mitigationPlan: "Eksternal danışman alımı planlanıyor", + projectId: "1", + riskCode: "009-BUTC", + category: RiskCategoryEnum.Resource, + impact: RiskImpactEnum.Low, + riskLevel: RiskLevelEnum.Critical, + identifiedBy: "", + isActive: false, + }, + ], + documents: [ + { + id: "1", + documentName: "Proje Teklifi.pdf", + documentType: PsDocumentTypeEnum.Design, + fileSize: 2.3, + uploadedAt: new Date("2024-01-15"), + uploadedBy: "Ali Öztürk", + filePath: "pdf", + projectId: "", + version: "", + isActive: false, + }, + { + id: "2", + documentName: "Gereksinim Analizi.docx", + documentType: PsDocumentTypeEnum.Report, + fileSize: 1.8, + uploadedAt: new Date("2024-01-15"), + uploadedBy: "Ayşe Kaya", + filePath: "docx", + projectId: "", + version: "", + isActive: false, + }, + ], + isActive: true, + creationTime: new Date("2024-01-10"), + lastModificationTime: new Date("2024-11-20"), + }, + { + id: "2", + code: "PRJ-2024-002", + name: "Mobil Uygulama Geliştirme", + description: "iOS ve Android mobil uygulama geliştirilmesi", + projectType: ProjectTypeEnum.Customer, + status: ProjectStatusEnum.Planning, + priority: PriorityEnum.Normal, + customerId: "5", + customer: mockBusinessParties.find((c) => c.id === "5"), + projectManagerId: "2", + projectManager: mockEmployees.find((e) => e.id === "2"), + startDate: new Date("2024-03-01"), + endDate: new Date("2024-08-31"), + actualStartDate: undefined, + actualEndDate: undefined, + budget: 300000, + actualCost: 50000, + currency: "TRY", + progress: 15, + phases: [], + tasks: [], + risks: [ + { + id: "r1", + description: "Teknoloji değişiklikleri", + impact: RiskImpactEnum.High, + probability: RiskProbabilityEnum.Medium, + mitigationPlan: "Düzenli eğitim ve güncellemeler", + projectId: "", + riskCode: "", + title: "", + category: RiskCategoryEnum.Technical, + riskLevel: RiskLevelEnum.Low, + status: RiskStatusEnum.Identified, + identifiedBy: "", + identifiedDate: new Date(), + isActive: false, + }, + ], + documents: [ + { + id: "3", + documentName: "UI Mockup.fig", + documentType: PsDocumentTypeEnum.Manual, + fileSize: 5.2, + uploadedAt: new Date("2024-02-20"), + uploadedBy: "Mehmet Demir", + filePath: "fig", + projectId: "", + version: "", + isActive: false, + }, + { + id: "4", + documentName: "Veritabanı Şeması.sql", + documentType: PsDocumentTypeEnum.Design, + fileSize: 1.2, + uploadedAt: new Date("2024-02-20"), + uploadedBy: "Mehmet Demir", + filePath: "fig", + projectId: "", + version: "", + isActive: false, + }, + ], + isActive: true, + creationTime: new Date("2024-02-15"), + lastModificationTime: new Date("2024-11-18"), + }, + { + id: "3", + code: "PRJ-2024-003", + name: "Veri Merkezi Kurulumu", + description: "Yeni veri merkezi altyapısının kurulması", + projectType: ProjectTypeEnum.Development, + status: ProjectStatusEnum.Completed, + priority: PriorityEnum.High, + customerId: "6", + customer: mockBusinessParties.find((c) => c.id === "6"), + projectManagerId: "3", + projectManager: mockEmployees.find((e) => e.id === "3"), + startDate: new Date("2024-06-01"), + endDate: new Date("2024-10-31"), + actualStartDate: new Date("2024-06-05"), + actualEndDate: new Date("2024-10-28"), + budget: 800000, + actualCost: 750000, + currency: "TRY", + progress: 100, + phases: [], + tasks: [], + risks: [], + documents: [], + isActive: true, + creationTime: new Date("2024-05-20"), + lastModificationTime: new Date("2024-10-28"), + }, + { + id: "4", + code: "PRJ-2024-004", + name: "E-ticaret Platform Entegrasyonu", + description: "Mevcut sisteme e-ticaret platformu entegrasyonu", + projectType: ProjectTypeEnum.Customer, + status: ProjectStatusEnum.OnHold, + priority: PriorityEnum.Low, + customerId: "5", + customer: mockBusinessParties.find((c) => c.id === "5"), + projectManagerId: "4", + projectManager: mockEmployees.find((e) => e.id === "4"), + startDate: new Date("2024-09-01"), + endDate: new Date("2024-12-15"), + actualStartDate: undefined, + actualEndDate: undefined, + budget: 200000, + actualCost: 25000, + currency: "TRY", + progress: 10, + phases: [], + tasks: [], + risks: [], + documents: [], + isActive: true, + creationTime: new Date("2024-08-15"), + lastModificationTime: new Date("2024-11-15"), + }, +]; diff --git a/ui/src/mocks/mockPromissoryNotes.ts b/ui/src/mocks/mockPromissoryNotes.ts new file mode 100644 index 00000000..2a97a9f5 --- /dev/null +++ b/ui/src/mocks/mockPromissoryNotes.ts @@ -0,0 +1,40 @@ +import { NoteStatusEnum, NoteTypeEnum, PromissoryNote } from "../types/fi"; +import { mockCurrentAccounts } from "./mockCurrentAccounts"; + +export const mockPromissoryNotes: PromissoryNote[] = [ + { + id: "1", + noteNumber: "NOT-001", + type: NoteTypeEnum.Received, + drawerName: "Müşteri A.Ş.", + payeeName: "ABC Şirket", + issueDate: new Date("2024-01-20"), + dueDate: new Date("2024-03-20"), + amount: 50000, + currency: "TRY", + status: NoteStatusEnum.InHand, + location: "Ana Kasa", + currentAccountId: "1", + currentAccount: mockCurrentAccounts.find((acc) => acc.id === "1"), + creationTime: new Date("2024-01-20"), + lastModificationTime: new Date("2024-01-20"), + }, + { + id: "2", + noteNumber: "NOT-002", + type: NoteTypeEnum.Issued, + drawerName: "ABC Şirket", + payeeName: "Kefil A.Ş.", + issueDate: new Date("2024-01-05"), + dueDate: new Date("2024-03-05"), + amount: 30000, + currency: "TRY", + status: NoteStatusEnum.Collected, + location: "Banka", + collectionDate: new Date("2024-01-25"), + currentAccountId: "2", + currentAccount: mockCurrentAccounts.find((acc) => acc.id === "2"), + creationTime: new Date("2024-01-05"), + lastModificationTime: new Date("2024-01-25"), + }, +]; diff --git a/ui/src/mocks/mockPurchaseOrders.ts b/ui/src/mocks/mockPurchaseOrders.ts new file mode 100644 index 00000000..957916c7 --- /dev/null +++ b/ui/src/mocks/mockPurchaseOrders.ts @@ -0,0 +1,217 @@ +import { PaymentTerms } from "../types/common"; +import { OrderStatusEnum, MmPurchaseOrder, RequestTypeEnum } from "../types/mm"; +import { mockMaterials } from "./mockMaterials"; +import { mockBusinessParties } from "./mockBusinessParties"; + +export const mockPurchaseOrders: MmPurchaseOrder[] = [ + { + id: "ORD001", + orderNumber: "SIP-2024-001", + supplierId: "1", + supplier: mockBusinessParties.find((s) => s.id === "1"), + orderDate: new Date("2024-01-20"), + deliveryDate: new Date("2024-02-03"), + status: OrderStatusEnum.Delivered, + paymentTerms: PaymentTerms.Net30, + currency: "TRY", + exchangeRate: 1, + subtotal: 125000, + taxAmount: 22500, + totalAmount: 147500, + deliveryAddress: { + street: "Atatürk Cad. No:10", + city: "İstanbul", + state: "İstanbul", + postalCode: "34000", + country: "Türkiye", + }, + terms: "30 gün içinde ödeme yapılacaktır.", + notes: "Öncelikli sipariş - hızlı teslimat talep edildi.", + items: [ + { + id: "1", + orderId: "ORD001", + materialId: "1", + material: mockMaterials.find((m) => m.id === "1"), + description: "Galvanizli çelik profil", + quantity: 100, + unit: "adet", + unitPrice: 850, + totalPrice: 85000, + deliveryDate: new Date("2024-02-03"), + receivedQuantity: 100, + deliveredQuantity: 100, + remainingQuantity: 0, + }, + { + id: "2", + orderId: "ORD001", + materialId: "2", + material: mockMaterials.find((m) => m.id === "2"), + description: "3.25mm kaynak elektrodu", + quantity: 200, + unit: "kg", + unitPrice: 200, + totalPrice: 40000, + deliveryDate: new Date("2024-02-03"), + receivedQuantity: 200, + deliveredQuantity: 200, + remainingQuantity: 0, + }, + ], + receipts: [], + invoices: [], + creationTime: new Date("2024-01-20"), + lastModificationTime: new Date("2024-02-03"), + requestId: "REQ001", + requestTitle: "Üretim Malzemesi Talebi", + requestType: RequestTypeEnum.Material, + quotationId: "QUO001", + expectedDeliveryDate: new Date("2024-02-05"), + actualDeliveryDate: new Date("2024-02-03"), + deliveryTerms: "Fabrika teslimi", + attachments: ["siparis_formu.pdf", "teknik_sartname.pdf"], + approvedBy: "Ayşe Demir", + approvedAt: new Date("2024-01-20"), + }, + { + id: "ORD002", + orderNumber: "SIP-2024-002", + supplierId: "2", + supplier: mockBusinessParties.find((s) => s.id === "2"), + orderDate: new Date("2024-01-22"), + deliveryDate: new Date("2024-02-10"), + status: OrderStatusEnum.PartiallyDelivered, + paymentTerms: PaymentTerms.Net45, + currency: "TRY", + exchangeRate: 0, + subtotal: 0, + taxAmount: 0, + totalAmount: 280000, + deliveryAddress: { + street: "İnönü Mah. No:5", + city: "Ankara", + state: "Ankara", + postalCode: "06000", + country: "Türkiye", + }, + terms: "45 gün içinde ödeme yapılacaktır.", + notes: "Kademeli teslimat yapılacak.", + items: [ + { + id: "3", + orderId: "ORD002", + materialId: "3", + material: mockMaterials.find((m) => m.id === "3"), + description: "i7 işlemci, 16GB RAM, 512GB SSD", + quantity: 10, + unit: "adet", + unitPrice: 25000, + totalPrice: 250000, + deliveryDate: new Date("2024-02-08"), + receivedQuantity: 7, + deliveredQuantity: 7, + remainingQuantity: 3, + }, + { + id: "4", + orderId: "ORD002", + materialId: "4", + material: mockMaterials.find((m) => m.id === "4"), + description: '24" LED monitör', + quantity: 10, + unit: "adet", + unitPrice: 3000, + totalPrice: 30000, + deliveryDate: new Date("2024-02-10"), + receivedQuantity: 10, + deliveredQuantity: 10, + remainingQuantity: 0, + }, + ], + receipts: [], + invoices: [], + creationTime: new Date("2024-01-22"), + lastModificationTime: new Date("2024-02-08"), + requestId: "REQ002", + requestTitle: "Bilgisayar Ekipmanları", + requestType: RequestTypeEnum.WorkCenter, + quotationId: "QUO002", + expectedDeliveryDate: new Date("2024-02-12"), + actualDeliveryDate: new Date("2024-02-08"), + deliveryTerms: "Ofis teslimi", + attachments: ["siparis_detay.pdf"], + approvedBy: "Murat Şen", + approvedAt: new Date("2024-01-22"), + }, + { + id: "ORD003", + orderNumber: "SIP-2024-003", + supplierId: "3", + supplier: mockBusinessParties.find((s) => s.id === "3"), + orderDate: new Date("2024-01-25"), + deliveryDate: new Date("2024-02-01"), + status: OrderStatusEnum.Confirmed, + paymentTerms: PaymentTerms.Prepaid, + currency: "TRY", + exchangeRate: 0, + subtotal: 0, + taxAmount: 0, + totalAmount: 85000, + deliveryAddress: { + street: "Hürriyet Cad. No:20", + city: "İzmir", + state: "İzmir", + postalCode: "35000", + country: "Türkiye", + }, + terms: "Hizmet başlamadan önce ödeme yapılacaktır.", + notes: "6 aylık hizmet anlaşması.", + items: [ + { + id: "5", + orderId: "ORD003", + materialId: "4", + material: mockMaterials.find((m) => m.id === "4"), + description: "Aylık makine bakım hizmeti", + quantity: 6, + unit: "ay", + unitPrice: 12000, + totalPrice: 72000, + deliveryDate: new Date("2024-02-01"), + receivedQuantity: 0, + deliveredQuantity: 0, + remainingQuantity: 6, + }, + { + id: "6", + orderId: "ORD003", + materialId: "5", + material: mockMaterials.find((m) => m.id === "5"), + description: "Acil durum müdahale paketi", + quantity: 1, + unit: "paket", + unitPrice: 13000, + totalPrice: 13000, + deliveryDate: new Date("2024-02-01"), + receivedQuantity: 0, + deliveredQuantity: 0, + remainingQuantity: 1, + }, + ], + receipts: [], + invoices: [], + creationTime: new Date("2024-01-25"), + lastModificationTime: new Date("2024-01-26"), + requestId: "REQ003", + requestTitle: "Makine Bakım Hizmeti", + requestType: RequestTypeEnum.Service, + quotationId: "QUO003", + expectedDeliveryDate: new Date("2024-02-01"), + actualDeliveryDate: new Date("2024-02-01"), + deliveryTerms: "Yerinde hizmet", + attachments: ["hizmet_sozlesmesi.pdf"], + approvedBy: "Can Demirtaş", + approvedAt: new Date("2024-01-25"), + }, +]; diff --git a/ui/src/mocks/mockPurchaseRequests.ts b/ui/src/mocks/mockPurchaseRequests.ts new file mode 100644 index 00000000..db2747e8 --- /dev/null +++ b/ui/src/mocks/mockPurchaseRequests.ts @@ -0,0 +1,190 @@ +import { PriorityEnum } from "../types/common"; +import { + ApprovalLevelEnum, + ApprovalStatusEnum, + MmPurchaseRequest, + RequestStatusEnum, + RequestTypeEnum, +} from "../types/mm"; + +export const mockPurchaseRequests: MmPurchaseRequest[] = [ + { + id: "REQ001", + requestNumber: "PR-2024-001", + requestType: RequestTypeEnum.Material, + description: "Üretim için hammadde talebi", + department: "Üretim", + requestedBy: "Ali Veli", + requestDate: new Date("2024-08-01"), + requiredDate: new Date("2024-08-15"), + priority: PriorityEnum.High, + status: RequestStatusEnum.Approved, + totalAmount: 75000, + currency: "TRY", + items: [ + { + id: "ITEM001", + requestId: "1", + materialId: "1", + quantity: 100, + unit: "KG", + estimatedPrice: 750, + specification: "Yüksek kalite çelik", + justification: "Üretim planı için gerekli", + isUrgent: true, + }, + ], + approvals: [ + { + id: "APP001", + requestId: "1", + approvalLevel: ApprovalLevelEnum.Supervisor, + approverUserId: "USR001", + approverName: "Mehmet Yılmaz", + approvalDate: new Date("2024-08-02"), + status: ApprovalStatusEnum.Approved, + comments: "Onaylandı", + sequence: 1, + isRequired: true, + }, + { + id: "APP002", + requestId: "1", + approvalLevel: ApprovalLevelEnum.Manager, + approverUserId: "USR002", + approverName: "Ayşe Demir", + approvalDate: new Date("2024-08-03"), + status: ApprovalStatusEnum.Approved, + sequence: 2, + isRequired: true, + }, + ], + attachments: [], + comments: [], + creationTime: new Date(), + lastModificationTime: new Date(), + }, + { + id: "REQ002", + requestNumber: "PR-2024-002", + requestType: RequestTypeEnum.Service, + description: "Bakım hizmeti talebi", + department: "Bakım", + requestedBy: "Fatma Özkan", + requestDate: new Date("2024-08-05"), + requiredDate: new Date("2024-08-12"), + priority: PriorityEnum.Urgent, + status: RequestStatusEnum.InReview, + totalAmount: 25000, + currency: "TRY", + items: [ + { + id: "ITEM002", + requestId: "2", + materialId: "2", + serviceDescription: "Kompresör bakım hizmeti", + quantity: 1, + unit: "ADET", + estimatedPrice: 25000, + specification: "Periyodik bakım", + justification: "Arıza önleme", + isUrgent: true, + }, + ], + approvals: [ + { + id: "APP003", + requestId: "2", + approvalLevel: ApprovalLevelEnum.Supervisor, + approverUserId: "USR003", + approverName: "Hasan Kaya", + status: ApprovalStatusEnum.Pending, + sequence: 1, + isRequired: true, + }, + ], + attachments: [], + comments: [], + creationTime: new Date(), + lastModificationTime: new Date(), + }, + { + id: "REQ003", + requestNumber: "PR-2024-003", + requestType: RequestTypeEnum.WorkCenter, + description: "Yeni ekipman talebi", + department: "IT", + requestedBy: "Murat Şen", + requestDate: new Date("2024-08-10"), + requiredDate: new Date("2024-08-25"), + priority: PriorityEnum.Normal, + status: RequestStatusEnum.Draft, + totalAmount: 150000, + currency: "TRY", + items: [ + { + id: "ITEM003", + requestId: "3", + materialId: "3", + serviceDescription: "Sunucu donanımı", + quantity: 2, + unit: "ADET", + estimatedPrice: 75000, + specification: "Dell PowerEdge R750", + justification: "Sistem kapasitesi artırımı", + isUrgent: false, + }, + ], + approvals: [], + attachments: [], + comments: [], + creationTime: new Date(), + lastModificationTime: new Date(), + }, + { + id: "4", + requestNumber: "PR-2024-004", + requestType: RequestTypeEnum.Material, + description: "Ofis malzemeleri talebi", + department: "İdari İşler", + requestedBy: "Zeynep Akın", + requestDate: new Date("2024-08-12"), + requiredDate: new Date("2024-08-20"), + priority: PriorityEnum.Low, + status: RequestStatusEnum.Rejected, + totalAmount: 5000, + currency: "TRY", + items: [ + { + id: "ITEM004", + requestId: "4", + materialId: "4", + serviceDescription: "Kırtasiye malzemeleri", + quantity: 1, + unit: "LOT", + estimatedPrice: 5000, + specification: "Çeşitli ofis malzemeleri", + justification: "Stok yenileme", + isUrgent: false, + }, + ], + approvals: [ + { + id: "APP004", + requestId: "4", + approvalLevel: ApprovalLevelEnum.Manager, + approverUserId: "USR004", + approverName: "Ahmet Yıldız", + approvalDate: new Date("2024-08-13"), + status: ApprovalStatusEnum.Rejected, + comments: "Bütçe yetersizliği", + sequence: 1, + isRequired: true, + }, + ], + attachments: [], + comments: [], + creationTime: new Date(), + lastModificationTime: new Date(), + }, +]; diff --git a/ui/src/mocks/mockPurchaseRequisitions.ts b/ui/src/mocks/mockPurchaseRequisitions.ts new file mode 100644 index 00000000..97de73d2 --- /dev/null +++ b/ui/src/mocks/mockPurchaseRequisitions.ts @@ -0,0 +1,50 @@ +import { PriorityEnum } from '@/types/common' +import { ApprovalStatusEnum, MmPurchaseRequisition, RequisitionStatusEnum } from '../types/mm' + +export const mockPurchaseRequisitions: MmPurchaseRequisition[] = [ + { + id: '1', + requisitionNumber: 'PR-2024-001', + requestedBy: 'Mehmet Özkan', + departmentId: 'PROD', + requestDate: new Date('2024-01-20'), + requiredDate: new Date('2024-02-15'), + priority: PriorityEnum.Normal, + status: RequisitionStatusEnum.InApproval, + description: 'Üretim hattı için çelik malzeme talebi', + justification: 'Mevcut stok seviyesi kritik seviyeye düştü', + totalAmount: 125000, + currency: 'TRY', + items: [ + { + id: '1', + requisitionId: '1', + materialId: 'MAT-001', + description: 'Çelik Levha 2mm', + quantity: 500, + unitId: '1', + estimatedPrice: 250, + totalAmount: 125000, + requiredDate: new Date('2024-02-15'), + specifications: 'Kalınlık: 2mm, Genişlik: 1000mm', + budgetCode: 'PROD-2024-Q1', + }, + ], + approvals: [ + { + id: '1', + documentId: '1', + documentType: 'PurchaseRequisition', + approverUserId: 'manager1', + approverName: 'Ali Yılmaz', + approvalLevel: 1, + status: ApprovalStatusEnum.Approved, + comments: 'Onaylandı', + approvedAt: new Date('2024-01-21'), + creationTime: new Date('2024-01-21'), + }, + ], + creationTime: new Date('2024-01-20'), + lastModificationTime: new Date('2024-01-21'), + }, +] diff --git a/ui/src/mocks/mockPutawayRules.ts b/ui/src/mocks/mockPutawayRules.ts new file mode 100644 index 00000000..9d8870e4 --- /dev/null +++ b/ui/src/mocks/mockPutawayRules.ts @@ -0,0 +1,124 @@ +import { + ConditionOperatorEnum, + ConditionTypeEnum, + WmPutawayRule, + PutawayStrategyEnum, +} from "../types/wm"; + +export const mockPutawayRules: WmPutawayRule[] = [ + { + id: "1", + code: "RULE001", + name: "Ağır Malzemeler", + description: "Ağır malzemeler için zemin seviye yerleştirme kuralı", + warehouseId: "1", + materialTypeId: "1", + materialGroupId: "2", + priority: 1, + conditions: [ + { + id: "1", + ruleId: "1", + conditionType: ConditionTypeEnum.Weight, + operator: ConditionOperatorEnum.GreaterThan, + value: "50", + }, + ], + targetZoneId: "1", + targetLocationId: undefined, + strategy: PutawayStrategyEnum.NearestLocation, + isActive: true, + }, + { + id: "2", + code: "RULE002", + name: "Hızlı Hareket Eden Malzemeler", + description: "A sınıfı malzemeler için kolay erişim bölgesi", + warehouseId: "1", + materialTypeId: "2", + materialGroupId: "2", + priority: 2, + conditions: [ + { + id: "2", + ruleId: "2", + conditionType: ConditionTypeEnum.MaterialGroup, + operator: ConditionOperatorEnum.Equals, + value: "A-Class", + }, + ], + targetZoneId: "2", + targetLocationId: undefined, + strategy: PutawayStrategyEnum.NearestLocation, + isActive: true, + }, + { + id: "3", + code: "RULE003", + name: "FIFO Kuralı", + description: "Son kullanma tarihi olan malzemeler için FIFO", + warehouseId: "1", + materialTypeId: "3", + materialGroupId: "2", + priority: 3, + conditions: [ + { + id: "3", + ruleId: "3", + conditionType: ConditionTypeEnum.MaterialType, + operator: ConditionOperatorEnum.Equals, + value: "Perishable", + }, + ], + targetZoneId: "3", + targetLocationId: undefined, + strategy: PutawayStrategyEnum.FIFO, + isActive: true, + }, + { + id: "4", + code: "RULE004", + name: "Büyük Hacimli Malzemeler", + description: "Büyük hacimli malzemeler için özel alan", + warehouseId: "1", + materialTypeId: "2", + materialGroupId: "4", + priority: 4, + conditions: [ + { + id: "4", + ruleId: "4", + conditionType: ConditionTypeEnum.Volume, + operator: ConditionOperatorEnum.GreaterThan, + value: "2", + }, + ], + targetZoneId: "4", + targetLocationId: undefined, + strategy: PutawayStrategyEnum.EmptyLocation, + isActive: true, + }, + { + id: "5", + code: "RULE005", + name: "Aynı Ürün Gruplaması", + description: "Aynı malzeme tiplerini birlikte yerleştirme", + warehouseId: "1", + materialTypeId: "2", + materialGroupId: "3", + priority: 5, + conditions: [ + { + id: "5", + ruleId: "5", + conditionType: ConditionTypeEnum.MaterialType, + operator: ConditionOperatorEnum.Equals, + value: "Electronics", + }, + ], + targetZoneId: "5", + targetLocationId: undefined, + strategy: PutawayStrategyEnum.SameProduct, + isActive: false, + }, +]; diff --git a/ui/src/mocks/mockQuotations.ts b/ui/src/mocks/mockQuotations.ts new file mode 100644 index 00000000..c8f56a7e --- /dev/null +++ b/ui/src/mocks/mockQuotations.ts @@ -0,0 +1,198 @@ +import { MmQuotation, QuotationStatusEnum, RequestTypeEnum } from "../types/mm"; +import { mockBusinessParties } from "./mockBusinessParties"; + +export const mockQuotations: MmQuotation[] = [ + { + id: "1", + quotationNumber: "TEK-2024-001", + supplierId: "1", + supplier: mockBusinessParties.find((s) => s.id === "1"), + requestId: "REQ001", + requestTitle: "Üretim Malzemesi Talebi", + requestType: RequestTypeEnum.Material, + quotationDate: new Date("2024-01-15"), + validUntil: new Date("2024-02-15"), + totalAmount: 125000, + currency: "TRY", + status: QuotationStatusEnum.Pending, + items: [ + { + id: "ITM001", + materialCode: "MAL001", + materialName: "Çelik Profil 40x40", + description: "Galvanizli çelik profil", + quantity: 100, + unit: "adet", + unitPrice: 850, + totalPrice: 85000, + leadTime: 15, + specifications: ["Galvanizli", "EN 10025 standardında"], + }, + { + id: "ITM002", + materialCode: "MAL002", + materialName: "Kaynak Elektrodu", + description: "3.25mm kaynak elektrodu", + quantity: 200, + unit: "kg", + unitPrice: 200, + totalPrice: 40000, + leadTime: 7, + specifications: ["AWS E6013", "Rutubet dirençli"], + }, + ], + deliveryTerms: "15 gün içinde teslim", + paymentTerms: "30 gün vadeli", + notes: "Toplu sipariş indirimi uygulanmıştır.", + attachments: [ + { + id: "ATT001", + fileName: "teknik_sartname.pdf", + fileSize: 1024, + fileType: "application/pdf", + uploadedBy: "Mehmet Yılmaz", + uploadedAt: new Date("2024-01-15"), + }, + { + id: "ATT002", + fileName: "urun_katalogu.pdf", + fileSize: 2048, + fileType: "application/pdf", + uploadedBy: "Mehmet Yılmaz", + uploadedAt: new Date("2024-01-15"), + }, + ], + submittedBy: "Mehmet Yılmaz", + submittedAt: new Date("2024-01-15"), + evaluatedBy: undefined, + evaluatedAt: undefined, + evaluationNotes: undefined, + creationTime: new Date("2024-01-15"), + lastModificationTime: new Date("2024-01-15"), + }, + { + id: "2", + quotationNumber: "TEK-2024-002", + supplierId: "2", + supplier: mockBusinessParties.find((s) => s.id === "2"), + requestId: "REQ002", + requestTitle: "Bilgisayar Ekipmanları", + requestType: RequestTypeEnum.WorkCenter, + quotationDate: new Date("2024-01-16"), + validUntil: new Date("2024-02-16"), + totalAmount: 280000, + currency: "TRY", + status: QuotationStatusEnum.Approved, + items: [ + { + id: "ITM003", + materialCode: "EQP001", + materialName: "Masaüstü Bilgisayar", + description: "i7 işlemci, 16GB RAM, 512GB SSD", + quantity: 10, + unit: "adet", + unitPrice: 25000, + totalPrice: 250000, + leadTime: 21, + specifications: [ + "Intel i7-12700", + "16GB DDR4", + "512GB NVMe SSD", + "Windows 11 Pro", + ], + }, + { + id: "ITM004", + materialCode: "EQP002", + materialName: "Monitör", + description: '24" LED monitör', + quantity: 10, + unit: "adet", + unitPrice: 3000, + totalPrice: 30000, + leadTime: 14, + specifications: ['24" Full HD', "IPS panel", "HDMI/DP girişi"], + }, + ], + deliveryTerms: "21 gün içinde teslim", + paymentTerms: "45 gün vadeli", + notes: "2 yıl garanti dahil.", + attachments: [ + { + id: "ATT003", + fileName: "teknik_ozellikler.pdf", + fileSize: 1536, + fileType: "application/pdf", + uploadedBy: "Ali Kaya", + uploadedAt: new Date("2024-01-16"), + }, + ], + submittedBy: "Ali Kaya", + submittedAt: new Date("2024-01-16"), + evaluatedBy: "Ayşe Demir", + evaluatedAt: new Date("2024-01-18"), + evaluationNotes: "Teknik özellikler uygun, fiyat makul.", + creationTime: new Date("2024-01-16"), + lastModificationTime: new Date("2024-01-18"), + }, + { + id: "3", + quotationNumber: "TEK-2024-003", + supplierId: "3", + supplier: mockBusinessParties.find((s) => s.id === "3"), + requestId: "REQ003", + requestTitle: "Bakım Hizmetleri", + requestType: RequestTypeEnum.Service, + quotationDate: new Date("2024-01-17"), + validUntil: new Date("2024-02-17"), + totalAmount: 95000, + currency: "TRY", + status: QuotationStatusEnum.Rejected, + items: [ + { + id: "ITM005", + materialCode: "SRV001", + materialName: "Preventif Bakım", + description: "Aylık preventif bakım hizmeti", + quantity: 12, + unit: "ay", + unitPrice: 7500, + totalPrice: 90000, + leadTime: 0, + specifications: ["24/7 destek", "Aylık rapor", "Yedek parça dahil"], + }, + { + id: "ITM006", + materialCode: "SRV002", + materialName: "Acil Müdahale", + description: "Acil durum müdahale hizmeti", + quantity: 1, + unit: "paket", + unitPrice: 5000, + totalPrice: 5000, + leadTime: 0, + specifications: ["2 saat içinde müdahale", "Hafta sonu dahil"], + }, + ], + deliveryTerms: "Hemen başlanabilir", + paymentTerms: "Aylık ödeme", + notes: "Yıllık anlaşma için %10 indirim.", + attachments: [ + { + id: "ATT004", + fileName: "hizmet_detaylari.pdf", + fileSize: 768, + fileType: "application/pdf", + uploadedBy: "Fatma Özkan", + uploadedAt: new Date("2024-01-17"), + }, + ], + submittedBy: "Fatma Özkan", + submittedAt: new Date("2024-01-17"), + evaluatedBy: "Murat Şen", + evaluatedAt: new Date("2024-01-20"), + evaluationNotes: "Fiyat yüksek, alternatif teklif aranacak.", + creationTime: new Date("2024-01-17"), + lastModificationTime: new Date("2024-01-20"), + }, +]; diff --git a/ui/src/mocks/mockRecentActivities.ts b/ui/src/mocks/mockRecentActivities.ts new file mode 100644 index 00000000..c1bb805d --- /dev/null +++ b/ui/src/mocks/mockRecentActivities.ts @@ -0,0 +1,29 @@ +export const mockRecentActivities = [ + { + id: "1", + type: "material_received", + title: "Malzeme Girişi", + description: "MAT-001 - Çelik Levha 500 KG alındı", + timestamp: new Date("2024-01-20T10:30:00"), + user: "Mehmet Özkan", + status: "completed", + }, + { + id: "2", + type: "maintenance_scheduled", + title: "Bakım Planlandı", + description: "EQP-005 - Tornezgah için periyodik bakım", + timestamp: new Date("2024-01-20T09:15:00"), + user: "Ali Yılmaz", + status: "pending", + }, + { + id: "3", + type: "order_created", + title: "Sipariş Oluşturuldu", + description: "PO-2024-025 - Motor satınalma siparişi", + timestamp: new Date("2024-01-20T08:45:00"), + user: "Ayşe Kaya", + status: "processing", + }, +]; diff --git a/ui/src/mocks/mockSalesOrders.ts b/ui/src/mocks/mockSalesOrders.ts new file mode 100644 index 00000000..dc544e2a --- /dev/null +++ b/ui/src/mocks/mockSalesOrders.ts @@ -0,0 +1,675 @@ +import { PaymentTerms } from "../types/common"; +import { + CrmSalesOrder, + SaleOrderStatusEnum, + SaleOrderItemStatusEnum, +} from "../types/crm"; +import { mockBusinessParties } from "./mockBusinessParties"; +import { mockMaterials } from "./mockMaterials"; + +export const mockSalesOrders: CrmSalesOrder[] = [ + { + id: "1", + orderNumber: "ORD-2024-001", + customerId: "6", // Teknoloji A.Ş. + customer: mockBusinessParties.find((c) => c.id === "6"), + orderDate: new Date("2024-08-15"), + requestedDeliveryDate: new Date("2024-09-15"), + confirmedDeliveryDate: new Date("2024-09-14"), + status: SaleOrderStatusEnum.Delivered, + subtotal: 125000, + taxAmount: 22500, + discountAmount: 6250, + totalAmount: 141250, + currency: "TRY", + paymentTerms: PaymentTerms.Net30, + deliveryAddress: { + street: "Teknoloji Caddesi No:100", + city: "İstanbul", + state: "İstanbul", + postalCode: "34000", + country: "Türkiye", + }, + billingAddress: { + street: "Teknoloji Caddesi No:100", + city: "İstanbul", + state: "İstanbul", + postalCode: "34000", + country: "Türkiye", + }, + items: [ + { + id: "soi_1", + orderId: "so_1", + materialId: "1", + material: mockMaterials.find((m) => m.id === "1"), + description: "Yüksek Kaliteli Çelik Levha 10mm", + quantity: 500, + deliveredQuantity: 500, + unitId: "LT", + unit: mockMaterials.find((m) => m.id === "LT"), + unitPrice: 18.75, + totalAmount: 9375, + requestedDate: new Date("2024-09-15"), + confirmedDate: new Date("2024-09-14"), + status: SaleOrderItemStatusEnum.Delivered, + }, + { + id: "soi_2", + orderId: "so_1", + materialId: "2", + material: mockMaterials.find((m) => m.id === "2"), + description: "Alüminyum Profil 40x40mm", + quantity: 1000, + deliveredQuantity: 1000, + unitId: "pcs", + unit: mockMaterials.find((m) => m.id === "pcs"), + unitPrice: 12.5, + totalAmount: 12500, + requestedDate: new Date("2024-09-15"), + confirmedDate: new Date("2024-09-14"), + status: SaleOrderItemStatusEnum.Delivered, + }, + ], + deliveries: [], + invoices: [], + creationTime: new Date("2024-08-15"), + lastModificationTime: new Date("2024-08-16"), + }, + { + id: "2", + orderNumber: "ORD-2024-002", + customerId: "5", // Üretim Sanayi Ltd. + customer: mockBusinessParties.find((c) => c.id === "5"), + orderDate: new Date("2024-08-20"), + requestedDeliveryDate: new Date("2024-09-20"), + confirmedDeliveryDate: new Date("2024-09-18"), + status: SaleOrderStatusEnum.Shipped, + subtotal: 85000, + taxAmount: 15300, + discountAmount: 4250, + totalAmount: 96050, + currency: "TRY", + paymentTerms: PaymentTerms.Net60, + deliveryAddress: { + street: "Sanayi Sitesi 5. Cadde No:23", + city: "Bursa", + state: "Bursa", + postalCode: "16000", + country: "Türkiye", + }, + billingAddress: { + street: "Sanayi Sitesi 5. Cadde No:23", + city: "Bursa", + state: "Bursa", + postalCode: "16000", + country: "Türkiye", + }, + items: [ + { + id: "soi_3", + orderId: "so_2", + materialId: "3", + material: mockMaterials.find((m) => m.id === "3"), + description: "Plastik Granül PVC", + quantity: 2000, + deliveredQuantity: 2000, + unitId: "ADET", + unit: mockMaterials.find((m) => m.id === "ADET"), + unitPrice: 8.5, + totalAmount: 17000, + requestedDate: new Date("2024-09-20"), + confirmedDate: new Date("2024-09-18"), + status: SaleOrderItemStatusEnum.Shipped, + }, + { + id: "soi_4", + orderId: "so_2", + materialId: "4", + material: mockMaterials.find((m) => m.id === "4"), + description: "Endüstriyel Yapıştırıcı", + quantity: 50, + deliveredQuantity: 50, + unitId: "ADET", + unit: mockMaterials.find((m) => m.id === "ADET"), + unitPrice: 125.0, + totalAmount: 6250, + requestedDate: new Date("2024-09-20"), + confirmedDate: new Date("2024-09-18"), + status: SaleOrderItemStatusEnum.Shipped, + }, + ], + deliveries: [], + invoices: [], + creationTime: new Date("2024-08-20"), + lastModificationTime: new Date("2024-08-21"), + }, + { + id: "3", + orderNumber: "ORD-2024-003", + customerId: "6", // Otomotiv Parça A.Ş. + customer: mockBusinessParties.find((c) => c.id === "6"), + orderDate: new Date("2024-08-25"), + requestedDeliveryDate: new Date("2024-09-25"), + confirmedDeliveryDate: new Date("2024-09-25"), + status: SaleOrderStatusEnum.InProduction, + subtotal: 175000, + taxAmount: 31500, + discountAmount: 8750, + totalAmount: 197750, + currency: "TRY", + paymentTerms: PaymentTerms.Net30, + deliveryAddress: { + street: "OSB 1. Cadde No:45", + city: "Kocaeli", + state: "Kocaeli", + postalCode: "41000", + country: "Türkiye", + }, + billingAddress: { + street: "OSB 1. Cadde No:45", + city: "Kocaeli", + state: "Kocaeli", + postalCode: "41000", + country: "Türkiye", + }, + items: [ + { + id: "soi_5", + orderId: "so_3", + materialId: "1", + material: mockMaterials.find((m) => m.id === "1"), + description: "Motor Yağı 10W-40", + quantity: 500, + deliveredQuantity: 0, + unitId: "ADET", + unit: mockMaterials.find((m) => m.id === "ADET"), + unitPrice: 45.0, + totalAmount: 22500, + requestedDate: new Date("2024-09-25"), + confirmedDate: new Date("2024-09-25"), + status: SaleOrderItemStatusEnum.InProduction, + }, + { + id: "soi_6", + orderId: "so_3", + materialId: "2", + material: mockMaterials.find((m) => m.id === "2"), + description: "Fren Balata Seti", + quantity: 200, + deliveredQuantity: 0, + unitId: "ADET", + unit: mockMaterials.find((m) => m.id === "ADET"), + unitPrice: 85.0, + totalAmount: 17000, + requestedDate: new Date("2024-09-25"), + confirmedDate: new Date("2024-09-25"), + status: SaleOrderItemStatusEnum.InProduction, + }, + ], + deliveries: [], + invoices: [], + creationTime: new Date("2024-08-25"), + lastModificationTime: new Date("2024-08-26"), + }, + { + id: "4", + orderNumber: "ORD-2024-004", + customerId: "6", // Teknoloji A.Ş. + customer: mockBusinessParties.find((c) => c.id === "6"), + orderDate: new Date("2024-09-01"), + requestedDeliveryDate: new Date("2024-10-01"), + confirmedDeliveryDate: new Date("2024-09-30"), + status: SaleOrderStatusEnum.Confirmed, + subtotal: 95000, + taxAmount: 17100, + discountAmount: 4750, + totalAmount: 107350, + currency: "TRY", + paymentTerms: PaymentTerms.Net30, + deliveryAddress: { + street: "Teknoloji Caddesi No:100", + city: "İstanbul", + state: "İstanbul", + postalCode: "34000", + country: "Türkiye", + }, + billingAddress: { + street: "Teknoloji Caddesi No:100", + city: "İstanbul", + state: "İstanbul", + postalCode: "34000", + country: "Türkiye", + }, + items: [ + { + id: "soi_7", + orderId: "so_4", + materialId: "4", + material: mockMaterials.find((m) => m.id === "4"), + description: "Elektronik Kart", + quantity: 100, + deliveredQuantity: 0, + unitId: "PAKET", + unit: mockMaterials.find((m) => m.id === "PAKET"), + unitPrice: 150.0, + totalAmount: 15000, + requestedDate: new Date("2024-10-01"), + confirmedDate: new Date("2024-09-30"), + status: SaleOrderItemStatusEnum.Confirmed, + }, + { + id: "soi_8", + orderId: "so_4", + materialId: "2", + material: mockMaterials.find((m) => m.id === "2"), + description: "Kablo Demeti", + quantity: 250, + deliveredQuantity: 0, + unitId: "PAKET", + unit: mockMaterials.find((m) => m.id === "PAKET"), + unitPrice: 25.0, + totalAmount: 6250, + requestedDate: new Date("2024-10-01"), + confirmedDate: new Date("2024-09-30"), + status: SaleOrderItemStatusEnum.Confirmed, + }, + ], + deliveries: [], + invoices: [], + creationTime: new Date("2024-09-01"), + lastModificationTime: new Date("2024-09-02"), + }, + { + id: "5", + orderNumber: "ORD-2024-005", + customerId: "6", // Üretim Sanayi Ltd. + customer: mockBusinessParties.find((c) => c.id === "6"), + orderDate: new Date("2024-09-05"), + requestedDeliveryDate: new Date("2024-10-05"), + confirmedDeliveryDate: new Date("2024-10-03"), + status: SaleOrderStatusEnum.Ready, + subtotal: 65000, + taxAmount: 11700, + discountAmount: 3250, + totalAmount: 73450, + currency: "TRY", + paymentTerms: PaymentTerms.Net60, + deliveryAddress: { + street: "Sanayi Sitesi 5. Cadde No:23", + city: "Bursa", + state: "Bursa", + postalCode: "16000", + country: "Türkiye", + }, + billingAddress: { + street: "Sanayi Sitesi 5. Cadde No:23", + city: "Bursa", + state: "Bursa", + postalCode: "16000", + country: "Türkiye", + }, + items: [ + { + id: "soi_9", + orderId: "so_5", + materialId: "3", + material: mockMaterials.find((m) => m.id === "3"), + description: "Rulman 6205", + quantity: 100, + deliveredQuantity: 100, + unitId: "KOLI", + unit: mockMaterials.find((m) => m.id === "KOLI"), + unitPrice: 35.0, + totalAmount: 3500, + requestedDate: new Date("2024-10-05"), + confirmedDate: new Date("2024-10-03"), + status: SaleOrderItemStatusEnum.Ready, + }, + { + id: "soi_10", + orderId: "so_5", + materialId: "5", + material: mockMaterials.find((m) => m.id === "5"), + description: "Kayış V-Tipi", + quantity: 50, + deliveredQuantity: 50, + unitId: "KOLI", + unit: mockMaterials.find((m) => m.id === "KOLI"), + unitPrice: 45.0, + totalAmount: 2250, + requestedDate: new Date("2024-10-05"), + confirmedDate: new Date("2024-10-03"), + status: SaleOrderItemStatusEnum.Ready, + }, + ], + deliveries: [], + invoices: [], + creationTime: new Date("2024-09-05"), + lastModificationTime: new Date("2024-09-06"), + }, + { + id: "6", + orderNumber: "ORD-2024-006", + customerId: "5", // Otomotiv Parça A.Ş. + customer: mockBusinessParties.find((c) => c.id === "5"), + orderDate: new Date("2024-09-10"), + requestedDeliveryDate: new Date("2024-10-10"), + confirmedDeliveryDate: undefined, + status: SaleOrderStatusEnum.Draft, + subtotal: 45000, + taxAmount: 8100, + discountAmount: 2250, + totalAmount: 50850, + currency: "TRY", + paymentTerms: PaymentTerms.Net30, + deliveryAddress: { + street: "OSB 1. Cadde No:45", + city: "Kocaeli", + state: "Kocaeli", + postalCode: "41000", + country: "Türkiye", + }, + billingAddress: { + street: "OSB 1. Cadde No:45", + city: "Kocaeli", + state: "Kocaeli", + postalCode: "41000", + country: "Türkiye", + }, + items: [ + { + id: "soi_11", + orderId: "so_6", + materialId: "1", + material: mockMaterials.find((m) => m.id === "1"), + description: "Lastik 205/55R16", + quantity: 20, + deliveredQuantity: 0, + unitId: "MT", + unit: mockMaterials.find((m) => m.id === "MT"), + unitPrice: 450.0, + totalAmount: 9000, + requestedDate: new Date("2024-10-10"), + confirmedDate: undefined, + status: SaleOrderItemStatusEnum.Pending, + }, + ], + deliveries: [], + invoices: [], + creationTime: new Date("2024-09-10"), + lastModificationTime: new Date("2024-09-10"), + }, + { + id: "7", + orderNumber: "ORD-2024-007", + customerId: "5", // Teknoloji A.Ş. + customer: mockBusinessParties.find((c) => c.id === "5"), + orderDate: new Date("2024-08-10"), + requestedDeliveryDate: new Date("2024-09-10"), + confirmedDeliveryDate: new Date("2024-09-05"), + status: SaleOrderStatusEnum.Cancelled, + subtotal: 25000, + taxAmount: 4500, + discountAmount: 1250, + totalAmount: 28250, + currency: "TRY", + paymentTerms: PaymentTerms.Net30, + deliveryAddress: { + street: "Teknoloji Caddesi No:100", + city: "İstanbul", + state: "İstanbul", + postalCode: "34000", + country: "Türkiye", + }, + billingAddress: { + street: "Teknoloji Caddesi No:100", + city: "İstanbul", + state: "İstanbul", + postalCode: "34000", + country: "Türkiye", + }, + items: [ + { + id: "soi_12", + orderId: "so_7", + materialId: "2", + material: mockMaterials.find((m) => m.id === "2"), + description: "Güç Kaynağı 500W", + quantity: 25, + deliveredQuantity: 0, + unitId: "MT", + unit: mockMaterials.find((m) => m.id === "MT"), + unitPrice: 200.0, + totalAmount: 5000, + requestedDate: new Date("2024-09-10"), + confirmedDate: new Date("2024-09-05"), + status: SaleOrderItemStatusEnum.Pending, + }, + ], + deliveries: [], + invoices: [], + creationTime: new Date("2024-08-10"), + lastModificationTime: new Date("2024-08-15"), + }, + { + id: "8", + orderNumber: "ORD-2024-008", + customerId: "5", // Üretim Sanayi Ltd. + customer: mockBusinessParties.find((c) => c.id === "5"), + orderDate: new Date("2024-09-12"), + requestedDeliveryDate: new Date("2024-10-12"), + confirmedDeliveryDate: new Date("2024-10-10"), + status: SaleOrderStatusEnum.InProduction, + subtotal: 135000, + taxAmount: 24300, + discountAmount: 6750, + totalAmount: 152550, + currency: "TRY", + paymentTerms: PaymentTerms.Net60, + deliveryAddress: { + street: "Sanayi Sitesi 5. Cadde No:23", + city: "Bursa", + state: "Bursa", + postalCode: "16000", + country: "Türkiye", + }, + billingAddress: { + street: "Sanayi Sitesi 5. Cadde No:23", + city: "Bursa", + state: "Bursa", + postalCode: "16000", + country: "Türkiye", + }, + items: [ + { + id: "soi_13", + orderId: "so_8", + materialId: "3", + material: mockMaterials.find((m) => m.id === "3"), + description: "Hidrolik Silindir", + quantity: 10, + deliveredQuantity: 0, + unitId: "MT", + unit: mockMaterials.find((m) => m.id === "MT"), + unitPrice: 850.0, + totalAmount: 8500, + requestedDate: new Date("2024-10-12"), + confirmedDate: new Date("2024-10-10"), + status: SaleOrderItemStatusEnum.InProduction, + }, + { + id: "soi_14", + orderId: "so_8", + materialId: "4", + material: mockMaterials.find((m) => m.id === "4"), + description: "Hidrolik Hortum 2m", + quantity: 50, + deliveredQuantity: 0, + unitId: "M3", + unit: mockMaterials.find((m) => m.id === "M3"), + unitPrice: 75.0, + totalAmount: 3750, + requestedDate: new Date("2024-10-12"), + confirmedDate: new Date("2024-10-10"), + status: SaleOrderItemStatusEnum.InProduction, + }, + ], + deliveries: [], + invoices: [], + creationTime: new Date("2024-09-12"), + lastModificationTime: new Date("2024-09-13"), + }, + { + id: "9", + orderNumber: "ORD-2024-009", + customerId: "6", // Otomotiv Parça A.Ş. + customer: mockBusinessParties.find((c) => c.id === "6"), + orderDate: new Date("2024-09-15"), + requestedDeliveryDate: new Date("2024-10-15"), + confirmedDeliveryDate: new Date("2024-10-12"), + status: SaleOrderStatusEnum.Confirmed, + subtotal: 185000, + taxAmount: 33300, + discountAmount: 9250, + totalAmount: 209050, + currency: "TRY", + paymentTerms: PaymentTerms.Net30, + deliveryAddress: { + street: "OSB 1. Cadde No:45", + city: "Kocaeli", + state: "Kocaeli", + postalCode: "41000", + country: "Türkiye", + }, + billingAddress: { + street: "OSB 1. Cadde No:45", + city: "Kocaeli", + state: "Kocaeli", + postalCode: "41000", + country: "Türkiye", + }, + items: [ + { + id: "soi_15", + orderId: "so_9", + materialId: "5", + material: mockMaterials.find((m) => m.id === "5"), + description: "Amortisör Ön Sol", + quantity: 100, + deliveredQuantity: 0, + unitId: "M3", + unit: mockMaterials.find((m) => m.id === "M3"), + unitPrice: 320.0, + totalAmount: 32000, + requestedDate: new Date("2024-10-15"), + confirmedDate: new Date("2024-10-12"), + status: SaleOrderItemStatusEnum.Confirmed, + }, + { + id: "soi_16", + orderId: "so_9", + materialId: "1", + material: mockMaterials.find((m) => m.id === "1"), + description: "Amortisör Ön Sağ", + quantity: 100, + deliveredQuantity: 0, + unitId: "M2", + unit: mockMaterials.find((m) => m.id === "M2"), + unitPrice: 320.0, + totalAmount: 32000, + requestedDate: new Date("2024-10-15"), + confirmedDate: new Date("2024-10-12"), + status: SaleOrderItemStatusEnum.Confirmed, + }, + ], + deliveries: [], + invoices: [], + creationTime: new Date("2024-09-15"), + lastModificationTime: new Date("2024-09-16"), + }, + { + id: "10", + orderNumber: "ORD-2024-010", + customerId: "6", // Teknoloji A.Ş. + customer: mockBusinessParties.find((c) => c.id === "6"), + orderDate: new Date("2024-09-18"), + requestedDeliveryDate: new Date("2024-10-18"), + confirmedDeliveryDate: new Date("2024-10-15"), + status: SaleOrderStatusEnum.Confirmed, + subtotal: 275000, + taxAmount: 49500, + discountAmount: 13750, + totalAmount: 310750, + currency: "TRY", + paymentTerms: PaymentTerms.Net30, + deliveryAddress: { + street: "Teknoloji Caddesi No:100", + city: "İstanbul", + state: "İstanbul", + postalCode: "34000", + country: "Türkiye", + }, + billingAddress: { + street: "Teknoloji Caddesi No:100", + city: "İstanbul", + state: "İstanbul", + postalCode: "34000", + country: "Türkiye", + }, + items: [ + { + id: "soi_17", + orderId: "so_10", + materialId: "3", + material: mockMaterials.find((m) => m.id === "3"), + description: "Server Bilgisayar", + quantity: 5, + deliveredQuantity: 0, + unitId: "M2", + unit: mockMaterials.find((m) => m.id === "M2"), + unitPrice: 12500.0, + totalAmount: 62500, + requestedDate: new Date("2024-10-18"), + confirmedDate: new Date("2024-10-15"), + status: SaleOrderItemStatusEnum.Confirmed, + }, + { + id: "soi_18", + orderId: "so_10", + materialId: "2", + material: mockMaterials.find((m) => m.id === "2"), + description: "Network Switch 48 Port", + quantity: 10, + deliveredQuantity: 0, + unitId: "M2", + unit: mockMaterials.find((m) => m.id === "M2"), + unitPrice: 2500.0, + totalAmount: 25000, + requestedDate: new Date("2024-10-18"), + confirmedDate: new Date("2024-10-15"), + status: SaleOrderItemStatusEnum.Confirmed, + }, + { + id: "soi_19", + orderId: "so_10", + materialId: "4", + material: mockMaterials.find((m) => m.id === "4"), + description: "UPS 5KVA", + quantity: 3, + deliveredQuantity: 0, + unitId: "M2", + unit: mockMaterials.find((m) => m.id === "M2"), + unitPrice: 4500.0, + totalAmount: 13500, + requestedDate: new Date("2024-10-18"), + confirmedDate: new Date("2024-10-15"), + status: SaleOrderItemStatusEnum.Confirmed, + }, + ], + deliveries: [], + invoices: [], + creationTime: new Date("2024-09-18"), + lastModificationTime: new Date("2024-09-19"), + }, +]; diff --git a/ui/src/mocks/mockSalesTeams.ts b/ui/src/mocks/mockSalesTeams.ts new file mode 100644 index 00000000..50f995cd --- /dev/null +++ b/ui/src/mocks/mockSalesTeams.ts @@ -0,0 +1,241 @@ +import { Team, TeamRoleEnum } from "../types/common"; +import { TargetTypeEnum, TargetStatusEnum } from "../types/crm"; +import { mockEmployees } from "./mockEmployees"; + +export const mockSalesTeams: Team[] = [ + { + id: "team-001", + code: "ST-001", + name: "Kurumsal Satış Ekibi", + description: + "Büyük kurumsal müşteriler ve enterprise çözümler için satış ekibi", + managerId: "1", + manager: mockEmployees.find((emp) => emp.id === "1"), + members: [ + { + id: "member-001", + teamId: "team-001", + employeeId: "2", + employee: mockEmployees.find((emp) => emp.id === "2"), + role: TeamRoleEnum.Lead, + joinDate: new Date("2024-01-15"), + isActive: true, + }, + { + id: "member-002", + teamId: "team-001", + employeeId: "3", + employee: mockEmployees.find((emp) => emp.id === "3"), + role: TeamRoleEnum.Member, + joinDate: new Date("2024-02-01"), + isActive: true, + }, + { + id: "member-003", + teamId: "team-001", + employeeId: "4", + employee: mockEmployees.find((emp) => emp.id === "4"), + role: TeamRoleEnum.Member, + joinDate: new Date("2024-03-10"), + isActive: true, + }, + ], + territories: [ + { + id: "territory-001", + territoryCode: "TR-IST", + name: "İstanbul Anadolu", + description: "İstanbul Anadolu yakası kurumsal müşteriler", + region: "Marmara", + countries: ["Türkiye"], + cities: ["İstanbul"], + assignedTeamId: "team-001", + isActive: true, + }, + { + id: "territory-002", + territoryCode: "TR-ANK", + name: "Ankara", + description: "Ankara bölgesi kurumsal müşteriler", + region: "İç Anadolu", + countries: ["Türkiye"], + cities: ["Ankara"], + assignedTeamId: "team-001", + isActive: true, + }, + ], + targets: [ + { + id: "target-001", + teamId: "team-001", + targetPeriod: "2024-Q4", + targetType: TargetTypeEnum.Revenue, + targetValue: 5000000, + actualValue: 4200000, + currency: "TRY", + startDate: new Date("2024-10-01"), + endDate: new Date("2024-12-31"), + status: TargetStatusEnum.Active, + }, + ], + isActive: true, + creationTime: new Date("2024-01-01"), + lastModificationTime: new Date("2024-11-01"), + }, + { + id: "team-002", + code: "ST-002", + name: "KOBİ Satış Ekibi", + description: "Küçük ve orta boy işletmeler için satış ekibi", + managerId: "5", + manager: mockEmployees.find((emp) => emp.id === "5"), + members: [ + { + id: "member-004", + teamId: "team-002", + employeeId: "6", + employee: mockEmployees.find((emp) => emp.id === "6"), + role: TeamRoleEnum.Lead, + joinDate: new Date("2024-01-20"), + isActive: true, + }, + { + id: "member-005", + teamId: "team-002", + employeeId: "7", + employee: mockEmployees.find((emp) => emp.id === "7"), + role: TeamRoleEnum.Member, + joinDate: new Date("2024-02-15"), + isActive: true, + }, + { + id: "member-006", + teamId: "team-002", + employeeId: "8", + employee: mockEmployees.find((emp) => emp.id === "8"), + role: TeamRoleEnum.Member, + joinDate: new Date("2024-04-01"), + isActive: true, + }, + { + id: "member-007", + teamId: "team-002", + employeeId: "9", + employee: mockEmployees.find((emp) => emp.id === "9"), + role: TeamRoleEnum.Member, + joinDate: new Date("2024-05-15"), + isActive: true, + }, + ], + territories: [ + { + id: "territory-003", + territoryCode: "TR-IZM", + name: "İzmir", + description: "İzmir bölgesi KOBİ müşteriler", + region: "Ege", + countries: ["Türkiye"], + cities: ["İzmir", "Manisa", "Balıkesir"], + assignedTeamId: "team-002", + isActive: true, + }, + { + id: "territory-004", + territoryCode: "TR-BUR", + name: "Bursa", + description: "Bursa ve çevre iller KOBİ müşteriler", + region: "Marmara", + countries: ["Türkiye"], + cities: ["Bursa", "Kocaeli", "Sakarya"], + assignedTeamId: "team-002", + isActive: true, + }, + ], + targets: [ + { + id: "target-002", + teamId: "team-002", + targetPeriod: "2024-Q4", + targetType: TargetTypeEnum.Revenue, + targetValue: 3000000, + actualValue: 3150000, + currency: "TRY", + startDate: new Date("2024-10-01"), + endDate: new Date("2024-12-31"), + status: TargetStatusEnum.Active, + }, + ], + isActive: true, + creationTime: new Date("2024-01-05"), + lastModificationTime: new Date("2024-10-15"), + }, + { + id: "team-003", + code: "ST-003", + name: "E-ticaret Satış Ekibi", + description: "Online satış kanalları ve e-ticaret platformları yönetimi", + managerId: "10", + manager: mockEmployees.find((emp) => emp.id === "10"), + members: [ + { + id: "member-008", + teamId: "team-003", + employeeId: "1", + employee: mockEmployees.find((emp) => emp.id === "1"), + role: TeamRoleEnum.Lead, + joinDate: new Date("2024-03-01"), + isActive: true, + }, + { + id: "member-009", + teamId: "team-003", + employeeId: "2", + employee: mockEmployees.find((emp) => emp.id === "2"), + role: TeamRoleEnum.Member, + joinDate: new Date("2024-03-15"), + isActive: true, + }, + { + id: "member-010", + teamId: "team-003", + employeeId: "3", + employee: mockEmployees.find((emp) => emp.id === "3"), + role: TeamRoleEnum.Member, + joinDate: new Date("2024-04-10"), + isActive: true, + }, + ], + territories: [ + { + id: "territory-005", + territoryCode: "TR-ONL", + name: "Online Türkiye", + description: "Türkiye geneli online satış kanalları", + region: "Online", + countries: ["Türkiye"], + cities: [], + assignedTeamId: "team-003", + isActive: true, + }, + ], + targets: [ + { + id: "target-003", + teamId: "team-003", + targetPeriod: "2024-Q4", + targetType: TargetTypeEnum.Revenue, + targetValue: 2000000, + actualValue: 1800000, + currency: "TRY", + startDate: new Date("2024-10-01"), + endDate: new Date("2024-12-31"), + status: TargetStatusEnum.Active, + }, + ], + isActive: true, + creationTime: new Date("2024-02-15"), + lastModificationTime: new Date("2024-11-05"), + }, +]; + +export default mockSalesTeams; diff --git a/ui/src/mocks/mockSerialNumbers.ts b/ui/src/mocks/mockSerialNumbers.ts new file mode 100644 index 00000000..806bb45c --- /dev/null +++ b/ui/src/mocks/mockSerialNumbers.ts @@ -0,0 +1,40 @@ +import { SerialStatusEnum } from "../types/mm"; +import { mockMaterials } from "./mockMaterials"; + +export const mockSerialNumbers = [ + { + id: "1", + materialId: "1", + material: mockMaterials.find((m) => m.id === "1"), + serialNumber: "SN2024001", + lotId: "1", + productionDate: new Date("2024-01-01"), + warrantyExpiryDate: new Date("2026-01-01"), + currentLocationId: "LOC-A01", + status: SerialStatusEnum.Available, + isActive: true, + }, + { + id: "2", + materialId: "2", + material: mockMaterials.find((m) => m.id === "2"), + serialNumber: "SN2024002", + lotId: "1", + productionDate: new Date("2024-01-02"), + warrantyExpiryDate: new Date("2026-01-02"), + currentLocationId: "LOC-A02", + status: SerialStatusEnum.InUse, + isActive: true, + }, + { + id: "3", + materialId: "3", + material: mockMaterials.find((m) => m.id === "3"), + serialNumber: "SN2024003", + productionDate: new Date("2024-01-03"), + warrantyExpiryDate: new Date("2025-01-03"), + currentLocationId: "LOC-B01", + status: SerialStatusEnum.Maintenance, + isActive: true, + }, +]; diff --git a/ui/src/mocks/mockStockItems.ts b/ui/src/mocks/mockStockItems.ts new file mode 100644 index 00000000..c64f6268 --- /dev/null +++ b/ui/src/mocks/mockStockItems.ts @@ -0,0 +1,95 @@ +import { WmStockItem, StockStatusEnum } from "../types/wm"; +import { mockMaterials } from "./mockMaterials"; + +export const mockStockItems: WmStockItem[] = [ + { + id: "1", + materialId: "1", + material: mockMaterials.find((mat) => mat.id === "1"), + warehouseId: "1", + zoneId: "1", + locationId: "3", + quantity: 50, + reservedQuantity: 10, + availableQuantity: 40, + unitId: "adet", + lotNumber: "LOT2024001", + serialNumber: undefined, + expiryDate: undefined, + receivedDate: new Date("2024-10-15"), + lastMovementDate: new Date("2024-11-15"), + status: StockStatusEnum.Available, + }, + { + id: "2", + materialId: "2", + material: mockMaterials.find((mat) => mat.id === "2"), + warehouseId: "1", + zoneId: "2", + locationId: "4", + quantity: 25, + reservedQuantity: 5, + availableQuantity: 20, + unitId: "metre", + lotNumber: "LOT2024002", + serialNumber: undefined, + expiryDate: undefined, + receivedDate: new Date("2024-11-01"), + lastMovementDate: new Date("2024-11-20"), + status: StockStatusEnum.Available, + }, + { + id: "3", + materialId: "3", + material: mockMaterials.find((mat) => mat.id === "3"), + warehouseId: "1", + zoneId: "2", + locationId: "1", + quantity: 150, + reservedQuantity: 0, + availableQuantity: 150, + unitId: "adet", + lotNumber: "LOT2024003", + serialNumber: undefined, + expiryDate: undefined, + receivedDate: new Date("2024-09-20"), + lastMovementDate: new Date("2024-10-25"), + status: StockStatusEnum.Available, + }, + { + id: "4", + materialId: "4", + material: mockMaterials.find((mat) => mat.id === "4"), + warehouseId: "1", + zoneId: "2", + locationId: "2", + quantity: 30, + reservedQuantity: 8, + availableQuantity: 22, + unitId: "adet", + lotNumber: "LOT2024004", + serialNumber: undefined, + expiryDate: undefined, + receivedDate: new Date("2024-08-10"), + lastMovementDate: new Date("2024-11-18"), + status: StockStatusEnum.Available, + }, + { + id: "5", + materialId: "5", + material: mockMaterials.find((mat) => mat.id === "5"), + warehouseId: "1", + zoneId: "1", + locationId: "2", + quantity: 5, + reservedQuantity: 0, + availableQuantity: 0, + unitId: "adet", + lotNumber: "LOT2024005", + serialNumber: undefined, + expiryDate: undefined, + receivedDate: new Date("2024-11-25"), + lastMovementDate: new Date("2024-11-25"), + status: StockStatusEnum.Quarantine, + }, +]; diff --git a/ui/src/mocks/mockStockMovements.ts b/ui/src/mocks/mockStockMovements.ts new file mode 100644 index 00000000..c6bcd735 --- /dev/null +++ b/ui/src/mocks/mockStockMovements.ts @@ -0,0 +1,303 @@ +import { + MmStockMovement, + MovementTypeEnum, + MovementStatusEnum, +} from "../types/mm"; +import { mockLocations } from "./mockLocations"; +import { mockMaterials } from "./mockMaterials"; +import { mockUnits } from "./mockUnits"; +import { mockWarehouses } from "./mockWarehouses"; +import { mockZones } from "./mockZones"; + +// Unified mock data for all material movements - combines previous mockMovements and mockStockMovements +export const mockStockMovements: MmStockMovement[] = [ + { + id: "1", + movementNumber: "GR-2024-001", + materialId: "1", + material: mockMaterials.find((m) => m.id === "1")!, + movementType: MovementTypeEnum.GoodsReceipt, + toWarehouseId: "1", + toWarehouse: mockWarehouses.find((w) => w.id === "1"), + toZoneId: "2", + toZone: mockZones.find((z) => z.id === "2"), + toLocationId: "2", + toLocation: mockLocations.find((l) => l.id === "2"), + quantity: 100, + unitId: "KG", + unit: mockUnits.find((u) => u.id === "KG"), + lotNumber: "LOT-2024-001", + referenceDocument: "PO-2024-001", + referenceDocumentType: "Purchase Order", + referenceType: "Purchase Order", + movementDate: new Date("2024-01-15T10:30:00"), + description: "Satın alma girişi", + reason: "Satın alma girişi", + performedBy: "Mehmet Özkan", + approvedBy: "manager1", + status: MovementStatusEnum.Completed, + creationTime: new Date("2024-01-15T10:30:00"), + }, + { + id: "5", + movementNumber: "GR-2024-001", + materialId: "2", + material: mockMaterials.find((m) => m.id === "2")!, + movementType: MovementTypeEnum.GoodsReceipt, + toWarehouseId: "1", + toWarehouse: mockWarehouses.find((w) => w.id === "1"), + toZoneId: "1", + toZone: mockZones.find((z) => z.id === "1"), + toLocationId: "3", + toLocation: mockLocations.find((l) => l.id === "3"), + quantity: 200, + unitId: "MT", + unit: mockUnits.find((u) => u.id === "metre"), + lotNumber: "LOT-2024-005", + referenceDocument: "PO-2024-002", + referenceDocumentType: "Purchase Order", + referenceType: "Purchase Order", + movementDate: new Date("2024-11-20T08:30:00"), + description: "Hammadde girişi", + reason: "Hammadde girişi", + performedBy: "Ali Veli", + approvedBy: "manager2", + status: MovementStatusEnum.Completed, + creationTime: new Date("2024-11-20T08:30:00"), + }, + { + id: "10", + movementNumber: "GR-2024-007", + materialId: "1", + material: mockMaterials.find((m) => m.id === "1")!, + + movementType: MovementTypeEnum.GoodsReceipt, + toWarehouseId: "1", + toWarehouse: mockWarehouses.find((w) => w.id === "1"), + toZoneId: "1", + toZone: mockZones.find((z) => z.id === "1"), + toLocationId: "1", + toLocation: mockLocations.find((l) => l.id === "1"), + + quantity: 10, + unitId: "KG", + unit: mockUnits.find((u) => u.id === "KG"), + lotNumber: "LOT-2024-001", + referenceDocument: "RET-2024-001", + referenceDocumentType: "Return Order", + referenceType: "Return Order", + movementDate: new Date("2024-11-30T10:30:00"), + description: "Müşteri iadesi", + reason: "Müşteri iadesi", + performedBy: "İade Operatörü", + status: MovementStatusEnum.Planned, + creationTime: new Date("2024-11-30T09:00:00"), + }, + { + id: "4", + movementNumber: "GR-2024-005", + materialId: "2", + material: mockMaterials.find((m) => m.id === "2")!, + movementType: MovementTypeEnum.GoodsReceipt, + toWarehouseId: "2", + toWarehouse: mockWarehouses.find((w) => w.id === "2"), + toZoneId: "3", + toZone: mockZones.find((z) => z.id === "3"), + toLocationId: "LOC004", + toLocation: mockLocations.find((l) => l.id === "4"), + quantity: 5, + unitId: "M2", + unit: mockUnits.find((u) => u.id === "M2"), + referenceDocument: "ADJ-2024-001", + referenceDocumentType: "Stock Adjustment", + referenceType: "Stock Adjustment", + movementDate: new Date("2024-01-18T16:45:00"), + description: "Sayım farkı düzeltmesi", + reason: "Sayım farkı düzeltmesi", + performedBy: "Stok Kontrol", + approvedBy: "manager2", + status: MovementStatusEnum.Completed, + creationTime: new Date("2024-01-18T16:45:00"), + }, + + // Goods Issues + { + id: "2", + movementNumber: "GI-2024-001", + materialId: "1", + material: mockMaterials.find((m) => m.id === "1")!, + movementType: MovementTypeEnum.GoodsIssue, + toWarehouseId: "1", + toWarehouse: mockWarehouses.find((w) => w.id === "1"), + toZoneId: "1", + toZone: mockZones.find((z) => z.id === "1"), + toLocationId: "1", + toLocation: mockLocations.find((l) => l.id === "1"), + quantity: 50, + unitId: "KG", + unit: mockUnits.find((u) => u.id === "KG"), + lotNumber: "LOT-2024-001", + referenceDocument: "SO-2024-001", + referenceDocumentType: "Sales Order", + referenceType: "Sales Order", + movementDate: new Date("2024-01-16T14:15:00"), + description: "Satış çıkışı", + reason: "Satış çıkışı", + performedBy: "Ayşe Yılmaz", + approvedBy: "manager1", + status: MovementStatusEnum.Completed, + creationTime: new Date("2024-01-16T14:15:00"), + }, + { + id: "6", + movementNumber: "GI-2024-001", + materialId: "2", + material: mockMaterials.find((m) => m.id === "2")!, + movementType: MovementTypeEnum.GoodsIssue, + toWarehouseId: "1", + toWarehouse: mockWarehouses.find((w) => w.id === "1"), + toZoneId: "1", + toZone: mockZones.find((z) => z.id === "1"), + toLocationId: "3", + toLocation: mockLocations.find((l) => l.id === "3"), + quantity: 50, + unitId: "MT", + unit: mockUnits.find((u) => u.id === "KG"), + lotNumber: "LOT-2024-005", + referenceDocument: "WO-2024-001", + referenceDocumentType: "Work Order", + referenceType: "Work Order", + movementDate: new Date("2024-11-26T10:15:00"), + description: "Üretim için malzeme çıkışı", + reason: "Üretim için malzeme çıkışı", + performedBy: "Mehmet Üretici", + status: MovementStatusEnum.InProgress, + creationTime: new Date("2024-11-26T10:15:00"), + }, + { + id: "9", + movementNumber: "GI-2024-009", + materialId: "4", + material: mockMaterials.find((m) => m.id === "4") || mockMaterials[0], + movementType: MovementTypeEnum.GoodsIssue, + + toWarehouseId: "1", + toWarehouse: mockWarehouses.find((w) => w.id === "1"), + toZoneId: "1", + toZone: mockZones.find((z) => z.id === "1"), + toLocationId: "3", + toLocation: mockLocations.find((l) => l.id === "3"), + + quantity: 100, + unitId: "ADET", + unit: mockUnits.find((u) => u.id === "ADET"), + referenceDocument: "WO-2024-002", + referenceDocumentType: "Work Order", + referenceType: "Work Order", + movementDate: new Date("2024-11-29T14:00:00"), + description: "Üretim tamamlama girişi", + reason: "Üretim tamamlama girişi", + performedBy: "Üretim Operatörü", + status: MovementStatusEnum.Completed, + creationTime: new Date("2024-11-29T14:00:00"), + }, + { + id: "7", + movementNumber: "GI-2024-003", + materialId: "3", + material: mockMaterials.find((m) => m.id === "3")!, + movementType: MovementTypeEnum.GoodsIssue, + toWarehouseId: "1", + toWarehouse: mockWarehouses.find((w) => w.id === "1"), + toZoneId: "1", + toZone: mockZones.find((z) => z.id === "1"), + toLocationId: "3", + toLocation: mockLocations.find((l) => l.id === "3"), + quantity: 500, + unitId: "ADET", + unit: mockUnits.find((u) => u.id === "ADET"), + lotNumber: "LOT-2024-006", + referenceDocument: "MR-2024-001", + referenceDocumentType: "Material Request", + referenceType: "Material Request", + movementDate: new Date("2024-11-27T15:30:00"), + description: "Bakım için malzeme talebi", + reason: "Bakım için malzeme talebi", + performedBy: "Bakım Ekibi", + status: MovementStatusEnum.Planned, + creationTime: new Date("2024-11-25T09:00:00"), + }, + + // Transfers + { + id: "3", + movementNumber: "TR-2024-001", + materialId: "1", + material: mockMaterials.find((m) => m.id === "1")!, + movementType: MovementTypeEnum.Transfer, + + fromWarehouseId: "2", + fromWarehouse: mockWarehouses.find((w) => w.id === "2"), + fromZoneId: "3", + fromZone: mockZones.find((z) => z.id === "3"), + fromLocationId: "4", + fromLocation: mockLocations.find((l) => l.id === "4"), + + toWarehouseId: "1", + toWarehouse: mockWarehouses.find((w) => w.id === "1"), + toZoneId: "2", + toZone: mockZones.find((z) => z.id === "2"), + toLocationId: "1", + toLocation: mockLocations.find((l) => l.id === "1"), + + quantity: 25, + unitId: "KG", + unit: mockUnits.find((u) => u.id === "KG"), + lotNumber: "LOT-2024-001", + referenceDocument: "TR-2024-001", + referenceDocumentType: "Transfer Order", + referenceType: "Transfer Order", + movementDate: new Date("2024-01-17T09:00:00"), + description: "Depo transferi", + reason: "Depo transferi", + performedBy: "Fatma Demir", + approvedBy: "manager1", + status: MovementStatusEnum.Completed, + creationTime: new Date("2024-01-17T09:00:00"), + }, + { + id: "8", + movementNumber: "TR-2024-002", + materialId: "1", + material: mockMaterials.find((m) => m.id === "1")!, + movementType: MovementTypeEnum.Transfer, + + fromWarehouseId: "1", + fromWarehouse: mockWarehouses.find((w) => w.id === "1"), + fromZoneId: "1", + fromZone: mockZones.find((z) => z.id === "1"), + fromLocationId: "1", + fromLocation: mockLocations.find((l) => l.id === "1"), + + toWarehouseId: "1", + toWarehouse: mockWarehouses.find((w) => w.id === "1"), + toZoneId: "1", + toZone: mockZones.find((z) => z.id === "1"), + toLocationId: "1", + toLocation: mockLocations.find((l) => l.id === "1"), + + quantity: 15, + unitId: "KG", + unit: mockUnits.find((u) => u.id === "KG"), + lotNumber: "LOT-2024-001", + referenceDocument: "TR-2024-002", + referenceDocumentType: "Transfer Order", + referenceType: "Transfer Order", + movementDate: new Date("2024-11-28T11:00:00"), + description: "Şube deposuna transfer", + reason: "Şube deposuna transfer", + performedBy: "Transfer Operatörü", + status: MovementStatusEnum.InProgress, + creationTime: new Date("2024-11-28T10:00:00"), + }, +]; diff --git a/ui/src/mocks/mockUnits.ts b/ui/src/mocks/mockUnits.ts new file mode 100644 index 00000000..79d15374 --- /dev/null +++ b/ui/src/mocks/mockUnits.ts @@ -0,0 +1,12 @@ +import { MmUnit } from "../types/mm"; + +export const mockUnits: MmUnit[] = [ + { id: "KG", code: "KG", name: "Kilogram", isActive: true }, + { id: "ADET", code: "ADET", name: "Adet", isActive: true }, + { id: "LT", code: "LT", name: "Litre", isActive: true }, + { id: "MT", code: "MT", name: "Metre", isActive: true }, + { id: "M2", code: "M²", name: "Metrekare", isActive: true }, + { id: "M3", code: "M³", name: "Metreküp", isActive: true }, + { id: "PAKET", code: "PAKET", name: "Paket", isActive: true }, + { id: "KOLI", code: "KOLI", name: "Koli", isActive: true }, +]; diff --git a/ui/src/mocks/mockWarehouses.ts b/ui/src/mocks/mockWarehouses.ts new file mode 100644 index 00000000..b14eb2fa --- /dev/null +++ b/ui/src/mocks/mockWarehouses.ts @@ -0,0 +1,132 @@ +import { SecurityLevelEnum } from "../types/mrp"; +import { WmWarehouse, WarehouseTypeEnum } from "../types/wm"; +import { mockLocations } from "./mockLocations"; +import { mockZones } from "./mockZones"; + +export const mockWarehouses: WmWarehouse[] = [ + { + id: "1", + code: "WH001", + name: "Ana Hammadde Deposu", + description: "Üretim için gerekli hammaddelerin depolandığı ana depo", + address: { + street: "Organize Sanayi Bölgesi 1. Cadde No: 15", + city: "İstanbul", + state: "İstanbul", + postalCode: "34000", + country: "Türkiye", + }, + warehouseType: WarehouseTypeEnum.RawMaterials, + zones: mockZones.filter((zone) => zone.warehouseId === "1"), + locations: mockLocations.filter((location) => location.warehouseId === "1"), + isMainWarehouse: true, + capacity: 5000, + currentUtilization: 0, + isActive: true, + temperatureControlled: false, + managerId: 1, + securityLevel: SecurityLevelEnum.Medium, + creationTime: new Date(), + lastModificationTime: new Date(), + }, + { + id: "2", + code: "WH002", + name: "Mamul Deposu", + description: "Üretimi tamamlanmış mamullerin depolandığı alan", + address: { + street: "Organize Sanayi Bölgesi 1. Cadde No: 15", + city: "İstanbul", + state: "İstanbul", + postalCode: "34000", + country: "Türkiye", + }, + warehouseType: WarehouseTypeEnum.FinishedGoods, + zones: mockZones.filter((zone) => zone.warehouseId === "2"), + locations: mockLocations.filter((location) => location.warehouseId === "2"), + isMainWarehouse: false, + capacity: 3000, + isActive: true, + currentUtilization: 0, + temperatureControlled: false, + managerId: 1, + securityLevel: SecurityLevelEnum.Medium, + creationTime: new Date(), + lastModificationTime: new Date(), + }, + { + id: "3", + code: "WH003", + name: "Ara Ürün Deposu", + description: "İşlenmiş ara ürünlerin geçici depolandığı alan", + address: { + street: "Organize Sanayi Bölgesi 1. Cadde No: 15", + city: "İstanbul", + state: "İstanbul", + postalCode: "34000", + country: "Türkiye", + }, + warehouseType: WarehouseTypeEnum.WorkInProgress, + zones: mockZones.filter((zone) => zone.warehouseId === "3"), + locations: mockLocations.filter((location) => location.warehouseId === "3"), + isMainWarehouse: false, + capacity: 1500, + isActive: true, + currentUtilization: 0, + managerId: 2, + securityLevel: SecurityLevelEnum.High, + temperatureControlled: false, + creationTime: new Date(), + lastModificationTime: new Date(), + }, + { + id: "4", + code: "WH004", + name: "Karantina Deposu", + description: "Kalite kontrolü bekleyen ürünlerin depolandığı alan", + address: { + street: "Organize Sanayi Bölgesi 1. Cadde No: 15", + city: "İstanbul", + state: "İstanbul", + postalCode: "34000", + country: "Türkiye", + }, + warehouseType: WarehouseTypeEnum.Quarantine, + zones: mockZones.filter((zone) => zone.warehouseId === "4"), + locations: mockLocations.filter((location) => location.warehouseId === "4"), + isMainWarehouse: true, + capacity: 500, + isActive: true, + temperatureControlled: false, + currentUtilization: 0, + managerId: 3, + securityLevel: SecurityLevelEnum.Low, + creationTime: new Date(), + lastModificationTime: new Date(), + }, + { + id: "5", + code: "WH005", + name: "İade Deposu", + description: "Müşterilerden dönen ürünlerin depolandığı alan", + address: { + street: "Organize Sanayi Bölgesi 1. Cadde No: 15", + city: "İstanbul", + state: "İstanbul", + postalCode: "34000", + country: "Türkiye", + }, + warehouseType: WarehouseTypeEnum.Returns, + zones: mockZones.filter((zone) => zone.warehouseId === "5"), + locations: mockLocations.filter((location) => location.warehouseId === "5"), + isMainWarehouse: true, + capacity: 800, + isActive: true, + temperatureControlled: false, + currentUtilization: 0, + managerId: 4, + securityLevel: SecurityLevelEnum.Restricted, + creationTime: new Date(), + lastModificationTime: new Date(), + }, +]; diff --git a/ui/src/mocks/mockWaybills.ts b/ui/src/mocks/mockWaybills.ts new file mode 100644 index 00000000..7d08ef74 --- /dev/null +++ b/ui/src/mocks/mockWaybills.ts @@ -0,0 +1,220 @@ +import { FiWaybill, WaybillTypeEnum, WaybillStatusEnum } from "../types/fi"; +import { mockCurrentAccounts } from "./mockCurrentAccounts"; + +export const mockWaybills: FiWaybill[] = [ + { + id: "1", + waybillNumber: "IRS2024001", + waybillType: WaybillTypeEnum.Outgoing, + currentAccountId: "1", + currentAccount: mockCurrentAccounts.find((acc) => acc.id === "1"), + waybillDate: new Date("2024-01-15"), + deliveryDate: new Date("2024-01-16"), + subtotal: 50300, + taxAmount: 9054, + discountAmount: 0, + totalAmount: 59354, + currency: "TRY", + status: WaybillStatusEnum.Delivered, + isInvoiced: false, + items: [ + { + id: "1", + waybillId: "1", + description: "Laptop Dell Inspiron 15", + quantity: 2, + unit: "Adet", + unitPrice: 25000, + lineTotal: 59000, + discountRate: 0, + discountAmount: 0, + taxRate: 18, + taxAmount: 9000, + netAmount: 50000, + }, + { + id: "2", + waybillId: "1", + description: "Wireless Mouse", + quantity: 2, + unit: "Adet", + unitPrice: 150, + lineTotal: 354, + discountRate: 0, + discountAmount: 0, + taxRate: 18, + taxAmount: 54, + netAmount: 300, + }, + ], + deliveryAddress: "Ataşehir Mah. Barbaros Cad. No:15 Ataşehir/İstanbul", + receiverName: "Ahmet Yılmaz", + receiverPhone: "+90 212 555 0101", + carrierCompany: "MNG Kargo", + trackingNumber: "MNG123456789", + notes: "Dikkatli taşınması gerekiyor.", + creationTime: new Date("2024-01-15T08:00:00"), + lastModificationTime: new Date("2024-01-16T14:30:00"), + }, + { + id: "2", + waybillNumber: "IRS2024002", + waybillType: WaybillTypeEnum.Outgoing, + currentAccountId: "2", + currentAccount: mockCurrentAccounts.find((acc) => acc.id === "2"), + waybillDate: new Date("2024-01-16"), + deliveryDate: new Date("2024-01-17"), + subtotal: 15000, + taxAmount: 2700, + discountAmount: 0, + totalAmount: 17700, + currency: "TRY", + status: WaybillStatusEnum.Delivered, + isInvoiced: false, + items: [ + { + id: "3", + waybillId: "2", + description: "Yazılım Lisansı - ERP Modülü", + quantity: 1, + unit: "Adet", + unitPrice: 15000, + lineTotal: 17700, + discountRate: 0, + discountAmount: 0, + taxRate: 18, + taxAmount: 2700, + netAmount: 15000, + }, + ], + deliveryAddress: "Kadıköy Mah. Bağdat Cad. No:45 Kadıköy/İstanbul", + receiverName: "Mehmet Demir", + receiverPhone: "+90 216 444 0202", + carrierCompany: "Yurtiçi Kargo", + trackingNumber: "YK987654321", + notes: "Dijital teslimat yapılacak.", + creationTime: new Date("2024-01-16T09:30:00"), + lastModificationTime: new Date("2024-01-17T16:00:00"), + }, + { + id: "3", + waybillNumber: "IRS2024003", + waybillType: WaybillTypeEnum.Outgoing, + currentAccountId: "1", + currentAccount: mockCurrentAccounts.find((acc) => acc.id === "1"), + waybillDate: new Date("2024-01-17"), + deliveryDate: new Date("2024-01-18"), + subtotal: 10500, + taxAmount: 1890, + discountAmount: 0, + totalAmount: 12390, + currency: "TRY", + status: WaybillStatusEnum.Delivered, + isInvoiced: true, + invoiceId: "1", + items: [ + { + id: "4", + waybillId: "3", + description: "Monitor 24 inch LED", + quantity: 3, + unit: "Adet", + unitPrice: 3500, + lineTotal: 12390, + discountRate: 0, + discountAmount: 0, + taxRate: 18, + taxAmount: 1890, + netAmount: 10500, + }, + ], + deliveryAddress: "Ataşehir Mah. Barbaros Cad. No:15 Ataşehir/İstanbul", + receiverName: "Ahmet Yılmaz", + receiverPhone: "+90 212 555 0101", + carrierCompany: "PTT Kargo", + trackingNumber: "PTT555666777", + notes: "Fatura kesilmiş, faturalandırıldı.", + creationTime: new Date("2024-01-17T10:00:00"), + lastModificationTime: new Date("2024-01-18T11:30:00"), + }, + { + id: "4", + waybillNumber: "IRS2024004", + waybillType: WaybillTypeEnum.Outgoing, + currentAccountId: "2", + currentAccount: mockCurrentAccounts.find((acc) => acc.id === "2"), + waybillDate: new Date("2024-01-18"), + deliveryDate: new Date("2024-01-19"), + subtotal: 35000, + taxAmount: 6300, + discountAmount: 1750, + totalAmount: 39550, + currency: "TRY", + status: WaybillStatusEnum.Delivered, + isInvoiced: false, + items: [ + { + id: "5", + waybillId: "4", + description: "Tablet Samsung Galaxy Tab", + quantity: 10, + unit: "Adet", + unitPrice: 3500, + lineTotal: 39550, + discountRate: 5, + discountAmount: 1750, + taxRate: 18, + taxAmount: 6300, + netAmount: 33250, + }, + ], + deliveryAddress: "Şişli Mah. Mecidiyeköy Cad. No:100 Şişli/İstanbul", + receiverName: "Fatma Kaya", + receiverPhone: "+90 212 777 0303", + carrierCompany: "Aras Kargo", + trackingNumber: "ARS111222333", + notes: "Toplu teslimat, %5 indirim uygulandı.", + creationTime: new Date("2024-01-18T14:00:00"), + lastModificationTime: new Date("2024-01-19T10:15:00"), + }, + { + id: "5", + waybillNumber: "IRS2024005", + waybillType: WaybillTypeEnum.Incoming, + currentAccountId: "4", + currentAccount: mockCurrentAccounts.find((acc) => acc.id === "4"), + waybillDate: new Date("2024-01-19"), + deliveryDate: new Date("2024-01-20"), + subtotal: 20000, + taxAmount: 3600, + discountAmount: 0, + totalAmount: 23600, + currency: "TRY", + status: WaybillStatusEnum.Delivered, + isInvoiced: false, + items: [ + { + id: "6", + waybillId: "5", + description: "Klavye Mekanik Gaming", + quantity: 20, + unit: "Adet", + unitPrice: 1000, + lineTotal: 23600, + discountRate: 0, + discountAmount: 0, + taxRate: 18, + taxAmount: 3600, + netAmount: 20000, + }, + ], + deliveryAddress: "Merkez Depo - Ümraniye Sanayi Sitesi", + receiverName: "Depo Sorumlusu", + receiverPhone: "+90 216 555 0505", + carrierCompany: "Horoz Lojistik", + trackingNumber: "HRZ777888999", + notes: "Stok girişi yapıldı.", + creationTime: new Date("2024-01-19T11:00:00"), + lastModificationTime: new Date("2024-01-20T09:00:00"), + }, +]; diff --git a/ui/src/mocks/mockWorkCenterTypes.ts b/ui/src/mocks/mockWorkCenterTypes.ts new file mode 100644 index 00000000..dbcac857 --- /dev/null +++ b/ui/src/mocks/mockWorkCenterTypes.ts @@ -0,0 +1,32 @@ +import { PmWorkCenterType } from "../types/pm"; + +export const mockWorkCenterTypes: PmWorkCenterType[] = [ + { + id: "1", + code: "CNC", + name: "CNC Makineleri", + category: "Üretim", + isActive: true, + }, + { + id: "2", + code: "COMP", + name: "Kompresörler", + category: "Altyapı", + isActive: true, + }, + { + id: "3", + code: "CONV", + name: "Konveyörler", + category: "Taşıma", + isActive: true, + }, + { + id: "4", + code: "WELD", + name: "Kaynak Makineleri", + category: "Üretim", + isActive: true, + }, +]; diff --git a/ui/src/mocks/mockWorkCenters.ts b/ui/src/mocks/mockWorkCenters.ts new file mode 100644 index 00000000..b910a3fa --- /dev/null +++ b/ui/src/mocks/mockWorkCenters.ts @@ -0,0 +1,368 @@ +import { + CriticalityLevelEnum, + PmWorkCenter, + WorkCenterStatusEnum, +} from "../types/pm"; +import { mockWorkCenterTypes } from "./mockWorkCenterTypes"; + +export const mockWorkCenters: PmWorkCenter[] = [ + { + id: "1", + code: "CNC-001", + name: "CNC Torna Tezgahı", + description: "Yüksek hassasiyetli CNC torna tezgahı", + workCenterId: "1", + workCenterType: mockWorkCenterTypes.find((wct) => wct.code === "1")!, + manufacturer: "HAAS Automation", + model: "ST-30", + serialNumber: "SN123456789", + installationDate: new Date("2022-03-15"), + warrantyExpiry: new Date("2025-03-15"), + location: "Atölye A - Hat 1", + departmentId: "1", + status: WorkCenterStatusEnum.Operational, + criticality: CriticalityLevelEnum.High, + specifications: [ + { + id: "SPEC001", + workCenterId: "EQP001", + specificationName: "Max Çap", + specificationValue: "300", + unit: "mm", + isRequired: true, + }, + { + id: "SPEC002", + workCenterId: "EQP001", + specificationName: "Motor Gücü", + specificationValue: "15", + unit: "kW", + isRequired: true, + }, + ], + maintenancePlans: [], + workOrders: [], + downTimeHistory: [], + isActive: true, + creationTime: new Date("2022-03-15"), + lastModificationTime: new Date("2024-01-15"), + capacity: 8, + costPerHour: 75, + setupTime: 15, + machineType: "CNC", + }, + { + id: "2", + code: "COMP-001", + name: "Hava Kompresörü", + description: "Endüstriyel hava kompresörü sistemi", + workCenterId: "2", + workCenterType: mockWorkCenterTypes.find((wct) => wct.code === "2")!, + manufacturer: "Atlas Copco", + model: "GA55VSD+", + serialNumber: "AC987654321", + installationDate: new Date("2021-08-20"), + warrantyExpiry: new Date("2024-08-20"), + location: "Kompresör Odası", + departmentId: "2", + status: WorkCenterStatusEnum.UnderMaintenance, + criticality: CriticalityLevelEnum.Critical, + specifications: [ + { + id: "SPEC003", + workCenterId: "EQP002", + specificationName: "Basınç", + specificationValue: "8.5", + unit: "bar", + isRequired: true, + }, + { + id: "SPEC004", + workCenterId: "EQP002", + specificationName: "Kapasite", + specificationValue: "55", + unit: "kW", + isRequired: true, + }, + ], + maintenancePlans: [], + workOrders: [], + downTimeHistory: [], + isActive: true, + creationTime: new Date("2021-08-20"), + lastModificationTime: new Date("2024-02-01"), + costPerHour: 85, + setupTime: 20, + machineType: "CNC", + capacity: 8, + }, + { + id: "3", + code: "CONV-001", + name: "Konveyör Sistemi", + description: "Ana hat konveyör sistemi", + workCenterId: "3", + workCenterType: mockWorkCenterTypes.find((wct) => wct.code === "3")!, + manufacturer: "Siemens", + model: "SIMATIC S7-1500", + serialNumber: "SM112233445", + installationDate: new Date("2020-11-10"), + location: "Ana Üretim Hattı", + departmentId: "3", + status: WorkCenterStatusEnum.OutOfOrder, + criticality: CriticalityLevelEnum.Medium, + specifications: [ + { + id: "SPEC005", + workCenterId: "EQP003", + specificationName: "Hız", + specificationValue: "2.5", + unit: "m/s", + isRequired: true, + }, + { + id: "SPEC006", + workCenterId: "EQP003", + specificationName: "Yük Kapasitesi", + specificationValue: "500", + unit: "kg", + isRequired: true, + }, + ], + maintenancePlans: [], + workOrders: [], + downTimeHistory: [], + isActive: true, + creationTime: new Date("2020-11-10"), + lastModificationTime: new Date("2024-02-05"), + costPerHour: 85, + setupTime: 20, + machineType: "CNC", + capacity: 8, + }, + { + id: "4", + code: "KELD-001", + name: "Kaynak Makinesi", + description: "Otomatik robot kaynak sistemi", + workCenterId: "4", + workCenterType: mockWorkCenterTypes.find((wct) => wct.code === "4")!, + manufacturer: "KUKA", + model: "KR 60-3", + serialNumber: "KU556677889", + installationDate: new Date("2023-01-15"), + warrantyExpiry: new Date("2026-01-15"), + location: "Kaynak Atölyesi", + departmentId: "4", + status: WorkCenterStatusEnum.Operational, + criticality: CriticalityLevelEnum.High, + specifications: [ + { + id: "SPEC007", + workCenterId: "EQP004", + specificationName: "Erişim Mesafesi", + specificationValue: "2033", + unit: "mm", + isRequired: true, + }, + { + id: "SPEC008", + workCenterId: "EQP004", + specificationName: "Taşıma Kapasitesi", + specificationValue: "60", + unit: "kg", + isRequired: true, + }, + ], + maintenancePlans: [], + workOrders: [], + downTimeHistory: [], + isActive: true, + creationTime: new Date("2023-01-15"), + lastModificationTime: new Date("2024-01-20"), + costPerHour: 85, + setupTime: 20, + machineType: "CNC", + capacity: 8, + }, + { + id: "5", + code: "WELL-001", + name: "Yıkama Makinesi", + description: "Otomatik robot kaynak sistemi", + workCenterId: "4", + workCenterType: mockWorkCenterTypes.find((wct) => wct.code === "4")!, + manufacturer: "KUKA", + model: "KR 60-3", + serialNumber: "KU556677889", + installationDate: new Date("2023-01-15"), + warrantyExpiry: new Date("2026-01-15"), + location: "Kaynak Atölyesi", + departmentId: "4", + status: WorkCenterStatusEnum.Operational, + criticality: CriticalityLevelEnum.High, + specifications: [ + { + id: "SPEC007", + workCenterId: "EQP004", + specificationName: "Erişim Mesafesi", + specificationValue: "2033", + unit: "mm", + isRequired: true, + }, + { + id: "SPEC008", + workCenterId: "EQP004", + specificationName: "Taşıma Kapasitesi", + specificationValue: "60", + unit: "kg", + isRequired: true, + }, + ], + maintenancePlans: [], + workOrders: [], + downTimeHistory: [], + isActive: true, + creationTime: new Date("2023-01-15"), + lastModificationTime: new Date("2024-01-20"), + costPerHour: 85, + setupTime: 20, + machineType: "CNC", + capacity: 8, + }, + { + id: "6", + code: "KELD-001", + name: "Ram Makinesi", + description: "Otomatik robot kaynak sistemi", + workCenterId: "4", + workCenterType: mockWorkCenterTypes.find((wct) => wct.code === "4")!, + manufacturer: "KUKA", + model: "KR 60-3", + serialNumber: "KU556677889", + installationDate: new Date("2023-01-15"), + warrantyExpiry: new Date("2026-01-15"), + location: "Kaynak Atölyesi", + departmentId: "4", + status: WorkCenterStatusEnum.Operational, + criticality: CriticalityLevelEnum.High, + specifications: [ + { + id: "SPEC007", + workCenterId: "EQP004", + specificationName: "Erişim Mesafesi", + specificationValue: "2033", + unit: "mm", + isRequired: true, + }, + { + id: "SPEC008", + workCenterId: "EQP004", + specificationName: "Taşıma Kapasitesi", + specificationValue: "60", + unit: "kg", + isRequired: true, + }, + ], + maintenancePlans: [], + workOrders: [], + downTimeHistory: [], + isActive: true, + creationTime: new Date("2023-01-15"), + lastModificationTime: new Date("2024-01-20"), + costPerHour: 85, + setupTime: 20, + machineType: "CNC", + capacity: 8, + }, + { + id: "7", + code: "WEID-001", + name: "Sarma Makinesi", + description: "Otomatik robot kaynak sistemi", + workCenterId: "4", + workCenterType: mockWorkCenterTypes.find((wct) => wct.code === "4")!, + manufacturer: "KUKA", + model: "KR 60-3", + serialNumber: "KU556677889", + installationDate: new Date("2023-01-15"), + warrantyExpiry: new Date("2026-01-15"), + location: "Kaynak Atölyesi", + departmentId: "4", + status: WorkCenterStatusEnum.Operational, + criticality: CriticalityLevelEnum.High, + specifications: [ + { + id: "SPEC007", + workCenterId: "EQP004", + specificationName: "Erişim Mesafesi", + specificationValue: "2033", + unit: "mm", + isRequired: true, + }, + { + id: "SPEC008", + workCenterId: "EQP004", + specificationName: "Taşıma Kapasitesi", + specificationValue: "60", + unit: "kg", + isRequired: true, + }, + ], + maintenancePlans: [], + workOrders: [], + downTimeHistory: [], + isActive: true, + creationTime: new Date("2023-01-15"), + lastModificationTime: new Date("2024-01-20"), + costPerHour: 85, + setupTime: 20, + machineType: "CNC", + capacity: 8, + }, + { + id: "8", + code: "KEL-001", + name: "Robot Kaynak Makinesi", + description: "Otomatik robot kaynak sistemi", + workCenterId: "4", + workCenterType: mockWorkCenterTypes.find((wct) => wct.code === "4")!, + manufacturer: "KUKA", + model: "KR 60-3", + serialNumber: "KU556677889", + installationDate: new Date("2023-01-15"), + warrantyExpiry: new Date("2026-01-15"), + location: "Kaynak Atölyesi", + departmentId: "4", + status: WorkCenterStatusEnum.Operational, + criticality: CriticalityLevelEnum.High, + specifications: [ + { + id: "SPEC007", + workCenterId: "EQP004", + specificationName: "Erişim Mesafesi", + specificationValue: "2033", + unit: "mm", + isRequired: true, + }, + { + id: "SPEC008", + workCenterId: "EQP004", + specificationName: "Taşıma Kapasitesi", + specificationValue: "60", + unit: "kg", + isRequired: true, + }, + ], + maintenancePlans: [], + workOrders: [], + downTimeHistory: [], + isActive: true, + creationTime: new Date("2023-01-15"), + lastModificationTime: new Date("2024-01-20"), + costPerHour: 85, + setupTime: 20, + machineType: "CNC", + capacity: 8, + }, +]; diff --git a/ui/src/mocks/mockWorkOrders.ts b/ui/src/mocks/mockWorkOrders.ts new file mode 100644 index 00000000..3e09d04a --- /dev/null +++ b/ui/src/mocks/mockWorkOrders.ts @@ -0,0 +1,217 @@ +import { MrpWorkOrder } from "../types/mrp"; +import { WorkOrderStatusEnum } from "../types/pm"; +import { mockMaterials } from "./mockMaterials"; +import { mockOperations } from "./mockOperations"; +import { mockProductionOrders } from "./mockProductionOrders"; +import { mockWorkCenters } from "./mockWorkCenters"; + +export const mockWorkOrders: MrpWorkOrder[] = [ + { + id: "WO-2024-001", + workOrderNumber: "WO-2024-001", + productionOrderId: mockProductionOrders[0].id, + productionOrder: mockProductionOrders[0], + operationId: "1", + operation: mockOperations.find((op) => op.id === "1"), + materialId: "1", + material: mockMaterials.find((m) => m.id === "1"), + sequence: 1, + plannedStartDate: new Date("2024-01-16"), + plannedEndDate: new Date("2024-01-18"), + plannedQuantity: 50, + confirmedQuantity: 30, + scrapQuantity: 1, + workCenterId: "1", + workCenter: mockWorkCenters.find((wc) => wc.id === "1"), + assignedOperators: ["1", "2"], + setupTime: 60, + processTime: 240, + status: WorkOrderStatusEnum.InProgress, + confirmations: [], + qualityChecks: [], + creationTime: new Date("2024-01-10"), + lastModificationTime: new Date("2024-01-16"), + }, + { + id: "WO-2024-002", + workOrderNumber: "WO-2024-002", + productionOrderId: mockProductionOrders[0].id, + productionOrder: mockProductionOrders[0], + operationId: "2", + operation: mockOperations.find((op) => op.id === "2"), + materialId: "2", + material: mockMaterials.find((m) => m.id === "2"), + sequence: 2, + plannedStartDate: new Date("2024-01-18"), + plannedEndDate: new Date("2024-01-20"), + plannedQuantity: 50, + confirmedQuantity: 35, + scrapQuantity: 1, + workCenterId: "2", + workCenter: mockWorkCenters.find((wc) => wc.id === "2"), + assignedOperators: ["3"], + setupTime: 45, + processTime: 180, + status: WorkOrderStatusEnum.Completed, + confirmations: [], + qualityChecks: [], + creationTime: new Date("2024-01-10"), + lastModificationTime: new Date("2024-01-20"), + }, + { + id: "WO-2024-003", + workOrderNumber: "WO-2024-003", + productionOrderId: mockProductionOrders[1].id, + productionOrder: mockProductionOrders[1], + operationId: "3", + operation: mockOperations.find((op) => op.id === "3"), + materialId: "3", + material: mockMaterials.find((m) => m.id === "3"), + sequence: 1, + plannedStartDate: new Date("2024-02-01"), + plannedEndDate: new Date("2024-02-05"), + plannedQuantity: 25, + confirmedQuantity: 0, + scrapQuantity: 0, + workCenterId: "3", + workCenter: mockWorkCenters.find((wc) => wc.id === "3"), + assignedOperators: ["4"], + setupTime: 30, + processTime: 120, + status: WorkOrderStatusEnum.Created, + confirmations: [], + qualityChecks: [], + creationTime: new Date("2024-01-25"), + lastModificationTime: new Date("2024-02-01"), + }, + { + id: "WO-2024-004", + workOrderNumber: "WO-2024-004", + productionOrderId: mockProductionOrders[1].id, + productionOrder: mockProductionOrders[1], + operationId: "4", + operation: mockOperations.find((op) => op.id === "4"), + materialId: "2", + material: mockMaterials.find((m) => m.id === "2"), + sequence: 2, + plannedStartDate: new Date("2024-02-05"), + plannedEndDate: new Date("2024-02-10"), + plannedQuantity: 25, + confirmedQuantity: 0, + scrapQuantity: 0, + workCenterId: "1", + workCenter: mockWorkCenters.find((wc) => wc.id === "1"), + assignedOperators: ["5", "6"], + setupTime: 40, + processTime: 150, + status: WorkOrderStatusEnum.Released, + confirmations: [], + qualityChecks: [], + creationTime: new Date("2024-01-25"), + lastModificationTime: new Date("2024-02-05"), + }, + { + id: "WO-2024-005", + workOrderNumber: "WO-2024-005", + productionOrderId: mockProductionOrders[0].id, + productionOrder: mockProductionOrders[0], + operationId: "5", + operation: mockOperations.find((op) => op.id === "5"), + materialId: "4", + material: mockMaterials.find((m) => m.id === "4"), + sequence: 3, + plannedStartDate: new Date("2024-01-20"), + plannedEndDate: new Date("2024-01-25"), + plannedQuantity: 20, + confirmedQuantity: 0, + scrapQuantity: 0, + workCenterId: "4", + workCenter: mockWorkCenters.find((wc) => wc.id === "4"), + assignedOperators: ["7"], + setupTime: 20, + processTime: 60, + status: WorkOrderStatusEnum.Created, + confirmations: [], + qualityChecks: [], + creationTime: new Date("2024-01-10"), + lastModificationTime: new Date("2024-01-20"), + }, + { + id: "WO-2024-006", + workOrderNumber: "WO-2024-006", + productionOrderId: mockProductionOrders[1].id, + productionOrder: mockProductionOrders[1], + operationId: "1", + operation: mockOperations.find((op) => op.id === "1"), + materialId: "2", + material: mockMaterials.find((m) => m.id === "2"), + sequence: 3, + plannedStartDate: new Date("2024-02-10"), + plannedEndDate: new Date("2024-02-15"), + plannedQuantity: 10, + confirmedQuantity: 0, + scrapQuantity: 0, + workCenterId: "5", + workCenter: mockWorkCenters.find((wc) => wc.id === "5"), + assignedOperators: ["8"], + setupTime: 15, + processTime: 45, + status: WorkOrderStatusEnum.Created, + confirmations: [], + qualityChecks: [], + creationTime: new Date("2024-01-25"), + lastModificationTime: new Date("2024-02-10"), + }, + { + id: "WO-2024-007", + workOrderNumber: "WO-2024-007", + productionOrderId: mockProductionOrders[0].id, + productionOrder: mockProductionOrders[0], + operationId: "2", + operation: mockOperations.find((op) => op.id === "2"), + materialId: "4", + material: mockMaterials.find((m) => m.id === "4"), + sequence: 4, + plannedStartDate: new Date("2024-01-25"), + plannedEndDate: new Date("2024-01-30"), + plannedQuantity: 10, + confirmedQuantity: 0, + scrapQuantity: 0, + workCenterId: "7", + workCenter: mockWorkCenters.find((wc) => wc.id === "7"), + assignedOperators: ["9"], + setupTime: 10, + processTime: 30, + status: WorkOrderStatusEnum.Cancelled, + confirmations: [], + qualityChecks: [], + creationTime: new Date("2024-01-10"), + lastModificationTime: new Date("2024-01-25"), + }, + { + id: "WO-2024-008", + workOrderNumber: "WO-2024-008", + productionOrderId: mockProductionOrders[1].id, + productionOrder: mockProductionOrders[1], + operationId: "3", + operation: mockOperations.find((op) => op.id === "3"), + materialId: "2", + material: mockMaterials.find((m) => m.id === "2"), + sequence: 4, + plannedStartDate: new Date("2024-02-15"), + plannedEndDate: new Date("2024-02-20"), + plannedQuantity: 5, + confirmedQuantity: 0, + scrapQuantity: 0, + workCenterId: "8", + workCenter: mockWorkCenters.find((wc) => wc.id === "8"), + assignedOperators: ["10"], + setupTime: 10, + processTime: 30, + status: WorkOrderStatusEnum.Created, + confirmations: [], + qualityChecks: [], + creationTime: new Date("2024-01-25"), + lastModificationTime: new Date("2024-02-15"), + }, +]; diff --git a/ui/src/mocks/mockZones.ts b/ui/src/mocks/mockZones.ts new file mode 100644 index 00000000..b62b4016 --- /dev/null +++ b/ui/src/mocks/mockZones.ts @@ -0,0 +1,40 @@ +import { WmZone, ZoneTypeEnum } from "../types/wm"; + +export const mockZones: WmZone[] = [ + { + id: "1", + warehouseId: "1", + zoneCode: "Z001", + name: "Giriş Bölgesi", + description: "Malzeme kabul bölgesi", + zoneType: ZoneTypeEnum.Receiving, + temperature: 20, + humidity: 45, + locations: [], + isActive: true, + }, + { + id: "2", + warehouseId: "1", + zoneCode: "Z002", + name: "Ana Depolama", + description: "Ana depolama alanı", + zoneType: ZoneTypeEnum.Storage, + temperature: 18, + humidity: 40, + locations: [], + isActive: true, + }, + { + id: "3", + warehouseId: "2", + zoneCode: "Z003", + name: "Sevkiyat Hazırlık", + description: "Sevkiyat hazırlık alanı", + zoneType: ZoneTypeEnum.Shipping, + temperature: 22, + humidity: 50, + locations: [], + isActive: true, + }, +]; diff --git a/ui/src/types/common.ts b/ui/src/types/common.ts new file mode 100644 index 00000000..7d8e9b55 --- /dev/null +++ b/ui/src/types/common.ts @@ -0,0 +1,222 @@ +import { BankAccountTypeEnum } from "./fi"; +import { + CrmActivity, + CustomerSegmentEnum, + CustomerTypeEnum, + CrmOpportunity, + CrmSalesOrder, + CrmSalesTarget, + CrmTerritory, +} from "./admin/crm"; +import { HrEmployee } from "./hr"; +import { + SupplierCardTypeEnum, + MmSupplierPerformance, + SupplierTypeEnum, +} from "./mm"; + +export interface DashboardStats { + // Gösterge Paneli İstatistikleri + totalMaterials: number; + criticalStock: number; + lowStock: number; + pendingOrders: number; + maintenanceDue: number; + activeProjects: number; + totalRevenue: number; + monthlyGrowth: number; + totalEmployees: number; + openOpportunities: number; + pendingPurchaseRequests: number; +} + +export interface BusinessParty { + // İş Ortağı (Müşteri/Satıcı) + id: string; + code: string; + name: string; + address?: Address; + taxNumber?: string; + paymentTerms: PaymentTerms; + currency: string; + creditLimit: number; + isActive: boolean; + creationTime: Date; + lastModificationTime: Date; + partyType: PartyType; + primaryContact?: Contact; + contacts?: Contact[]; + industry?: string; + email?: string; + phone?: string; + website?: string; + lastOrderDate?: Date; + status?: BusinessPartyStatusEnum; + + //Customer’a özgü alanlar + customerType?: CustomerTypeEnum; + registrationNumber?: string; + customerSegment?: CustomerSegmentEnum; + assignedSalesRep?: string; + teamId?: string; + team?: Team; + totalRevenue?: number; + averageOrderValue?: number; + lifetimeValue?: number; + opportunities?: CrmOpportunity[]; + orders?: CrmSalesOrder[]; + activities?: CrmActivity[]; + + // Supplier’a özgü alanlar + supplierType?: SupplierTypeEnum; + cardNumber?: string; + cardType?: SupplierCardTypeEnum; + validFrom?: Date; + validTo?: Date; + currentBalance?: number; + discountRate?: number; + specialConditions?: string[]; + performanceMetrics?: MmSupplierPerformance; + certifications?: string[]; + bankAccounts?: BankAccount[]; +} + +export enum BusinessPartyStatusEnum { // İş Ortağı Durumu + Prospect = "PROSPECT", // Potansiyel + Active = "ACTIVE", // Aktif + Inactive = "INACTIVE", // Pasif + Blocked = "BLOCKED", // Engellenmiş +} + +export interface Team { + // Takım + id: string; + code: string; + name: string; + description?: string; + managerId: string; + manager?: HrEmployee; + members: TeamMember[]; + territories?: CrmTerritory[]; + targets?: CrmSalesTarget[]; + specializations?: string[]; + isActive: boolean; + creationTime: Date; + lastModificationTime: Date; +} + +export interface TeamMember { + // Takım Üyesi + id: string; + teamId: string; + employeeId: string; + employee?: HrEmployee; + role: TeamRoleEnum; + joinDate: Date; + isActive: boolean; +} + +export interface Contact { + // İletişim + id: string; + customerId?: string; + firstName: string; + lastName: string; + fullName: string; + title?: string; + department?: string; + email: string; + phone?: string; + mobile?: string; + isPrimary: boolean; + isActive: boolean; + creationTime: Date; + lastModificationTime: Date; +} + +export interface Address { + // Adres + street: string; + city: string; + state: string; + postalCode: string; + country: string; +} + +// Bank Management Types +export interface BankAccount { + // Banka Hesabı + id: string; + accountCode: string; + bankName: string; + branchName: string; + accountNumber: string; + iban: string; + accountType: BankAccountTypeEnum; + currency: string; + balance: number; + overdraftLimit: number; + dailyTransferLimit: number; + isActive: boolean; + contactPerson?: string; + phone?: string; + swiftCode?: string; + isDefault: boolean; + creationTime: Date; + lastModificationTime: Date; +} + +export interface WidgetGroupDto { + // Widget Grubu + colGap?: number; + colSpan?: number; + className?: string; + items: WidgetEditDto[]; +} + +export interface WidgetEditDto { + // Widget Düzenleme + colGap: number; + colSpan: number; + sqlQuery?: string; + className?: string; + title: string; + value: string; + valueClassName: string; + color: string; + icon: string; + subTitle: string; + onClick: string; +} + +export enum TeamRoleEnum { // Takım Rolü + Member = "MEMBER", // Üye + Lead = "LEAD", // Lider + Manager = "MANAGER", // Yönetici + Specialist = "SPECIALIST", // Uzman +} + +export enum PartyType { // İş Ortağı Türü + Customer = "CUSTOMER", // Müşteri + Supplier = "SUPPLIER", // Tedarikçi + Both = "BOTH", // Her İkisi + Other = "OTHER", // Diğer +} + +export enum PaymentTerms { // Ödeme Koşulları + Net15 = "NET15", // 15 Gün + Net30 = "NET30", // 30 Gün + Net45 = "NET45", // 45 Gün + Net60 = "NET60", // 60 Gün + Net90 = "NET90", // 90 Gün + COD = "COD", // Kapıda Ödeme + Prepaid = "PREPAID", // Peşin + Cash = "CASH", // Nakit +} + +export enum PriorityEnum { // Öncelik + Low = "LOW", // Düşük + Normal = "NORMAL", // Normal + High = "HIGH", // Yüksek + Urgent = "URGENT", // Acil +} diff --git a/ui/src/types/crm.ts b/ui/src/types/crm.ts new file mode 100644 index 00000000..1f4f512d --- /dev/null +++ b/ui/src/types/crm.ts @@ -0,0 +1,269 @@ +import { + Address, + BusinessParty, + Contact, + PaymentTerms, + PriorityEnum, +} from "./common"; +import { HrEmployee } from "./hr"; +import { MmDelivery, MmMaterial, MmUnit } from "./mm"; + +export interface CrmSalesOrder { + // Satış Siparişi + id: string; + orderNumber: string; + customerId: string; + customer?: BusinessParty; + orderDate: Date; + requestedDeliveryDate: Date; + confirmedDeliveryDate?: Date; + status: SaleOrderStatusEnum; + subtotal: number; + taxAmount: number; + discountAmount: number; + totalAmount: number; + currency: string; + paymentTerms: PaymentTerms; + deliveryTerms?: string; + deliveryAddress: Address; + billingAddress: Address; + exchangeRate?: number; + discountRate?: number; + taxRate?: number; + specialInstructions?: string; + items: CrmSalesOrderItem[]; + deliveries: MmDelivery[]; + notes?: string; + creationTime: Date; + lastModificationTime: Date; +} + +export interface CrmSalesOrderItem { + // Satış Sipariş Kalemi + id: string; + orderId: string; + materialId?: string; + material?: MmMaterial; + description: string; + quantity: number; + deliveredQuantity: number; + unitPrice: number; + totalAmount: number; + unitId: string; + unit?: MmUnit; + discountRate?: number; + discountAmount?: number; + taxRate?: number; + taxAmount?: number; + notes?: string; + requestedDate: Date; + confirmedDate?: Date; + status: SaleOrderItemStatusEnum; +} + +export interface CrmTerritory { + // Sales Bölgesi + id: string; + territoryCode: string; + name: string; + description?: string; + region: string; + countries: string[]; + cities: string[]; + assignedTeamId?: string; + assignedSalesRep?: string; + isActive: boolean; +} + +export interface CrmOpportunity { + // Fırsat + id: string; + opportunityNumber: string; + title: string; + description?: string; + customerId: string; + customer?: BusinessParty; + contactId?: string; + contact?: Contact; + stage: OpportunityStageEnum; + probability: number; + estimatedValue: number; + currency: string; + expectedCloseDate: Date; + actualCloseDate?: Date; + assignedTo: string; + assigned?: HrEmployee; + teamId?: string; + leadSource: LeadSourceEnum; + campaignId?: string; + status: OpportunityStatusEnum; + lostReason?: CrmLostReason; + activities: CrmActivity[]; + competitors: CrmCompetitor[]; + creationTime: Date; + lastModificationTime: Date; +} + +export interface CrmActivity { + // Aktivite + id: string; + activityType: CrmActivityTypeEnum; + subject: string; + description?: string; + customerId?: string; + customer?: BusinessParty; + opportunityId?: string; + opportunity?: CrmOpportunity; + contactId?: string; + contact?: Contact; + activityDate: Date; + startTime?: Date; + endTime?: Date; + duration?: number; // minutes + assignedTo: string; + assigned?: HrEmployee; + participants: string[]; + status: ActivityStatusEnum; + priority: PriorityEnum; + followUpDate?: Date; + followUpActivity?: string; + outcome?: string; + nextSteps?: string; + creationTime: Date; + lastModificationTime: Date; +} + +export interface CrmCompetitor { + // Rakip + id: string; + name: string; + website?: string; + strengths: string[]; + weaknesses: string[]; + marketShare?: number; + isActive: boolean; +} + +export interface CrmLostReason { + // Kaybedilme Nedeni + id: string; + code: string; + name: string; + description?: string; + category: LostReasonCategoryEnum; + isActive: boolean; +} + +export interface CrmSalesTarget { + // Satış Hedefi + id: string; + teamId?: string; + employeeId?: string; + targetPeriod: string; + targetType: TargetTypeEnum; + targetValue: number; + actualValue: number; + currency: string; + startDate: Date; + endDate: Date; + status: TargetStatusEnum; +} + +export enum CustomerTypeEnum { // Müşteri Türü + Individual = "INDIVIDUAL", // Bireysel + Company = "COMPANY", // Şirket + Government = "GOVERNMENT", // Devlet + NonProfit = "NON_PROFIT", // Kar Amacı Gütmeyen +} + +export enum CustomerSegmentEnum { // Müşteri Segmenti + Enterprise = "ENTERPRISE", // Kurumsal + SMB = "SMB", // KOBİ + Startup = "STARTUP", // Yeni Kuruluş + Government = "GOVERNMENT", // Devlet +} + +export enum OpportunityStageEnum { // Fırsat Aşaması + Qualification = "QUALIFICATION", // Nitelik + NeedsAnalysis = "NEEDS_ANALYSIS", // İhtiyaç Analizi + Proposal = "PROPOSAL", // Teklif + Negotiation = "NEGOTIATION", // Müzakere + ClosedWon = "CLOSED_WON", // Kazanıldı + ClosedLost = "CLOSED_LOST", // Kaybedildi +} + +export enum OpportunityStatusEnum { // Fırsat Durumu + Open = "OPEN", // Açık + Won = "WON", // Kazanıldı + Lost = "LOST", // Kaybedildi + Cancelled = "CANCELLED", // İptal Edildi +} + +export enum LeadSourceEnum { // Lead Kaynağı + Website = "WEBSITE", // Web Sitesi + Referral = "REFERRAL", // Tavsiye + Campaign = "CAMPAIGN", // Kampanya + Trade_Show = "TRADE_SHOW", // Fuar + Cold_Call = "COLD_CALL", // Soğuk Arama + Social_Media = "SOCIAL_MEDIA", // Sosyal Medya + Partner = "PARTNER", // İş Ortağı +} + +export enum SaleOrderStatusEnum { // Satış Siparişi Durumu + Draft = "DRAFT", // Taslak + Confirmed = "CONFIRMED", // Onaylandı + InProduction = "IN_PRODUCTION", // Üretimde + Ready = "READY", // Hazır + Shipped = "SHIPPED", // Gönderildi + Delivered = "DELIVERED", // Teslim Edildi + Cancelled = "CANCELLED", // İptal Edildi +} + +export enum SaleOrderItemStatusEnum { // Satış Sipariş Kalemi Durumu + Pending = "PENDING", // Beklemede + Confirmed = "CONFIRMED", // Onaylandı + InProduction = "IN_PRODUCTION", // Üretimde + Ready = "READY", // Hazır + Shipped = "SHIPPED", // Gönderildi + Delivered = "DELIVERED", // Teslim Edildi +} + +export enum CrmActivityTypeEnum { // Aktivite Türü + Call = "CALL", // Telefon + Email = "EMAIL", // E-posta + Meeting = "MEETING", // Toplantı + Task = "TASK", // Görev + Note = "NOTE", // Not + Demo = "DEMO", // Demo + Proposal = "PROPOSAL", // Teklif +} + +export enum ActivityStatusEnum { // Aktivite Durumu + Planned = "PLANNED", // Planlandı + InProgress = "IN_PROGRESS", // Devam Ediyor + Completed = "COMPLETED", // Tamamlandı + Cancelled = "CANCELLED", // İptal Edildi +} + +export enum LostReasonCategoryEnum { // Kaybedilme Nedeni Kategorisi + Price = "PRICE", // Fiyat + Product = "PRODUCT", // Ürün + Service = "SERVICE", // Hizmet + Competitor = "COMPETITOR", // Rakip + Timing = "TIMING", // Zamanlama + Budget = "BUDGET", // Bütçe +} + +export enum TargetTypeEnum { // Hedef Türü + Revenue = "REVENUE", // Gelir + Units = "UNITS", // Birimler + Opportunities = "OPPORTUNITIES", // Fırsatlar + Customers = "CUSTOMERS", // Müşteriler +} + +export enum TargetStatusEnum { // Hedef Durumu + Active = "ACTIVE", // Aktif + Achieved = "ACHIEVED", // Gerçekleşti + Missed = "MISSED", // Kaçırıldı + Cancelled = "CANCELLED", // İptal Edildi +} diff --git a/ui/src/types/fi.ts b/ui/src/types/fi.ts new file mode 100644 index 00000000..49226cbd --- /dev/null +++ b/ui/src/types/fi.ts @@ -0,0 +1,362 @@ +import { BankAccount, BusinessParty } from "./common"; +import { MmMaterial } from "./mm"; + +export interface FiCurrentAccount { + // Cari Hesabı + id: string; + accountCode: string; + businessPartyId: string; + businessParty?: BusinessParty; + type: AccountTypeEnum; + contactPerson?: string; + phone?: string; + email?: string; + address?: string; + taxNumber?: string; + taxOffice?: string; + creditLimit: number; + balance: number; + currency: string; + isActive: boolean; + riskGroup: RiskGroupEnum; + paymentTerm: number; + creationTime: Date; + lastModificationTime: Date; + lastTransactionDate?: Date; +} + +export interface FiCurrentAccountMovement { + // Cari Hesap Hareketi + id: string; + accountId: string; + account?: FiCurrentAccount; + transactionDate: Date; + description: string; + referenceNumber?: string; + documentType: FiDocumentTypeEnum; + documentNumber?: string; + debitAmount: number; + creditAmount: number; + balance: number; + currency: string; + invoiceId?: string; + paymentId?: string; + creationTime: Date; +} + +export interface FiInvoice { + // Fatura + id: string; + invoiceNumber: string; + invoiceType: InvoiceTypeEnum; + currentAccountId: string; + currentAccount?: FiCurrentAccount; + invoiceDate: Date; + dueDate: Date; + deliveryDate?: Date; + subtotal: number; + taxAmount: number; + discountAmount: number; + totalAmount: number; + paidAmount: number; + remainingAmount: number; + currency: string; + status: InvoiceStatusEnum; + paymentStatus: PaymentStatusEnum; + items: FiInvoiceItem[]; + waybillNumber?: string; + waybillDate?: Date; + notes?: string; + creationTime: Date; + lastModificationTime: Date; +} + +export interface FiInvoiceItem { + // Fatura Kalemi + id: string; + invoiceId: string; + materialId?: string; + material?: MmMaterial; + description: string; + quantity: number; + unit: string; + unitPrice: number; + lineTotal: number; + discountRate: number; + discountAmount: number; + taxRate: number; + taxAmount: number; + netAmount: number; +} + +export interface FiWaybill { + // İrsaliye + id: string; + waybillNumber: string; + waybillType: WaybillTypeEnum; + currentAccountId: string; + currentAccount?: FiCurrentAccount; + waybillDate: Date; + deliveryDate?: Date; + subtotal: number; + taxAmount: number; + discountAmount: number; + totalAmount: number; + currency: string; + status: WaybillStatusEnum; + isInvoiced: boolean; + invoiceId?: string; + items: FiWaybillItem[]; + deliveryAddress?: string; + receiverName?: string; + receiverPhone?: string; + carrierCompany?: string; + trackingNumber?: string; + notes?: string; + creationTime: Date; + lastModificationTime: Date; +} + +export interface FiWaybillItem { + // İrsaliye Kalemi + id: string; + waybillId: string; + materialId?: string; + material?: MmMaterial; + description: string; + quantity: number; + unit: string; + unitPrice: number; + lineTotal: number; + discountRate: number; + discountAmount: number; + taxRate: number; + taxAmount: number; + netAmount: number; +} + +export interface FiCashAccount { + // Kasa Hesabı + id: string; + accountCode: string; + name: string; + description?: string; + currency: string; + balance: number; + isActive: boolean; + creationTime: Date; + lastModificationTime: Date; +} + +export interface FiCashMovement { + // Kasa Hareketi + id: string; + cashAccountId: string; + cashAccount?: FiCashAccount; + transactionDate: Date; + description: string; + referenceNumber?: string; + movementType: CashMovementTypeEnum; + amount: number; + currency: string; + documentType?: FiDocumentTypeEnum; + documentNumber?: string; + currentAccountId?: string; + currentAccount?: FiCurrentAccount; + creationTime: Date; +} + +export interface FiBankMovement { + // Banka Hareketi + id: string; + bankAccountId: string; + bankAccount?: BankAccount; + transactionDate: Date; + valueDate: Date; + description: string; + referenceNumber?: string; + transactionType: BankTransactionTypeEnum; + amount: number; + currency: string; + recipientName?: string; + recipientIban?: string; + recipientBank?: string; + documentType?: FiDocumentTypeEnum; + documentNumber?: string; + currentAccountId?: string; + currentAccount?: FiCurrentAccount; + status: TransactionStatusEnum; + creationTime: Date; +} + +export interface FiCheck { + // Çek + id: string; + checkNumber: string; + bankName: string; + branchName: string; + accountNumber: string; + drawerName: string; + payeeName: string; + currentAccountId?: string; + currentAccount?: FiCurrentAccount; + issueDate: Date; + dueDate: Date; + amount: number; + currency: string; + status: CheckStatusEnum; + type: CheckTypeEnum; + bankingDate?: Date; + collectionDate?: Date; + endorsedTo?: string; + notes?: string; + creationTime: Date; + lastModificationTime: Date; +} + +export interface PromissoryNote { + // Senet + id: string; + noteNumber: string; + drawerName: string; + payeeName: string; + currentAccountId?: string; + currentAccount?: FiCurrentAccount; + issueDate: Date; + dueDate: Date; + amount: number; + currency: string; + status: NoteStatusEnum; + type: NoteTypeEnum; // Received or Issued + collectionDate?: Date; + endorsedTo?: string; + location?: string; + notes?: string; + creationTime: Date; + lastModificationTime: Date; +} + +// Enums +export enum AccountTypeEnum { + Customer = "CUSTOMER", // Müşteri + Supplier = "SUPPLIER", // Tedarikçi + Both = "BOTH", // Her İkisi de + Other = "OTHER", // Diğer +} + +export enum RiskGroupEnum { + Low = "LOW", // Düşük + Medium = "MEDIUM", // Orta + High = "HIGH", // Yüksek + Blocked = "BLOCKED", // Bloke +} + +export enum FiDocumentTypeEnum { + Invoice = "INVOICE", // Fatura + Waybill = "WAYBILL", // İrsaliye + Receipt = "RECEIPT", // Makbuz + Payment = "PAYMENT", // Ödeme + BankTransfer = "BANK_TRANSFER", // Banka Transferi + CashMovement = "CASH_MOVEMENT", // Kasa Hareketi + Check = "CHECK", // Çek + PromissoryNote = "PROMISSORY_NOTE", // Senet + Other = "OTHER", //Diğer +} + +export enum InvoiceTypeEnum { + Sales = "SALES", // Satış + Purchase = "PURCHASE", // Satın Alma + Return = "RETURN", // İade + Proforma = "PROFORMA", // Proforma +} + +export enum InvoiceStatusEnum { + Draft = "DRAFT", // Taslak + Sent = "SENT", // Gönderildi + Approved = "APPROVED", // Onaylandı + Cancelled = "CANCELLED", // İptal +} + +export enum PaymentStatusEnum { + Unpaid = "UNPAID", // Ödenmemiş + PartiallyPaid = "PARTIALLY_PAID", // Kısmen Ödenmiş + Paid = "PAID", // Ödenmiş + Overdue = "OVERDUE", // Vadesi Geçmiş +} + +export enum CashMovementTypeEnum { + Income = "INCOME", // Gelir + Expense = "EXPENSE", // Gider +} + +export enum BankAccountTypeEnum { + Current = "CURRENT", // Vadesiz + Deposit = "DEPOSIT", // Vadeli + Credit = "CREDIT", // Kredi + Foreign = "FOREIGN", // Yabancı Para +} + +export enum BankTransactionTypeEnum { + Deposit = "DEPOSIT", // PARA YATIRMA + Withdrawal = "WITHDRAWAL", // PARA ÇEKME + Transfer = "TRANSFER", // HAVALE + EFT = "EFT", // EFT + Fee = "FEE", // MASRAF + Interest = "INTEREST", // FAİZ +} + +export enum TransactionStatusEnum { + Pending = "PENDING", // BEKLEMEDE + Completed = "COMPLETED", // TAMAMLANDI + Failed = "FAILED", // BAŞARISIZ + Cancelled = "CANCELLED", // İPTAL EDİLDİ +} + +export enum CheckStatusEnum { + InHand = "IN_HAND", // CÜZDANDA + Deposited = "DEPOSITED", // HESABA YATIRILDI + Collected = "COLLECTED", // TAHSİL EDİLDİ + Bounced = "BOUNCED", // İADE OLDU + Endorsed = "ENDORSED", // CIRO EDİLDİ + Cancelled = "CANCELLED", // İPTAL EDİLDİ +} + +export enum CheckTypeEnum { + Received = "RECEIVED", // ALINAN + Issued = "ISSUED", // VERİLEN +} + +export enum NoteStatusEnum { + InHand = "IN_HAND", // CÜZDANDA + Collected = "COLLECTED", // TAHSİL EDİLDİ + Overdue = "OVERDUE", // VADESİ GEÇMİŞ + Endorsed = "ENDORSED", // CIRO EDİLDİ + Cancelled = "CANCELLED", // İPTAL EDİLDİ +} + +export enum NoteTypeEnum { + Received = "RECEIVED", // Alınan + Issued = "ISSUED", // Verilen +} + +export enum WaybillTypeEnum { + Outgoing = "outgoing", // Çıkış İrsaliyesi + Incoming = "incoming", // Giriş İrsaliyesi + Transfer = "transfer", // Transfer İrsaliyesi + Return = "return", // İade İrsaliyesi +} + +export enum WaybillStatusEnum { + Draft = "draft", // Taslak + Confirmed = "confirmed", // Onaylandı + Delivered = "delivered", // Teslim Edildi + Cancelled = "cancelled", // İptal +} + +export enum PaymentMethodEnum { + Cash = "cash", // Nakit + BankTransfer = "bank_transfer", // Banka Transferi + CreditCard = "credit_card", // Kredi Kartı + Check = "check", // Çek + PromissoryNote = "promissory_note", // Senet +} diff --git a/ui/src/types/hr.ts b/ui/src/types/hr.ts new file mode 100644 index 00000000..43a7465f --- /dev/null +++ b/ui/src/types/hr.ts @@ -0,0 +1,702 @@ +import { Address, BankAccount } from "./common"; + +export interface HrEmployee { // İnsan Kaynakları Çalışanı + id: string; + code: string; + firstName: string; + lastName: string; + fullName: string; + email: string; + phone?: string; + personalPhone?: string; + nationalId: string; + birthDate: Date; + gender: GenderEnum; + maritalStatus: MaritalStatusEnum; + address: Address; + emergencyContact: HrEmergencyContact; + hireDate: Date; + terminationDate?: Date; + employmentType: EmploymentTypeEnum; + jobPositionId: string; + jobPosition?: HrJobPosition; + departmantId: string; + department?: HrDepartment; + managerId?: string; + manager?: HrEmployee; + baseSalary: number; + currency: string; + payrollGroup: string; + bankAccountId: string; + bankAccount?: BankAccount; + workLocation: string; + workSchedule?: HrWorkSchedule; + badgeNumber?: string; + employeeStatus: EmployeeStatusEnum; + isActive: boolean; + leaves: HrLeave[]; + evaluations: HrPerformanceEvaluation[]; + trainings: HrTraining[]; + disciplinaryActions: HrDisciplinaryAction[]; + creationTime: Date; + lastModificationTime: Date; +} + +export interface HrCostCenter { // İnsan Kaynakları Masraf Merkezi + id: string; + code: string; + name: string; + description?: string; + parentCostCenterId?: string; + parentCostCenter?: HrCostCenter; + subCostCenters: HrCostCenter[]; + responsibleEmployeeId?: string; + responsibleEmployee?: HrEmployee; + departmentId?: string; + department?: HrDepartment; + costCenterType: CostCenterType; + budgetedAmount: number; + actualAmount: number; + currency: string; + fiscalYear: string; + isActive: boolean; + creationTime: Date; + lastModificationTime: Date; +} + +export interface HrDepartment { // İnsan Kaynakları Departmanı + id: string; + code: string; + name: string; + description?: string; + parentDepartmentId?: string; + parentDepartment?: HrDepartment; + subDepartments: HrDepartment[]; + managerId?: string; + manager?: HrEmployee; + costCenterId?: string; + costCenter?: HrCostCenter; + budget: number; + isActive: boolean; + creationTime: Date; + lastModificationTime: Date; +} + +export interface HrJobPosition { // İnsan Kaynakları İş Pozisyonu + id: string; + code: string; + name: string; + description?: string; + departmentId: string; + department?: HrDepartment; + level: JobLevelEnum; + minSalary: number; + maxSalary: number; + currency: string; + requiredSkills: string[]; + responsibilities: string[]; + qualifications: string[]; + isActive: boolean; + employees: HrEmployee[]; + creationTime: Date; + lastModificationTime: Date; +} + +export interface HrLeave { // İnsan Kaynakları İzni + id: string; + employeeId: string; + employee?: HrEmployee; + leaveType: LeaveTypeEnum; + startDate: Date; + endDate: Date; + totalDays: number; + reason?: string; + status: LeaveStatusEnum; + appliedDate: Date; + approvedBy?: string; + approvedDate?: Date; + rejectionReason?: string; + isHalfDay: boolean; + attachments: string[]; + creationTime: Date; + lastModificationTime: Date; +} + +export interface HrPerformanceEvaluation { // İnsan Kaynakları Performans Değerlendirmesi + id: string; + employeeId: string; + employee?: HrEmployee; + evaluatorId: string; + evaluator?: HrEmployee; + evaluationPeriod: string; + evaluationType: EvaluationTypeEnum; + overallRating: number; + goals: HrPerformanceGoal[]; + competencies: HrCompetencyRating[]; + strengths: string[]; + areasForImprovement: string[]; + developmentPlan: string[]; + comments?: string; + status: EvaluationStatusEnum; + dueDate: Date; + completedDate?: Date; + creationTime: Date; + lastModificationTime: Date; +} + +export interface HrPerformanceGoal { // İnsan Kaynakları Performans Hedefi + id: string; + evaluationId: string; + goalDescription: string; + targetValue?: string; + actualValue?: string; + weight: number; + rating: number; + comments?: string; +} + +export interface HrCompetencyRating { // İnsan Kaynakları Yeterlilik Değerlendirmesi + id: string; + evaluationId: string; + competencyName: string; + expectedLevel: number; + actualLevel: number; + rating: number; + comments?: string; +} + +export interface HrTraining { // İnsan Kaynakları Eğitimi + id: string; + trainingCode: string; + title: string; + description?: string; + trainingType: TrainingTypeEnum; + provider: string; + startDate: Date; + endDate: Date; + duration: number; + location?: string; + isOnline: boolean; + maxParticipants?: number; + cost: number; + currency: string; + status: TrainingStatusEnum; + participants: HrTrainingParticipant[]; + materials: string[]; + creationTime: Date; + lastModificationTime: Date; +} + +export interface HrTrainingParticipant { // İnsan Kaynakları Eğitim Katılımcısı + id: string; + trainingId: string; + employeeId: string; + employee?: HrEmployee; + enrollmentDate: Date; + completionDate?: Date; + status: ParticipationStatusEnum; + score?: number; + feedback?: string; + certificateIssued: boolean; +} + +export interface HrWorkSchedule { // İnsan Kaynakları Çalışma Programı + id: string; + scheduleCode: string; + name: string; + description?: string; + workingDays: HrWorkingDay[]; + totalHoursPerWeek: number; + isFlexible: boolean; + isActive: boolean; +} + +export interface HrWorkingDay { // İnsan Kaynakları Çalışma Günü + dayOfWeek: number; // 0-6 (Sunday-Saturday) + isWorkingDay: boolean; + startTime?: string; + endTime?: string; + breakDuration?: number; // minutes +} + +export interface HrDisciplinaryAction { // İnsan Kaynakları Disiplin Cezası + id: string; + employeeId: string; + employee?: HrEmployee; + actionType: DisciplinaryActionTypeEnum; + reason: string; + description: string; + actionDate: Date; + issuedBy: string; + severity: DisciplinarySeverityEnum; + status: DisciplinaryStatusEnum; + expiryDate?: Date; + attachments: string[]; + creationTime: Date; + lastModificationTime: Date; +} + +export interface HrEmergencyContact { // İnsan Kaynakları Acil Durum İletişim + name: string; + relationship: string; + phone: string; + email?: string; + address?: Address; +} + +export interface HrEmploymentType { // İnsan Kaynakları İstihdam Türü + id: string; + name: string; + count?: number; + creationTime: Date; + lastModificationTime: Date; +} + +export interface HrOvertime { // İnsan Kaynakları Fazla Mesai + id: string; + employeeId: string; + employee?: HrEmployee; + date: Date; + startTime: string; + endTime: string; + totalHours: number; + reason: string; + status: LeaveStatusEnum; + approvedBy?: string; + approver?: HrEmployee; + rate?: number; + amount?: number; + creationTime: Date; + lastModificationTime: Date; +} + +export interface HrPayroll { // İnsan Kaynakları Maaş Bordrosu + id: string; + employeeId: string; + employee?: HrEmployee; + period: string; + baseSalary: number; + allowances: HrPayrollAllowance[]; + deductions: HrPayrollDeduction[]; + overtime: number; + bonus: number; + grossSalary: number; + netSalary: number; + tax: number; + socialSecurity: number; + status: PayrollStatusEnum; + paymentDate?: Date; + creationTime: Date; + lastModificationTime: Date; +} + +export interface HrPayrollAllowance { // İnsan Kaynakları Maaş Ek Ödemesi + id: string; + name: string; + amount: number; + taxable: boolean; +} + +export interface HrPayrollDeduction { // İnsan Kaynakları Maaş Kesintisi + id: string; + name: string; + amount: number; + mandatory: boolean; +} + +export interface HrBadge { // İnsan Kaynakları Rozeti + id: string; + code: string; + name: string; + description: string; + icon: string; + color: string; + backgroundColor: string; + category: BadgeCategoryEnum; + criteria: string; + points: number; + rarity: BadgeRarityEnum; + isActive: boolean; + creationTime: Date; + lastModificationTime: Date; +} + +export interface HrOrganizationChart { // İnsan Kaynakları Organizasyon Şeması + id: string; + employeeId: string; + employee?: HrEmployee; + parentId?: string; + parent?: HrOrganizationChart; + children?: HrOrganizationChart[]; + level: number; + position: string; + isActive: boolean; +} + +export interface HrEmployeeBadge { // İnsan Kaynakları Çalışan Rozeti + id: string; + employeeId: string; + employee?: HrEmployee; + badgeId: string; + badge?: HrBadge; + earnedDate: Date; + expiryDate?: Date; + reason?: string; + notes?: string; + isActive: boolean; + creationTime: Date; + lastModificationTime: Date; +} + +export interface HrEvaluation360Template { // İnsan Kaynakları 360 Derece Değerlendirme Şablonu + id: string; + name: string; + description: string; + isActive: boolean; + questionGroups: HrQuestionGroup[]; + applicablePositions: string[]; // JobPosition ID'leri + applicableDepartments: string[]; // Department ID'leri + assessorTypes: AssessorTypeEnum[]; // Değerlendiriciler + creationTime: Date; + lastModificationTime: Date; +} + +export interface HrQuestionGroup { // İnsan Kaynakları Soru Grubu + id: string; + templateId: string; + groupName: string; + description?: string; + weight: number; // Bu grubun toplam puandaki ağırlığı (%) + order: number; + questions: HrEvaluationQuestion[]; +} + +export interface HrEvaluationQuestion { // İnsan Kaynakları Değerlendirme Sorusu + id: string; + groupId: string; + questionText: string; + questionType: QuestionTypeEnum; + isRequired: boolean; + weight: number; // Bu sorunun grup içindeki ağırlığı (%) + order: number; + options?: HrQuestionOption[]; // Çoktan seçmeli sorular için + minRating?: number; + maxRating?: number; + ratingLabels?: string[]; // Rating için etiketler (örn: ["Zayıf", "Orta", "İyi", "Mükemmel"]) +} + +export interface HrQuestionOption { // İnsan Kaynakları Soru Seçeneği + id: string; + questionId: string; + optionText: string; + value: number; + order: number; +} + +export interface HrEvaluation360 { // İnsan Kaynakları 360 Derece Değerlendirme Kampanyası + id: string; + name: string; + description: string; + templateId: string; + template?: HrEvaluation360Template; + evaluationPeriod: string; + startDate: Date; + endDate: Date; + status: CampaignStatusEnum; + departmentId?: string; // Hedef departman + targetEmployees: string[]; // Değerlendirilecek Employee ID'leri + settings: HrEvaluation360Settings; + creationTime: Date; + lastModificationTime: Date; +} + +export interface HrEvaluation360Settings { // İnsan Kaynakları 360 Derece Değerlendirme Ayarları + allowSelfEvaluation: boolean; + requireManagerEvaluation: boolean; + minPeerEvaluations: number; + minSubordinateEvaluations: number; + allowAnonymousFeedback: boolean; + sendReminderEmails: boolean; + reminderIntervalDays: number; +} + +export interface HrEvaluation360Participant { // İnsan Kaynakları 360 Derece Değerlendirme Katılımcısı + id: string; + campaignId: string; + evaluatedEmployeeId: string; // Değerlendirilen kişi + evaluatedEmployee?: HrEmployee; + evaluatorId: string; // Değerlendiren kişi + evaluator?: HrEmployee; + evaluatorType: AssessorTypeEnum; + status: ParticipantStatusEnum; + invitedDate: Date; + startedDate?: Date; + completedDate?: Date; + responses: HrEvaluation360Response[]; + overallScore?: number; + notes?: string; +} + +export interface HrEvaluation360Response { // İnsan Kaynakları 360 Derece Değerlendirme Cevabı + id: string; + participantId: string; + questionId: string; + question?: HrEvaluationQuestion; + responseValue: string | number; // Cevap değeri + responseText?: string; // Metin cevaplar için + score: number; // Hesaplanan puan + submittedDate: Date; +} + +export interface HrEvaluation360Result { // İnsan Kaynakları 360 Derece Değerlendirme Sonucu + id: string; + campaignId: string; + employeeId: string; + employee?: HrEmployee; + participants: HrEvaluation360Participant[]; // Bu sonuca katkıda bulunan değerlendiriciler + overallScore: number; + maxPossibleScore: number; + scorePercentage: number; + groupScores: HrGroupScore[]; + assessorTypeScores: HrAssessorTypeScore[]; + strengths: string[]; + developmentAreas: string[]; + actionPlan: string[]; + managerComments?: string; + hrComments?: string; + status: ResultStatusEnum; + generatedDate: Date; + approvedBy?: string; + approvedDate?: Date; +} + +export interface HrGroupScore { // İnsan Kaynakları Grup Puanı + groupId: string; + groupName: string; + score: number; + maxScore: number; + percentage: number; + responseCount: number; +} + +export interface HrAssessorTypeScore { // İnsan Kaynakları Değerlendirici Türü Puanı + assessorType: AssessorTypeEnum; + assessorCount: number; + averageScore: number; + maxScore: number; + percentage: number; +} + +export enum PayrollStatusEnum { // Maaş Durumu + Draft = "DRAFT", // Taslak + Calculated = "CALCULATED", // Hesaplandı + Approved = "APPROVED", // Onaylandı + Paid = "PAID", // Ödendi + Cancelled = "CANCELLED", // İptal edildi +} + +export enum GoalStatusEnum { // Hedef Durumu + NotStarted = "NOT_STARTED", // Başlanmadı + InProgress = "IN_PROGRESS", // Devam Ediyor + Completed = "COMPLETED", // Tamamlandı + Overdue = "OVERDUE", // Geçmiş + Cancelled = "CANCELLED", // İptal edildi +} + +export enum BadgeCategoryEnum { // Rozet Kategorisi + Performance = "PERFORMANCE", // Performans + Leadership = "LEADERSHIP", // Liderlik + Innovation = "INNOVATION", // Yenilik + Teamwork = "TEAMWORK", // Takım Çalışması + Customer = "CUSTOMER", // Müşteri + Safety = "SAFETY", // Güvenlik + Attendance = "ATTENDANCE", // Devamsızlık + Training = "TRAINING", // Eğitim + Project = "PROJECT", // Proje + Special = "SPECIAL", // Özel +} + +export enum BadgeRarityEnum { // Rozet Nadirliği + Common = "COMMON", // Orta + Uncommon = "UNCOMMON", // Yaygın olmayan + Rare = "RARE", // Nadir + Epic = "EPIC", // Epik + Legendary = "LEGENDARY", // Efsanevi +} + +export enum ResultStatusEnum { // Sonuç Durumu + Pending = "PENDING", // Beklemede + InReview = "IN_REVIEW", // İnceleniyor + Approved = "APPROVED", // Onaylandı + Published = "PUBLISHED", // Yayınlandı +} + +export enum GenderEnum { // Cinsiyet + Male = "MALE", // Erkek + Female = "FEMALE", // Kadın + Other = "OTHER", // Diğer +} + +export enum MaritalStatusEnum { // Medeni Durum + Single = "SINGLE", // Bekar + Married = "MARRIED", // Evli + Divorced = "DIVORCED", // Boşanmış + Widowed = "WIDOWED", // Dul +} + +export enum CostCenterType { // Masraf Merkezi Türü + Revenue = "REVENUE", // Gelir + Standard = "STANDARD", // Standart + Discretionary = "DISCRETIONARY", // İsteğe bağlı + Investment = "INVESTMENT", // Yatırım + Service = "SERVICE", // Hizmet + Production = "PRODUCTION", // Üretim + Support = "SUPPORT", // Destek + Administrative = "ADMINISTRATIVE", // İdari +} + +export enum EmploymentTypeEnum { // İstihdam Türü + FullTime = "FULL_TIME", // Tam Zamanlı + PartTime = "PART_TIME", // Yarı Zamanlı + Contract = "CONTRACT", // Sözleşmeli + Intern = "INTERN", // Stajyer + Temporary = "TEMPORARY", // Geçici + Consultant = "CONSULTANT", // Danışman +} + +export enum EmployeeStatusEnum { // Çalışan Durumu + Active = "ACTIVE", // Aktif + Inactive = "INACTIVE", // Pasif + OnLeave = "ON_LEAVE", // İzinli + Suspended = "SUSPENDED", // Askıya Alındı + Terminated = "TERMINATED", // İşten Ayrıldı +} + +export enum JobLevelEnum { // İş Seviyesi + Entry = "ENTRY", // Giriş + Junior = "JUNIOR", // Junior + Mid = "MID", // Orta + Senior = "SENIOR", // Kıdemli + Lead = "LEAD", // Lider + Manager = "MANAGER", // Yönetici + Director = "DIRECTOR", // Direktör + Executive = "EXECUTIVE", // İcra +} + +export enum LeaveTypeEnum { // İzin Türü + Annual = "ANNUAL", // Yıllık + Sick = "SICK", // Hastalık + Maternity = "MATERNITY", // Doğum + Paternity = "PATERNITY", // Babalık + Personal = "PERSONAL", // Kişisel + Emergency = "EMERGENCY", // Acil + Study = "STUDY", // Eğitim + Unpaid = "UNPAID", // Ücretsiz +} + +export enum LeaveStatusEnum { // İzin Durumu + Pending = "PENDING", // Beklemede + Approved = "APPROVED", // Onaylandı + Rejected = "REJECTED", // Reddedildi + Cancelled = "CANCELLED", // İptal edildi +} + +export enum EvaluationStatusEnum { // Değerlendirme Durumu + NotStarted = "NOT_STARTED", // Başlanmadı + InProgress = "IN_PROGRESS", // Devam Ediyor + PendingReview = "PENDING_REVIEW", // İnceleme Bekliyor + Completed = "COMPLETED", // Tamamlandı + Overdue = "OVERDUE", // Geçmiş +} + +export enum TrainingTypeEnum { // Eğitim Türü + Technical = "TECHNICAL", // Teknik + Soft_Skills = "SOFT_SKILLS", // Yumuşak Beceriler + Leadership = "LEADERSHIP", // Liderlik + Compliance = "COMPLIANCE", // Uyum + Safety = "SAFETY", // Güvenlik + Product = "PRODUCT", // Ürün + Process = "PROCESS", // Süreç +} + +export enum TrainingStatusEnum { // Eğitim Durumu + Planned = "PLANNED", // Planlandı + Open = "OPEN", // Açık + InProgress = "IN_PROGRESS", // Devam Ediyor + Completed = "COMPLETED", // Tamamlandı + Cancelled = "CANCELLED", // İptal Edildi +} + +export enum ParticipationStatusEnum { // Katılım Durumu + Enrolled = "ENROLLED", // Kayıtlı + InProgress = "IN_PROGRESS", // Devam Ediyor + Completed = "COMPLETED", // Tamamlandı + Failed = "FAILED", // Başarısız + Withdrawn = "WITHDRAWN", // Çekildi +} + +export enum DisciplinaryActionTypeEnum { // Disiplin Cezası Türü + Verbal_Warning = "VERBAL_WARNING", // Sözlü Uyarı + Written_Warning = "WRITTEN_WARNING", // Yazılı Uyarı + Final_Warning = "FINAL_WARNING", // Son Uyarı + Suspension = "SUSPENSION", // Askıya Alma + Termination = "TERMINATION", // İşten Çıkarma + Demotion = "DEMOTION", // Aşağı Alma +} + +export enum DisciplinarySeverityEnum { // Disiplin Cezası Şiddeti + Minor = "MINOR", // Hafif + Major = "MAJOR", // Ağır + Severe = "SEVERE", // Ciddi +} + +export enum DisciplinaryStatusEnum { // Disiplin Cezası Durumu + Active = "ACTIVE", // Aktif + Resolved = "RESOLVED", // Çözüldü + Expired = "EXPIRED", // Süresi Dolmuş + Appealed = "APPEALED", // İtiraz Edilmiş +} + +export enum AssessorTypeEnum { // Değerlendirici Türü + Self = "SELF", // Kendi + Manager = "MANAGER", // Yönetici + Peer = "PEER", // Meslektaş + Subordinate = "SUBORDINATE", // Ast + Customer = "CUSTOMER", // Müşteri + OtherDepartment = "OTHER_DEPARTMENT", // Diğer Departman + HRUpperManagement = "HR_UPPER_MANAGEMENT", // İK/Üst Yönetim + External = "EXTERNAL", // Dış paydaş değerlendirmesi (mevcut) +} + +export enum EvaluationTypeEnum { // Değerlendirme Türü + Annual = "ANNUAL", // Yıllık + Quarterly = "QUARTERLY", // Çeyrek + Probation = "PROBATION", // Deneme Süresi + Project = "PROJECT", // Proje + Competency = "COMPETENCY", // Yeterlilik + Leadership = "LEADERSHIP", // Liderlik + Degree360 = "DEGREE_360", // 360° Derece değerlendirme +} + +export enum CampaignStatusEnum { // Kampanya Durumu + Draft = "DRAFT", // Taslak + Active = "ACTIVE", // Aktif + Completed = "COMPLETED", // Tamamlandı + Cancelled = "CANCELLED", // İptal Edildi +} + +export enum ParticipantStatusEnum { // Katılımcı Durumu + Invited = "INVITED", // Davet Edildi + Started = "STARTED", // Başladı + Completed = "COMPLETED", // Tamamlandı + Expired = "EXPIRED", // Süresi Dolmuş + Declined = "DECLINED", // Reddedildi +} + +export enum QuestionTypeEnum { // Soru Türü + Rating = "RATING", // 1-5 puan verme + MultipleChoice = "MULTIPLE_CHOICE", // Çoktan seçmeli + Text = "TEXT", // Metin cevap + YesNo = "YES_NO", // Evet/Hayır + Scale = "SCALE", // Ölçek (1-10 gibi) +} diff --git a/ui/src/types/mm.ts b/ui/src/types/mm.ts new file mode 100644 index 00000000..d3801dc5 --- /dev/null +++ b/ui/src/types/mm.ts @@ -0,0 +1,662 @@ +import { Address, BusinessParty, PaymentTerms, PriorityEnum } from "./common"; +import { HrDepartment } from "./hr"; +import { WmWarehouse, WmZone, WmLocation } from "./wm"; + +export interface MmMaterial { // Malzeme + id: string; + code: string; + name: string; + barcode?: string; + description?: string; + materialTypeId: string; + materialType?: MmMaterialType; + materialGroupId: string; + materialGroup?: MmMaterialGroup; + baseUnitId: string; + baseUnit?: MmUnit; + costPrice: number; + salesPrice: number; + currency: string; + isActive: boolean; + totalStock: number; + alternativeUnits?: MmMaterialUnit[]; + trackingType: "Quantity" | "Lot" | "Serial"; + variants?: MmMaterialVariant[]; + specifications?: MmMaterialSpecification[]; + suppliers?: MmMaterialSupplier[]; + stockLevels?: MmStockLevel[]; + creationTime: Date; + lastModificationTime: Date; +} + +export interface MmMaterialType { // Malzeme Türü + id: string; + code: MaterialTypeEnum; + name: string; + description?: string; + isActive: boolean; + className: string; +} + +export interface MmMaterialGroup { // Malzeme Grubu + id: string; + code: string; + name: string; + parentGroupId?: string; + parentGroup?: MmMaterialGroup; + description?: string; + isActive: boolean; + children?: MmMaterialGroup[]; // Ağaç görünümü için eklendi +} + +export interface MmMaterialUnit { // Alternatif Birim + id: string; + materialId: string; + unitId: string; + unit?: MmUnit; + conversionFactor: number; + isDefault: boolean; +} + +export interface MmMaterialVariant { // Varyant + id: string; + materialId: string; + variantCode: string; + variantName: string; + specifications: Record; + additionalCost: number; + isActive: boolean; +} + +export interface MmMaterialSpecification { // Özellik + id: string; + materialId: string; + specificationName: string; + specificationValue: string; + unitId: string; + unit?: MmUnit; + isRequired: boolean; +} + +export interface MmMaterialSupplier { // Tedarikçi + id: string; + materialId: string; + supplierId: string; + supplier?: BusinessParty; + supplierMaterialCode?: string; + leadTime: number; + minimumOrderQuantity: number; + price: number; + currency: string; + isPreferred: boolean; +} + +export interface MmUnit { // Birim + id: string; + code: string; + name: string; + description?: string; + isActive: boolean; +} + +export interface MmLotNumber { // Parti Numarası + id: string; + materialId: string; + material?: MmMaterial; + lotNumber: string; + productionDate: Date; + expiryDate?: Date; + quantity: number; + unitId: string; + supplierId?: string; + qualityStatus: QualityStatusEnum; + isActive: boolean; +} + +export interface MmSerialNumber { // Seri Numarası + id: string; + materialId: string; + material?: MmMaterial; + serialNumber: string; + lotId?: string; + productionDate: Date; + warrantyExpiryDate?: Date; + currentLocationId?: string; + status: SerialStatusEnum; + isActive: boolean; +} + +export interface MmStockLevel { // Stok Seviyesi + id: string; + materialId: string; + warehouseId: string; + warehouse?: WmWarehouse; + zoneId?: string; + zone?: WmZone; + locationId?: string; + location?: WmLocation; + availableQuantity: number; + reservedQuantity: number; + inTransitQuantity: number; + minimumStock: number; + maximumStock: number; + reorderPoint: number; + lastUpdated: Date; +} + +export interface MmStockMovement { // Stok Hareketi + id: string; + movementNumber: string; + materialId: string; + material: MmMaterial; + movementType: MovementTypeEnum; + fromWarehouseId?: string; + fromWarehouse?: WmWarehouse; + fromZoneId?: string; + fromZone?: WmZone; + fromLocationId?: string; + fromLocation?: WmLocation; + toWarehouseId?: string; + toWarehouse?: WmWarehouse; + toZoneId?: string; + toZone?: WmZone; + toLocationId?: string; + toLocation?: WmLocation; + quantity: number; + unit?: MmUnit; + unitId?: string; + lotNumber?: string; + referenceDocument?: string; + referenceDocumentType?: string; + referenceType?: string; + movementDate: Date; + description?: string; + reason?: string; + performedBy?: string; + approvedBy?: string; + status?: MovementStatusEnum; + creationTime: Date; +} + +export interface MmPurchaseRequisition { + // Satınalma Talebi + id: string; + requisitionNumber: string; + requestedBy: string; + departmentId: string; + requestDate: Date; + requiredDate: Date; + priority: PriorityEnum; + status: RequisitionStatusEnum; + description?: string; + justification?: string; + totalAmount: number; + currency: string; + items: MmPurchaseRequisitionItem[]; + approvals: MmApprovalHistory[]; + creationTime: Date; + lastModificationTime: Date; +} + +export interface MmPurchaseRequisitionItem { // Satınalma Talebi Kalemi + id: string; + requisitionId: string; + materialId?: string; + material?: MmMaterial; + description: string; + quantity: number; + unitId: string; + estimatedPrice: number; + totalAmount: number; + requiredDate: Date; + specifications?: string; + preferredSupplierId?: string; + budgetCode?: string; +} + +export interface MmPurchaseOrder { // Satınalma Siparişi + id: string; + orderNumber: string; + supplierId: string; + supplier?: BusinessParty; + orderDate: Date; + deliveryDate: Date; + status: OrderStatusEnum; + paymentTerms: PaymentTerms; + currency: string; + exchangeRate: number; + subtotal: number; + taxAmount: number; + totalAmount: number; + deliveryAddress: Address; + terms?: string; + notes?: string; + items: MmPurchaseOrderItem[]; + receipts: MmGoodsReceipt[]; + creationTime: Date; + lastModificationTime: Date; + requestId: string; + requestTitle: string; + requestType: RequestTypeEnum; + quotationId: string; + expectedDeliveryDate: Date; + actualDeliveryDate?: Date; + deliveryTerms: string; + attachments: string[]; + approvedBy?: string; + approvedAt?: Date; +} + +export interface MmPurchaseOrderItem { // Sipariş Kalemi + id: string; + orderId: string; + materialId: string; + material?: MmMaterial; + description: string; + quantity: number; + unit: string; + unitPrice: number; + totalPrice: number; + deliveryDate: Date; + receivedQuantity: number; + deliveredQuantity: number; + remainingQuantity: number; + specifications?: string; + qualityRequirements?: string; +} + +export interface MmGoodsReceipt { // Mal Kabul + id: string; + receiptNumber: string; + orderId: string; + order?: MmPurchaseOrder; + receiptDate: Date; + receivedBy: string; + warehouseId: string; + status: ReceiptStatusEnum; + notes?: string; + items: MmGoodsReceiptItem[]; + qualityInspection?: MmQualityInspection; + creationTime: Date; + lastModificationTime: Date; +} + +export interface MmGoodsReceiptItem { // Mal Kabul Kalemi + id: string; + receiptId: string; + orderItemId: string; + materialId: string; + receivedQuantity: number; + acceptedQuantity: number; + rejectedQuantity: number; + lotNumber?: string; + expiryDate?: Date; + qualityStatus: QualityStatusEnum; + storageLocation?: string; +} + +export interface MmQualityInspection { // Kalite Muayenesi + id: string; + inspectionNumber: string; + receiptId: string; + inspectionDate: Date; + inspectedBy: string; + status: InspectionStatusEnum; + overallResult: QualityResultEnumEnum; + notes?: string; + checkpoints: MmQualityInspectionCheckpoint[]; +} + +export interface MmQualityInspectionCheckpoint { // Muayene Noktası + id: string; + inspectionId: string; + checkpointName: string; + expectedValue: string; + actualValue: string; + result: QualityResultEnumEnum; + notes?: string; +} + +export interface MmApprovalHistory { + id: string; + documentId: string; + documentType: string; + approverUserId: string; + approverName: string; + approvalLevel: number; + status: ApprovalStatusEnum; + comments?: string; + approvedAt?: Date; + creationTime: Date; +} + +export interface MmPurchaseRequest { // Satınalma Talebi + id: string; + requestNumber: string; + requestType: RequestTypeEnum; + description: string; + department: string; + requestedBy: string; + requestDate: Date; + requiredDate: Date; + priority: PriorityEnum; + status: RequestStatusEnum; + totalAmount?: number; + currency: string; + items: MmPurchaseRequestItem[]; + approvals: MmRequestApproval[]; + attachments: MmAttachment[]; + comments: MmRequestComment[]; + creationTime: Date; + lastModificationTime: Date; +} + +export interface MmPurchaseRequestItem { // Kalem + id: string; + requestId: string; + materialId?: string; + serviceDescription?: string; + quantity: number; + unit: string; + estimatedPrice?: number; + specification?: string; + justification?: string; + isUrgent: boolean; +} + +export interface MmRequestApproval { // Onay + id: string; + requestId: string; + approvalLevel: ApprovalLevelEnum; + approverUserId: string; + approverName: string; + approvalDate?: Date; + status: ApprovalStatusEnum; + comments?: string; + sequence: number; + isRequired: boolean; +} + +export interface MmQuotation { // Teklif + id: string; + quotationNumber: string; + requestId: string; + requestTitle: string; + requestType: RequestTypeEnum; + supplierId: string; + supplier?: BusinessParty; + quotationDate: Date; + validUntil: Date; + status: QuotationStatusEnum; + totalAmount: number; + currency: string; + paymentTerms: string; + deliveryTerms: string; + deliveryTime?: number; + items: MmQuotationItem[]; + evaluationScore?: number; + evaluationComments?: string; + evaluationNotes?: string; + notes?: string; + attachments: MmAttachment[]; + submittedBy: string; + submittedAt: Date; + evaluatedBy?: string; + evaluatedAt?: Date; + creationTime: Date; + lastModificationTime: Date; +} + +export interface MmAttachment { // Ek + id: string; + fileName: string; + fileSize: number; + fileType: string; + uploadedBy: string; + uploadedAt: Date; + url?: string; +} + +export interface MmQuotationItem { // Teklif Kalemi + id: string; + materialCode: string; + materialName: string; + description: string; + quantity: number; + unit: string; + unitPrice: number; + totalPrice: number; + leadTime?: number; + specifications: string[]; +} + +export interface MmApprovalWorkflow { // Onay İş Akışı + id: string; + name: string; + departmentId: string; + department?: HrDepartment; + requestType: RequestTypeEnum; + amountThreshold: number; + approvalLevels: MmApprovalWorkflowLevel[]; + isActive: boolean; + creationTime: Date; + lastModificationTime: Date; +} + +export interface MmApprovalWorkflowLevel { // Onay Seviyesi + id: string; + workflowId: string; + level: ApprovalLevelEnum; + approverUserIds: string[]; + approverNames: string[]; + sequence: number; + isRequired: boolean; + isParallel: boolean; + timeoutDays?: number; +} + +export interface MmSupplierPerformance { // Tedarikçi Performansı + deliveryPerformance: number; + qualityRating: number; + priceCompetitiveness: number; + responsiveness: number; + complianceRating: number; + overallScore: number; + lastEvaluationDate: Date; +} + +export interface MmRequestComment { // Yorum + id: string; + requestId: string; + userId: string; + userName: string; + comment: string; + commentDate: Date; + isInternal: boolean; +} + +export interface MmDelivery { // Teslimat + id: string; + deliveryNumber: string; + orderId: string; + orderNumber: string; + requestType: RequestTypeEnum; + supplierId: string; + supplierName: string; + courierCompany?: string; + trackingNumber?: string; + deliveryDate: Date; + expectedDeliveryDate: Date; + actualDeliveryDate?: Date; + status: DeliveryStatusEnum; + deliveryAddress: string; + receivedBy?: string; + items: MmDeliveryItem[]; + notes?: string; + attachments: string[]; + creationTime: Date; + lastModificationTime: Date; +} + +export interface MmDeliveryItem { // Teslimat Kalemi + id: string; + materialId: string; + material?: MmMaterial; + orderedQuantity: number; + deliveredQuantity: number; + unit: string; + condition: "Good" | "Damaged" | "Missing"; + notes?: string; +} + +export enum OrderStatusEnum { // Sipariş Durumu + Draft = "Draft", // Yeni + Pending = "Pending", // Onay Bekliyor + Approved = "Approved", // Onaylandı + Sent = "Sent", // Gönderildi + Confirmed = "Confirmed", // Onaylandı + PartiallyDelivered = "PartiallyDelivered", // Kısmen Teslim Edildi + PartiallyReceived = "PartiallyReceived", // Kısmen Alındı + Received = "Received", // Alındı + Delivered = "Delivered", // Teslim Edildi + Invoiced = "Invoiced", // Faturalandırıldı + Completed = "Completed", // Tamamlandı + Closed = "Closed", // Kapalı + Cancelled = "Cancelled", // İptal Edildi +} + +export enum SupplierTypeEnum { // Tedarikçi Türü + Material = "MATERIAL", // Malzeme + Service = "SERVICE", // Hizmet + Both = "BOTH", // Her ikisi +} + +export enum RequisitionStatusEnum { // Satınalma Talebi Durumu + Draft = "DRAFT", // Taslak + Submitted = "SUBMITTED", // Gönderildi + InApproval = "IN_APPROVAL", // Onayda + Approved = "APPROVED", // Onaylandı + Rejected = "REJECTED", // Reddedildi + Cancelled = "CANCELLED", // İptal Edildi + Converted = "CONVERTED", +} + +export enum ReceiptStatusEnum { // Mal Kabul Durumu + Pending = "PENDING", // Beklemede + InProgress = "IN_PROGRESS", // İşlemde + Completed = "COMPLETED", // Tamamlandı + OnHold = "ON_HOLD", // Beklemede +} + +export enum InspectionStatusEnum { // Muayene Durumu + Scheduled = "SCHEDULED", // Planlandı + InProgress = "IN_PROGRESS", // İşlemde + Completed = "COMPLETED", // Tamamlandı + OnHold = "ON_HOLD", // Beklemede +} + +export enum QualityResultEnumEnum { // Kalite Sonucu + Pass = "PASS", // Geçti + Fail = "FAIL", // Kaldı + Conditional = "CONDITIONAL", // Koşullu +} + +export enum ApprovalStatusEnum { // Onay Durumu + Pending = "PENDING", // Beklemede + Approved = "APPROVED", // Onaylandı + Rejected = "REJECTED", // Reddedildi +} + +export enum RequestTypeEnum { // Talep Türü + Material = "MATERIAL", // Malzeme + Service = "SERVICE", // Hizmet + WorkCenter = "WORKCENTER", // İş Merkezi + Maintenance = "MAINTENANCE", // Bakım +} + +export enum RequestStatusEnum { // Talep Durumu + Draft = "DRAFT", // Taslak + Submitted = "SUBMITTED", // Gönderildi + InReview = "IN_REVIEW", // İnceleme Aşamasında + Approved = "APPROVED", // Onaylandı + Rejected = "REJECTED", // Reddedildi + InQuotation = "IN_QUOTATION", // Teklif Aşamasında + Ordered = "ORDERED", // Sipariş Verildi + Completed = "COMPLETED", // Tamamlandı + Cancelled = "CANCELLED", // İptal Edildi +} + +export enum QuotationStatusEnum { // Teklif Durumu + Draft = "Draft", // Taslak + Pending = "Pending", // Beklemede + UnderReview = "UnderReview", // İnceleme Aşamasında + Submitted = "Submitted", // Gönderildi + Approved = "Approved", // Onaylandı + Rejected = "Rejected", // Reddedildi + Expired = "Expired", // Süresi Dolmuş +} + +export enum ApprovalLevelEnum { // Onay Seviyesi + Supervisor = "SUPERVISOR", // Ambar Sorumlusu + Manager = "MANAGER", // Müdür + Director = "DIRECTOR", // Direktör + GeneralManager = "GENERAL_MANAGER", // Genel Müdür + FinanceManager = "FINANCE_MANAGER", // Finans Müdürü + TechnicalManager = "TECHNICAL_MANAGER", // Teknik Müdür +} + +export enum SupplierCardTypeEnum { // Tedarikçi Kart Türü + Standard = "STANDARD", // Standart + Premium = "PREMIUM", // Premium + Strategic = "STRATEGIC", // Stratejik + Preferred = "PREFERRED", // Tercih Edilen +} + +export enum DeliveryStatusEnum { // Teslimat Durumu + Preparing = "Preparing", // Hazırlanıyor + Shipped = "Shipped", // Gönderildi + InTransit = "InTransit", // Taşınıyor + OutForDelivery = "OutForDelivery", // Teslimat İçin Yolda + Delivered = "Delivered", // Teslim Edildi + PartiallyDelivered = "PartiallyDelivered", // Kısmen Teslim Edildi + Delayed = "Delayed", // Gecikmiş + Returned = "Returned", // İade Edildi + Cancelled = "Cancelled", // İptal Edildi +} + +export enum MovementStatusEnum { // Hareket Durumu + Planned = "PLANNED", // Planlandı + InProgress = "IN_PROGRESS", // İşlemde + Completed = "COMPLETED", // Tamamlandı + Cancelled = "CANCELLED", // İptal Edildi +} + +export enum MovementTypeEnum { // Hareket Türü + GoodsReceipt = "GR", // Malzeme Girişi + GoodsIssue = "GI", // Malzeme Çıkışı + Transfer = "TR", // Transfer +} + +export enum MaterialTypeEnum { // Malzeme Türü + RawMaterial = "RAW", // Hammadde + SemiFinished = "SEMI", // Yarı Mamul + Finished = "FINISHED", // Mamul + Consumable = "CONSUMABLE", // Tüketim Malzemesi + Service = "SERVICE", // Hizmet + Spare = "SPARE", // Yedek Parça +} + +export enum QualityStatusEnum { // Kalite Durumu + Pending = "PENDING", // Beklemede + Approved = "APPROVED", // Onaylandı + Rejected = "REJECTED", // Reddedildi + Conditional = "CONDITIONAL", // Koşullu + Quarantine = "QUARANTINE", // Karantinada +} + +export enum SerialStatusEnum { // Seri Numarası Durumu + Available = "AVAILABLE", // Kullanılabilir + InUse = "IN_USE", // Kullanımda + Maintenance = "MAINTENANCE", // Bakımda + Disposed = "DISPOSED", // İmha Edildi +} diff --git a/ui/src/types/mrp.ts b/ui/src/types/mrp.ts new file mode 100644 index 00000000..23e6ef92 --- /dev/null +++ b/ui/src/types/mrp.ts @@ -0,0 +1,457 @@ +import { CrmSalesOrder } from "./admin/crm"; +import { PmWorkCenter, WorkOrderStatusEnum } from "./pm"; +import { + MmMaterial, + MmMaterialSupplier, + QualityResultEnumEnum, + QualityStatusEnum, +} from "./mm"; +import { PriorityEnum } from "./common"; + +export interface MrpProductionOrder { + // Üretim Emri + id: string; + orderNumber: string; + orderType: ProductionOrderTypeEnum; + customerRequirement?: string; + plannedStartDate: Date; + plannedEndDate: Date; + actualStartDate?: Date; + actualEndDate?: Date; + status: ProductionOrderStatusEnum; + priority: PriorityEnum; + plannedQuantity: number; //Planlanan Miktar + confirmedQuantity: number; //Üretilen Miktar + requiredQuantity: number; //Gereken Miktar + scrapQuantity: number; //Fire + unitId: string; + plannedCost: number; + actualCost: number; + currency: string; + materials: MrpProductionOrderMaterial[]; + workOrders: MrpWorkOrder[]; + creationTime: Date; + lastModificationTime: Date; +} + +export interface MrpProductionOrderMaterial { + // Üretim Emri Malzemesi + id: string; + productionOrderId: string; + salesOrderId?: string; + salesOrder?: CrmSalesOrder; + materialId: string; + material?: MmMaterial; + customerRequirement?: string; + plannedQuantity: number; //Planlanan Miktar + confirmedQuantity: number; //Üretilen Miktar + requiredQuantity: number; //Gereken Miktar + scrapQuantity: number; //Fire + unitId: string; +} + +export interface MrpWorkOrder { + // İş Emri + id: string; + workOrderNumber: string; + productionOrderId: string; + productionOrder?: MrpProductionOrder; + operationId: string; + operation?: MrpOperation; + materialId: string; + material?: MmMaterial; + sequence: number; + plannedStartDate: Date; + plannedEndDate: Date; + actualStartDate?: Date; + actualEndDate?: Date; + plannedQuantity: number; + confirmedQuantity: number; + scrapQuantity: number; + workCenterId: string; + workCenter?: PmWorkCenter; + assignedOperators: string[]; + setupTime: number; // minutes + processTime: number; // minutes + actualSetupTime?: number; + actualProcessTime?: number; + status: WorkOrderStatusEnum; + confirmations: MrpWorkOrderConfirmation[]; + qualityChecks: MrpWorkOrderQualityCheck[]; + creationTime: Date; + lastModificationTime: Date; +} + +export interface MrpWorkOrderConfirmation { + // İş Emri Onayı + id: string; + workOrderId: string; + confirmationDate: Date; + confirmedQuantity: number; + scrapQuantity: number; + actualSetupTime: number; + actualProcessTime: number; + confirmedBy: string; + notes?: string; + creationTime: Date; +} + +export interface MrpWorkOrderQualityCheck { + // Kalite Kontrol + id: string; + checkNumber: string; + workOrderId?: string; + productionOrderId?: string; + materialId: string; + checkType: QualityCheckTypeEnum; + checkDate: Date; + checkedBy: string; + status: QualityStatusEnum; + overallResult: QualityResultEnumEnum; + checkpoints: MrpWorkOrderQualityCheckpoint[]; + nonConformanceActions: MrpNonConformanceAction[]; + creationTime: Date; + lastModificationTime: Date; +} + +export interface MrpWorkOrderQualityCheckpoint { + // Kalite Kontrol Noktası + id: string; + qualityCheckId: string; + checkpointName: string; + specification: string; + measuredValue: string; + result: QualityResultEnumEnum; + notes?: string; +} + +export interface MrpNonConformanceAction { + // Uygunsuzluk Eylemi + id: string; + qualityCheckId: string; + actionType: NonConformanceActionTypeEnum; + description: string; + assignedTo: string; + dueDate: Date; + status: ActionStatusEnum; + completedDate?: Date; +} + +export interface MrpMaterialRequirement { + // Malzeme Gereksinimi + id: string; + mrpRunId: string; + materialId: string; + material?: MmMaterial; + grossRequirement: number; + scheduledReceipts: number; + projectedAvailable: number; + netRequirement: number; + plannedOrderReceipt: number; + plannedOrderRelease: number; + requirementDate: Date; + plannedReceiptDate: Date; + plannedReleaseDate: Date; + sourceType: RequirementSourceTypeEnum; + sourceDocumentId?: string; + creationTime: Date; + lastModificationTime: Date; +} + +export interface MrpRecommendation { + // Tavsiye + id: string; + mrpRunId: string; + materialId: string; + material?: MmMaterial; + recommendationType: RecommendationTypeEnum; + recommendedAction: string; + quantity: number; + dueDate: Date; + priority: PriorityEnum; + reason: string; + status: RecommendationStatusEnum; + implementedDate?: Date; + implementedBy?: string; + creationTime: Date; + lastModificationTime: Date; +} + +export interface MrpDemandForecast { + // Talep Tahmini + id: string; + materialId: string; + material?: MmMaterial; + forecastPeriod: string; + startDate: Date; + endDate: Date; + forecastMethod: ForecastMethodEnum; + forecastQuantity: number; + actualQuantity?: number; + accuracy?: number; + seasonalityFactor?: number; + trendFactor?: number; + creationTime: Date; + lastModificationTime: Date; + notes: string; +} + +export interface MrpPurchaseSuggestionn extends MrpRecommendation { + // Satınalma Tavsiyesi + supplierId: string; + supplier?: MmMaterialSupplier; + estimatedCost: number; + leadTime: number; + minimumOrderQuantity: number; + suggestedQuantity: number; + economicOrderQuantity: number; +} + +export interface MrpProductionSuggestion extends MrpRecommendation { + // Üretim Tavsiyesi + estimatedDuration: number; // in hours + resourceRequirements: { + workCenter: string; + capacity: number; + efficiency: number; + }[]; + bom?: { + id: string; + version: string; + materialCount: number; + totalCost: number; + }; + productionCost: number; + setupTime: number; + cycleTime: number; + suggestedStartDate: string; + suggestedCompletionDate: string; +} + +export interface MrpOperationTypeDefinition { + // Operasyon Türü Tanımı + id: string; + code: string; + name: string; + description?: string; + category: OperationCategoryEnum; + defaultDuration: number; + requiresSetup: boolean; + allowsParallelOperation: boolean; + qualityCheckRequired: boolean; + skillLevelRequired: number; + isActive: boolean; + creationTime: Date; + lastModificationTime: Date; +} + +export interface MrpOperation { + // Operasyon + id: string; + code: string; + name: string; + description?: string; + operationTypeId?: string; + operationType?: MrpOperationTypeDefinition; + workCenterId: string; + workCenter?: PmWorkCenter; + standardTime: number; // minutes + setupTime: number; // minutes + laborCost: number; + machineCost: number; + overheadCost: number; + isActive: boolean; + instructions?: string; + qualityCheckRequired: boolean; + creationTime: Date; + lastModificationTime: Date; +} + +export interface MrpBOM { + // Malzeme Listesi (BOM) + id: string; + bomCode: string; + materialId: string; + material?: MmMaterial; + version: string; + validFrom: Date; + validTo?: Date; + isActive: boolean; + bomType: BOMTypeEnum; + baseQuantity: number; + components: MrpBOMComponent[]; + operations: MrpBOMOperation[]; + creationTime: Date; + lastModificationTime: Date; +} + +export interface MrpBOMComponent { + // BOM Bileşeni + id: string; + bomId: string; + materialId: string; + material?: MmMaterial; + quantity: number; + unitId: string; + scrapPercentage: number; + isPhantom: boolean; + position: number; + validFrom: Date; + validTo?: Date; + isActive: boolean; +} + +export interface MrpBOMOperation { + // BOM Operasyonu + id: string; + bomId: string; + operationId: string; + operation?: MrpOperation; + sequence: number; + setupTime: number; + runTime: number; + waitTime: number; + queueTime: number; + moveTime: number; + isActive: boolean; + workCenterId: string; + workCenter?: PmWorkCenter; + isParallel: boolean; + prerequisites: string[]; + qualityChecks: MrpBOMQualityCheck[]; + tools: MrpToolRequirement[]; + skills: MrpSkillRequirement[]; +} + +export interface MrpBOMQualityCheck { + // Kalite Kontrol Noktası + id: string; + name: string; + description?: string; + checkType: QualityCheckTypeEnum; + parameter: string; + minValue?: number; + maxValue?: number; + targetValue?: number; + tolerance?: number; + isRequired: boolean; +} + +export interface MrpToolRequirement { + // Araç Gereksinimi + id: string; + toolId: string; + toolName: string; + quantity: number; + isRequired: boolean; +} + +export interface MrpSkillRequirement { + // Beceri Gereksinimi + id: string; + skillName: string; + level: number; + isRequired: boolean; +} + +export enum ProductionOrderTypeEnum { // Üretim Emri Türü + Standard = "STANDARD", // Standart üretim emri + Rework = "REWORK", // Yeniden işleme emri + Maintenance = "MAINTENANCE", // Bakım emri + Sample = "SAMPLE", // Numune üretim emri +} + +export enum ProductionOrderStatusEnum { // Üretim Emri Durumu + Created = "CREATED", // Oluşturuldu + Released = "RELEASED", // Serbest bırakıldı + InProgress = "IN_PROGRESS", // İşlemde + Completed = "COMPLETED", // Tamamlandı + Cancelled = "CANCELLED", // İptal edildi + OnHold = "ON_HOLD", // Beklemede +} + +export enum QualityCheckTypeEnum { // Kalite Kontrol Türü + Incoming = "INCOMING", // Giriş + InProcess = "IN_PROCESS", // Süreç içi + Final = "FINAL", // Nihai + Random = "RANDOM", // Rastgele + Dimensional = "DIMENSIONAL", // Boyutsal + Visual = "VISUAL", // Görsel + Functional = "FUNCTIONAL", // Fonksiyonel + Material = "MATERIAL", // Malzeme + Electrical = "ELECTRICAL", // Elektriksel +} + +export enum NonConformanceActionTypeEnum { // Uygunsuzluk Eylem Türü + Rework = "REWORK", // Yeniden işleme + Scrap = "SCRAP", // Hurda + UseAsIs = "USE_AS_IS", // Olduğu gibi kullan + Return = "RETURN", // İade et +} + +export enum ActionStatusEnum { // Eylem Durumu + Open = "OPEN", // Açık + InProgress = "IN_PROGRESS", // İşlemde + Completed = "COMPLETED", // Tamamlandı + Cancelled = "CANCELLED", // İptal edildi +} + +export enum RequirementSourceTypeEnum { // Gereksinim Kaynak Türü + SalesOrder = "SALES_ORDER", // Satış Siparişi + Forecast = "FORECAST", // Tahmin + SafetyStock = "SAFETY_STOCK", // Güvenlik Stoku + ProductionOrder = "PRODUCTION_ORDER", // Üretim Emri +} + +export enum RecommendationTypeEnum { // Tavsiye Türü + PlannedOrder = "PLANNED_ORDER", // Planlanan Sipariş + PurchaseRequisition = "PURCHASE_REQUISITION", // Satınalma Talebi + Reschedule = "RESCHEDULE", // Yeniden Planla + Cancel = "CANCEL", // İptal Et +} + +export enum RecommendationStatusEnum { // Tavsiye Durumu + Open = "OPEN", // Açık + Implemented = "IMPLEMENTED", // Uygulandı + Rejected = "REJECTED", // Reddedildi + Expired = "EXPIRED", // Süresi Doldu +} + +export enum ForecastMethodEnum { // Tahmin Yöntemi + MovingAverage = "MOVING_AVERAGE", // Hareketli Ortalama + ExponentialSmoothing = "EXPONENTIAL_SMOOTHING", // Üstel Yumuşatma + LinearRegression = "LINEAR_REGRESSION", // Doğrusal Regresyon + Seasonal = "SEASONAL", // Mevsimsel +} + +export enum SecurityLevelEnum { // Güvenlik Seviyesi + Low = "LOW", // Düşük + Medium = "MEDIUM", // Orta + High = "HIGH", // Yüksek + Restricted = "RESTRICTED", // Kısıtlı +} + +export enum BOMTypeEnum { // BOM Türü + Production = "PROD", // Üretim + Engineering = "ENG", // Mühendislik + Planning = "PLAN", // Planlama + Costing = "COST", // Maliyetlendirme +} + +export enum RoutingStatusEnum { // Rota Durumu + Draft = "DRAFT", // Taslak + Active = "ACTIVE", // Aktif + Inactive = "INACTIVE", // Pasif + Obsolete = "OBSOLETE", // Kullanım dışı +} + +export enum OperationCategoryEnum { // Operasyon Kategorisi + Production = "PROD", // Üretim + Assembly = "ASSY", // Montaj + Inspection = "INSP", // Muayene + Packaging = "PACK", // Ambalajlama + Setup = "SETUP", // Kurulum + Maintenance = "MAINT", // Bakım + Transport = "TRANS", // Taşıma + Quality = "QUAL", // Kalite +} diff --git a/ui/src/types/pm.ts b/ui/src/types/pm.ts new file mode 100644 index 00000000..c1c17b62 --- /dev/null +++ b/ui/src/types/pm.ts @@ -0,0 +1,278 @@ +import { PriorityEnum } from "./common"; +import { HrDepartment } from "./hr"; +import { MmMaterial } from "./mm"; + +export type CalendarView = "month" | "week" | "day"; + +export interface PmWorkCenter { + // İş Merkezi / Ekipman + id: string; + code: string; + name: string; + description?: string; + workCenterId: string; + workCenterType?: PmWorkCenterType; + manufacturer?: string; + model?: string; + serialNumber?: string; + installationDate: Date; + warrantyExpiry?: Date; + location: string; + departmentId: string; + department?: HrDepartment; + status: WorkCenterStatusEnum; + criticality: CriticalityLevelEnum; + specifications: PmWorkCenterSpecification[]; + maintenancePlans: PmMaintenancePlan[]; + workOrders: PmMaintenanceWorkOrder[]; + downTimeHistory: PmDownTimeRecord[]; + capacity: number; + costPerHour: number; + setupTime: number; + machineType: string; + isActive: boolean; + creationTime: Date; + lastModificationTime: Date; +} + +export interface PmWorkCenterType { + // İş Merkezi / Ekipman Türü + id: string; + code: string; + name: string; + description?: string; + category: string; + isActive: boolean; +} + +export interface PmWorkCenterSpecification { + // İş Merkezi / Ekipman Özelliği + id: string; + workCenterId: string; + specificationName: string; + specificationValue: string; + unit?: string; + isRequired: boolean; +} + +export interface PmMaintenancePlan { + // Bakım Planı + id: string; + planCode: string; + workCenterId: string; + workCenter?: PmWorkCenter; + planType: MaintenancePlanTypeEnum; + description: string; + frequency: number; + frequencyUnit: FrequencyUnitEnum; + estimatedDuration: number; // minutes + priority: PriorityEnum; + maintenanceTeamId?: string; + instructions?: string; + requiredMaterials: PmPlanMaterial[]; + requiredSkills: string[]; + lastExecuted?: Date; + nextDue: Date; + isActive: boolean; + creationTime: Date; + lastModificationTime: Date; +} + +export interface PmPlanMaterial { + // Bakım Planı İçin Gerekli Malzeme + id: string; + planId: string; + materialId: string; + material?: MmMaterial; + quantity: number; + unitId: string; + isRequired: boolean; +} + +export interface PmMaintenanceWorkOrder { + // Bakım İş Emri + id: string; + workOrderNumber: string; + workCenterId: string; + workCenter?: PmWorkCenter; + planId?: string; + plan?: PmMaintenancePlan; + orderType: WorkOrderTypeEnum; + priority: PriorityEnum; + status: WorkOrderStatusEnum; + description: string; + reportedBy: string; + assignedTo?: string; + maintenanceTeamId?: string; + scheduledStart?: Date; + scheduledEnd?: Date; + actualStart?: Date; + actualEnd?: Date; + estimatedCost: number; + actualCost: number; + materials: PmWorkOrderMaterial[]; + activities: PmWorkOrderActivity[]; + notes?: string; + completionNotes?: string; + creationTime: Date; + lastModificationTime: Date; +} + +export interface PmWorkOrderMaterial { + // Bakım İş Emri İçin Kullanılan Malzeme + id: string; + workOrderId: string; + materialId: string; + materialCode?: string; + materialName?: string; + material?: MmMaterial; + plannedQuantity: number; + actualQuantity: number; + unitCost: number; + totalCost: number; +} + +export interface PmWorkOrderActivity { + // Bakım İş Emri Faaliyeti + id: string; + workOrderId: string; + activityDescription: string; + plannedDuration: number; + actualDuration: number; + performedBy: string; + completedAt?: Date; + notes?: string; +} + +export interface PmDownTimeRecord { + // İş Merkezi / Ekipman Arıza Süreç Kaydı + id: string; + workCenterId: string; + workOrderId?: string; + downTimeStart: Date; + downTimeEnd?: Date; + duration?: number; // minutes + reason: string; + impact: DownTimeImpactEnum; + cost: number; + description?: string; +} + +export interface PmFaultNotification { + // Arıza Bildirimi + id: string; + notificationCode: string; + workCenterId: string; + workCenter: PmWorkCenter; + location: string; + faultType: FaultTypeEnum; + priority: PriorityEnum; + severity: CriticalityLevelEnum; + title: string; + description: string; + reportedBy: string; + reportedAt: Date; + assignedTo?: string; + status: NotificationStatusEnum; + images?: string[]; + estimatedRepairTime?: number; // minutes + actualRepairTime?: number; // minutes + resolutionNotes?: string; + closedBy?: string; + closedAt?: Date; + workOrderId?: string; + followUpRequired: boolean; + isActive: boolean; + creationTime: Date; + lastModificationTime: Date; +} + +export interface PmCalendarEvent { + // Bakım Takvimi Etkinliği + id: string; + title: string; + type: "plan" | "workorder"; + date: Date; + startTime?: string; + endTime?: string; + status: WorkOrderStatusEnum; + priority: PriorityEnum; + assignedTo?: string; + workCenterCode?: string; + duration: number; // minutes +} + +export enum CriticalityLevelEnum { // Kritik Seviye + Low = "LOW", // Düşük + Medium = "MEDIUM", // Orta + High = "HIGH", // Yüksek + Critical = "CRITICAL", // Kritik +} + +export enum MaintenancePlanTypeEnum { // Bakım Plan Türü + Preventive = "PREVENTIVE", // Önleyici + Predictive = "PREDICTIVE", // Tahmine Dayalı + Corrective = "CORRECTIVE", // Düzeltici + Condition = "CONDITION", // Durum Bazlı +} + +export enum FrequencyUnitEnum { // Frekans Birimi + Days = "DAYS", // Günler + Weeks = "WEEKS", // Haftalar + Months = "MONTHS", // Aylar + Years = "YEARS", // Yıllar + Hours = "HOURS", // Saatler + Cycles = "CYCLES", // Döngüler +} + +export enum WorkOrderTypeEnum { // İş Emri Türü + Preventive = "PREVENTIVE", // Önleyici + Corrective = "CORRECTIVE", // Düzeltici + Emergency = "EMERGENCY", // Acil + Inspection = "INSPECTION", // Denetim + Calibration = "CALIBRATION", // Kalibrasyon +} + +export enum WorkOrderStatusEnum { // İş Emri Durumu + Created = "CREATED", // Oluşturuldu + Planned = "PLANNED", // Planlandı + Released = "RELEASED", // Serbest Bırakıldı + InProgress = "IN_PROGRESS", // Devam Ediyor + OnHold = "ON_HOLD", // Beklemede + Completed = "COMPLETED", // Tamamlandı + Cancelled = "CANCELLED", // İptal Edildi +} + +export enum DownTimeImpactEnum { // Arıza Süreç Etkisi + Low = "LOW", // DÜŞÜK + Medium = "MEDIUM", // ORTA + High = "HIGH", // YÜKSEK + Critical = "CRITICAL", // KRİTİK +} + +export enum FaultTypeEnum { // Arıza Türü + Mechanical = "MECHANICAL", // Mekanik + Electrical = "ELECTRICAL", // Elektrik + Hydraulic = "HYDRAULIC", // Hidrolik + Pneumatic = "PNEUMATIC", // Pnömatik + Software = "SOFTWARE", // Yazılım + Safety = "SAFETY", // Güvenlik + Performance = "PERFORMANCE", // Performans + Other = "OTHER", // Diğer +} + +export enum NotificationStatusEnum { // Bildirim Durumu + Open = "OPEN", // Açık + Assigned = "ASSIGNED", // Atandı + InProgress = "IN_PROGRESS", // Devam Ediyor + Resolved = "RESOLVED", // Çözüldü + Closed = "CLOSED", // Kapandı + Rejected = "REJECTED", // Reddedildi +} + +export enum WorkCenterStatusEnum { // İş Merkezi / Ekipman Durumu + Operational = "OPERATIONAL", // OPERATİF + UnderMaintenance = "UNDER_MAINTENANCE", // BAKIMDA + OutOfOrder = "OUT_OF_ORDER", // ARIZALI + Retired = "RETIRED", // ESKİ +} diff --git a/ui/src/types/ps.ts b/ui/src/types/ps.ts new file mode 100644 index 00000000..7ad47dc5 --- /dev/null +++ b/ui/src/types/ps.ts @@ -0,0 +1,342 @@ +import { BusinessParty, PriorityEnum } from "./common"; +import { HrEmployee } from "./hr"; + +export interface PsProject { + // Proje + id: string; + code: string; + name: string; + description?: string; + projectType: ProjectTypeEnum; + status: ProjectStatusEnum; + priority: PriorityEnum; + customerId?: string; + customer?: BusinessParty; + projectManagerId: string; + projectManager?: HrEmployee; + startDate: Date; + endDate: Date; + actualStartDate?: Date; + actualEndDate?: Date; + budget: number; + actualCost: number; + currency: string; + progress: number; + phases: PsProjectPhase[]; + tasks: PsProjectTask[]; + risks: PsProjectRisk[]; + documents: PsProjectDocument[]; + isActive: boolean; + creationTime: Date; + lastModificationTime: Date; +} + +export interface PsProjectPhase { + // Proje Fazı + id: string; + projectId: string; + project?: PsProject; + code: string; + name: string; + description?: string; + sequence: number; + startDate: Date; + endDate: Date; + actualStartDate?: Date; + actualEndDate?: Date; + status: PhaseStatusEnum; + budget: number; + actualCost: number; + progress: number; + tasks: PsProjectTask[]; + isActive: boolean; + milestones: number; + completedMilestones: number; + assignedTeams: string[]; + deliverables: string[]; + risks: string[]; + category: string; +} + +export interface PsProjectTask { + // Proje Görevi + id: string; + projectId: string; + phaseId?: string; + phase?: PsProjectPhase; + taskCode: string; + name: string; + description?: string; + taskType: TaskTypeEnum; + status: TaskStatusEnum; + priority: PriorityEnum; + assignedTo?: string; + assignee?: HrEmployee; + startDate: Date; + endDate: Date; + actualStartDate?: Date; + actualEndDate?: Date; + estimatedHours: number; + actualHours: number; + progress: number; + activities: PsTaskActivity[]; + comments: PsTaskComment[]; + isActive: boolean; + creationTime: Date; + lastModificationTime: Date; +} + +export interface PsProjectRisk { + // Proje Riski + id: string; + projectId: string; + riskCode: string; + title: string; + description: string; + category: RiskCategoryEnum; + probability: RiskProbabilityEnum; + impact: RiskImpactEnum; + riskLevel: RiskLevelEnum; + status: RiskStatusEnum; + identifiedBy: string; + identifiedDate: Date; + mitigationPlan?: string; + contingencyPlan?: string; + ownerId?: string; + reviewDate?: Date; + isActive: boolean; +} + +export interface PsTaskActivity { + // Görev Aktivitesi + id: string; + taskId: string; + activityType: PsActivityTypeEnum; + description: string; + performedBy: string; + performedAt: Date; + hoursSpent?: number; + notes?: string; +} + +export interface PsTaskComment { + // Görev Yorumu + id: string; + taskId: string; + comment: string; + commentedBy: string; + commentedAt: Date; + isInternal: boolean; +} + +export interface PsProjectDocument { + // Proje Belgesi + id: string; + projectId: string; + documentName: string; + documentType: PsDocumentTypeEnum; + filePath: string; + fileSize: number; + uploadedBy: string; + uploadedAt: Date; + version: string; + isActive: boolean; +} + +export interface PsActivity { + // Aktivite + id: string; + activityType: PsActivityTypeEnum; + name: string; + description: string; + category: string; + defaultDuration: number; // hours + isActive: boolean; + creationTime: Date; + lastModificationTime: Date; +} + +export interface PsProjectCostTracking { + // Proje Maliyet Takibi + id: string; + projectId: string; + projectName: string; + projectCode: string; + plannedBudget: number; + actualCost: number; + remainingBudget: number; + plannedStartDate: Date; + plannedEndDate: Date; + actualStartDate?: Date; + actualEndDate?: Date; + plannedDuration: number; // days + actualDuration?: number; // days + progress: number; // percentage + status: "ON_TRACK" | "AT_RISK" | "DELAYED" | "COMPLETED"; + currency: string; + lastUpdated: Date; +} + +export interface PsTaskDailyUpdate { + // Görev Günlük Güncellemesi + id: string; + taskId: string; + task?: PsProjectTask; + employeeId: string; + employee?: HrEmployee; + date: Date; + hoursWorked: number; + description: string; + workType: WorkTypeEnum; + progress: number; // percentage + challenges?: string; + nextSteps?: string; + status: DailyUpdateStatusEnum; + attachments?: string[]; + creationTime: Date; + lastModificationTime: Date; +} + +export interface PsGanttTask { + // Gantt Görevi + id: string; + name: string; + type: "project" | "phase" | "task"; + startDate: Date; + endDate: Date; + progress: number; + assignee?: HrEmployee; + parentId?: string; + children?: PsGanttTask[]; + dependencies?: string[]; + priority: PriorityEnum; + status: TaskStatusEnum | ProjectStatusEnum | PhaseStatusEnum; + hoursWorked?: number; + estimatedHours?: number; + level: number; // indentation level +} + +export enum WorkTypeEnum { // İş Türü + Development = "DEVELOPMENT", // Geliştirme + Testing = "TESTING", // Test + Design = "DESIGN", // Tasarım + Documentation = "DOCUMENTATION", // Dokümantasyon + Meeting = "MEETING", // Toplantı + Research = "RESEARCH", // Araştırma + Debugging = "DEBUGGING", // Hata Ayıklama + Review = "REVIEW", // İnceleme + Other = "OTHER", // Diğer +} + +export enum DailyUpdateStatusEnum { // Günlük Güncelleme Durumu + Draft = "DRAFT", // Taslak + Submitted = "SUBMITTED", // Gönderildi + Approved = "APPROVED", // Onaylandı + Rejected = "REJECTED", // Reddedildi +} + +export enum ProjectTypeEnum { // Proje Türü + Internal = "INTERNAL", // Dahili + Customer = "CUSTOMER", // Müşteri + Research = "RESEARCH", // Araştırma + Maintenance = "MAINTENANCE", // Bakım + Development = "DEVELOPMENT", // Geliştirme +} + +export enum ProjectStatusEnum { // Proje Durumu + Planning = "PLANNING", // Planlama + Active = "ACTIVE", // Aktif + OnHold = "ON_HOLD", // Beklemede + Completed = "COMPLETED", // Tamamlandı + Cancelled = "CANCELLED", // İptal Edildi +} + +export enum PhaseStatusEnum { // Faz Durumu + NotStarted = "NOT_STARTED", // Başlanmadı + InProgress = "IN_PROGRESS", // Devam Ediyor + Completed = "COMPLETED", // Tamamlandı + OnHold = "ON_HOLD", // Beklemede + Cancelled = "CANCELLED", // İptal Edildi +} + +export enum TaskStatusEnum { // Görev Durumu + NotStarted = "NOT_STARTED", // Başlanmadı + InProgress = "IN_PROGRESS", // Devam Ediyor + Completed = "COMPLETED", // Tamamlandı + OnHold = "ON_HOLD", // Beklemede + Cancelled = "CANCELLED", // İptal Edildi +} + +export enum TaskTypeEnum { // Görev Türü + Development = "DEVELOPMENT", // Geliştirme + Testing = "TESTING", // Test + Documentation = "DOCUMENTATION", // Dokümantasyon + Review = "REVIEW", // İnceleme + Deployment = "DEPLOYMENT", // Dağıtım + Meeting = "MEETING", // Toplantı +} + +export enum RiskCategoryEnum { // Risk Kategorisi + Technical = "TECHNICAL", // Teknik + Schedule = "SCHEDULE", // Zamanlama + Budget = "BUDGET", // Bütçe + Resource = "RESOURCE", // Kaynak + External = "EXTERNAL", // Dışsal + Quality = "QUALITY", // Kalite +} + +export enum RiskProbabilityEnum { // Risk Olasılığı + VeryLow = "VERY_LOW", // Çok Düşük + Low = "LOW", // Düşük + Medium = "MEDIUM", // Orta + High = "HIGH", // Yüksek + VeryHigh = "VERY_HIGH", // Çok Yüksek +} + +export enum RiskImpactEnum { // Risk Etkisi + VeryLow = "VERY_LOW", // Çok Düşük + Low = "LOW", // Düşük + Medium = "MEDIUM", // Orta + High = "HIGH", // Yüksek + VeryHigh = "VERY_HIGH", // Çok Yüksek +} + +export enum RiskLevelEnum { // Risk Seviyesi + Low = "LOW", // Düşük + Medium = "MEDIUM", // Orta + High = "HIGH", // Yüksek + Critical = "CRITICAL", // Kritik +} + +export enum RiskStatusEnum { // Risk Durumu + Identified = "IDENTIFIED", // Belirlendi + Analyzing = "ANALYZING", // Analiz Ediliyor + Mitigating = "MITIGATING", // Azaltılıyor + Monitoring = "MONITORING", // İzleniyor + Closed = "CLOSED", // Kapatıldı +} + +export enum PsActivityTypeEnum { // Aktivite Türü + WorkLog = "WORK_LOG", // İş Günlüğü + StatusUpdate = "STATUS_UPDATE", // Durum Güncellemesi + Issue = "ISSUE", // Sorun + Meeting = "MEETING", // Toplantı + Review = "REVIEW", // İnceleme + TaskCreated = "TASK_CREATED", // Görev Oluşturuldu + TaskUpdated = "TASK_UPDATED", // Görev Güncellendi + TaskCompleted = "TASK_COMPLETED", // Görev Tamamlandı + CommentAdded = "COMMENT_ADDED", // Yorum Eklendi + FileUploaded = "FILE_UPLOADED", // Dosya Yüklendi + StatusChanged = "STATUS_CHANGED", // Durum Değişti + AssignmentChanged = "ASSIGNMENT_CHANGED", // Atama Değişti + MeetingScheduled = "MEETING_SCHEDULED", // Toplantı Planlandı +} + +export enum PsDocumentTypeEnum { // Belge Türü + Specification = "SPECIFICATION", // Spesifikasyon + Design = "DESIGN", // Tasarım + Contract = "CONTRACT", // Sözleşme + Report = "REPORT", // Rapor + Manual = "MANUAL", // Kılavuz + Other = "OTHER", // Diğer +} diff --git a/ui/src/types/wm.ts b/ui/src/types/wm.ts new file mode 100644 index 00000000..13fd981c --- /dev/null +++ b/ui/src/types/wm.ts @@ -0,0 +1,246 @@ +import { Address } from "./common"; +import { MmMaterial } from "./mm"; +import { SecurityLevelEnum } from "./admin/mrp"; + +export interface WmWarehouse { + // Depo + id: string; + code: string; + name: string; + description?: string; + address?: Address; + warehouseType: WarehouseTypeEnum; + locations: WmLocation[]; + isMainWarehouse: boolean; + capacity: number; + currentUtilization: number; + zones: WmZone[]; + isActive: boolean; + securityLevel: SecurityLevelEnum; + temperatureControlled: boolean; + managerId: number; + creationTime: Date; + lastModificationTime: Date; +} + +export interface WmZone { + // Bölge + id: string; + warehouseId: string; + zoneCode: string; + name: string; + description?: string; + zoneType: ZoneTypeEnum; + temperature?: number; + humidity?: number; + locations: WmLocation[]; + isActive: boolean; +} + +export interface WmLocation { + // Lokasyon + id: string; + warehouseId: string; + zoneId?: string; + locationCode: string; + name: string; + description?: string; + locationType: LocationTypeEnum; + capacity: number; + currentStock: number; + dimensions?: WmLocationDimensions; + restrictions?: string[]; + stockItems: WmStockItem[]; + isActive: boolean; +} + +export interface WmLocationDimensions { + // Lokasyon Boyutları + length: number; + width: number; + height: number; + weight: number; + unit: string; +} + +export interface WmStockItem { + // Stok Kalemi + id: string; + materialId: string; + material?: MmMaterial; + warehouseId: string; + zoneId: string; + locationId: string; + quantity: number; + reservedQuantity: number; + availableQuantity: number; + unitId: string; + lotNumber?: string; + serialNumber?: string; + expiryDate?: Date; + receivedDate: Date; + lastMovementDate: Date; + status: StockStatusEnum; +} + +export interface WmInventoryCount { + // Envanter Sayımı + id: string; + countNumber: string; + warehouseId: string; + warehouse?: WmWarehouse; + zoneId?: string; + zone?: WmZone; + locationId?: string; + location?: WmLocation; + countType: CountTypeEnum; + status: CountStatusEnum; + scheduledDate: Date; + startDate?: Date; + endDate?: Date; + countedBy: string[]; + approvedBy?: string; + items: WmInventoryCountItem[]; + variances: WmInventoryVariance[]; + notes?: string; + creationTime: Date; + lastModificationTime: Date; +} + +export interface WmInventoryCountItem { + // Envanter Sayım Kalemi + id: string; + countId: string; + materialId: string; + material?: MmMaterial; + locationId: string; + systemQuantity: number; + countedQuantity: number; + variance: number; + variancePercentage: number; + lotNumber?: string; + serialNumber?: string; + countedBy: string; + countedAt: Date; + notes?: string; +} + +export interface WmInventoryVariance { + // Envanter Farkı + id: string; + countId: string; + materialId: string; + locationId: string; + variance: number; + varianceValue: number; + reason?: string; + action: VarianceActionEnum; + adjustmentMade: boolean; + approvedBy?: string; + approvedAt?: Date; +} + +export interface WmPutawayRule { + // Yerleştirme Kuralı + id: string; + code: string; + name: string; + description?: string; + warehouseId: string; + materialTypeId?: string; + materialGroupId?: string; + priority: number; + conditions: WmPutawayCondition[]; + targetZoneId?: string; + targetLocationId?: string; + strategy: PutawayStrategyEnum; + isActive: boolean; +} + +export interface WmPutawayCondition { + // Yerleştirme Koşulu + id: string; + ruleId: string; + conditionType: ConditionTypeEnum; + operator: ConditionOperatorEnum; + value: string; +} + +export enum WarehouseTypeEnum { // Depo Türleri + RawMaterials = "RAW_MATERIALS", // Hammaddeler + FinishedGoods = "FINISHED_GOODS", // Mamuller + WorkInProgress = "WIP", // İşlenmekte olan ürünler + SpareParts = "SPARE_PARTS", // Yedek Parçalar + Returns = "RETURNS", // İadeler + Quarantine = "QUARANTINE", // Karantina + Transit = "TRANSIT", // Geçici Depo +} + +export enum ZoneTypeEnum { // Bölge Türleri + Storage = "STORAGE", // Depolama + Receiving = "RECEIVING", // Giriş + Shipping = "SHIPPING", // Çıkış + Picking = "PICKING", // Toplama + Quality = "QUALITY", // Kalite Kontrol + Staging = "STAGING", // Sevkiyat Hazırlık +} + +export enum LocationTypeEnum { // Lokasyon Türleri + Shelf = "SHELF", // Raf + Bin = "BIN", // Kutu + Floor = "FLOOR", // Zemin + Rack = "RACK", // Palet Rafı + Tank = "TANK", // Tank +} + +export enum StockStatusEnum { // Stok Durumları + Available = "AVAILABLE", // Mevcut + Reserved = "RESERVED", // Rezerve Edilmiş + Blocked = "BLOCKED", // Engellenmiş + InTransit = "IN_TRANSIT", // Transferde + Quarantine = "QUARANTINE", // Karantina +} + +export enum CountTypeEnum { // Sayım Türleri + Full = "FULL", // Tam Sayım + Cycle = "CYCLE", // Döngüsel Sayım + Spot = "SPOT", // Noktasal Sayım +} + +export enum CountStatusEnum { // Sayım Durumları + Planned = "PLANNED", // Planlandı + InProgress = "IN_PROGRESS", // Devam Ediyor + Completed = "COMPLETED", // Tamamlandı + Approved = "APPROVED", // Onaylandı +} + +export enum VarianceActionEnum { // Fark Eylem Türleri + Accept = "ACCEPT", // Kabul Et + Investigate = "INVESTIGATE", // Araştır + Recount = "RECOUNT", // Yeniden Say + Adjust = "ADJUST", // Düzelt +} + +export enum PutawayStrategyEnum { // Yerleştirme Stratejileri + FIFO = "FIFO", // First In First Out + LIFO = "LIFO", // Last In First Out + NearestLocation = "NEAREST_LOCATION", // En Yakın Lokasyon + EmptyLocation = "EMPTY_LOCATION", // Boş Lokasyon + SameProduct = "SAME_PRODUCT", // Aynı Ürün +} + +export enum ConditionTypeEnum { // Koşul Türleri + MaterialType = "MATERIAL_TYPE", // Malzeme Türü + MaterialGroup = "MATERIAL_GROUP", // Malzeme Grubu + Quantity = "QUANTITY", // Miktar + Weight = "WEIGHT", // Ağırlık + Volume = "VOLUME", // Hacim +} + +export enum ConditionOperatorEnum { // Koşul Operatörleri + Equals = "EQUALS", // Eşittir + NotEquals = "NOT_EQUALS", // Eşit Değildir + GreaterThan = "GREATER_THAN", // Daha Büyüktür + LessThan = "LESS_THAN", // Daha Küçüktür + Contains = "CONTAINS", // İçerir +} diff --git a/ui/src/utils/erp.tsx b/ui/src/utils/erp.tsx new file mode 100644 index 00000000..72370522 --- /dev/null +++ b/ui/src/utils/erp.tsx @@ -0,0 +1,2700 @@ +import { + FaArchive, + FaArrowCircleDown, + FaArrowDown, + FaArrowUp, + FaAward, + FaBan, + FaBolt, + FaBox, + FaBullseye, + FaCalendar, + FaCheck, + FaCheckCircle, + FaClock, + FaCog, + FaComment, + FaEdit, + FaEnvelope, + FaExclamationCircle, + FaExclamationTriangle, + FaEye, + FaFileAlt, + FaFileInvoiceDollar, + FaFlask, + FaIndustry, + FaLock, + FaMapMarkerAlt, + FaMedal, + FaPause, + FaPhone, + FaPlay, + FaPlus, + FaStar, + FaTimesCircle, + FaTrophy, + FaTruck, + FaUser, + FaUsers, + FaUserTie, + FaVideo, + FaWrench, +} from "react-icons/fa"; +import { + ApprovalStatusEnum, + MmDeliveryItem, + MaterialTypeEnum, + MovementStatusEnum, + MovementTypeEnum, + OrderStatusEnum, + QualityStatusEnum, + QuotationStatusEnum, + RequestStatusEnum, + RequisitionStatusEnum, + SerialStatusEnum, + SupplierCardTypeEnum, + SupplierTypeEnum, +} from "../types/mm"; +import { + BOMTypeEnum, + OperationCategoryEnum, + MrpProductionOrder, + ProductionOrderStatusEnum, + ProductionOrderTypeEnum, + RecommendationStatusEnum, + RequirementSourceTypeEnum, + RoutingStatusEnum, + SecurityLevelEnum, +} from "../types/mrp"; +import { FaRepeat } from "react-icons/fa6"; +import { + ApprovalLevelEnum, + DeliveryStatusEnum, + RequestTypeEnum, +} from "../types/mm"; +import { + ConditionOperatorEnum, + ConditionTypeEnum, + CountStatusEnum, + CountTypeEnum, + LocationTypeEnum, + PutawayStrategyEnum, + StockStatusEnum, + WarehouseTypeEnum, + ZoneTypeEnum, +} from "../types/wm"; +import { + BusinessPartyStatusEnum, + PaymentTerms, + PriorityEnum, + TeamRoleEnum, +} from "../types/common"; +import { + AccountTypeEnum, + BankAccountTypeEnum, + BankTransactionTypeEnum, + CashMovementTypeEnum, + FiDocumentTypeEnum, + InvoiceStatusEnum, + InvoiceTypeEnum, + PaymentMethodEnum, + PaymentStatusEnum, + RiskGroupEnum, + TransactionStatusEnum, + WaybillStatusEnum, + WaybillTypeEnum, +} from "../types/fi"; +import { + ActivityStatusEnum, + CrmActivityTypeEnum, + CustomerSegmentEnum, + LostReasonCategoryEnum, + OpportunityStageEnum, + SaleOrderItemStatusEnum, + SaleOrderStatusEnum, +} from "../types/crm"; +import { + AssessorTypeEnum, + CampaignStatusEnum, + CostCenterType, + EmployeeStatusEnum, + EmploymentTypeEnum, + JobLevelEnum, + LeaveStatusEnum, + LeaveTypeEnum, + ParticipantStatusEnum, + PayrollStatusEnum, +} from "../types/hr"; +import { + CriticalityLevelEnum, + FaultTypeEnum, + FrequencyUnitEnum, + MaintenancePlanTypeEnum, + NotificationStatusEnum, + WorkCenterStatusEnum, + WorkOrderStatusEnum, + WorkOrderTypeEnum, +} from "../types/pm"; +import { + DailyUpdateStatusEnum, + PhaseStatusEnum, + ProjectStatusEnum, + ProjectTypeEnum, + PsActivityTypeEnum, + PsDocumentTypeEnum, + RiskCategoryEnum, + RiskImpactEnum, + RiskLevelEnum, + RiskProbabilityEnum, + RiskStatusEnum, + TaskStatusEnum, + TaskTypeEnum, + WorkTypeEnum, +} from "../types/ps"; + +export const getBOMTypeColor = (type: BOMTypeEnum) => { + switch (type) { + case BOMTypeEnum.Production: + return "bg-blue-100 text-blue-800"; + case BOMTypeEnum.Engineering: + return "bg-green-100 text-green-800"; + case BOMTypeEnum.Planning: + return "bg-yellow-100 text-yellow-800"; + case BOMTypeEnum.Costing: + return "bg-purple-100 text-purple-800"; + default: + return "bg-gray-100 text-gray-800"; + } +}; + +export const getBOMTypeName = (type: BOMTypeEnum) => { + switch (type) { + case BOMTypeEnum.Production: + return "Üretim"; + case BOMTypeEnum.Engineering: + return "Mühendislik"; + case BOMTypeEnum.Planning: + return "Planlama"; + case BOMTypeEnum.Costing: + return "Maliyetleme"; + default: + return "Bilinmiyor"; + } +}; + +export const getBOMexpeText = (type: BOMTypeEnum) => { + const types = { + [BOMTypeEnum.Production]: "Üretim", + [BOMTypeEnum.Engineering]: "Mühendislik", + [BOMTypeEnum.Planning]: "Planlama", + [BOMTypeEnum.Costing]: "Maliyetlendirme", + }; + return types[type]; +}; + +export const getMovementTypeInfo = (type: MovementTypeEnum) => { + switch (type) { + case MovementTypeEnum.GoodsReceipt: + return { + label: "Mal Girişi", + icon: FaArrowUp, + color: "text-green-600 bg-green-100", + sign: "+", + }; + case MovementTypeEnum.GoodsIssue: + return { + label: "Mal Çıkışı", + icon: FaArrowDown, + color: "text-red-600 bg-red-100", + sign: "-", + }; + case MovementTypeEnum.Transfer: + return { + label: "Transfer", + icon: FaRepeat, + color: "text-blue-600 bg-blue-100", + sign: "", + }; + default: + return { + label: "Bilinmeyen", + icon: FaArchive, + color: "text-gray-600 bg-gray-100", + sign: "", + }; + } +}; + +export const getMaterialTypeDisplay = (code: MaterialTypeEnum) => { + switch (code) { + case MaterialTypeEnum.RawMaterial: + return "HAMMADDE"; + case MaterialTypeEnum.SemiFinished: + return "YARI_MAMUL"; + case MaterialTypeEnum.Finished: + return "MAMUL"; + case MaterialTypeEnum.Consumable: + return "SARF_MALZ"; + case MaterialTypeEnum.Service: + return "HIZMET"; + case MaterialTypeEnum.Spare: + return "YEDEK_PARCA"; + default: + return code; + } +}; + +export const getOperationTypeText = (type: OperationCategoryEnum) => { + const types = { + [OperationCategoryEnum.Production]: "Üretim", + [OperationCategoryEnum.Assembly]: "Montaj", + [OperationCategoryEnum.Inspection]: "Kalite Kontrolü", + [OperationCategoryEnum.Packaging]: "Paketleme", + [OperationCategoryEnum.Setup]: "Hazırlık", + [OperationCategoryEnum.Maintenance]: "Bakım", + [OperationCategoryEnum.Transport]: "Taşıma", + [OperationCategoryEnum.Quality]: "Kalite", + }; + return types[type]; +}; + +export const getOperationTypeColor = (type: OperationCategoryEnum) => { + const colors = { + [OperationCategoryEnum.Production]: "bg-blue-100 text-blue-800", + [OperationCategoryEnum.Assembly]: "bg-green-100 text-green-800", + [OperationCategoryEnum.Inspection]: "bg-purple-100 text-purple-800", + [OperationCategoryEnum.Packaging]: "bg-orange-100 text-orange-800", + [OperationCategoryEnum.Setup]: "bg-yellow-100 text-yellow-800", + [OperationCategoryEnum.Maintenance]: "bg-red-100 text-red-800", + [OperationCategoryEnum.Transport]: "bg-indigo-100 text-indigo-800", + [OperationCategoryEnum.Quality]: "bg-pink-100 text-pink-800", + }; + return colors[type]; +}; + +export const getOperationCategoryColor = (category: string) => { + const colors: { [key: string]: string } = { + Üretim: "bg-blue-100 text-blue-800", + Montaj: "bg-green-100 text-green-800", + Kalite: "bg-purple-100 text-purple-800", + Paketleme: "bg-orange-100 text-orange-800", + Bakım: "bg-red-100 text-red-800", + }; + return colors[category] || "bg-gray-100 text-gray-800"; +}; + +export const getSkillLevelText = (level: number) => { + const levels = ["Başlangıç", "Temel", "Orta", "İleri", "Uzman"]; + return levels[level - 1] || "Belirsiz"; +}; + +export const getWarehouseTypeText = (type: WarehouseTypeEnum) => { + const types = { + [WarehouseTypeEnum.RawMaterials]: "Hammadde", + [WarehouseTypeEnum.FinishedGoods]: "Mamul", + [WarehouseTypeEnum.WorkInProgress]: "Ara Ürün", + [WarehouseTypeEnum.Quarantine]: "Karantina", + [WarehouseTypeEnum.Returns]: "İade", + [WarehouseTypeEnum.Transit]: "Transit", + [WarehouseTypeEnum.SpareParts]: "Parçalı", + }; + return types[type]; +}; + +export const getWarehouseTypeColor = (type: WarehouseTypeEnum) => { + const colors = { + [WarehouseTypeEnum.RawMaterials]: "bg-blue-100 text-blue-800", + [WarehouseTypeEnum.FinishedGoods]: "bg-green-100 text-green-800", + [WarehouseTypeEnum.WorkInProgress]: "bg-yellow-100 text-yellow-800", + [WarehouseTypeEnum.SpareParts]: "bg-purple-100 text-purple-800", + [WarehouseTypeEnum.Quarantine]: "bg-red-100 text-red-800", + [WarehouseTypeEnum.Returns]: "bg-pink-100 text-pink-800", + [WarehouseTypeEnum.Transit]: "bg-indigo-100 text-indigo-800", + }; + return colors[type]; +}; + +export const getSecurityLevelText = (level: SecurityLevelEnum) => { + const levels = { + [SecurityLevelEnum.Low]: "Düşük", + [SecurityLevelEnum.Medium]: "Orta", + [SecurityLevelEnum.High]: "Yüksek", + [SecurityLevelEnum.Restricted]: "Kısıtlı", + }; + return levels[level]; +}; + +export const getSecurityLevelColor = (level: SecurityLevelEnum) => { + const colors = { + [SecurityLevelEnum.Low]: "text-green-600", + [SecurityLevelEnum.Medium]: "text-yellow-600", + [SecurityLevelEnum.High]: "text-orange-600", + [SecurityLevelEnum.Restricted]: "text-red-600", + }; + return colors[level]; +}; + +export const getRoutingStatusText = (status: RoutingStatusEnum) => { + const statuses = { + [RoutingStatusEnum.Draft]: "Taslak", + [RoutingStatusEnum.Active]: "Aktif", + [RoutingStatusEnum.Inactive]: "Pasif", + [RoutingStatusEnum.Obsolete]: "Eski Sürüm", + }; + return statuses[status]; +}; + +export const getRoutingStatusColor = (status: RoutingStatusEnum) => { + const colors = { + [RoutingStatusEnum.Draft]: "bg-yellow-100 text-yellow-800", + [RoutingStatusEnum.Active]: "bg-green-100 text-green-800", + [RoutingStatusEnum.Inactive]: "bg-gray-100 text-gray-800", + [RoutingStatusEnum.Obsolete]: "bg-red-100 text-red-800", + }; + return colors[status]; +}; + +export const getRequestTypeText = (type: RequestTypeEnum) => { + const types = { + [RequestTypeEnum.Material]: "Malzeme", + [RequestTypeEnum.Service]: "Hizmet", + [RequestTypeEnum.WorkCenter]: "İş Merkezi", + [RequestTypeEnum.Maintenance]: "Bakım", + }; + return types[type]; +}; + +export const getRequestTypeColor = (type: RequestTypeEnum) => { + const colors = { + [RequestTypeEnum.Material]: "bg-blue-100 text-blue-800", + [RequestTypeEnum.Service]: "bg-green-100 text-green-800", + [RequestTypeEnum.WorkCenter]: "bg-purple-100 text-purple-800", + [RequestTypeEnum.Maintenance]: "bg-orange-100 text-orange-800", + }; + return colors[type]; +}; + +export const getApprovalLevelText = (level: ApprovalLevelEnum) => { + const levels = { + [ApprovalLevelEnum.Supervisor]: "Süpervizör", + [ApprovalLevelEnum.Manager]: "Yönetici", + [ApprovalLevelEnum.Director]: "Direktör", + [ApprovalLevelEnum.GeneralManager]: "Genel Müdür", + [ApprovalLevelEnum.FinanceManager]: "Mali İşler Müdürü", + [ApprovalLevelEnum.TechnicalManager]: "Teknik Müdür", + }; + return levels[level]; +}; + +export const getApprovalLevelColor = (level: ApprovalLevelEnum) => { + const colors = { + [ApprovalLevelEnum.Supervisor]: "bg-gray-100 text-gray-800", + [ApprovalLevelEnum.Manager]: "bg-blue-100 text-blue-800", + [ApprovalLevelEnum.Director]: "bg-purple-100 text-purple-800", + [ApprovalLevelEnum.GeneralManager]: "bg-red-100 text-red-800", + [ApprovalLevelEnum.FinanceManager]: "bg-green-100 text-green-800", + [ApprovalLevelEnum.TechnicalManager]: "bg-orange-100 text-orange-800", + }; + return colors[level]; +}; + +export const getDeliveryStatusText = (status: DeliveryStatusEnum) => { + const statuses = { + [DeliveryStatusEnum.Preparing]: "Hazırlanıyor", + [DeliveryStatusEnum.Shipped]: "Kargoya Verildi", + [DeliveryStatusEnum.InTransit]: "Yolda", + [DeliveryStatusEnum.OutForDelivery]: "Dağıtımda", + [DeliveryStatusEnum.Delivered]: "Teslim Edildi", + [DeliveryStatusEnum.PartiallyDelivered]: "Kısmi Teslim", + [DeliveryStatusEnum.Delayed]: "Gecikmeli", + [DeliveryStatusEnum.Returned]: "İade Edildi", + [DeliveryStatusEnum.Cancelled]: "İptal Edildi", + }; + return statuses[status]; +}; + +export const getPriorityText = (priority: PriorityEnum) => { + const priorities = { + [PriorityEnum.Low]: "Düşük", + [PriorityEnum.Normal]: "Normal", + [PriorityEnum.High]: "Yüksek", + [PriorityEnum.Urgent]: "Acil", + }; + return priorities[priority]; +}; + +export const getPriorityColor = (priority: PriorityEnum) => { + const colors = { + [PriorityEnum.Low]: "bg-emerald-50 text-emerald-700 border-emerald-200", + [PriorityEnum.Normal]: "bg-blue-50 text-blue-700 border-blue-200", + [PriorityEnum.High]: "bg-orange-50 text-orange-700 border-orange-200", + [PriorityEnum.Urgent]: "bg-red-50 text-red-700 border-red-200", + }; + return colors[priority]; +}; + +export const getWaybillStatusColor = (status: WaybillStatusEnum) => { + switch (status) { + case WaybillStatusEnum.Draft: + return "bg-gray-100 text-gray-800"; + case WaybillStatusEnum.Confirmed: + return "bg-blue-100 text-blue-800"; + case WaybillStatusEnum.Delivered: + return "bg-green-100 text-green-800"; + case WaybillStatusEnum.Cancelled: + return "bg-red-100 text-red-800"; + default: + return "bg-gray-100 text-gray-800"; + } +}; + +export const getWaybillStatusText = (status: WaybillStatusEnum) => { + switch (status) { + case WaybillStatusEnum.Draft: + return "Taslak"; + case WaybillStatusEnum.Confirmed: + return "Onaylandı"; + case WaybillStatusEnum.Delivered: + return "Teslim Edildi"; + case WaybillStatusEnum.Cancelled: + return "İptal"; + default: + return "Bilinmiyor"; + } +}; + +export const getWaybillTypeText = (type: WaybillTypeEnum) => { + switch (type) { + case WaybillTypeEnum.Outgoing: + return "Çıkış İrsaliyesi"; + case WaybillTypeEnum.Incoming: + return "Giriş İrsaliyesi"; + case WaybillTypeEnum.Transfer: + return "Transfer İrsaliyesi"; + case WaybillTypeEnum.Return: + return "İade İrsaliyesi"; + default: + return "Bilinmiyor"; + } +}; + +export const getBusinessPartyStatusColor = ( + status: BusinessPartyStatusEnum +) => { + switch (status) { + case BusinessPartyStatusEnum.Prospect: + return "bg-blue-100 text-blue-800 border-blue-200"; + case BusinessPartyStatusEnum.Active: + return "bg-green-100 text-green-800 border-green-200"; + case BusinessPartyStatusEnum.Inactive: + return "bg-gray-100 text-gray-800 border-gray-200"; + case BusinessPartyStatusEnum.Blocked: + return "bg-red-100 text-red-800 border-red-200"; + default: + return "bg-gray-100 text-gray-800 border-gray-200"; + } +}; + +export const getBusinessPartyStatusName = (status: BusinessPartyStatusEnum) => { + switch (status) { + case BusinessPartyStatusEnum.Prospect: + return "Potansiyel"; + case BusinessPartyStatusEnum.Active: + return "Aktif"; + case BusinessPartyStatusEnum.Inactive: + return "Pasif"; + case BusinessPartyStatusEnum.Blocked: + return "Blokeli"; + default: + return "Bilinmiyor"; + } +}; + +export const getCustomerSegmentColor = (segment: CustomerSegmentEnum) => { + switch (segment) { + case CustomerSegmentEnum.Enterprise: + return "text-purple-600"; + case CustomerSegmentEnum.SMB: + return "text-blue-600"; + case CustomerSegmentEnum.Startup: + return "text-green-600"; + case CustomerSegmentEnum.Government: + return "text-orange-600"; + default: + return "text-gray-600"; + } +}; + +export const getCustomerSegmentName = (segment: CustomerSegmentEnum) => { + switch (segment) { + case CustomerSegmentEnum.Enterprise: + return "Kurumsal"; + case CustomerSegmentEnum.SMB: + return "KOBİ"; + case CustomerSegmentEnum.Startup: + return "Girişim"; + case CustomerSegmentEnum.Government: + return "Kamu"; + default: + return "Diğer"; + } +}; + +export const getLostReasonCategoryText = (category: LostReasonCategoryEnum) => { + const categoryLabels = { + [LostReasonCategoryEnum.Price]: "Fiyat", + [LostReasonCategoryEnum.Product]: "Ürün", + [LostReasonCategoryEnum.Service]: "Hizmet", + [LostReasonCategoryEnum.Competitor]: "Rekabet", + [LostReasonCategoryEnum.Timing]: "Zamanlama", + [LostReasonCategoryEnum.Budget]: "Bütçe", + }; + return categoryLabels[category]; +}; + +export const getLostReasonCategoryColor = ( + category: LostReasonCategoryEnum +) => { + const categoryColors = { + [LostReasonCategoryEnum.Price]: "bg-red-100 text-red-800", + [LostReasonCategoryEnum.Product]: "bg-blue-100 text-blue-800", + [LostReasonCategoryEnum.Service]: "bg-green-100 text-green-800", + [LostReasonCategoryEnum.Competitor]: "bg-purple-100 text-purple-800", + [LostReasonCategoryEnum.Timing]: "bg-yellow-100 text-yellow-800", + [LostReasonCategoryEnum.Budget]: "bg-orange-100 text-orange-800", + }; + return categoryColors[category]; +}; + +export const getActivityTypeText = (type: CrmActivityTypeEnum) => { + const typeLabels = { + [CrmActivityTypeEnum.Call]: "Telefon Görüşmesi", + [CrmActivityTypeEnum.Email]: "E-posta", + [CrmActivityTypeEnum.Meeting]: "Toplantı", + [CrmActivityTypeEnum.Task]: "Görev", + [CrmActivityTypeEnum.Note]: "Not", + [CrmActivityTypeEnum.Demo]: "Demo", + [CrmActivityTypeEnum.Proposal]: "Teklif", + }; + return typeLabels[type]; +}; + +export const getActivityTypeIcon = (type: CrmActivityTypeEnum) => { + const typeIcons = { + [CrmActivityTypeEnum.Call]: FaPhone, + [CrmActivityTypeEnum.Email]: FaEnvelope, + [CrmActivityTypeEnum.Meeting]: FaUsers, + [CrmActivityTypeEnum.Task]: FaClock, + [CrmActivityTypeEnum.Note]: FaEdit, + [CrmActivityTypeEnum.Demo]: FaUsers, + [CrmActivityTypeEnum.Proposal]: FaFileAlt, + }; + return typeIcons[type]; +}; + +export const getActivityStatusText = (status: ActivityStatusEnum) => { + const statusLabels = { + [ActivityStatusEnum.Planned]: "Planlandı", + [ActivityStatusEnum.InProgress]: "Devam Ediyor", + [ActivityStatusEnum.Completed]: "Tamamlandı", + [ActivityStatusEnum.Cancelled]: "İptal Edildi", + }; + return statusLabels[status]; +}; + +export const getActivityStatusColor = (status: ActivityStatusEnum) => { + const statusColors = { + [ActivityStatusEnum.Planned]: "bg-blue-100 text-blue-800 border-blue-200", + [ActivityStatusEnum.InProgress]: + "bg-yellow-100 text-yellow-800 border-yellow-200", + [ActivityStatusEnum.Completed]: + "bg-green-100 text-green-800 border-green-200", + [ActivityStatusEnum.Cancelled]: "bg-red-100 text-red-800 border-red-200", + }; + return statusColors[status]; +}; + +export const getOpportunityStageText = (stage: OpportunityStageEnum) => { + const stageLabels = { + [OpportunityStageEnum.Qualification]: "Nitelendirme", + [OpportunityStageEnum.NeedsAnalysis]: "İhtiyaç Analizi", + [OpportunityStageEnum.Proposal]: "Teklif", + [OpportunityStageEnum.Negotiation]: "Müzakere", + [OpportunityStageEnum.ClosedWon]: "Kazanıldı", + [OpportunityStageEnum.ClosedLost]: "Kaybedildi", + }; + return stageLabels[stage]; +}; + +export const getOpportunityStageColor = (stage: OpportunityStageEnum) => { + const stageColors = { + [OpportunityStageEnum.Qualification]: + "bg-gray-100 text-gray-800 border-gray-200", + [OpportunityStageEnum.NeedsAnalysis]: + "bg-blue-100 text-blue-800 border-blue-200", + [OpportunityStageEnum.Proposal]: + "bg-yellow-100 text-yellow-800 border-yellow-200", + [OpportunityStageEnum.Negotiation]: + "bg-orange-100 text-orange-800 border-orange-200", + [OpportunityStageEnum.ClosedWon]: + "bg-green-100 text-green-800 border-green-200", + [OpportunityStageEnum.ClosedLost]: "bg-red-100 text-red-800 border-red-200", + }; + return stageColors[stage]; +}; + +export const getOpportunityProbabilityColor = (probability: number) => { + if (probability >= 80) return "text-green-600"; + if (probability >= 60) return "text-yellow-600"; + if (probability >= 40) return "text-orange-600"; + return "text-red-600"; +}; + +export const getOpportunityLeadSourceText = (source: string) => { + const sourceLabels: Record = { + WEBSITE: "Web Sitesi", + REFERRAL: "Referans", + CAMPAIGN: "Kampanya", + TRADE_SHOW: "Fuar", + COLD_CALL: "Soğuk Arama", + SOCIAL_MEDIA: "Sosyal Medya", + PARTNER: "Partner", + }; + return sourceLabels[source] || source; +}; + +export const getSaleOrderStatusText = (status: SaleOrderStatusEnum) => { + const statusLabels = { + [SaleOrderStatusEnum.Draft]: "Taslak", + [SaleOrderStatusEnum.Confirmed]: "Onaylandı", + [SaleOrderStatusEnum.InProduction]: "Üretimde", + [SaleOrderStatusEnum.Ready]: "Hazır", + [SaleOrderStatusEnum.Shipped]: "Kargoda", + [SaleOrderStatusEnum.Delivered]: "Teslim Edildi", + [SaleOrderStatusEnum.Cancelled]: "İptal Edildi", + }; + return statusLabels[status]; +}; + +export const getSaleOrderStatusColor = (status: SaleOrderStatusEnum) => { + const statusColors = { + [SaleOrderStatusEnum.Draft]: "bg-gray-100 text-gray-800", + [SaleOrderStatusEnum.Confirmed]: "bg-blue-100 text-blue-800", + [SaleOrderStatusEnum.InProduction]: "bg-yellow-100 text-yellow-800", + [SaleOrderStatusEnum.Ready]: "bg-orange-100 text-orange-800", + [SaleOrderStatusEnum.Shipped]: "bg-purple-100 text-purple-800", + [SaleOrderStatusEnum.Delivered]: "bg-green-100 text-green-800", + [SaleOrderStatusEnum.Cancelled]: "bg-red-100 text-red-800", + }; + return statusColors[status]; +}; + +export const getSaleOrderItemStatusnfo = (status: SaleOrderItemStatusEnum) => { + const statusInfo = { + [SaleOrderItemStatusEnum.Pending]: { + label: "Beklemede", + color: "bg-gray-100 text-gray-800", + icon: FaClock, + iconColor: "text-gray-500", + }, + [SaleOrderItemStatusEnum.Confirmed]: { + label: "Onaylandı", + color: "bg-blue-100 text-blue-800", + icon: FaCheckCircle, + iconColor: "text-blue-500", + }, + [SaleOrderItemStatusEnum.InProduction]: { + label: "Üretimde", + color: "bg-yellow-100 text-yellow-800", + icon: FaClock, + iconColor: "text-yellow-500", + }, + [SaleOrderItemStatusEnum.Ready]: { + label: "Hazır", + color: "bg-orange-100 text-orange-800", + icon: FaCheckCircle, + iconColor: "text-orange-500", + }, + [SaleOrderItemStatusEnum.Shipped]: { + label: "Kargoda", + color: "bg-purple-100 text-purple-800", + icon: FaTruck, + iconColor: "text-purple-500", + }, + [SaleOrderItemStatusEnum.Delivered]: { + label: "Teslim Edildi", + color: "bg-green-100 text-green-800", + icon: FaCheckCircle, + iconColor: "text-green-500", + }, + }; + return statusInfo[status]; +}; + +export const getBankAccountTypeText = (type: BankAccountTypeEnum) => { + const typeLabels = { + [BankAccountTypeEnum.Current]: "Vadesiz", + [BankAccountTypeEnum.Deposit]: "Vadeli", + [BankAccountTypeEnum.Credit]: "Kredi", + [BankAccountTypeEnum.Foreign]: "Döviz", + }; + return typeLabels[type]; +}; + +export const getBankAccountTypeColor = (type: BankAccountTypeEnum) => { + const typeColors = { + [BankAccountTypeEnum.Current]: "bg-blue-100 text-blue-800", + [BankAccountTypeEnum.Deposit]: "bg-green-100 text-green-800", + [BankAccountTypeEnum.Credit]: "bg-orange-100 text-orange-800", + [BankAccountTypeEnum.Foreign]: "bg-purple-100 text-purple-800", + }; + return typeColors[type]; +}; + +export const getTransactionTypeText = (type: BankTransactionTypeEnum) => { + const typeLabels = { + [BankTransactionTypeEnum.Deposit]: "Para Yatırma", + [BankTransactionTypeEnum.Withdrawal]: "Para Çekme", + [BankTransactionTypeEnum.Transfer]: "Transfer", + [BankTransactionTypeEnum.EFT]: "EFT/Havale", + [BankTransactionTypeEnum.Fee]: "Komisyon", + [BankTransactionTypeEnum.Interest]: "Faiz", + }; + return typeLabels[type]; +}; + +export const getTransactionStatusText = (status: TransactionStatusEnum) => { + const statusLabels = { + [TransactionStatusEnum.Pending]: "Bekliyor", + [TransactionStatusEnum.Completed]: "Tamamlandı", + [TransactionStatusEnum.Failed]: "Başarısız", + [TransactionStatusEnum.Cancelled]: "İptal", + }; + return statusLabels[status]; +}; + +export const getTransactionTypeColor = (type: BankTransactionTypeEnum) => { + const typeColors = { + [BankTransactionTypeEnum.Deposit]: "bg-green-100 text-green-800", + [BankTransactionTypeEnum.Withdrawal]: "bg-red-100 text-red-800", + [BankTransactionTypeEnum.Transfer]: "bg-blue-100 text-blue-800", + [BankTransactionTypeEnum.EFT]: "bg-purple-100 text-purple-800", + [BankTransactionTypeEnum.Fee]: "bg-orange-100 text-orange-800", + [BankTransactionTypeEnum.Interest]: "bg-yellow-100 text-yellow-800", + }; + return typeColors[type]; +}; + +export const getTransactionStatusColor = (status: TransactionStatusEnum) => { + const statusColors = { + [TransactionStatusEnum.Pending]: "bg-yellow-100 text-yellow-800", + [TransactionStatusEnum.Completed]: "bg-green-100 text-green-800", + [TransactionStatusEnum.Failed]: "bg-red-100 text-red-800", + [TransactionStatusEnum.Cancelled]: "bg-gray-100 text-gray-800", + }; + return statusColors[status]; +}; + +export const getFiDocumentTypeText = (type?: FiDocumentTypeEnum) => { + if (!type) return ""; + const typeLabels = { + [FiDocumentTypeEnum.Invoice]: "Fatura", + [FiDocumentTypeEnum.Waybill]: "İrsaliye", + [FiDocumentTypeEnum.Receipt]: "Makbuz", + [FiDocumentTypeEnum.Payment]: "Ödeme", + [FiDocumentTypeEnum.BankTransfer]: "Banka Havalesi", + [FiDocumentTypeEnum.CashMovement]: "Kasa Hareketi", + [FiDocumentTypeEnum.Check]: "Çek", + [FiDocumentTypeEnum.PromissoryNote]: "Senet", + [FiDocumentTypeEnum.Other]: "Diğer", + }; + return typeLabels[type]; +}; + +export const getFiDocumentTypeColor = (type: FiDocumentTypeEnum) => { + const typeColors = { + [FiDocumentTypeEnum.Invoice]: "bg-blue-100 text-blue-800", + [FiDocumentTypeEnum.Payment]: "bg-green-100 text-green-800", + [FiDocumentTypeEnum.Receipt]: "bg-purple-100 text-purple-800", + [FiDocumentTypeEnum.Check]: "bg-yellow-100 text-yellow-800", + [FiDocumentTypeEnum.BankTransfer]: "bg-indigo-100 text-indigo-800", + [FiDocumentTypeEnum.CashMovement]: "bg-orange-100 text-orange-800", + [FiDocumentTypeEnum.Waybill]: "bg-gray-100 text-gray-800", + [FiDocumentTypeEnum.PromissoryNote]: "bg-red-100 text-red-800", + [FiDocumentTypeEnum.Other]: "bg-gray-100 text-gray-800", + }; + return typeColors[type]; +}; + +export const getCashMovementTypeText = (type: CashMovementTypeEnum) => { + return type === CashMovementTypeEnum.Income ? "Giriş" : "Çıkış"; +}; + +export const getCashMovementTypeColor = (type: CashMovementTypeEnum) => { + return type === CashMovementTypeEnum.Income + ? "bg-green-100 text-green-800" + : "bg-red-100 text-red-800"; +}; + +export const getAccountTypeText = (type: AccountTypeEnum) => { + const typeLabels = { + [AccountTypeEnum.Customer]: "Müşteri", + [AccountTypeEnum.Supplier]: "Tedarikçi", + [AccountTypeEnum.Both]: "Müşteri/Tedarikçi", + [AccountTypeEnum.Other]: "Diğer", + }; + return typeLabels[type]; +}; + +export const getAccountTypeColor = (type: AccountTypeEnum) => { + const typeColors = { + [AccountTypeEnum.Customer]: "bg-blue-100 text-blue-800", + [AccountTypeEnum.Supplier]: "bg-green-100 text-green-800", + [AccountTypeEnum.Both]: "bg-purple-100 text-purple-800", + [AccountTypeEnum.Other]: "bg-gray-100 text-gray-800", + }; + return typeColors[type]; +}; + +export const getRiskGroupText = (riskGroup: RiskGroupEnum) => { + const riskLabels = { + [RiskGroupEnum.Low]: "Düşük Risk", + [RiskGroupEnum.Medium]: "Orta Risk", + [RiskGroupEnum.High]: "Yüksek Risk", + [RiskGroupEnum.Blocked]: "Blokeli", + }; + return riskLabels[riskGroup]; +}; + +export const getRiskGroupColor = (riskGroup: RiskGroupEnum) => { + const riskColors = { + [RiskGroupEnum.Low]: "bg-green-100 text-green-800", + [RiskGroupEnum.Medium]: "bg-yellow-100 text-yellow-800", + [RiskGroupEnum.High]: "bg-orange-100 text-orange-800", + [RiskGroupEnum.Blocked]: "bg-red-100 text-red-800", + }; + return riskColors[riskGroup]; +}; + +export const getInvoiceTypeText = (type: InvoiceTypeEnum) => { + const typeLabels = { + [InvoiceTypeEnum.Sales]: "Satış", + [InvoiceTypeEnum.Purchase]: "Alış", + [InvoiceTypeEnum.Return]: "İade", + [InvoiceTypeEnum.Proforma]: "Proforma", + }; + return typeLabels[type]; +}; + +export const getInvoiceTypeColor = (type: InvoiceTypeEnum) => { + const typeColors = { + [InvoiceTypeEnum.Sales]: "bg-green-100 text-green-800", + [InvoiceTypeEnum.Purchase]: "bg-blue-100 text-blue-800", + [InvoiceTypeEnum.Return]: "bg-orange-100 text-orange-800", + [InvoiceTypeEnum.Proforma]: "bg-purple-100 text-purple-800", + }; + return typeColors[type]; +}; + +export const getInvoiceStatusText = (status: InvoiceStatusEnum) => { + const statusLabels = { + [InvoiceStatusEnum.Draft]: "Taslak", + [InvoiceStatusEnum.Sent]: "Gönderildi", + [InvoiceStatusEnum.Approved]: "Onaylandı", + [InvoiceStatusEnum.Cancelled]: "İptal", + }; + return statusLabels[status]; +}; + +export const getInvoiceStatusColor = (status: InvoiceStatusEnum) => { + const statusColors = { + [InvoiceStatusEnum.Draft]: "bg-gray-100 text-gray-800", + [InvoiceStatusEnum.Sent]: "bg-blue-100 text-blue-800", + [InvoiceStatusEnum.Approved]: "bg-green-100 text-green-800", + [InvoiceStatusEnum.Cancelled]: "bg-red-100 text-red-800", + }; + return statusColors[status]; +}; + +export const getPaymentStatusText = (status: PaymentStatusEnum) => { + const statusLabels = { + [PaymentStatusEnum.Unpaid]: "Ödenmemiş", + [PaymentStatusEnum.PartiallyPaid]: "Kısmi Ödeme", + [PaymentStatusEnum.Paid]: "Ödenmiş", + [PaymentStatusEnum.Overdue]: "Vadesi Geçmiş", + }; + return statusLabels[status]; +}; + +export const getPaymentStatusColor = (status: PaymentStatusEnum) => { + const statusColors = { + [PaymentStatusEnum.Unpaid]: "bg-yellow-100 text-yellow-800", + [PaymentStatusEnum.PartiallyPaid]: "bg-orange-100 text-orange-800", + [PaymentStatusEnum.Paid]: "bg-green-100 text-green-800", + [PaymentStatusEnum.Overdue]: "bg-red-100 text-red-800", + }; + return statusColors[status]; +}; + +export const getPaymentMethodText = (method: PaymentMethodEnum) => { + const labels = { + [PaymentMethodEnum.Cash]: "Nakit", + [PaymentMethodEnum.BankTransfer]: "Banka Havalesi", + [PaymentMethodEnum.CreditCard]: "Kredi Kartı", + [PaymentMethodEnum.Check]: "Çek", + [PaymentMethodEnum.PromissoryNote]: "Senet", + }; + return labels[method]; +}; + +export const getWaybillTypeColor = (type: WaybillTypeEnum) => { + const typeColors = { + [WaybillTypeEnum.Outgoing]: "bg-green-100 text-green-800", + [WaybillTypeEnum.Incoming]: "bg-blue-100 text-blue-800", + [WaybillTypeEnum.Transfer]: "bg-purple-100 text-purple-800", + [WaybillTypeEnum.Return]: "bg-orange-100 text-orange-800", + }; + return typeColors[type]; +}; + +export const iconOptions = [ + { value: "⭐", label: "Yıldız" }, + { value: "🏆", label: "Kupa" }, + { value: "🥇", label: "Altın Madalya" }, + { value: "🥈", label: "Gümüş Madalya" }, + { value: "🥉", label: "Bronz Madalya" }, + { value: "👑", label: "Taç" }, + { value: "💎", label: "Elmas" }, + { value: "💡", label: "Ampul" }, + { value: "🔥", label: "Ateş" }, + { value: "⚡", label: "Şimşek" }, + { value: "🎯", label: "Hedef" }, + { value: "📈", label: "Grafik" }, + { value: "🚀", label: "Roket" }, + { value: "💪", label: "Güç" }, + { value: "❤️", label: "Kalp" }, +]; + +export const getIconComponent = (iconName: string) => { + switch (iconName) { + case "star": + return FaStar; + case "trophy": + return FaTrophy; + case "medal": + return FaMedal; + case "award": + default: + return FaAward; + } +}; + +export const getCostCenterTypeText = (type: CostCenterType): string => { + const typeMap = { + [CostCenterType.Revenue]: "Gelir", + [CostCenterType.Standard]: "Standart", + [CostCenterType.Discretionary]: "İsteğe Bağlı", + [CostCenterType.Investment]: "Yatırım", + [CostCenterType.Service]: "Hizmet", + [CostCenterType.Production]: "Üretim", + [CostCenterType.Support]: "Destek", + [CostCenterType.Administrative]: "İdari", + }; + return typeMap[type] || type; +}; + +export const getCostCenterTypeColor = (type: CostCenterType): string => { + const colorMap = { + [CostCenterType.Revenue]: "bg-green-100 text-green-800", + [CostCenterType.Standard]: "bg-blue-100 text-blue-800", + [CostCenterType.Discretionary]: "bg-purple-100 text-purple-800", + [CostCenterType.Investment]: "bg-orange-100 text-orange-800", + [CostCenterType.Service]: "bg-indigo-100 text-indigo-800", + [CostCenterType.Production]: "bg-red-100 text-red-800", + [CostCenterType.Support]: "bg-yellow-100 text-yellow-800", + [CostCenterType.Administrative]: "bg-gray-100 text-gray-800", + }; + return colorMap[type] || "bg-gray-100 text-gray-800"; +}; + +export const getCampaignStatusColor = (status: CampaignStatusEnum) => { + switch (status) { + case CampaignStatusEnum.Draft: + return "bg-gray-100 text-gray-800"; + case CampaignStatusEnum.Active: + return "bg-green-100 text-green-800"; + case CampaignStatusEnum.Completed: + return "bg-blue-100 text-blue-800"; + default: + return "bg-gray-100 text-gray-800"; + } +}; + +export const getCampaignStatusText = (status: CampaignStatusEnum) => { + switch (status) { + case CampaignStatusEnum.Draft: + return "Taslak"; + case CampaignStatusEnum.Active: + return "Aktif"; + case CampaignStatusEnum.Completed: + return "Tamamlandı"; + default: + return "Bilinmiyor"; + } +}; + +export const getAssessorTypeText = (type: AssessorTypeEnum) => { + switch (type) { + case AssessorTypeEnum.Self: + return "Kendi"; + case AssessorTypeEnum.Manager: + return "Yönetici"; + case AssessorTypeEnum.Peer: + return "Meslektaş"; + case AssessorTypeEnum.Subordinate: + return "Ast"; + case AssessorTypeEnum.Customer: + return "Müşteri"; + case AssessorTypeEnum.OtherDepartment: + return "Diğer Departman"; + case AssessorTypeEnum.HRUpperManagement: + return "İK/Üst Yönetim"; + case AssessorTypeEnum.External: + return "Dış Paydaş"; + default: + return "Bilinmiyor"; + } +}; + +export const getAssessorTypeDescription = (type: AssessorTypeEnum) => { + switch (type) { + case AssessorTypeEnum.Self: + return "Sadece kendisi"; + case AssessorTypeEnum.Manager: + return "Sadece çalıştığı departmanın müdürü"; + case AssessorTypeEnum.Peer: + return "Sadece aynı departmanda çalıştığı eşit düzeydeki çalışanlar"; + case AssessorTypeEnum.Subordinate: + return "Aynı departmanda ama düzeyi değerlendirilen kişinin altında olan"; + case AssessorTypeEnum.Customer: + return "Sistemde kayıtlı müşterilerden seçilecek"; + case AssessorTypeEnum.External: + return "Sistemde kayıtlı olmayan harici değerlendirici"; + case AssessorTypeEnum.HRUpperManagement: + return "Sadece İK departmanında bir kişi seçilmeli"; + case AssessorTypeEnum.OtherDepartment: + return "Değerlendirilen kişinin çalıştığı departman dışında kalan tüm departman çalışanları"; + default: + return ""; + } +}; + +export const getParticipantStatusColor = (status: ParticipantStatusEnum) => { + switch (status) { + case ParticipantStatusEnum.Invited: + return "bg-yellow-100 text-yellow-800"; + case ParticipantStatusEnum.Started: + return "bg-blue-100 text-blue-800"; + case ParticipantStatusEnum.Completed: + return "bg-green-100 text-green-800"; + default: + return "bg-gray-100 text-gray-800"; + } +}; + +export const getParticipantStatusText = (status: ParticipantStatusEnum) => { + switch (status) { + case ParticipantStatusEnum.Invited: + return "Davet Edildi"; + case ParticipantStatusEnum.Started: + return "Başladı"; + case ParticipantStatusEnum.Completed: + return "Tamamlandı"; + default: + return "Bilinmiyor"; + } +}; + +export const getEmployeeStatusColor = (status: EmployeeStatusEnum) => { + switch (status) { + case EmployeeStatusEnum.Active: + return "bg-green-100 text-green-800"; + case EmployeeStatusEnum.Inactive: + return "bg-gray-100 text-gray-800"; + case EmployeeStatusEnum.OnLeave: + return "bg-yellow-100 text-yellow-800"; + case EmployeeStatusEnum.Suspended: + return "bg-red-100 text-red-800"; + case EmployeeStatusEnum.Terminated: + return "bg-red-100 text-red-800"; + default: + return "bg-gray-100 text-gray-800"; + } +}; + +export const getEmployeeStatusText = (status: EmployeeStatusEnum) => { + switch (status) { + case EmployeeStatusEnum.Active: + return "Aktif"; + case EmployeeStatusEnum.Inactive: + return "Pasif"; + case EmployeeStatusEnum.OnLeave: + return "İzinli"; + case EmployeeStatusEnum.Suspended: + return "Askıda"; + case EmployeeStatusEnum.Terminated: + return "İşten Çıkarılmış"; + default: + return "Bilinmiyor"; + } +}; + +export const getEmployeeStatusIcon = (status: EmployeeStatusEnum) => { + switch (status) { + case EmployeeStatusEnum.Active: + return ; + case EmployeeStatusEnum.Inactive: + return ; + case EmployeeStatusEnum.OnLeave: + return ; + case EmployeeStatusEnum.Suspended: + return ; + case EmployeeStatusEnum.Terminated: + return ; + default: + return ; + } +}; + +export const getEmploymentTypeColor = (type: EmploymentTypeEnum) => { + switch (type) { + case EmploymentTypeEnum.FullTime: + return "text-green-600"; + case EmploymentTypeEnum.PartTime: + return "text-blue-600"; + case EmploymentTypeEnum.Contract: + return "text-orange-600"; + case EmploymentTypeEnum.Temporary: + return "text-yellow-600"; + case EmploymentTypeEnum.Intern: + return "text-purple-600"; + case EmploymentTypeEnum.Consultant: + return "text-red-600"; + default: + return "text-gray-600"; + } +}; + +export const getEmploymentTypeText = (type: EmploymentTypeEnum) => { + switch (type) { + case EmploymentTypeEnum.FullTime: + return "Tam Zamanlı"; + case EmploymentTypeEnum.PartTime: + return "Yarı Zamanlı"; + case EmploymentTypeEnum.Contract: + return "Sözleşmeli"; + case EmploymentTypeEnum.Temporary: + return "Geçici"; + case EmploymentTypeEnum.Intern: + return "Stajyer"; + case EmploymentTypeEnum.Consultant: + return "Danışman"; + default: + return "Belirtilmemiş"; + } +}; + +export const getJobLevelText = (level: JobLevelEnum) => { + switch (level) { + case JobLevelEnum.Entry: + return "Giriş Seviyesi"; + case JobLevelEnum.Junior: + return "Junior"; + case JobLevelEnum.Mid: + return "Orta Seviye"; + case JobLevelEnum.Senior: + return "Senior"; + case JobLevelEnum.Lead: + return "Lider"; + case JobLevelEnum.Manager: + return "Yönetici"; + case JobLevelEnum.Director: + return "Direktör"; + case JobLevelEnum.Executive: + return "Üst Düzey Yönetici"; + default: + return "Belirlenmemiş"; + } +}; + +export const getJobLevelColor = (level: JobLevelEnum) => { + switch (level) { + case JobLevelEnum.Entry: + return "bg-gray-100 text-gray-800"; + case JobLevelEnum.Junior: + return "bg-blue-100 text-blue-800"; + case JobLevelEnum.Mid: + return "bg-green-100 text-green-800"; + case JobLevelEnum.Senior: + return "bg-purple-100 text-purple-800"; + case JobLevelEnum.Lead: + return "bg-orange-100 text-orange-800"; + case JobLevelEnum.Manager: + return "bg-red-100 text-red-800"; + case JobLevelEnum.Director: + return "bg-indigo-100 text-indigo-800"; + case JobLevelEnum.Executive: + return "bg-pink-100 text-pink-800"; + default: + return "bg-gray-100 text-gray-800"; + } +}; + +export const getLeaveStatusColor = (status: LeaveStatusEnum) => { + switch (status) { + case LeaveStatusEnum.Pending: + return "bg-yellow-100 text-yellow-800"; + case LeaveStatusEnum.Approved: + return "bg-green-100 text-green-800"; + case LeaveStatusEnum.Rejected: + return "bg-red-100 text-red-800"; + case LeaveStatusEnum.Cancelled: + return "bg-gray-100 text-gray-800"; + default: + return "bg-gray-100 text-gray-800"; + } +}; + +export const getLeaveStatusText = (status: LeaveStatusEnum) => { + switch (status) { + case LeaveStatusEnum.Pending: + return "Beklemede"; + case LeaveStatusEnum.Approved: + return "Onaylandı"; + case LeaveStatusEnum.Rejected: + return "Reddedildi"; + case LeaveStatusEnum.Cancelled: + return "İptal Edildi"; + default: + return "Bilinmiyor"; + } +}; + +export const getLeaveTypeText = (type: LeaveTypeEnum) => { + switch (type) { + case LeaveTypeEnum.Annual: + return "Yıllık İzin"; + case LeaveTypeEnum.Sick: + return "Hastalık İzni"; + case LeaveTypeEnum.Maternity: + return "Doğum İzni"; + case LeaveTypeEnum.Paternity: + return "Babalık İzni"; + case LeaveTypeEnum.Personal: + return "Kişisel İzin"; + case LeaveTypeEnum.Emergency: + return "Acil Durum İzni"; + case LeaveTypeEnum.Study: + return "Eğitim İzni"; + case LeaveTypeEnum.Unpaid: + return "Ücretsiz İzin"; + default: + return "Diğer"; + } +}; + +export const getPayrollStatusColor = (status: PayrollStatusEnum) => { + switch (status) { + case PayrollStatusEnum.Draft: + return "bg-gray-100 text-gray-800"; + case PayrollStatusEnum.Calculated: + return "bg-blue-100 text-blue-800"; + case PayrollStatusEnum.Approved: + return "bg-green-100 text-green-800"; + case PayrollStatusEnum.Paid: + return "bg-purple-100 text-purple-800"; + case PayrollStatusEnum.Cancelled: + return "bg-red-100 text-red-800"; + default: + return "bg-gray-100 text-gray-800"; + } +}; + +export const getPayrollStatusText = (status: PayrollStatusEnum) => { + switch (status) { + case PayrollStatusEnum.Draft: + return "Taslak"; + case PayrollStatusEnum.Calculated: + return "Hesaplandı"; + case PayrollStatusEnum.Approved: + return "Onaylandı"; + case PayrollStatusEnum.Paid: + return "Ödendi"; + case PayrollStatusEnum.Cancelled: + return "İptal Edildi"; + default: + return "Bilinmiyor"; + } +}; + +export const getNotificationStatusColor = (status: NotificationStatusEnum) => { + const colors = { + [NotificationStatusEnum.Open]: "bg-gray-100 text-gray-800", + [NotificationStatusEnum.Assigned]: "bg-blue-100 text-blue-800", + [NotificationStatusEnum.InProgress]: "bg-orange-100 text-orange-800", + [NotificationStatusEnum.Resolved]: "bg-green-100 text-green-800", + [NotificationStatusEnum.Closed]: "bg-gray-100 text-gray-800", + [NotificationStatusEnum.Rejected]: "bg-red-100 text-red-800", + }; + return colors[status]; +}; + +export const getNotificationStatusIcon = (status: NotificationStatusEnum) => { + const icons = { + [NotificationStatusEnum.Open]: ( + + ), + [NotificationStatusEnum.Assigned]: , + [NotificationStatusEnum.InProgress]: , + [NotificationStatusEnum.Resolved]: , + [NotificationStatusEnum.Closed]: , + [NotificationStatusEnum.Rejected]: , + }; + return icons[status]; +}; + +export const getNotificationStatusText = (status: NotificationStatusEnum) => { + const statuses = { + [NotificationStatusEnum.Open]: "Açık", + [NotificationStatusEnum.Assigned]: "Atandı", + [NotificationStatusEnum.InProgress]: "Devam Ediyor", + [NotificationStatusEnum.Resolved]: "Çözüldü", + [NotificationStatusEnum.Closed]: "Kapatıldı", + [NotificationStatusEnum.Rejected]: "Reddedildi", + }; + return statuses[status]; +}; + +export const getWorkOrderStatusText = (status: WorkOrderStatusEnum) => { + const statuses = { + [WorkOrderStatusEnum.Created]: "Oluşturuldu", + [WorkOrderStatusEnum.Planned]: "Planlandı", + [WorkOrderStatusEnum.Released]: "Serbest Bırakıldı", + [WorkOrderStatusEnum.InProgress]: "Devam Ediyor", + [WorkOrderStatusEnum.OnHold]: "Beklemede", + [WorkOrderStatusEnum.Completed]: "Tamamlandı", + [WorkOrderStatusEnum.Cancelled]: "İptal Edildi", + }; + return statuses[status]; +}; + +export const getWorkOrderStatusColor = (status: WorkOrderStatusEnum) => { + const colors = { + [WorkOrderStatusEnum.Created]: "bg-gray-100 text-gray-800", + [WorkOrderStatusEnum.Planned]: "bg-blue-100 text-blue-800", + [WorkOrderStatusEnum.Released]: "bg-purple-100 text-purple-800", + [WorkOrderStatusEnum.InProgress]: "bg-orange-100 text-orange-800", + [WorkOrderStatusEnum.OnHold]: "bg-yellow-100 text-yellow-800", + [WorkOrderStatusEnum.Completed]: "bg-green-100 text-green-800", + [WorkOrderStatusEnum.Cancelled]: "bg-red-100 text-red-800", + }; + return colors[status]; +}; + +export const getWorkOrderStatusIcon = (status: WorkOrderStatusEnum) => { + const icons = { + [WorkOrderStatusEnum.Created]: null, + [WorkOrderStatusEnum.Planned]: null, + [WorkOrderStatusEnum.Released]: null, + [WorkOrderStatusEnum.InProgress]: , + [WorkOrderStatusEnum.OnHold]: , + [WorkOrderStatusEnum.Completed]: , + [WorkOrderStatusEnum.Cancelled]: , + }; + return icons[status]; +}; + +export const getFaultTypeText = (type: FaultTypeEnum) => { + const types = { + [FaultTypeEnum.Mechanical]: "Mekanik", + [FaultTypeEnum.Electrical]: "Elektrik", + [FaultTypeEnum.Hydraulic]: "Hidrolik", + [FaultTypeEnum.Pneumatic]: "Pnömatik", + [FaultTypeEnum.Software]: "Yazılım", + [FaultTypeEnum.Safety]: "Güvenlik", + [FaultTypeEnum.Performance]: "Performans", + [FaultTypeEnum.Other]: "Diğer", + }; + return types[type]; +}; + +export const getFaultTypeColor = (type: FaultTypeEnum) => { + const colors = { + [FaultTypeEnum.Mechanical]: "bg-blue-100 text-blue-800", + [FaultTypeEnum.Electrical]: "bg-yellow-100 text-yellow-800", + [FaultTypeEnum.Hydraulic]: "bg-green-100 text-green-800", + [FaultTypeEnum.Pneumatic]: "bg-purple-100 text-purple-800", + [FaultTypeEnum.Software]: "bg-indigo-100 text-indigo-800", + [FaultTypeEnum.Safety]: "bg-red-100 text-red-800", + [FaultTypeEnum.Performance]: "bg-orange-100 text-orange-800", + [FaultTypeEnum.Other]: "bg-gray-100 text-gray-800", + }; + return colors[type]; +}; + +export const getCriticalityLevelColor = (severity: CriticalityLevelEnum) => { + const colors = { + [CriticalityLevelEnum.Low]: "border-l-blue-500", + [CriticalityLevelEnum.Medium]: "border-l-yellow-500", + [CriticalityLevelEnum.High]: "border-l-orange-500", + [CriticalityLevelEnum.Critical]: "border-l-red-500", + }; + return colors[severity]; +}; + +export const getMaintenancePlanTypeText = (type: MaintenancePlanTypeEnum) => { + const types = { + [MaintenancePlanTypeEnum.Preventive]: "Önleyici", + [MaintenancePlanTypeEnum.Corrective]: "Düzeltici", + [MaintenancePlanTypeEnum.Predictive]: "Tahminsel", + [MaintenancePlanTypeEnum.Condition]: "Duruma Bağlı", + }; + return types[type]; +}; + +export const getMaintenancePlanTypeColor = (type: MaintenancePlanTypeEnum) => { + const colors = { + [MaintenancePlanTypeEnum.Preventive]: "bg-green-100 text-green-800", + [MaintenancePlanTypeEnum.Corrective]: "bg-red-100 text-red-800", + [MaintenancePlanTypeEnum.Predictive]: "bg-blue-100 text-blue-800", + [MaintenancePlanTypeEnum.Condition]: "bg-yellow-100 text-yellow-800", + }; + return colors[type]; +}; + +export const getFrequencyUnitText = ( + frequency: number, + unit: FrequencyUnitEnum +) => { + const units = { + [FrequencyUnitEnum.Days]: "Günlük", + [FrequencyUnitEnum.Weeks]: "Haftalık", + [FrequencyUnitEnum.Months]: "Aylık", + [FrequencyUnitEnum.Years]: "Yıllık", + [FrequencyUnitEnum.Hours]: "Saatlik", + [FrequencyUnitEnum.Cycles]: "Döngü", + }; + + return frequency === 1 ? units[unit] : `${frequency} ${units[unit]}`; +}; + +export const getTeamRoleText = (role: TeamRoleEnum) => { + const roles = { + [TeamRoleEnum.Member]: "Üye", + [TeamRoleEnum.Specialist]: "Uzman", + [TeamRoleEnum.Lead]: "Lider", + [TeamRoleEnum.Manager]: "Yönetici", + }; + return roles[role]; +}; + +export const getTeamRoleColor = (role: TeamRoleEnum) => { + const colors = { + [TeamRoleEnum.Member]: "bg-blue-100 text-blue-800", + [TeamRoleEnum.Specialist]: "bg-green-100 text-green-800", + [TeamRoleEnum.Lead]: "bg-purple-100 text-purple-800", + [TeamRoleEnum.Manager]: "bg-red-100 text-red-800", + }; + return colors[role]; +}; + +export const getTeamRoleIcon = (role: TeamRoleEnum) => { + const icons = { + [TeamRoleEnum.Member]: , + [TeamRoleEnum.Specialist]: , + [TeamRoleEnum.Lead]: , + [TeamRoleEnum.Manager]: , + }; + return icons[role]; +}; + +export const getWorkOrderTypeText = (type: WorkOrderTypeEnum) => { + const types = { + [WorkOrderTypeEnum.Preventive]: "Önleyici", + [WorkOrderTypeEnum.Corrective]: "Düzeltici", + [WorkOrderTypeEnum.Emergency]: "Acil", + [WorkOrderTypeEnum.Inspection]: "İnceleme", + [WorkOrderTypeEnum.Calibration]: "Kalibrasyon", + }; + return types[type]; +}; + +export const getWorkOrderTypeColor = (type: WorkOrderTypeEnum) => { + const colors = { + [WorkOrderTypeEnum.Preventive]: "bg-green-100 text-green-800", + [WorkOrderTypeEnum.Corrective]: "bg-blue-100 text-blue-800", + [WorkOrderTypeEnum.Emergency]: "bg-red-100 text-red-800", + [WorkOrderTypeEnum.Inspection]: "bg-purple-100 text-purple-800", + [WorkOrderTypeEnum.Calibration]: "bg-yellow-100 text-yellow-800", + }; + return colors[type]; +}; + +export const getWorkCenterStatusText = (status: WorkCenterStatusEnum) => { + const statuses = { + [WorkCenterStatusEnum.Operational]: "Operasyonel", + [WorkCenterStatusEnum.UnderMaintenance]: "Bakımda", + [WorkCenterStatusEnum.OutOfOrder]: "Arızalı", + [WorkCenterStatusEnum.Retired]: "Emekli", + }; + return statuses[status]; +}; + +export const getWorkCenterStatusColor = (status: WorkCenterStatusEnum) => { + const colors = { + [WorkCenterStatusEnum.Operational]: "bg-green-100 text-green-800", + [WorkCenterStatusEnum.UnderMaintenance]: "bg-yellow-100 text-yellow-800", + [WorkCenterStatusEnum.OutOfOrder]: "bg-red-100 text-red-800", + [WorkCenterStatusEnum.Retired]: "bg-gray-100 text-gray-800", + }; + return colors[status]; +}; + +export const getWorkCenterStatusIcon = (status: WorkCenterStatusEnum) => { + switch (status) { + case WorkCenterStatusEnum.Operational: + return ; + case WorkCenterStatusEnum.UnderMaintenance: + return ; + case WorkCenterStatusEnum.OutOfOrder: + return ; + case WorkCenterStatusEnum.Retired: + return ; + default: + return ; + } +}; + +export const getCriticalityLevelText = (criticality: CriticalityLevelEnum) => { + const levels = { + [CriticalityLevelEnum.Low]: "Düşük", + [CriticalityLevelEnum.Medium]: "Orta", + [CriticalityLevelEnum.High]: "Yüksek", + [CriticalityLevelEnum.Critical]: "Kritik", + }; + return levels[criticality]; +}; + +export const getRequirementSourceTypeText = ( + sourceType: RequirementSourceTypeEnum +) => { + const sourceLabels = { + [RequirementSourceTypeEnum.SalesOrder]: "Satış Siparişi", + [RequirementSourceTypeEnum.Forecast]: "Tahmin", + [RequirementSourceTypeEnum.SafetyStock]: "Güvenlik Stoku", + [RequirementSourceTypeEnum.ProductionOrder]: "Üretim Emri", + }; + return sourceLabels[sourceType]; +}; + +export const getRequirementSourceTypeColor = ( + sourceType: RequirementSourceTypeEnum +) => { + const sourceColors = { + [RequirementSourceTypeEnum.SalesOrder]: "bg-blue-100 text-blue-800", + [RequirementSourceTypeEnum.Forecast]: "bg-green-100 text-green-800", + [RequirementSourceTypeEnum.SafetyStock]: "bg-orange-100 text-orange-800", + [RequirementSourceTypeEnum.ProductionOrder]: + "bg-purple-100 text-purple-800", + }; + return sourceColors[sourceType]; +}; + +export const getProductionOrderStatus = ( + status: ProductionOrderStatusEnum +): ProjectStatusEnum => { + switch (status) { + case ProductionOrderStatusEnum.Created: + case ProductionOrderStatusEnum.Released: + return ProjectStatusEnum.Planning; + case ProductionOrderStatusEnum.InProgress: + return ProjectStatusEnum.Active; + case ProductionOrderStatusEnum.Completed: + return ProjectStatusEnum.Completed; + case ProductionOrderStatusEnum.Cancelled: + return ProjectStatusEnum.Cancelled; + case ProductionOrderStatusEnum.OnHold: + return ProjectStatusEnum.OnHold; + default: + return ProjectStatusEnum.Planning; + } +}; + +export const getWorkOrderStatus = ( + status: WorkOrderStatusEnum +): TaskStatusEnum => { + switch (status) { + case WorkOrderStatusEnum.Created: + case WorkOrderStatusEnum.Released: + return TaskStatusEnum.NotStarted; + case WorkOrderStatusEnum.InProgress: + return TaskStatusEnum.InProgress; + case WorkOrderStatusEnum.Completed: + return TaskStatusEnum.Completed; + case WorkOrderStatusEnum.Cancelled: + return TaskStatusEnum.Cancelled; + default: + return TaskStatusEnum.NotStarted; + } +}; + +export const getProductionOrderStatusColor = ( + status: ProductionOrderStatusEnum +) => { + switch (status) { + case ProductionOrderStatusEnum.Created: + return "bg-gray-100 text-gray-800"; + case ProductionOrderStatusEnum.Released: + return "bg-blue-100 text-blue-800"; + case ProductionOrderStatusEnum.InProgress: + return "bg-yellow-100 text-yellow-800"; + case ProductionOrderStatusEnum.Completed: + return "bg-green-100 text-green-800"; + case ProductionOrderStatusEnum.Cancelled: + return "bg-red-100 text-red-800"; + case ProductionOrderStatusEnum.OnHold: + return "bg-orange-100 text-orange-800"; + default: + return "bg-gray-100 text-gray-800"; + } +}; + +export const getProductionOrderStatusText = ( + status: ProductionOrderStatusEnum +) => { + switch (status) { + case ProductionOrderStatusEnum.Created: + return "Oluşturuldu"; + case ProductionOrderStatusEnum.Released: + return "Serbest Bırakıldı"; + case ProductionOrderStatusEnum.InProgress: + return "Devam Ediyor"; + case ProductionOrderStatusEnum.Completed: + return "Tamamlandı"; + case ProductionOrderStatusEnum.Cancelled: + return "İptal Edildi"; + case ProductionOrderStatusEnum.OnHold: + return "Beklemede"; + default: + return "Bilinmiyor"; + } +}; + +export const getProductionOrderStatusIcon = ( + status: ProductionOrderStatusEnum +) => { + switch (status) { + case ProductionOrderStatusEnum.Created: + return ; + case ProductionOrderStatusEnum.Released: + return ; + case ProductionOrderStatusEnum.InProgress: + return ; + case ProductionOrderStatusEnum.Completed: + return ; + case ProductionOrderStatusEnum.Cancelled: + return ; + case ProductionOrderStatusEnum.OnHold: + return ; + default: + return ; + } +}; + +export const getProgressPercentage = (order: MrpProductionOrder) => { + if (order.plannedQuantity === 0) return 0; + return Math.round((order.confirmedQuantity / order.plannedQuantity) * 100); +}; + +export const getProgressColor = (percentage: number) => { + if (percentage >= 90) return "bg-green-500"; + if (percentage >= 70) return "bg-blue-500"; + if (percentage >= 50) return "bg-yellow-500"; + if (percentage >= 25) return "bg-orange-500"; + return "bg-red-500"; +}; + +export const getProductionOrderTypeText = ( + type: ProductionOrderTypeEnum | undefined +) => { + switch (type) { + case ProductionOrderTypeEnum.Standard: + return "Standart"; + case ProductionOrderTypeEnum.Rework: + return "Yeniden İşleme"; + case ProductionOrderTypeEnum.Maintenance: + return "Bakım"; + case ProductionOrderTypeEnum.Sample: + return "Numune"; + default: + return "-"; + } +}; + +export const getRecommendationStatusText = ( + status: RecommendationStatusEnum +) => { + const statusLabels = { + [RecommendationStatusEnum.Open]: "Açık", + [RecommendationStatusEnum.Implemented]: "Uygulandı", + [RecommendationStatusEnum.Rejected]: "Reddedildi", + [RecommendationStatusEnum.Expired]: "Süresi Doldu", + }; + return statusLabels[status]; +}; + +export const getRecommendationStatusColor = ( + status: RecommendationStatusEnum +) => { + const statusColors = { + [RecommendationStatusEnum.Open]: "bg-blue-100 text-blue-800", + [RecommendationStatusEnum.Implemented]: "bg-green-100 text-green-800", + [RecommendationStatusEnum.Rejected]: "bg-red-100 text-red-800", + [RecommendationStatusEnum.Expired]: "bg-gray-100 text-gray-800", + }; + return statusColors[status]; +}; + +export const getPsActivityTypeText = (type: PsActivityTypeEnum): string => { + const labels: Record = { + [PsActivityTypeEnum.WorkLog]: "İş Kaydı", + [PsActivityTypeEnum.StatusUpdate]: "Durum Güncelleme", + [PsActivityTypeEnum.Issue]: "Sorun", + [PsActivityTypeEnum.Meeting]: "Toplantı", + [PsActivityTypeEnum.Review]: "İnceleme", + [PsActivityTypeEnum.TaskCreated]: "Görev Oluşturma", + [PsActivityTypeEnum.TaskUpdated]: "Görev Güncelleme", + [PsActivityTypeEnum.TaskCompleted]: "Görev Tamamlama", + [PsActivityTypeEnum.CommentAdded]: "Yorum Ekleme", + [PsActivityTypeEnum.FileUploaded]: "Dosya Yükleme", + [PsActivityTypeEnum.StatusChanged]: "Durum Değişikliği", + [PsActivityTypeEnum.AssignmentChanged]: "Atama Değişikliği", + [PsActivityTypeEnum.MeetingScheduled]: "Toplantı Planlama", + }; + return labels[type] || type; +}; + +export const getPsActivityTypeIcon = (activityType: PsActivityTypeEnum) => { + const icons: Record< + PsActivityTypeEnum, + React.ComponentType> + > = { + [PsActivityTypeEnum.WorkLog]: FaFileAlt, + [PsActivityTypeEnum.StatusUpdate]: FaCog, + [PsActivityTypeEnum.Issue]: FaFlask, + [PsActivityTypeEnum.Meeting]: FaVideo, + [PsActivityTypeEnum.Review]: FaEye, + [PsActivityTypeEnum.TaskCreated]: FaPlus, + [PsActivityTypeEnum.TaskUpdated]: FaEdit, + [PsActivityTypeEnum.TaskCompleted]: FaCog, + [PsActivityTypeEnum.CommentAdded]: FaComment, + [PsActivityTypeEnum.FileUploaded]: FaFileAlt, + [PsActivityTypeEnum.StatusChanged]: FaCog, + [PsActivityTypeEnum.AssignmentChanged]: FaUsers, + [PsActivityTypeEnum.MeetingScheduled]: FaVideo, + }; + return icons[activityType] || FaCog; +}; + +export const getPsActivityTypeColor = ( + activityType: PsActivityTypeEnum +): string => { + const colors: Record = { + [PsActivityTypeEnum.WorkLog]: "bg-gray-100 text-gray-800", + [PsActivityTypeEnum.StatusUpdate]: "bg-blue-100 text-blue-800", + [PsActivityTypeEnum.Issue]: "bg-red-100 text-red-800", + [PsActivityTypeEnum.Meeting]: "bg-teal-100 text-teal-800", + [PsActivityTypeEnum.Review]: "bg-purple-100 text-purple-800", + [PsActivityTypeEnum.TaskCreated]: "bg-green-100 text-green-800", + [PsActivityTypeEnum.TaskUpdated]: "bg-blue-100 text-blue-800", + [PsActivityTypeEnum.TaskCompleted]: "bg-purple-100 text-purple-800", + [PsActivityTypeEnum.CommentAdded]: "bg-yellow-100 text-yellow-800", + [PsActivityTypeEnum.FileUploaded]: "bg-indigo-100 text-indigo-800", + [PsActivityTypeEnum.StatusChanged]: "bg-orange-100 text-orange-800", + [PsActivityTypeEnum.AssignmentChanged]: "bg-pink-100 text-pink-800", + [PsActivityTypeEnum.MeetingScheduled]: "bg-teal-100 text-teal-800", + }; + return colors[activityType] || "bg-gray-100 text-gray-800"; +}; + +export const getCostTimeTrackingStatusText = (status: string) => { + const labels = { + ON_TRACK: "Planında", + AT_RISK: "Risk Altında", + DELAYED: "Gecikmiş", + COMPLETED: "Tamamlandı", + }; + return labels[status as keyof typeof labels] || status; +}; + +export const getCostTimeTrackingStatusColor = (status: string) => { + const colors = { + ON_TRACK: "bg-green-100 text-green-800", + AT_RISK: "bg-yellow-100 text-yellow-800", + DELAYED: "bg-red-100 text-red-800", + COMPLETED: "bg-blue-100 text-blue-800", + }; + return colors[status as keyof typeof colors] || "bg-gray-100 text-gray-800"; +}; + +export const getCostTimeTrackingStatusIcon = (status: string) => { + const icons = { + ON_TRACK: FaCheckCircle, + AT_RISK: FaExclamationCircle, + DELAYED: FaExclamationCircle, + COMPLETED: FaCheckCircle, + }; + return icons[status as keyof typeof icons] || FaExclamationCircle; +}; + +export const getPsDocumentTypeText = (type: PsDocumentTypeEnum): string => { + const typeLabels = { + [PsDocumentTypeEnum.Specification]: "Şartname", + [PsDocumentTypeEnum.Design]: "Tasarım", + [PsDocumentTypeEnum.Contract]: "Sözleşme", + [PsDocumentTypeEnum.Report]: "Rapor", + [PsDocumentTypeEnum.Manual]: "Kılavuz", + [PsDocumentTypeEnum.Other]: "Diğer", + }; + return typeLabels[type] || type; +}; + +export const getPhaseStatusColor = (status: PhaseStatusEnum) => { + switch (status) { + case PhaseStatusEnum.NotStarted: + return "bg-blue-100 text-blue-800"; + case PhaseStatusEnum.InProgress: + return "bg-yellow-100 text-yellow-800"; + case PhaseStatusEnum.Completed: + return "bg-green-100 text-green-800"; + case PhaseStatusEnum.OnHold: + return "bg-orange-100 text-orange-800"; + case PhaseStatusEnum.Cancelled: + return "bg-red-100 text-red-800"; + default: + return "bg-gray-100 text-gray-800"; + } +}; + +export const getPhaseStatusText = (status: PhaseStatusEnum) => { + switch (status) { + case PhaseStatusEnum.NotStarted: + return "Başlamadı"; + case PhaseStatusEnum.InProgress: + return "Devam Ediyor"; + case PhaseStatusEnum.Completed: + return "Tamamlandı"; + case PhaseStatusEnum.OnHold: + return "Beklemede"; + case PhaseStatusEnum.Cancelled: + return "İptal Edildi"; + default: + return "Bilinmiyor"; + } +}; + +export const getPhaseStatusIcon = (status: PhaseStatusEnum) => { + switch (status) { + case PhaseStatusEnum.NotStarted: + return ; + case PhaseStatusEnum.InProgress: + return ; + case PhaseStatusEnum.Completed: + return ; + case PhaseStatusEnum.OnHold: + return ; + case PhaseStatusEnum.Cancelled: + return ; + default: + return ; + } +}; + +export const getProjectStatusColor = (status: ProjectStatusEnum) => { + switch (status) { + case ProjectStatusEnum.Planning: + return "bg-blue-100 text-blue-800 border-blue-200"; + case ProjectStatusEnum.Active: + return "bg-green-100 text-green-800 border-green-200"; + case ProjectStatusEnum.OnHold: + return "bg-yellow-100 text-yellow-800 border-yellow-200"; + case ProjectStatusEnum.Completed: + return "bg-emerald-100 text-emerald-800 border-emerald-200"; + case ProjectStatusEnum.Cancelled: + return "bg-red-100 text-red-800 border-red-200"; + default: + return "bg-gray-100 text-gray-800 border-gray-200"; + } +}; + +export const getProjectStatusIcon = (status: ProjectStatusEnum) => { + switch (status) { + case ProjectStatusEnum.Planning: + return ; + case ProjectStatusEnum.Active: + return ; + case ProjectStatusEnum.OnHold: + return ; + case ProjectStatusEnum.Completed: + return ; + case ProjectStatusEnum.Cancelled: + return ; + default: + return ; + } +}; + +export const getProjectStatusText = (status: ProjectStatusEnum) => { + switch (status) { + case ProjectStatusEnum.Planning: + return "Planlama"; + case ProjectStatusEnum.Active: + return "Aktif"; + case ProjectStatusEnum.OnHold: + return "Beklemede"; + case ProjectStatusEnum.Completed: + return "Tamamlandı"; + case ProjectStatusEnum.Cancelled: + return "İptal Edildi"; + default: + return "Bilinmiyor"; + } +}; + +export const getProjectTypeColor = (type: ProjectTypeEnum) => { + switch (type) { + case ProjectTypeEnum.Internal: + return "bg-purple-100 text-purple-800 border-purple-200"; + case ProjectTypeEnum.Customer: + return "bg-blue-100 text-blue-800 border-blue-200"; + case ProjectTypeEnum.Research: + return "bg-green-100 text-green-800 border-green-200"; + case ProjectTypeEnum.Maintenance: + return "bg-orange-100 text-orange-800 border-orange-200"; + default: + return "bg-gray-100 text-gray-800 border-gray-200"; + } +}; + +export const getProjectTypeText = (type: ProjectTypeEnum) => { + switch (type) { + case ProjectTypeEnum.Internal: + return "İç Proje"; + case ProjectTypeEnum.Customer: + return "Müşteri Projesi"; + case ProjectTypeEnum.Research: + return "Ar-Ge Projesi"; + case ProjectTypeEnum.Maintenance: + return "Bakım Projesi"; + default: + return "Diğer"; + } +}; + +export const getProjectPhaseTaskStatusColor = ( + status: TaskStatusEnum | ProjectStatusEnum | PhaseStatusEnum +) => { + switch (status) { + case TaskStatusEnum.Completed: + case ProjectStatusEnum.Completed: + case PhaseStatusEnum.Completed: + return "bg-gradient-to-r from-green-500 to-green-700"; + case TaskStatusEnum.InProgress: + case ProjectStatusEnum.Active: + case PhaseStatusEnum.InProgress: + return "bg-gradient-to-r from-blue-500 to-blue-700"; + case TaskStatusEnum.OnHold: + case ProjectStatusEnum.OnHold: + case PhaseStatusEnum.OnHold: + return "bg-gradient-to-r from-yellow-500 to-orange-600"; + case TaskStatusEnum.Cancelled: + case ProjectStatusEnum.Cancelled: + case PhaseStatusEnum.Cancelled: + return "bg-gradient-to-r from-red-500 to-red-700"; + default: + return "bg-gradient-to-r from-black-500 to-black-700"; + } +}; + +export const getPhaseCategoryColor = (category: string) => { + switch (category) { + case "Planning": + return "bg-purple-100 text-purple-800"; + case "Development": + return "bg-blue-100 text-blue-800"; + case "Testing": + return "bg-orange-100 text-orange-800"; + case "Deployment": + return "bg-green-100 text-green-800"; + case "Design": + return "bg-pink-100 text-pink-800"; + default: + return "bg-gray-100 text-gray-800"; + } +}; + +export const getTaskStatusIcon = (status: TaskStatusEnum) => { + switch (status) { + case TaskStatusEnum.NotStarted: + return ; + case TaskStatusEnum.InProgress: + return ; + case TaskStatusEnum.Completed: + return ; + case TaskStatusEnum.OnHold: + return ; + case TaskStatusEnum.Cancelled: + return ; + default: + return ; + } +}; + +export const getTaskStatusColor = (status: TaskStatusEnum) => { + switch (status) { + case TaskStatusEnum.NotStarted: + return "bg-gray-100 text-gray-800"; + case TaskStatusEnum.InProgress: + return "bg-blue-100 text-blue-800"; + case TaskStatusEnum.Completed: + return "bg-green-100 text-green-800"; + case TaskStatusEnum.OnHold: + return "bg-yellow-100 text-yellow-800"; + case TaskStatusEnum.Cancelled: + return "bg-red-100 text-red-800"; + default: + return "bg-gray-100 text-gray-800"; + } +}; + +export const getTaskTypeColor = (taskType: TaskTypeEnum) => { + switch (taskType) { + case TaskTypeEnum.Development: + return "bg-purple-100 text-purple-800"; + case TaskTypeEnum.Testing: + return "bg-green-100 text-green-800"; + case TaskTypeEnum.Documentation: + return "bg-blue-100 text-blue-800"; + case TaskTypeEnum.Review: + return "bg-yellow-100 text-yellow-800"; + case TaskTypeEnum.Deployment: + return "bg-red-100 text-red-800"; + case TaskTypeEnum.Meeting: + return "bg-gray-100 text-gray-800"; + default: + return "bg-gray-100 text-gray-800"; + } +}; + +export const getRiskCategoryText = (category: RiskCategoryEnum): string => { + const labels = { + [RiskCategoryEnum.Technical]: "Teknik", + [RiskCategoryEnum.Schedule]: "Program", + [RiskCategoryEnum.Budget]: "Bütçe", + [RiskCategoryEnum.Resource]: "Kaynak", + [RiskCategoryEnum.External]: "Dış Etken", + [RiskCategoryEnum.Quality]: "Kalite", + }; + return labels[category] || category; +}; + +export const getRiskProbabilityText = ( + probability: RiskProbabilityEnum +): string => { + const labels = { + [RiskProbabilityEnum.VeryLow]: "Çok Düşük", + [RiskProbabilityEnum.Low]: "Düşük", + [RiskProbabilityEnum.Medium]: "Orta", + [RiskProbabilityEnum.High]: "Yüksek", + [RiskProbabilityEnum.VeryHigh]: "Çok Yüksek", + }; + return labels[probability] || probability; +}; + +export const getRiskImpactText = (impact: RiskImpactEnum): string => { + const labels = { + [RiskImpactEnum.VeryLow]: "Çok Düşük", + [RiskImpactEnum.Low]: "Düşük", + [RiskImpactEnum.Medium]: "Orta", + [RiskImpactEnum.High]: "Yüksek", + [RiskImpactEnum.VeryHigh]: "Çok Yüksek", + }; + return labels[impact] || impact; +}; + +export const getRiskLevelText = (level: RiskLevelEnum): string => { + const labels = { + [RiskLevelEnum.Low]: "Düşük", + [RiskLevelEnum.Medium]: "Orta", + [RiskLevelEnum.High]: "Yüksek", + [RiskLevelEnum.Critical]: "Kritik", + }; + return labels[level] || level; +}; + +export const getRiskStatusText = (status: RiskStatusEnum): string => { + const labels = { + [RiskStatusEnum.Identified]: "Tespit Edildi", + [RiskStatusEnum.Analyzing]: "Analiz Ediliyor", + [RiskStatusEnum.Mitigating]: "Önlem Alınıyor", + [RiskStatusEnum.Monitoring]: "İzleniyor", + [RiskStatusEnum.Closed]: "Kapatıldı", + }; + return labels[status] || status; +}; + +export const getRiskLevelColor = (level: RiskLevelEnum): string => { + const colors = { + [RiskLevelEnum.Low]: "bg-green-100 text-green-800", + [RiskLevelEnum.Medium]: "bg-yellow-100 text-yellow-800", + [RiskLevelEnum.High]: "bg-orange-100 text-orange-800", + [RiskLevelEnum.Critical]: "bg-red-100 text-red-800", + }; + return colors[level] || "bg-gray-100 text-gray-800"; +}; + +export const getDailyUpdateStatusColor = (status: DailyUpdateStatusEnum) => { + switch (status) { + case DailyUpdateStatusEnum.Draft: + return "bg-gray-100 text-gray-800"; + case DailyUpdateStatusEnum.Submitted: + return "bg-blue-100 text-blue-800"; + case DailyUpdateStatusEnum.Approved: + return "bg-green-100 text-green-800"; + case DailyUpdateStatusEnum.Rejected: + return "bg-red-100 text-red-800"; + default: + return "bg-gray-100 text-gray-800"; + } +}; + +export const getWorkTypeColor = (workType: WorkTypeEnum) => { + const colors = { + [WorkTypeEnum.Development]: "bg-blue-100 text-blue-800", + [WorkTypeEnum.Testing]: "bg-green-100 text-green-800", + [WorkTypeEnum.Design]: "bg-purple-100 text-purple-800", + [WorkTypeEnum.Documentation]: "bg-yellow-100 text-yellow-800", + [WorkTypeEnum.Meeting]: "bg-orange-100 text-orange-800", + [WorkTypeEnum.Research]: "bg-indigo-100 text-indigo-800", + [WorkTypeEnum.Debugging]: "bg-red-100 text-red-800", + [WorkTypeEnum.Review]: "bg-teal-100 text-teal-800", + [WorkTypeEnum.Other]: "bg-gray-100 text-gray-800", + }; + return colors[workType] || "bg-gray-100 text-gray-800"; +}; + +export const getDeliveryStatusColor = (status: DeliveryStatusEnum) => { + const colors = { + [DeliveryStatusEnum.Preparing]: "bg-gray-100 text-gray-800", + [DeliveryStatusEnum.Shipped]: "bg-blue-100 text-blue-800", + [DeliveryStatusEnum.InTransit]: "bg-indigo-100 text-indigo-800", + [DeliveryStatusEnum.OutForDelivery]: "bg-purple-100 text-purple-800", + [DeliveryStatusEnum.Delivered]: "bg-green-100 text-green-800", + [DeliveryStatusEnum.PartiallyDelivered]: "bg-orange-100 text-orange-800", + [DeliveryStatusEnum.Delayed]: "bg-red-100 text-red-800", + [DeliveryStatusEnum.Returned]: "bg-yellow-100 text-yellow-800", + [DeliveryStatusEnum.Cancelled]: "bg-gray-100 text-gray-800", + }; + return colors[status]; +}; + +export const getDeliveryStatusIcon = (status: DeliveryStatusEnum) => { + const icons = { + [DeliveryStatusEnum.Preparing]: , + [DeliveryStatusEnum.Shipped]: , + [DeliveryStatusEnum.InTransit]: , + [DeliveryStatusEnum.OutForDelivery]: , + [DeliveryStatusEnum.Delivered]: , + [DeliveryStatusEnum.PartiallyDelivered]: ( + + ), + [DeliveryStatusEnum.Delayed]: , + [DeliveryStatusEnum.Returned]: , + [DeliveryStatusEnum.Cancelled]: ( + + ), + }; + return icons[status]; +}; + +export const getConditionColor = (condition: MmDeliveryItem["condition"]) => { + const colors = { + Good: "bg-green-100 text-green-800", + Damaged: "bg-red-100 text-red-800", + Missing: "bg-orange-100 text-orange-800", + }; + return colors[condition]; +}; + +export const getConditionText = (condition: MmDeliveryItem["condition"]) => { + const texts = { + Good: "İyi", + Damaged: "Hasarlı", + Missing: "Eksik", + }; + return texts[condition]; +}; + +export const getOrderStatusText = (status: OrderStatusEnum) => { + const texts = { + [OrderStatusEnum.Draft]: "Taslak", + [OrderStatusEnum.Pending]: "Beklemede", + [OrderStatusEnum.Approved]: "Onaylandı", + [OrderStatusEnum.Sent]: "Gönderildi", + [OrderStatusEnum.Confirmed]: "Onaylandı", + [OrderStatusEnum.PartiallyDelivered]: "Kısmi Teslim", + [OrderStatusEnum.Delivered]: "Teslim Edildi", + [OrderStatusEnum.Completed]: "Tamamlandı", + [OrderStatusEnum.Cancelled]: "İptal Edildi", + [OrderStatusEnum.PartiallyReceived]: "Kısmi Alındı", + [OrderStatusEnum.Received]: "Alındı", + [OrderStatusEnum.Invoiced]: "Faturalandırıldı", + [OrderStatusEnum.Closed]: "Kapandı", + }; + return texts[status]; +}; + +export const getOrderStatusColor = (status: OrderStatusEnum) => { + const colors = { + [OrderStatusEnum.Draft]: "bg-gray-100 text-gray-800", + [OrderStatusEnum.Pending]: "bg-yellow-100 text-yellow-800", + [OrderStatusEnum.Approved]: "bg-blue-100 text-blue-800", + [OrderStatusEnum.Sent]: "bg-indigo-100 text-indigo-800", + [OrderStatusEnum.Confirmed]: "bg-purple-100 text-purple-800", + [OrderStatusEnum.PartiallyDelivered]: "bg-orange-100 text-orange-800", + [OrderStatusEnum.Delivered]: "bg-green-100 text-green-800", + [OrderStatusEnum.Completed]: "bg-emerald-100 text-emerald-800", + [OrderStatusEnum.Cancelled]: "bg-red-100 text-red-800", + [OrderStatusEnum.PartiallyReceived]: "bg-orange-100 text-orange-800", + [OrderStatusEnum.Received]: "bg-green-100 text-green-800", + [OrderStatusEnum.Invoiced]: "bg-blue-100 text-blue-800", + [OrderStatusEnum.Closed]: "bg-gray-100 text-gray-800", + }; + return colors[status]; +}; + +export const getOrderStatusIcon = (status: OrderStatusEnum) => { + const icons = { + [OrderStatusEnum.Draft]: , + [OrderStatusEnum.Pending]: , + [OrderStatusEnum.Approved]: , + [OrderStatusEnum.Sent]: , + [OrderStatusEnum.Confirmed]: , + [OrderStatusEnum.PartiallyDelivered]: ( + + ), + [OrderStatusEnum.Delivered]: , + [OrderStatusEnum.Completed]: , + [OrderStatusEnum.Cancelled]: , + [OrderStatusEnum.PartiallyReceived]: ( + + ), + [OrderStatusEnum.Received]: , + [OrderStatusEnum.Invoiced]: , + [OrderStatusEnum.Closed]: , + }; + return icons[status]; +}; + +export const getRequestStatusText = (status: RequestStatusEnum) => { + const statuses = { + [RequestStatusEnum.Draft]: "Taslak", + [RequestStatusEnum.Submitted]: "Gönderildi", + [RequestStatusEnum.InReview]: "İnceleniyor", + [RequestStatusEnum.Approved]: "Onaylandı", + [RequestStatusEnum.Rejected]: "Reddedildi", + [RequestStatusEnum.InQuotation]: "Teklif Aşamasında", + [RequestStatusEnum.Ordered]: "Sipariş Verildi", + [RequestStatusEnum.Completed]: "Tamamlandı", + [RequestStatusEnum.Cancelled]: "İptal Edildi", + }; + return statuses[status]; +}; + +export const getRequestStatusColor = (status: RequestStatusEnum) => { + const colors = { + [RequestStatusEnum.Draft]: "bg-gray-100 text-gray-800", + [RequestStatusEnum.Submitted]: "bg-blue-100 text-blue-800", + [RequestStatusEnum.InReview]: "bg-yellow-100 text-yellow-800", + [RequestStatusEnum.Approved]: "bg-green-100 text-green-800", + [RequestStatusEnum.Rejected]: "bg-red-100 text-red-800", + [RequestStatusEnum.InQuotation]: "bg-purple-100 text-purple-800", + [RequestStatusEnum.Ordered]: "bg-indigo-100 text-indigo-800", + [RequestStatusEnum.Completed]: "bg-green-100 text-green-800", + [RequestStatusEnum.Cancelled]: "bg-red-100 text-red-800", + }; + return colors[status]; +}; + +export const getApprovalStatusIcon = (status: ApprovalStatusEnum) => { + switch (status) { + case ApprovalStatusEnum.Approved: + return ; + case ApprovalStatusEnum.Rejected: + return ; + case ApprovalStatusEnum.Pending: + return ; + default: + return ; + } +}; + +export const getRequisitionStatusColor = (status: RequisitionStatusEnum) => { + switch (status) { + case RequisitionStatusEnum.Draft: + return "bg-gray-100 text-gray-800"; + case RequisitionStatusEnum.Submitted: + return "bg-blue-100 text-blue-800"; + case RequisitionStatusEnum.InApproval: + return "bg-yellow-100 text-yellow-800"; + case RequisitionStatusEnum.Approved: + return "bg-green-100 text-green-800"; + case RequisitionStatusEnum.Rejected: + return "bg-red-100 text-red-800"; + case RequisitionStatusEnum.Cancelled: + return "bg-gray-100 text-gray-800"; + case RequisitionStatusEnum.Converted: + return "bg-purple-100 text-purple-800"; + default: + return "bg-gray-100 text-gray-800"; + } +}; + +export const getRequisitionStatusText = (status: RequisitionStatusEnum) => { + switch (status) { + case RequisitionStatusEnum.Draft: + return "Taslak"; + case RequisitionStatusEnum.Submitted: + return "Gönderildi"; + case RequisitionStatusEnum.InApproval: + return "Onayda"; + case RequisitionStatusEnum.Approved: + return "Onaylandı"; + case RequisitionStatusEnum.Rejected: + return "Reddedildi"; + case RequisitionStatusEnum.Cancelled: + return "İptal Edildi"; + case RequisitionStatusEnum.Converted: + return "Siparişe Dönüştürüldü"; + default: + return "Bilinmiyor"; + } +}; + +export const getRequisitionStatusIcon = (status: RequisitionStatusEnum) => { + switch (status) { + case RequisitionStatusEnum.Draft: + return ; + case RequisitionStatusEnum.Submitted: + return ; + case RequisitionStatusEnum.InApproval: + return ; + case RequisitionStatusEnum.Approved: + return ; + case RequisitionStatusEnum.Rejected: + return ; + case RequisitionStatusEnum.Cancelled: + return ; + case RequisitionStatusEnum.Converted: + return ; + default: + return ; + } +}; + +export const getQuotationStatusText = (status: QuotationStatusEnum) => { + const statuses = { + [QuotationStatusEnum.Draft]: "Taslak", + [QuotationStatusEnum.Pending]: "Beklemede", + [QuotationStatusEnum.UnderReview]: "İnceleme", + [QuotationStatusEnum.Submitted]: "Sunuldu", + [QuotationStatusEnum.Approved]: "Onaylandı", + [QuotationStatusEnum.Rejected]: "Reddedildi", + [QuotationStatusEnum.Expired]: "Süresi Doldu", + }; + return statuses[status]; +}; + +export const getQuotationStatusColor = (status: QuotationStatusEnum) => { + const colors = { + [QuotationStatusEnum.Draft]: "bg-gray-100 text-gray-800", + [QuotationStatusEnum.Pending]: "bg-yellow-100 text-yellow-800", + [QuotationStatusEnum.UnderReview]: "bg-blue-100 text-blue-800", + [QuotationStatusEnum.Submitted]: "bg-indigo-100 text-indigo-800", + [QuotationStatusEnum.Approved]: "bg-green-100 text-green-800", + [QuotationStatusEnum.Rejected]: "bg-red-100 text-red-800", + [QuotationStatusEnum.Expired]: "bg-orange-100 text-orange-800", + }; + return colors[status]; +}; + +export const getQuotationStatusIcon = (status: QuotationStatusEnum) => { + const icons = { + [QuotationStatusEnum.Draft]: , + [QuotationStatusEnum.Pending]: , + [QuotationStatusEnum.UnderReview]: , + [QuotationStatusEnum.Submitted]: , + [QuotationStatusEnum.Approved]: , + [QuotationStatusEnum.Rejected]: , + [QuotationStatusEnum.Expired]: , + }; + return icons[status]; +}; + +export const getSupplierCardTypeText = (type: SupplierCardTypeEnum) => { + const types = { + [SupplierCardTypeEnum.Standard]: "Standart", + [SupplierCardTypeEnum.Premium]: "Premium", + [SupplierCardTypeEnum.Strategic]: "Stratejik", + [SupplierCardTypeEnum.Preferred]: "Tercihli", + }; + return types[type]; +}; + +export const getSupplierCardTypeColor = (type: SupplierCardTypeEnum) => { + const colors = { + [SupplierCardTypeEnum.Standard]: + "bg-gray-100 text-gray-800 border-gray-200", + [SupplierCardTypeEnum.Premium]: "bg-blue-100 text-blue-800 border-blue-200", + [SupplierCardTypeEnum.Strategic]: + "bg-purple-100 text-purple-800 border-purple-200", + [SupplierCardTypeEnum.Preferred]: + "bg-green-100 text-green-800 border-green-200", + }; + return colors[type]; +}; + +export const getPaymentTermsText = (terms: PaymentTerms) => { + const termsMap = { + [PaymentTerms.Cash]: "Peşin", + [PaymentTerms.Net15]: "Net 15", + [PaymentTerms.Net30]: "Net 30", + [PaymentTerms.Net45]: "Net 45", + [PaymentTerms.Net60]: "Net 60", + [PaymentTerms.Net90]: "Net 90", + [PaymentTerms.COD]: "Kapıda Ödeme", + [PaymentTerms.Prepaid]: "Ön Ödeme", + }; + return termsMap[terms] || terms; +}; + +export const getSupplierTypeColor = (type: SupplierTypeEnum) => { + switch (type) { + case SupplierTypeEnum.Material: + return "bg-blue-100 text-blue-800"; + case SupplierTypeEnum.Service: + return "bg-green-100 text-green-800"; + case SupplierTypeEnum.Both: + return "bg-purple-100 text-purple-800"; + default: + return "bg-gray-100 text-gray-800"; + } +}; + +export const getSupplierTypeText = (type: SupplierTypeEnum) => { + switch (type) { + case SupplierTypeEnum.Material: + return "Malzeme"; + case SupplierTypeEnum.Service: + return "Hizmet"; + case SupplierTypeEnum.Both: + return "Karma"; + default: + return "Bilinmiyor"; + } +}; + +export const getRatingColor = (rating: number) => { + if (rating >= 4.5) return "text-green-600"; + if (rating >= 4.0) return "text-yellow-600"; + if (rating >= 3.0) return "text-orange-600"; + return "text-red-600"; +}; + +export const getLocationTypeText = (type: LocationTypeEnum) => { + const labels = { + [LocationTypeEnum.Shelf]: "Raf", + [LocationTypeEnum.Bin]: "Kutu", + [LocationTypeEnum.Floor]: "Zemin", + [LocationTypeEnum.Rack]: "Yüksek Raf", + [LocationTypeEnum.Tank]: "Tank", + }; + return labels[type]; +}; + +export const getZoneTypeText = (type: ZoneTypeEnum) => { + const labels = { + [ZoneTypeEnum.Storage]: "Depolama", + [ZoneTypeEnum.Receiving]: "Giriş", + [ZoneTypeEnum.Shipping]: "Sevkiyat", + [ZoneTypeEnum.Picking]: "Toplama", + [ZoneTypeEnum.Quality]: "Kalite", + [ZoneTypeEnum.Staging]: "Hazırlık", + }; + return labels[type]; +}; + +export const getQualityStatusInfo = (status: QualityStatusEnum) => { + switch (status) { + case QualityStatusEnum.Approved: + return { label: "Onaylandı", color: "bg-green-100 text-green-800" }; + case QualityStatusEnum.Rejected: + return { label: "Reddedildi", color: "bg-red-100 text-red-800" }; + case QualityStatusEnum.Quarantine: + return { label: "Karantina", color: "bg-yellow-100 text-yellow-800" }; + case QualityStatusEnum.Pending: + return { label: "Beklemede", color: "bg-blue-100 text-blue-800" }; + default: + return { label: "Bilinmeyen", color: "bg-gray-100 text-gray-800" }; + } +}; + +export const getSerialStatusInfo = (status: SerialStatusEnum) => { + switch (status) { + case SerialStatusEnum.Available: + return { label: "Müsait", color: "bg-green-100 text-green-800" }; + case SerialStatusEnum.InUse: + return { label: "Kullanımda", color: "bg-blue-100 text-blue-800" }; + case SerialStatusEnum.Maintenance: + return { label: "Bakımda", color: "bg-yellow-100 text-yellow-800" }; + case SerialStatusEnum.Disposed: + return { label: "İmha Edildi", color: "bg-red-100 text-red-800" }; + default: + return { label: "Bilinmeyen", color: "bg-gray-100 text-gray-800" }; + } +}; + +export const getStockStatusText = (status: StockStatusEnum) => { + const labels = { + [StockStatusEnum.Available]: "Mevcut", + [StockStatusEnum.Reserved]: "Rezerve", + [StockStatusEnum.Blocked]: "Blokeli", + [StockStatusEnum.InTransit]: "Transfer Halinde", + [StockStatusEnum.Quarantine]: "Karantina", + }; + return labels[status]; +}; + +export const getStockStatusColor = (status: StockStatusEnum) => { + const colors = { + [StockStatusEnum.Available]: "bg-green-100 text-green-800", + [StockStatusEnum.Reserved]: "bg-yellow-100 text-yellow-800", + [StockStatusEnum.Blocked]: "bg-red-100 text-red-800", + [StockStatusEnum.InTransit]: "bg-blue-100 text-blue-800", + [StockStatusEnum.Quarantine]: "bg-purple-100 text-purple-800", + }; + return colors[status]; +}; + +export const getPutawayStrategyText = (strategy: PutawayStrategyEnum) => { + const labels = { + [PutawayStrategyEnum.FIFO]: "İlk Giren İlk Çıkar (FIFO)", + [PutawayStrategyEnum.LIFO]: "Son Giren İlk Çıkar (LIFO)", + [PutawayStrategyEnum.NearestLocation]: "En Yakın Lokasyon", + [PutawayStrategyEnum.EmptyLocation]: "Boş Lokasyon", + [PutawayStrategyEnum.SameProduct]: "Aynı Ürün Gruplaması", + }; + return labels[strategy]; +}; + +export const getPutawayStrategyColor = (strategy: PutawayStrategyEnum) => { + const colors = { + [PutawayStrategyEnum.FIFO]: "bg-green-100 text-green-800", + [PutawayStrategyEnum.LIFO]: "bg-red-100 text-red-800", + [PutawayStrategyEnum.NearestLocation]: "bg-blue-100 text-blue-800", + [PutawayStrategyEnum.EmptyLocation]: "bg-purple-100 text-purple-800", + [PutawayStrategyEnum.SameProduct]: "bg-yellow-100 text-yellow-800", + }; + return colors[strategy]; +}; + +export const getConditionTypeText = (type: ConditionTypeEnum) => { + const labels = { + [ConditionTypeEnum.MaterialType]: "Malzeme Tipi", + [ConditionTypeEnum.MaterialGroup]: "Malzeme Grubu", + [ConditionTypeEnum.Quantity]: "Miktar", + [ConditionTypeEnum.Weight]: "Ağırlık", + [ConditionTypeEnum.Volume]: "Hacim", + }; + return labels[type]; +}; + +export const getConditionOperatorText = (operator: ConditionOperatorEnum) => { + const labels = { + [ConditionOperatorEnum.Equals]: "Eşittir", + [ConditionOperatorEnum.NotEquals]: "Eşit Değildir", + [ConditionOperatorEnum.GreaterThan]: "Büyüktür", + [ConditionOperatorEnum.LessThan]: "Küçüktür", + [ConditionOperatorEnum.Contains]: "İçerir", + }; + return labels[operator]; +}; + +export const getCountTypeText = (type: CountTypeEnum) => { + const labels = { + [CountTypeEnum.Full]: "Tam Sayım", + [CountTypeEnum.Cycle]: "Döngüsel Sayım", + [CountTypeEnum.Spot]: "Nokta Sayım", + }; + return labels[type]; +}; + +export const getCountStatusText = (status: CountStatusEnum) => { + const labels = { + [CountStatusEnum.Planned]: "Planlandı", + [CountStatusEnum.InProgress]: "Devam Ediyor", + [CountStatusEnum.Completed]: "Tamamlandı", + [CountStatusEnum.Approved]: "Onaylandı", + }; + return labels[status]; +}; + +export const getCountStatusColor = (status: CountStatusEnum) => { + const colors = { + [CountStatusEnum.Planned]: "bg-gray-100 text-gray-800", + [CountStatusEnum.InProgress]: "bg-blue-100 text-blue-800", + [CountStatusEnum.Completed]: "bg-yellow-100 text-yellow-800", + [CountStatusEnum.Approved]: "bg-green-100 text-green-800", + }; + return colors[status]; +}; + +export const getMovementStatusText = (status: MovementStatusEnum) => { + const labels = { + [MovementStatusEnum.Planned]: "Planlandı", + [MovementStatusEnum.InProgress]: "Devam Ediyor", + [MovementStatusEnum.Completed]: "Tamamlandı", + [MovementStatusEnum.Cancelled]: "İptal Edildi", + }; + return labels[status]; +}; + +export const getMovementStatusColor = (status: MovementStatusEnum) => { + const colors = { + [MovementStatusEnum.Planned]: "bg-gray-100 text-gray-800", + [MovementStatusEnum.InProgress]: "bg-blue-100 text-blue-800", + [MovementStatusEnum.Completed]: "bg-green-100 text-green-800", + [MovementStatusEnum.Cancelled]: "bg-red-100 text-red-800", + }; + return colors[status]; +}; + +export const getMovementStatusIcon = (status: MovementStatusEnum) => { + const icons = { + [MovementStatusEnum.Planned]: FaClock, + [MovementStatusEnum.InProgress]: FaArrowCircleDown, + [MovementStatusEnum.Completed]: FaCheckCircle, + [MovementStatusEnum.Cancelled]: FaExclamationCircle, + }; + return icons[status]; +}; diff --git a/ui/src/views/accounting/AccountingManagement.tsx b/ui/src/views/accounting/AccountingManagement.tsx new file mode 100644 index 00000000..9e738c78 --- /dev/null +++ b/ui/src/views/accounting/AccountingManagement.tsx @@ -0,0 +1,42 @@ +import React from "react"; +import { Outlet, useLocation } from "react-router-dom"; +import ModuleHeader from "../../components/common/ModuleHeader"; + +const AccountingManagement: React.FC = () => { + const location = useLocation(); + + // Define page mappings for breadcrumbs + const getPageTitle = (pathname: string) => { + if ( + pathname === "/admin/accounting" || + pathname === "/admin/accounting/current-accounts" + ) + return "Cari Hesap Yönetimi"; + if (pathname === "/admin/accounting/waybills") return "İrsaliye Yönetimi"; + if (pathname === "/admin/accounting/invoices") return "Fatura Yönetimi"; + if (pathname === "/admin/accounting/cash") return "Kasa Yönetimi"; + if (pathname === "/admin/accounting/bank") return "Banka Yönetimi"; + if (pathname === "/admin/accounting/check-note") return "Çek & Senet Takibi"; + return "Muhasebe Yönetimi"; + }; + + const pageTitle = getPageTitle(location.pathname); + + // Create breadcrumbs: Anasayfa / CRM Yönetimi / Sayfanın Adı + const breadcrumbs = [{ name: "CRM Yönetimi", href: "/admin/crm" }]; + + return ( +
+ + +
+ +
+
+ ); +}; + +export default AccountingManagement; diff --git a/ui/src/views/accounting/BankPage.tsx b/ui/src/views/accounting/BankPage.tsx new file mode 100644 index 00000000..6f7e0b36 --- /dev/null +++ b/ui/src/views/accounting/BankPage.tsx @@ -0,0 +1,226 @@ +import React, { useState, useEffect } from "react"; +import BankManagement from "./components/BankManagement"; +import BankAccountForm from "./components/BankAccountForm"; +import BankMovementForm from "./components/BankMovementForm"; +import BankAccountDetails from "./components/BankAccountDetails"; +import { + FiBankMovement, + BankAccountTypeEnum, + BankTransactionTypeEnum, + TransactionStatusEnum, +} from "../../types/fi"; +import { mockBanks } from "../../mocks/mockBanks"; +import { mockBankMovements } from "../../mocks/mockBankMovements"; +import { BankAccount } from "../../types/common"; + +const BankPage: React.FC = () => { + const [bankAccounts, setBankAccounts] = useState(mockBanks); + const [bankMovements, setBankMovements] = useState([]); + + // Initialize bank movements after bank accounts are set + useEffect(() => { + if (bankAccounts.length > 0) { + setBankMovements(mockBankMovements); + } + }, [bankAccounts]); + + // Modal states + const [isAccountFormOpen, setIsAccountFormOpen] = useState(false); + const [isMovementFormOpen, setIsMovementFormOpen] = useState(false); + const [isAccountDetailsOpen, setIsAccountDetailsOpen] = useState(false); + const [selectedAccount, setSelectedAccount] = useState< + BankAccount | undefined + >(undefined); + const [selectedMovement, setSelectedMovement] = useState< + FiBankMovement | undefined + >(undefined); + + const handleAddAccount = () => { + setSelectedAccount(undefined); + setIsAccountFormOpen(true); + }; + + const handleEditAccount = (account: BankAccount) => { + setSelectedAccount(account); + setIsAccountFormOpen(true); + }; + + const handleAddMovement = () => { + setSelectedMovement(undefined); + setIsMovementFormOpen(true); + }; + + const handleEditMovement = (movement: FiBankMovement) => { + setSelectedMovement(movement); + setIsMovementFormOpen(true); + }; + + const handleViewDetails = (account: BankAccount) => { + setSelectedAccount(account); + setIsAccountDetailsOpen(true); + }; + + const handleSaveAccount = (accountData: Partial) => { + if (selectedAccount) { + // Update existing account + setBankAccounts((prev) => + prev.map((acc) => + acc.id === selectedAccount.id + ? { ...acc, ...accountData, lastModificationTime: new Date() } + : acc + ) + ); + } else { + // Add new account + const newAccount: BankAccount = { + id: Date.now().toString(), + accountCode: accountData.accountCode || "", + bankName: accountData.bankName || "", + branchName: accountData.branchName || "", + accountNumber: accountData.accountNumber || "", + iban: accountData.iban || "", + accountType: accountData.accountType || BankAccountTypeEnum.Current, + currency: accountData.currency || "TRY", + balance: accountData.balance || 0, + overdraftLimit: accountData.overdraftLimit || 0, + dailyTransferLimit: accountData.dailyTransferLimit || 0, + contactPerson: accountData.contactPerson, + phone: accountData.phone, + isActive: accountData.isActive ?? true, + creationTime: new Date(), + lastModificationTime: new Date(), + isDefault: false, + }; + setBankAccounts((prev) => [...prev, newAccount]); + } + setIsAccountFormOpen(false); + setSelectedAccount(undefined); + }; + + const handleSaveMovement = (movementData: Partial) => { + if (selectedMovement) { + // Update existing movement + setBankMovements((prev) => + prev.map((mov) => + mov.id === selectedMovement.id ? { ...mov, ...movementData } : mov + ) + ); + } else { + // Add new movement + const bankAccount = bankAccounts.find( + (acc) => acc.id === movementData.bankAccountId + ); + const newMovement: FiBankMovement = { + id: Date.now().toString(), + bankAccountId: movementData.bankAccountId || "", + bankAccount: bankAccount, + transactionDate: movementData.transactionDate || new Date(), + valueDate: movementData.valueDate || new Date(), + description: movementData.description || "", + referenceNumber: movementData.referenceNumber, + transactionType: + movementData.transactionType || BankTransactionTypeEnum.Deposit, + amount: movementData.amount || 0, + currency: movementData.currency || "TRY", + recipientName: movementData.recipientName, + recipientIban: movementData.recipientIban, + recipientBank: movementData.recipientBank, + currentAccountId: movementData.currentAccountId, + status: movementData.status || TransactionStatusEnum.Pending, + creationTime: new Date(), + }; + setBankMovements((prev) => [...prev, newMovement]); + + // Update account balance + if (bankAccount) { + const isIncoming = [ + BankTransactionTypeEnum.Deposit, + BankTransactionTypeEnum.Interest, + ].includes(newMovement.transactionType); + const isOutgoing = [ + BankTransactionTypeEnum.Withdrawal, + BankTransactionTypeEnum.Transfer, + BankTransactionTypeEnum.EFT, + BankTransactionTypeEnum.Fee, + ].includes(newMovement.transactionType); + + if (newMovement.status === TransactionStatusEnum.Completed) { + const balanceChange = isIncoming + ? newMovement.amount + : isOutgoing + ? -newMovement.amount + : 0; + setBankAccounts((prev) => + prev.map((acc) => + acc.id === bankAccount.id + ? { + ...acc, + balance: acc.balance + balanceChange, + lastModificationTime: new Date(), + } + : acc + ) + ); + } + } + } + setIsMovementFormOpen(false); + setSelectedMovement(undefined); + }; + + return ( + <> + + + {/* Bank Account Form Modal */} + { + setIsAccountFormOpen(false); + setSelectedAccount(undefined); + }} + onSave={handleSaveAccount} + /> + + {/* Bank Movement Form Modal */} + { + setIsMovementFormOpen(false); + setSelectedMovement(undefined); + }} + onSave={handleSaveMovement} + /> + + {/* Bank Account Details Modal */} + {selectedAccount && ( + { + setIsAccountDetailsOpen(false); + setSelectedAccount(undefined); + }} + onEdit={(account) => { + setIsAccountDetailsOpen(false); + handleEditAccount(account); + }} + /> + )} + + ); +}; + +export default BankPage; diff --git a/ui/src/views/accounting/CashPage.tsx b/ui/src/views/accounting/CashPage.tsx new file mode 100644 index 00000000..caa94af1 --- /dev/null +++ b/ui/src/views/accounting/CashPage.tsx @@ -0,0 +1,184 @@ +import React, { useState } from "react"; +import CashManagement from "./components/CashManagement"; +import CashAccountForm from "./components/CashAccountForm"; +import CashMovementForm from "./components/CashMovementForm"; +import CashAccountDetails from "./components/CashAccountDetails"; +import { + FiCashAccount, + FiCashMovement, + CashMovementTypeEnum, +} from "../../types/fi"; +import { mockCashAccounts } from "../../mocks/mockCashAccounts"; +import { mockCashMovements } from "../../mocks/mockCashMovements"; + +const CashPage: React.FC = () => { + const [showAccountForm, setShowAccountForm] = useState(false); + const [showMovementForm, setShowMovementForm] = useState(false); + const [showAccountDetails, setShowAccountDetails] = useState(false); + const [editingAccount, setEditingAccount] = useState< + FiCashAccount | undefined + >(); + const [editingMovement, setEditingMovement] = useState< + FiCashMovement | undefined + >(); + const [viewingAccount, setViewingAccount] = useState< + FiCashAccount | undefined + >(); + const [cashAccounts, setCashAccounts] = useState(mockCashAccounts); + const [cashMovements, setCashMovements] = useState(mockCashMovements); + + const handleAddAccount = () => { + setEditingAccount(undefined); + setShowAccountForm(true); + }; + + const handleEditAccount = (account: FiCashAccount) => { + setEditingAccount(account); + setShowAccountForm(true); + }; + + const handleSaveAccount = (accountData: Omit) => { + if (editingAccount) { + // Update existing account + setCashAccounts((prev) => + prev.map((acc) => + acc.id === editingAccount.id + ? { ...accountData, id: editingAccount.id } + : acc + ) + ); + } else { + // Add new account + const newAccount: FiCashAccount = { + ...accountData, + id: Date.now().toString(), + }; + setCashAccounts((prev) => [...prev, newAccount]); + } + setShowAccountForm(false); + setEditingAccount(undefined); + }; + + const handleAddMovement = () => { + setEditingMovement(undefined); + setShowMovementForm(true); + }; + + const handleEditMovement = (movement: FiCashMovement) => { + setEditingMovement(movement); + setShowMovementForm(true); + }; + + const handleSaveMovement = (movementData: Omit) => { + if (editingMovement) { + // Update existing movement + setCashMovements((prev) => + prev.map((mov) => + mov.id === editingMovement.id + ? { ...movementData, id: editingMovement.id } + : mov + ) + ); + } else { + // Add new movement + const newMovement: FiCashMovement = { + ...movementData, + id: Date.now().toString(), + }; + setCashMovements((prev) => [...prev, newMovement]); + } + + // Update cash account balance + if (movementData.cashAccount) { + setCashAccounts((prev) => + prev.map((acc) => { + if (acc.id === movementData.cashAccount?.id) { + const balanceChange = + movementData.movementType === CashMovementTypeEnum.Income + ? movementData.amount + : -movementData.amount; + return { + ...acc, + balance: acc.balance + balanceChange, + lastModificationTime: new Date(), + }; + } + return acc; + }) + ); + } + + setShowMovementForm(false); + setEditingMovement(undefined); + }; + + const handleViewDetails = (account: FiCashAccount) => { + setViewingAccount(account); + setShowAccountDetails(true); + }; + + const handleCloseAccountForm = () => { + setShowAccountForm(false); + setEditingAccount(undefined); + }; + + const handleCloseMovementForm = () => { + setShowMovementForm(false); + setEditingMovement(undefined); + }; + + const handleCloseAccountDetails = () => { + setShowAccountDetails(false); + setViewingAccount(undefined); + }; + + return ( + <> + + + {/* Account Form Modal */} + {showAccountForm && ( + + )} + + {/* Movement Form Modal */} + {showMovementForm && ( + + )} + + {/* Account Details Modal */} + {showAccountDetails && viewingAccount && ( + { + setShowAccountDetails(false); + handleEditAccount(account); + }} + /> + )} + + ); +}; + +export default CashPage; diff --git a/ui/src/views/accounting/CheckNotePage.tsx b/ui/src/views/accounting/CheckNotePage.tsx new file mode 100644 index 00000000..e61e5ab8 --- /dev/null +++ b/ui/src/views/accounting/CheckNotePage.tsx @@ -0,0 +1,159 @@ +import React, { useState } from "react"; +import CheckNoteManagement from "./components/CheckNoteManagement"; +import { + FiCheck, + PromissoryNote, + CheckStatusEnum, + NoteStatusEnum, +} from "../../types/fi"; +import { mockChecks } from "../../mocks/mockChecks"; +import { mockPromissoryNotes } from "../../mocks/mockPromissoryNotes"; +import { mockCurrentAccounts } from "../../mocks/mockCurrentAccounts"; + +const CheckNotePage: React.FC = () => { + const [checks, setChecks] = useState(mockChecks); + const [promissoryNotes, setPromissoryNotes] = + useState(mockPromissoryNotes); + + const handleAddCheck = ( + checkData: Omit + ) => { + const newCheck: FiCheck = { + ...checkData, + id: `check_${Date.now()}`, + creationTime: new Date(), + lastModificationTime: new Date(), + }; + setChecks((prev) => [...prev, newCheck]); + console.log("Check added:", newCheck); + }; + + const handleEditCheck = ( + id: string, + checkData: Omit + ) => { + setChecks((prev) => + prev.map((check) => + check.id === id + ? { ...check, ...checkData, lastModificationTime: new Date() } + : check + ) + ); + console.log("Check updated:", id, checkData); + }; + + const handleAddNote = ( + noteData: Omit< + PromissoryNote, + "id" | "creationTime" | "lastModificationTime" + > + ) => { + const newNote: PromissoryNote = { + ...noteData, + id: `note_${Date.now()}`, + creationTime: new Date(), + lastModificationTime: new Date(), + }; + setPromissoryNotes((prev) => [...prev, newNote]); + console.log("Promissory note added:", newNote); + }; + + const handleEditNote = ( + id: string, + noteData: Omit< + PromissoryNote, + "id" | "creationTime" | "lastModificationTime" + > + ) => { + setPromissoryNotes((prev) => + prev.map((note) => + note.id === id + ? { ...note, ...noteData, lastModificationTime: new Date() } + : note + ) + ); + console.log("Promissory note updated:", id, noteData); + }; + + const handleCollectCheck = (id: string, collectionDate: Date) => { + setChecks((prev) => + prev.map((check) => + check.id === id + ? { + ...check, + status: CheckStatusEnum.Collected, + collectionDate, + lastModificationTime: new Date(), + } + : check + ) + ); + console.log("Check collected:", id, collectionDate); + }; + + const handleCollectNote = (id: string, collectionDate: Date) => { + setPromissoryNotes((prev) => + prev.map((note) => + note.id === id + ? { + ...note, + status: NoteStatusEnum.Collected, + collectionDate, + lastModificationTime: new Date(), + } + : note + ) + ); + console.log("Promissory note collected:", id, collectionDate); + }; + + const handleEndorseCheck = (id: string, endorsedTo: string) => { + setChecks((prev) => + prev.map((check) => + check.id === id + ? { + ...check, + status: CheckStatusEnum.Endorsed, + endorsedTo, + lastModificationTime: new Date(), + } + : check + ) + ); + console.log("Check endorsed:", id, endorsedTo); + }; + + const handleEndorseNote = (id: string, endorsedTo: string) => { + setPromissoryNotes((prev) => + prev.map((note) => + note.id === id + ? { + ...note, + status: NoteStatusEnum.Endorsed, + endorsedTo, + lastModificationTime: new Date(), + } + : note + ) + ); + console.log("Promissory note endorsed:", id, endorsedTo); + }; + + return ( + + ); +}; + +export default CheckNotePage; diff --git a/ui/src/views/accounting/CurrentAccountPage.tsx b/ui/src/views/accounting/CurrentAccountPage.tsx new file mode 100644 index 00000000..4571f994 --- /dev/null +++ b/ui/src/views/accounting/CurrentAccountPage.tsx @@ -0,0 +1,15 @@ +import React from "react"; +import CurrentAccountManagement from "./components/CurrentAccountManagement"; +import { mockCurrentAccounts } from "../../mocks/mockCurrentAccounts"; +import { mockCurrentAccountMovements } from "../../mocks/mockCurrentAccountMovements"; + +const CurrentAccountPage: React.FC = () => { + return ( + + ); +}; + +export default CurrentAccountPage; diff --git a/ui/src/views/accounting/InvoicePage.tsx b/ui/src/views/accounting/InvoicePage.tsx new file mode 100644 index 00000000..af827364 --- /dev/null +++ b/ui/src/views/accounting/InvoicePage.tsx @@ -0,0 +1,180 @@ +import React, { useState } from "react"; +import InvoiceManagement from "./components/InvoiceManagement"; +import InvoiceForm from "./components/InvoiceForm"; +import InvoiceDetails from "./components/InvoiceDetails"; +import PaymentForm from "./components/PaymentForm"; +import WaybillToInvoice from "./components/WaybillToInvoice"; +import { + FiInvoice, + PaymentMethodEnum, + PaymentStatusEnum, +} from "../../types/fi"; +import { mockInvoices } from "../../mocks/mockInvoices"; + +interface PaymentData { + amount: number; + paymentDate: Date; + paymentMethod: PaymentMethodEnum; + description: string; + referenceNumber?: string; +} + +const InvoicePage: React.FC = () => { + const [invoices, setInvoices] = useState(mockInvoices); + const [showInvoiceForm, setShowInvoiceForm] = useState(false); + const [showInvoiceDetails, setShowInvoiceDetails] = useState(false); + const [showPaymentForm, setShowPaymentForm] = useState(false); + const [showWaybillToInvoice, setShowWaybillToInvoice] = useState(false); + const [selectedInvoice, setSelectedInvoice] = useState( + null + ); + const [editingInvoice, setEditingInvoice] = useState(null); + + const handleAdd = () => { + setEditingInvoice(null); + setShowInvoiceForm(true); + }; + + const handleEdit = (invoice: FiInvoice) => { + setEditingInvoice(invoice); + setShowInvoiceForm(true); + }; + + const handleCreatePayment = (invoice: FiInvoice) => { + setSelectedInvoice(invoice); + setShowPaymentForm(true); + }; + + const handleViewDetails = (invoice: FiInvoice) => { + setSelectedInvoice(invoice); + setShowInvoiceDetails(true); + }; + + const handleConvertFromWaybill = () => { + setShowWaybillToInvoice(true); + }; + + const handleSaveInvoice = (invoiceData: Partial) => { + if (editingInvoice) { + // Güncelleme + setInvoices((prev) => + prev.map((inv) => + inv.id === editingInvoice.id + ? { ...inv, ...invoiceData, lastModificationTime: new Date() } + : inv + ) + ); + } else { + // Yeni ekleme + const newInvoice: FiInvoice = { + id: Date.now().toString(), + creationTime: new Date(), + lastModificationTime: new Date(), + ...invoiceData, + } as FiInvoice; + setInvoices((prev) => [newInvoice, ...prev]); + } + setShowInvoiceForm(false); + setEditingInvoice(null); + }; + + const handleSavePayment = (paymentData: PaymentData) => { + if (!selectedInvoice) return; + + // Ödeme bilgilerini faturaya ekle + const updatedInvoice = { + ...selectedInvoice, + paidAmount: selectedInvoice.paidAmount + paymentData.amount, + remainingAmount: selectedInvoice.remainingAmount - paymentData.amount, + paymentStatus: + selectedInvoice.remainingAmount - paymentData.amount <= 0 + ? PaymentStatusEnum.Paid + : PaymentStatusEnum.PartiallyPaid, + lastModificationTime: new Date(), + }; + + setInvoices((prev) => + prev.map((inv) => (inv.id === selectedInvoice.id ? updatedInvoice : inv)) + ); + + setShowPaymentForm(false); + setSelectedInvoice(null); + + // Başarı mesajı + alert( + `${paymentData.amount.toLocaleString("tr-TR", { + style: "currency", + currency: "TRY", + })} tutarında ödeme kaydedildi.` + ); + }; + + const handleSaveFromWaybill = () => { + setShowWaybillToInvoice(false); + alert("İrsaliyelerden fatura başarıyla oluşturuldu."); + }; + + const handleCancelForm = () => { + setShowInvoiceForm(false); + setEditingInvoice(null); + }; + + const handleCancelDetails = () => { + setShowInvoiceDetails(false); + setSelectedInvoice(null); + }; + + const handleCancelPayment = () => { + setShowPaymentForm(false); + setSelectedInvoice(null); + }; + + const handleCancelWaybillToInvoice = () => { + setShowWaybillToInvoice(false); + }; + + return ( + <> + + + + + {selectedInvoice && ( + <> + + + + + )} + + + + ); +}; + +export default InvoicePage; diff --git a/ui/src/views/accounting/WaybillPage.tsx b/ui/src/views/accounting/WaybillPage.tsx new file mode 100644 index 00000000..5bfeef90 --- /dev/null +++ b/ui/src/views/accounting/WaybillPage.tsx @@ -0,0 +1,142 @@ +import React, { useState } from "react"; +import WaybillManagement from "./components/WaybillManagement"; +import WaybillForm from "./components/WaybillForm"; +import WaybillDetails from "./components/WaybillDetails"; +import WaybillToInvoice from "./components/WaybillToInvoice"; +import { FiWaybill, WaybillStatusEnum } from "../../types/fi"; +import { mockWaybills } from "../../mocks/mockWaybills"; + +type ViewType = "management" | "form" | "details" | "createInvoice"; + +const WaybillPage: React.FC = () => { + const [currentView, setCurrentView] = useState("management"); + const [waybills, setWaybills] = useState(mockWaybills); + const [selectedWaybill, setSelectedWaybill] = useState< + FiWaybill | undefined + >(); + + const handleAdd = () => { + setSelectedWaybill(undefined); + setCurrentView("form"); + }; + + const handleEdit = (waybill: FiWaybill) => { + setSelectedWaybill(waybill); + setCurrentView("form"); + }; + + const handleViewDetails = (waybill: FiWaybill) => { + setSelectedWaybill(waybill); + setCurrentView("details"); + }; + + const handleCreateInvoice = (waybill: FiWaybill) => { + setSelectedWaybill(waybill); + setCurrentView("createInvoice"); + }; + + const handleMarkAsDelivered = (waybill: FiWaybill) => { + setWaybills((prev) => + prev.map((w) => + w.id === waybill.id + ? { + ...w, + status: WaybillStatusEnum.Delivered, + lastModificationTime: new Date(), + } + : w + ) + ); + alert( + `${waybill.waybillNumber} numaralı irsaliye teslim edildi olarak işaretlendi.` + ); + }; + + const handleSaveWaybill = (waybillData: Partial) => { + if (selectedWaybill) { + // Update existing waybill + const updatedWaybills = waybills.map((w) => + w.id === selectedWaybill.id + ? { + ...selectedWaybill, + ...waybillData, + lastModificationTime: new Date(), + } + : w + ); + setWaybills(updatedWaybills); + } else { + // Create new waybill + const newWaybill: FiWaybill = { + ...(waybillData as FiWaybill), + id: Date.now().toString(), + creationTime: new Date(), + lastModificationTime: new Date(), + }; + setWaybills([...waybills, newWaybill]); + } + setCurrentView("management"); + setSelectedWaybill(undefined); + }; + + const handleCancel = () => { + setCurrentView("management"); + setSelectedWaybill(undefined); + }; + + const handleInvoiceCreated = () => { + // Mark waybill as invoiced + if (selectedWaybill) { + const updatedWaybills = waybills.map((w) => + w.id === selectedWaybill.id + ? { ...w, isInvoiced: true, lastModificationTime: new Date() } + : w + ); + setWaybills(updatedWaybills); + } + setCurrentView("management"); + setSelectedWaybill(undefined); + }; + + return ( + <> + {currentView === "management" && ( + + )} + + + + {selectedWaybill && ( + handleCreateInvoice(selectedWaybill)} + isVisible={currentView === "details"} + /> + )} + + {selectedWaybill && ( + + )} + + ); +}; + +export default WaybillPage; diff --git a/ui/src/views/accounting/components/BankAccountDetails.tsx b/ui/src/views/accounting/components/BankAccountDetails.tsx new file mode 100644 index 00000000..cba9db30 --- /dev/null +++ b/ui/src/views/accounting/components/BankAccountDetails.tsx @@ -0,0 +1,477 @@ +import React from "react"; +import { + FaBuilding, + FaTimes, + FaCreditCard, + FaMoneyBillWave, + FaUser, + FaCalendar, + FaTimesCircle, +} from "react-icons/fa"; +import { + FiBankMovement, + BankTransactionTypeEnum, + TransactionStatusEnum, +} from "../../../types/fi"; +import { BankAccount } from "../../../types/common"; +import { + getBankAccountTypeText, + getTransactionStatusText, + getTransactionTypeText, +} from "../../../utils/erp"; + +interface BankAccountDetailsProps { + account: BankAccount; + movements: FiBankMovement[]; + isOpen: boolean; + onClose: () => void; + onEdit: (account: BankAccount) => void; +} + +const BankAccountDetails: React.FC = ({ + account, + movements, + isOpen, + onClose, + onEdit, +}) => { + const formatCurrency = (amount: number) => { + return amount.toLocaleString("tr-TR", { + style: "currency", + currency: account.currency || "TRY", + minimumFractionDigits: 2, + }); + }; + + const formatIban = (iban: string) => { + return iban.replace(/(.{4})/g, "$1 ").trim(); + }; + + const formatDate = (date: Date | string) => { + return new Date(date).toLocaleDateString("tr-TR"); + }; + + // Calculate statistics + const accountMovements = movements.filter( + (m) => m.bankAccountId === account.id + ); + const totalIncoming = accountMovements + .filter((m) => + [ + BankTransactionTypeEnum.Deposit, + BankTransactionTypeEnum.Interest, + ].includes(m.transactionType) + ) + .reduce((sum, m) => sum + m.amount, 0); + + const totalOutgoing = accountMovements + .filter((m) => + [ + BankTransactionTypeEnum.Withdrawal, + BankTransactionTypeEnum.Transfer, + BankTransactionTypeEnum.EFT, + BankTransactionTypeEnum.Fee, + ].includes(m.transactionType) + ) + .reduce((sum, m) => sum + m.amount, 0); + + const pendingTransactions = accountMovements.filter( + (m) => m.status === TransactionStatusEnum.Pending + ); + const recentMovements = accountMovements + .sort( + (a, b) => + new Date(b.transactionDate).getTime() - + new Date(a.transactionDate).getTime() + ) + .slice(0, 10); + + const isNearOverdraftLimit = () => { + const usedLimit = Math.abs(Math.min(account.balance, 0)); + return ( + account.overdraftLimit > 0 && usedLimit > account.overdraftLimit * 0.8 + ); + }; + + if (!isOpen) return null; + + return ( +
+
+
+
+ +
+

+ Banka Hesap Detayları +

+

+ {account.bankName} - {account.accountNumber} +

+
+
+
+ + +
+
+ +
+ {/* Account Overview */} +
+
+
+
+

Güncel Bakiye

+

+ {formatCurrency(account.balance)} +

+
+ +
+
+ +
+
+
+

Toplam Gelen

+

+ {formatCurrency(totalIncoming)} +

+
+ +
+
+ +
+
+
+

Toplam Çıkan

+

+ {formatCurrency(totalOutgoing)} +

+
+ +
+
+ +
+
+
+

Bekleyen İşlem

+

+ {pendingTransactions.length} +

+
+ +
+
+
+ + {/* Alerts */} + {isNearOverdraftLimit() && ( +
+
+ +

+ Kredi Limiti Uyarısı +

+
+

+ Bu hesap kredi limitinin %80'ine yaklaşmış durumda. +

+
+ )} + +
+ {/* Account Information */} +
+
+

+ + Hesap Bilgileri +

+
+
+ Hesap Kodu: + {account.accountCode} +
+
+ Banka: + {account.bankName} +
+
+ Şube: + {account.branchName} +
+
+ Hesap No: + {account.accountNumber} +
+
+ IBAN: + + {formatIban(account.iban)} + +
+
+ Hesap Türü: + + {getBankAccountTypeText(account.accountType)} + +
+
+ Para Birimi: + + {account.currency} + +
+
+ Durum: + + {account.isActive ? "Aktif" : "Pasif"} + +
+
+
+ +
+

+ + Limitler +

+
+
+ Kredi Limiti: + + {formatCurrency(account.overdraftLimit)} + +
+
+ + Günlük Transfer Limiti: + + + {formatCurrency(account.dailyTransferLimit)} + +
+ {account.overdraftLimit > 0 && ( +
+ Kullanılan Kredi: + + {account.balance < 0 + ? formatCurrency(Math.abs(account.balance)) + : formatCurrency(0)} + +
+ )} +
+
+ + {(account.contactPerson || account.phone) && ( +
+

+ + İletişim Bilgileri +

+
+ {account.contactPerson && ( +
+ İletişim Kişisi: + + {account.contactPerson} + +
+ )} + {account.phone && ( +
+ Telefon: + {account.phone} +
+ )} +
+
+ )} + +
+

+ + Tarihler +

+
+
+ Oluşturulma: + + {formatDate(account.creationTime)} + +
+
+ Son Güncelleme: + + {formatDate(account.lastModificationTime)} + +
+
+
+
+ + {/* Recent Movements */} +
+
+

+ Son Hareketler ({recentMovements.length}) +

+ {recentMovements.length > 0 ? ( +
+ {recentMovements.map((movement) => { + const isIncoming = [ + BankTransactionTypeEnum.Deposit, + BankTransactionTypeEnum.Interest, + ].includes(movement.transactionType); + const isOutgoing = [ + BankTransactionTypeEnum.Withdrawal, + BankTransactionTypeEnum.Transfer, + BankTransactionTypeEnum.EFT, + BankTransactionTypeEnum.Fee, + ].includes(movement.transactionType); + + return ( +
+
+
+ + {getTransactionTypeText( + movement.transactionType + )} + + + {getTransactionStatusText(movement.status)} + +
+ + {isIncoming ? "+" : isOutgoing ? "-" : ""} + {formatCurrency(movement.amount)} + +
+
+ {movement.description} +
+
+ {formatDate(movement.transactionDate)} + {movement.referenceNumber && ( + Ref: {movement.referenceNumber} + )} +
+ {movement.recipientName && ( +
+ Alıcı: {movement.recipientName} +
+ )} +
+ ); + })} +
+ ) : ( +
+ +

Henüz hareket bulunmamaktadır.

+
+ )} +
+ + {pendingTransactions.length > 0 && ( +
+

+ + Bekleyen İşlemler ({pendingTransactions.length}) +

+
+ {pendingTransactions.slice(0, 5).map((movement) => ( +
+
+
+ {movement.description} +
+
+ {formatDate(movement.transactionDate)} +
+
+ + {formatCurrency(movement.amount)} + +
+ ))} + {pendingTransactions.length > 5 && ( +
+ ... ve {pendingTransactions.length - 5} işlem daha +
+ )} +
+
+ )} +
+
+
+
+
+ ); +}; + +export default BankAccountDetails; diff --git a/ui/src/views/accounting/components/BankAccountForm.tsx b/ui/src/views/accounting/components/BankAccountForm.tsx new file mode 100644 index 00000000..ac765e82 --- /dev/null +++ b/ui/src/views/accounting/components/BankAccountForm.tsx @@ -0,0 +1,467 @@ +import React, { useState, useEffect } from "react"; +import { FaSave, FaTimes, FaBuilding } from "react-icons/fa"; +import { BankAccountTypeEnum } from "../../../types/fi"; +import { BankAccount } from "../../../types/common"; + +interface BankAccountFormProps { + account?: BankAccount; + isOpen: boolean; + onClose: () => void; + onSave: (account: Partial) => void; +} + +const BankAccountForm: React.FC = ({ + account, + isOpen, + onClose, + onSave, +}) => { + const [formData, setFormData] = useState>({ + accountCode: "", + bankName: "", + branchName: "", + accountNumber: "", + iban: "", + accountType: BankAccountTypeEnum.Current, + currency: "TRY", + balance: 0, + overdraftLimit: 0, + dailyTransferLimit: 0, + contactPerson: "", + phone: "", + isActive: true, + }); + + const [errors, setErrors] = useState>({}); + + useEffect(() => { + if (account) { + setFormData(account); + } else { + setFormData({ + accountCode: "", + bankName: "", + branchName: "", + accountNumber: "", + iban: "", + accountType: BankAccountTypeEnum.Current, + currency: "TRY", + balance: 0, + overdraftLimit: 0, + dailyTransferLimit: 0, + contactPerson: "", + phone: "", + isActive: true, + }); + } + setErrors({}); + }, [account, isOpen]); + + const validateForm = () => { + const newErrors: Record = {}; + + if (!formData.accountCode?.trim()) { + newErrors.accountCode = "Hesap kodu gereklidir"; + } + + if (!formData.bankName?.trim()) { + newErrors.bankName = "Banka adı gereklidir"; + } + + if (!formData.branchName?.trim()) { + newErrors.branchName = "Şube adı gereklidir"; + } + + if (!formData.accountNumber?.trim()) { + newErrors.accountNumber = "Hesap numarası gereklidir"; + } + + if (!formData.iban?.trim()) { + newErrors.iban = "IBAN gereklidir"; + } else if (formData.iban.length < 26) { + newErrors.iban = "IBAN geçerli formatta olmalıdır"; + } + + if (!formData.currency?.trim()) { + newErrors.currency = "Para birimi gereklidir"; + } + + if ( + formData.dailyTransferLimit !== undefined && + formData.dailyTransferLimit < 0 + ) { + newErrors.dailyTransferLimit = "Günlük transfer limiti negatif olamaz"; + } + + if (formData.overdraftLimit !== undefined && formData.overdraftLimit < 0) { + newErrors.overdraftLimit = "Kredi limiti negatif olamaz"; + } + + setErrors(newErrors); + return Object.keys(newErrors).length === 0; + }; + + const handleSubmit = (e: React.FormEvent) => { + e.preventDefault(); + if (validateForm()) { + onSave(formData); + } + }; + + const handleInputChange = ( + e: React.ChangeEvent< + HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement + > + ) => { + const { name, value, type } = e.target; + const parsedValue = type === "number" ? parseFloat(value) || 0 : value; + + setFormData((prev) => ({ + ...prev, + [name]: parsedValue, + })); + + // Clear error when user starts typing + if (errors[name]) { + setErrors((prev) => ({ + ...prev, + [name]: "", + })); + } + }; + + const handleCheckboxChange = (e: React.ChangeEvent) => { + const { name, checked } = e.target; + setFormData((prev) => ({ + ...prev, + [name]: checked, + })); + }; + + const handleIbanChange = (e: React.ChangeEvent) => { + let value = e.target.value; + + // Sadece harf ve rakam kalsın + value = value.replace(/[^A-Za-z0-9]/g, ""); + + // 4 karakterde bir boşluk ekle + value = value.replace(/(.{4})/g, "$1 ").trim(); + + setFormData({ + ...formData, + iban: value, + }); + }; + + if (!isOpen) return null; + + return ( +
+
+
+
+ +

+ {account ? "Banka Hesabını Düzenle" : "Yeni Banka Hesabı"} +

+
+ +
+ +
+
+ {/* Temel Bilgiler */} +
+

+ Temel Bilgiler +

+ +
+ + + {errors.accountCode && ( +

+ {errors.accountCode} +

+ )} +
+ +
+ + + {errors.bankName && ( +

{errors.bankName}

+ )} +
+ +
+ + + {errors.branchName && ( +

+ {errors.branchName} +

+ )} +
+ +
+ + +
+ +
+ + + {errors.currency && ( +

{errors.currency}

+ )} +
+
+ + {/* Hesap Detayları */} +
+

+ Hesap Detayları +

+ +
+ + + {errors.accountNumber && ( +

+ {errors.accountNumber} +

+ )} +
+ +
+ + + {errors.iban && ( +

{errors.iban}

+ )} +
+ +
+ + +
+ +
+ + + {errors.overdraftLimit && ( +

+ {errors.overdraftLimit} +

+ )} +
+ +
+ + + {errors.dailyTransferLimit && ( +

+ {errors.dailyTransferLimit} +

+ )} +
+
+ + {/* İletişim Bilgileri */} +
+

+ İletişim Bilgileri +

+ +
+
+ + +
+ +
+ + +
+
+ +
+ + +
+
+
+ + {/* Form Actions */} +
+ + +
+
+
+
+ ); +}; + +export default BankAccountForm; diff --git a/ui/src/views/accounting/components/BankManagement.tsx b/ui/src/views/accounting/components/BankManagement.tsx new file mode 100644 index 00000000..569729c9 --- /dev/null +++ b/ui/src/views/accounting/components/BankManagement.tsx @@ -0,0 +1,676 @@ +import React, { useState } from "react"; +import { + FaBuilding, + FaPlus, + FaSearch, + FaExclamationTriangle, + FaCalendar, + FaEdit, +} from "react-icons/fa"; +import { + FiBankMovement, + BankTransactionTypeEnum, + TransactionStatusEnum, +} from "../../../types/fi"; +import DataTable, { Column } from "../../../components/common/DataTable"; +import { BankAccount } from "../../../types/common"; +import Widget from "../../../components/common/Widget"; +import { + getBankAccountTypeColor, + getBankAccountTypeText, + getTransactionStatusColor, + getTransactionStatusText, + getTransactionTypeColor, + getTransactionTypeText, +} from "../../../utils/erp"; + +interface BankManagementProps { + bankAccounts: BankAccount[]; + bankMovements: FiBankMovement[]; + onAddAccount: () => void; + onEditAccount: (account: BankAccount) => void; + onAddMovement: () => void; + onEditMovement: (movement: FiBankMovement) => void; + onViewDetails: (account: BankAccount) => void; +} + +const BankManagement: React.FC = ({ + bankAccounts, + bankMovements, + onAddAccount, + onEditAccount, + onAddMovement, + onEditMovement, + onViewDetails, +}) => { + const [activeTab, setActiveTab] = useState<"accounts" | "movements">( + "accounts" + ); + const [searchTerm, setSearchTerm] = useState(""); + const [selectedTransactionType, setSelectedTransactionType] = useState< + BankTransactionTypeEnum | "all" + >("all"); + const [selectedStatus, setSelectedStatus] = useState< + TransactionStatusEnum | "all" + >("all"); + const [sortBy, setSortBy] = useState<"date" | "amount">("date"); + + const filteredAccounts = bankAccounts.filter((account) => { + if ( + searchTerm && + !account.bankName.toLowerCase().includes(searchTerm.toLowerCase()) && + !account.accountNumber.toLowerCase().includes(searchTerm.toLowerCase()) && + !account.iban.toLowerCase().includes(searchTerm.toLowerCase()) + ) { + return false; + } + return true; + }); + + const filteredMovements = bankMovements + .filter((movement) => { + if ( + searchTerm && + !movement.description + .toLowerCase() + .includes(searchTerm.toLowerCase()) && + !movement.referenceNumber + ?.toLowerCase() + .includes(searchTerm.toLowerCase()) && + !movement.bankAccount?.bankName + ?.toLowerCase() + .includes(searchTerm.toLowerCase()) && + !movement.recipientName + ?.toLowerCase() + .includes(searchTerm.toLowerCase()) + ) { + return false; + } + if ( + selectedTransactionType !== "all" && + movement.transactionType !== selectedTransactionType + ) { + return false; + } + if (selectedStatus !== "all" && movement.status !== selectedStatus) { + return false; + } + return true; + }) + .sort((a, b) => { + switch (sortBy) { + case "date": + return ( + new Date(b.transactionDate).getTime() - + new Date(a.transactionDate).getTime() + ); + case "amount": + return b.amount - a.amount; + default: + return 0; + } + }); + + const formatCurrency = (amount: number) => { + return amount.toLocaleString("tr-TR", { + style: "currency", + currency: "TRY", + minimumFractionDigits: 2, + }); + }; + + const formatIban = (iban: string) => { + return iban.replace(/(.{4})/g, "$1 ").trim(); + }; + + const isNearOverdraftLimit = (account: BankAccount) => { + const usedLimit = Math.abs(Math.min(account.balance, 0)); + return ( + account.overdraftLimit > 0 && usedLimit > account.overdraftLimit * 0.8 + ); + }; + + const accountColumns: Column[] = [ + { + key: "bankInfo", + header: "Banka Bilgileri", + render: (account: BankAccount) => ( +
+
{account.bankName}
+
{account.branchName}
+
+ Kod: {account.accountCode} +
+
+ ), + }, + { + key: "accountDetails", + header: "Hesap Detayları", + render: (account: BankAccount) => ( +
+
{account.accountNumber}
+
+ {formatIban(account.iban)} +
+
+ ), + }, + { + key: "type", + header: "Tür", + render: (account: BankAccount) => ( + + {getBankAccountTypeText(account.accountType)} + + ), + }, + { + key: "currency", + header: "Para Birimi", + render: (account: BankAccount) => ( + + {account.currency} + + ), + }, + { + key: "balance", + header: "Bakiye", + sortable: true, + render: (account: BankAccount) => { + const isOverdraft = account.balance < 0; + const isNearLimit = isNearOverdraftLimit(account); + + return ( +
+
+ {formatCurrency(account.balance)} +
+ {account.overdraftLimit > 0 && ( +
+ Limit: {formatCurrency(account.overdraftLimit)} + {isNearLimit && ( + ⚠️ + )} +
+ )} +
+ ); + }, + }, + { + key: "limits", + header: "Limitler", + render: (account: BankAccount) => ( +
+
Günlük Transfer:
+
+ {formatCurrency(account.dailyTransferLimit)} +
+
+ ), + }, + { + key: "contact", + header: "İletişim", + render: (account: BankAccount) => ( +
+ {account.contactPerson && ( +
{account.contactPerson}
+ )} + {account.phone && ( +
{account.phone}
+ )} +
+ ), + }, + { + key: "status", + header: "Durum", + render: (account: BankAccount) => ( + + {account.isActive ? "Aktif" : "Pasif"} + + ), + }, + { + key: "actions", + header: "İşlemler", + render: (account: BankAccount) => ( +
+ + +
+ ), + }, + ]; + + const movementColumns: Column[] = [ + { + key: "dates", + header: "Tarihler", + sortable: true, + render: (movement: FiBankMovement) => ( +
+
+ İşlem:{" "} + {new Date(movement.transactionDate).toLocaleDateString("tr-TR")} +
+
+ Valör: {new Date(movement.valueDate).toLocaleDateString("tr-TR")} +
+
+ ), + }, + { + key: "bankAccount", + header: "Banka Hesabı", + render: (movement: FiBankMovement) => ( +
+
+ {movement.bankAccount?.bankName || "Bilinmeyen"} +
+
+ {movement.bankAccount?.accountNumber} +
+
+ ), + }, + { + key: "type", + header: "İşlem Türü", + render: (movement: FiBankMovement) => ( + + {getTransactionTypeText(movement.transactionType)} + + ), + }, + { + key: "description", + header: "Açıklama", + render: (movement: FiBankMovement) => ( +
+
+ {movement.description} +
+ {movement.referenceNumber && ( +
+ Ref: {movement.referenceNumber} +
+ )} + {movement.recipientName && ( +
+ Alıcı: {movement.recipientName} +
+ )} +
+ ), + }, + { + key: "amount", + header: "Tutar", + sortable: true, + render: (movement: FiBankMovement) => { + const isIncoming = [ + BankTransactionTypeEnum.Deposit, + BankTransactionTypeEnum.Interest, + ].includes(movement.transactionType); + const isOutgoing = [ + BankTransactionTypeEnum.Withdrawal, + BankTransactionTypeEnum.Transfer, + BankTransactionTypeEnum.EFT, + BankTransactionTypeEnum.Fee, + ].includes(movement.transactionType); + + return ( +
+ + {isIncoming ? "+" : isOutgoing ? "-" : ""} + {formatCurrency(movement.amount)} + +
+ ); + }, + }, + { + key: "status", + header: "Durum", + render: (movement: FiBankMovement) => ( + + {getTransactionStatusText(movement.status)} + + ), + }, + { + key: "currentAccount", + header: "Cari Hesap", + render: (movement: FiBankMovement) => ( +
+ {movement.currentAccount?.accountCode || "-"} +
+ ), + }, + { + key: "actions", + header: "İşlemler", + render: (movement: FiBankMovement) => ( +
+ +
+ ), + }, + ]; + + // Calculate statistics + const totalBankBalance = bankAccounts.reduce( + (sum, account) => sum + account.balance, + 0 + ); + const activeBankAccounts = bankAccounts.filter( + (account) => account.isActive + ).length; + const totalOverdraftLimit = bankAccounts.reduce( + (sum, account) => sum + account.overdraftLimit, + 0 + ); + + const todayMovements = bankMovements.filter((movement) => { + const today = new Date(); + const movementDate = new Date(movement.transactionDate); + return movementDate.toDateString() === today.toDateString(); + }); + + const todayIncoming = todayMovements + .filter((m) => + [ + BankTransactionTypeEnum.Deposit, + BankTransactionTypeEnum.Interest, + ].includes(m.transactionType) + ) + .reduce((sum, m) => sum + m.amount, 0); + + const todayOutgoing = todayMovements + .filter((m) => + [ + BankTransactionTypeEnum.Withdrawal, + BankTransactionTypeEnum.Transfer, + BankTransactionTypeEnum.EFT, + BankTransactionTypeEnum.Fee, + ].includes(m.transactionType) + ) + .reduce((sum, m) => sum + m.amount, 0); + + // Accounts near overdraft limit + const accountsNearLimit = bankAccounts.filter(isNearOverdraftLimit); + + // Pending transactions + const pendingTransactions = bankMovements.filter( + (m) => m.status === TransactionStatusEnum.Pending + ); + + return ( +
+ {/* Header */} +
+
+

Banka Yönetimi

+

+ Banka hesapları ve EFT/Havale işlemleri +

+
+
+ + +
+
+ + {/* Stats Cards */} +
+ + + + +
+ + {/* Alerts */} + {(accountsNearLimit.length > 0 || pendingTransactions.length > 0) && ( +
+ {accountsNearLimit.length > 0 && ( +
+
+ +

+ Kredi Limiti Uyarısı +

+
+

+ {accountsNearLimit.length} hesap kredi limitinin %80'ine + yaklaşmış durumda. +

+
+ )} + + {pendingTransactions.length > 0 && ( +
+
+ +

+ Bekleyen İşlemler +

+
+

+ {pendingTransactions.length} adet bekleyen banka işlemi + bulunmaktadır. +

+
+ )} +
+ )} + + {/* Tabs */} +
+ +
+ + {/* Filters */} +
+
+ + setSearchTerm(e.target.value)} + className="w-full pl-10 pr-3 py-1.5 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" + /> +
+ + {activeTab === "movements" && ( + <> + + + + + + + )} +
+ + {/* Data Table */} +
+ {activeTab === "accounts" ? ( + + ) : ( + + )} +
+ + {/* Empty State */} + {((activeTab === "accounts" && filteredAccounts.length === 0) || + (activeTab === "movements" && filteredMovements.length === 0)) && ( +
+ +

+ {activeTab === "accounts" + ? "Banka hesabı bulunamadı" + : "Banka hareketi bulunamadı"} +

+

+ {activeTab === "accounts" + ? "Yeni bir banka hesabı ekleyin veya arama kriterlerinizi değiştirin." + : "Yeni bir banka hareketi ekleyin veya arama kriterlerinizi değiştirin."} +

+
+ )} +
+ ); +}; + +export default BankManagement; diff --git a/ui/src/views/accounting/components/BankMovementForm.tsx b/ui/src/views/accounting/components/BankMovementForm.tsx new file mode 100644 index 00000000..beae074c --- /dev/null +++ b/ui/src/views/accounting/components/BankMovementForm.tsx @@ -0,0 +1,524 @@ +import React, { useState, useEffect } from "react"; +import { FaSave, FaTimes, FaExchangeAlt } from "react-icons/fa"; +import { + FiBankMovement, + BankTransactionTypeEnum, + TransactionStatusEnum, + FiCurrentAccount, +} from "../../../types/fi"; +import { BankAccount } from "../../../types/common"; +import { + getTransactionStatusText, + getTransactionTypeText, +} from "../../../utils/erp"; + +interface BankMovementFormProps { + movement?: FiBankMovement; + bankAccounts: BankAccount[]; + currentAccounts?: FiCurrentAccount[]; + isOpen: boolean; + onClose: () => void; + onSave: (movement: Partial) => void; +} + +const BankMovementForm: React.FC = ({ + movement, + bankAccounts, + currentAccounts = [], + isOpen, + onClose, + onSave, +}) => { + const [formData, setFormData] = useState< + Partial & { + transactionDateString?: string; + valueDateString?: string; + } + >({ + bankAccountId: "", + transactionDateString: new Date().toISOString().split("T")[0], + valueDateString: new Date().toISOString().split("T")[0], + description: "", + referenceNumber: "", + transactionType: BankTransactionTypeEnum.Deposit, + amount: 0, + currency: "TRY", + recipientName: "", + recipientIban: "", + recipientBank: "", + currentAccountId: "", + status: TransactionStatusEnum.Pending, + }); + + const [errors, setErrors] = useState>({}); + + useEffect(() => { + if (movement) { + setFormData({ + ...movement, + transactionDateString: new Date(movement.transactionDate) + .toISOString() + .split("T")[0], + valueDateString: new Date(movement.valueDate) + .toISOString() + .split("T")[0], + }); + } else { + setFormData({ + bankAccountId: "", + transactionDateString: new Date().toISOString().split("T")[0], + valueDateString: new Date().toISOString().split("T")[0], + description: "", + referenceNumber: "", + transactionType: BankTransactionTypeEnum.Deposit, + amount: 0, + currency: "TRY", + recipientName: "", + recipientIban: "", + recipientBank: "", + currentAccountId: "", + status: TransactionStatusEnum.Pending, + }); + } + setErrors({}); + }, [movement, isOpen]); + + const validateForm = () => { + const newErrors: Record = {}; + + if (!formData.bankAccountId) { + newErrors.bankAccountId = "Banka hesabı seçmelisiniz"; + } + + if (!formData.description?.trim()) { + newErrors.description = "Açıklama gereklidir"; + } + + if (!formData.amount || formData.amount <= 0) { + newErrors.amount = "Tutar 0'dan büyük olmalıdır"; + } + + if (!formData.transactionDateString) { + newErrors.transactionDate = "İşlem tarihi gereklidir"; + } + + if (!formData.valueDateString) { + newErrors.valueDate = "Valör tarihi gereklidir"; + } + + // EFT/Transfer için alıcı bilgileri kontrol et + if ( + [BankTransactionTypeEnum.EFT, BankTransactionTypeEnum.Transfer].includes( + formData.transactionType! + ) + ) { + if (!formData.recipientName?.trim()) { + newErrors.recipientName = "Alıcı adı gereklidir"; + } + if (!formData.recipientIban?.trim()) { + newErrors.recipientIban = "Alıcı IBAN gereklidir"; + } + } + + setErrors(newErrors); + return Object.keys(newErrors).length === 0; + }; + + const handleSubmit = (e: React.FormEvent) => { + e.preventDefault(); + if (validateForm()) { + const selectedBankAccount = bankAccounts.find( + (acc) => acc.id === formData.bankAccountId + ); + onSave({ + ...formData, + transactionDate: new Date(formData.transactionDateString!), + valueDate: new Date(formData.valueDateString!), + currency: selectedBankAccount?.currency || formData.currency, + }); + } + }; + + const handleInputChange = ( + e: React.ChangeEvent< + HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement + > + ) => { + const { name, value, type } = e.target; + const parsedValue = type === "number" ? parseFloat(value) || 0 : value; + + setFormData((prev) => ({ + ...prev, + [name]: parsedValue, + })); + + // Update currency when bank account changes + if (name === "bankAccountId") { + const selectedAccount = bankAccounts.find((acc) => acc.id === value); + if (selectedAccount) { + setFormData((prev) => ({ + ...prev, + bankAccountId: value, + currency: selectedAccount.currency, + })); + } + } + + // Clear error when user starts typing + if (errors[name]) { + setErrors((prev) => ({ + ...prev, + [name]: "", + })); + } + }; + + const formatIban = (iban: string) => { + const cleaned = iban.replace(/\s/g, "").toUpperCase(); + return cleaned.replace(/(.{4})/g, "$1 ").trim(); + }; + + const handleIbanChange = (e: React.ChangeEvent) => { + const formatted = formatIban(e.target.value); + setFormData((prev) => ({ + ...prev, + recipientIban: formatted, + })); + + if (errors.recipientIban) { + setErrors((prev) => ({ + ...prev, + recipientIban: "", + })); + } + }; + + const isTransferType = [ + BankTransactionTypeEnum.EFT, + BankTransactionTypeEnum.Transfer, + ].includes(formData.transactionType!); + + if (!isOpen) return null; + + return ( +
+
+
+
+ +

+ {movement ? "Banka Hareketini Düzenle" : "Yeni Banka Hareketi"} +

+
+ +
+ +
+
+ {/* Temel Bilgiler */} +
+

+ Temel Bilgiler +

+ +
+ + + {errors.bankAccountId && ( +

+ {errors.bankAccountId} +

+ )} +
+ +
+ + +
+ +
+
+ + + {errors.transactionDate && ( +

+ {errors.transactionDate} +

+ )} +
+ +
+ + + {errors.valueDate && ( +

+ {errors.valueDate} +

+ )} +
+
+ +
+ +