diff --git a/src/pages/DealsPage/hooks/useDealsPageState.tsx b/src/pages/DealsPage/hooks/useDealsPageState.tsx index 68495e6..9d3a24f 100644 --- a/src/pages/DealsPage/hooks/useDealsPageState.tsx +++ b/src/pages/DealsPage/hooks/useDealsPageState.tsx @@ -1,8 +1,7 @@ import { useDealSummariesFull } from "./useDealSummaries.tsx"; import { useForm } from "@mantine/form"; import { useEffect, useState } from "react"; -import { BaseMarketplaceSchema, BoardSchema, ClientSchema, ProjectSchema } from "../../../client"; -import { DealStatusType } from "../../../shared/enums/DealStatus.ts"; +import { BaseMarketplaceSchema, BoardSchema, ClientSchema, ProjectSchema, StatusSchema } from "../../../client"; type Props = { @@ -17,7 +16,7 @@ export type DealsPageState = { projectForTable: ProjectSchema | null; board: BoardSchema | null; - dealStatus: DealStatusType | null; + dealStatus: StatusSchema | null; }; const useDealsPageState = ({ projects }: Props) => { diff --git a/src/pages/DealsPage/hooks/useProjects.tsx b/src/pages/DealsPage/hooks/useProjects.tsx index 6b1b14f..556f80d 100644 --- a/src/pages/DealsPage/hooks/useProjects.tsx +++ b/src/pages/DealsPage/hooks/useProjects.tsx @@ -1,9 +1,9 @@ import { useEffect, useState } from "react"; -import { ProjectSchema, ProjectService } from "../../../client"; +import { type ProjectSchemaWithCount, ProjectService } from "../../../client"; const useProjects = () => { - const [projects, setProjects] = useState([]); + const [projects, setProjects] = useState([]); const refetchProjects = () => { ProjectService.getProjects() diff --git a/src/pages/DealsPage/modals/ProjectsModal/ProjectsModal.tsx b/src/pages/DealsPage/modals/ProjectsModal/ProjectsModal.tsx index 0281954..48809cb 100644 --- a/src/pages/DealsPage/modals/ProjectsModal/ProjectsModal.tsx +++ b/src/pages/DealsPage/modals/ProjectsModal/ProjectsModal.tsx @@ -1,4 +1,4 @@ -import { ProjectSchema } from "../../../../client"; +import { type ProjectSchemaWithCount } from "../../../../client"; import { ContextModalProps } from "@mantine/modals"; import { ActionIcon, Flex, rem, Stack, TextInput, Tooltip } from "@mantine/core"; import { BaseTable } from "../../../../components/BaseTable/BaseTable.tsx"; @@ -75,7 +75,7 @@ const ProjectsModal = ({ innerProps }: ContextModalProps) => { ), - } as MRT_TableOptions + } as MRT_TableOptions } /> diff --git a/src/pages/StatisticsPage/types/ChartFormFilters.ts b/src/pages/StatisticsPage/types/ChartFormFilters.ts deleted file mode 100644 index 515993f..0000000 --- a/src/pages/StatisticsPage/types/ChartFormFilters.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { BaseMarketplaceSchema, ClientSchema, UserSchema } from "../../../client"; -import { DealStatusType } from "../../../shared/enums/DealStatus.ts"; - -export interface ChartFormFilters { - dateRange: [Date | null, Date | null]; - client: ClientSchema | null; - marketplace: BaseMarketplaceSchema | null; - dealStatus: DealStatusType | null; - manager: UserSchema | null; -} \ No newline at end of file diff --git a/src/shared/enums/DealStatus.ts b/src/shared/enums/DealStatus.ts deleted file mode 100644 index e79dcd7..0000000 --- a/src/shared/enums/DealStatus.ts +++ /dev/null @@ -1,35 +0,0 @@ -export enum DealStatus { - CREATED = 0, - AWAITING_ACCEPTANCE = 1, - READY_FOR_WORK = 2, - PACKAGING = 3, - AWAITING_SHIPMENT = 4, - IN_DELIVERY = 5, - AWAITING_PAYMENT = 6, - COMPLETED = 7, - CANCELLED = 8, -} - -export const getDealStatusByName = (name: string): DealStatus => { - return DealStatus[name as keyof typeof DealStatus]; -}; -export const DealStatusDictionary = { - [DealStatus.CREATED]: "Создан", - [DealStatus.AWAITING_ACCEPTANCE]: "Ожидает приемки", - [DealStatus.READY_FOR_WORK]: "Готов к работе", - [DealStatus.PACKAGING]: "Упаковка", - [DealStatus.AWAITING_SHIPMENT]: "Ожидает отгрузки", - [DealStatus.IN_DELIVERY]: "В доставке", - [DealStatus.AWAITING_PAYMENT]: "Ожидает оплаты", - [DealStatus.COMPLETED]: "Завершена", - [DealStatus.CANCELLED]: "Отменена", -}; -export type DealStatusType = { - id: number; - name: string; -}; -export const DealStatuses: DealStatusType[] = Object.entries( - DealStatusDictionary, -).map(([key, value]) => { - return { id: parseInt(key), name: value }; -});