diff --git a/api/src/Erp.Platform.Application.Contracts/Intranet/IntranetDashboardDto.cs b/api/src/Erp.Platform.Application.Contracts/Intranet/IntranetDashboardDto.cs index e98c605c..22446f1c 100644 --- a/api/src/Erp.Platform.Application.Contracts/Intranet/IntranetDashboardDto.cs +++ b/api/src/Erp.Platform.Application.Contracts/Intranet/IntranetDashboardDto.cs @@ -19,6 +19,7 @@ public class IntranetDashboardDto public List Overtimes { get; set; } = []; public List Surveys { get; set; } = []; public List SocialPosts { get; set; } = []; + public List Tasks { get; set; } = []; } diff --git a/api/src/Erp.Platform.Application.Contracts/Intranet/ProjectTaskDto.cs b/api/src/Erp.Platform.Application.Contracts/Intranet/ProjectTaskDto.cs new file mode 100644 index 00000000..d38100ee --- /dev/null +++ b/api/src/Erp.Platform.Application.Contracts/Intranet/ProjectTaskDto.cs @@ -0,0 +1,29 @@ +using System; +using Volo.Abp.Application.Dtos; + +namespace Erp.Platform.Intranet; + +public class ProjectTaskDto : FullAuditedEntityDto +{ + public Guid? TenantId { get; set; } + + public Guid? ProjectId { get; set; } + public Guid? PhaseId { get; set; } + + public string Name { get; set; } + public string Description { get; set; } + + public string? TaskTypeId { get; set; } + + public string Priority { get; set; } + public string? StatusId { get; set; } + + public Guid? EmployeeId { get; set; } + public EmployeeDto Employee { get; set; } + + public DateTime StartDate { get; set; } + public DateTime EndDate { get; set; } + + public int Progress { get; set; } + public bool IsActive { get; set; } +} diff --git a/api/src/Erp.Platform.Application/Intranet/IntranetAppService.cs b/api/src/Erp.Platform.Application/Intranet/IntranetAppService.cs index dd3638aa..bb44be79 100644 --- a/api/src/Erp.Platform.Application/Intranet/IntranetAppService.cs +++ b/api/src/Erp.Platform.Application/Intranet/IntranetAppService.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; -using ClosedXML; using Erp.Platform.BlobStoring; using Erp.Platform.Entities; using Erp.Platform.FileManagement; @@ -38,6 +37,7 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService private readonly IRepository _overtimeRepository; private readonly IRepository _surveyRepository; private readonly IRepository _socialPostRepository; + private readonly IRepository _projectTaskRepository; public IntranetAppService( ICurrentTenant currentTenant, @@ -57,7 +57,8 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService IRepository leaveRepository, IRepository overtimeRepository, IRepository surveyRepository, - IRepository socialPostRepository + IRepository socialPostRepository, + IRepository projectTaskRepository ) { _currentTenant = currentTenant; @@ -78,6 +79,8 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService _overtimeRepository = overtimeRepository; _surveyRepository = surveyRepository; _socialPostRepository = socialPostRepository; + + _projectTaskRepository = projectTaskRepository; } public async Task GetIntranetDashboardAsync() @@ -97,10 +100,23 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService Leaves = await GetLeavesAsync(), Overtimes = await GetOvertimesAsync(), Surveys = await GetSurveysAsync(), - SocialPosts = await GetSocialPostsAsync() + SocialPosts = await GetSocialPostsAsync(), + Tasks = await GetProjectTasksAsync() }; } + private async Task> GetProjectTasksAsync() + { + var tasks = await _projectTaskRepository + .WithDetailsAsync(e => e.Employee) + .ContinueWith(t => t.Result.Where(s => s.Priority == "High" || s.Priority == "Urgent") + .OrderByDescending(s => s.StartDate) + .Take(3) + .ToList()); + + return ObjectMapper.Map, List>(tasks); + } + private async Task> GetSocialPostsAsync() { var socialPosts = await _socialPostRepository @@ -125,8 +141,6 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService private async Task> GetOvertimesAsync() { - var today = DateTime.Now; - var overtimes = await _overtimeRepository .WithDetailsAsync(e => e.Employee) .ContinueWith(t => t.Result.ToList()); @@ -136,8 +150,6 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService private async Task> GetLeavesAsync() { - var today = DateTime.Now; - var leaves = await _leaveRepository .WithDetailsAsync(e => e.Employee) .ContinueWith(t => t.Result.ToList()); diff --git a/api/src/Erp.Platform.Application/Intranet/IntranetAutoMapperProfile.cs b/api/src/Erp.Platform.Application/Intranet/IntranetAutoMapperProfile.cs index 255fadc1..a4c2f450 100644 --- a/api/src/Erp.Platform.Application/Intranet/IntranetAutoMapperProfile.cs +++ b/api/src/Erp.Platform.Application/Intranet/IntranetAutoMapperProfile.cs @@ -40,6 +40,8 @@ public class IntranetAutoMapperProfile : Profile CreateMap(); CreateMap(); CreateMap(); + + CreateMap(); } } diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json b/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json index 6d953ae8..689b5e63 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json @@ -454,510 +454,6 @@ "componentPath": "@/views/coordinator/ExamInterface/PDFTestInterface", "routeType": "protected", "authority": ["App.Coordinator.Tests"] - }, - { - "key": "admin.supplychain.requests", - "path": "/admin/supplychain/requests", - "componentPath": "@/views/supplychain/components/PurchaseRequests", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.supplychain.requestsNew", - "path": "/admin/supplychain/requests/new", - "componentPath": "@/views/supplychain/components/PurchaseRequestForm", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.supplychain.requestsEdit", - "path": "/admin/supplychain/requests/edit/:id", - "componentPath": "@/views/supplychain/components/PurchaseRequestForm", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.supplychain.requestsView", - "path": "/admin/supplychain/requests/view/:id", - "componentPath": "@/views/supplychain/components/PurchaseRequestForm", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.supplychain.quotations", - "path": "/admin/supplychain/quotations", - "componentPath": "@/views/supplychain/components/QuotationManagement", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.supplychain.quotationsNew", - "path": "/admin/supplychain/quotations/new", - "componentPath": "@/views/supplychain/components/QuotationForm", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.supplychain.quotationsEdit", - "path": "/admin/supplychain/quotations/edit/:id", - "componentPath": "@/views/supplychain/components/QuotationForm", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.supplychain.quotationsView", - "path": "/admin/supplychain/quotations/view/:id", - "componentPath": "@/views/supplychain/components/QuotationForm", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.supplychain.orders", - "path": "/admin/supplychain/orders", - "componentPath": "@/views/supplychain/components/OrderManagement", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.supplychain.ordersNew", - "path": "/admin/supplychain/orders/new", - "componentPath": "@/views/supplychain/components/OrderManagementForm", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.supplychain.ordersEdit", - "path": "/admin/supplychain/orders/edit/:id", - "componentPath": "@/views/supplychain/components/OrderManagementForm", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.supplychain.ordersView", - "path": "/admin/supplychain/orders/view/:id", - "componentPath": "@/views/supplychain/components/OrderManagementForm", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.supplychain.delivery", - "path": "/admin/supplychain/delivery", - "componentPath": "@/views/supplychain/components/DeliveryTracking", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.maintenance.equipment", - "path": "/admin/maintenance/equipment", - "componentPath": "@/views/maintenance/components/WorkCenterCards", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.maintenance.equipmentNew", - "path": "/admin/maintenance/equipment/new", - "componentPath": "@/views/maintenance/components/WorkCenterCards", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.maintenance.equipmentEdit", - "path": "/admin/maintenance/equipment/edit/:id", - "componentPath": "@/views/maintenance/components/WorkCenterCards", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.maintenance.equipmentDetail", - "path": "/admin/maintenance/equipment/:id", - "componentPath": "@/views/maintenance/components/WorkCenterCards", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.maintenance.workcenters", - "path": "/admin/maintenance/workcenters", - "componentPath": "@/views/maintenance/components/WorkCenterCards", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.maintenance.plans", - "path": "/admin/maintenance/plans", - "componentPath": "@/views/maintenance/components/MaintenancePlans", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.maintenance.calendar", - "path": "/admin/maintenance/calendar", - "componentPath": "@/views/maintenance/components/MaintenanceCalendar", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.maintenance.teams", - "path": "/admin/maintenance/teams", - "componentPath": "@/views/maintenance/components/MaintenanceTeams", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.maintenance.faults", - "path": "/admin/maintenance/faults", - "componentPath": "@/views/maintenance/components/FaultNotifications", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.maintenance.workorders", - "path": "/admin/maintenance/workorders", - "componentPath": "@/views/maintenance/components/MaintenanceWorkOrders", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.maintenance.workordersNew", - "path": "/admin/maintenance/workorders/new", - "componentPath": "@/views/maintenance/components/MaintenanceWorkOrders", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.maintenance.workordersDetail", - "path": "/admin/maintenance/workorders/:id", - "componentPath": "@/views/maintenance/components/MaintenanceWorkOrders", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.warehouse.definitions", - "path": "/admin/warehouse/definitions", - "componentPath": "@/views/warehouse/components/WarehouseDefinitions", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.warehouse.putaway", - "path": "/admin/warehouse/putaway", - "componentPath": "@/views/warehouse/components/PutawayRules", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.warehouse.receipt", - "path": "/admin/warehouse/receipt", - "componentPath": "@/views/warehouse/components/WarehouseReceipt", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.warehouse.issue", - "path": "/admin/warehouse/issue", - "componentPath": "@/views/warehouse/components/WarehouseIssue", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.warehouse.transfer", - "path": "/admin/warehouse/transfer", - "componentPath": "@/views/warehouse/components/WarehouseTransfer", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.warehouse.inventory", - "path": "/admin/warehouse/inventory", - "componentPath": "@/views/warehouse/components/StockLevelsInventory", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.warehouse.movements", - "path": "/admin/warehouse/movements", - "componentPath": "@/views/warehouse/components/MaterialMovements", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.warehouse.movementDetail", - "path": "/admin/warehouse/movements/:id", - "componentPath": "@/views/warehouse/components/MaterialMovements", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.warehouse.stocklevel", - "path": "/admin/warehouse/stocklevel", - "componentPath": "@/views/warehouse/components/InventoryTracking", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.warehouse.warehouses", - "path": "/admin/warehouse/warehouses", - "componentPath": "@/views/warehouse/components/WarehouseDefinitions", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.warehouse.warehouseNew", - "path": "/admin/warehouse/new", - "componentPath": "@/views/warehouse/components/WarehouseDefinitions", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.warehouse.warehouseEdit", - "path": "/admin/warehouse/edit/:id", - "componentPath": "@/views/warehouse/components/WarehouseDefinitions", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.warehouse.warehouseDetail", - "path": "/admin/warehouse/warehouses/:id", - "componentPath": "@/views/warehouse/components/WarehouseDefinitions", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.project.list", - "path": "/admin/projects", - "componentPath": "@/views/project/components/ProjectList", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.project.new", - "path": "/admin/projects/new", - "componentPath": "@/views/project/components/ProjectForm", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.project.edit", - "path": "/admin/projects/edit/:id", - "componentPath": "@/views/project/components/ProjectForm", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.project.detail", - "path": "/admin/projects/:id", - "componentPath": "@/views/project/components/ProjectView", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.project.tasks", - "path": "/admin/projects/tasks", - "componentPath": "@/views/project/components/ProjectTasks", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.project.phases", - "path": "/admin/projects/phases", - "componentPath": "@/views/project/components/ProjectPhases", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.project.activities", - "path": "/admin/projects/activities", - "componentPath": "@/views/project/components/ActivityTypes", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.project.workload", - "path": "/admin/projects/workload", - "componentPath": "@/views/project/components/ProjectGantt", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.project.costTracking", - "path": "/admin/projects/cost-tracking", - "componentPath": "@/views/project/components/CostTimeTracking", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.project.dailyUpdates", - "path": "/admin/projects/daily-updates", - "componentPath": "@/views/project/components/TaskDailyUpdates", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.crm.activities", - "path": "/admin/crm/activities", - "componentPath": "@/views/crm/components/ActivityRecords", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.crm.salesOrders", - "path": "/admin/crm/sales-orders", - "componentPath": "@/views/crm/components/SalesOrders", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.crm.salesOrdersNew", - "path": "/admin/crm/sales-orders/new", - "componentPath": "@/views/crm/components/SalesOrderForm", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.crm.salesOrdersEdit", - "path": "/admin/crm/sales-orders/edit/:id", - "componentPath": "@/views/crm/components/SalesOrderForm", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.crm.salesOrdersDetail", - "path": "/admin/crm/sales-orders/:id", - "componentPath": "@/views/crm/components/SalesOrderView", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.mrp.operationTypes", - "path": "/admin/mrp/operation-types", - "componentPath": "@/views/mrp/components/OperationTypes", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.mrp.workcenters", - "path": "/admin/mrp/workcenters", - "componentPath": "@/views/maintenance/components/WorkCenterCards", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.mrp.operations", - "path": "/admin/mrp/operations", - "componentPath": "@/views/mrp/components/OperationDefinitions", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.mrp.bom", - "path": "/admin/mrp/bom", - "componentPath": "@/views/mrp/components/BOMManagement", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.mrp.productionOrders", - "path": "/admin/mrp/production-orders", - "componentPath": "@/views/mrp/components/ProductionOrderList", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.mrp.productionOrderNew", - "path": "/admin/mrp/production-orders/new", - "componentPath": "@/views/mrp/components/ProductionOrderForm", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.mrp.productionOrderEdit", - "path": "/admin/mrp/production-orders/:id/edit", - "componentPath": "@/views/mrp/components/ProductionOrderForm", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.mrp.productionOrderDetail", - "path": "/admin/mrp/production-orders/:id", - "componentPath": "@/views/mrp/components/ProductionOrderView", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.mrp.workOrders", - "path": "/admin/mrp/work-orders", - "componentPath": "@/views/mrp/components/WorkOrders", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.mrp.demandPlanning", - "path": "/admin/mrp/demand-planning", - "componentPath": "@/views/mrp/components/DemandPlanning", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.mrp.materialRequirements", - "path": "/admin/mrp/material-requirements", - "componentPath": "@/views/mrp/components/Requirements", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.mrp.planningGantt", - "path": "/admin/mrp/planning-gantt", - "componentPath": "@/views/mrp/components/PlanningGantt", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.accounting.currentAccounts", - "path": "/admin/accounting/current-accounts", - "componentPath": "@/views/accounting/CurrentAccountPage", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.accounting.waybills", - "path": "/admin/accounting/waybills", - "componentPath": "@/views/accounting/WaybillPage", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.accounting.invoices", - "path": "/admin/accounting/invoices", - "componentPath": "@/views/accounting/InvoicePage", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.accounting.invoicesNew", - "path": "/admin/accounting/invoices/new", - "componentPath": "@/views/accounting/InvoicePage", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.accounting.cash", - "path": "/admin/accounting/cash", - "componentPath": "@/views/accounting/CashPage", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.accounting.bank", - "path": "/admin/accounting/bank", - "componentPath": "@/views/accounting/BankPage", - "routeType": "protected", - "authority": null - }, - { - "key": "admin.accounting.checkNote", - "path": "/admin/accounting/check-note", - "componentPath": "@/views/accounting/CheckNotePage", - "routeType": "protected", - "authority": null } ], "Menus": [ diff --git a/api/src/Erp.Platform.Domain/Entities/Tenant/Project/ProjectTask.cs b/api/src/Erp.Platform.Domain/Entities/Tenant/Project/ProjectTask.cs index 7a2b8e13..ce24033e 100644 --- a/api/src/Erp.Platform.Domain/Entities/Tenant/Project/ProjectTask.cs +++ b/api/src/Erp.Platform.Domain/Entities/Tenant/Project/ProjectTask.cs @@ -26,7 +26,7 @@ public class ProjectTask : FullAuditedEntity, IMultiTenant public Status? Status { get; set; } public Guid? EmployeeId { get; set; } - public Employee? Employee { get; set; } + public Employee Employee { get; set; } public DateTime StartDate { get; set; } public DateTime EndDate { get; set; } diff --git a/ui/public/version.json b/ui/public/version.json index c2b18c8a..c65a3438 100644 --- a/ui/public/version.json +++ b/ui/public/version.json @@ -1,6 +1,25 @@ { - "commit": "43a8e20e", + "commit": "16dca4a0", "releases": [ + { + "version": "1.0.37", + "buildDate": "2025-12-07", + "commit": "8fd2d58c0f629af466df87dd8b03a17d9c44ceb2", + "changeLog": [ + "- Before ve After Insert Command", + "- Before ve After Update Command", + "- Before ve After Delete Command", + "Bu tanımlamalar artık liste formlarda çalıştırıldı test edildi." + ] + }, + { + "version": "1.0.36", + "buildDate": "2025-12-06", + "commit": "9938acb94c3758a54bcb8593690825b63a4ab54f", + "changeLog": [ + "SQL Query Manager komponentin üretildi. Artık uygulama üzerinden veritabanına hükmedilebilecek." + ] + }, { "version": "1.0.34", "buildDate": "2025-11-18", @@ -173,7 +192,7 @@ { "version": "1.0.14", "buildDate": "2025-09-22", - "commit": "1c4ab4f8232b4cd2a39fa66f8101664840113ce5", + "commit": "51208b86937484d68b699120d74872067b1c7ef6", "changeLog": [ "Yeni versiyon çıktı uyarı gelecek şekilde düzenlendi.", "Sağ alt kısımda mesaj çıkacak ve yenile butonu ile uygulama yeni versiyona geçecektir." diff --git a/ui/src/components/common/MultiSelectEmployee.tsx b/ui/src/components/common/MultiSelectEmployee.tsx deleted file mode 100644 index 0b190e9a..00000000 --- a/ui/src/components/common/MultiSelectEmployee.tsx +++ /dev/null @@ -1,180 +0,0 @@ -import React, { useState, useRef, useEffect } from "react"; -import { FaChevronDown, FaTimes } from "react-icons/fa"; -import { mockEmployees } from "../../mocks/mockEmployees"; -import { EmployeeDto } from "@/proxy/intranet/models"; - -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: EmployeeDto) => - employee.name.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: EmployeeDto) => - selectedEmployees.includes(emp.id) - ); - - return ( -
-
!disabled && setIsOpen(!isOpen)} - > -
-
- {selectedEmployeeObjects.length > 0 ? ( - selectedEmployeeObjects.map((employee: EmployeeDto) => ( - - {employee.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 */} -
- {filteredEmployees.length > 0 ? ( - filteredEmployees.map((employee: EmployeeDto) => ( -
handleEmployeeToggle(employee.id)} - > -
-
- {employee.name} -
-
- {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 deleted file mode 100644 index 7eb3eec3..00000000 --- a/ui/src/components/common/MultiSelectTeam.tsx +++ /dev/null @@ -1,190 +0,0 @@ -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/mocks/mockActivities.ts b/ui/src/mocks/mockActivities.ts deleted file mode 100644 index fa72e5fe..00000000 --- a/ui/src/mocks/mockActivities.ts +++ /dev/null @@ -1,174 +0,0 @@ -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 deleted file mode 100644 index 42de6072..00000000 --- a/ui/src/mocks/mockActivityTypes.ts +++ /dev/null @@ -1,92 +0,0 @@ -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 deleted file mode 100644 index bc66b7cf..00000000 --- a/ui/src/mocks/mockApprovalWorkflows.ts +++ /dev/null @@ -1,193 +0,0 @@ -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 deleted file mode 100644 index 151b210e..00000000 --- a/ui/src/mocks/mockBOMs.ts +++ /dev/null @@ -1,319 +0,0 @@ -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 deleted file mode 100644 index 6003ba97..00000000 --- a/ui/src/mocks/mockBadges.ts +++ /dev/null @@ -1,88 +0,0 @@ -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 deleted file mode 100644 index 2b357f15..00000000 --- a/ui/src/mocks/mockBankMovements.ts +++ /dev/null @@ -1,43 +0,0 @@ -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 index 710e7a52..39e34e99 100644 --- a/ui/src/mocks/mockBanks.ts +++ b/ui/src/mocks/mockBanks.ts @@ -1,5 +1,4 @@ -import { BankAccountTypeEnum } from "../types/fi"; -import { BankAccount } from "../types/common"; +import { BankAccount, BankAccountTypeEnum } from "@/proxy/intranet/models"; export const mockBanks: BankAccount[] = [ { diff --git a/ui/src/mocks/mockBusinessParties.ts b/ui/src/mocks/mockBusinessParties.ts deleted file mode 100644 index 04e26ba6..00000000 --- a/ui/src/mocks/mockBusinessParties.ts +++ /dev/null @@ -1,521 +0,0 @@ -import { BankAccountTypeEnum } from '../types/fi' -import { BusinessParty, BusinessPartyIndustryEnum, 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', - partyType: PartyType.Supplier, - name: 'ABC Malzeme Ltd.', - primaryContact: { - id: '2', - firstName: 'Fatma', - lastName: 'Demir', - name: 'Fatma Demir', - title: 'Genel Müdür', - department: 'Yönetim', - email: 'fatma.demir@uretim.com', - phoneNumber: '3125550202', - mobileNumber: '5325550202', - isPrimary: true, - isActive: true, - creationTime: new Date(), - lastModificationTime: new Date(), - }, - email: 'aliveli@gmail.com', - phoneNumber: '+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', - name: 'Ali Veli', - title: 'Satınalma Müdürü', - email: 'aliveli@gmail.com', - phoneNumber: '+90 212 555 1234', - department: 'Satınalma', - isPrimary: true, - isActive: false, - creationTime: new Date(), - lastModificationTime: new Date(), - }, - ], - supplierType: SupplierTypeEnum.Manufacturer, - creationTime: new Date(), - lastModificationTime: new Date(), - }, - { - id: '2', - code: 'SUP002', - supplierType: SupplierTypeEnum.ServiceProvider, - name: 'XYZ Teknoloji A.Ş.', - primaryContact: { - id: '2', - firstName: 'Fatma', - lastName: 'Demir', - name: 'Fatma Demir', - title: 'Genel Müdür', - department: 'Yönetim', - email: 'fatma.demir@uretim.com', - phoneNumber: '3125550202', - mobileNumber: '5325550202', - isPrimary: true, - isActive: true, - creationTime: new Date(), - lastModificationTime: new Date(), - }, - email: 'aysedemir@gmail.com', - phoneNumber: '+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', - name: 'Ayşe Demir', - title: 'Satış Müdürü', - email: 'aysedemir@gmail.com', - phoneNumber: '+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.Manufacturer, - name: 'LMN Endüstri A.Ş.', - primaryContact: { - id: '2', - firstName: 'Fatma', - lastName: 'Demir', - name: 'Fatma Demir', - title: 'Genel Müdür', - department: 'Yönetim', - email: 'fatma.demir@uretim.com', - phoneNumber: '3125550202', - mobileNumber: '5325550202', - isPrimary: true, - isActive: true, - creationTime: new Date(), - lastModificationTime: new Date(), - }, - email: 'mehmetyilmaz@gmail.com', - phoneNumber: '+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', - name: 'Mehmet Yılmaz', - title: 'Genel Müdür', - email: 'mehmetyilmaz@gmail.com', - phoneNumber: '+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.Distributor, - name: 'OPQ Ticaret Ltd.', - primaryContact: { - id: '2', - firstName: 'Fatma', - lastName: 'Demir', - name: 'Fatma Demir', - title: 'Genel Müdür', - department: 'Yönetim', - email: 'fatma.demir@uretim.com', - phoneNumber: '3125550202', - mobileNumber: '5325550202', - isPrimary: true, - isActive: true, - creationTime: new Date(), - lastModificationTime: new Date(), - }, - email: 'fatmacelik@gmail.com', - phoneNumber: '+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', - name: 'Fatma Çelik', - title: 'Finans Müdürü', - email: 'fatmacelik@gmail.com', - phoneNumber: '+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: BusinessPartyIndustryEnum.Finance, - website: 'www.uretim.com', - primaryContact: { - id: '2', - firstName: 'Fatma', - lastName: 'Demir', - name: 'Fatma Demir', - title: 'Genel Müdür', - department: 'Yönetim', - email: 'fatma.demir@uretim.com', - phoneNumber: '3125550202', - mobileNumber: '5325550202', - 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', - paymentTerms: PaymentTerms.Net60, - creditLimit: 500000, - 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: BusinessPartyIndustryEnum.Technology, - website: 'www.teknoloji.com', - primaryContact: { - id: '1', - firstName: 'Ali', - lastName: 'Yılmaz', - name: 'Ali Yılmaz', - title: 'Satınalma Müdürü', - department: 'Satınalma', - email: 'ali.yilmaz@teknoloji.com', - phoneNumber: '2125550201', - mobileNumber: '5325550201', - 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.ServiceProvider, - name: '', - email: '', - phoneNumber: '', - 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 deleted file mode 100644 index 1632edff..00000000 --- a/ui/src/mocks/mockCashAccounts.ts +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index e26d2aff..00000000 --- a/ui/src/mocks/mockCashMovements.ts +++ /dev/null @@ -1,29 +0,0 @@ -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 deleted file mode 100644 index 67e102ec..00000000 --- a/ui/src/mocks/mockChecks.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { FiCheck, CheckStatusEnum, TypeEnum } from '../types/fi' -import { mockCurrentAccounts } from './mockCurrentAccounts' - -export const mockChecks: FiCheck[] = [ - { - id: '1', - checkNumber: 'CHK-001', - bankName: 'İş Bankası', - branchName: 'Levent Şubesi', - accountNumber: '1234567890', - type: TypeEnum.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: TypeEnum.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/mockCoordinator.ts b/ui/src/mocks/mockCoordinator.ts deleted file mode 100644 index b0962f9a..00000000 --- a/ui/src/mocks/mockCoordinator.ts +++ /dev/null @@ -1,79 +0,0 @@ -export const adminNavigationItems = [ - { - id: "dashboard", - title: "Dashboard", - icon: "LayoutDashboard", - path: "/admin/dashboard", - description: "Genel bakış ve istatistikler", - }, - { - id: "tags", - title: "Etiket Yönetimi", - icon: "Tags", - path: "/admin/tags", - description: "Soru ve içerik etiketleri", - }, - { - id: "question-pools", - title: "Soru Havuzları", - icon: "Database", - path: "/admin/question-pools", - description: "Soru havuzları ve kategoriler", - }, - { - id: "exams", - title: "Sınav Yönetimi", - icon: "FileText", - path: "/admin/exams", - description: "Sınavları yönetin", - }, - { - id: "assignments", - title: "Ödev Yönetimi", - icon: "BookOpen", - path: "/admin/assignments", - description: "Ödevleri yönetin", - }, - { - id: "tests", - title: "Test Yönetimi", - icon: "ClipboardList", - path: "/admin/tests", - description: "PDF testler ve cevap anahtarları", - }, -]; - -export const questionTypes = [ - { value: "multiple-choice", label: "Çoktan Seçmeli", icon: "CheckCircle" }, - { value: "fill-blank", label: "Boşluk Doldurma", icon: "Edit3" }, - { value: "multiple-answer", label: "Çok Yanıtlı", icon: "CheckSquare" }, - { value: "matching", label: "Eşleştirme", icon: "Link" }, - { value: "ordering", label: "Sıralama", icon: "ArrowUpDown" }, - { value: "open-ended", label: "Açık Uçlu", icon: "MessageSquare" }, - { value: "true-false", label: "Doğru-Yanlış", icon: "ToggleLeft" }, - { value: "calculation", label: "Hesaplama", icon: "Calculator" }, -]; - -export const difficultyLevels = [ - { value: "easy", label: "Kolay", color: "green" }, - { value: "medium", label: "Orta", color: "yellow" }, - { value: "hard", label: "Zor", color: "red" }, -]; - -export const examTypes = [ - { value: "exam", label: "Sınav", icon: "FileText" }, - { value: "assignment", label: "Ödev", icon: "BookOpen" }, - { value: "test", label: "Test", icon: "ClipboardList" }, -]; - -export const getBreadcrumb = (currentPath: string): string[] => { - const pathMap: Record = { - "/admin/dashboard": ["Admin", "Dashboard"], - "/admin/tags": ["Admin", "Etiket Yönetimi"], - "/admin/question-pools": ["Admin", "Soru Havuzları"], - "/admin/exams": ["Admin", "Sınav Yönetimi"], - "/admin/assignments": ["Admin", "Ödev Yönetimi"], - "/admin/tests": ["Admin", "Test Yönetimi"], - }; - return pathMap[currentPath] || ["Admin"]; -}; diff --git a/ui/src/mocks/mockCostCenters.ts b/ui/src/mocks/mockCostCenters.ts deleted file mode 100644 index c1cce51f..00000000 --- a/ui/src/mocks/mockCostCenters.ts +++ /dev/null @@ -1,184 +0,0 @@ -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 deleted file mode 100644 index 18467021..00000000 --- a/ui/src/mocks/mockCurrencies.ts +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index 2b1ff697..00000000 --- a/ui/src/mocks/mockCurrentAccountMovements.ts +++ /dev/null @@ -1,154 +0,0 @@ -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 deleted file mode 100644 index 2995a2f6..00000000 --- a/ui/src/mocks/mockCurrentAccounts.ts +++ /dev/null @@ -1,115 +0,0 @@ -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", - phoneNumber: "+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", - phoneNumber: "+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", - phoneNumber: "+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", - phoneNumber: "+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", - phoneNumber: "+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 deleted file mode 100644 index 70ca1d84..00000000 --- a/ui/src/mocks/mockDeliveries.ts +++ /dev/null @@ -1,149 +0,0 @@ -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 deleted file mode 100644 index ec8702bb..00000000 --- a/ui/src/mocks/mockDemandPlanning.ts +++ /dev/null @@ -1,163 +0,0 @@ -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 index f0b0f764..82150a49 100644 --- a/ui/src/mocks/mockDepartments.ts +++ b/ui/src/mocks/mockDepartments.ts @@ -1,9 +1,8 @@ -import { DepartmentDto } from '../types/hr' +import { DepartmentDto } from "@/proxy/intranet/models" export const mockDepartments: DepartmentDto[] = [ { id: '1', - code: 'ÜRT', name: 'Üretim', description: 'Üretim departmanı', parentDepartmentId: undefined, @@ -20,7 +19,6 @@ export const mockDepartments: DepartmentDto[] = [ }, { id: '2', - code: 'BAK', name: 'Bakım', description: 'Bakım departmanı', parentDepartmentId: undefined, @@ -37,7 +35,6 @@ export const mockDepartments: DepartmentDto[] = [ }, { id: '3', - code: 'KAL', name: 'Kalite Kontrol', description: 'Kalite kontrol departmanı', parentDepartmentId: '1', @@ -54,7 +51,6 @@ export const mockDepartments: DepartmentDto[] = [ }, { id: '4', - code: 'DEP', name: 'Depo', description: 'Depo departmanı', parentDepartmentId: '1', @@ -71,7 +67,6 @@ export const mockDepartments: DepartmentDto[] = [ }, { id: '5', - code: 'IDR', name: 'İdari İşler', description: 'İdari işler departmanı', parentDepartmentId: undefined, diff --git a/ui/src/mocks/mockEmployeeTypes.ts b/ui/src/mocks/mockEmployeeTypes.ts deleted file mode 100644 index b235c8d6..00000000 --- a/ui/src/mocks/mockEmployeeTypes.ts +++ /dev/null @@ -1,59 +0,0 @@ -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/mockEvaluation360.ts b/ui/src/mocks/mockEvaluation360.ts deleted file mode 100644 index c8ae73f8..00000000 --- a/ui/src/mocks/mockEvaluation360.ts +++ /dev/null @@ -1,148 +0,0 @@ -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 deleted file mode 100644 index 759da911..00000000 --- a/ui/src/mocks/mockEvaluation360Results.ts +++ /dev/null @@ -1,519 +0,0 @@ -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 deleted file mode 100644 index 68852884..00000000 --- a/ui/src/mocks/mockEvaluation360Templates.ts +++ /dev/null @@ -1,283 +0,0 @@ -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 deleted file mode 100644 index 02c5c9e5..00000000 --- a/ui/src/mocks/mockFaultNotifications.ts +++ /dev/null @@ -1,131 +0,0 @@ -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 deleted file mode 100644 index 5fc3fe69..00000000 --- a/ui/src/mocks/mockInventoryCounts.ts +++ /dev/null @@ -1,112 +0,0 @@ -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 deleted file mode 100644 index 05484743..00000000 --- a/ui/src/mocks/mockInvoices.ts +++ /dev/null @@ -1,55 +0,0 @@ -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 index 4211ca7a..6a6f0058 100644 --- a/ui/src/mocks/mockJobPositions.ts +++ b/ui/src/mocks/mockJobPositions.ts @@ -1,10 +1,10 @@ -import { JobPositionDto, JobLevelEnum } from "../types/hr"; +import { JobPositionDto } from "@/proxy/intranet/models"; import { mockDepartments } from "./mockDepartments"; +import { JobLevelEnum } from "@/types/hr"; export const mockJobPositions: JobPositionDto[] = [ { id: "1", - code: "DEV-001", name: "Software Developer", description: "Responsible for developing and maintaining web applications", departmentId: "1", @@ -32,7 +32,6 @@ export const mockJobPositions: JobPositionDto[] = [ }, { id: "2", - code: "MGR-001", name: "Project Manager", description: "Lead and manage software development projects", departmentId: "1", @@ -60,7 +59,6 @@ export const mockJobPositions: JobPositionDto[] = [ }, { id: "3", - code: "QA-001", name: "Quality Assurance Engineer", description: "Ensure software quality through testing and automation", departmentId: "1", @@ -88,7 +86,6 @@ export const mockJobPositions: JobPositionDto[] = [ }, { id: "4", - code: "UX-001", name: "UX/UI Designer", description: "Design user interfaces and improve user experience", departmentId: "2", @@ -121,7 +118,6 @@ export const mockJobPositions: JobPositionDto[] = [ }, { id: "5", - code: "DA-001", name: "Data Analyst", description: "Analyze business data and provide insights", departmentId: "1", @@ -149,7 +145,6 @@ export const mockJobPositions: JobPositionDto[] = [ }, { id: "6", - code: "HR-001", name: "HR Specialist", description: "Support human resources operations and employee relations", departmentId: "4", @@ -182,7 +177,6 @@ export const mockJobPositions: JobPositionDto[] = [ }, { id: "7", - code: "SA-001", name: "Sales Associate", description: "Generate sales leads and maintain customer relationships", departmentId: "2", @@ -210,7 +204,6 @@ export const mockJobPositions: JobPositionDto[] = [ }, { id: "8", - code: "ACC-001", name: "Accountant", description: "Manage financial records and ensure compliance", departmentId: "3", @@ -243,7 +236,6 @@ export const mockJobPositions: JobPositionDto[] = [ }, { id: "9", - code: "CS-001", name: "Customer Support Representative", description: "Provide excellent customer service and technical support", departmentId: "2", @@ -276,7 +268,6 @@ export const mockJobPositions: JobPositionDto[] = [ }, { id: "10", - code: "IT-001", name: "IT Support Specialist", description: "Provide technical support and maintain IT infrastructure", departmentId: "1", diff --git a/ui/src/mocks/mockLocations.ts b/ui/src/mocks/mockLocations.ts deleted file mode 100644 index cbb80273..00000000 --- a/ui/src/mocks/mockLocations.ts +++ /dev/null @@ -1,110 +0,0 @@ -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 deleted file mode 100644 index 728d29a2..00000000 --- a/ui/src/mocks/mockLossReasons.ts +++ /dev/null @@ -1,52 +0,0 @@ -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 deleted file mode 100644 index bf522e70..00000000 --- a/ui/src/mocks/mockLotNumbers.ts +++ /dev/null @@ -1,42 +0,0 @@ -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 deleted file mode 100644 index 9e0ef57f..00000000 --- a/ui/src/mocks/mockMRP.ts +++ /dev/null @@ -1,168 +0,0 @@ -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 deleted file mode 100644 index 9bb6366b..00000000 --- a/ui/src/mocks/mockMaintenanceCalendarEvent.ts +++ /dev/null @@ -1,86 +0,0 @@ -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: WorkOrderStatusEnum.Created, - 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: WorkOrderStatusEnum.Created, - 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: WorkOrderStatusEnum.Created, - 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: WorkOrderStatusEnum.Created, - 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 deleted file mode 100644 index c8896bc3..00000000 --- a/ui/src/mocks/mockMaintenancePlans.ts +++ /dev/null @@ -1,80 +0,0 @@ -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 deleted file mode 100644 index d5ca9cdd..00000000 --- a/ui/src/mocks/mockMaintenanceTeams.ts +++ /dev/null @@ -1,144 +0,0 @@ -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 deleted file mode 100644 index a97967d6..00000000 --- a/ui/src/mocks/mockMaintenanceWorkOrders.ts +++ /dev/null @@ -1,204 +0,0 @@ -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 deleted file mode 100644 index 9f956a62..00000000 --- a/ui/src/mocks/mockMaterialGroups.ts +++ /dev/null @@ -1,68 +0,0 @@ -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 deleted file mode 100644 index a0ce38e8..00000000 --- a/ui/src/mocks/mockMaterialTypes.ts +++ /dev/null @@ -1,52 +0,0 @@ -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 deleted file mode 100644 index e4d16caf..00000000 --- a/ui/src/mocks/mockMaterials.ts +++ /dev/null @@ -1,429 +0,0 @@ -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 deleted file mode 100644 index ed655c42..00000000 --- a/ui/src/mocks/mockOperationTypes.ts +++ /dev/null @@ -1,79 +0,0 @@ -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 deleted file mode 100644 index c129f55a..00000000 --- a/ui/src/mocks/mockOperations.ts +++ /dev/null @@ -1,106 +0,0 @@ -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 deleted file mode 100644 index bdcc155d..00000000 --- a/ui/src/mocks/mockOpportunities.ts +++ /dev/null @@ -1,54 +0,0 @@ -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: [], - 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: [], - competitors: [], - creationTime: new Date("2024-02-05"), - lastModificationTime: new Date("2024-04-20"), - }, -]; diff --git a/ui/src/mocks/mockPayrolls.ts b/ui/src/mocks/mockPayrolls.ts deleted file mode 100644 index 6b278cd7..00000000 --- a/ui/src/mocks/mockPayrolls.ts +++ /dev/null @@ -1,95 +0,0 @@ -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 deleted file mode 100644 index 911917f9..00000000 --- a/ui/src/mocks/mockProductionOrders.ts +++ /dev/null @@ -1,84 +0,0 @@ -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 deleted file mode 100644 index 37fb2a48..00000000 --- a/ui/src/mocks/mockProjectCostTracking.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { ProjectCostTrackingStatus, 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: ProjectCostTrackingStatus.OnTrack, - 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: ProjectCostTrackingStatus.AtRisk, - 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: ProjectCostTrackingStatus.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: ProjectCostTrackingStatus.Delayed, - currency: 'TRY', - lastUpdated: new Date('2024-11-22'), - }, -] diff --git a/ui/src/mocks/mockProjectPhases.ts b/ui/src/mocks/mockProjectPhases.ts deleted file mode 100644 index cf95a653..00000000 --- a/ui/src/mocks/mockProjectPhases.ts +++ /dev/null @@ -1,164 +0,0 @@ -import { PhaseCategoryEnum, 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: PhaseCategoryEnum.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: PhaseCategoryEnum.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: PhaseCategoryEnum.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: PhaseCategoryEnum.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: PhaseCategoryEnum.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: PhaseCategoryEnum.Design, - sequence: 0, - tasks: [], - isActive: false, - }, -] diff --git a/ui/src/mocks/mockProjectTaskDailyUpdates.ts b/ui/src/mocks/mockProjectTaskDailyUpdates.ts deleted file mode 100644 index 25b771e9..00000000 --- a/ui/src/mocks/mockProjectTaskDailyUpdates.ts +++ /dev/null @@ -1,158 +0,0 @@ -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 deleted file mode 100644 index 85d649a9..00000000 --- a/ui/src/mocks/mockProjectTasks.ts +++ /dev/null @@ -1,137 +0,0 @@ -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"), - }, - { - id: "4", - projectId: "1", - phaseId: "1", - phase: mockProjectPhases.find((phase) => phase.id === "1"), - taskCode: "TSK-004", - name: "Güvenlik Açığı Düzeltme", - description: "Kritik güvenlik açığının acil olarak düzeltilmesi gerekiyor", - taskType: TaskTypeEnum.Development, - status: TaskStatusEnum.InProgress, - priority: PriorityEnum.Urgent, - assignedTo: "1", - assignee: mockEmployees.find((emp) => emp.id === "1"), - startDate: new Date("2024-10-20"), - endDate: new Date("2024-10-25"), - actualStartDate: new Date("2024-10-20"), - actualEndDate: undefined, - estimatedHours: 20, - actualHours: 8, - progress: 40, - activities: [], - comments: [], - isActive: true, - creationTime: new Date("2024-10-20"), - lastModificationTime: new Date("2024-10-20"), - }, - { - id: "5", - projectId: "2", - phaseId: "2", - phase: mockProjectPhases.find((phase) => phase.id === "2"), - taskCode: "TSK-005", - name: "Performans Optimizasyonu", - description: "Uygulama performansının iyileştirilmesi", - taskType: TaskTypeEnum.Development, - status: TaskStatusEnum.NotStarted, - priority: PriorityEnum.High, - assignedTo: "2", - assignee: mockEmployees.find((emp) => emp.id === "2"), - startDate: new Date("2024-10-28"), - endDate: new Date("2024-11-15"), - actualStartDate: undefined, - actualEndDate: undefined, - estimatedHours: 100, - actualHours: 0, - progress: 0, - activities: [], - comments: [], - isActive: true, - creationTime: new Date("2024-10-15"), - lastModificationTime: new Date("2024-10-15"), - }, -]; diff --git a/ui/src/mocks/mockProjects.ts b/ui/src/mocks/mockProjects.ts deleted file mode 100644 index 14262c36..00000000 --- a/ui/src/mocks/mockProjects.ts +++ /dev/null @@ -1,233 +0,0 @@ -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 deleted file mode 100644 index 36a475eb..00000000 --- a/ui/src/mocks/mockPromissoryNotes.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { NoteStatusEnum, PromissoryNote, TypeEnum } from '../types/fi' -import { mockCurrentAccounts } from './mockCurrentAccounts' - -export const mockPromissoryNotes: PromissoryNote[] = [ - { - id: '1', - noteNumber: 'NOT-001', - type: TypeEnum.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: TypeEnum.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 deleted file mode 100644 index 2f11dd48..00000000 --- a/ui/src/mocks/mockPurchaseOrders.ts +++ /dev/null @@ -1,214 +0,0 @@ -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: [], - 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: [], - 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: [], - 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 deleted file mode 100644 index db2747e8..00000000 --- a/ui/src/mocks/mockPurchaseRequests.ts +++ /dev/null @@ -1,190 +0,0 @@ -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 deleted file mode 100644 index 97de73d2..00000000 --- a/ui/src/mocks/mockPurchaseRequisitions.ts +++ /dev/null @@ -1,50 +0,0 @@ -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 deleted file mode 100644 index 9d8870e4..00000000 --- a/ui/src/mocks/mockPutawayRules.ts +++ /dev/null @@ -1,124 +0,0 @@ -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 deleted file mode 100644 index c8f56a7e..00000000 --- a/ui/src/mocks/mockQuotations.ts +++ /dev/null @@ -1,198 +0,0 @@ -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 deleted file mode 100644 index c1bb805d..00000000 --- a/ui/src/mocks/mockRecentActivities.ts +++ /dev/null @@ -1,29 +0,0 @@ -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 deleted file mode 100644 index 471f4d76..00000000 --- a/ui/src/mocks/mockSalesOrders.ts +++ /dev/null @@ -1,665 +0,0 @@ -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: [], - 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: [], - 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: [], - 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: [], - 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: [], - 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: [], - 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: [], - 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: [], - 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: [], - 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: [], - 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 deleted file mode 100644 index 50f995cd..00000000 --- a/ui/src/mocks/mockSalesTeams.ts +++ /dev/null @@ -1,241 +0,0 @@ -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 deleted file mode 100644 index 806bb45c..00000000 --- a/ui/src/mocks/mockSerialNumbers.ts +++ /dev/null @@ -1,40 +0,0 @@ -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 deleted file mode 100644 index c64f6268..00000000 --- a/ui/src/mocks/mockStockItems.ts +++ /dev/null @@ -1,95 +0,0 @@ -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 deleted file mode 100644 index c6bcd735..00000000 --- a/ui/src/mocks/mockStockMovements.ts +++ /dev/null @@ -1,303 +0,0 @@ -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 deleted file mode 100644 index 79d15374..00000000 --- a/ui/src/mocks/mockUnits.ts +++ /dev/null @@ -1,12 +0,0 @@ -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 deleted file mode 100644 index b14eb2fa..00000000 --- a/ui/src/mocks/mockWarehouses.ts +++ /dev/null @@ -1,132 +0,0 @@ -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 deleted file mode 100644 index 3cb79040..00000000 --- a/ui/src/mocks/mockWaybills.ts +++ /dev/null @@ -1,220 +0,0 @@ -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/mockWorkCenterMachineTypes.ts b/ui/src/mocks/mockWorkCenterMachineTypes.ts deleted file mode 100644 index eed49a6d..00000000 --- a/ui/src/mocks/mockWorkCenterMachineTypes.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { PmMachineType } from '../types/pm' - -export const mockWorkCenterMachineTypes: PmMachineType[] = [ - { - id: '1', - code: 'CNC', - name: 'CNC Makineleri', - isActive: true, - }, - { - id: '2', - code: 'COMP', - name: 'Kompresörler', - isActive: true, - }, - { - id: '3', - code: 'CONV', - name: 'Konveyörler', - isActive: true, - }, - { - id: '4', - code: 'WELD', - name: 'Kaynak Makineleri', - isActive: true, - }, -] diff --git a/ui/src/mocks/mockWorkCenters.ts b/ui/src/mocks/mockWorkCenters.ts deleted file mode 100644 index 089ff127..00000000 --- a/ui/src/mocks/mockWorkCenters.ts +++ /dev/null @@ -1,356 +0,0 @@ -import { CriticalityLevelEnum, PmWorkCenter, WorkCenterStatusEnum } from '../types/pm' -import { mockWorkCenterMachineTypes } from './mockWorkCenterMachineTypes' - -export const mockWorkCenters: PmWorkCenter[] = [ - { - id: '1', - code: 'CNC-001', - name: 'CNC Torna Tezgahı', - description: 'Yüksek hassasiyetli CNC torna tezgahı', - 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, - machineTypeId: '1', - machineType: mockWorkCenterMachineTypes.find((mt) => mt.id === '1')!, - }, - { - id: '2', - code: 'COMP-001', - name: 'Hava Kompresörü', - description: 'Endüstriyel hava kompresörü sistemi', - 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, - machineTypeId: '2', - machineType: mockWorkCenterMachineTypes.find((mt) => mt.id === '2')!, - capacity: 8, - }, - { - id: '3', - code: 'CONV-001', - name: 'Konveyör Sistemi', - description: 'Ana hat konveyör sistemi', - 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, - machineTypeId: '3', - machineType: mockWorkCenterMachineTypes.find((mt) => mt.id === '3')!, - capacity: 8, - }, - { - id: '4', - code: 'KELD-001', - name: 'Kaynak Makinesi', - description: 'Otomatik robot kaynak sistemi', - 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, - machineTypeId: '3', - machineType: mockWorkCenterMachineTypes.find((mt) => mt.id === '3')!, - capacity: 8, - }, - { - id: '5', - code: 'WELL-001', - name: 'Yıkama Makinesi', - description: 'Otomatik robot kaynak sistemi', - 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, - machineTypeId: '4', - machineType: mockWorkCenterMachineTypes.find((mt) => mt.id === '4')!, - capacity: 8, - }, - { - id: '6', - code: 'KELD-001', - name: 'Ram Makinesi', - description: 'Otomatik robot kaynak sistemi', - 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, - machineTypeId: '4', - machineType: mockWorkCenterMachineTypes.find((mt) => mt.id === '4')!, - capacity: 8, - }, - { - id: '7', - code: 'WEID-001', - name: 'Sarma Makinesi', - description: 'Otomatik robot kaynak sistemi', - 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, - machineTypeId: '1', - machineType: mockWorkCenterMachineTypes.find((mt) => mt.id === '1')!, - capacity: 8, - }, - { - id: '8', - code: 'KEL-001', - name: 'Robot Kaynak Makinesi', - description: 'Otomatik robot kaynak sistemi', - 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, - machineTypeId: '1', - machineType: mockWorkCenterMachineTypes.find((mt) => mt.id === '1')!, - capacity: 8, - }, -] diff --git a/ui/src/mocks/mockWorkOrders.ts b/ui/src/mocks/mockWorkOrders.ts deleted file mode 100644 index 3e09d04a..00000000 --- a/ui/src/mocks/mockWorkOrders.ts +++ /dev/null @@ -1,217 +0,0 @@ -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 deleted file mode 100644 index b62b4016..00000000 --- a/ui/src/mocks/mockZones.ts +++ /dev/null @@ -1,40 +0,0 @@ -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/proxy/intranet/models.ts b/ui/src/proxy/intranet/models.ts index 0b6dc590..daf7c623 100644 --- a/ui/src/proxy/intranet/models.ts +++ b/ui/src/proxy/intranet/models.ts @@ -1,5 +1,5 @@ -import { Address, BankAccount } from '@/types/common' import { + Address, EmployeeStatusEnum, EmploymentTypeEnum, GenderEnum, @@ -14,6 +14,7 @@ import { LeaveTypeEnum, MaritalStatusEnum, } from '@/types/hr' +import { PriorityEnum } from '@/types/intranet' export interface IntranetDashboardDto { events: EventDto[] @@ -30,7 +31,7 @@ export interface IntranetDashboardDto { overtimes: OvertimeDto[] surveys: SurveyDto[] socialPosts: SocialPostDto[] - // priorityTasks: TaskDto[] + tasks: ProjectTaskDto[] } // Etkinlik @@ -59,6 +60,36 @@ export interface EventCommentDto { likes: number } +export enum BankAccountTypeEnum { + Current = 'CURRENT', // Vadesiz + Deposit = 'DEPOSIT', // Vadeli + Credit = 'CREDIT', // Kredi + Foreign = 'FOREIGN', // Yabancı Para +} + +// 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 + phoneNumber?: string + swiftCode?: string + isDefault: boolean + creationTime: Date + lastModificationTime: Date +} + export interface EmployeeDto { // İnsan Kaynakları Çalışanı id: string @@ -283,6 +314,26 @@ export interface MealDto { materials: string[] } +// İnsan Kaynakları Fazla Mesai +export interface ProjectTaskDto { + id: string + + name: string + description: string + + priority: PriorityEnum + status?: string + + employeeId?: string + employee: EmployeeDto + + startDate: Date + endDate: Date + + progress: number + isActive: boolean +} + // İnsan Kaynakları Fazla Mesai export interface OvertimeDto { id: string diff --git a/ui/src/types/common.ts b/ui/src/types/common.ts index 9d150419..defc004c 100644 --- a/ui/src/types/common.ts +++ b/ui/src/types/common.ts @@ -1,183 +1,3 @@ -import { BankAccountTypeEnum } from './fi' -import { - CrmActivity, - CustomerSegmentEnum, - CustomerTypeEnum, - CrmOpportunity, - CrmSalesOrder, - CrmSalesTarget, - CrmTerritory, -} from './crm' -import { SupplierCardTypeEnum, MmSupplierPerformance, SupplierTypeEnum } from './mm' -import { EmployeeDto } from '@/proxy/intranet/models' - -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?: BusinessPartyIndustryEnum - email?: string - phoneNumber?: 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 BusinessPartyIndustryEnum { - // İş Ortağı Endüstrisi - Technology = 'TECHNOLOGY', // Teknoloji - Healthcare = 'HEALTHCARE', // Sağlık - Finance = 'FINANCE', // Finans - Retail = 'RETAIL', // Perakende - Manufacturing = 'MANUFACTURING', // Üretim - Education = 'EDUCATION', // Eğitim - Construction = 'CONSTRUCTION', // İnşaat - Hospitality = 'HOSPITALITY', // Konaklama - Transportation = 'TRANSPORTATION', // Ulaşım - RealEstate = 'REAL_ESTATE', // Emlak - Other = 'OTHER', // Diğer -} - -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?: EmployeeDto - 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?: EmployeeDto - role: TeamRoleEnum - joinDate: Date - isActive: boolean -} - -export interface Contact { - // İletişim - id: string - customerId?: string - firstName: string - lastName: string - name: string - title?: string - department?: string - email: string - phoneNumber?: string - mobileNumber?: string - isPrimary: boolean - isActive: boolean - creationTime: Date - lastModificationTime: Date -} - -export interface Address { - // Adres - country: string - state: string - city: string - street: string - postalCode: 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 - phoneNumber?: string - swiftCode?: string - isDefault: boolean - creationTime: Date - lastModificationTime: Date -} - export interface WidgetGroupDto { // Widget Grubu colGap?: number @@ -199,40 +19,4 @@ export interface WidgetEditDto { 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 -} +} \ No newline at end of file diff --git a/ui/src/types/crm.ts b/ui/src/types/crm.ts deleted file mode 100644 index a6d5da28..00000000 --- a/ui/src/types/crm.ts +++ /dev/null @@ -1,275 +0,0 @@ -import { EmployeeDto } from '@/proxy/intranet/models' -import { Address, BusinessParty, Contact, PaymentTerms, PriorityEnum } from './common' -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?: EmployeeDto - 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?: EmployeeDto - 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 deleted file mode 100644 index e2aba4c6..00000000 --- a/ui/src/types/fi.ts +++ /dev/null @@ -1,357 +0,0 @@ -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 - phoneNumber?: 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: TypeEnum - 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: TypeEnum // 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 TypeEnum { - 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 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 index e1102e6b..0e778f09 100644 --- a/ui/src/types/hr.ts +++ b/ui/src/types/hr.ts @@ -1,5 +1,13 @@ -import { DepartmentDto, EmployeeDto, JobPositionDto } from '@/proxy/intranet/models' -import { Address, BankAccount } from './common' +import { DepartmentDto, EmployeeDto } from '@/proxy/intranet/models' + +export interface Address { + // Adres + country: string + state: string + city: string + street: string + postalCode: string +} export interface HrCostCenter { // İnsan Kaynakları Masraf Merkezi diff --git a/ui/src/types/intranet.ts b/ui/src/types/intranet.ts index 2d4de90f..c042cd51 100644 --- a/ui/src/types/intranet.ts +++ b/ui/src/types/intranet.ts @@ -1,21 +1,36 @@ -import { - EmployeeDto, - SurveyQuestionDto, -} from '@/proxy/intranet/models' - -// Görev -export interface Task { - id: string - title: string - description: string - project: string - assignedTo: EmployeeDto[] - assignedBy: EmployeeDto - priority: 'low' | 'medium' | 'high' | 'urgent' - status: 'todo' | 'in-progress' | 'review' | 'done' - dueDate: Date - creationTime: Date - labels: string[] - attachments?: { name: string; url: string }[] - comments: number +export enum LeaveStatusEnum { + // İzin Durumu + Pending = 'Pending', // Beklemede + Approved = 'Approved', // Onaylandı + Rejected = 'Rejected', // Reddedildi + Cancelled = 'Cancelled', // İptal edildi } + +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 PriorityEnum { + // Öncelik + Low = 'LOW', // Düşük + Normal = 'NORMAL', // Normal + High = 'HIGH', // Yüksek + Urgent = 'URGENT', // Acil +} + +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 +} \ No newline at end of file diff --git a/ui/src/types/menu.ts b/ui/src/types/menu.ts index 22ac6a4b..371dbe4d 100644 --- a/ui/src/types/menu.ts +++ b/ui/src/types/menu.ts @@ -38,7 +38,7 @@ export function toPrefix(menu: MenuPrefixEnum): string { case MenuPrefixEnum.Maintenance: return "Mnt"; case MenuPrefixEnum.Warehouse: - return "Wh"; + return "Str"; case MenuPrefixEnum.Project: return "Prj"; case MenuPrefixEnum.Hr: diff --git a/ui/src/types/mm.ts b/ui/src/types/mm.ts deleted file mode 100644 index 48afb8a0..00000000 --- a/ui/src/types/mm.ts +++ /dev/null @@ -1,713 +0,0 @@ -import { DepartmentDto } from '@/proxy/intranet/models' -import { Address, BusinessParty, PaymentTerms, PriorityEnum } from './common' -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?: DepartmentDto - 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ü - Manufacturer = 'MANUFACTURER', // Üretici - Distributor = 'DISTRIBUTOR', // Distribütör - Wholesaler = 'WHOLESALER', // Toptancı - ServiceProvider = 'SERVICE_PROVIDER', // Hizmet Sağlayıcı - Other = 'OTHER', // Diğer -} - -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 deleted file mode 100644 index f46bd80d..00000000 --- a/ui/src/types/mrp.ts +++ /dev/null @@ -1,465 +0,0 @@ -import { PmWorkCenter, WorkOrderStatusEnum } from './pm' -import { MmMaterial, MmMaterialSupplier, QualityResultEnumEnum, QualityStatusEnum } from './mm' -import { PriorityEnum } from './common' -import { CrmSalesOrder } from './crm' - -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 MrpPurchaseSuggestion 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 deleted file mode 100644 index 077a6e33..00000000 --- a/ui/src/types/pm.ts +++ /dev/null @@ -1,294 +0,0 @@ -import { DepartmentDto } from '@/proxy/intranet/models' -import { PriorityEnum } from './common' -import { MmMaterial } from './mm' - -export type CalendarView = 'month' | 'week' | 'day' - -export interface PmWorkCenter { - // İş Merkezi / Ekipman - id: string - code: string - name: string - description?: string - manufacturer?: string - model?: string - serialNumber?: string - installationDate: Date - warrantyExpiry?: Date - location: string - departmentId: string - department?: DepartmentDto - status: WorkCenterStatusEnum - criticality: CriticalityLevelEnum - specifications: PmWorkCenterSpecification[] - maintenancePlans: PmMaintenancePlan[] - workOrders: PmMaintenanceWorkOrder[] - downTimeHistory: PmDownTimeRecord[] - capacity: number - costPerHour: number - setupTime: number - machineTypeId: string - machineType?: PmMachineType - 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 PmMachineType { - // Makina Türü - id: string - code: string - name: 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 deleted file mode 100644 index 3e64a2fd..00000000 --- a/ui/src/types/ps.ts +++ /dev/null @@ -1,373 +0,0 @@ -import { EmployeeDto } from '@/proxy/intranet/models' -import { BusinessParty, PriorityEnum } from './common' - -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?: EmployeeDto - 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: PhaseCategoryEnum -} - -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?: EmployeeDto - 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: ProjectCostTrackingStatus - currency: string - lastUpdated: Date -} - -export interface PsTaskDailyUpdate { - // Görev Günlük Güncellemesi - id: string - taskId: string - task?: PsProjectTask - employeeId: string - employee?: EmployeeDto - 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?: EmployeeDto - 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 PhaseCategoryEnum { - // Category of Phase - Planning = 'PLANNING', // Planlama - Development = 'EXECUTION', // Yürütme - Testing = 'MONITORING', // İzleme - Deployment = 'CLOSURE', // Kapanış - Design = 'OTHER', // Diğer -} - -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 -} - -export enum ProjectCostTrackingStatus { - // Proje Maliyet Takibi Durumu - OnTrack = 'ON_TRACK', // Planında - AtRisk = 'AT_RISK', // Riskte - Delayed = 'DELAYED', // Gecikmiş - Completed = 'COMPLETED', // Tamamlandı -} diff --git a/ui/src/types/wm.ts b/ui/src/types/wm.ts deleted file mode 100644 index 3b20e2c9..00000000 --- a/ui/src/types/wm.ts +++ /dev/null @@ -1,256 +0,0 @@ -import { Address } from './common' -import { MmMaterial } from './mm' -import { SecurityLevelEnum } from './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 deleted file mode 100644 index 879f34c2..00000000 --- a/ui/src/utils/erp.tsx +++ /dev/null @@ -1,2879 +0,0 @@ -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, - ReceiptStatusEnum, -} from '../types/mm' -import { - BOMTypeEnum, - OperationCategoryEnum, - MrpProductionOrder, - ProductionOrderStatusEnum, - ProductionOrderTypeEnum, - RecommendationStatusEnum, - RequirementSourceTypeEnum, - RoutingStatusEnum, - SecurityLevelEnum, - ForecastMethodEnum, -} 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 { - BusinessPartyIndustryEnum, - BusinessPartyStatusEnum, - PaymentTerms, - PriorityEnum, - TeamRoleEnum, -} from '../types/common' -import { - AccountTypeEnum, - BankAccountTypeEnum, - BankTransactionTypeEnum, - CashMovementTypeEnum, - CheckStatusEnum, - TypeEnum, - FiDocumentTypeEnum, - InvoiceStatusEnum, - InvoiceTypeEnum, - NoteStatusEnum, - PaymentMethodEnum, - PaymentStatusEnum, - RiskGroupEnum, - TransactionStatusEnum, - WaybillStatusEnum, - WaybillTypeEnum, -} from '../types/fi' -import { - ActivityStatusEnum, - CrmActivityTypeEnum, - CustomerSegmentEnum, - CustomerTypeEnum, - LostReasonCategoryEnum, - OpportunityStageEnum, - SaleOrderItemStatusEnum, - SaleOrderStatusEnum, -} from '../types/crm' -import { - AssessorTypeEnum, - CampaignStatusEnum, - CostCenterType, - EmployeeStatusEnum, - EmploymentTypeEnum, - GenderEnum, - JobLevelEnum, - LeaveStatusEnum, - LeaveTypeEnum, - MaritalStatusEnum, - ParticipantStatusEnum, - PayrollStatusEnum, -} from '../types/hr' -import { - CriticalityLevelEnum, - FaultTypeEnum, - FrequencyUnitEnum, - MaintenancePlanTypeEnum, - NotificationStatusEnum, - WorkCenterStatusEnum, - WorkOrderStatusEnum, - WorkOrderTypeEnum, -} from '../types/pm' -import { - DailyUpdateStatusEnum, - PhaseCategoryEnum, - PhaseStatusEnum, - ProjectCostTrackingStatus, - ProjectStatusEnum, - ProjectTypeEnum, - PsActivityTypeEnum, - PsDocumentTypeEnum, - RiskCategoryEnum, - RiskImpactEnum, - RiskLevelEnum, - RiskProbabilityEnum, - RiskStatusEnum, - TaskStatusEnum, - TaskTypeEnum, - WorkTypeEnum, -} from '../types/ps' - -export const getBOMTypeText = (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 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 getMovementTypeText = (type: MovementTypeEnum) => { - switch (type) { - case MovementTypeEnum.GoodsReceipt: - return 'Mal Girişi' - case MovementTypeEnum.GoodsIssue: - return 'Mal Çıkışı' - case MovementTypeEnum.Transfer: - return 'Transfer' - default: - return 'Bilinmeyen' - } -} - -export const getMovementTypeIcon = (type: MovementTypeEnum) => { - switch (type) { - case MovementTypeEnum.GoodsReceipt: - return FaArrowUp - case MovementTypeEnum.GoodsIssue: - return FaArrowDown - case MovementTypeEnum.Transfer: - return FaRepeat - default: - return FaArchive - } -} - -export const getMovementTypeColor = (type: MovementTypeEnum) => { - switch (type) { - case MovementTypeEnum.GoodsReceipt: - return 'text-green-600 bg-green-100' - case MovementTypeEnum.GoodsIssue: - return 'text-red-600 bg-red-100' - case MovementTypeEnum.Transfer: - return 'text-blue-600 bg-blue-100' - default: - return 'text-gray-600 bg-gray-100' - } -} - -export const getMovementTypeSign = (type: MovementTypeEnum) => { - switch (type) { - case MovementTypeEnum.GoodsReceipt: - return '+' - case MovementTypeEnum.GoodsIssue: - return '-' - case MovementTypeEnum.Transfer: - return '' - default: - return '' - } -} - -export const getMaterialTypeText = (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 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 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 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 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 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 getBusinessPartyStatusText = (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 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 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 getCustomerSegmentText = (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 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 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 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 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 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 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 getCriticalityLevelText = (criticality: CriticalityLevelEnum) => { - const levels = { - [CriticalityLevelEnum.Low]: 'Düşük', - [CriticalityLevelEnum.Medium]: 'Orta', - [CriticalityLevelEnum.High]: 'Yüksek', - [CriticalityLevelEnum.Critical]: 'Kritik', - } - return levels[criticality] -} - -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 = (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 units[unit] -} - -export const getFrequencyUnitTextByFrequency = (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 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 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) => { - 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.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: ProjectCostTrackingStatus) => { - switch (status) { - case ProjectCostTrackingStatus.OnTrack: - return 'Planında' - case ProjectCostTrackingStatus.AtRisk: - return 'Risk Altında' - case ProjectCostTrackingStatus.Delayed: - return 'Gecikmiş' - case ProjectCostTrackingStatus.Completed: - return 'Tamamlandı' - default: - return 'Bilinmeyen' - } -} - -export const getCostTimeTrackingStatusColor = (status: ProjectCostTrackingStatus) => { - switch (status) { - case ProjectCostTrackingStatus.OnTrack: - return 'bg-green-100 text-green-800' - case ProjectCostTrackingStatus.AtRisk: - return 'bg-yellow-100 text-yellow-800' - case ProjectCostTrackingStatus.Delayed: - return 'bg-red-100 text-red-800' - case ProjectCostTrackingStatus.Completed: - return 'bg-blue-100 text-blue-800' - default: - return 'bg-gray-100 text-gray-800' - } -} - -export const getCostTimeTrackingStatusIcon = (status: ProjectCostTrackingStatus) => { - switch (status) { - case ProjectCostTrackingStatus.OnTrack: - return FaCheckCircle - case ProjectCostTrackingStatus.AtRisk: - return FaExclamationCircle - case ProjectCostTrackingStatus.Delayed: - return FaExclamationCircle - case ProjectCostTrackingStatus.Completed: - return FaCheckCircle - default: - return 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 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 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 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 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 getPhaseCategoryText = (category: PhaseCategoryEnum) => { - switch (category) { - case PhaseCategoryEnum.Planning: - return 'Planlama' - case PhaseCategoryEnum.Development: - return 'Yürütme' - case PhaseCategoryEnum.Testing: - return 'İzleme' - case PhaseCategoryEnum.Deployment: - return 'Kapanış' - case PhaseCategoryEnum.Design: - return 'Diğer' - default: - return 'Bilinmeyen' - } -} - -export const getPhaseCategoryColor = (category: PhaseCategoryEnum) => { - switch (category) { - case PhaseCategoryEnum.Planning: - return 'bg-purple-100 text-purple-800' - case PhaseCategoryEnum.Development: - return 'bg-blue-100 text-blue-800' - case PhaseCategoryEnum.Testing: - return 'bg-orange-100 text-orange-800' - case PhaseCategoryEnum.Deployment: - return 'bg-green-100 text-green-800' - case PhaseCategoryEnum.Design: - return 'bg-pink-100 text-pink-800' - default: - return 'bg-gray-100 text-gray-800' - } -} - -export const getTaskStatusText = (status: TaskStatusEnum) => { - switch (status) { - case TaskStatusEnum.NotStarted: - return 'Başlanmadı' - case TaskStatusEnum.InProgress: - return 'Devam Ediyor' - case TaskStatusEnum.Completed: - return 'Tamamlandı' - case TaskStatusEnum.OnHold: - return 'Beklemede' - case TaskStatusEnum.Cancelled: - return 'İptal Edildi' - default: - return 'Bilinmiyor' - } -} - -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 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 getTaskTypeText = (taskType: TaskTypeEnum) => { - switch (taskType) { - case TaskTypeEnum.Development: - return 'Geliştirme' - case TaskTypeEnum.Testing: - return 'Test' - case TaskTypeEnum.Documentation: - return 'Dokümantasyon' - case TaskTypeEnum.Review: - return 'İnceleme' - case TaskTypeEnum.Deployment: - return 'Dağıtım' - case TaskTypeEnum.Meeting: - return 'Toplantı' - default: - return 'Bilinmiyor' - } -} - -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 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 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 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 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 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 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 getSupplierTypeText = (type: SupplierTypeEnum) => { - switch (type) { - case SupplierTypeEnum.Wholesaler: - return 'Toptancı' - case SupplierTypeEnum.Distributor: - return 'Distribütör' - case SupplierTypeEnum.ServiceProvider: - return 'Hizmet Sağlayıcı' - case SupplierTypeEnum.Other: - return 'Diğer' - default: - return 'Bilinmiyor' - } -} - -export const getSupplierTypeColor = (type: SupplierTypeEnum) => { - switch (type) { - case SupplierTypeEnum.Wholesaler: - return 'bg-blue-100 text-blue-800' - case SupplierTypeEnum.Distributor: - return 'bg-green-100 text-green-800' - case SupplierTypeEnum.ServiceProvider: - return 'bg-purple-100 text-purple-800' - case SupplierTypeEnum.Other: - return 'bg-gray-100 text-gray-800' - default: - return 'bg-gray-100 text-gray-800' - } -} - -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 getQualityStatusText = (status: QualityStatusEnum) => { - switch (status) { - case QualityStatusEnum.Approved: - return 'Onaylandı' - case QualityStatusEnum.Rejected: - return 'Reddedildi' - case QualityStatusEnum.Quarantine: - return 'Karantina' - case QualityStatusEnum.Pending: - return 'Beklemede' - case QualityStatusEnum.Conditional: - return 'Koşullu Onay' - default: - return 'Bilinmeyen' - } -} - -export const getQualityStatusColor = (status: QualityStatusEnum) => { - switch (status) { - case QualityStatusEnum.Approved: - return 'bg-green-100 text-green-800' - case QualityStatusEnum.Rejected: - return 'bg-red-100 text-red-800' - case QualityStatusEnum.Quarantine: - return 'bg-yellow-100 text-yellow-800' - case QualityStatusEnum.Pending: - return 'bg-blue-100 text-blue-800' - case QualityStatusEnum.Conditional: - return 'bg-purple-100 text-purple-800' - default: - return 'bg-gray-100 text-gray-800' - } -} - -export const getReceiptStatusText = (status: ReceiptStatusEnum) => { - switch (status) { - case ReceiptStatusEnum.Pending: - return 'Beklemede' - case ReceiptStatusEnum.InProgress: - return 'İşlemde' - case ReceiptStatusEnum.Completed: - return 'Tamamlandı' - case ReceiptStatusEnum.OnHold: - return 'Bekletildi' - default: - return 'Bilinmeyen' - } -} - -export const getReceiptStatusColor = (status: ReceiptStatusEnum) => { - switch (status) { - case ReceiptStatusEnum.Pending: - return 'bg-blue-100 text-blue-800' - case ReceiptStatusEnum.InProgress: - return 'bg-yellow-100 text-yellow-800' - case ReceiptStatusEnum.Completed: - return 'bg-green-100 text-green-800' - case ReceiptStatusEnum.OnHold: - return 'bg-red-100 text-red-800' - default: - return 'bg-gray-100 text-gray-800' - } -} - -export const getSerialStatusText = (status: SerialStatusEnum) => { - switch (status) { - case SerialStatusEnum.Available: - return 'Müsait' - case SerialStatusEnum.InUse: - return 'Kullanımda' - case SerialStatusEnum.Maintenance: - return 'Bakımda' - case SerialStatusEnum.Disposed: - return 'İmha Edildi' - default: - return 'Bilinmeyen' - } -} - -export const getSerialStatusColor = (status: SerialStatusEnum) => { - switch (status) { - case SerialStatusEnum.Available: - return 'bg-green-100 text-green-800' - case SerialStatusEnum.InUse: - return 'bg-blue-100 text-blue-800' - case SerialStatusEnum.Maintenance: - return 'bg-yellow-100 text-yellow-800' - case SerialStatusEnum.Disposed: - return 'bg-red-100 text-red-800' - default: - return '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] -} - -export const getForecastMethodText = (method: ForecastMethodEnum) => { - const methodLabels = { - [ForecastMethodEnum.MovingAverage]: 'Hareketli Ortalama', - [ForecastMethodEnum.ExponentialSmoothing]: 'Üstel Yumuşatma', - [ForecastMethodEnum.LinearRegression]: 'Doğrusal Regresyon', - [ForecastMethodEnum.Seasonal]: 'Mevsimsel', - } - return methodLabels[method] -} - -export const getAccuracyColor = (accuracy: number) => { - if (accuracy >= 90) return 'text-green-600' - if (accuracy >= 75) return 'text-yellow-600' - return 'text-red-600' -} - -export const getCheckStatusText = (status: CheckStatusEnum) => { - const statusLabels = { - [CheckStatusEnum.InHand]: 'Elde', - [CheckStatusEnum.Deposited]: 'Bankaya Verildi', - [CheckStatusEnum.Collected]: 'Tahsil Edildi', - [CheckStatusEnum.Bounced]: 'Karşılıksız', - [CheckStatusEnum.Endorsed]: 'Ciro Edildi', - [CheckStatusEnum.Cancelled]: 'İptal', - } - return statusLabels[status] -} - -export const getCheckStatusColor = (status: CheckStatusEnum) => { - const statusColors = { - [CheckStatusEnum.InHand]: 'bg-blue-100 text-blue-800', - [CheckStatusEnum.Deposited]: 'bg-yellow-100 text-yellow-800', - [CheckStatusEnum.Collected]: 'bg-green-100 text-green-800', - [CheckStatusEnum.Bounced]: 'bg-red-100 text-red-800', - [CheckStatusEnum.Endorsed]: 'bg-purple-100 text-purple-800', - [CheckStatusEnum.Cancelled]: 'bg-gray-100 text-gray-800', - } - return statusColors[status] -} - -export const getNoteStatusText = (status: NoteStatusEnum) => { - const statusLabels = { - [NoteStatusEnum.InHand]: 'Elde', - [NoteStatusEnum.Collected]: 'Tahsil Edildi', - [NoteStatusEnum.Overdue]: 'Vadesi Geçmiş', - [NoteStatusEnum.Endorsed]: 'Ciro Edildi', - [NoteStatusEnum.Cancelled]: 'İptal', - } - return statusLabels[status] -} - -export const getNoteStatusColor = (status: NoteStatusEnum) => { - const statusColors = { - [NoteStatusEnum.InHand]: 'bg-blue-100 text-blue-800', - [NoteStatusEnum.Collected]: 'bg-green-100 text-green-800', - [NoteStatusEnum.Overdue]: 'bg-red-100 text-red-800', - [NoteStatusEnum.Endorsed]: 'bg-purple-100 text-purple-800', - [NoteStatusEnum.Cancelled]: 'bg-gray-100 text-gray-800', - } - return statusColors[status] -} - -export const getTypeText = (status: TypeEnum) => { - const statusLabels = { - [TypeEnum.Received]: 'Alınan', - [TypeEnum.Issued]: 'Verilen', - } - return statusLabels[status] -} - -export const getGanttStatusColor = ( - 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 getGenderText = (status: GenderEnum) => { - const genderLabels = { - [GenderEnum.Male]: 'Erkek', - [GenderEnum.Female]: 'Kadın', - [GenderEnum.Other]: 'Diğer', - } - return genderLabels[status] -} - -export const getMaritalStatusText = (status: MaritalStatusEnum) => { - const statusLabels = { - [MaritalStatusEnum.Single]: 'Bekar', - [MaritalStatusEnum.Married]: 'Evli', - [MaritalStatusEnum.Divorced]: 'Boşanmış', - [MaritalStatusEnum.Widowed]: 'Dul', - } - return statusLabels[status] -} - -export const getCustomerTypeText = (type: CustomerTypeEnum) => { - switch (type) { - case CustomerTypeEnum.Individual: - return 'Bireysel' - case CustomerTypeEnum.Company: - return 'Şirket' - case CustomerTypeEnum.Government: - return 'Devlet' - case CustomerTypeEnum.NonProfit: - return 'Kar Amacı Gütmeyen' - default: - return 'Bilinmeyen' - } -} - -export const getBusinessPartyIndustryText = (industry: BusinessPartyIndustryEnum | string) => { - switch (industry) { - case BusinessPartyIndustryEnum.Technology: - return 'Teknoloji' - case BusinessPartyIndustryEnum.Healthcare: - return 'Sağlık' - case BusinessPartyIndustryEnum.Finance: - return 'Finans' - case BusinessPartyIndustryEnum.Retail: - return 'Perakende' - case BusinessPartyIndustryEnum.Manufacturing: - return 'İmalat' - case BusinessPartyIndustryEnum.Education: - return 'Eğitim' - case BusinessPartyIndustryEnum.Construction: - return 'İnşaat' - case BusinessPartyIndustryEnum.Hospitality: - return 'Konaklama' - case BusinessPartyIndustryEnum.Transportation: - return 'Ulaşım' - case BusinessPartyIndustryEnum.RealEstate: - return 'Emlak' - case BusinessPartyIndustryEnum.Other: - return 'Diğer' - case 'AUTOMOTIVE': // Optionlarda var, enumda yok - return 'Otomotiv' - default: - return 'Bilinmeyen' - } -} diff --git a/ui/src/views/accounting/BankPage.tsx b/ui/src/views/accounting/BankPage.tsx deleted file mode 100644 index cbfe15ba..00000000 --- a/ui/src/views/accounting/BankPage.tsx +++ /dev/null @@ -1,218 +0,0 @@ -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' -import { Container } from '@/components/shared' - -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(undefined) - const [selectedMovement, setSelectedMovement] = useState(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, - phoneNumber: accountData.phoneNumber, - 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 deleted file mode 100644 index 6fc51f1e..00000000 --- a/ui/src/views/accounting/CashPage.tsx +++ /dev/null @@ -1,171 +0,0 @@ -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' -import { Container } from '@/components/shared' - -const CashPage: React.FC = () => { - const [showAccountForm, setShowAccountForm] = useState(false) - const [showMovementForm, setShowMovementForm] = useState(false) - const [showAccountDetails, setShowAccountDetails] = useState(false) - const [editingAccount, setEditingAccount] = useState() - const [editingMovement, setEditingMovement] = useState() - const [viewingAccount, setViewingAccount] = useState() - 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 deleted file mode 100644 index f752f456..00000000 --- a/ui/src/views/accounting/CheckNotePage.tsx +++ /dev/null @@ -1,146 +0,0 @@ -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' -import { Container } from '@/components/shared' - -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, - ) => { - 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, - ) => { - 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 deleted file mode 100644 index 29c9712e..00000000 --- a/ui/src/views/accounting/CurrentAccountPage.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react' -import CurrentAccountManagement from './components/CurrentAccountManagement' -import { mockCurrentAccounts } from '../../mocks/mockCurrentAccounts' -import { mockCurrentAccountMovements } from '../../mocks/mockCurrentAccountMovements' -import { Container } from '@/components/shared' - -const CurrentAccountPage: React.FC = () => { - return ( - - - - ) -} - -export default CurrentAccountPage diff --git a/ui/src/views/accounting/InvoicePage.tsx b/ui/src/views/accounting/InvoicePage.tsx deleted file mode 100644 index c0f49ad8..00000000 --- a/ui/src/views/accounting/InvoicePage.tsx +++ /dev/null @@ -1,173 +0,0 @@ -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' -import { Container } from '@/components/shared' - -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 deleted file mode 100644 index 78d812f8..00000000 --- a/ui/src/views/accounting/WaybillPage.tsx +++ /dev/null @@ -1,139 +0,0 @@ -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' -import { Container } from '@/components/shared' - -type ViewType = 'management' | 'form' | 'details' | 'createInvoice' - -const WaybillPage: React.FC = () => { - const [currentView, setCurrentView] = useState('management') - const [waybills, setWaybills] = useState(mockWaybills) - const [selectedWaybill, setSelectedWaybill] = useState() - - 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 deleted file mode 100644 index 826e7e8f..00000000 --- a/ui/src/views/accounting/components/BankAccountDetails.tsx +++ /dev/null @@ -1,477 +0,0 @@ -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.phoneNumber) && ( -
-

- - İletişim Bilgileri -

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

- - 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 deleted file mode 100644 index 4b731c22..00000000 --- a/ui/src/views/accounting/components/BankAccountForm.tsx +++ /dev/null @@ -1,427 +0,0 @@ -import React, { useState, useEffect } from 'react' -import { FaSave, FaTimes, FaBuilding } from 'react-icons/fa' -import { BankAccountTypeEnum } from '../../../types/fi' -import { BankAccount } from '../../../types/common' -import { getBankAccountTypeText } from '@/utils/erp' -import { mockCurrencies } from '@/mocks/mockCurrencies' - -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: '', - phoneNumber: '', - 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: '', - phoneNumber: '', - 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, - ) => { - 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 deleted file mode 100644 index 15a5740c..00000000 --- a/ui/src/views/accounting/components/BankManagement.tsx +++ /dev/null @@ -1,676 +0,0 @@ -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.phoneNumber && ( -
{account.phoneNumber}
- )} -
- ), - }, - { - 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 deleted file mode 100644 index beae074c..00000000 --- a/ui/src/views/accounting/components/BankMovementForm.tsx +++ /dev/null @@ -1,524 +0,0 @@ -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} -

- )} -
-
- -
- -