diff --git a/src/client/index.ts b/src/client/index.ts index 069d6a1..98d5d5a 100644 --- a/src/client/index.ts +++ b/src/client/index.ts @@ -52,6 +52,8 @@ export type { CreatePayRateRequest } from './models/CreatePayRateRequest'; export type { CreatePayRateResponse } from './models/CreatePayRateResponse'; export type { CreatePositionRequest } from './models/CreatePositionRequest'; export type { CreatePositionResponse } from './models/CreatePositionResponse'; +export type { CreatePriceCategoryRequest } from './models/CreatePriceCategoryRequest'; +export type { CreatePriceCategoryResponse } from './models/CreatePriceCategoryResponse'; export type { CreateServiceKitSchema } from './models/CreateServiceKitSchema'; export type { CreateServicesKitRequest } from './models/CreateServicesKitRequest'; export type { CreateServicesKitResponse } from './models/CreateServicesKitResponse'; @@ -120,6 +122,8 @@ export type { DeletePayRateRequest } from './models/DeletePayRateRequest'; export type { DeletePayRateResponse } from './models/DeletePayRateResponse'; export type { DeletePositionRequest } from './models/DeletePositionRequest'; export type { DeletePositionResponse } from './models/DeletePositionResponse'; +export type { DeletePriceCategoryRequest } from './models/DeletePriceCategoryRequest'; +export type { DeletePriceCategoryResponse } from './models/DeletePriceCategoryResponse'; export type { DeleteShippingWarehouseRequest } from './models/DeleteShippingWarehouseRequest'; export type { DeleteShippingWarehouseResponse } from './models/DeleteShippingWarehouseResponse'; export type { GetAllBarcodeTemplateAttributesResponse } from './models/GetAllBarcodeTemplateAttributesResponse'; @@ -129,6 +133,7 @@ export type { GetAllBaseMarketplacesResponse } from './models/GetAllBaseMarketpl export type { GetAllPayRatesResponse } from './models/GetAllPayRatesResponse'; export type { GetAllPayrollSchemeResponse } from './models/GetAllPayrollSchemeResponse'; export type { GetAllPositionsResponse } from './models/GetAllPositionsResponse'; +export type { GetAllPriceCategoriesResponse } from './models/GetAllPriceCategoriesResponse'; export type { GetAllRolesResponse } from './models/GetAllRolesResponse'; export type { GetAllServicesKitsResponse } from './models/GetAllServicesKitsResponse'; export type { GetAllShippingWarehousesResponse } from './models/GetAllShippingWarehousesResponse'; @@ -174,6 +179,7 @@ export type { ProductUpdateRequest } from './models/ProductUpdateRequest'; export type { ProductUpdateResponse } from './models/ProductUpdateResponse'; export type { ProductUploadImageResponse } from './models/ProductUploadImageResponse'; export type { RoleSchema } from './models/RoleSchema'; +export type { ServiceCategoryPriceSchema } from './models/ServiceCategoryPriceSchema'; export type { ServiceCategorySchema } from './models/ServiceCategorySchema'; export type { ServiceCreateCategoryRequest } from './models/ServiceCreateCategoryRequest'; export type { ServiceCreateCategoryResponse } from './models/ServiceCreateCategoryResponse'; @@ -183,6 +189,7 @@ export type { ServiceDeleteRequest } from './models/ServiceDeleteRequest'; export type { ServiceDeleteResponse } from './models/ServiceDeleteResponse'; export type { ServiceGetAllCategoriesResponse } from './models/ServiceGetAllCategoriesResponse'; export type { ServiceGetAllResponse } from './models/ServiceGetAllResponse'; +export type { ServicePriceCategorySchema } from './models/ServicePriceCategorySchema'; export type { ServicePriceRangeSchema } from './models/ServicePriceRangeSchema'; export type { ServiceSchema } from './models/ServiceSchema'; export type { ServiceUpdateRequest } from './models/ServiceUpdateRequest'; @@ -196,6 +203,8 @@ export type { UpdateMarketplaceRequest } from './models/UpdateMarketplaceRequest export type { UpdateMarketplaceResponse } from './models/UpdateMarketplaceResponse'; export type { UpdatePayRateRequest } from './models/UpdatePayRateRequest'; export type { UpdatePayRateResponse } from './models/UpdatePayRateResponse'; +export type { UpdatePriceCategoryRequest } from './models/UpdatePriceCategoryRequest'; +export type { UpdatePriceCategoryResponse } from './models/UpdatePriceCategoryResponse'; export type { UpdateServiceKitSchema } from './models/UpdateServiceKitSchema'; export type { UpdateServicesKitRequest } from './models/UpdateServicesKitRequest'; export type { UpdateServicesKitResponse } from './models/UpdateServicesKitResponse'; diff --git a/src/client/models/CreatePriceCategoryRequest.ts b/src/client/models/CreatePriceCategoryRequest.ts new file mode 100644 index 0000000..190f822 --- /dev/null +++ b/src/client/models/CreatePriceCategoryRequest.ts @@ -0,0 +1,8 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type CreatePriceCategoryRequest = { + name: string; +}; + diff --git a/src/client/models/CreatePriceCategoryResponse.ts b/src/client/models/CreatePriceCategoryResponse.ts new file mode 100644 index 0000000..b4e605d --- /dev/null +++ b/src/client/models/CreatePriceCategoryResponse.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type CreatePriceCategoryResponse = { + ok: boolean; + message: string; +}; + diff --git a/src/client/models/DealQuickCreateRequest.ts b/src/client/models/DealQuickCreateRequest.ts index fca1507..692714d 100644 --- a/src/client/models/DealQuickCreateRequest.ts +++ b/src/client/models/DealQuickCreateRequest.ts @@ -3,6 +3,7 @@ /* tslint:disable */ /* eslint-disable */ import type { BaseMarketplaceSchema } from './BaseMarketplaceSchema'; +import type { ServicePriceCategorySchema } from './ServicePriceCategorySchema'; export type DealQuickCreateRequest = { name: string; clientName: string; @@ -10,5 +11,6 @@ export type DealQuickCreateRequest = { acceptanceDate: string; shippingWarehouse: string; baseMarketplace: BaseMarketplaceSchema; + category?: (ServicePriceCategorySchema | null); }; diff --git a/src/client/models/DealSchema.ts b/src/client/models/DealSchema.ts index 2ee158d..c8145f4 100644 --- a/src/client/models/DealSchema.ts +++ b/src/client/models/DealSchema.ts @@ -7,6 +7,7 @@ import type { DealBillRequestSchema } from './DealBillRequestSchema'; import type { DealProductSchema } from './DealProductSchema'; import type { DealServiceSchema } from './DealServiceSchema'; import type { DealStatusHistorySchema } from './DealStatusHistorySchema'; +import type { ServicePriceCategorySchema } from './ServicePriceCategorySchema'; import type { ShippingWarehouseSchema } from './ShippingWarehouseSchema'; export type DealSchema = { id: number; @@ -24,5 +25,6 @@ export type DealSchema = { comment: string; shippingWarehouse?: (ShippingWarehouseSchema | string | null); billRequest?: (DealBillRequestSchema | null); + category?: (ServicePriceCategorySchema | null); }; diff --git a/src/client/models/DeletePriceCategoryRequest.ts b/src/client/models/DeletePriceCategoryRequest.ts new file mode 100644 index 0000000..fa09b70 --- /dev/null +++ b/src/client/models/DeletePriceCategoryRequest.ts @@ -0,0 +1,8 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type DeletePriceCategoryRequest = { + id: number; +}; + diff --git a/src/client/models/DeletePriceCategoryResponse.ts b/src/client/models/DeletePriceCategoryResponse.ts new file mode 100644 index 0000000..c95ffb8 --- /dev/null +++ b/src/client/models/DeletePriceCategoryResponse.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type DeletePriceCategoryResponse = { + ok: boolean; + message: string; +}; + diff --git a/src/client/models/GetAllPriceCategoriesResponse.ts b/src/client/models/GetAllPriceCategoriesResponse.ts new file mode 100644 index 0000000..895b73f --- /dev/null +++ b/src/client/models/GetAllPriceCategoriesResponse.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { ServicePriceCategorySchema } from './ServicePriceCategorySchema'; +export type GetAllPriceCategoriesResponse = { + priceCategories: Array; +}; + diff --git a/src/client/models/ServiceCategoryPriceSchema.ts b/src/client/models/ServiceCategoryPriceSchema.ts new file mode 100644 index 0000000..e3b5084 --- /dev/null +++ b/src/client/models/ServiceCategoryPriceSchema.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { ServicePriceCategorySchema } from './ServicePriceCategorySchema'; +export type ServiceCategoryPriceSchema = { + category: ServicePriceCategorySchema; + price: number; +}; + diff --git a/src/client/models/ServicePriceCategorySchema.ts b/src/client/models/ServicePriceCategorySchema.ts new file mode 100644 index 0000000..fd0c854 --- /dev/null +++ b/src/client/models/ServicePriceCategorySchema.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type ServicePriceCategorySchema = { + id: number; + name: string; +}; + diff --git a/src/client/models/ServiceSchema.ts b/src/client/models/ServiceSchema.ts index 26542a4..395d662 100644 --- a/src/client/models/ServiceSchema.ts +++ b/src/client/models/ServiceSchema.ts @@ -2,6 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +import type { ServiceCategoryPriceSchema } from './ServiceCategoryPriceSchema'; import type { ServiceCategorySchema } from './ServiceCategorySchema'; import type { ServicePriceRangeSchema } from './ServicePriceRangeSchema'; export type ServiceSchema = { @@ -11,6 +12,7 @@ export type ServiceSchema = { price: number; serviceType: number; priceRanges: Array; + categoryPrices: Array; cost: (number | null); }; diff --git a/src/client/models/UpdatePriceCategoryRequest.ts b/src/client/models/UpdatePriceCategoryRequest.ts new file mode 100644 index 0000000..51be544 --- /dev/null +++ b/src/client/models/UpdatePriceCategoryRequest.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type UpdatePriceCategoryRequest = { + id: number; + name: string; +}; + diff --git a/src/client/models/UpdatePriceCategoryResponse.ts b/src/client/models/UpdatePriceCategoryResponse.ts new file mode 100644 index 0000000..adaf36d --- /dev/null +++ b/src/client/models/UpdatePriceCategoryResponse.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type UpdatePriceCategoryResponse = { + ok: boolean; + message: string; +}; + diff --git a/src/client/services/DealService.ts b/src/client/services/DealService.ts index e8bf4d4..2665000 100644 --- a/src/client/services/DealService.ts +++ b/src/client/services/DealService.ts @@ -305,6 +305,27 @@ export class DealService { }, }); } + /** + * Get Detailed Deal Document + * @returns any Successful Response + * @throws ApiError + */ + public static getDealDocumentDetailed({ + dealId, + }: { + dealId: number, + }): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/deal/detailedDocument/{deal_id}', + path: { + 'deal_id': dealId, + }, + errors: { + 422: `Validation Error`, + }, + }); + } /** * Services Add * @returns DealAddServicesResponse Successful Response diff --git a/src/client/services/ServiceService.ts b/src/client/services/ServiceService.ts index 22867fd..1f65fe1 100644 --- a/src/client/services/ServiceService.ts +++ b/src/client/services/ServiceService.ts @@ -3,8 +3,13 @@ /* tslint:disable */ /* eslint-disable */ import type { BaseEnumListSchema } from '../models/BaseEnumListSchema'; +import type { CreatePriceCategoryRequest } from '../models/CreatePriceCategoryRequest'; +import type { CreatePriceCategoryResponse } from '../models/CreatePriceCategoryResponse'; import type { CreateServicesKitRequest } from '../models/CreateServicesKitRequest'; import type { CreateServicesKitResponse } from '../models/CreateServicesKitResponse'; +import type { DeletePriceCategoryRequest } from '../models/DeletePriceCategoryRequest'; +import type { DeletePriceCategoryResponse } from '../models/DeletePriceCategoryResponse'; +import type { GetAllPriceCategoriesResponse } from '../models/GetAllPriceCategoriesResponse'; import type { GetAllServicesKitsResponse } from '../models/GetAllServicesKitsResponse'; import type { ServiceCreateCategoryRequest } from '../models/ServiceCreateCategoryRequest'; import type { ServiceCreateCategoryResponse } from '../models/ServiceCreateCategoryResponse'; @@ -16,6 +21,8 @@ import type { ServiceGetAllCategoriesResponse } from '../models/ServiceGetAllCat import type { ServiceGetAllResponse } from '../models/ServiceGetAllResponse'; import type { ServiceUpdateRequest } from '../models/ServiceUpdateRequest'; import type { ServiceUpdateResponse } from '../models/ServiceUpdateResponse'; +import type { UpdatePriceCategoryRequest } from '../models/UpdatePriceCategoryRequest'; +import type { UpdatePriceCategoryResponse } from '../models/UpdatePriceCategoryResponse'; import type { UpdateServicesKitRequest } from '../models/UpdateServicesKitRequest'; import type { UpdateServicesKitResponse } from '../models/UpdateServicesKitResponse'; import type { CancelablePromise } from '../core/CancelablePromise'; @@ -186,4 +193,75 @@ export class ServiceService { }, }); } + /** + * Get All Price Categories + * @returns GetAllPriceCategoriesResponse Successful Response + * @throws ApiError + */ + public static getAllPriceCategories(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/service/price-categories/get-all', + }); + } + /** + * Create Price Category + * @returns CreatePriceCategoryResponse Successful Response + * @throws ApiError + */ + public static createPriceCategory({ + requestBody, + }: { + requestBody: CreatePriceCategoryRequest, + }): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/service/price-categories/create', + body: requestBody, + mediaType: 'application/json', + errors: { + 422: `Validation Error`, + }, + }); + } + /** + * Update Price Category + * @returns UpdatePriceCategoryResponse Successful Response + * @throws ApiError + */ + public static updatePriceCategory({ + requestBody, + }: { + requestBody: UpdatePriceCategoryRequest, + }): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/service/price-categories/update', + body: requestBody, + mediaType: 'application/json', + errors: { + 422: `Validation Error`, + }, + }); + } + /** + * Delete Price Category + * @returns DeletePriceCategoryResponse Successful Response + * @throws ApiError + */ + public static deletePriceCategory({ + requestBody, + }: { + requestBody: DeletePriceCategoryRequest, + }): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/service/price-categories/delete', + body: requestBody, + mediaType: 'application/json', + errors: { + 422: `Validation Error`, + }, + }); + } } diff --git a/src/components/Dnd/CreateDealForm/CreateDealFrom.tsx b/src/components/Dnd/CreateDealForm/CreateDealFrom.tsx index 7e548af..5360f69 100644 --- a/src/components/Dnd/CreateDealForm/CreateDealFrom.tsx +++ b/src/components/Dnd/CreateDealForm/CreateDealFrom.tsx @@ -1,99 +1,108 @@ -import {Button, rem, Textarea, TextInput} from "@mantine/core"; -import {QuickDeal} from "../../../types/QuickDeal.ts"; -import {FC} from "react"; -import {useForm} from "@mantine/form"; -import styles from './CreateDealForm.module.css'; +import { Button, rem, Textarea, TextInput } from "@mantine/core"; +import { QuickDeal } from "../../../types/QuickDeal.ts"; +import { FC } from "react"; +import { useForm } from "@mantine/form"; +import styles from "./CreateDealForm.module.css"; import ClientAutocomplete from "../../Selects/ClientAutocomplete/ClientAutocomplete.tsx"; -import {DateTimePicker} from "@mantine/dates"; +import { DateTimePicker } from "@mantine/dates"; import ShippingWarehouseAutocomplete from "../../Selects/ShippingWarehouseAutocomplete/ShippingWarehouseAutocomplete.tsx"; import BaseMarketplaceSelect from "../../Selects/BaseMarketplaceSelect/BaseMarketplaceSelect.tsx"; +import ServicePriceCategorySelect from "../../Selects/ServicePriceCategorySelect/ServicePriceCategorySelect.tsx"; type Props = { onSubmit: (quickDeal: QuickDeal) => void onCancel: () => void; } -const CreateDealFrom: FC = ({onSubmit, onCancel}) => { +const CreateDealFrom: FC = ({ onSubmit, onCancel }) => { const form = useForm({ initialValues: { - name: '', - clientName: '', - clientAddress: '', - comment: '', + name: "", + clientName: "", + clientAddress: "", + comment: "", acceptanceDate: new Date(), - shippingWarehouse: '', + shippingWarehouse: "", baseMarketplace: { key: "", iconUrl: "", - name: "" - } - } + name: "", + }, + }, }); return (
onSubmit(values))} >
-
+
-
+
-
+
} placeholder={"Базовый маркетплейс"} {...form.getInputProps("baseMarketplace")} /> + +
+
+ } + placeholder={"Выберите категорию"} + {...form.getInputProps("category")} />
-
+