erp modülleri initial
This commit is contained in:
parent
795ad3d00c
commit
a4f4a8d338
291 changed files with 126124 additions and 1 deletions
|
|
@ -82,7 +82,7 @@ define(['./workbox-a959eb95'], (function (workbox) { 'use strict';
|
||||||
"revision": "3ca0b8505b4bec776b69afdba2768812"
|
"revision": "3ca0b8505b4bec776b69afdba2768812"
|
||||||
}, {
|
}, {
|
||||||
"url": "/index.html",
|
"url": "/index.html",
|
||||||
"revision": "0.g281p2a917g"
|
"revision": "0.jnromdj77f8"
|
||||||
}], {});
|
}], {});
|
||||||
workbox.cleanupOutdatedCaches();
|
workbox.cleanupOutdatedCaches();
|
||||||
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("/index.html"), {
|
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("/index.html"), {
|
||||||
|
|
|
||||||
165
ui/src/components/common/DataTable.tsx
Normal file
165
ui/src/components/common/DataTable.tsx
Normal file
|
|
@ -0,0 +1,165 @@
|
||||||
|
import React from "react";
|
||||||
|
import classNames from "classnames";
|
||||||
|
import { FaChevronUp, FaChevronDown, FaBox } from "react-icons/fa";
|
||||||
|
|
||||||
|
export interface Column<T> {
|
||||||
|
key: keyof T | string;
|
||||||
|
header: string;
|
||||||
|
width?: string;
|
||||||
|
sortable?: boolean;
|
||||||
|
render?: (item: T) => React.ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface DataTableProps<T> {
|
||||||
|
data: T[];
|
||||||
|
columns: Column<T>[];
|
||||||
|
loading?: boolean;
|
||||||
|
sortBy?: string;
|
||||||
|
sortDirection?: "asc" | "desc";
|
||||||
|
onSort?: (key: string) => void;
|
||||||
|
className?: string;
|
||||||
|
selectable?: boolean; // ✅ ekledik
|
||||||
|
selectedKeys?: string[]; // ✅ ekledik
|
||||||
|
onSelectionChange?: (keys: string[]) => void; // ✅ ekledik
|
||||||
|
}
|
||||||
|
|
||||||
|
function DataTable<T extends { id: string }>({
|
||||||
|
data,
|
||||||
|
columns,
|
||||||
|
loading = false,
|
||||||
|
sortBy,
|
||||||
|
sortDirection,
|
||||||
|
onSort,
|
||||||
|
className,
|
||||||
|
selectable = false,
|
||||||
|
selectedKeys = [],
|
||||||
|
onSelectionChange,
|
||||||
|
}: DataTableProps<T>) {
|
||||||
|
const allSelected = data.length > 0 && selectedKeys.length === data.length;
|
||||||
|
|
||||||
|
const handleSelectAll = (checked: boolean) => {
|
||||||
|
if (!onSelectionChange) return;
|
||||||
|
if (checked) {
|
||||||
|
onSelectionChange(data.map((d) => d.id));
|
||||||
|
} else {
|
||||||
|
onSelectionChange([]);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSelectRow = (id: string, checked: boolean) => {
|
||||||
|
if (!onSelectionChange) return;
|
||||||
|
if (checked) {
|
||||||
|
onSelectionChange([...selectedKeys, id]);
|
||||||
|
} else {
|
||||||
|
onSelectionChange(selectedKeys.filter((k) => k !== id));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (loading) {
|
||||||
|
// (loading skeleton senin kodundaki gibi kalabilir)
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={classNames(
|
||||||
|
"bg-white rounded-md shadow-sm border border-gray-200",
|
||||||
|
className
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<div className="overflow-x-auto">
|
||||||
|
<table className="w-full">
|
||||||
|
<thead className="bg-gray-50">
|
||||||
|
<tr>
|
||||||
|
{selectable && (
|
||||||
|
<th className="px-3 py-2">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
checked={allSelected}
|
||||||
|
onChange={(e) => handleSelectAll(e.target.checked)}
|
||||||
|
/>
|
||||||
|
</th>
|
||||||
|
)}
|
||||||
|
{columns.map((column) => (
|
||||||
|
<th
|
||||||
|
key={String(column.key)}
|
||||||
|
className={classNames(
|
||||||
|
"px-3 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",
|
||||||
|
column.sortable &&
|
||||||
|
onSort &&
|
||||||
|
"cursor-pointer hover:bg-gray-100 transition-colors",
|
||||||
|
column.width && `w-${column.width}`
|
||||||
|
)}
|
||||||
|
onClick={() =>
|
||||||
|
column.sortable && onSort && onSort(String(column.key))
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<div className="flex items-center">
|
||||||
|
{column.header}
|
||||||
|
{column.sortable && onSort && (
|
||||||
|
<div className="ml-1">
|
||||||
|
{sortBy === column.key ? (
|
||||||
|
sortDirection === "asc" ? (
|
||||||
|
<FaChevronUp size={12} className="text-gray-400" />
|
||||||
|
) : (
|
||||||
|
<FaChevronDown
|
||||||
|
size={12}
|
||||||
|
className="text-gray-400"
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
) : (
|
||||||
|
<div className="w-3 h-3" />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</th>
|
||||||
|
))}
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody className="bg-white divide-y divide-gray-200">
|
||||||
|
{data.map((item) => (
|
||||||
|
<tr key={item.id} className="hover:bg-gray-50 transition-colors">
|
||||||
|
{selectable && (
|
||||||
|
<td className="px-3 py-2">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
checked={selectedKeys.includes(item.id)}
|
||||||
|
onChange={(e) =>
|
||||||
|
handleSelectRow(item.id, e.target.checked)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</td>
|
||||||
|
)}
|
||||||
|
{columns.map((column) => (
|
||||||
|
<td
|
||||||
|
key={String(column.key)}
|
||||||
|
className="px-3 py-2 whitespace-nowrap text-sm text-gray-900"
|
||||||
|
>
|
||||||
|
{column.render
|
||||||
|
? column.render(item)
|
||||||
|
: String((item as any)[column.key] || "-")}
|
||||||
|
</td>
|
||||||
|
))}
|
||||||
|
</tr>
|
||||||
|
))}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{data.length === 0 && (
|
||||||
|
<div className="text-center py-8">
|
||||||
|
<div className="text-gray-400 mb-3">
|
||||||
|
<FaBox className="mx-auto h-8 w-8" />
|
||||||
|
</div>
|
||||||
|
<h3 className="text-sm font-medium text-gray-900">Veri bulunamadı</h3>
|
||||||
|
<p className="mt-1 text-xs text-gray-500">
|
||||||
|
Kriterlere uygun kayıt bulunmuyor.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default DataTable;
|
||||||
61
ui/src/components/common/InfoSection.tsx
Normal file
61
ui/src/components/common/InfoSection.tsx
Normal file
|
|
@ -0,0 +1,61 @@
|
||||||
|
import classNames from "classnames";
|
||||||
|
|
||||||
|
interface InfoSectionProps {
|
||||||
|
title: string;
|
||||||
|
children: React.ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const InfoSection: React.FC<InfoSectionProps> = ({
|
||||||
|
title,
|
||||||
|
children,
|
||||||
|
}) => (
|
||||||
|
<div className="space-y-2">
|
||||||
|
<h3 className="text-sm font-medium text-gray-900 border-b pb-1 mb-2">
|
||||||
|
{title}
|
||||||
|
</h3>
|
||||||
|
<div className="space-y-2.5 text-sm">{children}</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
|
interface InfoItemProps {
|
||||||
|
label: string;
|
||||||
|
value: string | number;
|
||||||
|
isMono?: boolean;
|
||||||
|
isBold?: boolean;
|
||||||
|
isBadge?: boolean;
|
||||||
|
badgeColor?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const InfoItem: React.FC<InfoItemProps> = ({
|
||||||
|
label,
|
||||||
|
value,
|
||||||
|
isMono,
|
||||||
|
isBold,
|
||||||
|
isBadge,
|
||||||
|
badgeColor,
|
||||||
|
}) => (
|
||||||
|
<div>
|
||||||
|
<label className="text-xs font-medium text-gray-500">{label}</label>
|
||||||
|
{isBadge ? (
|
||||||
|
<p>
|
||||||
|
<span
|
||||||
|
className={classNames(
|
||||||
|
"px-2 py-0.5 rounded-full text-xs font-medium",
|
||||||
|
badgeColor || "bg-gray-100 text-gray-800"
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{value}
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
|
) : (
|
||||||
|
<p
|
||||||
|
className={classNames("text-gray-900", {
|
||||||
|
"font-mono": isMono,
|
||||||
|
"font-semibold": isBold,
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
{value}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
41
ui/src/components/common/LoadingSpinner.tsx
Normal file
41
ui/src/components/common/LoadingSpinner.tsx
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
import React from 'react';
|
||||||
|
import classNames from 'classnames';
|
||||||
|
|
||||||
|
interface LoadingSpinnerProps {
|
||||||
|
size?: 'sm' | 'md' | 'lg';
|
||||||
|
color?: 'blue' | 'white' | 'gray';
|
||||||
|
text?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const LoadingSpinner: React.FC<LoadingSpinnerProps> = ({
|
||||||
|
size = 'md',
|
||||||
|
color = 'blue',
|
||||||
|
text
|
||||||
|
}) => {
|
||||||
|
const sizeClasses = {
|
||||||
|
sm: 'h-4 w-4',
|
||||||
|
md: 'h-6 w-6',
|
||||||
|
lg: 'h-8 w-8'
|
||||||
|
};
|
||||||
|
|
||||||
|
const colorClasses = {
|
||||||
|
blue: 'border-blue-600',
|
||||||
|
white: 'border-white',
|
||||||
|
gray: 'border-gray-600'
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="flex items-center justify-center">
|
||||||
|
<div
|
||||||
|
className={classNames(
|
||||||
|
'animate-spin rounded-full border-b-2',
|
||||||
|
sizeClasses[size],
|
||||||
|
colorClasses[color]
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
{text && <span className="ml-3 text-gray-600">{text}</span>}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default LoadingSpinner;
|
||||||
64
ui/src/components/common/ModuleHeader.tsx
Normal file
64
ui/src/components/common/ModuleHeader.tsx
Normal file
|
|
@ -0,0 +1,64 @@
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
|
interface ModuleHeaderProps {
|
||||||
|
title: string;
|
||||||
|
breadcrumbs?: Array<{
|
||||||
|
name: string;
|
||||||
|
href?: string;
|
||||||
|
}>;
|
||||||
|
}
|
||||||
|
|
||||||
|
const ModuleHeader: React.FC<ModuleHeaderProps> = ({
|
||||||
|
title,
|
||||||
|
breadcrumbs = [],
|
||||||
|
}) => {
|
||||||
|
return (
|
||||||
|
<div className="bg-white border-b border-gray-200 px-4 py-3">
|
||||||
|
{/* Breadcrumb Navigation */}
|
||||||
|
<nav className="flex" aria-label="Breadcrumb">
|
||||||
|
<ol className="flex items-center space-x-1 text-sm">
|
||||||
|
<li>
|
||||||
|
<div className="flex items-center">
|
||||||
|
<svg
|
||||||
|
className="h-4 w-4 text-gray-400"
|
||||||
|
fill="none"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
stroke="currentColor"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
strokeWidth={2}
|
||||||
|
d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
<span className="ml-1 font-medium text-gray-500">Anasayfa</span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
{breadcrumbs.map((breadcrumb, index) => (
|
||||||
|
<li key={index}>
|
||||||
|
<div className="flex items-center">
|
||||||
|
<span className="text-gray-400 mx-2">/</span>
|
||||||
|
<span className="font-medium text-gray-500">
|
||||||
|
{breadcrumb.name}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<div className="flex items-center">
|
||||||
|
<span className="text-gray-400 mx-2">/</span>
|
||||||
|
<span className="font-medium text-gray-900" aria-current="page">
|
||||||
|
{title}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default ModuleHeader;
|
||||||
180
ui/src/components/common/MultiSelectEmployee.tsx
Normal file
180
ui/src/components/common/MultiSelectEmployee.tsx
Normal file
|
|
@ -0,0 +1,180 @@
|
||||||
|
import React, { useState, useRef, useEffect } from "react";
|
||||||
|
import { FaChevronDown, FaTimes } from "react-icons/fa";
|
||||||
|
import { mockEmployees } from "../../mocks/mockEmployees";
|
||||||
|
import { HrEmployee } from "../../types/hr";
|
||||||
|
|
||||||
|
interface MultiSelectEmployeeProps {
|
||||||
|
selectedEmployees: string[];
|
||||||
|
onChange: (employeeIds: string[]) => void;
|
||||||
|
placeholder?: string;
|
||||||
|
disabled?: boolean;
|
||||||
|
className?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const MultiSelectEmployee: React.FC<MultiSelectEmployeeProps> = ({
|
||||||
|
selectedEmployees,
|
||||||
|
onChange,
|
||||||
|
placeholder = "Personel seçin",
|
||||||
|
disabled = false,
|
||||||
|
className = "",
|
||||||
|
}) => {
|
||||||
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
|
const [searchTerm, setSearchTerm] = useState("");
|
||||||
|
const dropdownRef = useRef<HTMLDivElement>(null);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const handleClickOutside = (event: MouseEvent) => {
|
||||||
|
if (
|
||||||
|
dropdownRef.current &&
|
||||||
|
!dropdownRef.current.contains(event.target as Node)
|
||||||
|
) {
|
||||||
|
setIsOpen(false);
|
||||||
|
setSearchTerm("");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
document.addEventListener("mousedown", handleClickOutside);
|
||||||
|
return () => {
|
||||||
|
document.removeEventListener("mousedown", handleClickOutside);
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const filteredEmployees = mockEmployees.filter(
|
||||||
|
(employee: HrEmployee) =>
|
||||||
|
employee.fullName.toLowerCase().includes(searchTerm.toLowerCase()) ||
|
||||||
|
employee.code.toLowerCase().includes(searchTerm.toLowerCase())
|
||||||
|
);
|
||||||
|
|
||||||
|
const handleEmployeeToggle = (employeeId: string) => {
|
||||||
|
if (selectedEmployees.includes(employeeId)) {
|
||||||
|
onChange(selectedEmployees.filter((id) => id !== employeeId));
|
||||||
|
} else {
|
||||||
|
onChange([...selectedEmployees, employeeId]);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleRemoveEmployee = (employeeId: string, e: React.MouseEvent) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
onChange(selectedEmployees.filter((id) => id !== employeeId));
|
||||||
|
};
|
||||||
|
|
||||||
|
const selectedEmployeeObjects = mockEmployees.filter((emp: HrEmployee) =>
|
||||||
|
selectedEmployees.includes(emp.id)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={`relative ${className}`} ref={dropdownRef}>
|
||||||
|
<div
|
||||||
|
className={`
|
||||||
|
w-full min-h-[38px] px-2 py-2 border border-gray-300 rounded-lg
|
||||||
|
focus:ring-2 focus:ring-blue-500 focus:border-blue-500 cursor-pointer
|
||||||
|
${
|
||||||
|
disabled
|
||||||
|
? "bg-gray-100 cursor-not-allowed"
|
||||||
|
: "bg-white hover:border-gray-400"
|
||||||
|
}
|
||||||
|
`}
|
||||||
|
onClick={() => !disabled && setIsOpen(!isOpen)}
|
||||||
|
>
|
||||||
|
<div className="flex items-center justify-between">
|
||||||
|
<div className="flex flex-wrap gap-1 flex-1">
|
||||||
|
{selectedEmployeeObjects.length > 0 ? (
|
||||||
|
selectedEmployeeObjects.map((employee: HrEmployee) => (
|
||||||
|
<span
|
||||||
|
key={employee.id}
|
||||||
|
className="inline-flex items-center px-2 py-1 rounded-md text-xs font-medium bg-blue-100 text-blue-800"
|
||||||
|
>
|
||||||
|
{employee.fullName}
|
||||||
|
{!disabled && (
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={(e) => handleRemoveEmployee(employee.id, e)}
|
||||||
|
className="ml-1 inline-flex items-center justify-center w-4 h-4 rounded-full hover:bg-blue-200"
|
||||||
|
>
|
||||||
|
<FaTimes className="w-2 h-2" />
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
))
|
||||||
|
) : (
|
||||||
|
<span className="text-gray-500">{placeholder}</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
{!disabled && (
|
||||||
|
<FaChevronDown
|
||||||
|
className={`w-4 h-4 text-gray-400 transition-transform ${
|
||||||
|
isOpen ? "transform rotate-180" : ""
|
||||||
|
}`}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{isOpen && !disabled && (
|
||||||
|
<div className="absolute z-50 w-full mt-1 bg-white border border-gray-300 rounded-lg shadow-lg max-h-60 overflow-hidden">
|
||||||
|
{/* Search Input */}
|
||||||
|
<div className="p-2 border-b border-gray-200">
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
placeholder="Personel ara..."
|
||||||
|
value={searchTerm}
|
||||||
|
onChange={(e) => 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()}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Options List */}
|
||||||
|
<div className="max-h-48 overflow-y-auto">
|
||||||
|
{filteredEmployees.length > 0 ? (
|
||||||
|
filteredEmployees.map((employee: HrEmployee) => (
|
||||||
|
<div
|
||||||
|
key={employee.id}
|
||||||
|
className={`
|
||||||
|
px-3 py-2 cursor-pointer hover:bg-gray-100 flex items-center justify-between
|
||||||
|
${
|
||||||
|
selectedEmployees.includes(employee.id)
|
||||||
|
? "bg-blue-50"
|
||||||
|
: ""
|
||||||
|
}
|
||||||
|
`}
|
||||||
|
onClick={() => handleEmployeeToggle(employee.id)}
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<div className="text-sm font-medium text-gray-900">
|
||||||
|
{employee.fullName}
|
||||||
|
</div>
|
||||||
|
<div className="text-xs text-gray-500">
|
||||||
|
{employee.code} - {employee.jobPosition?.name}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{selectedEmployees.includes(employee.id) && (
|
||||||
|
<div className="w-4 h-4 bg-blue-500 text-white rounded-full flex items-center justify-center">
|
||||||
|
<svg
|
||||||
|
className="w-3 h-3"
|
||||||
|
fill="currentColor"
|
||||||
|
viewBox="0 0 20 20"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
fillRule="evenodd"
|
||||||
|
d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z"
|
||||||
|
clipRule="evenodd"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
))
|
||||||
|
) : (
|
||||||
|
<div className="px-3 py-2 text-sm text-gray-500">
|
||||||
|
Personel bulunamadı
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default MultiSelectEmployee;
|
||||||
190
ui/src/components/common/MultiSelectTeam.tsx
Normal file
190
ui/src/components/common/MultiSelectTeam.tsx
Normal file
|
|
@ -0,0 +1,190 @@
|
||||||
|
import React, { useState, useRef, useEffect } from "react";
|
||||||
|
import { FaChevronDown, FaTimes } from "react-icons/fa";
|
||||||
|
import { mockMaintenanceTeams } from "../../mocks/mockMaintenanceTeams";
|
||||||
|
import { Team } from "../../types/common";
|
||||||
|
|
||||||
|
interface MultiSelectTeamProps {
|
||||||
|
selectedTeams: string[];
|
||||||
|
onChange: (teams: string[]) => void;
|
||||||
|
placeholder?: string;
|
||||||
|
disabled?: boolean;
|
||||||
|
className?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const MultiSelectTeam: React.FC<MultiSelectTeamProps> = ({
|
||||||
|
selectedTeams,
|
||||||
|
onChange,
|
||||||
|
placeholder = "Ekip seçin",
|
||||||
|
disabled = false,
|
||||||
|
className = "",
|
||||||
|
}) => {
|
||||||
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
|
const [searchTerm, setSearchTerm] = useState("");
|
||||||
|
const dropdownRef = useRef<HTMLDivElement>(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 (
|
||||||
|
<div className={`relative ${className}`} ref={dropdownRef}>
|
||||||
|
<div
|
||||||
|
className={`
|
||||||
|
w-full min-h-[38px] px-2 py-2 border border-gray-300 rounded-lg
|
||||||
|
focus:ring-2 focus:ring-blue-500 focus:border-blue-500 cursor-pointer
|
||||||
|
${
|
||||||
|
disabled
|
||||||
|
? "bg-gray-100 cursor-not-allowed"
|
||||||
|
: "bg-white hover:border-gray-400"
|
||||||
|
}
|
||||||
|
`}
|
||||||
|
onClick={() => !disabled && setIsOpen(!isOpen)}
|
||||||
|
>
|
||||||
|
<div className="flex items-center justify-between">
|
||||||
|
<div className="flex flex-wrap gap-1 flex-1">
|
||||||
|
{selectedTeamObjects.length > 0 ? (
|
||||||
|
selectedTeamObjects.map((team: Team) => (
|
||||||
|
<span
|
||||||
|
key={team.id}
|
||||||
|
className="inline-flex items-center px-2 py-1 rounded-md text-xs font-medium bg-blue-100 text-blue-800"
|
||||||
|
>
|
||||||
|
{team.name}
|
||||||
|
{!disabled && (
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={(e) => handleRemoveTeam(team.name, e)}
|
||||||
|
className="ml-1 inline-flex items-center justify-center w-4 h-4 rounded-full hover:bg-blue-200"
|
||||||
|
>
|
||||||
|
<FaTimes className="w-2 h-2" />
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
))
|
||||||
|
) : (
|
||||||
|
<span className="text-gray-500">{placeholder}</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
{!disabled && (
|
||||||
|
<FaChevronDown
|
||||||
|
className={`w-4 h-4 text-gray-400 transition-transform ${
|
||||||
|
isOpen ? "transform rotate-180" : ""
|
||||||
|
}`}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{isOpen && !disabled && (
|
||||||
|
<div className="absolute z-50 w-full mt-1 bg-white border border-gray-300 rounded-lg shadow-lg max-h-60 overflow-hidden">
|
||||||
|
{/* Search Input */}
|
||||||
|
<div className="p-2 border-b border-gray-200">
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
placeholder="Ekip ara..."
|
||||||
|
value={searchTerm}
|
||||||
|
onChange={(e) => 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()}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Options List */}
|
||||||
|
<div className="max-h-48 overflow-y-auto">
|
||||||
|
{filteredTeams.length > 0 ? (
|
||||||
|
filteredTeams.map((team: Team) => (
|
||||||
|
<div
|
||||||
|
key={team.id}
|
||||||
|
className={`
|
||||||
|
px-3 py-2 cursor-pointer hover:bg-gray-100 flex items-center justify-between
|
||||||
|
${selectedTeams.includes(team.name) ? "bg-blue-50" : ""}
|
||||||
|
`}
|
||||||
|
onClick={() => handleTeamToggle(team.name)}
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<div className="text-sm font-medium text-gray-900">
|
||||||
|
{team.name}
|
||||||
|
</div>
|
||||||
|
<div className="text-xs text-gray-500">
|
||||||
|
{team.code} - {team.description}
|
||||||
|
</div>
|
||||||
|
<div className="flex items-center mt-1">
|
||||||
|
<span
|
||||||
|
className={`inline-flex items-center px-2 py-1 rounded-full text-xs font-medium ${
|
||||||
|
team.isActive
|
||||||
|
? "bg-green-100 text-green-800"
|
||||||
|
: "bg-gray-100 text-gray-800"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
{team.isActive ? "Aktif" : "Pasif"}
|
||||||
|
</span>
|
||||||
|
<span className="ml-2 text-xs text-gray-500">
|
||||||
|
{team.members.filter((m) => m.isActive).length} üye
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{selectedTeams.includes(team.name) && (
|
||||||
|
<div className="w-4 h-4 bg-blue-500 text-white rounded-full flex items-center justify-center">
|
||||||
|
<svg
|
||||||
|
className="w-3 h-3"
|
||||||
|
fill="currentColor"
|
||||||
|
viewBox="0 0 20 20"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
fillRule="evenodd"
|
||||||
|
d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z"
|
||||||
|
clipRule="evenodd"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
))
|
||||||
|
) : (
|
||||||
|
<div className="px-3 py-2 text-sm text-gray-500">
|
||||||
|
Ekip bulunamadı
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default MultiSelectTeam;
|
||||||
89
ui/src/components/common/StatusBadge.tsx
Normal file
89
ui/src/components/common/StatusBadge.tsx
Normal file
|
|
@ -0,0 +1,89 @@
|
||||||
|
import React from "react";
|
||||||
|
import classNames from "classnames";
|
||||||
|
import {
|
||||||
|
FaCheckCircle,
|
||||||
|
FaExclamationTriangle,
|
||||||
|
FaClock,
|
||||||
|
FaTimes,
|
||||||
|
} from "react-icons/fa";
|
||||||
|
|
||||||
|
interface StatusBadgeProps {
|
||||||
|
status: string;
|
||||||
|
size?: "sm" | "md";
|
||||||
|
showIcon?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
const StatusBadge: React.FC<StatusBadgeProps> = ({
|
||||||
|
status,
|
||||||
|
size = "md",
|
||||||
|
showIcon = true,
|
||||||
|
}) => {
|
||||||
|
const sizeClasses = {
|
||||||
|
sm: "px-1.5 py-0.5 text-xs",
|
||||||
|
md: "px-2 py-0.5 text-xs",
|
||||||
|
};
|
||||||
|
|
||||||
|
const getStatusConfig = (status: string) => {
|
||||||
|
switch (status) {
|
||||||
|
case "active":
|
||||||
|
return {
|
||||||
|
color: "bg-green-100 text-green-800",
|
||||||
|
icon: <FaCheckCircle size={14} />,
|
||||||
|
text: "Aktif",
|
||||||
|
};
|
||||||
|
case "inactive":
|
||||||
|
return {
|
||||||
|
color: "bg-red-100 text-red-800",
|
||||||
|
icon: <FaTimes size={14} />,
|
||||||
|
text: "Pasif",
|
||||||
|
};
|
||||||
|
case "pending":
|
||||||
|
return {
|
||||||
|
color: "bg-yellow-100 text-yellow-800",
|
||||||
|
icon: <FaClock size={14} />,
|
||||||
|
text: "Beklemede",
|
||||||
|
};
|
||||||
|
case "critical":
|
||||||
|
return {
|
||||||
|
color: "bg-red-100 text-red-800",
|
||||||
|
icon: <FaExclamationTriangle size={14} />,
|
||||||
|
text: "Kritik",
|
||||||
|
};
|
||||||
|
case "low":
|
||||||
|
return {
|
||||||
|
color: "bg-yellow-100 text-yellow-800",
|
||||||
|
icon: <FaExclamationTriangle size={14} />,
|
||||||
|
text: "Düşük",
|
||||||
|
};
|
||||||
|
case "normal":
|
||||||
|
return {
|
||||||
|
color: "bg-green-100 text-green-800",
|
||||||
|
icon: <FaCheckCircle size={14} />,
|
||||||
|
text: "Normal",
|
||||||
|
};
|
||||||
|
default:
|
||||||
|
return {
|
||||||
|
color: "bg-gray-100 text-gray-800",
|
||||||
|
icon: <FaCheckCircle size={14} />,
|
||||||
|
text: "Bilinmiyor",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const config = getStatusConfig(status);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<span
|
||||||
|
className={classNames(
|
||||||
|
"inline-flex items-center rounded-full font-medium",
|
||||||
|
config.color,
|
||||||
|
sizeClasses[size]
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{showIcon && <span className="mr-1">{config.icon}</span>}
|
||||||
|
{config.text}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default StatusBadge;
|
||||||
100
ui/src/components/common/Widget.tsx
Normal file
100
ui/src/components/common/Widget.tsx
Normal file
|
|
@ -0,0 +1,100 @@
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import classNames from "classnames";
|
||||||
|
import { iconList } from "./iconList";
|
||||||
|
|
||||||
|
export type colorType =
|
||||||
|
| "blue"
|
||||||
|
| "green"
|
||||||
|
| "purple"
|
||||||
|
| "gray"
|
||||||
|
| "red"
|
||||||
|
| "yellow"
|
||||||
|
| "pink"
|
||||||
|
| "indigo"
|
||||||
|
| "teal"
|
||||||
|
| "orange";
|
||||||
|
|
||||||
|
interface WidgetProps {
|
||||||
|
title: string;
|
||||||
|
value: string | number;
|
||||||
|
valueClassName?: string;
|
||||||
|
color?: colorType;
|
||||||
|
icon?: (typeof iconList)[number];
|
||||||
|
subTitle?: string;
|
||||||
|
onClick?: () => void;
|
||||||
|
className?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function Widget({
|
||||||
|
title,
|
||||||
|
value,
|
||||||
|
valueClassName = "text-3xl",
|
||||||
|
color = "blue",
|
||||||
|
icon = "FaChartBar",
|
||||||
|
subTitle = "-",
|
||||||
|
onClick,
|
||||||
|
className,
|
||||||
|
}: WidgetProps) {
|
||||||
|
const [IconComponent, setIconComponent] = useState<React.ComponentType<{
|
||||||
|
className?: string;
|
||||||
|
}> | null>(null);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
let isMounted = true;
|
||||||
|
import("react-icons/fa").then((icons) => {
|
||||||
|
if (isMounted && icon && icon in icons) {
|
||||||
|
setIconComponent(() => (icons as any)[icon]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return () => {
|
||||||
|
isMounted = false;
|
||||||
|
};
|
||||||
|
}, [icon]);
|
||||||
|
|
||||||
|
const colorMap: Record<string, { bg: string; text: string }> = {
|
||||||
|
blue: { bg: "from-blue-100 to-blue-200", text: "text-blue-600" },
|
||||||
|
green: { bg: "from-green-100 to-green-200", text: "text-green-600" },
|
||||||
|
purple: { bg: "from-purple-100 to-purple-200", text: "text-purple-600" },
|
||||||
|
gray: { bg: "from-gray-100 to-gray-200", text: "text-gray-600" },
|
||||||
|
red: { bg: "from-red-100 to-red-200", text: "text-red-600" },
|
||||||
|
yellow: { bg: "from-yellow-100 to-yellow-200", text: "text-yellow-600" },
|
||||||
|
pink: { bg: "from-pink-100 to-pink-200", text: "text-pink-600" },
|
||||||
|
indigo: { bg: "from-indigo-100 to-indigo-200", text: "text-indigo-600" },
|
||||||
|
teal: { bg: "from-teal-100 to-teal-200", text: "text-teal-600" },
|
||||||
|
orange: { bg: "from-orange-100 to-orange-200", text: "text-orange-600" },
|
||||||
|
};
|
||||||
|
|
||||||
|
const safeColor = color && colorMap[color] ? color : "green";
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
onClick={onClick}
|
||||||
|
className={classNames(
|
||||||
|
"bg-white rounded-lg shadow-sm border border-gray-200 p-4 flex flex-col justify-between",
|
||||||
|
onClick && "cursor-pointer hover:bg-gray-50",
|
||||||
|
className
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<div className="flex items-center justify-between">
|
||||||
|
<div>
|
||||||
|
<p className="text-sm font-semibold text-gray-600 uppercase tracking-wide">
|
||||||
|
{title}
|
||||||
|
</p>
|
||||||
|
<p
|
||||||
|
className={`${valueClassName} font-bold mt-1 ${colorMap[safeColor].text}`}
|
||||||
|
>
|
||||||
|
{value}
|
||||||
|
</p>
|
||||||
|
<p className="text-sm text-gray-500 mt-1">{subTitle}</p>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
className={`w-12 h-12 bg-gradient-to-br ${colorMap[safeColor].bg} rounded-xl flex items-center justify-center shadow-sm`}
|
||||||
|
>
|
||||||
|
{IconComponent ? (
|
||||||
|
<IconComponent className={`w-6 h-6 ${colorMap[safeColor].text}`} />
|
||||||
|
) : null}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
47
ui/src/components/common/WidgetGroup.tsx
Normal file
47
ui/src/components/common/WidgetGroup.tsx
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
import classNames from "classnames";
|
||||||
|
import Widget, { type colorType } from "./Widget";
|
||||||
|
import { useNavigate } from "react-router-dom";
|
||||||
|
import { WidgetEditDto, WidgetGroupDto } from "../../types/common";
|
||||||
|
|
||||||
|
export default function WidgetGroup({
|
||||||
|
widgetGroups,
|
||||||
|
}: {
|
||||||
|
widgetGroups: WidgetGroupDto[];
|
||||||
|
}) {
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
{widgetGroups.map((group, gIdx) => (
|
||||||
|
<div
|
||||||
|
key={gIdx}
|
||||||
|
className={classNames(
|
||||||
|
`grid grid-cols-12 gap-${group.colGap} ${group.className || ""}`
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{group.items.map((item: WidgetEditDto, order: number) => (
|
||||||
|
<div
|
||||||
|
key={`${gIdx}-${order}`}
|
||||||
|
className={classNames(`col-span-${group.colSpan}`)}
|
||||||
|
>
|
||||||
|
<Widget
|
||||||
|
title={item.title}
|
||||||
|
value={item.value}
|
||||||
|
color={item.color as colorType}
|
||||||
|
icon={item.icon}
|
||||||
|
subTitle={item.subTitle}
|
||||||
|
valueClassName={item.valueClassName}
|
||||||
|
onClick={() => {
|
||||||
|
if (item.onClick) {
|
||||||
|
// eslint-disable-next-line no-eval
|
||||||
|
eval(item.onClick);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
1613
ui/src/components/common/iconList.ts
Normal file
1613
ui/src/components/common/iconList.ts
Normal file
File diff suppressed because it is too large
Load diff
174
ui/src/mocks/mockActivities.ts
Normal file
174
ui/src/mocks/mockActivities.ts
Normal file
|
|
@ -0,0 +1,174 @@
|
||||||
|
import { PriorityEnum } from "../types/common";
|
||||||
|
import {
|
||||||
|
CrmActivity,
|
||||||
|
CrmActivityTypeEnum,
|
||||||
|
ActivityStatusEnum,
|
||||||
|
} from "../types/crm";
|
||||||
|
import { mockBusinessParties } from "./mockBusinessParties";
|
||||||
|
import { mockEmployees } from "./mockEmployees";
|
||||||
|
|
||||||
|
export const mockActivities: CrmActivity[] = [
|
||||||
|
{
|
||||||
|
id: "act_001",
|
||||||
|
activityType: CrmActivityTypeEnum.Call,
|
||||||
|
subject: "Teklif Görüşmesi - ABC Şirketi",
|
||||||
|
description: "Yeni proje için teklif sunumu ve fiyat görüşmesi yapılacak.",
|
||||||
|
customerId: "6",
|
||||||
|
customer: mockBusinessParties.find((cust) => cust.id === "6"),
|
||||||
|
activityDate: new Date("2024-01-25T10:00:00"),
|
||||||
|
startTime: new Date("2024-01-25T10:00:00"),
|
||||||
|
endTime: new Date("2024-01-25T11:00:00"),
|
||||||
|
duration: 60,
|
||||||
|
assignedTo: "1",
|
||||||
|
assigned: mockEmployees.find((emp) => emp.id === "1"),
|
||||||
|
participants: ["3", "2"],
|
||||||
|
status: ActivityStatusEnum.Planned,
|
||||||
|
priority: PriorityEnum.High,
|
||||||
|
followUpDate: new Date("2024-01-30"),
|
||||||
|
followUpActivity: "Teklif cevabı takip edilecek",
|
||||||
|
creationTime: new Date("2024-01-20T09:00:00"),
|
||||||
|
lastModificationTime: new Date("2024-01-20T09:00:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "act_002",
|
||||||
|
activityType: CrmActivityTypeEnum.Meeting,
|
||||||
|
subject: "Proje Kickoff Toplantısı",
|
||||||
|
description: "XYZ projesi için başlangıç toplantısı düzenlenecek.",
|
||||||
|
customerId: "5",
|
||||||
|
customer: mockBusinessParties.find((cust) => cust.id === "5"),
|
||||||
|
activityDate: new Date("2024-01-24T14:00:00"),
|
||||||
|
startTime: new Date("2024-01-24T14:00:00"),
|
||||||
|
endTime: new Date("2024-01-24T16:00:00"),
|
||||||
|
duration: 120,
|
||||||
|
assignedTo: "2",
|
||||||
|
assigned: mockEmployees.find((emp) => emp.id === "2"),
|
||||||
|
participants: ["3", "2", "4"],
|
||||||
|
status: ActivityStatusEnum.Completed,
|
||||||
|
priority: PriorityEnum.Normal,
|
||||||
|
outcome: "Proje kapsamı netleştirildi ve görev dağılımı yapıldı.",
|
||||||
|
nextSteps: "Detaylı proje planı hazırlanacak.",
|
||||||
|
creationTime: new Date("2024-01-18T11:30:00"),
|
||||||
|
lastModificationTime: new Date("2024-01-24T16:15:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "act_003",
|
||||||
|
activityType: CrmActivityTypeEnum.Email,
|
||||||
|
subject: "Ürün Katalogu Gönderimi",
|
||||||
|
description:
|
||||||
|
"Müşteriye güncel ürün katalogu ve fiyat listesi e-posta ile gönderildi.",
|
||||||
|
customerId: "5",
|
||||||
|
customer: mockBusinessParties.find((cust) => cust.id === "5"),
|
||||||
|
activityDate: new Date("2024-01-23T09:30:00"),
|
||||||
|
duration: 15,
|
||||||
|
assignedTo: "3",
|
||||||
|
assigned: mockEmployees.find((emp) => emp.id === "3"),
|
||||||
|
participants: [],
|
||||||
|
status: ActivityStatusEnum.Completed,
|
||||||
|
priority: PriorityEnum.Low,
|
||||||
|
outcome: "Katalog başarıyla gönderildi, müşteri geri dönüş yaptı.",
|
||||||
|
creationTime: new Date("2024-01-23T09:15:00"),
|
||||||
|
lastModificationTime: new Date("2024-01-23T09:45:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "act_004",
|
||||||
|
activityType: CrmActivityTypeEnum.Demo,
|
||||||
|
subject: "Yazılım Demo Sunumu",
|
||||||
|
description:
|
||||||
|
"ERP sisteminin demo sunumu müşteri lokasyonunda gerçekleştirilecek.",
|
||||||
|
customerId: "5",
|
||||||
|
customer: mockBusinessParties.find((cust) => cust.id === "5"),
|
||||||
|
activityDate: new Date("2024-01-26T13:00:00"),
|
||||||
|
startTime: new Date("2024-01-26T13:00:00"),
|
||||||
|
endTime: new Date("2024-01-26T15:00:00"),
|
||||||
|
duration: 120,
|
||||||
|
assignedTo: "4",
|
||||||
|
assigned: mockEmployees.find((emp) => emp.id === "4"),
|
||||||
|
participants: ["5", "10"],
|
||||||
|
status: ActivityStatusEnum.InProgress,
|
||||||
|
priority: PriorityEnum.High,
|
||||||
|
followUpDate: new Date("2024-01-29"),
|
||||||
|
followUpActivity: "Demo sonrası müşteri geri bildirimlerini al",
|
||||||
|
creationTime: new Date("2024-01-19T16:00:00"),
|
||||||
|
lastModificationTime: new Date("2024-01-22T10:30:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "act_005",
|
||||||
|
activityType: CrmActivityTypeEnum.Task,
|
||||||
|
subject: "Müşteri Memnuniyet Anketi",
|
||||||
|
description:
|
||||||
|
"Proje teslimi sonrası müşteri memnuniyet anketi düzenlenecek.",
|
||||||
|
customerId: "6",
|
||||||
|
customer: mockBusinessParties.find((cust) => cust.id === "6"),
|
||||||
|
activityDate: new Date("2024-01-28T10:00:00"),
|
||||||
|
duration: 30,
|
||||||
|
assignedTo: "5",
|
||||||
|
assigned: mockEmployees.find((emp) => emp.id === "5"),
|
||||||
|
participants: [],
|
||||||
|
status: ActivityStatusEnum.Planned,
|
||||||
|
priority: PriorityEnum.Normal,
|
||||||
|
followUpDate: new Date("2024-02-05"),
|
||||||
|
followUpActivity: "Anket sonuçlarını değerlendir ve rapor hazırla",
|
||||||
|
creationTime: new Date("2024-01-21T14:20:00"),
|
||||||
|
lastModificationTime: new Date("2024-01-21T14:20:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "act_006",
|
||||||
|
activityType: CrmActivityTypeEnum.Note,
|
||||||
|
subject: "Müşteri Taleplerini Değerlendirme",
|
||||||
|
description:
|
||||||
|
"Müşterinin ek özellik talepleri not alındı ve teknik ekiple paylaşıldı.",
|
||||||
|
customerId: "6",
|
||||||
|
customer: mockBusinessParties.find((cust) => cust.id === "6"),
|
||||||
|
activityDate: new Date("2024-01-22T15:45:00"),
|
||||||
|
assignedTo: "6",
|
||||||
|
assigned: mockEmployees.find((emp) => emp.id === "6"),
|
||||||
|
participants: [],
|
||||||
|
status: ActivityStatusEnum.Completed,
|
||||||
|
priority: PriorityEnum.Normal,
|
||||||
|
outcome:
|
||||||
|
"Talepler teknik ekiple değerlendirildi, uygulama planı oluşturuldu.",
|
||||||
|
nextSteps: "Müşteriye geri dönüş yapılacak ve timeline paylaşılacak.",
|
||||||
|
creationTime: new Date("2024-01-22T15:30:00"),
|
||||||
|
lastModificationTime: new Date("2024-01-22T16:00:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "act_007",
|
||||||
|
activityType: CrmActivityTypeEnum.Proposal,
|
||||||
|
subject: "Yıllık Bakım Sözleşmesi Teklifi",
|
||||||
|
description:
|
||||||
|
"Sistemin yıllık bakım ve destek hizmetleri için teklif hazırlandı.",
|
||||||
|
customerId: "5",
|
||||||
|
customer: mockBusinessParties.find((cust) => cust.id === "5"),
|
||||||
|
activityDate: new Date("2024-01-27T11:00:00"),
|
||||||
|
duration: 45,
|
||||||
|
assignedTo: "7",
|
||||||
|
assigned: mockEmployees.find((emp) => emp.id === "7"),
|
||||||
|
participants: ["7"],
|
||||||
|
status: ActivityStatusEnum.Planned,
|
||||||
|
priority: PriorityEnum.Normal,
|
||||||
|
followUpDate: new Date("2024-02-03"),
|
||||||
|
followUpActivity: "Teklif sunumu yapılacak",
|
||||||
|
creationTime: new Date("2024-01-24T09:30:00"),
|
||||||
|
lastModificationTime: new Date("2024-01-24T09:30:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "act_008",
|
||||||
|
activityType: CrmActivityTypeEnum.Call,
|
||||||
|
subject: "Ödeme Planı Görüşmesi",
|
||||||
|
description:
|
||||||
|
"Projenin ödeme planı ve faturalandırma detayları görüşülecek.",
|
||||||
|
customerId: "5",
|
||||||
|
customer: mockBusinessParties.find((cust) => cust.id === "5"),
|
||||||
|
activityDate: new Date("2024-01-29T09:00:00"),
|
||||||
|
startTime: new Date("2024-01-29T09:00:00"),
|
||||||
|
endTime: new Date("2024-01-29T09:30:00"),
|
||||||
|
duration: 30,
|
||||||
|
assignedTo: "8",
|
||||||
|
assigned: mockEmployees.find((emp) => emp.id === "8"),
|
||||||
|
participants: [],
|
||||||
|
status: ActivityStatusEnum.Planned,
|
||||||
|
priority: PriorityEnum.High,
|
||||||
|
creationTime: new Date("2024-01-25T13:15:00"),
|
||||||
|
lastModificationTime: new Date("2024-01-25T13:15:00"),
|
||||||
|
},
|
||||||
|
];
|
||||||
92
ui/src/mocks/mockActivityTypes.ts
Normal file
92
ui/src/mocks/mockActivityTypes.ts
Normal file
|
|
@ -0,0 +1,92 @@
|
||||||
|
import { PsActivityTypeEnum, PsActivity } from "../types/ps";
|
||||||
|
|
||||||
|
export const activityTypes: PsActivity[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
activityType: PsActivityTypeEnum.TaskCreated,
|
||||||
|
name: "Görev Oluşturma",
|
||||||
|
description: "Yeni bir görev oluşturulması",
|
||||||
|
category: "Görev Yönetimi",
|
||||||
|
defaultDuration: 0.5,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-15"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
activityType: PsActivityTypeEnum.TaskUpdated,
|
||||||
|
name: "Görev Güncelleme",
|
||||||
|
description: "Mevcut görevde değişiklik yapılması",
|
||||||
|
category: "Görev Yönetimi",
|
||||||
|
defaultDuration: 0.25,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-15"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
activityType: PsActivityTypeEnum.TaskCompleted,
|
||||||
|
name: "Görev Tamamlama",
|
||||||
|
description: "Görevin tamamlanarak kapatılması",
|
||||||
|
category: "Görev Yönetimi",
|
||||||
|
defaultDuration: 0.5,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-15"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
activityType: PsActivityTypeEnum.CommentAdded,
|
||||||
|
name: "Yorum Ekleme",
|
||||||
|
description: "Görev veya projeye yorum eklenmesi",
|
||||||
|
category: "İletişim",
|
||||||
|
defaultDuration: 0.1,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-15"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "5",
|
||||||
|
activityType: PsActivityTypeEnum.FileUploaded,
|
||||||
|
name: "Dosya Yükleme",
|
||||||
|
description: "Proje veya göreve dosya eklenmesi",
|
||||||
|
category: "Dokümantasyon",
|
||||||
|
defaultDuration: 0.25,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-15"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "6",
|
||||||
|
activityType: PsActivityTypeEnum.StatusChanged,
|
||||||
|
name: "Durum Değişikliği",
|
||||||
|
description: "Görev veya proje durumunun değiştirilmesi",
|
||||||
|
category: "Durum Yönetimi",
|
||||||
|
defaultDuration: 0.1,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-15"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "7",
|
||||||
|
activityType: PsActivityTypeEnum.AssignmentChanged,
|
||||||
|
name: "Atama Değişikliği",
|
||||||
|
description: "Görevin farklı bir kişiye atanması",
|
||||||
|
category: "Kaynak Yönetimi",
|
||||||
|
defaultDuration: 0.1,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-15"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "8",
|
||||||
|
activityType: PsActivityTypeEnum.MeetingScheduled,
|
||||||
|
name: "Toplantı Planlama",
|
||||||
|
description: "Proje ile ilgili toplantı planlanması",
|
||||||
|
category: "Toplantı",
|
||||||
|
defaultDuration: 1.0,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-15"),
|
||||||
|
},
|
||||||
|
];
|
||||||
193
ui/src/mocks/mockApprovalWorkflows.ts
Normal file
193
ui/src/mocks/mockApprovalWorkflows.ts
Normal file
|
|
@ -0,0 +1,193 @@
|
||||||
|
import {
|
||||||
|
ApprovalLevelEnum,
|
||||||
|
MmApprovalWorkflow,
|
||||||
|
RequestTypeEnum,
|
||||||
|
} from "../types/mm";
|
||||||
|
import { mockDepartments } from "./mockDepartments";
|
||||||
|
|
||||||
|
export const mockApprovalWorkflows: MmApprovalWorkflow[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
name: "Üretim Malzeme Onayı",
|
||||||
|
departmentId: "1",
|
||||||
|
department: mockDepartments.find((d) => d.id === "1"),
|
||||||
|
requestType: RequestTypeEnum.Material,
|
||||||
|
amountThreshold: 50000,
|
||||||
|
approvalLevels: [
|
||||||
|
{
|
||||||
|
id: "AL001",
|
||||||
|
workflowId: "1",
|
||||||
|
level: ApprovalLevelEnum.Supervisor,
|
||||||
|
approverUserIds: ["USR001", "USR002"],
|
||||||
|
approverNames: ["Mehmet Yılmaz", "Ali Kaya"],
|
||||||
|
sequence: 1,
|
||||||
|
isRequired: true,
|
||||||
|
isParallel: false,
|
||||||
|
timeoutDays: 2,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "AL002",
|
||||||
|
workflowId: "1",
|
||||||
|
level: ApprovalLevelEnum.Manager,
|
||||||
|
approverUserIds: ["USR003"],
|
||||||
|
approverNames: ["Ayşe Demir"],
|
||||||
|
sequence: 2,
|
||||||
|
isRequired: true,
|
||||||
|
isParallel: false,
|
||||||
|
timeoutDays: 3,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "AL003",
|
||||||
|
workflowId: "1",
|
||||||
|
level: ApprovalLevelEnum.FinanceManager,
|
||||||
|
approverUserIds: ["USR004"],
|
||||||
|
approverNames: ["Fatma Özkan"],
|
||||||
|
sequence: 3,
|
||||||
|
isRequired: false,
|
||||||
|
isParallel: false,
|
||||||
|
timeoutDays: 5,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
name: "IT İş Merkezi Onayı",
|
||||||
|
departmentId: "2",
|
||||||
|
department: mockDepartments.find((d) => d.id === "2"),
|
||||||
|
requestType: RequestTypeEnum.WorkCenter,
|
||||||
|
amountThreshold: 100000,
|
||||||
|
approvalLevels: [
|
||||||
|
{
|
||||||
|
id: "AL004",
|
||||||
|
workflowId: "2",
|
||||||
|
level: ApprovalLevelEnum.TechnicalManager,
|
||||||
|
approverUserIds: ["USR005"],
|
||||||
|
approverNames: ["Murat Şen"],
|
||||||
|
sequence: 1,
|
||||||
|
isRequired: true,
|
||||||
|
isParallel: false,
|
||||||
|
timeoutDays: 3,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "AL005",
|
||||||
|
workflowId: "2",
|
||||||
|
level: ApprovalLevelEnum.Director,
|
||||||
|
approverUserIds: ["USR006", "USR007"],
|
||||||
|
approverNames: ["Hasan Kara", "Zeynep Akın"],
|
||||||
|
sequence: 2,
|
||||||
|
isRequired: true,
|
||||||
|
isParallel: true,
|
||||||
|
timeoutDays: 5,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "AL006",
|
||||||
|
workflowId: "2",
|
||||||
|
level: ApprovalLevelEnum.GeneralManager,
|
||||||
|
approverUserIds: ["USR008"],
|
||||||
|
approverNames: ["Ahmet Yıldız"],
|
||||||
|
sequence: 3,
|
||||||
|
isRequired: true,
|
||||||
|
isParallel: false,
|
||||||
|
timeoutDays: 7,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
name: "Bakım Hizmet Onayı",
|
||||||
|
departmentId: "3",
|
||||||
|
department: mockDepartments.find((d) => d.id === "3"),
|
||||||
|
requestType: RequestTypeEnum.Service,
|
||||||
|
amountThreshold: 25000,
|
||||||
|
approvalLevels: [
|
||||||
|
{
|
||||||
|
id: "AL007",
|
||||||
|
workflowId: "3",
|
||||||
|
level: ApprovalLevelEnum.Supervisor,
|
||||||
|
approverUserIds: ["USR009"],
|
||||||
|
approverNames: ["Kemal Özdemir"],
|
||||||
|
sequence: 1,
|
||||||
|
isRequired: true,
|
||||||
|
isParallel: false,
|
||||||
|
timeoutDays: 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "AL008",
|
||||||
|
workflowId: "3",
|
||||||
|
level: ApprovalLevelEnum.Manager,
|
||||||
|
approverUserIds: ["USR010"],
|
||||||
|
approverNames: ["Leyla Çelik"],
|
||||||
|
sequence: 2,
|
||||||
|
isRequired: true,
|
||||||
|
isParallel: false,
|
||||||
|
timeoutDays: 2,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
name: "Yüksek Tutar Onayı",
|
||||||
|
departmentId: "4",
|
||||||
|
department: mockDepartments.find((d) => d.id === "4"),
|
||||||
|
requestType: RequestTypeEnum.Material,
|
||||||
|
amountThreshold: 500000,
|
||||||
|
approvalLevels: [
|
||||||
|
{
|
||||||
|
id: "AL009",
|
||||||
|
workflowId: "4",
|
||||||
|
level: ApprovalLevelEnum.Manager,
|
||||||
|
approverUserIds: ["USR011"],
|
||||||
|
approverNames: ["Selim Yağcı"],
|
||||||
|
sequence: 1,
|
||||||
|
isRequired: true,
|
||||||
|
isParallel: false,
|
||||||
|
timeoutDays: 2,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "AL010",
|
||||||
|
workflowId: "4",
|
||||||
|
level: ApprovalLevelEnum.FinanceManager,
|
||||||
|
approverUserIds: ["USR012"],
|
||||||
|
approverNames: ["Burcu Arslan"],
|
||||||
|
sequence: 2,
|
||||||
|
isRequired: true,
|
||||||
|
isParallel: false,
|
||||||
|
timeoutDays: 3,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "AL011",
|
||||||
|
workflowId: "4",
|
||||||
|
level: ApprovalLevelEnum.Director,
|
||||||
|
approverUserIds: ["USR013"],
|
||||||
|
approverNames: ["Can Demirtaş"],
|
||||||
|
sequence: 3,
|
||||||
|
isRequired: true,
|
||||||
|
isParallel: false,
|
||||||
|
timeoutDays: 5,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "AL012",
|
||||||
|
workflowId: "4",
|
||||||
|
level: ApprovalLevelEnum.GeneralManager,
|
||||||
|
approverUserIds: ["USR014"],
|
||||||
|
approverNames: ["Eda Yurtseven"],
|
||||||
|
sequence: 4,
|
||||||
|
isRequired: true,
|
||||||
|
isParallel: false,
|
||||||
|
timeoutDays: 7,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
isActive: false,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
];
|
||||||
319
ui/src/mocks/mockBOMs.ts
Normal file
319
ui/src/mocks/mockBOMs.ts
Normal file
|
|
@ -0,0 +1,319 @@
|
||||||
|
import { MrpBOM, BOMTypeEnum } from "../types/mrp";
|
||||||
|
import { mockMaterials } from "./mockMaterials";
|
||||||
|
import { mockOperations } from "./mockOperations";
|
||||||
|
|
||||||
|
// Mock data
|
||||||
|
export const mockBOMs: MrpBOM[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
bomCode: "BOM-MOT-001",
|
||||||
|
materialId: "1", // Motor Blok - Workflow ile eşleştirilen malzeme
|
||||||
|
material: mockMaterials.find((m) => m.id === "1")!,
|
||||||
|
version: "1.0",
|
||||||
|
validFrom: new Date("2024-01-01"),
|
||||||
|
validTo: new Date("2024-12-31"),
|
||||||
|
isActive: true,
|
||||||
|
bomType: BOMTypeEnum.Production,
|
||||||
|
baseQuantity: 1,
|
||||||
|
components: [
|
||||||
|
{
|
||||||
|
id: "COMP001",
|
||||||
|
bomId: "1",
|
||||||
|
materialId: "3", // Çelik Levha
|
||||||
|
material: mockMaterials.find((m) => m.id === "3")!,
|
||||||
|
quantity: 2,
|
||||||
|
unitId: "PCS",
|
||||||
|
scrapPercentage: 5,
|
||||||
|
isPhantom: false,
|
||||||
|
position: 10,
|
||||||
|
validFrom: new Date("2024-01-01"),
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "COMP002",
|
||||||
|
bomId: "1",
|
||||||
|
materialId: "4", // Alüminyum Profil
|
||||||
|
material: mockMaterials.find((m) => m.id === "4")!,
|
||||||
|
quantity: 1,
|
||||||
|
unitId: "PCS",
|
||||||
|
scrapPercentage: 2,
|
||||||
|
isPhantom: false,
|
||||||
|
position: 20,
|
||||||
|
validFrom: new Date("2024-01-01"),
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "COMP003",
|
||||||
|
bomId: "1",
|
||||||
|
materialId: "5", // Plastik Kapak
|
||||||
|
material: mockMaterials.find((m) => m.id === "5")!,
|
||||||
|
quantity: 1,
|
||||||
|
unitId: "PCS",
|
||||||
|
scrapPercentage: 3,
|
||||||
|
isPhantom: false,
|
||||||
|
position: 30,
|
||||||
|
validFrom: new Date("2024-01-01"),
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
operations: [
|
||||||
|
// Workflow RT001 ile eşleştirilen operasyonlar
|
||||||
|
{
|
||||||
|
id: "BOMOP001",
|
||||||
|
bomId: "1",
|
||||||
|
operationId: "1", // CNC Torna
|
||||||
|
operation: mockOperations.find((op) => op.id === "1")!,
|
||||||
|
sequence: 10,
|
||||||
|
setupTime: 30,
|
||||||
|
runTime: 45,
|
||||||
|
queueTime: 15,
|
||||||
|
moveTime: 5,
|
||||||
|
isActive: true,
|
||||||
|
waitTime: 0,
|
||||||
|
workCenterId: "",
|
||||||
|
isParallel: false,
|
||||||
|
prerequisites: [],
|
||||||
|
qualityChecks: [],
|
||||||
|
tools: [],
|
||||||
|
skills: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "BOMOP002",
|
||||||
|
bomId: "1",
|
||||||
|
operationId: "2", // Kaynak
|
||||||
|
operation: mockOperations.find((op) => op.id === "2")!,
|
||||||
|
sequence: 20,
|
||||||
|
setupTime: 15,
|
||||||
|
runTime: 60,
|
||||||
|
queueTime: 10,
|
||||||
|
moveTime: 5,
|
||||||
|
isActive: true,
|
||||||
|
waitTime: 0,
|
||||||
|
workCenterId: "",
|
||||||
|
isParallel: false,
|
||||||
|
prerequisites: [],
|
||||||
|
qualityChecks: [],
|
||||||
|
tools: [],
|
||||||
|
skills: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "BOMOP003",
|
||||||
|
bomId: "1",
|
||||||
|
operationId: "3", // Kalite Kontrolü
|
||||||
|
operation: mockOperations.find((op) => op.id === "3")!,
|
||||||
|
sequence: 30,
|
||||||
|
setupTime: 5,
|
||||||
|
runTime: 20,
|
||||||
|
queueTime: 5,
|
||||||
|
moveTime: 3,
|
||||||
|
isActive: true,
|
||||||
|
waitTime: 0,
|
||||||
|
workCenterId: "",
|
||||||
|
isParallel: false,
|
||||||
|
prerequisites: [],
|
||||||
|
qualityChecks: [],
|
||||||
|
tools: [],
|
||||||
|
skills: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
bomCode: "BOM-GEAR-001",
|
||||||
|
materialId: "2", // Şanzıman Kasası - Workflow ile eşleştirilen malzeme
|
||||||
|
material: mockMaterials.find((m) => m.id === "2")!,
|
||||||
|
version: "2.1",
|
||||||
|
validFrom: new Date("2024-02-01"),
|
||||||
|
validTo: new Date("2024-12-31"),
|
||||||
|
isActive: true,
|
||||||
|
bomType: BOMTypeEnum.Production,
|
||||||
|
baseQuantity: 1,
|
||||||
|
components: [
|
||||||
|
{
|
||||||
|
id: "COMP004",
|
||||||
|
bomId: "2",
|
||||||
|
materialId: "1", // Motor Blok
|
||||||
|
material: mockMaterials.find((m) => m.id === "1")!,
|
||||||
|
quantity: 1,
|
||||||
|
unitId: "PCS",
|
||||||
|
scrapPercentage: 3,
|
||||||
|
isPhantom: false,
|
||||||
|
position: 10,
|
||||||
|
validFrom: new Date("2024-02-01"),
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "COMP005",
|
||||||
|
bomId: "2",
|
||||||
|
materialId: "3", // Çelik Levha
|
||||||
|
material: mockMaterials.find((m) => m.id === "3")!,
|
||||||
|
quantity: 3,
|
||||||
|
unitId: "KG",
|
||||||
|
scrapPercentage: 4,
|
||||||
|
isPhantom: false,
|
||||||
|
position: 20,
|
||||||
|
validFrom: new Date("2024-02-01"),
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "COMP006",
|
||||||
|
bomId: "2",
|
||||||
|
materialId: "4", // Alüminyum Profil
|
||||||
|
material: mockMaterials.find((m) => m.id === "4")!,
|
||||||
|
quantity: 2,
|
||||||
|
unitId: "M",
|
||||||
|
scrapPercentage: 2,
|
||||||
|
isPhantom: false,
|
||||||
|
position: 30,
|
||||||
|
validFrom: new Date("2024-02-01"),
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
operations: [
|
||||||
|
// Workflow RT002 ile eşleştirilen operasyonlar
|
||||||
|
{
|
||||||
|
id: "BOMOP004",
|
||||||
|
bomId: "2",
|
||||||
|
operationId: "4", // Paketleme
|
||||||
|
operation: mockOperations.find((op) => op.id === "4")!,
|
||||||
|
sequence: 10,
|
||||||
|
setupTime: 20,
|
||||||
|
runTime: 45,
|
||||||
|
queueTime: 10,
|
||||||
|
moveTime: 5,
|
||||||
|
isActive: true,
|
||||||
|
waitTime: 0,
|
||||||
|
workCenterId: "",
|
||||||
|
isParallel: false,
|
||||||
|
prerequisites: [],
|
||||||
|
qualityChecks: [],
|
||||||
|
tools: [],
|
||||||
|
skills: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "BOMOP005",
|
||||||
|
bomId: "2",
|
||||||
|
operationId: "1", // CNC Torna
|
||||||
|
operation: mockOperations.find((op) => op.id === "1")!,
|
||||||
|
sequence: 20,
|
||||||
|
setupTime: 25,
|
||||||
|
runTime: 70,
|
||||||
|
queueTime: 12,
|
||||||
|
moveTime: 8,
|
||||||
|
isActive: true,
|
||||||
|
waitTime: 0,
|
||||||
|
workCenterId: "",
|
||||||
|
isParallel: false,
|
||||||
|
prerequisites: [],
|
||||||
|
qualityChecks: [],
|
||||||
|
tools: [],
|
||||||
|
skills: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "BOMOP006",
|
||||||
|
bomId: "2",
|
||||||
|
operationId: "3", // Kalite Kontrolü
|
||||||
|
operation: mockOperations.find((op) => op.id === "3")!,
|
||||||
|
sequence: 30,
|
||||||
|
setupTime: 10,
|
||||||
|
runTime: 30,
|
||||||
|
queueTime: 8,
|
||||||
|
moveTime: 5,
|
||||||
|
isActive: true,
|
||||||
|
waitTime: 0,
|
||||||
|
workCenterId: "",
|
||||||
|
isParallel: false,
|
||||||
|
prerequisites: [],
|
||||||
|
qualityChecks: [],
|
||||||
|
tools: [],
|
||||||
|
skills: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
bomCode: "BOM-PCB-001",
|
||||||
|
materialId: "5", // Plastik Kapak - yeni workflow ekleyelim
|
||||||
|
material: mockMaterials.find((m) => m.id === "5")!,
|
||||||
|
version: "1.0",
|
||||||
|
validFrom: new Date("2024-03-01"),
|
||||||
|
isActive: true,
|
||||||
|
bomType: BOMTypeEnum.Production,
|
||||||
|
baseQuantity: 1,
|
||||||
|
components: [
|
||||||
|
{
|
||||||
|
id: "COMP007",
|
||||||
|
bomId: "3",
|
||||||
|
materialId: "3", // Çelik Levha
|
||||||
|
material: mockMaterials.find((m) => m.id === "3")!,
|
||||||
|
quantity: 0.5,
|
||||||
|
unitId: "KG",
|
||||||
|
scrapPercentage: 5,
|
||||||
|
isPhantom: false,
|
||||||
|
position: 10,
|
||||||
|
validFrom: new Date("2024-03-01"),
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "COMP008",
|
||||||
|
bomId: "3",
|
||||||
|
materialId: "4", // Alüminyum Profil
|
||||||
|
material: mockMaterials.find((m) => m.id === "4")!,
|
||||||
|
quantity: 0.2,
|
||||||
|
unitId: "M",
|
||||||
|
scrapPercentage: 3,
|
||||||
|
isPhantom: false,
|
||||||
|
position: 20,
|
||||||
|
validFrom: new Date("2024-03-01"),
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
operations: [
|
||||||
|
// Basit plastik kapak işlemleri
|
||||||
|
{
|
||||||
|
id: "BOMOP007",
|
||||||
|
bomId: "3",
|
||||||
|
operationId: "5", // Bakım/Kalıp işlemi
|
||||||
|
operation: mockOperations.find((op) => op.id === "5")!,
|
||||||
|
sequence: 10,
|
||||||
|
setupTime: 15,
|
||||||
|
runTime: 25,
|
||||||
|
queueTime: 5,
|
||||||
|
moveTime: 3,
|
||||||
|
isActive: true,
|
||||||
|
waitTime: 0,
|
||||||
|
workCenterId: "",
|
||||||
|
isParallel: false,
|
||||||
|
prerequisites: [],
|
||||||
|
qualityChecks: [],
|
||||||
|
tools: [],
|
||||||
|
skills: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "BOMOP008",
|
||||||
|
bomId: "3",
|
||||||
|
operationId: "4", // Paketleme
|
||||||
|
operation: mockOperations.find((op) => op.id === "4")!,
|
||||||
|
sequence: 20,
|
||||||
|
setupTime: 5,
|
||||||
|
runTime: 10,
|
||||||
|
queueTime: 3,
|
||||||
|
moveTime: 2,
|
||||||
|
isActive: true,
|
||||||
|
waitTime: 0,
|
||||||
|
workCenterId: "",
|
||||||
|
isParallel: false,
|
||||||
|
prerequisites: [],
|
||||||
|
qualityChecks: [],
|
||||||
|
tools: [],
|
||||||
|
skills: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
];
|
||||||
88
ui/src/mocks/mockBadges.ts
Normal file
88
ui/src/mocks/mockBadges.ts
Normal file
|
|
@ -0,0 +1,88 @@
|
||||||
|
import { HrBadge, BadgeCategoryEnum, BadgeRarityEnum } from "../types/hr";
|
||||||
|
|
||||||
|
export const mockBadges: HrBadge[] = [
|
||||||
|
{
|
||||||
|
id: "badge-001",
|
||||||
|
code: "STAR_PERFORMER",
|
||||||
|
name: "Yıldız Performans",
|
||||||
|
description:
|
||||||
|
"Üstün performans sergileyen çalışanlara verilen prestijli rozet",
|
||||||
|
icon: "⭐",
|
||||||
|
color: "#FFD700",
|
||||||
|
backgroundColor: "#FFF8DC",
|
||||||
|
category: BadgeCategoryEnum.Performance,
|
||||||
|
criteria: "3 çeyrek üst üste hedefleri %110 üzerinde tamamlama",
|
||||||
|
points: 100,
|
||||||
|
rarity: BadgeRarityEnum.Epic,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-15"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "badge-002",
|
||||||
|
code: "TEAM_LEADER",
|
||||||
|
name: "Takım Lideri",
|
||||||
|
description:
|
||||||
|
"Takım arkadaşlarına öncülük eden ve onları motive eden çalışanlar için",
|
||||||
|
icon: "👑",
|
||||||
|
color: "#4B0082",
|
||||||
|
backgroundColor: "#E6E6FA",
|
||||||
|
category: BadgeCategoryEnum.Leadership,
|
||||||
|
criteria: "Takım projelerinde liderlik gösterme ve ekip başarısına katkı",
|
||||||
|
points: 75,
|
||||||
|
rarity: BadgeRarityEnum.Rare,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-02-10"),
|
||||||
|
lastModificationTime: new Date("2024-02-10"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "badge-003",
|
||||||
|
code: "INNOVATOR",
|
||||||
|
name: "İnovatör",
|
||||||
|
description:
|
||||||
|
"Yaratıcı çözümler üreten ve yenilikçi yaklaşımlar sergileyen çalışanlar",
|
||||||
|
icon: "💡",
|
||||||
|
color: "#FF6B35",
|
||||||
|
backgroundColor: "#FFF0E6",
|
||||||
|
category: BadgeCategoryEnum.Innovation,
|
||||||
|
criteria: "Şirkete değer katan yenilikçi fikirler sunma",
|
||||||
|
points: 80,
|
||||||
|
rarity: BadgeRarityEnum.Rare,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-03-05"),
|
||||||
|
lastModificationTime: new Date("2024-03-05"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "badge-004",
|
||||||
|
code: "PERFECT_ATTENDANCE",
|
||||||
|
name: "Mükemmel Devam",
|
||||||
|
description:
|
||||||
|
"Düzenli ve zamanında işe gelen, devamsızlık yapmayan çalışanlar",
|
||||||
|
icon: "📅",
|
||||||
|
color: "#28A745",
|
||||||
|
backgroundColor: "#E8F5E8",
|
||||||
|
category: BadgeCategoryEnum.Attendance,
|
||||||
|
criteria: "6 ay boyunca devamsızlık yapmama",
|
||||||
|
points: 50,
|
||||||
|
rarity: BadgeRarityEnum.Uncommon,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-04-20"),
|
||||||
|
lastModificationTime: new Date("2024-04-20"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "badge-005",
|
||||||
|
code: "CUSTOMER_CHAMPION",
|
||||||
|
name: "Müşteri Şampiyonu",
|
||||||
|
description: "Müşteri memnuniyetinde üstün başarı gösteren çalışanlar",
|
||||||
|
icon: "🏆",
|
||||||
|
color: "#DC3545",
|
||||||
|
backgroundColor: "#FFEBEE",
|
||||||
|
category: BadgeCategoryEnum.Customer,
|
||||||
|
criteria: "Müşteri memnuniyet puanı %95 üzerinde alma",
|
||||||
|
points: 90,
|
||||||
|
rarity: BadgeRarityEnum.Epic,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-05-12"),
|
||||||
|
lastModificationTime: new Date("2024-05-12"),
|
||||||
|
},
|
||||||
|
];
|
||||||
43
ui/src/mocks/mockBankMovements.ts
Normal file
43
ui/src/mocks/mockBankMovements.ts
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
import {
|
||||||
|
FiBankMovement,
|
||||||
|
BankTransactionTypeEnum,
|
||||||
|
TransactionStatusEnum,
|
||||||
|
} from "../types/fi";
|
||||||
|
import { mockBanks } from "./mockBanks";
|
||||||
|
|
||||||
|
export const mockBankMovements: FiBankMovement[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
bankAccountId: "1",
|
||||||
|
bankAccount: mockBanks.find((acc) => acc.id === "1"),
|
||||||
|
transactionDate: new Date("2024-01-20"),
|
||||||
|
valueDate: new Date("2024-01-20"),
|
||||||
|
description: "Müşteri havale ödemesi",
|
||||||
|
referenceNumber: "EFT-001",
|
||||||
|
transactionType: BankTransactionTypeEnum.EFT,
|
||||||
|
amount: 25000,
|
||||||
|
currency: "TRY",
|
||||||
|
status: TransactionStatusEnum.Completed,
|
||||||
|
recipientName: "ABC Şirket",
|
||||||
|
recipientIban: "TR120006400000112345678901",
|
||||||
|
recipientBank: "İş Bankası",
|
||||||
|
creationTime: new Date("2024-01-20"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
bankAccountId: "1",
|
||||||
|
bankAccount: mockBanks.find((acc) => acc.id === "1"),
|
||||||
|
transactionDate: new Date("2024-01-19"),
|
||||||
|
valueDate: new Date("2024-01-19"),
|
||||||
|
description: "Tedarikçi ödeme",
|
||||||
|
referenceNumber: "EFT-002",
|
||||||
|
transactionType: BankTransactionTypeEnum.Transfer,
|
||||||
|
amount: 15000,
|
||||||
|
currency: "TRY",
|
||||||
|
status: TransactionStatusEnum.Completed,
|
||||||
|
recipientName: "Tedarikçi Ltd.",
|
||||||
|
recipientIban: "TR980006200012600006298453",
|
||||||
|
recipientBank: "Garanti BBVA",
|
||||||
|
creationTime: new Date("2024-01-19"),
|
||||||
|
},
|
||||||
|
];
|
||||||
45
ui/src/mocks/mockBanks.ts
Normal file
45
ui/src/mocks/mockBanks.ts
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
import { BankAccountTypeEnum } from "../types/fi";
|
||||||
|
import { BankAccount } from "../types/common";
|
||||||
|
|
||||||
|
export const mockBanks: BankAccount[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
accountCode: "BANKA001",
|
||||||
|
bankName: "İş Bankası",
|
||||||
|
branchName: "Levent Şubesi",
|
||||||
|
accountNumber: "1234567890",
|
||||||
|
iban: "TR120006400000112345678901",
|
||||||
|
accountType: BankAccountTypeEnum.Current,
|
||||||
|
currency: "TRY",
|
||||||
|
balance: 125000,
|
||||||
|
overdraftLimit: 50000,
|
||||||
|
dailyTransferLimit: 100000,
|
||||||
|
isActive: true,
|
||||||
|
contactPerson: "Mehmet Ak",
|
||||||
|
phone: "+90 212 555 1111",
|
||||||
|
creationTime: new Date("2024-01-01"),
|
||||||
|
lastModificationTime: new Date("2024-01-20"),
|
||||||
|
swiftCode: "ISBKTRIS",
|
||||||
|
isDefault: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
accountCode: "BANKA002",
|
||||||
|
bankName: "Garanti BBVA",
|
||||||
|
branchName: "Şişli Şubesi",
|
||||||
|
accountNumber: "9876543210",
|
||||||
|
iban: "TR980006200012600006298453",
|
||||||
|
accountType: BankAccountTypeEnum.Deposit,
|
||||||
|
currency: "USD",
|
||||||
|
balance: 15000,
|
||||||
|
overdraftLimit: 0,
|
||||||
|
dailyTransferLimit: 50000,
|
||||||
|
isActive: true,
|
||||||
|
contactPerson: "Ayşe Yıldız",
|
||||||
|
phone: "+90 212 555 2222",
|
||||||
|
creationTime: new Date("2024-01-01"),
|
||||||
|
lastModificationTime: new Date("2024-01-18"),
|
||||||
|
swiftCode: "TGBATRIS",
|
||||||
|
isDefault: false,
|
||||||
|
},
|
||||||
|
];
|
||||||
524
ui/src/mocks/mockBusinessParties.ts
Normal file
524
ui/src/mocks/mockBusinessParties.ts
Normal file
|
|
@ -0,0 +1,524 @@
|
||||||
|
import { BankAccountTypeEnum } from "../types/fi";
|
||||||
|
import { BusinessParty, BusinessPartyStatusEnum, PartyType, PaymentTerms } from "../types/common";
|
||||||
|
import {
|
||||||
|
CustomerSegmentEnum,
|
||||||
|
CustomerTypeEnum,
|
||||||
|
} from "../types/crm";
|
||||||
|
import { SupplierTypeEnum, SupplierCardTypeEnum } from "../types/mm";
|
||||||
|
|
||||||
|
export const mockBusinessParties: BusinessParty[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
code: "SUP001",
|
||||||
|
supplierType: SupplierTypeEnum.Material,
|
||||||
|
name: "ABC Malzeme Ltd.",
|
||||||
|
primaryContact: {
|
||||||
|
id: "2",
|
||||||
|
firstName: "Fatma",
|
||||||
|
lastName: "Demir",
|
||||||
|
fullName: "Fatma Demir",
|
||||||
|
title: "Genel Müdür",
|
||||||
|
department: "Yönetim",
|
||||||
|
email: "fatma.demir@uretim.com",
|
||||||
|
phone: "+90 312 555 0202",
|
||||||
|
mobile: "+90 532 555 0202",
|
||||||
|
isPrimary: true,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
email: "aliveli@gmail.com",
|
||||||
|
phone: "+90 212 555 1234",
|
||||||
|
address: {
|
||||||
|
street: "İstiklal Cad. No:10",
|
||||||
|
city: "İstanbul",
|
||||||
|
state: "İstanbul",
|
||||||
|
postalCode: "34430",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
taxNumber: "1234567890",
|
||||||
|
paymentTerms: PaymentTerms.Net30,
|
||||||
|
currency: "TRY",
|
||||||
|
cardNumber: "SC-2024-001",
|
||||||
|
cardType: SupplierCardTypeEnum.Standard,
|
||||||
|
validFrom: new Date("2024-01-01"),
|
||||||
|
validTo: new Date("2024-12-31"),
|
||||||
|
creditLimit: 500000,
|
||||||
|
isActive: true,
|
||||||
|
currentBalance: 120000,
|
||||||
|
discountRate: 5,
|
||||||
|
specialConditions: ["Toplu sipariş indirimi", "Öncelikli teslimat"],
|
||||||
|
lastOrderDate: new Date("2024-08-15"),
|
||||||
|
performanceMetrics: {
|
||||||
|
deliveryPerformance: 95,
|
||||||
|
qualityRating: 90,
|
||||||
|
priceCompetitiveness: 85,
|
||||||
|
responsiveness: 67,
|
||||||
|
complianceRating: 88,
|
||||||
|
overallScore: 100,
|
||||||
|
lastEvaluationDate: new Date("2024-08-01"),
|
||||||
|
},
|
||||||
|
certifications: ["ISO 9001", "ISO 14001"],
|
||||||
|
bankAccounts: [
|
||||||
|
{
|
||||||
|
id: "BA001",
|
||||||
|
bankName: "Garanti BBVA",
|
||||||
|
accountNumber: "1234567890",
|
||||||
|
iban: "TR330006100519786457841326",
|
||||||
|
swiftCode: "TGBATRIS",
|
||||||
|
isDefault: true,
|
||||||
|
accountCode: "",
|
||||||
|
branchName: "",
|
||||||
|
accountType: BankAccountTypeEnum.Current,
|
||||||
|
currency: "",
|
||||||
|
balance: 0,
|
||||||
|
overdraftLimit: 0,
|
||||||
|
dailyTransferLimit: 0,
|
||||||
|
isActive: false,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
contacts: [
|
||||||
|
{
|
||||||
|
id: "C001",
|
||||||
|
firstName: "Ali",
|
||||||
|
lastName: "Veli",
|
||||||
|
fullName: "Ali Veli",
|
||||||
|
title: "Satınalma Müdürü",
|
||||||
|
email: "aliveli@gmail.com",
|
||||||
|
phone: "+90 212 555 1234",
|
||||||
|
department: "Satınalma",
|
||||||
|
isPrimary: true,
|
||||||
|
isActive: false,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
partyType: PartyType.Supplier,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
code: "SUP002",
|
||||||
|
supplierType: SupplierTypeEnum.Service,
|
||||||
|
name: "XYZ Teknoloji A.Ş.",
|
||||||
|
primaryContact: {
|
||||||
|
id: "2",
|
||||||
|
firstName: "Fatma",
|
||||||
|
lastName: "Demir",
|
||||||
|
fullName: "Fatma Demir",
|
||||||
|
title: "Genel Müdür",
|
||||||
|
department: "Yönetim",
|
||||||
|
email: "fatma.demir@uretim.com",
|
||||||
|
phone: "+90 312 555 0202",
|
||||||
|
mobile: "+90 532 555 0202",
|
||||||
|
isPrimary: true,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
email: "aysedemir@gmail.com",
|
||||||
|
phone: "+90 216 555 5678",
|
||||||
|
address: {
|
||||||
|
street: "Barbaros Bulv. No:20",
|
||||||
|
city: "İstanbul",
|
||||||
|
state: "İstanbul",
|
||||||
|
postalCode: "34746",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
taxNumber: "0987654321",
|
||||||
|
paymentTerms: PaymentTerms.Net15,
|
||||||
|
currency: "TRY",
|
||||||
|
cardNumber: "SC-2024-002",
|
||||||
|
cardType: SupplierCardTypeEnum.Premium,
|
||||||
|
validFrom: new Date("2024-02-01"),
|
||||||
|
validTo: new Date("2024-12-31"),
|
||||||
|
creditLimit: 250000,
|
||||||
|
isActive: true,
|
||||||
|
currentBalance: 75000,
|
||||||
|
discountRate: 3,
|
||||||
|
specialConditions: ["Hızlı teslimat", "Kalite garantisi"],
|
||||||
|
lastOrderDate: new Date("2024-08-20"),
|
||||||
|
performanceMetrics: {
|
||||||
|
deliveryPerformance: 88,
|
||||||
|
qualityRating: 90,
|
||||||
|
priceCompetitiveness: 85,
|
||||||
|
responsiveness: 87,
|
||||||
|
complianceRating: 91,
|
||||||
|
overallScore: 88,
|
||||||
|
lastEvaluationDate: new Date("2024-08-01"),
|
||||||
|
},
|
||||||
|
certifications: ["ISO 9001"],
|
||||||
|
bankAccounts: [
|
||||||
|
{
|
||||||
|
id: "BA002",
|
||||||
|
bankName: "İş Bankası",
|
||||||
|
accountNumber: "0987654321",
|
||||||
|
iban: "TR440006200519786457841327",
|
||||||
|
swiftCode: "ISBKTRIS",
|
||||||
|
isDefault: true,
|
||||||
|
accountCode: "",
|
||||||
|
branchName: "",
|
||||||
|
accountType: BankAccountTypeEnum.Current,
|
||||||
|
currency: "",
|
||||||
|
balance: 0,
|
||||||
|
overdraftLimit: 0,
|
||||||
|
dailyTransferLimit: 0,
|
||||||
|
isActive: false,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
contacts: [
|
||||||
|
{
|
||||||
|
id: "C002",
|
||||||
|
firstName: "Ayşe",
|
||||||
|
lastName: "Demir",
|
||||||
|
fullName: "Ayşe Demir",
|
||||||
|
title: "Satış Müdürü",
|
||||||
|
email: "aysedemir@gmail.com",
|
||||||
|
phone: "+90 216 555 5678",
|
||||||
|
department: "Satış",
|
||||||
|
isPrimary: true,
|
||||||
|
isActive: false,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
partyType: PartyType.Supplier,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
code: "SUP003",
|
||||||
|
supplierType: SupplierTypeEnum.Both,
|
||||||
|
name: "LMN Endüstri A.Ş.",
|
||||||
|
primaryContact: {
|
||||||
|
id: "2",
|
||||||
|
firstName: "Fatma",
|
||||||
|
lastName: "Demir",
|
||||||
|
fullName: "Fatma Demir",
|
||||||
|
title: "Genel Müdür",
|
||||||
|
department: "Yönetim",
|
||||||
|
email: "fatma.demir@uretim.com",
|
||||||
|
phone: "+90 312 555 0202",
|
||||||
|
mobile: "+90 532 555 0202",
|
||||||
|
isPrimary: true,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
email: "mehmetyilmaz@gmail.com",
|
||||||
|
phone: "+90 232 555 7890",
|
||||||
|
address: {
|
||||||
|
street: "Atatürk Cad. No:5",
|
||||||
|
city: "İzmir",
|
||||||
|
state: "İzmir",
|
||||||
|
postalCode: "35210",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
taxNumber: "1122334455",
|
||||||
|
paymentTerms: PaymentTerms.Net45,
|
||||||
|
currency: "TRY",
|
||||||
|
cardNumber: "SC-2024-003",
|
||||||
|
cardType: SupplierCardTypeEnum.Preferred,
|
||||||
|
validFrom: new Date("2024-03-01"),
|
||||||
|
validTo: new Date("2024-12-31"),
|
||||||
|
creditLimit: 150000,
|
||||||
|
isActive: true,
|
||||||
|
currentBalance: 45000,
|
||||||
|
discountRate: 2,
|
||||||
|
specialConditions: ["Toplu sipariş indirimi"],
|
||||||
|
lastOrderDate: new Date("2024-08-18"),
|
||||||
|
performanceMetrics: {
|
||||||
|
deliveryPerformance: 82,
|
||||||
|
qualityRating: 85,
|
||||||
|
priceCompetitiveness: 90,
|
||||||
|
responsiveness: 80,
|
||||||
|
complianceRating: 88,
|
||||||
|
overallScore: 85,
|
||||||
|
lastEvaluationDate: new Date("2024-07-15"),
|
||||||
|
},
|
||||||
|
certifications: ["ISO 9001", "OHSAS 18001"],
|
||||||
|
bankAccounts: [
|
||||||
|
{
|
||||||
|
id: "BA003",
|
||||||
|
bankName: "Yapı Kredi",
|
||||||
|
accountNumber: "1122334455",
|
||||||
|
iban: "TR550006300519786457841328",
|
||||||
|
swiftCode: "YAPITRIS",
|
||||||
|
isDefault: true,
|
||||||
|
accountCode: "",
|
||||||
|
branchName: "",
|
||||||
|
accountType: BankAccountTypeEnum.Current,
|
||||||
|
currency: "",
|
||||||
|
balance: 0,
|
||||||
|
overdraftLimit: 0,
|
||||||
|
dailyTransferLimit: 0,
|
||||||
|
isActive: false,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
contacts: [
|
||||||
|
{
|
||||||
|
id: "C003",
|
||||||
|
firstName: "Mehmet",
|
||||||
|
lastName: "Yılmaz",
|
||||||
|
fullName: "Mehmet Yılmaz",
|
||||||
|
title: "Genel Müdür",
|
||||||
|
email: "mehmetyilmaz@gmail.com",
|
||||||
|
phone: "+90 232 555 7890",
|
||||||
|
department: "Yönetim",
|
||||||
|
isPrimary: true,
|
||||||
|
isActive: false,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
partyType: PartyType.Supplier,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
code: "SUP004",
|
||||||
|
supplierType: SupplierTypeEnum.Material,
|
||||||
|
name: "OPQ Ticaret Ltd.",
|
||||||
|
primaryContact: {
|
||||||
|
id: "2",
|
||||||
|
firstName: "Fatma",
|
||||||
|
lastName: "Demir",
|
||||||
|
fullName: "Fatma Demir",
|
||||||
|
title: "Genel Müdür",
|
||||||
|
department: "Yönetim",
|
||||||
|
email: "fatma.demir@uretim.com",
|
||||||
|
phone: "+90 312 555 0202",
|
||||||
|
mobile: "+90 532 555 0202",
|
||||||
|
isPrimary: true,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
email: "fatmacelik@gmail.com",
|
||||||
|
phone: "+90 312 555 3456",
|
||||||
|
address: {
|
||||||
|
street: "Kızılay Meydanı No:15",
|
||||||
|
city: "Ankara",
|
||||||
|
state: "Ankara",
|
||||||
|
postalCode: "06690",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
taxNumber: "6677889900",
|
||||||
|
paymentTerms: PaymentTerms.Net30,
|
||||||
|
currency: "TRY",
|
||||||
|
cardNumber: "SC-2024-004",
|
||||||
|
cardType: SupplierCardTypeEnum.Standard,
|
||||||
|
validFrom: new Date("2024-04-01"),
|
||||||
|
validTo: new Date("2024-12-31"),
|
||||||
|
creditLimit: 100000,
|
||||||
|
isActive: false,
|
||||||
|
currentBalance: 30000,
|
||||||
|
discountRate: 4,
|
||||||
|
specialConditions: ["Öncelikli sipariş", "Hızlı teslimat"],
|
||||||
|
lastOrderDate: new Date("2024-06-30"),
|
||||||
|
performanceMetrics: {
|
||||||
|
deliveryPerformance: 75,
|
||||||
|
qualityRating: 78,
|
||||||
|
priceCompetitiveness: 82,
|
||||||
|
responsiveness: 76,
|
||||||
|
complianceRating: 80,
|
||||||
|
overallScore: 78,
|
||||||
|
lastEvaluationDate: new Date("2024-07-01"),
|
||||||
|
},
|
||||||
|
certifications: ["ISO 9001"],
|
||||||
|
bankAccounts: [
|
||||||
|
{
|
||||||
|
id: "BA004",
|
||||||
|
bankName: "Halkbank",
|
||||||
|
accountNumber: "6677889900",
|
||||||
|
iban: "TR660006400519786457841329",
|
||||||
|
swiftCode: "HALKTRIS",
|
||||||
|
isDefault: true,
|
||||||
|
accountCode: "",
|
||||||
|
branchName: "",
|
||||||
|
accountType: BankAccountTypeEnum.Current,
|
||||||
|
currency: "",
|
||||||
|
balance: 0,
|
||||||
|
overdraftLimit: 0,
|
||||||
|
dailyTransferLimit: 0,
|
||||||
|
isActive: false,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
contacts: [
|
||||||
|
{
|
||||||
|
id: "C004",
|
||||||
|
firstName: "Fatma",
|
||||||
|
lastName: "Çelik",
|
||||||
|
fullName: "Fatma Çelik",
|
||||||
|
title: "Finans Müdürü",
|
||||||
|
email: "fatmacelik@gmail.com",
|
||||||
|
phone: "+90 312 555 3456",
|
||||||
|
department: "Finans",
|
||||||
|
isPrimary: true,
|
||||||
|
isActive: false,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
partyType: PartyType.Supplier,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "5",
|
||||||
|
code: "CUST-002",
|
||||||
|
name: "Üretim Ltd.",
|
||||||
|
customerType: CustomerTypeEnum.Company,
|
||||||
|
industry: "İmalat",
|
||||||
|
website: "www.uretim.com",
|
||||||
|
primaryContact: {
|
||||||
|
id: "2",
|
||||||
|
firstName: "Fatma",
|
||||||
|
lastName: "Demir",
|
||||||
|
fullName: "Fatma Demir",
|
||||||
|
title: "Genel Müdür",
|
||||||
|
department: "Yönetim",
|
||||||
|
email: "fatma.demir@uretim.com",
|
||||||
|
phone: "+90 312 555 0202",
|
||||||
|
mobile: "+90 532 555 0202",
|
||||||
|
isPrimary: true,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
contacts: [],
|
||||||
|
address: {
|
||||||
|
street: "Sanayi Sitesi 5. Cadde No:25",
|
||||||
|
city: "Ankara",
|
||||||
|
state: "Ankara",
|
||||||
|
postalCode: "06000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
taxNumber: "0987654321",
|
||||||
|
registrationNumber: "REG-002",
|
||||||
|
creditLimit: 500000,
|
||||||
|
paymentTerms: PaymentTerms.Net60,
|
||||||
|
currency: "TRY",
|
||||||
|
status: BusinessPartyStatusEnum.Active,
|
||||||
|
customerSegment: CustomerSegmentEnum.SMB,
|
||||||
|
assignedSalesRep: "REP-002",
|
||||||
|
teamId: "TEAM-001",
|
||||||
|
totalRevenue: 850000,
|
||||||
|
lastOrderDate: new Date("2024-01-10"),
|
||||||
|
averageOrderValue: 42500,
|
||||||
|
lifetimeValue: 1700000,
|
||||||
|
opportunities: [],
|
||||||
|
orders: [],
|
||||||
|
activities: [],
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2023-09-20"),
|
||||||
|
lastModificationTime: new Date("2024-01-18"),
|
||||||
|
partyType: PartyType.Customer,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "6",
|
||||||
|
code: "CUST-001",
|
||||||
|
name: "Teknoloji A.Ş.",
|
||||||
|
customerType: CustomerTypeEnum.Company,
|
||||||
|
industry: "Teknoloji",
|
||||||
|
website: "www.teknoloji.com",
|
||||||
|
primaryContact: {
|
||||||
|
id: "1",
|
||||||
|
firstName: "Ali",
|
||||||
|
lastName: "Yılmaz",
|
||||||
|
fullName: "Ali Yılmaz",
|
||||||
|
title: "Satınalma Müdürü",
|
||||||
|
department: "Satınalma",
|
||||||
|
email: "ali.yilmaz@teknoloji.com",
|
||||||
|
phone: "+90 212 555 0201",
|
||||||
|
mobile: "+90 532 555 0201",
|
||||||
|
isPrimary: true,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
contacts: [],
|
||||||
|
address: {
|
||||||
|
street: "Teknoloji Caddesi No:100",
|
||||||
|
city: "İstanbul",
|
||||||
|
state: "İstanbul",
|
||||||
|
postalCode: "34000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
taxNumber: "1234567890",
|
||||||
|
registrationNumber: "REG-001",
|
||||||
|
creditLimit: 1000000,
|
||||||
|
paymentTerms: PaymentTerms.Net30,
|
||||||
|
currency: "TRY",
|
||||||
|
status: BusinessPartyStatusEnum.Active,
|
||||||
|
customerSegment: CustomerSegmentEnum.Enterprise,
|
||||||
|
assignedSalesRep: "REP-001",
|
||||||
|
teamId: "TEAM-001",
|
||||||
|
totalRevenue: 2500000,
|
||||||
|
lastOrderDate: new Date("2024-01-15"),
|
||||||
|
averageOrderValue: 125000,
|
||||||
|
lifetimeValue: 5000000,
|
||||||
|
opportunities: [],
|
||||||
|
orders: [],
|
||||||
|
activities: [],
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2023-06-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-20"),
|
||||||
|
partyType: PartyType.Customer,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export const mockBusinessPartyNew: BusinessParty = {
|
||||||
|
id: "",
|
||||||
|
code: "",
|
||||||
|
supplierType: SupplierTypeEnum.Both,
|
||||||
|
name: "",
|
||||||
|
email: "",
|
||||||
|
phone: "",
|
||||||
|
address: {
|
||||||
|
street: "",
|
||||||
|
city: "",
|
||||||
|
state: "",
|
||||||
|
postalCode: "",
|
||||||
|
country: "",
|
||||||
|
},
|
||||||
|
taxNumber: "",
|
||||||
|
paymentTerms: PaymentTerms.Cash,
|
||||||
|
currency: "TRY",
|
||||||
|
cardNumber: "",
|
||||||
|
cardType: SupplierCardTypeEnum.Standard,
|
||||||
|
validTo: new Date(),
|
||||||
|
validFrom: new Date(),
|
||||||
|
creditLimit: 0,
|
||||||
|
isActive: true,
|
||||||
|
currentBalance: 0,
|
||||||
|
discountRate: 0,
|
||||||
|
specialConditions: [],
|
||||||
|
lastOrderDate: new Date(),
|
||||||
|
performanceMetrics: {
|
||||||
|
deliveryPerformance: 0,
|
||||||
|
qualityRating: 0,
|
||||||
|
priceCompetitiveness: 0,
|
||||||
|
responsiveness: 0,
|
||||||
|
complianceRating: 0,
|
||||||
|
overallScore: 0,
|
||||||
|
lastEvaluationDate: new Date(),
|
||||||
|
},
|
||||||
|
certifications: [],
|
||||||
|
bankAccounts: [],
|
||||||
|
contacts: [],
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
partyType: PartyType.Supplier,
|
||||||
|
};
|
||||||
26
ui/src/mocks/mockCashAccounts.ts
Normal file
26
ui/src/mocks/mockCashAccounts.ts
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
import { FiCashAccount } from "../types/fi";
|
||||||
|
|
||||||
|
export const mockCashAccounts: FiCashAccount[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
accountCode: "KASA001",
|
||||||
|
name: "Ana Kasa",
|
||||||
|
description: "Ana nakit kasası",
|
||||||
|
currency: "TRY",
|
||||||
|
balance: 15000,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-01-01"),
|
||||||
|
lastModificationTime: new Date("2024-01-20"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
accountCode: "KASA002",
|
||||||
|
name: "USD Kasa",
|
||||||
|
description: "Döviz kasası",
|
||||||
|
currency: "USD",
|
||||||
|
balance: 2500,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-01-01"),
|
||||||
|
lastModificationTime: new Date("2024-01-18"),
|
||||||
|
},
|
||||||
|
];
|
||||||
29
ui/src/mocks/mockCashMovements.ts
Normal file
29
ui/src/mocks/mockCashMovements.ts
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
import { FiCashMovement, CashMovementTypeEnum } from "../types/fi";
|
||||||
|
import { mockCashAccounts } from "./mockCashAccounts";
|
||||||
|
|
||||||
|
export const mockCashMovements: FiCashMovement[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
cashAccountId: "1",
|
||||||
|
cashAccount: mockCashAccounts[0],
|
||||||
|
transactionDate: new Date("2024-01-20"),
|
||||||
|
description: "Müşteri nakit ödemesi",
|
||||||
|
referenceNumber: "NAK-001",
|
||||||
|
movementType: CashMovementTypeEnum.Income,
|
||||||
|
amount: 5000,
|
||||||
|
currency: "TRY",
|
||||||
|
creationTime: new Date("2024-01-20"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
cashAccountId: "1",
|
||||||
|
cashAccount: mockCashAccounts[0],
|
||||||
|
transactionDate: new Date("2024-01-19"),
|
||||||
|
description: "Kasa gider",
|
||||||
|
referenceNumber: "NAK-002",
|
||||||
|
movementType: CashMovementTypeEnum.Expense,
|
||||||
|
amount: 1000,
|
||||||
|
currency: "TRY",
|
||||||
|
creationTime: new Date("2024-01-19"),
|
||||||
|
},
|
||||||
|
];
|
||||||
44
ui/src/mocks/mockChecks.ts
Normal file
44
ui/src/mocks/mockChecks.ts
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
import { FiCheck, CheckStatusEnum, CheckTypeEnum } from "../types/fi";
|
||||||
|
import { mockCurrentAccounts } from "./mockCurrentAccounts";
|
||||||
|
|
||||||
|
export const mockChecks: FiCheck[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
checkNumber: "CHK-001",
|
||||||
|
bankName: "İş Bankası",
|
||||||
|
branchName: "Levent Şubesi",
|
||||||
|
accountNumber: "1234567890",
|
||||||
|
type: CheckTypeEnum.Received,
|
||||||
|
drawerName: "XYZ Müşteri A.Ş.",
|
||||||
|
payeeName: "ABC Şirket",
|
||||||
|
issueDate: new Date("2024-01-15"),
|
||||||
|
dueDate: new Date("2024-02-15"),
|
||||||
|
amount: 25000,
|
||||||
|
currency: "TRY",
|
||||||
|
status: CheckStatusEnum.InHand,
|
||||||
|
currentAccountId: "1",
|
||||||
|
currentAccount: mockCurrentAccounts.find((ca) => ca.id === "1"),
|
||||||
|
creationTime: new Date("2024-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-15"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
checkNumber: "CHK-002",
|
||||||
|
bankName: "Garanti BBVA",
|
||||||
|
branchName: "Şişli Şubesi",
|
||||||
|
accountNumber: "9876543210",
|
||||||
|
type: CheckTypeEnum.Issued,
|
||||||
|
drawerName: "ABC Şirket",
|
||||||
|
payeeName: "Tedarikçi Ltd.",
|
||||||
|
issueDate: new Date("2024-01-10"),
|
||||||
|
dueDate: new Date("2024-02-10"),
|
||||||
|
amount: 15000,
|
||||||
|
currency: "TRY",
|
||||||
|
status: CheckStatusEnum.Deposited,
|
||||||
|
bankingDate: new Date("2024-01-20"),
|
||||||
|
currentAccountId: "2",
|
||||||
|
currentAccount: mockCurrentAccounts.find((ca) => ca.id === "2"),
|
||||||
|
creationTime: new Date("2024-01-10"),
|
||||||
|
lastModificationTime: new Date("2024-01-20"),
|
||||||
|
},
|
||||||
|
];
|
||||||
184
ui/src/mocks/mockCostCenters.ts
Normal file
184
ui/src/mocks/mockCostCenters.ts
Normal file
|
|
@ -0,0 +1,184 @@
|
||||||
|
import { HrCostCenter, CostCenterType } from "../types/hr";
|
||||||
|
|
||||||
|
export const mockCostCenters: HrCostCenter[] = [
|
||||||
|
{
|
||||||
|
id: "cc-001",
|
||||||
|
code: "CC-ADM-001",
|
||||||
|
name: "Genel Yönetim",
|
||||||
|
description: "Şirket genel yönetim masrafları",
|
||||||
|
costCenterType: CostCenterType.Administrative,
|
||||||
|
budgetedAmount: 2500000,
|
||||||
|
actualAmount: 2350000,
|
||||||
|
currency: "TRY",
|
||||||
|
fiscalYear: "2025",
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-12-01"),
|
||||||
|
subCostCenters: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "cc-002",
|
||||||
|
code: "CC-HR-001",
|
||||||
|
name: "İnsan Kaynakları",
|
||||||
|
description: "İnsan kaynakları departmanı masrafları",
|
||||||
|
costCenterType: CostCenterType.Support,
|
||||||
|
budgetedAmount: 1800000,
|
||||||
|
actualAmount: 1650000,
|
||||||
|
currency: "TRY",
|
||||||
|
fiscalYear: "2025",
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-11-15"),
|
||||||
|
subCostCenters: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "cc-003",
|
||||||
|
code: "CC-FIN-001",
|
||||||
|
name: "Finans ve Muhasebe",
|
||||||
|
description: "Mali işler ve muhasebe masrafları",
|
||||||
|
costCenterType: CostCenterType.Support,
|
||||||
|
budgetedAmount: 1500000,
|
||||||
|
actualAmount: 1420000,
|
||||||
|
currency: "TRY",
|
||||||
|
fiscalYear: "2025",
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-11-20"),
|
||||||
|
subCostCenters: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "cc-004",
|
||||||
|
code: "CC-IT-001",
|
||||||
|
name: "Bilgi İşlem",
|
||||||
|
description: "IT altyapı ve yazılım masrafları",
|
||||||
|
costCenterType: CostCenterType.Support,
|
||||||
|
budgetedAmount: 3200000,
|
||||||
|
actualAmount: 3100000,
|
||||||
|
currency: "TRY",
|
||||||
|
fiscalYear: "2025",
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-12-05"),
|
||||||
|
subCostCenters: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "cc-005",
|
||||||
|
code: "CC-PROD-001",
|
||||||
|
name: "Üretim Departmanı",
|
||||||
|
description: "Üretim faaliyetleri masrafları",
|
||||||
|
costCenterType: CostCenterType.Production,
|
||||||
|
budgetedAmount: 8500000,
|
||||||
|
actualAmount: 8200000,
|
||||||
|
currency: "TRY",
|
||||||
|
fiscalYear: "2025",
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-12-10"),
|
||||||
|
subCostCenters: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "cc-006",
|
||||||
|
code: "CC-SAL-001",
|
||||||
|
name: "Satış ve Pazarlama",
|
||||||
|
description: "Satış ve pazarlama faaliyetleri",
|
||||||
|
costCenterType: CostCenterType.Revenue,
|
||||||
|
budgetedAmount: 4200000,
|
||||||
|
actualAmount: 4050000,
|
||||||
|
currency: "TRY",
|
||||||
|
fiscalYear: "2025",
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-12-08"),
|
||||||
|
subCostCenters: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "cc-007",
|
||||||
|
code: "CC-QUA-001",
|
||||||
|
name: "Kalite Kontrol",
|
||||||
|
description: "Kalite kontrol ve güvence masrafları",
|
||||||
|
costCenterType: CostCenterType.Support,
|
||||||
|
budgetedAmount: 1200000,
|
||||||
|
actualAmount: 1150000,
|
||||||
|
currency: "TRY",
|
||||||
|
fiscalYear: "2025",
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-11-25"),
|
||||||
|
subCostCenters: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "cc-008",
|
||||||
|
code: "CC-LOG-001",
|
||||||
|
name: "Lojistik ve Depo",
|
||||||
|
description: "Lojistik operasyonları ve depo masrafları",
|
||||||
|
costCenterType: CostCenterType.Support,
|
||||||
|
budgetedAmount: 2800000,
|
||||||
|
actualAmount: 2650000,
|
||||||
|
currency: "TRY",
|
||||||
|
fiscalYear: "2025",
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-12-03"),
|
||||||
|
subCostCenters: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "cc-009",
|
||||||
|
code: "CC-RND-001",
|
||||||
|
name: "Ar-Ge Departmanı",
|
||||||
|
description: "Araştırma ve geliştirme masrafları",
|
||||||
|
costCenterType: CostCenterType.Investment,
|
||||||
|
budgetedAmount: 3500000,
|
||||||
|
actualAmount: 3300000,
|
||||||
|
currency: "TRY",
|
||||||
|
fiscalYear: "2025",
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-12-07"),
|
||||||
|
subCostCenters: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "cc-010",
|
||||||
|
code: "CC-PUR-001",
|
||||||
|
name: "Satın Alma",
|
||||||
|
description: "Satın alma ve tedarik masrafları",
|
||||||
|
costCenterType: CostCenterType.Support,
|
||||||
|
budgetedAmount: 1600000,
|
||||||
|
actualAmount: 1520000,
|
||||||
|
currency: "TRY",
|
||||||
|
fiscalYear: "2025",
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-11-30"),
|
||||||
|
subCostCenters: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "cc-011",
|
||||||
|
code: "CC-MAI-001",
|
||||||
|
name: "Bakım ve Onarım",
|
||||||
|
description: "Bakım ve onarım masrafları",
|
||||||
|
costCenterType: CostCenterType.Service,
|
||||||
|
budgetedAmount: 2200000,
|
||||||
|
actualAmount: 2100000,
|
||||||
|
currency: "TRY",
|
||||||
|
fiscalYear: "2025",
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-12-02"),
|
||||||
|
subCostCenters: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "cc-012",
|
||||||
|
code: "CC-CUS-001",
|
||||||
|
name: "Müşteri Hizmetleri",
|
||||||
|
description: "Müşteri hizmetleri masrafları",
|
||||||
|
costCenterType: CostCenterType.Service,
|
||||||
|
budgetedAmount: 1000000,
|
||||||
|
actualAmount: 950000,
|
||||||
|
currency: "TRY",
|
||||||
|
fiscalYear: "2025",
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-11-28"),
|
||||||
|
subCostCenters: [],
|
||||||
|
},
|
||||||
|
];
|
||||||
5
ui/src/mocks/mockCurrencies.ts
Normal file
5
ui/src/mocks/mockCurrencies.ts
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
export const mockCurrencies = [
|
||||||
|
{ value: "TRY", label: "Türk Lirası (₺)" },
|
||||||
|
{ value: "USD", label: "Amerikan Doları ($)" },
|
||||||
|
{ value: "EUR", label: "Euro (€)" },
|
||||||
|
];
|
||||||
154
ui/src/mocks/mockCurrentAccountMovements.ts
Normal file
154
ui/src/mocks/mockCurrentAccountMovements.ts
Normal file
|
|
@ -0,0 +1,154 @@
|
||||||
|
import { FiCurrentAccountMovement, FiDocumentTypeEnum } from "../types/fi";
|
||||||
|
|
||||||
|
export const mockCurrentAccountMovements: FiCurrentAccountMovement[] = [
|
||||||
|
{
|
||||||
|
id: "am1",
|
||||||
|
accountId: "1",
|
||||||
|
transactionDate: new Date("2024-11-01"),
|
||||||
|
description: "Satış faturası - SF2024/001",
|
||||||
|
referenceNumber: "SF2024/001",
|
||||||
|
documentType: FiDocumentTypeEnum.Invoice,
|
||||||
|
documentNumber: "SF2024/001",
|
||||||
|
debitAmount: 0,
|
||||||
|
creditAmount: 25000,
|
||||||
|
balance: -15000,
|
||||||
|
currency: "TRY",
|
||||||
|
invoiceId: "inv1",
|
||||||
|
creationTime: new Date("2024-11-01T10:30:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "am2",
|
||||||
|
accountId: "1",
|
||||||
|
transactionDate: new Date("2024-10-28"),
|
||||||
|
description: "Tahsilat - Nakit",
|
||||||
|
referenceNumber: "TH2024/001",
|
||||||
|
documentType: FiDocumentTypeEnum.Payment,
|
||||||
|
documentNumber: "TH2024/001",
|
||||||
|
debitAmount: 10000,
|
||||||
|
creditAmount: 0,
|
||||||
|
balance: 10000,
|
||||||
|
currency: "TRY",
|
||||||
|
paymentId: "pay1",
|
||||||
|
creationTime: new Date("2024-10-28T14:15:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "am3",
|
||||||
|
accountId: "2",
|
||||||
|
transactionDate: new Date("2024-11-02"),
|
||||||
|
description: "Alış faturası - AF2024/003",
|
||||||
|
referenceNumber: "AF2024/003",
|
||||||
|
documentType: FiDocumentTypeEnum.Invoice,
|
||||||
|
documentNumber: "AF2024/003",
|
||||||
|
debitAmount: 15000,
|
||||||
|
creditAmount: 0,
|
||||||
|
balance: 25000,
|
||||||
|
currency: "TRY",
|
||||||
|
invoiceId: "inv2",
|
||||||
|
creationTime: new Date("2024-11-02T09:45:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "am4",
|
||||||
|
accountId: "2",
|
||||||
|
transactionDate: new Date("2024-10-30"),
|
||||||
|
description: "Ödeme - Banka Havalesi",
|
||||||
|
referenceNumber: "OD2024/005",
|
||||||
|
documentType: FiDocumentTypeEnum.Payment,
|
||||||
|
documentNumber: "OD2024/005",
|
||||||
|
debitAmount: 0,
|
||||||
|
creditAmount: 12000,
|
||||||
|
balance: 10000,
|
||||||
|
currency: "TRY",
|
||||||
|
paymentId: "pay2",
|
||||||
|
creationTime: new Date("2024-10-30T16:20:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "am5",
|
||||||
|
accountId: "1",
|
||||||
|
transactionDate: new Date("2024-10-25"),
|
||||||
|
description: "Satış faturası - SF2024/002",
|
||||||
|
referenceNumber: "SF2024/002",
|
||||||
|
documentType: FiDocumentTypeEnum.Invoice,
|
||||||
|
documentNumber: "SF2024/002",
|
||||||
|
debitAmount: 0,
|
||||||
|
creditAmount: 18000,
|
||||||
|
balance: 0,
|
||||||
|
currency: "TRY",
|
||||||
|
invoiceId: "inv3",
|
||||||
|
creationTime: new Date("2024-10-25T11:10:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "am6",
|
||||||
|
accountId: "3",
|
||||||
|
transactionDate: new Date("2024-11-03"),
|
||||||
|
description: "Alış faturası - AF2024/004",
|
||||||
|
referenceNumber: "AF2024/004",
|
||||||
|
documentType: FiDocumentTypeEnum.Invoice,
|
||||||
|
documentNumber: "AF2024/004",
|
||||||
|
debitAmount: 8500,
|
||||||
|
creditAmount: 0,
|
||||||
|
balance: 8500,
|
||||||
|
currency: "TRY",
|
||||||
|
invoiceId: "inv4",
|
||||||
|
creationTime: new Date("2024-11-03T13:30:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "am7",
|
||||||
|
accountId: "2",
|
||||||
|
transactionDate: new Date("2024-10-22"),
|
||||||
|
description: "Tahsilat - Çek",
|
||||||
|
referenceNumber: "TH2024/002",
|
||||||
|
documentType: FiDocumentTypeEnum.Check,
|
||||||
|
documentNumber: "TH2024/002",
|
||||||
|
debitAmount: 22000,
|
||||||
|
creditAmount: 0,
|
||||||
|
balance: 22000,
|
||||||
|
currency: "TRY",
|
||||||
|
paymentId: "pay3",
|
||||||
|
creationTime: new Date("2024-10-22T15:45:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "am8",
|
||||||
|
accountId: "1",
|
||||||
|
transactionDate: new Date("2024-10-20"),
|
||||||
|
description: "İade faturası - IF2024/001",
|
||||||
|
referenceNumber: "IF2024/001",
|
||||||
|
documentType: FiDocumentTypeEnum.Invoice,
|
||||||
|
documentNumber: "IF2024/001",
|
||||||
|
debitAmount: 3000,
|
||||||
|
creditAmount: 0,
|
||||||
|
balance: 18000,
|
||||||
|
currency: "TRY",
|
||||||
|
invoiceId: "inv5",
|
||||||
|
creationTime: new Date("2024-10-20T12:20:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "am9",
|
||||||
|
accountId: "3",
|
||||||
|
transactionDate: new Date("2024-10-18"),
|
||||||
|
description: "Ödeme - Kredi Kartı",
|
||||||
|
referenceNumber: "OD2024/006",
|
||||||
|
documentType: FiDocumentTypeEnum.Payment,
|
||||||
|
documentNumber: "OD2024/006",
|
||||||
|
debitAmount: 0,
|
||||||
|
creditAmount: 5000,
|
||||||
|
balance: 0,
|
||||||
|
currency: "TRY",
|
||||||
|
paymentId: "pay4",
|
||||||
|
creationTime: new Date("2024-10-18T14:00:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "am10",
|
||||||
|
accountId: "4",
|
||||||
|
transactionDate: new Date("2024-11-04"),
|
||||||
|
description: "Satış faturası - SF2024/003",
|
||||||
|
referenceNumber: "SF2024/003",
|
||||||
|
documentType: FiDocumentTypeEnum.Invoice,
|
||||||
|
documentNumber: "SF2024/003",
|
||||||
|
debitAmount: 0,
|
||||||
|
creditAmount: 32000,
|
||||||
|
balance: -32000,
|
||||||
|
currency: "TRY",
|
||||||
|
invoiceId: "inv6",
|
||||||
|
creationTime: new Date("2024-11-04T10:15:00"),
|
||||||
|
},
|
||||||
|
];
|
||||||
115
ui/src/mocks/mockCurrentAccounts.ts
Normal file
115
ui/src/mocks/mockCurrentAccounts.ts
Normal file
|
|
@ -0,0 +1,115 @@
|
||||||
|
import { AccountTypeEnum, FiCurrentAccount, RiskGroupEnum } from "../types/fi";
|
||||||
|
import { mockBusinessParties } from "./mockBusinessParties";
|
||||||
|
|
||||||
|
export const mockCurrentAccounts: FiCurrentAccount[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
accountCode: "CA001",
|
||||||
|
businessPartyId: "1",
|
||||||
|
businessParty: mockBusinessParties.find((bp) => bp.id === "1"),
|
||||||
|
type: AccountTypeEnum.Supplier,
|
||||||
|
taxNumber: "1234567890",
|
||||||
|
taxOffice: "Beylikdüzü V.D.",
|
||||||
|
contactPerson: "Ahmet Yılmaz",
|
||||||
|
phone: "+90 212 555 1234",
|
||||||
|
email: "info@abctedarik.com",
|
||||||
|
address: "Beylikdüzü Organize Sanayi Bölgesi, İstanbul",
|
||||||
|
creditLimit: 50000,
|
||||||
|
balance: -15000,
|
||||||
|
currency: "TRY",
|
||||||
|
riskGroup: RiskGroupEnum.Low,
|
||||||
|
paymentTerm: 30,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-20"),
|
||||||
|
lastTransactionDate: new Date("2024-11-01"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
accountCode: "CA002",
|
||||||
|
businessPartyId: "2",
|
||||||
|
businessParty: mockBusinessParties.find((bp) => bp.id === "2"),
|
||||||
|
type: AccountTypeEnum.Customer,
|
||||||
|
taxNumber: "9876543210",
|
||||||
|
taxOffice: "Kadıköy V.D.",
|
||||||
|
contactPerson: "Fatma Demir",
|
||||||
|
phone: "+90 216 888 5678",
|
||||||
|
email: "satis@xyzmuster.com",
|
||||||
|
address: "Kadıköy, İstanbul",
|
||||||
|
creditLimit: 100000,
|
||||||
|
balance: 25000,
|
||||||
|
currency: "TRY",
|
||||||
|
riskGroup: RiskGroupEnum.Medium,
|
||||||
|
paymentTerm: 45,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-02-01"),
|
||||||
|
lastModificationTime: new Date("2024-02-10"),
|
||||||
|
lastTransactionDate: new Date("2024-11-02"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
accountCode: "CA003",
|
||||||
|
businessPartyId: "3",
|
||||||
|
businessParty: mockBusinessParties.find((bp) => bp.id === "3"),
|
||||||
|
type: AccountTypeEnum.Both,
|
||||||
|
taxNumber: "5555666677",
|
||||||
|
taxOffice: "Ümraniye V.D.",
|
||||||
|
contactPerson: "Mehmet Kaya",
|
||||||
|
phone: "+90 216 333 4455",
|
||||||
|
email: "info@definsaat.com",
|
||||||
|
address: "Ümraniye, İstanbul",
|
||||||
|
creditLimit: 75000,
|
||||||
|
balance: 8500,
|
||||||
|
currency: "TRY",
|
||||||
|
riskGroup: RiskGroupEnum.Low,
|
||||||
|
paymentTerm: 30,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-03-10"),
|
||||||
|
lastModificationTime: new Date("2024-03-15"),
|
||||||
|
lastTransactionDate: new Date("2024-11-03"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
accountCode: "CA004",
|
||||||
|
businessPartyId: "4",
|
||||||
|
businessParty: mockBusinessParties.find((bp) => bp.id === "4"),
|
||||||
|
type: AccountTypeEnum.Customer,
|
||||||
|
taxNumber: "1111222233",
|
||||||
|
taxOffice: "Beşiktaş V.D.",
|
||||||
|
contactPerson: "Ayşe Özkan",
|
||||||
|
phone: "+90 212 777 8899",
|
||||||
|
email: "info@ghiteknoloji.com",
|
||||||
|
address: "Beşiktaş, İstanbul",
|
||||||
|
creditLimit: 200000,
|
||||||
|
balance: -32000,
|
||||||
|
currency: "TRY",
|
||||||
|
riskGroup: RiskGroupEnum.Low,
|
||||||
|
paymentTerm: 60,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-04-05"),
|
||||||
|
lastModificationTime: new Date("2024-04-12"),
|
||||||
|
lastTransactionDate: new Date("2024-11-04"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "5",
|
||||||
|
accountCode: "CA005",
|
||||||
|
businessPartyId: "5",
|
||||||
|
businessParty: mockBusinessParties.find((bp) => bp.id === "5"),
|
||||||
|
type: AccountTypeEnum.Supplier,
|
||||||
|
taxNumber: "9999888877",
|
||||||
|
taxOffice: "Maltepe V.D.",
|
||||||
|
contactPerson: "Ali Öz",
|
||||||
|
phone: "+90 216 555 1122",
|
||||||
|
email: "info@jklgida.com",
|
||||||
|
address: "Maltepe, İstanbul",
|
||||||
|
creditLimit: 30000,
|
||||||
|
balance: 45000,
|
||||||
|
currency: "TRY",
|
||||||
|
riskGroup: RiskGroupEnum.High,
|
||||||
|
paymentTerm: 15,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-05-20"),
|
||||||
|
lastModificationTime: new Date("2024-05-25"),
|
||||||
|
lastTransactionDate: new Date("2024-10-28"),
|
||||||
|
},
|
||||||
|
];
|
||||||
149
ui/src/mocks/mockDeliveries.ts
Normal file
149
ui/src/mocks/mockDeliveries.ts
Normal file
|
|
@ -0,0 +1,149 @@
|
||||||
|
import { MmDelivery, DeliveryStatusEnum, RequestTypeEnum } from "../types/mm";
|
||||||
|
|
||||||
|
export const mockDeliveries: MmDelivery[] = [
|
||||||
|
{
|
||||||
|
id: "DEL001",
|
||||||
|
deliveryNumber: "TES-2024-001",
|
||||||
|
orderId: "ORD001",
|
||||||
|
orderNumber: "SIP-2024-001",
|
||||||
|
requestType: RequestTypeEnum.Material,
|
||||||
|
supplierId: "SUP001",
|
||||||
|
supplierName: "ABC Malzeme Ltd.",
|
||||||
|
courierCompany: "Hızlı Kargo",
|
||||||
|
trackingNumber: "HK123456789",
|
||||||
|
deliveryDate: new Date("2024-02-03"),
|
||||||
|
expectedDeliveryDate: new Date("2024-02-05"),
|
||||||
|
actualDeliveryDate: new Date("2024-02-03"),
|
||||||
|
status: DeliveryStatusEnum.Delivered,
|
||||||
|
deliveryAddress: "Organize Sanayi Bölgesi, 1. Cadde No:15, İstanbul",
|
||||||
|
receivedBy: "Ahmet Yıldız - Depo Sorumlusu",
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
id: "DELI001",
|
||||||
|
materialId: "MAL001",
|
||||||
|
materialName: "Çelik Profil 40x40",
|
||||||
|
orderedQuantity: 100,
|
||||||
|
deliveredQuantity: 100,
|
||||||
|
unit: "adet",
|
||||||
|
condition: "Good", // ✅ artık DeliveryItem union tipine uygun
|
||||||
|
notes: "Tam ve hasarsız teslim alındı",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "DELI002",
|
||||||
|
materialId: "MAL002",
|
||||||
|
materialName: "Kaynak Elektrodu",
|
||||||
|
orderedQuantity: 200,
|
||||||
|
deliveredQuantity: 200,
|
||||||
|
unit: "kg",
|
||||||
|
condition: "Good",
|
||||||
|
notes: "Ambalaj intact",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
notes: "Öncelikli teslimat - 2 gün erken teslim edildi.",
|
||||||
|
attachments: ["teslimat_tutanagi.pdf", "kalite_kontrol_raporu.pdf"],
|
||||||
|
creationTime: new Date("2024-02-01"),
|
||||||
|
lastModificationTime: new Date("2024-02-03"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "DEL002",
|
||||||
|
deliveryNumber: "TES-2024-002",
|
||||||
|
orderId: "ORD002",
|
||||||
|
orderNumber: "SIP-2024-002",
|
||||||
|
requestType: RequestTypeEnum.WorkCenter,
|
||||||
|
supplierId: "SUP002",
|
||||||
|
supplierName: "XYZ Teknoloji A.Ş.",
|
||||||
|
courierCompany: "Güvenli Nakliyat",
|
||||||
|
trackingNumber: "GN987654321",
|
||||||
|
deliveryDate: new Date("2024-02-08"),
|
||||||
|
expectedDeliveryDate: new Date("2024-02-12"),
|
||||||
|
status: DeliveryStatusEnum.PartiallyDelivered,
|
||||||
|
deliveryAddress: "İş Merkezi, 3. Kat, Levent, İstanbul",
|
||||||
|
receivedBy: "Zeynep Kaya - IT Sorumlusu",
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
id: "DELI003",
|
||||||
|
materialId: "EQP001",
|
||||||
|
materialName: "Masaüstü Bilgisayar",
|
||||||
|
orderedQuantity: 10,
|
||||||
|
deliveredQuantity: 7,
|
||||||
|
unit: "adet",
|
||||||
|
condition: "Good",
|
||||||
|
notes: "3 adet gecikecek - tedarikçi bilgilendirildi",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "DELI004",
|
||||||
|
materialId: "EQP002",
|
||||||
|
materialName: "Monitör",
|
||||||
|
orderedQuantity: 10,
|
||||||
|
deliveredQuantity: 10,
|
||||||
|
unit: "adet",
|
||||||
|
condition: "Good",
|
||||||
|
notes: "Tam teslimat",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
notes: "Kısmi teslimat - kalan 3 adet bilgisayar sonraki hafta gelecek.",
|
||||||
|
attachments: ["kismi_teslimat_tutanagi.pdf"],
|
||||||
|
creationTime: new Date("2024-02-05"),
|
||||||
|
lastModificationTime: new Date("2024-02-08"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "DEL003",
|
||||||
|
deliveryNumber: "TES-2024-003",
|
||||||
|
orderId: "ORD003",
|
||||||
|
orderNumber: "SIP-2024-003",
|
||||||
|
requestType: RequestTypeEnum.Service,
|
||||||
|
supplierId: "SUP003",
|
||||||
|
supplierName: "DEF Bakım Ltd.",
|
||||||
|
deliveryDate: new Date("2024-02-01"),
|
||||||
|
expectedDeliveryDate: new Date("2024-02-01"),
|
||||||
|
status: DeliveryStatusEnum.InTransit,
|
||||||
|
deliveryAddress: "Fabrika Sahası, Makine Atölyesi, Gebze, Kocaeli",
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
id: "DELI005",
|
||||||
|
materialId: "SRV001",
|
||||||
|
materialName: "Preventif Bakım Hizmeti",
|
||||||
|
orderedQuantity: 1,
|
||||||
|
deliveredQuantity: 0,
|
||||||
|
unit: "hizmet",
|
||||||
|
condition: "Good",
|
||||||
|
notes: "Teknisyen yolda",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
notes: "Tekniker ekibi fabrikaya doğru yola çıktı.",
|
||||||
|
attachments: [],
|
||||||
|
creationTime: new Date("2024-01-30"),
|
||||||
|
lastModificationTime: new Date("2024-02-01"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "DEL004",
|
||||||
|
deliveryNumber: "TES-2024-004",
|
||||||
|
orderId: "ORD004",
|
||||||
|
orderNumber: "SIP-2024-004",
|
||||||
|
requestType: RequestTypeEnum.Material,
|
||||||
|
supplierId: "SUP004",
|
||||||
|
supplierName: "GHI Kimya San.",
|
||||||
|
courierCompany: "Özel Taşıma",
|
||||||
|
trackingNumber: "OT456789123",
|
||||||
|
deliveryDate: new Date("2024-02-10"),
|
||||||
|
expectedDeliveryDate: new Date("2024-02-08"),
|
||||||
|
status: DeliveryStatusEnum.Delayed,
|
||||||
|
deliveryAddress: "Kimya Fabrikası, Yarışlı Mah., İzmit, Kocaeli",
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
id: "DELI006",
|
||||||
|
materialId: "CHE001",
|
||||||
|
materialName: "Endüstriyel Temizlik Kimyasalı",
|
||||||
|
orderedQuantity: 500,
|
||||||
|
deliveredQuantity: 0,
|
||||||
|
unit: "litre",
|
||||||
|
condition: "Good",
|
||||||
|
notes: "Özel izin bekliyor",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
notes: "Kimyasal madde izni bekleniyor - 2 gün gecikme var.",
|
||||||
|
attachments: ["gecikme_bildirimi.pdf"],
|
||||||
|
creationTime: new Date("2024-02-05"),
|
||||||
|
lastModificationTime: new Date("2024-02-10"),
|
||||||
|
},
|
||||||
|
];
|
||||||
163
ui/src/mocks/mockDemandPlanning.ts
Normal file
163
ui/src/mocks/mockDemandPlanning.ts
Normal file
|
|
@ -0,0 +1,163 @@
|
||||||
|
import {
|
||||||
|
MrpDemandForecast,
|
||||||
|
ForecastMethodEnum,
|
||||||
|
MrpMaterialRequirement,
|
||||||
|
RequirementSourceTypeEnum,
|
||||||
|
} from "../types/mrp";
|
||||||
|
import { mockMaterials } from "./mockMaterials";
|
||||||
|
|
||||||
|
export const mockDemandForecasts: MrpDemandForecast[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
materialId: "1",
|
||||||
|
material: mockMaterials.find((m) => m.id === "1"),
|
||||||
|
forecastPeriod: "Ocak 2025",
|
||||||
|
startDate: new Date("2025-01-01"),
|
||||||
|
endDate: new Date("2025-01-31"),
|
||||||
|
forecastMethod: ForecastMethodEnum.MovingAverage,
|
||||||
|
forecastQuantity: 1200,
|
||||||
|
actualQuantity: 1150,
|
||||||
|
accuracy: 95.8,
|
||||||
|
seasonalityFactor: 1.1,
|
||||||
|
trendFactor: 1.02,
|
||||||
|
creationTime: new Date("2024-12-15"),
|
||||||
|
lastModificationTime: new Date("2024-12-20"),
|
||||||
|
notes: "Geçen senenin aynı dönemine göre %10 artış öngörüldü.",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
materialId: "2",
|
||||||
|
material: mockMaterials.find((m) => m.id === "2"),
|
||||||
|
forecastPeriod: "Ocak 2025",
|
||||||
|
startDate: new Date("2025-01-01"),
|
||||||
|
endDate: new Date("2025-01-31"),
|
||||||
|
forecastMethod: ForecastMethodEnum.ExponentialSmoothing,
|
||||||
|
forecastQuantity: 800,
|
||||||
|
actualQuantity: 820,
|
||||||
|
accuracy: 97.5,
|
||||||
|
trendFactor: 1.05,
|
||||||
|
creationTime: new Date("2024-12-18"),
|
||||||
|
lastModificationTime: new Date("2024-12-22"),
|
||||||
|
notes: "Yeni pazarlama kampanyasının etkisiyle talep artışı bekleniyor.",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
materialId: "3",
|
||||||
|
material: mockMaterials.find((m) => m.id === "3"),
|
||||||
|
forecastPeriod: "Şubat 2025",
|
||||||
|
startDate: new Date("2025-02-01"),
|
||||||
|
endDate: new Date("2025-02-28"),
|
||||||
|
forecastMethod: ForecastMethodEnum.LinearRegression,
|
||||||
|
forecastQuantity: 2500,
|
||||||
|
creationTime: new Date("2024-12-20"),
|
||||||
|
lastModificationTime: new Date("2024-12-25"),
|
||||||
|
notes: "Tarihsel satış verilerine dayalı regresyon analizi sonucu.",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
materialId: "4",
|
||||||
|
material: mockMaterials.find((m) => m.id === "4"),
|
||||||
|
forecastPeriod: "Şubat 2025",
|
||||||
|
startDate: new Date("2025-02-01"),
|
||||||
|
endDate: new Date("2025-02-28"),
|
||||||
|
forecastMethod: ForecastMethodEnum.Seasonal,
|
||||||
|
forecastQuantity: 550,
|
||||||
|
seasonalityFactor: 1.4,
|
||||||
|
creationTime: new Date("2024-12-22"),
|
||||||
|
lastModificationTime: new Date("2024-12-28"),
|
||||||
|
notes: "Kış sezonu nedeniyle talepte mevsimsel artış.",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "df-005",
|
||||||
|
materialId: "3",
|
||||||
|
material: mockMaterials.find((m) => m.id === "3"),
|
||||||
|
forecastPeriod: "Şubat 2025",
|
||||||
|
startDate: new Date("2025-02-01"),
|
||||||
|
endDate: new Date("2025-02-28"),
|
||||||
|
forecastMethod: ForecastMethodEnum.MovingAverage,
|
||||||
|
forecastQuantity: 1300,
|
||||||
|
accuracy: 88.0,
|
||||||
|
creationTime: new Date("2025-01-05"),
|
||||||
|
lastModificationTime: new Date("2025-01-10"),
|
||||||
|
notes: "Ocak ayı verileriyle güncellenmiş hareketli ortalama.",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export const mockMaterialRequirements: MrpMaterialRequirement[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
mrpRunId: "",
|
||||||
|
materialId: "1",
|
||||||
|
material: mockMaterials.find((m) => m.id === "1"),
|
||||||
|
grossRequirement: 1200,
|
||||||
|
scheduledReceipts: 200,
|
||||||
|
projectedAvailable: 150,
|
||||||
|
netRequirement: 850,
|
||||||
|
plannedOrderReceipt: 900,
|
||||||
|
plannedOrderRelease: 900,
|
||||||
|
requirementDate: new Date("2025-01-05"),
|
||||||
|
plannedReceiptDate: new Date("2025-01-10"),
|
||||||
|
plannedReleaseDate: new Date("2025-01-05"),
|
||||||
|
sourceType: RequirementSourceTypeEnum.Forecast,
|
||||||
|
sourceDocumentId: "df-001",
|
||||||
|
creationTime: new Date("2024-12-20"),
|
||||||
|
lastModificationTime: new Date("2024-12-22"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
mrpRunId: "",
|
||||||
|
materialId: "2",
|
||||||
|
material: mockMaterials.find((m) => m.id === "2"),
|
||||||
|
grossRequirement: 500,
|
||||||
|
scheduledReceipts: 0,
|
||||||
|
projectedAvailable: 50,
|
||||||
|
netRequirement: 450,
|
||||||
|
plannedOrderReceipt: 500,
|
||||||
|
plannedOrderRelease: 500,
|
||||||
|
plannedReceiptDate: new Date("2025-01-05"),
|
||||||
|
plannedReleaseDate: new Date("2025-01-10"),
|
||||||
|
requirementDate: new Date("2025-01-20"),
|
||||||
|
sourceType: RequirementSourceTypeEnum.SalesOrder,
|
||||||
|
sourceDocumentId: "SO-2025-001",
|
||||||
|
creationTime: new Date("2025-01-10"),
|
||||||
|
lastModificationTime: new Date("2025-01-15"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
mrpRunId: "",
|
||||||
|
materialId: "3",
|
||||||
|
material: mockMaterials.find((m) => m.id === "3"),
|
||||||
|
grossRequirement: 300,
|
||||||
|
scheduledReceipts: 100,
|
||||||
|
projectedAvailable: 350,
|
||||||
|
netRequirement: 0, // Stok yeterli
|
||||||
|
plannedOrderReceipt: 0,
|
||||||
|
plannedOrderRelease: 0,
|
||||||
|
plannedReceiptDate: new Date("2025-01-25"),
|
||||||
|
plannedReleaseDate: new Date("2025-01-20"),
|
||||||
|
requirementDate: new Date("2025-01-15"),
|
||||||
|
sourceType: RequirementSourceTypeEnum.Forecast,
|
||||||
|
sourceDocumentId: "df-003",
|
||||||
|
creationTime: new Date("2025-01-30"),
|
||||||
|
lastModificationTime: new Date("2025-01-30"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
mrpRunId: "",
|
||||||
|
materialId: "4",
|
||||||
|
material: mockMaterials.find((m) => m.id === "4"),
|
||||||
|
grossRequirement: 400,
|
||||||
|
scheduledReceipts: 0,
|
||||||
|
projectedAvailable: 20,
|
||||||
|
netRequirement: 380,
|
||||||
|
plannedOrderReceipt: 400,
|
||||||
|
plannedOrderRelease: 400,
|
||||||
|
plannedReceiptDate: new Date("2025-02-05"),
|
||||||
|
plannedReleaseDate: new Date("2025-01-30"),
|
||||||
|
requirementDate: new Date("2025-02-10"),
|
||||||
|
sourceType: RequirementSourceTypeEnum.SafetyStock,
|
||||||
|
sourceDocumentId: "SS-2025-001",
|
||||||
|
creationTime: new Date("2025-01-15"),
|
||||||
|
lastModificationTime: new Date("2025-01-20"),
|
||||||
|
},
|
||||||
|
];
|
||||||
109
ui/src/mocks/mockDepartments.ts
Normal file
109
ui/src/mocks/mockDepartments.ts
Normal file
|
|
@ -0,0 +1,109 @@
|
||||||
|
import { HrDepartment } from "../types/hr";
|
||||||
|
|
||||||
|
export const mockDepartments: HrDepartment[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
code: "ÜRT",
|
||||||
|
name: "Üretim",
|
||||||
|
description: "Üretim departmanı",
|
||||||
|
parentDepartmentId: undefined,
|
||||||
|
parentDepartment: undefined,
|
||||||
|
subDepartments: [],
|
||||||
|
managerId: "1",
|
||||||
|
manager: undefined,
|
||||||
|
costCenterId: "cc-005",
|
||||||
|
costCenter: undefined,
|
||||||
|
budget: 8500000,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2022-03-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-15"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
code: "BAK",
|
||||||
|
name: "Bakım",
|
||||||
|
description: "Bakım departmanı",
|
||||||
|
parentDepartmentId: undefined,
|
||||||
|
parentDepartment: undefined,
|
||||||
|
subDepartments: [],
|
||||||
|
managerId: "7",
|
||||||
|
manager: undefined,
|
||||||
|
costCenterId: "cc-011",
|
||||||
|
costCenter: undefined,
|
||||||
|
budget: 2200000,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2022-03-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-15"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
code: "KAL",
|
||||||
|
name: "Kalite Kontrol",
|
||||||
|
description: "Kalite kontrol departmanı",
|
||||||
|
parentDepartmentId: "1",
|
||||||
|
parentDepartment: undefined,
|
||||||
|
subDepartments: [],
|
||||||
|
managerId: "5",
|
||||||
|
manager: undefined,
|
||||||
|
costCenterId: "cc-007",
|
||||||
|
costCenter: undefined,
|
||||||
|
budget: 1200000,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2022-03-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-15"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
code: "DEP",
|
||||||
|
name: "Depo",
|
||||||
|
description: "Depo departmanı",
|
||||||
|
parentDepartmentId: "1",
|
||||||
|
parentDepartment: undefined,
|
||||||
|
subDepartments: [],
|
||||||
|
managerId: "3",
|
||||||
|
manager: undefined,
|
||||||
|
costCenterId: "cc-008",
|
||||||
|
costCenter: undefined,
|
||||||
|
budget: 2800000,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2022-03-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-15"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "5",
|
||||||
|
code: "IDR",
|
||||||
|
name: "İdari İşler",
|
||||||
|
description: "İdari işler departmanı",
|
||||||
|
parentDepartmentId: undefined,
|
||||||
|
parentDepartment: undefined,
|
||||||
|
subDepartments: [],
|
||||||
|
managerId: "2",
|
||||||
|
manager: undefined,
|
||||||
|
costCenterId: "cc-001",
|
||||||
|
costCenter: undefined,
|
||||||
|
budget: 2500000,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2022-03-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-15"),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
mockDepartments.forEach((dept) => {
|
||||||
|
if (dept.parentDepartmentId) {
|
||||||
|
dept.parentDepartment = mockDepartments.find(
|
||||||
|
(d) => d.id === dept.parentDepartmentId
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
mockDepartments.forEach((dept) => {
|
||||||
|
if (dept.parentDepartmentId) {
|
||||||
|
const parent = mockDepartments.find(
|
||||||
|
(d) => d.id === dept.parentDepartmentId
|
||||||
|
);
|
||||||
|
if (parent) {
|
||||||
|
dept.parentDepartment = parent;
|
||||||
|
parent.subDepartments.push(dept); // subDepartments bağlantısı
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
71
ui/src/mocks/mockEmployeeLeaves.ts
Normal file
71
ui/src/mocks/mockEmployeeLeaves.ts
Normal file
|
|
@ -0,0 +1,71 @@
|
||||||
|
import { HrLeave, LeaveStatusEnum, LeaveTypeEnum } from "../types/hr";
|
||||||
|
import { mockEmployees } from "./mockEmployees";
|
||||||
|
|
||||||
|
export const mockEmployeeLeaves: HrLeave[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
employeeId: "1",
|
||||||
|
employee: mockEmployees.find((e) => e.id === "1"),
|
||||||
|
leaveType: LeaveTypeEnum.Annual,
|
||||||
|
startDate: new Date("2024-12-20"),
|
||||||
|
endDate: new Date("2024-12-24"),
|
||||||
|
totalDays: 5,
|
||||||
|
reason: "Yıllık izin talebi",
|
||||||
|
status: LeaveStatusEnum.Pending,
|
||||||
|
appliedDate: new Date("2024-11-15"),
|
||||||
|
isHalfDay: false,
|
||||||
|
attachments: [],
|
||||||
|
creationTime: new Date("2024-11-15"),
|
||||||
|
lastModificationTime: new Date("2024-11-15"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
employeeId: "2",
|
||||||
|
employee: mockEmployees.find((e) => e.id === "2"),
|
||||||
|
leaveType: LeaveTypeEnum.Sick,
|
||||||
|
startDate: new Date("2024-11-10"),
|
||||||
|
endDate: new Date("2024-11-12"),
|
||||||
|
totalDays: 3,
|
||||||
|
reason: "Sağlık kontrolü",
|
||||||
|
status: LeaveStatusEnum.Approved,
|
||||||
|
appliedDate: new Date("2024-11-08"),
|
||||||
|
approvedDate: new Date("2024-11-09"),
|
||||||
|
isHalfDay: false,
|
||||||
|
attachments: [],
|
||||||
|
creationTime: new Date("2024-11-08"),
|
||||||
|
lastModificationTime: new Date("2024-11-09"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
employeeId: "3",
|
||||||
|
employee: mockEmployees.find((e) => e.id === "3"),
|
||||||
|
leaveType: LeaveTypeEnum.Personal,
|
||||||
|
startDate: new Date("2024-12-01"),
|
||||||
|
endDate: new Date("2024-12-01"),
|
||||||
|
totalDays: 0.5,
|
||||||
|
reason: "Kişisel işler",
|
||||||
|
status: LeaveStatusEnum.Rejected,
|
||||||
|
appliedDate: new Date("2024-11-20"),
|
||||||
|
rejectionReason: "Proje teslim tarihi nedeniyle uygun değil",
|
||||||
|
isHalfDay: true,
|
||||||
|
attachments: [],
|
||||||
|
creationTime: new Date("2024-11-20"),
|
||||||
|
lastModificationTime: new Date("2024-11-21"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
employeeId: "4",
|
||||||
|
employee: mockEmployees.find((e) => e.id === "4"),
|
||||||
|
leaveType: LeaveTypeEnum.Emergency,
|
||||||
|
startDate: new Date("2024-11-25"),
|
||||||
|
endDate: new Date("2024-11-26"),
|
||||||
|
totalDays: 2,
|
||||||
|
reason: "Acil aile durumu",
|
||||||
|
status: LeaveStatusEnum.Pending,
|
||||||
|
appliedDate: new Date("2024-11-24"),
|
||||||
|
isHalfDay: false,
|
||||||
|
attachments: [],
|
||||||
|
creationTime: new Date("2024-11-24"),
|
||||||
|
lastModificationTime: new Date("2024-11-24"),
|
||||||
|
},
|
||||||
|
];
|
||||||
59
ui/src/mocks/mockEmployeeTypes.ts
Normal file
59
ui/src/mocks/mockEmployeeTypes.ts
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
import { HrEmploymentType, EmploymentTypeEnum } from "../types/hr";
|
||||||
|
import { mockEmployees } from "./mockEmployees";
|
||||||
|
|
||||||
|
export const mockEmployeeTypes: HrEmploymentType[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
name: "FULL_TIME",
|
||||||
|
count: mockEmployees.filter(
|
||||||
|
(a) => a.employmentType == EmploymentTypeEnum.FullTime
|
||||||
|
).length,
|
||||||
|
creationTime: new Date("2023-01-01T10:00:00Z"),
|
||||||
|
lastModificationTime: new Date("2023-01-01T10:00:00Z"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
name: "PART_TIME",
|
||||||
|
count: mockEmployees.filter(
|
||||||
|
(a) => a.employmentType == EmploymentTypeEnum.PartTime
|
||||||
|
).length,
|
||||||
|
creationTime: new Date("2023-01-01T10:00:00Z"),
|
||||||
|
lastModificationTime: new Date("2023-01-01T10:00:00Z"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
name: "CONTRACT",
|
||||||
|
count: mockEmployees.filter(
|
||||||
|
(a) => a.employmentType == EmploymentTypeEnum.Contract
|
||||||
|
).length,
|
||||||
|
creationTime: new Date("2023-01-01T10:00:00Z"),
|
||||||
|
lastModificationTime: new Date("2023-01-01T10:00:00Z"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
name: "INTERN",
|
||||||
|
count: mockEmployees.filter(
|
||||||
|
(a) => a.employmentType == EmploymentTypeEnum.Intern
|
||||||
|
).length,
|
||||||
|
creationTime: new Date("2023-01-01T10:00:00Z"),
|
||||||
|
lastModificationTime: new Date("2023-01-01T10:00:00Z"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "5",
|
||||||
|
name: "TEMPORARY",
|
||||||
|
count: mockEmployees.filter(
|
||||||
|
(a) => a.employmentType == EmploymentTypeEnum.Temporary
|
||||||
|
).length,
|
||||||
|
creationTime: new Date("2023-01-01T10:00:00Z"),
|
||||||
|
lastModificationTime: new Date("2023-01-01T10:00:00Z"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "6",
|
||||||
|
name: "CONSULTANT",
|
||||||
|
count: mockEmployees.filter(
|
||||||
|
(a) => a.employmentType == EmploymentTypeEnum.Consultant
|
||||||
|
).length,
|
||||||
|
creationTime: new Date("2023-01-01T10:00:00Z"),
|
||||||
|
lastModificationTime: new Date("2023-01-01T10:00:00Z"),
|
||||||
|
},
|
||||||
|
];
|
||||||
592
ui/src/mocks/mockEmployees.ts
Normal file
592
ui/src/mocks/mockEmployees.ts
Normal file
|
|
@ -0,0 +1,592 @@
|
||||||
|
import {
|
||||||
|
HrEmployee,
|
||||||
|
EmployeeStatusEnum,
|
||||||
|
EmploymentTypeEnum,
|
||||||
|
GenderEnum,
|
||||||
|
MaritalStatusEnum,
|
||||||
|
} from "../types/hr";
|
||||||
|
import { mockBanks } from "./mockBanks";
|
||||||
|
import { mockDepartments } from "./mockDepartments";
|
||||||
|
import { mockJobPositions } from "./mockJobPositions";
|
||||||
|
|
||||||
|
export const mockEmployees: HrEmployee[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
code: "EMP-001",
|
||||||
|
firstName: "Ali",
|
||||||
|
lastName: "Öztürk",
|
||||||
|
fullName: "Ali Öztürk",
|
||||||
|
email: "ali.ozturk@company.com",
|
||||||
|
phone: "+90 212 555 0100",
|
||||||
|
personalPhone: "+90 532 555 0101",
|
||||||
|
nationalId: "12345678901",
|
||||||
|
birthDate: new Date("1988-02-14"),
|
||||||
|
gender: GenderEnum.Male,
|
||||||
|
maritalStatus: MaritalStatusEnum.Married,
|
||||||
|
address: {
|
||||||
|
street: "Kızılay Cd. No:12",
|
||||||
|
city: "Ankara",
|
||||||
|
state: "Ankara",
|
||||||
|
postalCode: "06050",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
emergencyContact: {
|
||||||
|
name: "Ayşe Öztürk",
|
||||||
|
relationship: "Eşi",
|
||||||
|
phone: "+90 532 555 0100",
|
||||||
|
},
|
||||||
|
hireDate: new Date("2020-01-15"),
|
||||||
|
employmentType: EmploymentTypeEnum.FullTime,
|
||||||
|
jobPositionId: "1",
|
||||||
|
jobPosition: mockJobPositions.find((jp) => jp.id === "1")!,
|
||||||
|
departmantId: "1",
|
||||||
|
department: mockDepartments.find((d) => d.id === "1")!,
|
||||||
|
baseSalary: 65000,
|
||||||
|
currency: "TRY",
|
||||||
|
payrollGroup: "MONTHLY",
|
||||||
|
bankAccountId: "1",
|
||||||
|
bankAccount: mockBanks.find((b) => b.id === "1")!,
|
||||||
|
workLocation: "Ankara Merkez",
|
||||||
|
workSchedule: {
|
||||||
|
id: "1",
|
||||||
|
scheduleCode: "STD",
|
||||||
|
name: "Standart Mesai",
|
||||||
|
description: "08:30-17:30 Pazartesi-Cuma",
|
||||||
|
workingDays: [],
|
||||||
|
totalHoursPerWeek: 40,
|
||||||
|
isFlexible: false,
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
badgeNumber: "B001",
|
||||||
|
employeeStatus: EmployeeStatusEnum.Active,
|
||||||
|
isActive: true,
|
||||||
|
leaves: [],
|
||||||
|
evaluations: [],
|
||||||
|
trainings: [],
|
||||||
|
disciplinaryActions: [],
|
||||||
|
creationTime: new Date("2020-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-18"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
code: "EMP-002",
|
||||||
|
firstName: "Ayşe",
|
||||||
|
lastName: "Kaya",
|
||||||
|
fullName: "Ayşe Kaya",
|
||||||
|
email: "ayse.kaya@company.com",
|
||||||
|
phone: "+90 212 555 0102",
|
||||||
|
personalPhone: "+90 532 555 0103",
|
||||||
|
nationalId: "12345678902",
|
||||||
|
birthDate: new Date("1990-08-22"),
|
||||||
|
gender: GenderEnum.Female,
|
||||||
|
maritalStatus: MaritalStatusEnum.Single,
|
||||||
|
address: {
|
||||||
|
street: "İnönü Bulvarı No:456",
|
||||||
|
city: "Ankara",
|
||||||
|
state: "Ankara",
|
||||||
|
postalCode: "06000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
emergencyContact: {
|
||||||
|
name: "Fatma Kaya",
|
||||||
|
relationship: "Anne",
|
||||||
|
phone: "+90 532 555 0104",
|
||||||
|
},
|
||||||
|
hireDate: new Date("2021-06-01"),
|
||||||
|
employmentType: EmploymentTypeEnum.FullTime,
|
||||||
|
jobPositionId: "2",
|
||||||
|
jobPosition: mockJobPositions.find((jp) => jp.id === "2")!,
|
||||||
|
|
||||||
|
departmantId: "1",
|
||||||
|
department: mockDepartments.find((d) => d.id === "1")!,
|
||||||
|
baseSalary: 72000,
|
||||||
|
currency: "TRY",
|
||||||
|
payrollGroup: "MONTHLY",
|
||||||
|
bankAccountId: "2",
|
||||||
|
bankAccount: mockBanks.find((b) => b.id === "2")!,
|
||||||
|
workLocation: "Ankara Şube",
|
||||||
|
workSchedule: {
|
||||||
|
id: "2",
|
||||||
|
scheduleCode: "STD",
|
||||||
|
name: "Standart Mesai",
|
||||||
|
description: "08:30-17:30 Pazartesi-Cuma",
|
||||||
|
workingDays: [],
|
||||||
|
totalHoursPerWeek: 40,
|
||||||
|
isFlexible: false,
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
badgeNumber: "B002",
|
||||||
|
employeeStatus: EmployeeStatusEnum.Active,
|
||||||
|
isActive: true,
|
||||||
|
leaves: [],
|
||||||
|
evaluations: [],
|
||||||
|
trainings: [],
|
||||||
|
disciplinaryActions: [],
|
||||||
|
creationTime: new Date("2021-06-01"),
|
||||||
|
lastModificationTime: new Date("2024-01-18"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
code: "EMP-003",
|
||||||
|
firstName: "Mehmet",
|
||||||
|
lastName: "Yılmaz",
|
||||||
|
fullName: "Mehmet Yılmaz",
|
||||||
|
email: "mehmet.yilmaz@company.com",
|
||||||
|
phone: "+90 212 555 0105",
|
||||||
|
personalPhone: "+90 532 555 0106",
|
||||||
|
nationalId: "12345678903",
|
||||||
|
birthDate: new Date("1987-03-12"),
|
||||||
|
gender: GenderEnum.Male,
|
||||||
|
maritalStatus: MaritalStatusEnum.Married,
|
||||||
|
address: {
|
||||||
|
street: "Cumhuriyet Cad. No:123",
|
||||||
|
city: "İstanbul",
|
||||||
|
state: "İstanbul",
|
||||||
|
postalCode: "34000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
emergencyContact: {
|
||||||
|
name: "Zeynep Yılmaz",
|
||||||
|
relationship: "Eşi",
|
||||||
|
phone: "+90 532 555 0107",
|
||||||
|
},
|
||||||
|
hireDate: new Date("2020-02-15"),
|
||||||
|
employmentType: EmploymentTypeEnum.FullTime,
|
||||||
|
jobPositionId: "3",
|
||||||
|
jobPosition: mockJobPositions.find((jp) => jp.id === "3")!,
|
||||||
|
|
||||||
|
departmantId: "1",
|
||||||
|
department: mockDepartments.find((d) => d.id === "1")!,
|
||||||
|
baseSalary: 85000,
|
||||||
|
currency: "TRY",
|
||||||
|
payrollGroup: "MONTHLY",
|
||||||
|
bankAccountId: "2",
|
||||||
|
bankAccount: mockBanks.find((b) => b.id === "2")!,
|
||||||
|
workLocation: "İstanbul HQ",
|
||||||
|
workSchedule: {
|
||||||
|
id: "2",
|
||||||
|
scheduleCode: "FLEX",
|
||||||
|
name: "Esnek Çalışma",
|
||||||
|
description: "09:00-18:00 Pazartesi-Cuma",
|
||||||
|
workingDays: [],
|
||||||
|
totalHoursPerWeek: 40,
|
||||||
|
isFlexible: true,
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
badgeNumber: "B003",
|
||||||
|
employeeStatus: EmployeeStatusEnum.Active,
|
||||||
|
isActive: true,
|
||||||
|
leaves: [],
|
||||||
|
evaluations: [],
|
||||||
|
trainings: [],
|
||||||
|
disciplinaryActions: [],
|
||||||
|
creationTime: new Date("2020-02-15"),
|
||||||
|
lastModificationTime: new Date("2024-02-01"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
code: "EMP-004",
|
||||||
|
firstName: "Selin",
|
||||||
|
lastName: "Demir",
|
||||||
|
fullName: "Selin Demir",
|
||||||
|
email: "selin.demir@company.com",
|
||||||
|
phone: "+90 312 555 0108",
|
||||||
|
personalPhone: "+90 542 555 0109",
|
||||||
|
nationalId: "12345678904",
|
||||||
|
birthDate: new Date("1993-05-25"),
|
||||||
|
gender: GenderEnum.Female,
|
||||||
|
maritalStatus: MaritalStatusEnum.Single,
|
||||||
|
address: {
|
||||||
|
street: "Atatürk Bulvarı No:78",
|
||||||
|
city: "Ankara",
|
||||||
|
state: "Ankara",
|
||||||
|
postalCode: "06100",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
emergencyContact: {
|
||||||
|
name: "Ali Demir",
|
||||||
|
relationship: "Baba",
|
||||||
|
phone: "+90 532 555 0110",
|
||||||
|
},
|
||||||
|
hireDate: new Date("2022-01-10"),
|
||||||
|
employmentType: EmploymentTypeEnum.PartTime,
|
||||||
|
jobPositionId: "4",
|
||||||
|
jobPosition: mockJobPositions.find((jp) => jp.id === "4")!,
|
||||||
|
|
||||||
|
departmantId: "1",
|
||||||
|
department: mockDepartments.find((d) => d.id === "1")!,
|
||||||
|
baseSalary: 60000,
|
||||||
|
currency: "TRY",
|
||||||
|
payrollGroup: "MONTHLY",
|
||||||
|
bankAccountId: "3",
|
||||||
|
bankAccount: mockBanks.find((b) => b.id === "3")!,
|
||||||
|
workLocation: "Ankara Şube",
|
||||||
|
workSchedule: {
|
||||||
|
id: "3",
|
||||||
|
scheduleCode: "PT",
|
||||||
|
name: "Yarı Zamanlı",
|
||||||
|
description: "09:00-13:00 Pazartesi-Cuma",
|
||||||
|
workingDays: [],
|
||||||
|
totalHoursPerWeek: 20,
|
||||||
|
isFlexible: false,
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
badgeNumber: "B004",
|
||||||
|
employeeStatus: EmployeeStatusEnum.Active,
|
||||||
|
isActive: true,
|
||||||
|
leaves: [],
|
||||||
|
evaluations: [],
|
||||||
|
trainings: [],
|
||||||
|
disciplinaryActions: [],
|
||||||
|
creationTime: new Date("2022-01-10"),
|
||||||
|
lastModificationTime: new Date("2024-01-20"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "5",
|
||||||
|
code: "EMP-005",
|
||||||
|
firstName: "Ahmet",
|
||||||
|
lastName: "Çelik",
|
||||||
|
fullName: "Ahmet Çelik",
|
||||||
|
email: "ahmet.celik@company.com",
|
||||||
|
phone: "+90 212 555 0111",
|
||||||
|
personalPhone: "+90 532 555 0112",
|
||||||
|
nationalId: "12345678905",
|
||||||
|
birthDate: new Date("1985-09-10"),
|
||||||
|
gender: GenderEnum.Male,
|
||||||
|
maritalStatus: MaritalStatusEnum.Married,
|
||||||
|
address: {
|
||||||
|
street: "Bağdat Cad. No:25",
|
||||||
|
city: "İstanbul",
|
||||||
|
state: "İstanbul",
|
||||||
|
postalCode: "34728",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
emergencyContact: {
|
||||||
|
name: "Emine Çelik",
|
||||||
|
relationship: "Eşi",
|
||||||
|
phone: "+90 532 555 0113",
|
||||||
|
},
|
||||||
|
hireDate: new Date("2019-04-01"),
|
||||||
|
employmentType: EmploymentTypeEnum.FullTime,
|
||||||
|
jobPositionId: "5",
|
||||||
|
jobPosition: mockJobPositions.find((jp) => jp.id === "5")!,
|
||||||
|
|
||||||
|
departmantId: "1",
|
||||||
|
department: mockDepartments.find((d) => d.id === "1")!,
|
||||||
|
baseSalary: 95000,
|
||||||
|
currency: "TRY",
|
||||||
|
payrollGroup: "MONTHLY",
|
||||||
|
bankAccountId: "4",
|
||||||
|
bankAccount: mockBanks.find((b) => b.id === "4")!,
|
||||||
|
workLocation: "İstanbul HQ",
|
||||||
|
workSchedule: {
|
||||||
|
id: "4",
|
||||||
|
scheduleCode: "STD",
|
||||||
|
name: "Standart Mesai",
|
||||||
|
description: "08:30-17:30 Pazartesi-Cuma",
|
||||||
|
workingDays: [],
|
||||||
|
totalHoursPerWeek: 40,
|
||||||
|
isFlexible: false,
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
badgeNumber: "B005",
|
||||||
|
employeeStatus: EmployeeStatusEnum.Active,
|
||||||
|
isActive: true,
|
||||||
|
leaves: [],
|
||||||
|
evaluations: [],
|
||||||
|
trainings: [],
|
||||||
|
disciplinaryActions: [],
|
||||||
|
creationTime: new Date("2019-04-01"),
|
||||||
|
lastModificationTime: new Date("2024-01-10"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "6",
|
||||||
|
code: "EMP-006",
|
||||||
|
firstName: "Zeynep",
|
||||||
|
lastName: "Arslan",
|
||||||
|
fullName: "Zeynep Arslan",
|
||||||
|
email: "zeynep.arslan@company.com",
|
||||||
|
phone: "+90 216 555 0114",
|
||||||
|
personalPhone: "+90 532 555 0115",
|
||||||
|
nationalId: "12345678906",
|
||||||
|
birthDate: new Date("1995-01-30"),
|
||||||
|
gender: GenderEnum.Female,
|
||||||
|
maritalStatus: MaritalStatusEnum.Single,
|
||||||
|
address: {
|
||||||
|
street: "Yıldız Mah. No:19",
|
||||||
|
city: "İzmir",
|
||||||
|
state: "İzmir",
|
||||||
|
postalCode: "35000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
emergencyContact: {
|
||||||
|
name: "Hasan Arslan",
|
||||||
|
relationship: "Baba",
|
||||||
|
phone: "+90 532 555 0116",
|
||||||
|
},
|
||||||
|
hireDate: new Date("2023-03-20"),
|
||||||
|
employmentType: EmploymentTypeEnum.Intern,
|
||||||
|
jobPositionId: "6",
|
||||||
|
jobPosition: mockJobPositions.find((jp) => jp.id === "6")!,
|
||||||
|
|
||||||
|
departmantId: "1",
|
||||||
|
department: mockDepartments.find((d) => d.id === "1")!,
|
||||||
|
baseSalary: 15000,
|
||||||
|
currency: "TRY",
|
||||||
|
payrollGroup: "MONTHLY",
|
||||||
|
bankAccountId: "1",
|
||||||
|
bankAccount: mockBanks.find((b) => b.id === "1")!,
|
||||||
|
workLocation: "İzmir Ofis",
|
||||||
|
workSchedule: {
|
||||||
|
id: "5",
|
||||||
|
scheduleCode: "INT",
|
||||||
|
name: "Staj Programı",
|
||||||
|
description: "09:00-16:00 Pazartesi-Perşembe",
|
||||||
|
workingDays: [],
|
||||||
|
totalHoursPerWeek: 30,
|
||||||
|
isFlexible: true,
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
badgeNumber: "B006",
|
||||||
|
employeeStatus: EmployeeStatusEnum.Active,
|
||||||
|
isActive: true,
|
||||||
|
leaves: [],
|
||||||
|
evaluations: [],
|
||||||
|
trainings: [],
|
||||||
|
disciplinaryActions: [],
|
||||||
|
creationTime: new Date("2023-03-20"),
|
||||||
|
lastModificationTime: new Date("2024-02-15"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "7",
|
||||||
|
code: "EMP-007",
|
||||||
|
firstName: "Burak",
|
||||||
|
lastName: "Koç",
|
||||||
|
fullName: "Burak Koç",
|
||||||
|
email: "burak.koc@company.com",
|
||||||
|
phone: "+90 224 555 0117",
|
||||||
|
personalPhone: "+90 532 555 0118",
|
||||||
|
nationalId: "12345678907",
|
||||||
|
birthDate: new Date("1991-06-18"),
|
||||||
|
gender: GenderEnum.Male,
|
||||||
|
maritalStatus: MaritalStatusEnum.Married,
|
||||||
|
address: {
|
||||||
|
street: "Osmangazi Mah. No:45",
|
||||||
|
city: "Bursa",
|
||||||
|
state: "Bursa",
|
||||||
|
postalCode: "16000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
emergencyContact: {
|
||||||
|
name: "Elif Koç",
|
||||||
|
relationship: "Eşi",
|
||||||
|
phone: "+90 532 555 0119",
|
||||||
|
},
|
||||||
|
hireDate: new Date("2021-07-12"),
|
||||||
|
employmentType: EmploymentTypeEnum.FullTime,
|
||||||
|
jobPositionId: "7",
|
||||||
|
jobPosition: mockJobPositions.find((jp) => jp.id === "7")!,
|
||||||
|
|
||||||
|
departmantId: "2",
|
||||||
|
department: mockDepartments.find((d) => d.id === "2")!,
|
||||||
|
baseSalary: 75000,
|
||||||
|
currency: "TRY",
|
||||||
|
payrollGroup: "MONTHLY",
|
||||||
|
bankAccountId: "3",
|
||||||
|
bankAccount: mockBanks.find((b) => b.id === "3")!,
|
||||||
|
workLocation: "Bursa Depo",
|
||||||
|
workSchedule: {
|
||||||
|
id: "6",
|
||||||
|
scheduleCode: "STD",
|
||||||
|
name: "Standart Mesai",
|
||||||
|
description: "08:00-17:00 Pazartesi-Cumartesi",
|
||||||
|
workingDays: [],
|
||||||
|
totalHoursPerWeek: 45,
|
||||||
|
isFlexible: false,
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
badgeNumber: "B007",
|
||||||
|
employeeStatus: EmployeeStatusEnum.Active,
|
||||||
|
isActive: true,
|
||||||
|
leaves: [],
|
||||||
|
evaluations: [],
|
||||||
|
trainings: [],
|
||||||
|
disciplinaryActions: [],
|
||||||
|
creationTime: new Date("2021-07-12"),
|
||||||
|
lastModificationTime: new Date("2024-01-05"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "8",
|
||||||
|
code: "EMP-008",
|
||||||
|
firstName: "Elif",
|
||||||
|
lastName: "Şahin",
|
||||||
|
fullName: "Elif Şahin",
|
||||||
|
email: "elif.sahin@company.com",
|
||||||
|
phone: "+90 232 555 0120",
|
||||||
|
personalPhone: "+90 532 555 0121",
|
||||||
|
nationalId: "12345678908",
|
||||||
|
birthDate: new Date("1989-11-05"),
|
||||||
|
gender: GenderEnum.Female,
|
||||||
|
maritalStatus: MaritalStatusEnum.Married,
|
||||||
|
address: {
|
||||||
|
street: "Alsancak Mah. No:88",
|
||||||
|
city: "İzmir",
|
||||||
|
state: "İzmir",
|
||||||
|
postalCode: "35220",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
emergencyContact: {
|
||||||
|
name: "Murat Şahin",
|
||||||
|
relationship: "Eşi",
|
||||||
|
phone: "+90 532 555 0122",
|
||||||
|
},
|
||||||
|
hireDate: new Date("2018-09-01"),
|
||||||
|
employmentType: EmploymentTypeEnum.FullTime,
|
||||||
|
jobPositionId: "8",
|
||||||
|
jobPosition: mockJobPositions.find((jp) => jp.id === "8")!,
|
||||||
|
|
||||||
|
departmantId: "2",
|
||||||
|
department: mockDepartments.find((d) => d.id === "2")!,
|
||||||
|
baseSalary: 130000,
|
||||||
|
currency: "TRY",
|
||||||
|
payrollGroup: "MONTHLY",
|
||||||
|
bankAccountId: "2",
|
||||||
|
bankAccount: mockBanks.find((b) => b.id === "2")!,
|
||||||
|
workLocation: "İzmir Bölge Ofisi",
|
||||||
|
workSchedule: {
|
||||||
|
id: "7",
|
||||||
|
scheduleCode: "STD",
|
||||||
|
name: "Standart Mesai",
|
||||||
|
description: "08:30-17:30 Pazartesi-Cuma",
|
||||||
|
workingDays: [],
|
||||||
|
totalHoursPerWeek: 40,
|
||||||
|
isFlexible: false,
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
badgeNumber: "B008",
|
||||||
|
employeeStatus: EmployeeStatusEnum.Active,
|
||||||
|
isActive: true,
|
||||||
|
leaves: [],
|
||||||
|
evaluations: [],
|
||||||
|
trainings: [],
|
||||||
|
disciplinaryActions: [],
|
||||||
|
creationTime: new Date("2018-09-01"),
|
||||||
|
lastModificationTime: new Date("2024-01-12"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "9",
|
||||||
|
code: "EMP-009",
|
||||||
|
firstName: "Canan",
|
||||||
|
lastName: "Öztürk",
|
||||||
|
fullName: "Canan Öztürk",
|
||||||
|
email: "canan.ozturk@company.com",
|
||||||
|
phone: "+90 312 555 0123",
|
||||||
|
personalPhone: "+90 532 555 0124",
|
||||||
|
nationalId: "12345678909",
|
||||||
|
birthDate: new Date("1992-04-14"),
|
||||||
|
gender: GenderEnum.Female,
|
||||||
|
maritalStatus: MaritalStatusEnum.Single,
|
||||||
|
address: {
|
||||||
|
street: "Bahçelievler Mah. No:55",
|
||||||
|
city: "Ankara",
|
||||||
|
state: "Ankara",
|
||||||
|
postalCode: "06490",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
emergencyContact: {
|
||||||
|
name: "Hüseyin Öztürk",
|
||||||
|
relationship: "Baba",
|
||||||
|
phone: "+90 532 555 0125",
|
||||||
|
},
|
||||||
|
hireDate: new Date("2020-11-02"),
|
||||||
|
employmentType: EmploymentTypeEnum.FullTime,
|
||||||
|
jobPositionId: "9",
|
||||||
|
jobPosition: mockJobPositions.find((jp) => jp.id === "9")!,
|
||||||
|
|
||||||
|
departmantId: "1",
|
||||||
|
department: mockDepartments.find((d) => d.id === "1")!,
|
||||||
|
baseSalary: 50000,
|
||||||
|
currency: "TRY",
|
||||||
|
payrollGroup: "MONTHLY",
|
||||||
|
bankAccountId: "1",
|
||||||
|
bankAccount: mockBanks.find((b) => b.id === "1")!,
|
||||||
|
workLocation: "Ankara Çağrı Merkezi",
|
||||||
|
workSchedule: {
|
||||||
|
id: "8",
|
||||||
|
scheduleCode: "SHIFT",
|
||||||
|
name: "Vardiya",
|
||||||
|
description: "3 vardiya sistemi",
|
||||||
|
workingDays: [],
|
||||||
|
totalHoursPerWeek: 40,
|
||||||
|
isFlexible: true,
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
badgeNumber: "B009",
|
||||||
|
employeeStatus: EmployeeStatusEnum.Active,
|
||||||
|
isActive: true,
|
||||||
|
leaves: [],
|
||||||
|
evaluations: [],
|
||||||
|
trainings: [],
|
||||||
|
disciplinaryActions: [],
|
||||||
|
creationTime: new Date("2020-11-02"),
|
||||||
|
lastModificationTime: new Date("2024-01-18"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "10",
|
||||||
|
code: "EMP-010",
|
||||||
|
firstName: "Murat",
|
||||||
|
lastName: "Aydın",
|
||||||
|
fullName: "Murat Aydın",
|
||||||
|
email: "murat.aydin@company.com",
|
||||||
|
phone: "+90 212 555 0126",
|
||||||
|
personalPhone: "+90 532 555 0127",
|
||||||
|
nationalId: "12345678910",
|
||||||
|
birthDate: new Date("1984-12-22"),
|
||||||
|
gender: GenderEnum.Male,
|
||||||
|
maritalStatus: MaritalStatusEnum.Married,
|
||||||
|
address: {
|
||||||
|
street: "Şişli Mah. No:101",
|
||||||
|
city: "İstanbul",
|
||||||
|
state: "İstanbul",
|
||||||
|
postalCode: "34360",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
emergencyContact: {
|
||||||
|
name: "Ayten Aydın",
|
||||||
|
relationship: "Eşi",
|
||||||
|
phone: "+90 532 555 0128",
|
||||||
|
},
|
||||||
|
hireDate: new Date("2017-05-15"),
|
||||||
|
employmentType: EmploymentTypeEnum.FullTime,
|
||||||
|
jobPositionId: "10",
|
||||||
|
jobPosition: mockJobPositions.find((jp) => jp.id === "10")!,
|
||||||
|
|
||||||
|
departmantId: "1",
|
||||||
|
department: mockDepartments.find((d) => d.id === "1")!,
|
||||||
|
baseSalary: 250000,
|
||||||
|
currency: "TRY",
|
||||||
|
payrollGroup: "MONTHLY",
|
||||||
|
bankAccountId: "4",
|
||||||
|
bankAccount: mockBanks.find((b) => b.id === "4")!,
|
||||||
|
workLocation: "İstanbul Genel Merkez",
|
||||||
|
workSchedule: {
|
||||||
|
id: "9",
|
||||||
|
scheduleCode: "EXEC",
|
||||||
|
name: "Yönetici Çalışma Programı",
|
||||||
|
description: "Esnek yönetici programı",
|
||||||
|
workingDays: [],
|
||||||
|
totalHoursPerWeek: 50,
|
||||||
|
isFlexible: true,
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
badgeNumber: "B010",
|
||||||
|
employeeStatus: EmployeeStatusEnum.Active,
|
||||||
|
isActive: true,
|
||||||
|
leaves: [],
|
||||||
|
evaluations: [],
|
||||||
|
trainings: [],
|
||||||
|
disciplinaryActions: [],
|
||||||
|
creationTime: new Date("2017-05-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-22"),
|
||||||
|
},
|
||||||
|
];
|
||||||
148
ui/src/mocks/mockEvaluation360.ts
Normal file
148
ui/src/mocks/mockEvaluation360.ts
Normal file
|
|
@ -0,0 +1,148 @@
|
||||||
|
import { HrEvaluation360, CampaignStatusEnum } from "../types/hr";
|
||||||
|
|
||||||
|
// Örnek 360° Derece Değerlendirme
|
||||||
|
export const mockEvaluation360: HrEvaluation360[] = [
|
||||||
|
{
|
||||||
|
id: "campaign-001",
|
||||||
|
name: "2024 Q4 360° Derece Değerlendirme",
|
||||||
|
description: "2024 yılı son çeyrek 360° derece performans değerlendirmesi",
|
||||||
|
templateId: "template-001",
|
||||||
|
evaluationPeriod: "2024 Q4",
|
||||||
|
startDate: new Date("2024-11-01"),
|
||||||
|
endDate: new Date("2024-12-15"),
|
||||||
|
status: CampaignStatusEnum.Active,
|
||||||
|
departmentId: "1", // Üretim departmanı
|
||||||
|
targetEmployees: ["1", "2", "3", "4", "5"],
|
||||||
|
settings: {
|
||||||
|
allowSelfEvaluation: true,
|
||||||
|
requireManagerEvaluation: true,
|
||||||
|
minPeerEvaluations: 2,
|
||||||
|
minSubordinateEvaluations: 1,
|
||||||
|
allowAnonymousFeedback: true,
|
||||||
|
sendReminderEmails: true,
|
||||||
|
reminderIntervalDays: 3,
|
||||||
|
},
|
||||||
|
creationTime: new Date("2024-10-15"),
|
||||||
|
lastModificationTime: new Date("2024-11-15"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "campaign-002",
|
||||||
|
name: "2025 Q1 Liderlik Değerlendirmesi",
|
||||||
|
description:
|
||||||
|
"Liderlik pozisyonları için özel 360° derece değerlendirme kampanyası",
|
||||||
|
templateId: "template-001",
|
||||||
|
evaluationPeriod: "2025 Q1",
|
||||||
|
startDate: new Date("2025-01-01"),
|
||||||
|
endDate: new Date("2025-02-28"),
|
||||||
|
status: CampaignStatusEnum.Active,
|
||||||
|
departmentId: "2", // Bakım departmanı
|
||||||
|
targetEmployees: ["7", "8", "9"],
|
||||||
|
settings: {
|
||||||
|
allowSelfEvaluation: true,
|
||||||
|
requireManagerEvaluation: true,
|
||||||
|
minPeerEvaluations: 3,
|
||||||
|
minSubordinateEvaluations: 2,
|
||||||
|
allowAnonymousFeedback: true,
|
||||||
|
sendReminderEmails: true,
|
||||||
|
reminderIntervalDays: 5,
|
||||||
|
},
|
||||||
|
creationTime: new Date("2024-12-01"),
|
||||||
|
lastModificationTime: new Date("2024-12-01"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "campaign-003",
|
||||||
|
name: "2023 Kalite Departmanı Değerlendirme",
|
||||||
|
description:
|
||||||
|
"Kalite kontrol departmanı personeli için 360° derece değerlendirme",
|
||||||
|
templateId: "template-001",
|
||||||
|
evaluationPeriod: "2023 Annual",
|
||||||
|
startDate: new Date("2023-10-01"),
|
||||||
|
endDate: new Date("2023-11-30"),
|
||||||
|
status: CampaignStatusEnum.Active,
|
||||||
|
departmentId: "3", // Kalite Kontrol departmanı
|
||||||
|
targetEmployees: ["5", "6"],
|
||||||
|
settings: {
|
||||||
|
allowSelfEvaluation: true,
|
||||||
|
requireManagerEvaluation: true,
|
||||||
|
minPeerEvaluations: 2,
|
||||||
|
minSubordinateEvaluations: 0,
|
||||||
|
allowAnonymousFeedback: true,
|
||||||
|
sendReminderEmails: true,
|
||||||
|
reminderIntervalDays: 3,
|
||||||
|
},
|
||||||
|
creationTime: new Date("2024-09-15"),
|
||||||
|
lastModificationTime: new Date("2024-11-30"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "campaign-004",
|
||||||
|
name: "2022 Kalite Departmanı Değerlendirme",
|
||||||
|
description:
|
||||||
|
"Kalite kontrol departmanı personeli için 360° derece değerlendirme",
|
||||||
|
templateId: "template-001",
|
||||||
|
evaluationPeriod: "2022 Annual",
|
||||||
|
startDate: new Date("2022-10-01"),
|
||||||
|
endDate: new Date("2024-11-30"),
|
||||||
|
status: CampaignStatusEnum.Active,
|
||||||
|
departmentId: "3", // Kalite Kontrol departmanı
|
||||||
|
targetEmployees: ["5", "6"],
|
||||||
|
settings: {
|
||||||
|
allowSelfEvaluation: true,
|
||||||
|
requireManagerEvaluation: true,
|
||||||
|
minPeerEvaluations: 2,
|
||||||
|
minSubordinateEvaluations: 0,
|
||||||
|
allowAnonymousFeedback: true,
|
||||||
|
sendReminderEmails: true,
|
||||||
|
reminderIntervalDays: 3,
|
||||||
|
},
|
||||||
|
creationTime: new Date("2024-09-15"),
|
||||||
|
lastModificationTime: new Date("2024-11-30"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "campaign-005",
|
||||||
|
name: "2021 Kalite Departmanı Değerlendirme",
|
||||||
|
description:
|
||||||
|
"Kalite kontrol departmanı personeli için 360° derece değerlendirme",
|
||||||
|
templateId: "template-001",
|
||||||
|
evaluationPeriod: "2021 Annual",
|
||||||
|
startDate: new Date("2021-10-01"),
|
||||||
|
endDate: new Date("2021-11-30"),
|
||||||
|
status: CampaignStatusEnum.Active,
|
||||||
|
departmentId: "3", // Kalite Kontrol departmanı
|
||||||
|
targetEmployees: ["5", "6"],
|
||||||
|
settings: {
|
||||||
|
allowSelfEvaluation: true,
|
||||||
|
requireManagerEvaluation: true,
|
||||||
|
minPeerEvaluations: 2,
|
||||||
|
minSubordinateEvaluations: 0,
|
||||||
|
allowAnonymousFeedback: true,
|
||||||
|
sendReminderEmails: true,
|
||||||
|
reminderIntervalDays: 3,
|
||||||
|
},
|
||||||
|
creationTime: new Date("2024-09-15"),
|
||||||
|
lastModificationTime: new Date("2024-11-30"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "campaign-006",
|
||||||
|
name: "2020 Kalite Departmanı Değerlendirme",
|
||||||
|
description:
|
||||||
|
"Kalite kontrol departmanı personeli için 360° derece değerlendirme",
|
||||||
|
templateId: "template-001",
|
||||||
|
evaluationPeriod: "2020 Annual",
|
||||||
|
startDate: new Date("2020-10-01"),
|
||||||
|
endDate: new Date("2020-11-30"),
|
||||||
|
status: CampaignStatusEnum.Active,
|
||||||
|
departmentId: "3", // Kalite Kontrol departmanı
|
||||||
|
targetEmployees: ["5", "6"],
|
||||||
|
settings: {
|
||||||
|
allowSelfEvaluation: true,
|
||||||
|
requireManagerEvaluation: true,
|
||||||
|
minPeerEvaluations: 2,
|
||||||
|
minSubordinateEvaluations: 0,
|
||||||
|
allowAnonymousFeedback: true,
|
||||||
|
sendReminderEmails: true,
|
||||||
|
reminderIntervalDays: 3,
|
||||||
|
},
|
||||||
|
creationTime: new Date("2024-09-15"),
|
||||||
|
lastModificationTime: new Date("2024-11-30"),
|
||||||
|
},
|
||||||
|
];
|
||||||
519
ui/src/mocks/mockEvaluation360Results.ts
Normal file
519
ui/src/mocks/mockEvaluation360Results.ts
Normal file
|
|
@ -0,0 +1,519 @@
|
||||||
|
import {
|
||||||
|
AssessorTypeEnum,
|
||||||
|
HrEvaluation360Result,
|
||||||
|
ResultStatusEnum,
|
||||||
|
ParticipantStatusEnum,
|
||||||
|
} from "../types/hr";
|
||||||
|
|
||||||
|
// Örnek Sonuçlar
|
||||||
|
export const mockEvaluation360Results: HrEvaluation360Result[] = [
|
||||||
|
{
|
||||||
|
id: "result-001",
|
||||||
|
campaignId: "campaign-001",
|
||||||
|
employeeId: "1",
|
||||||
|
participants: [
|
||||||
|
// Ali Öztürk'ün kendisi tarafından değerlendirme
|
||||||
|
{
|
||||||
|
id: "part-001",
|
||||||
|
campaignId: "campaign-001",
|
||||||
|
evaluatedEmployeeId: "1",
|
||||||
|
evaluatorId: "1", // Kendi değerlendirmesi
|
||||||
|
evaluatorType: AssessorTypeEnum.Self,
|
||||||
|
status: ParticipantStatusEnum.Completed,
|
||||||
|
invitedDate: new Date("2024-11-01"),
|
||||||
|
startedDate: new Date("2024-11-05"),
|
||||||
|
completedDate: new Date("2024-11-10"),
|
||||||
|
responses: [
|
||||||
|
{
|
||||||
|
id: "resp-001",
|
||||||
|
participantId: "part-001",
|
||||||
|
questionId: "q-001", // İletişim Becerileri - İletişim kurar
|
||||||
|
responseValue: 4,
|
||||||
|
score: 4,
|
||||||
|
submittedDate: new Date("2024-11-10"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "resp-002",
|
||||||
|
participantId: "part-001",
|
||||||
|
questionId: "q-002", // İletişim Becerileri - Dinleme
|
||||||
|
responseValue: 4,
|
||||||
|
score: 4,
|
||||||
|
submittedDate: new Date("2024-11-10"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "resp-003",
|
||||||
|
participantId: "part-001",
|
||||||
|
questionId: "q-005", // Takım Çalışması
|
||||||
|
responseValue: 4,
|
||||||
|
score: 4,
|
||||||
|
submittedDate: new Date("2024-11-10"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "resp-004",
|
||||||
|
participantId: "part-001",
|
||||||
|
questionId: "q-008", // Liderlik - Motivasyon
|
||||||
|
responseValue: 3,
|
||||||
|
score: 3,
|
||||||
|
submittedDate: new Date("2024-11-10"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "resp-005",
|
||||||
|
participantId: "part-001",
|
||||||
|
questionId: "q-010", // Problem Çözme
|
||||||
|
responseValue: 5,
|
||||||
|
score: 5,
|
||||||
|
submittedDate: new Date("2024-11-10"),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
overallScore: 85,
|
||||||
|
notes: "Genel olarak kendimi başarılı buluyorum",
|
||||||
|
},
|
||||||
|
// Yönetici tarafından değerlendirme
|
||||||
|
{
|
||||||
|
id: "part-002",
|
||||||
|
campaignId: "campaign-001",
|
||||||
|
evaluatedEmployeeId: "1",
|
||||||
|
evaluatorId: "2", // Yönetici değerlendirmesi
|
||||||
|
evaluatorType: AssessorTypeEnum.Manager,
|
||||||
|
status: ParticipantStatusEnum.Completed,
|
||||||
|
invitedDate: new Date("2024-11-01"),
|
||||||
|
startedDate: new Date("2024-11-08"),
|
||||||
|
completedDate: new Date("2024-11-12"),
|
||||||
|
responses: [
|
||||||
|
{
|
||||||
|
id: "resp-006",
|
||||||
|
participantId: "part-002",
|
||||||
|
questionId: "q-001",
|
||||||
|
responseValue: 5,
|
||||||
|
score: 5,
|
||||||
|
submittedDate: new Date("2024-11-12"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "resp-007",
|
||||||
|
participantId: "part-002",
|
||||||
|
questionId: "q-002",
|
||||||
|
responseValue: 4,
|
||||||
|
score: 4,
|
||||||
|
submittedDate: new Date("2024-11-12"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "resp-008",
|
||||||
|
participantId: "part-002",
|
||||||
|
questionId: "q-005",
|
||||||
|
responseValue: 5,
|
||||||
|
score: 5,
|
||||||
|
submittedDate: new Date("2024-11-12"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "resp-009",
|
||||||
|
participantId: "part-002",
|
||||||
|
questionId: "q-008",
|
||||||
|
responseValue: 4,
|
||||||
|
score: 4,
|
||||||
|
submittedDate: new Date("2024-11-12"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "resp-010",
|
||||||
|
participantId: "part-002",
|
||||||
|
questionId: "q-010",
|
||||||
|
responseValue: 5,
|
||||||
|
score: 5,
|
||||||
|
submittedDate: new Date("2024-11-12"),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
overallScore: 92,
|
||||||
|
notes: "Çok başarılı bir ekip üyesi",
|
||||||
|
},
|
||||||
|
// Meslektaş değerlendirmeleri
|
||||||
|
{
|
||||||
|
id: "part-003",
|
||||||
|
campaignId: "campaign-001",
|
||||||
|
evaluatedEmployeeId: "1",
|
||||||
|
evaluatorId: "3", // Meslektaş değerlendirmesi
|
||||||
|
evaluatorType: AssessorTypeEnum.Peer,
|
||||||
|
status: ParticipantStatusEnum.Completed,
|
||||||
|
invitedDate: new Date("2024-11-01"),
|
||||||
|
startedDate: new Date("2024-11-06"),
|
||||||
|
completedDate: new Date("2024-11-11"),
|
||||||
|
responses: [
|
||||||
|
{
|
||||||
|
id: "resp-011",
|
||||||
|
participantId: "part-003",
|
||||||
|
questionId: "q-001",
|
||||||
|
responseValue: 4,
|
||||||
|
score: 4,
|
||||||
|
submittedDate: new Date("2024-11-11"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "resp-012",
|
||||||
|
participantId: "part-003",
|
||||||
|
questionId: "q-002",
|
||||||
|
responseValue: 5,
|
||||||
|
score: 5,
|
||||||
|
submittedDate: new Date("2024-11-11"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "resp-013",
|
||||||
|
participantId: "part-003",
|
||||||
|
questionId: "q-005",
|
||||||
|
responseValue: 4,
|
||||||
|
score: 4,
|
||||||
|
submittedDate: new Date("2024-11-11"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "resp-014",
|
||||||
|
participantId: "part-003",
|
||||||
|
questionId: "q-008",
|
||||||
|
responseValue: 3,
|
||||||
|
score: 3,
|
||||||
|
submittedDate: new Date("2024-11-11"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "resp-015",
|
||||||
|
participantId: "part-003",
|
||||||
|
questionId: "q-010",
|
||||||
|
responseValue: 4,
|
||||||
|
score: 4,
|
||||||
|
submittedDate: new Date("2024-11-11"),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
overallScore: 87,
|
||||||
|
notes: "İşbirliğinde çok başarılı",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
overallScore: 88.5,
|
||||||
|
maxPossibleScore: 100,
|
||||||
|
scorePercentage: 88.5,
|
||||||
|
groupScores: [
|
||||||
|
{
|
||||||
|
groupId: "group-001",
|
||||||
|
groupName: "İletişim Becerileri",
|
||||||
|
score: 22,
|
||||||
|
maxScore: 25,
|
||||||
|
percentage: 88,
|
||||||
|
responseCount: 3,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
groupId: "group-002",
|
||||||
|
groupName: "Takım Çalışması",
|
||||||
|
score: 23,
|
||||||
|
maxScore: 25,
|
||||||
|
percentage: 92,
|
||||||
|
responseCount: 3,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
groupId: "group-003",
|
||||||
|
groupName: "Liderlik",
|
||||||
|
score: 20,
|
||||||
|
maxScore: 25,
|
||||||
|
percentage: 80,
|
||||||
|
responseCount: 3,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
groupId: "group-004",
|
||||||
|
groupName: "Problem Çözme",
|
||||||
|
score: 23.5,
|
||||||
|
maxScore: 25,
|
||||||
|
percentage: 94,
|
||||||
|
responseCount: 3,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
assessorTypeScores: [
|
||||||
|
{
|
||||||
|
assessorType: AssessorTypeEnum.Self,
|
||||||
|
assessorCount: 1,
|
||||||
|
averageScore: 85,
|
||||||
|
maxScore: 100,
|
||||||
|
percentage: 85,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
assessorType: AssessorTypeEnum.Manager,
|
||||||
|
assessorCount: 1,
|
||||||
|
averageScore: 92,
|
||||||
|
maxScore: 100,
|
||||||
|
percentage: 92,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
assessorType: AssessorTypeEnum.Peer,
|
||||||
|
assessorCount: 2,
|
||||||
|
averageScore: 87,
|
||||||
|
maxScore: 100,
|
||||||
|
percentage: 87,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
strengths: [
|
||||||
|
"Problem çözme konusunda çok başarılı",
|
||||||
|
"Takım çalışmasında öne çıkıyor",
|
||||||
|
"İletişim becerileri güçlü",
|
||||||
|
],
|
||||||
|
developmentAreas: [
|
||||||
|
"Liderlik becerilerini geliştirmeli",
|
||||||
|
"Zaman yönetimi konusunda iyileştirme yapabilir",
|
||||||
|
],
|
||||||
|
actionPlan: [
|
||||||
|
"Liderlik eğitimi alması öneriliyor",
|
||||||
|
"Zaman yönetimi workshop'una katılmalı",
|
||||||
|
"Mentorluk programına dahil edilmeli",
|
||||||
|
],
|
||||||
|
managerComments: "Genel olarak çok başarılı. Liderlik potansiyeli yüksek.",
|
||||||
|
status: ResultStatusEnum.Pending,
|
||||||
|
generatedDate: new Date("2024-11-20"),
|
||||||
|
approvedBy: "hr-manager",
|
||||||
|
approvedDate: new Date("2024-11-22"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "result-002",
|
||||||
|
campaignId: "campaign-003",
|
||||||
|
employeeId: "5",
|
||||||
|
participants: [
|
||||||
|
// Fatma Yıldız'ın kendisi tarafından değerlendirme
|
||||||
|
{
|
||||||
|
id: "part-101",
|
||||||
|
campaignId: "campaign-003",
|
||||||
|
evaluatedEmployeeId: "5",
|
||||||
|
evaluatorId: "5", // Kendi değerlendirmesi
|
||||||
|
evaluatorType: AssessorTypeEnum.Self,
|
||||||
|
status: ParticipantStatusEnum.Declined,
|
||||||
|
invitedDate: new Date("2024-10-01"),
|
||||||
|
startedDate: new Date("2024-10-05"),
|
||||||
|
completedDate: new Date("2024-10-15"),
|
||||||
|
responses: [
|
||||||
|
{
|
||||||
|
id: "resp-101",
|
||||||
|
participantId: "part-101",
|
||||||
|
questionId: "q-001",
|
||||||
|
responseValue: 4,
|
||||||
|
score: 4,
|
||||||
|
submittedDate: new Date("2024-10-15"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "resp-102",
|
||||||
|
participantId: "part-101",
|
||||||
|
questionId: "q-002",
|
||||||
|
responseValue: 4,
|
||||||
|
score: 4,
|
||||||
|
submittedDate: new Date("2024-10-15"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "resp-103",
|
||||||
|
participantId: "part-101",
|
||||||
|
questionId: "q-005",
|
||||||
|
responseValue: 4,
|
||||||
|
score: 4,
|
||||||
|
submittedDate: new Date("2024-10-15"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "resp-104",
|
||||||
|
participantId: "part-101",
|
||||||
|
questionId: "q-008",
|
||||||
|
responseValue: 4,
|
||||||
|
score: 4,
|
||||||
|
submittedDate: new Date("2024-10-15"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "resp-105",
|
||||||
|
participantId: "part-101",
|
||||||
|
questionId: "q-010",
|
||||||
|
responseValue: 5,
|
||||||
|
score: 5,
|
||||||
|
submittedDate: new Date("2024-10-15"),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
overallScore: 88,
|
||||||
|
notes: "Kalite standartlarına uyum konusunda kendimi başarılı buluyorum",
|
||||||
|
},
|
||||||
|
// Yönetici tarafından değerlendirme
|
||||||
|
{
|
||||||
|
id: "part-102",
|
||||||
|
campaignId: "campaign-003",
|
||||||
|
evaluatedEmployeeId: "5",
|
||||||
|
evaluatorId: "1", // Yönetici değerlendirmesi
|
||||||
|
evaluatorType: AssessorTypeEnum.Manager,
|
||||||
|
status: ParticipantStatusEnum.Invited,
|
||||||
|
invitedDate: new Date("2024-10-01"),
|
||||||
|
startedDate: new Date("2024-10-10"),
|
||||||
|
completedDate: new Date("2024-10-20"),
|
||||||
|
responses: [
|
||||||
|
{
|
||||||
|
id: "resp-106",
|
||||||
|
participantId: "part-102",
|
||||||
|
questionId: "q-001",
|
||||||
|
responseValue: 5,
|
||||||
|
score: 5,
|
||||||
|
submittedDate: new Date("2024-10-20"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "resp-107",
|
||||||
|
participantId: "part-102",
|
||||||
|
questionId: "q-002",
|
||||||
|
responseValue: 5,
|
||||||
|
score: 5,
|
||||||
|
submittedDate: new Date("2024-10-20"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "resp-108",
|
||||||
|
participantId: "part-102",
|
||||||
|
questionId: "q-005",
|
||||||
|
responseValue: 4,
|
||||||
|
score: 4,
|
||||||
|
submittedDate: new Date("2024-10-20"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "resp-109",
|
||||||
|
participantId: "part-102",
|
||||||
|
questionId: "q-008",
|
||||||
|
responseValue: 4,
|
||||||
|
score: 4,
|
||||||
|
submittedDate: new Date("2024-10-20"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "resp-110",
|
||||||
|
participantId: "part-102",
|
||||||
|
questionId: "q-010",
|
||||||
|
responseValue: 5,
|
||||||
|
score: 5,
|
||||||
|
submittedDate: new Date("2024-10-20"),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
overallScore: 91,
|
||||||
|
notes: "Kalite kontrol süreçlerinde çok titiz ve başarılı",
|
||||||
|
},
|
||||||
|
// Meslektaş değerlendirmesi
|
||||||
|
{
|
||||||
|
id: "part-103",
|
||||||
|
campaignId: "campaign-003",
|
||||||
|
evaluatedEmployeeId: "5",
|
||||||
|
evaluatorId: "6", // Meslektaş değerlendirmesi
|
||||||
|
evaluatorType: AssessorTypeEnum.Peer,
|
||||||
|
status: ParticipantStatusEnum.Started,
|
||||||
|
invitedDate: new Date("2024-10-01"),
|
||||||
|
startedDate: new Date("2024-10-12"),
|
||||||
|
completedDate: new Date("2024-10-18"),
|
||||||
|
responses: [
|
||||||
|
{
|
||||||
|
id: "resp-111",
|
||||||
|
participantId: "part-103",
|
||||||
|
questionId: "q-001",
|
||||||
|
responseValue: 5,
|
||||||
|
score: 5,
|
||||||
|
submittedDate: new Date("2024-10-18"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "resp-112",
|
||||||
|
participantId: "part-103",
|
||||||
|
questionId: "q-002",
|
||||||
|
responseValue: 4,
|
||||||
|
score: 4,
|
||||||
|
submittedDate: new Date("2024-10-18"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "resp-113",
|
||||||
|
participantId: "part-103",
|
||||||
|
questionId: "q-005",
|
||||||
|
responseValue: 4,
|
||||||
|
score: 4,
|
||||||
|
submittedDate: new Date("2024-10-18"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "resp-114",
|
||||||
|
participantId: "part-103",
|
||||||
|
questionId: "q-008",
|
||||||
|
responseValue: 4,
|
||||||
|
score: 4,
|
||||||
|
submittedDate: new Date("2024-10-18"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "resp-115",
|
||||||
|
participantId: "part-103",
|
||||||
|
questionId: "q-010",
|
||||||
|
responseValue: 5,
|
||||||
|
score: 5,
|
||||||
|
submittedDate: new Date("2024-10-18"),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
overallScore: 89,
|
||||||
|
notes: "Detaycı ve kalite odaklı çalışıyor",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
overallScore: 450,
|
||||||
|
maxPossibleScore: 500,
|
||||||
|
scorePercentage: 90,
|
||||||
|
groupScores: [
|
||||||
|
{
|
||||||
|
groupId: "group-001",
|
||||||
|
groupName: "İletişim Becerileri",
|
||||||
|
score: 115,
|
||||||
|
maxScore: 125,
|
||||||
|
percentage: 92,
|
||||||
|
responseCount: 3,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
groupId: "group-002",
|
||||||
|
groupName: "Takım Çalışması",
|
||||||
|
score: 110,
|
||||||
|
maxScore: 125,
|
||||||
|
percentage: 88,
|
||||||
|
responseCount: 3,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
groupId: "group-003",
|
||||||
|
groupName: "Liderlik",
|
||||||
|
score: 105,
|
||||||
|
maxScore: 125,
|
||||||
|
percentage: 84,
|
||||||
|
responseCount: 3,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
groupId: "group-004",
|
||||||
|
groupName: "Problem Çözme",
|
||||||
|
score: 120,
|
||||||
|
maxScore: 125,
|
||||||
|
percentage: 96,
|
||||||
|
responseCount: 3,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
assessorTypeScores: [
|
||||||
|
{
|
||||||
|
assessorType: AssessorTypeEnum.Self,
|
||||||
|
assessorCount: 1,
|
||||||
|
averageScore: 88,
|
||||||
|
maxScore: 100,
|
||||||
|
percentage: 88,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
assessorType: AssessorTypeEnum.Manager,
|
||||||
|
assessorCount: 1,
|
||||||
|
averageScore: 91,
|
||||||
|
maxScore: 100,
|
||||||
|
percentage: 91,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
assessorType: AssessorTypeEnum.Peer,
|
||||||
|
assessorCount: 2,
|
||||||
|
averageScore: 89,
|
||||||
|
maxScore: 100,
|
||||||
|
percentage: 89,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
strengths: [
|
||||||
|
"Kalite standartlarına titizlikle uyuyor",
|
||||||
|
"Analitik düşünce becerisi güçlü",
|
||||||
|
"Detaycı ve organizeli çalışıyor",
|
||||||
|
],
|
||||||
|
developmentAreas: [
|
||||||
|
"Takım motivasyonu konusunda gelişim gösterebilir",
|
||||||
|
"Yaratıcı çözümler üretme konusunda iyileştirme yapabilir",
|
||||||
|
],
|
||||||
|
actionPlan: [
|
||||||
|
"Takım liderliği eğitimi alması öneriliyor",
|
||||||
|
"Yaratıcı düşünce workshop'una katılmalı",
|
||||||
|
"Cross-functional projelerde yer almalı",
|
||||||
|
],
|
||||||
|
managerComments: "Kalite kontrol süreçlerinde mükemmel performans gösteriyor.",
|
||||||
|
hrComments: "Liderlik potansiyeli geliştirilmeli.",
|
||||||
|
status: ResultStatusEnum.Pending,
|
||||||
|
generatedDate: new Date("2024-12 -01"),
|
||||||
|
approvedBy: "quality-manager",
|
||||||
|
approvedDate: new Date("2024-12-03"),
|
||||||
|
},
|
||||||
|
];
|
||||||
283
ui/src/mocks/mockEvaluation360Templates.ts
Normal file
283
ui/src/mocks/mockEvaluation360Templates.ts
Normal file
|
|
@ -0,0 +1,283 @@
|
||||||
|
import {
|
||||||
|
HrEvaluation360Template,
|
||||||
|
QuestionTypeEnum,
|
||||||
|
AssessorTypeEnum,
|
||||||
|
} from "../types/hr";
|
||||||
|
|
||||||
|
// Örnek Değerlendirme Şablonu
|
||||||
|
export const mockEvaluation360Templates: HrEvaluation360Template[] = [
|
||||||
|
{
|
||||||
|
id: "template-001",
|
||||||
|
name: "Genel Yetkinlik Değerlendirmesi",
|
||||||
|
description:
|
||||||
|
"Tüm pozisyonlar için kullanılabilecek genel 360° derece değerlendirme şablonu",
|
||||||
|
isActive: true,
|
||||||
|
assessorTypes: [
|
||||||
|
AssessorTypeEnum.Self,
|
||||||
|
AssessorTypeEnum.Manager,
|
||||||
|
AssessorTypeEnum.Peer,
|
||||||
|
AssessorTypeEnum.Subordinate,
|
||||||
|
AssessorTypeEnum.Customer,
|
||||||
|
AssessorTypeEnum.External,
|
||||||
|
AssessorTypeEnum.HRUpperManagement,
|
||||||
|
AssessorTypeEnum.OtherDepartment,
|
||||||
|
],
|
||||||
|
questionGroups: [
|
||||||
|
{
|
||||||
|
id: "group-001",
|
||||||
|
templateId: "template-001",
|
||||||
|
groupName: "İletişim Becerileri",
|
||||||
|
description: "Sözlü ve yazılı iletişim, dinleme becerileri",
|
||||||
|
weight: 25,
|
||||||
|
order: 1,
|
||||||
|
questions: [
|
||||||
|
{
|
||||||
|
id: "q-001",
|
||||||
|
groupId: "group-001",
|
||||||
|
questionText:
|
||||||
|
"Bu kişi açık ve anlaşılır bir şekilde iletişim kurar",
|
||||||
|
questionType: QuestionTypeEnum.Rating,
|
||||||
|
isRequired: true,
|
||||||
|
weight: 20,
|
||||||
|
order: 1,
|
||||||
|
minRating: 1,
|
||||||
|
maxRating: 5,
|
||||||
|
ratingLabels: [
|
||||||
|
"Hiç Katılmıyorum",
|
||||||
|
"Katılmıyorum",
|
||||||
|
"Kararsızım",
|
||||||
|
"Katılıyorum",
|
||||||
|
"Tamamen Katılıyorum",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "q-002",
|
||||||
|
groupId: "group-001",
|
||||||
|
questionText: "Bu kişi diğerlerini etkin bir şekilde dinler",
|
||||||
|
questionType: QuestionTypeEnum.Rating,
|
||||||
|
isRequired: true,
|
||||||
|
weight: 20,
|
||||||
|
order: 2,
|
||||||
|
minRating: 1,
|
||||||
|
maxRating: 5,
|
||||||
|
ratingLabels: [
|
||||||
|
"Hiç Katılmıyorum",
|
||||||
|
"Katılmıyorum",
|
||||||
|
"Kararsızım",
|
||||||
|
"Katılıyorum",
|
||||||
|
"Tamamen Katılıyorum",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "q-003",
|
||||||
|
groupId: "group-001",
|
||||||
|
questionText: "Bu kişinin yazılı iletişim becerileri nasıldır?",
|
||||||
|
questionType: QuestionTypeEnum.MultipleChoice,
|
||||||
|
isRequired: true,
|
||||||
|
weight: 15,
|
||||||
|
order: 3,
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
id: "opt-001",
|
||||||
|
questionId: "q-003",
|
||||||
|
optionText: "Çok Zayıf",
|
||||||
|
value: 1,
|
||||||
|
order: 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "opt-002",
|
||||||
|
questionId: "q-003",
|
||||||
|
optionText: "Zayıf",
|
||||||
|
value: 2,
|
||||||
|
order: 2,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "opt-003",
|
||||||
|
questionId: "q-003",
|
||||||
|
optionText: "Orta",
|
||||||
|
value: 3,
|
||||||
|
order: 3,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "opt-004",
|
||||||
|
questionId: "q-003",
|
||||||
|
optionText: "İyi",
|
||||||
|
value: 4,
|
||||||
|
order: 4,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "opt-005",
|
||||||
|
questionId: "q-003",
|
||||||
|
optionText: "Mükemmel",
|
||||||
|
value: 5,
|
||||||
|
order: 5,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "q-004",
|
||||||
|
groupId: "group-001",
|
||||||
|
questionText: "İletişim konusunda özel yorumlarınız:",
|
||||||
|
questionType: QuestionTypeEnum.Text,
|
||||||
|
isRequired: false,
|
||||||
|
weight: 5,
|
||||||
|
order: 4,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "group-002",
|
||||||
|
templateId: "template-001",
|
||||||
|
groupName: "Takım Çalışması",
|
||||||
|
description: "İşbirliği, team work, ortak hedeflere odaklanma",
|
||||||
|
weight: 25,
|
||||||
|
order: 2,
|
||||||
|
questions: [
|
||||||
|
{
|
||||||
|
id: "q-005",
|
||||||
|
groupId: "group-002",
|
||||||
|
questionText: "Bu kişi takım içinde yapıcı bir rol oynar",
|
||||||
|
questionType: QuestionTypeEnum.Rating,
|
||||||
|
isRequired: true,
|
||||||
|
weight: 25,
|
||||||
|
order: 1,
|
||||||
|
minRating: 1,
|
||||||
|
maxRating: 5,
|
||||||
|
ratingLabels: [
|
||||||
|
"Hiç Katılmıyorum",
|
||||||
|
"Katılmıyorum",
|
||||||
|
"Kararsızım",
|
||||||
|
"Katılıyorum",
|
||||||
|
"Tamamen Katılıyorum",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "q-006",
|
||||||
|
groupId: "group-002",
|
||||||
|
questionText: "Bu kişi çatışma durumlarında yapıcı çözümler önerir",
|
||||||
|
questionType: QuestionTypeEnum.Rating,
|
||||||
|
isRequired: true,
|
||||||
|
weight: 25,
|
||||||
|
order: 2,
|
||||||
|
minRating: 1,
|
||||||
|
maxRating: 5,
|
||||||
|
ratingLabels: [
|
||||||
|
"Hiç Katılmıyorum",
|
||||||
|
"Katılmıyorum",
|
||||||
|
"Kararsızım",
|
||||||
|
"Katılıyorum",
|
||||||
|
"Tamamen Katılıyorum",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "q-007",
|
||||||
|
groupId: "group-002",
|
||||||
|
questionText:
|
||||||
|
"Takım çalışması konusundaki gözlemlerinizi paylaşın:",
|
||||||
|
questionType: QuestionTypeEnum.Text,
|
||||||
|
isRequired: false,
|
||||||
|
weight: 10,
|
||||||
|
order: 3,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "group-003",
|
||||||
|
templateId: "template-001",
|
||||||
|
groupName: "Liderlik",
|
||||||
|
description: "Vizyon oluşturma, yönlendirme, motivasyon",
|
||||||
|
weight: 25,
|
||||||
|
order: 3,
|
||||||
|
questions: [
|
||||||
|
{
|
||||||
|
id: "q-008",
|
||||||
|
groupId: "group-003",
|
||||||
|
questionText: "Bu kişi takımı motive etme konusunda başarılıdır",
|
||||||
|
questionType: QuestionTypeEnum.Rating,
|
||||||
|
isRequired: true,
|
||||||
|
weight: 30,
|
||||||
|
order: 1,
|
||||||
|
minRating: 1,
|
||||||
|
maxRating: 5,
|
||||||
|
ratingLabels: [
|
||||||
|
"Hiç Katılmıyorum",
|
||||||
|
"Katılmıyorum",
|
||||||
|
"Kararsızım",
|
||||||
|
"Katılıyorum",
|
||||||
|
"Tamamen Katılıyorum",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "q-009",
|
||||||
|
groupId: "group-003",
|
||||||
|
questionText: "Bu kişi zor durumlarda liderlik gösterir",
|
||||||
|
questionType: QuestionTypeEnum.Rating,
|
||||||
|
isRequired: true,
|
||||||
|
weight: 30,
|
||||||
|
order: 2,
|
||||||
|
minRating: 1,
|
||||||
|
maxRating: 5,
|
||||||
|
ratingLabels: [
|
||||||
|
"Hiç Katılmıyorum",
|
||||||
|
"Katılmıyorum",
|
||||||
|
"Kararsızım",
|
||||||
|
"Katılıyorum",
|
||||||
|
"Tamamen Katılıyorum",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "group-004",
|
||||||
|
templateId: "template-001",
|
||||||
|
groupName: "Problem Çözme",
|
||||||
|
description: "Analitik düşünme, yaratıcı çözümler üretme",
|
||||||
|
weight: 25,
|
||||||
|
order: 4,
|
||||||
|
questions: [
|
||||||
|
{
|
||||||
|
id: "q-010",
|
||||||
|
groupId: "group-004",
|
||||||
|
questionText:
|
||||||
|
"Bu kişi karmaşık problemleri etkili bir şekilde analiz eder",
|
||||||
|
questionType: QuestionTypeEnum.Rating,
|
||||||
|
isRequired: true,
|
||||||
|
weight: 30,
|
||||||
|
order: 1,
|
||||||
|
minRating: 1,
|
||||||
|
maxRating: 5,
|
||||||
|
ratingLabels: [
|
||||||
|
"Hiç Katılmıyorum",
|
||||||
|
"Katılmıyorum",
|
||||||
|
"Kararsızım",
|
||||||
|
"Katılıyorum",
|
||||||
|
"Tamamen Katılıyorum",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "q-011",
|
||||||
|
groupId: "group-004",
|
||||||
|
questionText: "Bu kişi yaratıcı ve inovatif çözümler üretir",
|
||||||
|
questionType: QuestionTypeEnum.Rating,
|
||||||
|
isRequired: true,
|
||||||
|
weight: 30,
|
||||||
|
order: 2,
|
||||||
|
minRating: 1,
|
||||||
|
maxRating: 5,
|
||||||
|
ratingLabels: [
|
||||||
|
"Hiç Katılmıyorum",
|
||||||
|
"Katılmıyorum",
|
||||||
|
"Kararsızım",
|
||||||
|
"Katılıyorum",
|
||||||
|
"Tamamen Katılıyorum",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
applicablePositions: [],
|
||||||
|
applicableDepartments: [],
|
||||||
|
creationTime: new Date("2024-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-15"),
|
||||||
|
},
|
||||||
|
];
|
||||||
131
ui/src/mocks/mockFaultNotifications.ts
Normal file
131
ui/src/mocks/mockFaultNotifications.ts
Normal file
|
|
@ -0,0 +1,131 @@
|
||||||
|
import { PriorityEnum } from "../types/common";
|
||||||
|
import {
|
||||||
|
CriticalityLevelEnum,
|
||||||
|
PmFaultNotification,
|
||||||
|
FaultTypeEnum,
|
||||||
|
NotificationStatusEnum,
|
||||||
|
} from "../types/pm";
|
||||||
|
import { mockWorkCenters } from "./mockWorkCenters";
|
||||||
|
|
||||||
|
export const mockFaultNotifications: PmFaultNotification[] = [
|
||||||
|
{
|
||||||
|
id: "FN001",
|
||||||
|
notificationCode: "ARZ-2024-001",
|
||||||
|
workCenterId: "1",
|
||||||
|
workCenter: mockWorkCenters.find((wc) => wc.id === "1")!,
|
||||||
|
location: "Atölye A - Hat 1",
|
||||||
|
faultType: FaultTypeEnum.Mechanical,
|
||||||
|
priority: PriorityEnum.High,
|
||||||
|
severity: CriticalityLevelEnum.High,
|
||||||
|
title: "Motor Aşırı Titreşim",
|
||||||
|
description:
|
||||||
|
"CNC torna tezgahında motor aşırı titreşim yapıyor. Ses seviyesi normalden yüksek ve hassas işlemlerde problem yaşanıyor.",
|
||||||
|
reportedBy: "Operator Mustafa Koç",
|
||||||
|
reportedAt: new Date("2024-02-08T09:30:00"),
|
||||||
|
assignedTo: "Mehmet Kaya - Mekanik Ekibi",
|
||||||
|
status: NotificationStatusEnum.InProgress,
|
||||||
|
images: ["fault_image_1.jpg", "fault_image_2.jpg"],
|
||||||
|
estimatedRepairTime: 180,
|
||||||
|
workOrderId: "WO-2024-045",
|
||||||
|
followUpRequired: true,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-02-08T09:30:00"),
|
||||||
|
lastModificationTime: new Date("2024-02-08T14:15:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "FN002",
|
||||||
|
notificationCode: "ARZ-2024-002",
|
||||||
|
workCenterId: "2",
|
||||||
|
workCenter: mockWorkCenters.find((wc) => wc.id === "2")!,
|
||||||
|
location: "Kompresör Odası",
|
||||||
|
faultType: FaultTypeEnum.Electrical,
|
||||||
|
priority: PriorityEnum.Urgent,
|
||||||
|
severity: CriticalityLevelEnum.Critical,
|
||||||
|
title: "Elektrik Panosu Arızası",
|
||||||
|
description:
|
||||||
|
"Kompresör elektrik panosunda kısa devre meydana geldi. Sistem tamamen durdu.",
|
||||||
|
reportedBy: "Vardiya Amiri Ali Demir",
|
||||||
|
reportedAt: new Date("2024-02-07T16:45:00"),
|
||||||
|
assignedTo: "Ahmet Yılmaz - Elektrik Ekibi",
|
||||||
|
status: NotificationStatusEnum.Resolved,
|
||||||
|
estimatedRepairTime: 240,
|
||||||
|
actualRepairTime: 195,
|
||||||
|
resolutionNotes:
|
||||||
|
"Yanık sigorta değiştirildi ve pano kontrolleri yapıldı. Sistem normal çalışıyor.",
|
||||||
|
closedBy: "Ahmet Yılmaz",
|
||||||
|
closedAt: new Date("2024-02-07T20:00:00"),
|
||||||
|
workOrderId: "WO-2024-044",
|
||||||
|
followUpRequired: false,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-02-07T16:45:00"),
|
||||||
|
lastModificationTime: new Date("2024-02-07T20:00:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "FN003",
|
||||||
|
notificationCode: "ARZ-2024-003",
|
||||||
|
workCenterId: "3",
|
||||||
|
workCenter: mockWorkCenters.find((wc) => wc.id === "3")!,
|
||||||
|
location: "Ana Üretim Hattı",
|
||||||
|
faultType: FaultTypeEnum.Mechanical,
|
||||||
|
priority: PriorityEnum.Normal,
|
||||||
|
severity: CriticalityLevelEnum.Medium,
|
||||||
|
title: "Kayış Gerilimi Azaldı",
|
||||||
|
description:
|
||||||
|
"Konveyör kayışında gevşeme tespit edildi. Hız düşüklüğü gözlemleniyor.",
|
||||||
|
reportedBy: "Hat Sorumlusu Fatma Özkan",
|
||||||
|
reportedAt: new Date("2024-02-06T11:20:00"),
|
||||||
|
status: NotificationStatusEnum.Open,
|
||||||
|
estimatedRepairTime: 60,
|
||||||
|
followUpRequired: false,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-02-06T11:20:00"),
|
||||||
|
lastModificationTime: new Date("2024-02-06T11:20:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "FN004",
|
||||||
|
notificationCode: "ARZ-2024-004",
|
||||||
|
workCenterId: "3",
|
||||||
|
workCenter: mockWorkCenters.find((wc) => wc.id === "3")!,
|
||||||
|
location: "Kaynak Atölyesi",
|
||||||
|
faultType: FaultTypeEnum.Software,
|
||||||
|
priority: PriorityEnum.High,
|
||||||
|
severity: CriticalityLevelEnum.High,
|
||||||
|
title: "Program Kalibrasyon Hatası",
|
||||||
|
description:
|
||||||
|
"Robot kaynak pozisyonlarında sapma var. Kalibrasyon gerekiyor.",
|
||||||
|
reportedBy: "Kaynak Operatörü Hasan Çelik",
|
||||||
|
reportedAt: new Date("2024-02-05T14:10:00"),
|
||||||
|
assignedTo: "Sema Korkmaz - Robot Teknisyeni",
|
||||||
|
status: NotificationStatusEnum.Assigned,
|
||||||
|
estimatedRepairTime: 120,
|
||||||
|
followUpRequired: true,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-02-05T14:10:00"),
|
||||||
|
lastModificationTime: new Date("2024-02-05T15:30:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "FN005",
|
||||||
|
notificationCode: "ARZ-2024-005",
|
||||||
|
workCenterId: "4",
|
||||||
|
workCenter: mockWorkCenters.find((wc) => wc.id === "4")!,
|
||||||
|
location: "Pres Atölyesi",
|
||||||
|
faultType: FaultTypeEnum.Hydraulic,
|
||||||
|
priority: PriorityEnum.Low,
|
||||||
|
severity: CriticalityLevelEnum.Low,
|
||||||
|
title: "Yağ Sızıntısı",
|
||||||
|
description:
|
||||||
|
"Hidrolik sistem borularında hafif yağ sızıntısı tespit edildi.",
|
||||||
|
reportedBy: "Temizlik Personeli Zeynep Aktaş",
|
||||||
|
reportedAt: new Date("2024-02-04T08:45:00"),
|
||||||
|
status: NotificationStatusEnum.Closed,
|
||||||
|
estimatedRepairTime: 45,
|
||||||
|
actualRepairTime: 30,
|
||||||
|
resolutionNotes: "Boru bağlantıları sıkılaştırıldı. Sızıntı durduruldu.",
|
||||||
|
closedBy: "Ali Demir",
|
||||||
|
closedAt: new Date("2024-02-04T10:15:00"),
|
||||||
|
followUpRequired: true,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-02-04T08:45:00"),
|
||||||
|
lastModificationTime: new Date("2024-02-04T10:15:00"),
|
||||||
|
},
|
||||||
|
];
|
||||||
112
ui/src/mocks/mockInventoryCounts.ts
Normal file
112
ui/src/mocks/mockInventoryCounts.ts
Normal file
|
|
@ -0,0 +1,112 @@
|
||||||
|
import {
|
||||||
|
CountStatusEnum,
|
||||||
|
CountTypeEnum,
|
||||||
|
WmInventoryCount,
|
||||||
|
WmInventoryCountItem,
|
||||||
|
} from "../types/wm";
|
||||||
|
import { mockLocations } from "./mockLocations";
|
||||||
|
import { mockMaterials } from "./mockMaterials";
|
||||||
|
import { mockWarehouses } from "./mockWarehouses";
|
||||||
|
import { mockZones } from "./mockZones";
|
||||||
|
|
||||||
|
export const mockInventoryCounts: WmInventoryCount[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
countNumber: "INV2024001",
|
||||||
|
warehouseId: "1",
|
||||||
|
warehouse: mockWarehouses.find((m) => m.id === "1"),
|
||||||
|
zoneId: "1",
|
||||||
|
zone: mockZones.find((m) => m.id === "1"),
|
||||||
|
locationId: "3",
|
||||||
|
location: mockLocations.find((m) => m.id === "3"),
|
||||||
|
countType: CountTypeEnum.Full,
|
||||||
|
status: CountStatusEnum.Completed,
|
||||||
|
scheduledDate: new Date("2024-11-01"),
|
||||||
|
startDate: new Date("2024-11-01"),
|
||||||
|
endDate: new Date("2024-11-03"),
|
||||||
|
countedBy: ["user1", "user2"],
|
||||||
|
approvedBy: "manager1",
|
||||||
|
items: [],
|
||||||
|
variances: [],
|
||||||
|
notes: "Aylık tam sayım",
|
||||||
|
creationTime: new Date("2024-10-25"),
|
||||||
|
lastModificationTime: new Date("2024-11-03"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
countNumber: "INV2024002",
|
||||||
|
warehouseId: "1",
|
||||||
|
warehouse: mockWarehouses.find((m) => m.id === "1"),
|
||||||
|
zoneId: "1",
|
||||||
|
zone: mockZones.find((m) => m.id === "1"),
|
||||||
|
locationId: "3",
|
||||||
|
location: mockLocations.find((m) => m.id === "3"),
|
||||||
|
countType: CountTypeEnum.Cycle,
|
||||||
|
status: CountStatusEnum.InProgress,
|
||||||
|
scheduledDate: new Date("2024-11-25"),
|
||||||
|
startDate: new Date("2024-11-25"),
|
||||||
|
endDate: undefined,
|
||||||
|
countedBy: ["user3"],
|
||||||
|
approvedBy: undefined,
|
||||||
|
items: [],
|
||||||
|
variances: [],
|
||||||
|
notes: "A grubu malzemeler döngüsel sayım",
|
||||||
|
creationTime: new Date("2024-11-20"),
|
||||||
|
lastModificationTime: new Date("2024-11-25"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
countNumber: "INV2024003",
|
||||||
|
warehouseId: "1",
|
||||||
|
warehouse: mockWarehouses.find((m) => m.id === "1"),
|
||||||
|
zoneId: "2",
|
||||||
|
zone: mockZones.find((m) => m.id === "2"),
|
||||||
|
locationId: "2",
|
||||||
|
location: mockLocations.find((m) => m.id === "2"),
|
||||||
|
countType: CountTypeEnum.Spot,
|
||||||
|
status: CountStatusEnum.Planned,
|
||||||
|
scheduledDate: new Date("2024-12-05"),
|
||||||
|
startDate: undefined,
|
||||||
|
endDate: undefined,
|
||||||
|
countedBy: [],
|
||||||
|
approvedBy: undefined,
|
||||||
|
items: [],
|
||||||
|
variances: [],
|
||||||
|
notes: "Şüpheli stoklar için nokta sayım",
|
||||||
|
creationTime: new Date("2024-11-30"),
|
||||||
|
lastModificationTime: new Date("2024-11-30"),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export const mockCountItems: WmInventoryCountItem[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
countId: "1",
|
||||||
|
materialId: "1",
|
||||||
|
material: mockMaterials.find((m) => m.id === "1"),
|
||||||
|
locationId: "1",
|
||||||
|
systemQuantity: 15,
|
||||||
|
countedQuantity: 14,
|
||||||
|
variance: -1,
|
||||||
|
variancePercentage: -6.67,
|
||||||
|
lotNumber: "LOT2024001",
|
||||||
|
countedBy: "user1",
|
||||||
|
countedAt: new Date("2024-11-01"),
|
||||||
|
notes: "Hasarlı 1 adet tespit edildi",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
countId: "1",
|
||||||
|
materialId: "2",
|
||||||
|
material: mockMaterials.find((m) => m.id === "2"),
|
||||||
|
locationId: "1",
|
||||||
|
systemQuantity: 8,
|
||||||
|
countedQuantity: 8,
|
||||||
|
variance: 0,
|
||||||
|
variancePercentage: 0,
|
||||||
|
lotNumber: "LOT2024002",
|
||||||
|
countedBy: "user2",
|
||||||
|
countedAt: new Date("2024-11-01"),
|
||||||
|
notes: "Sayım doğru",
|
||||||
|
},
|
||||||
|
];
|
||||||
55
ui/src/mocks/mockInvoices.ts
Normal file
55
ui/src/mocks/mockInvoices.ts
Normal file
|
|
@ -0,0 +1,55 @@
|
||||||
|
import {
|
||||||
|
FiInvoice,
|
||||||
|
InvoiceStatusEnum,
|
||||||
|
InvoiceTypeEnum,
|
||||||
|
PaymentStatusEnum,
|
||||||
|
} from "../types/fi";
|
||||||
|
import { mockCurrentAccounts } from "./mockCurrentAccounts";
|
||||||
|
|
||||||
|
export const mockInvoices: FiInvoice[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
invoiceNumber: "SAT-2024-001",
|
||||||
|
invoiceType: InvoiceTypeEnum.Sales,
|
||||||
|
currentAccountId: "1",
|
||||||
|
currentAccount: mockCurrentAccounts.find((acc) => acc.id === "1")!,
|
||||||
|
invoiceDate: new Date("2024-01-15"),
|
||||||
|
dueDate: new Date("2024-02-14"),
|
||||||
|
subtotal: 10000,
|
||||||
|
taxAmount: 1800,
|
||||||
|
discountAmount: 0,
|
||||||
|
totalAmount: 11800,
|
||||||
|
paidAmount: 5000,
|
||||||
|
remainingAmount: 6800,
|
||||||
|
currency: "TRY",
|
||||||
|
status: InvoiceStatusEnum.Sent,
|
||||||
|
paymentStatus: PaymentStatusEnum.PartiallyPaid,
|
||||||
|
items: [],
|
||||||
|
waybillNumber: "IRS-2024-001",
|
||||||
|
creationTime: new Date("2024-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-20"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
invoiceNumber: "AL-2024-001",
|
||||||
|
invoiceType: InvoiceTypeEnum.Purchase,
|
||||||
|
currentAccountId: "2",
|
||||||
|
currentAccount: mockCurrentAccounts.find((acc) => acc.id === "2")!,
|
||||||
|
invoiceDate: new Date("2024-01-10"),
|
||||||
|
dueDate: new Date("2024-02-09"),
|
||||||
|
subtotal: 15000,
|
||||||
|
taxAmount: 2700,
|
||||||
|
discountAmount: 0,
|
||||||
|
totalAmount: 17700,
|
||||||
|
paidAmount: 17700,
|
||||||
|
remainingAmount: 0,
|
||||||
|
currency: "TRY",
|
||||||
|
status: InvoiceStatusEnum.Approved,
|
||||||
|
paymentStatus: PaymentStatusEnum.Paid,
|
||||||
|
items: [],
|
||||||
|
waybillNumber: "IRS-2024-002",
|
||||||
|
waybillDate: new Date("2024-01-10"),
|
||||||
|
creationTime: new Date("2024-01-10"),
|
||||||
|
lastModificationTime: new Date("2024-01-15"),
|
||||||
|
},
|
||||||
|
];
|
||||||
310
ui/src/mocks/mockJobPositions.ts
Normal file
310
ui/src/mocks/mockJobPositions.ts
Normal file
|
|
@ -0,0 +1,310 @@
|
||||||
|
import { HrJobPosition, JobLevelEnum } from "../types/hr";
|
||||||
|
import { mockDepartments } from "./mockDepartments";
|
||||||
|
|
||||||
|
export const mockJobPositions: HrJobPosition[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
code: "DEV-001",
|
||||||
|
name: "Software Developer",
|
||||||
|
description: "Responsible for developing and maintaining web applications",
|
||||||
|
departmentId: "1",
|
||||||
|
department: mockDepartments.find((dept) => dept.id === "1"),
|
||||||
|
level: JobLevelEnum.Mid,
|
||||||
|
minSalary: 80000,
|
||||||
|
maxSalary: 120000,
|
||||||
|
currency: "USD",
|
||||||
|
requiredSkills: ["JavaScript", "TypeScript", "React", "Node.js"],
|
||||||
|
responsibilities: [
|
||||||
|
"Develop frontend and backend applications",
|
||||||
|
"Write clean and maintainable code",
|
||||||
|
"Participate in code reviews",
|
||||||
|
"Collaborate with team members",
|
||||||
|
],
|
||||||
|
qualifications: [
|
||||||
|
"Bachelor's degree in Computer Science or related field",
|
||||||
|
"3+ years of experience in web development",
|
||||||
|
"Strong knowledge of JavaScript and TypeScript",
|
||||||
|
],
|
||||||
|
isActive: true,
|
||||||
|
employees: [],
|
||||||
|
creationTime: new Date("2024-01-15T08:00:00Z"),
|
||||||
|
lastModificationTime: new Date("2024-01-15T08:00:00Z"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
code: "MGR-001",
|
||||||
|
name: "Project Manager",
|
||||||
|
description: "Lead and manage software development projects",
|
||||||
|
departmentId: "1",
|
||||||
|
department: mockDepartments.find((dept) => dept.id === "1"),
|
||||||
|
level: JobLevelEnum.Manager,
|
||||||
|
minSalary: 100000,
|
||||||
|
maxSalary: 150000,
|
||||||
|
currency: "USD",
|
||||||
|
requiredSkills: ["Project Management", "Agile", "Scrum", "Leadership"],
|
||||||
|
responsibilities: [
|
||||||
|
"Plan and execute project timelines",
|
||||||
|
"Coordinate with cross-functional teams",
|
||||||
|
"Manage project budgets and resources",
|
||||||
|
"Ensure project delivery within scope and timeline",
|
||||||
|
],
|
||||||
|
qualifications: [
|
||||||
|
"Bachelor's degree in Business or related field",
|
||||||
|
"5+ years of project management experience",
|
||||||
|
"PMP certification preferred",
|
||||||
|
],
|
||||||
|
isActive: true,
|
||||||
|
employees: [],
|
||||||
|
creationTime: new Date("2024-01-16T08:00:00Z"),
|
||||||
|
lastModificationTime: new Date("2024-01-16T08:00:00Z"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
code: "QA-001",
|
||||||
|
name: "Quality Assurance Engineer",
|
||||||
|
description: "Ensure software quality through testing and automation",
|
||||||
|
departmentId: "1",
|
||||||
|
department: mockDepartments.find((dept) => dept.id === "1"),
|
||||||
|
level: JobLevelEnum.Mid,
|
||||||
|
minSalary: 70000,
|
||||||
|
maxSalary: 100000,
|
||||||
|
currency: "USD",
|
||||||
|
requiredSkills: ["Testing", "Automation", "Selenium", "API Testing"],
|
||||||
|
responsibilities: [
|
||||||
|
"Design and execute test cases",
|
||||||
|
"Automate testing processes",
|
||||||
|
"Report and track bugs",
|
||||||
|
"Collaborate with development team",
|
||||||
|
],
|
||||||
|
qualifications: [
|
||||||
|
"Bachelor's degree in Computer Science or related field",
|
||||||
|
"3+ years of QA experience",
|
||||||
|
"Experience with automation tools",
|
||||||
|
],
|
||||||
|
isActive: true,
|
||||||
|
employees: [],
|
||||||
|
creationTime: new Date("2024-01-17T08:00:00Z"),
|
||||||
|
lastModificationTime: new Date("2024-01-17T08:00:00Z"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
code: "UX-001",
|
||||||
|
name: "UX/UI Designer",
|
||||||
|
description: "Design user interfaces and improve user experience",
|
||||||
|
departmentId: "2",
|
||||||
|
department: mockDepartments.find((dept) => dept.id === "2"),
|
||||||
|
level: JobLevelEnum.Mid,
|
||||||
|
minSalary: 75000,
|
||||||
|
maxSalary: 110000,
|
||||||
|
currency: "USD",
|
||||||
|
requiredSkills: [
|
||||||
|
"Figma",
|
||||||
|
"Adobe Creative Suite",
|
||||||
|
"User Research",
|
||||||
|
"Prototyping",
|
||||||
|
],
|
||||||
|
responsibilities: [
|
||||||
|
"Create wireframes and prototypes",
|
||||||
|
"Conduct user research",
|
||||||
|
"Design intuitive user interfaces",
|
||||||
|
"Collaborate with development team",
|
||||||
|
],
|
||||||
|
qualifications: [
|
||||||
|
"Bachelor's degree in Design or related field",
|
||||||
|
"3+ years of UX/UI design experience",
|
||||||
|
"Strong portfolio demonstrating design skills",
|
||||||
|
],
|
||||||
|
isActive: true,
|
||||||
|
employees: [],
|
||||||
|
creationTime: new Date("2024-01-18T08:00:00Z"),
|
||||||
|
lastModificationTime: new Date("2024-01-18T08:00:00Z"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "5",
|
||||||
|
code: "DA-001",
|
||||||
|
name: "Data Analyst",
|
||||||
|
description: "Analyze business data and provide insights",
|
||||||
|
departmentId: "1",
|
||||||
|
department: mockDepartments.find((dept) => dept.id === "1"),
|
||||||
|
level: JobLevelEnum.Mid,
|
||||||
|
minSalary: 85000,
|
||||||
|
maxSalary: 125000,
|
||||||
|
currency: "USD",
|
||||||
|
requiredSkills: ["SQL", "Python", "Excel", "Tableau", "Statistics"],
|
||||||
|
responsibilities: [
|
||||||
|
"Analyze large datasets",
|
||||||
|
"Create reports and dashboards",
|
||||||
|
"Identify trends and patterns",
|
||||||
|
"Present findings to stakeholders",
|
||||||
|
],
|
||||||
|
qualifications: [
|
||||||
|
"Bachelor's degree in Statistics, Mathematics, or related field",
|
||||||
|
"3+ years of data analysis experience",
|
||||||
|
"Strong analytical and problem-solving skills",
|
||||||
|
],
|
||||||
|
isActive: true,
|
||||||
|
employees: [],
|
||||||
|
creationTime: new Date("2024-01-19T08:00:00Z"),
|
||||||
|
lastModificationTime: new Date("2024-01-19T08:00:00Z"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "6",
|
||||||
|
code: "HR-001",
|
||||||
|
name: "HR Specialist",
|
||||||
|
description: "Support human resources operations and employee relations",
|
||||||
|
departmentId: "4",
|
||||||
|
department: mockDepartments.find((dept) => dept.id === "4"),
|
||||||
|
level: JobLevelEnum.Mid,
|
||||||
|
minSalary: 60000,
|
||||||
|
maxSalary: 85000,
|
||||||
|
currency: "USD",
|
||||||
|
requiredSkills: [
|
||||||
|
"HR Management",
|
||||||
|
"Recruitment",
|
||||||
|
"Employee Relations",
|
||||||
|
"HRIS",
|
||||||
|
],
|
||||||
|
responsibilities: [
|
||||||
|
"Manage recruitment processes",
|
||||||
|
"Handle employee relations issues",
|
||||||
|
"Maintain HR records and policies",
|
||||||
|
"Support employee onboarding",
|
||||||
|
],
|
||||||
|
qualifications: [
|
||||||
|
"Bachelor's degree in Human Resources or related field",
|
||||||
|
"2+ years of HR experience",
|
||||||
|
"Knowledge of employment laws and regulations",
|
||||||
|
],
|
||||||
|
isActive: true,
|
||||||
|
employees: [],
|
||||||
|
creationTime: new Date("2024-01-20T08:00:00Z"),
|
||||||
|
lastModificationTime: new Date("2024-01-20T08:00:00Z"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "7",
|
||||||
|
code: "SA-001",
|
||||||
|
name: "Sales Associate",
|
||||||
|
description: "Generate sales leads and maintain customer relationships",
|
||||||
|
departmentId: "2",
|
||||||
|
department: mockDepartments.find((dept) => dept.id === "2"),
|
||||||
|
level: JobLevelEnum.Junior,
|
||||||
|
minSalary: 45000,
|
||||||
|
maxSalary: 70000,
|
||||||
|
currency: "USD",
|
||||||
|
requiredSkills: ["Sales", "CRM", "Communication", "Customer Service"],
|
||||||
|
responsibilities: [
|
||||||
|
"Identify and pursue sales opportunities",
|
||||||
|
"Maintain customer relationships",
|
||||||
|
"Prepare sales proposals",
|
||||||
|
"Meet monthly sales targets",
|
||||||
|
],
|
||||||
|
qualifications: [
|
||||||
|
"Bachelor's degree in Business or related field",
|
||||||
|
"1+ years of sales experience",
|
||||||
|
"Excellent communication skills",
|
||||||
|
],
|
||||||
|
isActive: true,
|
||||||
|
employees: [],
|
||||||
|
creationTime: new Date("2024-01-21T08:00:00Z"),
|
||||||
|
lastModificationTime: new Date("2024-01-21T08:00:00Z"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "8",
|
||||||
|
code: "ACC-001",
|
||||||
|
name: "Accountant",
|
||||||
|
description: "Manage financial records and ensure compliance",
|
||||||
|
departmentId: "3",
|
||||||
|
department: mockDepartments.find((dept) => dept.id === "3"),
|
||||||
|
level: JobLevelEnum.Mid,
|
||||||
|
minSalary: 55000,
|
||||||
|
maxSalary: 80000,
|
||||||
|
currency: "USD",
|
||||||
|
requiredSkills: [
|
||||||
|
"Accounting",
|
||||||
|
"Excel",
|
||||||
|
"Financial Analysis",
|
||||||
|
"Tax Preparation",
|
||||||
|
],
|
||||||
|
responsibilities: [
|
||||||
|
"Maintain financial records",
|
||||||
|
"Prepare financial statements",
|
||||||
|
"Ensure regulatory compliance",
|
||||||
|
"Assist with budget planning",
|
||||||
|
],
|
||||||
|
qualifications: [
|
||||||
|
"Bachelor's degree in Accounting or Finance",
|
||||||
|
"CPA certification preferred",
|
||||||
|
"3+ years of accounting experience",
|
||||||
|
],
|
||||||
|
isActive: true,
|
||||||
|
employees: [],
|
||||||
|
creationTime: new Date("2024-01-22T08:00:00Z"),
|
||||||
|
lastModificationTime: new Date("2024-01-22T08:00:00Z"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "9",
|
||||||
|
code: "CS-001",
|
||||||
|
name: "Customer Support Representative",
|
||||||
|
description: "Provide excellent customer service and technical support",
|
||||||
|
departmentId: "2",
|
||||||
|
department: mockDepartments.find((dept) => dept.id === "2"),
|
||||||
|
level: JobLevelEnum.Entry,
|
||||||
|
minSalary: 35000,
|
||||||
|
maxSalary: 50000,
|
||||||
|
currency: "USD",
|
||||||
|
requiredSkills: [
|
||||||
|
"Customer Service",
|
||||||
|
"Communication",
|
||||||
|
"Problem Solving",
|
||||||
|
"CRM",
|
||||||
|
],
|
||||||
|
responsibilities: [
|
||||||
|
"Respond to customer inquiries",
|
||||||
|
"Resolve technical issues",
|
||||||
|
"Document customer interactions",
|
||||||
|
"Escalate complex issues when needed",
|
||||||
|
],
|
||||||
|
qualifications: [
|
||||||
|
"High school diploma or equivalent",
|
||||||
|
"1+ years of customer service experience",
|
||||||
|
"Strong communication skills",
|
||||||
|
],
|
||||||
|
isActive: true,
|
||||||
|
employees: [],
|
||||||
|
creationTime: new Date("2024-01-23T08:00:00Z"),
|
||||||
|
lastModificationTime: new Date("2024-01-23T08:00:00Z"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "10",
|
||||||
|
code: "IT-001",
|
||||||
|
name: "IT Support Specialist",
|
||||||
|
description: "Provide technical support and maintain IT infrastructure",
|
||||||
|
departmentId: "1",
|
||||||
|
department: mockDepartments.find((dept) => dept.id === "1"),
|
||||||
|
level: JobLevelEnum.Junior,
|
||||||
|
minSalary: 50000,
|
||||||
|
maxSalary: 75000,
|
||||||
|
currency: "USD",
|
||||||
|
requiredSkills: [
|
||||||
|
"Windows",
|
||||||
|
"Network Administration",
|
||||||
|
"Hardware",
|
||||||
|
"Troubleshooting",
|
||||||
|
],
|
||||||
|
responsibilities: [
|
||||||
|
"Provide technical support to employees",
|
||||||
|
"Maintain computer systems and networks",
|
||||||
|
"Install and configure software",
|
||||||
|
"Document IT procedures",
|
||||||
|
],
|
||||||
|
qualifications: [
|
||||||
|
"Associate degree in Information Technology or related field",
|
||||||
|
"2+ years of IT support experience",
|
||||||
|
"CompTIA A+ certification preferred",
|
||||||
|
],
|
||||||
|
isActive: true,
|
||||||
|
employees: [],
|
||||||
|
creationTime: new Date("2024-01-24T08:00:00Z"),
|
||||||
|
lastModificationTime: new Date("2024-01-24T08:00:00Z"),
|
||||||
|
},
|
||||||
|
];
|
||||||
110
ui/src/mocks/mockLocations.ts
Normal file
110
ui/src/mocks/mockLocations.ts
Normal file
|
|
@ -0,0 +1,110 @@
|
||||||
|
import { LocationTypeEnum } from "../types/wm";
|
||||||
|
import { WmLocation } from "../types/wm";
|
||||||
|
|
||||||
|
export const mockLocations: WmLocation[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
warehouseId: "1",
|
||||||
|
zoneId: "2",
|
||||||
|
locationCode: "A01-01-01",
|
||||||
|
name: "A Blok 1. Koridor 1. Raf",
|
||||||
|
description: "Yüksek raf - Ağır malzemeler",
|
||||||
|
locationType: LocationTypeEnum.Rack,
|
||||||
|
capacity: 100,
|
||||||
|
currentStock: 75,
|
||||||
|
dimensions: {
|
||||||
|
length: 2.5,
|
||||||
|
width: 1.2,
|
||||||
|
height: 3.0,
|
||||||
|
weight: 1000,
|
||||||
|
unit: "kg",
|
||||||
|
},
|
||||||
|
restrictions: ["Ağır malzemeler", "Palet kullanımı zorunlu"],
|
||||||
|
stockItems: [],
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
warehouseId: "1",
|
||||||
|
zoneId: "2",
|
||||||
|
locationCode: "A01-01-02",
|
||||||
|
name: "A Blok 1. Koridor 2. Raf",
|
||||||
|
description: "Orta raf - Orta ağırlık malzemeler",
|
||||||
|
locationType: LocationTypeEnum.Shelf,
|
||||||
|
capacity: 50,
|
||||||
|
currentStock: 30,
|
||||||
|
dimensions: {
|
||||||
|
length: 2.0,
|
||||||
|
width: 0.8,
|
||||||
|
height: 2.0,
|
||||||
|
weight: 500,
|
||||||
|
unit: "kg",
|
||||||
|
},
|
||||||
|
restrictions: ["Orta ağırlık malzemeler"],
|
||||||
|
stockItems: [],
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
warehouseId: "1",
|
||||||
|
zoneId: "1",
|
||||||
|
locationCode: "B02-02-01",
|
||||||
|
name: "B Blok 2. Koridor 1. Raf",
|
||||||
|
description: "Küçük parçalar rafı",
|
||||||
|
locationType: LocationTypeEnum.Bin,
|
||||||
|
capacity: 200,
|
||||||
|
currentStock: 180,
|
||||||
|
dimensions: {
|
||||||
|
length: 1.5,
|
||||||
|
width: 0.6,
|
||||||
|
height: 1.5,
|
||||||
|
weight: 200,
|
||||||
|
unit: "kg",
|
||||||
|
},
|
||||||
|
restrictions: ["Küçük parçalar"],
|
||||||
|
stockItems: [],
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
warehouseId: "2",
|
||||||
|
zoneId: "1",
|
||||||
|
locationCode: "B02-02-01",
|
||||||
|
name: "B Blok 2. Koridor 1. Raf",
|
||||||
|
description: "Küçük parçalar rafı",
|
||||||
|
locationType: LocationTypeEnum.Bin,
|
||||||
|
capacity: 200,
|
||||||
|
currentStock: 180,
|
||||||
|
dimensions: {
|
||||||
|
length: 1.5,
|
||||||
|
width: 0.6,
|
||||||
|
height: 1.5,
|
||||||
|
weight: 200,
|
||||||
|
unit: "kg",
|
||||||
|
},
|
||||||
|
restrictions: ["Küçük parçalar"],
|
||||||
|
stockItems: [],
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
warehouseId: "2",
|
||||||
|
zoneId: "3",
|
||||||
|
locationCode: "C01-02-01",
|
||||||
|
name: "C Blok 2. Koridor 1. Raf",
|
||||||
|
description: "Büyük parçalar rafı",
|
||||||
|
locationType: LocationTypeEnum.Bin,
|
||||||
|
capacity: 200,
|
||||||
|
currentStock: 180,
|
||||||
|
dimensions: {
|
||||||
|
length: 1.5,
|
||||||
|
width: 0.6,
|
||||||
|
height: 1.5,
|
||||||
|
weight: 200,
|
||||||
|
unit: "kg",
|
||||||
|
},
|
||||||
|
restrictions: ["Küçük parçalar"],
|
||||||
|
stockItems: [],
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
52
ui/src/mocks/mockLossReasons.ts
Normal file
52
ui/src/mocks/mockLossReasons.ts
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
import { CrmLostReason, LostReasonCategoryEnum } from "../types/crm";
|
||||||
|
|
||||||
|
export const mockLossReasons: CrmLostReason[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
code: "LR001",
|
||||||
|
name: "Fiyat Rekabetsizliği",
|
||||||
|
description: "Müşteri daha uygun fiyatlı alternatif buldu",
|
||||||
|
category: LostReasonCategoryEnum.Price,
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
code: "LR002",
|
||||||
|
name: "Ürün Özellik Eksikliği",
|
||||||
|
description: "Ürünümüzde müşterinin istediği özellik bulunmuyor",
|
||||||
|
category: LostReasonCategoryEnum.Product,
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
code: "LR003",
|
||||||
|
name: "Destek Kalitesi",
|
||||||
|
description: "Müşteri destek kalitemizden memnun değil",
|
||||||
|
category: LostReasonCategoryEnum.Service,
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
code: "LR004",
|
||||||
|
name: "Rakip Avantajı",
|
||||||
|
description: "Rakip daha iyi şartlar sundu",
|
||||||
|
category: LostReasonCategoryEnum.Competitor,
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "5",
|
||||||
|
code: "LR005",
|
||||||
|
name: "Yanlış Zamanlama",
|
||||||
|
description: "Müşteri zamanlaması uygun değil",
|
||||||
|
category: LostReasonCategoryEnum.Timing,
|
||||||
|
isActive: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "6",
|
||||||
|
code: "LR006",
|
||||||
|
name: "Bütçe Kısıtlaması",
|
||||||
|
description: "Müşteri bütçesi yetersiz",
|
||||||
|
category: LostReasonCategoryEnum.Budget,
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
42
ui/src/mocks/mockLotNumbers.ts
Normal file
42
ui/src/mocks/mockLotNumbers.ts
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
import { MmLotNumber, QualityStatusEnum } from "../types/mm";
|
||||||
|
import { mockMaterials } from "./mockMaterials";
|
||||||
|
|
||||||
|
export const mockLotNumbers: MmLotNumber[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
materialId: "1",
|
||||||
|
material: mockMaterials.find((m) => m.id === "1"),
|
||||||
|
lotNumber: "LOT-2024-001",
|
||||||
|
productionDate: new Date("2024-01-01"),
|
||||||
|
expiryDate: new Date("2024-12-31"),
|
||||||
|
quantity: 100,
|
||||||
|
unitId: "KG",
|
||||||
|
supplierId: "SUP-001",
|
||||||
|
qualityStatus: QualityStatusEnum.Approved,
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
materialId: "2",
|
||||||
|
material: mockMaterials.find((m) => m.id === "2"),
|
||||||
|
lotNumber: "LOT-2024-002",
|
||||||
|
productionDate: new Date("2024-01-15"),
|
||||||
|
expiryDate: new Date("2025-01-14"),
|
||||||
|
quantity: 75,
|
||||||
|
unitId: "KG",
|
||||||
|
supplierId: "SUP-002",
|
||||||
|
qualityStatus: QualityStatusEnum.Pending,
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
materialId: "3",
|
||||||
|
material: mockMaterials.find((m) => m.id === "3"),
|
||||||
|
lotNumber: "LOT-2024-003",
|
||||||
|
productionDate: new Date("2024-01-10"),
|
||||||
|
quantity: 50,
|
||||||
|
unitId: "ADET",
|
||||||
|
qualityStatus: QualityStatusEnum.Quarantine,
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
168
ui/src/mocks/mockMRP.ts
Normal file
168
ui/src/mocks/mockMRP.ts
Normal file
|
|
@ -0,0 +1,168 @@
|
||||||
|
import { PriorityEnum } from "../types/common";
|
||||||
|
import { mockMaterials } from "./../mocks/mockMaterials";
|
||||||
|
import {
|
||||||
|
MrpMaterialRequirement,
|
||||||
|
MrpProductionSuggestion,
|
||||||
|
MrpPurchaseSuggestion,
|
||||||
|
RecommendationStatusEnum,
|
||||||
|
RecommendationTypeEnum,
|
||||||
|
RequirementSourceTypeEnum,
|
||||||
|
} from "./../types/mrp";
|
||||||
|
|
||||||
|
export const mockMaterialRequirements: MrpMaterialRequirement[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
mrpRunId: "mrp-run-123",
|
||||||
|
materialId: mockMaterials[0].id,
|
||||||
|
material: mockMaterials[0],
|
||||||
|
sourceType: RequirementSourceTypeEnum.SalesOrder,
|
||||||
|
sourceDocumentId: "SO-2024-001",
|
||||||
|
grossRequirement: 150,
|
||||||
|
projectedAvailable: 50,
|
||||||
|
scheduledReceipts: 20,
|
||||||
|
netRequirement: 80,
|
||||||
|
plannedOrderReceipt: 80,
|
||||||
|
plannedOrderRelease: 80,
|
||||||
|
requirementDate: new Date("2024-08-15"),
|
||||||
|
plannedReceiptDate: new Date("2024-08-10"),
|
||||||
|
plannedReleaseDate: new Date("2024-08-01"),
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
mrpRunId: "mrp-run-123",
|
||||||
|
materialId: mockMaterials[2].id,
|
||||||
|
material: mockMaterials[2],
|
||||||
|
sourceType: RequirementSourceTypeEnum.Forecast,
|
||||||
|
sourceDocumentId: "F-2024-Q3",
|
||||||
|
grossRequirement: 500,
|
||||||
|
projectedAvailable: 200,
|
||||||
|
scheduledReceipts: 100,
|
||||||
|
netRequirement: 200,
|
||||||
|
plannedOrderReceipt: 200,
|
||||||
|
plannedOrderRelease: 200,
|
||||||
|
requirementDate: new Date("2024-09-01"),
|
||||||
|
plannedReceiptDate: new Date("2024-08-25"),
|
||||||
|
plannedReleaseDate: new Date("2024-08-10"),
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
mrpRunId: "mrp-run-123",
|
||||||
|
materialId: mockMaterials[4].id,
|
||||||
|
material: mockMaterials[4],
|
||||||
|
sourceType: RequirementSourceTypeEnum.SafetyStock,
|
||||||
|
sourceDocumentId: "SS-RULE-1",
|
||||||
|
grossRequirement: 100,
|
||||||
|
projectedAvailable: 30,
|
||||||
|
scheduledReceipts: 0,
|
||||||
|
netRequirement: 70,
|
||||||
|
plannedOrderReceipt: 70,
|
||||||
|
plannedOrderRelease: 70,
|
||||||
|
requirementDate: new Date("2024-07-30"),
|
||||||
|
plannedReceiptDate: new Date("2024-07-25"),
|
||||||
|
plannedReleaseDate: new Date("2024-07-15"),
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export const mockPurchaseSuggestions: MrpPurchaseSuggestion[] = [
|
||||||
|
{
|
||||||
|
id: "rec-pur-1",
|
||||||
|
mrpRunId: "mrp-run-123",
|
||||||
|
materialId: mockMaterials[2].id,
|
||||||
|
material: mockMaterials[2],
|
||||||
|
recommendationType: RecommendationTypeEnum.PurchaseRequisition,
|
||||||
|
recommendedAction: "200 adet satın al",
|
||||||
|
reason: "Tahmin bazlı ihtiyaç",
|
||||||
|
quantity: 200,
|
||||||
|
dueDate: new Date("2024-08-25"),
|
||||||
|
priority: PriorityEnum.Normal,
|
||||||
|
status: RecommendationStatusEnum.Open,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
supplierId: "1",
|
||||||
|
supplier: mockMaterials
|
||||||
|
.find((m) => m.id === mockMaterials[2].id)
|
||||||
|
?.suppliers?.find((s) => s.id === "1"),
|
||||||
|
estimatedCost:
|
||||||
|
200 *
|
||||||
|
(mockMaterials
|
||||||
|
.find((m) => m.id === mockMaterials[2].id)
|
||||||
|
?.suppliers?.find((s) => s.id === "1")?.price || 12.5),
|
||||||
|
leadTime:
|
||||||
|
mockMaterials
|
||||||
|
.find((m) => m.id === mockMaterials[2].id)
|
||||||
|
?.suppliers?.find((s) => s.id === "1")?.leadTime || 15,
|
||||||
|
minimumOrderQuantity: 0,
|
||||||
|
suggestedQuantity: 0,
|
||||||
|
economicOrderQuantity: 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "rec-pur-2",
|
||||||
|
mrpRunId: "mrp-run-123",
|
||||||
|
materialId: mockMaterials[4].id,
|
||||||
|
material: mockMaterials[4],
|
||||||
|
recommendationType: RecommendationTypeEnum.PurchaseRequisition,
|
||||||
|
recommendedAction: "70 adet satın al",
|
||||||
|
reason: "Güvenlik stoku altına düştü",
|
||||||
|
quantity: 70,
|
||||||
|
dueDate: new Date("2024-07-25"),
|
||||||
|
priority: PriorityEnum.High,
|
||||||
|
status: RecommendationStatusEnum.Open,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
supplier: mockMaterials
|
||||||
|
.find((m) => m.id === mockMaterials[1].id)
|
||||||
|
?.suppliers?.find((s) => s.id === "1"),
|
||||||
|
estimatedCost:
|
||||||
|
200 *
|
||||||
|
(mockMaterials
|
||||||
|
.find((m) => m.id === mockMaterials[2].id)
|
||||||
|
?.suppliers?.find((s) => s.id === "1")?.price || 5.5),
|
||||||
|
leadTime:
|
||||||
|
mockMaterials
|
||||||
|
.find((m) => m.id === mockMaterials[2].id)
|
||||||
|
?.suppliers?.find((s) => s.id === "1")?.leadTime || 10,
|
||||||
|
minimumOrderQuantity: 20,
|
||||||
|
suggestedQuantity: 70,
|
||||||
|
economicOrderQuantity: 100,
|
||||||
|
supplierId: "",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export const mockProductionSuggestions: MrpProductionSuggestion[] = [
|
||||||
|
{
|
||||||
|
id: "rec-prod-1",
|
||||||
|
mrpRunId: "mrp-run-123",
|
||||||
|
materialId: mockMaterials[0].id,
|
||||||
|
material: mockMaterials[0],
|
||||||
|
recommendationType: RecommendationTypeEnum.PlannedOrder,
|
||||||
|
recommendedAction: "80 adet üret",
|
||||||
|
reason: "Satış siparişi ihtiyacı",
|
||||||
|
quantity: 80,
|
||||||
|
dueDate: new Date("2024-08-10"),
|
||||||
|
priority: PriorityEnum.Urgent,
|
||||||
|
status: RecommendationStatusEnum.Open,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
estimatedDuration: 40, // hours
|
||||||
|
resourceRequirements: [
|
||||||
|
{ workCenter: "MONTAJ-01", capacity: 40, efficiency: 95 },
|
||||||
|
],
|
||||||
|
bom: {
|
||||||
|
id: "bom-1",
|
||||||
|
version: "1.2",
|
||||||
|
materialCount: 5,
|
||||||
|
totalCost: 1500,
|
||||||
|
},
|
||||||
|
productionCost: 80 * 25.5,
|
||||||
|
setupTime: 2,
|
||||||
|
cycleTime: 0.5,
|
||||||
|
suggestedStartDate: "2024-08-01",
|
||||||
|
suggestedCompletionDate: "2024-08-05",
|
||||||
|
},
|
||||||
|
];
|
||||||
86
ui/src/mocks/mockMaintenanceCalendarEvent.ts
Normal file
86
ui/src/mocks/mockMaintenanceCalendarEvent.ts
Normal file
|
|
@ -0,0 +1,86 @@
|
||||||
|
import { PriorityEnum } from "../types/common";
|
||||||
|
import {
|
||||||
|
PmCalendarEvent as MaintenanceCalendarEvent,
|
||||||
|
WorkOrderStatusEnum,
|
||||||
|
} from "../types/pm";
|
||||||
|
|
||||||
|
export const mockCalendarEvents: MaintenanceCalendarEvent[] = [
|
||||||
|
{
|
||||||
|
id: "E001",
|
||||||
|
title: "CNC Torna Rutin Bakım",
|
||||||
|
type: "plan",
|
||||||
|
date: new Date("2024-02-12"),
|
||||||
|
startTime: "09:00",
|
||||||
|
endTime: "11:00",
|
||||||
|
status: "scheduled",
|
||||||
|
priority: PriorityEnum.High,
|
||||||
|
assignedTo: "Mehmet Kaya",
|
||||||
|
workCenterCode: "CNC-001",
|
||||||
|
duration: 120,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "E002",
|
||||||
|
title: "Kompresör Aylık Bakım",
|
||||||
|
type: "plan",
|
||||||
|
date: new Date("2024-02-15"),
|
||||||
|
startTime: "08:00",
|
||||||
|
endTime: "12:00",
|
||||||
|
status: "scheduled",
|
||||||
|
priority: PriorityEnum.Urgent,
|
||||||
|
assignedTo: "Ali Demir",
|
||||||
|
workCenterCode: "COMP-001",
|
||||||
|
duration: 240,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "E003",
|
||||||
|
title: "Konveyör Arıza Onarım",
|
||||||
|
type: "workorder",
|
||||||
|
date: new Date("2024-02-10"),
|
||||||
|
startTime: "14:00",
|
||||||
|
endTime: "17:00",
|
||||||
|
status: WorkOrderStatusEnum.InProgress,
|
||||||
|
priority: PriorityEnum.High,
|
||||||
|
assignedTo: "Ahmet Yılmaz",
|
||||||
|
workCenterCode: "CONV-001",
|
||||||
|
duration: 180,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "E004",
|
||||||
|
title: "Robot Kaynak Kalibrasyon",
|
||||||
|
type: "workorder",
|
||||||
|
date: new Date("2024-02-08"),
|
||||||
|
startTime: "10:00",
|
||||||
|
endTime: "18:00",
|
||||||
|
status: WorkOrderStatusEnum.Completed,
|
||||||
|
priority: PriorityEnum.Normal,
|
||||||
|
assignedTo: "Fatma Özkan",
|
||||||
|
workCenterCode: "WELD-001",
|
||||||
|
duration: 480,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "E005",
|
||||||
|
title: "Hidrolik Sistem Kontrol",
|
||||||
|
type: "plan",
|
||||||
|
date: new Date("2024-02-14"),
|
||||||
|
startTime: "13:00",
|
||||||
|
endTime: "15:00",
|
||||||
|
status: "scheduled",
|
||||||
|
priority: PriorityEnum.Normal,
|
||||||
|
assignedTo: "Sema Korkmaz",
|
||||||
|
workCenterCode: "HYD-001",
|
||||||
|
duration: 120,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "E006",
|
||||||
|
title: "Elektrik Panosu Bakım",
|
||||||
|
type: "plan",
|
||||||
|
date: new Date("2024-02-16"),
|
||||||
|
startTime: "16:00",
|
||||||
|
endTime: "18:00",
|
||||||
|
status: "scheduled",
|
||||||
|
priority: PriorityEnum.Low,
|
||||||
|
assignedTo: "Hasan Çelik",
|
||||||
|
workCenterCode: "ELEC-001",
|
||||||
|
duration: 120,
|
||||||
|
},
|
||||||
|
];
|
||||||
80
ui/src/mocks/mockMaintenancePlans.ts
Normal file
80
ui/src/mocks/mockMaintenancePlans.ts
Normal file
|
|
@ -0,0 +1,80 @@
|
||||||
|
import { PriorityEnum } from "../types/common";
|
||||||
|
import {
|
||||||
|
FrequencyUnitEnum,
|
||||||
|
PmMaintenancePlan,
|
||||||
|
MaintenancePlanTypeEnum,
|
||||||
|
} from "../types/pm";
|
||||||
|
|
||||||
|
export const mockMaintenancePlans: PmMaintenancePlan[] = [
|
||||||
|
{
|
||||||
|
id: "MP001",
|
||||||
|
planCode: "PM-CNC-001",
|
||||||
|
workCenterId: "EQP001",
|
||||||
|
planType: MaintenancePlanTypeEnum.Preventive,
|
||||||
|
description: "CNC torna tezgahı için haftalık rutin bakım planı",
|
||||||
|
frequency: 1,
|
||||||
|
frequencyUnit: FrequencyUnitEnum.Weeks,
|
||||||
|
estimatedDuration: 120,
|
||||||
|
priority: PriorityEnum.High,
|
||||||
|
requiredMaterials: [],
|
||||||
|
requiredSkills: ["Torna Operatörü", "Mekanik"],
|
||||||
|
lastExecuted: new Date("2024-02-05"),
|
||||||
|
nextDue: new Date("2024-02-12"),
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-02-01"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "MP002",
|
||||||
|
planCode: "PM-COMP-001",
|
||||||
|
workCenterId: "EQP002",
|
||||||
|
planType: MaintenancePlanTypeEnum.Preventive,
|
||||||
|
description: "Hava kompresörü aylık bakım ve kontrol planı",
|
||||||
|
frequency: 1,
|
||||||
|
frequencyUnit: FrequencyUnitEnum.Months,
|
||||||
|
estimatedDuration: 240,
|
||||||
|
priority: PriorityEnum.Urgent,
|
||||||
|
requiredMaterials: [],
|
||||||
|
requiredSkills: ["Kompresör Teknisyeni", "Elektrikçi"],
|
||||||
|
lastExecuted: new Date("2024-01-15"),
|
||||||
|
nextDue: new Date("2024-02-15"),
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-01-10"),
|
||||||
|
lastModificationTime: new Date("2024-01-25"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "MP003",
|
||||||
|
planCode: "CM-CONV-001",
|
||||||
|
workCenterId: "EQP003",
|
||||||
|
planType: MaintenancePlanTypeEnum.Corrective,
|
||||||
|
description: "Konveyör sistemi arıza durumunda müdahale planı",
|
||||||
|
frequency: 0,
|
||||||
|
frequencyUnit: FrequencyUnitEnum.Days,
|
||||||
|
estimatedDuration: 180,
|
||||||
|
priority: PriorityEnum.High,
|
||||||
|
requiredMaterials: [],
|
||||||
|
requiredSkills: ["Mekanik", "Elektrikçi", "PLC Teknisyeni"],
|
||||||
|
nextDue: new Date("2024-02-10"),
|
||||||
|
isActive: false,
|
||||||
|
creationTime: new Date("2024-02-05"),
|
||||||
|
lastModificationTime: new Date("2024-02-06"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "MP004",
|
||||||
|
planCode: "PM-WELD-001",
|
||||||
|
workCenterId: "EQP004",
|
||||||
|
planType: MaintenancePlanTypeEnum.Predictive,
|
||||||
|
description: "Robot kaynak sistemi 6 aylık periyodik bakımı",
|
||||||
|
frequency: 6,
|
||||||
|
frequencyUnit: FrequencyUnitEnum.Months,
|
||||||
|
estimatedDuration: 480,
|
||||||
|
priority: PriorityEnum.High,
|
||||||
|
requiredMaterials: [],
|
||||||
|
requiredSkills: ["Robot Teknisyeni", "Kaynak Uzmanı", "Elektrikçi"],
|
||||||
|
lastExecuted: new Date("2023-08-15"),
|
||||||
|
nextDue: new Date("2024-02-15"),
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2023-08-01"),
|
||||||
|
lastModificationTime: new Date("2024-01-20"),
|
||||||
|
},
|
||||||
|
];
|
||||||
144
ui/src/mocks/mockMaintenanceTeams.ts
Normal file
144
ui/src/mocks/mockMaintenanceTeams.ts
Normal file
|
|
@ -0,0 +1,144 @@
|
||||||
|
import { Team, TeamRoleEnum } from "../types/common";
|
||||||
|
import { mockEmployees } from "./mockEmployees";
|
||||||
|
|
||||||
|
export const mockMaintenanceTeams: Team[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
code: "MEC-001",
|
||||||
|
name: "Mekanik Bakım Ekibi",
|
||||||
|
description: "Genel mekanik bakım ve onarım işleri",
|
||||||
|
managerId: "1",
|
||||||
|
members: [
|
||||||
|
{
|
||||||
|
id: "TM001",
|
||||||
|
teamId: "1",
|
||||||
|
employeeId: "1",
|
||||||
|
employee: mockEmployees.find((emp) => emp.id === "1")!,
|
||||||
|
role: TeamRoleEnum.Lead,
|
||||||
|
joinDate: new Date("2023-01-15"),
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "TM002",
|
||||||
|
teamId: "1",
|
||||||
|
employeeId: "2",
|
||||||
|
employee: mockEmployees.find((emp) => emp.id === "2")!,
|
||||||
|
role: TeamRoleEnum.Member,
|
||||||
|
joinDate: new Date("2023-03-20"),
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "TM003",
|
||||||
|
teamId: "1",
|
||||||
|
employeeId: "3",
|
||||||
|
employee: mockEmployees.find((emp) => emp.id === "3")!,
|
||||||
|
role: TeamRoleEnum.Specialist,
|
||||||
|
joinDate: new Date("2023-02-10"),
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
specializations: [
|
||||||
|
"Torna Tezgahı",
|
||||||
|
"Freze Makinesi",
|
||||||
|
"CNC Sistemleri",
|
||||||
|
"Hidrolik Sistemler",
|
||||||
|
],
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2023-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-20"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
code: "ELE-001",
|
||||||
|
name: "Elektrik Bakım Ekibi",
|
||||||
|
description: "Elektrik sistemleri ve otomasyon bakımı",
|
||||||
|
managerId: "4",
|
||||||
|
members: [
|
||||||
|
{
|
||||||
|
id: "TM004",
|
||||||
|
teamId: "2",
|
||||||
|
employeeId: "4",
|
||||||
|
employee: mockEmployees.find((emp) => emp.id === "4")!,
|
||||||
|
role: TeamRoleEnum.Lead,
|
||||||
|
joinDate: new Date("2023-01-20"),
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "TM005",
|
||||||
|
teamId: "2",
|
||||||
|
employeeId: "5",
|
||||||
|
employee: mockEmployees.find((emp) => emp.id === "5")!,
|
||||||
|
role: TeamRoleEnum.Member,
|
||||||
|
joinDate: new Date("2023-02-15"),
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
specializations: [
|
||||||
|
"PLC Programlama",
|
||||||
|
"Motor Kontrolü",
|
||||||
|
"Pano Montajı",
|
||||||
|
"Sensör Sistemleri",
|
||||||
|
],
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2023-01-20"),
|
||||||
|
lastModificationTime: new Date("2024-01-25"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
code: "WEL-001",
|
||||||
|
name: "Kaynak Ekibi",
|
||||||
|
description: "Kaynak ve metal işleri uzmanları",
|
||||||
|
managerId: "6",
|
||||||
|
members: [
|
||||||
|
{
|
||||||
|
id: "TM006",
|
||||||
|
teamId: "3",
|
||||||
|
employeeId: "6",
|
||||||
|
employee: mockEmployees.find((emp) => emp.id === "6")!,
|
||||||
|
role: TeamRoleEnum.Lead,
|
||||||
|
joinDate: new Date("2023-01-10"),
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "TM007",
|
||||||
|
teamId: "3",
|
||||||
|
employeeId: "7",
|
||||||
|
employee: mockEmployees.find((emp) => emp.id === "7")!,
|
||||||
|
role: TeamRoleEnum.Member,
|
||||||
|
joinDate: new Date("2023-04-05"),
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
specializations: [
|
||||||
|
"Robot Kaynak",
|
||||||
|
"TIG Kaynak",
|
||||||
|
"MIG Kaynak",
|
||||||
|
"Argon Kaynak",
|
||||||
|
],
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2023-01-10"),
|
||||||
|
lastModificationTime: new Date("2024-02-01"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
code: "GEN-001",
|
||||||
|
name: "Genel Bakım Ekibi",
|
||||||
|
description: "Genel bakım ve temizlik işleri",
|
||||||
|
managerId: "8",
|
||||||
|
members: [
|
||||||
|
{
|
||||||
|
id: "TM008",
|
||||||
|
teamId: "4",
|
||||||
|
employeeId: "8",
|
||||||
|
employee: mockEmployees.find((emp) => emp.id === "8")!,
|
||||||
|
role: TeamRoleEnum.Lead,
|
||||||
|
joinDate: new Date("2023-01-05"),
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
specializations: ["Genel Temizlik", "Yağlama", "Basit Onarımlar"],
|
||||||
|
isActive: false,
|
||||||
|
creationTime: new Date("2023-01-05"),
|
||||||
|
lastModificationTime: new Date("2024-01-30"),
|
||||||
|
},
|
||||||
|
];
|
||||||
204
ui/src/mocks/mockMaintenanceWorkOrders.ts
Normal file
204
ui/src/mocks/mockMaintenanceWorkOrders.ts
Normal file
|
|
@ -0,0 +1,204 @@
|
||||||
|
import { PriorityEnum } from "../types/common";
|
||||||
|
import {
|
||||||
|
PmMaintenanceWorkOrder,
|
||||||
|
WorkOrderStatusEnum,
|
||||||
|
WorkOrderTypeEnum,
|
||||||
|
} from "../types/pm";
|
||||||
|
|
||||||
|
export const mockMaintenanceWorkOrders: PmMaintenanceWorkOrder[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
workOrderNumber: "WO-2024-045",
|
||||||
|
workCenterId: "1",
|
||||||
|
orderType: WorkOrderTypeEnum.Corrective,
|
||||||
|
priority: PriorityEnum.High,
|
||||||
|
status: WorkOrderStatusEnum.InProgress,
|
||||||
|
description: "CNC Torna Tezgahı Motor Titreşim Sorunu Giderilmesi",
|
||||||
|
reportedBy: "Operator Mustafa Koç",
|
||||||
|
assignedTo: "Mehmet Kaya",
|
||||||
|
scheduledStart: new Date("2024-02-08T10:00:00"),
|
||||||
|
scheduledEnd: new Date("2024-02-08T13:00:00"),
|
||||||
|
actualStart: new Date("2024-02-08T10:15:00"),
|
||||||
|
estimatedCost: 500,
|
||||||
|
actualCost: 350,
|
||||||
|
materials: [
|
||||||
|
{
|
||||||
|
id: "WOM001",
|
||||||
|
workOrderId: "WO001",
|
||||||
|
materialId: "MAT001",
|
||||||
|
materialCode: "BEARING-001",
|
||||||
|
materialName: "Rulman 6205",
|
||||||
|
plannedQuantity: 2,
|
||||||
|
actualQuantity: 2,
|
||||||
|
unitCost: 45.5,
|
||||||
|
totalCost: 91.0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "WOM002",
|
||||||
|
workOrderId: "WO001",
|
||||||
|
materialId: "MAT002",
|
||||||
|
materialCode: "OIL-002",
|
||||||
|
materialName: "Motor Yağı",
|
||||||
|
plannedQuantity: 3,
|
||||||
|
actualQuantity: 2,
|
||||||
|
unitCost: 35.0,
|
||||||
|
totalCost: 70.0,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
activities: [
|
||||||
|
{
|
||||||
|
id: "WOA001",
|
||||||
|
workOrderId: "WO001",
|
||||||
|
activityDescription: "Motor sökme ve inceleme",
|
||||||
|
plannedDuration: 60,
|
||||||
|
actualDuration: 45,
|
||||||
|
performedBy: "Mehmet Kaya",
|
||||||
|
completedAt: new Date("2024-02-08T11:00:00"),
|
||||||
|
notes: "Motor rulmanlarında aşınma tespit edildi",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "WOA002",
|
||||||
|
workOrderId: "WO001",
|
||||||
|
activityDescription: "Rulman değişimi",
|
||||||
|
plannedDuration: 90,
|
||||||
|
actualDuration: 75,
|
||||||
|
performedBy: "Mehmet Kaya",
|
||||||
|
notes: "Yeni rulmanlar takıldı ve yağlama yapıldı",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
notes: "Motor titreşim sorunu rulman değişimi ile çözüldü.",
|
||||||
|
creationTime: new Date("2024-02-08T09:30:00"),
|
||||||
|
lastModificationTime: new Date("2024-02-08T12:00:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
workOrderNumber: "WO-2024-046",
|
||||||
|
workCenterId: "2",
|
||||||
|
planId: "MP002",
|
||||||
|
orderType: WorkOrderTypeEnum.Preventive,
|
||||||
|
priority: PriorityEnum.Normal,
|
||||||
|
status: WorkOrderStatusEnum.Planned,
|
||||||
|
description: "Hava Kompresörü Aylık Rutin Bakım",
|
||||||
|
reportedBy: "Sistem (Otomatik)",
|
||||||
|
assignedTo: "Ali Demir",
|
||||||
|
scheduledStart: new Date("2024-02-15T08:00:00"),
|
||||||
|
scheduledEnd: new Date("2024-02-15T12:00:00"),
|
||||||
|
estimatedCost: 200,
|
||||||
|
actualCost: 0,
|
||||||
|
materials: [
|
||||||
|
{
|
||||||
|
id: "WOM003",
|
||||||
|
workOrderId: "WO002",
|
||||||
|
materialId: "MAT003",
|
||||||
|
materialCode: "FILTER-001",
|
||||||
|
materialName: "Hava Filtresi",
|
||||||
|
plannedQuantity: 2,
|
||||||
|
actualQuantity: 0,
|
||||||
|
unitCost: 25.0,
|
||||||
|
totalCost: 50.0,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
activities: [
|
||||||
|
{
|
||||||
|
id: "WOA003",
|
||||||
|
workOrderId: "WO002",
|
||||||
|
activityDescription: "Hava filtresi değişimi",
|
||||||
|
plannedDuration: 30,
|
||||||
|
actualDuration: 0,
|
||||||
|
performedBy: "Ali Demir",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "WOA004",
|
||||||
|
workOrderId: "WO002",
|
||||||
|
activityDescription: "Basınç kontrolü ve kalibrasyon",
|
||||||
|
plannedDuration: 60,
|
||||||
|
actualDuration: 0,
|
||||||
|
performedBy: "Ali Demir",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
creationTime: new Date("2024-02-01T09:00:00"),
|
||||||
|
lastModificationTime: new Date("2024-02-01T09:00:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
workOrderNumber: "WO-2024-047",
|
||||||
|
workCenterId: "3",
|
||||||
|
orderType: WorkOrderTypeEnum.Emergency,
|
||||||
|
priority: PriorityEnum.Urgent,
|
||||||
|
status: WorkOrderStatusEnum.Completed,
|
||||||
|
description: "Konveyör Sistemi Acil Onarım - Üretim Durduruldu",
|
||||||
|
reportedBy: "Vardiya Amiri",
|
||||||
|
assignedTo: "Fatma Özkan",
|
||||||
|
scheduledStart: new Date("2024-02-06T14:00:00"),
|
||||||
|
scheduledEnd: new Date("2024-02-06T17:00:00"),
|
||||||
|
actualStart: new Date("2024-02-06T14:10:00"),
|
||||||
|
actualEnd: new Date("2024-02-06T16:45:00"),
|
||||||
|
estimatedCost: 800,
|
||||||
|
actualCost: 750,
|
||||||
|
materials: [
|
||||||
|
{
|
||||||
|
id: "WOM004",
|
||||||
|
workOrderId: "WO003",
|
||||||
|
materialId: "MAT004",
|
||||||
|
materialCode: "MOTOR-001",
|
||||||
|
materialName: "Konveyör Motoru 3kW",
|
||||||
|
plannedQuantity: 1,
|
||||||
|
actualQuantity: 1,
|
||||||
|
unitCost: 650.0,
|
||||||
|
totalCost: 650.0,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
activities: [
|
||||||
|
{
|
||||||
|
id: "WOA005",
|
||||||
|
workOrderId: "WO003",
|
||||||
|
activityDescription: "Arızalı motor sökme",
|
||||||
|
plannedDuration: 45,
|
||||||
|
actualDuration: 40,
|
||||||
|
performedBy: "Fatma Özkan",
|
||||||
|
completedAt: new Date("2024-02-06T14:50:00"),
|
||||||
|
notes: "Motor sargıları yanmış",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "WOA006",
|
||||||
|
workOrderId: "WO003",
|
||||||
|
activityDescription: "Yeni motor montajı",
|
||||||
|
plannedDuration: 90,
|
||||||
|
actualDuration: 85,
|
||||||
|
performedBy: "Fatma Özkan",
|
||||||
|
completedAt: new Date("2024-02-06T16:15:00"),
|
||||||
|
notes: "Motor takıldı ve test edildi",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
notes: "Acil onarım başarıyla tamamlandı. Üretim normale döndü.",
|
||||||
|
completionNotes:
|
||||||
|
"Motor arızası nedeniyle değişim yapıldı. Sistem test edildi ve normal çalışıyor.",
|
||||||
|
creationTime: new Date("2024-02-06T13:45:00"),
|
||||||
|
lastModificationTime: new Date("2024-02-06T16:45:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
workOrderNumber: "WO-2024-048",
|
||||||
|
workCenterId: "4",
|
||||||
|
orderType: WorkOrderTypeEnum.Calibration,
|
||||||
|
priority: PriorityEnum.Normal,
|
||||||
|
status: WorkOrderStatusEnum.Created,
|
||||||
|
description: "Robot Kaynak Makinesi Kalibrasyon",
|
||||||
|
reportedBy: "Kalite Kontrol",
|
||||||
|
estimatedCost: 300,
|
||||||
|
actualCost: 0,
|
||||||
|
materials: [],
|
||||||
|
activities: [
|
||||||
|
{
|
||||||
|
id: "WOA007",
|
||||||
|
workOrderId: "WO004",
|
||||||
|
activityDescription: "Robot pozisyon kalibrasyonu",
|
||||||
|
plannedDuration: 120,
|
||||||
|
actualDuration: 0,
|
||||||
|
performedBy: "Sema Korkmaz",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
creationTime: new Date("2024-02-05T11:20:00"),
|
||||||
|
lastModificationTime: new Date("2024-02-05T11:20:00"),
|
||||||
|
},
|
||||||
|
];
|
||||||
68
ui/src/mocks/mockMaterialGroups.ts
Normal file
68
ui/src/mocks/mockMaterialGroups.ts
Normal file
|
|
@ -0,0 +1,68 @@
|
||||||
|
import { MmMaterialGroup } from "../types/mm";
|
||||||
|
|
||||||
|
// Define your mock data
|
||||||
|
export const mockMaterialGroups: MmMaterialGroup[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
code: "METAL",
|
||||||
|
name: "Metal Malzemeler",
|
||||||
|
description: "Çelik, alüminyum gibi metal ürün grupları.",
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
code: "MOTOR",
|
||||||
|
name: "Elektrik Motorları",
|
||||||
|
description: "AC, DC ve servo motor grupları.",
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
code: "PLASTIK",
|
||||||
|
name: "Plastik Malzemeler",
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
code: "KIMYA",
|
||||||
|
name: "Kimyasal Maddeler",
|
||||||
|
description: "Yağlar, solventler ve diğer kimyasallar.",
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "5",
|
||||||
|
code: "YARI-MAMUL",
|
||||||
|
name: "Yarı Mamuller",
|
||||||
|
parentGroupId: "1",
|
||||||
|
isActive: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "6",
|
||||||
|
code: "MAMUL",
|
||||||
|
name: "Mamuller",
|
||||||
|
parentGroupId: "1",
|
||||||
|
isActive: false,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
// Function to populate the parentGroup field
|
||||||
|
export function populateParentGroups(groups: MmMaterialGroup[]): MmMaterialGroup[] {
|
||||||
|
const groupMap = new Map<string, MmMaterialGroup>();
|
||||||
|
|
||||||
|
// 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);
|
||||||
52
ui/src/mocks/mockMaterialTypes.ts
Normal file
52
ui/src/mocks/mockMaterialTypes.ts
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
import { MmMaterialType, MaterialTypeEnum } from "../types/mm";
|
||||||
|
|
||||||
|
export const mockMaterialTypes: MmMaterialType[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
code: MaterialTypeEnum.RawMaterial,
|
||||||
|
name: "Hammadde",
|
||||||
|
description: "Üretimde kullanılan temel malzemeler",
|
||||||
|
isActive: true,
|
||||||
|
className: "bg-blue-100 text-blue-800",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
code: MaterialTypeEnum.SemiFinished,
|
||||||
|
name: "Yarı Mamul",
|
||||||
|
description: "Kısmen işlenmiş ürünler",
|
||||||
|
isActive: true,
|
||||||
|
className: "bg-yellow-100 text-yellow-800",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
code: MaterialTypeEnum.Finished,
|
||||||
|
name: "Mamul",
|
||||||
|
description: "Satışa hazır nihai ürünler",
|
||||||
|
isActive: true,
|
||||||
|
className: "bg-green-100 text-green-800",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
code: MaterialTypeEnum.Consumable,
|
||||||
|
name: "Sarf Malzemesi",
|
||||||
|
description: "Tüketilen yardımcı malzemeler",
|
||||||
|
isActive: true,
|
||||||
|
className: "bg-gray-100 text-gray-800",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "5",
|
||||||
|
code: MaterialTypeEnum.Service,
|
||||||
|
name: "Hizmet",
|
||||||
|
description: "Hizmet türü kalemler",
|
||||||
|
isActive: true,
|
||||||
|
className: "bg-purple-100 text-purple-800",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "6",
|
||||||
|
code: MaterialTypeEnum.Spare,
|
||||||
|
name: "Yedek Parça",
|
||||||
|
description: "Bakım ve onarım parçaları",
|
||||||
|
isActive: true,
|
||||||
|
className: "bg-orange-100 text-orange-800",
|
||||||
|
},
|
||||||
|
];
|
||||||
429
ui/src/mocks/mockMaterials.ts
Normal file
429
ui/src/mocks/mockMaterials.ts
Normal file
|
|
@ -0,0 +1,429 @@
|
||||||
|
import { MmMaterial } from "../types/mm";
|
||||||
|
import { mockBusinessParties } from "./mockBusinessParties";
|
||||||
|
import { mockLocations } from "./mockLocations";
|
||||||
|
import { mockMaterialGroups } from "./mockMaterialGroups";
|
||||||
|
import { mockMaterialTypes } from "./mockMaterialTypes";
|
||||||
|
import { mockUnits } from "./mockUnits";
|
||||||
|
import { mockWarehouses } from "./mockWarehouses";
|
||||||
|
import { mockZones } from "./mockZones";
|
||||||
|
|
||||||
|
export const mockMaterials: MmMaterial[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
code: "MT001",
|
||||||
|
name: "Yüksek Kaliteli Çelik Levha 10mm",
|
||||||
|
description: "Çelik Levha 2mm",
|
||||||
|
baseUnitId: "KG",
|
||||||
|
baseUnit: mockUnits.find((u) => u.id === "KG"),
|
||||||
|
costPrice: 15.5,
|
||||||
|
salesPrice: 18.75,
|
||||||
|
currency: "TRY",
|
||||||
|
isActive: true,
|
||||||
|
totalStock: 2500.0,
|
||||||
|
materialTypeId: "1",
|
||||||
|
materialType: mockMaterialTypes.find((mt) => mt.id === "1"),
|
||||||
|
materialGroupId: "1",
|
||||||
|
materialGroup: mockMaterialGroups.find((mg) => mg.id === "1"),
|
||||||
|
barcode: "1234567890123",
|
||||||
|
trackingType: "Quantity",
|
||||||
|
creationTime: new Date("2024-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-20"),
|
||||||
|
alternativeUnits: [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
materialId: "1",
|
||||||
|
unitId: "KOLI",
|
||||||
|
unit: mockUnits.find((u) => u.id === "KOLI"),
|
||||||
|
conversionFactor: 1,
|
||||||
|
isDefault: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
materialId: "1",
|
||||||
|
unitId: "PAKET",
|
||||||
|
unit: mockUnits.find((u) => u.id === "PAKET"),
|
||||||
|
conversionFactor: 1,
|
||||||
|
isDefault: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
stockLevels: [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
materialId: "1",
|
||||||
|
warehouseId: "1",
|
||||||
|
warehouse: mockWarehouses.find((w) => w.id === "1"),
|
||||||
|
zoneId: "2",
|
||||||
|
zone: mockZones.find((z) => z.id === "2"),
|
||||||
|
locationId: "1",
|
||||||
|
location: mockLocations.find((l) => l.id === "1"),
|
||||||
|
availableQuantity: 1250,
|
||||||
|
reservedQuantity: 200,
|
||||||
|
inTransitQuantity: 500,
|
||||||
|
minimumStock: 100,
|
||||||
|
maximumStock: 2000,
|
||||||
|
reorderPoint: 300,
|
||||||
|
lastUpdated: new Date(),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
specifications: [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
materialId: "1",
|
||||||
|
specificationName: "Kalınlık",
|
||||||
|
specificationValue: "2",
|
||||||
|
unitId: "mm",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
materialId: "1",
|
||||||
|
specificationName: "Genişlik",
|
||||||
|
specificationValue: "1000",
|
||||||
|
unitId: "mm",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
materialId: "1",
|
||||||
|
specificationName: "Uzunluk",
|
||||||
|
specificationValue: "2000",
|
||||||
|
unitId: "mm",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
suppliers: [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
materialId: "1",
|
||||||
|
supplierId: "1",
|
||||||
|
supplier: mockBusinessParties.find((bp) => bp.id === "1"),
|
||||||
|
supplierMaterialCode: "S-MAT-001",
|
||||||
|
leadTime: 7,
|
||||||
|
minimumOrderQuantity: 100,
|
||||||
|
price: 24.0,
|
||||||
|
currency: "TRY",
|
||||||
|
isPreferred: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
code: "MT002",
|
||||||
|
name: "Alüminyum Profil 40x40",
|
||||||
|
description: "Alüminyum Profil 40x40",
|
||||||
|
materialTypeId: "2",
|
||||||
|
materialType: mockMaterialTypes.find((mt) => mt.id === "2"),
|
||||||
|
baseUnitId: "MT",
|
||||||
|
baseUnit: mockUnits.find((u) => u.id === "MT"),
|
||||||
|
costPrice: 45.0,
|
||||||
|
salesPrice: 55.0,
|
||||||
|
currency: "TRY",
|
||||||
|
isActive: true,
|
||||||
|
totalStock: 1200.0,
|
||||||
|
creationTime: new Date("2024-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-20"),
|
||||||
|
materialGroupId: "1",
|
||||||
|
materialGroup: mockMaterialGroups.find((mg) => mg.id === "1"),
|
||||||
|
trackingType: "Lot",
|
||||||
|
barcode: "1234567890124",
|
||||||
|
stockLevels: [
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
materialId: "2",
|
||||||
|
warehouseId: "1",
|
||||||
|
warehouse: mockWarehouses.find((w) => w.id === "1"),
|
||||||
|
zoneId: "2",
|
||||||
|
zone: mockZones.find((z) => z.id === "2"),
|
||||||
|
locationId: "2",
|
||||||
|
location: mockLocations.find((l) => l.id === "2"),
|
||||||
|
availableQuantity: 800,
|
||||||
|
reservedQuantity: 150,
|
||||||
|
inTransitQuantity: 200,
|
||||||
|
minimumStock: 50,
|
||||||
|
maximumStock: 1500,
|
||||||
|
reorderPoint: 200,
|
||||||
|
lastUpdated: new Date(),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
specifications: [
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
materialId: "2",
|
||||||
|
specificationName: "Genişlik",
|
||||||
|
specificationValue: "40",
|
||||||
|
unitId: "mm",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "5",
|
||||||
|
materialId: "2",
|
||||||
|
specificationName: "Yükseklik",
|
||||||
|
specificationValue: "40",
|
||||||
|
unitId: "mm",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "6",
|
||||||
|
materialId: "2",
|
||||||
|
specificationName: "Alaşım",
|
||||||
|
specificationValue: "6061",
|
||||||
|
unitId: "",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
suppliers: [
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
materialId: "2",
|
||||||
|
supplierId: "2",
|
||||||
|
supplier: mockBusinessParties.find((bp) => bp.id === "2"),
|
||||||
|
supplierMaterialCode: "S-ALU-002",
|
||||||
|
leadTime: 10,
|
||||||
|
minimumOrderQuantity: 50,
|
||||||
|
price: 42.0,
|
||||||
|
currency: "TRY",
|
||||||
|
isPreferred: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
code: "PR001",
|
||||||
|
name: "Montajlı Motor Grubu A-Type",
|
||||||
|
description: "Motor Grubu A-Type",
|
||||||
|
materialTypeId: "1",
|
||||||
|
materialType: mockMaterialTypes.find((mt) => mt.id === "1"),
|
||||||
|
baseUnitId: "AD",
|
||||||
|
baseUnit: mockUnits.find((u) => u.id === "AD"),
|
||||||
|
costPrice: 850.0,
|
||||||
|
salesPrice: 1200.0,
|
||||||
|
currency: "TRY",
|
||||||
|
isActive: true,
|
||||||
|
totalStock: 45.0,
|
||||||
|
creationTime: new Date("2024-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-20"),
|
||||||
|
materialGroupId: "2",
|
||||||
|
materialGroup: mockMaterialGroups.find((mg) => mg.id === "2"),
|
||||||
|
trackingType: "Lot",
|
||||||
|
barcode: "1234567890125",
|
||||||
|
stockLevels: [
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
materialId: "3",
|
||||||
|
warehouseId: "1",
|
||||||
|
warehouse: mockWarehouses.find((w) => w.id === "1"),
|
||||||
|
zoneId: "1",
|
||||||
|
zone: mockZones.find((z) => z.id === "1"),
|
||||||
|
locationId: "3",
|
||||||
|
location: mockLocations.find((l) => l.id === "3"),
|
||||||
|
availableQuantity: 30,
|
||||||
|
reservedQuantity: 10,
|
||||||
|
inTransitQuantity: 5,
|
||||||
|
minimumStock: 5,
|
||||||
|
maximumStock: 100,
|
||||||
|
reorderPoint: 15,
|
||||||
|
lastUpdated: new Date(),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
specifications: [
|
||||||
|
{
|
||||||
|
id: "7",
|
||||||
|
materialId: "3",
|
||||||
|
specificationName: "Güç",
|
||||||
|
specificationValue: "5.5",
|
||||||
|
unitId: "kW",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "8",
|
||||||
|
materialId: "3",
|
||||||
|
specificationName: "Devir",
|
||||||
|
specificationValue: "1450",
|
||||||
|
unitId: "rpm",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "9",
|
||||||
|
materialId: "3",
|
||||||
|
specificationName: "Voltaj",
|
||||||
|
specificationValue: "380",
|
||||||
|
unitId: "V",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
suppliers: [
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
materialId: "3",
|
||||||
|
supplierId: "3",
|
||||||
|
supplier: mockBusinessParties.find((bp) => bp.id === "3"),
|
||||||
|
supplierMaterialCode: "S-MOT-003",
|
||||||
|
leadTime: 21,
|
||||||
|
minimumOrderQuantity: 1,
|
||||||
|
price: 800.0,
|
||||||
|
currency: "TRY",
|
||||||
|
isPreferred: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
code: "SF001",
|
||||||
|
name: "Kesme Yağı Premium",
|
||||||
|
description: "Kesme Yağı Premium",
|
||||||
|
materialTypeId: "1",
|
||||||
|
materialType: mockMaterialTypes.find((mt) => mt.id === "1"),
|
||||||
|
baseUnitId: "LT",
|
||||||
|
baseUnit: mockUnits.find((u) => u.id === "LT"),
|
||||||
|
costPrice: 25.0,
|
||||||
|
salesPrice: 35.0,
|
||||||
|
currency: "TRY",
|
||||||
|
isActive: true,
|
||||||
|
totalStock: 150.0,
|
||||||
|
creationTime: new Date("2024-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-20"),
|
||||||
|
materialGroupId: "4",
|
||||||
|
materialGroup: mockMaterialGroups.find((mg) => mg.id === "4"),
|
||||||
|
trackingType: "Quantity",
|
||||||
|
barcode: "1234567890126",
|
||||||
|
stockLevels: [
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
materialId: "4",
|
||||||
|
warehouseId: "2",
|
||||||
|
warehouse: mockWarehouses.find((w) => w.id === "2"),
|
||||||
|
zoneId: "1",
|
||||||
|
zone: mockZones.find((z) => z.id === "1"),
|
||||||
|
locationId: "4",
|
||||||
|
location: mockLocations.find((l) => l.id === "4"),
|
||||||
|
availableQuantity: 120,
|
||||||
|
reservedQuantity: 20,
|
||||||
|
inTransitQuantity: 10,
|
||||||
|
minimumStock: 25,
|
||||||
|
maximumStock: 300,
|
||||||
|
reorderPoint: 50,
|
||||||
|
lastUpdated: new Date(),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
specifications: [
|
||||||
|
{
|
||||||
|
id: "10",
|
||||||
|
materialId: "4",
|
||||||
|
specificationName: "Viskozite",
|
||||||
|
specificationValue: "32",
|
||||||
|
unitId: "cSt",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "11",
|
||||||
|
materialId: "4",
|
||||||
|
specificationName: "Yoğunluk",
|
||||||
|
specificationValue: "0.85",
|
||||||
|
unitId: "g/cm³",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "12",
|
||||||
|
materialId: "4",
|
||||||
|
specificationName: "Parlama Noktası",
|
||||||
|
specificationValue: "210",
|
||||||
|
unitId: "°C",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
suppliers: [
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
materialId: "4",
|
||||||
|
supplierId: "3",
|
||||||
|
supplier: mockBusinessParties.find((bp) => bp.id === "3"),
|
||||||
|
supplierMaterialCode: "S-OIL-004",
|
||||||
|
leadTime: 5,
|
||||||
|
minimumOrderQuantity: 20,
|
||||||
|
price: 22.0,
|
||||||
|
currency: "TRY",
|
||||||
|
isPreferred: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "5",
|
||||||
|
code: "PK001",
|
||||||
|
name: "Plastik Kapak Komponenti",
|
||||||
|
description: "Plastik Kapak",
|
||||||
|
materialTypeId: "1",
|
||||||
|
materialType: mockMaterialTypes.find((mt) => mt.id === "1"),
|
||||||
|
materialGroupId: "5",
|
||||||
|
materialGroup: mockMaterialGroups.find((mg) => mg.id === "5"),
|
||||||
|
baseUnitId: "AD",
|
||||||
|
baseUnit: mockUnits.find((u) => u.id === "AD"),
|
||||||
|
costPrice: 8.5,
|
||||||
|
salesPrice: 15.0,
|
||||||
|
currency: "TRY",
|
||||||
|
isActive: true,
|
||||||
|
totalStock: 850.0,
|
||||||
|
creationTime: new Date("2024-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-20"),
|
||||||
|
trackingType: "Serial",
|
||||||
|
barcode: "1234567890127",
|
||||||
|
stockLevels: [
|
||||||
|
{
|
||||||
|
id: "5",
|
||||||
|
materialId: "5",
|
||||||
|
warehouseId: "2",
|
||||||
|
warehouse: mockWarehouses.find((w) => w.id === "2"),
|
||||||
|
zoneId: "3",
|
||||||
|
zone: mockZones.find((z) => z.id === "3"),
|
||||||
|
locationId: "4",
|
||||||
|
location: mockLocations.find((l) => l.id === "4"),
|
||||||
|
availableQuantity: 750,
|
||||||
|
reservedQuantity: 50,
|
||||||
|
inTransitQuantity: 50,
|
||||||
|
minimumStock: 100,
|
||||||
|
maximumStock: 1000,
|
||||||
|
reorderPoint: 200,
|
||||||
|
lastUpdated: new Date(),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
specifications: [
|
||||||
|
{
|
||||||
|
id: "13",
|
||||||
|
materialId: "5",
|
||||||
|
specificationName: "Malzeme",
|
||||||
|
specificationValue: "PP Polypropylene",
|
||||||
|
unitId: "",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "14",
|
||||||
|
materialId: "5",
|
||||||
|
specificationName: "Ağırlık",
|
||||||
|
specificationValue: "5.2",
|
||||||
|
unitId: "kg",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "15",
|
||||||
|
materialId: "5",
|
||||||
|
specificationName: "Boyut",
|
||||||
|
specificationValue: "300x200x50",
|
||||||
|
unitId: "mm",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
suppliers: [
|
||||||
|
{
|
||||||
|
id: "5",
|
||||||
|
materialId: "5",
|
||||||
|
supplierId: "2",
|
||||||
|
supplier: mockBusinessParties.find((bp) => bp.id === "2"),
|
||||||
|
supplierMaterialCode: "S-SEM-005",
|
||||||
|
leadTime: 14,
|
||||||
|
minimumOrderQuantity: 5,
|
||||||
|
price: 110.0,
|
||||||
|
currency: "TRY",
|
||||||
|
isPreferred: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
79
ui/src/mocks/mockOperationTypes.ts
Normal file
79
ui/src/mocks/mockOperationTypes.ts
Normal file
|
|
@ -0,0 +1,79 @@
|
||||||
|
import { OperationCategoryEnum, MrpOperationTypeDefinition } from "../types/mrp";
|
||||||
|
|
||||||
|
export const mockOperationTypes: MrpOperationTypeDefinition[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
code: "CUT001",
|
||||||
|
name: "Kesme İşlemi",
|
||||||
|
description: "Malzeme kesme operasyonu",
|
||||||
|
category: OperationCategoryEnum.Production,
|
||||||
|
defaultDuration: 30,
|
||||||
|
requiresSetup: true,
|
||||||
|
allowsParallelOperation: false,
|
||||||
|
qualityCheckRequired: true,
|
||||||
|
skillLevelRequired: 3,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
code: "WELD001",
|
||||||
|
name: "Kaynak İşlemi",
|
||||||
|
description: "Metal kaynak operasyonu",
|
||||||
|
category: OperationCategoryEnum.Maintenance,
|
||||||
|
defaultDuration: 45,
|
||||||
|
requiresSetup: true,
|
||||||
|
allowsParallelOperation: false,
|
||||||
|
qualityCheckRequired: true,
|
||||||
|
skillLevelRequired: 4,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
code: "ASSY001",
|
||||||
|
name: "Montaj İşlemi",
|
||||||
|
description: "Parça montaj operasyonu",
|
||||||
|
category: OperationCategoryEnum.Production,
|
||||||
|
defaultDuration: 20,
|
||||||
|
requiresSetup: false,
|
||||||
|
allowsParallelOperation: true,
|
||||||
|
qualityCheckRequired: false,
|
||||||
|
skillLevelRequired: 2,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
code: "QC001",
|
||||||
|
name: "Kalite Kontrolü",
|
||||||
|
description: "Ürün kalite kontrol işlemi",
|
||||||
|
category: OperationCategoryEnum.Quality,
|
||||||
|
defaultDuration: 15,
|
||||||
|
requiresSetup: false,
|
||||||
|
allowsParallelOperation: false,
|
||||||
|
qualityCheckRequired: true,
|
||||||
|
skillLevelRequired: 3,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "5",
|
||||||
|
code: "PACK001",
|
||||||
|
name: "Paketleme",
|
||||||
|
description: "Ürün paketleme işlemi",
|
||||||
|
category: OperationCategoryEnum.Setup,
|
||||||
|
defaultDuration: 10,
|
||||||
|
requiresSetup: false,
|
||||||
|
allowsParallelOperation: true,
|
||||||
|
qualityCheckRequired: false,
|
||||||
|
skillLevelRequired: 1,
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
];
|
||||||
106
ui/src/mocks/mockOperations.ts
Normal file
106
ui/src/mocks/mockOperations.ts
Normal file
|
|
@ -0,0 +1,106 @@
|
||||||
|
import { MrpOperation } from "../types/mrp";
|
||||||
|
import { mockWorkCenters } from "./mockWorkCenters";
|
||||||
|
import { mockOperationTypes } from "./mockOperationTypes";
|
||||||
|
|
||||||
|
export const mockOperations: MrpOperation[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
code: "OP001",
|
||||||
|
name: "CNC Torna Tezgahı İşlemi",
|
||||||
|
description: "Metal parçaların CNC torna tezgahında işlenmesi",
|
||||||
|
operationTypeId: "1",
|
||||||
|
operationType: mockOperationTypes.find((ot) => ot.code === "1"),
|
||||||
|
workCenterId: "1",
|
||||||
|
workCenter: mockWorkCenters.find((wc) => wc.id === "1"),
|
||||||
|
standardTime: 45,
|
||||||
|
setupTime: 30,
|
||||||
|
laborCost: 50,
|
||||||
|
machineCost: 100,
|
||||||
|
overheadCost: 25,
|
||||||
|
isActive: true,
|
||||||
|
instructions: "Torna tezgahında hassas işleme yapılacak",
|
||||||
|
qualityCheckRequired: true,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
code: "OP002",
|
||||||
|
name: "Kaynak İşlemi",
|
||||||
|
description: "Argon kaynak ile metal birleştirme",
|
||||||
|
operationTypeId: "2",
|
||||||
|
operationType: mockOperationTypes.find((ot) => ot.code === "2"),
|
||||||
|
workCenterId: "2",
|
||||||
|
workCenter: mockWorkCenters.find((wc) => wc.id === "2"),
|
||||||
|
standardTime: 60,
|
||||||
|
setupTime: 15,
|
||||||
|
laborCost: 80,
|
||||||
|
machineCost: 40,
|
||||||
|
overheadCost: 20,
|
||||||
|
isActive: true,
|
||||||
|
instructions: "Argon gazı ile koruyucu atmosferde kaynak yapılacak",
|
||||||
|
qualityCheckRequired: true,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
code: "OP003",
|
||||||
|
name: "Kalite Kontrolü",
|
||||||
|
description: "Boyutsal ve görsel kalite kontrolü",
|
||||||
|
operationTypeId: "3",
|
||||||
|
operationType: mockOperationTypes.find((ot) => ot.code === "3"),
|
||||||
|
workCenterId: "3",
|
||||||
|
workCenter: mockWorkCenters.find((wc) => wc.id === "3"),
|
||||||
|
standardTime: 20,
|
||||||
|
setupTime: 5,
|
||||||
|
laborCost: 60,
|
||||||
|
machineCost: 20,
|
||||||
|
overheadCost: 10,
|
||||||
|
isActive: true,
|
||||||
|
instructions: "Teknik çizimlere göre boyutsal kontrol yapılacak",
|
||||||
|
qualityCheckRequired: false,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
code: "OP004",
|
||||||
|
name: "Paketleme İşlemi",
|
||||||
|
description: "Ürünlerin paketlenmesi",
|
||||||
|
operationTypeId: "4",
|
||||||
|
operationType: mockOperationTypes.find((ot) => ot.code === "4"),
|
||||||
|
workCenterId: "4",
|
||||||
|
workCenter: mockWorkCenters.find((wc) => wc.id === "4"),
|
||||||
|
standardTime: 20,
|
||||||
|
setupTime: 5,
|
||||||
|
laborCost: 60,
|
||||||
|
machineCost: 20,
|
||||||
|
overheadCost: 10,
|
||||||
|
isActive: true,
|
||||||
|
instructions: "Teknik çizimlere göre boyutsal kontrol yapılacak",
|
||||||
|
qualityCheckRequired: false,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "5",
|
||||||
|
code: "OP005",
|
||||||
|
name: "Bakım İşlemi",
|
||||||
|
description: "Preventif bakım işlemleri",
|
||||||
|
operationTypeId: "5",
|
||||||
|
operationType: mockOperationTypes.find((ot) => ot.code === "5"),
|
||||||
|
workCenterId: "3",
|
||||||
|
workCenter: mockWorkCenters.find((wc) => wc.id === "3"),
|
||||||
|
standardTime: 120,
|
||||||
|
setupTime: 20,
|
||||||
|
laborCost: 70,
|
||||||
|
machineCost: 30,
|
||||||
|
overheadCost: 20,
|
||||||
|
isActive: true,
|
||||||
|
instructions: "Periyodik bakım planına göre işlem yapılacak",
|
||||||
|
qualityCheckRequired: false,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
];
|
||||||
56
ui/src/mocks/mockOpportunities.ts
Normal file
56
ui/src/mocks/mockOpportunities.ts
Normal file
|
|
@ -0,0 +1,56 @@
|
||||||
|
import {
|
||||||
|
LeadSourceEnum,
|
||||||
|
CrmOpportunity,
|
||||||
|
OpportunityStageEnum,
|
||||||
|
OpportunityStatusEnum,
|
||||||
|
} from "../types/crm";
|
||||||
|
import { mockBusinessParties } from "./mockBusinessParties";
|
||||||
|
import { mockEmployees } from "./mockEmployees";
|
||||||
|
import { mockLossReasons } from "./mockLossReasons";
|
||||||
|
|
||||||
|
export const mockOpportunities: CrmOpportunity[] = [
|
||||||
|
{
|
||||||
|
id: "opp1",
|
||||||
|
opportunityNumber: "OPP-2024-001",
|
||||||
|
title: "ABC Şirketi Yazılım Projesi",
|
||||||
|
customerId: "5",
|
||||||
|
customer: mockBusinessParties.find((c) => c.id === "5"),
|
||||||
|
stage: OpportunityStageEnum.ClosedLost,
|
||||||
|
probability: 0,
|
||||||
|
estimatedValue: 150000,
|
||||||
|
currency: "TRY",
|
||||||
|
expectedCloseDate: new Date("2024-03-15"),
|
||||||
|
assignedTo: "1",
|
||||||
|
assigned: mockEmployees.find((e) => e.id === "1"),
|
||||||
|
leadSource: LeadSourceEnum.Website,
|
||||||
|
status: OpportunityStatusEnum.Lost,
|
||||||
|
lostReason: mockLossReasons[0],
|
||||||
|
activities: [],
|
||||||
|
quotes: [],
|
||||||
|
competitors: [],
|
||||||
|
creationTime: new Date("2024-01-10"),
|
||||||
|
lastModificationTime: new Date("2024-03-15"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "opp2",
|
||||||
|
opportunityNumber: "OPP-2024-002",
|
||||||
|
title: "XYZ Kurumu ERP Sistemi",
|
||||||
|
customerId: "6",
|
||||||
|
customer: mockBusinessParties.find((c) => c.id === "6"),
|
||||||
|
stage: OpportunityStageEnum.ClosedLost,
|
||||||
|
probability: 0,
|
||||||
|
estimatedValue: 300000,
|
||||||
|
currency: "TRY",
|
||||||
|
expectedCloseDate: new Date("2024-04-20"),
|
||||||
|
assignedTo: "2",
|
||||||
|
assigned: mockEmployees.find((e) => e.id === "2"),
|
||||||
|
leadSource: LeadSourceEnum.Referral,
|
||||||
|
status: OpportunityStatusEnum.Lost,
|
||||||
|
lostReason: mockLossReasons[1],
|
||||||
|
activities: [],
|
||||||
|
quotes: [],
|
||||||
|
competitors: [],
|
||||||
|
creationTime: new Date("2024-02-05"),
|
||||||
|
lastModificationTime: new Date("2024-04-20"),
|
||||||
|
},
|
||||||
|
];
|
||||||
151
ui/src/mocks/mockOvertimes.ts
Normal file
151
ui/src/mocks/mockOvertimes.ts
Normal file
|
|
@ -0,0 +1,151 @@
|
||||||
|
import { HrOvertime, LeaveStatusEnum } from "../types/hr";
|
||||||
|
|
||||||
|
export const mockOvertimes: HrOvertime[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
employeeId: "1",
|
||||||
|
date: new Date("2024-12-15"),
|
||||||
|
startTime: "18:00",
|
||||||
|
endTime: "21:00",
|
||||||
|
totalHours: 3,
|
||||||
|
reason: "Proje deadline'ı nedeniyle acil çalışma",
|
||||||
|
status: LeaveStatusEnum.Approved,
|
||||||
|
approvedBy: "emp_002",
|
||||||
|
rate: 1.5,
|
||||||
|
amount: 450, // 3 saat * 100 TL/saat * 1.5 kat
|
||||||
|
creationTime: new Date("2024-12-15T09:00:00"),
|
||||||
|
lastModificationTime: new Date("2024-12-15T10:30:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
employeeId: "3",
|
||||||
|
date: new Date("2024-12-14"),
|
||||||
|
startTime: "17:30",
|
||||||
|
endTime: "20:00",
|
||||||
|
totalHours: 2.5,
|
||||||
|
reason: "Müşteri talep değişikliği nedeniyle ek çalışma",
|
||||||
|
status: LeaveStatusEnum.Pending,
|
||||||
|
rate: 1.5,
|
||||||
|
amount: 375, // 2.5 saat * 100 TL/saat * 1.5 kat
|
||||||
|
creationTime: new Date("2024-12-14T17:30:00"),
|
||||||
|
lastModificationTime: new Date("2024-12-14T17:30:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
employeeId: "4",
|
||||||
|
date: new Date("2024-12-13"),
|
||||||
|
startTime: "19:00",
|
||||||
|
endTime: "22:30",
|
||||||
|
totalHours: 3.5,
|
||||||
|
reason: "Sistem bakımı ve güncelleme çalışmaları",
|
||||||
|
status: LeaveStatusEnum.Approved,
|
||||||
|
approvedBy: "emp_002",
|
||||||
|
rate: 1.5,
|
||||||
|
amount: 525, // 3.5 saat * 100 TL/saat * 1.5 kat
|
||||||
|
creationTime: new Date("2024-12-13T19:00:00"),
|
||||||
|
lastModificationTime: new Date("2024-12-13T22:35:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
employeeId: "5",
|
||||||
|
date: new Date("2024-12-12"),
|
||||||
|
startTime: "17:00",
|
||||||
|
endTime: "19:00",
|
||||||
|
totalHours: 2,
|
||||||
|
reason: "Rapor hazırlama ve sunum düzenleme",
|
||||||
|
status: LeaveStatusEnum.Rejected,
|
||||||
|
approvedBy: "emp_002",
|
||||||
|
rate: 1.5,
|
||||||
|
amount: 0, // Reddedildiği için ücret hesaplanmadı
|
||||||
|
creationTime: new Date("2024-12-12T17:00:00"),
|
||||||
|
lastModificationTime: new Date("2024-12-12T08:30:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "5",
|
||||||
|
employeeId: "6",
|
||||||
|
date: new Date("2024-12-11"),
|
||||||
|
startTime: "18:30",
|
||||||
|
endTime: "21:00",
|
||||||
|
totalHours: 2.5,
|
||||||
|
reason: "Acil hata düzeltme ve test çalışmaları",
|
||||||
|
status: LeaveStatusEnum.Approved,
|
||||||
|
approvedBy: "emp_001",
|
||||||
|
rate: 2.0, // Hafta sonu çalışması
|
||||||
|
amount: 500, // 2.5 saat * 100 TL/saat * 2.0 kat
|
||||||
|
creationTime: new Date("2024-12-11T18:30:00"),
|
||||||
|
lastModificationTime: new Date("2024-12-11T21:05:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "6",
|
||||||
|
employeeId: "7",
|
||||||
|
date: new Date("2024-12-10"),
|
||||||
|
startTime: "16:00",
|
||||||
|
endTime: "20:00",
|
||||||
|
totalHours: 4,
|
||||||
|
reason: "Yeni müşteri onboarding süreci",
|
||||||
|
status: LeaveStatusEnum.Pending,
|
||||||
|
rate: 1.5,
|
||||||
|
amount: 600, // 4 saat * 100 TL/saat * 1.5 kat
|
||||||
|
creationTime: new Date("2024-12-10T16:00:00"),
|
||||||
|
lastModificationTime: new Date("2024-12-10T16:00:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "7",
|
||||||
|
employeeId: "8",
|
||||||
|
date: new Date("2024-12-09"),
|
||||||
|
startTime: "17:45",
|
||||||
|
endTime: "21:15",
|
||||||
|
totalHours: 3.5,
|
||||||
|
reason: "Veri analizi ve raporlama çalışmaları",
|
||||||
|
status: LeaveStatusEnum.Approved,
|
||||||
|
approvedBy: "emp_002",
|
||||||
|
rate: 1.5,
|
||||||
|
amount: 525, // 3.5 saat * 100 TL/saat * 1.5 kat
|
||||||
|
creationTime: new Date("2024-12-09T17:45:00"),
|
||||||
|
lastModificationTime: new Date("2024-12-09T21:20:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "8",
|
||||||
|
employeeId: "9",
|
||||||
|
date: new Date("2024-12-08"),
|
||||||
|
startTime: "18:00",
|
||||||
|
endTime: "20:30",
|
||||||
|
totalHours: 2.5,
|
||||||
|
reason: "Eğitim materyali hazırlama",
|
||||||
|
status: LeaveStatusEnum.Pending,
|
||||||
|
rate: 1.5,
|
||||||
|
amount: 375, // 2.5 saat * 100 TL/saat * 1.5 kat
|
||||||
|
creationTime: new Date("2024-12-08T18:00:00"),
|
||||||
|
lastModificationTime: new Date("2024-12-08T18:00:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "9",
|
||||||
|
employeeId: "10",
|
||||||
|
date: new Date("2024-12-07"),
|
||||||
|
startTime: "19:30",
|
||||||
|
endTime: "23:00",
|
||||||
|
totalHours: 3.5,
|
||||||
|
reason: "Kritik sistem güvenlik yaması uygulaması",
|
||||||
|
status: LeaveStatusEnum.Approved,
|
||||||
|
approvedBy: "emp_001",
|
||||||
|
rate: 1.5,
|
||||||
|
amount: 525, // 3.5 saat * 100 TL/saat * 1.5 kat
|
||||||
|
creationTime: new Date("2024-12-07T19:30:00"),
|
||||||
|
lastModificationTime: new Date("2024-12-07T23:05:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "10",
|
||||||
|
employeeId: "1",
|
||||||
|
date: new Date("2024-12-06"),
|
||||||
|
startTime: "17:30",
|
||||||
|
endTime: "20:00",
|
||||||
|
totalHours: 2.5,
|
||||||
|
reason: "Stratejik planlama toplantısı hazırlığı",
|
||||||
|
status: LeaveStatusEnum.Rejected,
|
||||||
|
approvedBy: "emp_002",
|
||||||
|
rate: 1.5,
|
||||||
|
amount: 0, // Reddedildiği için ücret hesaplanmadı
|
||||||
|
creationTime: new Date("2024-12-06T17:30:00"),
|
||||||
|
lastModificationTime: new Date("2024-12-06T08:15:00"),
|
||||||
|
},
|
||||||
|
];
|
||||||
95
ui/src/mocks/mockPayrolls.ts
Normal file
95
ui/src/mocks/mockPayrolls.ts
Normal file
|
|
@ -0,0 +1,95 @@
|
||||||
|
import { HrPayroll, PayrollStatusEnum } from "../types/hr";
|
||||||
|
import { mockEmployees } from "./mockEmployees";
|
||||||
|
|
||||||
|
export const mockPayrolls: HrPayroll[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
employeeId: "1",
|
||||||
|
employee: mockEmployees.find((emp) => emp.id === "1"),
|
||||||
|
period: "2023-01",
|
||||||
|
baseSalary: 3000,
|
||||||
|
allowances: [],
|
||||||
|
deductions: [],
|
||||||
|
overtime: 0,
|
||||||
|
bonus: 0,
|
||||||
|
grossSalary: 0,
|
||||||
|
netSalary: 0,
|
||||||
|
tax: 0,
|
||||||
|
socialSecurity: 0,
|
||||||
|
status: PayrollStatusEnum.Cancelled,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
employeeId: "2",
|
||||||
|
employee: mockEmployees.find((emp) => emp.id === "2"),
|
||||||
|
period: "2023-01",
|
||||||
|
baseSalary: 3200,
|
||||||
|
allowances: [],
|
||||||
|
deductions: [],
|
||||||
|
overtime: 0,
|
||||||
|
bonus: 0,
|
||||||
|
grossSalary: 0,
|
||||||
|
netSalary: 0,
|
||||||
|
tax: 0,
|
||||||
|
socialSecurity: 0,
|
||||||
|
status: PayrollStatusEnum.Paid,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
employeeId: "3",
|
||||||
|
employee: mockEmployees.find((emp) => emp.id === "3"),
|
||||||
|
period: "2023-01",
|
||||||
|
baseSalary: 2800,
|
||||||
|
allowances: [],
|
||||||
|
deductions: [],
|
||||||
|
overtime: 0,
|
||||||
|
bonus: 0,
|
||||||
|
grossSalary: 0,
|
||||||
|
netSalary: 0,
|
||||||
|
tax: 0,
|
||||||
|
socialSecurity: 0,
|
||||||
|
status: PayrollStatusEnum.Approved,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
employeeId: "4",
|
||||||
|
employee: mockEmployees.find((emp) => emp.id === "4"),
|
||||||
|
period: "2023-01",
|
||||||
|
baseSalary: 3500,
|
||||||
|
allowances: [],
|
||||||
|
deductions: [],
|
||||||
|
overtime: 0,
|
||||||
|
bonus: 0,
|
||||||
|
grossSalary: 0,
|
||||||
|
netSalary: 0,
|
||||||
|
tax: 0,
|
||||||
|
socialSecurity: 0,
|
||||||
|
status: PayrollStatusEnum.Calculated,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "5",
|
||||||
|
employeeId: "4",
|
||||||
|
employee: mockEmployees.find((emp) => emp.id === "4"),
|
||||||
|
period: "2023-01",
|
||||||
|
baseSalary: 4000,
|
||||||
|
allowances: [],
|
||||||
|
deductions: [],
|
||||||
|
overtime: 0,
|
||||||
|
bonus: 0,
|
||||||
|
grossSalary: 0,
|
||||||
|
netSalary: 0,
|
||||||
|
tax: 0,
|
||||||
|
socialSecurity: 0,
|
||||||
|
status: PayrollStatusEnum.Draft,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
];
|
||||||
84
ui/src/mocks/mockProductionOrders.ts
Normal file
84
ui/src/mocks/mockProductionOrders.ts
Normal file
|
|
@ -0,0 +1,84 @@
|
||||||
|
import { PriorityEnum } from "../types/common";
|
||||||
|
import {
|
||||||
|
MrpProductionOrder,
|
||||||
|
ProductionOrderStatusEnum,
|
||||||
|
ProductionOrderTypeEnum,
|
||||||
|
} from "../types/mrp";
|
||||||
|
import { mockMaterials } from "./mockMaterials";
|
||||||
|
import { mockSalesOrders } from "./mockSalesOrders";
|
||||||
|
|
||||||
|
export const mockProductionOrders: MrpProductionOrder[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
orderNumber: "PO-2024-001",
|
||||||
|
orderType: ProductionOrderTypeEnum.Standard,
|
||||||
|
plannedStartDate: new Date("2024-01-15"),
|
||||||
|
plannedEndDate: new Date("2024-01-30"),
|
||||||
|
actualStartDate: new Date("2024-01-16"),
|
||||||
|
status: ProductionOrderStatusEnum.InProgress,
|
||||||
|
priority: PriorityEnum.High,
|
||||||
|
plannedQuantity: 100,
|
||||||
|
confirmedQuantity: 65,
|
||||||
|
requiredQuantity: 100,
|
||||||
|
scrapQuantity: 2,
|
||||||
|
unitId: "ADET",
|
||||||
|
plannedCost: 125000,
|
||||||
|
actualCost: 82000,
|
||||||
|
currency: "TRY",
|
||||||
|
materials: [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
productionOrderId: "1",
|
||||||
|
materialId: "2",
|
||||||
|
material: mockMaterials.find((m) => m.id === "2")!,
|
||||||
|
salesOrderId: "1",
|
||||||
|
salesOrder: mockSalesOrders.find((so) => so.id === "1"),
|
||||||
|
customerRequirement: "Acil teslimat gerekli",
|
||||||
|
plannedQuantity: 100,
|
||||||
|
confirmedQuantity: 65,
|
||||||
|
requiredQuantity: 100,
|
||||||
|
scrapQuantity: 2,
|
||||||
|
unitId: "ADET",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
workOrders: [],
|
||||||
|
creationTime: new Date("2024-01-10"),
|
||||||
|
lastModificationTime: new Date("2024-01-20"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
orderNumber: "PO-2024-002",
|
||||||
|
orderType: ProductionOrderTypeEnum.Standard,
|
||||||
|
plannedStartDate: new Date("2024-02-01"),
|
||||||
|
plannedEndDate: new Date("2024-02-15"),
|
||||||
|
status: ProductionOrderStatusEnum.Created,
|
||||||
|
priority: PriorityEnum.Normal,
|
||||||
|
plannedQuantity: 50,
|
||||||
|
confirmedQuantity: 0,
|
||||||
|
requiredQuantity: 50,
|
||||||
|
scrapQuantity: 1,
|
||||||
|
unitId: "ADET",
|
||||||
|
plannedCost: 75000,
|
||||||
|
actualCost: 0,
|
||||||
|
currency: "TRY",
|
||||||
|
materials: [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
productionOrderId: "1",
|
||||||
|
materialId: "3",
|
||||||
|
material: mockMaterials.find((m) => m.id === "3")!,
|
||||||
|
salesOrderId: "1",
|
||||||
|
salesOrder: mockSalesOrders.find((so) => so.id === "1"),
|
||||||
|
customerRequirement: "Acil teslimat gerekli",
|
||||||
|
plannedQuantity: 50,
|
||||||
|
confirmedQuantity: 0,
|
||||||
|
requiredQuantity: 0,
|
||||||
|
scrapQuantity: 2,
|
||||||
|
unitId: "ADET",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
workOrders: [],
|
||||||
|
creationTime: new Date("2024-01-25"),
|
||||||
|
lastModificationTime: new Date("2024-01-25"),
|
||||||
|
},
|
||||||
|
];
|
||||||
80
ui/src/mocks/mockProjectCostTracking.ts
Normal file
80
ui/src/mocks/mockProjectCostTracking.ts
Normal file
|
|
@ -0,0 +1,80 @@
|
||||||
|
import { PsProjectCostTracking } from "../types/ps";
|
||||||
|
|
||||||
|
export const mockProjectCostTracking: PsProjectCostTracking[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
projectId: "1",
|
||||||
|
projectName: "ERP Sistemi Geliştirme",
|
||||||
|
projectCode: "PRJ-2024-001",
|
||||||
|
plannedBudget: 500000,
|
||||||
|
actualCost: 325000,
|
||||||
|
remainingBudget: 175000,
|
||||||
|
plannedStartDate: new Date("2024-01-15"),
|
||||||
|
plannedEndDate: new Date("2024-12-31"),
|
||||||
|
actualStartDate: new Date("2024-01-20"),
|
||||||
|
actualEndDate: undefined,
|
||||||
|
plannedDuration: 351,
|
||||||
|
actualDuration: 300,
|
||||||
|
progress: 65,
|
||||||
|
status: "ON_TRACK",
|
||||||
|
currency: "TRY",
|
||||||
|
lastUpdated: new Date("2024-11-25"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
projectId: "2",
|
||||||
|
projectName: "Mobil Uygulama Geliştirme",
|
||||||
|
projectCode: "PRJ-2024-002",
|
||||||
|
plannedBudget: 250000,
|
||||||
|
actualCost: 200000,
|
||||||
|
remainingBudget: 50000,
|
||||||
|
plannedStartDate: new Date("2024-03-01"),
|
||||||
|
plannedEndDate: new Date("2024-08-31"),
|
||||||
|
actualStartDate: new Date("2024-03-15"),
|
||||||
|
actualEndDate: undefined,
|
||||||
|
plannedDuration: 184,
|
||||||
|
actualDuration: 200,
|
||||||
|
progress: 80,
|
||||||
|
status: "AT_RISK",
|
||||||
|
currency: "TRY",
|
||||||
|
lastUpdated: new Date("2024-11-20"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
projectId: "3",
|
||||||
|
projectName: "Web Sitesi Yenileme",
|
||||||
|
projectCode: "PRJ-2024-003",
|
||||||
|
plannedBudget: 150000,
|
||||||
|
actualCost: 180000,
|
||||||
|
remainingBudget: -30000,
|
||||||
|
plannedStartDate: new Date("2024-02-01"),
|
||||||
|
plannedEndDate: new Date("2024-06-30"),
|
||||||
|
actualStartDate: new Date("2024-02-10"),
|
||||||
|
actualEndDate: new Date("2024-07-15"),
|
||||||
|
plannedDuration: 150,
|
||||||
|
actualDuration: 156,
|
||||||
|
progress: 100,
|
||||||
|
status: "COMPLETED",
|
||||||
|
currency: "TRY",
|
||||||
|
lastUpdated: new Date("2024-07-15"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
projectId: "4",
|
||||||
|
projectName: "Veri Analizi Platformu",
|
||||||
|
projectCode: "PRJ-2024-004",
|
||||||
|
plannedBudget: 400000,
|
||||||
|
actualCost: 120000,
|
||||||
|
remainingBudget: 280000,
|
||||||
|
plannedStartDate: new Date("2024-06-01"),
|
||||||
|
plannedEndDate: new Date("2024-12-31"),
|
||||||
|
actualStartDate: new Date("2024-06-15"),
|
||||||
|
actualEndDate: undefined,
|
||||||
|
plannedDuration: 214,
|
||||||
|
actualDuration: 163,
|
||||||
|
progress: 30,
|
||||||
|
status: "DELAYED",
|
||||||
|
currency: "TRY",
|
||||||
|
lastUpdated: new Date("2024-11-22"),
|
||||||
|
},
|
||||||
|
];
|
||||||
180
ui/src/mocks/mockProjectPhases.ts
Normal file
180
ui/src/mocks/mockProjectPhases.ts
Normal file
|
|
@ -0,0 +1,180 @@
|
||||||
|
import { PhaseStatusEnum, PsProjectPhase } from "../types/ps";
|
||||||
|
import { mockMaintenanceTeams } from "./mockMaintenanceTeams";
|
||||||
|
import { mockProjects } from "./mockProjects";
|
||||||
|
|
||||||
|
export const mockProjectPhases: PsProjectPhase[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
code: "PH-001",
|
||||||
|
name: "Analiz ve Tasarım",
|
||||||
|
description: "Sistem analizi ve tasarım dokümantasyonu hazırlanması",
|
||||||
|
projectId: "1",
|
||||||
|
project: mockProjects.find((p) => p.id === "1")!,
|
||||||
|
status: PhaseStatusEnum.Completed,
|
||||||
|
startDate: new Date("2024-01-15"),
|
||||||
|
endDate: new Date("2024-02-28"),
|
||||||
|
actualStartDate: new Date("2024-01-15"),
|
||||||
|
actualEndDate: new Date("2024-02-25"),
|
||||||
|
budget: 150000,
|
||||||
|
actualCost: 145000,
|
||||||
|
progress: 100,
|
||||||
|
milestones: 4,
|
||||||
|
completedMilestones: 4,
|
||||||
|
assignedTeams: [
|
||||||
|
mockMaintenanceTeams.find((t) => t.id === "1")!.name,
|
||||||
|
mockMaintenanceTeams.find((t) => t.id === "2")!.name,
|
||||||
|
],
|
||||||
|
deliverables: [
|
||||||
|
"Sistem Analiz Raporu",
|
||||||
|
"Teknik Tasarım Dokümanı",
|
||||||
|
"UI/UX Tasarımları",
|
||||||
|
],
|
||||||
|
risks: ["Gereksinim değişiklikleri"],
|
||||||
|
category: "Planning",
|
||||||
|
sequence: 0,
|
||||||
|
tasks: [],
|
||||||
|
isActive: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
code: "PH-002",
|
||||||
|
name: "Geliştirme - Faz 1",
|
||||||
|
description: "Backend altyapısı ve temel modüllerin geliştirilmesi",
|
||||||
|
projectId: "1",
|
||||||
|
project: mockProjects.find((p) => p.id === "1")!,
|
||||||
|
status: PhaseStatusEnum.Cancelled,
|
||||||
|
startDate: new Date("2024-03-01"),
|
||||||
|
endDate: new Date("2024-05-15"),
|
||||||
|
actualStartDate: new Date("2024-03-01"),
|
||||||
|
actualEndDate: new Date("2024-05-10"),
|
||||||
|
budget: 400000,
|
||||||
|
actualCost: 280000,
|
||||||
|
progress: 70,
|
||||||
|
milestones: 6,
|
||||||
|
completedMilestones: 4,
|
||||||
|
assignedTeams: [
|
||||||
|
mockMaintenanceTeams.find((t) => t.id === "1")!.name,
|
||||||
|
mockMaintenanceTeams.find((t) => t.id === "2")!.name,
|
||||||
|
],
|
||||||
|
deliverables: ["API Framework", "Veritabanı Şeması", "Güvenlik Modülü"],
|
||||||
|
risks: ["Performans sorunları", "Üçüncü parti entegrasyon gecikmeleri"],
|
||||||
|
category: "Development",
|
||||||
|
sequence: 0,
|
||||||
|
tasks: [],
|
||||||
|
isActive: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
code: "PH-003",
|
||||||
|
name: "Geliştirme - Faz 2",
|
||||||
|
description: "Frontend geliştirme ve kullanıcı arayüzleri",
|
||||||
|
projectId: "1",
|
||||||
|
project: mockProjects.find((p) => p.id === "1")!,
|
||||||
|
status: PhaseStatusEnum.NotStarted,
|
||||||
|
startDate: new Date("2024-04-15"),
|
||||||
|
endDate: new Date("2024-07-30"),
|
||||||
|
budget: 350000,
|
||||||
|
actualCost: 0,
|
||||||
|
progress: 0,
|
||||||
|
milestones: 5,
|
||||||
|
completedMilestones: 0,
|
||||||
|
assignedTeams: [
|
||||||
|
mockMaintenanceTeams.find((t) => t.id === "1")!.name,
|
||||||
|
mockMaintenanceTeams.find((t) => t.id === "2")!.name,
|
||||||
|
],
|
||||||
|
deliverables: [
|
||||||
|
"React Bileşenleri",
|
||||||
|
"Responsive Tasarım",
|
||||||
|
"Mobil Uyumluluk",
|
||||||
|
],
|
||||||
|
risks: ["Tarayıcı uyumluluk sorunları", "Performans optimizasyonu"],
|
||||||
|
category: "Development",
|
||||||
|
sequence: 0,
|
||||||
|
tasks: [],
|
||||||
|
isActive: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
code: "PH-004",
|
||||||
|
name: "Test ve Kalite Güvence",
|
||||||
|
description: "Kapsamlı test süreçleri ve kalite kontrolleri",
|
||||||
|
projectId: "2",
|
||||||
|
project: mockProjects.find((p) => p.id === "2")!,
|
||||||
|
status: PhaseStatusEnum.NotStarted,
|
||||||
|
startDate: new Date("2024-07-01"),
|
||||||
|
endDate: new Date("2024-09-15"),
|
||||||
|
budget: 120000,
|
||||||
|
actualCost: 0,
|
||||||
|
progress: 0,
|
||||||
|
milestones: 3,
|
||||||
|
completedMilestones: 0,
|
||||||
|
assignedTeams: [
|
||||||
|
mockMaintenanceTeams.find((t) => t.id === "3")!.name,
|
||||||
|
mockMaintenanceTeams.find((t) => t.id === "4")!.name,
|
||||||
|
],
|
||||||
|
deliverables: [
|
||||||
|
"Test Senaryoları",
|
||||||
|
"Otomatik Test Süitleri",
|
||||||
|
"Kalite Raporu",
|
||||||
|
],
|
||||||
|
risks: ["Kritik hataların geç tespit edilmesi"],
|
||||||
|
category: "Testing",
|
||||||
|
sequence: 0,
|
||||||
|
tasks: [],
|
||||||
|
isActive: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "5",
|
||||||
|
code: "PH-005",
|
||||||
|
name: "Deployment ve Go-Live",
|
||||||
|
description: "Üretime alma ve kullanıcı eğitimleri",
|
||||||
|
projectId: "2",
|
||||||
|
project: mockProjects.find((p) => p.id === "2")!,
|
||||||
|
status: PhaseStatusEnum.NotStarted,
|
||||||
|
startDate: new Date("2024-09-15"),
|
||||||
|
endDate: new Date("2024-10-31"),
|
||||||
|
budget: 80000,
|
||||||
|
actualCost: 0,
|
||||||
|
progress: 0,
|
||||||
|
milestones: 2,
|
||||||
|
completedMilestones: 0,
|
||||||
|
assignedTeams: [
|
||||||
|
mockMaintenanceTeams.find((t) => t.id === "2")!.name,
|
||||||
|
mockMaintenanceTeams.find((t) => t.id === "4")!.name,
|
||||||
|
],
|
||||||
|
deliverables: [
|
||||||
|
"Prodüksiyon Ortamı",
|
||||||
|
"Kullanıcı Eğitimleri",
|
||||||
|
"Dokümentasyon",
|
||||||
|
],
|
||||||
|
risks: ["Sistem kesintileri", "Kullanıcı adaptasyon sorunları"],
|
||||||
|
category: "Deployment",
|
||||||
|
sequence: 0,
|
||||||
|
tasks: [],
|
||||||
|
isActive: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "6",
|
||||||
|
code: "PH-006",
|
||||||
|
name: "Mobil UI Tasarımı",
|
||||||
|
description: "Mobil uygulama kullanıcı arayüzü tasarımı",
|
||||||
|
projectId: "2",
|
||||||
|
project: mockProjects.find((p) => p.id === "2")!,
|
||||||
|
status: PhaseStatusEnum.OnHold,
|
||||||
|
startDate: new Date("2024-03-01"),
|
||||||
|
endDate: new Date("2024-04-15"),
|
||||||
|
actualStartDate: new Date("2024-03-05"),
|
||||||
|
budget: 75000,
|
||||||
|
actualCost: 25000,
|
||||||
|
progress: 35,
|
||||||
|
milestones: 3,
|
||||||
|
completedMilestones: 1,
|
||||||
|
assignedTeams: [mockMaintenanceTeams.find((t) => t.id === "1")!.name],
|
||||||
|
deliverables: ["Wireframe'ler", "Mobil Tasarım Kılavuzu", "Prototype"],
|
||||||
|
risks: ["Platformlar arası tutarlılık sorunları"],
|
||||||
|
category: "Design",
|
||||||
|
sequence: 0,
|
||||||
|
tasks: [],
|
||||||
|
isActive: false,
|
||||||
|
},
|
||||||
|
];
|
||||||
158
ui/src/mocks/mockProjectTaskDailyUpdates.ts
Normal file
158
ui/src/mocks/mockProjectTaskDailyUpdates.ts
Normal file
|
|
@ -0,0 +1,158 @@
|
||||||
|
import {
|
||||||
|
PsTaskDailyUpdate,
|
||||||
|
WorkTypeEnum,
|
||||||
|
DailyUpdateStatusEnum,
|
||||||
|
} from "../types/ps";
|
||||||
|
import { mockEmployees } from "./mockEmployees";
|
||||||
|
import { mockProjectTasks } from "./mockProjectTasks";
|
||||||
|
|
||||||
|
export const mockProjectTaskDailyUpdates: PsTaskDailyUpdate[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
taskId: "1",
|
||||||
|
task: mockProjectTasks.find((t) => t.id === "1"),
|
||||||
|
employeeId: "1",
|
||||||
|
employee: mockEmployees.find((e) => e.id === "1"),
|
||||||
|
date: new Date("2024-12-05"),
|
||||||
|
hoursWorked: 6,
|
||||||
|
description:
|
||||||
|
"Backend API geliştirme işleri tamamlandı. User authentication servisleri oluşturuldu.",
|
||||||
|
workType: WorkTypeEnum.Development,
|
||||||
|
progress: 75,
|
||||||
|
challenges: "OAuth2 entegrasyonunda bazı sorunlar yaşandı",
|
||||||
|
nextSteps: "Token yenileme mekanizması geliştirilecek",
|
||||||
|
status: DailyUpdateStatusEnum.Submitted,
|
||||||
|
attachments: [],
|
||||||
|
creationTime: new Date("2024-12-05T17:30:00"),
|
||||||
|
lastModificationTime: new Date("2024-12-05T17:30:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
taskId: "1",
|
||||||
|
task: mockProjectTasks.find((t) => t.id === "1"),
|
||||||
|
employeeId: "1",
|
||||||
|
employee: mockEmployees.find((e) => e.id === "1"),
|
||||||
|
date: new Date("2024-12-04"),
|
||||||
|
hoursWorked: 7,
|
||||||
|
description: "Database şema tasarımı ve migration scriptleri hazırlandı.",
|
||||||
|
workType: WorkTypeEnum.Development,
|
||||||
|
progress: 60,
|
||||||
|
challenges: "Performans optimizasyonu için index stratejileri belirlendi",
|
||||||
|
nextSteps: "API endpoint'leri geliştirilmeye başlanacak",
|
||||||
|
status: DailyUpdateStatusEnum.Approved,
|
||||||
|
attachments: [],
|
||||||
|
creationTime: new Date("2024-12-04T18:00:00"),
|
||||||
|
lastModificationTime: new Date("2024-12-04T18:00:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
taskId: "2",
|
||||||
|
task: mockProjectTasks.find((t) => t.id === "2"),
|
||||||
|
employeeId: "2",
|
||||||
|
employee: mockEmployees.find((e) => e.id === "2"),
|
||||||
|
date: new Date("2024-12-05"),
|
||||||
|
hoursWorked: 4,
|
||||||
|
description: "API dokümantasyonu için swagger entegrasyonu yapıldı.",
|
||||||
|
workType: WorkTypeEnum.Documentation,
|
||||||
|
progress: 40,
|
||||||
|
challenges: "Mevcut API endpoint'lerinin belirlenmesi zaman aldı",
|
||||||
|
nextSteps: "Detaylı endpoint dokümantasyonu yazılacak",
|
||||||
|
status: DailyUpdateStatusEnum.Draft,
|
||||||
|
attachments: [],
|
||||||
|
creationTime: new Date("2024-12-05T16:45:00"),
|
||||||
|
lastModificationTime: new Date("2024-12-05T16:45:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
taskId: "3",
|
||||||
|
task: mockProjectTasks.find((t) => t.id === "3"),
|
||||||
|
employeeId: "3",
|
||||||
|
employee: mockEmployees.find((e) => e.id === "3"),
|
||||||
|
date: new Date("2024-12-05"),
|
||||||
|
hoursWorked: 5.5,
|
||||||
|
description:
|
||||||
|
"Frontend arayüz tasarımında kullanıcı deneyimi optimizasyonu yapıldı.",
|
||||||
|
workType: WorkTypeEnum.Design,
|
||||||
|
progress: 65,
|
||||||
|
challenges: "Responsive tasarım gereksinimlerinin belirlenmesi",
|
||||||
|
nextSteps: "Mobile uyumlu tasarım geliştirilecek",
|
||||||
|
status: DailyUpdateStatusEnum.Submitted,
|
||||||
|
attachments: [],
|
||||||
|
creationTime: new Date("2024-12-05T17:00:00"),
|
||||||
|
lastModificationTime: new Date("2024-12-05T17:00:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "5",
|
||||||
|
taskId: "4",
|
||||||
|
task: mockProjectTasks.find((t) => t.id === "4"),
|
||||||
|
employeeId: "4",
|
||||||
|
employee: mockEmployees.find((e) => e.id === "4"),
|
||||||
|
date: new Date("2024-12-05"),
|
||||||
|
hoursWorked: 3,
|
||||||
|
description:
|
||||||
|
"Unit test scenarioları oluşturuldu ve test coverage analizi yapıldı.",
|
||||||
|
workType: WorkTypeEnum.Testing,
|
||||||
|
progress: 30,
|
||||||
|
challenges: "Complex business logic için test senaryoları karmaşık",
|
||||||
|
nextSteps: "Integration testlere başlanacak",
|
||||||
|
status: DailyUpdateStatusEnum.Draft,
|
||||||
|
attachments: [],
|
||||||
|
creationTime: new Date("2024-12-05T15:20:00"),
|
||||||
|
lastModificationTime: new Date("2024-12-05T15:20:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "6",
|
||||||
|
taskId: "1",
|
||||||
|
task: mockProjectTasks.find((t) => t.id === "1"),
|
||||||
|
employeeId: "1",
|
||||||
|
employee: mockEmployees.find((e) => e.id === "1"),
|
||||||
|
date: new Date("2024-12-03"),
|
||||||
|
hoursWorked: 8,
|
||||||
|
description:
|
||||||
|
"Veritabanı tablolarının oluşturulması ve ilişkilerin kurulması tamamlandı.",
|
||||||
|
workType: WorkTypeEnum.Development,
|
||||||
|
progress: 45,
|
||||||
|
challenges: "Foreign key constraints'lerin optimize edilmesi gerekti",
|
||||||
|
nextSteps: "Stored procedure'lar yazılacak",
|
||||||
|
status: DailyUpdateStatusEnum.Approved,
|
||||||
|
attachments: [],
|
||||||
|
creationTime: new Date("2024-12-03T18:30:00"),
|
||||||
|
lastModificationTime: new Date("2024-12-03T18:30:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "7",
|
||||||
|
taskId: "2",
|
||||||
|
task: mockProjectTasks.find((t) => t.id === "2"),
|
||||||
|
employeeId: "2",
|
||||||
|
employee: mockEmployees.find((e) => e.id === "2"),
|
||||||
|
date: new Date("2024-12-04"),
|
||||||
|
hoursWorked: 6,
|
||||||
|
description: "REST API endpoint'lerinin dokümantasyonuna başlandı.",
|
||||||
|
workType: WorkTypeEnum.Documentation,
|
||||||
|
progress: 20,
|
||||||
|
challenges: "API specification'ların güncel olmama durumu",
|
||||||
|
nextSteps: "Developer'larla koordinasyon kurulacak",
|
||||||
|
status: DailyUpdateStatusEnum.Submitted,
|
||||||
|
attachments: [],
|
||||||
|
creationTime: new Date("2024-12-04T17:15:00"),
|
||||||
|
lastModificationTime: new Date("2024-12-04T17:15:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "8",
|
||||||
|
taskId: "5",
|
||||||
|
task: mockProjectTasks.find((t) => t.id === "5"),
|
||||||
|
employeeId: "5",
|
||||||
|
employee: mockEmployees.find((e) => e.id === "5"),
|
||||||
|
date: new Date("2024-12-05"),
|
||||||
|
hoursWorked: 7,
|
||||||
|
description: "Mobil uygulama için React Native setup'ı tamamlandı.",
|
||||||
|
workType: WorkTypeEnum.Development,
|
||||||
|
progress: 55,
|
||||||
|
challenges: "iOS ve Android build configuration farklılıkları",
|
||||||
|
nextSteps: "Navigation structure implementasyonu",
|
||||||
|
status: DailyUpdateStatusEnum.Approved,
|
||||||
|
attachments: [],
|
||||||
|
creationTime: new Date("2024-12-05T18:00:00"),
|
||||||
|
lastModificationTime: new Date("2024-12-05T18:00:00"),
|
||||||
|
},
|
||||||
|
];
|
||||||
85
ui/src/mocks/mockProjectTasks.ts
Normal file
85
ui/src/mocks/mockProjectTasks.ts
Normal file
|
|
@ -0,0 +1,85 @@
|
||||||
|
import { PriorityEnum } from "../types/common";
|
||||||
|
import { PsProjectTask, TaskStatusEnum, TaskTypeEnum } from "../types/ps";
|
||||||
|
import { mockEmployees } from "./mockEmployees";
|
||||||
|
import { mockProjectPhases } from "./mockProjectPhases";
|
||||||
|
|
||||||
|
export const mockProjectTasks: PsProjectTask[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
projectId: "1",
|
||||||
|
phaseId: "1",
|
||||||
|
phase: mockProjectPhases.find((phase) => phase.id === "1"),
|
||||||
|
taskCode: "TSK-001",
|
||||||
|
name: "Veritabanı Tasarımı",
|
||||||
|
description: "ERP sistemi için veritabanı şemasının tasarlanması",
|
||||||
|
taskType: TaskTypeEnum.Development,
|
||||||
|
status: TaskStatusEnum.InProgress,
|
||||||
|
priority: PriorityEnum.High,
|
||||||
|
assignedTo: "1",
|
||||||
|
assignee: mockEmployees.find((emp) => emp.id === "1"),
|
||||||
|
startDate: new Date("2024-01-15"),
|
||||||
|
endDate: new Date("2024-02-15"),
|
||||||
|
actualStartDate: new Date("2024-01-16"),
|
||||||
|
actualEndDate: undefined,
|
||||||
|
estimatedHours: 80,
|
||||||
|
actualHours: 45,
|
||||||
|
progress: 60,
|
||||||
|
activities: [],
|
||||||
|
comments: [],
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-01-10"),
|
||||||
|
lastModificationTime: new Date("2024-01-20"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
projectId: "1",
|
||||||
|
phaseId: "1",
|
||||||
|
phase: mockProjectPhases.find((phase) => phase.id === "1"),
|
||||||
|
taskCode: "TSK-002",
|
||||||
|
name: "API Dokümantasyonu",
|
||||||
|
description: "REST API endpoints dokümantasyonunun hazırlanması",
|
||||||
|
taskType: TaskTypeEnum.Documentation,
|
||||||
|
status: TaskStatusEnum.NotStarted,
|
||||||
|
priority: PriorityEnum.Normal,
|
||||||
|
assignedTo: "2",
|
||||||
|
assignee: mockEmployees.find((emp) => emp.id === "2"),
|
||||||
|
startDate: new Date("2024-02-01"),
|
||||||
|
endDate: new Date("2024-02-20"),
|
||||||
|
actualStartDate: undefined,
|
||||||
|
actualEndDate: undefined,
|
||||||
|
estimatedHours: 40,
|
||||||
|
actualHours: 0,
|
||||||
|
progress: 0,
|
||||||
|
activities: [],
|
||||||
|
comments: [],
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-01-25"),
|
||||||
|
lastModificationTime: new Date("2024-01-25"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
projectId: "2",
|
||||||
|
phaseId: "2",
|
||||||
|
phase: mockProjectPhases.find((phase) => phase.id === "2"),
|
||||||
|
taskCode: "TSK-003",
|
||||||
|
name: "Unit Test Yazımı",
|
||||||
|
description: "Backend servisler için unit testlerin yazılması",
|
||||||
|
taskType: TaskTypeEnum.Testing,
|
||||||
|
status: TaskStatusEnum.Completed,
|
||||||
|
priority: PriorityEnum.High,
|
||||||
|
assignedTo: "3",
|
||||||
|
assignee: mockEmployees.find((emp) => emp.id === "3"),
|
||||||
|
startDate: new Date("2024-01-20"),
|
||||||
|
endDate: new Date("2024-02-10"),
|
||||||
|
actualStartDate: new Date("2024-01-20"),
|
||||||
|
actualEndDate: new Date("2024-02-08"),
|
||||||
|
estimatedHours: 60,
|
||||||
|
actualHours: 58,
|
||||||
|
progress: 100,
|
||||||
|
activities: [],
|
||||||
|
comments: [],
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-02-08"),
|
||||||
|
},
|
||||||
|
];
|
||||||
233
ui/src/mocks/mockProjects.ts
Normal file
233
ui/src/mocks/mockProjects.ts
Normal file
|
|
@ -0,0 +1,233 @@
|
||||||
|
import { PriorityEnum } from "../types/common";
|
||||||
|
import {
|
||||||
|
PsDocumentTypeEnum,
|
||||||
|
PsProject,
|
||||||
|
ProjectStatusEnum,
|
||||||
|
ProjectTypeEnum,
|
||||||
|
RiskCategoryEnum,
|
||||||
|
RiskImpactEnum,
|
||||||
|
RiskLevelEnum,
|
||||||
|
RiskProbabilityEnum,
|
||||||
|
RiskStatusEnum,
|
||||||
|
} from "../types/ps";
|
||||||
|
import { mockBusinessParties } from "./mockBusinessParties";
|
||||||
|
import { mockEmployees } from "./mockEmployees";
|
||||||
|
|
||||||
|
export const mockProjects: PsProject[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
code: "PRJ-2024-001",
|
||||||
|
name: "ERP Sistemi Geliştirme",
|
||||||
|
description: "Kurumsal kaynak planlama sistemi geliştirilmesi",
|
||||||
|
projectType: ProjectTypeEnum.Internal,
|
||||||
|
status: ProjectStatusEnum.Active,
|
||||||
|
priority: PriorityEnum.High,
|
||||||
|
customerId: "6",
|
||||||
|
customer: mockBusinessParties.find((c) => c.id === "6"),
|
||||||
|
projectManagerId: "1",
|
||||||
|
projectManager: mockEmployees.find((e) => e.id === "1"),
|
||||||
|
startDate: new Date("2024-01-15"),
|
||||||
|
endDate: new Date("2024-12-31"),
|
||||||
|
actualStartDate: new Date("2024-01-20"),
|
||||||
|
actualEndDate: undefined,
|
||||||
|
budget: 500000,
|
||||||
|
actualCost: 250000,
|
||||||
|
currency: "TRY",
|
||||||
|
progress: 65,
|
||||||
|
phases: [],
|
||||||
|
tasks: [],
|
||||||
|
risks: [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
title: "Teknik Ekip Yetersizliği",
|
||||||
|
description:
|
||||||
|
"Projenin gerektirdiği teknik uzmanlığa sahip personel eksikliği",
|
||||||
|
probability: RiskProbabilityEnum.Medium,
|
||||||
|
status: RiskStatusEnum.Analyzing,
|
||||||
|
ownerId: "1",
|
||||||
|
identifiedDate: new Date("2024-01-20"),
|
||||||
|
mitigationPlan: "Eksternal danışman alımı planlanıyor",
|
||||||
|
projectId: "1",
|
||||||
|
riskCode: "005-TEKN",
|
||||||
|
category: RiskCategoryEnum.Technical,
|
||||||
|
impact: RiskImpactEnum.VeryLow,
|
||||||
|
riskLevel: RiskLevelEnum.Low,
|
||||||
|
identifiedBy: "",
|
||||||
|
isActive: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
title: "Bütçe Aşımı",
|
||||||
|
description:
|
||||||
|
"Beklenenden fazla kaynak kullanımı nedeniyle bütçe aşımı riski",
|
||||||
|
probability: RiskProbabilityEnum.Medium,
|
||||||
|
status: RiskStatusEnum.Analyzing,
|
||||||
|
ownerId: "2",
|
||||||
|
identifiedDate: new Date("2024-01-20"),
|
||||||
|
mitigationPlan: "Eksternal danışman alımı planlanıyor",
|
||||||
|
projectId: "1",
|
||||||
|
riskCode: "009-BUTC",
|
||||||
|
category: RiskCategoryEnum.Resource,
|
||||||
|
impact: RiskImpactEnum.Low,
|
||||||
|
riskLevel: RiskLevelEnum.Critical,
|
||||||
|
identifiedBy: "",
|
||||||
|
isActive: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
documents: [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
documentName: "Proje Teklifi.pdf",
|
||||||
|
documentType: PsDocumentTypeEnum.Design,
|
||||||
|
fileSize: 2.3,
|
||||||
|
uploadedAt: new Date("2024-01-15"),
|
||||||
|
uploadedBy: "Ali Öztürk",
|
||||||
|
filePath: "pdf",
|
||||||
|
projectId: "",
|
||||||
|
version: "",
|
||||||
|
isActive: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
documentName: "Gereksinim Analizi.docx",
|
||||||
|
documentType: PsDocumentTypeEnum.Report,
|
||||||
|
fileSize: 1.8,
|
||||||
|
uploadedAt: new Date("2024-01-15"),
|
||||||
|
uploadedBy: "Ayşe Kaya",
|
||||||
|
filePath: "docx",
|
||||||
|
projectId: "",
|
||||||
|
version: "",
|
||||||
|
isActive: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-01-10"),
|
||||||
|
lastModificationTime: new Date("2024-11-20"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
code: "PRJ-2024-002",
|
||||||
|
name: "Mobil Uygulama Geliştirme",
|
||||||
|
description: "iOS ve Android mobil uygulama geliştirilmesi",
|
||||||
|
projectType: ProjectTypeEnum.Customer,
|
||||||
|
status: ProjectStatusEnum.Planning,
|
||||||
|
priority: PriorityEnum.Normal,
|
||||||
|
customerId: "5",
|
||||||
|
customer: mockBusinessParties.find((c) => c.id === "5"),
|
||||||
|
projectManagerId: "2",
|
||||||
|
projectManager: mockEmployees.find((e) => e.id === "2"),
|
||||||
|
startDate: new Date("2024-03-01"),
|
||||||
|
endDate: new Date("2024-08-31"),
|
||||||
|
actualStartDate: undefined,
|
||||||
|
actualEndDate: undefined,
|
||||||
|
budget: 300000,
|
||||||
|
actualCost: 50000,
|
||||||
|
currency: "TRY",
|
||||||
|
progress: 15,
|
||||||
|
phases: [],
|
||||||
|
tasks: [],
|
||||||
|
risks: [
|
||||||
|
{
|
||||||
|
id: "r1",
|
||||||
|
description: "Teknoloji değişiklikleri",
|
||||||
|
impact: RiskImpactEnum.High,
|
||||||
|
probability: RiskProbabilityEnum.Medium,
|
||||||
|
mitigationPlan: "Düzenli eğitim ve güncellemeler",
|
||||||
|
projectId: "",
|
||||||
|
riskCode: "",
|
||||||
|
title: "",
|
||||||
|
category: RiskCategoryEnum.Technical,
|
||||||
|
riskLevel: RiskLevelEnum.Low,
|
||||||
|
status: RiskStatusEnum.Identified,
|
||||||
|
identifiedBy: "",
|
||||||
|
identifiedDate: new Date(),
|
||||||
|
isActive: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
documents: [
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
documentName: "UI Mockup.fig",
|
||||||
|
documentType: PsDocumentTypeEnum.Manual,
|
||||||
|
fileSize: 5.2,
|
||||||
|
uploadedAt: new Date("2024-02-20"),
|
||||||
|
uploadedBy: "Mehmet Demir",
|
||||||
|
filePath: "fig",
|
||||||
|
projectId: "",
|
||||||
|
version: "",
|
||||||
|
isActive: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
documentName: "Veritabanı Şeması.sql",
|
||||||
|
documentType: PsDocumentTypeEnum.Design,
|
||||||
|
fileSize: 1.2,
|
||||||
|
uploadedAt: new Date("2024-02-20"),
|
||||||
|
uploadedBy: "Mehmet Demir",
|
||||||
|
filePath: "fig",
|
||||||
|
projectId: "",
|
||||||
|
version: "",
|
||||||
|
isActive: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-02-15"),
|
||||||
|
lastModificationTime: new Date("2024-11-18"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
code: "PRJ-2024-003",
|
||||||
|
name: "Veri Merkezi Kurulumu",
|
||||||
|
description: "Yeni veri merkezi altyapısının kurulması",
|
||||||
|
projectType: ProjectTypeEnum.Development,
|
||||||
|
status: ProjectStatusEnum.Completed,
|
||||||
|
priority: PriorityEnum.High,
|
||||||
|
customerId: "6",
|
||||||
|
customer: mockBusinessParties.find((c) => c.id === "6"),
|
||||||
|
projectManagerId: "3",
|
||||||
|
projectManager: mockEmployees.find((e) => e.id === "3"),
|
||||||
|
startDate: new Date("2024-06-01"),
|
||||||
|
endDate: new Date("2024-10-31"),
|
||||||
|
actualStartDate: new Date("2024-06-05"),
|
||||||
|
actualEndDate: new Date("2024-10-28"),
|
||||||
|
budget: 800000,
|
||||||
|
actualCost: 750000,
|
||||||
|
currency: "TRY",
|
||||||
|
progress: 100,
|
||||||
|
phases: [],
|
||||||
|
tasks: [],
|
||||||
|
risks: [],
|
||||||
|
documents: [],
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-05-20"),
|
||||||
|
lastModificationTime: new Date("2024-10-28"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
code: "PRJ-2024-004",
|
||||||
|
name: "E-ticaret Platform Entegrasyonu",
|
||||||
|
description: "Mevcut sisteme e-ticaret platformu entegrasyonu",
|
||||||
|
projectType: ProjectTypeEnum.Customer,
|
||||||
|
status: ProjectStatusEnum.OnHold,
|
||||||
|
priority: PriorityEnum.Low,
|
||||||
|
customerId: "5",
|
||||||
|
customer: mockBusinessParties.find((c) => c.id === "5"),
|
||||||
|
projectManagerId: "4",
|
||||||
|
projectManager: mockEmployees.find((e) => e.id === "4"),
|
||||||
|
startDate: new Date("2024-09-01"),
|
||||||
|
endDate: new Date("2024-12-15"),
|
||||||
|
actualStartDate: undefined,
|
||||||
|
actualEndDate: undefined,
|
||||||
|
budget: 200000,
|
||||||
|
actualCost: 25000,
|
||||||
|
currency: "TRY",
|
||||||
|
progress: 10,
|
||||||
|
phases: [],
|
||||||
|
tasks: [],
|
||||||
|
risks: [],
|
||||||
|
documents: [],
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-08-15"),
|
||||||
|
lastModificationTime: new Date("2024-11-15"),
|
||||||
|
},
|
||||||
|
];
|
||||||
40
ui/src/mocks/mockPromissoryNotes.ts
Normal file
40
ui/src/mocks/mockPromissoryNotes.ts
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
import { NoteStatusEnum, NoteTypeEnum, PromissoryNote } from "../types/fi";
|
||||||
|
import { mockCurrentAccounts } from "./mockCurrentAccounts";
|
||||||
|
|
||||||
|
export const mockPromissoryNotes: PromissoryNote[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
noteNumber: "NOT-001",
|
||||||
|
type: NoteTypeEnum.Received,
|
||||||
|
drawerName: "Müşteri A.Ş.",
|
||||||
|
payeeName: "ABC Şirket",
|
||||||
|
issueDate: new Date("2024-01-20"),
|
||||||
|
dueDate: new Date("2024-03-20"),
|
||||||
|
amount: 50000,
|
||||||
|
currency: "TRY",
|
||||||
|
status: NoteStatusEnum.InHand,
|
||||||
|
location: "Ana Kasa",
|
||||||
|
currentAccountId: "1",
|
||||||
|
currentAccount: mockCurrentAccounts.find((acc) => acc.id === "1"),
|
||||||
|
creationTime: new Date("2024-01-20"),
|
||||||
|
lastModificationTime: new Date("2024-01-20"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
noteNumber: "NOT-002",
|
||||||
|
type: NoteTypeEnum.Issued,
|
||||||
|
drawerName: "ABC Şirket",
|
||||||
|
payeeName: "Kefil A.Ş.",
|
||||||
|
issueDate: new Date("2024-01-05"),
|
||||||
|
dueDate: new Date("2024-03-05"),
|
||||||
|
amount: 30000,
|
||||||
|
currency: "TRY",
|
||||||
|
status: NoteStatusEnum.Collected,
|
||||||
|
location: "Banka",
|
||||||
|
collectionDate: new Date("2024-01-25"),
|
||||||
|
currentAccountId: "2",
|
||||||
|
currentAccount: mockCurrentAccounts.find((acc) => acc.id === "2"),
|
||||||
|
creationTime: new Date("2024-01-05"),
|
||||||
|
lastModificationTime: new Date("2024-01-25"),
|
||||||
|
},
|
||||||
|
];
|
||||||
217
ui/src/mocks/mockPurchaseOrders.ts
Normal file
217
ui/src/mocks/mockPurchaseOrders.ts
Normal file
|
|
@ -0,0 +1,217 @@
|
||||||
|
import { PaymentTerms } from "../types/common";
|
||||||
|
import { OrderStatusEnum, MmPurchaseOrder, RequestTypeEnum } from "../types/mm";
|
||||||
|
import { mockMaterials } from "./mockMaterials";
|
||||||
|
import { mockBusinessParties } from "./mockBusinessParties";
|
||||||
|
|
||||||
|
export const mockPurchaseOrders: MmPurchaseOrder[] = [
|
||||||
|
{
|
||||||
|
id: "ORD001",
|
||||||
|
orderNumber: "SIP-2024-001",
|
||||||
|
supplierId: "1",
|
||||||
|
supplier: mockBusinessParties.find((s) => s.id === "1"),
|
||||||
|
orderDate: new Date("2024-01-20"),
|
||||||
|
deliveryDate: new Date("2024-02-03"),
|
||||||
|
status: OrderStatusEnum.Delivered,
|
||||||
|
paymentTerms: PaymentTerms.Net30,
|
||||||
|
currency: "TRY",
|
||||||
|
exchangeRate: 1,
|
||||||
|
subtotal: 125000,
|
||||||
|
taxAmount: 22500,
|
||||||
|
totalAmount: 147500,
|
||||||
|
deliveryAddress: {
|
||||||
|
street: "Atatürk Cad. No:10",
|
||||||
|
city: "İstanbul",
|
||||||
|
state: "İstanbul",
|
||||||
|
postalCode: "34000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
terms: "30 gün içinde ödeme yapılacaktır.",
|
||||||
|
notes: "Öncelikli sipariş - hızlı teslimat talep edildi.",
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
orderId: "ORD001",
|
||||||
|
materialId: "1",
|
||||||
|
material: mockMaterials.find((m) => m.id === "1"),
|
||||||
|
description: "Galvanizli çelik profil",
|
||||||
|
quantity: 100,
|
||||||
|
unit: "adet",
|
||||||
|
unitPrice: 850,
|
||||||
|
totalPrice: 85000,
|
||||||
|
deliveryDate: new Date("2024-02-03"),
|
||||||
|
receivedQuantity: 100,
|
||||||
|
deliveredQuantity: 100,
|
||||||
|
remainingQuantity: 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
orderId: "ORD001",
|
||||||
|
materialId: "2",
|
||||||
|
material: mockMaterials.find((m) => m.id === "2"),
|
||||||
|
description: "3.25mm kaynak elektrodu",
|
||||||
|
quantity: 200,
|
||||||
|
unit: "kg",
|
||||||
|
unitPrice: 200,
|
||||||
|
totalPrice: 40000,
|
||||||
|
deliveryDate: new Date("2024-02-03"),
|
||||||
|
receivedQuantity: 200,
|
||||||
|
deliveredQuantity: 200,
|
||||||
|
remainingQuantity: 0,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
receipts: [],
|
||||||
|
invoices: [],
|
||||||
|
creationTime: new Date("2024-01-20"),
|
||||||
|
lastModificationTime: new Date("2024-02-03"),
|
||||||
|
requestId: "REQ001",
|
||||||
|
requestTitle: "Üretim Malzemesi Talebi",
|
||||||
|
requestType: RequestTypeEnum.Material,
|
||||||
|
quotationId: "QUO001",
|
||||||
|
expectedDeliveryDate: new Date("2024-02-05"),
|
||||||
|
actualDeliveryDate: new Date("2024-02-03"),
|
||||||
|
deliveryTerms: "Fabrika teslimi",
|
||||||
|
attachments: ["siparis_formu.pdf", "teknik_sartname.pdf"],
|
||||||
|
approvedBy: "Ayşe Demir",
|
||||||
|
approvedAt: new Date("2024-01-20"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "ORD002",
|
||||||
|
orderNumber: "SIP-2024-002",
|
||||||
|
supplierId: "2",
|
||||||
|
supplier: mockBusinessParties.find((s) => s.id === "2"),
|
||||||
|
orderDate: new Date("2024-01-22"),
|
||||||
|
deliveryDate: new Date("2024-02-10"),
|
||||||
|
status: OrderStatusEnum.PartiallyDelivered,
|
||||||
|
paymentTerms: PaymentTerms.Net45,
|
||||||
|
currency: "TRY",
|
||||||
|
exchangeRate: 0,
|
||||||
|
subtotal: 0,
|
||||||
|
taxAmount: 0,
|
||||||
|
totalAmount: 280000,
|
||||||
|
deliveryAddress: {
|
||||||
|
street: "İnönü Mah. No:5",
|
||||||
|
city: "Ankara",
|
||||||
|
state: "Ankara",
|
||||||
|
postalCode: "06000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
terms: "45 gün içinde ödeme yapılacaktır.",
|
||||||
|
notes: "Kademeli teslimat yapılacak.",
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
orderId: "ORD002",
|
||||||
|
materialId: "3",
|
||||||
|
material: mockMaterials.find((m) => m.id === "3"),
|
||||||
|
description: "i7 işlemci, 16GB RAM, 512GB SSD",
|
||||||
|
quantity: 10,
|
||||||
|
unit: "adet",
|
||||||
|
unitPrice: 25000,
|
||||||
|
totalPrice: 250000,
|
||||||
|
deliveryDate: new Date("2024-02-08"),
|
||||||
|
receivedQuantity: 7,
|
||||||
|
deliveredQuantity: 7,
|
||||||
|
remainingQuantity: 3,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
orderId: "ORD002",
|
||||||
|
materialId: "4",
|
||||||
|
material: mockMaterials.find((m) => m.id === "4"),
|
||||||
|
description: '24" LED monitör',
|
||||||
|
quantity: 10,
|
||||||
|
unit: "adet",
|
||||||
|
unitPrice: 3000,
|
||||||
|
totalPrice: 30000,
|
||||||
|
deliveryDate: new Date("2024-02-10"),
|
||||||
|
receivedQuantity: 10,
|
||||||
|
deliveredQuantity: 10,
|
||||||
|
remainingQuantity: 0,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
receipts: [],
|
||||||
|
invoices: [],
|
||||||
|
creationTime: new Date("2024-01-22"),
|
||||||
|
lastModificationTime: new Date("2024-02-08"),
|
||||||
|
requestId: "REQ002",
|
||||||
|
requestTitle: "Bilgisayar Ekipmanları",
|
||||||
|
requestType: RequestTypeEnum.WorkCenter,
|
||||||
|
quotationId: "QUO002",
|
||||||
|
expectedDeliveryDate: new Date("2024-02-12"),
|
||||||
|
actualDeliveryDate: new Date("2024-02-08"),
|
||||||
|
deliveryTerms: "Ofis teslimi",
|
||||||
|
attachments: ["siparis_detay.pdf"],
|
||||||
|
approvedBy: "Murat Şen",
|
||||||
|
approvedAt: new Date("2024-01-22"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "ORD003",
|
||||||
|
orderNumber: "SIP-2024-003",
|
||||||
|
supplierId: "3",
|
||||||
|
supplier: mockBusinessParties.find((s) => s.id === "3"),
|
||||||
|
orderDate: new Date("2024-01-25"),
|
||||||
|
deliveryDate: new Date("2024-02-01"),
|
||||||
|
status: OrderStatusEnum.Confirmed,
|
||||||
|
paymentTerms: PaymentTerms.Prepaid,
|
||||||
|
currency: "TRY",
|
||||||
|
exchangeRate: 0,
|
||||||
|
subtotal: 0,
|
||||||
|
taxAmount: 0,
|
||||||
|
totalAmount: 85000,
|
||||||
|
deliveryAddress: {
|
||||||
|
street: "Hürriyet Cad. No:20",
|
||||||
|
city: "İzmir",
|
||||||
|
state: "İzmir",
|
||||||
|
postalCode: "35000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
terms: "Hizmet başlamadan önce ödeme yapılacaktır.",
|
||||||
|
notes: "6 aylık hizmet anlaşması.",
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
id: "5",
|
||||||
|
orderId: "ORD003",
|
||||||
|
materialId: "4",
|
||||||
|
material: mockMaterials.find((m) => m.id === "4"),
|
||||||
|
description: "Aylık makine bakım hizmeti",
|
||||||
|
quantity: 6,
|
||||||
|
unit: "ay",
|
||||||
|
unitPrice: 12000,
|
||||||
|
totalPrice: 72000,
|
||||||
|
deliveryDate: new Date("2024-02-01"),
|
||||||
|
receivedQuantity: 0,
|
||||||
|
deliveredQuantity: 0,
|
||||||
|
remainingQuantity: 6,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "6",
|
||||||
|
orderId: "ORD003",
|
||||||
|
materialId: "5",
|
||||||
|
material: mockMaterials.find((m) => m.id === "5"),
|
||||||
|
description: "Acil durum müdahale paketi",
|
||||||
|
quantity: 1,
|
||||||
|
unit: "paket",
|
||||||
|
unitPrice: 13000,
|
||||||
|
totalPrice: 13000,
|
||||||
|
deliveryDate: new Date("2024-02-01"),
|
||||||
|
receivedQuantity: 0,
|
||||||
|
deliveredQuantity: 0,
|
||||||
|
remainingQuantity: 1,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
receipts: [],
|
||||||
|
invoices: [],
|
||||||
|
creationTime: new Date("2024-01-25"),
|
||||||
|
lastModificationTime: new Date("2024-01-26"),
|
||||||
|
requestId: "REQ003",
|
||||||
|
requestTitle: "Makine Bakım Hizmeti",
|
||||||
|
requestType: RequestTypeEnum.Service,
|
||||||
|
quotationId: "QUO003",
|
||||||
|
expectedDeliveryDate: new Date("2024-02-01"),
|
||||||
|
actualDeliveryDate: new Date("2024-02-01"),
|
||||||
|
deliveryTerms: "Yerinde hizmet",
|
||||||
|
attachments: ["hizmet_sozlesmesi.pdf"],
|
||||||
|
approvedBy: "Can Demirtaş",
|
||||||
|
approvedAt: new Date("2024-01-25"),
|
||||||
|
},
|
||||||
|
];
|
||||||
190
ui/src/mocks/mockPurchaseRequests.ts
Normal file
190
ui/src/mocks/mockPurchaseRequests.ts
Normal file
|
|
@ -0,0 +1,190 @@
|
||||||
|
import { PriorityEnum } from "../types/common";
|
||||||
|
import {
|
||||||
|
ApprovalLevelEnum,
|
||||||
|
ApprovalStatusEnum,
|
||||||
|
MmPurchaseRequest,
|
||||||
|
RequestStatusEnum,
|
||||||
|
RequestTypeEnum,
|
||||||
|
} from "../types/mm";
|
||||||
|
|
||||||
|
export const mockPurchaseRequests: MmPurchaseRequest[] = [
|
||||||
|
{
|
||||||
|
id: "REQ001",
|
||||||
|
requestNumber: "PR-2024-001",
|
||||||
|
requestType: RequestTypeEnum.Material,
|
||||||
|
description: "Üretim için hammadde talebi",
|
||||||
|
department: "Üretim",
|
||||||
|
requestedBy: "Ali Veli",
|
||||||
|
requestDate: new Date("2024-08-01"),
|
||||||
|
requiredDate: new Date("2024-08-15"),
|
||||||
|
priority: PriorityEnum.High,
|
||||||
|
status: RequestStatusEnum.Approved,
|
||||||
|
totalAmount: 75000,
|
||||||
|
currency: "TRY",
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
id: "ITEM001",
|
||||||
|
requestId: "1",
|
||||||
|
materialId: "1",
|
||||||
|
quantity: 100,
|
||||||
|
unit: "KG",
|
||||||
|
estimatedPrice: 750,
|
||||||
|
specification: "Yüksek kalite çelik",
|
||||||
|
justification: "Üretim planı için gerekli",
|
||||||
|
isUrgent: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
approvals: [
|
||||||
|
{
|
||||||
|
id: "APP001",
|
||||||
|
requestId: "1",
|
||||||
|
approvalLevel: ApprovalLevelEnum.Supervisor,
|
||||||
|
approverUserId: "USR001",
|
||||||
|
approverName: "Mehmet Yılmaz",
|
||||||
|
approvalDate: new Date("2024-08-02"),
|
||||||
|
status: ApprovalStatusEnum.Approved,
|
||||||
|
comments: "Onaylandı",
|
||||||
|
sequence: 1,
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "APP002",
|
||||||
|
requestId: "1",
|
||||||
|
approvalLevel: ApprovalLevelEnum.Manager,
|
||||||
|
approverUserId: "USR002",
|
||||||
|
approverName: "Ayşe Demir",
|
||||||
|
approvalDate: new Date("2024-08-03"),
|
||||||
|
status: ApprovalStatusEnum.Approved,
|
||||||
|
sequence: 2,
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
attachments: [],
|
||||||
|
comments: [],
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "REQ002",
|
||||||
|
requestNumber: "PR-2024-002",
|
||||||
|
requestType: RequestTypeEnum.Service,
|
||||||
|
description: "Bakım hizmeti talebi",
|
||||||
|
department: "Bakım",
|
||||||
|
requestedBy: "Fatma Özkan",
|
||||||
|
requestDate: new Date("2024-08-05"),
|
||||||
|
requiredDate: new Date("2024-08-12"),
|
||||||
|
priority: PriorityEnum.Urgent,
|
||||||
|
status: RequestStatusEnum.InReview,
|
||||||
|
totalAmount: 25000,
|
||||||
|
currency: "TRY",
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
id: "ITEM002",
|
||||||
|
requestId: "2",
|
||||||
|
materialId: "2",
|
||||||
|
serviceDescription: "Kompresör bakım hizmeti",
|
||||||
|
quantity: 1,
|
||||||
|
unit: "ADET",
|
||||||
|
estimatedPrice: 25000,
|
||||||
|
specification: "Periyodik bakım",
|
||||||
|
justification: "Arıza önleme",
|
||||||
|
isUrgent: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
approvals: [
|
||||||
|
{
|
||||||
|
id: "APP003",
|
||||||
|
requestId: "2",
|
||||||
|
approvalLevel: ApprovalLevelEnum.Supervisor,
|
||||||
|
approverUserId: "USR003",
|
||||||
|
approverName: "Hasan Kaya",
|
||||||
|
status: ApprovalStatusEnum.Pending,
|
||||||
|
sequence: 1,
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
attachments: [],
|
||||||
|
comments: [],
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "REQ003",
|
||||||
|
requestNumber: "PR-2024-003",
|
||||||
|
requestType: RequestTypeEnum.WorkCenter,
|
||||||
|
description: "Yeni ekipman talebi",
|
||||||
|
department: "IT",
|
||||||
|
requestedBy: "Murat Şen",
|
||||||
|
requestDate: new Date("2024-08-10"),
|
||||||
|
requiredDate: new Date("2024-08-25"),
|
||||||
|
priority: PriorityEnum.Normal,
|
||||||
|
status: RequestStatusEnum.Draft,
|
||||||
|
totalAmount: 150000,
|
||||||
|
currency: "TRY",
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
id: "ITEM003",
|
||||||
|
requestId: "3",
|
||||||
|
materialId: "3",
|
||||||
|
serviceDescription: "Sunucu donanımı",
|
||||||
|
quantity: 2,
|
||||||
|
unit: "ADET",
|
||||||
|
estimatedPrice: 75000,
|
||||||
|
specification: "Dell PowerEdge R750",
|
||||||
|
justification: "Sistem kapasitesi artırımı",
|
||||||
|
isUrgent: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
approvals: [],
|
||||||
|
attachments: [],
|
||||||
|
comments: [],
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
requestNumber: "PR-2024-004",
|
||||||
|
requestType: RequestTypeEnum.Material,
|
||||||
|
description: "Ofis malzemeleri talebi",
|
||||||
|
department: "İdari İşler",
|
||||||
|
requestedBy: "Zeynep Akın",
|
||||||
|
requestDate: new Date("2024-08-12"),
|
||||||
|
requiredDate: new Date("2024-08-20"),
|
||||||
|
priority: PriorityEnum.Low,
|
||||||
|
status: RequestStatusEnum.Rejected,
|
||||||
|
totalAmount: 5000,
|
||||||
|
currency: "TRY",
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
id: "ITEM004",
|
||||||
|
requestId: "4",
|
||||||
|
materialId: "4",
|
||||||
|
serviceDescription: "Kırtasiye malzemeleri",
|
||||||
|
quantity: 1,
|
||||||
|
unit: "LOT",
|
||||||
|
estimatedPrice: 5000,
|
||||||
|
specification: "Çeşitli ofis malzemeleri",
|
||||||
|
justification: "Stok yenileme",
|
||||||
|
isUrgent: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
approvals: [
|
||||||
|
{
|
||||||
|
id: "APP004",
|
||||||
|
requestId: "4",
|
||||||
|
approvalLevel: ApprovalLevelEnum.Manager,
|
||||||
|
approverUserId: "USR004",
|
||||||
|
approverName: "Ahmet Yıldız",
|
||||||
|
approvalDate: new Date("2024-08-13"),
|
||||||
|
status: ApprovalStatusEnum.Rejected,
|
||||||
|
comments: "Bütçe yetersizliği",
|
||||||
|
sequence: 1,
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
attachments: [],
|
||||||
|
comments: [],
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
];
|
||||||
50
ui/src/mocks/mockPurchaseRequisitions.ts
Normal file
50
ui/src/mocks/mockPurchaseRequisitions.ts
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
import { PriorityEnum } from '@/types/common'
|
||||||
|
import { ApprovalStatusEnum, MmPurchaseRequisition, RequisitionStatusEnum } from '../types/mm'
|
||||||
|
|
||||||
|
export const mockPurchaseRequisitions: MmPurchaseRequisition[] = [
|
||||||
|
{
|
||||||
|
id: '1',
|
||||||
|
requisitionNumber: 'PR-2024-001',
|
||||||
|
requestedBy: 'Mehmet Özkan',
|
||||||
|
departmentId: 'PROD',
|
||||||
|
requestDate: new Date('2024-01-20'),
|
||||||
|
requiredDate: new Date('2024-02-15'),
|
||||||
|
priority: PriorityEnum.Normal,
|
||||||
|
status: RequisitionStatusEnum.InApproval,
|
||||||
|
description: 'Üretim hattı için çelik malzeme talebi',
|
||||||
|
justification: 'Mevcut stok seviyesi kritik seviyeye düştü',
|
||||||
|
totalAmount: 125000,
|
||||||
|
currency: 'TRY',
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
id: '1',
|
||||||
|
requisitionId: '1',
|
||||||
|
materialId: 'MAT-001',
|
||||||
|
description: 'Çelik Levha 2mm',
|
||||||
|
quantity: 500,
|
||||||
|
unitId: '1',
|
||||||
|
estimatedPrice: 250,
|
||||||
|
totalAmount: 125000,
|
||||||
|
requiredDate: new Date('2024-02-15'),
|
||||||
|
specifications: 'Kalınlık: 2mm, Genişlik: 1000mm',
|
||||||
|
budgetCode: 'PROD-2024-Q1',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
approvals: [
|
||||||
|
{
|
||||||
|
id: '1',
|
||||||
|
documentId: '1',
|
||||||
|
documentType: 'PurchaseRequisition',
|
||||||
|
approverUserId: 'manager1',
|
||||||
|
approverName: 'Ali Yılmaz',
|
||||||
|
approvalLevel: 1,
|
||||||
|
status: ApprovalStatusEnum.Approved,
|
||||||
|
comments: 'Onaylandı',
|
||||||
|
approvedAt: new Date('2024-01-21'),
|
||||||
|
creationTime: new Date('2024-01-21'),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
creationTime: new Date('2024-01-20'),
|
||||||
|
lastModificationTime: new Date('2024-01-21'),
|
||||||
|
},
|
||||||
|
]
|
||||||
124
ui/src/mocks/mockPutawayRules.ts
Normal file
124
ui/src/mocks/mockPutawayRules.ts
Normal file
|
|
@ -0,0 +1,124 @@
|
||||||
|
import {
|
||||||
|
ConditionOperatorEnum,
|
||||||
|
ConditionTypeEnum,
|
||||||
|
WmPutawayRule,
|
||||||
|
PutawayStrategyEnum,
|
||||||
|
} from "../types/wm";
|
||||||
|
|
||||||
|
export const mockPutawayRules: WmPutawayRule[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
code: "RULE001",
|
||||||
|
name: "Ağır Malzemeler",
|
||||||
|
description: "Ağır malzemeler için zemin seviye yerleştirme kuralı",
|
||||||
|
warehouseId: "1",
|
||||||
|
materialTypeId: "1",
|
||||||
|
materialGroupId: "2",
|
||||||
|
priority: 1,
|
||||||
|
conditions: [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
ruleId: "1",
|
||||||
|
conditionType: ConditionTypeEnum.Weight,
|
||||||
|
operator: ConditionOperatorEnum.GreaterThan,
|
||||||
|
value: "50",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
targetZoneId: "1",
|
||||||
|
targetLocationId: undefined,
|
||||||
|
strategy: PutawayStrategyEnum.NearestLocation,
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
code: "RULE002",
|
||||||
|
name: "Hızlı Hareket Eden Malzemeler",
|
||||||
|
description: "A sınıfı malzemeler için kolay erişim bölgesi",
|
||||||
|
warehouseId: "1",
|
||||||
|
materialTypeId: "2",
|
||||||
|
materialGroupId: "2",
|
||||||
|
priority: 2,
|
||||||
|
conditions: [
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
ruleId: "2",
|
||||||
|
conditionType: ConditionTypeEnum.MaterialGroup,
|
||||||
|
operator: ConditionOperatorEnum.Equals,
|
||||||
|
value: "A-Class",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
targetZoneId: "2",
|
||||||
|
targetLocationId: undefined,
|
||||||
|
strategy: PutawayStrategyEnum.NearestLocation,
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
code: "RULE003",
|
||||||
|
name: "FIFO Kuralı",
|
||||||
|
description: "Son kullanma tarihi olan malzemeler için FIFO",
|
||||||
|
warehouseId: "1",
|
||||||
|
materialTypeId: "3",
|
||||||
|
materialGroupId: "2",
|
||||||
|
priority: 3,
|
||||||
|
conditions: [
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
ruleId: "3",
|
||||||
|
conditionType: ConditionTypeEnum.MaterialType,
|
||||||
|
operator: ConditionOperatorEnum.Equals,
|
||||||
|
value: "Perishable",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
targetZoneId: "3",
|
||||||
|
targetLocationId: undefined,
|
||||||
|
strategy: PutawayStrategyEnum.FIFO,
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
code: "RULE004",
|
||||||
|
name: "Büyük Hacimli Malzemeler",
|
||||||
|
description: "Büyük hacimli malzemeler için özel alan",
|
||||||
|
warehouseId: "1",
|
||||||
|
materialTypeId: "2",
|
||||||
|
materialGroupId: "4",
|
||||||
|
priority: 4,
|
||||||
|
conditions: [
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
ruleId: "4",
|
||||||
|
conditionType: ConditionTypeEnum.Volume,
|
||||||
|
operator: ConditionOperatorEnum.GreaterThan,
|
||||||
|
value: "2",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
targetZoneId: "4",
|
||||||
|
targetLocationId: undefined,
|
||||||
|
strategy: PutawayStrategyEnum.EmptyLocation,
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "5",
|
||||||
|
code: "RULE005",
|
||||||
|
name: "Aynı Ürün Gruplaması",
|
||||||
|
description: "Aynı malzeme tiplerini birlikte yerleştirme",
|
||||||
|
warehouseId: "1",
|
||||||
|
materialTypeId: "2",
|
||||||
|
materialGroupId: "3",
|
||||||
|
priority: 5,
|
||||||
|
conditions: [
|
||||||
|
{
|
||||||
|
id: "5",
|
||||||
|
ruleId: "5",
|
||||||
|
conditionType: ConditionTypeEnum.MaterialType,
|
||||||
|
operator: ConditionOperatorEnum.Equals,
|
||||||
|
value: "Electronics",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
targetZoneId: "5",
|
||||||
|
targetLocationId: undefined,
|
||||||
|
strategy: PutawayStrategyEnum.SameProduct,
|
||||||
|
isActive: false,
|
||||||
|
},
|
||||||
|
];
|
||||||
198
ui/src/mocks/mockQuotations.ts
Normal file
198
ui/src/mocks/mockQuotations.ts
Normal file
|
|
@ -0,0 +1,198 @@
|
||||||
|
import { MmQuotation, QuotationStatusEnum, RequestTypeEnum } from "../types/mm";
|
||||||
|
import { mockBusinessParties } from "./mockBusinessParties";
|
||||||
|
|
||||||
|
export const mockQuotations: MmQuotation[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
quotationNumber: "TEK-2024-001",
|
||||||
|
supplierId: "1",
|
||||||
|
supplier: mockBusinessParties.find((s) => s.id === "1"),
|
||||||
|
requestId: "REQ001",
|
||||||
|
requestTitle: "Üretim Malzemesi Talebi",
|
||||||
|
requestType: RequestTypeEnum.Material,
|
||||||
|
quotationDate: new Date("2024-01-15"),
|
||||||
|
validUntil: new Date("2024-02-15"),
|
||||||
|
totalAmount: 125000,
|
||||||
|
currency: "TRY",
|
||||||
|
status: QuotationStatusEnum.Pending,
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
id: "ITM001",
|
||||||
|
materialCode: "MAL001",
|
||||||
|
materialName: "Çelik Profil 40x40",
|
||||||
|
description: "Galvanizli çelik profil",
|
||||||
|
quantity: 100,
|
||||||
|
unit: "adet",
|
||||||
|
unitPrice: 850,
|
||||||
|
totalPrice: 85000,
|
||||||
|
leadTime: 15,
|
||||||
|
specifications: ["Galvanizli", "EN 10025 standardında"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "ITM002",
|
||||||
|
materialCode: "MAL002",
|
||||||
|
materialName: "Kaynak Elektrodu",
|
||||||
|
description: "3.25mm kaynak elektrodu",
|
||||||
|
quantity: 200,
|
||||||
|
unit: "kg",
|
||||||
|
unitPrice: 200,
|
||||||
|
totalPrice: 40000,
|
||||||
|
leadTime: 7,
|
||||||
|
specifications: ["AWS E6013", "Rutubet dirençli"],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
deliveryTerms: "15 gün içinde teslim",
|
||||||
|
paymentTerms: "30 gün vadeli",
|
||||||
|
notes: "Toplu sipariş indirimi uygulanmıştır.",
|
||||||
|
attachments: [
|
||||||
|
{
|
||||||
|
id: "ATT001",
|
||||||
|
fileName: "teknik_sartname.pdf",
|
||||||
|
fileSize: 1024,
|
||||||
|
fileType: "application/pdf",
|
||||||
|
uploadedBy: "Mehmet Yılmaz",
|
||||||
|
uploadedAt: new Date("2024-01-15"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "ATT002",
|
||||||
|
fileName: "urun_katalogu.pdf",
|
||||||
|
fileSize: 2048,
|
||||||
|
fileType: "application/pdf",
|
||||||
|
uploadedBy: "Mehmet Yılmaz",
|
||||||
|
uploadedAt: new Date("2024-01-15"),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
submittedBy: "Mehmet Yılmaz",
|
||||||
|
submittedAt: new Date("2024-01-15"),
|
||||||
|
evaluatedBy: undefined,
|
||||||
|
evaluatedAt: undefined,
|
||||||
|
evaluationNotes: undefined,
|
||||||
|
creationTime: new Date("2024-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-15"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
quotationNumber: "TEK-2024-002",
|
||||||
|
supplierId: "2",
|
||||||
|
supplier: mockBusinessParties.find((s) => s.id === "2"),
|
||||||
|
requestId: "REQ002",
|
||||||
|
requestTitle: "Bilgisayar Ekipmanları",
|
||||||
|
requestType: RequestTypeEnum.WorkCenter,
|
||||||
|
quotationDate: new Date("2024-01-16"),
|
||||||
|
validUntil: new Date("2024-02-16"),
|
||||||
|
totalAmount: 280000,
|
||||||
|
currency: "TRY",
|
||||||
|
status: QuotationStatusEnum.Approved,
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
id: "ITM003",
|
||||||
|
materialCode: "EQP001",
|
||||||
|
materialName: "Masaüstü Bilgisayar",
|
||||||
|
description: "i7 işlemci, 16GB RAM, 512GB SSD",
|
||||||
|
quantity: 10,
|
||||||
|
unit: "adet",
|
||||||
|
unitPrice: 25000,
|
||||||
|
totalPrice: 250000,
|
||||||
|
leadTime: 21,
|
||||||
|
specifications: [
|
||||||
|
"Intel i7-12700",
|
||||||
|
"16GB DDR4",
|
||||||
|
"512GB NVMe SSD",
|
||||||
|
"Windows 11 Pro",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "ITM004",
|
||||||
|
materialCode: "EQP002",
|
||||||
|
materialName: "Monitör",
|
||||||
|
description: '24" LED monitör',
|
||||||
|
quantity: 10,
|
||||||
|
unit: "adet",
|
||||||
|
unitPrice: 3000,
|
||||||
|
totalPrice: 30000,
|
||||||
|
leadTime: 14,
|
||||||
|
specifications: ['24" Full HD', "IPS panel", "HDMI/DP girişi"],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
deliveryTerms: "21 gün içinde teslim",
|
||||||
|
paymentTerms: "45 gün vadeli",
|
||||||
|
notes: "2 yıl garanti dahil.",
|
||||||
|
attachments: [
|
||||||
|
{
|
||||||
|
id: "ATT003",
|
||||||
|
fileName: "teknik_ozellikler.pdf",
|
||||||
|
fileSize: 1536,
|
||||||
|
fileType: "application/pdf",
|
||||||
|
uploadedBy: "Ali Kaya",
|
||||||
|
uploadedAt: new Date("2024-01-16"),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
submittedBy: "Ali Kaya",
|
||||||
|
submittedAt: new Date("2024-01-16"),
|
||||||
|
evaluatedBy: "Ayşe Demir",
|
||||||
|
evaluatedAt: new Date("2024-01-18"),
|
||||||
|
evaluationNotes: "Teknik özellikler uygun, fiyat makul.",
|
||||||
|
creationTime: new Date("2024-01-16"),
|
||||||
|
lastModificationTime: new Date("2024-01-18"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
quotationNumber: "TEK-2024-003",
|
||||||
|
supplierId: "3",
|
||||||
|
supplier: mockBusinessParties.find((s) => s.id === "3"),
|
||||||
|
requestId: "REQ003",
|
||||||
|
requestTitle: "Bakım Hizmetleri",
|
||||||
|
requestType: RequestTypeEnum.Service,
|
||||||
|
quotationDate: new Date("2024-01-17"),
|
||||||
|
validUntil: new Date("2024-02-17"),
|
||||||
|
totalAmount: 95000,
|
||||||
|
currency: "TRY",
|
||||||
|
status: QuotationStatusEnum.Rejected,
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
id: "ITM005",
|
||||||
|
materialCode: "SRV001",
|
||||||
|
materialName: "Preventif Bakım",
|
||||||
|
description: "Aylık preventif bakım hizmeti",
|
||||||
|
quantity: 12,
|
||||||
|
unit: "ay",
|
||||||
|
unitPrice: 7500,
|
||||||
|
totalPrice: 90000,
|
||||||
|
leadTime: 0,
|
||||||
|
specifications: ["24/7 destek", "Aylık rapor", "Yedek parça dahil"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "ITM006",
|
||||||
|
materialCode: "SRV002",
|
||||||
|
materialName: "Acil Müdahale",
|
||||||
|
description: "Acil durum müdahale hizmeti",
|
||||||
|
quantity: 1,
|
||||||
|
unit: "paket",
|
||||||
|
unitPrice: 5000,
|
||||||
|
totalPrice: 5000,
|
||||||
|
leadTime: 0,
|
||||||
|
specifications: ["2 saat içinde müdahale", "Hafta sonu dahil"],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
deliveryTerms: "Hemen başlanabilir",
|
||||||
|
paymentTerms: "Aylık ödeme",
|
||||||
|
notes: "Yıllık anlaşma için %10 indirim.",
|
||||||
|
attachments: [
|
||||||
|
{
|
||||||
|
id: "ATT004",
|
||||||
|
fileName: "hizmet_detaylari.pdf",
|
||||||
|
fileSize: 768,
|
||||||
|
fileType: "application/pdf",
|
||||||
|
uploadedBy: "Fatma Özkan",
|
||||||
|
uploadedAt: new Date("2024-01-17"),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
submittedBy: "Fatma Özkan",
|
||||||
|
submittedAt: new Date("2024-01-17"),
|
||||||
|
evaluatedBy: "Murat Şen",
|
||||||
|
evaluatedAt: new Date("2024-01-20"),
|
||||||
|
evaluationNotes: "Fiyat yüksek, alternatif teklif aranacak.",
|
||||||
|
creationTime: new Date("2024-01-17"),
|
||||||
|
lastModificationTime: new Date("2024-01-20"),
|
||||||
|
},
|
||||||
|
];
|
||||||
29
ui/src/mocks/mockRecentActivities.ts
Normal file
29
ui/src/mocks/mockRecentActivities.ts
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
export const mockRecentActivities = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
type: "material_received",
|
||||||
|
title: "Malzeme Girişi",
|
||||||
|
description: "MAT-001 - Çelik Levha 500 KG alındı",
|
||||||
|
timestamp: new Date("2024-01-20T10:30:00"),
|
||||||
|
user: "Mehmet Özkan",
|
||||||
|
status: "completed",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
type: "maintenance_scheduled",
|
||||||
|
title: "Bakım Planlandı",
|
||||||
|
description: "EQP-005 - Tornezgah için periyodik bakım",
|
||||||
|
timestamp: new Date("2024-01-20T09:15:00"),
|
||||||
|
user: "Ali Yılmaz",
|
||||||
|
status: "pending",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
type: "order_created",
|
||||||
|
title: "Sipariş Oluşturuldu",
|
||||||
|
description: "PO-2024-025 - Motor satınalma siparişi",
|
||||||
|
timestamp: new Date("2024-01-20T08:45:00"),
|
||||||
|
user: "Ayşe Kaya",
|
||||||
|
status: "processing",
|
||||||
|
},
|
||||||
|
];
|
||||||
675
ui/src/mocks/mockSalesOrders.ts
Normal file
675
ui/src/mocks/mockSalesOrders.ts
Normal file
|
|
@ -0,0 +1,675 @@
|
||||||
|
import { PaymentTerms } from "../types/common";
|
||||||
|
import {
|
||||||
|
CrmSalesOrder,
|
||||||
|
SaleOrderStatusEnum,
|
||||||
|
SaleOrderItemStatusEnum,
|
||||||
|
} from "../types/crm";
|
||||||
|
import { mockBusinessParties } from "./mockBusinessParties";
|
||||||
|
import { mockMaterials } from "./mockMaterials";
|
||||||
|
|
||||||
|
export const mockSalesOrders: CrmSalesOrder[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
orderNumber: "ORD-2024-001",
|
||||||
|
customerId: "6", // Teknoloji A.Ş.
|
||||||
|
customer: mockBusinessParties.find((c) => c.id === "6"),
|
||||||
|
orderDate: new Date("2024-08-15"),
|
||||||
|
requestedDeliveryDate: new Date("2024-09-15"),
|
||||||
|
confirmedDeliveryDate: new Date("2024-09-14"),
|
||||||
|
status: SaleOrderStatusEnum.Delivered,
|
||||||
|
subtotal: 125000,
|
||||||
|
taxAmount: 22500,
|
||||||
|
discountAmount: 6250,
|
||||||
|
totalAmount: 141250,
|
||||||
|
currency: "TRY",
|
||||||
|
paymentTerms: PaymentTerms.Net30,
|
||||||
|
deliveryAddress: {
|
||||||
|
street: "Teknoloji Caddesi No:100",
|
||||||
|
city: "İstanbul",
|
||||||
|
state: "İstanbul",
|
||||||
|
postalCode: "34000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
billingAddress: {
|
||||||
|
street: "Teknoloji Caddesi No:100",
|
||||||
|
city: "İstanbul",
|
||||||
|
state: "İstanbul",
|
||||||
|
postalCode: "34000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
id: "soi_1",
|
||||||
|
orderId: "so_1",
|
||||||
|
materialId: "1",
|
||||||
|
material: mockMaterials.find((m) => m.id === "1"),
|
||||||
|
description: "Yüksek Kaliteli Çelik Levha 10mm",
|
||||||
|
quantity: 500,
|
||||||
|
deliveredQuantity: 500,
|
||||||
|
unitId: "LT",
|
||||||
|
unit: mockMaterials.find((m) => m.id === "LT"),
|
||||||
|
unitPrice: 18.75,
|
||||||
|
totalAmount: 9375,
|
||||||
|
requestedDate: new Date("2024-09-15"),
|
||||||
|
confirmedDate: new Date("2024-09-14"),
|
||||||
|
status: SaleOrderItemStatusEnum.Delivered,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "soi_2",
|
||||||
|
orderId: "so_1",
|
||||||
|
materialId: "2",
|
||||||
|
material: mockMaterials.find((m) => m.id === "2"),
|
||||||
|
description: "Alüminyum Profil 40x40mm",
|
||||||
|
quantity: 1000,
|
||||||
|
deliveredQuantity: 1000,
|
||||||
|
unitId: "pcs",
|
||||||
|
unit: mockMaterials.find((m) => m.id === "pcs"),
|
||||||
|
unitPrice: 12.5,
|
||||||
|
totalAmount: 12500,
|
||||||
|
requestedDate: new Date("2024-09-15"),
|
||||||
|
confirmedDate: new Date("2024-09-14"),
|
||||||
|
status: SaleOrderItemStatusEnum.Delivered,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
deliveries: [],
|
||||||
|
invoices: [],
|
||||||
|
creationTime: new Date("2024-08-15"),
|
||||||
|
lastModificationTime: new Date("2024-08-16"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
orderNumber: "ORD-2024-002",
|
||||||
|
customerId: "5", // Üretim Sanayi Ltd.
|
||||||
|
customer: mockBusinessParties.find((c) => c.id === "5"),
|
||||||
|
orderDate: new Date("2024-08-20"),
|
||||||
|
requestedDeliveryDate: new Date("2024-09-20"),
|
||||||
|
confirmedDeliveryDate: new Date("2024-09-18"),
|
||||||
|
status: SaleOrderStatusEnum.Shipped,
|
||||||
|
subtotal: 85000,
|
||||||
|
taxAmount: 15300,
|
||||||
|
discountAmount: 4250,
|
||||||
|
totalAmount: 96050,
|
||||||
|
currency: "TRY",
|
||||||
|
paymentTerms: PaymentTerms.Net60,
|
||||||
|
deliveryAddress: {
|
||||||
|
street: "Sanayi Sitesi 5. Cadde No:23",
|
||||||
|
city: "Bursa",
|
||||||
|
state: "Bursa",
|
||||||
|
postalCode: "16000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
billingAddress: {
|
||||||
|
street: "Sanayi Sitesi 5. Cadde No:23",
|
||||||
|
city: "Bursa",
|
||||||
|
state: "Bursa",
|
||||||
|
postalCode: "16000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
id: "soi_3",
|
||||||
|
orderId: "so_2",
|
||||||
|
materialId: "3",
|
||||||
|
material: mockMaterials.find((m) => m.id === "3"),
|
||||||
|
description: "Plastik Granül PVC",
|
||||||
|
quantity: 2000,
|
||||||
|
deliveredQuantity: 2000,
|
||||||
|
unitId: "ADET",
|
||||||
|
unit: mockMaterials.find((m) => m.id === "ADET"),
|
||||||
|
unitPrice: 8.5,
|
||||||
|
totalAmount: 17000,
|
||||||
|
requestedDate: new Date("2024-09-20"),
|
||||||
|
confirmedDate: new Date("2024-09-18"),
|
||||||
|
status: SaleOrderItemStatusEnum.Shipped,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "soi_4",
|
||||||
|
orderId: "so_2",
|
||||||
|
materialId: "4",
|
||||||
|
material: mockMaterials.find((m) => m.id === "4"),
|
||||||
|
description: "Endüstriyel Yapıştırıcı",
|
||||||
|
quantity: 50,
|
||||||
|
deliveredQuantity: 50,
|
||||||
|
unitId: "ADET",
|
||||||
|
unit: mockMaterials.find((m) => m.id === "ADET"),
|
||||||
|
unitPrice: 125.0,
|
||||||
|
totalAmount: 6250,
|
||||||
|
requestedDate: new Date("2024-09-20"),
|
||||||
|
confirmedDate: new Date("2024-09-18"),
|
||||||
|
status: SaleOrderItemStatusEnum.Shipped,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
deliveries: [],
|
||||||
|
invoices: [],
|
||||||
|
creationTime: new Date("2024-08-20"),
|
||||||
|
lastModificationTime: new Date("2024-08-21"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
orderNumber: "ORD-2024-003",
|
||||||
|
customerId: "6", // Otomotiv Parça A.Ş.
|
||||||
|
customer: mockBusinessParties.find((c) => c.id === "6"),
|
||||||
|
orderDate: new Date("2024-08-25"),
|
||||||
|
requestedDeliveryDate: new Date("2024-09-25"),
|
||||||
|
confirmedDeliveryDate: new Date("2024-09-25"),
|
||||||
|
status: SaleOrderStatusEnum.InProduction,
|
||||||
|
subtotal: 175000,
|
||||||
|
taxAmount: 31500,
|
||||||
|
discountAmount: 8750,
|
||||||
|
totalAmount: 197750,
|
||||||
|
currency: "TRY",
|
||||||
|
paymentTerms: PaymentTerms.Net30,
|
||||||
|
deliveryAddress: {
|
||||||
|
street: "OSB 1. Cadde No:45",
|
||||||
|
city: "Kocaeli",
|
||||||
|
state: "Kocaeli",
|
||||||
|
postalCode: "41000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
billingAddress: {
|
||||||
|
street: "OSB 1. Cadde No:45",
|
||||||
|
city: "Kocaeli",
|
||||||
|
state: "Kocaeli",
|
||||||
|
postalCode: "41000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
id: "soi_5",
|
||||||
|
orderId: "so_3",
|
||||||
|
materialId: "1",
|
||||||
|
material: mockMaterials.find((m) => m.id === "1"),
|
||||||
|
description: "Motor Yağı 10W-40",
|
||||||
|
quantity: 500,
|
||||||
|
deliveredQuantity: 0,
|
||||||
|
unitId: "ADET",
|
||||||
|
unit: mockMaterials.find((m) => m.id === "ADET"),
|
||||||
|
unitPrice: 45.0,
|
||||||
|
totalAmount: 22500,
|
||||||
|
requestedDate: new Date("2024-09-25"),
|
||||||
|
confirmedDate: new Date("2024-09-25"),
|
||||||
|
status: SaleOrderItemStatusEnum.InProduction,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "soi_6",
|
||||||
|
orderId: "so_3",
|
||||||
|
materialId: "2",
|
||||||
|
material: mockMaterials.find((m) => m.id === "2"),
|
||||||
|
description: "Fren Balata Seti",
|
||||||
|
quantity: 200,
|
||||||
|
deliveredQuantity: 0,
|
||||||
|
unitId: "ADET",
|
||||||
|
unit: mockMaterials.find((m) => m.id === "ADET"),
|
||||||
|
unitPrice: 85.0,
|
||||||
|
totalAmount: 17000,
|
||||||
|
requestedDate: new Date("2024-09-25"),
|
||||||
|
confirmedDate: new Date("2024-09-25"),
|
||||||
|
status: SaleOrderItemStatusEnum.InProduction,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
deliveries: [],
|
||||||
|
invoices: [],
|
||||||
|
creationTime: new Date("2024-08-25"),
|
||||||
|
lastModificationTime: new Date("2024-08-26"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
orderNumber: "ORD-2024-004",
|
||||||
|
customerId: "6", // Teknoloji A.Ş.
|
||||||
|
customer: mockBusinessParties.find((c) => c.id === "6"),
|
||||||
|
orderDate: new Date("2024-09-01"),
|
||||||
|
requestedDeliveryDate: new Date("2024-10-01"),
|
||||||
|
confirmedDeliveryDate: new Date("2024-09-30"),
|
||||||
|
status: SaleOrderStatusEnum.Confirmed,
|
||||||
|
subtotal: 95000,
|
||||||
|
taxAmount: 17100,
|
||||||
|
discountAmount: 4750,
|
||||||
|
totalAmount: 107350,
|
||||||
|
currency: "TRY",
|
||||||
|
paymentTerms: PaymentTerms.Net30,
|
||||||
|
deliveryAddress: {
|
||||||
|
street: "Teknoloji Caddesi No:100",
|
||||||
|
city: "İstanbul",
|
||||||
|
state: "İstanbul",
|
||||||
|
postalCode: "34000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
billingAddress: {
|
||||||
|
street: "Teknoloji Caddesi No:100",
|
||||||
|
city: "İstanbul",
|
||||||
|
state: "İstanbul",
|
||||||
|
postalCode: "34000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
id: "soi_7",
|
||||||
|
orderId: "so_4",
|
||||||
|
materialId: "4",
|
||||||
|
material: mockMaterials.find((m) => m.id === "4"),
|
||||||
|
description: "Elektronik Kart",
|
||||||
|
quantity: 100,
|
||||||
|
deliveredQuantity: 0,
|
||||||
|
unitId: "PAKET",
|
||||||
|
unit: mockMaterials.find((m) => m.id === "PAKET"),
|
||||||
|
unitPrice: 150.0,
|
||||||
|
totalAmount: 15000,
|
||||||
|
requestedDate: new Date("2024-10-01"),
|
||||||
|
confirmedDate: new Date("2024-09-30"),
|
||||||
|
status: SaleOrderItemStatusEnum.Confirmed,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "soi_8",
|
||||||
|
orderId: "so_4",
|
||||||
|
materialId: "2",
|
||||||
|
material: mockMaterials.find((m) => m.id === "2"),
|
||||||
|
description: "Kablo Demeti",
|
||||||
|
quantity: 250,
|
||||||
|
deliveredQuantity: 0,
|
||||||
|
unitId: "PAKET",
|
||||||
|
unit: mockMaterials.find((m) => m.id === "PAKET"),
|
||||||
|
unitPrice: 25.0,
|
||||||
|
totalAmount: 6250,
|
||||||
|
requestedDate: new Date("2024-10-01"),
|
||||||
|
confirmedDate: new Date("2024-09-30"),
|
||||||
|
status: SaleOrderItemStatusEnum.Confirmed,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
deliveries: [],
|
||||||
|
invoices: [],
|
||||||
|
creationTime: new Date("2024-09-01"),
|
||||||
|
lastModificationTime: new Date("2024-09-02"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "5",
|
||||||
|
orderNumber: "ORD-2024-005",
|
||||||
|
customerId: "6", // Üretim Sanayi Ltd.
|
||||||
|
customer: mockBusinessParties.find((c) => c.id === "6"),
|
||||||
|
orderDate: new Date("2024-09-05"),
|
||||||
|
requestedDeliveryDate: new Date("2024-10-05"),
|
||||||
|
confirmedDeliveryDate: new Date("2024-10-03"),
|
||||||
|
status: SaleOrderStatusEnum.Ready,
|
||||||
|
subtotal: 65000,
|
||||||
|
taxAmount: 11700,
|
||||||
|
discountAmount: 3250,
|
||||||
|
totalAmount: 73450,
|
||||||
|
currency: "TRY",
|
||||||
|
paymentTerms: PaymentTerms.Net60,
|
||||||
|
deliveryAddress: {
|
||||||
|
street: "Sanayi Sitesi 5. Cadde No:23",
|
||||||
|
city: "Bursa",
|
||||||
|
state: "Bursa",
|
||||||
|
postalCode: "16000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
billingAddress: {
|
||||||
|
street: "Sanayi Sitesi 5. Cadde No:23",
|
||||||
|
city: "Bursa",
|
||||||
|
state: "Bursa",
|
||||||
|
postalCode: "16000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
id: "soi_9",
|
||||||
|
orderId: "so_5",
|
||||||
|
materialId: "3",
|
||||||
|
material: mockMaterials.find((m) => m.id === "3"),
|
||||||
|
description: "Rulman 6205",
|
||||||
|
quantity: 100,
|
||||||
|
deliveredQuantity: 100,
|
||||||
|
unitId: "KOLI",
|
||||||
|
unit: mockMaterials.find((m) => m.id === "KOLI"),
|
||||||
|
unitPrice: 35.0,
|
||||||
|
totalAmount: 3500,
|
||||||
|
requestedDate: new Date("2024-10-05"),
|
||||||
|
confirmedDate: new Date("2024-10-03"),
|
||||||
|
status: SaleOrderItemStatusEnum.Ready,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "soi_10",
|
||||||
|
orderId: "so_5",
|
||||||
|
materialId: "5",
|
||||||
|
material: mockMaterials.find((m) => m.id === "5"),
|
||||||
|
description: "Kayış V-Tipi",
|
||||||
|
quantity: 50,
|
||||||
|
deliveredQuantity: 50,
|
||||||
|
unitId: "KOLI",
|
||||||
|
unit: mockMaterials.find((m) => m.id === "KOLI"),
|
||||||
|
unitPrice: 45.0,
|
||||||
|
totalAmount: 2250,
|
||||||
|
requestedDate: new Date("2024-10-05"),
|
||||||
|
confirmedDate: new Date("2024-10-03"),
|
||||||
|
status: SaleOrderItemStatusEnum.Ready,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
deliveries: [],
|
||||||
|
invoices: [],
|
||||||
|
creationTime: new Date("2024-09-05"),
|
||||||
|
lastModificationTime: new Date("2024-09-06"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "6",
|
||||||
|
orderNumber: "ORD-2024-006",
|
||||||
|
customerId: "5", // Otomotiv Parça A.Ş.
|
||||||
|
customer: mockBusinessParties.find((c) => c.id === "5"),
|
||||||
|
orderDate: new Date("2024-09-10"),
|
||||||
|
requestedDeliveryDate: new Date("2024-10-10"),
|
||||||
|
confirmedDeliveryDate: undefined,
|
||||||
|
status: SaleOrderStatusEnum.Draft,
|
||||||
|
subtotal: 45000,
|
||||||
|
taxAmount: 8100,
|
||||||
|
discountAmount: 2250,
|
||||||
|
totalAmount: 50850,
|
||||||
|
currency: "TRY",
|
||||||
|
paymentTerms: PaymentTerms.Net30,
|
||||||
|
deliveryAddress: {
|
||||||
|
street: "OSB 1. Cadde No:45",
|
||||||
|
city: "Kocaeli",
|
||||||
|
state: "Kocaeli",
|
||||||
|
postalCode: "41000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
billingAddress: {
|
||||||
|
street: "OSB 1. Cadde No:45",
|
||||||
|
city: "Kocaeli",
|
||||||
|
state: "Kocaeli",
|
||||||
|
postalCode: "41000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
id: "soi_11",
|
||||||
|
orderId: "so_6",
|
||||||
|
materialId: "1",
|
||||||
|
material: mockMaterials.find((m) => m.id === "1"),
|
||||||
|
description: "Lastik 205/55R16",
|
||||||
|
quantity: 20,
|
||||||
|
deliveredQuantity: 0,
|
||||||
|
unitId: "MT",
|
||||||
|
unit: mockMaterials.find((m) => m.id === "MT"),
|
||||||
|
unitPrice: 450.0,
|
||||||
|
totalAmount: 9000,
|
||||||
|
requestedDate: new Date("2024-10-10"),
|
||||||
|
confirmedDate: undefined,
|
||||||
|
status: SaleOrderItemStatusEnum.Pending,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
deliveries: [],
|
||||||
|
invoices: [],
|
||||||
|
creationTime: new Date("2024-09-10"),
|
||||||
|
lastModificationTime: new Date("2024-09-10"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "7",
|
||||||
|
orderNumber: "ORD-2024-007",
|
||||||
|
customerId: "5", // Teknoloji A.Ş.
|
||||||
|
customer: mockBusinessParties.find((c) => c.id === "5"),
|
||||||
|
orderDate: new Date("2024-08-10"),
|
||||||
|
requestedDeliveryDate: new Date("2024-09-10"),
|
||||||
|
confirmedDeliveryDate: new Date("2024-09-05"),
|
||||||
|
status: SaleOrderStatusEnum.Cancelled,
|
||||||
|
subtotal: 25000,
|
||||||
|
taxAmount: 4500,
|
||||||
|
discountAmount: 1250,
|
||||||
|
totalAmount: 28250,
|
||||||
|
currency: "TRY",
|
||||||
|
paymentTerms: PaymentTerms.Net30,
|
||||||
|
deliveryAddress: {
|
||||||
|
street: "Teknoloji Caddesi No:100",
|
||||||
|
city: "İstanbul",
|
||||||
|
state: "İstanbul",
|
||||||
|
postalCode: "34000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
billingAddress: {
|
||||||
|
street: "Teknoloji Caddesi No:100",
|
||||||
|
city: "İstanbul",
|
||||||
|
state: "İstanbul",
|
||||||
|
postalCode: "34000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
id: "soi_12",
|
||||||
|
orderId: "so_7",
|
||||||
|
materialId: "2",
|
||||||
|
material: mockMaterials.find((m) => m.id === "2"),
|
||||||
|
description: "Güç Kaynağı 500W",
|
||||||
|
quantity: 25,
|
||||||
|
deliveredQuantity: 0,
|
||||||
|
unitId: "MT",
|
||||||
|
unit: mockMaterials.find((m) => m.id === "MT"),
|
||||||
|
unitPrice: 200.0,
|
||||||
|
totalAmount: 5000,
|
||||||
|
requestedDate: new Date("2024-09-10"),
|
||||||
|
confirmedDate: new Date("2024-09-05"),
|
||||||
|
status: SaleOrderItemStatusEnum.Pending,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
deliveries: [],
|
||||||
|
invoices: [],
|
||||||
|
creationTime: new Date("2024-08-10"),
|
||||||
|
lastModificationTime: new Date("2024-08-15"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "8",
|
||||||
|
orderNumber: "ORD-2024-008",
|
||||||
|
customerId: "5", // Üretim Sanayi Ltd.
|
||||||
|
customer: mockBusinessParties.find((c) => c.id === "5"),
|
||||||
|
orderDate: new Date("2024-09-12"),
|
||||||
|
requestedDeliveryDate: new Date("2024-10-12"),
|
||||||
|
confirmedDeliveryDate: new Date("2024-10-10"),
|
||||||
|
status: SaleOrderStatusEnum.InProduction,
|
||||||
|
subtotal: 135000,
|
||||||
|
taxAmount: 24300,
|
||||||
|
discountAmount: 6750,
|
||||||
|
totalAmount: 152550,
|
||||||
|
currency: "TRY",
|
||||||
|
paymentTerms: PaymentTerms.Net60,
|
||||||
|
deliveryAddress: {
|
||||||
|
street: "Sanayi Sitesi 5. Cadde No:23",
|
||||||
|
city: "Bursa",
|
||||||
|
state: "Bursa",
|
||||||
|
postalCode: "16000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
billingAddress: {
|
||||||
|
street: "Sanayi Sitesi 5. Cadde No:23",
|
||||||
|
city: "Bursa",
|
||||||
|
state: "Bursa",
|
||||||
|
postalCode: "16000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
id: "soi_13",
|
||||||
|
orderId: "so_8",
|
||||||
|
materialId: "3",
|
||||||
|
material: mockMaterials.find((m) => m.id === "3"),
|
||||||
|
description: "Hidrolik Silindir",
|
||||||
|
quantity: 10,
|
||||||
|
deliveredQuantity: 0,
|
||||||
|
unitId: "MT",
|
||||||
|
unit: mockMaterials.find((m) => m.id === "MT"),
|
||||||
|
unitPrice: 850.0,
|
||||||
|
totalAmount: 8500,
|
||||||
|
requestedDate: new Date("2024-10-12"),
|
||||||
|
confirmedDate: new Date("2024-10-10"),
|
||||||
|
status: SaleOrderItemStatusEnum.InProduction,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "soi_14",
|
||||||
|
orderId: "so_8",
|
||||||
|
materialId: "4",
|
||||||
|
material: mockMaterials.find((m) => m.id === "4"),
|
||||||
|
description: "Hidrolik Hortum 2m",
|
||||||
|
quantity: 50,
|
||||||
|
deliveredQuantity: 0,
|
||||||
|
unitId: "M3",
|
||||||
|
unit: mockMaterials.find((m) => m.id === "M3"),
|
||||||
|
unitPrice: 75.0,
|
||||||
|
totalAmount: 3750,
|
||||||
|
requestedDate: new Date("2024-10-12"),
|
||||||
|
confirmedDate: new Date("2024-10-10"),
|
||||||
|
status: SaleOrderItemStatusEnum.InProduction,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
deliveries: [],
|
||||||
|
invoices: [],
|
||||||
|
creationTime: new Date("2024-09-12"),
|
||||||
|
lastModificationTime: new Date("2024-09-13"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "9",
|
||||||
|
orderNumber: "ORD-2024-009",
|
||||||
|
customerId: "6", // Otomotiv Parça A.Ş.
|
||||||
|
customer: mockBusinessParties.find((c) => c.id === "6"),
|
||||||
|
orderDate: new Date("2024-09-15"),
|
||||||
|
requestedDeliveryDate: new Date("2024-10-15"),
|
||||||
|
confirmedDeliveryDate: new Date("2024-10-12"),
|
||||||
|
status: SaleOrderStatusEnum.Confirmed,
|
||||||
|
subtotal: 185000,
|
||||||
|
taxAmount: 33300,
|
||||||
|
discountAmount: 9250,
|
||||||
|
totalAmount: 209050,
|
||||||
|
currency: "TRY",
|
||||||
|
paymentTerms: PaymentTerms.Net30,
|
||||||
|
deliveryAddress: {
|
||||||
|
street: "OSB 1. Cadde No:45",
|
||||||
|
city: "Kocaeli",
|
||||||
|
state: "Kocaeli",
|
||||||
|
postalCode: "41000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
billingAddress: {
|
||||||
|
street: "OSB 1. Cadde No:45",
|
||||||
|
city: "Kocaeli",
|
||||||
|
state: "Kocaeli",
|
||||||
|
postalCode: "41000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
id: "soi_15",
|
||||||
|
orderId: "so_9",
|
||||||
|
materialId: "5",
|
||||||
|
material: mockMaterials.find((m) => m.id === "5"),
|
||||||
|
description: "Amortisör Ön Sol",
|
||||||
|
quantity: 100,
|
||||||
|
deliveredQuantity: 0,
|
||||||
|
unitId: "M3",
|
||||||
|
unit: mockMaterials.find((m) => m.id === "M3"),
|
||||||
|
unitPrice: 320.0,
|
||||||
|
totalAmount: 32000,
|
||||||
|
requestedDate: new Date("2024-10-15"),
|
||||||
|
confirmedDate: new Date("2024-10-12"),
|
||||||
|
status: SaleOrderItemStatusEnum.Confirmed,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "soi_16",
|
||||||
|
orderId: "so_9",
|
||||||
|
materialId: "1",
|
||||||
|
material: mockMaterials.find((m) => m.id === "1"),
|
||||||
|
description: "Amortisör Ön Sağ",
|
||||||
|
quantity: 100,
|
||||||
|
deliveredQuantity: 0,
|
||||||
|
unitId: "M2",
|
||||||
|
unit: mockMaterials.find((m) => m.id === "M2"),
|
||||||
|
unitPrice: 320.0,
|
||||||
|
totalAmount: 32000,
|
||||||
|
requestedDate: new Date("2024-10-15"),
|
||||||
|
confirmedDate: new Date("2024-10-12"),
|
||||||
|
status: SaleOrderItemStatusEnum.Confirmed,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
deliveries: [],
|
||||||
|
invoices: [],
|
||||||
|
creationTime: new Date("2024-09-15"),
|
||||||
|
lastModificationTime: new Date("2024-09-16"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "10",
|
||||||
|
orderNumber: "ORD-2024-010",
|
||||||
|
customerId: "6", // Teknoloji A.Ş.
|
||||||
|
customer: mockBusinessParties.find((c) => c.id === "6"),
|
||||||
|
orderDate: new Date("2024-09-18"),
|
||||||
|
requestedDeliveryDate: new Date("2024-10-18"),
|
||||||
|
confirmedDeliveryDate: new Date("2024-10-15"),
|
||||||
|
status: SaleOrderStatusEnum.Confirmed,
|
||||||
|
subtotal: 275000,
|
||||||
|
taxAmount: 49500,
|
||||||
|
discountAmount: 13750,
|
||||||
|
totalAmount: 310750,
|
||||||
|
currency: "TRY",
|
||||||
|
paymentTerms: PaymentTerms.Net30,
|
||||||
|
deliveryAddress: {
|
||||||
|
street: "Teknoloji Caddesi No:100",
|
||||||
|
city: "İstanbul",
|
||||||
|
state: "İstanbul",
|
||||||
|
postalCode: "34000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
billingAddress: {
|
||||||
|
street: "Teknoloji Caddesi No:100",
|
||||||
|
city: "İstanbul",
|
||||||
|
state: "İstanbul",
|
||||||
|
postalCode: "34000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
id: "soi_17",
|
||||||
|
orderId: "so_10",
|
||||||
|
materialId: "3",
|
||||||
|
material: mockMaterials.find((m) => m.id === "3"),
|
||||||
|
description: "Server Bilgisayar",
|
||||||
|
quantity: 5,
|
||||||
|
deliveredQuantity: 0,
|
||||||
|
unitId: "M2",
|
||||||
|
unit: mockMaterials.find((m) => m.id === "M2"),
|
||||||
|
unitPrice: 12500.0,
|
||||||
|
totalAmount: 62500,
|
||||||
|
requestedDate: new Date("2024-10-18"),
|
||||||
|
confirmedDate: new Date("2024-10-15"),
|
||||||
|
status: SaleOrderItemStatusEnum.Confirmed,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "soi_18",
|
||||||
|
orderId: "so_10",
|
||||||
|
materialId: "2",
|
||||||
|
material: mockMaterials.find((m) => m.id === "2"),
|
||||||
|
description: "Network Switch 48 Port",
|
||||||
|
quantity: 10,
|
||||||
|
deliveredQuantity: 0,
|
||||||
|
unitId: "M2",
|
||||||
|
unit: mockMaterials.find((m) => m.id === "M2"),
|
||||||
|
unitPrice: 2500.0,
|
||||||
|
totalAmount: 25000,
|
||||||
|
requestedDate: new Date("2024-10-18"),
|
||||||
|
confirmedDate: new Date("2024-10-15"),
|
||||||
|
status: SaleOrderItemStatusEnum.Confirmed,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "soi_19",
|
||||||
|
orderId: "so_10",
|
||||||
|
materialId: "4",
|
||||||
|
material: mockMaterials.find((m) => m.id === "4"),
|
||||||
|
description: "UPS 5KVA",
|
||||||
|
quantity: 3,
|
||||||
|
deliveredQuantity: 0,
|
||||||
|
unitId: "M2",
|
||||||
|
unit: mockMaterials.find((m) => m.id === "M2"),
|
||||||
|
unitPrice: 4500.0,
|
||||||
|
totalAmount: 13500,
|
||||||
|
requestedDate: new Date("2024-10-18"),
|
||||||
|
confirmedDate: new Date("2024-10-15"),
|
||||||
|
status: SaleOrderItemStatusEnum.Confirmed,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
deliveries: [],
|
||||||
|
invoices: [],
|
||||||
|
creationTime: new Date("2024-09-18"),
|
||||||
|
lastModificationTime: new Date("2024-09-19"),
|
||||||
|
},
|
||||||
|
];
|
||||||
241
ui/src/mocks/mockSalesTeams.ts
Normal file
241
ui/src/mocks/mockSalesTeams.ts
Normal file
|
|
@ -0,0 +1,241 @@
|
||||||
|
import { Team, TeamRoleEnum } from "../types/common";
|
||||||
|
import { TargetTypeEnum, TargetStatusEnum } from "../types/crm";
|
||||||
|
import { mockEmployees } from "./mockEmployees";
|
||||||
|
|
||||||
|
export const mockSalesTeams: Team[] = [
|
||||||
|
{
|
||||||
|
id: "team-001",
|
||||||
|
code: "ST-001",
|
||||||
|
name: "Kurumsal Satış Ekibi",
|
||||||
|
description:
|
||||||
|
"Büyük kurumsal müşteriler ve enterprise çözümler için satış ekibi",
|
||||||
|
managerId: "1",
|
||||||
|
manager: mockEmployees.find((emp) => emp.id === "1"),
|
||||||
|
members: [
|
||||||
|
{
|
||||||
|
id: "member-001",
|
||||||
|
teamId: "team-001",
|
||||||
|
employeeId: "2",
|
||||||
|
employee: mockEmployees.find((emp) => emp.id === "2"),
|
||||||
|
role: TeamRoleEnum.Lead,
|
||||||
|
joinDate: new Date("2024-01-15"),
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "member-002",
|
||||||
|
teamId: "team-001",
|
||||||
|
employeeId: "3",
|
||||||
|
employee: mockEmployees.find((emp) => emp.id === "3"),
|
||||||
|
role: TeamRoleEnum.Member,
|
||||||
|
joinDate: new Date("2024-02-01"),
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "member-003",
|
||||||
|
teamId: "team-001",
|
||||||
|
employeeId: "4",
|
||||||
|
employee: mockEmployees.find((emp) => emp.id === "4"),
|
||||||
|
role: TeamRoleEnum.Member,
|
||||||
|
joinDate: new Date("2024-03-10"),
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
territories: [
|
||||||
|
{
|
||||||
|
id: "territory-001",
|
||||||
|
territoryCode: "TR-IST",
|
||||||
|
name: "İstanbul Anadolu",
|
||||||
|
description: "İstanbul Anadolu yakası kurumsal müşteriler",
|
||||||
|
region: "Marmara",
|
||||||
|
countries: ["Türkiye"],
|
||||||
|
cities: ["İstanbul"],
|
||||||
|
assignedTeamId: "team-001",
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "territory-002",
|
||||||
|
territoryCode: "TR-ANK",
|
||||||
|
name: "Ankara",
|
||||||
|
description: "Ankara bölgesi kurumsal müşteriler",
|
||||||
|
region: "İç Anadolu",
|
||||||
|
countries: ["Türkiye"],
|
||||||
|
cities: ["Ankara"],
|
||||||
|
assignedTeamId: "team-001",
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
targets: [
|
||||||
|
{
|
||||||
|
id: "target-001",
|
||||||
|
teamId: "team-001",
|
||||||
|
targetPeriod: "2024-Q4",
|
||||||
|
targetType: TargetTypeEnum.Revenue,
|
||||||
|
targetValue: 5000000,
|
||||||
|
actualValue: 4200000,
|
||||||
|
currency: "TRY",
|
||||||
|
startDate: new Date("2024-10-01"),
|
||||||
|
endDate: new Date("2024-12-31"),
|
||||||
|
status: TargetStatusEnum.Active,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-01-01"),
|
||||||
|
lastModificationTime: new Date("2024-11-01"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "team-002",
|
||||||
|
code: "ST-002",
|
||||||
|
name: "KOBİ Satış Ekibi",
|
||||||
|
description: "Küçük ve orta boy işletmeler için satış ekibi",
|
||||||
|
managerId: "5",
|
||||||
|
manager: mockEmployees.find((emp) => emp.id === "5"),
|
||||||
|
members: [
|
||||||
|
{
|
||||||
|
id: "member-004",
|
||||||
|
teamId: "team-002",
|
||||||
|
employeeId: "6",
|
||||||
|
employee: mockEmployees.find((emp) => emp.id === "6"),
|
||||||
|
role: TeamRoleEnum.Lead,
|
||||||
|
joinDate: new Date("2024-01-20"),
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "member-005",
|
||||||
|
teamId: "team-002",
|
||||||
|
employeeId: "7",
|
||||||
|
employee: mockEmployees.find((emp) => emp.id === "7"),
|
||||||
|
role: TeamRoleEnum.Member,
|
||||||
|
joinDate: new Date("2024-02-15"),
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "member-006",
|
||||||
|
teamId: "team-002",
|
||||||
|
employeeId: "8",
|
||||||
|
employee: mockEmployees.find((emp) => emp.id === "8"),
|
||||||
|
role: TeamRoleEnum.Member,
|
||||||
|
joinDate: new Date("2024-04-01"),
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "member-007",
|
||||||
|
teamId: "team-002",
|
||||||
|
employeeId: "9",
|
||||||
|
employee: mockEmployees.find((emp) => emp.id === "9"),
|
||||||
|
role: TeamRoleEnum.Member,
|
||||||
|
joinDate: new Date("2024-05-15"),
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
territories: [
|
||||||
|
{
|
||||||
|
id: "territory-003",
|
||||||
|
territoryCode: "TR-IZM",
|
||||||
|
name: "İzmir",
|
||||||
|
description: "İzmir bölgesi KOBİ müşteriler",
|
||||||
|
region: "Ege",
|
||||||
|
countries: ["Türkiye"],
|
||||||
|
cities: ["İzmir", "Manisa", "Balıkesir"],
|
||||||
|
assignedTeamId: "team-002",
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "territory-004",
|
||||||
|
territoryCode: "TR-BUR",
|
||||||
|
name: "Bursa",
|
||||||
|
description: "Bursa ve çevre iller KOBİ müşteriler",
|
||||||
|
region: "Marmara",
|
||||||
|
countries: ["Türkiye"],
|
||||||
|
cities: ["Bursa", "Kocaeli", "Sakarya"],
|
||||||
|
assignedTeamId: "team-002",
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
targets: [
|
||||||
|
{
|
||||||
|
id: "target-002",
|
||||||
|
teamId: "team-002",
|
||||||
|
targetPeriod: "2024-Q4",
|
||||||
|
targetType: TargetTypeEnum.Revenue,
|
||||||
|
targetValue: 3000000,
|
||||||
|
actualValue: 3150000,
|
||||||
|
currency: "TRY",
|
||||||
|
startDate: new Date("2024-10-01"),
|
||||||
|
endDate: new Date("2024-12-31"),
|
||||||
|
status: TargetStatusEnum.Active,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-01-05"),
|
||||||
|
lastModificationTime: new Date("2024-10-15"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "team-003",
|
||||||
|
code: "ST-003",
|
||||||
|
name: "E-ticaret Satış Ekibi",
|
||||||
|
description: "Online satış kanalları ve e-ticaret platformları yönetimi",
|
||||||
|
managerId: "10",
|
||||||
|
manager: mockEmployees.find((emp) => emp.id === "10"),
|
||||||
|
members: [
|
||||||
|
{
|
||||||
|
id: "member-008",
|
||||||
|
teamId: "team-003",
|
||||||
|
employeeId: "1",
|
||||||
|
employee: mockEmployees.find((emp) => emp.id === "1"),
|
||||||
|
role: TeamRoleEnum.Lead,
|
||||||
|
joinDate: new Date("2024-03-01"),
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "member-009",
|
||||||
|
teamId: "team-003",
|
||||||
|
employeeId: "2",
|
||||||
|
employee: mockEmployees.find((emp) => emp.id === "2"),
|
||||||
|
role: TeamRoleEnum.Member,
|
||||||
|
joinDate: new Date("2024-03-15"),
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "member-010",
|
||||||
|
teamId: "team-003",
|
||||||
|
employeeId: "3",
|
||||||
|
employee: mockEmployees.find((emp) => emp.id === "3"),
|
||||||
|
role: TeamRoleEnum.Member,
|
||||||
|
joinDate: new Date("2024-04-10"),
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
territories: [
|
||||||
|
{
|
||||||
|
id: "territory-005",
|
||||||
|
territoryCode: "TR-ONL",
|
||||||
|
name: "Online Türkiye",
|
||||||
|
description: "Türkiye geneli online satış kanalları",
|
||||||
|
region: "Online",
|
||||||
|
countries: ["Türkiye"],
|
||||||
|
cities: [],
|
||||||
|
assignedTeamId: "team-003",
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
targets: [
|
||||||
|
{
|
||||||
|
id: "target-003",
|
||||||
|
teamId: "team-003",
|
||||||
|
targetPeriod: "2024-Q4",
|
||||||
|
targetType: TargetTypeEnum.Revenue,
|
||||||
|
targetValue: 2000000,
|
||||||
|
actualValue: 1800000,
|
||||||
|
currency: "TRY",
|
||||||
|
startDate: new Date("2024-10-01"),
|
||||||
|
endDate: new Date("2024-12-31"),
|
||||||
|
status: TargetStatusEnum.Active,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2024-02-15"),
|
||||||
|
lastModificationTime: new Date("2024-11-05"),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export default mockSalesTeams;
|
||||||
40
ui/src/mocks/mockSerialNumbers.ts
Normal file
40
ui/src/mocks/mockSerialNumbers.ts
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
import { SerialStatusEnum } from "../types/mm";
|
||||||
|
import { mockMaterials } from "./mockMaterials";
|
||||||
|
|
||||||
|
export const mockSerialNumbers = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
materialId: "1",
|
||||||
|
material: mockMaterials.find((m) => m.id === "1"),
|
||||||
|
serialNumber: "SN2024001",
|
||||||
|
lotId: "1",
|
||||||
|
productionDate: new Date("2024-01-01"),
|
||||||
|
warrantyExpiryDate: new Date("2026-01-01"),
|
||||||
|
currentLocationId: "LOC-A01",
|
||||||
|
status: SerialStatusEnum.Available,
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
materialId: "2",
|
||||||
|
material: mockMaterials.find((m) => m.id === "2"),
|
||||||
|
serialNumber: "SN2024002",
|
||||||
|
lotId: "1",
|
||||||
|
productionDate: new Date("2024-01-02"),
|
||||||
|
warrantyExpiryDate: new Date("2026-01-02"),
|
||||||
|
currentLocationId: "LOC-A02",
|
||||||
|
status: SerialStatusEnum.InUse,
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
materialId: "3",
|
||||||
|
material: mockMaterials.find((m) => m.id === "3"),
|
||||||
|
serialNumber: "SN2024003",
|
||||||
|
productionDate: new Date("2024-01-03"),
|
||||||
|
warrantyExpiryDate: new Date("2025-01-03"),
|
||||||
|
currentLocationId: "LOC-B01",
|
||||||
|
status: SerialStatusEnum.Maintenance,
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
95
ui/src/mocks/mockStockItems.ts
Normal file
95
ui/src/mocks/mockStockItems.ts
Normal file
|
|
@ -0,0 +1,95 @@
|
||||||
|
import { WmStockItem, StockStatusEnum } from "../types/wm";
|
||||||
|
import { mockMaterials } from "./mockMaterials";
|
||||||
|
|
||||||
|
export const mockStockItems: WmStockItem[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
materialId: "1",
|
||||||
|
material: mockMaterials.find((mat) => mat.id === "1"),
|
||||||
|
warehouseId: "1",
|
||||||
|
zoneId: "1",
|
||||||
|
locationId: "3",
|
||||||
|
quantity: 50,
|
||||||
|
reservedQuantity: 10,
|
||||||
|
availableQuantity: 40,
|
||||||
|
unitId: "adet",
|
||||||
|
lotNumber: "LOT2024001",
|
||||||
|
serialNumber: undefined,
|
||||||
|
expiryDate: undefined,
|
||||||
|
receivedDate: new Date("2024-10-15"),
|
||||||
|
lastMovementDate: new Date("2024-11-15"),
|
||||||
|
status: StockStatusEnum.Available,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
materialId: "2",
|
||||||
|
material: mockMaterials.find((mat) => mat.id === "2"),
|
||||||
|
warehouseId: "1",
|
||||||
|
zoneId: "2",
|
||||||
|
locationId: "4",
|
||||||
|
quantity: 25,
|
||||||
|
reservedQuantity: 5,
|
||||||
|
availableQuantity: 20,
|
||||||
|
unitId: "metre",
|
||||||
|
lotNumber: "LOT2024002",
|
||||||
|
serialNumber: undefined,
|
||||||
|
expiryDate: undefined,
|
||||||
|
receivedDate: new Date("2024-11-01"),
|
||||||
|
lastMovementDate: new Date("2024-11-20"),
|
||||||
|
status: StockStatusEnum.Available,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
materialId: "3",
|
||||||
|
material: mockMaterials.find((mat) => mat.id === "3"),
|
||||||
|
warehouseId: "1",
|
||||||
|
zoneId: "2",
|
||||||
|
locationId: "1",
|
||||||
|
quantity: 150,
|
||||||
|
reservedQuantity: 0,
|
||||||
|
availableQuantity: 150,
|
||||||
|
unitId: "adet",
|
||||||
|
lotNumber: "LOT2024003",
|
||||||
|
serialNumber: undefined,
|
||||||
|
expiryDate: undefined,
|
||||||
|
receivedDate: new Date("2024-09-20"),
|
||||||
|
lastMovementDate: new Date("2024-10-25"),
|
||||||
|
status: StockStatusEnum.Available,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
materialId: "4",
|
||||||
|
material: mockMaterials.find((mat) => mat.id === "4"),
|
||||||
|
warehouseId: "1",
|
||||||
|
zoneId: "2",
|
||||||
|
locationId: "2",
|
||||||
|
quantity: 30,
|
||||||
|
reservedQuantity: 8,
|
||||||
|
availableQuantity: 22,
|
||||||
|
unitId: "adet",
|
||||||
|
lotNumber: "LOT2024004",
|
||||||
|
serialNumber: undefined,
|
||||||
|
expiryDate: undefined,
|
||||||
|
receivedDate: new Date("2024-08-10"),
|
||||||
|
lastMovementDate: new Date("2024-11-18"),
|
||||||
|
status: StockStatusEnum.Available,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "5",
|
||||||
|
materialId: "5",
|
||||||
|
material: mockMaterials.find((mat) => mat.id === "5"),
|
||||||
|
warehouseId: "1",
|
||||||
|
zoneId: "1",
|
||||||
|
locationId: "2",
|
||||||
|
quantity: 5,
|
||||||
|
reservedQuantity: 0,
|
||||||
|
availableQuantity: 0,
|
||||||
|
unitId: "adet",
|
||||||
|
lotNumber: "LOT2024005",
|
||||||
|
serialNumber: undefined,
|
||||||
|
expiryDate: undefined,
|
||||||
|
receivedDate: new Date("2024-11-25"),
|
||||||
|
lastMovementDate: new Date("2024-11-25"),
|
||||||
|
status: StockStatusEnum.Quarantine,
|
||||||
|
},
|
||||||
|
];
|
||||||
303
ui/src/mocks/mockStockMovements.ts
Normal file
303
ui/src/mocks/mockStockMovements.ts
Normal file
|
|
@ -0,0 +1,303 @@
|
||||||
|
import {
|
||||||
|
MmStockMovement,
|
||||||
|
MovementTypeEnum,
|
||||||
|
MovementStatusEnum,
|
||||||
|
} from "../types/mm";
|
||||||
|
import { mockLocations } from "./mockLocations";
|
||||||
|
import { mockMaterials } from "./mockMaterials";
|
||||||
|
import { mockUnits } from "./mockUnits";
|
||||||
|
import { mockWarehouses } from "./mockWarehouses";
|
||||||
|
import { mockZones } from "./mockZones";
|
||||||
|
|
||||||
|
// Unified mock data for all material movements - combines previous mockMovements and mockStockMovements
|
||||||
|
export const mockStockMovements: MmStockMovement[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
movementNumber: "GR-2024-001",
|
||||||
|
materialId: "1",
|
||||||
|
material: mockMaterials.find((m) => m.id === "1")!,
|
||||||
|
movementType: MovementTypeEnum.GoodsReceipt,
|
||||||
|
toWarehouseId: "1",
|
||||||
|
toWarehouse: mockWarehouses.find((w) => w.id === "1"),
|
||||||
|
toZoneId: "2",
|
||||||
|
toZone: mockZones.find((z) => z.id === "2"),
|
||||||
|
toLocationId: "2",
|
||||||
|
toLocation: mockLocations.find((l) => l.id === "2"),
|
||||||
|
quantity: 100,
|
||||||
|
unitId: "KG",
|
||||||
|
unit: mockUnits.find((u) => u.id === "KG"),
|
||||||
|
lotNumber: "LOT-2024-001",
|
||||||
|
referenceDocument: "PO-2024-001",
|
||||||
|
referenceDocumentType: "Purchase Order",
|
||||||
|
referenceType: "Purchase Order",
|
||||||
|
movementDate: new Date("2024-01-15T10:30:00"),
|
||||||
|
description: "Satın alma girişi",
|
||||||
|
reason: "Satın alma girişi",
|
||||||
|
performedBy: "Mehmet Özkan",
|
||||||
|
approvedBy: "manager1",
|
||||||
|
status: MovementStatusEnum.Completed,
|
||||||
|
creationTime: new Date("2024-01-15T10:30:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "5",
|
||||||
|
movementNumber: "GR-2024-001",
|
||||||
|
materialId: "2",
|
||||||
|
material: mockMaterials.find((m) => m.id === "2")!,
|
||||||
|
movementType: MovementTypeEnum.GoodsReceipt,
|
||||||
|
toWarehouseId: "1",
|
||||||
|
toWarehouse: mockWarehouses.find((w) => w.id === "1"),
|
||||||
|
toZoneId: "1",
|
||||||
|
toZone: mockZones.find((z) => z.id === "1"),
|
||||||
|
toLocationId: "3",
|
||||||
|
toLocation: mockLocations.find((l) => l.id === "3"),
|
||||||
|
quantity: 200,
|
||||||
|
unitId: "MT",
|
||||||
|
unit: mockUnits.find((u) => u.id === "metre"),
|
||||||
|
lotNumber: "LOT-2024-005",
|
||||||
|
referenceDocument: "PO-2024-002",
|
||||||
|
referenceDocumentType: "Purchase Order",
|
||||||
|
referenceType: "Purchase Order",
|
||||||
|
movementDate: new Date("2024-11-20T08:30:00"),
|
||||||
|
description: "Hammadde girişi",
|
||||||
|
reason: "Hammadde girişi",
|
||||||
|
performedBy: "Ali Veli",
|
||||||
|
approvedBy: "manager2",
|
||||||
|
status: MovementStatusEnum.Completed,
|
||||||
|
creationTime: new Date("2024-11-20T08:30:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "10",
|
||||||
|
movementNumber: "GR-2024-007",
|
||||||
|
materialId: "1",
|
||||||
|
material: mockMaterials.find((m) => m.id === "1")!,
|
||||||
|
|
||||||
|
movementType: MovementTypeEnum.GoodsReceipt,
|
||||||
|
toWarehouseId: "1",
|
||||||
|
toWarehouse: mockWarehouses.find((w) => w.id === "1"),
|
||||||
|
toZoneId: "1",
|
||||||
|
toZone: mockZones.find((z) => z.id === "1"),
|
||||||
|
toLocationId: "1",
|
||||||
|
toLocation: mockLocations.find((l) => l.id === "1"),
|
||||||
|
|
||||||
|
quantity: 10,
|
||||||
|
unitId: "KG",
|
||||||
|
unit: mockUnits.find((u) => u.id === "KG"),
|
||||||
|
lotNumber: "LOT-2024-001",
|
||||||
|
referenceDocument: "RET-2024-001",
|
||||||
|
referenceDocumentType: "Return Order",
|
||||||
|
referenceType: "Return Order",
|
||||||
|
movementDate: new Date("2024-11-30T10:30:00"),
|
||||||
|
description: "Müşteri iadesi",
|
||||||
|
reason: "Müşteri iadesi",
|
||||||
|
performedBy: "İade Operatörü",
|
||||||
|
status: MovementStatusEnum.Planned,
|
||||||
|
creationTime: new Date("2024-11-30T09:00:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
movementNumber: "GR-2024-005",
|
||||||
|
materialId: "2",
|
||||||
|
material: mockMaterials.find((m) => m.id === "2")!,
|
||||||
|
movementType: MovementTypeEnum.GoodsReceipt,
|
||||||
|
toWarehouseId: "2",
|
||||||
|
toWarehouse: mockWarehouses.find((w) => w.id === "2"),
|
||||||
|
toZoneId: "3",
|
||||||
|
toZone: mockZones.find((z) => z.id === "3"),
|
||||||
|
toLocationId: "LOC004",
|
||||||
|
toLocation: mockLocations.find((l) => l.id === "4"),
|
||||||
|
quantity: 5,
|
||||||
|
unitId: "M2",
|
||||||
|
unit: mockUnits.find((u) => u.id === "M2"),
|
||||||
|
referenceDocument: "ADJ-2024-001",
|
||||||
|
referenceDocumentType: "Stock Adjustment",
|
||||||
|
referenceType: "Stock Adjustment",
|
||||||
|
movementDate: new Date("2024-01-18T16:45:00"),
|
||||||
|
description: "Sayım farkı düzeltmesi",
|
||||||
|
reason: "Sayım farkı düzeltmesi",
|
||||||
|
performedBy: "Stok Kontrol",
|
||||||
|
approvedBy: "manager2",
|
||||||
|
status: MovementStatusEnum.Completed,
|
||||||
|
creationTime: new Date("2024-01-18T16:45:00"),
|
||||||
|
},
|
||||||
|
|
||||||
|
// Goods Issues
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
movementNumber: "GI-2024-001",
|
||||||
|
materialId: "1",
|
||||||
|
material: mockMaterials.find((m) => m.id === "1")!,
|
||||||
|
movementType: MovementTypeEnum.GoodsIssue,
|
||||||
|
toWarehouseId: "1",
|
||||||
|
toWarehouse: mockWarehouses.find((w) => w.id === "1"),
|
||||||
|
toZoneId: "1",
|
||||||
|
toZone: mockZones.find((z) => z.id === "1"),
|
||||||
|
toLocationId: "1",
|
||||||
|
toLocation: mockLocations.find((l) => l.id === "1"),
|
||||||
|
quantity: 50,
|
||||||
|
unitId: "KG",
|
||||||
|
unit: mockUnits.find((u) => u.id === "KG"),
|
||||||
|
lotNumber: "LOT-2024-001",
|
||||||
|
referenceDocument: "SO-2024-001",
|
||||||
|
referenceDocumentType: "Sales Order",
|
||||||
|
referenceType: "Sales Order",
|
||||||
|
movementDate: new Date("2024-01-16T14:15:00"),
|
||||||
|
description: "Satış çıkışı",
|
||||||
|
reason: "Satış çıkışı",
|
||||||
|
performedBy: "Ayşe Yılmaz",
|
||||||
|
approvedBy: "manager1",
|
||||||
|
status: MovementStatusEnum.Completed,
|
||||||
|
creationTime: new Date("2024-01-16T14:15:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "6",
|
||||||
|
movementNumber: "GI-2024-001",
|
||||||
|
materialId: "2",
|
||||||
|
material: mockMaterials.find((m) => m.id === "2")!,
|
||||||
|
movementType: MovementTypeEnum.GoodsIssue,
|
||||||
|
toWarehouseId: "1",
|
||||||
|
toWarehouse: mockWarehouses.find((w) => w.id === "1"),
|
||||||
|
toZoneId: "1",
|
||||||
|
toZone: mockZones.find((z) => z.id === "1"),
|
||||||
|
toLocationId: "3",
|
||||||
|
toLocation: mockLocations.find((l) => l.id === "3"),
|
||||||
|
quantity: 50,
|
||||||
|
unitId: "MT",
|
||||||
|
unit: mockUnits.find((u) => u.id === "KG"),
|
||||||
|
lotNumber: "LOT-2024-005",
|
||||||
|
referenceDocument: "WO-2024-001",
|
||||||
|
referenceDocumentType: "Work Order",
|
||||||
|
referenceType: "Work Order",
|
||||||
|
movementDate: new Date("2024-11-26T10:15:00"),
|
||||||
|
description: "Üretim için malzeme çıkışı",
|
||||||
|
reason: "Üretim için malzeme çıkışı",
|
||||||
|
performedBy: "Mehmet Üretici",
|
||||||
|
status: MovementStatusEnum.InProgress,
|
||||||
|
creationTime: new Date("2024-11-26T10:15:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "9",
|
||||||
|
movementNumber: "GI-2024-009",
|
||||||
|
materialId: "4",
|
||||||
|
material: mockMaterials.find((m) => m.id === "4") || mockMaterials[0],
|
||||||
|
movementType: MovementTypeEnum.GoodsIssue,
|
||||||
|
|
||||||
|
toWarehouseId: "1",
|
||||||
|
toWarehouse: mockWarehouses.find((w) => w.id === "1"),
|
||||||
|
toZoneId: "1",
|
||||||
|
toZone: mockZones.find((z) => z.id === "1"),
|
||||||
|
toLocationId: "3",
|
||||||
|
toLocation: mockLocations.find((l) => l.id === "3"),
|
||||||
|
|
||||||
|
quantity: 100,
|
||||||
|
unitId: "ADET",
|
||||||
|
unit: mockUnits.find((u) => u.id === "ADET"),
|
||||||
|
referenceDocument: "WO-2024-002",
|
||||||
|
referenceDocumentType: "Work Order",
|
||||||
|
referenceType: "Work Order",
|
||||||
|
movementDate: new Date("2024-11-29T14:00:00"),
|
||||||
|
description: "Üretim tamamlama girişi",
|
||||||
|
reason: "Üretim tamamlama girişi",
|
||||||
|
performedBy: "Üretim Operatörü",
|
||||||
|
status: MovementStatusEnum.Completed,
|
||||||
|
creationTime: new Date("2024-11-29T14:00:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "7",
|
||||||
|
movementNumber: "GI-2024-003",
|
||||||
|
materialId: "3",
|
||||||
|
material: mockMaterials.find((m) => m.id === "3")!,
|
||||||
|
movementType: MovementTypeEnum.GoodsIssue,
|
||||||
|
toWarehouseId: "1",
|
||||||
|
toWarehouse: mockWarehouses.find((w) => w.id === "1"),
|
||||||
|
toZoneId: "1",
|
||||||
|
toZone: mockZones.find((z) => z.id === "1"),
|
||||||
|
toLocationId: "3",
|
||||||
|
toLocation: mockLocations.find((l) => l.id === "3"),
|
||||||
|
quantity: 500,
|
||||||
|
unitId: "ADET",
|
||||||
|
unit: mockUnits.find((u) => u.id === "ADET"),
|
||||||
|
lotNumber: "LOT-2024-006",
|
||||||
|
referenceDocument: "MR-2024-001",
|
||||||
|
referenceDocumentType: "Material Request",
|
||||||
|
referenceType: "Material Request",
|
||||||
|
movementDate: new Date("2024-11-27T15:30:00"),
|
||||||
|
description: "Bakım için malzeme talebi",
|
||||||
|
reason: "Bakım için malzeme talebi",
|
||||||
|
performedBy: "Bakım Ekibi",
|
||||||
|
status: MovementStatusEnum.Planned,
|
||||||
|
creationTime: new Date("2024-11-25T09:00:00"),
|
||||||
|
},
|
||||||
|
|
||||||
|
// Transfers
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
movementNumber: "TR-2024-001",
|
||||||
|
materialId: "1",
|
||||||
|
material: mockMaterials.find((m) => m.id === "1")!,
|
||||||
|
movementType: MovementTypeEnum.Transfer,
|
||||||
|
|
||||||
|
fromWarehouseId: "2",
|
||||||
|
fromWarehouse: mockWarehouses.find((w) => w.id === "2"),
|
||||||
|
fromZoneId: "3",
|
||||||
|
fromZone: mockZones.find((z) => z.id === "3"),
|
||||||
|
fromLocationId: "4",
|
||||||
|
fromLocation: mockLocations.find((l) => l.id === "4"),
|
||||||
|
|
||||||
|
toWarehouseId: "1",
|
||||||
|
toWarehouse: mockWarehouses.find((w) => w.id === "1"),
|
||||||
|
toZoneId: "2",
|
||||||
|
toZone: mockZones.find((z) => z.id === "2"),
|
||||||
|
toLocationId: "1",
|
||||||
|
toLocation: mockLocations.find((l) => l.id === "1"),
|
||||||
|
|
||||||
|
quantity: 25,
|
||||||
|
unitId: "KG",
|
||||||
|
unit: mockUnits.find((u) => u.id === "KG"),
|
||||||
|
lotNumber: "LOT-2024-001",
|
||||||
|
referenceDocument: "TR-2024-001",
|
||||||
|
referenceDocumentType: "Transfer Order",
|
||||||
|
referenceType: "Transfer Order",
|
||||||
|
movementDate: new Date("2024-01-17T09:00:00"),
|
||||||
|
description: "Depo transferi",
|
||||||
|
reason: "Depo transferi",
|
||||||
|
performedBy: "Fatma Demir",
|
||||||
|
approvedBy: "manager1",
|
||||||
|
status: MovementStatusEnum.Completed,
|
||||||
|
creationTime: new Date("2024-01-17T09:00:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "8",
|
||||||
|
movementNumber: "TR-2024-002",
|
||||||
|
materialId: "1",
|
||||||
|
material: mockMaterials.find((m) => m.id === "1")!,
|
||||||
|
movementType: MovementTypeEnum.Transfer,
|
||||||
|
|
||||||
|
fromWarehouseId: "1",
|
||||||
|
fromWarehouse: mockWarehouses.find((w) => w.id === "1"),
|
||||||
|
fromZoneId: "1",
|
||||||
|
fromZone: mockZones.find((z) => z.id === "1"),
|
||||||
|
fromLocationId: "1",
|
||||||
|
fromLocation: mockLocations.find((l) => l.id === "1"),
|
||||||
|
|
||||||
|
toWarehouseId: "1",
|
||||||
|
toWarehouse: mockWarehouses.find((w) => w.id === "1"),
|
||||||
|
toZoneId: "1",
|
||||||
|
toZone: mockZones.find((z) => z.id === "1"),
|
||||||
|
toLocationId: "1",
|
||||||
|
toLocation: mockLocations.find((l) => l.id === "1"),
|
||||||
|
|
||||||
|
quantity: 15,
|
||||||
|
unitId: "KG",
|
||||||
|
unit: mockUnits.find((u) => u.id === "KG"),
|
||||||
|
lotNumber: "LOT-2024-001",
|
||||||
|
referenceDocument: "TR-2024-002",
|
||||||
|
referenceDocumentType: "Transfer Order",
|
||||||
|
referenceType: "Transfer Order",
|
||||||
|
movementDate: new Date("2024-11-28T11:00:00"),
|
||||||
|
description: "Şube deposuna transfer",
|
||||||
|
reason: "Şube deposuna transfer",
|
||||||
|
performedBy: "Transfer Operatörü",
|
||||||
|
status: MovementStatusEnum.InProgress,
|
||||||
|
creationTime: new Date("2024-11-28T10:00:00"),
|
||||||
|
},
|
||||||
|
];
|
||||||
12
ui/src/mocks/mockUnits.ts
Normal file
12
ui/src/mocks/mockUnits.ts
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
import { MmUnit } from "../types/mm";
|
||||||
|
|
||||||
|
export const mockUnits: MmUnit[] = [
|
||||||
|
{ id: "KG", code: "KG", name: "Kilogram", isActive: true },
|
||||||
|
{ id: "ADET", code: "ADET", name: "Adet", isActive: true },
|
||||||
|
{ id: "LT", code: "LT", name: "Litre", isActive: true },
|
||||||
|
{ id: "MT", code: "MT", name: "Metre", isActive: true },
|
||||||
|
{ id: "M2", code: "M²", name: "Metrekare", isActive: true },
|
||||||
|
{ id: "M3", code: "M³", name: "Metreküp", isActive: true },
|
||||||
|
{ id: "PAKET", code: "PAKET", name: "Paket", isActive: true },
|
||||||
|
{ id: "KOLI", code: "KOLI", name: "Koli", isActive: true },
|
||||||
|
];
|
||||||
132
ui/src/mocks/mockWarehouses.ts
Normal file
132
ui/src/mocks/mockWarehouses.ts
Normal file
|
|
@ -0,0 +1,132 @@
|
||||||
|
import { SecurityLevelEnum } from "../types/mrp";
|
||||||
|
import { WmWarehouse, WarehouseTypeEnum } from "../types/wm";
|
||||||
|
import { mockLocations } from "./mockLocations";
|
||||||
|
import { mockZones } from "./mockZones";
|
||||||
|
|
||||||
|
export const mockWarehouses: WmWarehouse[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
code: "WH001",
|
||||||
|
name: "Ana Hammadde Deposu",
|
||||||
|
description: "Üretim için gerekli hammaddelerin depolandığı ana depo",
|
||||||
|
address: {
|
||||||
|
street: "Organize Sanayi Bölgesi 1. Cadde No: 15",
|
||||||
|
city: "İstanbul",
|
||||||
|
state: "İstanbul",
|
||||||
|
postalCode: "34000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
warehouseType: WarehouseTypeEnum.RawMaterials,
|
||||||
|
zones: mockZones.filter((zone) => zone.warehouseId === "1"),
|
||||||
|
locations: mockLocations.filter((location) => location.warehouseId === "1"),
|
||||||
|
isMainWarehouse: true,
|
||||||
|
capacity: 5000,
|
||||||
|
currentUtilization: 0,
|
||||||
|
isActive: true,
|
||||||
|
temperatureControlled: false,
|
||||||
|
managerId: 1,
|
||||||
|
securityLevel: SecurityLevelEnum.Medium,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
code: "WH002",
|
||||||
|
name: "Mamul Deposu",
|
||||||
|
description: "Üretimi tamamlanmış mamullerin depolandığı alan",
|
||||||
|
address: {
|
||||||
|
street: "Organize Sanayi Bölgesi 1. Cadde No: 15",
|
||||||
|
city: "İstanbul",
|
||||||
|
state: "İstanbul",
|
||||||
|
postalCode: "34000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
warehouseType: WarehouseTypeEnum.FinishedGoods,
|
||||||
|
zones: mockZones.filter((zone) => zone.warehouseId === "2"),
|
||||||
|
locations: mockLocations.filter((location) => location.warehouseId === "2"),
|
||||||
|
isMainWarehouse: false,
|
||||||
|
capacity: 3000,
|
||||||
|
isActive: true,
|
||||||
|
currentUtilization: 0,
|
||||||
|
temperatureControlled: false,
|
||||||
|
managerId: 1,
|
||||||
|
securityLevel: SecurityLevelEnum.Medium,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
code: "WH003",
|
||||||
|
name: "Ara Ürün Deposu",
|
||||||
|
description: "İşlenmiş ara ürünlerin geçici depolandığı alan",
|
||||||
|
address: {
|
||||||
|
street: "Organize Sanayi Bölgesi 1. Cadde No: 15",
|
||||||
|
city: "İstanbul",
|
||||||
|
state: "İstanbul",
|
||||||
|
postalCode: "34000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
warehouseType: WarehouseTypeEnum.WorkInProgress,
|
||||||
|
zones: mockZones.filter((zone) => zone.warehouseId === "3"),
|
||||||
|
locations: mockLocations.filter((location) => location.warehouseId === "3"),
|
||||||
|
isMainWarehouse: false,
|
||||||
|
capacity: 1500,
|
||||||
|
isActive: true,
|
||||||
|
currentUtilization: 0,
|
||||||
|
managerId: 2,
|
||||||
|
securityLevel: SecurityLevelEnum.High,
|
||||||
|
temperatureControlled: false,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
code: "WH004",
|
||||||
|
name: "Karantina Deposu",
|
||||||
|
description: "Kalite kontrolü bekleyen ürünlerin depolandığı alan",
|
||||||
|
address: {
|
||||||
|
street: "Organize Sanayi Bölgesi 1. Cadde No: 15",
|
||||||
|
city: "İstanbul",
|
||||||
|
state: "İstanbul",
|
||||||
|
postalCode: "34000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
warehouseType: WarehouseTypeEnum.Quarantine,
|
||||||
|
zones: mockZones.filter((zone) => zone.warehouseId === "4"),
|
||||||
|
locations: mockLocations.filter((location) => location.warehouseId === "4"),
|
||||||
|
isMainWarehouse: true,
|
||||||
|
capacity: 500,
|
||||||
|
isActive: true,
|
||||||
|
temperatureControlled: false,
|
||||||
|
currentUtilization: 0,
|
||||||
|
managerId: 3,
|
||||||
|
securityLevel: SecurityLevelEnum.Low,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "5",
|
||||||
|
code: "WH005",
|
||||||
|
name: "İade Deposu",
|
||||||
|
description: "Müşterilerden dönen ürünlerin depolandığı alan",
|
||||||
|
address: {
|
||||||
|
street: "Organize Sanayi Bölgesi 1. Cadde No: 15",
|
||||||
|
city: "İstanbul",
|
||||||
|
state: "İstanbul",
|
||||||
|
postalCode: "34000",
|
||||||
|
country: "Türkiye",
|
||||||
|
},
|
||||||
|
warehouseType: WarehouseTypeEnum.Returns,
|
||||||
|
zones: mockZones.filter((zone) => zone.warehouseId === "5"),
|
||||||
|
locations: mockLocations.filter((location) => location.warehouseId === "5"),
|
||||||
|
isMainWarehouse: true,
|
||||||
|
capacity: 800,
|
||||||
|
isActive: true,
|
||||||
|
temperatureControlled: false,
|
||||||
|
currentUtilization: 0,
|
||||||
|
managerId: 4,
|
||||||
|
securityLevel: SecurityLevelEnum.Restricted,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
},
|
||||||
|
];
|
||||||
220
ui/src/mocks/mockWaybills.ts
Normal file
220
ui/src/mocks/mockWaybills.ts
Normal file
|
|
@ -0,0 +1,220 @@
|
||||||
|
import { FiWaybill, WaybillTypeEnum, WaybillStatusEnum } from "../types/fi";
|
||||||
|
import { mockCurrentAccounts } from "./mockCurrentAccounts";
|
||||||
|
|
||||||
|
export const mockWaybills: FiWaybill[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
waybillNumber: "IRS2024001",
|
||||||
|
waybillType: WaybillTypeEnum.Outgoing,
|
||||||
|
currentAccountId: "1",
|
||||||
|
currentAccount: mockCurrentAccounts.find((acc) => acc.id === "1"),
|
||||||
|
waybillDate: new Date("2024-01-15"),
|
||||||
|
deliveryDate: new Date("2024-01-16"),
|
||||||
|
subtotal: 50300,
|
||||||
|
taxAmount: 9054,
|
||||||
|
discountAmount: 0,
|
||||||
|
totalAmount: 59354,
|
||||||
|
currency: "TRY",
|
||||||
|
status: WaybillStatusEnum.Delivered,
|
||||||
|
isInvoiced: false,
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
waybillId: "1",
|
||||||
|
description: "Laptop Dell Inspiron 15",
|
||||||
|
quantity: 2,
|
||||||
|
unit: "Adet",
|
||||||
|
unitPrice: 25000,
|
||||||
|
lineTotal: 59000,
|
||||||
|
discountRate: 0,
|
||||||
|
discountAmount: 0,
|
||||||
|
taxRate: 18,
|
||||||
|
taxAmount: 9000,
|
||||||
|
netAmount: 50000,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
waybillId: "1",
|
||||||
|
description: "Wireless Mouse",
|
||||||
|
quantity: 2,
|
||||||
|
unit: "Adet",
|
||||||
|
unitPrice: 150,
|
||||||
|
lineTotal: 354,
|
||||||
|
discountRate: 0,
|
||||||
|
discountAmount: 0,
|
||||||
|
taxRate: 18,
|
||||||
|
taxAmount: 54,
|
||||||
|
netAmount: 300,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
deliveryAddress: "Ataşehir Mah. Barbaros Cad. No:15 Ataşehir/İstanbul",
|
||||||
|
receiverName: "Ahmet Yılmaz",
|
||||||
|
receiverPhone: "+90 212 555 0101",
|
||||||
|
carrierCompany: "MNG Kargo",
|
||||||
|
trackingNumber: "MNG123456789",
|
||||||
|
notes: "Dikkatli taşınması gerekiyor.",
|
||||||
|
creationTime: new Date("2024-01-15T08:00:00"),
|
||||||
|
lastModificationTime: new Date("2024-01-16T14:30:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
waybillNumber: "IRS2024002",
|
||||||
|
waybillType: WaybillTypeEnum.Outgoing,
|
||||||
|
currentAccountId: "2",
|
||||||
|
currentAccount: mockCurrentAccounts.find((acc) => acc.id === "2"),
|
||||||
|
waybillDate: new Date("2024-01-16"),
|
||||||
|
deliveryDate: new Date("2024-01-17"),
|
||||||
|
subtotal: 15000,
|
||||||
|
taxAmount: 2700,
|
||||||
|
discountAmount: 0,
|
||||||
|
totalAmount: 17700,
|
||||||
|
currency: "TRY",
|
||||||
|
status: WaybillStatusEnum.Delivered,
|
||||||
|
isInvoiced: false,
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
waybillId: "2",
|
||||||
|
description: "Yazılım Lisansı - ERP Modülü",
|
||||||
|
quantity: 1,
|
||||||
|
unit: "Adet",
|
||||||
|
unitPrice: 15000,
|
||||||
|
lineTotal: 17700,
|
||||||
|
discountRate: 0,
|
||||||
|
discountAmount: 0,
|
||||||
|
taxRate: 18,
|
||||||
|
taxAmount: 2700,
|
||||||
|
netAmount: 15000,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
deliveryAddress: "Kadıköy Mah. Bağdat Cad. No:45 Kadıköy/İstanbul",
|
||||||
|
receiverName: "Mehmet Demir",
|
||||||
|
receiverPhone: "+90 216 444 0202",
|
||||||
|
carrierCompany: "Yurtiçi Kargo",
|
||||||
|
trackingNumber: "YK987654321",
|
||||||
|
notes: "Dijital teslimat yapılacak.",
|
||||||
|
creationTime: new Date("2024-01-16T09:30:00"),
|
||||||
|
lastModificationTime: new Date("2024-01-17T16:00:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
waybillNumber: "IRS2024003",
|
||||||
|
waybillType: WaybillTypeEnum.Outgoing,
|
||||||
|
currentAccountId: "1",
|
||||||
|
currentAccount: mockCurrentAccounts.find((acc) => acc.id === "1"),
|
||||||
|
waybillDate: new Date("2024-01-17"),
|
||||||
|
deliveryDate: new Date("2024-01-18"),
|
||||||
|
subtotal: 10500,
|
||||||
|
taxAmount: 1890,
|
||||||
|
discountAmount: 0,
|
||||||
|
totalAmount: 12390,
|
||||||
|
currency: "TRY",
|
||||||
|
status: WaybillStatusEnum.Delivered,
|
||||||
|
isInvoiced: true,
|
||||||
|
invoiceId: "1",
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
waybillId: "3",
|
||||||
|
description: "Monitor 24 inch LED",
|
||||||
|
quantity: 3,
|
||||||
|
unit: "Adet",
|
||||||
|
unitPrice: 3500,
|
||||||
|
lineTotal: 12390,
|
||||||
|
discountRate: 0,
|
||||||
|
discountAmount: 0,
|
||||||
|
taxRate: 18,
|
||||||
|
taxAmount: 1890,
|
||||||
|
netAmount: 10500,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
deliveryAddress: "Ataşehir Mah. Barbaros Cad. No:15 Ataşehir/İstanbul",
|
||||||
|
receiverName: "Ahmet Yılmaz",
|
||||||
|
receiverPhone: "+90 212 555 0101",
|
||||||
|
carrierCompany: "PTT Kargo",
|
||||||
|
trackingNumber: "PTT555666777",
|
||||||
|
notes: "Fatura kesilmiş, faturalandırıldı.",
|
||||||
|
creationTime: new Date("2024-01-17T10:00:00"),
|
||||||
|
lastModificationTime: new Date("2024-01-18T11:30:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
waybillNumber: "IRS2024004",
|
||||||
|
waybillType: WaybillTypeEnum.Outgoing,
|
||||||
|
currentAccountId: "2",
|
||||||
|
currentAccount: mockCurrentAccounts.find((acc) => acc.id === "2"),
|
||||||
|
waybillDate: new Date("2024-01-18"),
|
||||||
|
deliveryDate: new Date("2024-01-19"),
|
||||||
|
subtotal: 35000,
|
||||||
|
taxAmount: 6300,
|
||||||
|
discountAmount: 1750,
|
||||||
|
totalAmount: 39550,
|
||||||
|
currency: "TRY",
|
||||||
|
status: WaybillStatusEnum.Delivered,
|
||||||
|
isInvoiced: false,
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
id: "5",
|
||||||
|
waybillId: "4",
|
||||||
|
description: "Tablet Samsung Galaxy Tab",
|
||||||
|
quantity: 10,
|
||||||
|
unit: "Adet",
|
||||||
|
unitPrice: 3500,
|
||||||
|
lineTotal: 39550,
|
||||||
|
discountRate: 5,
|
||||||
|
discountAmount: 1750,
|
||||||
|
taxRate: 18,
|
||||||
|
taxAmount: 6300,
|
||||||
|
netAmount: 33250,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
deliveryAddress: "Şişli Mah. Mecidiyeköy Cad. No:100 Şişli/İstanbul",
|
||||||
|
receiverName: "Fatma Kaya",
|
||||||
|
receiverPhone: "+90 212 777 0303",
|
||||||
|
carrierCompany: "Aras Kargo",
|
||||||
|
trackingNumber: "ARS111222333",
|
||||||
|
notes: "Toplu teslimat, %5 indirim uygulandı.",
|
||||||
|
creationTime: new Date("2024-01-18T14:00:00"),
|
||||||
|
lastModificationTime: new Date("2024-01-19T10:15:00"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "5",
|
||||||
|
waybillNumber: "IRS2024005",
|
||||||
|
waybillType: WaybillTypeEnum.Incoming,
|
||||||
|
currentAccountId: "4",
|
||||||
|
currentAccount: mockCurrentAccounts.find((acc) => acc.id === "4"),
|
||||||
|
waybillDate: new Date("2024-01-19"),
|
||||||
|
deliveryDate: new Date("2024-01-20"),
|
||||||
|
subtotal: 20000,
|
||||||
|
taxAmount: 3600,
|
||||||
|
discountAmount: 0,
|
||||||
|
totalAmount: 23600,
|
||||||
|
currency: "TRY",
|
||||||
|
status: WaybillStatusEnum.Delivered,
|
||||||
|
isInvoiced: false,
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
id: "6",
|
||||||
|
waybillId: "5",
|
||||||
|
description: "Klavye Mekanik Gaming",
|
||||||
|
quantity: 20,
|
||||||
|
unit: "Adet",
|
||||||
|
unitPrice: 1000,
|
||||||
|
lineTotal: 23600,
|
||||||
|
discountRate: 0,
|
||||||
|
discountAmount: 0,
|
||||||
|
taxRate: 18,
|
||||||
|
taxAmount: 3600,
|
||||||
|
netAmount: 20000,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
deliveryAddress: "Merkez Depo - Ümraniye Sanayi Sitesi",
|
||||||
|
receiverName: "Depo Sorumlusu",
|
||||||
|
receiverPhone: "+90 216 555 0505",
|
||||||
|
carrierCompany: "Horoz Lojistik",
|
||||||
|
trackingNumber: "HRZ777888999",
|
||||||
|
notes: "Stok girişi yapıldı.",
|
||||||
|
creationTime: new Date("2024-01-19T11:00:00"),
|
||||||
|
lastModificationTime: new Date("2024-01-20T09:00:00"),
|
||||||
|
},
|
||||||
|
];
|
||||||
32
ui/src/mocks/mockWorkCenterTypes.ts
Normal file
32
ui/src/mocks/mockWorkCenterTypes.ts
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
import { PmWorkCenterType } from "../types/pm";
|
||||||
|
|
||||||
|
export const mockWorkCenterTypes: PmWorkCenterType[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
code: "CNC",
|
||||||
|
name: "CNC Makineleri",
|
||||||
|
category: "Üretim",
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
code: "COMP",
|
||||||
|
name: "Kompresörler",
|
||||||
|
category: "Altyapı",
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
code: "CONV",
|
||||||
|
name: "Konveyörler",
|
||||||
|
category: "Taşıma",
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
code: "WELD",
|
||||||
|
name: "Kaynak Makineleri",
|
||||||
|
category: "Üretim",
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
368
ui/src/mocks/mockWorkCenters.ts
Normal file
368
ui/src/mocks/mockWorkCenters.ts
Normal file
|
|
@ -0,0 +1,368 @@
|
||||||
|
import {
|
||||||
|
CriticalityLevelEnum,
|
||||||
|
PmWorkCenter,
|
||||||
|
WorkCenterStatusEnum,
|
||||||
|
} from "../types/pm";
|
||||||
|
import { mockWorkCenterTypes } from "./mockWorkCenterTypes";
|
||||||
|
|
||||||
|
export const mockWorkCenters: PmWorkCenter[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
code: "CNC-001",
|
||||||
|
name: "CNC Torna Tezgahı",
|
||||||
|
description: "Yüksek hassasiyetli CNC torna tezgahı",
|
||||||
|
workCenterId: "1",
|
||||||
|
workCenterType: mockWorkCenterTypes.find((wct) => wct.code === "1")!,
|
||||||
|
manufacturer: "HAAS Automation",
|
||||||
|
model: "ST-30",
|
||||||
|
serialNumber: "SN123456789",
|
||||||
|
installationDate: new Date("2022-03-15"),
|
||||||
|
warrantyExpiry: new Date("2025-03-15"),
|
||||||
|
location: "Atölye A - Hat 1",
|
||||||
|
departmentId: "1",
|
||||||
|
status: WorkCenterStatusEnum.Operational,
|
||||||
|
criticality: CriticalityLevelEnum.High,
|
||||||
|
specifications: [
|
||||||
|
{
|
||||||
|
id: "SPEC001",
|
||||||
|
workCenterId: "EQP001",
|
||||||
|
specificationName: "Max Çap",
|
||||||
|
specificationValue: "300",
|
||||||
|
unit: "mm",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "SPEC002",
|
||||||
|
workCenterId: "EQP001",
|
||||||
|
specificationName: "Motor Gücü",
|
||||||
|
specificationValue: "15",
|
||||||
|
unit: "kW",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
maintenancePlans: [],
|
||||||
|
workOrders: [],
|
||||||
|
downTimeHistory: [],
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2022-03-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-15"),
|
||||||
|
capacity: 8,
|
||||||
|
costPerHour: 75,
|
||||||
|
setupTime: 15,
|
||||||
|
machineType: "CNC",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
code: "COMP-001",
|
||||||
|
name: "Hava Kompresörü",
|
||||||
|
description: "Endüstriyel hava kompresörü sistemi",
|
||||||
|
workCenterId: "2",
|
||||||
|
workCenterType: mockWorkCenterTypes.find((wct) => wct.code === "2")!,
|
||||||
|
manufacturer: "Atlas Copco",
|
||||||
|
model: "GA55VSD+",
|
||||||
|
serialNumber: "AC987654321",
|
||||||
|
installationDate: new Date("2021-08-20"),
|
||||||
|
warrantyExpiry: new Date("2024-08-20"),
|
||||||
|
location: "Kompresör Odası",
|
||||||
|
departmentId: "2",
|
||||||
|
status: WorkCenterStatusEnum.UnderMaintenance,
|
||||||
|
criticality: CriticalityLevelEnum.Critical,
|
||||||
|
specifications: [
|
||||||
|
{
|
||||||
|
id: "SPEC003",
|
||||||
|
workCenterId: "EQP002",
|
||||||
|
specificationName: "Basınç",
|
||||||
|
specificationValue: "8.5",
|
||||||
|
unit: "bar",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "SPEC004",
|
||||||
|
workCenterId: "EQP002",
|
||||||
|
specificationName: "Kapasite",
|
||||||
|
specificationValue: "55",
|
||||||
|
unit: "kW",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
maintenancePlans: [],
|
||||||
|
workOrders: [],
|
||||||
|
downTimeHistory: [],
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2021-08-20"),
|
||||||
|
lastModificationTime: new Date("2024-02-01"),
|
||||||
|
costPerHour: 85,
|
||||||
|
setupTime: 20,
|
||||||
|
machineType: "CNC",
|
||||||
|
capacity: 8,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
code: "CONV-001",
|
||||||
|
name: "Konveyör Sistemi",
|
||||||
|
description: "Ana hat konveyör sistemi",
|
||||||
|
workCenterId: "3",
|
||||||
|
workCenterType: mockWorkCenterTypes.find((wct) => wct.code === "3")!,
|
||||||
|
manufacturer: "Siemens",
|
||||||
|
model: "SIMATIC S7-1500",
|
||||||
|
serialNumber: "SM112233445",
|
||||||
|
installationDate: new Date("2020-11-10"),
|
||||||
|
location: "Ana Üretim Hattı",
|
||||||
|
departmentId: "3",
|
||||||
|
status: WorkCenterStatusEnum.OutOfOrder,
|
||||||
|
criticality: CriticalityLevelEnum.Medium,
|
||||||
|
specifications: [
|
||||||
|
{
|
||||||
|
id: "SPEC005",
|
||||||
|
workCenterId: "EQP003",
|
||||||
|
specificationName: "Hız",
|
||||||
|
specificationValue: "2.5",
|
||||||
|
unit: "m/s",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "SPEC006",
|
||||||
|
workCenterId: "EQP003",
|
||||||
|
specificationName: "Yük Kapasitesi",
|
||||||
|
specificationValue: "500",
|
||||||
|
unit: "kg",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
maintenancePlans: [],
|
||||||
|
workOrders: [],
|
||||||
|
downTimeHistory: [],
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2020-11-10"),
|
||||||
|
lastModificationTime: new Date("2024-02-05"),
|
||||||
|
costPerHour: 85,
|
||||||
|
setupTime: 20,
|
||||||
|
machineType: "CNC",
|
||||||
|
capacity: 8,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
code: "KELD-001",
|
||||||
|
name: "Kaynak Makinesi",
|
||||||
|
description: "Otomatik robot kaynak sistemi",
|
||||||
|
workCenterId: "4",
|
||||||
|
workCenterType: mockWorkCenterTypes.find((wct) => wct.code === "4")!,
|
||||||
|
manufacturer: "KUKA",
|
||||||
|
model: "KR 60-3",
|
||||||
|
serialNumber: "KU556677889",
|
||||||
|
installationDate: new Date("2023-01-15"),
|
||||||
|
warrantyExpiry: new Date("2026-01-15"),
|
||||||
|
location: "Kaynak Atölyesi",
|
||||||
|
departmentId: "4",
|
||||||
|
status: WorkCenterStatusEnum.Operational,
|
||||||
|
criticality: CriticalityLevelEnum.High,
|
||||||
|
specifications: [
|
||||||
|
{
|
||||||
|
id: "SPEC007",
|
||||||
|
workCenterId: "EQP004",
|
||||||
|
specificationName: "Erişim Mesafesi",
|
||||||
|
specificationValue: "2033",
|
||||||
|
unit: "mm",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "SPEC008",
|
||||||
|
workCenterId: "EQP004",
|
||||||
|
specificationName: "Taşıma Kapasitesi",
|
||||||
|
specificationValue: "60",
|
||||||
|
unit: "kg",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
maintenancePlans: [],
|
||||||
|
workOrders: [],
|
||||||
|
downTimeHistory: [],
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2023-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-20"),
|
||||||
|
costPerHour: 85,
|
||||||
|
setupTime: 20,
|
||||||
|
machineType: "CNC",
|
||||||
|
capacity: 8,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "5",
|
||||||
|
code: "WELL-001",
|
||||||
|
name: "Yıkama Makinesi",
|
||||||
|
description: "Otomatik robot kaynak sistemi",
|
||||||
|
workCenterId: "4",
|
||||||
|
workCenterType: mockWorkCenterTypes.find((wct) => wct.code === "4")!,
|
||||||
|
manufacturer: "KUKA",
|
||||||
|
model: "KR 60-3",
|
||||||
|
serialNumber: "KU556677889",
|
||||||
|
installationDate: new Date("2023-01-15"),
|
||||||
|
warrantyExpiry: new Date("2026-01-15"),
|
||||||
|
location: "Kaynak Atölyesi",
|
||||||
|
departmentId: "4",
|
||||||
|
status: WorkCenterStatusEnum.Operational,
|
||||||
|
criticality: CriticalityLevelEnum.High,
|
||||||
|
specifications: [
|
||||||
|
{
|
||||||
|
id: "SPEC007",
|
||||||
|
workCenterId: "EQP004",
|
||||||
|
specificationName: "Erişim Mesafesi",
|
||||||
|
specificationValue: "2033",
|
||||||
|
unit: "mm",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "SPEC008",
|
||||||
|
workCenterId: "EQP004",
|
||||||
|
specificationName: "Taşıma Kapasitesi",
|
||||||
|
specificationValue: "60",
|
||||||
|
unit: "kg",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
maintenancePlans: [],
|
||||||
|
workOrders: [],
|
||||||
|
downTimeHistory: [],
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2023-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-20"),
|
||||||
|
costPerHour: 85,
|
||||||
|
setupTime: 20,
|
||||||
|
machineType: "CNC",
|
||||||
|
capacity: 8,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "6",
|
||||||
|
code: "KELD-001",
|
||||||
|
name: "Ram Makinesi",
|
||||||
|
description: "Otomatik robot kaynak sistemi",
|
||||||
|
workCenterId: "4",
|
||||||
|
workCenterType: mockWorkCenterTypes.find((wct) => wct.code === "4")!,
|
||||||
|
manufacturer: "KUKA",
|
||||||
|
model: "KR 60-3",
|
||||||
|
serialNumber: "KU556677889",
|
||||||
|
installationDate: new Date("2023-01-15"),
|
||||||
|
warrantyExpiry: new Date("2026-01-15"),
|
||||||
|
location: "Kaynak Atölyesi",
|
||||||
|
departmentId: "4",
|
||||||
|
status: WorkCenterStatusEnum.Operational,
|
||||||
|
criticality: CriticalityLevelEnum.High,
|
||||||
|
specifications: [
|
||||||
|
{
|
||||||
|
id: "SPEC007",
|
||||||
|
workCenterId: "EQP004",
|
||||||
|
specificationName: "Erişim Mesafesi",
|
||||||
|
specificationValue: "2033",
|
||||||
|
unit: "mm",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "SPEC008",
|
||||||
|
workCenterId: "EQP004",
|
||||||
|
specificationName: "Taşıma Kapasitesi",
|
||||||
|
specificationValue: "60",
|
||||||
|
unit: "kg",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
maintenancePlans: [],
|
||||||
|
workOrders: [],
|
||||||
|
downTimeHistory: [],
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2023-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-20"),
|
||||||
|
costPerHour: 85,
|
||||||
|
setupTime: 20,
|
||||||
|
machineType: "CNC",
|
||||||
|
capacity: 8,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "7",
|
||||||
|
code: "WEID-001",
|
||||||
|
name: "Sarma Makinesi",
|
||||||
|
description: "Otomatik robot kaynak sistemi",
|
||||||
|
workCenterId: "4",
|
||||||
|
workCenterType: mockWorkCenterTypes.find((wct) => wct.code === "4")!,
|
||||||
|
manufacturer: "KUKA",
|
||||||
|
model: "KR 60-3",
|
||||||
|
serialNumber: "KU556677889",
|
||||||
|
installationDate: new Date("2023-01-15"),
|
||||||
|
warrantyExpiry: new Date("2026-01-15"),
|
||||||
|
location: "Kaynak Atölyesi",
|
||||||
|
departmentId: "4",
|
||||||
|
status: WorkCenterStatusEnum.Operational,
|
||||||
|
criticality: CriticalityLevelEnum.High,
|
||||||
|
specifications: [
|
||||||
|
{
|
||||||
|
id: "SPEC007",
|
||||||
|
workCenterId: "EQP004",
|
||||||
|
specificationName: "Erişim Mesafesi",
|
||||||
|
specificationValue: "2033",
|
||||||
|
unit: "mm",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "SPEC008",
|
||||||
|
workCenterId: "EQP004",
|
||||||
|
specificationName: "Taşıma Kapasitesi",
|
||||||
|
specificationValue: "60",
|
||||||
|
unit: "kg",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
maintenancePlans: [],
|
||||||
|
workOrders: [],
|
||||||
|
downTimeHistory: [],
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2023-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-20"),
|
||||||
|
costPerHour: 85,
|
||||||
|
setupTime: 20,
|
||||||
|
machineType: "CNC",
|
||||||
|
capacity: 8,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "8",
|
||||||
|
code: "KEL-001",
|
||||||
|
name: "Robot Kaynak Makinesi",
|
||||||
|
description: "Otomatik robot kaynak sistemi",
|
||||||
|
workCenterId: "4",
|
||||||
|
workCenterType: mockWorkCenterTypes.find((wct) => wct.code === "4")!,
|
||||||
|
manufacturer: "KUKA",
|
||||||
|
model: "KR 60-3",
|
||||||
|
serialNumber: "KU556677889",
|
||||||
|
installationDate: new Date("2023-01-15"),
|
||||||
|
warrantyExpiry: new Date("2026-01-15"),
|
||||||
|
location: "Kaynak Atölyesi",
|
||||||
|
departmentId: "4",
|
||||||
|
status: WorkCenterStatusEnum.Operational,
|
||||||
|
criticality: CriticalityLevelEnum.High,
|
||||||
|
specifications: [
|
||||||
|
{
|
||||||
|
id: "SPEC007",
|
||||||
|
workCenterId: "EQP004",
|
||||||
|
specificationName: "Erişim Mesafesi",
|
||||||
|
specificationValue: "2033",
|
||||||
|
unit: "mm",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "SPEC008",
|
||||||
|
workCenterId: "EQP004",
|
||||||
|
specificationName: "Taşıma Kapasitesi",
|
||||||
|
specificationValue: "60",
|
||||||
|
unit: "kg",
|
||||||
|
isRequired: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
maintenancePlans: [],
|
||||||
|
workOrders: [],
|
||||||
|
downTimeHistory: [],
|
||||||
|
isActive: true,
|
||||||
|
creationTime: new Date("2023-01-15"),
|
||||||
|
lastModificationTime: new Date("2024-01-20"),
|
||||||
|
costPerHour: 85,
|
||||||
|
setupTime: 20,
|
||||||
|
machineType: "CNC",
|
||||||
|
capacity: 8,
|
||||||
|
},
|
||||||
|
];
|
||||||
217
ui/src/mocks/mockWorkOrders.ts
Normal file
217
ui/src/mocks/mockWorkOrders.ts
Normal file
|
|
@ -0,0 +1,217 @@
|
||||||
|
import { MrpWorkOrder } from "../types/mrp";
|
||||||
|
import { WorkOrderStatusEnum } from "../types/pm";
|
||||||
|
import { mockMaterials } from "./mockMaterials";
|
||||||
|
import { mockOperations } from "./mockOperations";
|
||||||
|
import { mockProductionOrders } from "./mockProductionOrders";
|
||||||
|
import { mockWorkCenters } from "./mockWorkCenters";
|
||||||
|
|
||||||
|
export const mockWorkOrders: MrpWorkOrder[] = [
|
||||||
|
{
|
||||||
|
id: "WO-2024-001",
|
||||||
|
workOrderNumber: "WO-2024-001",
|
||||||
|
productionOrderId: mockProductionOrders[0].id,
|
||||||
|
productionOrder: mockProductionOrders[0],
|
||||||
|
operationId: "1",
|
||||||
|
operation: mockOperations.find((op) => op.id === "1"),
|
||||||
|
materialId: "1",
|
||||||
|
material: mockMaterials.find((m) => m.id === "1"),
|
||||||
|
sequence: 1,
|
||||||
|
plannedStartDate: new Date("2024-01-16"),
|
||||||
|
plannedEndDate: new Date("2024-01-18"),
|
||||||
|
plannedQuantity: 50,
|
||||||
|
confirmedQuantity: 30,
|
||||||
|
scrapQuantity: 1,
|
||||||
|
workCenterId: "1",
|
||||||
|
workCenter: mockWorkCenters.find((wc) => wc.id === "1"),
|
||||||
|
assignedOperators: ["1", "2"],
|
||||||
|
setupTime: 60,
|
||||||
|
processTime: 240,
|
||||||
|
status: WorkOrderStatusEnum.InProgress,
|
||||||
|
confirmations: [],
|
||||||
|
qualityChecks: [],
|
||||||
|
creationTime: new Date("2024-01-10"),
|
||||||
|
lastModificationTime: new Date("2024-01-16"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "WO-2024-002",
|
||||||
|
workOrderNumber: "WO-2024-002",
|
||||||
|
productionOrderId: mockProductionOrders[0].id,
|
||||||
|
productionOrder: mockProductionOrders[0],
|
||||||
|
operationId: "2",
|
||||||
|
operation: mockOperations.find((op) => op.id === "2"),
|
||||||
|
materialId: "2",
|
||||||
|
material: mockMaterials.find((m) => m.id === "2"),
|
||||||
|
sequence: 2,
|
||||||
|
plannedStartDate: new Date("2024-01-18"),
|
||||||
|
plannedEndDate: new Date("2024-01-20"),
|
||||||
|
plannedQuantity: 50,
|
||||||
|
confirmedQuantity: 35,
|
||||||
|
scrapQuantity: 1,
|
||||||
|
workCenterId: "2",
|
||||||
|
workCenter: mockWorkCenters.find((wc) => wc.id === "2"),
|
||||||
|
assignedOperators: ["3"],
|
||||||
|
setupTime: 45,
|
||||||
|
processTime: 180,
|
||||||
|
status: WorkOrderStatusEnum.Completed,
|
||||||
|
confirmations: [],
|
||||||
|
qualityChecks: [],
|
||||||
|
creationTime: new Date("2024-01-10"),
|
||||||
|
lastModificationTime: new Date("2024-01-20"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "WO-2024-003",
|
||||||
|
workOrderNumber: "WO-2024-003",
|
||||||
|
productionOrderId: mockProductionOrders[1].id,
|
||||||
|
productionOrder: mockProductionOrders[1],
|
||||||
|
operationId: "3",
|
||||||
|
operation: mockOperations.find((op) => op.id === "3"),
|
||||||
|
materialId: "3",
|
||||||
|
material: mockMaterials.find((m) => m.id === "3"),
|
||||||
|
sequence: 1,
|
||||||
|
plannedStartDate: new Date("2024-02-01"),
|
||||||
|
plannedEndDate: new Date("2024-02-05"),
|
||||||
|
plannedQuantity: 25,
|
||||||
|
confirmedQuantity: 0,
|
||||||
|
scrapQuantity: 0,
|
||||||
|
workCenterId: "3",
|
||||||
|
workCenter: mockWorkCenters.find((wc) => wc.id === "3"),
|
||||||
|
assignedOperators: ["4"],
|
||||||
|
setupTime: 30,
|
||||||
|
processTime: 120,
|
||||||
|
status: WorkOrderStatusEnum.Created,
|
||||||
|
confirmations: [],
|
||||||
|
qualityChecks: [],
|
||||||
|
creationTime: new Date("2024-01-25"),
|
||||||
|
lastModificationTime: new Date("2024-02-01"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "WO-2024-004",
|
||||||
|
workOrderNumber: "WO-2024-004",
|
||||||
|
productionOrderId: mockProductionOrders[1].id,
|
||||||
|
productionOrder: mockProductionOrders[1],
|
||||||
|
operationId: "4",
|
||||||
|
operation: mockOperations.find((op) => op.id === "4"),
|
||||||
|
materialId: "2",
|
||||||
|
material: mockMaterials.find((m) => m.id === "2"),
|
||||||
|
sequence: 2,
|
||||||
|
plannedStartDate: new Date("2024-02-05"),
|
||||||
|
plannedEndDate: new Date("2024-02-10"),
|
||||||
|
plannedQuantity: 25,
|
||||||
|
confirmedQuantity: 0,
|
||||||
|
scrapQuantity: 0,
|
||||||
|
workCenterId: "1",
|
||||||
|
workCenter: mockWorkCenters.find((wc) => wc.id === "1"),
|
||||||
|
assignedOperators: ["5", "6"],
|
||||||
|
setupTime: 40,
|
||||||
|
processTime: 150,
|
||||||
|
status: WorkOrderStatusEnum.Released,
|
||||||
|
confirmations: [],
|
||||||
|
qualityChecks: [],
|
||||||
|
creationTime: new Date("2024-01-25"),
|
||||||
|
lastModificationTime: new Date("2024-02-05"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "WO-2024-005",
|
||||||
|
workOrderNumber: "WO-2024-005",
|
||||||
|
productionOrderId: mockProductionOrders[0].id,
|
||||||
|
productionOrder: mockProductionOrders[0],
|
||||||
|
operationId: "5",
|
||||||
|
operation: mockOperations.find((op) => op.id === "5"),
|
||||||
|
materialId: "4",
|
||||||
|
material: mockMaterials.find((m) => m.id === "4"),
|
||||||
|
sequence: 3,
|
||||||
|
plannedStartDate: new Date("2024-01-20"),
|
||||||
|
plannedEndDate: new Date("2024-01-25"),
|
||||||
|
plannedQuantity: 20,
|
||||||
|
confirmedQuantity: 0,
|
||||||
|
scrapQuantity: 0,
|
||||||
|
workCenterId: "4",
|
||||||
|
workCenter: mockWorkCenters.find((wc) => wc.id === "4"),
|
||||||
|
assignedOperators: ["7"],
|
||||||
|
setupTime: 20,
|
||||||
|
processTime: 60,
|
||||||
|
status: WorkOrderStatusEnum.Created,
|
||||||
|
confirmations: [],
|
||||||
|
qualityChecks: [],
|
||||||
|
creationTime: new Date("2024-01-10"),
|
||||||
|
lastModificationTime: new Date("2024-01-20"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "WO-2024-006",
|
||||||
|
workOrderNumber: "WO-2024-006",
|
||||||
|
productionOrderId: mockProductionOrders[1].id,
|
||||||
|
productionOrder: mockProductionOrders[1],
|
||||||
|
operationId: "1",
|
||||||
|
operation: mockOperations.find((op) => op.id === "1"),
|
||||||
|
materialId: "2",
|
||||||
|
material: mockMaterials.find((m) => m.id === "2"),
|
||||||
|
sequence: 3,
|
||||||
|
plannedStartDate: new Date("2024-02-10"),
|
||||||
|
plannedEndDate: new Date("2024-02-15"),
|
||||||
|
plannedQuantity: 10,
|
||||||
|
confirmedQuantity: 0,
|
||||||
|
scrapQuantity: 0,
|
||||||
|
workCenterId: "5",
|
||||||
|
workCenter: mockWorkCenters.find((wc) => wc.id === "5"),
|
||||||
|
assignedOperators: ["8"],
|
||||||
|
setupTime: 15,
|
||||||
|
processTime: 45,
|
||||||
|
status: WorkOrderStatusEnum.Created,
|
||||||
|
confirmations: [],
|
||||||
|
qualityChecks: [],
|
||||||
|
creationTime: new Date("2024-01-25"),
|
||||||
|
lastModificationTime: new Date("2024-02-10"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "WO-2024-007",
|
||||||
|
workOrderNumber: "WO-2024-007",
|
||||||
|
productionOrderId: mockProductionOrders[0].id,
|
||||||
|
productionOrder: mockProductionOrders[0],
|
||||||
|
operationId: "2",
|
||||||
|
operation: mockOperations.find((op) => op.id === "2"),
|
||||||
|
materialId: "4",
|
||||||
|
material: mockMaterials.find((m) => m.id === "4"),
|
||||||
|
sequence: 4,
|
||||||
|
plannedStartDate: new Date("2024-01-25"),
|
||||||
|
plannedEndDate: new Date("2024-01-30"),
|
||||||
|
plannedQuantity: 10,
|
||||||
|
confirmedQuantity: 0,
|
||||||
|
scrapQuantity: 0,
|
||||||
|
workCenterId: "7",
|
||||||
|
workCenter: mockWorkCenters.find((wc) => wc.id === "7"),
|
||||||
|
assignedOperators: ["9"],
|
||||||
|
setupTime: 10,
|
||||||
|
processTime: 30,
|
||||||
|
status: WorkOrderStatusEnum.Cancelled,
|
||||||
|
confirmations: [],
|
||||||
|
qualityChecks: [],
|
||||||
|
creationTime: new Date("2024-01-10"),
|
||||||
|
lastModificationTime: new Date("2024-01-25"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "WO-2024-008",
|
||||||
|
workOrderNumber: "WO-2024-008",
|
||||||
|
productionOrderId: mockProductionOrders[1].id,
|
||||||
|
productionOrder: mockProductionOrders[1],
|
||||||
|
operationId: "3",
|
||||||
|
operation: mockOperations.find((op) => op.id === "3"),
|
||||||
|
materialId: "2",
|
||||||
|
material: mockMaterials.find((m) => m.id === "2"),
|
||||||
|
sequence: 4,
|
||||||
|
plannedStartDate: new Date("2024-02-15"),
|
||||||
|
plannedEndDate: new Date("2024-02-20"),
|
||||||
|
plannedQuantity: 5,
|
||||||
|
confirmedQuantity: 0,
|
||||||
|
scrapQuantity: 0,
|
||||||
|
workCenterId: "8",
|
||||||
|
workCenter: mockWorkCenters.find((wc) => wc.id === "8"),
|
||||||
|
assignedOperators: ["10"],
|
||||||
|
setupTime: 10,
|
||||||
|
processTime: 30,
|
||||||
|
status: WorkOrderStatusEnum.Created,
|
||||||
|
confirmations: [],
|
||||||
|
qualityChecks: [],
|
||||||
|
creationTime: new Date("2024-01-25"),
|
||||||
|
lastModificationTime: new Date("2024-02-15"),
|
||||||
|
},
|
||||||
|
];
|
||||||
40
ui/src/mocks/mockZones.ts
Normal file
40
ui/src/mocks/mockZones.ts
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
import { WmZone, ZoneTypeEnum } from "../types/wm";
|
||||||
|
|
||||||
|
export const mockZones: WmZone[] = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
warehouseId: "1",
|
||||||
|
zoneCode: "Z001",
|
||||||
|
name: "Giriş Bölgesi",
|
||||||
|
description: "Malzeme kabul bölgesi",
|
||||||
|
zoneType: ZoneTypeEnum.Receiving,
|
||||||
|
temperature: 20,
|
||||||
|
humidity: 45,
|
||||||
|
locations: [],
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
warehouseId: "1",
|
||||||
|
zoneCode: "Z002",
|
||||||
|
name: "Ana Depolama",
|
||||||
|
description: "Ana depolama alanı",
|
||||||
|
zoneType: ZoneTypeEnum.Storage,
|
||||||
|
temperature: 18,
|
||||||
|
humidity: 40,
|
||||||
|
locations: [],
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
warehouseId: "2",
|
||||||
|
zoneCode: "Z003",
|
||||||
|
name: "Sevkiyat Hazırlık",
|
||||||
|
description: "Sevkiyat hazırlık alanı",
|
||||||
|
zoneType: ZoneTypeEnum.Shipping,
|
||||||
|
temperature: 22,
|
||||||
|
humidity: 50,
|
||||||
|
locations: [],
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
222
ui/src/types/common.ts
Normal file
222
ui/src/types/common.ts
Normal file
|
|
@ -0,0 +1,222 @@
|
||||||
|
import { BankAccountTypeEnum } from "./fi";
|
||||||
|
import {
|
||||||
|
CrmActivity,
|
||||||
|
CustomerSegmentEnum,
|
||||||
|
CustomerTypeEnum,
|
||||||
|
CrmOpportunity,
|
||||||
|
CrmSalesOrder,
|
||||||
|
CrmSalesTarget,
|
||||||
|
CrmTerritory,
|
||||||
|
} from "./admin/crm";
|
||||||
|
import { HrEmployee } from "./hr";
|
||||||
|
import {
|
||||||
|
SupplierCardTypeEnum,
|
||||||
|
MmSupplierPerformance,
|
||||||
|
SupplierTypeEnum,
|
||||||
|
} from "./mm";
|
||||||
|
|
||||||
|
export interface DashboardStats {
|
||||||
|
// Gösterge Paneli İstatistikleri
|
||||||
|
totalMaterials: number;
|
||||||
|
criticalStock: number;
|
||||||
|
lowStock: number;
|
||||||
|
pendingOrders: number;
|
||||||
|
maintenanceDue: number;
|
||||||
|
activeProjects: number;
|
||||||
|
totalRevenue: number;
|
||||||
|
monthlyGrowth: number;
|
||||||
|
totalEmployees: number;
|
||||||
|
openOpportunities: number;
|
||||||
|
pendingPurchaseRequests: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface BusinessParty {
|
||||||
|
// İş Ortağı (Müşteri/Satıcı)
|
||||||
|
id: string;
|
||||||
|
code: string;
|
||||||
|
name: string;
|
||||||
|
address?: Address;
|
||||||
|
taxNumber?: string;
|
||||||
|
paymentTerms: PaymentTerms;
|
||||||
|
currency: string;
|
||||||
|
creditLimit: number;
|
||||||
|
isActive: boolean;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
partyType: PartyType;
|
||||||
|
primaryContact?: Contact;
|
||||||
|
contacts?: Contact[];
|
||||||
|
industry?: string;
|
||||||
|
email?: string;
|
||||||
|
phone?: string;
|
||||||
|
website?: string;
|
||||||
|
lastOrderDate?: Date;
|
||||||
|
status?: BusinessPartyStatusEnum;
|
||||||
|
|
||||||
|
//Customer’a özgü alanlar
|
||||||
|
customerType?: CustomerTypeEnum;
|
||||||
|
registrationNumber?: string;
|
||||||
|
customerSegment?: CustomerSegmentEnum;
|
||||||
|
assignedSalesRep?: string;
|
||||||
|
teamId?: string;
|
||||||
|
team?: Team;
|
||||||
|
totalRevenue?: number;
|
||||||
|
averageOrderValue?: number;
|
||||||
|
lifetimeValue?: number;
|
||||||
|
opportunities?: CrmOpportunity[];
|
||||||
|
orders?: CrmSalesOrder[];
|
||||||
|
activities?: CrmActivity[];
|
||||||
|
|
||||||
|
// Supplier’a özgü alanlar
|
||||||
|
supplierType?: SupplierTypeEnum;
|
||||||
|
cardNumber?: string;
|
||||||
|
cardType?: SupplierCardTypeEnum;
|
||||||
|
validFrom?: Date;
|
||||||
|
validTo?: Date;
|
||||||
|
currentBalance?: number;
|
||||||
|
discountRate?: number;
|
||||||
|
specialConditions?: string[];
|
||||||
|
performanceMetrics?: MmSupplierPerformance;
|
||||||
|
certifications?: string[];
|
||||||
|
bankAccounts?: BankAccount[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum BusinessPartyStatusEnum { // İş Ortağı Durumu
|
||||||
|
Prospect = "PROSPECT", // Potansiyel
|
||||||
|
Active = "ACTIVE", // Aktif
|
||||||
|
Inactive = "INACTIVE", // Pasif
|
||||||
|
Blocked = "BLOCKED", // Engellenmiş
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Team {
|
||||||
|
// Takım
|
||||||
|
id: string;
|
||||||
|
code: string;
|
||||||
|
name: string;
|
||||||
|
description?: string;
|
||||||
|
managerId: string;
|
||||||
|
manager?: HrEmployee;
|
||||||
|
members: TeamMember[];
|
||||||
|
territories?: CrmTerritory[];
|
||||||
|
targets?: CrmSalesTarget[];
|
||||||
|
specializations?: string[];
|
||||||
|
isActive: boolean;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TeamMember {
|
||||||
|
// Takım Üyesi
|
||||||
|
id: string;
|
||||||
|
teamId: string;
|
||||||
|
employeeId: string;
|
||||||
|
employee?: HrEmployee;
|
||||||
|
role: TeamRoleEnum;
|
||||||
|
joinDate: Date;
|
||||||
|
isActive: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Contact {
|
||||||
|
// İletişim
|
||||||
|
id: string;
|
||||||
|
customerId?: string;
|
||||||
|
firstName: string;
|
||||||
|
lastName: string;
|
||||||
|
fullName: string;
|
||||||
|
title?: string;
|
||||||
|
department?: string;
|
||||||
|
email: string;
|
||||||
|
phone?: string;
|
||||||
|
mobile?: string;
|
||||||
|
isPrimary: boolean;
|
||||||
|
isActive: boolean;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Address {
|
||||||
|
// Adres
|
||||||
|
street: string;
|
||||||
|
city: string;
|
||||||
|
state: string;
|
||||||
|
postalCode: string;
|
||||||
|
country: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Bank Management Types
|
||||||
|
export interface BankAccount {
|
||||||
|
// Banka Hesabı
|
||||||
|
id: string;
|
||||||
|
accountCode: string;
|
||||||
|
bankName: string;
|
||||||
|
branchName: string;
|
||||||
|
accountNumber: string;
|
||||||
|
iban: string;
|
||||||
|
accountType: BankAccountTypeEnum;
|
||||||
|
currency: string;
|
||||||
|
balance: number;
|
||||||
|
overdraftLimit: number;
|
||||||
|
dailyTransferLimit: number;
|
||||||
|
isActive: boolean;
|
||||||
|
contactPerson?: string;
|
||||||
|
phone?: string;
|
||||||
|
swiftCode?: string;
|
||||||
|
isDefault: boolean;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WidgetGroupDto {
|
||||||
|
// Widget Grubu
|
||||||
|
colGap?: number;
|
||||||
|
colSpan?: number;
|
||||||
|
className?: string;
|
||||||
|
items: WidgetEditDto[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WidgetEditDto {
|
||||||
|
// Widget Düzenleme
|
||||||
|
colGap: number;
|
||||||
|
colSpan: number;
|
||||||
|
sqlQuery?: string;
|
||||||
|
className?: string;
|
||||||
|
title: string;
|
||||||
|
value: string;
|
||||||
|
valueClassName: string;
|
||||||
|
color: string;
|
||||||
|
icon: string;
|
||||||
|
subTitle: string;
|
||||||
|
onClick: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum TeamRoleEnum { // Takım Rolü
|
||||||
|
Member = "MEMBER", // Üye
|
||||||
|
Lead = "LEAD", // Lider
|
||||||
|
Manager = "MANAGER", // Yönetici
|
||||||
|
Specialist = "SPECIALIST", // Uzman
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum PartyType { // İş Ortağı Türü
|
||||||
|
Customer = "CUSTOMER", // Müşteri
|
||||||
|
Supplier = "SUPPLIER", // Tedarikçi
|
||||||
|
Both = "BOTH", // Her İkisi
|
||||||
|
Other = "OTHER", // Diğer
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum PaymentTerms { // Ödeme Koşulları
|
||||||
|
Net15 = "NET15", // 15 Gün
|
||||||
|
Net30 = "NET30", // 30 Gün
|
||||||
|
Net45 = "NET45", // 45 Gün
|
||||||
|
Net60 = "NET60", // 60 Gün
|
||||||
|
Net90 = "NET90", // 90 Gün
|
||||||
|
COD = "COD", // Kapıda Ödeme
|
||||||
|
Prepaid = "PREPAID", // Peşin
|
||||||
|
Cash = "CASH", // Nakit
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum PriorityEnum { // Öncelik
|
||||||
|
Low = "LOW", // Düşük
|
||||||
|
Normal = "NORMAL", // Normal
|
||||||
|
High = "HIGH", // Yüksek
|
||||||
|
Urgent = "URGENT", // Acil
|
||||||
|
}
|
||||||
269
ui/src/types/crm.ts
Normal file
269
ui/src/types/crm.ts
Normal file
|
|
@ -0,0 +1,269 @@
|
||||||
|
import {
|
||||||
|
Address,
|
||||||
|
BusinessParty,
|
||||||
|
Contact,
|
||||||
|
PaymentTerms,
|
||||||
|
PriorityEnum,
|
||||||
|
} from "./common";
|
||||||
|
import { HrEmployee } from "./hr";
|
||||||
|
import { MmDelivery, MmMaterial, MmUnit } from "./mm";
|
||||||
|
|
||||||
|
export interface CrmSalesOrder {
|
||||||
|
// Satış Siparişi
|
||||||
|
id: string;
|
||||||
|
orderNumber: string;
|
||||||
|
customerId: string;
|
||||||
|
customer?: BusinessParty;
|
||||||
|
orderDate: Date;
|
||||||
|
requestedDeliveryDate: Date;
|
||||||
|
confirmedDeliveryDate?: Date;
|
||||||
|
status: SaleOrderStatusEnum;
|
||||||
|
subtotal: number;
|
||||||
|
taxAmount: number;
|
||||||
|
discountAmount: number;
|
||||||
|
totalAmount: number;
|
||||||
|
currency: string;
|
||||||
|
paymentTerms: PaymentTerms;
|
||||||
|
deliveryTerms?: string;
|
||||||
|
deliveryAddress: Address;
|
||||||
|
billingAddress: Address;
|
||||||
|
exchangeRate?: number;
|
||||||
|
discountRate?: number;
|
||||||
|
taxRate?: number;
|
||||||
|
specialInstructions?: string;
|
||||||
|
items: CrmSalesOrderItem[];
|
||||||
|
deliveries: MmDelivery[];
|
||||||
|
notes?: string;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CrmSalesOrderItem {
|
||||||
|
// Satış Sipariş Kalemi
|
||||||
|
id: string;
|
||||||
|
orderId: string;
|
||||||
|
materialId?: string;
|
||||||
|
material?: MmMaterial;
|
||||||
|
description: string;
|
||||||
|
quantity: number;
|
||||||
|
deliveredQuantity: number;
|
||||||
|
unitPrice: number;
|
||||||
|
totalAmount: number;
|
||||||
|
unitId: string;
|
||||||
|
unit?: MmUnit;
|
||||||
|
discountRate?: number;
|
||||||
|
discountAmount?: number;
|
||||||
|
taxRate?: number;
|
||||||
|
taxAmount?: number;
|
||||||
|
notes?: string;
|
||||||
|
requestedDate: Date;
|
||||||
|
confirmedDate?: Date;
|
||||||
|
status: SaleOrderItemStatusEnum;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CrmTerritory {
|
||||||
|
// Sales Bölgesi
|
||||||
|
id: string;
|
||||||
|
territoryCode: string;
|
||||||
|
name: string;
|
||||||
|
description?: string;
|
||||||
|
region: string;
|
||||||
|
countries: string[];
|
||||||
|
cities: string[];
|
||||||
|
assignedTeamId?: string;
|
||||||
|
assignedSalesRep?: string;
|
||||||
|
isActive: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CrmOpportunity {
|
||||||
|
// Fırsat
|
||||||
|
id: string;
|
||||||
|
opportunityNumber: string;
|
||||||
|
title: string;
|
||||||
|
description?: string;
|
||||||
|
customerId: string;
|
||||||
|
customer?: BusinessParty;
|
||||||
|
contactId?: string;
|
||||||
|
contact?: Contact;
|
||||||
|
stage: OpportunityStageEnum;
|
||||||
|
probability: number;
|
||||||
|
estimatedValue: number;
|
||||||
|
currency: string;
|
||||||
|
expectedCloseDate: Date;
|
||||||
|
actualCloseDate?: Date;
|
||||||
|
assignedTo: string;
|
||||||
|
assigned?: HrEmployee;
|
||||||
|
teamId?: string;
|
||||||
|
leadSource: LeadSourceEnum;
|
||||||
|
campaignId?: string;
|
||||||
|
status: OpportunityStatusEnum;
|
||||||
|
lostReason?: CrmLostReason;
|
||||||
|
activities: CrmActivity[];
|
||||||
|
competitors: CrmCompetitor[];
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CrmActivity {
|
||||||
|
// Aktivite
|
||||||
|
id: string;
|
||||||
|
activityType: CrmActivityTypeEnum;
|
||||||
|
subject: string;
|
||||||
|
description?: string;
|
||||||
|
customerId?: string;
|
||||||
|
customer?: BusinessParty;
|
||||||
|
opportunityId?: string;
|
||||||
|
opportunity?: CrmOpportunity;
|
||||||
|
contactId?: string;
|
||||||
|
contact?: Contact;
|
||||||
|
activityDate: Date;
|
||||||
|
startTime?: Date;
|
||||||
|
endTime?: Date;
|
||||||
|
duration?: number; // minutes
|
||||||
|
assignedTo: string;
|
||||||
|
assigned?: HrEmployee;
|
||||||
|
participants: string[];
|
||||||
|
status: ActivityStatusEnum;
|
||||||
|
priority: PriorityEnum;
|
||||||
|
followUpDate?: Date;
|
||||||
|
followUpActivity?: string;
|
||||||
|
outcome?: string;
|
||||||
|
nextSteps?: string;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CrmCompetitor {
|
||||||
|
// Rakip
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
website?: string;
|
||||||
|
strengths: string[];
|
||||||
|
weaknesses: string[];
|
||||||
|
marketShare?: number;
|
||||||
|
isActive: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CrmLostReason {
|
||||||
|
// Kaybedilme Nedeni
|
||||||
|
id: string;
|
||||||
|
code: string;
|
||||||
|
name: string;
|
||||||
|
description?: string;
|
||||||
|
category: LostReasonCategoryEnum;
|
||||||
|
isActive: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CrmSalesTarget {
|
||||||
|
// Satış Hedefi
|
||||||
|
id: string;
|
||||||
|
teamId?: string;
|
||||||
|
employeeId?: string;
|
||||||
|
targetPeriod: string;
|
||||||
|
targetType: TargetTypeEnum;
|
||||||
|
targetValue: number;
|
||||||
|
actualValue: number;
|
||||||
|
currency: string;
|
||||||
|
startDate: Date;
|
||||||
|
endDate: Date;
|
||||||
|
status: TargetStatusEnum;
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum CustomerTypeEnum { // Müşteri Türü
|
||||||
|
Individual = "INDIVIDUAL", // Bireysel
|
||||||
|
Company = "COMPANY", // Şirket
|
||||||
|
Government = "GOVERNMENT", // Devlet
|
||||||
|
NonProfit = "NON_PROFIT", // Kar Amacı Gütmeyen
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum CustomerSegmentEnum { // Müşteri Segmenti
|
||||||
|
Enterprise = "ENTERPRISE", // Kurumsal
|
||||||
|
SMB = "SMB", // KOBİ
|
||||||
|
Startup = "STARTUP", // Yeni Kuruluş
|
||||||
|
Government = "GOVERNMENT", // Devlet
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum OpportunityStageEnum { // Fırsat Aşaması
|
||||||
|
Qualification = "QUALIFICATION", // Nitelik
|
||||||
|
NeedsAnalysis = "NEEDS_ANALYSIS", // İhtiyaç Analizi
|
||||||
|
Proposal = "PROPOSAL", // Teklif
|
||||||
|
Negotiation = "NEGOTIATION", // Müzakere
|
||||||
|
ClosedWon = "CLOSED_WON", // Kazanıldı
|
||||||
|
ClosedLost = "CLOSED_LOST", // Kaybedildi
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum OpportunityStatusEnum { // Fırsat Durumu
|
||||||
|
Open = "OPEN", // Açık
|
||||||
|
Won = "WON", // Kazanıldı
|
||||||
|
Lost = "LOST", // Kaybedildi
|
||||||
|
Cancelled = "CANCELLED", // İptal Edildi
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum LeadSourceEnum { // Lead Kaynağı
|
||||||
|
Website = "WEBSITE", // Web Sitesi
|
||||||
|
Referral = "REFERRAL", // Tavsiye
|
||||||
|
Campaign = "CAMPAIGN", // Kampanya
|
||||||
|
Trade_Show = "TRADE_SHOW", // Fuar
|
||||||
|
Cold_Call = "COLD_CALL", // Soğuk Arama
|
||||||
|
Social_Media = "SOCIAL_MEDIA", // Sosyal Medya
|
||||||
|
Partner = "PARTNER", // İş Ortağı
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum SaleOrderStatusEnum { // Satış Siparişi Durumu
|
||||||
|
Draft = "DRAFT", // Taslak
|
||||||
|
Confirmed = "CONFIRMED", // Onaylandı
|
||||||
|
InProduction = "IN_PRODUCTION", // Üretimde
|
||||||
|
Ready = "READY", // Hazır
|
||||||
|
Shipped = "SHIPPED", // Gönderildi
|
||||||
|
Delivered = "DELIVERED", // Teslim Edildi
|
||||||
|
Cancelled = "CANCELLED", // İptal Edildi
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum SaleOrderItemStatusEnum { // Satış Sipariş Kalemi Durumu
|
||||||
|
Pending = "PENDING", // Beklemede
|
||||||
|
Confirmed = "CONFIRMED", // Onaylandı
|
||||||
|
InProduction = "IN_PRODUCTION", // Üretimde
|
||||||
|
Ready = "READY", // Hazır
|
||||||
|
Shipped = "SHIPPED", // Gönderildi
|
||||||
|
Delivered = "DELIVERED", // Teslim Edildi
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum CrmActivityTypeEnum { // Aktivite Türü
|
||||||
|
Call = "CALL", // Telefon
|
||||||
|
Email = "EMAIL", // E-posta
|
||||||
|
Meeting = "MEETING", // Toplantı
|
||||||
|
Task = "TASK", // Görev
|
||||||
|
Note = "NOTE", // Not
|
||||||
|
Demo = "DEMO", // Demo
|
||||||
|
Proposal = "PROPOSAL", // Teklif
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum ActivityStatusEnum { // Aktivite Durumu
|
||||||
|
Planned = "PLANNED", // Planlandı
|
||||||
|
InProgress = "IN_PROGRESS", // Devam Ediyor
|
||||||
|
Completed = "COMPLETED", // Tamamlandı
|
||||||
|
Cancelled = "CANCELLED", // İptal Edildi
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum LostReasonCategoryEnum { // Kaybedilme Nedeni Kategorisi
|
||||||
|
Price = "PRICE", // Fiyat
|
||||||
|
Product = "PRODUCT", // Ürün
|
||||||
|
Service = "SERVICE", // Hizmet
|
||||||
|
Competitor = "COMPETITOR", // Rakip
|
||||||
|
Timing = "TIMING", // Zamanlama
|
||||||
|
Budget = "BUDGET", // Bütçe
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum TargetTypeEnum { // Hedef Türü
|
||||||
|
Revenue = "REVENUE", // Gelir
|
||||||
|
Units = "UNITS", // Birimler
|
||||||
|
Opportunities = "OPPORTUNITIES", // Fırsatlar
|
||||||
|
Customers = "CUSTOMERS", // Müşteriler
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum TargetStatusEnum { // Hedef Durumu
|
||||||
|
Active = "ACTIVE", // Aktif
|
||||||
|
Achieved = "ACHIEVED", // Gerçekleşti
|
||||||
|
Missed = "MISSED", // Kaçırıldı
|
||||||
|
Cancelled = "CANCELLED", // İptal Edildi
|
||||||
|
}
|
||||||
362
ui/src/types/fi.ts
Normal file
362
ui/src/types/fi.ts
Normal file
|
|
@ -0,0 +1,362 @@
|
||||||
|
import { BankAccount, BusinessParty } from "./common";
|
||||||
|
import { MmMaterial } from "./mm";
|
||||||
|
|
||||||
|
export interface FiCurrentAccount {
|
||||||
|
// Cari Hesabı
|
||||||
|
id: string;
|
||||||
|
accountCode: string;
|
||||||
|
businessPartyId: string;
|
||||||
|
businessParty?: BusinessParty;
|
||||||
|
type: AccountTypeEnum;
|
||||||
|
contactPerson?: string;
|
||||||
|
phone?: string;
|
||||||
|
email?: string;
|
||||||
|
address?: string;
|
||||||
|
taxNumber?: string;
|
||||||
|
taxOffice?: string;
|
||||||
|
creditLimit: number;
|
||||||
|
balance: number;
|
||||||
|
currency: string;
|
||||||
|
isActive: boolean;
|
||||||
|
riskGroup: RiskGroupEnum;
|
||||||
|
paymentTerm: number;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
lastTransactionDate?: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FiCurrentAccountMovement {
|
||||||
|
// Cari Hesap Hareketi
|
||||||
|
id: string;
|
||||||
|
accountId: string;
|
||||||
|
account?: FiCurrentAccount;
|
||||||
|
transactionDate: Date;
|
||||||
|
description: string;
|
||||||
|
referenceNumber?: string;
|
||||||
|
documentType: FiDocumentTypeEnum;
|
||||||
|
documentNumber?: string;
|
||||||
|
debitAmount: number;
|
||||||
|
creditAmount: number;
|
||||||
|
balance: number;
|
||||||
|
currency: string;
|
||||||
|
invoiceId?: string;
|
||||||
|
paymentId?: string;
|
||||||
|
creationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FiInvoice {
|
||||||
|
// Fatura
|
||||||
|
id: string;
|
||||||
|
invoiceNumber: string;
|
||||||
|
invoiceType: InvoiceTypeEnum;
|
||||||
|
currentAccountId: string;
|
||||||
|
currentAccount?: FiCurrentAccount;
|
||||||
|
invoiceDate: Date;
|
||||||
|
dueDate: Date;
|
||||||
|
deliveryDate?: Date;
|
||||||
|
subtotal: number;
|
||||||
|
taxAmount: number;
|
||||||
|
discountAmount: number;
|
||||||
|
totalAmount: number;
|
||||||
|
paidAmount: number;
|
||||||
|
remainingAmount: number;
|
||||||
|
currency: string;
|
||||||
|
status: InvoiceStatusEnum;
|
||||||
|
paymentStatus: PaymentStatusEnum;
|
||||||
|
items: FiInvoiceItem[];
|
||||||
|
waybillNumber?: string;
|
||||||
|
waybillDate?: Date;
|
||||||
|
notes?: string;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FiInvoiceItem {
|
||||||
|
// Fatura Kalemi
|
||||||
|
id: string;
|
||||||
|
invoiceId: string;
|
||||||
|
materialId?: string;
|
||||||
|
material?: MmMaterial;
|
||||||
|
description: string;
|
||||||
|
quantity: number;
|
||||||
|
unit: string;
|
||||||
|
unitPrice: number;
|
||||||
|
lineTotal: number;
|
||||||
|
discountRate: number;
|
||||||
|
discountAmount: number;
|
||||||
|
taxRate: number;
|
||||||
|
taxAmount: number;
|
||||||
|
netAmount: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FiWaybill {
|
||||||
|
// İrsaliye
|
||||||
|
id: string;
|
||||||
|
waybillNumber: string;
|
||||||
|
waybillType: WaybillTypeEnum;
|
||||||
|
currentAccountId: string;
|
||||||
|
currentAccount?: FiCurrentAccount;
|
||||||
|
waybillDate: Date;
|
||||||
|
deliveryDate?: Date;
|
||||||
|
subtotal: number;
|
||||||
|
taxAmount: number;
|
||||||
|
discountAmount: number;
|
||||||
|
totalAmount: number;
|
||||||
|
currency: string;
|
||||||
|
status: WaybillStatusEnum;
|
||||||
|
isInvoiced: boolean;
|
||||||
|
invoiceId?: string;
|
||||||
|
items: FiWaybillItem[];
|
||||||
|
deliveryAddress?: string;
|
||||||
|
receiverName?: string;
|
||||||
|
receiverPhone?: string;
|
||||||
|
carrierCompany?: string;
|
||||||
|
trackingNumber?: string;
|
||||||
|
notes?: string;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FiWaybillItem {
|
||||||
|
// İrsaliye Kalemi
|
||||||
|
id: string;
|
||||||
|
waybillId: string;
|
||||||
|
materialId?: string;
|
||||||
|
material?: MmMaterial;
|
||||||
|
description: string;
|
||||||
|
quantity: number;
|
||||||
|
unit: string;
|
||||||
|
unitPrice: number;
|
||||||
|
lineTotal: number;
|
||||||
|
discountRate: number;
|
||||||
|
discountAmount: number;
|
||||||
|
taxRate: number;
|
||||||
|
taxAmount: number;
|
||||||
|
netAmount: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FiCashAccount {
|
||||||
|
// Kasa Hesabı
|
||||||
|
id: string;
|
||||||
|
accountCode: string;
|
||||||
|
name: string;
|
||||||
|
description?: string;
|
||||||
|
currency: string;
|
||||||
|
balance: number;
|
||||||
|
isActive: boolean;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FiCashMovement {
|
||||||
|
// Kasa Hareketi
|
||||||
|
id: string;
|
||||||
|
cashAccountId: string;
|
||||||
|
cashAccount?: FiCashAccount;
|
||||||
|
transactionDate: Date;
|
||||||
|
description: string;
|
||||||
|
referenceNumber?: string;
|
||||||
|
movementType: CashMovementTypeEnum;
|
||||||
|
amount: number;
|
||||||
|
currency: string;
|
||||||
|
documentType?: FiDocumentTypeEnum;
|
||||||
|
documentNumber?: string;
|
||||||
|
currentAccountId?: string;
|
||||||
|
currentAccount?: FiCurrentAccount;
|
||||||
|
creationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FiBankMovement {
|
||||||
|
// Banka Hareketi
|
||||||
|
id: string;
|
||||||
|
bankAccountId: string;
|
||||||
|
bankAccount?: BankAccount;
|
||||||
|
transactionDate: Date;
|
||||||
|
valueDate: Date;
|
||||||
|
description: string;
|
||||||
|
referenceNumber?: string;
|
||||||
|
transactionType: BankTransactionTypeEnum;
|
||||||
|
amount: number;
|
||||||
|
currency: string;
|
||||||
|
recipientName?: string;
|
||||||
|
recipientIban?: string;
|
||||||
|
recipientBank?: string;
|
||||||
|
documentType?: FiDocumentTypeEnum;
|
||||||
|
documentNumber?: string;
|
||||||
|
currentAccountId?: string;
|
||||||
|
currentAccount?: FiCurrentAccount;
|
||||||
|
status: TransactionStatusEnum;
|
||||||
|
creationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FiCheck {
|
||||||
|
// Çek
|
||||||
|
id: string;
|
||||||
|
checkNumber: string;
|
||||||
|
bankName: string;
|
||||||
|
branchName: string;
|
||||||
|
accountNumber: string;
|
||||||
|
drawerName: string;
|
||||||
|
payeeName: string;
|
||||||
|
currentAccountId?: string;
|
||||||
|
currentAccount?: FiCurrentAccount;
|
||||||
|
issueDate: Date;
|
||||||
|
dueDate: Date;
|
||||||
|
amount: number;
|
||||||
|
currency: string;
|
||||||
|
status: CheckStatusEnum;
|
||||||
|
type: CheckTypeEnum;
|
||||||
|
bankingDate?: Date;
|
||||||
|
collectionDate?: Date;
|
||||||
|
endorsedTo?: string;
|
||||||
|
notes?: string;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PromissoryNote {
|
||||||
|
// Senet
|
||||||
|
id: string;
|
||||||
|
noteNumber: string;
|
||||||
|
drawerName: string;
|
||||||
|
payeeName: string;
|
||||||
|
currentAccountId?: string;
|
||||||
|
currentAccount?: FiCurrentAccount;
|
||||||
|
issueDate: Date;
|
||||||
|
dueDate: Date;
|
||||||
|
amount: number;
|
||||||
|
currency: string;
|
||||||
|
status: NoteStatusEnum;
|
||||||
|
type: NoteTypeEnum; // Received or Issued
|
||||||
|
collectionDate?: Date;
|
||||||
|
endorsedTo?: string;
|
||||||
|
location?: string;
|
||||||
|
notes?: string;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Enums
|
||||||
|
export enum AccountTypeEnum {
|
||||||
|
Customer = "CUSTOMER", // Müşteri
|
||||||
|
Supplier = "SUPPLIER", // Tedarikçi
|
||||||
|
Both = "BOTH", // Her İkisi de
|
||||||
|
Other = "OTHER", // Diğer
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum RiskGroupEnum {
|
||||||
|
Low = "LOW", // Düşük
|
||||||
|
Medium = "MEDIUM", // Orta
|
||||||
|
High = "HIGH", // Yüksek
|
||||||
|
Blocked = "BLOCKED", // Bloke
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum FiDocumentTypeEnum {
|
||||||
|
Invoice = "INVOICE", // Fatura
|
||||||
|
Waybill = "WAYBILL", // İrsaliye
|
||||||
|
Receipt = "RECEIPT", // Makbuz
|
||||||
|
Payment = "PAYMENT", // Ödeme
|
||||||
|
BankTransfer = "BANK_TRANSFER", // Banka Transferi
|
||||||
|
CashMovement = "CASH_MOVEMENT", // Kasa Hareketi
|
||||||
|
Check = "CHECK", // Çek
|
||||||
|
PromissoryNote = "PROMISSORY_NOTE", // Senet
|
||||||
|
Other = "OTHER", //Diğer
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum InvoiceTypeEnum {
|
||||||
|
Sales = "SALES", // Satış
|
||||||
|
Purchase = "PURCHASE", // Satın Alma
|
||||||
|
Return = "RETURN", // İade
|
||||||
|
Proforma = "PROFORMA", // Proforma
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum InvoiceStatusEnum {
|
||||||
|
Draft = "DRAFT", // Taslak
|
||||||
|
Sent = "SENT", // Gönderildi
|
||||||
|
Approved = "APPROVED", // Onaylandı
|
||||||
|
Cancelled = "CANCELLED", // İptal
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum PaymentStatusEnum {
|
||||||
|
Unpaid = "UNPAID", // Ödenmemiş
|
||||||
|
PartiallyPaid = "PARTIALLY_PAID", // Kısmen Ödenmiş
|
||||||
|
Paid = "PAID", // Ödenmiş
|
||||||
|
Overdue = "OVERDUE", // Vadesi Geçmiş
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum CashMovementTypeEnum {
|
||||||
|
Income = "INCOME", // Gelir
|
||||||
|
Expense = "EXPENSE", // Gider
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum BankAccountTypeEnum {
|
||||||
|
Current = "CURRENT", // Vadesiz
|
||||||
|
Deposit = "DEPOSIT", // Vadeli
|
||||||
|
Credit = "CREDIT", // Kredi
|
||||||
|
Foreign = "FOREIGN", // Yabancı Para
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum BankTransactionTypeEnum {
|
||||||
|
Deposit = "DEPOSIT", // PARA YATIRMA
|
||||||
|
Withdrawal = "WITHDRAWAL", // PARA ÇEKME
|
||||||
|
Transfer = "TRANSFER", // HAVALE
|
||||||
|
EFT = "EFT", // EFT
|
||||||
|
Fee = "FEE", // MASRAF
|
||||||
|
Interest = "INTEREST", // FAİZ
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum TransactionStatusEnum {
|
||||||
|
Pending = "PENDING", // BEKLEMEDE
|
||||||
|
Completed = "COMPLETED", // TAMAMLANDI
|
||||||
|
Failed = "FAILED", // BAŞARISIZ
|
||||||
|
Cancelled = "CANCELLED", // İPTAL EDİLDİ
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum CheckStatusEnum {
|
||||||
|
InHand = "IN_HAND", // CÜZDANDA
|
||||||
|
Deposited = "DEPOSITED", // HESABA YATIRILDI
|
||||||
|
Collected = "COLLECTED", // TAHSİL EDİLDİ
|
||||||
|
Bounced = "BOUNCED", // İADE OLDU
|
||||||
|
Endorsed = "ENDORSED", // CIRO EDİLDİ
|
||||||
|
Cancelled = "CANCELLED", // İPTAL EDİLDİ
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum CheckTypeEnum {
|
||||||
|
Received = "RECEIVED", // ALINAN
|
||||||
|
Issued = "ISSUED", // VERİLEN
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum NoteStatusEnum {
|
||||||
|
InHand = "IN_HAND", // CÜZDANDA
|
||||||
|
Collected = "COLLECTED", // TAHSİL EDİLDİ
|
||||||
|
Overdue = "OVERDUE", // VADESİ GEÇMİŞ
|
||||||
|
Endorsed = "ENDORSED", // CIRO EDİLDİ
|
||||||
|
Cancelled = "CANCELLED", // İPTAL EDİLDİ
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum NoteTypeEnum {
|
||||||
|
Received = "RECEIVED", // Alınan
|
||||||
|
Issued = "ISSUED", // Verilen
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum WaybillTypeEnum {
|
||||||
|
Outgoing = "outgoing", // Çıkış İrsaliyesi
|
||||||
|
Incoming = "incoming", // Giriş İrsaliyesi
|
||||||
|
Transfer = "transfer", // Transfer İrsaliyesi
|
||||||
|
Return = "return", // İade İrsaliyesi
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum WaybillStatusEnum {
|
||||||
|
Draft = "draft", // Taslak
|
||||||
|
Confirmed = "confirmed", // Onaylandı
|
||||||
|
Delivered = "delivered", // Teslim Edildi
|
||||||
|
Cancelled = "cancelled", // İptal
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum PaymentMethodEnum {
|
||||||
|
Cash = "cash", // Nakit
|
||||||
|
BankTransfer = "bank_transfer", // Banka Transferi
|
||||||
|
CreditCard = "credit_card", // Kredi Kartı
|
||||||
|
Check = "check", // Çek
|
||||||
|
PromissoryNote = "promissory_note", // Senet
|
||||||
|
}
|
||||||
702
ui/src/types/hr.ts
Normal file
702
ui/src/types/hr.ts
Normal file
|
|
@ -0,0 +1,702 @@
|
||||||
|
import { Address, BankAccount } from "./common";
|
||||||
|
|
||||||
|
export interface HrEmployee { // İnsan Kaynakları Çalışanı
|
||||||
|
id: string;
|
||||||
|
code: string;
|
||||||
|
firstName: string;
|
||||||
|
lastName: string;
|
||||||
|
fullName: string;
|
||||||
|
email: string;
|
||||||
|
phone?: string;
|
||||||
|
personalPhone?: string;
|
||||||
|
nationalId: string;
|
||||||
|
birthDate: Date;
|
||||||
|
gender: GenderEnum;
|
||||||
|
maritalStatus: MaritalStatusEnum;
|
||||||
|
address: Address;
|
||||||
|
emergencyContact: HrEmergencyContact;
|
||||||
|
hireDate: Date;
|
||||||
|
terminationDate?: Date;
|
||||||
|
employmentType: EmploymentTypeEnum;
|
||||||
|
jobPositionId: string;
|
||||||
|
jobPosition?: HrJobPosition;
|
||||||
|
departmantId: string;
|
||||||
|
department?: HrDepartment;
|
||||||
|
managerId?: string;
|
||||||
|
manager?: HrEmployee;
|
||||||
|
baseSalary: number;
|
||||||
|
currency: string;
|
||||||
|
payrollGroup: string;
|
||||||
|
bankAccountId: string;
|
||||||
|
bankAccount?: BankAccount;
|
||||||
|
workLocation: string;
|
||||||
|
workSchedule?: HrWorkSchedule;
|
||||||
|
badgeNumber?: string;
|
||||||
|
employeeStatus: EmployeeStatusEnum;
|
||||||
|
isActive: boolean;
|
||||||
|
leaves: HrLeave[];
|
||||||
|
evaluations: HrPerformanceEvaluation[];
|
||||||
|
trainings: HrTraining[];
|
||||||
|
disciplinaryActions: HrDisciplinaryAction[];
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HrCostCenter { // İnsan Kaynakları Masraf Merkezi
|
||||||
|
id: string;
|
||||||
|
code: string;
|
||||||
|
name: string;
|
||||||
|
description?: string;
|
||||||
|
parentCostCenterId?: string;
|
||||||
|
parentCostCenter?: HrCostCenter;
|
||||||
|
subCostCenters: HrCostCenter[];
|
||||||
|
responsibleEmployeeId?: string;
|
||||||
|
responsibleEmployee?: HrEmployee;
|
||||||
|
departmentId?: string;
|
||||||
|
department?: HrDepartment;
|
||||||
|
costCenterType: CostCenterType;
|
||||||
|
budgetedAmount: number;
|
||||||
|
actualAmount: number;
|
||||||
|
currency: string;
|
||||||
|
fiscalYear: string;
|
||||||
|
isActive: boolean;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HrDepartment { // İnsan Kaynakları Departmanı
|
||||||
|
id: string;
|
||||||
|
code: string;
|
||||||
|
name: string;
|
||||||
|
description?: string;
|
||||||
|
parentDepartmentId?: string;
|
||||||
|
parentDepartment?: HrDepartment;
|
||||||
|
subDepartments: HrDepartment[];
|
||||||
|
managerId?: string;
|
||||||
|
manager?: HrEmployee;
|
||||||
|
costCenterId?: string;
|
||||||
|
costCenter?: HrCostCenter;
|
||||||
|
budget: number;
|
||||||
|
isActive: boolean;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HrJobPosition { // İnsan Kaynakları İş Pozisyonu
|
||||||
|
id: string;
|
||||||
|
code: string;
|
||||||
|
name: string;
|
||||||
|
description?: string;
|
||||||
|
departmentId: string;
|
||||||
|
department?: HrDepartment;
|
||||||
|
level: JobLevelEnum;
|
||||||
|
minSalary: number;
|
||||||
|
maxSalary: number;
|
||||||
|
currency: string;
|
||||||
|
requiredSkills: string[];
|
||||||
|
responsibilities: string[];
|
||||||
|
qualifications: string[];
|
||||||
|
isActive: boolean;
|
||||||
|
employees: HrEmployee[];
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HrLeave { // İnsan Kaynakları İzni
|
||||||
|
id: string;
|
||||||
|
employeeId: string;
|
||||||
|
employee?: HrEmployee;
|
||||||
|
leaveType: LeaveTypeEnum;
|
||||||
|
startDate: Date;
|
||||||
|
endDate: Date;
|
||||||
|
totalDays: number;
|
||||||
|
reason?: string;
|
||||||
|
status: LeaveStatusEnum;
|
||||||
|
appliedDate: Date;
|
||||||
|
approvedBy?: string;
|
||||||
|
approvedDate?: Date;
|
||||||
|
rejectionReason?: string;
|
||||||
|
isHalfDay: boolean;
|
||||||
|
attachments: string[];
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HrPerformanceEvaluation { // İnsan Kaynakları Performans Değerlendirmesi
|
||||||
|
id: string;
|
||||||
|
employeeId: string;
|
||||||
|
employee?: HrEmployee;
|
||||||
|
evaluatorId: string;
|
||||||
|
evaluator?: HrEmployee;
|
||||||
|
evaluationPeriod: string;
|
||||||
|
evaluationType: EvaluationTypeEnum;
|
||||||
|
overallRating: number;
|
||||||
|
goals: HrPerformanceGoal[];
|
||||||
|
competencies: HrCompetencyRating[];
|
||||||
|
strengths: string[];
|
||||||
|
areasForImprovement: string[];
|
||||||
|
developmentPlan: string[];
|
||||||
|
comments?: string;
|
||||||
|
status: EvaluationStatusEnum;
|
||||||
|
dueDate: Date;
|
||||||
|
completedDate?: Date;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HrPerformanceGoal { // İnsan Kaynakları Performans Hedefi
|
||||||
|
id: string;
|
||||||
|
evaluationId: string;
|
||||||
|
goalDescription: string;
|
||||||
|
targetValue?: string;
|
||||||
|
actualValue?: string;
|
||||||
|
weight: number;
|
||||||
|
rating: number;
|
||||||
|
comments?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HrCompetencyRating { // İnsan Kaynakları Yeterlilik Değerlendirmesi
|
||||||
|
id: string;
|
||||||
|
evaluationId: string;
|
||||||
|
competencyName: string;
|
||||||
|
expectedLevel: number;
|
||||||
|
actualLevel: number;
|
||||||
|
rating: number;
|
||||||
|
comments?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HrTraining { // İnsan Kaynakları Eğitimi
|
||||||
|
id: string;
|
||||||
|
trainingCode: string;
|
||||||
|
title: string;
|
||||||
|
description?: string;
|
||||||
|
trainingType: TrainingTypeEnum;
|
||||||
|
provider: string;
|
||||||
|
startDate: Date;
|
||||||
|
endDate: Date;
|
||||||
|
duration: number;
|
||||||
|
location?: string;
|
||||||
|
isOnline: boolean;
|
||||||
|
maxParticipants?: number;
|
||||||
|
cost: number;
|
||||||
|
currency: string;
|
||||||
|
status: TrainingStatusEnum;
|
||||||
|
participants: HrTrainingParticipant[];
|
||||||
|
materials: string[];
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HrTrainingParticipant { // İnsan Kaynakları Eğitim Katılımcısı
|
||||||
|
id: string;
|
||||||
|
trainingId: string;
|
||||||
|
employeeId: string;
|
||||||
|
employee?: HrEmployee;
|
||||||
|
enrollmentDate: Date;
|
||||||
|
completionDate?: Date;
|
||||||
|
status: ParticipationStatusEnum;
|
||||||
|
score?: number;
|
||||||
|
feedback?: string;
|
||||||
|
certificateIssued: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HrWorkSchedule { // İnsan Kaynakları Çalışma Programı
|
||||||
|
id: string;
|
||||||
|
scheduleCode: string;
|
||||||
|
name: string;
|
||||||
|
description?: string;
|
||||||
|
workingDays: HrWorkingDay[];
|
||||||
|
totalHoursPerWeek: number;
|
||||||
|
isFlexible: boolean;
|
||||||
|
isActive: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HrWorkingDay { // İnsan Kaynakları Çalışma Günü
|
||||||
|
dayOfWeek: number; // 0-6 (Sunday-Saturday)
|
||||||
|
isWorkingDay: boolean;
|
||||||
|
startTime?: string;
|
||||||
|
endTime?: string;
|
||||||
|
breakDuration?: number; // minutes
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HrDisciplinaryAction { // İnsan Kaynakları Disiplin Cezası
|
||||||
|
id: string;
|
||||||
|
employeeId: string;
|
||||||
|
employee?: HrEmployee;
|
||||||
|
actionType: DisciplinaryActionTypeEnum;
|
||||||
|
reason: string;
|
||||||
|
description: string;
|
||||||
|
actionDate: Date;
|
||||||
|
issuedBy: string;
|
||||||
|
severity: DisciplinarySeverityEnum;
|
||||||
|
status: DisciplinaryStatusEnum;
|
||||||
|
expiryDate?: Date;
|
||||||
|
attachments: string[];
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HrEmergencyContact { // İnsan Kaynakları Acil Durum İletişim
|
||||||
|
name: string;
|
||||||
|
relationship: string;
|
||||||
|
phone: string;
|
||||||
|
email?: string;
|
||||||
|
address?: Address;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HrEmploymentType { // İnsan Kaynakları İstihdam Türü
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
count?: number;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HrOvertime { // İnsan Kaynakları Fazla Mesai
|
||||||
|
id: string;
|
||||||
|
employeeId: string;
|
||||||
|
employee?: HrEmployee;
|
||||||
|
date: Date;
|
||||||
|
startTime: string;
|
||||||
|
endTime: string;
|
||||||
|
totalHours: number;
|
||||||
|
reason: string;
|
||||||
|
status: LeaveStatusEnum;
|
||||||
|
approvedBy?: string;
|
||||||
|
approver?: HrEmployee;
|
||||||
|
rate?: number;
|
||||||
|
amount?: number;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HrPayroll { // İnsan Kaynakları Maaş Bordrosu
|
||||||
|
id: string;
|
||||||
|
employeeId: string;
|
||||||
|
employee?: HrEmployee;
|
||||||
|
period: string;
|
||||||
|
baseSalary: number;
|
||||||
|
allowances: HrPayrollAllowance[];
|
||||||
|
deductions: HrPayrollDeduction[];
|
||||||
|
overtime: number;
|
||||||
|
bonus: number;
|
||||||
|
grossSalary: number;
|
||||||
|
netSalary: number;
|
||||||
|
tax: number;
|
||||||
|
socialSecurity: number;
|
||||||
|
status: PayrollStatusEnum;
|
||||||
|
paymentDate?: Date;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HrPayrollAllowance { // İnsan Kaynakları Maaş Ek Ödemesi
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
amount: number;
|
||||||
|
taxable: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HrPayrollDeduction { // İnsan Kaynakları Maaş Kesintisi
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
amount: number;
|
||||||
|
mandatory: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HrBadge { // İnsan Kaynakları Rozeti
|
||||||
|
id: string;
|
||||||
|
code: string;
|
||||||
|
name: string;
|
||||||
|
description: string;
|
||||||
|
icon: string;
|
||||||
|
color: string;
|
||||||
|
backgroundColor: string;
|
||||||
|
category: BadgeCategoryEnum;
|
||||||
|
criteria: string;
|
||||||
|
points: number;
|
||||||
|
rarity: BadgeRarityEnum;
|
||||||
|
isActive: boolean;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HrOrganizationChart { // İnsan Kaynakları Organizasyon Şeması
|
||||||
|
id: string;
|
||||||
|
employeeId: string;
|
||||||
|
employee?: HrEmployee;
|
||||||
|
parentId?: string;
|
||||||
|
parent?: HrOrganizationChart;
|
||||||
|
children?: HrOrganizationChart[];
|
||||||
|
level: number;
|
||||||
|
position: string;
|
||||||
|
isActive: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HrEmployeeBadge { // İnsan Kaynakları Çalışan Rozeti
|
||||||
|
id: string;
|
||||||
|
employeeId: string;
|
||||||
|
employee?: HrEmployee;
|
||||||
|
badgeId: string;
|
||||||
|
badge?: HrBadge;
|
||||||
|
earnedDate: Date;
|
||||||
|
expiryDate?: Date;
|
||||||
|
reason?: string;
|
||||||
|
notes?: string;
|
||||||
|
isActive: boolean;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HrEvaluation360Template { // İnsan Kaynakları 360 Derece Değerlendirme Şablonu
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
description: string;
|
||||||
|
isActive: boolean;
|
||||||
|
questionGroups: HrQuestionGroup[];
|
||||||
|
applicablePositions: string[]; // JobPosition ID'leri
|
||||||
|
applicableDepartments: string[]; // Department ID'leri
|
||||||
|
assessorTypes: AssessorTypeEnum[]; // Değerlendiriciler
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HrQuestionGroup { // İnsan Kaynakları Soru Grubu
|
||||||
|
id: string;
|
||||||
|
templateId: string;
|
||||||
|
groupName: string;
|
||||||
|
description?: string;
|
||||||
|
weight: number; // Bu grubun toplam puandaki ağırlığı (%)
|
||||||
|
order: number;
|
||||||
|
questions: HrEvaluationQuestion[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HrEvaluationQuestion { // İnsan Kaynakları Değerlendirme Sorusu
|
||||||
|
id: string;
|
||||||
|
groupId: string;
|
||||||
|
questionText: string;
|
||||||
|
questionType: QuestionTypeEnum;
|
||||||
|
isRequired: boolean;
|
||||||
|
weight: number; // Bu sorunun grup içindeki ağırlığı (%)
|
||||||
|
order: number;
|
||||||
|
options?: HrQuestionOption[]; // Çoktan seçmeli sorular için
|
||||||
|
minRating?: number;
|
||||||
|
maxRating?: number;
|
||||||
|
ratingLabels?: string[]; // Rating için etiketler (örn: ["Zayıf", "Orta", "İyi", "Mükemmel"])
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HrQuestionOption { // İnsan Kaynakları Soru Seçeneği
|
||||||
|
id: string;
|
||||||
|
questionId: string;
|
||||||
|
optionText: string;
|
||||||
|
value: number;
|
||||||
|
order: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HrEvaluation360 { // İnsan Kaynakları 360 Derece Değerlendirme Kampanyası
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
description: string;
|
||||||
|
templateId: string;
|
||||||
|
template?: HrEvaluation360Template;
|
||||||
|
evaluationPeriod: string;
|
||||||
|
startDate: Date;
|
||||||
|
endDate: Date;
|
||||||
|
status: CampaignStatusEnum;
|
||||||
|
departmentId?: string; // Hedef departman
|
||||||
|
targetEmployees: string[]; // Değerlendirilecek Employee ID'leri
|
||||||
|
settings: HrEvaluation360Settings;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HrEvaluation360Settings { // İnsan Kaynakları 360 Derece Değerlendirme Ayarları
|
||||||
|
allowSelfEvaluation: boolean;
|
||||||
|
requireManagerEvaluation: boolean;
|
||||||
|
minPeerEvaluations: number;
|
||||||
|
minSubordinateEvaluations: number;
|
||||||
|
allowAnonymousFeedback: boolean;
|
||||||
|
sendReminderEmails: boolean;
|
||||||
|
reminderIntervalDays: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HrEvaluation360Participant { // İnsan Kaynakları 360 Derece Değerlendirme Katılımcısı
|
||||||
|
id: string;
|
||||||
|
campaignId: string;
|
||||||
|
evaluatedEmployeeId: string; // Değerlendirilen kişi
|
||||||
|
evaluatedEmployee?: HrEmployee;
|
||||||
|
evaluatorId: string; // Değerlendiren kişi
|
||||||
|
evaluator?: HrEmployee;
|
||||||
|
evaluatorType: AssessorTypeEnum;
|
||||||
|
status: ParticipantStatusEnum;
|
||||||
|
invitedDate: Date;
|
||||||
|
startedDate?: Date;
|
||||||
|
completedDate?: Date;
|
||||||
|
responses: HrEvaluation360Response[];
|
||||||
|
overallScore?: number;
|
||||||
|
notes?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HrEvaluation360Response { // İnsan Kaynakları 360 Derece Değerlendirme Cevabı
|
||||||
|
id: string;
|
||||||
|
participantId: string;
|
||||||
|
questionId: string;
|
||||||
|
question?: HrEvaluationQuestion;
|
||||||
|
responseValue: string | number; // Cevap değeri
|
||||||
|
responseText?: string; // Metin cevaplar için
|
||||||
|
score: number; // Hesaplanan puan
|
||||||
|
submittedDate: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HrEvaluation360Result { // İnsan Kaynakları 360 Derece Değerlendirme Sonucu
|
||||||
|
id: string;
|
||||||
|
campaignId: string;
|
||||||
|
employeeId: string;
|
||||||
|
employee?: HrEmployee;
|
||||||
|
participants: HrEvaluation360Participant[]; // Bu sonuca katkıda bulunan değerlendiriciler
|
||||||
|
overallScore: number;
|
||||||
|
maxPossibleScore: number;
|
||||||
|
scorePercentage: number;
|
||||||
|
groupScores: HrGroupScore[];
|
||||||
|
assessorTypeScores: HrAssessorTypeScore[];
|
||||||
|
strengths: string[];
|
||||||
|
developmentAreas: string[];
|
||||||
|
actionPlan: string[];
|
||||||
|
managerComments?: string;
|
||||||
|
hrComments?: string;
|
||||||
|
status: ResultStatusEnum;
|
||||||
|
generatedDate: Date;
|
||||||
|
approvedBy?: string;
|
||||||
|
approvedDate?: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HrGroupScore { // İnsan Kaynakları Grup Puanı
|
||||||
|
groupId: string;
|
||||||
|
groupName: string;
|
||||||
|
score: number;
|
||||||
|
maxScore: number;
|
||||||
|
percentage: number;
|
||||||
|
responseCount: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HrAssessorTypeScore { // İnsan Kaynakları Değerlendirici Türü Puanı
|
||||||
|
assessorType: AssessorTypeEnum;
|
||||||
|
assessorCount: number;
|
||||||
|
averageScore: number;
|
||||||
|
maxScore: number;
|
||||||
|
percentage: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum PayrollStatusEnum { // Maaş Durumu
|
||||||
|
Draft = "DRAFT", // Taslak
|
||||||
|
Calculated = "CALCULATED", // Hesaplandı
|
||||||
|
Approved = "APPROVED", // Onaylandı
|
||||||
|
Paid = "PAID", // Ödendi
|
||||||
|
Cancelled = "CANCELLED", // İptal edildi
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum GoalStatusEnum { // Hedef Durumu
|
||||||
|
NotStarted = "NOT_STARTED", // Başlanmadı
|
||||||
|
InProgress = "IN_PROGRESS", // Devam Ediyor
|
||||||
|
Completed = "COMPLETED", // Tamamlandı
|
||||||
|
Overdue = "OVERDUE", // Geçmiş
|
||||||
|
Cancelled = "CANCELLED", // İptal edildi
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum BadgeCategoryEnum { // Rozet Kategorisi
|
||||||
|
Performance = "PERFORMANCE", // Performans
|
||||||
|
Leadership = "LEADERSHIP", // Liderlik
|
||||||
|
Innovation = "INNOVATION", // Yenilik
|
||||||
|
Teamwork = "TEAMWORK", // Takım Çalışması
|
||||||
|
Customer = "CUSTOMER", // Müşteri
|
||||||
|
Safety = "SAFETY", // Güvenlik
|
||||||
|
Attendance = "ATTENDANCE", // Devamsızlık
|
||||||
|
Training = "TRAINING", // Eğitim
|
||||||
|
Project = "PROJECT", // Proje
|
||||||
|
Special = "SPECIAL", // Özel
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum BadgeRarityEnum { // Rozet Nadirliği
|
||||||
|
Common = "COMMON", // Orta
|
||||||
|
Uncommon = "UNCOMMON", // Yaygın olmayan
|
||||||
|
Rare = "RARE", // Nadir
|
||||||
|
Epic = "EPIC", // Epik
|
||||||
|
Legendary = "LEGENDARY", // Efsanevi
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum ResultStatusEnum { // Sonuç Durumu
|
||||||
|
Pending = "PENDING", // Beklemede
|
||||||
|
InReview = "IN_REVIEW", // İnceleniyor
|
||||||
|
Approved = "APPROVED", // Onaylandı
|
||||||
|
Published = "PUBLISHED", // Yayınlandı
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum GenderEnum { // Cinsiyet
|
||||||
|
Male = "MALE", // Erkek
|
||||||
|
Female = "FEMALE", // Kadın
|
||||||
|
Other = "OTHER", // Diğer
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum MaritalStatusEnum { // Medeni Durum
|
||||||
|
Single = "SINGLE", // Bekar
|
||||||
|
Married = "MARRIED", // Evli
|
||||||
|
Divorced = "DIVORCED", // Boşanmış
|
||||||
|
Widowed = "WIDOWED", // Dul
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum CostCenterType { // Masraf Merkezi Türü
|
||||||
|
Revenue = "REVENUE", // Gelir
|
||||||
|
Standard = "STANDARD", // Standart
|
||||||
|
Discretionary = "DISCRETIONARY", // İsteğe bağlı
|
||||||
|
Investment = "INVESTMENT", // Yatırım
|
||||||
|
Service = "SERVICE", // Hizmet
|
||||||
|
Production = "PRODUCTION", // Üretim
|
||||||
|
Support = "SUPPORT", // Destek
|
||||||
|
Administrative = "ADMINISTRATIVE", // İdari
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum EmploymentTypeEnum { // İstihdam Türü
|
||||||
|
FullTime = "FULL_TIME", // Tam Zamanlı
|
||||||
|
PartTime = "PART_TIME", // Yarı Zamanlı
|
||||||
|
Contract = "CONTRACT", // Sözleşmeli
|
||||||
|
Intern = "INTERN", // Stajyer
|
||||||
|
Temporary = "TEMPORARY", // Geçici
|
||||||
|
Consultant = "CONSULTANT", // Danışman
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum EmployeeStatusEnum { // Çalışan Durumu
|
||||||
|
Active = "ACTIVE", // Aktif
|
||||||
|
Inactive = "INACTIVE", // Pasif
|
||||||
|
OnLeave = "ON_LEAVE", // İzinli
|
||||||
|
Suspended = "SUSPENDED", // Askıya Alındı
|
||||||
|
Terminated = "TERMINATED", // İşten Ayrıldı
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum JobLevelEnum { // İş Seviyesi
|
||||||
|
Entry = "ENTRY", // Giriş
|
||||||
|
Junior = "JUNIOR", // Junior
|
||||||
|
Mid = "MID", // Orta
|
||||||
|
Senior = "SENIOR", // Kıdemli
|
||||||
|
Lead = "LEAD", // Lider
|
||||||
|
Manager = "MANAGER", // Yönetici
|
||||||
|
Director = "DIRECTOR", // Direktör
|
||||||
|
Executive = "EXECUTIVE", // İcra
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum LeaveTypeEnum { // İzin Türü
|
||||||
|
Annual = "ANNUAL", // Yıllık
|
||||||
|
Sick = "SICK", // Hastalık
|
||||||
|
Maternity = "MATERNITY", // Doğum
|
||||||
|
Paternity = "PATERNITY", // Babalık
|
||||||
|
Personal = "PERSONAL", // Kişisel
|
||||||
|
Emergency = "EMERGENCY", // Acil
|
||||||
|
Study = "STUDY", // Eğitim
|
||||||
|
Unpaid = "UNPAID", // Ücretsiz
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum LeaveStatusEnum { // İzin Durumu
|
||||||
|
Pending = "PENDING", // Beklemede
|
||||||
|
Approved = "APPROVED", // Onaylandı
|
||||||
|
Rejected = "REJECTED", // Reddedildi
|
||||||
|
Cancelled = "CANCELLED", // İptal edildi
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum EvaluationStatusEnum { // Değerlendirme Durumu
|
||||||
|
NotStarted = "NOT_STARTED", // Başlanmadı
|
||||||
|
InProgress = "IN_PROGRESS", // Devam Ediyor
|
||||||
|
PendingReview = "PENDING_REVIEW", // İnceleme Bekliyor
|
||||||
|
Completed = "COMPLETED", // Tamamlandı
|
||||||
|
Overdue = "OVERDUE", // Geçmiş
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum TrainingTypeEnum { // Eğitim Türü
|
||||||
|
Technical = "TECHNICAL", // Teknik
|
||||||
|
Soft_Skills = "SOFT_SKILLS", // Yumuşak Beceriler
|
||||||
|
Leadership = "LEADERSHIP", // Liderlik
|
||||||
|
Compliance = "COMPLIANCE", // Uyum
|
||||||
|
Safety = "SAFETY", // Güvenlik
|
||||||
|
Product = "PRODUCT", // Ürün
|
||||||
|
Process = "PROCESS", // Süreç
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum TrainingStatusEnum { // Eğitim Durumu
|
||||||
|
Planned = "PLANNED", // Planlandı
|
||||||
|
Open = "OPEN", // Açık
|
||||||
|
InProgress = "IN_PROGRESS", // Devam Ediyor
|
||||||
|
Completed = "COMPLETED", // Tamamlandı
|
||||||
|
Cancelled = "CANCELLED", // İptal Edildi
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum ParticipationStatusEnum { // Katılım Durumu
|
||||||
|
Enrolled = "ENROLLED", // Kayıtlı
|
||||||
|
InProgress = "IN_PROGRESS", // Devam Ediyor
|
||||||
|
Completed = "COMPLETED", // Tamamlandı
|
||||||
|
Failed = "FAILED", // Başarısız
|
||||||
|
Withdrawn = "WITHDRAWN", // Çekildi
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum DisciplinaryActionTypeEnum { // Disiplin Cezası Türü
|
||||||
|
Verbal_Warning = "VERBAL_WARNING", // Sözlü Uyarı
|
||||||
|
Written_Warning = "WRITTEN_WARNING", // Yazılı Uyarı
|
||||||
|
Final_Warning = "FINAL_WARNING", // Son Uyarı
|
||||||
|
Suspension = "SUSPENSION", // Askıya Alma
|
||||||
|
Termination = "TERMINATION", // İşten Çıkarma
|
||||||
|
Demotion = "DEMOTION", // Aşağı Alma
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum DisciplinarySeverityEnum { // Disiplin Cezası Şiddeti
|
||||||
|
Minor = "MINOR", // Hafif
|
||||||
|
Major = "MAJOR", // Ağır
|
||||||
|
Severe = "SEVERE", // Ciddi
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum DisciplinaryStatusEnum { // Disiplin Cezası Durumu
|
||||||
|
Active = "ACTIVE", // Aktif
|
||||||
|
Resolved = "RESOLVED", // Çözüldü
|
||||||
|
Expired = "EXPIRED", // Süresi Dolmuş
|
||||||
|
Appealed = "APPEALED", // İtiraz Edilmiş
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum AssessorTypeEnum { // Değerlendirici Türü
|
||||||
|
Self = "SELF", // Kendi
|
||||||
|
Manager = "MANAGER", // Yönetici
|
||||||
|
Peer = "PEER", // Meslektaş
|
||||||
|
Subordinate = "SUBORDINATE", // Ast
|
||||||
|
Customer = "CUSTOMER", // Müşteri
|
||||||
|
OtherDepartment = "OTHER_DEPARTMENT", // Diğer Departman
|
||||||
|
HRUpperManagement = "HR_UPPER_MANAGEMENT", // İK/Üst Yönetim
|
||||||
|
External = "EXTERNAL", // Dış paydaş değerlendirmesi (mevcut)
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum EvaluationTypeEnum { // Değerlendirme Türü
|
||||||
|
Annual = "ANNUAL", // Yıllık
|
||||||
|
Quarterly = "QUARTERLY", // Çeyrek
|
||||||
|
Probation = "PROBATION", // Deneme Süresi
|
||||||
|
Project = "PROJECT", // Proje
|
||||||
|
Competency = "COMPETENCY", // Yeterlilik
|
||||||
|
Leadership = "LEADERSHIP", // Liderlik
|
||||||
|
Degree360 = "DEGREE_360", // 360° Derece değerlendirme
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum CampaignStatusEnum { // Kampanya Durumu
|
||||||
|
Draft = "DRAFT", // Taslak
|
||||||
|
Active = "ACTIVE", // Aktif
|
||||||
|
Completed = "COMPLETED", // Tamamlandı
|
||||||
|
Cancelled = "CANCELLED", // İptal Edildi
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum ParticipantStatusEnum { // Katılımcı Durumu
|
||||||
|
Invited = "INVITED", // Davet Edildi
|
||||||
|
Started = "STARTED", // Başladı
|
||||||
|
Completed = "COMPLETED", // Tamamlandı
|
||||||
|
Expired = "EXPIRED", // Süresi Dolmuş
|
||||||
|
Declined = "DECLINED", // Reddedildi
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum QuestionTypeEnum { // Soru Türü
|
||||||
|
Rating = "RATING", // 1-5 puan verme
|
||||||
|
MultipleChoice = "MULTIPLE_CHOICE", // Çoktan seçmeli
|
||||||
|
Text = "TEXT", // Metin cevap
|
||||||
|
YesNo = "YES_NO", // Evet/Hayır
|
||||||
|
Scale = "SCALE", // Ölçek (1-10 gibi)
|
||||||
|
}
|
||||||
662
ui/src/types/mm.ts
Normal file
662
ui/src/types/mm.ts
Normal file
|
|
@ -0,0 +1,662 @@
|
||||||
|
import { Address, BusinessParty, PaymentTerms, PriorityEnum } from "./common";
|
||||||
|
import { HrDepartment } from "./hr";
|
||||||
|
import { WmWarehouse, WmZone, WmLocation } from "./wm";
|
||||||
|
|
||||||
|
export interface MmMaterial { // Malzeme
|
||||||
|
id: string;
|
||||||
|
code: string;
|
||||||
|
name: string;
|
||||||
|
barcode?: string;
|
||||||
|
description?: string;
|
||||||
|
materialTypeId: string;
|
||||||
|
materialType?: MmMaterialType;
|
||||||
|
materialGroupId: string;
|
||||||
|
materialGroup?: MmMaterialGroup;
|
||||||
|
baseUnitId: string;
|
||||||
|
baseUnit?: MmUnit;
|
||||||
|
costPrice: number;
|
||||||
|
salesPrice: number;
|
||||||
|
currency: string;
|
||||||
|
isActive: boolean;
|
||||||
|
totalStock: number;
|
||||||
|
alternativeUnits?: MmMaterialUnit[];
|
||||||
|
trackingType: "Quantity" | "Lot" | "Serial";
|
||||||
|
variants?: MmMaterialVariant[];
|
||||||
|
specifications?: MmMaterialSpecification[];
|
||||||
|
suppliers?: MmMaterialSupplier[];
|
||||||
|
stockLevels?: MmStockLevel[];
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MmMaterialType { // Malzeme Türü
|
||||||
|
id: string;
|
||||||
|
code: MaterialTypeEnum;
|
||||||
|
name: string;
|
||||||
|
description?: string;
|
||||||
|
isActive: boolean;
|
||||||
|
className: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MmMaterialGroup { // Malzeme Grubu
|
||||||
|
id: string;
|
||||||
|
code: string;
|
||||||
|
name: string;
|
||||||
|
parentGroupId?: string;
|
||||||
|
parentGroup?: MmMaterialGroup;
|
||||||
|
description?: string;
|
||||||
|
isActive: boolean;
|
||||||
|
children?: MmMaterialGroup[]; // Ağaç görünümü için eklendi
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MmMaterialUnit { // Alternatif Birim
|
||||||
|
id: string;
|
||||||
|
materialId: string;
|
||||||
|
unitId: string;
|
||||||
|
unit?: MmUnit;
|
||||||
|
conversionFactor: number;
|
||||||
|
isDefault: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MmMaterialVariant { // Varyant
|
||||||
|
id: string;
|
||||||
|
materialId: string;
|
||||||
|
variantCode: string;
|
||||||
|
variantName: string;
|
||||||
|
specifications: Record<string, string | number>;
|
||||||
|
additionalCost: number;
|
||||||
|
isActive: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MmMaterialSpecification { // Özellik
|
||||||
|
id: string;
|
||||||
|
materialId: string;
|
||||||
|
specificationName: string;
|
||||||
|
specificationValue: string;
|
||||||
|
unitId: string;
|
||||||
|
unit?: MmUnit;
|
||||||
|
isRequired: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MmMaterialSupplier { // Tedarikçi
|
||||||
|
id: string;
|
||||||
|
materialId: string;
|
||||||
|
supplierId: string;
|
||||||
|
supplier?: BusinessParty;
|
||||||
|
supplierMaterialCode?: string;
|
||||||
|
leadTime: number;
|
||||||
|
minimumOrderQuantity: number;
|
||||||
|
price: number;
|
||||||
|
currency: string;
|
||||||
|
isPreferred: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MmUnit { // Birim
|
||||||
|
id: string;
|
||||||
|
code: string;
|
||||||
|
name: string;
|
||||||
|
description?: string;
|
||||||
|
isActive: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MmLotNumber { // Parti Numarası
|
||||||
|
id: string;
|
||||||
|
materialId: string;
|
||||||
|
material?: MmMaterial;
|
||||||
|
lotNumber: string;
|
||||||
|
productionDate: Date;
|
||||||
|
expiryDate?: Date;
|
||||||
|
quantity: number;
|
||||||
|
unitId: string;
|
||||||
|
supplierId?: string;
|
||||||
|
qualityStatus: QualityStatusEnum;
|
||||||
|
isActive: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MmSerialNumber { // Seri Numarası
|
||||||
|
id: string;
|
||||||
|
materialId: string;
|
||||||
|
material?: MmMaterial;
|
||||||
|
serialNumber: string;
|
||||||
|
lotId?: string;
|
||||||
|
productionDate: Date;
|
||||||
|
warrantyExpiryDate?: Date;
|
||||||
|
currentLocationId?: string;
|
||||||
|
status: SerialStatusEnum;
|
||||||
|
isActive: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MmStockLevel { // Stok Seviyesi
|
||||||
|
id: string;
|
||||||
|
materialId: string;
|
||||||
|
warehouseId: string;
|
||||||
|
warehouse?: WmWarehouse;
|
||||||
|
zoneId?: string;
|
||||||
|
zone?: WmZone;
|
||||||
|
locationId?: string;
|
||||||
|
location?: WmLocation;
|
||||||
|
availableQuantity: number;
|
||||||
|
reservedQuantity: number;
|
||||||
|
inTransitQuantity: number;
|
||||||
|
minimumStock: number;
|
||||||
|
maximumStock: number;
|
||||||
|
reorderPoint: number;
|
||||||
|
lastUpdated: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MmStockMovement { // Stok Hareketi
|
||||||
|
id: string;
|
||||||
|
movementNumber: string;
|
||||||
|
materialId: string;
|
||||||
|
material: MmMaterial;
|
||||||
|
movementType: MovementTypeEnum;
|
||||||
|
fromWarehouseId?: string;
|
||||||
|
fromWarehouse?: WmWarehouse;
|
||||||
|
fromZoneId?: string;
|
||||||
|
fromZone?: WmZone;
|
||||||
|
fromLocationId?: string;
|
||||||
|
fromLocation?: WmLocation;
|
||||||
|
toWarehouseId?: string;
|
||||||
|
toWarehouse?: WmWarehouse;
|
||||||
|
toZoneId?: string;
|
||||||
|
toZone?: WmZone;
|
||||||
|
toLocationId?: string;
|
||||||
|
toLocation?: WmLocation;
|
||||||
|
quantity: number;
|
||||||
|
unit?: MmUnit;
|
||||||
|
unitId?: string;
|
||||||
|
lotNumber?: string;
|
||||||
|
referenceDocument?: string;
|
||||||
|
referenceDocumentType?: string;
|
||||||
|
referenceType?: string;
|
||||||
|
movementDate: Date;
|
||||||
|
description?: string;
|
||||||
|
reason?: string;
|
||||||
|
performedBy?: string;
|
||||||
|
approvedBy?: string;
|
||||||
|
status?: MovementStatusEnum;
|
||||||
|
creationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MmPurchaseRequisition {
|
||||||
|
// Satınalma Talebi
|
||||||
|
id: string;
|
||||||
|
requisitionNumber: string;
|
||||||
|
requestedBy: string;
|
||||||
|
departmentId: string;
|
||||||
|
requestDate: Date;
|
||||||
|
requiredDate: Date;
|
||||||
|
priority: PriorityEnum;
|
||||||
|
status: RequisitionStatusEnum;
|
||||||
|
description?: string;
|
||||||
|
justification?: string;
|
||||||
|
totalAmount: number;
|
||||||
|
currency: string;
|
||||||
|
items: MmPurchaseRequisitionItem[];
|
||||||
|
approvals: MmApprovalHistory[];
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MmPurchaseRequisitionItem { // Satınalma Talebi Kalemi
|
||||||
|
id: string;
|
||||||
|
requisitionId: string;
|
||||||
|
materialId?: string;
|
||||||
|
material?: MmMaterial;
|
||||||
|
description: string;
|
||||||
|
quantity: number;
|
||||||
|
unitId: string;
|
||||||
|
estimatedPrice: number;
|
||||||
|
totalAmount: number;
|
||||||
|
requiredDate: Date;
|
||||||
|
specifications?: string;
|
||||||
|
preferredSupplierId?: string;
|
||||||
|
budgetCode?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MmPurchaseOrder { // Satınalma Siparişi
|
||||||
|
id: string;
|
||||||
|
orderNumber: string;
|
||||||
|
supplierId: string;
|
||||||
|
supplier?: BusinessParty;
|
||||||
|
orderDate: Date;
|
||||||
|
deliveryDate: Date;
|
||||||
|
status: OrderStatusEnum;
|
||||||
|
paymentTerms: PaymentTerms;
|
||||||
|
currency: string;
|
||||||
|
exchangeRate: number;
|
||||||
|
subtotal: number;
|
||||||
|
taxAmount: number;
|
||||||
|
totalAmount: number;
|
||||||
|
deliveryAddress: Address;
|
||||||
|
terms?: string;
|
||||||
|
notes?: string;
|
||||||
|
items: MmPurchaseOrderItem[];
|
||||||
|
receipts: MmGoodsReceipt[];
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
requestId: string;
|
||||||
|
requestTitle: string;
|
||||||
|
requestType: RequestTypeEnum;
|
||||||
|
quotationId: string;
|
||||||
|
expectedDeliveryDate: Date;
|
||||||
|
actualDeliveryDate?: Date;
|
||||||
|
deliveryTerms: string;
|
||||||
|
attachments: string[];
|
||||||
|
approvedBy?: string;
|
||||||
|
approvedAt?: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MmPurchaseOrderItem { // Sipariş Kalemi
|
||||||
|
id: string;
|
||||||
|
orderId: string;
|
||||||
|
materialId: string;
|
||||||
|
material?: MmMaterial;
|
||||||
|
description: string;
|
||||||
|
quantity: number;
|
||||||
|
unit: string;
|
||||||
|
unitPrice: number;
|
||||||
|
totalPrice: number;
|
||||||
|
deliveryDate: Date;
|
||||||
|
receivedQuantity: number;
|
||||||
|
deliveredQuantity: number;
|
||||||
|
remainingQuantity: number;
|
||||||
|
specifications?: string;
|
||||||
|
qualityRequirements?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MmGoodsReceipt { // Mal Kabul
|
||||||
|
id: string;
|
||||||
|
receiptNumber: string;
|
||||||
|
orderId: string;
|
||||||
|
order?: MmPurchaseOrder;
|
||||||
|
receiptDate: Date;
|
||||||
|
receivedBy: string;
|
||||||
|
warehouseId: string;
|
||||||
|
status: ReceiptStatusEnum;
|
||||||
|
notes?: string;
|
||||||
|
items: MmGoodsReceiptItem[];
|
||||||
|
qualityInspection?: MmQualityInspection;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MmGoodsReceiptItem { // Mal Kabul Kalemi
|
||||||
|
id: string;
|
||||||
|
receiptId: string;
|
||||||
|
orderItemId: string;
|
||||||
|
materialId: string;
|
||||||
|
receivedQuantity: number;
|
||||||
|
acceptedQuantity: number;
|
||||||
|
rejectedQuantity: number;
|
||||||
|
lotNumber?: string;
|
||||||
|
expiryDate?: Date;
|
||||||
|
qualityStatus: QualityStatusEnum;
|
||||||
|
storageLocation?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MmQualityInspection { // Kalite Muayenesi
|
||||||
|
id: string;
|
||||||
|
inspectionNumber: string;
|
||||||
|
receiptId: string;
|
||||||
|
inspectionDate: Date;
|
||||||
|
inspectedBy: string;
|
||||||
|
status: InspectionStatusEnum;
|
||||||
|
overallResult: QualityResultEnumEnum;
|
||||||
|
notes?: string;
|
||||||
|
checkpoints: MmQualityInspectionCheckpoint[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MmQualityInspectionCheckpoint { // Muayene Noktası
|
||||||
|
id: string;
|
||||||
|
inspectionId: string;
|
||||||
|
checkpointName: string;
|
||||||
|
expectedValue: string;
|
||||||
|
actualValue: string;
|
||||||
|
result: QualityResultEnumEnum;
|
||||||
|
notes?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MmApprovalHistory {
|
||||||
|
id: string;
|
||||||
|
documentId: string;
|
||||||
|
documentType: string;
|
||||||
|
approverUserId: string;
|
||||||
|
approverName: string;
|
||||||
|
approvalLevel: number;
|
||||||
|
status: ApprovalStatusEnum;
|
||||||
|
comments?: string;
|
||||||
|
approvedAt?: Date;
|
||||||
|
creationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MmPurchaseRequest { // Satınalma Talebi
|
||||||
|
id: string;
|
||||||
|
requestNumber: string;
|
||||||
|
requestType: RequestTypeEnum;
|
||||||
|
description: string;
|
||||||
|
department: string;
|
||||||
|
requestedBy: string;
|
||||||
|
requestDate: Date;
|
||||||
|
requiredDate: Date;
|
||||||
|
priority: PriorityEnum;
|
||||||
|
status: RequestStatusEnum;
|
||||||
|
totalAmount?: number;
|
||||||
|
currency: string;
|
||||||
|
items: MmPurchaseRequestItem[];
|
||||||
|
approvals: MmRequestApproval[];
|
||||||
|
attachments: MmAttachment[];
|
||||||
|
comments: MmRequestComment[];
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MmPurchaseRequestItem { // Kalem
|
||||||
|
id: string;
|
||||||
|
requestId: string;
|
||||||
|
materialId?: string;
|
||||||
|
serviceDescription?: string;
|
||||||
|
quantity: number;
|
||||||
|
unit: string;
|
||||||
|
estimatedPrice?: number;
|
||||||
|
specification?: string;
|
||||||
|
justification?: string;
|
||||||
|
isUrgent: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MmRequestApproval { // Onay
|
||||||
|
id: string;
|
||||||
|
requestId: string;
|
||||||
|
approvalLevel: ApprovalLevelEnum;
|
||||||
|
approverUserId: string;
|
||||||
|
approverName: string;
|
||||||
|
approvalDate?: Date;
|
||||||
|
status: ApprovalStatusEnum;
|
||||||
|
comments?: string;
|
||||||
|
sequence: number;
|
||||||
|
isRequired: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MmQuotation { // Teklif
|
||||||
|
id: string;
|
||||||
|
quotationNumber: string;
|
||||||
|
requestId: string;
|
||||||
|
requestTitle: string;
|
||||||
|
requestType: RequestTypeEnum;
|
||||||
|
supplierId: string;
|
||||||
|
supplier?: BusinessParty;
|
||||||
|
quotationDate: Date;
|
||||||
|
validUntil: Date;
|
||||||
|
status: QuotationStatusEnum;
|
||||||
|
totalAmount: number;
|
||||||
|
currency: string;
|
||||||
|
paymentTerms: string;
|
||||||
|
deliveryTerms: string;
|
||||||
|
deliveryTime?: number;
|
||||||
|
items: MmQuotationItem[];
|
||||||
|
evaluationScore?: number;
|
||||||
|
evaluationComments?: string;
|
||||||
|
evaluationNotes?: string;
|
||||||
|
notes?: string;
|
||||||
|
attachments: MmAttachment[];
|
||||||
|
submittedBy: string;
|
||||||
|
submittedAt: Date;
|
||||||
|
evaluatedBy?: string;
|
||||||
|
evaluatedAt?: Date;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MmAttachment { // Ek
|
||||||
|
id: string;
|
||||||
|
fileName: string;
|
||||||
|
fileSize: number;
|
||||||
|
fileType: string;
|
||||||
|
uploadedBy: string;
|
||||||
|
uploadedAt: Date;
|
||||||
|
url?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MmQuotationItem { // Teklif Kalemi
|
||||||
|
id: string;
|
||||||
|
materialCode: string;
|
||||||
|
materialName: string;
|
||||||
|
description: string;
|
||||||
|
quantity: number;
|
||||||
|
unit: string;
|
||||||
|
unitPrice: number;
|
||||||
|
totalPrice: number;
|
||||||
|
leadTime?: number;
|
||||||
|
specifications: string[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MmApprovalWorkflow { // Onay İş Akışı
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
departmentId: string;
|
||||||
|
department?: HrDepartment;
|
||||||
|
requestType: RequestTypeEnum;
|
||||||
|
amountThreshold: number;
|
||||||
|
approvalLevels: MmApprovalWorkflowLevel[];
|
||||||
|
isActive: boolean;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MmApprovalWorkflowLevel { // Onay Seviyesi
|
||||||
|
id: string;
|
||||||
|
workflowId: string;
|
||||||
|
level: ApprovalLevelEnum;
|
||||||
|
approverUserIds: string[];
|
||||||
|
approverNames: string[];
|
||||||
|
sequence: number;
|
||||||
|
isRequired: boolean;
|
||||||
|
isParallel: boolean;
|
||||||
|
timeoutDays?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MmSupplierPerformance { // Tedarikçi Performansı
|
||||||
|
deliveryPerformance: number;
|
||||||
|
qualityRating: number;
|
||||||
|
priceCompetitiveness: number;
|
||||||
|
responsiveness: number;
|
||||||
|
complianceRating: number;
|
||||||
|
overallScore: number;
|
||||||
|
lastEvaluationDate: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MmRequestComment { // Yorum
|
||||||
|
id: string;
|
||||||
|
requestId: string;
|
||||||
|
userId: string;
|
||||||
|
userName: string;
|
||||||
|
comment: string;
|
||||||
|
commentDate: Date;
|
||||||
|
isInternal: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MmDelivery { // Teslimat
|
||||||
|
id: string;
|
||||||
|
deliveryNumber: string;
|
||||||
|
orderId: string;
|
||||||
|
orderNumber: string;
|
||||||
|
requestType: RequestTypeEnum;
|
||||||
|
supplierId: string;
|
||||||
|
supplierName: string;
|
||||||
|
courierCompany?: string;
|
||||||
|
trackingNumber?: string;
|
||||||
|
deliveryDate: Date;
|
||||||
|
expectedDeliveryDate: Date;
|
||||||
|
actualDeliveryDate?: Date;
|
||||||
|
status: DeliveryStatusEnum;
|
||||||
|
deliveryAddress: string;
|
||||||
|
receivedBy?: string;
|
||||||
|
items: MmDeliveryItem[];
|
||||||
|
notes?: string;
|
||||||
|
attachments: string[];
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MmDeliveryItem { // Teslimat Kalemi
|
||||||
|
id: string;
|
||||||
|
materialId: string;
|
||||||
|
material?: MmMaterial;
|
||||||
|
orderedQuantity: number;
|
||||||
|
deliveredQuantity: number;
|
||||||
|
unit: string;
|
||||||
|
condition: "Good" | "Damaged" | "Missing";
|
||||||
|
notes?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum OrderStatusEnum { // Sipariş Durumu
|
||||||
|
Draft = "Draft", // Yeni
|
||||||
|
Pending = "Pending", // Onay Bekliyor
|
||||||
|
Approved = "Approved", // Onaylandı
|
||||||
|
Sent = "Sent", // Gönderildi
|
||||||
|
Confirmed = "Confirmed", // Onaylandı
|
||||||
|
PartiallyDelivered = "PartiallyDelivered", // Kısmen Teslim Edildi
|
||||||
|
PartiallyReceived = "PartiallyReceived", // Kısmen Alındı
|
||||||
|
Received = "Received", // Alındı
|
||||||
|
Delivered = "Delivered", // Teslim Edildi
|
||||||
|
Invoiced = "Invoiced", // Faturalandırıldı
|
||||||
|
Completed = "Completed", // Tamamlandı
|
||||||
|
Closed = "Closed", // Kapalı
|
||||||
|
Cancelled = "Cancelled", // İptal Edildi
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum SupplierTypeEnum { // Tedarikçi Türü
|
||||||
|
Material = "MATERIAL", // Malzeme
|
||||||
|
Service = "SERVICE", // Hizmet
|
||||||
|
Both = "BOTH", // Her ikisi
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum RequisitionStatusEnum { // Satınalma Talebi Durumu
|
||||||
|
Draft = "DRAFT", // Taslak
|
||||||
|
Submitted = "SUBMITTED", // Gönderildi
|
||||||
|
InApproval = "IN_APPROVAL", // Onayda
|
||||||
|
Approved = "APPROVED", // Onaylandı
|
||||||
|
Rejected = "REJECTED", // Reddedildi
|
||||||
|
Cancelled = "CANCELLED", // İptal Edildi
|
||||||
|
Converted = "CONVERTED",
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum ReceiptStatusEnum { // Mal Kabul Durumu
|
||||||
|
Pending = "PENDING", // Beklemede
|
||||||
|
InProgress = "IN_PROGRESS", // İşlemde
|
||||||
|
Completed = "COMPLETED", // Tamamlandı
|
||||||
|
OnHold = "ON_HOLD", // Beklemede
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum InspectionStatusEnum { // Muayene Durumu
|
||||||
|
Scheduled = "SCHEDULED", // Planlandı
|
||||||
|
InProgress = "IN_PROGRESS", // İşlemde
|
||||||
|
Completed = "COMPLETED", // Tamamlandı
|
||||||
|
OnHold = "ON_HOLD", // Beklemede
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum QualityResultEnumEnum { // Kalite Sonucu
|
||||||
|
Pass = "PASS", // Geçti
|
||||||
|
Fail = "FAIL", // Kaldı
|
||||||
|
Conditional = "CONDITIONAL", // Koşullu
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum ApprovalStatusEnum { // Onay Durumu
|
||||||
|
Pending = "PENDING", // Beklemede
|
||||||
|
Approved = "APPROVED", // Onaylandı
|
||||||
|
Rejected = "REJECTED", // Reddedildi
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum RequestTypeEnum { // Talep Türü
|
||||||
|
Material = "MATERIAL", // Malzeme
|
||||||
|
Service = "SERVICE", // Hizmet
|
||||||
|
WorkCenter = "WORKCENTER", // İş Merkezi
|
||||||
|
Maintenance = "MAINTENANCE", // Bakım
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum RequestStatusEnum { // Talep Durumu
|
||||||
|
Draft = "DRAFT", // Taslak
|
||||||
|
Submitted = "SUBMITTED", // Gönderildi
|
||||||
|
InReview = "IN_REVIEW", // İnceleme Aşamasında
|
||||||
|
Approved = "APPROVED", // Onaylandı
|
||||||
|
Rejected = "REJECTED", // Reddedildi
|
||||||
|
InQuotation = "IN_QUOTATION", // Teklif Aşamasında
|
||||||
|
Ordered = "ORDERED", // Sipariş Verildi
|
||||||
|
Completed = "COMPLETED", // Tamamlandı
|
||||||
|
Cancelled = "CANCELLED", // İptal Edildi
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum QuotationStatusEnum { // Teklif Durumu
|
||||||
|
Draft = "Draft", // Taslak
|
||||||
|
Pending = "Pending", // Beklemede
|
||||||
|
UnderReview = "UnderReview", // İnceleme Aşamasında
|
||||||
|
Submitted = "Submitted", // Gönderildi
|
||||||
|
Approved = "Approved", // Onaylandı
|
||||||
|
Rejected = "Rejected", // Reddedildi
|
||||||
|
Expired = "Expired", // Süresi Dolmuş
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum ApprovalLevelEnum { // Onay Seviyesi
|
||||||
|
Supervisor = "SUPERVISOR", // Ambar Sorumlusu
|
||||||
|
Manager = "MANAGER", // Müdür
|
||||||
|
Director = "DIRECTOR", // Direktör
|
||||||
|
GeneralManager = "GENERAL_MANAGER", // Genel Müdür
|
||||||
|
FinanceManager = "FINANCE_MANAGER", // Finans Müdürü
|
||||||
|
TechnicalManager = "TECHNICAL_MANAGER", // Teknik Müdür
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum SupplierCardTypeEnum { // Tedarikçi Kart Türü
|
||||||
|
Standard = "STANDARD", // Standart
|
||||||
|
Premium = "PREMIUM", // Premium
|
||||||
|
Strategic = "STRATEGIC", // Stratejik
|
||||||
|
Preferred = "PREFERRED", // Tercih Edilen
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum DeliveryStatusEnum { // Teslimat Durumu
|
||||||
|
Preparing = "Preparing", // Hazırlanıyor
|
||||||
|
Shipped = "Shipped", // Gönderildi
|
||||||
|
InTransit = "InTransit", // Taşınıyor
|
||||||
|
OutForDelivery = "OutForDelivery", // Teslimat İçin Yolda
|
||||||
|
Delivered = "Delivered", // Teslim Edildi
|
||||||
|
PartiallyDelivered = "PartiallyDelivered", // Kısmen Teslim Edildi
|
||||||
|
Delayed = "Delayed", // Gecikmiş
|
||||||
|
Returned = "Returned", // İade Edildi
|
||||||
|
Cancelled = "Cancelled", // İptal Edildi
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum MovementStatusEnum { // Hareket Durumu
|
||||||
|
Planned = "PLANNED", // Planlandı
|
||||||
|
InProgress = "IN_PROGRESS", // İşlemde
|
||||||
|
Completed = "COMPLETED", // Tamamlandı
|
||||||
|
Cancelled = "CANCELLED", // İptal Edildi
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum MovementTypeEnum { // Hareket Türü
|
||||||
|
GoodsReceipt = "GR", // Malzeme Girişi
|
||||||
|
GoodsIssue = "GI", // Malzeme Çıkışı
|
||||||
|
Transfer = "TR", // Transfer
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum MaterialTypeEnum { // Malzeme Türü
|
||||||
|
RawMaterial = "RAW", // Hammadde
|
||||||
|
SemiFinished = "SEMI", // Yarı Mamul
|
||||||
|
Finished = "FINISHED", // Mamul
|
||||||
|
Consumable = "CONSUMABLE", // Tüketim Malzemesi
|
||||||
|
Service = "SERVICE", // Hizmet
|
||||||
|
Spare = "SPARE", // Yedek Parça
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum QualityStatusEnum { // Kalite Durumu
|
||||||
|
Pending = "PENDING", // Beklemede
|
||||||
|
Approved = "APPROVED", // Onaylandı
|
||||||
|
Rejected = "REJECTED", // Reddedildi
|
||||||
|
Conditional = "CONDITIONAL", // Koşullu
|
||||||
|
Quarantine = "QUARANTINE", // Karantinada
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum SerialStatusEnum { // Seri Numarası Durumu
|
||||||
|
Available = "AVAILABLE", // Kullanılabilir
|
||||||
|
InUse = "IN_USE", // Kullanımda
|
||||||
|
Maintenance = "MAINTENANCE", // Bakımda
|
||||||
|
Disposed = "DISPOSED", // İmha Edildi
|
||||||
|
}
|
||||||
457
ui/src/types/mrp.ts
Normal file
457
ui/src/types/mrp.ts
Normal file
|
|
@ -0,0 +1,457 @@
|
||||||
|
import { CrmSalesOrder } from "./admin/crm";
|
||||||
|
import { PmWorkCenter, WorkOrderStatusEnum } from "./pm";
|
||||||
|
import {
|
||||||
|
MmMaterial,
|
||||||
|
MmMaterialSupplier,
|
||||||
|
QualityResultEnumEnum,
|
||||||
|
QualityStatusEnum,
|
||||||
|
} from "./mm";
|
||||||
|
import { PriorityEnum } from "./common";
|
||||||
|
|
||||||
|
export interface MrpProductionOrder {
|
||||||
|
// Üretim Emri
|
||||||
|
id: string;
|
||||||
|
orderNumber: string;
|
||||||
|
orderType: ProductionOrderTypeEnum;
|
||||||
|
customerRequirement?: string;
|
||||||
|
plannedStartDate: Date;
|
||||||
|
plannedEndDate: Date;
|
||||||
|
actualStartDate?: Date;
|
||||||
|
actualEndDate?: Date;
|
||||||
|
status: ProductionOrderStatusEnum;
|
||||||
|
priority: PriorityEnum;
|
||||||
|
plannedQuantity: number; //Planlanan Miktar
|
||||||
|
confirmedQuantity: number; //Üretilen Miktar
|
||||||
|
requiredQuantity: number; //Gereken Miktar
|
||||||
|
scrapQuantity: number; //Fire
|
||||||
|
unitId: string;
|
||||||
|
plannedCost: number;
|
||||||
|
actualCost: number;
|
||||||
|
currency: string;
|
||||||
|
materials: MrpProductionOrderMaterial[];
|
||||||
|
workOrders: MrpWorkOrder[];
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MrpProductionOrderMaterial {
|
||||||
|
// Üretim Emri Malzemesi
|
||||||
|
id: string;
|
||||||
|
productionOrderId: string;
|
||||||
|
salesOrderId?: string;
|
||||||
|
salesOrder?: CrmSalesOrder;
|
||||||
|
materialId: string;
|
||||||
|
material?: MmMaterial;
|
||||||
|
customerRequirement?: string;
|
||||||
|
plannedQuantity: number; //Planlanan Miktar
|
||||||
|
confirmedQuantity: number; //Üretilen Miktar
|
||||||
|
requiredQuantity: number; //Gereken Miktar
|
||||||
|
scrapQuantity: number; //Fire
|
||||||
|
unitId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MrpWorkOrder {
|
||||||
|
// İş Emri
|
||||||
|
id: string;
|
||||||
|
workOrderNumber: string;
|
||||||
|
productionOrderId: string;
|
||||||
|
productionOrder?: MrpProductionOrder;
|
||||||
|
operationId: string;
|
||||||
|
operation?: MrpOperation;
|
||||||
|
materialId: string;
|
||||||
|
material?: MmMaterial;
|
||||||
|
sequence: number;
|
||||||
|
plannedStartDate: Date;
|
||||||
|
plannedEndDate: Date;
|
||||||
|
actualStartDate?: Date;
|
||||||
|
actualEndDate?: Date;
|
||||||
|
plannedQuantity: number;
|
||||||
|
confirmedQuantity: number;
|
||||||
|
scrapQuantity: number;
|
||||||
|
workCenterId: string;
|
||||||
|
workCenter?: PmWorkCenter;
|
||||||
|
assignedOperators: string[];
|
||||||
|
setupTime: number; // minutes
|
||||||
|
processTime: number; // minutes
|
||||||
|
actualSetupTime?: number;
|
||||||
|
actualProcessTime?: number;
|
||||||
|
status: WorkOrderStatusEnum;
|
||||||
|
confirmations: MrpWorkOrderConfirmation[];
|
||||||
|
qualityChecks: MrpWorkOrderQualityCheck[];
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MrpWorkOrderConfirmation {
|
||||||
|
// İş Emri Onayı
|
||||||
|
id: string;
|
||||||
|
workOrderId: string;
|
||||||
|
confirmationDate: Date;
|
||||||
|
confirmedQuantity: number;
|
||||||
|
scrapQuantity: number;
|
||||||
|
actualSetupTime: number;
|
||||||
|
actualProcessTime: number;
|
||||||
|
confirmedBy: string;
|
||||||
|
notes?: string;
|
||||||
|
creationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MrpWorkOrderQualityCheck {
|
||||||
|
// Kalite Kontrol
|
||||||
|
id: string;
|
||||||
|
checkNumber: string;
|
||||||
|
workOrderId?: string;
|
||||||
|
productionOrderId?: string;
|
||||||
|
materialId: string;
|
||||||
|
checkType: QualityCheckTypeEnum;
|
||||||
|
checkDate: Date;
|
||||||
|
checkedBy: string;
|
||||||
|
status: QualityStatusEnum;
|
||||||
|
overallResult: QualityResultEnumEnum;
|
||||||
|
checkpoints: MrpWorkOrderQualityCheckpoint[];
|
||||||
|
nonConformanceActions: MrpNonConformanceAction[];
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MrpWorkOrderQualityCheckpoint {
|
||||||
|
// Kalite Kontrol Noktası
|
||||||
|
id: string;
|
||||||
|
qualityCheckId: string;
|
||||||
|
checkpointName: string;
|
||||||
|
specification: string;
|
||||||
|
measuredValue: string;
|
||||||
|
result: QualityResultEnumEnum;
|
||||||
|
notes?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MrpNonConformanceAction {
|
||||||
|
// Uygunsuzluk Eylemi
|
||||||
|
id: string;
|
||||||
|
qualityCheckId: string;
|
||||||
|
actionType: NonConformanceActionTypeEnum;
|
||||||
|
description: string;
|
||||||
|
assignedTo: string;
|
||||||
|
dueDate: Date;
|
||||||
|
status: ActionStatusEnum;
|
||||||
|
completedDate?: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MrpMaterialRequirement {
|
||||||
|
// Malzeme Gereksinimi
|
||||||
|
id: string;
|
||||||
|
mrpRunId: string;
|
||||||
|
materialId: string;
|
||||||
|
material?: MmMaterial;
|
||||||
|
grossRequirement: number;
|
||||||
|
scheduledReceipts: number;
|
||||||
|
projectedAvailable: number;
|
||||||
|
netRequirement: number;
|
||||||
|
plannedOrderReceipt: number;
|
||||||
|
plannedOrderRelease: number;
|
||||||
|
requirementDate: Date;
|
||||||
|
plannedReceiptDate: Date;
|
||||||
|
plannedReleaseDate: Date;
|
||||||
|
sourceType: RequirementSourceTypeEnum;
|
||||||
|
sourceDocumentId?: string;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MrpRecommendation {
|
||||||
|
// Tavsiye
|
||||||
|
id: string;
|
||||||
|
mrpRunId: string;
|
||||||
|
materialId: string;
|
||||||
|
material?: MmMaterial;
|
||||||
|
recommendationType: RecommendationTypeEnum;
|
||||||
|
recommendedAction: string;
|
||||||
|
quantity: number;
|
||||||
|
dueDate: Date;
|
||||||
|
priority: PriorityEnum;
|
||||||
|
reason: string;
|
||||||
|
status: RecommendationStatusEnum;
|
||||||
|
implementedDate?: Date;
|
||||||
|
implementedBy?: string;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MrpDemandForecast {
|
||||||
|
// Talep Tahmini
|
||||||
|
id: string;
|
||||||
|
materialId: string;
|
||||||
|
material?: MmMaterial;
|
||||||
|
forecastPeriod: string;
|
||||||
|
startDate: Date;
|
||||||
|
endDate: Date;
|
||||||
|
forecastMethod: ForecastMethodEnum;
|
||||||
|
forecastQuantity: number;
|
||||||
|
actualQuantity?: number;
|
||||||
|
accuracy?: number;
|
||||||
|
seasonalityFactor?: number;
|
||||||
|
trendFactor?: number;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
notes: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MrpPurchaseSuggestionn extends MrpRecommendation {
|
||||||
|
// Satınalma Tavsiyesi
|
||||||
|
supplierId: string;
|
||||||
|
supplier?: MmMaterialSupplier;
|
||||||
|
estimatedCost: number;
|
||||||
|
leadTime: number;
|
||||||
|
minimumOrderQuantity: number;
|
||||||
|
suggestedQuantity: number;
|
||||||
|
economicOrderQuantity: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MrpProductionSuggestion extends MrpRecommendation {
|
||||||
|
// Üretim Tavsiyesi
|
||||||
|
estimatedDuration: number; // in hours
|
||||||
|
resourceRequirements: {
|
||||||
|
workCenter: string;
|
||||||
|
capacity: number;
|
||||||
|
efficiency: number;
|
||||||
|
}[];
|
||||||
|
bom?: {
|
||||||
|
id: string;
|
||||||
|
version: string;
|
||||||
|
materialCount: number;
|
||||||
|
totalCost: number;
|
||||||
|
};
|
||||||
|
productionCost: number;
|
||||||
|
setupTime: number;
|
||||||
|
cycleTime: number;
|
||||||
|
suggestedStartDate: string;
|
||||||
|
suggestedCompletionDate: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MrpOperationTypeDefinition {
|
||||||
|
// Operasyon Türü Tanımı
|
||||||
|
id: string;
|
||||||
|
code: string;
|
||||||
|
name: string;
|
||||||
|
description?: string;
|
||||||
|
category: OperationCategoryEnum;
|
||||||
|
defaultDuration: number;
|
||||||
|
requiresSetup: boolean;
|
||||||
|
allowsParallelOperation: boolean;
|
||||||
|
qualityCheckRequired: boolean;
|
||||||
|
skillLevelRequired: number;
|
||||||
|
isActive: boolean;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MrpOperation {
|
||||||
|
// Operasyon
|
||||||
|
id: string;
|
||||||
|
code: string;
|
||||||
|
name: string;
|
||||||
|
description?: string;
|
||||||
|
operationTypeId?: string;
|
||||||
|
operationType?: MrpOperationTypeDefinition;
|
||||||
|
workCenterId: string;
|
||||||
|
workCenter?: PmWorkCenter;
|
||||||
|
standardTime: number; // minutes
|
||||||
|
setupTime: number; // minutes
|
||||||
|
laborCost: number;
|
||||||
|
machineCost: number;
|
||||||
|
overheadCost: number;
|
||||||
|
isActive: boolean;
|
||||||
|
instructions?: string;
|
||||||
|
qualityCheckRequired: boolean;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MrpBOM {
|
||||||
|
// Malzeme Listesi (BOM)
|
||||||
|
id: string;
|
||||||
|
bomCode: string;
|
||||||
|
materialId: string;
|
||||||
|
material?: MmMaterial;
|
||||||
|
version: string;
|
||||||
|
validFrom: Date;
|
||||||
|
validTo?: Date;
|
||||||
|
isActive: boolean;
|
||||||
|
bomType: BOMTypeEnum;
|
||||||
|
baseQuantity: number;
|
||||||
|
components: MrpBOMComponent[];
|
||||||
|
operations: MrpBOMOperation[];
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MrpBOMComponent {
|
||||||
|
// BOM Bileşeni
|
||||||
|
id: string;
|
||||||
|
bomId: string;
|
||||||
|
materialId: string;
|
||||||
|
material?: MmMaterial;
|
||||||
|
quantity: number;
|
||||||
|
unitId: string;
|
||||||
|
scrapPercentage: number;
|
||||||
|
isPhantom: boolean;
|
||||||
|
position: number;
|
||||||
|
validFrom: Date;
|
||||||
|
validTo?: Date;
|
||||||
|
isActive: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MrpBOMOperation {
|
||||||
|
// BOM Operasyonu
|
||||||
|
id: string;
|
||||||
|
bomId: string;
|
||||||
|
operationId: string;
|
||||||
|
operation?: MrpOperation;
|
||||||
|
sequence: number;
|
||||||
|
setupTime: number;
|
||||||
|
runTime: number;
|
||||||
|
waitTime: number;
|
||||||
|
queueTime: number;
|
||||||
|
moveTime: number;
|
||||||
|
isActive: boolean;
|
||||||
|
workCenterId: string;
|
||||||
|
workCenter?: PmWorkCenter;
|
||||||
|
isParallel: boolean;
|
||||||
|
prerequisites: string[];
|
||||||
|
qualityChecks: MrpBOMQualityCheck[];
|
||||||
|
tools: MrpToolRequirement[];
|
||||||
|
skills: MrpSkillRequirement[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MrpBOMQualityCheck {
|
||||||
|
// Kalite Kontrol Noktası
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
description?: string;
|
||||||
|
checkType: QualityCheckTypeEnum;
|
||||||
|
parameter: string;
|
||||||
|
minValue?: number;
|
||||||
|
maxValue?: number;
|
||||||
|
targetValue?: number;
|
||||||
|
tolerance?: number;
|
||||||
|
isRequired: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MrpToolRequirement {
|
||||||
|
// Araç Gereksinimi
|
||||||
|
id: string;
|
||||||
|
toolId: string;
|
||||||
|
toolName: string;
|
||||||
|
quantity: number;
|
||||||
|
isRequired: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MrpSkillRequirement {
|
||||||
|
// Beceri Gereksinimi
|
||||||
|
id: string;
|
||||||
|
skillName: string;
|
||||||
|
level: number;
|
||||||
|
isRequired: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum ProductionOrderTypeEnum { // Üretim Emri Türü
|
||||||
|
Standard = "STANDARD", // Standart üretim emri
|
||||||
|
Rework = "REWORK", // Yeniden işleme emri
|
||||||
|
Maintenance = "MAINTENANCE", // Bakım emri
|
||||||
|
Sample = "SAMPLE", // Numune üretim emri
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum ProductionOrderStatusEnum { // Üretim Emri Durumu
|
||||||
|
Created = "CREATED", // Oluşturuldu
|
||||||
|
Released = "RELEASED", // Serbest bırakıldı
|
||||||
|
InProgress = "IN_PROGRESS", // İşlemde
|
||||||
|
Completed = "COMPLETED", // Tamamlandı
|
||||||
|
Cancelled = "CANCELLED", // İptal edildi
|
||||||
|
OnHold = "ON_HOLD", // Beklemede
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum QualityCheckTypeEnum { // Kalite Kontrol Türü
|
||||||
|
Incoming = "INCOMING", // Giriş
|
||||||
|
InProcess = "IN_PROCESS", // Süreç içi
|
||||||
|
Final = "FINAL", // Nihai
|
||||||
|
Random = "RANDOM", // Rastgele
|
||||||
|
Dimensional = "DIMENSIONAL", // Boyutsal
|
||||||
|
Visual = "VISUAL", // Görsel
|
||||||
|
Functional = "FUNCTIONAL", // Fonksiyonel
|
||||||
|
Material = "MATERIAL", // Malzeme
|
||||||
|
Electrical = "ELECTRICAL", // Elektriksel
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum NonConformanceActionTypeEnum { // Uygunsuzluk Eylem Türü
|
||||||
|
Rework = "REWORK", // Yeniden işleme
|
||||||
|
Scrap = "SCRAP", // Hurda
|
||||||
|
UseAsIs = "USE_AS_IS", // Olduğu gibi kullan
|
||||||
|
Return = "RETURN", // İade et
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum ActionStatusEnum { // Eylem Durumu
|
||||||
|
Open = "OPEN", // Açık
|
||||||
|
InProgress = "IN_PROGRESS", // İşlemde
|
||||||
|
Completed = "COMPLETED", // Tamamlandı
|
||||||
|
Cancelled = "CANCELLED", // İptal edildi
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum RequirementSourceTypeEnum { // Gereksinim Kaynak Türü
|
||||||
|
SalesOrder = "SALES_ORDER", // Satış Siparişi
|
||||||
|
Forecast = "FORECAST", // Tahmin
|
||||||
|
SafetyStock = "SAFETY_STOCK", // Güvenlik Stoku
|
||||||
|
ProductionOrder = "PRODUCTION_ORDER", // Üretim Emri
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum RecommendationTypeEnum { // Tavsiye Türü
|
||||||
|
PlannedOrder = "PLANNED_ORDER", // Planlanan Sipariş
|
||||||
|
PurchaseRequisition = "PURCHASE_REQUISITION", // Satınalma Talebi
|
||||||
|
Reschedule = "RESCHEDULE", // Yeniden Planla
|
||||||
|
Cancel = "CANCEL", // İptal Et
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum RecommendationStatusEnum { // Tavsiye Durumu
|
||||||
|
Open = "OPEN", // Açık
|
||||||
|
Implemented = "IMPLEMENTED", // Uygulandı
|
||||||
|
Rejected = "REJECTED", // Reddedildi
|
||||||
|
Expired = "EXPIRED", // Süresi Doldu
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum ForecastMethodEnum { // Tahmin Yöntemi
|
||||||
|
MovingAverage = "MOVING_AVERAGE", // Hareketli Ortalama
|
||||||
|
ExponentialSmoothing = "EXPONENTIAL_SMOOTHING", // Üstel Yumuşatma
|
||||||
|
LinearRegression = "LINEAR_REGRESSION", // Doğrusal Regresyon
|
||||||
|
Seasonal = "SEASONAL", // Mevsimsel
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum SecurityLevelEnum { // Güvenlik Seviyesi
|
||||||
|
Low = "LOW", // Düşük
|
||||||
|
Medium = "MEDIUM", // Orta
|
||||||
|
High = "HIGH", // Yüksek
|
||||||
|
Restricted = "RESTRICTED", // Kısıtlı
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum BOMTypeEnum { // BOM Türü
|
||||||
|
Production = "PROD", // Üretim
|
||||||
|
Engineering = "ENG", // Mühendislik
|
||||||
|
Planning = "PLAN", // Planlama
|
||||||
|
Costing = "COST", // Maliyetlendirme
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum RoutingStatusEnum { // Rota Durumu
|
||||||
|
Draft = "DRAFT", // Taslak
|
||||||
|
Active = "ACTIVE", // Aktif
|
||||||
|
Inactive = "INACTIVE", // Pasif
|
||||||
|
Obsolete = "OBSOLETE", // Kullanım dışı
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum OperationCategoryEnum { // Operasyon Kategorisi
|
||||||
|
Production = "PROD", // Üretim
|
||||||
|
Assembly = "ASSY", // Montaj
|
||||||
|
Inspection = "INSP", // Muayene
|
||||||
|
Packaging = "PACK", // Ambalajlama
|
||||||
|
Setup = "SETUP", // Kurulum
|
||||||
|
Maintenance = "MAINT", // Bakım
|
||||||
|
Transport = "TRANS", // Taşıma
|
||||||
|
Quality = "QUAL", // Kalite
|
||||||
|
}
|
||||||
278
ui/src/types/pm.ts
Normal file
278
ui/src/types/pm.ts
Normal file
|
|
@ -0,0 +1,278 @@
|
||||||
|
import { PriorityEnum } from "./common";
|
||||||
|
import { HrDepartment } from "./hr";
|
||||||
|
import { MmMaterial } from "./mm";
|
||||||
|
|
||||||
|
export type CalendarView = "month" | "week" | "day";
|
||||||
|
|
||||||
|
export interface PmWorkCenter {
|
||||||
|
// İş Merkezi / Ekipman
|
||||||
|
id: string;
|
||||||
|
code: string;
|
||||||
|
name: string;
|
||||||
|
description?: string;
|
||||||
|
workCenterId: string;
|
||||||
|
workCenterType?: PmWorkCenterType;
|
||||||
|
manufacturer?: string;
|
||||||
|
model?: string;
|
||||||
|
serialNumber?: string;
|
||||||
|
installationDate: Date;
|
||||||
|
warrantyExpiry?: Date;
|
||||||
|
location: string;
|
||||||
|
departmentId: string;
|
||||||
|
department?: HrDepartment;
|
||||||
|
status: WorkCenterStatusEnum;
|
||||||
|
criticality: CriticalityLevelEnum;
|
||||||
|
specifications: PmWorkCenterSpecification[];
|
||||||
|
maintenancePlans: PmMaintenancePlan[];
|
||||||
|
workOrders: PmMaintenanceWorkOrder[];
|
||||||
|
downTimeHistory: PmDownTimeRecord[];
|
||||||
|
capacity: number;
|
||||||
|
costPerHour: number;
|
||||||
|
setupTime: number;
|
||||||
|
machineType: string;
|
||||||
|
isActive: boolean;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PmWorkCenterType {
|
||||||
|
// İş Merkezi / Ekipman Türü
|
||||||
|
id: string;
|
||||||
|
code: string;
|
||||||
|
name: string;
|
||||||
|
description?: string;
|
||||||
|
category: string;
|
||||||
|
isActive: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PmWorkCenterSpecification {
|
||||||
|
// İş Merkezi / Ekipman Özelliği
|
||||||
|
id: string;
|
||||||
|
workCenterId: string;
|
||||||
|
specificationName: string;
|
||||||
|
specificationValue: string;
|
||||||
|
unit?: string;
|
||||||
|
isRequired: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PmMaintenancePlan {
|
||||||
|
// Bakım Planı
|
||||||
|
id: string;
|
||||||
|
planCode: string;
|
||||||
|
workCenterId: string;
|
||||||
|
workCenter?: PmWorkCenter;
|
||||||
|
planType: MaintenancePlanTypeEnum;
|
||||||
|
description: string;
|
||||||
|
frequency: number;
|
||||||
|
frequencyUnit: FrequencyUnitEnum;
|
||||||
|
estimatedDuration: number; // minutes
|
||||||
|
priority: PriorityEnum;
|
||||||
|
maintenanceTeamId?: string;
|
||||||
|
instructions?: string;
|
||||||
|
requiredMaterials: PmPlanMaterial[];
|
||||||
|
requiredSkills: string[];
|
||||||
|
lastExecuted?: Date;
|
||||||
|
nextDue: Date;
|
||||||
|
isActive: boolean;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PmPlanMaterial {
|
||||||
|
// Bakım Planı İçin Gerekli Malzeme
|
||||||
|
id: string;
|
||||||
|
planId: string;
|
||||||
|
materialId: string;
|
||||||
|
material?: MmMaterial;
|
||||||
|
quantity: number;
|
||||||
|
unitId: string;
|
||||||
|
isRequired: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PmMaintenanceWorkOrder {
|
||||||
|
// Bakım İş Emri
|
||||||
|
id: string;
|
||||||
|
workOrderNumber: string;
|
||||||
|
workCenterId: string;
|
||||||
|
workCenter?: PmWorkCenter;
|
||||||
|
planId?: string;
|
||||||
|
plan?: PmMaintenancePlan;
|
||||||
|
orderType: WorkOrderTypeEnum;
|
||||||
|
priority: PriorityEnum;
|
||||||
|
status: WorkOrderStatusEnum;
|
||||||
|
description: string;
|
||||||
|
reportedBy: string;
|
||||||
|
assignedTo?: string;
|
||||||
|
maintenanceTeamId?: string;
|
||||||
|
scheduledStart?: Date;
|
||||||
|
scheduledEnd?: Date;
|
||||||
|
actualStart?: Date;
|
||||||
|
actualEnd?: Date;
|
||||||
|
estimatedCost: number;
|
||||||
|
actualCost: number;
|
||||||
|
materials: PmWorkOrderMaterial[];
|
||||||
|
activities: PmWorkOrderActivity[];
|
||||||
|
notes?: string;
|
||||||
|
completionNotes?: string;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PmWorkOrderMaterial {
|
||||||
|
// Bakım İş Emri İçin Kullanılan Malzeme
|
||||||
|
id: string;
|
||||||
|
workOrderId: string;
|
||||||
|
materialId: string;
|
||||||
|
materialCode?: string;
|
||||||
|
materialName?: string;
|
||||||
|
material?: MmMaterial;
|
||||||
|
plannedQuantity: number;
|
||||||
|
actualQuantity: number;
|
||||||
|
unitCost: number;
|
||||||
|
totalCost: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PmWorkOrderActivity {
|
||||||
|
// Bakım İş Emri Faaliyeti
|
||||||
|
id: string;
|
||||||
|
workOrderId: string;
|
||||||
|
activityDescription: string;
|
||||||
|
plannedDuration: number;
|
||||||
|
actualDuration: number;
|
||||||
|
performedBy: string;
|
||||||
|
completedAt?: Date;
|
||||||
|
notes?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PmDownTimeRecord {
|
||||||
|
// İş Merkezi / Ekipman Arıza Süreç Kaydı
|
||||||
|
id: string;
|
||||||
|
workCenterId: string;
|
||||||
|
workOrderId?: string;
|
||||||
|
downTimeStart: Date;
|
||||||
|
downTimeEnd?: Date;
|
||||||
|
duration?: number; // minutes
|
||||||
|
reason: string;
|
||||||
|
impact: DownTimeImpactEnum;
|
||||||
|
cost: number;
|
||||||
|
description?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PmFaultNotification {
|
||||||
|
// Arıza Bildirimi
|
||||||
|
id: string;
|
||||||
|
notificationCode: string;
|
||||||
|
workCenterId: string;
|
||||||
|
workCenter: PmWorkCenter;
|
||||||
|
location: string;
|
||||||
|
faultType: FaultTypeEnum;
|
||||||
|
priority: PriorityEnum;
|
||||||
|
severity: CriticalityLevelEnum;
|
||||||
|
title: string;
|
||||||
|
description: string;
|
||||||
|
reportedBy: string;
|
||||||
|
reportedAt: Date;
|
||||||
|
assignedTo?: string;
|
||||||
|
status: NotificationStatusEnum;
|
||||||
|
images?: string[];
|
||||||
|
estimatedRepairTime?: number; // minutes
|
||||||
|
actualRepairTime?: number; // minutes
|
||||||
|
resolutionNotes?: string;
|
||||||
|
closedBy?: string;
|
||||||
|
closedAt?: Date;
|
||||||
|
workOrderId?: string;
|
||||||
|
followUpRequired: boolean;
|
||||||
|
isActive: boolean;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PmCalendarEvent {
|
||||||
|
// Bakım Takvimi Etkinliği
|
||||||
|
id: string;
|
||||||
|
title: string;
|
||||||
|
type: "plan" | "workorder";
|
||||||
|
date: Date;
|
||||||
|
startTime?: string;
|
||||||
|
endTime?: string;
|
||||||
|
status: WorkOrderStatusEnum;
|
||||||
|
priority: PriorityEnum;
|
||||||
|
assignedTo?: string;
|
||||||
|
workCenterCode?: string;
|
||||||
|
duration: number; // minutes
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum CriticalityLevelEnum { // Kritik Seviye
|
||||||
|
Low = "LOW", // Düşük
|
||||||
|
Medium = "MEDIUM", // Orta
|
||||||
|
High = "HIGH", // Yüksek
|
||||||
|
Critical = "CRITICAL", // Kritik
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum MaintenancePlanTypeEnum { // Bakım Plan Türü
|
||||||
|
Preventive = "PREVENTIVE", // Önleyici
|
||||||
|
Predictive = "PREDICTIVE", // Tahmine Dayalı
|
||||||
|
Corrective = "CORRECTIVE", // Düzeltici
|
||||||
|
Condition = "CONDITION", // Durum Bazlı
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum FrequencyUnitEnum { // Frekans Birimi
|
||||||
|
Days = "DAYS", // Günler
|
||||||
|
Weeks = "WEEKS", // Haftalar
|
||||||
|
Months = "MONTHS", // Aylar
|
||||||
|
Years = "YEARS", // Yıllar
|
||||||
|
Hours = "HOURS", // Saatler
|
||||||
|
Cycles = "CYCLES", // Döngüler
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum WorkOrderTypeEnum { // İş Emri Türü
|
||||||
|
Preventive = "PREVENTIVE", // Önleyici
|
||||||
|
Corrective = "CORRECTIVE", // Düzeltici
|
||||||
|
Emergency = "EMERGENCY", // Acil
|
||||||
|
Inspection = "INSPECTION", // Denetim
|
||||||
|
Calibration = "CALIBRATION", // Kalibrasyon
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum WorkOrderStatusEnum { // İş Emri Durumu
|
||||||
|
Created = "CREATED", // Oluşturuldu
|
||||||
|
Planned = "PLANNED", // Planlandı
|
||||||
|
Released = "RELEASED", // Serbest Bırakıldı
|
||||||
|
InProgress = "IN_PROGRESS", // Devam Ediyor
|
||||||
|
OnHold = "ON_HOLD", // Beklemede
|
||||||
|
Completed = "COMPLETED", // Tamamlandı
|
||||||
|
Cancelled = "CANCELLED", // İptal Edildi
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum DownTimeImpactEnum { // Arıza Süreç Etkisi
|
||||||
|
Low = "LOW", // DÜŞÜK
|
||||||
|
Medium = "MEDIUM", // ORTA
|
||||||
|
High = "HIGH", // YÜKSEK
|
||||||
|
Critical = "CRITICAL", // KRİTİK
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum FaultTypeEnum { // Arıza Türü
|
||||||
|
Mechanical = "MECHANICAL", // Mekanik
|
||||||
|
Electrical = "ELECTRICAL", // Elektrik
|
||||||
|
Hydraulic = "HYDRAULIC", // Hidrolik
|
||||||
|
Pneumatic = "PNEUMATIC", // Pnömatik
|
||||||
|
Software = "SOFTWARE", // Yazılım
|
||||||
|
Safety = "SAFETY", // Güvenlik
|
||||||
|
Performance = "PERFORMANCE", // Performans
|
||||||
|
Other = "OTHER", // Diğer
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum NotificationStatusEnum { // Bildirim Durumu
|
||||||
|
Open = "OPEN", // Açık
|
||||||
|
Assigned = "ASSIGNED", // Atandı
|
||||||
|
InProgress = "IN_PROGRESS", // Devam Ediyor
|
||||||
|
Resolved = "RESOLVED", // Çözüldü
|
||||||
|
Closed = "CLOSED", // Kapandı
|
||||||
|
Rejected = "REJECTED", // Reddedildi
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum WorkCenterStatusEnum { // İş Merkezi / Ekipman Durumu
|
||||||
|
Operational = "OPERATIONAL", // OPERATİF
|
||||||
|
UnderMaintenance = "UNDER_MAINTENANCE", // BAKIMDA
|
||||||
|
OutOfOrder = "OUT_OF_ORDER", // ARIZALI
|
||||||
|
Retired = "RETIRED", // ESKİ
|
||||||
|
}
|
||||||
342
ui/src/types/ps.ts
Normal file
342
ui/src/types/ps.ts
Normal file
|
|
@ -0,0 +1,342 @@
|
||||||
|
import { BusinessParty, PriorityEnum } from "./common";
|
||||||
|
import { HrEmployee } from "./hr";
|
||||||
|
|
||||||
|
export interface PsProject {
|
||||||
|
// Proje
|
||||||
|
id: string;
|
||||||
|
code: string;
|
||||||
|
name: string;
|
||||||
|
description?: string;
|
||||||
|
projectType: ProjectTypeEnum;
|
||||||
|
status: ProjectStatusEnum;
|
||||||
|
priority: PriorityEnum;
|
||||||
|
customerId?: string;
|
||||||
|
customer?: BusinessParty;
|
||||||
|
projectManagerId: string;
|
||||||
|
projectManager?: HrEmployee;
|
||||||
|
startDate: Date;
|
||||||
|
endDate: Date;
|
||||||
|
actualStartDate?: Date;
|
||||||
|
actualEndDate?: Date;
|
||||||
|
budget: number;
|
||||||
|
actualCost: number;
|
||||||
|
currency: string;
|
||||||
|
progress: number;
|
||||||
|
phases: PsProjectPhase[];
|
||||||
|
tasks: PsProjectTask[];
|
||||||
|
risks: PsProjectRisk[];
|
||||||
|
documents: PsProjectDocument[];
|
||||||
|
isActive: boolean;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PsProjectPhase {
|
||||||
|
// Proje Fazı
|
||||||
|
id: string;
|
||||||
|
projectId: string;
|
||||||
|
project?: PsProject;
|
||||||
|
code: string;
|
||||||
|
name: string;
|
||||||
|
description?: string;
|
||||||
|
sequence: number;
|
||||||
|
startDate: Date;
|
||||||
|
endDate: Date;
|
||||||
|
actualStartDate?: Date;
|
||||||
|
actualEndDate?: Date;
|
||||||
|
status: PhaseStatusEnum;
|
||||||
|
budget: number;
|
||||||
|
actualCost: number;
|
||||||
|
progress: number;
|
||||||
|
tasks: PsProjectTask[];
|
||||||
|
isActive: boolean;
|
||||||
|
milestones: number;
|
||||||
|
completedMilestones: number;
|
||||||
|
assignedTeams: string[];
|
||||||
|
deliverables: string[];
|
||||||
|
risks: string[];
|
||||||
|
category: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PsProjectTask {
|
||||||
|
// Proje Görevi
|
||||||
|
id: string;
|
||||||
|
projectId: string;
|
||||||
|
phaseId?: string;
|
||||||
|
phase?: PsProjectPhase;
|
||||||
|
taskCode: string;
|
||||||
|
name: string;
|
||||||
|
description?: string;
|
||||||
|
taskType: TaskTypeEnum;
|
||||||
|
status: TaskStatusEnum;
|
||||||
|
priority: PriorityEnum;
|
||||||
|
assignedTo?: string;
|
||||||
|
assignee?: HrEmployee;
|
||||||
|
startDate: Date;
|
||||||
|
endDate: Date;
|
||||||
|
actualStartDate?: Date;
|
||||||
|
actualEndDate?: Date;
|
||||||
|
estimatedHours: number;
|
||||||
|
actualHours: number;
|
||||||
|
progress: number;
|
||||||
|
activities: PsTaskActivity[];
|
||||||
|
comments: PsTaskComment[];
|
||||||
|
isActive: boolean;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PsProjectRisk {
|
||||||
|
// Proje Riski
|
||||||
|
id: string;
|
||||||
|
projectId: string;
|
||||||
|
riskCode: string;
|
||||||
|
title: string;
|
||||||
|
description: string;
|
||||||
|
category: RiskCategoryEnum;
|
||||||
|
probability: RiskProbabilityEnum;
|
||||||
|
impact: RiskImpactEnum;
|
||||||
|
riskLevel: RiskLevelEnum;
|
||||||
|
status: RiskStatusEnum;
|
||||||
|
identifiedBy: string;
|
||||||
|
identifiedDate: Date;
|
||||||
|
mitigationPlan?: string;
|
||||||
|
contingencyPlan?: string;
|
||||||
|
ownerId?: string;
|
||||||
|
reviewDate?: Date;
|
||||||
|
isActive: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PsTaskActivity {
|
||||||
|
// Görev Aktivitesi
|
||||||
|
id: string;
|
||||||
|
taskId: string;
|
||||||
|
activityType: PsActivityTypeEnum;
|
||||||
|
description: string;
|
||||||
|
performedBy: string;
|
||||||
|
performedAt: Date;
|
||||||
|
hoursSpent?: number;
|
||||||
|
notes?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PsTaskComment {
|
||||||
|
// Görev Yorumu
|
||||||
|
id: string;
|
||||||
|
taskId: string;
|
||||||
|
comment: string;
|
||||||
|
commentedBy: string;
|
||||||
|
commentedAt: Date;
|
||||||
|
isInternal: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PsProjectDocument {
|
||||||
|
// Proje Belgesi
|
||||||
|
id: string;
|
||||||
|
projectId: string;
|
||||||
|
documentName: string;
|
||||||
|
documentType: PsDocumentTypeEnum;
|
||||||
|
filePath: string;
|
||||||
|
fileSize: number;
|
||||||
|
uploadedBy: string;
|
||||||
|
uploadedAt: Date;
|
||||||
|
version: string;
|
||||||
|
isActive: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PsActivity {
|
||||||
|
// Aktivite
|
||||||
|
id: string;
|
||||||
|
activityType: PsActivityTypeEnum;
|
||||||
|
name: string;
|
||||||
|
description: string;
|
||||||
|
category: string;
|
||||||
|
defaultDuration: number; // hours
|
||||||
|
isActive: boolean;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PsProjectCostTracking {
|
||||||
|
// Proje Maliyet Takibi
|
||||||
|
id: string;
|
||||||
|
projectId: string;
|
||||||
|
projectName: string;
|
||||||
|
projectCode: string;
|
||||||
|
plannedBudget: number;
|
||||||
|
actualCost: number;
|
||||||
|
remainingBudget: number;
|
||||||
|
plannedStartDate: Date;
|
||||||
|
plannedEndDate: Date;
|
||||||
|
actualStartDate?: Date;
|
||||||
|
actualEndDate?: Date;
|
||||||
|
plannedDuration: number; // days
|
||||||
|
actualDuration?: number; // days
|
||||||
|
progress: number; // percentage
|
||||||
|
status: "ON_TRACK" | "AT_RISK" | "DELAYED" | "COMPLETED";
|
||||||
|
currency: string;
|
||||||
|
lastUpdated: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PsTaskDailyUpdate {
|
||||||
|
// Görev Günlük Güncellemesi
|
||||||
|
id: string;
|
||||||
|
taskId: string;
|
||||||
|
task?: PsProjectTask;
|
||||||
|
employeeId: string;
|
||||||
|
employee?: HrEmployee;
|
||||||
|
date: Date;
|
||||||
|
hoursWorked: number;
|
||||||
|
description: string;
|
||||||
|
workType: WorkTypeEnum;
|
||||||
|
progress: number; // percentage
|
||||||
|
challenges?: string;
|
||||||
|
nextSteps?: string;
|
||||||
|
status: DailyUpdateStatusEnum;
|
||||||
|
attachments?: string[];
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PsGanttTask {
|
||||||
|
// Gantt Görevi
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
type: "project" | "phase" | "task";
|
||||||
|
startDate: Date;
|
||||||
|
endDate: Date;
|
||||||
|
progress: number;
|
||||||
|
assignee?: HrEmployee;
|
||||||
|
parentId?: string;
|
||||||
|
children?: PsGanttTask[];
|
||||||
|
dependencies?: string[];
|
||||||
|
priority: PriorityEnum;
|
||||||
|
status: TaskStatusEnum | ProjectStatusEnum | PhaseStatusEnum;
|
||||||
|
hoursWorked?: number;
|
||||||
|
estimatedHours?: number;
|
||||||
|
level: number; // indentation level
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum WorkTypeEnum { // İş Türü
|
||||||
|
Development = "DEVELOPMENT", // Geliştirme
|
||||||
|
Testing = "TESTING", // Test
|
||||||
|
Design = "DESIGN", // Tasarım
|
||||||
|
Documentation = "DOCUMENTATION", // Dokümantasyon
|
||||||
|
Meeting = "MEETING", // Toplantı
|
||||||
|
Research = "RESEARCH", // Araştırma
|
||||||
|
Debugging = "DEBUGGING", // Hata Ayıklama
|
||||||
|
Review = "REVIEW", // İnceleme
|
||||||
|
Other = "OTHER", // Diğer
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum DailyUpdateStatusEnum { // Günlük Güncelleme Durumu
|
||||||
|
Draft = "DRAFT", // Taslak
|
||||||
|
Submitted = "SUBMITTED", // Gönderildi
|
||||||
|
Approved = "APPROVED", // Onaylandı
|
||||||
|
Rejected = "REJECTED", // Reddedildi
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum ProjectTypeEnum { // Proje Türü
|
||||||
|
Internal = "INTERNAL", // Dahili
|
||||||
|
Customer = "CUSTOMER", // Müşteri
|
||||||
|
Research = "RESEARCH", // Araştırma
|
||||||
|
Maintenance = "MAINTENANCE", // Bakım
|
||||||
|
Development = "DEVELOPMENT", // Geliştirme
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum ProjectStatusEnum { // Proje Durumu
|
||||||
|
Planning = "PLANNING", // Planlama
|
||||||
|
Active = "ACTIVE", // Aktif
|
||||||
|
OnHold = "ON_HOLD", // Beklemede
|
||||||
|
Completed = "COMPLETED", // Tamamlandı
|
||||||
|
Cancelled = "CANCELLED", // İptal Edildi
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum PhaseStatusEnum { // Faz Durumu
|
||||||
|
NotStarted = "NOT_STARTED", // Başlanmadı
|
||||||
|
InProgress = "IN_PROGRESS", // Devam Ediyor
|
||||||
|
Completed = "COMPLETED", // Tamamlandı
|
||||||
|
OnHold = "ON_HOLD", // Beklemede
|
||||||
|
Cancelled = "CANCELLED", // İptal Edildi
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum TaskStatusEnum { // Görev Durumu
|
||||||
|
NotStarted = "NOT_STARTED", // Başlanmadı
|
||||||
|
InProgress = "IN_PROGRESS", // Devam Ediyor
|
||||||
|
Completed = "COMPLETED", // Tamamlandı
|
||||||
|
OnHold = "ON_HOLD", // Beklemede
|
||||||
|
Cancelled = "CANCELLED", // İptal Edildi
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum TaskTypeEnum { // Görev Türü
|
||||||
|
Development = "DEVELOPMENT", // Geliştirme
|
||||||
|
Testing = "TESTING", // Test
|
||||||
|
Documentation = "DOCUMENTATION", // Dokümantasyon
|
||||||
|
Review = "REVIEW", // İnceleme
|
||||||
|
Deployment = "DEPLOYMENT", // Dağıtım
|
||||||
|
Meeting = "MEETING", // Toplantı
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum RiskCategoryEnum { // Risk Kategorisi
|
||||||
|
Technical = "TECHNICAL", // Teknik
|
||||||
|
Schedule = "SCHEDULE", // Zamanlama
|
||||||
|
Budget = "BUDGET", // Bütçe
|
||||||
|
Resource = "RESOURCE", // Kaynak
|
||||||
|
External = "EXTERNAL", // Dışsal
|
||||||
|
Quality = "QUALITY", // Kalite
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum RiskProbabilityEnum { // Risk Olasılığı
|
||||||
|
VeryLow = "VERY_LOW", // Çok Düşük
|
||||||
|
Low = "LOW", // Düşük
|
||||||
|
Medium = "MEDIUM", // Orta
|
||||||
|
High = "HIGH", // Yüksek
|
||||||
|
VeryHigh = "VERY_HIGH", // Çok Yüksek
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum RiskImpactEnum { // Risk Etkisi
|
||||||
|
VeryLow = "VERY_LOW", // Çok Düşük
|
||||||
|
Low = "LOW", // Düşük
|
||||||
|
Medium = "MEDIUM", // Orta
|
||||||
|
High = "HIGH", // Yüksek
|
||||||
|
VeryHigh = "VERY_HIGH", // Çok Yüksek
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum RiskLevelEnum { // Risk Seviyesi
|
||||||
|
Low = "LOW", // Düşük
|
||||||
|
Medium = "MEDIUM", // Orta
|
||||||
|
High = "HIGH", // Yüksek
|
||||||
|
Critical = "CRITICAL", // Kritik
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum RiskStatusEnum { // Risk Durumu
|
||||||
|
Identified = "IDENTIFIED", // Belirlendi
|
||||||
|
Analyzing = "ANALYZING", // Analiz Ediliyor
|
||||||
|
Mitigating = "MITIGATING", // Azaltılıyor
|
||||||
|
Monitoring = "MONITORING", // İzleniyor
|
||||||
|
Closed = "CLOSED", // Kapatıldı
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum PsActivityTypeEnum { // Aktivite Türü
|
||||||
|
WorkLog = "WORK_LOG", // İş Günlüğü
|
||||||
|
StatusUpdate = "STATUS_UPDATE", // Durum Güncellemesi
|
||||||
|
Issue = "ISSUE", // Sorun
|
||||||
|
Meeting = "MEETING", // Toplantı
|
||||||
|
Review = "REVIEW", // İnceleme
|
||||||
|
TaskCreated = "TASK_CREATED", // Görev Oluşturuldu
|
||||||
|
TaskUpdated = "TASK_UPDATED", // Görev Güncellendi
|
||||||
|
TaskCompleted = "TASK_COMPLETED", // Görev Tamamlandı
|
||||||
|
CommentAdded = "COMMENT_ADDED", // Yorum Eklendi
|
||||||
|
FileUploaded = "FILE_UPLOADED", // Dosya Yüklendi
|
||||||
|
StatusChanged = "STATUS_CHANGED", // Durum Değişti
|
||||||
|
AssignmentChanged = "ASSIGNMENT_CHANGED", // Atama Değişti
|
||||||
|
MeetingScheduled = "MEETING_SCHEDULED", // Toplantı Planlandı
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum PsDocumentTypeEnum { // Belge Türü
|
||||||
|
Specification = "SPECIFICATION", // Spesifikasyon
|
||||||
|
Design = "DESIGN", // Tasarım
|
||||||
|
Contract = "CONTRACT", // Sözleşme
|
||||||
|
Report = "REPORT", // Rapor
|
||||||
|
Manual = "MANUAL", // Kılavuz
|
||||||
|
Other = "OTHER", // Diğer
|
||||||
|
}
|
||||||
246
ui/src/types/wm.ts
Normal file
246
ui/src/types/wm.ts
Normal file
|
|
@ -0,0 +1,246 @@
|
||||||
|
import { Address } from "./common";
|
||||||
|
import { MmMaterial } from "./mm";
|
||||||
|
import { SecurityLevelEnum } from "./admin/mrp";
|
||||||
|
|
||||||
|
export interface WmWarehouse {
|
||||||
|
// Depo
|
||||||
|
id: string;
|
||||||
|
code: string;
|
||||||
|
name: string;
|
||||||
|
description?: string;
|
||||||
|
address?: Address;
|
||||||
|
warehouseType: WarehouseTypeEnum;
|
||||||
|
locations: WmLocation[];
|
||||||
|
isMainWarehouse: boolean;
|
||||||
|
capacity: number;
|
||||||
|
currentUtilization: number;
|
||||||
|
zones: WmZone[];
|
||||||
|
isActive: boolean;
|
||||||
|
securityLevel: SecurityLevelEnum;
|
||||||
|
temperatureControlled: boolean;
|
||||||
|
managerId: number;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WmZone {
|
||||||
|
// Bölge
|
||||||
|
id: string;
|
||||||
|
warehouseId: string;
|
||||||
|
zoneCode: string;
|
||||||
|
name: string;
|
||||||
|
description?: string;
|
||||||
|
zoneType: ZoneTypeEnum;
|
||||||
|
temperature?: number;
|
||||||
|
humidity?: number;
|
||||||
|
locations: WmLocation[];
|
||||||
|
isActive: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WmLocation {
|
||||||
|
// Lokasyon
|
||||||
|
id: string;
|
||||||
|
warehouseId: string;
|
||||||
|
zoneId?: string;
|
||||||
|
locationCode: string;
|
||||||
|
name: string;
|
||||||
|
description?: string;
|
||||||
|
locationType: LocationTypeEnum;
|
||||||
|
capacity: number;
|
||||||
|
currentStock: number;
|
||||||
|
dimensions?: WmLocationDimensions;
|
||||||
|
restrictions?: string[];
|
||||||
|
stockItems: WmStockItem[];
|
||||||
|
isActive: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WmLocationDimensions {
|
||||||
|
// Lokasyon Boyutları
|
||||||
|
length: number;
|
||||||
|
width: number;
|
||||||
|
height: number;
|
||||||
|
weight: number;
|
||||||
|
unit: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WmStockItem {
|
||||||
|
// Stok Kalemi
|
||||||
|
id: string;
|
||||||
|
materialId: string;
|
||||||
|
material?: MmMaterial;
|
||||||
|
warehouseId: string;
|
||||||
|
zoneId: string;
|
||||||
|
locationId: string;
|
||||||
|
quantity: number;
|
||||||
|
reservedQuantity: number;
|
||||||
|
availableQuantity: number;
|
||||||
|
unitId: string;
|
||||||
|
lotNumber?: string;
|
||||||
|
serialNumber?: string;
|
||||||
|
expiryDate?: Date;
|
||||||
|
receivedDate: Date;
|
||||||
|
lastMovementDate: Date;
|
||||||
|
status: StockStatusEnum;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WmInventoryCount {
|
||||||
|
// Envanter Sayımı
|
||||||
|
id: string;
|
||||||
|
countNumber: string;
|
||||||
|
warehouseId: string;
|
||||||
|
warehouse?: WmWarehouse;
|
||||||
|
zoneId?: string;
|
||||||
|
zone?: WmZone;
|
||||||
|
locationId?: string;
|
||||||
|
location?: WmLocation;
|
||||||
|
countType: CountTypeEnum;
|
||||||
|
status: CountStatusEnum;
|
||||||
|
scheduledDate: Date;
|
||||||
|
startDate?: Date;
|
||||||
|
endDate?: Date;
|
||||||
|
countedBy: string[];
|
||||||
|
approvedBy?: string;
|
||||||
|
items: WmInventoryCountItem[];
|
||||||
|
variances: WmInventoryVariance[];
|
||||||
|
notes?: string;
|
||||||
|
creationTime: Date;
|
||||||
|
lastModificationTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WmInventoryCountItem {
|
||||||
|
// Envanter Sayım Kalemi
|
||||||
|
id: string;
|
||||||
|
countId: string;
|
||||||
|
materialId: string;
|
||||||
|
material?: MmMaterial;
|
||||||
|
locationId: string;
|
||||||
|
systemQuantity: number;
|
||||||
|
countedQuantity: number;
|
||||||
|
variance: number;
|
||||||
|
variancePercentage: number;
|
||||||
|
lotNumber?: string;
|
||||||
|
serialNumber?: string;
|
||||||
|
countedBy: string;
|
||||||
|
countedAt: Date;
|
||||||
|
notes?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WmInventoryVariance {
|
||||||
|
// Envanter Farkı
|
||||||
|
id: string;
|
||||||
|
countId: string;
|
||||||
|
materialId: string;
|
||||||
|
locationId: string;
|
||||||
|
variance: number;
|
||||||
|
varianceValue: number;
|
||||||
|
reason?: string;
|
||||||
|
action: VarianceActionEnum;
|
||||||
|
adjustmentMade: boolean;
|
||||||
|
approvedBy?: string;
|
||||||
|
approvedAt?: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WmPutawayRule {
|
||||||
|
// Yerleştirme Kuralı
|
||||||
|
id: string;
|
||||||
|
code: string;
|
||||||
|
name: string;
|
||||||
|
description?: string;
|
||||||
|
warehouseId: string;
|
||||||
|
materialTypeId?: string;
|
||||||
|
materialGroupId?: string;
|
||||||
|
priority: number;
|
||||||
|
conditions: WmPutawayCondition[];
|
||||||
|
targetZoneId?: string;
|
||||||
|
targetLocationId?: string;
|
||||||
|
strategy: PutawayStrategyEnum;
|
||||||
|
isActive: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WmPutawayCondition {
|
||||||
|
// Yerleştirme Koşulu
|
||||||
|
id: string;
|
||||||
|
ruleId: string;
|
||||||
|
conditionType: ConditionTypeEnum;
|
||||||
|
operator: ConditionOperatorEnum;
|
||||||
|
value: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum WarehouseTypeEnum { // Depo Türleri
|
||||||
|
RawMaterials = "RAW_MATERIALS", // Hammaddeler
|
||||||
|
FinishedGoods = "FINISHED_GOODS", // Mamuller
|
||||||
|
WorkInProgress = "WIP", // İşlenmekte olan ürünler
|
||||||
|
SpareParts = "SPARE_PARTS", // Yedek Parçalar
|
||||||
|
Returns = "RETURNS", // İadeler
|
||||||
|
Quarantine = "QUARANTINE", // Karantina
|
||||||
|
Transit = "TRANSIT", // Geçici Depo
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum ZoneTypeEnum { // Bölge Türleri
|
||||||
|
Storage = "STORAGE", // Depolama
|
||||||
|
Receiving = "RECEIVING", // Giriş
|
||||||
|
Shipping = "SHIPPING", // Çıkış
|
||||||
|
Picking = "PICKING", // Toplama
|
||||||
|
Quality = "QUALITY", // Kalite Kontrol
|
||||||
|
Staging = "STAGING", // Sevkiyat Hazırlık
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum LocationTypeEnum { // Lokasyon Türleri
|
||||||
|
Shelf = "SHELF", // Raf
|
||||||
|
Bin = "BIN", // Kutu
|
||||||
|
Floor = "FLOOR", // Zemin
|
||||||
|
Rack = "RACK", // Palet Rafı
|
||||||
|
Tank = "TANK", // Tank
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum StockStatusEnum { // Stok Durumları
|
||||||
|
Available = "AVAILABLE", // Mevcut
|
||||||
|
Reserved = "RESERVED", // Rezerve Edilmiş
|
||||||
|
Blocked = "BLOCKED", // Engellenmiş
|
||||||
|
InTransit = "IN_TRANSIT", // Transferde
|
||||||
|
Quarantine = "QUARANTINE", // Karantina
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum CountTypeEnum { // Sayım Türleri
|
||||||
|
Full = "FULL", // Tam Sayım
|
||||||
|
Cycle = "CYCLE", // Döngüsel Sayım
|
||||||
|
Spot = "SPOT", // Noktasal Sayım
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum CountStatusEnum { // Sayım Durumları
|
||||||
|
Planned = "PLANNED", // Planlandı
|
||||||
|
InProgress = "IN_PROGRESS", // Devam Ediyor
|
||||||
|
Completed = "COMPLETED", // Tamamlandı
|
||||||
|
Approved = "APPROVED", // Onaylandı
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum VarianceActionEnum { // Fark Eylem Türleri
|
||||||
|
Accept = "ACCEPT", // Kabul Et
|
||||||
|
Investigate = "INVESTIGATE", // Araştır
|
||||||
|
Recount = "RECOUNT", // Yeniden Say
|
||||||
|
Adjust = "ADJUST", // Düzelt
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum PutawayStrategyEnum { // Yerleştirme Stratejileri
|
||||||
|
FIFO = "FIFO", // First In First Out
|
||||||
|
LIFO = "LIFO", // Last In First Out
|
||||||
|
NearestLocation = "NEAREST_LOCATION", // En Yakın Lokasyon
|
||||||
|
EmptyLocation = "EMPTY_LOCATION", // Boş Lokasyon
|
||||||
|
SameProduct = "SAME_PRODUCT", // Aynı Ürün
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum ConditionTypeEnum { // Koşul Türleri
|
||||||
|
MaterialType = "MATERIAL_TYPE", // Malzeme Türü
|
||||||
|
MaterialGroup = "MATERIAL_GROUP", // Malzeme Grubu
|
||||||
|
Quantity = "QUANTITY", // Miktar
|
||||||
|
Weight = "WEIGHT", // Ağırlık
|
||||||
|
Volume = "VOLUME", // Hacim
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum ConditionOperatorEnum { // Koşul Operatörleri
|
||||||
|
Equals = "EQUALS", // Eşittir
|
||||||
|
NotEquals = "NOT_EQUALS", // Eşit Değildir
|
||||||
|
GreaterThan = "GREATER_THAN", // Daha Büyüktür
|
||||||
|
LessThan = "LESS_THAN", // Daha Küçüktür
|
||||||
|
Contains = "CONTAINS", // İçerir
|
||||||
|
}
|
||||||
2700
ui/src/utils/erp.tsx
Normal file
2700
ui/src/utils/erp.tsx
Normal file
File diff suppressed because it is too large
Load diff
42
ui/src/views/accounting/AccountingManagement.tsx
Normal file
42
ui/src/views/accounting/AccountingManagement.tsx
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
import React from "react";
|
||||||
|
import { Outlet, useLocation } from "react-router-dom";
|
||||||
|
import ModuleHeader from "../../components/common/ModuleHeader";
|
||||||
|
|
||||||
|
const AccountingManagement: React.FC = () => {
|
||||||
|
const location = useLocation();
|
||||||
|
|
||||||
|
// Define page mappings for breadcrumbs
|
||||||
|
const getPageTitle = (pathname: string) => {
|
||||||
|
if (
|
||||||
|
pathname === "/admin/accounting" ||
|
||||||
|
pathname === "/admin/accounting/current-accounts"
|
||||||
|
)
|
||||||
|
return "Cari Hesap Yönetimi";
|
||||||
|
if (pathname === "/admin/accounting/waybills") return "İrsaliye Yönetimi";
|
||||||
|
if (pathname === "/admin/accounting/invoices") return "Fatura Yönetimi";
|
||||||
|
if (pathname === "/admin/accounting/cash") return "Kasa Yönetimi";
|
||||||
|
if (pathname === "/admin/accounting/bank") return "Banka Yönetimi";
|
||||||
|
if (pathname === "/admin/accounting/check-note") return "Çek & Senet Takibi";
|
||||||
|
return "Muhasebe Yönetimi";
|
||||||
|
};
|
||||||
|
|
||||||
|
const pageTitle = getPageTitle(location.pathname);
|
||||||
|
|
||||||
|
// Create breadcrumbs: Anasayfa / CRM Yönetimi / Sayfanın Adı
|
||||||
|
const breadcrumbs = [{ name: "CRM Yönetimi", href: "/admin/crm" }];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="min-h-screen bg-gray-50">
|
||||||
|
<ModuleHeader
|
||||||
|
title={pageTitle}
|
||||||
|
breadcrumbs={breadcrumbs}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<Outlet />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default AccountingManagement;
|
||||||
226
ui/src/views/accounting/BankPage.tsx
Normal file
226
ui/src/views/accounting/BankPage.tsx
Normal file
|
|
@ -0,0 +1,226 @@
|
||||||
|
import React, { useState, useEffect } from "react";
|
||||||
|
import BankManagement from "./components/BankManagement";
|
||||||
|
import BankAccountForm from "./components/BankAccountForm";
|
||||||
|
import BankMovementForm from "./components/BankMovementForm";
|
||||||
|
import BankAccountDetails from "./components/BankAccountDetails";
|
||||||
|
import {
|
||||||
|
FiBankMovement,
|
||||||
|
BankAccountTypeEnum,
|
||||||
|
BankTransactionTypeEnum,
|
||||||
|
TransactionStatusEnum,
|
||||||
|
} from "../../types/fi";
|
||||||
|
import { mockBanks } from "../../mocks/mockBanks";
|
||||||
|
import { mockBankMovements } from "../../mocks/mockBankMovements";
|
||||||
|
import { BankAccount } from "../../types/common";
|
||||||
|
|
||||||
|
const BankPage: React.FC = () => {
|
||||||
|
const [bankAccounts, setBankAccounts] = useState<BankAccount[]>(mockBanks);
|
||||||
|
const [bankMovements, setBankMovements] = useState<FiBankMovement[]>([]);
|
||||||
|
|
||||||
|
// Initialize bank movements after bank accounts are set
|
||||||
|
useEffect(() => {
|
||||||
|
if (bankAccounts.length > 0) {
|
||||||
|
setBankMovements(mockBankMovements);
|
||||||
|
}
|
||||||
|
}, [bankAccounts]);
|
||||||
|
|
||||||
|
// Modal states
|
||||||
|
const [isAccountFormOpen, setIsAccountFormOpen] = useState(false);
|
||||||
|
const [isMovementFormOpen, setIsMovementFormOpen] = useState(false);
|
||||||
|
const [isAccountDetailsOpen, setIsAccountDetailsOpen] = useState(false);
|
||||||
|
const [selectedAccount, setSelectedAccount] = useState<
|
||||||
|
BankAccount | undefined
|
||||||
|
>(undefined);
|
||||||
|
const [selectedMovement, setSelectedMovement] = useState<
|
||||||
|
FiBankMovement | undefined
|
||||||
|
>(undefined);
|
||||||
|
|
||||||
|
const handleAddAccount = () => {
|
||||||
|
setSelectedAccount(undefined);
|
||||||
|
setIsAccountFormOpen(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleEditAccount = (account: BankAccount) => {
|
||||||
|
setSelectedAccount(account);
|
||||||
|
setIsAccountFormOpen(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleAddMovement = () => {
|
||||||
|
setSelectedMovement(undefined);
|
||||||
|
setIsMovementFormOpen(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleEditMovement = (movement: FiBankMovement) => {
|
||||||
|
setSelectedMovement(movement);
|
||||||
|
setIsMovementFormOpen(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleViewDetails = (account: BankAccount) => {
|
||||||
|
setSelectedAccount(account);
|
||||||
|
setIsAccountDetailsOpen(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSaveAccount = (accountData: Partial<BankAccount>) => {
|
||||||
|
if (selectedAccount) {
|
||||||
|
// Update existing account
|
||||||
|
setBankAccounts((prev) =>
|
||||||
|
prev.map((acc) =>
|
||||||
|
acc.id === selectedAccount.id
|
||||||
|
? { ...acc, ...accountData, lastModificationTime: new Date() }
|
||||||
|
: acc
|
||||||
|
)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
// Add new account
|
||||||
|
const newAccount: BankAccount = {
|
||||||
|
id: Date.now().toString(),
|
||||||
|
accountCode: accountData.accountCode || "",
|
||||||
|
bankName: accountData.bankName || "",
|
||||||
|
branchName: accountData.branchName || "",
|
||||||
|
accountNumber: accountData.accountNumber || "",
|
||||||
|
iban: accountData.iban || "",
|
||||||
|
accountType: accountData.accountType || BankAccountTypeEnum.Current,
|
||||||
|
currency: accountData.currency || "TRY",
|
||||||
|
balance: accountData.balance || 0,
|
||||||
|
overdraftLimit: accountData.overdraftLimit || 0,
|
||||||
|
dailyTransferLimit: accountData.dailyTransferLimit || 0,
|
||||||
|
contactPerson: accountData.contactPerson,
|
||||||
|
phone: accountData.phone,
|
||||||
|
isActive: accountData.isActive ?? true,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
isDefault: false,
|
||||||
|
};
|
||||||
|
setBankAccounts((prev) => [...prev, newAccount]);
|
||||||
|
}
|
||||||
|
setIsAccountFormOpen(false);
|
||||||
|
setSelectedAccount(undefined);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSaveMovement = (movementData: Partial<FiBankMovement>) => {
|
||||||
|
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 (
|
||||||
|
<>
|
||||||
|
<BankManagement
|
||||||
|
bankAccounts={bankAccounts}
|
||||||
|
bankMovements={bankMovements}
|
||||||
|
onAddAccount={handleAddAccount}
|
||||||
|
onEditAccount={handleEditAccount}
|
||||||
|
onAddMovement={handleAddMovement}
|
||||||
|
onEditMovement={handleEditMovement}
|
||||||
|
onViewDetails={handleViewDetails}
|
||||||
|
/>
|
||||||
|
|
||||||
|
{/* Bank Account Form Modal */}
|
||||||
|
<BankAccountForm
|
||||||
|
account={selectedAccount}
|
||||||
|
isOpen={isAccountFormOpen}
|
||||||
|
onClose={() => {
|
||||||
|
setIsAccountFormOpen(false);
|
||||||
|
setSelectedAccount(undefined);
|
||||||
|
}}
|
||||||
|
onSave={handleSaveAccount}
|
||||||
|
/>
|
||||||
|
|
||||||
|
{/* Bank Movement Form Modal */}
|
||||||
|
<BankMovementForm
|
||||||
|
movement={selectedMovement}
|
||||||
|
bankAccounts={bankAccounts}
|
||||||
|
isOpen={isMovementFormOpen}
|
||||||
|
onClose={() => {
|
||||||
|
setIsMovementFormOpen(false);
|
||||||
|
setSelectedMovement(undefined);
|
||||||
|
}}
|
||||||
|
onSave={handleSaveMovement}
|
||||||
|
/>
|
||||||
|
|
||||||
|
{/* Bank Account Details Modal */}
|
||||||
|
{selectedAccount && (
|
||||||
|
<BankAccountDetails
|
||||||
|
account={selectedAccount}
|
||||||
|
movements={bankMovements}
|
||||||
|
isOpen={isAccountDetailsOpen}
|
||||||
|
onClose={() => {
|
||||||
|
setIsAccountDetailsOpen(false);
|
||||||
|
setSelectedAccount(undefined);
|
||||||
|
}}
|
||||||
|
onEdit={(account) => {
|
||||||
|
setIsAccountDetailsOpen(false);
|
||||||
|
handleEditAccount(account);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default BankPage;
|
||||||
184
ui/src/views/accounting/CashPage.tsx
Normal file
184
ui/src/views/accounting/CashPage.tsx
Normal file
|
|
@ -0,0 +1,184 @@
|
||||||
|
import React, { useState } from "react";
|
||||||
|
import CashManagement from "./components/CashManagement";
|
||||||
|
import CashAccountForm from "./components/CashAccountForm";
|
||||||
|
import CashMovementForm from "./components/CashMovementForm";
|
||||||
|
import CashAccountDetails from "./components/CashAccountDetails";
|
||||||
|
import {
|
||||||
|
FiCashAccount,
|
||||||
|
FiCashMovement,
|
||||||
|
CashMovementTypeEnum,
|
||||||
|
} from "../../types/fi";
|
||||||
|
import { mockCashAccounts } from "../../mocks/mockCashAccounts";
|
||||||
|
import { mockCashMovements } from "../../mocks/mockCashMovements";
|
||||||
|
|
||||||
|
const CashPage: React.FC = () => {
|
||||||
|
const [showAccountForm, setShowAccountForm] = useState(false);
|
||||||
|
const [showMovementForm, setShowMovementForm] = useState(false);
|
||||||
|
const [showAccountDetails, setShowAccountDetails] = useState(false);
|
||||||
|
const [editingAccount, setEditingAccount] = useState<
|
||||||
|
FiCashAccount | undefined
|
||||||
|
>();
|
||||||
|
const [editingMovement, setEditingMovement] = useState<
|
||||||
|
FiCashMovement | undefined
|
||||||
|
>();
|
||||||
|
const [viewingAccount, setViewingAccount] = useState<
|
||||||
|
FiCashAccount | undefined
|
||||||
|
>();
|
||||||
|
const [cashAccounts, setCashAccounts] = useState(mockCashAccounts);
|
||||||
|
const [cashMovements, setCashMovements] = useState(mockCashMovements);
|
||||||
|
|
||||||
|
const handleAddAccount = () => {
|
||||||
|
setEditingAccount(undefined);
|
||||||
|
setShowAccountForm(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleEditAccount = (account: FiCashAccount) => {
|
||||||
|
setEditingAccount(account);
|
||||||
|
setShowAccountForm(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSaveAccount = (accountData: Omit<FiCashAccount, "id">) => {
|
||||||
|
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<FiCashMovement, "id">) => {
|
||||||
|
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 (
|
||||||
|
<>
|
||||||
|
<CashManagement
|
||||||
|
cashAccounts={cashAccounts}
|
||||||
|
cashMovements={cashMovements}
|
||||||
|
onAddAccount={handleAddAccount}
|
||||||
|
onEditAccount={handleEditAccount}
|
||||||
|
onAddMovement={handleAddMovement}
|
||||||
|
onEditMovement={handleEditMovement}
|
||||||
|
onViewDetails={handleViewDetails}
|
||||||
|
/>
|
||||||
|
|
||||||
|
{/* Account Form Modal */}
|
||||||
|
{showAccountForm && (
|
||||||
|
<CashAccountForm
|
||||||
|
account={editingAccount}
|
||||||
|
onSave={handleSaveAccount}
|
||||||
|
onCancel={handleCloseAccountForm}
|
||||||
|
isEdit={!!editingAccount}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Movement Form Modal */}
|
||||||
|
{showMovementForm && (
|
||||||
|
<CashMovementForm
|
||||||
|
movement={editingMovement}
|
||||||
|
cashAccounts={cashAccounts}
|
||||||
|
onSave={handleSaveMovement}
|
||||||
|
onCancel={handleCloseMovementForm}
|
||||||
|
isEdit={!!editingMovement}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Account Details Modal */}
|
||||||
|
{showAccountDetails && viewingAccount && (
|
||||||
|
<CashAccountDetails
|
||||||
|
account={viewingAccount}
|
||||||
|
movements={cashMovements}
|
||||||
|
onClose={handleCloseAccountDetails}
|
||||||
|
onEdit={(account) => {
|
||||||
|
setShowAccountDetails(false);
|
||||||
|
handleEditAccount(account);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default CashPage;
|
||||||
159
ui/src/views/accounting/CheckNotePage.tsx
Normal file
159
ui/src/views/accounting/CheckNotePage.tsx
Normal file
|
|
@ -0,0 +1,159 @@
|
||||||
|
import React, { useState } from "react";
|
||||||
|
import CheckNoteManagement from "./components/CheckNoteManagement";
|
||||||
|
import {
|
||||||
|
FiCheck,
|
||||||
|
PromissoryNote,
|
||||||
|
CheckStatusEnum,
|
||||||
|
NoteStatusEnum,
|
||||||
|
} from "../../types/fi";
|
||||||
|
import { mockChecks } from "../../mocks/mockChecks";
|
||||||
|
import { mockPromissoryNotes } from "../../mocks/mockPromissoryNotes";
|
||||||
|
import { mockCurrentAccounts } from "../../mocks/mockCurrentAccounts";
|
||||||
|
|
||||||
|
const CheckNotePage: React.FC = () => {
|
||||||
|
const [checks, setChecks] = useState<FiCheck[]>(mockChecks);
|
||||||
|
const [promissoryNotes, setPromissoryNotes] =
|
||||||
|
useState<PromissoryNote[]>(mockPromissoryNotes);
|
||||||
|
|
||||||
|
const handleAddCheck = (
|
||||||
|
checkData: Omit<FiCheck, "id" | "creationTime" | "lastModificationTime">
|
||||||
|
) => {
|
||||||
|
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<FiCheck, "id" | "creationTime" | "lastModificationTime">
|
||||||
|
) => {
|
||||||
|
setChecks((prev) =>
|
||||||
|
prev.map((check) =>
|
||||||
|
check.id === id
|
||||||
|
? { ...check, ...checkData, lastModificationTime: new Date() }
|
||||||
|
: check
|
||||||
|
)
|
||||||
|
);
|
||||||
|
console.log("Check updated:", id, checkData);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleAddNote = (
|
||||||
|
noteData: Omit<
|
||||||
|
PromissoryNote,
|
||||||
|
"id" | "creationTime" | "lastModificationTime"
|
||||||
|
>
|
||||||
|
) => {
|
||||||
|
const newNote: PromissoryNote = {
|
||||||
|
...noteData,
|
||||||
|
id: `note_${Date.now()}`,
|
||||||
|
creationTime: new Date(),
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
};
|
||||||
|
setPromissoryNotes((prev) => [...prev, newNote]);
|
||||||
|
console.log("Promissory note added:", newNote);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleEditNote = (
|
||||||
|
id: string,
|
||||||
|
noteData: Omit<
|
||||||
|
PromissoryNote,
|
||||||
|
"id" | "creationTime" | "lastModificationTime"
|
||||||
|
>
|
||||||
|
) => {
|
||||||
|
setPromissoryNotes((prev) =>
|
||||||
|
prev.map((note) =>
|
||||||
|
note.id === id
|
||||||
|
? { ...note, ...noteData, lastModificationTime: new Date() }
|
||||||
|
: note
|
||||||
|
)
|
||||||
|
);
|
||||||
|
console.log("Promissory note updated:", id, noteData);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleCollectCheck = (id: string, collectionDate: Date) => {
|
||||||
|
setChecks((prev) =>
|
||||||
|
prev.map((check) =>
|
||||||
|
check.id === id
|
||||||
|
? {
|
||||||
|
...check,
|
||||||
|
status: CheckStatusEnum.Collected,
|
||||||
|
collectionDate,
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
}
|
||||||
|
: check
|
||||||
|
)
|
||||||
|
);
|
||||||
|
console.log("Check collected:", id, collectionDate);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleCollectNote = (id: string, collectionDate: Date) => {
|
||||||
|
setPromissoryNotes((prev) =>
|
||||||
|
prev.map((note) =>
|
||||||
|
note.id === id
|
||||||
|
? {
|
||||||
|
...note,
|
||||||
|
status: NoteStatusEnum.Collected,
|
||||||
|
collectionDate,
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
}
|
||||||
|
: note
|
||||||
|
)
|
||||||
|
);
|
||||||
|
console.log("Promissory note collected:", id, collectionDate);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleEndorseCheck = (id: string, endorsedTo: string) => {
|
||||||
|
setChecks((prev) =>
|
||||||
|
prev.map((check) =>
|
||||||
|
check.id === id
|
||||||
|
? {
|
||||||
|
...check,
|
||||||
|
status: CheckStatusEnum.Endorsed,
|
||||||
|
endorsedTo,
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
}
|
||||||
|
: check
|
||||||
|
)
|
||||||
|
);
|
||||||
|
console.log("Check endorsed:", id, endorsedTo);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleEndorseNote = (id: string, endorsedTo: string) => {
|
||||||
|
setPromissoryNotes((prev) =>
|
||||||
|
prev.map((note) =>
|
||||||
|
note.id === id
|
||||||
|
? {
|
||||||
|
...note,
|
||||||
|
status: NoteStatusEnum.Endorsed,
|
||||||
|
endorsedTo,
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
}
|
||||||
|
: note
|
||||||
|
)
|
||||||
|
);
|
||||||
|
console.log("Promissory note endorsed:", id, endorsedTo);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<CheckNoteManagement
|
||||||
|
checks={checks}
|
||||||
|
promissoryNotes={promissoryNotes}
|
||||||
|
currentAccounts={mockCurrentAccounts}
|
||||||
|
onAddCheck={handleAddCheck}
|
||||||
|
onEditCheck={handleEditCheck}
|
||||||
|
onAddNote={handleAddNote}
|
||||||
|
onEditNote={handleEditNote}
|
||||||
|
onCollectCheck={handleCollectCheck}
|
||||||
|
onCollectNote={handleCollectNote}
|
||||||
|
onEndorseCheck={handleEndorseCheck}
|
||||||
|
onEndorseNote={handleEndorseNote}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default CheckNotePage;
|
||||||
15
ui/src/views/accounting/CurrentAccountPage.tsx
Normal file
15
ui/src/views/accounting/CurrentAccountPage.tsx
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
import React from "react";
|
||||||
|
import CurrentAccountManagement from "./components/CurrentAccountManagement";
|
||||||
|
import { mockCurrentAccounts } from "../../mocks/mockCurrentAccounts";
|
||||||
|
import { mockCurrentAccountMovements } from "../../mocks/mockCurrentAccountMovements";
|
||||||
|
|
||||||
|
const CurrentAccountPage: React.FC = () => {
|
||||||
|
return (
|
||||||
|
<CurrentAccountManagement
|
||||||
|
accounts={mockCurrentAccounts}
|
||||||
|
accountMovements={mockCurrentAccountMovements}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default CurrentAccountPage;
|
||||||
180
ui/src/views/accounting/InvoicePage.tsx
Normal file
180
ui/src/views/accounting/InvoicePage.tsx
Normal file
|
|
@ -0,0 +1,180 @@
|
||||||
|
import React, { useState } from "react";
|
||||||
|
import InvoiceManagement from "./components/InvoiceManagement";
|
||||||
|
import InvoiceForm from "./components/InvoiceForm";
|
||||||
|
import InvoiceDetails from "./components/InvoiceDetails";
|
||||||
|
import PaymentForm from "./components/PaymentForm";
|
||||||
|
import WaybillToInvoice from "./components/WaybillToInvoice";
|
||||||
|
import {
|
||||||
|
FiInvoice,
|
||||||
|
PaymentMethodEnum,
|
||||||
|
PaymentStatusEnum,
|
||||||
|
} from "../../types/fi";
|
||||||
|
import { mockInvoices } from "../../mocks/mockInvoices";
|
||||||
|
|
||||||
|
interface PaymentData {
|
||||||
|
amount: number;
|
||||||
|
paymentDate: Date;
|
||||||
|
paymentMethod: PaymentMethodEnum;
|
||||||
|
description: string;
|
||||||
|
referenceNumber?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const InvoicePage: React.FC = () => {
|
||||||
|
const [invoices, setInvoices] = useState<FiInvoice[]>(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<FiInvoice | null>(
|
||||||
|
null
|
||||||
|
);
|
||||||
|
const [editingInvoice, setEditingInvoice] = useState<FiInvoice | null>(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<FiInvoice>) => {
|
||||||
|
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 (
|
||||||
|
<>
|
||||||
|
<InvoiceManagement
|
||||||
|
invoices={invoices}
|
||||||
|
onAdd={handleAdd}
|
||||||
|
onEdit={handleEdit}
|
||||||
|
onCreatePayment={handleCreatePayment}
|
||||||
|
onViewDetails={handleViewDetails}
|
||||||
|
onConvertFromWaybill={handleConvertFromWaybill}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<InvoiceForm
|
||||||
|
invoice={editingInvoice || undefined}
|
||||||
|
onSave={handleSaveInvoice}
|
||||||
|
onCancel={handleCancelForm}
|
||||||
|
isVisible={showInvoiceForm}
|
||||||
|
/>
|
||||||
|
|
||||||
|
{selectedInvoice && (
|
||||||
|
<>
|
||||||
|
<InvoiceDetails
|
||||||
|
invoice={selectedInvoice}
|
||||||
|
onClose={handleCancelDetails}
|
||||||
|
isVisible={showInvoiceDetails}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<PaymentForm
|
||||||
|
invoice={selectedInvoice}
|
||||||
|
onSave={handleSavePayment}
|
||||||
|
onCancel={handleCancelPayment}
|
||||||
|
isVisible={showPaymentForm}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<WaybillToInvoice
|
||||||
|
onClose={handleCancelWaybillToInvoice}
|
||||||
|
onInvoiceCreated={handleSaveFromWaybill}
|
||||||
|
isVisible={showWaybillToInvoice}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default InvoicePage;
|
||||||
142
ui/src/views/accounting/WaybillPage.tsx
Normal file
142
ui/src/views/accounting/WaybillPage.tsx
Normal file
|
|
@ -0,0 +1,142 @@
|
||||||
|
import React, { useState } from "react";
|
||||||
|
import WaybillManagement from "./components/WaybillManagement";
|
||||||
|
import WaybillForm from "./components/WaybillForm";
|
||||||
|
import WaybillDetails from "./components/WaybillDetails";
|
||||||
|
import WaybillToInvoice from "./components/WaybillToInvoice";
|
||||||
|
import { FiWaybill, WaybillStatusEnum } from "../../types/fi";
|
||||||
|
import { mockWaybills } from "../../mocks/mockWaybills";
|
||||||
|
|
||||||
|
type ViewType = "management" | "form" | "details" | "createInvoice";
|
||||||
|
|
||||||
|
const WaybillPage: React.FC = () => {
|
||||||
|
const [currentView, setCurrentView] = useState<ViewType>("management");
|
||||||
|
const [waybills, setWaybills] = useState<FiWaybill[]>(mockWaybills);
|
||||||
|
const [selectedWaybill, setSelectedWaybill] = useState<
|
||||||
|
FiWaybill | undefined
|
||||||
|
>();
|
||||||
|
|
||||||
|
const handleAdd = () => {
|
||||||
|
setSelectedWaybill(undefined);
|
||||||
|
setCurrentView("form");
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleEdit = (waybill: FiWaybill) => {
|
||||||
|
setSelectedWaybill(waybill);
|
||||||
|
setCurrentView("form");
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleViewDetails = (waybill: FiWaybill) => {
|
||||||
|
setSelectedWaybill(waybill);
|
||||||
|
setCurrentView("details");
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleCreateInvoice = (waybill: FiWaybill) => {
|
||||||
|
setSelectedWaybill(waybill);
|
||||||
|
setCurrentView("createInvoice");
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleMarkAsDelivered = (waybill: FiWaybill) => {
|
||||||
|
setWaybills((prev) =>
|
||||||
|
prev.map((w) =>
|
||||||
|
w.id === waybill.id
|
||||||
|
? {
|
||||||
|
...w,
|
||||||
|
status: WaybillStatusEnum.Delivered,
|
||||||
|
lastModificationTime: new Date(),
|
||||||
|
}
|
||||||
|
: w
|
||||||
|
)
|
||||||
|
);
|
||||||
|
alert(
|
||||||
|
`${waybill.waybillNumber} numaralı irsaliye teslim edildi olarak işaretlendi.`
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSaveWaybill = (waybillData: Partial<FiWaybill>) => {
|
||||||
|
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" && (
|
||||||
|
<WaybillManagement
|
||||||
|
waybills={waybills}
|
||||||
|
onAdd={handleAdd}
|
||||||
|
onEdit={handleEdit}
|
||||||
|
onViewDetails={handleViewDetails}
|
||||||
|
onCreateInvoice={handleCreateInvoice}
|
||||||
|
onMarkAsDelivered={handleMarkAsDelivered}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<WaybillForm
|
||||||
|
waybill={selectedWaybill}
|
||||||
|
onSave={handleSaveWaybill}
|
||||||
|
onCancel={handleCancel}
|
||||||
|
isVisible={currentView === "form"}
|
||||||
|
/>
|
||||||
|
|
||||||
|
{selectedWaybill && (
|
||||||
|
<WaybillDetails
|
||||||
|
waybill={selectedWaybill}
|
||||||
|
onClose={handleCancel}
|
||||||
|
onCreateInvoice={() => handleCreateInvoice(selectedWaybill)}
|
||||||
|
isVisible={currentView === "details"}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{selectedWaybill && (
|
||||||
|
<WaybillToInvoice
|
||||||
|
selectedWaybills={[selectedWaybill.id]}
|
||||||
|
onClose={handleCancel}
|
||||||
|
onInvoiceCreated={handleInvoiceCreated}
|
||||||
|
isVisible={currentView === "createInvoice"}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default WaybillPage;
|
||||||
477
ui/src/views/accounting/components/BankAccountDetails.tsx
Normal file
477
ui/src/views/accounting/components/BankAccountDetails.tsx
Normal file
|
|
@ -0,0 +1,477 @@
|
||||||
|
import React from "react";
|
||||||
|
import {
|
||||||
|
FaBuilding,
|
||||||
|
FaTimes,
|
||||||
|
FaCreditCard,
|
||||||
|
FaMoneyBillWave,
|
||||||
|
FaUser,
|
||||||
|
FaCalendar,
|
||||||
|
FaTimesCircle,
|
||||||
|
} from "react-icons/fa";
|
||||||
|
import {
|
||||||
|
FiBankMovement,
|
||||||
|
BankTransactionTypeEnum,
|
||||||
|
TransactionStatusEnum,
|
||||||
|
} from "../../../types/fi";
|
||||||
|
import { BankAccount } from "../../../types/common";
|
||||||
|
import {
|
||||||
|
getBankAccountTypeText,
|
||||||
|
getTransactionStatusText,
|
||||||
|
getTransactionTypeText,
|
||||||
|
} from "../../../utils/erp";
|
||||||
|
|
||||||
|
interface BankAccountDetailsProps {
|
||||||
|
account: BankAccount;
|
||||||
|
movements: FiBankMovement[];
|
||||||
|
isOpen: boolean;
|
||||||
|
onClose: () => void;
|
||||||
|
onEdit: (account: BankAccount) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const BankAccountDetails: React.FC<BankAccountDetailsProps> = ({
|
||||||
|
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 (
|
||||||
|
<div className="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
|
||||||
|
<div className="bg-white rounded-lg shadow-xl max-w-4xl w-full mx-4 max-h-[90vh] overflow-y-auto text-sm">
|
||||||
|
<div className="flex items-center justify-between p-4 border-b border-gray-200">
|
||||||
|
<div className="flex items-center gap-2.5">
|
||||||
|
<FaBuilding className="w-5 h-5 text-blue-600" />
|
||||||
|
<div>
|
||||||
|
<h2 className="text-lg font-semibold text-gray-900">
|
||||||
|
Banka Hesap Detayları
|
||||||
|
</h2>
|
||||||
|
<p className="text-sm text-gray-500">
|
||||||
|
{account.bankName} - {account.accountNumber}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
<button
|
||||||
|
onClick={() => onEdit(account)}
|
||||||
|
className="flex items-center gap-2 px-3 py-1.5 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors text-sm"
|
||||||
|
>
|
||||||
|
Düzenle
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
onClick={onClose}
|
||||||
|
className="p-2 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-md transition-colors"
|
||||||
|
>
|
||||||
|
<FaTimes className="w-5 h-5" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="p-4">
|
||||||
|
{/* Account Overview */}
|
||||||
|
<div className="grid grid-cols-1 md:grid-cols-4 gap-4 mb-6">
|
||||||
|
<div className="bg-gradient-to-r from-blue-500 to-blue-600 text-white p-4 rounded-lg">
|
||||||
|
<div className="flex items-center justify-between">
|
||||||
|
<div>
|
||||||
|
<p className="text-blue-100">Güncel Bakiye</p>
|
||||||
|
<p className="text-xl font-bold">
|
||||||
|
{formatCurrency(account.balance)}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<FaMoneyBillWave className="w-7 h-7 text-blue-200" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="bg-gradient-to-r from-green-500 to-green-600 text-white p-4 rounded-lg">
|
||||||
|
<div className="flex items-center justify-between">
|
||||||
|
<div>
|
||||||
|
<p className="text-green-100">Toplam Gelen</p>
|
||||||
|
<p className="text-xl font-bold">
|
||||||
|
{formatCurrency(totalIncoming)}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<FaMoneyBillWave className="w-7 h-7 text-green-200" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="bg-gradient-to-r from-red-500 to-red-600 text-white p-4 rounded-lg">
|
||||||
|
<div className="flex items-center justify-between">
|
||||||
|
<div>
|
||||||
|
<p className="text-red-100">Toplam Çıkan</p>
|
||||||
|
<p className="text-xl font-bold">
|
||||||
|
{formatCurrency(totalOutgoing)}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<FaMoneyBillWave className="w-7 h-7 text-red-200" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="bg-gradient-to-r from-orange-500 to-orange-600 text-white p-4 rounded-lg">
|
||||||
|
<div className="flex items-center justify-between">
|
||||||
|
<div>
|
||||||
|
<p className="text-orange-100">Bekleyen İşlem</p>
|
||||||
|
<p className="text-xl font-bold">
|
||||||
|
{pendingTransactions.length}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<FaCreditCard className="w-7 h-7 text-orange-200" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Alerts */}
|
||||||
|
{isNearOverdraftLimit() && (
|
||||||
|
<div className="bg-orange-50 border border-orange-200 rounded-lg p-3 mb-4">
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
<FaTimesCircle className="w-5 h-5 text-orange-600" />
|
||||||
|
<h3 className="text-base font-semibold text-orange-900">
|
||||||
|
Kredi Limiti Uyarısı
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
<p className="text-orange-700 mt-1">
|
||||||
|
Bu hesap kredi limitinin %80'ine yaklaşmış durumda.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
|
||||||
|
{/* Account Information */}
|
||||||
|
<div className="space-y-4">
|
||||||
|
<div className="bg-gray-50 rounded-lg p-4">
|
||||||
|
<h3 className="text-base font-semibold text-gray-900 mb-3 flex items-center gap-2">
|
||||||
|
<FaBuilding className="w-5 h-5 text-blue-600" />
|
||||||
|
Hesap Bilgileri
|
||||||
|
</h3>
|
||||||
|
<div className="space-y-2">
|
||||||
|
<div className="flex justify-between">
|
||||||
|
<span className="text-gray-600">Hesap Kodu:</span>
|
||||||
|
<span className="font-medium">{account.accountCode}</span>
|
||||||
|
</div>
|
||||||
|
<div className="flex justify-between">
|
||||||
|
<span className="text-gray-600">Banka:</span>
|
||||||
|
<span className="font-medium">{account.bankName}</span>
|
||||||
|
</div>
|
||||||
|
<div className="flex justify-between">
|
||||||
|
<span className="text-gray-600">Şube:</span>
|
||||||
|
<span className="font-medium">{account.branchName}</span>
|
||||||
|
</div>
|
||||||
|
<div className="flex justify-between">
|
||||||
|
<span className="text-gray-600">Hesap No:</span>
|
||||||
|
<span className="font-mono">{account.accountNumber}</span>
|
||||||
|
</div>
|
||||||
|
<div className="flex justify-between">
|
||||||
|
<span className="text-gray-600">IBAN:</span>
|
||||||
|
<span className="font-mono text-xs">
|
||||||
|
{formatIban(account.iban)}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div className="flex justify-between">
|
||||||
|
<span className="text-gray-600">Hesap Türü:</span>
|
||||||
|
<span className="px-2 py-1 text-xs font-medium bg-blue-100 text-blue-800 rounded-full">
|
||||||
|
{getBankAccountTypeText(account.accountType)}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div className="flex justify-between">
|
||||||
|
<span className="text-gray-600">Para Birimi:</span>
|
||||||
|
<span className="px-2 py-1 text-xs font-medium bg-gray-100 text-gray-800 rounded-full">
|
||||||
|
{account.currency}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div className="flex justify-between">
|
||||||
|
<span className="text-gray-600">Durum:</span>
|
||||||
|
<span
|
||||||
|
className={`px-2 py-1 text-xs font-medium rounded-full ${
|
||||||
|
account.isActive
|
||||||
|
? "bg-green-100 text-green-800"
|
||||||
|
: "bg-gray-100 text-gray-800"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
{account.isActive ? "Aktif" : "Pasif"}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="bg-gray-50 rounded-lg p-4">
|
||||||
|
<h3 className="text-base font-semibold text-gray-900 mb-3 flex items-center gap-2">
|
||||||
|
<FaCreditCard className="w-5 h-5 text-green-600" />
|
||||||
|
Limitler
|
||||||
|
</h3>
|
||||||
|
<div className="space-y-2">
|
||||||
|
<div className="flex justify-between">
|
||||||
|
<span className="text-gray-600">Kredi Limiti:</span>
|
||||||
|
<span className="font-medium">
|
||||||
|
{formatCurrency(account.overdraftLimit)}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div className="flex justify-between">
|
||||||
|
<span className="text-gray-600">
|
||||||
|
Günlük Transfer Limiti:
|
||||||
|
</span>
|
||||||
|
<span className="font-medium">
|
||||||
|
{formatCurrency(account.dailyTransferLimit)}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
{account.overdraftLimit > 0 && (
|
||||||
|
<div className="flex justify-between">
|
||||||
|
<span className="text-gray-600">Kullanılan Kredi:</span>
|
||||||
|
<span
|
||||||
|
className={`font-medium ${
|
||||||
|
account.balance < 0
|
||||||
|
? "text-red-600"
|
||||||
|
: "text-green-600"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
{account.balance < 0
|
||||||
|
? formatCurrency(Math.abs(account.balance))
|
||||||
|
: formatCurrency(0)}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{(account.contactPerson || account.phone) && (
|
||||||
|
<div className="bg-gray-50 rounded-lg p-4">
|
||||||
|
<h3 className="text-base font-semibold text-gray-900 mb-3 flex items-center gap-2">
|
||||||
|
<FaUser className="w-5 h-5 text-purple-600" />
|
||||||
|
İletişim Bilgileri
|
||||||
|
</h3>
|
||||||
|
<div className="space-y-2">
|
||||||
|
{account.contactPerson && (
|
||||||
|
<div className="flex justify-between">
|
||||||
|
<span className="text-gray-600">İletişim Kişisi:</span>
|
||||||
|
<span className="font-medium">
|
||||||
|
{account.contactPerson}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{account.phone && (
|
||||||
|
<div className="flex justify-between">
|
||||||
|
<span className="text-gray-600">Telefon:</span>
|
||||||
|
<span className="font-medium">{account.phone}</span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<div className="bg-gray-50 rounded-lg p-4">
|
||||||
|
<h3 className="text-base font-semibold text-gray-900 mb-3 flex items-center gap-2">
|
||||||
|
<FaCalendar className="w-5 h-5 text-gray-600" />
|
||||||
|
Tarihler
|
||||||
|
</h3>
|
||||||
|
<div className="space-y-2">
|
||||||
|
<div className="flex justify-between">
|
||||||
|
<span className="text-gray-600">Oluşturulma:</span>
|
||||||
|
<span className="font-medium">
|
||||||
|
{formatDate(account.creationTime)}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div className="flex justify-between">
|
||||||
|
<span className="text-gray-600">Son Güncelleme:</span>
|
||||||
|
<span className="font-medium">
|
||||||
|
{formatDate(account.lastModificationTime)}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Recent Movements */}
|
||||||
|
<div className="space-y-4">
|
||||||
|
<div className="bg-gray-50 rounded-lg p-4">
|
||||||
|
<h3 className="text-base font-semibold text-gray-900 mb-3">
|
||||||
|
Son Hareketler ({recentMovements.length})
|
||||||
|
</h3>
|
||||||
|
{recentMovements.length > 0 ? (
|
||||||
|
<div className="space-y-2 max-h-96 overflow-y-auto">
|
||||||
|
{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 (
|
||||||
|
<div
|
||||||
|
key={movement.id}
|
||||||
|
className="bg-white rounded-lg p-3 border"
|
||||||
|
>
|
||||||
|
<div className="flex items-center justify-between mb-2">
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
<span
|
||||||
|
className={`px-2 py-1 text-xs font-medium rounded-full ${
|
||||||
|
isIncoming
|
||||||
|
? "bg-green-100 text-green-800"
|
||||||
|
: isOutgoing
|
||||||
|
? "bg-red-100 text-red-800"
|
||||||
|
: "bg-gray-100 text-gray-800"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
{getTransactionTypeText(
|
||||||
|
movement.transactionType
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
className={`px-2 py-1 text-xs font-medium rounded-full ${
|
||||||
|
movement.status ===
|
||||||
|
TransactionStatusEnum.Completed
|
||||||
|
? "bg-green-100 text-green-800"
|
||||||
|
: movement.status ===
|
||||||
|
TransactionStatusEnum.Pending
|
||||||
|
? "bg-yellow-100 text-yellow-800"
|
||||||
|
: movement.status ===
|
||||||
|
TransactionStatusEnum.Failed
|
||||||
|
? "bg-red-100 text-red-800"
|
||||||
|
: "bg-gray-100 text-gray-800"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
{getTransactionStatusText(movement.status)}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<span
|
||||||
|
className={`font-medium ${
|
||||||
|
isIncoming
|
||||||
|
? "text-green-600"
|
||||||
|
: isOutgoing
|
||||||
|
? "text-red-600"
|
||||||
|
: "text-gray-600"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
{isIncoming ? "+" : isOutgoing ? "-" : ""}
|
||||||
|
{formatCurrency(movement.amount)}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div className="text-sm text-gray-900 font-medium mb-1">
|
||||||
|
{movement.description}
|
||||||
|
</div>
|
||||||
|
<div className="flex items-center justify-between text-xs text-gray-500">
|
||||||
|
<span>{formatDate(movement.transactionDate)}</span>
|
||||||
|
{movement.referenceNumber && (
|
||||||
|
<span>Ref: {movement.referenceNumber}</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
{movement.recipientName && (
|
||||||
|
<div className="text-xs text-blue-600 mt-1">
|
||||||
|
Alıcı: {movement.recipientName}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<div className="text-center py-6 text-gray-500">
|
||||||
|
<FaCalendar className="w-8 h-8 mx-auto mb-2 text-gray-300" />
|
||||||
|
<p>Henüz hareket bulunmamaktadır.</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{pendingTransactions.length > 0 && (
|
||||||
|
<div className="bg-yellow-50 border border-yellow-200 rounded-lg p-4">
|
||||||
|
<h3 className="text-base font-semibold text-yellow-900 mb-3 flex items-center gap-2">
|
||||||
|
<FaTimesCircle className="w-5 h-5 text-yellow-600" />
|
||||||
|
Bekleyen İşlemler ({pendingTransactions.length})
|
||||||
|
</h3>
|
||||||
|
<div className="space-y-1.5">
|
||||||
|
{pendingTransactions.slice(0, 5).map((movement) => (
|
||||||
|
<div
|
||||||
|
key={movement.id}
|
||||||
|
className="flex items-center justify-between py-2"
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<div className="text-sm font-medium text-yellow-900">
|
||||||
|
{movement.description}
|
||||||
|
</div>
|
||||||
|
<div className="text-xs text-yellow-700">
|
||||||
|
{formatDate(movement.transactionDate)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<span className="text-sm font-medium text-yellow-900">
|
||||||
|
{formatCurrency(movement.amount)}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
{pendingTransactions.length > 5 && (
|
||||||
|
<div className="text-xs text-yellow-700 text-center pt-2">
|
||||||
|
... ve {pendingTransactions.length - 5} işlem daha
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default BankAccountDetails;
|
||||||
467
ui/src/views/accounting/components/BankAccountForm.tsx
Normal file
467
ui/src/views/accounting/components/BankAccountForm.tsx
Normal file
|
|
@ -0,0 +1,467 @@
|
||||||
|
import React, { useState, useEffect } from "react";
|
||||||
|
import { FaSave, FaTimes, FaBuilding } from "react-icons/fa";
|
||||||
|
import { BankAccountTypeEnum } from "../../../types/fi";
|
||||||
|
import { BankAccount } from "../../../types/common";
|
||||||
|
|
||||||
|
interface BankAccountFormProps {
|
||||||
|
account?: BankAccount;
|
||||||
|
isOpen: boolean;
|
||||||
|
onClose: () => void;
|
||||||
|
onSave: (account: Partial<BankAccount>) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const BankAccountForm: React.FC<BankAccountFormProps> = ({
|
||||||
|
account,
|
||||||
|
isOpen,
|
||||||
|
onClose,
|
||||||
|
onSave,
|
||||||
|
}) => {
|
||||||
|
const [formData, setFormData] = useState<Partial<BankAccount>>({
|
||||||
|
accountCode: "",
|
||||||
|
bankName: "",
|
||||||
|
branchName: "",
|
||||||
|
accountNumber: "",
|
||||||
|
iban: "",
|
||||||
|
accountType: BankAccountTypeEnum.Current,
|
||||||
|
currency: "TRY",
|
||||||
|
balance: 0,
|
||||||
|
overdraftLimit: 0,
|
||||||
|
dailyTransferLimit: 0,
|
||||||
|
contactPerson: "",
|
||||||
|
phone: "",
|
||||||
|
isActive: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
const [errors, setErrors] = useState<Record<string, string>>({});
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (account) {
|
||||||
|
setFormData(account);
|
||||||
|
} else {
|
||||||
|
setFormData({
|
||||||
|
accountCode: "",
|
||||||
|
bankName: "",
|
||||||
|
branchName: "",
|
||||||
|
accountNumber: "",
|
||||||
|
iban: "",
|
||||||
|
accountType: BankAccountTypeEnum.Current,
|
||||||
|
currency: "TRY",
|
||||||
|
balance: 0,
|
||||||
|
overdraftLimit: 0,
|
||||||
|
dailyTransferLimit: 0,
|
||||||
|
contactPerson: "",
|
||||||
|
phone: "",
|
||||||
|
isActive: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
setErrors({});
|
||||||
|
}, [account, isOpen]);
|
||||||
|
|
||||||
|
const validateForm = () => {
|
||||||
|
const newErrors: Record<string, string> = {};
|
||||||
|
|
||||||
|
if (!formData.accountCode?.trim()) {
|
||||||
|
newErrors.accountCode = "Hesap kodu gereklidir";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!formData.bankName?.trim()) {
|
||||||
|
newErrors.bankName = "Banka adı gereklidir";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!formData.branchName?.trim()) {
|
||||||
|
newErrors.branchName = "Şube adı gereklidir";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!formData.accountNumber?.trim()) {
|
||||||
|
newErrors.accountNumber = "Hesap numarası gereklidir";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!formData.iban?.trim()) {
|
||||||
|
newErrors.iban = "IBAN gereklidir";
|
||||||
|
} else if (formData.iban.length < 26) {
|
||||||
|
newErrors.iban = "IBAN geçerli formatta olmalıdır";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!formData.currency?.trim()) {
|
||||||
|
newErrors.currency = "Para birimi gereklidir";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
formData.dailyTransferLimit !== undefined &&
|
||||||
|
formData.dailyTransferLimit < 0
|
||||||
|
) {
|
||||||
|
newErrors.dailyTransferLimit = "Günlük transfer limiti negatif olamaz";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (formData.overdraftLimit !== undefined && formData.overdraftLimit < 0) {
|
||||||
|
newErrors.overdraftLimit = "Kredi limiti negatif olamaz";
|
||||||
|
}
|
||||||
|
|
||||||
|
setErrors(newErrors);
|
||||||
|
return Object.keys(newErrors).length === 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSubmit = (e: React.FormEvent) => {
|
||||||
|
e.preventDefault();
|
||||||
|
if (validateForm()) {
|
||||||
|
onSave(formData);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleInputChange = (
|
||||||
|
e: React.ChangeEvent<
|
||||||
|
HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement
|
||||||
|
>
|
||||||
|
) => {
|
||||||
|
const { name, value, type } = e.target;
|
||||||
|
const parsedValue = type === "number" ? parseFloat(value) || 0 : value;
|
||||||
|
|
||||||
|
setFormData((prev) => ({
|
||||||
|
...prev,
|
||||||
|
[name]: parsedValue,
|
||||||
|
}));
|
||||||
|
|
||||||
|
// Clear error when user starts typing
|
||||||
|
if (errors[name]) {
|
||||||
|
setErrors((prev) => ({
|
||||||
|
...prev,
|
||||||
|
[name]: "",
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleCheckboxChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
const { name, checked } = e.target;
|
||||||
|
setFormData((prev) => ({
|
||||||
|
...prev,
|
||||||
|
[name]: checked,
|
||||||
|
}));
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleIbanChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
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 (
|
||||||
|
<div className="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
|
||||||
|
<div className="bg-white rounded-lg shadow-xl max-w-3xl w-full mx-4 max-h-[90vh] overflow-y-auto">
|
||||||
|
<div className="flex items-center justify-between p-4 border-b border-gray-200">
|
||||||
|
<div className="flex items-center gap-2.5">
|
||||||
|
<FaBuilding className="w-5 h-5 text-blue-600" />
|
||||||
|
<h2 className="text-lg font-semibold text-gray-900">
|
||||||
|
{account ? "Banka Hesabını Düzenle" : "Yeni Banka Hesabı"}
|
||||||
|
</h2>
|
||||||
|
</div>
|
||||||
|
<button
|
||||||
|
onClick={onClose}
|
||||||
|
className="p-2 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-md transition-colors"
|
||||||
|
>
|
||||||
|
<FaTimes className="w-5 h-5" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<form onSubmit={handleSubmit} className="p-4">
|
||||||
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||||
|
{/* Temel Bilgiler */}
|
||||||
|
<div className="space-y-3">
|
||||||
|
<h3 className="text-base font-semibold text-gray-900 border-b pb-2 mb-2">
|
||||||
|
Temel Bilgiler
|
||||||
|
</h3>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-gray-700 mb-1">
|
||||||
|
Hesap Kodu *
|
||||||
|
</label>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
name="accountCode"
|
||||||
|
value={formData.accountCode || ""}
|
||||||
|
onChange={handleInputChange}
|
||||||
|
className={`w-full px-3 py-1.5 text-sm border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 ${
|
||||||
|
errors.accountCode ? "border-red-500" : "border-gray-300"
|
||||||
|
}`}
|
||||||
|
placeholder="Örn: BANKA001"
|
||||||
|
/>
|
||||||
|
{errors.accountCode && (
|
||||||
|
<p className="text-red-500 text-xs mt-1">
|
||||||
|
{errors.accountCode}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-gray-700 mb-1">
|
||||||
|
Banka Adı *
|
||||||
|
</label>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
name="bankName"
|
||||||
|
value={formData.bankName || ""}
|
||||||
|
onChange={handleInputChange}
|
||||||
|
className={`w-full px-3 py-1.5 text-sm border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 ${
|
||||||
|
errors.bankName ? "border-red-500" : "border-gray-300"
|
||||||
|
}`}
|
||||||
|
placeholder="Örn: İş Bankası"
|
||||||
|
/>
|
||||||
|
{errors.bankName && (
|
||||||
|
<p className="text-red-500 text-xs mt-1">{errors.bankName}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-gray-700 mb-1">
|
||||||
|
Şube Adı *
|
||||||
|
</label>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
name="branchName"
|
||||||
|
value={formData.branchName || ""}
|
||||||
|
onChange={handleInputChange}
|
||||||
|
className={`w-full px-3 py-1.5 text-sm border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 ${
|
||||||
|
errors.branchName ? "border-red-500" : "border-gray-300"
|
||||||
|
}`}
|
||||||
|
placeholder="Örn: Levent Şubesi"
|
||||||
|
/>
|
||||||
|
{errors.branchName && (
|
||||||
|
<p className="text-red-500 text-xs mt-1">
|
||||||
|
{errors.branchName}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-gray-700 mb-1">
|
||||||
|
Hesap Türü
|
||||||
|
</label>
|
||||||
|
<select
|
||||||
|
name="accountType"
|
||||||
|
value={formData.accountType || BankAccountTypeEnum.Current}
|
||||||
|
onChange={handleInputChange}
|
||||||
|
className="w-full px-3 py-1.5 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||||
|
>
|
||||||
|
<option value={BankAccountTypeEnum.Current}>Vadesiz</option>
|
||||||
|
<option value={BankAccountTypeEnum.Deposit}>Vadeli</option>
|
||||||
|
<option value={BankAccountTypeEnum.Credit}>Kredi</option>
|
||||||
|
<option value={BankAccountTypeEnum.Foreign}>Döviz</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-gray-700 mb-1">
|
||||||
|
Para Birimi *
|
||||||
|
</label>
|
||||||
|
<select
|
||||||
|
name="currency"
|
||||||
|
value={formData.currency || "TRY"}
|
||||||
|
onChange={handleInputChange}
|
||||||
|
className={`w-full px-3 py-1.5 text-sm border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 ${
|
||||||
|
errors.currency ? "border-red-500" : "border-gray-300"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
<option value="TRY">TRY - Türk Lirası</option>
|
||||||
|
<option value="USD">USD - Amerikan Doları</option>
|
||||||
|
<option value="EUR">EUR - Euro</option>
|
||||||
|
<option value="GBP">GBP - İngiliz Sterlini</option>
|
||||||
|
</select>
|
||||||
|
{errors.currency && (
|
||||||
|
<p className="text-red-500 text-xs mt-1">{errors.currency}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Hesap Detayları */}
|
||||||
|
<div className="space-y-3">
|
||||||
|
<h3 className="text-base font-semibold text-gray-900 border-b pb-2 mb-2">
|
||||||
|
Hesap Detayları
|
||||||
|
</h3>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-gray-700 mb-1">
|
||||||
|
Hesap Numarası *
|
||||||
|
</label>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
name="accountNumber"
|
||||||
|
value={formData.accountNumber || ""}
|
||||||
|
onChange={handleInputChange}
|
||||||
|
className={`w-full px-3 py-1.5 text-sm border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 ${
|
||||||
|
errors.accountNumber ? "border-red-500" : "border-gray-300"
|
||||||
|
}`}
|
||||||
|
placeholder="1234567890"
|
||||||
|
/>
|
||||||
|
{errors.accountNumber && (
|
||||||
|
<p className="text-red-500 text-xs mt-1">
|
||||||
|
{errors.accountNumber}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-gray-700 mb-1">
|
||||||
|
IBAN *
|
||||||
|
</label>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
name="iban"
|
||||||
|
value={formData.iban || ""}
|
||||||
|
onChange={handleIbanChange}
|
||||||
|
className={`w-full px-3 py-1.5 text-sm border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 font-mono ${
|
||||||
|
errors.iban ? "border-red-500" : "border-gray-300"
|
||||||
|
}`}
|
||||||
|
placeholder="TR12 0006 4000 0011 2345 6789 01"
|
||||||
|
maxLength={34}
|
||||||
|
/>
|
||||||
|
{errors.iban && (
|
||||||
|
<p className="text-red-500 text-xs mt-1">{errors.iban}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-gray-700 mb-1">
|
||||||
|
Başlangıç Bakiyesi
|
||||||
|
</label>
|
||||||
|
<input
|
||||||
|
type="number"
|
||||||
|
name="balance"
|
||||||
|
value={formData.balance || 0}
|
||||||
|
onChange={handleInputChange}
|
||||||
|
className="w-full px-3 py-1.5 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||||
|
step="0.01"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-gray-700 mb-1">
|
||||||
|
Kredi Limiti
|
||||||
|
</label>
|
||||||
|
<input
|
||||||
|
type="number"
|
||||||
|
name="overdraftLimit"
|
||||||
|
value={formData.overdraftLimit || 0}
|
||||||
|
onChange={handleInputChange}
|
||||||
|
className={`w-full px-3 py-1.5 text-sm border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 ${
|
||||||
|
errors.overdraftLimit ? "border-red-500" : "border-gray-300"
|
||||||
|
}`}
|
||||||
|
step="0.01"
|
||||||
|
min="0"
|
||||||
|
/>
|
||||||
|
{errors.overdraftLimit && (
|
||||||
|
<p className="text-red-500 text-xs mt-1">
|
||||||
|
{errors.overdraftLimit}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-gray-700 mb-1">
|
||||||
|
Günlük Transfer Limiti
|
||||||
|
</label>
|
||||||
|
<input
|
||||||
|
type="number"
|
||||||
|
name="dailyTransferLimit"
|
||||||
|
value={formData.dailyTransferLimit || 0}
|
||||||
|
onChange={handleInputChange}
|
||||||
|
className={`w-full px-3 py-1.5 text-sm border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 ${
|
||||||
|
errors.dailyTransferLimit
|
||||||
|
? "border-red-500"
|
||||||
|
: "border-gray-300"
|
||||||
|
}`}
|
||||||
|
step="0.01"
|
||||||
|
min="0"
|
||||||
|
/>
|
||||||
|
{errors.dailyTransferLimit && (
|
||||||
|
<p className="text-red-500 text-xs mt-1">
|
||||||
|
{errors.dailyTransferLimit}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* İletişim Bilgileri */}
|
||||||
|
<div className="space-y-3 md:col-span-2">
|
||||||
|
<h3 className="text-base font-semibold text-gray-900 border-b pb-2 mb-2">
|
||||||
|
İletişim Bilgileri
|
||||||
|
</h3>
|
||||||
|
|
||||||
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-3">
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-gray-700 mb-1">
|
||||||
|
İletişim Kişisi
|
||||||
|
</label>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
name="contactPerson"
|
||||||
|
value={formData.contactPerson || ""}
|
||||||
|
onChange={handleInputChange}
|
||||||
|
className="w-full px-3 py-1.5 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||||
|
placeholder="Ad Soyad"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium text-gray-700 mb-1">
|
||||||
|
Telefon
|
||||||
|
</label>
|
||||||
|
<input
|
||||||
|
type="tel"
|
||||||
|
name="phone"
|
||||||
|
value={formData.phone || ""}
|
||||||
|
onChange={handleInputChange}
|
||||||
|
className="w-full px-3 py-1.5 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||||
|
placeholder="+90 212 555 1234"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="flex items-center">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
name="isActive"
|
||||||
|
checked={formData.isActive || false}
|
||||||
|
onChange={handleCheckboxChange}
|
||||||
|
className="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"
|
||||||
|
/>
|
||||||
|
<label className="ml-2 block text-sm text-gray-700">
|
||||||
|
Hesap aktif
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Form Actions */}
|
||||||
|
<div className="flex justify-end gap-3 mt-6 pt-4 border-t border-gray-200">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={onClose}
|
||||||
|
className="px-4 py-1.5 text-sm text-gray-700 bg-gray-100 hover:bg-gray-200 rounded-md transition-colors"
|
||||||
|
>
|
||||||
|
İptal
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
className="flex items-center gap-2 px-3 py-1.5 text-sm bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors"
|
||||||
|
>
|
||||||
|
<FaSave className="w-4 h-4" />
|
||||||
|
{account ? "Güncelle" : "Kaydet"}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default BankAccountForm;
|
||||||
676
ui/src/views/accounting/components/BankManagement.tsx
Normal file
676
ui/src/views/accounting/components/BankManagement.tsx
Normal file
|
|
@ -0,0 +1,676 @@
|
||||||
|
import React, { useState } from "react";
|
||||||
|
import {
|
||||||
|
FaBuilding,
|
||||||
|
FaPlus,
|
||||||
|
FaSearch,
|
||||||
|
FaExclamationTriangle,
|
||||||
|
FaCalendar,
|
||||||
|
FaEdit,
|
||||||
|
} from "react-icons/fa";
|
||||||
|
import {
|
||||||
|
FiBankMovement,
|
||||||
|
BankTransactionTypeEnum,
|
||||||
|
TransactionStatusEnum,
|
||||||
|
} from "../../../types/fi";
|
||||||
|
import DataTable, { Column } from "../../../components/common/DataTable";
|
||||||
|
import { BankAccount } from "../../../types/common";
|
||||||
|
import Widget from "../../../components/common/Widget";
|
||||||
|
import {
|
||||||
|
getBankAccountTypeColor,
|
||||||
|
getBankAccountTypeText,
|
||||||
|
getTransactionStatusColor,
|
||||||
|
getTransactionStatusText,
|
||||||
|
getTransactionTypeColor,
|
||||||
|
getTransactionTypeText,
|
||||||
|
} from "../../../utils/erp";
|
||||||
|
|
||||||
|
interface BankManagementProps {
|
||||||
|
bankAccounts: BankAccount[];
|
||||||
|
bankMovements: FiBankMovement[];
|
||||||
|
onAddAccount: () => void;
|
||||||
|
onEditAccount: (account: BankAccount) => void;
|
||||||
|
onAddMovement: () => void;
|
||||||
|
onEditMovement: (movement: FiBankMovement) => void;
|
||||||
|
onViewDetails: (account: BankAccount) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const BankManagement: React.FC<BankManagementProps> = ({
|
||||||
|
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<BankAccount>[] = [
|
||||||
|
{
|
||||||
|
key: "bankInfo",
|
||||||
|
header: "Banka Bilgileri",
|
||||||
|
render: (account: BankAccount) => (
|
||||||
|
<div>
|
||||||
|
<div className="font-medium text-gray-900">{account.bankName}</div>
|
||||||
|
<div className="text-sm text-gray-500">{account.branchName}</div>
|
||||||
|
<div className="text-xs text-gray-400">
|
||||||
|
Kod: {account.accountCode}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "accountDetails",
|
||||||
|
header: "Hesap Detayları",
|
||||||
|
render: (account: BankAccount) => (
|
||||||
|
<div>
|
||||||
|
<div className="text-sm font-mono">{account.accountNumber}</div>
|
||||||
|
<div className="text-xs font-mono text-gray-500">
|
||||||
|
{formatIban(account.iban)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "type",
|
||||||
|
header: "Tür",
|
||||||
|
render: (account: BankAccount) => (
|
||||||
|
<span
|
||||||
|
className={`px-2 py-1 text-xs font-medium rounded-full ${getBankAccountTypeColor(
|
||||||
|
account.accountType
|
||||||
|
)}`}
|
||||||
|
>
|
||||||
|
{getBankAccountTypeText(account.accountType)}
|
||||||
|
</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "currency",
|
||||||
|
header: "Para Birimi",
|
||||||
|
render: (account: BankAccount) => (
|
||||||
|
<span className="px-2 py-1 text-xs font-medium bg-gray-100 text-gray-800 rounded-full">
|
||||||
|
{account.currency}
|
||||||
|
</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "balance",
|
||||||
|
header: "Bakiye",
|
||||||
|
sortable: true,
|
||||||
|
render: (account: BankAccount) => {
|
||||||
|
const isOverdraft = account.balance < 0;
|
||||||
|
const isNearLimit = isNearOverdraftLimit(account);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="text-right">
|
||||||
|
<div
|
||||||
|
className={`font-medium ${
|
||||||
|
isOverdraft ? "text-red-600" : "text-green-600"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
{formatCurrency(account.balance)}
|
||||||
|
</div>
|
||||||
|
{account.overdraftLimit > 0 && (
|
||||||
|
<div className="text-xs text-gray-500">
|
||||||
|
Limit: {formatCurrency(account.overdraftLimit)}
|
||||||
|
{isNearLimit && (
|
||||||
|
<span className="ml-1 text-orange-600">⚠️</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "limits",
|
||||||
|
header: "Limitler",
|
||||||
|
render: (account: BankAccount) => (
|
||||||
|
<div className="text-sm">
|
||||||
|
<div>Günlük Transfer:</div>
|
||||||
|
<div className="text-gray-600">
|
||||||
|
{formatCurrency(account.dailyTransferLimit)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "contact",
|
||||||
|
header: "İletişim",
|
||||||
|
render: (account: BankAccount) => (
|
||||||
|
<div className="text-sm">
|
||||||
|
{account.contactPerson && (
|
||||||
|
<div className="text-gray-900">{account.contactPerson}</div>
|
||||||
|
)}
|
||||||
|
{account.phone && (
|
||||||
|
<div className="text-gray-500">{account.phone}</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "status",
|
||||||
|
header: "Durum",
|
||||||
|
render: (account: BankAccount) => (
|
||||||
|
<span
|
||||||
|
className={`px-2 py-1 text-xs font-medium rounded-full ${
|
||||||
|
account.isActive
|
||||||
|
? "bg-green-100 text-green-800"
|
||||||
|
: "bg-gray-100 text-gray-800"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
{account.isActive ? "Aktif" : "Pasif"}
|
||||||
|
</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "actions",
|
||||||
|
header: "İşlemler",
|
||||||
|
render: (account: BankAccount) => (
|
||||||
|
<div className="flex gap-1">
|
||||||
|
<button
|
||||||
|
onClick={() => onViewDetails(account)}
|
||||||
|
className="p-1 text-blue-600 hover:bg-blue-50 rounded"
|
||||||
|
title="Detayları Görüntüle"
|
||||||
|
>
|
||||||
|
<FaCalendar className="w-4 h-4" />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
onClick={() => onEditAccount(account)}
|
||||||
|
className="p-1 text-green-600 hover:bg-green-50 rounded"
|
||||||
|
title="Düzenle"
|
||||||
|
>
|
||||||
|
<FaEdit className="w-4 h-4" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const movementColumns: Column<FiBankMovement>[] = [
|
||||||
|
{
|
||||||
|
key: "dates",
|
||||||
|
header: "Tarihler",
|
||||||
|
sortable: true,
|
||||||
|
render: (movement: FiBankMovement) => (
|
||||||
|
<div className="text-sm">
|
||||||
|
<div>
|
||||||
|
İşlem:{" "}
|
||||||
|
{new Date(movement.transactionDate).toLocaleDateString("tr-TR")}
|
||||||
|
</div>
|
||||||
|
<div className="text-gray-500">
|
||||||
|
Valör: {new Date(movement.valueDate).toLocaleDateString("tr-TR")}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "bankAccount",
|
||||||
|
header: "Banka Hesabı",
|
||||||
|
render: (movement: FiBankMovement) => (
|
||||||
|
<div>
|
||||||
|
<div className="font-medium text-gray-900">
|
||||||
|
{movement.bankAccount?.bankName || "Bilinmeyen"}
|
||||||
|
</div>
|
||||||
|
<div className="text-sm text-gray-500">
|
||||||
|
{movement.bankAccount?.accountNumber}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "type",
|
||||||
|
header: "İşlem Türü",
|
||||||
|
render: (movement: FiBankMovement) => (
|
||||||
|
<span
|
||||||
|
className={`px-2 py-1 text-xs font-medium rounded-full ${getTransactionTypeColor(
|
||||||
|
movement.transactionType
|
||||||
|
)}`}
|
||||||
|
>
|
||||||
|
{getTransactionTypeText(movement.transactionType)}
|
||||||
|
</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "description",
|
||||||
|
header: "Açıklama",
|
||||||
|
render: (movement: FiBankMovement) => (
|
||||||
|
<div>
|
||||||
|
<div className="font-medium text-gray-900">
|
||||||
|
{movement.description}
|
||||||
|
</div>
|
||||||
|
{movement.referenceNumber && (
|
||||||
|
<div className="text-sm text-gray-500">
|
||||||
|
Ref: {movement.referenceNumber}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{movement.recipientName && (
|
||||||
|
<div className="text-sm text-blue-600">
|
||||||
|
Alıcı: {movement.recipientName}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
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 (
|
||||||
|
<div className="text-right">
|
||||||
|
<span
|
||||||
|
className={`font-medium ${
|
||||||
|
isIncoming
|
||||||
|
? "text-green-600"
|
||||||
|
: isOutgoing
|
||||||
|
? "text-red-600"
|
||||||
|
: "text-gray-600"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
{isIncoming ? "+" : isOutgoing ? "-" : ""}
|
||||||
|
{formatCurrency(movement.amount)}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "status",
|
||||||
|
header: "Durum",
|
||||||
|
render: (movement: FiBankMovement) => (
|
||||||
|
<span
|
||||||
|
className={`px-2 py-1 text-xs font-medium rounded-full ${getTransactionStatusColor(
|
||||||
|
movement.status
|
||||||
|
)}`}
|
||||||
|
>
|
||||||
|
{getTransactionStatusText(movement.status)}
|
||||||
|
</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "currentAccount",
|
||||||
|
header: "Cari Hesap",
|
||||||
|
render: (movement: FiBankMovement) => (
|
||||||
|
<div className="text-sm text-gray-900">
|
||||||
|
{movement.currentAccount?.accountCode || "-"}
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "actions",
|
||||||
|
header: "İşlemler",
|
||||||
|
render: (movement: FiBankMovement) => (
|
||||||
|
<div className="flex gap-1">
|
||||||
|
<button
|
||||||
|
onClick={() => onEditMovement(movement)}
|
||||||
|
className="p-1 text-green-600 hover:bg-green-50 rounded"
|
||||||
|
title="Düzenle"
|
||||||
|
>
|
||||||
|
<FaEdit className="w-4 h-4" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
// 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 (
|
||||||
|
<div className="space-y-3 py-2">
|
||||||
|
{/* Header */}
|
||||||
|
<div className="flex items-center justify-between">
|
||||||
|
<div>
|
||||||
|
<h2 className="text-xl font-bold text-gray-900">Banka Yönetimi</h2>
|
||||||
|
<p className="text-sm text-gray-500">
|
||||||
|
Banka hesapları ve EFT/Havale işlemleri
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div className="flex gap-2 text-sm">
|
||||||
|
<button
|
||||||
|
onClick={onAddMovement}
|
||||||
|
className="flex items-center gap-2 px-3 py-1.5 bg-green-600 text-white rounded-md hover:bg-green-700 transition-colors"
|
||||||
|
>
|
||||||
|
<FaPlus className="w-4 h-4" />
|
||||||
|
Banka Hareketi
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
onClick={onAddAccount}
|
||||||
|
className="flex items-center gap-2 px-3 py-1.5 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors"
|
||||||
|
>
|
||||||
|
<FaPlus className="w-4 h-4" />
|
||||||
|
Yeni Banka Hesabı
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Stats Cards */}
|
||||||
|
<div className="grid grid-cols-1 md:grid-cols-4 gap-4">
|
||||||
|
<Widget
|
||||||
|
title="Toplam Banka Bakiyesi"
|
||||||
|
value={formatCurrency(totalBankBalance)}
|
||||||
|
color="blue"
|
||||||
|
icon="FaBuilding"
|
||||||
|
subTitle={`${activeBankAccounts} aktif hesap`}
|
||||||
|
/>
|
||||||
|
<Widget
|
||||||
|
title="Günlük Giren"
|
||||||
|
value={formatCurrency(todayIncoming)}
|
||||||
|
color="green"
|
||||||
|
icon="FaArrowUp"
|
||||||
|
subTitle="Bugün"
|
||||||
|
/>
|
||||||
|
<Widget
|
||||||
|
title="Günlük Çıkan"
|
||||||
|
value={formatCurrency(todayOutgoing)}
|
||||||
|
color="red"
|
||||||
|
icon="FaArrowDown"
|
||||||
|
subTitle="Bugün"
|
||||||
|
/>
|
||||||
|
<Widget
|
||||||
|
title="Kredi Limiti"
|
||||||
|
value={formatCurrency(totalOverdraftLimit)}
|
||||||
|
color="orange"
|
||||||
|
icon="FaCreditCard"
|
||||||
|
subTitle="Toplam limit"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Alerts */}
|
||||||
|
{(accountsNearLimit.length > 0 || pendingTransactions.length > 0) && (
|
||||||
|
<div className="space-y-3">
|
||||||
|
{accountsNearLimit.length > 0 && (
|
||||||
|
<div className="bg-orange-50 border border-orange-200 rounded-lg p-3">
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
<FaExclamationTriangle className="w-5 h-5 text-orange-600" />
|
||||||
|
<h3 className="text-base font-semibold text-orange-900">
|
||||||
|
Kredi Limiti Uyarısı
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
<p className="text-orange-700 mt-1">
|
||||||
|
{accountsNearLimit.length} hesap kredi limitinin %80'ine
|
||||||
|
yaklaşmış durumda.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{pendingTransactions.length > 0 && (
|
||||||
|
<div className="bg-yellow-50 border border-yellow-200 rounded-lg p-3">
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
<FaExclamationTriangle className="w-5 h-5 text-yellow-600" />
|
||||||
|
<h3 className="text-base font-semibold text-yellow-900">
|
||||||
|
Bekleyen İşlemler
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
<p className="text-yellow-700 mt-1">
|
||||||
|
{pendingTransactions.length} adet bekleyen banka işlemi
|
||||||
|
bulunmaktadır.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Tabs */}
|
||||||
|
<div className="border-b border-gray-200">
|
||||||
|
<nav className="-mb-px flex space-x-6">
|
||||||
|
<button
|
||||||
|
onClick={() => setActiveTab("accounts")}
|
||||||
|
className={`py-3 px-1 border-b-2 font-medium text-sm ${
|
||||||
|
activeTab === "accounts"
|
||||||
|
? "border-blue-500 text-blue-600"
|
||||||
|
: "border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
Banka Hesapları ({bankAccounts.length})
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
onClick={() => setActiveTab("movements")}
|
||||||
|
className={`py-3 px-1 border-b-2 font-medium text-sm ${
|
||||||
|
activeTab === "movements"
|
||||||
|
? "border-blue-500 text-blue-600"
|
||||||
|
: "border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
Banka Hareketleri ({bankMovements.length})
|
||||||
|
</button>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Filters */}
|
||||||
|
<div className="flex gap-3 items-center">
|
||||||
|
<div className="flex-1 relative">
|
||||||
|
<FaSearch className="w-4 h-4 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400" />
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
placeholder={
|
||||||
|
activeTab === "accounts"
|
||||||
|
? "Banka adı, hesap no veya IBAN ara..."
|
||||||
|
: "Açıklama, referans no veya alıcı ara..."
|
||||||
|
}
|
||||||
|
value={searchTerm}
|
||||||
|
onChange={(e) => 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"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{activeTab === "movements" && (
|
||||||
|
<>
|
||||||
|
<select
|
||||||
|
value={selectedTransactionType}
|
||||||
|
onChange={(e) =>
|
||||||
|
setSelectedTransactionType(
|
||||||
|
e.target.value as BankTransactionTypeEnum | "all"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
className="px-3 py-1.5 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||||
|
>
|
||||||
|
<option value="all">Tüm İşlem Türleri</option>
|
||||||
|
{Object.values(BankTransactionTypeEnum).map((type) => (
|
||||||
|
<option key={type} value={type}>
|
||||||
|
{getTransactionTypeText(type)}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select
|
||||||
|
value={selectedStatus}
|
||||||
|
onChange={(e) =>
|
||||||
|
setSelectedStatus(
|
||||||
|
e.target.value as TransactionStatusEnum | "all"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
className="px-3 py-1.5 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||||
|
>
|
||||||
|
<option value="all">Tüm Durumlar</option>
|
||||||
|
{Object.values(TransactionStatusEnum).map((status) => (
|
||||||
|
<option key={status} value={status}>
|
||||||
|
{getTransactionStatusText(status)}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select
|
||||||
|
value={sortBy}
|
||||||
|
onChange={(e) => setSortBy(e.target.value as "date" | "amount")}
|
||||||
|
className="px-3 py-1.5 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||||
|
>
|
||||||
|
<option value="date">Tarihe Göre</option>
|
||||||
|
<option value="amount">Tutara Göre</option>
|
||||||
|
</select>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Data Table */}
|
||||||
|
<div className="bg-white rounded-lg shadow-sm border overflow-x-auto">
|
||||||
|
{activeTab === "accounts" ? (
|
||||||
|
<DataTable data={filteredAccounts} columns={accountColumns} />
|
||||||
|
) : (
|
||||||
|
<DataTable data={filteredMovements} columns={movementColumns} />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Empty State */}
|
||||||
|
{((activeTab === "accounts" && filteredAccounts.length === 0) ||
|
||||||
|
(activeTab === "movements" && filteredMovements.length === 0)) && (
|
||||||
|
<div className="text-center py-10">
|
||||||
|
<FaBuilding className="w-12 h-12 text-gray-400 mx-auto mb-4" />
|
||||||
|
<h3 className="text-base font-medium text-gray-900 mb-2">
|
||||||
|
{activeTab === "accounts"
|
||||||
|
? "Banka hesabı bulunamadı"
|
||||||
|
: "Banka hareketi bulunamadı"}
|
||||||
|
</h3>
|
||||||
|
<p className="text-sm text-gray-500">
|
||||||
|
{activeTab === "accounts"
|
||||||
|
? "Yeni bir banka hesabı ekleyin veya arama kriterlerinizi değiştirin."
|
||||||
|
: "Yeni bir banka hareketi ekleyin veya arama kriterlerinizi değiştirin."}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default BankManagement;
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue