From dc9455966e01125095989413ec6b054403a76158 Mon Sep 17 00:00:00 2001 From: AlexSserb Date: Wed, 19 Feb 2025 14:46:13 +0400 Subject: [PATCH 01/11] feat: cards, attributes and modules --- src/client/index.ts | 166 +++---- src/client/models/AttributeSchema.ts | 15 + ...emaWithCount.ts => AttributeTypeSchema.ts} | 7 +- src/client/models/BoardSchema.ts | 2 +- src/client/models/BoxSchema.ts | 2 +- ...illRequest.ts => CancelCardBillRequest.ts} | 4 +- ...lResponse.ts => CancelCardBillResponse.ts} | 2 +- ...lAddKitRequest.ts => CardAddKitRequest.ts} | 4 +- ...eleteResponse.ts => CardAddKitResponse.ts} | 2 +- src/client/models/CardAddProductRequest.ts | 10 + ...lResponse.ts => CardAddProductResponse.ts} | 2 +- ...iceRequest.ts => CardAddServiceRequest.ts} | 4 +- ...tResponse.ts => CardAddServiceResponse.ts} | 2 +- src/client/models/CardAddServicesRequest.ts | 10 + src/client/models/CardAddServicesResponse.ts | 9 + ...oupRequest.ts => CardAddToGroupRequest.ts} | 4 +- src/client/models/CardAddToGroupResponse.ts | 9 + src/client/models/CardAttributeSchema.ts | 11 + ...uestSchema.ts => CardBillRequestSchema.ts} | 4 +- ...sRequest.ts => CardChangeStatusRequest.ts} | 4 +- ...esponse.ts => CardChangeStatusResponse.ts} | 2 +- ...pleteRequest.ts => CardCompleteRequest.ts} | 4 +- ...eteResponse.ts => CardCompleteResponse.ts} | 2 +- src/client/models/CardCreateGroupResponse.ts | 9 + .../models/CardCreateGuestUrlRequest.ts | 8 + ...ponse.ts => CardCreateGuestUrlResponse.ts} | 2 +- ...Request.ts => CardDeleteProductRequest.ts} | 4 +- .../models/CardDeleteProductResponse.ts | 9 + ...equest.ts => CardDeleteProductsRequest.ts} | 4 +- .../models/CardDeleteProductsResponse.ts | 9 + ...lDeleteRequest.ts => CardDeleteRequest.ts} | 4 +- ...ddKitResponse.ts => CardDeleteResponse.ts} | 2 +- ...Request.ts => CardDeleteServiceRequest.ts} | 4 +- .../models/CardDeleteServiceResponse.ts | 9 + ...equest.ts => CardDeleteServicesRequest.ts} | 4 +- .../models/CardDeleteServicesResponse.ts | 9 + ...loyeesSchema.ts => CardEmployeesSchema.ts} | 2 +- ...InfoSchema.ts => CardGeneralInfoSchema.ts} | 12 +- src/client/models/CardGetAllResponse.ts | 9 + ...est.ts => CardGroupChangeStatusRequest.ts} | 2 +- .../models/CardGroupChangeStatusResponse.ts | 9 + ...{DealGroupSchema.ts => CardGroupSchema.ts} | 2 +- src/client/models/CardGroupUpdateRequest.ts | 9 + src/client/models/CardGroupUpdateResponse.ts | 9 + src/client/models/CardPrefillRequest.ts | 9 + ...fillResponse.ts => CardPrefillResponse.ts} | 2 +- ...Request.ts => CardProductAddKitRequest.ts} | 4 +- .../models/CardProductAddKitResponse.ts | 9 + ...lProductSchema.ts => CardProductSchema.ts} | 6 +- ...eSchema.ts => CardProductServiceSchema.ts} | 2 +- ...teRequest.ts => CardQuickCreateRequest.ts} | 2 +- src/client/models/CardQuickCreateResponse.ts | 8 + .../models/CardRecalculatePriceRequest.ts | 8 + ...nse.ts => CardRecalculatePriceResponse.ts} | 2 +- .../models/CardRemoveFromGroupRequest.ts | 8 + .../models/CardRemoveFromGroupResponse.ts | 9 + .../models/{DealSchema.ts => CardSchema.ts} | 35 +- ...lServiceSchema.ts => CardServiceSchema.ts} | 2 +- ...yRequest.ts => CardServicesCopyRequest.ts} | 4 +- src/client/models/CardServicesCopyResponse.ts | 9 + ...rySchema.ts => CardStatusHistorySchema.ts} | 2 +- .../models/{DealSummary.ts => CardSummary.ts} | 12 +- ...equest.ts => CardSummaryReorderRequest.ts} | 4 +- src/client/models/CardSummaryResponse.ts | 9 + .../models/CardUpdateGeneralInfoRequest.ts | 10 + .../models/CardUpdateGeneralInfoResponse.ts | 9 + ...ts => CardUpdateProductQuantityRequest.ts} | 4 +- .../CardUpdateProductQuantityResponse.ts | 9 + src/client/models/CardUpdateProductRequest.ts | 10 + .../models/CardUpdateProductResponse.ts | 9 + ...ts => CardUpdateServiceQuantityRequest.ts} | 4 +- .../CardUpdateServiceQuantityResponse.ts | 9 + src/client/models/CardUpdateServiceRequest.ts | 10 + .../models/CardUpdateServiceResponse.ts | 9 + ...DealSchema.ts => CreateBoxInCardSchema.ts} | 4 +- ...illRequest.ts => CreateCardBillRequest.ts} | 4 +- src/client/models/CreateCardBillResponse.ts | 9 + src/client/models/CreateCardGroupRequest.ts | 9 + ...uest.ts => CreateCardsFromExcelRequest.ts} | 2 +- .../models/CreateCardsFromExcelResponse.ts | 9 + src/client/models/DealAddProductRequest.ts | 10 - src/client/models/DealAddServiceResponse.ts | 9 - src/client/models/DealAddServicesRequest.ts | 10 - src/client/models/DealAddServicesResponse.ts | 9 - src/client/models/DealAddToGroupResponse.ts | 9 - src/client/models/DealCreateGroupRequest.ts | 9 - src/client/models/DealCreateGroupResponse.ts | 9 - .../models/DealCreateGuestUrlRequest.ts | 8 - .../models/DealDeleteProductResponse.ts | 9 - .../models/DealDeleteProductsResponse.ts | 9 - .../models/DealDeleteServiceResponse.ts | 9 - .../models/DealDeleteServicesResponse.ts | 9 - src/client/models/DealGetAllResponse.ts | 9 - .../models/DealGroupChangeStatusResponse.ts | 9 - src/client/models/DealGroupUpdateRequest.ts | 9 - src/client/models/DealGroupUpdateResponse.ts | 9 - src/client/models/DealPrefillRequest.ts | 9 - .../models/DealProductAddKitResponse.ts | 9 - src/client/models/DealQuickCreateResponse.ts | 8 - .../models/DealRecalculatePriceRequest.ts | 8 - .../models/DealRecalculatePriceResponse.ts | 9 - .../models/DealRemoveFromGroupRequest.ts | 8 - .../models/DealRemoveFromGroupResponse.ts | 9 - src/client/models/DealServicesCopyResponse.ts | 9 - src/client/models/DealSummaryResponse.ts | 9 - .../models/DealUpdateGeneralInfoRequest.ts | 10 - .../models/DealUpdateGeneralInfoResponse.ts | 9 - .../DealUpdateProductQuantityResponse.ts | 9 - src/client/models/DealUpdateProductRequest.ts | 10 - .../models/DealUpdateProductResponse.ts | 9 - .../DealUpdateServiceQuantityResponse.ts | 9 - src/client/models/DealUpdateServiceRequest.ts | 10 - .../models/DealUpdateServiceResponse.ts | 9 - src/client/models/FullProjectSchema.ts | 14 + ...{GetDealBillById.ts => GetCardBillById.ts} | 6 +- .../GetCardProductsBarcodesPdfRequest.ts | 8 + ... => GetCardProductsBarcodesPdfResponse.ts} | 2 +- .../GetDealProductsBarcodesPdfRequest.ts | 8 - .../models/GetProfitChartDataRequest.ts | 2 +- .../models/GetProfitTableDataRequest.ts | 2 +- src/client/models/GetProjectsResponse.ts | 4 +- src/client/models/ManageEmployeeRequest.ts | 2 +- src/client/models/ModuleSchema.ts | 10 + ...Response.ts => ParseCardsExcelResponse.ts} | 2 +- src/client/models/ProfitChartDataItem.ts | 2 +- src/client/models/ProfitTableDataItem.ts | 2 +- src/client/models/ProjectSchema.ts | 4 + src/client/models/ServiceCategorySchema.ts | 2 +- src/client/models/UpdateBoxRequest.ts | 4 +- src/client/services/BillingService.ts | 26 +- ...ealGroupService.ts => CardGroupService.ts} | 74 ++-- .../{DealService.ts => CardService.ts} | 412 +++++++++--------- src/client/services/ShippingService.ts | 8 +- .../CardAttributeFields.tsx | 31 ++ .../components/CardAttributeField.tsx | 51 +++ .../utils/getAttributesFromCard.ts | 27 ++ .../DealStatusSelect/DealStatusSelect.tsx | 2 +- src/components/Dnd/Boards/Boards/Boards.tsx | 11 +- .../Dnd/Boards/Boards/hooks/useBoards.tsx | 7 +- .../Dnd/Boards/Boards/hooks/useBoardsDnd.tsx | 4 +- .../CardGroupView/CardGroupView.tsx} | 24 +- .../CardSummaryItem.module.css} | 0 .../CardSummaryItem/CardSummaryItem.tsx} | 89 ++-- .../CardSummaryItem/useCardSummaryState.tsx} | 57 ++- .../CardsDndColumn/CardsDndColumn.tsx} | 114 ++--- .../CardsDndColumn}/DealsDndColumn.module.css | 0 .../CardsDndColumn/hooks/useCardsDnd.tsx} | 68 +-- .../CardsDndColumn}/utils/getColumnColor.ts | 0 .../CardsDndFooter/CardsDndFooter.tsx} | 8 +- .../CreateCardButton/CreateCardButton.tsx} | 35 +- .../CreateDealButton.module.css | 0 .../CreateCardForm/CreateCardForm.tsx} | 40 +- .../CreateCardForm}/CreateDealForm.module.css | 0 .../CreateDealsFromFileButton.module.css | 0 .../CreateDealsFromFileButton.tsx | 4 +- src/components/Dnd/Statuses/Status/Status.tsx | 10 +- .../Dnd/Statuses/Statuses/Statuses.tsx | 18 +- .../Statuses/hooks/useStatusesDnd.tsx | 6 +- .../ManagerSelect/ManagerSelect.tsx | 2 +- src/components/Navbar/Navbar.tsx | 7 +- .../EmployeeTableModal/EmployeeTableModal.tsx | 2 +- .../EnterDeadlineModal/EnterDeadlineModal.tsx | 8 +- src/modals/modals.ts | 24 +- src/pages/CardPage/index.ts | 1 + src/pages/CardPage/ui/CardPage.tsx | 38 ++ .../DealProductServiceTable.tsx | 8 +- .../DealProductsTable/DealProductsTable.tsx | 18 +- .../components/DealProductsTable/columns.tsx | 8 +- .../DealServicesTable/DealServicesTable.tsx | 16 +- .../components/DealServicesTable/columns.tsx | 6 +- .../CardStatusChangeTable.tsx} | 8 +- .../DealStatusChangeTable/columns.tsx | 4 +- .../components/DealsTable/CardsTable.tsx} | 24 +- .../components/DealsTable/columns.tsx | 8 +- .../LeadsPageHeader/LeadsPageHeader.tsx | 10 +- .../SimpleUsersTable/SimpleUsersTable.tsx | 0 .../components/SimpleUsersTable/columns.tsx | 0 .../CardsPage/contexts/CardPageContext.tsx | 75 ++++ .../CardsPage/contexts/PrefillCardContext.tsx | 71 +++ .../contexts/PrefillDealsWithExcelContext.tsx | 48 +- .../CardEditDrawer/CardEditDrawer.module.css} | 0 .../CardEditDrawer/CardEditDrawer.tsx} | 71 +-- .../CardPrefillDrawer.module.css} | 0 .../CardPrefillDrawer/CardPrefillDrawer.tsx} | 20 +- .../components/Preview/Preview.module.css | 0 .../components/Preview/Preview.tsx | 18 +- .../ProductPreview/ProductPreview.module.css | 0 .../ProductPreview/ProductPreview.tsx | 4 +- .../DealServicesTable/DealServicesTable.tsx | 6 +- .../tables/DealServicesTable/columns.tsx | 4 +- .../tables/DealsTable/DealsTable.tsx | 10 +- .../components/tables/DealsTable/columns.tsx | 12 +- .../ProductServicesTable.tsx | 6 +- .../tables/ProductServicesTable/columns.tsx | 6 +- .../hooks/usePrefillDeal.tsx | 4 +- .../PrefillCardsWithExcelDrawer.module.css} | 0 .../PrefillCardsWithExcelDrawer.tsx} | 14 +- .../components/BreakdownByCityTable.tsx | 0 .../components/ParsingResultsTooltip.tsx | 4 +- .../components/ProductsPreview.tsx | 8 +- .../components/ProductsTable.tsx | 0 .../hooks/useBreakdownByCityTableColumns.tsx | 0 .../hooks/useProductsTableColumns.tsx | 4 +- .../PrefillCardWithExcelDrawer}/types.tsx | 2 +- .../enums/DisplayMode.ts | 0 .../enums/DragState.ts | 0 .../hooks/useBoards.tsx | 0 .../hooks/useCardSummaries.tsx} | 14 +- .../hooks/useCardsPageState.tsx} | 20 +- .../{DealsPage => CardsPage}/hooks/useDnd.tsx | 8 +- .../hooks/useManagersList.tsx | 0 .../hooks/useProjects.tsx | 4 +- src/pages/CardsPage/index.ts | 1 + .../modals/AddCardProductModal.tsx} | 18 +- .../modals/AddCardServiceModal.tsx} | 12 +- .../modals/BoardModal/BoardModal.tsx | 0 .../modals/BoardModal/hooks/useBoardModal.tsx | 0 .../modals/CardsTableFiltersModal.tsx} | 10 +- .../modals/ProductServiceFormModal.tsx | 10 +- .../modals/ProjectsModal/ProjectsModal.tsx | 4 +- .../hooks/projectsTableColumns.tsx | 0 .../ProjectsModal/hooks/useProjectModal.tsx | 0 .../modals/SelectCardProductsModal.tsx} | 36 +- .../modals/StatusModal/StatusModal.tsx | 0 .../StatusModal/hooks/useStatusModal.tsx | 0 .../tabs/ClientTab}/ClientTab.tsx | 24 +- .../tabs/EmployeesTab/EmployeesTab.tsx | 0 .../components/AvailableEmployeesSelect.tsx | 6 +- .../EmployeesTab/components/EmployeeInput.tsx | 0 .../components/EmployeesTable.tsx | 10 +- .../hooks/useAvailableEmployeesList.tsx | 8 +- .../EmployeesTab/hooks/useEmployeesTab.tsx | 28 +- .../hooks/useEmployeesTableColumns.tsx | 4 +- .../EmployeesTab/modals/AssignUserModal.tsx | 12 +- .../types/AssignUserModalForm.tsx | 0 .../CardsPage/tabs/GeneralTab/GeneralTab.tsx | 309 +++++++++++++ .../components/PaymentLinkButton.tsx | 43 ++ .../components/PrintDealBarcodesButton.tsx | 63 +++ .../ProductAndServiceTab.module.css | 0 .../ProductAndServiceTab.tsx | 104 ++--- .../DealServicesTable/CardServicesTable.tsx} | 30 +- .../ProductServicesTable.tsx | 18 +- .../ProductServicesTable/columns.tsx | 6 +- .../ProductView/ProductView.module.css | 0 .../components/ProductView/ProductView.tsx | 28 +- .../hooks/useProductAndServiceTabState.tsx | 106 ++--- .../tabs/ShippingTab/ShippingTab.tsx | 4 +- .../ShippingTab/components/BoxesTable.tsx | 12 +- .../components/ShippingProductSelect.tsx | 0 .../components/ShippingProductsTable.tsx | 12 +- .../ShippingTab/components/ShippingTree.tsx | 10 +- .../hooks/shippingTableColumns.tsx | 0 .../tabs/ShippingTab/hooks/useShipping.tsx | 28 +- .../tabs/ShippingTab/hooks/useShippingQrs.tsx | 12 +- .../tabs/ShippingTab/hooks/useUpdateCard.tsx | 18 + .../modals/ShippingProductModal.tsx | 20 +- .../ShippingTab/types/ShippingProductData.tsx | 0 .../ShippingTab/utils/getRestProducts.tsx | 14 +- .../ui/CardsPage.module.css} | 0 .../ui/CardsPage.tsx} | 46 +- .../CardsPage/utils/isModuleInProject.ts | 12 + src/pages/DealPage/index.ts | 1 - src/pages/DealPage/ui/DealPage.tsx | 30 -- .../DealsPage/contexts/DealPageContext.tsx | 74 ---- .../DealsPage/contexts/PrefillDealContext.tsx | 71 --- .../tabs/DealEditDrawerGeneralTab.tsx | 373 ---------------- src/pages/DealsPage/index.ts | 1 - .../tabs/ShippingTab/hooks/useUpdateDeal.tsx | 18 - .../ServicesTable/ServicesTable.tsx | 6 +- .../modals/CreateServiceCategoryModal.tsx | 2 +- .../modals/CreateServiceModal.tsx | 2 +- src/pages/ServicesPage/ui/ServicesPage.tsx | 2 +- .../ShippingWarehousesTable.tsx | 4 +- .../modals/ShippingWarehouseForm.tsx | 20 +- .../ui/ShippingWarehousesPage.tsx | 4 +- .../ProfitTab/components/Filters/Filters.tsx | 6 +- .../ProfitTable/hooks/useProfitTable.tsx | 2 +- .../tabs/ProfitTab/components/Total/Total.tsx | 4 +- .../ProfitTab/contexts/ProfitTabContext.tsx | 4 +- .../ProfitTab/modals/ProfitFiltersModal.tsx | 2 +- src/pages/StatisticsPage/types/FormFilters.ts | 2 +- src/routes/deals.$dealId.tsx | 4 +- src/routes/leads.$dealId.tsx | 4 +- src/routes/leads.lazy.tsx | 4 +- src/types/{QuickDeal.ts => QuickCard.ts} | 2 +- src/types/utils.ts | 2 +- 286 files changed, 2355 insertions(+), 2168 deletions(-) create mode 100644 src/client/models/AttributeSchema.ts rename src/client/models/{ProjectSchemaWithCount.ts => AttributeTypeSchema.ts} (68%) rename src/client/models/{CancelDealBillRequest.ts => CancelCardBillRequest.ts} (70%) rename src/client/models/{CreateDealBillResponse.ts => CancelCardBillResponse.ts} (81%) rename src/client/models/{DealAddKitRequest.ts => CardAddKitRequest.ts} (74%) rename src/client/models/{DealDeleteResponse.ts => CardAddKitResponse.ts} (83%) create mode 100644 src/client/models/CardAddProductRequest.ts rename src/client/models/{CancelDealBillResponse.ts => CardAddProductResponse.ts} (81%) rename src/client/models/{DealAddServiceRequest.ts => CardAddServiceRequest.ts} (77%) rename src/client/models/{DealAddProductResponse.ts => CardAddServiceResponse.ts} (81%) create mode 100644 src/client/models/CardAddServicesRequest.ts create mode 100644 src/client/models/CardAddServicesResponse.ts rename src/client/models/{DealAddToGroupRequest.ts => CardAddToGroupRequest.ts} (73%) create mode 100644 src/client/models/CardAddToGroupResponse.ts create mode 100644 src/client/models/CardAttributeSchema.ts rename src/client/models/{DealBillRequestSchema.ts => CardBillRequestSchema.ts} (80%) rename src/client/models/{DealChangeStatusRequest.ts => CardChangeStatusRequest.ts} (72%) rename src/client/models/{DealChangeStatusResponse.ts => CardChangeStatusResponse.ts} (78%) rename src/client/models/{DealCompleteRequest.ts => CardCompleteRequest.ts} (70%) rename src/client/models/{DealCompleteResponse.ts => CardCompleteResponse.ts} (82%) create mode 100644 src/client/models/CardCreateGroupResponse.ts create mode 100644 src/client/models/CardCreateGuestUrlRequest.ts rename src/client/models/{DealCreateGuestUrlResponse.ts => CardCreateGuestUrlResponse.ts} (81%) rename src/client/models/{DealDeleteProductRequest.ts => CardDeleteProductRequest.ts} (72%) create mode 100644 src/client/models/CardDeleteProductResponse.ts rename src/client/models/{DealDeleteProductsRequest.ts => CardDeleteProductsRequest.ts} (73%) create mode 100644 src/client/models/CardDeleteProductsResponse.ts rename src/client/models/{DealDeleteRequest.ts => CardDeleteRequest.ts} (71%) rename src/client/models/{DealAddKitResponse.ts => CardDeleteResponse.ts} (83%) rename src/client/models/{DealDeleteServiceRequest.ts => CardDeleteServiceRequest.ts} (72%) create mode 100644 src/client/models/CardDeleteServiceResponse.ts rename src/client/models/{DealDeleteServicesRequest.ts => CardDeleteServicesRequest.ts} (73%) create mode 100644 src/client/models/CardDeleteServicesResponse.ts rename src/client/models/{DealEmployeesSchema.ts => CardEmployeesSchema.ts} (86%) rename src/client/models/{DealGeneralInfoSchema.ts => CardGeneralInfoSchema.ts} (54%) create mode 100644 src/client/models/CardGetAllResponse.ts rename src/client/models/{DealGroupChangeStatusRequest.ts => CardGroupChangeStatusRequest.ts} (80%) create mode 100644 src/client/models/CardGroupChangeStatusResponse.ts rename src/client/models/{DealGroupSchema.ts => CardGroupSchema.ts} (91%) create mode 100644 src/client/models/CardGroupUpdateRequest.ts create mode 100644 src/client/models/CardGroupUpdateResponse.ts create mode 100644 src/client/models/CardPrefillRequest.ts rename src/client/models/{DealPrefillResponse.ts => CardPrefillResponse.ts} (82%) rename src/client/models/{DealProductAddKitRequest.ts => CardProductAddKitRequest.ts} (74%) create mode 100644 src/client/models/CardProductAddKitResponse.ts rename src/client/models/{DealProductSchema.ts => CardProductSchema.ts} (65%) rename src/client/models/{DealProductServiceSchema.ts => CardProductServiceSchema.ts} (89%) rename src/client/models/{DealQuickCreateRequest.ts => CardQuickCreateRequest.ts} (91%) create mode 100644 src/client/models/CardQuickCreateResponse.ts create mode 100644 src/client/models/CardRecalculatePriceRequest.ts rename src/client/models/{CreateDealsFromExcelResponse.ts => CardRecalculatePriceResponse.ts} (79%) create mode 100644 src/client/models/CardRemoveFromGroupRequest.ts create mode 100644 src/client/models/CardRemoveFromGroupResponse.ts rename src/client/models/{DealSchema.ts => CardSchema.ts} (54%) rename src/client/models/{DealServiceSchema.ts => CardServiceSchema.ts} (91%) rename src/client/models/{DealServicesCopyRequest.ts => CardServicesCopyRequest.ts} (77%) create mode 100644 src/client/models/CardServicesCopyResponse.ts rename src/client/models/{DealStatusHistorySchema.ts => CardStatusHistorySchema.ts} (91%) rename src/client/models/{DealSummary.ts => CardSummary.ts} (67%) rename src/client/models/{DealSummaryReorderRequest.ts => CardSummaryReorderRequest.ts} (79%) create mode 100644 src/client/models/CardSummaryResponse.ts create mode 100644 src/client/models/CardUpdateGeneralInfoRequest.ts create mode 100644 src/client/models/CardUpdateGeneralInfoResponse.ts rename src/client/models/{DealUpdateProductQuantityRequest.ts => CardUpdateProductQuantityRequest.ts} (72%) create mode 100644 src/client/models/CardUpdateProductQuantityResponse.ts create mode 100644 src/client/models/CardUpdateProductRequest.ts create mode 100644 src/client/models/CardUpdateProductResponse.ts rename src/client/models/{DealUpdateServiceQuantityRequest.ts => CardUpdateServiceQuantityRequest.ts} (72%) create mode 100644 src/client/models/CardUpdateServiceQuantityResponse.ts create mode 100644 src/client/models/CardUpdateServiceRequest.ts create mode 100644 src/client/models/CardUpdateServiceResponse.ts rename src/client/models/{CreateBoxInDealSchema.ts => CreateBoxInCardSchema.ts} (67%) rename src/client/models/{CreateDealBillRequest.ts => CreateCardBillRequest.ts} (70%) create mode 100644 src/client/models/CreateCardBillResponse.ts create mode 100644 src/client/models/CreateCardGroupRequest.ts rename src/client/models/{CreateDealsFromExcelRequest.ts => CreateCardsFromExcelRequest.ts} (87%) create mode 100644 src/client/models/CreateCardsFromExcelResponse.ts delete mode 100644 src/client/models/DealAddProductRequest.ts delete mode 100644 src/client/models/DealAddServiceResponse.ts delete mode 100644 src/client/models/DealAddServicesRequest.ts delete mode 100644 src/client/models/DealAddServicesResponse.ts delete mode 100644 src/client/models/DealAddToGroupResponse.ts delete mode 100644 src/client/models/DealCreateGroupRequest.ts delete mode 100644 src/client/models/DealCreateGroupResponse.ts delete mode 100644 src/client/models/DealCreateGuestUrlRequest.ts delete mode 100644 src/client/models/DealDeleteProductResponse.ts delete mode 100644 src/client/models/DealDeleteProductsResponse.ts delete mode 100644 src/client/models/DealDeleteServiceResponse.ts delete mode 100644 src/client/models/DealDeleteServicesResponse.ts delete mode 100644 src/client/models/DealGetAllResponse.ts delete mode 100644 src/client/models/DealGroupChangeStatusResponse.ts delete mode 100644 src/client/models/DealGroupUpdateRequest.ts delete mode 100644 src/client/models/DealGroupUpdateResponse.ts delete mode 100644 src/client/models/DealPrefillRequest.ts delete mode 100644 src/client/models/DealProductAddKitResponse.ts delete mode 100644 src/client/models/DealQuickCreateResponse.ts delete mode 100644 src/client/models/DealRecalculatePriceRequest.ts delete mode 100644 src/client/models/DealRecalculatePriceResponse.ts delete mode 100644 src/client/models/DealRemoveFromGroupRequest.ts delete mode 100644 src/client/models/DealRemoveFromGroupResponse.ts delete mode 100644 src/client/models/DealServicesCopyResponse.ts delete mode 100644 src/client/models/DealSummaryResponse.ts delete mode 100644 src/client/models/DealUpdateGeneralInfoRequest.ts delete mode 100644 src/client/models/DealUpdateGeneralInfoResponse.ts delete mode 100644 src/client/models/DealUpdateProductQuantityResponse.ts delete mode 100644 src/client/models/DealUpdateProductRequest.ts delete mode 100644 src/client/models/DealUpdateProductResponse.ts delete mode 100644 src/client/models/DealUpdateServiceQuantityResponse.ts delete mode 100644 src/client/models/DealUpdateServiceRequest.ts delete mode 100644 src/client/models/DealUpdateServiceResponse.ts create mode 100644 src/client/models/FullProjectSchema.ts rename src/client/models/{GetDealBillById.ts => GetCardBillById.ts} (51%) create mode 100644 src/client/models/GetCardProductsBarcodesPdfRequest.ts rename src/client/models/{GetDealProductsBarcodesPdfResponse.ts => GetCardProductsBarcodesPdfResponse.ts} (80%) delete mode 100644 src/client/models/GetDealProductsBarcodesPdfRequest.ts create mode 100644 src/client/models/ModuleSchema.ts rename src/client/models/{ParseDealsExcelResponse.ts => ParseCardsExcelResponse.ts} (87%) rename src/client/services/{DealGroupService.ts => CardGroupService.ts} (51%) rename src/client/services/{DealService.ts => CardService.ts} (53%) create mode 100644 src/components/CardAttributeFields/CardAttributeFields.tsx create mode 100644 src/components/CardAttributeFields/components/CardAttributeField.tsx create mode 100644 src/components/CardAttributeFields/utils/getAttributesFromCard.ts rename src/components/Dnd/{Deals/DealGroupView/DealGroupView.tsx => Cards/CardGroupView/CardGroupView.tsx} (80%) rename src/components/Dnd/{Deals/DealSummaryCard/DealSummaryCard.module.css => Cards/CardSummaryItem/CardSummaryItem.module.css} (100%) rename src/components/Dnd/{Deals/DealSummaryCard/DealSummaryCard.tsx => Cards/CardSummaryItem/CardSummaryItem.tsx} (64%) rename src/components/Dnd/{Deals/DealSummaryCard/useDealSummaryState.tsx => Cards/CardSummaryItem/useCardSummaryState.tsx} (60%) rename src/components/Dnd/{Deals/DealsDndColumn/DealsDndColumn.tsx => Cards/CardsDndColumn/CardsDndColumn.tsx} (51%) rename src/components/Dnd/{Deals/DealsDndColumn => Cards/CardsDndColumn}/DealsDndColumn.module.css (100%) rename src/components/Dnd/{Deals/DealsDndColumn/hooks/useDealsDnd.tsx => Cards/CardsDndColumn/hooks/useCardsDnd.tsx} (81%) rename src/components/Dnd/{Deals/DealsDndColumn => Cards/CardsDndColumn}/utils/getColumnColor.ts (100%) rename src/components/Dnd/{Deals/DealsDndFooter/DealsDndFooter.tsx => Cards/CardsDndFooter/CardsDndFooter.tsx} (91%) rename src/components/Dnd/{Deals/CreateDealButton/CreateDealButton.tsx => Cards/CreateCardButton/CreateCardButton.tsx} (63%) rename src/components/Dnd/{Deals/CreateDealButton => Cards/CreateCardButton}/CreateDealButton.module.css (100%) rename src/components/Dnd/{Deals/CreateDealForm/CreateDealFrom.tsx => Cards/CreateCardForm/CreateCardForm.tsx} (71%) rename src/components/Dnd/{Deals/CreateDealForm => Cards/CreateCardForm}/CreateDealForm.module.css (100%) rename src/components/Dnd/{Deals/CreateDealsFromFileButton => Cards/CreateCardsFromFileButton}/CreateDealsFromFileButton.module.css (100%) rename src/components/Dnd/{Deals/CreateDealsFromFileButton => Cards/CreateCardsFromFileButton}/CreateDealsFromFileButton.tsx (68%) create mode 100644 src/pages/CardPage/index.ts create mode 100644 src/pages/CardPage/ui/CardPage.tsx rename src/pages/{DealsPage => CardsPage}/components/DealProductsTable/DealProductServiceTable.tsx (95%) rename src/pages/{DealsPage => CardsPage}/components/DealProductsTable/DealProductsTable.tsx (92%) rename src/pages/{DealsPage => CardsPage}/components/DealProductsTable/columns.tsx (94%) rename src/pages/{DealsPage => CardsPage}/components/DealServicesTable/DealServicesTable.tsx (91%) rename src/pages/{DealsPage => CardsPage}/components/DealServicesTable/columns.tsx (93%) rename src/pages/{DealsPage/components/DealStatusChangeTable/DealStatusChangeTable.tsx => CardsPage/components/DealStatusChangeTable/CardStatusChangeTable.tsx} (77%) rename src/pages/{DealsPage => CardsPage}/components/DealStatusChangeTable/columns.tsx (93%) rename src/pages/{DealsPage/components/DealsTable/DealsTable.tsx => CardsPage/components/DealsTable/CardsTable.tsx} (71%) rename src/pages/{DealsPage => CardsPage}/components/DealsTable/columns.tsx (90%) rename src/pages/{DealsPage => CardsPage}/components/LeadsPageHeader/LeadsPageHeader.tsx (94%) rename src/pages/{DealsPage => CardsPage}/components/SimpleUsersTable/SimpleUsersTable.tsx (100%) rename src/pages/{DealsPage => CardsPage}/components/SimpleUsersTable/columns.tsx (100%) create mode 100644 src/pages/CardsPage/contexts/CardPageContext.tsx create mode 100644 src/pages/CardsPage/contexts/PrefillCardContext.tsx rename src/pages/{DealsPage => CardsPage}/contexts/PrefillDealsWithExcelContext.tsx (73%) rename src/pages/{DealsPage/drawers/DealEditDrawer/DealEditDrawer.module.css => CardsPage/drawers/CardEditDrawer/CardEditDrawer.module.css} (100%) rename src/pages/{DealsPage/drawers/DealEditDrawer/DealEditDrawer.tsx => CardsPage/drawers/CardEditDrawer/CardEditDrawer.tsx} (64%) rename src/pages/{DealsPage/drawers/DealPrefillDrawer/DealPrefillDrawer.module.css => CardsPage/drawers/CardPrefillDrawer/CardPrefillDrawer.module.css} (100%) rename src/pages/{DealsPage/drawers/DealPrefillDrawer/DealPrefillDrawer.tsx => CardsPage/drawers/CardPrefillDrawer/CardPrefillDrawer.tsx} (83%) rename src/pages/{DealsPage/drawers/DealPrefillDrawer => CardsPage/drawers/CardPrefillDrawer}/components/Preview/Preview.module.css (100%) rename src/pages/{DealsPage/drawers/DealPrefillDrawer => CardsPage/drawers/CardPrefillDrawer}/components/Preview/Preview.tsx (77%) rename src/pages/{DealsPage/drawers/DealPrefillDrawer => CardsPage/drawers/CardPrefillDrawer}/components/ProductPreview/ProductPreview.module.css (100%) rename src/pages/{DealsPage/drawers/DealPrefillDrawer => CardsPage/drawers/CardPrefillDrawer}/components/ProductPreview/ProductPreview.tsx (95%) rename src/pages/{DealsPage/drawers/DealPrefillDrawer => CardsPage/drawers/CardPrefillDrawer}/components/tables/DealServicesTable/DealServicesTable.tsx (91%) rename src/pages/{DealsPage/drawers/DealPrefillDrawer => CardsPage/drawers/CardPrefillDrawer}/components/tables/DealServicesTable/columns.tsx (86%) rename src/pages/{DealsPage/drawers/DealPrefillDrawer => CardsPage/drawers/CardPrefillDrawer}/components/tables/DealsTable/DealsTable.tsx (82%) rename src/pages/{DealsPage/drawers/DealPrefillDrawer => CardsPage/drawers/CardPrefillDrawer}/components/tables/DealsTable/columns.tsx (84%) rename src/pages/{DealsPage/drawers/DealPrefillDrawer => CardsPage/drawers/CardPrefillDrawer}/components/tables/ProductServicesTable/ProductServicesTable.tsx (82%) rename src/pages/{DealsPage/drawers/DealPrefillDrawer => CardsPage/drawers/CardPrefillDrawer}/components/tables/ProductServicesTable/columns.tsx (88%) rename src/pages/{DealsPage/drawers/DealPrefillDrawer => CardsPage/drawers/CardPrefillDrawer}/hooks/usePrefillDeal.tsx (92%) rename src/pages/{DealsPage/drawers/PrefillDealWithExcelDrawer/PrefillDealsWithExcelDrawer.module.css => CardsPage/drawers/PrefillCardWithExcelDrawer/PrefillCardsWithExcelDrawer.module.css} (100%) rename src/pages/{DealsPage/drawers/PrefillDealWithExcelDrawer/PrefillDealsWithExcelDrawer.tsx => CardsPage/drawers/PrefillCardWithExcelDrawer/PrefillCardsWithExcelDrawer.tsx} (74%) rename src/pages/{DealsPage/drawers/PrefillDealWithExcelDrawer => CardsPage/drawers/PrefillCardWithExcelDrawer}/components/BreakdownByCityTable.tsx (100%) rename src/pages/{DealsPage/drawers/PrefillDealWithExcelDrawer => CardsPage/drawers/PrefillCardWithExcelDrawer}/components/ParsingResultsTooltip.tsx (87%) rename src/pages/{DealsPage/drawers/PrefillDealWithExcelDrawer => CardsPage/drawers/PrefillCardWithExcelDrawer}/components/ProductsPreview.tsx (90%) rename src/pages/{DealsPage/drawers/PrefillDealWithExcelDrawer => CardsPage/drawers/PrefillCardWithExcelDrawer}/components/ProductsTable.tsx (100%) rename src/pages/{DealsPage/drawers/PrefillDealWithExcelDrawer => CardsPage/drawers/PrefillCardWithExcelDrawer}/hooks/useBreakdownByCityTableColumns.tsx (100%) rename src/pages/{DealsPage/drawers/PrefillDealWithExcelDrawer => CardsPage/drawers/PrefillCardWithExcelDrawer}/hooks/useProductsTableColumns.tsx (95%) rename src/pages/{DealsPage/drawers/PrefillDealWithExcelDrawer => CardsPage/drawers/PrefillCardWithExcelDrawer}/types.tsx (88%) rename src/pages/{DealsPage => CardsPage}/enums/DisplayMode.ts (100%) rename src/pages/{DealsPage => CardsPage}/enums/DragState.ts (100%) rename src/pages/{DealsPage => CardsPage}/hooks/useBoards.tsx (100%) rename src/pages/{DealsPage/hooks/useDealSummaries.tsx => CardsPage/hooks/useCardSummaries.tsx} (69%) rename src/pages/{DealsPage/hooks/useDealsPageState.tsx => CardsPage/hooks/useCardsPageState.tsx} (81%) rename src/pages/{DealsPage => CardsPage}/hooks/useDnd.tsx (87%) rename src/pages/{DealsPage => CardsPage}/hooks/useManagersList.tsx (100%) rename src/pages/{DealsPage => CardsPage}/hooks/useProjects.tsx (74%) create mode 100644 src/pages/CardsPage/index.ts rename src/pages/{DealsPage/modals/AddDealProductModal.tsx => CardsPage/modals/AddCardProductModal.tsx} (85%) rename src/pages/{DealsPage/modals/AddDealServiceModal.tsx => CardsPage/modals/AddCardServiceModal.tsx} (92%) rename src/pages/{DealsPage => CardsPage}/modals/BoardModal/BoardModal.tsx (100%) rename src/pages/{DealsPage => CardsPage}/modals/BoardModal/hooks/useBoardModal.tsx (100%) rename src/pages/{DealsPage/modals/DealsTableFiltersModal.tsx => CardsPage/modals/CardsTableFiltersModal.tsx} (91%) rename src/pages/{DealsPage => CardsPage}/modals/ProductServiceFormModal.tsx (92%) rename src/pages/{DealsPage => CardsPage}/modals/ProjectsModal/ProjectsModal.tsx (96%) rename src/pages/{DealsPage => CardsPage}/modals/ProjectsModal/hooks/projectsTableColumns.tsx (100%) rename src/pages/{DealsPage => CardsPage}/modals/ProjectsModal/hooks/useProjectModal.tsx (100%) rename src/pages/{DealsPage/modals/SelectDealProductsModal.tsx => CardsPage/modals/SelectCardProductsModal.tsx} (71%) rename src/pages/{DealsPage => CardsPage}/modals/StatusModal/StatusModal.tsx (100%) rename src/pages/{DealsPage => CardsPage}/modals/StatusModal/hooks/useStatusModal.tsx (100%) rename src/pages/{DealsPage/drawers/DealEditDrawer/tabs => CardsPage/tabs/ClientTab}/ClientTab.tsx (81%) rename src/pages/{DealsPage => CardsPage}/tabs/EmployeesTab/EmployeesTab.tsx (100%) rename src/pages/{DealsPage => CardsPage}/tabs/EmployeesTab/components/AvailableEmployeesSelect.tsx (82%) rename src/pages/{DealsPage => CardsPage}/tabs/EmployeesTab/components/EmployeeInput.tsx (100%) rename src/pages/{DealsPage => CardsPage}/tabs/EmployeesTab/components/EmployeesTable.tsx (83%) rename src/pages/{DealsPage => CardsPage}/tabs/EmployeesTab/hooks/useAvailableEmployeesList.tsx (55%) rename src/pages/{DealsPage => CardsPage}/tabs/EmployeesTab/hooks/useEmployeesTab.tsx (71%) rename src/pages/{DealsPage => CardsPage}/tabs/EmployeesTab/hooks/useEmployeesTableColumns.tsx (89%) rename src/pages/{DealsPage => CardsPage}/tabs/EmployeesTab/modals/AssignUserModal.tsx (86%) rename src/pages/{DealsPage => CardsPage}/tabs/EmployeesTab/types/AssignUserModalForm.tsx (100%) create mode 100644 src/pages/CardsPage/tabs/GeneralTab/GeneralTab.tsx create mode 100644 src/pages/CardsPage/tabs/GeneralTab/components/PaymentLinkButton.tsx create mode 100644 src/pages/CardsPage/tabs/GeneralTab/components/PrintDealBarcodesButton.tsx rename src/pages/{DealsPage => CardsPage}/tabs/ProductAndServiceTab/ProductAndServiceTab.module.css (100%) rename src/pages/{DealsPage => CardsPage}/tabs/ProductAndServiceTab/ProductAndServiceTab.tsx (77%) rename src/pages/{DealsPage/tabs/ProductAndServiceTab/components/DealServicesTable/DealServicesTable.tsx => CardsPage/tabs/ProductAndServiceTab/components/DealServicesTable/CardServicesTable.tsx} (92%) rename src/pages/{DealsPage => CardsPage}/tabs/ProductAndServiceTab/components/ProductServicesTable/ProductServicesTable.tsx (93%) rename src/pages/{DealsPage => CardsPage}/tabs/ProductAndServiceTab/components/ProductServicesTable/columns.tsx (87%) rename src/pages/{DealsPage => CardsPage}/tabs/ProductAndServiceTab/components/ProductView/ProductView.module.css (100%) rename src/pages/{DealsPage => CardsPage}/tabs/ProductAndServiceTab/components/ProductView/ProductView.tsx (91%) rename src/pages/{DealsPage => CardsPage}/tabs/ProductAndServiceTab/hooks/useProductAndServiceTabState.tsx (53%) rename src/pages/{DealsPage => CardsPage}/tabs/ShippingTab/ShippingTab.tsx (94%) rename src/pages/{DealsPage => CardsPage}/tabs/ShippingTab/components/BoxesTable.tsx (91%) rename src/pages/{DealsPage => CardsPage}/tabs/ShippingTab/components/ShippingProductSelect.tsx (100%) rename src/pages/{DealsPage => CardsPage}/tabs/ShippingTab/components/ShippingProductsTable.tsx (92%) rename src/pages/{DealsPage => CardsPage}/tabs/ShippingTab/components/ShippingTree.tsx (94%) rename src/pages/{DealsPage => CardsPage}/tabs/ShippingTab/hooks/shippingTableColumns.tsx (100%) rename src/pages/{DealsPage => CardsPage}/tabs/ShippingTab/hooks/useShipping.tsx (82%) rename src/pages/{DealsPage => CardsPage}/tabs/ShippingTab/hooks/useShippingQrs.tsx (64%) create mode 100644 src/pages/CardsPage/tabs/ShippingTab/hooks/useUpdateCard.tsx rename src/pages/{DealsPage => CardsPage}/tabs/ShippingTab/modals/ShippingProductModal.tsx (93%) rename src/pages/{DealsPage => CardsPage}/tabs/ShippingTab/types/ShippingProductData.tsx (100%) rename src/pages/{DealsPage => CardsPage}/tabs/ShippingTab/utils/getRestProducts.tsx (87%) rename src/pages/{DealsPage/ui/DealsPage.module.css => CardsPage/ui/CardsPage.module.css} (100%) rename src/pages/{DealsPage/ui/DealsPage.tsx => CardsPage/ui/CardsPage.tsx} (69%) create mode 100644 src/pages/CardsPage/utils/isModuleInProject.ts delete mode 100644 src/pages/DealPage/index.ts delete mode 100644 src/pages/DealPage/ui/DealPage.tsx delete mode 100644 src/pages/DealsPage/contexts/DealPageContext.tsx delete mode 100644 src/pages/DealsPage/contexts/PrefillDealContext.tsx delete mode 100644 src/pages/DealsPage/drawers/DealEditDrawer/tabs/DealEditDrawerGeneralTab.tsx delete mode 100644 src/pages/DealsPage/index.ts delete mode 100644 src/pages/DealsPage/tabs/ShippingTab/hooks/useUpdateDeal.tsx rename src/types/{QuickDeal.ts => QuickCard.ts} (90%) diff --git a/src/client/index.ts b/src/client/index.ts index 1d8514a..f3ad3f7 100644 --- a/src/client/index.ts +++ b/src/client/index.ts @@ -9,6 +9,8 @@ export type { OpenAPIConfig } from './core/OpenAPI'; export type { AddUserRequest } from './models/AddUserRequest'; export type { AddUserResponse } from './models/AddUserResponse'; +export type { AttributeSchema } from './models/AttributeSchema'; +export type { AttributeTypeSchema } from './models/AttributeTypeSchema'; export type { AuthLoginRequest } from './models/AuthLoginRequest'; export type { AuthLoginResponse } from './models/AuthLoginResponse'; export type { BarcodeAttributeSchema } from './models/BarcodeAttributeSchema'; @@ -39,8 +41,75 @@ export type { Body_upload_passport_image } from './models/Body_upload_passport_i export type { Body_upload_product_barcode_image } from './models/Body_upload_product_barcode_image'; export type { Body_upload_product_image } from './models/Body_upload_product_image'; export type { BoxSchema } from './models/BoxSchema'; -export type { CancelDealBillRequest } from './models/CancelDealBillRequest'; -export type { CancelDealBillResponse } from './models/CancelDealBillResponse'; +export type { CancelCardBillRequest } from './models/CancelCardBillRequest'; +export type { CancelCardBillResponse } from './models/CancelCardBillResponse'; +export type { CardAddKitRequest } from './models/CardAddKitRequest'; +export type { CardAddKitResponse } from './models/CardAddKitResponse'; +export type { CardAddProductRequest } from './models/CardAddProductRequest'; +export type { CardAddProductResponse } from './models/CardAddProductResponse'; +export type { CardAddServiceRequest } from './models/CardAddServiceRequest'; +export type { CardAddServiceResponse } from './models/CardAddServiceResponse'; +export type { CardAddServicesRequest } from './models/CardAddServicesRequest'; +export type { CardAddServicesResponse } from './models/CardAddServicesResponse'; +export type { CardAddToGroupRequest } from './models/CardAddToGroupRequest'; +export type { CardAddToGroupResponse } from './models/CardAddToGroupResponse'; +export type { CardAttributeSchema } from './models/CardAttributeSchema'; +export type { CardBillRequestSchema } from './models/CardBillRequestSchema'; +export type { CardChangeStatusRequest } from './models/CardChangeStatusRequest'; +export type { CardChangeStatusResponse } from './models/CardChangeStatusResponse'; +export type { CardCompleteRequest } from './models/CardCompleteRequest'; +export type { CardCompleteResponse } from './models/CardCompleteResponse'; +export type { CardCreateGroupResponse } from './models/CardCreateGroupResponse'; +export type { CardCreateGuestUrlRequest } from './models/CardCreateGuestUrlRequest'; +export type { CardCreateGuestUrlResponse } from './models/CardCreateGuestUrlResponse'; +export type { CardDeleteProductRequest } from './models/CardDeleteProductRequest'; +export type { CardDeleteProductResponse } from './models/CardDeleteProductResponse'; +export type { CardDeleteProductsRequest } from './models/CardDeleteProductsRequest'; +export type { CardDeleteProductsResponse } from './models/CardDeleteProductsResponse'; +export type { CardDeleteRequest } from './models/CardDeleteRequest'; +export type { CardDeleteResponse } from './models/CardDeleteResponse'; +export type { CardDeleteServiceRequest } from './models/CardDeleteServiceRequest'; +export type { CardDeleteServiceResponse } from './models/CardDeleteServiceResponse'; +export type { CardDeleteServicesRequest } from './models/CardDeleteServicesRequest'; +export type { CardDeleteServicesResponse } from './models/CardDeleteServicesResponse'; +export type { CardEmployeesSchema } from './models/CardEmployeesSchema'; +export type { CardGeneralInfoSchema } from './models/CardGeneralInfoSchema'; +export type { CardGetAllResponse } from './models/CardGetAllResponse'; +export type { CardGroupChangeStatusRequest } from './models/CardGroupChangeStatusRequest'; +export type { CardGroupChangeStatusResponse } from './models/CardGroupChangeStatusResponse'; +export type { CardGroupSchema } from './models/CardGroupSchema'; +export type { CardGroupUpdateRequest } from './models/CardGroupUpdateRequest'; +export type { CardGroupUpdateResponse } from './models/CardGroupUpdateResponse'; +export type { CardPrefillRequest } from './models/CardPrefillRequest'; +export type { CardPrefillResponse } from './models/CardPrefillResponse'; +export type { CardProductAddKitRequest } from './models/CardProductAddKitRequest'; +export type { CardProductAddKitResponse } from './models/CardProductAddKitResponse'; +export type { CardProductSchema } from './models/CardProductSchema'; +export type { CardProductServiceSchema } from './models/CardProductServiceSchema'; +export type { CardQuickCreateRequest } from './models/CardQuickCreateRequest'; +export type { CardQuickCreateResponse } from './models/CardQuickCreateResponse'; +export type { CardRecalculatePriceRequest } from './models/CardRecalculatePriceRequest'; +export type { CardRecalculatePriceResponse } from './models/CardRecalculatePriceResponse'; +export type { CardRemoveFromGroupRequest } from './models/CardRemoveFromGroupRequest'; +export type { CardRemoveFromGroupResponse } from './models/CardRemoveFromGroupResponse'; +export type { CardSchema } from './models/CardSchema'; +export type { CardServiceSchema } from './models/CardServiceSchema'; +export type { CardServicesCopyRequest } from './models/CardServicesCopyRequest'; +export type { CardServicesCopyResponse } from './models/CardServicesCopyResponse'; +export type { CardStatusHistorySchema } from './models/CardStatusHistorySchema'; +export type { CardSummary } from './models/CardSummary'; +export type { CardSummaryReorderRequest } from './models/CardSummaryReorderRequest'; +export type { CardSummaryResponse } from './models/CardSummaryResponse'; +export type { CardUpdateGeneralInfoRequest } from './models/CardUpdateGeneralInfoRequest'; +export type { CardUpdateGeneralInfoResponse } from './models/CardUpdateGeneralInfoResponse'; +export type { CardUpdateProductQuantityRequest } from './models/CardUpdateProductQuantityRequest'; +export type { CardUpdateProductQuantityResponse } from './models/CardUpdateProductQuantityResponse'; +export type { CardUpdateProductRequest } from './models/CardUpdateProductRequest'; +export type { CardUpdateProductResponse } from './models/CardUpdateProductResponse'; +export type { CardUpdateServiceQuantityRequest } from './models/CardUpdateServiceQuantityRequest'; +export type { CardUpdateServiceQuantityResponse } from './models/CardUpdateServiceQuantityResponse'; +export type { CardUpdateServiceRequest } from './models/CardUpdateServiceRequest'; +export type { CardUpdateServiceResponse } from './models/CardUpdateServiceResponse'; export type { CityBreakdownFromExcelSchema } from './models/CityBreakdownFromExcelSchema'; export type { ClientCreateRequest } from './models/ClientCreateRequest'; export type { ClientCreateResponse } from './models/ClientCreateResponse'; @@ -58,12 +127,13 @@ export type { CreateBarcodeTemplateAttributeRequest } from './models/CreateBarco export type { CreateBarcodeTemplateAttributeResponse } from './models/CreateBarcodeTemplateAttributeResponse'; export type { CreateBoardRequest } from './models/CreateBoardRequest'; export type { CreateBoardResponse } from './models/CreateBoardResponse'; -export type { CreateBoxInDealSchema } from './models/CreateBoxInDealSchema'; +export type { CreateBoxInCardSchema } from './models/CreateBoxInCardSchema'; export type { CreateBoxInPalletSchema } from './models/CreateBoxInPalletSchema'; -export type { CreateDealBillRequest } from './models/CreateDealBillRequest'; -export type { CreateDealBillResponse } from './models/CreateDealBillResponse'; -export type { CreateDealsFromExcelRequest } from './models/CreateDealsFromExcelRequest'; -export type { CreateDealsFromExcelResponse } from './models/CreateDealsFromExcelResponse'; +export type { CreateCardBillRequest } from './models/CreateCardBillRequest'; +export type { CreateCardBillResponse } from './models/CreateCardBillResponse'; +export type { CreateCardGroupRequest } from './models/CreateCardGroupRequest'; +export type { CreateCardsFromExcelRequest } from './models/CreateCardsFromExcelRequest'; +export type { CreateCardsFromExcelResponse } from './models/CreateCardsFromExcelResponse'; export type { CreateDepartmentRequest } from './models/CreateDepartmentRequest'; export type { CreateDepartmentResponse } from './models/CreateDepartmentResponse'; export type { CreateDepartmentSectionRequest } from './models/CreateDepartmentSectionRequest'; @@ -98,73 +168,6 @@ export type { CreateTaskResponse } from './models/CreateTaskResponse'; export type { CreateTransactionTagRequest } from './models/CreateTransactionTagRequest'; export type { CreateUserRequest } from './models/CreateUserRequest'; export type { CreateUserResponse } from './models/CreateUserResponse'; -export type { DealAddKitRequest } from './models/DealAddKitRequest'; -export type { DealAddKitResponse } from './models/DealAddKitResponse'; -export type { DealAddProductRequest } from './models/DealAddProductRequest'; -export type { DealAddProductResponse } from './models/DealAddProductResponse'; -export type { DealAddServiceRequest } from './models/DealAddServiceRequest'; -export type { DealAddServiceResponse } from './models/DealAddServiceResponse'; -export type { DealAddServicesRequest } from './models/DealAddServicesRequest'; -export type { DealAddServicesResponse } from './models/DealAddServicesResponse'; -export type { DealAddToGroupRequest } from './models/DealAddToGroupRequest'; -export type { DealAddToGroupResponse } from './models/DealAddToGroupResponse'; -export type { DealBillRequestSchema } from './models/DealBillRequestSchema'; -export type { DealChangeStatusRequest } from './models/DealChangeStatusRequest'; -export type { DealChangeStatusResponse } from './models/DealChangeStatusResponse'; -export type { DealCompleteRequest } from './models/DealCompleteRequest'; -export type { DealCompleteResponse } from './models/DealCompleteResponse'; -export type { DealCreateGroupRequest } from './models/DealCreateGroupRequest'; -export type { DealCreateGroupResponse } from './models/DealCreateGroupResponse'; -export type { DealCreateGuestUrlRequest } from './models/DealCreateGuestUrlRequest'; -export type { DealCreateGuestUrlResponse } from './models/DealCreateGuestUrlResponse'; -export type { DealDeleteProductRequest } from './models/DealDeleteProductRequest'; -export type { DealDeleteProductResponse } from './models/DealDeleteProductResponse'; -export type { DealDeleteProductsRequest } from './models/DealDeleteProductsRequest'; -export type { DealDeleteProductsResponse } from './models/DealDeleteProductsResponse'; -export type { DealDeleteRequest } from './models/DealDeleteRequest'; -export type { DealDeleteResponse } from './models/DealDeleteResponse'; -export type { DealDeleteServiceRequest } from './models/DealDeleteServiceRequest'; -export type { DealDeleteServiceResponse } from './models/DealDeleteServiceResponse'; -export type { DealDeleteServicesRequest } from './models/DealDeleteServicesRequest'; -export type { DealDeleteServicesResponse } from './models/DealDeleteServicesResponse'; -export type { DealEmployeesSchema } from './models/DealEmployeesSchema'; -export type { DealGeneralInfoSchema } from './models/DealGeneralInfoSchema'; -export type { DealGetAllResponse } from './models/DealGetAllResponse'; -export type { DealGroupChangeStatusRequest } from './models/DealGroupChangeStatusRequest'; -export type { DealGroupChangeStatusResponse } from './models/DealGroupChangeStatusResponse'; -export type { DealGroupSchema } from './models/DealGroupSchema'; -export type { DealGroupUpdateRequest } from './models/DealGroupUpdateRequest'; -export type { DealGroupUpdateResponse } from './models/DealGroupUpdateResponse'; -export type { DealPrefillRequest } from './models/DealPrefillRequest'; -export type { DealPrefillResponse } from './models/DealPrefillResponse'; -export type { DealProductAddKitRequest } from './models/DealProductAddKitRequest'; -export type { DealProductAddKitResponse } from './models/DealProductAddKitResponse'; -export type { DealProductSchema } from './models/DealProductSchema'; -export type { DealProductServiceSchema } from './models/DealProductServiceSchema'; -export type { DealQuickCreateRequest } from './models/DealQuickCreateRequest'; -export type { DealQuickCreateResponse } from './models/DealQuickCreateResponse'; -export type { DealRecalculatePriceRequest } from './models/DealRecalculatePriceRequest'; -export type { DealRecalculatePriceResponse } from './models/DealRecalculatePriceResponse'; -export type { DealRemoveFromGroupRequest } from './models/DealRemoveFromGroupRequest'; -export type { DealRemoveFromGroupResponse } from './models/DealRemoveFromGroupResponse'; -export type { DealSchema } from './models/DealSchema'; -export type { DealServiceSchema } from './models/DealServiceSchema'; -export type { DealServicesCopyRequest } from './models/DealServicesCopyRequest'; -export type { DealServicesCopyResponse } from './models/DealServicesCopyResponse'; -export type { DealStatusHistorySchema } from './models/DealStatusHistorySchema'; -export type { DealSummary } from './models/DealSummary'; -export type { DealSummaryReorderRequest } from './models/DealSummaryReorderRequest'; -export type { DealSummaryResponse } from './models/DealSummaryResponse'; -export type { DealUpdateGeneralInfoRequest } from './models/DealUpdateGeneralInfoRequest'; -export type { DealUpdateGeneralInfoResponse } from './models/DealUpdateGeneralInfoResponse'; -export type { DealUpdateProductQuantityRequest } from './models/DealUpdateProductQuantityRequest'; -export type { DealUpdateProductQuantityResponse } from './models/DealUpdateProductQuantityResponse'; -export type { DealUpdateProductRequest } from './models/DealUpdateProductRequest'; -export type { DealUpdateProductResponse } from './models/DealUpdateProductResponse'; -export type { DealUpdateServiceQuantityRequest } from './models/DealUpdateServiceQuantityRequest'; -export type { DealUpdateServiceQuantityResponse } from './models/DealUpdateServiceQuantityResponse'; -export type { DealUpdateServiceRequest } from './models/DealUpdateServiceRequest'; -export type { DealUpdateServiceResponse } from './models/DealUpdateServiceResponse'; export type { DeleteBoardResponse } from './models/DeleteBoardResponse'; export type { DeleteBoxResponse } from './models/DeleteBoxResponse'; export type { DeleteDepartmentResponse } from './models/DeleteDepartmentResponse'; @@ -200,6 +203,7 @@ export type { FinishPauseByShiftIdResponse } from './models/FinishPauseByShiftId export type { FinishPauseByUserIdResponse } from './models/FinishPauseByUserIdResponse'; export type { FinishShiftByIdResponse } from './models/FinishShiftByIdResponse'; export type { FinishShiftResponse } from './models/FinishShiftResponse'; +export type { FullProjectSchema } from './models/FullProjectSchema'; export type { GetAllBarcodeTemplateAttributesResponse } from './models/GetAllBarcodeTemplateAttributesResponse'; export type { GetAllBarcodeTemplateSizesResponse } from './models/GetAllBarcodeTemplateSizesResponse'; export type { GetAllBarcodeTemplatesResponse } from './models/GetAllBarcodeTemplatesResponse'; @@ -219,11 +223,11 @@ export type { GetAvailableUsersForDepartmentSectionResponse } from './models/Get export type { GetBarcodeTemplateByIdRequest } from './models/GetBarcodeTemplateByIdRequest'; export type { GetBarcodeTemplateByIdResponse } from './models/GetBarcodeTemplateByIdResponse'; export type { GetBoardsResponse } from './models/GetBoardsResponse'; +export type { GetCardBillById } from './models/GetCardBillById'; +export type { GetCardProductsBarcodesPdfRequest } from './models/GetCardProductsBarcodesPdfRequest'; +export type { GetCardProductsBarcodesPdfResponse } from './models/GetCardProductsBarcodesPdfResponse'; export type { GetClientMarketplacesRequest } from './models/GetClientMarketplacesRequest'; export type { GetClientMarketplacesResponse } from './models/GetClientMarketplacesResponse'; -export type { GetDealBillById } from './models/GetDealBillById'; -export type { GetDealProductsBarcodesPdfRequest } from './models/GetDealProductsBarcodesPdfRequest'; -export type { GetDealProductsBarcodesPdfResponse } from './models/GetDealProductsBarcodesPdfResponse'; export type { GetDepartmentSectionsResponse } from './models/GetDepartmentSectionsResponse'; export type { GetDepartmentsResponse } from './models/GetDepartmentsResponse'; export type { GetManagersResponse } from './models/GetManagersResponse'; @@ -254,12 +258,13 @@ export type { ManageEmployeeRequest } from './models/ManageEmployeeRequest'; export type { ManageEmployeeResponse } from './models/ManageEmployeeResponse'; export type { MarketplaceCreateSchema } from './models/MarketplaceCreateSchema'; export type { MarketplaceSchema } from './models/MarketplaceSchema'; +export type { ModuleSchema } from './models/ModuleSchema'; export type { NotificationChannel } from './models/NotificationChannel'; export type { OptionalShippingWarehouseSchema } from './models/OptionalShippingWarehouseSchema'; export type { PaginationInfoSchema } from './models/PaginationInfoSchema'; export type { PalletSchema } from './models/PalletSchema'; +export type { ParseCardsExcelResponse } from './models/ParseCardsExcelResponse'; export type { ParsedCityBreakdownSchema } from './models/ParsedCityBreakdownSchema'; -export type { ParseDealsExcelResponse } from './models/ParseDealsExcelResponse'; export type { ParsedProductRowSchema } from './models/ParsedProductRowSchema'; export type { PassportImageSchema } from './models/PassportImageSchema'; export type { PaymentRecordCreateSchema } from './models/PaymentRecordCreateSchema'; @@ -295,7 +300,6 @@ export type { ProfitChartDataItem } from './models/ProfitChartDataItem'; export type { ProfitTableDataItem } from './models/ProfitTableDataItem'; export type { ProfitTableGroupBy } from './models/ProfitTableGroupBy'; export type { ProjectSchema } from './models/ProjectSchema'; -export type { ProjectSchemaWithCount } from './models/ProjectSchemaWithCount'; export type { ReceiptBoxSchema } from './models/ReceiptBoxSchema'; export type { ReceiptPalletSchema } from './models/ReceiptPalletSchema'; export type { ResidualBoxSchema } from './models/ResidualBoxSchema'; @@ -394,9 +398,9 @@ export { AuthService } from './services/AuthService'; export { BarcodeService } from './services/BarcodeService'; export { BillingService } from './services/BillingService'; export { BoardService } from './services/BoardService'; +export { CardService } from './services/CardService'; +export { CardGroupService } from './services/CardGroupService'; export { ClientService } from './services/ClientService'; -export { DealService } from './services/DealService'; -export { DealGroupService } from './services/DealGroupService'; export { DepartmentService } from './services/DepartmentService'; export { MarketplaceService } from './services/MarketplaceService'; export { PayrollService } from './services/PayrollService'; diff --git a/src/client/models/AttributeSchema.ts b/src/client/models/AttributeSchema.ts new file mode 100644 index 0000000..dc78668 --- /dev/null +++ b/src/client/models/AttributeSchema.ts @@ -0,0 +1,15 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { AttributeTypeSchema } from './AttributeTypeSchema'; +export type AttributeSchema = { + id: number; + label: string; + name: string; + isApplicableToGroup: boolean; + isNullable: boolean; + defaultValue: (boolean | number | string | null); + type: AttributeTypeSchema; +}; + diff --git a/src/client/models/ProjectSchemaWithCount.ts b/src/client/models/AttributeTypeSchema.ts similarity index 68% rename from src/client/models/ProjectSchemaWithCount.ts rename to src/client/models/AttributeTypeSchema.ts index 8bcf459..5819d92 100644 --- a/src/client/models/ProjectSchemaWithCount.ts +++ b/src/client/models/AttributeTypeSchema.ts @@ -2,9 +2,10 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type ProjectSchemaWithCount = { - name: string; +export type AttributeTypeSchema = { id: number; - boardsCount: number; + type: string; + name: string; + isDeleted: boolean; }; diff --git a/src/client/models/BoardSchema.ts b/src/client/models/BoardSchema.ts index 431cff3..e24e481 100644 --- a/src/client/models/BoardSchema.ts +++ b/src/client/models/BoardSchema.ts @@ -9,7 +9,7 @@ export type BoardSchema = { projectId: number; id: number; ordinalNumber: number; - dealStatuses: Array; + statuses: Array; project: ProjectSchema; }; diff --git a/src/client/models/BoxSchema.ts b/src/client/models/BoxSchema.ts index b7a71ac..a4e63f7 100644 --- a/src/client/models/BoxSchema.ts +++ b/src/client/models/BoxSchema.ts @@ -8,6 +8,6 @@ export type BoxSchema = { quantity: number; product: (ProductSchema | null); palletId: (number | null); - dealId: (number | null); + cardId: (number | null); }; diff --git a/src/client/models/CancelDealBillRequest.ts b/src/client/models/CancelCardBillRequest.ts similarity index 70% rename from src/client/models/CancelDealBillRequest.ts rename to src/client/models/CancelCardBillRequest.ts index 9f9e51a..dbdc509 100644 --- a/src/client/models/CancelDealBillRequest.ts +++ b/src/client/models/CancelCardBillRequest.ts @@ -2,7 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type CancelDealBillRequest = { - dealId: number; +export type CancelCardBillRequest = { + cardId: number; }; diff --git a/src/client/models/CreateDealBillResponse.ts b/src/client/models/CancelCardBillResponse.ts similarity index 81% rename from src/client/models/CreateDealBillResponse.ts rename to src/client/models/CancelCardBillResponse.ts index 8c67e9d..cdb68c4 100644 --- a/src/client/models/CreateDealBillResponse.ts +++ b/src/client/models/CancelCardBillResponse.ts @@ -2,7 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type CreateDealBillResponse = { +export type CancelCardBillResponse = { ok: boolean; message: string; }; diff --git a/src/client/models/DealAddKitRequest.ts b/src/client/models/CardAddKitRequest.ts similarity index 74% rename from src/client/models/DealAddKitRequest.ts rename to src/client/models/CardAddKitRequest.ts index fa817d1..c4b8cd1 100644 --- a/src/client/models/DealAddKitRequest.ts +++ b/src/client/models/CardAddKitRequest.ts @@ -2,8 +2,8 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type DealAddKitRequest = { - dealId: number; +export type CardAddKitRequest = { + cardId: number; kitId: number; }; diff --git a/src/client/models/DealDeleteResponse.ts b/src/client/models/CardAddKitResponse.ts similarity index 83% rename from src/client/models/DealDeleteResponse.ts rename to src/client/models/CardAddKitResponse.ts index 90e7788..ed3f59e 100644 --- a/src/client/models/DealDeleteResponse.ts +++ b/src/client/models/CardAddKitResponse.ts @@ -2,7 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type DealDeleteResponse = { +export type CardAddKitResponse = { ok: boolean; message: string; }; diff --git a/src/client/models/CardAddProductRequest.ts b/src/client/models/CardAddProductRequest.ts new file mode 100644 index 0000000..aeae076 --- /dev/null +++ b/src/client/models/CardAddProductRequest.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { CardProductSchema } from './CardProductSchema'; +export type CardAddProductRequest = { + cardId: number; + product: CardProductSchema; +}; + diff --git a/src/client/models/CancelDealBillResponse.ts b/src/client/models/CardAddProductResponse.ts similarity index 81% rename from src/client/models/CancelDealBillResponse.ts rename to src/client/models/CardAddProductResponse.ts index 7399779..1aeae50 100644 --- a/src/client/models/CancelDealBillResponse.ts +++ b/src/client/models/CardAddProductResponse.ts @@ -2,7 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type CancelDealBillResponse = { +export type CardAddProductResponse = { ok: boolean; message: string; }; diff --git a/src/client/models/DealAddServiceRequest.ts b/src/client/models/CardAddServiceRequest.ts similarity index 77% rename from src/client/models/DealAddServiceRequest.ts rename to src/client/models/CardAddServiceRequest.ts index 512a256..3d8d98c 100644 --- a/src/client/models/DealAddServiceRequest.ts +++ b/src/client/models/CardAddServiceRequest.ts @@ -2,8 +2,8 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type DealAddServiceRequest = { - dealId: number; +export type CardAddServiceRequest = { + cardId: number; serviceId: number; quantity: number; price: number; diff --git a/src/client/models/DealAddProductResponse.ts b/src/client/models/CardAddServiceResponse.ts similarity index 81% rename from src/client/models/DealAddProductResponse.ts rename to src/client/models/CardAddServiceResponse.ts index 0f220c8..3beb752 100644 --- a/src/client/models/DealAddProductResponse.ts +++ b/src/client/models/CardAddServiceResponse.ts @@ -2,7 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type DealAddProductResponse = { +export type CardAddServiceResponse = { ok: boolean; message: string; }; diff --git a/src/client/models/CardAddServicesRequest.ts b/src/client/models/CardAddServicesRequest.ts new file mode 100644 index 0000000..7294c9a --- /dev/null +++ b/src/client/models/CardAddServicesRequest.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { CardServiceSchema } from './CardServiceSchema'; +export type CardAddServicesRequest = { + cardId: number; + services: Array; +}; + diff --git a/src/client/models/CardAddServicesResponse.ts b/src/client/models/CardAddServicesResponse.ts new file mode 100644 index 0000000..e04bb4c --- /dev/null +++ b/src/client/models/CardAddServicesResponse.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type CardAddServicesResponse = { + ok: boolean; + message: string; +}; + diff --git a/src/client/models/DealAddToGroupRequest.ts b/src/client/models/CardAddToGroupRequest.ts similarity index 73% rename from src/client/models/DealAddToGroupRequest.ts rename to src/client/models/CardAddToGroupRequest.ts index e817931..4c9fd24 100644 --- a/src/client/models/DealAddToGroupRequest.ts +++ b/src/client/models/CardAddToGroupRequest.ts @@ -2,8 +2,8 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type DealAddToGroupRequest = { - dealId: number; +export type CardAddToGroupRequest = { + cardId: number; groupId: number; }; diff --git a/src/client/models/CardAddToGroupResponse.ts b/src/client/models/CardAddToGroupResponse.ts new file mode 100644 index 0000000..ca3baca --- /dev/null +++ b/src/client/models/CardAddToGroupResponse.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type CardAddToGroupResponse = { + ok: boolean; + message: string; +}; + diff --git a/src/client/models/CardAttributeSchema.ts b/src/client/models/CardAttributeSchema.ts new file mode 100644 index 0000000..0efc8d7 --- /dev/null +++ b/src/client/models/CardAttributeSchema.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { AttributeSchema } from './AttributeSchema'; +export type CardAttributeSchema = { + value: (boolean | number | string | null); + cardId: number; + attribute: AttributeSchema; +}; + diff --git a/src/client/models/DealBillRequestSchema.ts b/src/client/models/CardBillRequestSchema.ts similarity index 80% rename from src/client/models/DealBillRequestSchema.ts rename to src/client/models/CardBillRequestSchema.ts index 84a986f..5e2cf20 100644 --- a/src/client/models/DealBillRequestSchema.ts +++ b/src/client/models/CardBillRequestSchema.ts @@ -2,8 +2,8 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type DealBillRequestSchema = { - dealId: number; +export type CardBillRequestSchema = { + cardId: number; createdAt: string; paid: boolean; pdfUrl: (string | null); diff --git a/src/client/models/DealChangeStatusRequest.ts b/src/client/models/CardChangeStatusRequest.ts similarity index 72% rename from src/client/models/DealChangeStatusRequest.ts rename to src/client/models/CardChangeStatusRequest.ts index 71fe9f1..62642d4 100644 --- a/src/client/models/DealChangeStatusRequest.ts +++ b/src/client/models/CardChangeStatusRequest.ts @@ -2,8 +2,8 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type DealChangeStatusRequest = { - dealId: number; +export type CardChangeStatusRequest = { + cardId: number; newStatus: number; }; diff --git a/src/client/models/DealChangeStatusResponse.ts b/src/client/models/CardChangeStatusResponse.ts similarity index 78% rename from src/client/models/DealChangeStatusResponse.ts rename to src/client/models/CardChangeStatusResponse.ts index 85c0609..297443a 100644 --- a/src/client/models/DealChangeStatusResponse.ts +++ b/src/client/models/CardChangeStatusResponse.ts @@ -2,7 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type DealChangeStatusResponse = { +export type CardChangeStatusResponse = { ok: boolean; }; diff --git a/src/client/models/DealCompleteRequest.ts b/src/client/models/CardCompleteRequest.ts similarity index 70% rename from src/client/models/DealCompleteRequest.ts rename to src/client/models/CardCompleteRequest.ts index ac500b6..8070f1f 100644 --- a/src/client/models/DealCompleteRequest.ts +++ b/src/client/models/CardCompleteRequest.ts @@ -2,7 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type DealCompleteRequest = { - dealId: number; +export type CardCompleteRequest = { + cardId: number; }; diff --git a/src/client/models/DealCompleteResponse.ts b/src/client/models/CardCompleteResponse.ts similarity index 82% rename from src/client/models/DealCompleteResponse.ts rename to src/client/models/CardCompleteResponse.ts index d82206e..2840bf2 100644 --- a/src/client/models/DealCompleteResponse.ts +++ b/src/client/models/CardCompleteResponse.ts @@ -2,7 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type DealCompleteResponse = { +export type CardCompleteResponse = { ok: boolean; message: string; }; diff --git a/src/client/models/CardCreateGroupResponse.ts b/src/client/models/CardCreateGroupResponse.ts new file mode 100644 index 0000000..d13749b --- /dev/null +++ b/src/client/models/CardCreateGroupResponse.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type CardCreateGroupResponse = { + ok: boolean; + message: string; +}; + diff --git a/src/client/models/CardCreateGuestUrlRequest.ts b/src/client/models/CardCreateGuestUrlRequest.ts new file mode 100644 index 0000000..da08d63 --- /dev/null +++ b/src/client/models/CardCreateGuestUrlRequest.ts @@ -0,0 +1,8 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type CardCreateGuestUrlRequest = { + cardId: number; +}; + diff --git a/src/client/models/DealCreateGuestUrlResponse.ts b/src/client/models/CardCreateGuestUrlResponse.ts similarity index 81% rename from src/client/models/DealCreateGuestUrlResponse.ts rename to src/client/models/CardCreateGuestUrlResponse.ts index fc790b7..f2232d6 100644 --- a/src/client/models/DealCreateGuestUrlResponse.ts +++ b/src/client/models/CardCreateGuestUrlResponse.ts @@ -2,7 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type DealCreateGuestUrlResponse = { +export type CardCreateGuestUrlResponse = { ok: boolean; message: string; url: string; diff --git a/src/client/models/DealDeleteProductRequest.ts b/src/client/models/CardDeleteProductRequest.ts similarity index 72% rename from src/client/models/DealDeleteProductRequest.ts rename to src/client/models/CardDeleteProductRequest.ts index a487e98..03e090f 100644 --- a/src/client/models/DealDeleteProductRequest.ts +++ b/src/client/models/CardDeleteProductRequest.ts @@ -2,8 +2,8 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type DealDeleteProductRequest = { - dealId: number; +export type CardDeleteProductRequest = { + cardId: number; productId: number; }; diff --git a/src/client/models/CardDeleteProductResponse.ts b/src/client/models/CardDeleteProductResponse.ts new file mode 100644 index 0000000..25ef2a4 --- /dev/null +++ b/src/client/models/CardDeleteProductResponse.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type CardDeleteProductResponse = { + ok: boolean; + message: string; +}; + diff --git a/src/client/models/DealDeleteProductsRequest.ts b/src/client/models/CardDeleteProductsRequest.ts similarity index 73% rename from src/client/models/DealDeleteProductsRequest.ts rename to src/client/models/CardDeleteProductsRequest.ts index c51d264..3c9a9f0 100644 --- a/src/client/models/DealDeleteProductsRequest.ts +++ b/src/client/models/CardDeleteProductsRequest.ts @@ -2,8 +2,8 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type DealDeleteProductsRequest = { - dealId: number; +export type CardDeleteProductsRequest = { + cardId: number; productIds: Array; }; diff --git a/src/client/models/CardDeleteProductsResponse.ts b/src/client/models/CardDeleteProductsResponse.ts new file mode 100644 index 0000000..781ba1c --- /dev/null +++ b/src/client/models/CardDeleteProductsResponse.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type CardDeleteProductsResponse = { + ok: boolean; + message: string; +}; + diff --git a/src/client/models/DealDeleteRequest.ts b/src/client/models/CardDeleteRequest.ts similarity index 71% rename from src/client/models/DealDeleteRequest.ts rename to src/client/models/CardDeleteRequest.ts index ffd14a4..64ca679 100644 --- a/src/client/models/DealDeleteRequest.ts +++ b/src/client/models/CardDeleteRequest.ts @@ -2,7 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type DealDeleteRequest = { - dealId: number; +export type CardDeleteRequest = { + cardId: number; }; diff --git a/src/client/models/DealAddKitResponse.ts b/src/client/models/CardDeleteResponse.ts similarity index 83% rename from src/client/models/DealAddKitResponse.ts rename to src/client/models/CardDeleteResponse.ts index 7edc087..26b6c35 100644 --- a/src/client/models/DealAddKitResponse.ts +++ b/src/client/models/CardDeleteResponse.ts @@ -2,7 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type DealAddKitResponse = { +export type CardDeleteResponse = { ok: boolean; message: string; }; diff --git a/src/client/models/DealDeleteServiceRequest.ts b/src/client/models/CardDeleteServiceRequest.ts similarity index 72% rename from src/client/models/DealDeleteServiceRequest.ts rename to src/client/models/CardDeleteServiceRequest.ts index ea2a07c..f9cd8d1 100644 --- a/src/client/models/DealDeleteServiceRequest.ts +++ b/src/client/models/CardDeleteServiceRequest.ts @@ -2,8 +2,8 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type DealDeleteServiceRequest = { - dealId: number; +export type CardDeleteServiceRequest = { + cardId: number; serviceId: number; }; diff --git a/src/client/models/CardDeleteServiceResponse.ts b/src/client/models/CardDeleteServiceResponse.ts new file mode 100644 index 0000000..4bd5213 --- /dev/null +++ b/src/client/models/CardDeleteServiceResponse.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type CardDeleteServiceResponse = { + ok: boolean; + message: string; +}; + diff --git a/src/client/models/DealDeleteServicesRequest.ts b/src/client/models/CardDeleteServicesRequest.ts similarity index 73% rename from src/client/models/DealDeleteServicesRequest.ts rename to src/client/models/CardDeleteServicesRequest.ts index e52c0fd..48c7f3d 100644 --- a/src/client/models/DealDeleteServicesRequest.ts +++ b/src/client/models/CardDeleteServicesRequest.ts @@ -2,8 +2,8 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type DealDeleteServicesRequest = { - dealId: number; +export type CardDeleteServicesRequest = { + cardId: number; serviceIds: Array; }; diff --git a/src/client/models/CardDeleteServicesResponse.ts b/src/client/models/CardDeleteServicesResponse.ts new file mode 100644 index 0000000..11075ad --- /dev/null +++ b/src/client/models/CardDeleteServicesResponse.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type CardDeleteServicesResponse = { + ok: boolean; + message: string; +}; + diff --git a/src/client/models/DealEmployeesSchema.ts b/src/client/models/CardEmployeesSchema.ts similarity index 86% rename from src/client/models/DealEmployeesSchema.ts rename to src/client/models/CardEmployeesSchema.ts index 5ba3a15..9f9c4de 100644 --- a/src/client/models/DealEmployeesSchema.ts +++ b/src/client/models/CardEmployeesSchema.ts @@ -3,7 +3,7 @@ /* tslint:disable */ /* eslint-disable */ import type { UserSchema } from './UserSchema'; -export type DealEmployeesSchema = { +export type CardEmployeesSchema = { user: UserSchema; createdAt: string; }; diff --git a/src/client/models/DealGeneralInfoSchema.ts b/src/client/models/CardGeneralInfoSchema.ts similarity index 54% rename from src/client/models/DealGeneralInfoSchema.ts rename to src/client/models/CardGeneralInfoSchema.ts index 95157b9..301eb65 100644 --- a/src/client/models/DealGeneralInfoSchema.ts +++ b/src/client/models/CardGeneralInfoSchema.ts @@ -2,20 +2,16 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { BoardSchema } from './BoardSchema'; -import type { StatusSchema } from './StatusSchema'; import type { UserSchema } from './UserSchema'; -export type DealGeneralInfoSchema = { +export type CardGeneralInfoSchema = { + attributes?: Record; name: string; isDeleted: boolean; isCompleted: boolean; - isAccounted: boolean; comment: string; shippingWarehouse?: (string | null); - deliveryDate?: (string | null); - receivingSlotDate?: (string | null); manager?: (UserSchema | null); - board: BoardSchema; - status: StatusSchema; + boardId: number; + statusId: number; }; diff --git a/src/client/models/CardGetAllResponse.ts b/src/client/models/CardGetAllResponse.ts new file mode 100644 index 0000000..537f264 --- /dev/null +++ b/src/client/models/CardGetAllResponse.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { CardSchema } from './CardSchema'; +export type CardGetAllResponse = { + cards: Array; +}; + diff --git a/src/client/models/DealGroupChangeStatusRequest.ts b/src/client/models/CardGroupChangeStatusRequest.ts similarity index 80% rename from src/client/models/DealGroupChangeStatusRequest.ts rename to src/client/models/CardGroupChangeStatusRequest.ts index 64a78b0..ebd24f4 100644 --- a/src/client/models/DealGroupChangeStatusRequest.ts +++ b/src/client/models/CardGroupChangeStatusRequest.ts @@ -2,7 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type DealGroupChangeStatusRequest = { +export type CardGroupChangeStatusRequest = { groupId: number; newStatus: number; }; diff --git a/src/client/models/CardGroupChangeStatusResponse.ts b/src/client/models/CardGroupChangeStatusResponse.ts new file mode 100644 index 0000000..f1082ea --- /dev/null +++ b/src/client/models/CardGroupChangeStatusResponse.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type CardGroupChangeStatusResponse = { + ok: boolean; + message: string; +}; + diff --git a/src/client/models/DealGroupSchema.ts b/src/client/models/CardGroupSchema.ts similarity index 91% rename from src/client/models/DealGroupSchema.ts rename to src/client/models/CardGroupSchema.ts index 1e2af96..f57295c 100644 --- a/src/client/models/DealGroupSchema.ts +++ b/src/client/models/CardGroupSchema.ts @@ -3,7 +3,7 @@ /* tslint:disable */ /* eslint-disable */ import type { GroupBillRequestSchema } from './GroupBillRequestSchema'; -export type DealGroupSchema = { +export type CardGroupSchema = { id: number; name?: (string | null); lexorank: string; diff --git a/src/client/models/CardGroupUpdateRequest.ts b/src/client/models/CardGroupUpdateRequest.ts new file mode 100644 index 0000000..0229506 --- /dev/null +++ b/src/client/models/CardGroupUpdateRequest.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { CardGroupSchema } from './CardGroupSchema'; +export type CardGroupUpdateRequest = { + data: CardGroupSchema; +}; + diff --git a/src/client/models/CardGroupUpdateResponse.ts b/src/client/models/CardGroupUpdateResponse.ts new file mode 100644 index 0000000..19b8da6 --- /dev/null +++ b/src/client/models/CardGroupUpdateResponse.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type CardGroupUpdateResponse = { + ok: boolean; + message: string; +}; + diff --git a/src/client/models/CardPrefillRequest.ts b/src/client/models/CardPrefillRequest.ts new file mode 100644 index 0000000..19e29a6 --- /dev/null +++ b/src/client/models/CardPrefillRequest.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type CardPrefillRequest = { + oldCardId: number; + newCardId: number; +}; + diff --git a/src/client/models/DealPrefillResponse.ts b/src/client/models/CardPrefillResponse.ts similarity index 82% rename from src/client/models/DealPrefillResponse.ts rename to src/client/models/CardPrefillResponse.ts index 2b92198..c24e9d0 100644 --- a/src/client/models/DealPrefillResponse.ts +++ b/src/client/models/CardPrefillResponse.ts @@ -2,7 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type DealPrefillResponse = { +export type CardPrefillResponse = { ok: boolean; message: string; }; diff --git a/src/client/models/DealProductAddKitRequest.ts b/src/client/models/CardProductAddKitRequest.ts similarity index 74% rename from src/client/models/DealProductAddKitRequest.ts rename to src/client/models/CardProductAddKitRequest.ts index 4ec1598..7f994b6 100644 --- a/src/client/models/DealProductAddKitRequest.ts +++ b/src/client/models/CardProductAddKitRequest.ts @@ -2,8 +2,8 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type DealProductAddKitRequest = { - dealId: number; +export type CardProductAddKitRequest = { + cardId: number; productId: number; kitId: number; }; diff --git a/src/client/models/CardProductAddKitResponse.ts b/src/client/models/CardProductAddKitResponse.ts new file mode 100644 index 0000000..cca68b7 --- /dev/null +++ b/src/client/models/CardProductAddKitResponse.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type CardProductAddKitResponse = { + ok: boolean; + message: string; +}; + diff --git a/src/client/models/DealProductSchema.ts b/src/client/models/CardProductSchema.ts similarity index 65% rename from src/client/models/DealProductSchema.ts rename to src/client/models/CardProductSchema.ts index 1ce0fd5..5d9cb38 100644 --- a/src/client/models/DealProductSchema.ts +++ b/src/client/models/CardProductSchema.ts @@ -2,11 +2,11 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { DealProductServiceSchema } from './DealProductServiceSchema'; +import type { CardProductServiceSchema } from './CardProductServiceSchema'; import type { ProductSchema } from './ProductSchema'; -export type DealProductSchema = { +export type CardProductSchema = { product: ProductSchema; - services: Array; + services: Array; quantity: number; comment?: string; }; diff --git a/src/client/models/DealProductServiceSchema.ts b/src/client/models/CardProductServiceSchema.ts similarity index 89% rename from src/client/models/DealProductServiceSchema.ts rename to src/client/models/CardProductServiceSchema.ts index 7d9e5b9..3267427 100644 --- a/src/client/models/DealProductServiceSchema.ts +++ b/src/client/models/CardProductServiceSchema.ts @@ -4,7 +4,7 @@ /* eslint-disable */ import type { ServiceSchema } from './ServiceSchema'; import type { UserSchema } from './UserSchema'; -export type DealProductServiceSchema = { +export type CardProductServiceSchema = { service: ServiceSchema; price: number; employees: Array; diff --git a/src/client/models/DealQuickCreateRequest.ts b/src/client/models/CardQuickCreateRequest.ts similarity index 91% rename from src/client/models/DealQuickCreateRequest.ts rename to src/client/models/CardQuickCreateRequest.ts index 333e413..3489182 100644 --- a/src/client/models/DealQuickCreateRequest.ts +++ b/src/client/models/CardQuickCreateRequest.ts @@ -3,7 +3,7 @@ /* tslint:disable */ /* eslint-disable */ import type { BaseMarketplaceSchema } from './BaseMarketplaceSchema'; -export type DealQuickCreateRequest = { +export type CardQuickCreateRequest = { name: string; clientName: string; comment: string; diff --git a/src/client/models/CardQuickCreateResponse.ts b/src/client/models/CardQuickCreateResponse.ts new file mode 100644 index 0000000..1074791 --- /dev/null +++ b/src/client/models/CardQuickCreateResponse.ts @@ -0,0 +1,8 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type CardQuickCreateResponse = { + cardId: number; +}; + diff --git a/src/client/models/CardRecalculatePriceRequest.ts b/src/client/models/CardRecalculatePriceRequest.ts new file mode 100644 index 0000000..62dd249 --- /dev/null +++ b/src/client/models/CardRecalculatePriceRequest.ts @@ -0,0 +1,8 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type CardRecalculatePriceRequest = { + cardId: number; +}; + diff --git a/src/client/models/CreateDealsFromExcelResponse.ts b/src/client/models/CardRecalculatePriceResponse.ts similarity index 79% rename from src/client/models/CreateDealsFromExcelResponse.ts rename to src/client/models/CardRecalculatePriceResponse.ts index 5718e1d..8a8e53e 100644 --- a/src/client/models/CreateDealsFromExcelResponse.ts +++ b/src/client/models/CardRecalculatePriceResponse.ts @@ -2,7 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type CreateDealsFromExcelResponse = { +export type CardRecalculatePriceResponse = { ok: boolean; message: string; }; diff --git a/src/client/models/CardRemoveFromGroupRequest.ts b/src/client/models/CardRemoveFromGroupRequest.ts new file mode 100644 index 0000000..f348298 --- /dev/null +++ b/src/client/models/CardRemoveFromGroupRequest.ts @@ -0,0 +1,8 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type CardRemoveFromGroupRequest = { + cardId: number; +}; + diff --git a/src/client/models/CardRemoveFromGroupResponse.ts b/src/client/models/CardRemoveFromGroupResponse.ts new file mode 100644 index 0000000..e9f12bb --- /dev/null +++ b/src/client/models/CardRemoveFromGroupResponse.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type CardRemoveFromGroupResponse = { + ok: boolean; + message: string; +}; + diff --git a/src/client/models/DealSchema.ts b/src/client/models/CardSchema.ts similarity index 54% rename from src/client/models/DealSchema.ts rename to src/client/models/CardSchema.ts index 8e99371..9b1f818 100644 --- a/src/client/models/DealSchema.ts +++ b/src/client/models/CardSchema.ts @@ -4,41 +4,40 @@ /* eslint-disable */ import type { BoardSchema } from './BoardSchema'; import type { BoxSchema } from './BoxSchema'; +import type { CardAttributeSchema } from './CardAttributeSchema'; +import type { CardBillRequestSchema } from './CardBillRequestSchema'; +import type { CardEmployeesSchema } from './CardEmployeesSchema'; +import type { CardGroupSchema } from './CardGroupSchema'; +import type { CardProductSchema } from './CardProductSchema'; +import type { CardServiceSchema } from './CardServiceSchema'; +import type { CardStatusHistorySchema } from './CardStatusHistorySchema'; import type { ClientSchema } from './ClientSchema'; -import type { DealBillRequestSchema } from './DealBillRequestSchema'; -import type { DealEmployeesSchema } from './DealEmployeesSchema'; -import type { DealGroupSchema } from './DealGroupSchema'; -import type { DealProductSchema } from './DealProductSchema'; -import type { DealServiceSchema } from './DealServiceSchema'; -import type { DealStatusHistorySchema } from './DealStatusHistorySchema'; import type { PalletSchema } from './PalletSchema'; import type { ShippingWarehouseSchema } from './ShippingWarehouseSchema'; import type { StatusSchema } from './StatusSchema'; import type { UserSchema } from './UserSchema'; -export type DealSchema = { +export type CardSchema = { id: number; name: string; - clientId: number; + comment: string; createdAt: string; status: StatusSchema; board: BoardSchema; - services: Array; - products: Array; - statusHistory: Array; + statusHistory: Array; isDeleted: boolean; isCompleted: boolean; isLocked: boolean; - isAccounted: boolean; + services: Array; + products: Array; + clientId: number; client: ClientSchema; - comment: string; shippingWarehouse?: (ShippingWarehouseSchema | string | null); - billRequest?: (DealBillRequestSchema | null); - group?: (DealGroupSchema | null); + billRequest?: (CardBillRequestSchema | null); + group?: (CardGroupSchema | null); manager?: (UserSchema | null); pallets?: Array; boxes?: Array; - employees?: Array; - deliveryDate?: (string | null); - receivingSlotDate?: (string | null); + employees?: Array; + attributes: Array; }; diff --git a/src/client/models/DealServiceSchema.ts b/src/client/models/CardServiceSchema.ts similarity index 91% rename from src/client/models/DealServiceSchema.ts rename to src/client/models/CardServiceSchema.ts index c7cbc1a..4b50264 100644 --- a/src/client/models/DealServiceSchema.ts +++ b/src/client/models/CardServiceSchema.ts @@ -4,7 +4,7 @@ /* eslint-disable */ import type { ServiceSchema } from './ServiceSchema'; import type { UserSchema } from './UserSchema'; -export type DealServiceSchema = { +export type CardServiceSchema = { service: ServiceSchema; quantity: number; price: number; diff --git a/src/client/models/DealServicesCopyRequest.ts b/src/client/models/CardServicesCopyRequest.ts similarity index 77% rename from src/client/models/DealServicesCopyRequest.ts rename to src/client/models/CardServicesCopyRequest.ts index 79a7f6e..355f770 100644 --- a/src/client/models/DealServicesCopyRequest.ts +++ b/src/client/models/CardServicesCopyRequest.ts @@ -2,8 +2,8 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type DealServicesCopyRequest = { - dealId: number; +export type CardServicesCopyRequest = { + cardId: number; sourceProductId: number; destinationProductIds: Array; }; diff --git a/src/client/models/CardServicesCopyResponse.ts b/src/client/models/CardServicesCopyResponse.ts new file mode 100644 index 0000000..5cd9e8b --- /dev/null +++ b/src/client/models/CardServicesCopyResponse.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type CardServicesCopyResponse = { + ok: boolean; + message: string; +}; + diff --git a/src/client/models/DealStatusHistorySchema.ts b/src/client/models/CardStatusHistorySchema.ts similarity index 91% rename from src/client/models/DealStatusHistorySchema.ts rename to src/client/models/CardStatusHistorySchema.ts index 0fd15e9..94e31ed 100644 --- a/src/client/models/DealStatusHistorySchema.ts +++ b/src/client/models/CardStatusHistorySchema.ts @@ -4,7 +4,7 @@ /* eslint-disable */ import type { StatusSchema } from './StatusSchema'; import type { UserSchema } from './UserSchema'; -export type DealStatusHistorySchema = { +export type CardStatusHistorySchema = { user: UserSchema; changedAt: string; fromStatus: StatusSchema; diff --git a/src/client/models/DealSummary.ts b/src/client/models/CardSummary.ts similarity index 67% rename from src/client/models/DealSummary.ts rename to src/client/models/CardSummary.ts index f7e0330..d08d489 100644 --- a/src/client/models/DealSummary.ts +++ b/src/client/models/CardSummary.ts @@ -4,10 +4,10 @@ /* eslint-disable */ import type { BaseMarketplaceSchema } from './BaseMarketplaceSchema'; import type { BoardSchema } from './BoardSchema'; -import type { DealBillRequestSchema } from './DealBillRequestSchema'; -import type { DealGroupSchema } from './DealGroupSchema'; +import type { CardBillRequestSchema } from './CardBillRequestSchema'; +import type { CardGroupSchema } from './CardGroupSchema'; import type { StatusSchema } from './StatusSchema'; -export type DealSummary = { +export type CardSummary = { id: number; name: string; clientName: string; @@ -20,9 +20,7 @@ export type DealSummary = { totalProducts: number; shipmentWarehouseId: (number | null); shipmentWarehouseName: (string | null); - deliveryDate?: (string | null); - receivingSlotDate?: (string | null); - billRequest?: (DealBillRequestSchema | null); - group?: (DealGroupSchema | null); + billRequest?: (CardBillRequestSchema | null); + group?: (CardGroupSchema | null); }; diff --git a/src/client/models/DealSummaryReorderRequest.ts b/src/client/models/CardSummaryReorderRequest.ts similarity index 79% rename from src/client/models/DealSummaryReorderRequest.ts rename to src/client/models/CardSummaryReorderRequest.ts index 9e760cc..bec06b1 100644 --- a/src/client/models/DealSummaryReorderRequest.ts +++ b/src/client/models/CardSummaryReorderRequest.ts @@ -2,8 +2,8 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type DealSummaryReorderRequest = { - dealId: number; +export type CardSummaryReorderRequest = { + cardId: number; statusId: number; index: number; deadline?: (string | null); diff --git a/src/client/models/CardSummaryResponse.ts b/src/client/models/CardSummaryResponse.ts new file mode 100644 index 0000000..dceb170 --- /dev/null +++ b/src/client/models/CardSummaryResponse.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { CardSummary } from './CardSummary'; +export type CardSummaryResponse = { + summaries: Array; +}; + diff --git a/src/client/models/CardUpdateGeneralInfoRequest.ts b/src/client/models/CardUpdateGeneralInfoRequest.ts new file mode 100644 index 0000000..4ba1843 --- /dev/null +++ b/src/client/models/CardUpdateGeneralInfoRequest.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { CardGeneralInfoSchema } from './CardGeneralInfoSchema'; +export type CardUpdateGeneralInfoRequest = { + cardId: number; + data: CardGeneralInfoSchema; +}; + diff --git a/src/client/models/CardUpdateGeneralInfoResponse.ts b/src/client/models/CardUpdateGeneralInfoResponse.ts new file mode 100644 index 0000000..6c2a154 --- /dev/null +++ b/src/client/models/CardUpdateGeneralInfoResponse.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type CardUpdateGeneralInfoResponse = { + ok: boolean; + message: string; +}; + diff --git a/src/client/models/DealUpdateProductQuantityRequest.ts b/src/client/models/CardUpdateProductQuantityRequest.ts similarity index 72% rename from src/client/models/DealUpdateProductQuantityRequest.ts rename to src/client/models/CardUpdateProductQuantityRequest.ts index a3fd92a..380dcec 100644 --- a/src/client/models/DealUpdateProductQuantityRequest.ts +++ b/src/client/models/CardUpdateProductQuantityRequest.ts @@ -2,8 +2,8 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type DealUpdateProductQuantityRequest = { - dealId: number; +export type CardUpdateProductQuantityRequest = { + cardId: number; productId: number; quantity: number; }; diff --git a/src/client/models/CardUpdateProductQuantityResponse.ts b/src/client/models/CardUpdateProductQuantityResponse.ts new file mode 100644 index 0000000..48a9cbe --- /dev/null +++ b/src/client/models/CardUpdateProductQuantityResponse.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type CardUpdateProductQuantityResponse = { + ok: boolean; + message: string; +}; + diff --git a/src/client/models/CardUpdateProductRequest.ts b/src/client/models/CardUpdateProductRequest.ts new file mode 100644 index 0000000..1310a6e --- /dev/null +++ b/src/client/models/CardUpdateProductRequest.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { CardProductSchema } from './CardProductSchema'; +export type CardUpdateProductRequest = { + cardId: number; + product: CardProductSchema; +}; + diff --git a/src/client/models/CardUpdateProductResponse.ts b/src/client/models/CardUpdateProductResponse.ts new file mode 100644 index 0000000..ddedf4d --- /dev/null +++ b/src/client/models/CardUpdateProductResponse.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type CardUpdateProductResponse = { + ok: boolean; + message: string; +}; + diff --git a/src/client/models/DealUpdateServiceQuantityRequest.ts b/src/client/models/CardUpdateServiceQuantityRequest.ts similarity index 72% rename from src/client/models/DealUpdateServiceQuantityRequest.ts rename to src/client/models/CardUpdateServiceQuantityRequest.ts index 90259d0..cc2c8e2 100644 --- a/src/client/models/DealUpdateServiceQuantityRequest.ts +++ b/src/client/models/CardUpdateServiceQuantityRequest.ts @@ -2,8 +2,8 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type DealUpdateServiceQuantityRequest = { - dealId: number; +export type CardUpdateServiceQuantityRequest = { + cardId: number; serviceId: number; quantity: number; }; diff --git a/src/client/models/CardUpdateServiceQuantityResponse.ts b/src/client/models/CardUpdateServiceQuantityResponse.ts new file mode 100644 index 0000000..7faebed --- /dev/null +++ b/src/client/models/CardUpdateServiceQuantityResponse.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type CardUpdateServiceQuantityResponse = { + ok: boolean; + message: string; +}; + diff --git a/src/client/models/CardUpdateServiceRequest.ts b/src/client/models/CardUpdateServiceRequest.ts new file mode 100644 index 0000000..108460e --- /dev/null +++ b/src/client/models/CardUpdateServiceRequest.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { CardServiceSchema } from './CardServiceSchema'; +export type CardUpdateServiceRequest = { + cardId: number; + service: CardServiceSchema; +}; + diff --git a/src/client/models/CardUpdateServiceResponse.ts b/src/client/models/CardUpdateServiceResponse.ts new file mode 100644 index 0000000..7228a1b --- /dev/null +++ b/src/client/models/CardUpdateServiceResponse.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type CardUpdateServiceResponse = { + ok: boolean; + message: string; +}; + diff --git a/src/client/models/CreateBoxInDealSchema.ts b/src/client/models/CreateBoxInCardSchema.ts similarity index 67% rename from src/client/models/CreateBoxInDealSchema.ts rename to src/client/models/CreateBoxInCardSchema.ts index 373942e..6447bb2 100644 --- a/src/client/models/CreateBoxInDealSchema.ts +++ b/src/client/models/CreateBoxInCardSchema.ts @@ -2,7 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type CreateBoxInDealSchema = { - dealId: (number | null); +export type CreateBoxInCardSchema = { + cardId: (number | null); }; diff --git a/src/client/models/CreateDealBillRequest.ts b/src/client/models/CreateCardBillRequest.ts similarity index 70% rename from src/client/models/CreateDealBillRequest.ts rename to src/client/models/CreateCardBillRequest.ts index a193cf8..e779f9d 100644 --- a/src/client/models/CreateDealBillRequest.ts +++ b/src/client/models/CreateCardBillRequest.ts @@ -2,7 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type CreateDealBillRequest = { - dealId: number; +export type CreateCardBillRequest = { + cardId: number; }; diff --git a/src/client/models/CreateCardBillResponse.ts b/src/client/models/CreateCardBillResponse.ts new file mode 100644 index 0000000..737845a --- /dev/null +++ b/src/client/models/CreateCardBillResponse.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type CreateCardBillResponse = { + ok: boolean; + message: string; +}; + diff --git a/src/client/models/CreateCardGroupRequest.ts b/src/client/models/CreateCardGroupRequest.ts new file mode 100644 index 0000000..ca099df --- /dev/null +++ b/src/client/models/CreateCardGroupRequest.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type CreateCardGroupRequest = { + draggingCardId: number; + hoveredCardId: number; +}; + diff --git a/src/client/models/CreateDealsFromExcelRequest.ts b/src/client/models/CreateCardsFromExcelRequest.ts similarity index 87% rename from src/client/models/CreateDealsFromExcelRequest.ts rename to src/client/models/CreateCardsFromExcelRequest.ts index 538d5f6..38dd033 100644 --- a/src/client/models/CreateDealsFromExcelRequest.ts +++ b/src/client/models/CreateCardsFromExcelRequest.ts @@ -3,7 +3,7 @@ /* tslint:disable */ /* eslint-disable */ import type { ProductFromExcelSchema } from './ProductFromExcelSchema'; -export type CreateDealsFromExcelRequest = { +export type CreateCardsFromExcelRequest = { clientId: number; statusId: number; products: Array; diff --git a/src/client/models/CreateCardsFromExcelResponse.ts b/src/client/models/CreateCardsFromExcelResponse.ts new file mode 100644 index 0000000..f0c0184 --- /dev/null +++ b/src/client/models/CreateCardsFromExcelResponse.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type CreateCardsFromExcelResponse = { + ok: boolean; + message: string; +}; + diff --git a/src/client/models/DealAddProductRequest.ts b/src/client/models/DealAddProductRequest.ts deleted file mode 100644 index 29a9d1d..0000000 --- a/src/client/models/DealAddProductRequest.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { DealProductSchema } from './DealProductSchema'; -export type DealAddProductRequest = { - dealId: number; - product: DealProductSchema; -}; - diff --git a/src/client/models/DealAddServiceResponse.ts b/src/client/models/DealAddServiceResponse.ts deleted file mode 100644 index 246b168..0000000 --- a/src/client/models/DealAddServiceResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type DealAddServiceResponse = { - ok: boolean; - message: string; -}; - diff --git a/src/client/models/DealAddServicesRequest.ts b/src/client/models/DealAddServicesRequest.ts deleted file mode 100644 index ce5fbe3..0000000 --- a/src/client/models/DealAddServicesRequest.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { DealServiceSchema } from './DealServiceSchema'; -export type DealAddServicesRequest = { - dealId: number; - services: Array; -}; - diff --git a/src/client/models/DealAddServicesResponse.ts b/src/client/models/DealAddServicesResponse.ts deleted file mode 100644 index 3a51404..0000000 --- a/src/client/models/DealAddServicesResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type DealAddServicesResponse = { - ok: boolean; - message: string; -}; - diff --git a/src/client/models/DealAddToGroupResponse.ts b/src/client/models/DealAddToGroupResponse.ts deleted file mode 100644 index e38365f..0000000 --- a/src/client/models/DealAddToGroupResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type DealAddToGroupResponse = { - ok: boolean; - message: string; -}; - diff --git a/src/client/models/DealCreateGroupRequest.ts b/src/client/models/DealCreateGroupRequest.ts deleted file mode 100644 index 5a2ec1d..0000000 --- a/src/client/models/DealCreateGroupRequest.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type DealCreateGroupRequest = { - draggingDealId: number; - hoveredDealId: number; -}; - diff --git a/src/client/models/DealCreateGroupResponse.ts b/src/client/models/DealCreateGroupResponse.ts deleted file mode 100644 index 17393df..0000000 --- a/src/client/models/DealCreateGroupResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type DealCreateGroupResponse = { - ok: boolean; - message: string; -}; - diff --git a/src/client/models/DealCreateGuestUrlRequest.ts b/src/client/models/DealCreateGuestUrlRequest.ts deleted file mode 100644 index 1286b5e..0000000 --- a/src/client/models/DealCreateGuestUrlRequest.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type DealCreateGuestUrlRequest = { - dealId: number; -}; - diff --git a/src/client/models/DealDeleteProductResponse.ts b/src/client/models/DealDeleteProductResponse.ts deleted file mode 100644 index 6c62810..0000000 --- a/src/client/models/DealDeleteProductResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type DealDeleteProductResponse = { - ok: boolean; - message: string; -}; - diff --git a/src/client/models/DealDeleteProductsResponse.ts b/src/client/models/DealDeleteProductsResponse.ts deleted file mode 100644 index fefb43f..0000000 --- a/src/client/models/DealDeleteProductsResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type DealDeleteProductsResponse = { - ok: boolean; - message: string; -}; - diff --git a/src/client/models/DealDeleteServiceResponse.ts b/src/client/models/DealDeleteServiceResponse.ts deleted file mode 100644 index 91f25d6..0000000 --- a/src/client/models/DealDeleteServiceResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type DealDeleteServiceResponse = { - ok: boolean; - message: string; -}; - diff --git a/src/client/models/DealDeleteServicesResponse.ts b/src/client/models/DealDeleteServicesResponse.ts deleted file mode 100644 index 6a97f58..0000000 --- a/src/client/models/DealDeleteServicesResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type DealDeleteServicesResponse = { - ok: boolean; - message: string; -}; - diff --git a/src/client/models/DealGetAllResponse.ts b/src/client/models/DealGetAllResponse.ts deleted file mode 100644 index 7b58a45..0000000 --- a/src/client/models/DealGetAllResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { DealSchema } from './DealSchema'; -export type DealGetAllResponse = { - deals: Array; -}; - diff --git a/src/client/models/DealGroupChangeStatusResponse.ts b/src/client/models/DealGroupChangeStatusResponse.ts deleted file mode 100644 index 89be5a8..0000000 --- a/src/client/models/DealGroupChangeStatusResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type DealGroupChangeStatusResponse = { - ok: boolean; - message: string; -}; - diff --git a/src/client/models/DealGroupUpdateRequest.ts b/src/client/models/DealGroupUpdateRequest.ts deleted file mode 100644 index d017140..0000000 --- a/src/client/models/DealGroupUpdateRequest.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { DealGroupSchema } from './DealGroupSchema'; -export type DealGroupUpdateRequest = { - data: DealGroupSchema; -}; - diff --git a/src/client/models/DealGroupUpdateResponse.ts b/src/client/models/DealGroupUpdateResponse.ts deleted file mode 100644 index 5d2bced..0000000 --- a/src/client/models/DealGroupUpdateResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type DealGroupUpdateResponse = { - ok: boolean; - message: string; -}; - diff --git a/src/client/models/DealPrefillRequest.ts b/src/client/models/DealPrefillRequest.ts deleted file mode 100644 index f5820d2..0000000 --- a/src/client/models/DealPrefillRequest.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type DealPrefillRequest = { - oldDealId: number; - newDealId: number; -}; - diff --git a/src/client/models/DealProductAddKitResponse.ts b/src/client/models/DealProductAddKitResponse.ts deleted file mode 100644 index 9d7ee54..0000000 --- a/src/client/models/DealProductAddKitResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type DealProductAddKitResponse = { - ok: boolean; - message: string; -}; - diff --git a/src/client/models/DealQuickCreateResponse.ts b/src/client/models/DealQuickCreateResponse.ts deleted file mode 100644 index f48342a..0000000 --- a/src/client/models/DealQuickCreateResponse.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type DealQuickCreateResponse = { - dealId: number; -}; - diff --git a/src/client/models/DealRecalculatePriceRequest.ts b/src/client/models/DealRecalculatePriceRequest.ts deleted file mode 100644 index 0f0623f..0000000 --- a/src/client/models/DealRecalculatePriceRequest.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type DealRecalculatePriceRequest = { - dealId: number; -}; - diff --git a/src/client/models/DealRecalculatePriceResponse.ts b/src/client/models/DealRecalculatePriceResponse.ts deleted file mode 100644 index d1c4a12..0000000 --- a/src/client/models/DealRecalculatePriceResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type DealRecalculatePriceResponse = { - ok: boolean; - message: string; -}; - diff --git a/src/client/models/DealRemoveFromGroupRequest.ts b/src/client/models/DealRemoveFromGroupRequest.ts deleted file mode 100644 index 139a2e8..0000000 --- a/src/client/models/DealRemoveFromGroupRequest.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type DealRemoveFromGroupRequest = { - dealId: number; -}; - diff --git a/src/client/models/DealRemoveFromGroupResponse.ts b/src/client/models/DealRemoveFromGroupResponse.ts deleted file mode 100644 index 8f772d7..0000000 --- a/src/client/models/DealRemoveFromGroupResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type DealRemoveFromGroupResponse = { - ok: boolean; - message: string; -}; - diff --git a/src/client/models/DealServicesCopyResponse.ts b/src/client/models/DealServicesCopyResponse.ts deleted file mode 100644 index 8132509..0000000 --- a/src/client/models/DealServicesCopyResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type DealServicesCopyResponse = { - ok: boolean; - message: string; -}; - diff --git a/src/client/models/DealSummaryResponse.ts b/src/client/models/DealSummaryResponse.ts deleted file mode 100644 index 5b880de..0000000 --- a/src/client/models/DealSummaryResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { DealSummary } from './DealSummary'; -export type DealSummaryResponse = { - summaries: Array; -}; - diff --git a/src/client/models/DealUpdateGeneralInfoRequest.ts b/src/client/models/DealUpdateGeneralInfoRequest.ts deleted file mode 100644 index eb8d936..0000000 --- a/src/client/models/DealUpdateGeneralInfoRequest.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { DealGeneralInfoSchema } from './DealGeneralInfoSchema'; -export type DealUpdateGeneralInfoRequest = { - dealId: number; - data: DealGeneralInfoSchema; -}; - diff --git a/src/client/models/DealUpdateGeneralInfoResponse.ts b/src/client/models/DealUpdateGeneralInfoResponse.ts deleted file mode 100644 index a979cf8..0000000 --- a/src/client/models/DealUpdateGeneralInfoResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type DealUpdateGeneralInfoResponse = { - ok: boolean; - message: string; -}; - diff --git a/src/client/models/DealUpdateProductQuantityResponse.ts b/src/client/models/DealUpdateProductQuantityResponse.ts deleted file mode 100644 index 2ca92a3..0000000 --- a/src/client/models/DealUpdateProductQuantityResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type DealUpdateProductQuantityResponse = { - ok: boolean; - message: string; -}; - diff --git a/src/client/models/DealUpdateProductRequest.ts b/src/client/models/DealUpdateProductRequest.ts deleted file mode 100644 index d48282b..0000000 --- a/src/client/models/DealUpdateProductRequest.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { DealProductSchema } from './DealProductSchema'; -export type DealUpdateProductRequest = { - dealId: number; - product: DealProductSchema; -}; - diff --git a/src/client/models/DealUpdateProductResponse.ts b/src/client/models/DealUpdateProductResponse.ts deleted file mode 100644 index a637b46..0000000 --- a/src/client/models/DealUpdateProductResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type DealUpdateProductResponse = { - ok: boolean; - message: string; -}; - diff --git a/src/client/models/DealUpdateServiceQuantityResponse.ts b/src/client/models/DealUpdateServiceQuantityResponse.ts deleted file mode 100644 index a1efb55..0000000 --- a/src/client/models/DealUpdateServiceQuantityResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type DealUpdateServiceQuantityResponse = { - ok: boolean; - message: string; -}; - diff --git a/src/client/models/DealUpdateServiceRequest.ts b/src/client/models/DealUpdateServiceRequest.ts deleted file mode 100644 index 6271c62..0000000 --- a/src/client/models/DealUpdateServiceRequest.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { DealServiceSchema } from './DealServiceSchema'; -export type DealUpdateServiceRequest = { - dealId: number; - service: DealServiceSchema; -}; - diff --git a/src/client/models/DealUpdateServiceResponse.ts b/src/client/models/DealUpdateServiceResponse.ts deleted file mode 100644 index 5783931..0000000 --- a/src/client/models/DealUpdateServiceResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type DealUpdateServiceResponse = { - ok: boolean; - message: string; -}; - diff --git a/src/client/models/FullProjectSchema.ts b/src/client/models/FullProjectSchema.ts new file mode 100644 index 0000000..f55ffdd --- /dev/null +++ b/src/client/models/FullProjectSchema.ts @@ -0,0 +1,14 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { AttributeSchema } from './AttributeSchema'; +import type { ModuleSchema } from './ModuleSchema'; +export type FullProjectSchema = { + name: string; + id: number; + attributes: Array; + modules: Array; + boardsCount: number; +}; + diff --git a/src/client/models/GetDealBillById.ts b/src/client/models/GetCardBillById.ts similarity index 51% rename from src/client/models/GetDealBillById.ts rename to src/client/models/GetCardBillById.ts index a7dd7ee..28bcac2 100644 --- a/src/client/models/GetDealBillById.ts +++ b/src/client/models/GetCardBillById.ts @@ -2,8 +2,8 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { DealBillRequestSchema } from './DealBillRequestSchema'; -export type GetDealBillById = { - dealBill: DealBillRequestSchema; +import type { CardBillRequestSchema } from './CardBillRequestSchema'; +export type GetCardBillById = { + cardBill: CardBillRequestSchema; }; diff --git a/src/client/models/GetCardProductsBarcodesPdfRequest.ts b/src/client/models/GetCardProductsBarcodesPdfRequest.ts new file mode 100644 index 0000000..a359242 --- /dev/null +++ b/src/client/models/GetCardProductsBarcodesPdfRequest.ts @@ -0,0 +1,8 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type GetCardProductsBarcodesPdfRequest = { + cardId: number; +}; + diff --git a/src/client/models/GetDealProductsBarcodesPdfResponse.ts b/src/client/models/GetCardProductsBarcodesPdfResponse.ts similarity index 80% rename from src/client/models/GetDealProductsBarcodesPdfResponse.ts rename to src/client/models/GetCardProductsBarcodesPdfResponse.ts index a4edb0a..bc3cd0f 100644 --- a/src/client/models/GetDealProductsBarcodesPdfResponse.ts +++ b/src/client/models/GetCardProductsBarcodesPdfResponse.ts @@ -2,7 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type GetDealProductsBarcodesPdfResponse = { +export type GetCardProductsBarcodesPdfResponse = { base64String: string; filename: string; mimeType: string; diff --git a/src/client/models/GetDealProductsBarcodesPdfRequest.ts b/src/client/models/GetDealProductsBarcodesPdfRequest.ts deleted file mode 100644 index d12f5e2..0000000 --- a/src/client/models/GetDealProductsBarcodesPdfRequest.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type GetDealProductsBarcodesPdfRequest = { - dealId: number; -}; - diff --git a/src/client/models/GetProfitChartDataRequest.ts b/src/client/models/GetProfitChartDataRequest.ts index 82037ea..75b3db3 100644 --- a/src/client/models/GetProfitChartDataRequest.ts +++ b/src/client/models/GetProfitChartDataRequest.ts @@ -8,7 +8,7 @@ export type GetProfitChartDataRequest = { baseMarketplaceKey: string; projectId: number; boardId: number; - dealStatusId: number; + cardStatusId: number; managerId: number; expenseTagId: number; incomeTagId: number; diff --git a/src/client/models/GetProfitTableDataRequest.ts b/src/client/models/GetProfitTableDataRequest.ts index 38b12e3..356c639 100644 --- a/src/client/models/GetProfitTableDataRequest.ts +++ b/src/client/models/GetProfitTableDataRequest.ts @@ -9,7 +9,7 @@ export type GetProfitTableDataRequest = { baseMarketplaceKey: string; projectId: number; boardId: number; - dealStatusId: number; + cardStatusId: number; managerId: number; expenseTagId: number; incomeTagId: number; diff --git a/src/client/models/GetProjectsResponse.ts b/src/client/models/GetProjectsResponse.ts index c4346fd..d2fda8b 100644 --- a/src/client/models/GetProjectsResponse.ts +++ b/src/client/models/GetProjectsResponse.ts @@ -2,8 +2,8 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { ProjectSchemaWithCount } from './ProjectSchemaWithCount'; +import type { FullProjectSchema } from './FullProjectSchema'; export type GetProjectsResponse = { - projects: Array; + projects: Array; }; diff --git a/src/client/models/ManageEmployeeRequest.ts b/src/client/models/ManageEmployeeRequest.ts index 0f1a05d..cc1813a 100644 --- a/src/client/models/ManageEmployeeRequest.ts +++ b/src/client/models/ManageEmployeeRequest.ts @@ -3,7 +3,7 @@ /* tslint:disable */ /* eslint-disable */ export type ManageEmployeeRequest = { - dealId: number; + cardId: number; userId: number; isAssign: boolean; }; diff --git a/src/client/models/ModuleSchema.ts b/src/client/models/ModuleSchema.ts new file mode 100644 index 0000000..7957205 --- /dev/null +++ b/src/client/models/ModuleSchema.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type ModuleSchema = { + id: number; + key: string; + isDeleted: boolean; +}; + diff --git a/src/client/models/ParseDealsExcelResponse.ts b/src/client/models/ParseCardsExcelResponse.ts similarity index 87% rename from src/client/models/ParseDealsExcelResponse.ts rename to src/client/models/ParseCardsExcelResponse.ts index 0615eac..0868b56 100644 --- a/src/client/models/ParseDealsExcelResponse.ts +++ b/src/client/models/ParseCardsExcelResponse.ts @@ -3,7 +3,7 @@ /* tslint:disable */ /* eslint-disable */ import type { ParsedProductRowSchema } from './ParsedProductRowSchema'; -export type ParseDealsExcelResponse = { +export type ParseCardsExcelResponse = { rows: Array; errors: Array; }; diff --git a/src/client/models/ProfitChartDataItem.ts b/src/client/models/ProfitChartDataItem.ts index 1ed5684..55a3ce9 100644 --- a/src/client/models/ProfitChartDataItem.ts +++ b/src/client/models/ProfitChartDataItem.ts @@ -7,6 +7,6 @@ export type ProfitChartDataItem = { revenue: number; profit: number; expenses: number; - dealsCount: number; + cardsCount: number; }; diff --git a/src/client/models/ProfitTableDataItem.ts b/src/client/models/ProfitTableDataItem.ts index 52790ea..8e7c155 100644 --- a/src/client/models/ProfitTableDataItem.ts +++ b/src/client/models/ProfitTableDataItem.ts @@ -7,6 +7,6 @@ export type ProfitTableDataItem = { revenue: number; profit: number; expenses?: (number | null); - dealsCount: number; + cardsCount: number; }; diff --git a/src/client/models/ProjectSchema.ts b/src/client/models/ProjectSchema.ts index b51bfc8..f5c7aae 100644 --- a/src/client/models/ProjectSchema.ts +++ b/src/client/models/ProjectSchema.ts @@ -2,8 +2,12 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +import type { AttributeSchema } from './AttributeSchema'; +import type { ModuleSchema } from './ModuleSchema'; export type ProjectSchema = { name: string; id: number; + attributes: Array; + modules: Array; }; diff --git a/src/client/models/ServiceCategorySchema.ts b/src/client/models/ServiceCategorySchema.ts index f0ebfc6..3dd51d3 100644 --- a/src/client/models/ServiceCategorySchema.ts +++ b/src/client/models/ServiceCategorySchema.ts @@ -5,7 +5,7 @@ export type ServiceCategorySchema = { id: number; name: string; - dealServiceRank: string; + cardServiceRank: string; productServiceRank: string; }; diff --git a/src/client/models/UpdateBoxRequest.ts b/src/client/models/UpdateBoxRequest.ts index 8bfbaa8..5af81f0 100644 --- a/src/client/models/UpdateBoxRequest.ts +++ b/src/client/models/UpdateBoxRequest.ts @@ -2,10 +2,10 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { CreateBoxInDealSchema } from './CreateBoxInDealSchema'; +import type { CreateBoxInCardSchema } from './CreateBoxInCardSchema'; import type { CreateBoxInPalletSchema } from './CreateBoxInPalletSchema'; import type { UpdateBoxSchema } from './UpdateBoxSchema'; export type UpdateBoxRequest = { - data: (CreateBoxInDealSchema | CreateBoxInPalletSchema | UpdateBoxSchema); + data: (CreateBoxInCardSchema | CreateBoxInPalletSchema | UpdateBoxSchema); }; diff --git a/src/client/services/BillingService.ts b/src/client/services/BillingService.ts index b200d9e..27c24e1 100644 --- a/src/client/services/BillingService.ts +++ b/src/client/services/BillingService.ts @@ -3,11 +3,11 @@ /* tslint:disable */ /* eslint-disable */ import type { BillStatusUpdateRequest } from '../models/BillStatusUpdateRequest'; -import type { CancelDealBillRequest } from '../models/CancelDealBillRequest'; -import type { CancelDealBillResponse } from '../models/CancelDealBillResponse'; -import type { CreateDealBillRequest } from '../models/CreateDealBillRequest'; -import type { CreateDealBillResponse } from '../models/CreateDealBillResponse'; -import type { GetDealBillById } from '../models/GetDealBillById'; +import type { CancelCardBillRequest } from '../models/CancelCardBillRequest'; +import type { CancelCardBillResponse } from '../models/CancelCardBillResponse'; +import type { CreateCardBillRequest } from '../models/CreateCardBillRequest'; +import type { CreateCardBillResponse } from '../models/CreateCardBillResponse'; +import type { GetCardBillById } from '../models/GetCardBillById'; import type { CancelablePromise } from '../core/CancelablePromise'; import { OpenAPI } from '../core/OpenAPI'; import { request as __request } from '../core/request'; @@ -34,14 +34,14 @@ export class BillingService { } /** * Create Deal Bill - * @returns CreateDealBillResponse Successful Response + * @returns CreateCardBillResponse Successful Response * @throws ApiError */ public static createDealBill({ requestBody, }: { - requestBody: CreateDealBillRequest, - }): CancelablePromise { + requestBody: CreateCardBillRequest, + }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/billing/create-deal-bill', @@ -54,14 +54,14 @@ export class BillingService { } /** * Cancel Deal Billing - * @returns CancelDealBillResponse Successful Response + * @returns CancelCardBillResponse Successful Response * @throws ApiError */ public static cancelDealBill({ requestBody, }: { - requestBody: CancelDealBillRequest, - }): CancelablePromise { + requestBody: CancelCardBillRequest, + }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/billing/cancel-deal-bill', @@ -74,14 +74,14 @@ export class BillingService { } /** * Get Deal Bill By Id - * @returns GetDealBillById Successful Response + * @returns GetCardBillById Successful Response * @throws ApiError */ public static getDealBillById({ dealId, }: { dealId: number, - }): CancelablePromise { + }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/billing/deal-bill-request/{deal_id}', diff --git a/src/client/services/DealGroupService.ts b/src/client/services/CardGroupService.ts similarity index 51% rename from src/client/services/DealGroupService.ts rename to src/client/services/CardGroupService.ts index 4b0b5e8..e51c354 100644 --- a/src/client/services/DealGroupService.ts +++ b/src/client/services/CardGroupService.ts @@ -2,33 +2,33 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { DealAddToGroupRequest } from '../models/DealAddToGroupRequest'; -import type { DealAddToGroupResponse } from '../models/DealAddToGroupResponse'; -import type { DealCreateGroupRequest } from '../models/DealCreateGroupRequest'; -import type { DealCreateGroupResponse } from '../models/DealCreateGroupResponse'; -import type { DealGroupChangeStatusRequest } from '../models/DealGroupChangeStatusRequest'; -import type { DealGroupChangeStatusResponse } from '../models/DealGroupChangeStatusResponse'; -import type { DealGroupUpdateRequest } from '../models/DealGroupUpdateRequest'; -import type { DealGroupUpdateResponse } from '../models/DealGroupUpdateResponse'; -import type { DealRemoveFromGroupRequest } from '../models/DealRemoveFromGroupRequest'; -import type { DealRemoveFromGroupResponse } from '../models/DealRemoveFromGroupResponse'; +import type { CardAddToGroupRequest } from '../models/CardAddToGroupRequest'; +import type { CardAddToGroupResponse } from '../models/CardAddToGroupResponse'; +import type { CardCreateGroupResponse } from '../models/CardCreateGroupResponse'; +import type { CardGroupChangeStatusRequest } from '../models/CardGroupChangeStatusRequest'; +import type { CardGroupChangeStatusResponse } from '../models/CardGroupChangeStatusResponse'; +import type { CardGroupUpdateRequest } from '../models/CardGroupUpdateRequest'; +import type { CardGroupUpdateResponse } from '../models/CardGroupUpdateResponse'; +import type { CardRemoveFromGroupRequest } from '../models/CardRemoveFromGroupRequest'; +import type { CardRemoveFromGroupResponse } from '../models/CardRemoveFromGroupResponse'; +import type { CreateCardGroupRequest } from '../models/CreateCardGroupRequest'; import type { CancelablePromise } from '../core/CancelablePromise'; import { OpenAPI } from '../core/OpenAPI'; import { request as __request } from '../core/request'; -export class DealGroupService { +export class CardGroupService { /** * Create Group - * @returns DealCreateGroupResponse Successful Response + * @returns CardCreateGroupResponse Successful Response * @throws ApiError */ - public static createDealGroup({ + public static createCardGroup({ requestBody, }: { - requestBody: DealCreateGroupRequest, - }): CancelablePromise { + requestBody: CreateCardGroupRequest, + }): CancelablePromise { return __request(OpenAPI, { method: 'POST', - url: '/deal-group/', + url: '/card-group/', body: requestBody, mediaType: 'application/json', errors: { @@ -38,17 +38,17 @@ export class DealGroupService { } /** * Update Group - * @returns DealGroupUpdateResponse Successful Response + * @returns CardGroupUpdateResponse Successful Response * @throws ApiError */ - public static updateDealGroup({ + public static updateCardGroup({ requestBody, }: { - requestBody: DealGroupUpdateRequest, - }): CancelablePromise { + requestBody: CardGroupUpdateRequest, + }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', - url: '/deal-group/', + url: '/card-group/', body: requestBody, mediaType: 'application/json', errors: { @@ -58,17 +58,17 @@ export class DealGroupService { } /** * Change Status - * @returns DealGroupChangeStatusResponse Successful Response + * @returns CardGroupChangeStatusResponse Successful Response * @throws ApiError */ public static changeStatus({ requestBody, }: { - requestBody: DealGroupChangeStatusRequest, - }): CancelablePromise { + requestBody: CardGroupChangeStatusRequest, + }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', - url: '/deal-group/change-status', + url: '/card-group/change-status', body: requestBody, mediaType: 'application/json', errors: { @@ -77,18 +77,18 @@ export class DealGroupService { }); } /** - * Add Deal - * @returns DealAddToGroupResponse Successful Response + * Add Card + * @returns CardAddToGroupResponse Successful Response * @throws ApiError */ - public static addDeal({ + public static addCard({ requestBody, }: { - requestBody: DealAddToGroupRequest, - }): CancelablePromise { + requestBody: CardAddToGroupRequest, + }): CancelablePromise { return __request(OpenAPI, { method: 'POST', - url: '/deal-group/deal', + url: '/card-group/card', body: requestBody, mediaType: 'application/json', errors: { @@ -97,18 +97,18 @@ export class DealGroupService { }); } /** - * Remove Deal - * @returns DealRemoveFromGroupResponse Successful Response + * Remove Card + * @returns CardRemoveFromGroupResponse Successful Response * @throws ApiError */ - public static removeDeal({ + public static removeCard({ requestBody, }: { - requestBody: DealRemoveFromGroupRequest, - }): CancelablePromise { + requestBody: CardRemoveFromGroupRequest, + }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', - url: '/deal-group/deal', + url: '/card-group/card', body: requestBody, mediaType: 'application/json', errors: { diff --git a/src/client/services/DealService.ts b/src/client/services/CardService.ts similarity index 53% rename from src/client/services/DealService.ts rename to src/client/services/CardService.ts index cda8a32..2922e4b 100644 --- a/src/client/services/DealService.ts +++ b/src/client/services/CardService.ts @@ -3,79 +3,79 @@ /* tslint:disable */ /* eslint-disable */ import type { Body_parse_deals_excel } from '../models/Body_parse_deals_excel'; -import type { CreateDealsFromExcelRequest } from '../models/CreateDealsFromExcelRequest'; -import type { CreateDealsFromExcelResponse } from '../models/CreateDealsFromExcelResponse'; -import type { DealAddKitRequest } from '../models/DealAddKitRequest'; -import type { DealAddKitResponse } from '../models/DealAddKitResponse'; -import type { DealAddProductRequest } from '../models/DealAddProductRequest'; -import type { DealAddProductResponse } from '../models/DealAddProductResponse'; -import type { DealAddServiceRequest } from '../models/DealAddServiceRequest'; -import type { DealAddServiceResponse } from '../models/DealAddServiceResponse'; -import type { DealAddServicesRequest } from '../models/DealAddServicesRequest'; -import type { DealAddServicesResponse } from '../models/DealAddServicesResponse'; -import type { DealChangeStatusRequest } from '../models/DealChangeStatusRequest'; -import type { DealChangeStatusResponse } from '../models/DealChangeStatusResponse'; -import type { DealCompleteRequest } from '../models/DealCompleteRequest'; -import type { DealCompleteResponse } from '../models/DealCompleteResponse'; -import type { DealCreateGuestUrlRequest } from '../models/DealCreateGuestUrlRequest'; -import type { DealCreateGuestUrlResponse } from '../models/DealCreateGuestUrlResponse'; -import type { DealDeleteProductRequest } from '../models/DealDeleteProductRequest'; -import type { DealDeleteProductResponse } from '../models/DealDeleteProductResponse'; -import type { DealDeleteProductsRequest } from '../models/DealDeleteProductsRequest'; -import type { DealDeleteProductsResponse } from '../models/DealDeleteProductsResponse'; -import type { DealDeleteRequest } from '../models/DealDeleteRequest'; -import type { DealDeleteResponse } from '../models/DealDeleteResponse'; -import type { DealDeleteServiceRequest } from '../models/DealDeleteServiceRequest'; -import type { DealDeleteServiceResponse } from '../models/DealDeleteServiceResponse'; -import type { DealDeleteServicesRequest } from '../models/DealDeleteServicesRequest'; -import type { DealDeleteServicesResponse } from '../models/DealDeleteServicesResponse'; -import type { DealGetAllResponse } from '../models/DealGetAllResponse'; -import type { DealPrefillRequest } from '../models/DealPrefillRequest'; -import type { DealPrefillResponse } from '../models/DealPrefillResponse'; -import type { DealProductAddKitRequest } from '../models/DealProductAddKitRequest'; -import type { DealProductAddKitResponse } from '../models/DealProductAddKitResponse'; -import type { DealQuickCreateRequest } from '../models/DealQuickCreateRequest'; -import type { DealQuickCreateResponse } from '../models/DealQuickCreateResponse'; -import type { DealRecalculatePriceRequest } from '../models/DealRecalculatePriceRequest'; -import type { DealRecalculatePriceResponse } from '../models/DealRecalculatePriceResponse'; -import type { DealSchema } from '../models/DealSchema'; -import type { DealServicesCopyRequest } from '../models/DealServicesCopyRequest'; -import type { DealServicesCopyResponse } from '../models/DealServicesCopyResponse'; -import type { DealSummaryReorderRequest } from '../models/DealSummaryReorderRequest'; -import type { DealSummaryResponse } from '../models/DealSummaryResponse'; -import type { DealUpdateGeneralInfoRequest } from '../models/DealUpdateGeneralInfoRequest'; -import type { DealUpdateGeneralInfoResponse } from '../models/DealUpdateGeneralInfoResponse'; -import type { DealUpdateProductQuantityRequest } from '../models/DealUpdateProductQuantityRequest'; -import type { DealUpdateProductQuantityResponse } from '../models/DealUpdateProductQuantityResponse'; -import type { DealUpdateProductRequest } from '../models/DealUpdateProductRequest'; -import type { DealUpdateProductResponse } from '../models/DealUpdateProductResponse'; -import type { DealUpdateServiceQuantityRequest } from '../models/DealUpdateServiceQuantityRequest'; -import type { DealUpdateServiceQuantityResponse } from '../models/DealUpdateServiceQuantityResponse'; -import type { DealUpdateServiceRequest } from '../models/DealUpdateServiceRequest'; -import type { DealUpdateServiceResponse } from '../models/DealUpdateServiceResponse'; +import type { CardAddKitRequest } from '../models/CardAddKitRequest'; +import type { CardAddKitResponse } from '../models/CardAddKitResponse'; +import type { CardAddProductRequest } from '../models/CardAddProductRequest'; +import type { CardAddProductResponse } from '../models/CardAddProductResponse'; +import type { CardAddServiceRequest } from '../models/CardAddServiceRequest'; +import type { CardAddServiceResponse } from '../models/CardAddServiceResponse'; +import type { CardAddServicesRequest } from '../models/CardAddServicesRequest'; +import type { CardAddServicesResponse } from '../models/CardAddServicesResponse'; +import type { CardChangeStatusRequest } from '../models/CardChangeStatusRequest'; +import type { CardChangeStatusResponse } from '../models/CardChangeStatusResponse'; +import type { CardCompleteRequest } from '../models/CardCompleteRequest'; +import type { CardCompleteResponse } from '../models/CardCompleteResponse'; +import type { CardCreateGuestUrlRequest } from '../models/CardCreateGuestUrlRequest'; +import type { CardCreateGuestUrlResponse } from '../models/CardCreateGuestUrlResponse'; +import type { CardDeleteProductRequest } from '../models/CardDeleteProductRequest'; +import type { CardDeleteProductResponse } from '../models/CardDeleteProductResponse'; +import type { CardDeleteProductsRequest } from '../models/CardDeleteProductsRequest'; +import type { CardDeleteProductsResponse } from '../models/CardDeleteProductsResponse'; +import type { CardDeleteRequest } from '../models/CardDeleteRequest'; +import type { CardDeleteResponse } from '../models/CardDeleteResponse'; +import type { CardDeleteServiceRequest } from '../models/CardDeleteServiceRequest'; +import type { CardDeleteServiceResponse } from '../models/CardDeleteServiceResponse'; +import type { CardDeleteServicesRequest } from '../models/CardDeleteServicesRequest'; +import type { CardDeleteServicesResponse } from '../models/CardDeleteServicesResponse'; +import type { CardGetAllResponse } from '../models/CardGetAllResponse'; +import type { CardPrefillRequest } from '../models/CardPrefillRequest'; +import type { CardPrefillResponse } from '../models/CardPrefillResponse'; +import type { CardProductAddKitRequest } from '../models/CardProductAddKitRequest'; +import type { CardProductAddKitResponse } from '../models/CardProductAddKitResponse'; +import type { CardQuickCreateRequest } from '../models/CardQuickCreateRequest'; +import type { CardQuickCreateResponse } from '../models/CardQuickCreateResponse'; +import type { CardRecalculatePriceRequest } from '../models/CardRecalculatePriceRequest'; +import type { CardRecalculatePriceResponse } from '../models/CardRecalculatePriceResponse'; +import type { CardSchema } from '../models/CardSchema'; +import type { CardServicesCopyRequest } from '../models/CardServicesCopyRequest'; +import type { CardServicesCopyResponse } from '../models/CardServicesCopyResponse'; +import type { CardSummaryReorderRequest } from '../models/CardSummaryReorderRequest'; +import type { CardSummaryResponse } from '../models/CardSummaryResponse'; +import type { CardUpdateGeneralInfoRequest } from '../models/CardUpdateGeneralInfoRequest'; +import type { CardUpdateGeneralInfoResponse } from '../models/CardUpdateGeneralInfoResponse'; +import type { CardUpdateProductQuantityRequest } from '../models/CardUpdateProductQuantityRequest'; +import type { CardUpdateProductQuantityResponse } from '../models/CardUpdateProductQuantityResponse'; +import type { CardUpdateProductRequest } from '../models/CardUpdateProductRequest'; +import type { CardUpdateProductResponse } from '../models/CardUpdateProductResponse'; +import type { CardUpdateServiceQuantityRequest } from '../models/CardUpdateServiceQuantityRequest'; +import type { CardUpdateServiceQuantityResponse } from '../models/CardUpdateServiceQuantityResponse'; +import type { CardUpdateServiceRequest } from '../models/CardUpdateServiceRequest'; +import type { CardUpdateServiceResponse } from '../models/CardUpdateServiceResponse'; +import type { CreateCardsFromExcelRequest } from '../models/CreateCardsFromExcelRequest'; +import type { CreateCardsFromExcelResponse } from '../models/CreateCardsFromExcelResponse'; import type { GetAvailableEmployeesToAssignResponse } from '../models/GetAvailableEmployeesToAssignResponse'; -import type { GetDealProductsBarcodesPdfRequest } from '../models/GetDealProductsBarcodesPdfRequest'; -import type { GetDealProductsBarcodesPdfResponse } from '../models/GetDealProductsBarcodesPdfResponse'; +import type { GetCardProductsBarcodesPdfRequest } from '../models/GetCardProductsBarcodesPdfRequest'; +import type { GetCardProductsBarcodesPdfResponse } from '../models/GetCardProductsBarcodesPdfResponse'; import type { ManageEmployeeRequest } from '../models/ManageEmployeeRequest'; import type { ManageEmployeeResponse } from '../models/ManageEmployeeResponse'; -import type { ParseDealsExcelResponse } from '../models/ParseDealsExcelResponse'; +import type { ParseCardsExcelResponse } from '../models/ParseCardsExcelResponse'; import type { CancelablePromise } from '../core/CancelablePromise'; import { OpenAPI } from '../core/OpenAPI'; import { request as __request } from '../core/request'; -export class DealService { +export class CardService { /** * Delete - * @returns DealDeleteResponse Successful Response + * @returns CardDeleteResponse Successful Response * @throws ApiError */ - public static deleteDeal({ + public static deleteCard({ requestBody, }: { - requestBody: DealDeleteRequest, - }): CancelablePromise { + requestBody: CardDeleteRequest, + }): CancelablePromise { return __request(OpenAPI, { method: 'POST', - url: '/deal/delete', + url: '/card/delete', body: requestBody, mediaType: 'application/json', errors: { @@ -85,17 +85,17 @@ export class DealService { } /** * Complete - * @returns DealCompleteResponse Successful Response + * @returns CardCompleteResponse Successful Response * @throws ApiError */ - public static completeDeal({ + public static completeCard({ requestBody, }: { - requestBody: DealCompleteRequest, - }): CancelablePromise { + requestBody: CardCompleteRequest, + }): CancelablePromise { return __request(OpenAPI, { method: 'POST', - url: '/deal/complete', + url: '/card/complete', body: requestBody, mediaType: 'application/json', errors: { @@ -105,17 +105,17 @@ export class DealService { } /** * Quick Create - * @returns DealQuickCreateResponse Successful Response + * @returns CardQuickCreateResponse Successful Response * @throws ApiError */ - public static quickCreateDealQuickCreatePost({ + public static quickCreateCardQuickCreatePost({ requestBody, }: { - requestBody: DealQuickCreateRequest, - }): CancelablePromise { + requestBody: CardQuickCreateRequest, + }): CancelablePromise { return __request(OpenAPI, { method: 'POST', - url: '/deal/quickCreate', + url: '/card/quickCreate', body: requestBody, mediaType: 'application/json', errors: { @@ -125,17 +125,17 @@ export class DealService { } /** * Change Status - * @returns DealChangeStatusResponse Successful Response + * @returns CardChangeStatusResponse Successful Response * @throws ApiError */ - public static changeStatusDealChangeStatusPost({ + public static changeStatusCardChangeStatusPost({ requestBody, }: { - requestBody: DealChangeStatusRequest, - }): CancelablePromise { + requestBody: CardChangeStatusRequest, + }): CancelablePromise { return __request(OpenAPI, { method: 'POST', - url: '/deal/changeStatus', + url: '/card/changeStatus', body: requestBody, mediaType: 'application/json', errors: { @@ -145,17 +145,17 @@ export class DealService { } /** * Get Summary - * @returns DealSummaryResponse Successful Response + * @returns CardSummaryResponse Successful Response * @throws ApiError */ - public static getDealSummaries({ + public static getCardSummaries({ full, }: { full: (boolean | null), - }): CancelablePromise { + }): CancelablePromise { return __request(OpenAPI, { method: 'GET', - url: '/deal/summaries', + url: '/card/summaries', query: { 'full': full, }, @@ -166,17 +166,17 @@ export class DealService { } /** * Reorder - * @returns DealSummaryResponse Successful Response + * @returns CardSummaryResponse Successful Response * @throws ApiError */ - public static reorderDealSummaries({ + public static reorderCardSummaries({ requestBody, }: { - requestBody: DealSummaryReorderRequest, - }): CancelablePromise { + requestBody: CardSummaryReorderRequest, + }): CancelablePromise { return __request(OpenAPI, { method: 'POST', - url: '/deal/summaries/reorder', + url: '/card/summaries/reorder', body: requestBody, mediaType: 'application/json', errors: { @@ -186,30 +186,30 @@ export class DealService { } /** * Get All - * @returns DealGetAllResponse Successful Response + * @returns CardGetAllResponse Successful Response * @throws ApiError */ - public static getAllDeals(): CancelablePromise { + public static getAllCards(): CancelablePromise { return __request(OpenAPI, { method: 'GET', - url: '/deal/get-all', + url: '/card/get-all', }); } /** - * Get Deal By Id - * @returns DealSchema Successful Response + * Get Card By Id + * @returns CardSchema Successful Response * @throws ApiError */ - public static getDealById({ - dealId, + public static getCardById({ + cardId, }: { - dealId: number, - }): CancelablePromise { + cardId: number, + }): CancelablePromise { return __request(OpenAPI, { method: 'GET', - url: '/deal/get/{deal_id}', + url: '/card/get/{card_id}', path: { - 'deal_id': dealId, + 'card_id': cardId, }, errors: { 422: `Validation Error`, @@ -218,17 +218,17 @@ export class DealService { } /** * Update General Info - * @returns DealUpdateGeneralInfoResponse Successful Response + * @returns CardUpdateGeneralInfoResponse Successful Response * @throws ApiError */ - public static updateDealGeneralInfo({ + public static updateCardGeneralInfo({ requestBody, }: { - requestBody: DealUpdateGeneralInfoRequest, - }): CancelablePromise { + requestBody: CardUpdateGeneralInfoRequest, + }): CancelablePromise { return __request(OpenAPI, { method: 'POST', - url: '/deal/update-general-info', + url: '/card/update-general-info', body: requestBody, mediaType: 'application/json', errors: { @@ -237,18 +237,18 @@ export class DealService { }); } /** - * Add Kit To Deal - * @returns DealAddKitResponse Successful Response + * Add Kit To Card + * @returns CardAddKitResponse Successful Response * @throws ApiError */ - public static addKitToDeal({ + public static addKitToCard({ requestBody, }: { - requestBody: DealAddKitRequest, - }): CancelablePromise { + requestBody: CardAddKitRequest, + }): CancelablePromise { return __request(OpenAPI, { method: 'POST', - url: '/deal/add-kit', + url: '/card/add-kit', body: requestBody, mediaType: 'application/json', errors: { @@ -258,17 +258,17 @@ export class DealService { } /** * Create Guest Url - * @returns DealCreateGuestUrlResponse Successful Response + * @returns CardCreateGuestUrlResponse Successful Response * @throws ApiError */ public static createDealGuestUrl({ requestBody, }: { - requestBody: DealCreateGuestUrlRequest, - }): CancelablePromise { + requestBody: CardCreateGuestUrlRequest, + }): CancelablePromise { return __request(OpenAPI, { method: 'POST', - url: '/deal/create-guest-url', + url: '/card/create-guest-url', body: requestBody, mediaType: 'application/json', errors: { @@ -288,7 +288,7 @@ export class DealService { }): CancelablePromise { return __request(OpenAPI, { method: 'GET', - url: '/deal/billing-document/{deal_id}', + url: '/card/billing-document/{deal_id}', path: { 'deal_id': dealId, }, @@ -309,7 +309,7 @@ export class DealService { }): CancelablePromise { return __request(OpenAPI, { method: 'GET', - url: '/deal/tech-spec/{deal_id}', + url: '/card/tech-spec/{deal_id}', path: { 'deal_id': dealId, }, @@ -319,18 +319,18 @@ export class DealService { }); } /** - * Post Prefill Deal - * @returns DealPrefillResponse Successful Response + * Post Prefill Card + * @returns CardPrefillResponse Successful Response * @throws ApiError */ - public static prefillDeal({ + public static prefillCard({ requestBody, }: { - requestBody: DealPrefillRequest, - }): CancelablePromise { + requestBody: CardPrefillRequest, + }): CancelablePromise { return __request(OpenAPI, { method: 'POST', - url: '/deal/prefill', + url: '/card/prefill', body: requestBody, mediaType: 'application/json', errors: { @@ -339,18 +339,18 @@ export class DealService { }); } /** - * Recalculate Deal Price - * @returns DealRecalculatePriceResponse Successful Response + * Recalculate Card Price + * @returns CardRecalculatePriceResponse Successful Response * @throws ApiError */ - public static recalculateDealPrice({ + public static recalculateCardPrice({ requestBody, }: { - requestBody: DealRecalculatePriceRequest, - }): CancelablePromise { + requestBody: CardRecalculatePriceRequest, + }): CancelablePromise { return __request(OpenAPI, { method: 'POST', - url: '/deal/recalculate-price', + url: '/card/recalculate-price', body: requestBody, mediaType: 'application/json', errors: { @@ -370,7 +370,7 @@ export class DealService { }): CancelablePromise { return __request(OpenAPI, { method: 'POST', - url: '/deal/employee', + url: '/card/employee', body: requestBody, mediaType: 'application/json', errors: { @@ -384,15 +384,15 @@ export class DealService { * @throws ApiError */ public static getAvailableEmployeesToAssign({ - dealId, + cardId, }: { - dealId: number, + cardId: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', - url: '/deal/employee/available/{deal_id}', + url: '/card/employee/available/{card_id}', path: { - 'deal_id': dealId, + 'card_id': cardId, }, errors: { 422: `Validation Error`, @@ -401,17 +401,17 @@ export class DealService { } /** * Parse Deals Excel - * @returns ParseDealsExcelResponse Successful Response + * @returns ParseCardsExcelResponse Successful Response * @throws ApiError */ public static parseDealsExcel({ formData, }: { formData: Body_parse_deals_excel, - }): CancelablePromise { + }): CancelablePromise { return __request(OpenAPI, { method: 'POST', - url: '/deal/prefill/excel/parse', + url: '/card/prefill/excel/parse', formData: formData, mediaType: 'multipart/form-data', errors: { @@ -421,17 +421,17 @@ export class DealService { } /** * Create Deals From Excel - * @returns CreateDealsFromExcelResponse Successful Response + * @returns CreateCardsFromExcelResponse Successful Response * @throws ApiError */ public static createDealsExcel({ requestBody, }: { - requestBody: CreateDealsFromExcelRequest, - }): CancelablePromise { + requestBody: CreateCardsFromExcelRequest, + }): CancelablePromise { return __request(OpenAPI, { method: 'POST', - url: '/deal/prefill/excel/create', + url: '/card/prefill/excel/create', body: requestBody, mediaType: 'application/json', errors: { @@ -441,17 +441,17 @@ export class DealService { } /** * Services Add - * @returns DealAddServicesResponse Successful Response + * @returns CardAddServicesResponse Successful Response * @throws ApiError */ - public static addMultipleDealServices({ + public static addMultipleCardServices({ requestBody, }: { - requestBody: DealAddServicesRequest, - }): CancelablePromise { + requestBody: CardAddServicesRequest, + }): CancelablePromise { return __request(OpenAPI, { method: 'POST', - url: '/deal/services/add/multiple', + url: '/card/services/add/multiple', body: requestBody, mediaType: 'application/json', errors: { @@ -461,17 +461,17 @@ export class DealService { } /** * Services Add - * @returns DealAddServiceResponse Successful Response + * @returns CardAddServiceResponse Successful Response * @throws ApiError */ - public static addDealService({ + public static addCardService({ requestBody, }: { - requestBody: DealAddServiceRequest, - }): CancelablePromise { + requestBody: CardAddServiceRequest, + }): CancelablePromise { return __request(OpenAPI, { method: 'POST', - url: '/deal/services/add', + url: '/card/services/add', body: requestBody, mediaType: 'application/json', errors: { @@ -481,17 +481,17 @@ export class DealService { } /** * Services Update Quantity - * @returns DealUpdateServiceQuantityResponse Successful Response + * @returns CardUpdateServiceQuantityResponse Successful Response * @throws ApiError */ - public static updateDealServiceQuantity({ + public static updateCardServiceQuantity({ requestBody, }: { - requestBody: DealUpdateServiceQuantityRequest, - }): CancelablePromise { + requestBody: CardUpdateServiceQuantityRequest, + }): CancelablePromise { return __request(OpenAPI, { method: 'POST', - url: '/deal/services/update-quantity', + url: '/card/services/update-quantity', body: requestBody, mediaType: 'application/json', errors: { @@ -501,17 +501,17 @@ export class DealService { } /** * Services Update - * @returns DealUpdateServiceResponse Successful Response + * @returns CardUpdateServiceResponse Successful Response * @throws ApiError */ - public static updateDealService({ + public static updateCardService({ requestBody, }: { - requestBody: DealUpdateServiceRequest, - }): CancelablePromise { + requestBody: CardUpdateServiceRequest, + }): CancelablePromise { return __request(OpenAPI, { method: 'POST', - url: '/deal/services/update', + url: '/card/services/update', body: requestBody, mediaType: 'application/json', errors: { @@ -521,17 +521,17 @@ export class DealService { } /** * Services Delete - * @returns DealDeleteServiceResponse Successful Response + * @returns CardDeleteServiceResponse Successful Response * @throws ApiError */ - public static deleteDealService({ + public static deleteCardService({ requestBody, }: { - requestBody: DealDeleteServiceRequest, - }): CancelablePromise { + requestBody: CardDeleteServiceRequest, + }): CancelablePromise { return __request(OpenAPI, { method: 'POST', - url: '/deal/services/delete', + url: '/card/services/delete', body: requestBody, mediaType: 'application/json', errors: { @@ -541,17 +541,17 @@ export class DealService { } /** * Services Delete - * @returns DealDeleteServicesResponse Successful Response + * @returns CardDeleteServicesResponse Successful Response * @throws ApiError */ - public static deleteMultipleDealServices({ + public static deleteMultipleCardServices({ requestBody, }: { - requestBody: DealDeleteServicesRequest, - }): CancelablePromise { + requestBody: CardDeleteServicesRequest, + }): CancelablePromise { return __request(OpenAPI, { method: 'POST', - url: '/deal/services/delete/multiple', + url: '/card/services/delete/multiple', body: requestBody, mediaType: 'application/json', errors: { @@ -561,17 +561,17 @@ export class DealService { } /** * Services Copy - * @returns DealServicesCopyResponse Successful Response + * @returns CardServicesCopyResponse Successful Response * @throws ApiError */ public static copyProductServices({ requestBody, }: { - requestBody: DealServicesCopyRequest, - }): CancelablePromise { + requestBody: CardServicesCopyRequest, + }): CancelablePromise { return __request(OpenAPI, { method: 'POST', - url: '/deal/services/copy', + url: '/card/services/copy', body: requestBody, mediaType: 'application/json', errors: { @@ -581,17 +581,17 @@ export class DealService { } /** * Products Update - * @returns DealUpdateProductQuantityResponse Successful Response + * @returns CardUpdateProductQuantityResponse Successful Response * @throws ApiError */ - public static updateDealProductQuantity({ + public static updateCardProductQuantity({ requestBody, }: { - requestBody: DealUpdateProductQuantityRequest, - }): CancelablePromise { + requestBody: CardUpdateProductQuantityRequest, + }): CancelablePromise { return __request(OpenAPI, { method: 'POST', - url: '/deal/products/update-quantity', + url: '/card/products/update-quantity', body: requestBody, mediaType: 'application/json', errors: { @@ -601,17 +601,17 @@ export class DealService { } /** * Products Add - * @returns DealAddProductResponse Successful Response + * @returns CardAddProductResponse Successful Response * @throws ApiError */ - public static addDealProduct({ + public static addCardProduct({ requestBody, }: { - requestBody: DealAddProductRequest, - }): CancelablePromise { + requestBody: CardAddProductRequest, + }): CancelablePromise { return __request(OpenAPI, { method: 'POST', - url: '/deal/products/add', + url: '/card/products/add', body: requestBody, mediaType: 'application/json', errors: { @@ -621,17 +621,17 @@ export class DealService { } /** * Products Delete - * @returns DealDeleteProductResponse Successful Response + * @returns CardDeleteProductResponse Successful Response * @throws ApiError */ - public static deleteDealProduct({ + public static deleteCardProduct({ requestBody, }: { - requestBody: DealDeleteProductRequest, - }): CancelablePromise { + requestBody: CardDeleteProductRequest, + }): CancelablePromise { return __request(OpenAPI, { method: 'POST', - url: '/deal/products/delete', + url: '/card/products/delete', body: requestBody, mediaType: 'application/json', errors: { @@ -641,17 +641,17 @@ export class DealService { } /** * Products Delete - * @returns DealDeleteProductsResponse Successful Response + * @returns CardDeleteProductsResponse Successful Response * @throws ApiError */ - public static deleteMultipleDealProducts({ + public static deleteMultipleCardProducts({ requestBody, }: { - requestBody: DealDeleteProductsRequest, - }): CancelablePromise { + requestBody: CardDeleteProductsRequest, + }): CancelablePromise { return __request(OpenAPI, { method: 'POST', - url: '/deal/products/delete/multiple', + url: '/card/products/delete/multiple', body: requestBody, mediaType: 'application/json', errors: { @@ -661,17 +661,17 @@ export class DealService { } /** * Products Update - * @returns DealUpdateProductResponse Successful Response + * @returns CardUpdateProductResponse Successful Response * @throws ApiError */ - public static updateDealProduct({ + public static updateCardProduct({ requestBody, }: { - requestBody: DealUpdateProductRequest, - }): CancelablePromise { + requestBody: CardUpdateProductRequest, + }): CancelablePromise { return __request(OpenAPI, { method: 'POST', - url: '/deal/product/update', + url: '/card/product/update', body: requestBody, mediaType: 'application/json', errors: { @@ -680,18 +680,18 @@ export class DealService { }); } /** - * Add Kit To Deal Product - * @returns DealProductAddKitResponse Successful Response + * Add Kit To Card Product + * @returns CardProductAddKitResponse Successful Response * @throws ApiError */ - public static addKitToDealProduct({ + public static addKitToCardProduct({ requestBody, }: { - requestBody: DealProductAddKitRequest, - }): CancelablePromise { + requestBody: CardProductAddKitRequest, + }): CancelablePromise { return __request(OpenAPI, { method: 'POST', - url: '/deal/product/add-kit', + url: '/card/product/add-kit', body: requestBody, mediaType: 'application/json', errors: { @@ -700,18 +700,18 @@ export class DealService { }); } /** - * Get Deal Products Barcodes Pdf - * @returns GetDealProductsBarcodesPdfResponse Successful Response + * Get Card Products Barcodes Pdf + * @returns GetCardProductsBarcodesPdfResponse Successful Response * @throws ApiError */ - public static getDealProductsBarcodesPdf({ + public static getCardProductsBarcodesPdf({ requestBody, }: { - requestBody: GetDealProductsBarcodesPdfRequest, - }): CancelablePromise { + requestBody: GetCardProductsBarcodesPdfRequest, + }): CancelablePromise { return __request(OpenAPI, { method: 'POST', - url: '/deal/barcodes/get-pdf', + url: '/card/barcodes/get-pdf', body: requestBody, mediaType: 'application/json', errors: { diff --git a/src/client/services/ShippingService.ts b/src/client/services/ShippingService.ts index d85149d..304e767 100644 --- a/src/client/services/ShippingService.ts +++ b/src/client/services/ShippingService.ts @@ -20,15 +20,15 @@ export class ShippingService { * @throws ApiError */ public static createPallet({ - dealId, + cardId, }: { - dealId: number, + cardId: number, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', - url: '/shipping/pallet/{deal_id}', + url: '/shipping/pallet/{card_id}', path: { - 'deal_id': dealId, + 'card_id': cardId, }, errors: { 422: `Validation Error`, diff --git a/src/components/CardAttributeFields/CardAttributeFields.tsx b/src/components/CardAttributeFields/CardAttributeFields.tsx new file mode 100644 index 0000000..3a2518e --- /dev/null +++ b/src/components/CardAttributeFields/CardAttributeFields.tsx @@ -0,0 +1,31 @@ +import { ProjectSchema } from "../../client"; +import { UseFormReturnType } from "@mantine/form"; +import { rem, Stack } from "@mantine/core"; +import { ReactNode } from "react"; +import CardAttributeField from "./components/CardAttributeField.tsx"; +import { CardGeneralFormType } from "../../pages/CardsPage/tabs/GeneralTab/GeneralTab.tsx"; + +type Props = { + project: ProjectSchema; + form: UseFormReturnType; +} + +const CardAttributeFields = ({ project, form }: Props) => { + const fields: ReactNode[] = project.attributes.map(attribute => { + return ( + + ); + }); + + return ( + + {...fields} + + ); +}; + +export default CardAttributeFields; diff --git a/src/components/CardAttributeFields/components/CardAttributeField.tsx b/src/components/CardAttributeFields/components/CardAttributeField.tsx new file mode 100644 index 0000000..3831a49 --- /dev/null +++ b/src/components/CardAttributeFields/components/CardAttributeField.tsx @@ -0,0 +1,51 @@ +import { AttributeSchema } from "../../../client"; +import { Checkbox, Tooltip } from "@mantine/core"; +import { UseFormReturnType } from "@mantine/form"; +import { ReactNode } from "react"; +import { DatePickerInput } from "@mantine/dates"; +import { CardGeneralFormType } from "../../../pages/CardsPage/tabs/GeneralTab/GeneralTab.tsx"; + +type Props = { + attribute: AttributeSchema; + form: UseFormReturnType; +} + +const CardAttributeField = ({ attribute, form }: Props) => { + const tooltipLabel = attribute.isApplicableToGroup + ? "Применяется ко всей группе" + : "Применяется только к данной сделке"; + + let component: ReactNode; + + if (attribute.type.type === "bool") { + component = ( + + ); + } + else if (attribute.type.type === "datetime" || attribute.type.type === "date") { + console.log("value = "); + console.log(form.getInputProps(attribute.name).value); + console.log("type = ") + console.log(typeof form.getInputProps(attribute.name).value); + + component = ( + + ); + } + + return ( + + {component} + + ); +}; + +export default CardAttributeField; diff --git a/src/components/CardAttributeFields/utils/getAttributesFromCard.ts b/src/components/CardAttributeFields/utils/getAttributesFromCard.ts new file mode 100644 index 0000000..098a474 --- /dev/null +++ b/src/components/CardAttributeFields/utils/getAttributesFromCard.ts @@ -0,0 +1,27 @@ +import { CardSchema } from "../../../client"; + +const DATETIME_TYPES = ["datetime", "date"]; + +const getAttributesFromCard = (card: CardSchema) => { + console.log("getAttributesFromCard"); + + return card.attributes.reduce( + (values, cardAttribute) => { + let value: boolean | number | string | null | Date = cardAttribute.value; + console.log(cardAttribute.attribute.type.type); + if (DATETIME_TYPES.includes(cardAttribute.attribute.type.type) && value !== null) { + value = new Date(value as string); + } + + console.log("cardAttrValue", value); + console.log("value type", typeof value); + return { + ...values, + [cardAttribute.attribute.name]: value, + }; + }, + {}, + ); +}; + +export default getAttributesFromCard; diff --git a/src/components/DealStatusSelect/DealStatusSelect.tsx b/src/components/DealStatusSelect/DealStatusSelect.tsx index fcc9c6b..9ab924e 100644 --- a/src/components/DealStatusSelect/DealStatusSelect.tsx +++ b/src/components/DealStatusSelect/DealStatusSelect.tsx @@ -13,7 +13,7 @@ type Props = OtherProps & SelectProps; const DealStatusSelect: FC = ({ board, ...props}) => { const [isInitial, setIsInitial] = useState(true); - const filteredData = board?.dealStatuses.filter( + const filteredData = board?.statuses.filter( status => !status.isDeleted, ) ?? []; diff --git a/src/components/Dnd/Boards/Boards/Boards.tsx b/src/components/Dnd/Boards/Boards/Boards.tsx index 8414fc0..d05bb19 100644 --- a/src/components/Dnd/Boards/Boards/Boards.tsx +++ b/src/components/Dnd/Boards/Boards/Boards.tsx @@ -1,18 +1,17 @@ import { Box, Center, Group, Stack } from "@mantine/core"; import { DragDropContext } from "@hello-pangea/dnd"; -import { BoardSchema, DealSummary, ProjectSchema } from "../../../../client"; +import { BoardSchema, CardSummary } from "../../../../client"; import { IconPlus } from "@tabler/icons-react"; import useBoards from "./hooks/useBoards.tsx"; import Statuses from "../../Statuses/Statuses/Statuses.tsx"; import Board from "../Board/Board.tsx"; import useBoardsDnd from "./hooks/useBoardsDnd.tsx"; -import PrefillDealsWithExcelDrawer - from "../../../../pages/DealsPage/drawers/PrefillDealWithExcelDrawer/PrefillDealsWithExcelDrawer.tsx"; +import PrefillCardsWithExcelDrawer + from "../../../../pages/CardsPage/drawers/PrefillCardWithExcelDrawer/PrefillCardsWithExcelDrawer.tsx"; type Props = { - project: ProjectSchema | null; - summariesRaw: DealSummary[]; + summariesRaw: CardSummary[]; refetchSummaries: () => void; boards: BoardSchema[]; refetchBoards: () => void; @@ -82,7 +81,7 @@ const Boards = (props: Props) => { selectedBoard={selectedBoard} {...props} /> - + ); }; diff --git a/src/components/Dnd/Boards/Boards/hooks/useBoards.tsx b/src/components/Dnd/Boards/Boards/hooks/useBoards.tsx index d0d7e53..c89deef 100644 --- a/src/components/Dnd/Boards/Boards/hooks/useBoards.tsx +++ b/src/components/Dnd/Boards/Boards/hooks/useBoards.tsx @@ -1,16 +1,17 @@ import { useEffect, useState } from "react"; -import { BoardSchema, BoardService, ProjectSchema } from "../../../../../client"; +import { BoardSchema, BoardService } from "../../../../../client"; import { modals } from "@mantine/modals"; import { notifications } from "../../../../../shared/lib/notifications.ts"; +import { useCardPageContext } from "../../../../../pages/CardsPage/contexts/CardPageContext.tsx"; type Props = { boards: BoardSchema[]; refetchBoards: () => void; - project: ProjectSchema | null; } -const useBoards = ({ boards, refetchBoards, project }: Props) => { +const useBoards = ({ boards, refetchBoards }: Props) => { const [selectedBoard, setSelectedBoard] = useState(null); + const { selectedProject: project } = useCardPageContext(); useEffect(() => { if (boards.length > 0 && selectedBoard === null) { diff --git a/src/components/Dnd/Boards/Boards/hooks/useBoardsDnd.tsx b/src/components/Dnd/Boards/Boards/hooks/useBoardsDnd.tsx index e018fdf..06dd799 100644 --- a/src/components/Dnd/Boards/Boards/hooks/useBoardsDnd.tsx +++ b/src/components/Dnd/Boards/Boards/hooks/useBoardsDnd.tsx @@ -32,11 +32,11 @@ const useBoardsDnd = ({ boards, refetchBoards }: Props) => { // If there is no changes if (!result.destination || result.destination == result.source) return; - // Checking for valid dealId + // Checking for valid cardId const boardId = parseInt(result.draggableId); if (isNaN(boardId)) return; - // Checking for valid deal + // Checking for valid card const board = boards.find(board => board.id == boardId); if (!board) return; diff --git a/src/components/Dnd/Deals/DealGroupView/DealGroupView.tsx b/src/components/Dnd/Cards/CardGroupView/CardGroupView.tsx similarity index 80% rename from src/components/Dnd/Deals/DealGroupView/DealGroupView.tsx rename to src/components/Dnd/Cards/CardGroupView/CardGroupView.tsx index d6562f5..c2f0f3e 100644 --- a/src/components/Dnd/Deals/DealGroupView/DealGroupView.tsx +++ b/src/components/Dnd/Cards/CardGroupView/CardGroupView.tsx @@ -1,25 +1,25 @@ -import { DealGroupSchema, DealGroupService, DealSummary } from "../../../../client"; +import { CardGroupSchema, CardGroupService, CardSummary } from "../../../../client"; import { FC, useEffect, useMemo, useState } from "react"; -import DealSummaryCard from "../DealSummaryCard/DealSummaryCard.tsx"; +import CardSummaryItem from "../CardSummaryItem/CardSummaryItem.tsx"; import { Flex, rem, Text, TextInput, useMantineColorScheme } from "@mantine/core"; import { IconGripHorizontal } from "@tabler/icons-react"; import { useDebouncedValue } from "@mantine/hooks"; import { notifications } from "../../../../shared/lib/notifications.ts"; type Props = { - deals: DealSummary[]; - group: DealGroupSchema; + cards: CardSummary[]; + group: CardGroupSchema; } -export const DealGroupView: FC = ({ deals, group }) => { +export const CardGroupView: FC = ({ cards, group }) => { const theme = useMantineColorScheme(); const [name, setName] = useState(group.name || ""); const [debouncedName] = useDebouncedValue(name, 200); - const totalPrice = useMemo(() => deals.reduce((acc, deal) => acc + deal.totalPrice, 0), [deals]); - const totalProducts = useMemo(() => deals.reduce((acc, deal) => acc + deal.totalProducts, 0), [deals]); + const totalPrice = useMemo(() => cards.reduce((acc, card) => acc + card.totalPrice, 0), [cards]); + const totalProducts = useMemo(() => cards.reduce((acc, card) => acc + card.totalProducts, 0), [cards]); const updateName = () => { if (debouncedName === group.name) return; - DealGroupService.updateDealGroup({ + CardGroupService.updateCardGroup({ requestBody: { data: { ...group, @@ -62,11 +62,11 @@ export const DealGroupView: FC = ({ deals, group }) => { - {deals.map(deal => ( - ( + ))} diff --git a/src/components/Dnd/Deals/DealSummaryCard/DealSummaryCard.module.css b/src/components/Dnd/Cards/CardSummaryItem/CardSummaryItem.module.css similarity index 100% rename from src/components/Dnd/Deals/DealSummaryCard/DealSummaryCard.module.css rename to src/components/Dnd/Cards/CardSummaryItem/CardSummaryItem.module.css diff --git a/src/components/Dnd/Deals/DealSummaryCard/DealSummaryCard.tsx b/src/components/Dnd/Cards/CardSummaryItem/CardSummaryItem.tsx similarity index 64% rename from src/components/Dnd/Deals/DealSummaryCard/DealSummaryCard.tsx rename to src/components/Dnd/Cards/CardSummaryItem/CardSummaryItem.tsx index 66d78d6..5ef8e43 100644 --- a/src/components/Dnd/Deals/DealSummaryCard/DealSummaryCard.tsx +++ b/src/components/Dnd/Cards/CardSummaryItem/CardSummaryItem.tsx @@ -1,54 +1,57 @@ import { FC } from "react"; -import { DealService, DealSummary } from "../../../../client"; -import styles from "./DealSummaryCard.module.css"; +import { CardService, CardSummary } from "../../../../client"; +import styles from "./CardSummaryItem.module.css"; import { ActionIcon, Badge, CopyButton, Flex, Image, Popover, rem, Text, ThemeIcon, Tooltip } from "@mantine/core"; -import { useDealPageContext } from "../../../../pages/DealsPage/contexts/DealPageContext.tsx"; +import { useCardPageContext } from "../../../../pages/CardsPage/contexts/CardPageContext.tsx"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faCheck } from "@fortawesome/free-solid-svg-icons"; import { IconCheck, IconLayoutGridRemove, IconTrash } from "@tabler/icons-react"; import { useContextMenu } from "mantine-contextmenu"; -import useDealSummaryState from "./useDealSummaryState.tsx"; +import useCardSummaryState from "./useCardSummaryState.tsx"; +import isModuleInProject, { Modules } from "../../../../pages/CardsPage/utils/isModuleInProject.ts"; type Props = { - dealSummary: DealSummary; + cardSummary: CardSummary; color?: string }; -const DealSummaryCard: FC = ({ dealSummary, color }) => { +const CardSummaryItem: FC = ({ cardSummary, color }) => { const { showContextMenu } = useContextMenu(); - const { setSelectedDeal } = useDealPageContext(); - const { onDelete, onComplete, onDeleteFromGroup } = useDealSummaryState(); + const { selectedProject, setSelectedCard } = useCardPageContext(); + const { onDelete, onComplete, onDeleteFromGroup } = useCardSummaryState(); + + const isServicesAndProductsIncluded = isModuleInProject(Modules.SERVICES_AND_PRODUCTS, selectedProject); const onDealSummaryClick = () => { - DealService.getDealById({ dealId: dealSummary.id }).then(deal => { - setSelectedDeal(deal); + CardService.getCardById({ cardId: cardSummary.id }).then(card => { + setSelectedCard(card); }); }; const isPaid = () => { - return dealSummary.billRequest?.paid || dealSummary.group?.billRequest?.paid; + return cardSummary.billRequest?.paid || cardSummary.group?.billRequest?.paid; }; const isLockedInsideGroup = () => { - return dealSummary.group && !dealSummary.group.billRequest; + return cardSummary.group && !cardSummary.group.billRequest; }; return (
onDeleteFromGroup(dealSummary), + onClick: () => onDeleteFromGroup(cardSummary), title: "Убрать из группы", icon: , }] : [], { key: "complete", - onClick: () => onComplete(dealSummary), + onClick: () => onComplete(cardSummary), title: "Завершить", icon: , }, { key: "delete", - onClick: () => onDelete(dealSummary), + onClick: () => onDelete(cardSummary), title: "Удалить", icon: , }, @@ -65,56 +68,36 @@ const DealSummaryCard: FC = ({ dealSummary, color }) => { size={"xs"} > - {dealSummary.clientName} + {cardSummary.clientName} - {dealSummary.name} + {cardSummary.name} - - - {dealSummary.shipmentWarehouseName || "Склад не указан"} - - - {dealSummary.totalPrice.toLocaleString("ru-RU")} руб,{" "} - - - {dealSummary.totalProducts.toLocaleString("ru-RU")} тов. - - - - {dealSummary.deliveryDate && ( - Доставка: {(new Date(dealSummary.deliveryDate)).toLocaleDateString("ru-RU")} + c={"gray.6"} + size={"sm"} + > + {cardSummary.totalPrice.toLocaleString("ru-RU")} руб,{" "} - )} - {dealSummary.receivingSlotDate && ( - Слот: {(new Date(dealSummary.receivingSlotDate)).toLocaleDateString("ru-RU")} + {cardSummary.totalProducts.toLocaleString("ru-RU")} тов. - )} - + + )} - + {({ copy, copied }) => ( = ({ dealSummary, color }) => { - ID: {dealSummary.id} + ID: {cardSummary.id}
@@ -162,7 +145,7 @@ const DealSummaryCard: FC = ({ dealSummary, color }) => { @@ -170,4 +153,4 @@ const DealSummaryCard: FC = ({ dealSummary, color }) => { ); }; -export default DealSummaryCard; +export default CardSummaryItem; diff --git a/src/components/Dnd/Deals/DealSummaryCard/useDealSummaryState.tsx b/src/components/Dnd/Cards/CardSummaryItem/useCardSummaryState.tsx similarity index 60% rename from src/components/Dnd/Deals/DealSummaryCard/useDealSummaryState.tsx rename to src/components/Dnd/Cards/CardSummaryItem/useCardSummaryState.tsx index 80c4102..6e6096e 100644 --- a/src/components/Dnd/Deals/DealSummaryCard/useDealSummaryState.tsx +++ b/src/components/Dnd/Cards/CardSummaryItem/useCardSummaryState.tsx @@ -1,91 +1,88 @@ -import { DealGroupService, DealService, DealSummary } from "../../../../client"; -import { useDealPageContext } from "../../../../pages/DealsPage/contexts/DealPageContext.tsx"; +import { CardGroupService, CardService, CardSummary } from "../../../../client"; +import { useCardPageContext } from "../../../../pages/CardsPage/contexts/CardPageContext.tsx"; import { modals } from "@mantine/modals"; import { Text } from "@mantine/core"; import { notifications } from "../../../../shared/lib/notifications.ts"; -const useDealSummaryState = () => { - const { refetchDeals } = useDealPageContext(); +const useCardSummaryState = () => { + const { refetchCards } = useCardPageContext(); - const recalculate = async (dealId: number) => { - return DealService.recalculateDealPrice({ + const recalculate = async (cardId: number) => { + return CardService.recalculateCardPrice({ requestBody: { - dealId: dealId, + cardId, }, }).then(({ ok, message }) => { notifications.guess(ok, { message }); }); }; - const onDelete = (summary: DealSummary) => { + const onDelete = (summary: CardSummary) => { modals.openConfirmModal({ - title: "Удаление сделки", + title: "Удаление карточки", children: ( - Вы уверены что хотите удалить сделку "{summary.name}"? + Вы уверены что хотите удалить карточку "{summary.name}"? ), labels: { confirm: "Да", cancel: "Нет" }, confirmProps: { color: "red" }, onConfirm: () => { - DealService.deleteDeal({ + CardService.deleteCard({ requestBody: { - dealId: summary.id, + cardId: summary.id, }, }).then(async (response) => { notifications.guess(response.ok, { message: response.message }); - if (response.ok) await refetchDeals(); + if (response.ok) await refetchCards(); }); }, }); }; - const onComplete = (summary: DealSummary) => { + const onComplete = (summary: CardSummary) => { modals.openConfirmModal({ - title: "Удаление сделки", + title: "Удаление карточки", children: ( - Вы уверены что хотите завершить сделку "{summary.name}"? + Вы уверены что хотите завершить карточку "{summary.name}"? ), labels: { confirm: "Да", cancel: "Нет" }, confirmProps: { color: "green" }, onConfirm: () => { - DealService.completeDeal({ + CardService.completeCard({ requestBody: { - dealId: summary.id, + cardId: summary.id, }, }).then(async (response) => { notifications.guess(response.ok, { message: response.message }); - if (response.ok) await refetchDeals(); - - + if (response.ok) await refetchCards(); }); }, }); }; - const onDeleteFromGroup = (summary: DealSummary) => { + const onDeleteFromGroup = (summary: CardSummary) => { modals.openConfirmModal({ - title: "Удаление сделки", + title: "Удаление карточки", children: ( - Вы уверены что хотите удалить сделку "{summary.name}" из группы? + Вы уверены что хотите удалить карточку "{summary.name}" из группы? ), labels: { confirm: "Да", cancel: "Нет" }, confirmProps: { color: "red" }, onConfirm: () => { - DealGroupService.removeDeal({ + CardGroupService.removeCard({ requestBody: { - dealId: summary.id, + cardId: summary.id, }, }).then(async (response) => { notifications.guess(response.ok, { message: response.message }); - if (response.ok) await refetchDeals(); + if (response.ok) await refetchCards(); await recalculate(summary.id); - if (response.ok) await refetchDeals(); - + if (response.ok) await refetchCards(); }); }, }); @@ -98,4 +95,4 @@ const useDealSummaryState = () => { }; }; -export default useDealSummaryState; \ No newline at end of file +export default useCardSummaryState; \ No newline at end of file diff --git a/src/components/Dnd/Deals/DealsDndColumn/DealsDndColumn.tsx b/src/components/Dnd/Cards/CardsDndColumn/CardsDndColumn.tsx similarity index 51% rename from src/components/Dnd/Deals/DealsDndColumn/DealsDndColumn.tsx rename to src/components/Dnd/Cards/CardsDndColumn/CardsDndColumn.tsx index faaf85a..212ab0e 100644 --- a/src/components/Dnd/Deals/DealsDndColumn/DealsDndColumn.tsx +++ b/src/components/Dnd/Cards/CardsDndColumn/CardsDndColumn.tsx @@ -1,111 +1,83 @@ import { FC } from "react"; import styles from "./DealsDndColumn.module.css"; import { Draggable, Droppable } from "@hello-pangea/dnd"; -import CreateDealButton from "../CreateDealButton/CreateDealButton.tsx"; -import { DealGroupSchema, DealSummary, StatusSchema } from "../../../../client"; -import DealSummaryCard from "../DealSummaryCard/DealSummaryCard.tsx"; +import CreateCardButton from "../CreateCardButton/CreateCardButton.tsx"; +import { CardGroupSchema, CardSummary, StatusSchema } from "../../../../client"; +import CardSummaryItem from "../CardSummaryItem/CardSummaryItem.tsx"; import classNames from "classnames"; import { groupBy, has, uniq } from "lodash"; -import { DealGroupView } from "../DealGroupView/DealGroupView.tsx"; -import CreateDealsFromFileButton from "../CreateDealsFromFileButton/CreateDealsFromFileButton.tsx"; -import DragState from "../../../../pages/DealsPage/enums/DragState.ts"; +import { CardGroupView } from "../CardGroupView/CardGroupView.tsx"; +import CreateDealsFromFileButton from "../CreateCardsFromFileButton/CreateDealsFromFileButton.tsx"; +import DragState from "../../../../pages/CardsPage/enums/DragState.ts"; +import { useCardPageContext } from "../../../../pages/CardsPage/contexts/CardPageContext.tsx"; +import isModuleInProject, { Modules } from "../../../../pages/CardsPage/utils/isModuleInProject.ts"; type Props = { status: StatusSchema; withCreateButton?: boolean; - summaries: DealSummary[]; + summaries: CardSummary[]; dragState: DragState; }; -type GroupWithDeals = { group: DealGroupSchema, deals: DealSummary[] } +type GroupWithCards = { group: CardGroupSchema, cards: CardSummary[] } -export const DealsDndColumn: FC = ({ +export const CardsDndColumn: FC = ({ status, summaries, dragState, withCreateButton = false, }) => { + const { selectedProject } = useCardPageContext(); + const isCreatingDealFromFileEnabled = isModuleInProject(Modules.SERVICES_AND_PRODUCTS, selectedProject); const isDropDisabled = dragState === DragState.DRAG_STATUS; const droppableId = status.id.toString(); - const isGroup = (obj: GroupWithDeals | DealSummary): obj is GroupWithDeals => { - return has(obj, "deals"); + const isGroup = (obj: GroupWithCards | CardSummary): obj is GroupWithCards => { + return has(obj, "cards"); }; - const getDealGroups = (): GroupWithDeals[] => { - const groups = uniq(summaries.filter(s => s.group).map(summary => summary.group) as DealGroupSchema[]); + const getDealGroups = (): GroupWithCards[] => { + const groups = uniq(summaries.filter(s => s.group).map(summary => summary.group) as CardGroupSchema[]); if (groups.length === 0) return []; const groupedSummaries = groupBy(summaries, "group.id"); const groupDict = groups.reduce((acc, group) => { acc[group.id] = group; return acc; } - , {} as { [key: number]: DealGroupSchema }); - return Object.entries(groupedSummaries).reduce((acc, [groupId, deals]) => { + , {} as { [key: number]: CardGroupSchema }); + return Object.entries(groupedSummaries).reduce((acc, [groupId, cards]) => { if (!groupId) return acc; const group = groupDict[parseInt(groupId)]; if (!group) return acc; acc.push({ group, - deals, + cards, }); return acc; - }, [] as { group: DealGroupSchema; deals: DealSummary[] }[]); + }, [] as { group: CardGroupSchema; cards: CardSummary[] }[]); }; - const getDateFromDealOrGroup = (obj: GroupWithDeals | DealSummary) => { - // if is group get group with the delivery earliest date - if (isGroup(obj)) { - const dates = obj.deals.map(d => d.deliveryDate || d.createdAt).filter(Boolean); - if (dates.length === 0) return null; - return new Date(Math.min(...dates.map(d => { - return new Date(d).getTime(); - }))); - } - // if is deal get deal delivery date - return new Date(obj.deliveryDate || obj.createdAt); - }; - - const getDealsAndGroups = (): (GroupWithDeals | DealSummary)[] => { + const getDealsAndGroups = (): (GroupWithCards | CardSummary)[] => { const groups = getDealGroups(); - const deals = summaries.filter(s => !s.group); - const dealsWithDeliveryDate = deals.filter(d => d.deliveryDate).sort((a, b) => { - if (!a.deliveryDate || !b.deliveryDate) return 0; - return new Date(a.deliveryDate).getTime() - new Date(b.deliveryDate).getTime(); - }); - const dealsWithoutDeliveryDate = deals.filter(d => !d.deliveryDate).sort((a, b) => { + const cards = summaries.filter(s => !s.group).sort((a, b) => { return new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime(); }); - const groupsWithDeliveryDate = groups.filter(g => g.deals.some(d => d.deliveryDate)); - const groupsWithoutDeliveryDate = groups.filter(g => g.deals.every(d => !d.deliveryDate)); - const firstRankData = [...dealsWithDeliveryDate, ...groupsWithDeliveryDate].sort((a, b) => { - const aDate = getDateFromDealOrGroup(a); - const bDate = getDateFromDealOrGroup(b); - if (!aDate || !bDate) return 0; - return aDate.getTime() - bDate.getTime(); - }); - const secondRankData = [...dealsWithoutDeliveryDate, ...groupsWithoutDeliveryDate].sort((a, b) => { - const aDate = getDateFromDealOrGroup(a); - const bDate = getDateFromDealOrGroup(b); - if (!aDate || !bDate) return 0; - return aDate.getTime() - bDate.getTime(); - }); - return [...firstRankData, ...secondRankData].map((obj, index) => { + return [...cards, ...groups].map((obj, index) => { if (isGroup(obj)) { - obj.deals[0].rank = index; + obj.cards[0].rank = index; return obj; } obj.rank = index; return obj; - }) as (GroupWithDeals | DealSummary)[]; + }) as (GroupWithCards | CardSummary)[]; }; - const renderDeal = (deal: DealSummary) => { + const renderCard = (card: CardSummary) => { return ( + draggableId={card.id.toString()} + index={card.rank} + key={card.id}> {(provided, snapshot) => (
= ({ color: snapshot.combineWith ? "red" : "black", }} > - +
- )}
); }; - const renderGroup = (obj: GroupWithDeals) => { - const { deals, group } = obj; + const renderGroup = (obj: GroupWithCards) => { + const { cards, group } = obj; return ( {(provided) => ( @@ -142,8 +111,8 @@ export const DealsDndColumn: FC = ({ {...provided.dragHandleProps} ref={provided.innerRef} > - @@ -168,15 +137,18 @@ export const DealsDndColumn: FC = ({ {...provided.droppableProps}> {withCreateButton && ( <> - - + + { + isCreatingDealFromFileEnabled && + () + } )} {getDealsAndGroups().map(obj => { if (isGroup(obj)) { return renderGroup(obj); } - return renderDeal(obj); + return renderCard(obj); })} {provided.placeholder} @@ -185,5 +157,5 @@ export const DealsDndColumn: FC = ({ ); }; -export default DealsDndColumn; +export default CardsDndColumn; diff --git a/src/components/Dnd/Deals/DealsDndColumn/DealsDndColumn.module.css b/src/components/Dnd/Cards/CardsDndColumn/DealsDndColumn.module.css similarity index 100% rename from src/components/Dnd/Deals/DealsDndColumn/DealsDndColumn.module.css rename to src/components/Dnd/Cards/CardsDndColumn/DealsDndColumn.module.css diff --git a/src/components/Dnd/Deals/DealsDndColumn/hooks/useDealsDnd.tsx b/src/components/Dnd/Cards/CardsDndColumn/hooks/useCardsDnd.tsx similarity index 81% rename from src/components/Dnd/Deals/DealsDndColumn/hooks/useDealsDnd.tsx rename to src/components/Dnd/Cards/CardsDndColumn/hooks/useCardsDnd.tsx index d5763f1..ed5bd03 100644 --- a/src/components/Dnd/Deals/DealsDndColumn/hooks/useDealsDnd.tsx +++ b/src/components/Dnd/Cards/CardsDndColumn/hooks/useCardsDnd.tsx @@ -2,17 +2,17 @@ import { modals } from "@mantine/modals"; import { Flex } from "@mantine/core"; import { DropResult } from "@hello-pangea/dnd"; import { useEffect, useState } from "react"; -import { DealGroupService, DealService, DealSummary, DealSummaryReorderRequest } from "../../../../../client"; +import { CardGroupService, CardService, CardSummary, CardSummaryReorderRequest } from "../../../../../client"; import { notifications } from "../../../../../shared/lib/notifications.ts"; import { dateWithoutTimezone } from "../../../../../shared/lib/date.ts"; type Props = { - summariesRaw: DealSummary[]; + summariesRaw: CardSummary[]; refetchSummaries: () => void; } -const useDealsDnd = ({ +const useCardsDnd = ({ summariesRaw, refetchSummaries, }: Props) => { @@ -22,18 +22,18 @@ const useDealsDnd = ({ setSummaries(summariesRaw); }, [summariesRaw]); - const recalculate = async (dealId: number) => { - return DealService.recalculateDealPrice({ + const recalculate = async (cardId: number) => { + return CardService.recalculateCardPrice({ requestBody: { - dealId: dealId, + cardId, }, }).then(({ ok, message }) => { notifications.guess(ok, { message }); }); }; - const onDelete = (dealId: number) => { - const summary = summaries.find(summary => summary.id == dealId); + const onDelete = (cardId: number) => { + const summary = summaries.find(summary => summary.id == cardId); if (!summary) return; modals.openConfirmModal({ title: "Удаление сделки", @@ -43,8 +43,8 @@ const useDealsDnd = ({ ), onConfirm: () => { - DealService.deleteDeal({ - requestBody: { dealId: dealId }, + CardService.deleteCard({ + requestBody: { cardId }, }).then(async ({ ok, message }) => { notifications.guess(ok, { message }); if (!ok) return; @@ -58,8 +58,8 @@ const useDealsDnd = ({ }); }; - const onSuccess = (dealId: number) => { - const summary = summaries.find(summary => summary.id == dealId); + const onSuccess = (cardId: number) => { + const summary = summaries.find(summary => summary.id == cardId); if (!summary) return; modals.openConfirmModal({ title: "Завершение сделки", @@ -69,8 +69,8 @@ const useDealsDnd = ({ ), onConfirm: () => { - DealService.completeDeal({ - requestBody: { dealId: dealId }, + CardService.completeCard({ + requestBody: { cardId }, }).then(async ({ ok, message }) => { notifications.guess(ok, { message }); if (!ok) return; @@ -91,9 +91,9 @@ const useDealsDnd = ({ const sourceId = parseInt(source); if (destination.includes("group")) { const groupId = parseInt(destination.split("-")[1]); - DealGroupService.addDeal({ + CardGroupService.addCard({ requestBody: { - dealId: sourceId, + cardId: sourceId, groupId: groupId, }, }).then(async response => { @@ -108,10 +108,10 @@ const useDealsDnd = ({ } else { const destinationId = parseInt(destination); // creating new group - DealGroupService.createDealGroup({ + CardGroupService.createCardGroup({ requestBody: { - draggingDealId: sourceId, - hoveredDealId: destinationId, + draggingCardId: sourceId, + hoveredCardId: destinationId, }, }).then(async response => { if (!response.ok) { @@ -130,7 +130,7 @@ const useDealsDnd = ({ const destination = result.destination?.droppableId; if (!destination) return; const statusId = parseInt(destination); - DealGroupService.changeStatus({ + CardGroupService.changeStatus({ requestBody: { groupId: groupId, newStatus: statusId, @@ -152,37 +152,37 @@ const useDealsDnd = ({ // If there is no changes if (!result.destination || result.destination == result.source) return; - // Checking for valid dealId + // Checking for valid cardId if (result.draggableId.includes("group")) { return moveGroup(result); } - const dealId = parseInt(result.draggableId); - if (isNaN(dealId)) return; + const cardId = parseInt(result.draggableId); + if (isNaN(cardId)) return; - // Checking for valid deal - const summary = summaries.find(summary => summary.id == dealId); + // Checking for valid card + const summary = summaries.find(summary => summary.id == cardId); if (!summary) return; // Checking if it is custom actions const droppableId = result.destination.droppableId; if (droppableId === "DELETE") { - onDelete(dealId); + onDelete(cardId); return; } if (droppableId === "SUCCESS") { - onSuccess(dealId); + onSuccess(cardId); return; } const statusId = Number.parseInt(droppableId); - const request: Partial = { - dealId, + const request: Partial = { + cardId, index: result.destination.index, statusId, }; if (statusId == summary.status.id) { - DealService.reorderDealSummaries({ - requestBody: request as DealSummaryReorderRequest, + CardService.reorderCardSummaries({ + requestBody: request as CardSummaryReorderRequest, }).then(async response => { setSummaries(response.summaries); await refetchSummaries(); @@ -190,9 +190,9 @@ const useDealsDnd = ({ return; } - DealService.reorderDealSummaries({ + CardService.reorderCardSummaries({ requestBody: { - dealId, + cardId, statusId, index: result.destination.index, comment: "", @@ -210,4 +210,4 @@ const useDealsDnd = ({ }; }; -export default useDealsDnd; +export default useCardsDnd; diff --git a/src/components/Dnd/Deals/DealsDndColumn/utils/getColumnColor.ts b/src/components/Dnd/Cards/CardsDndColumn/utils/getColumnColor.ts similarity index 100% rename from src/components/Dnd/Deals/DealsDndColumn/utils/getColumnColor.ts rename to src/components/Dnd/Cards/CardsDndColumn/utils/getColumnColor.ts diff --git a/src/components/Dnd/Deals/DealsDndFooter/DealsDndFooter.tsx b/src/components/Dnd/Cards/CardsDndFooter/CardsDndFooter.tsx similarity index 91% rename from src/components/Dnd/Deals/DealsDndFooter/DealsDndFooter.tsx rename to src/components/Dnd/Cards/CardsDndFooter/CardsDndFooter.tsx index 6f8ff3c..6e32dff 100644 --- a/src/components/Dnd/Deals/DealsDndFooter/DealsDndFooter.tsx +++ b/src/components/Dnd/Cards/CardsDndFooter/CardsDndFooter.tsx @@ -1,14 +1,14 @@ import { Flex, rem } from "@mantine/core"; import classNames from "classnames"; -import styles from "../../../../pages/DealsPage/ui/DealsPage.module.css"; +import styles from "../../../../pages/CardsPage/ui/CardsPage.module.css"; import { Droppable } from "@hello-pangea/dnd"; -import DragState from "../../../../pages/DealsPage/enums/DragState.ts"; +import DragState from "../../../../pages/CardsPage/enums/DragState.ts"; type Props = { dragState: DragState; } -const DealsDndFooter = ({ dragState }: Props) => { +const CardsDndFooter = ({ dragState }: Props) => { const isDealDragEnded = dragState === DragState.DRAG_ENDED; return ( @@ -63,4 +63,4 @@ const DealsDndFooter = ({ dragState }: Props) => { ); }; -export default DealsDndFooter; +export default CardsDndFooter; diff --git a/src/components/Dnd/Deals/CreateDealButton/CreateDealButton.tsx b/src/components/Dnd/Cards/CreateCardButton/CreateCardButton.tsx similarity index 63% rename from src/components/Dnd/Deals/CreateDealButton/CreateDealButton.tsx rename to src/components/Dnd/Cards/CreateCardButton/CreateCardButton.tsx index 8c4eec1..bd9aa7e 100644 --- a/src/components/Dnd/Deals/CreateDealButton/CreateDealButton.tsx +++ b/src/components/Dnd/Cards/CreateCardButton/CreateCardButton.tsx @@ -2,21 +2,26 @@ import { useState } from "react"; import styles from "./CreateDealButton.module.css"; import { Text, Transition } from "@mantine/core"; -import CreateDealFrom from "../CreateDealForm/CreateDealFrom.tsx"; -import { DealService, StatusSchema } from "../../../../client"; +import CreateCardForm from "../CreateCardForm/CreateCardForm.tsx"; +import { CardService, StatusSchema } from "../../../../client"; import { useQueryClient } from "@tanstack/react-query"; import { dateWithoutTimezone } from "../../../../shared/lib/date.ts"; -import { usePrefillDealContext } from "../../../../pages/DealsPage/contexts/PrefillDealContext.tsx"; +import { usePrefillCardContext } from "../../../../pages/CardsPage/contexts/PrefillCardContext.tsx"; +import { useCardPageContext } from "../../../../pages/CardsPage/contexts/CardPageContext.tsx"; +import isModuleInProject, { Modules } from "../../../../pages/CardsPage/utils/isModuleInProject.ts"; type Props = { status: StatusSchema; } -const CreateDealButton = ({ status }: Props) => { +const CreateCardButton = ({ status }: Props) => { const [isCreating, setIsCreating] = useState(false); const [isTransitionEnded, setIsTransitionEnded] = useState(true); const queryClient = useQueryClient(); - const { prefillDeal, setPrefillDeal } = usePrefillDealContext(); + const { prefillCard, setPrefillCard } = usePrefillCardContext(); + + const { selectedProject } = useCardPageContext(); + const isPrefillingDealEnabled = isModuleInProject(Modules.SERVICES_AND_PRODUCTS, selectedProject); return (
{ onExited={() => setIsTransitionEnded(true)}> {styles => (
- { - setPrefillDeal(undefined); + setPrefillCard(undefined); setIsCreating(false); }} onSubmit={quickDeal => { - DealService.quickCreateDealQuickCreatePost({ + CardService.quickCreateCardQuickCreatePost({ requestBody: { ...quickDeal, acceptanceDate: dateWithoutTimezone( @@ -50,19 +55,19 @@ const CreateDealButton = ({ status }: Props) => { statusId: status.id, }, }).then(async (result) => { - if (prefillDeal) { - DealService.prefillDeal({ + if (isPrefillingDealEnabled && prefillCard) { + CardService.prefillCard({ requestBody: { - oldDealId: prefillDeal.id, - newDealId: result.dealId, + oldCardId: prefillCard.id, + newCardId: result.cardId, }, }); } await queryClient.invalidateQueries({ - queryKey: ["getDealSummaries"], + queryKey: ["getCardSummaries"], }); setIsCreating(false); - setPrefillDeal(undefined); + setPrefillCard(undefined); }); }} /> @@ -72,4 +77,4 @@ const CreateDealButton = ({ status }: Props) => {
); }; -export default CreateDealButton; +export default CreateCardButton; diff --git a/src/components/Dnd/Deals/CreateDealButton/CreateDealButton.module.css b/src/components/Dnd/Cards/CreateCardButton/CreateDealButton.module.css similarity index 100% rename from src/components/Dnd/Deals/CreateDealButton/CreateDealButton.module.css rename to src/components/Dnd/Cards/CreateCardButton/CreateDealButton.module.css diff --git a/src/components/Dnd/Deals/CreateDealForm/CreateDealFrom.tsx b/src/components/Dnd/Cards/CreateCardForm/CreateCardForm.tsx similarity index 71% rename from src/components/Dnd/Deals/CreateDealForm/CreateDealFrom.tsx rename to src/components/Dnd/Cards/CreateCardForm/CreateCardForm.tsx index 780d8a8..2e42bc8 100644 --- a/src/components/Dnd/Deals/CreateDealForm/CreateDealFrom.tsx +++ b/src/components/Dnd/Cards/CreateCardForm/CreateCardForm.tsx @@ -1,5 +1,5 @@ import { Button, rem, Textarea, TextInput } from "@mantine/core"; -import { QuickDeal } from "../../../../types/QuickDeal.ts"; +import { QuickCard } from "../../../../types/QuickCard.ts"; import { FC } from "react"; import { useForm } from "@mantine/form"; import styles from "./CreateDealForm.module.css"; @@ -8,15 +8,21 @@ import { DateTimePicker } from "@mantine/dates"; import ShippingWarehouseAutocomplete from "../../../Selects/ShippingWarehouseAutocomplete/ShippingWarehouseAutocomplete.tsx"; import BaseMarketplaceSelect from "../../../Selects/BaseMarketplaceSelect/BaseMarketplaceSelect.tsx"; -import { usePrefillDealContext } from "../../../../pages/DealsPage/contexts/PrefillDealContext.tsx"; +import { usePrefillCardContext } from "../../../../pages/CardsPage/contexts/PrefillCardContext.tsx"; +import { useCardPageContext } from "../../../../pages/CardsPage/contexts/CardPageContext.tsx"; +import isModuleInProject, { Modules } from "../../../../pages/CardsPage/utils/isModuleInProject.ts"; type Props = { - onSubmit: (quickDeal: QuickDeal) => void; + onSubmit: (quickDeal: QuickCard) => void; onCancel: () => void; }; -const CreateDealFrom: FC = ({ onSubmit, onCancel }) => { - const { prefillOnOpen, prefillDeal } = usePrefillDealContext(); - const form = useForm({ + +const CreateCardForm: FC = ({ onSubmit, onCancel }) => { + const { selectedProject } = useCardPageContext(); + const isPrefillingDealEnabled = isModuleInProject(Modules.SERVICES_AND_PRODUCTS, selectedProject); + + const { prefillOnOpen, prefillCard } = usePrefillCardContext(); + const form = useForm({ initialValues: { name: "", clientName: "", @@ -32,7 +38,7 @@ const CreateDealFrom: FC = ({ onSubmit, onCancel }) => { }, }); - const prefillButtonLabel = prefillDeal ? `Предзаполнено [ID: ${prefillDeal.id}]` : "Предзаполнить"; + const prefillButtonLabel = prefillCard ? `Предзаполнено [ID: ${prefillCard.id}]` : "Предзаполнить"; return (
= ({ onSubmit, onCancel }) => { {...form.getInputProps("acceptanceDate")} />
-
- -
+ {isPrefillingDealEnabled && ( +
+ +
+ )}
), - } as MRT_TableOptions + } as MRT_TableOptions } /> ); diff --git a/src/pages/DealsPage/components/DealProductsTable/columns.tsx b/src/pages/CardsPage/components/DealProductsTable/columns.tsx similarity index 94% rename from src/pages/DealsPage/components/DealProductsTable/columns.tsx rename to src/pages/CardsPage/components/DealProductsTable/columns.tsx index 747175b..dbc6594 100644 --- a/src/pages/DealsPage/components/DealProductsTable/columns.tsx +++ b/src/pages/CardsPage/components/DealProductsTable/columns.tsx @@ -1,11 +1,11 @@ import { useMemo } from "react"; import { MRT_ColumnDef } from "mantine-react-table"; -import { DealProductSchema } from "../../../../client"; +import { CardProductSchema } from "../../../../client"; import { List } from "@mantine/core"; type Props = { - onChange: (product: DealProductSchema, quantity: number) => void; - data: DealProductSchema[]; + onChange: (product: CardProductSchema, quantity: number) => void; + data: CardProductSchema[]; }; const useDealProductsTableColumns = (props: Props) => { const { onChange, data } = props; @@ -27,7 +27,7 @@ const useDealProductsTableColumns = (props: Props) => { ), [data] ); - return useMemo[]>( + return useMemo[]>( () => [ { accessorKey: "product.article", diff --git a/src/pages/DealsPage/components/DealServicesTable/DealServicesTable.tsx b/src/pages/CardsPage/components/DealServicesTable/DealServicesTable.tsx similarity index 91% rename from src/pages/DealsPage/components/DealServicesTable/DealServicesTable.tsx rename to src/pages/CardsPage/components/DealServicesTable/DealServicesTable.tsx index c2a3c66..7f3d096 100644 --- a/src/pages/DealsPage/components/DealServicesTable/DealServicesTable.tsx +++ b/src/pages/CardsPage/components/DealServicesTable/DealServicesTable.tsx @@ -1,7 +1,7 @@ import { FC } from "react"; import { useDealServicesTableColumns } from "./columns.tsx"; import { BaseTable } from "../../../../components/BaseTable/BaseTable.tsx"; -import { DealServiceSchema } from "../../../../client"; +import { CardServiceSchema } from "../../../../client"; import { CRUDTableProps } from "../../../../types/CRUDTable.tsx"; import { MRT_TableOptions } from "mantine-react-table"; import { ActionIcon, Button, Flex, rem, Tooltip } from "@mantine/core"; @@ -9,9 +9,9 @@ import { openContextModal } from "@mantine/modals"; import { IconEdit, IconTrash } from "@tabler/icons-react"; type RestProps = { - onMultipleDelete?: (items: DealServiceSchema[]) => void; + onMultipleDelete?: (items: CardServiceSchema[]) => void; }; -type Props = CRUDTableProps & RestProps; +type Props = CRUDTableProps & RestProps; const DealServicesTable: FC = ({ items, onChange, @@ -30,18 +30,18 @@ const DealServicesTable: FC = ({ if (!onCreate) return; openContextModal({ title: "Добавление услуги", - modal: "addDealService", + modal: "addCardService", innerProps: { - onCreate: event => onCreate(event as DealServiceSchema), + onCreate: event => onCreate(event as CardServiceSchema), serviceIds, }, }); }; - const onEditClick = (service: DealServiceSchema) => { + const onEditClick = (service: CardServiceSchema) => { if (!onChange) return; openContextModal({ title: "Добавление услуги", - modal: "addDealService", + modal: "addCardService", innerProps: { element: service, onChange, @@ -119,7 +119,7 @@ const DealServicesTable: FC = ({ ), - } as MRT_TableOptions + } as MRT_TableOptions } /> diff --git a/src/pages/DealsPage/components/DealServicesTable/columns.tsx b/src/pages/CardsPage/components/DealServicesTable/columns.tsx similarity index 93% rename from src/pages/DealsPage/components/DealServicesTable/columns.tsx rename to src/pages/CardsPage/components/DealServicesTable/columns.tsx index 560bb22..f118dfa 100644 --- a/src/pages/DealsPage/components/DealServicesTable/columns.tsx +++ b/src/pages/CardsPage/components/DealServicesTable/columns.tsx @@ -1,9 +1,9 @@ import { MRT_ColumnDef } from "mantine-react-table"; import { useMemo } from "react"; -import { DealServiceSchema } from "../../../../client"; +import { CardServiceSchema } from "../../../../client"; type Props = { - data: DealServiceSchema[]; + data: CardServiceSchema[]; }; export const useDealServicesTableColumns = (props: Props) => { @@ -13,7 +13,7 @@ export const useDealServicesTableColumns = (props: Props) => { [data] ); - return useMemo[]>( + return useMemo[]>( () => [ { accessorKey: "service.category", diff --git a/src/pages/DealsPage/components/DealStatusChangeTable/DealStatusChangeTable.tsx b/src/pages/CardsPage/components/DealStatusChangeTable/CardStatusChangeTable.tsx similarity index 77% rename from src/pages/DealsPage/components/DealStatusChangeTable/DealStatusChangeTable.tsx rename to src/pages/CardsPage/components/DealStatusChangeTable/CardStatusChangeTable.tsx index 7cbd55e..f199082 100644 --- a/src/pages/DealsPage/components/DealStatusChangeTable/DealStatusChangeTable.tsx +++ b/src/pages/CardsPage/components/DealStatusChangeTable/CardStatusChangeTable.tsx @@ -1,13 +1,13 @@ -import { DealStatusHistorySchema } from "../../../../client"; +import { CardStatusHistorySchema } from "../../../../client"; import { useDealStatusChangeTableColumns } from "./columns.tsx"; import { BaseTable } from "../../../../components/BaseTable/BaseTable.tsx"; import { FC } from "react"; type Props = { - items: DealStatusHistorySchema[]; + items: CardStatusHistorySchema[]; }; -const DealStatusChangeTable: FC = (props: Props) => { +const CardStatusChangeTable: FC = (props: Props) => { const { items } = props; return ( @@ -26,4 +26,4 @@ const DealStatusChangeTable: FC = (props: Props) => { /> ); }; -export default DealStatusChangeTable; +export default CardStatusChangeTable; diff --git a/src/pages/DealsPage/components/DealStatusChangeTable/columns.tsx b/src/pages/CardsPage/components/DealStatusChangeTable/columns.tsx similarity index 93% rename from src/pages/DealsPage/components/DealStatusChangeTable/columns.tsx rename to src/pages/CardsPage/components/DealStatusChangeTable/columns.tsx index 11b09ad..46c8ce2 100644 --- a/src/pages/DealsPage/components/DealStatusChangeTable/columns.tsx +++ b/src/pages/CardsPage/components/DealStatusChangeTable/columns.tsx @@ -1,10 +1,10 @@ import { useMemo } from "react"; import { MRT_ColumnDef } from "mantine-react-table"; -import { DealStatusHistorySchema } from "../../../../client"; +import { CardStatusHistorySchema } from "../../../../client"; import { Spoiler, Text } from "@mantine/core"; export const useDealStatusChangeTableColumns = () => { - return useMemo[]>( + return useMemo[]>( () => [ { accessorKey: "changedAt", diff --git a/src/pages/DealsPage/components/DealsTable/DealsTable.tsx b/src/pages/CardsPage/components/DealsTable/CardsTable.tsx similarity index 71% rename from src/pages/DealsPage/components/DealsTable/DealsTable.tsx rename to src/pages/CardsPage/components/DealsTable/CardsTable.tsx index b3d9d81..a86f85d 100644 --- a/src/pages/DealsPage/components/DealsTable/DealsTable.tsx +++ b/src/pages/CardsPage/components/DealsTable/CardsTable.tsx @@ -1,24 +1,24 @@ import { CRUDTableProps } from "../../../../types/CRUDTable.tsx"; -import { DealService, DealSummary } from "../../../../client"; +import { CardService, CardSummary } from "../../../../client"; import { FC } from "react"; -import useDealsTableColumns from "./columns.tsx"; +import useCardsTableColumns from "./columns.tsx"; import { BaseTable } from "../../../../components/BaseTable/BaseTable.tsx"; import { ActionIcon, Flex, Tooltip } from "@mantine/core"; import { IconEdit } from "@tabler/icons-react"; import { MRT_TableOptions } from "mantine-react-table"; -import { useDealPageContext } from "../../contexts/DealPageContext.tsx"; +import { useCardPageContext } from "../../contexts/CardPageContext.tsx"; type RestProps = { viewOnly?: boolean; }; -type Props = CRUDTableProps & RestProps; +type Props = CRUDTableProps & RestProps; -const DealsTable: FC = ({ items, onSelectionChange, viewOnly = false }) => { - const columns = useDealsTableColumns(); - const { setSelectedDeal } = useDealPageContext(); - const onEditClick = (dealSummary: DealSummary) => { - DealService.getDealById({ dealId: dealSummary.id }).then(deal => { - setSelectedDeal(deal); +const CardsTable: FC = ({ items, onSelectionChange, viewOnly = false }) => { + const columns = useCardsTableColumns(); + const { setSelectedCard } = useCardPageContext(); + const onEditClick = (cardSummary: CardSummary) => { + CardService.getCardById({ cardId: cardSummary.id }).then(card => { + setSelectedCard(card); }); }; @@ -48,10 +48,10 @@ const DealsTable: FC = ({ items, onSelectionChange, viewOnly = false }) = ), - } as MRT_TableOptions + } as MRT_TableOptions } /> ); }; -export default DealsTable; +export default CardsTable; diff --git a/src/pages/DealsPage/components/DealsTable/columns.tsx b/src/pages/CardsPage/components/DealsTable/columns.tsx similarity index 90% rename from src/pages/DealsPage/components/DealsTable/columns.tsx rename to src/pages/CardsPage/components/DealsTable/columns.tsx index 29e8917..4335327 100644 --- a/src/pages/DealsPage/components/DealsTable/columns.tsx +++ b/src/pages/CardsPage/components/DealsTable/columns.tsx @@ -1,10 +1,10 @@ import { useMemo } from "react"; import { MRT_ColumnDef } from "mantine-react-table"; -import { DealSummary } from "../../../../client"; +import { CardSummary } from "../../../../client"; import { ActionIcon, Image } from "@mantine/core"; -const useDealsTableColumns = () => { - return useMemo[]>( +const useCardsTableColumns = () => { + return useMemo[]>( () => [ { accessorKey: "id", @@ -53,4 +53,4 @@ const useDealsTableColumns = () => { ); }; -export default useDealsTableColumns; +export default useCardsTableColumns; diff --git a/src/pages/DealsPage/components/LeadsPageHeader/LeadsPageHeader.tsx b/src/pages/CardsPage/components/LeadsPageHeader/LeadsPageHeader.tsx similarity index 94% rename from src/pages/DealsPage/components/LeadsPageHeader/LeadsPageHeader.tsx rename to src/pages/CardsPage/components/LeadsPageHeader/LeadsPageHeader.tsx index 7b6166c..8c76ea1 100644 --- a/src/pages/DealsPage/components/LeadsPageHeader/LeadsPageHeader.tsx +++ b/src/pages/CardsPage/components/LeadsPageHeader/LeadsPageHeader.tsx @@ -1,21 +1,21 @@ import { ActionIcon, Flex, rem, Text } from "@mantine/core"; import { IconEdit, IconMenu2, IconMenuDeep } from "@tabler/icons-react"; import { motion } from "framer-motion"; -import styles from "../../ui/DealsPage.module.css"; +import styles from "../../ui/CardsPage.module.css"; import PageBlock from "../../../../components/PageBlock/PageBlock.tsx"; import DisplayMode from "../../enums/DisplayMode.ts"; import { UseFormReturnType } from "@mantine/form"; -import { DealsPageState } from "../../hooks/useDealsPageState.tsx"; +import { CardsPageState } from "../../hooks/useCardsPageState.tsx"; import React from "react"; import { ProjectSchema } from "../../../../client"; import { modals } from "@mantine/modals"; import ObjectSelect from "../../../../components/ObjectSelect/ObjectSelect.tsx"; -import DealsTableFiltersModal from "../../modals/DealsTableFiltersModal.tsx"; +import CardsTableFiltersModal from "../../modals/CardsTableFiltersModal.tsx"; type Props = { displayMode: DisplayMode; setDisplayMode: React.Dispatch>; - form: UseFormReturnType; + form: UseFormReturnType; projects: ProjectSchema[]; refetchProjects: () => void; } @@ -66,7 +66,7 @@ const LeadsPageHeader = ({ display: displayMode === DisplayMode.TABLE ? "flex" : "none", }} > - diff --git a/src/pages/DealsPage/components/SimpleUsersTable/SimpleUsersTable.tsx b/src/pages/CardsPage/components/SimpleUsersTable/SimpleUsersTable.tsx similarity index 100% rename from src/pages/DealsPage/components/SimpleUsersTable/SimpleUsersTable.tsx rename to src/pages/CardsPage/components/SimpleUsersTable/SimpleUsersTable.tsx diff --git a/src/pages/DealsPage/components/SimpleUsersTable/columns.tsx b/src/pages/CardsPage/components/SimpleUsersTable/columns.tsx similarity index 100% rename from src/pages/DealsPage/components/SimpleUsersTable/columns.tsx rename to src/pages/CardsPage/components/SimpleUsersTable/columns.tsx diff --git a/src/pages/CardsPage/contexts/CardPageContext.tsx b/src/pages/CardsPage/contexts/CardPageContext.tsx new file mode 100644 index 0000000..480b454 --- /dev/null +++ b/src/pages/CardsPage/contexts/CardPageContext.tsx @@ -0,0 +1,75 @@ +import React, { createContext, FC, useContext, useEffect, useState } from "react"; +import { CardSchema, CardService, ProjectSchema } from "../../../client"; + +type CardPageContextState = { + selectedCard?: CardSchema; + setSelectedCard: (card: CardSchema | undefined) => void; + refetchCards: () => Promise; + refetchCard: () => void; + selectedProject?: ProjectSchema | null; +}; + +const CardPageContext = createContext( + undefined, +); + +type CardPageContextStateProps = { + refetchCards: () => Promise; + defaultCardId?: number; + selectedProject?: ProjectSchema | null; +} + +const useCardPageContextState = (props: CardPageContextStateProps) => { + const { refetchCards, defaultCardId } = props; + const [selectedCard, setSelectedCard] = useState( + undefined, + ); + + const refetchCard = () => { + const cardId = selectedCard?.id ?? defaultCardId; + if (!cardId) return; + + CardService.getCardById({ cardId }).then(card => { + setSelectedCard(card); + }); + }; + + useEffect(() => { + refetchCard(); + }, []); + + return { + selectedCard, + setSelectedCard, + selectedProject: props.selectedProject, + refetchCards, + refetchCard, + }; +}; + +type CardPageContextProviderProps = { + children: React.ReactNode; +} & CardPageContextStateProps; + +export const CardPageContextProvider: FC = ({ + children, + ...props + }) => { + const state = useCardPageContextState(props); + + return ( + + {children} + + ); +}; + +export const useCardPageContext = () => { + const context = useContext(CardPageContext); + if (!context) { + throw new Error( + "useCardPageContext must be used within a CardPageContextProvider", + ); + } + return context; +}; diff --git a/src/pages/CardsPage/contexts/PrefillCardContext.tsx b/src/pages/CardsPage/contexts/PrefillCardContext.tsx new file mode 100644 index 0000000..ead247f --- /dev/null +++ b/src/pages/CardsPage/contexts/PrefillCardContext.tsx @@ -0,0 +1,71 @@ +import { createContext, Dispatch, FC, SetStateAction, useContext, useState } from "react"; +import { CardSchema, CardService } from "../../../client"; +import { useDisclosure } from "@mantine/hooks"; + +type PrefillCardContextState = { + prefillOpened: boolean; + prefillOnClose: () => void; + prefillOnOpen: () => void; + + selectedPrefillCard?: CardSchema; + selectPrefillCard: (cardId: number) => void; + prefillCard?: CardSchema; + setPrefillCard: Dispatch>; +}; + +const PrefillCardContext = createContext( + undefined +); +const usePrefillCardContextState = () => { + const [selectedPrefillCard, setSelectedPrefillCard] = useState( + undefined, + ); + const [prefillCard, setPrefillCard] = useState( + undefined, + ); + const [prefillOpened, { open, close }] = useDisclosure(false); + const prefillOnClose = close; + const prefillOnOpen = open; + + const selectPrefillCard = (cardId: number) => { + CardService.getCardById({ cardId }).then(card => { + setSelectedPrefillCard(card); + }); + } + + return { + prefillOpened, + prefillOnClose, + prefillOnOpen, + + selectedPrefillCard, + selectPrefillCard, + prefillCard, + setPrefillCard, + }; +}; + +type PrefillCardContextProviderProps = { + children: React.ReactNode; +}; + +export const PrefillCardContextProvider: FC = ({ + children, + }) => { + const state = usePrefillCardContextState(); + return ( + + {children} + + ); +}; + +export const usePrefillCardContext = () => { + const context = useContext(PrefillCardContext); + if (!context) { + throw new Error( + "usePrefillCardContext must be used within a PrefillCardContextProvider" + ); + } + return context; +}; diff --git a/src/pages/DealsPage/contexts/PrefillDealsWithExcelContext.tsx b/src/pages/CardsPage/contexts/PrefillDealsWithExcelContext.tsx similarity index 73% rename from src/pages/DealsPage/contexts/PrefillDealsWithExcelContext.tsx rename to src/pages/CardsPage/contexts/PrefillDealsWithExcelContext.tsx index 0ec0e0c..c18df80 100644 --- a/src/pages/DealsPage/contexts/PrefillDealsWithExcelContext.tsx +++ b/src/pages/CardsPage/contexts/PrefillDealsWithExcelContext.tsx @@ -1,14 +1,14 @@ -import { createContext, FC, useContext, useState } from "react"; +import React, { createContext, FC, useContext, useState } from "react"; import { useDisclosure } from "@mantine/hooks"; -import { DealsWithExcelForm, ProductExcelData } from "../drawers/PrefillDealWithExcelDrawer/types.tsx"; +import { CardsWithExcelForm, ProductExcelData } from "../drawers/PrefillCardWithExcelDrawer/types.tsx"; import { FileWithPath } from "@mantine/dropzone"; import { notifications } from "../../../shared/lib/notifications.ts"; -import { DealService, type ProductFromExcelSchema, ProductSchema, StatusSchema } from "../../../client"; +import { CardService, type ProductFromExcelSchema, ProductSchema, StatusSchema } from "../../../client"; import UseExcelDropzone from "../../../types/UseExcelDropzone.tsx"; import { useForm, UseFormReturnType } from "@mantine/form"; -import { useDealPageContext } from "./DealPageContext.tsx"; +import { useCardPageContext } from "./CardPageContext.tsx"; -type PrefillDealsWithExcelContextState = { +type PrefillCardsWithExcelContextState = { prefillWithExcelOpened: boolean; prefillWithExcelOnClose: () => void; prefillWithExcelOnOpen: () => void; @@ -16,18 +16,18 @@ type PrefillDealsWithExcelContextState = { onProductSelectChange: (barcode: string, selectedProduct: ProductSchema) => void, onDrop: (files: FileWithPath[]) => void; excelDropzone: UseExcelDropzone; - createDeals: (values: DealsWithExcelForm, status: StatusSchema) => void; - form: UseFormReturnType; + createCards: (values: CardsWithExcelForm, status: StatusSchema) => void; + form: UseFormReturnType; errors: string[]; }; -const PrefillDealsWithExcelContext = createContext( +const PrefillCardsWithExcelContext = createContext( undefined, ); -const usePrefillDealsWithExcelContextState = () => { +const usePrefillCardsWithExcelContextState = () => { const [prefillWithExcelOpened, { open, close }] = useDisclosure(false); - const { refetchDeals } = useDealPageContext(); + const { refetchCards } = useCardPageContext(); const [isLoading, setIsLoading] = useState(false); const [errors, setErrors] = useState([]); const excelDropzone: UseExcelDropzone = { @@ -35,7 +35,7 @@ const usePrefillDealsWithExcelContextState = () => { setIsLoading, }; - const form = useForm({ + const form = useForm({ validate: { client: client => !client && "Выберите клиента", }, @@ -51,7 +51,7 @@ const usePrefillDealsWithExcelContextState = () => { const file = files[0]; setIsLoading(true); - DealService.parseDealsExcel({ + CardService.parseDealsExcel({ formData: { upload_file: file, }, @@ -91,7 +91,7 @@ const usePrefillDealsWithExcelContextState = () => { form.reset(); }; - const createDeals = (values: DealsWithExcelForm, status: StatusSchema) => { + const createCards = (values: CardsWithExcelForm, status: StatusSchema) => { const products: ProductFromExcelSchema[] = barcodeProductsMap.entries().map(([, productData]) => { return { productId: productData.selectedProduct!.id, @@ -99,7 +99,7 @@ const usePrefillDealsWithExcelContextState = () => { }; }).toArray(); - DealService.createDealsExcel({ + CardService.createDealsExcel({ requestBody: { products, clientId: values.client?.id ?? -1, @@ -109,7 +109,7 @@ const usePrefillDealsWithExcelContextState = () => { .then(({ ok, message }) => { notifications.guess(ok, { message }); if (ok) prefillWithExcelOnClose(); - refetchDeals(); + refetchCards(); }) .catch(err => console.log(err)); }; @@ -122,30 +122,30 @@ const usePrefillDealsWithExcelContextState = () => { onProductSelectChange, onDrop, excelDropzone, - createDeals, + createCards, form, errors, }; }; -type PrefillDealsWithExcelContextProviderProps = { +type PrefillCardsWithExcelContextProviderProps = { children: React.ReactNode; }; -export const PrefillDealsWithExcelContextProvider: FC = ({ children }) => { - const state = usePrefillDealsWithExcelContextState(); +export const PrefillCardsWithExcelContextProvider: FC = ({ children }) => { + const state = usePrefillCardsWithExcelContextState(); return ( - + {children} - + ); }; -export const usePrefillDealsWithExcelContext = () => { - const context = useContext(PrefillDealsWithExcelContext); +export const usePrefillCardsWithExcelContext = () => { + const context = useContext(PrefillCardsWithExcelContext); if (!context) { throw new Error( - "usePrefillDealsWithExcelContext must be used within a PrefillDealsWithExcelContextProvider", + "usePrefillCardsWithExcelContext must be used within a PrefillCardsWithExcelContextProvider", ); } return context; diff --git a/src/pages/DealsPage/drawers/DealEditDrawer/DealEditDrawer.module.css b/src/pages/CardsPage/drawers/CardEditDrawer/CardEditDrawer.module.css similarity index 100% rename from src/pages/DealsPage/drawers/DealEditDrawer/DealEditDrawer.module.css rename to src/pages/CardsPage/drawers/CardEditDrawer/CardEditDrawer.module.css diff --git a/src/pages/DealsPage/drawers/DealEditDrawer/DealEditDrawer.tsx b/src/pages/CardsPage/drawers/CardEditDrawer/CardEditDrawer.tsx similarity index 64% rename from src/pages/DealsPage/drawers/DealEditDrawer/DealEditDrawer.tsx rename to src/pages/CardsPage/drawers/CardEditDrawer/CardEditDrawer.tsx index ebe1990..ce7d450 100644 --- a/src/pages/DealsPage/drawers/DealEditDrawer/DealEditDrawer.tsx +++ b/src/pages/CardsPage/drawers/CardEditDrawer/CardEditDrawer.tsx @@ -1,43 +1,47 @@ import { Box, Drawer, rem, Tabs } from "@mantine/core"; import { FC, ReactNode, useEffect } from "react"; -import { useDealPageContext } from "../../contexts/DealPageContext.tsx"; +import { useCardPageContext } from "../../contexts/CardPageContext.tsx"; import { IconBox, IconCalendarUser, IconCubeSend, IconSettings, IconUser, IconUsersGroup } from "@tabler/icons-react"; -import DealStatusChangeTable from "../../components/DealStatusChangeTable/DealStatusChangeTable.tsx"; -import DealEditDrawerGeneralTab from "./tabs/DealEditDrawerGeneralTab.tsx"; +import CardStatusChangeTable from "../../components/DealStatusChangeTable/CardStatusChangeTable.tsx"; +import GeneralTab from "../../tabs/GeneralTab/GeneralTab.tsx"; import { useQueryClient } from "@tanstack/react-query"; import ProductAndServiceTab from "../../tabs/ProductAndServiceTab/ProductAndServiceTab.tsx"; import { motion } from "framer-motion"; import ShippingTab from "../../tabs/ShippingTab/ShippingTab.tsx"; import EmployeesTab from "../../tabs/EmployeesTab/EmployeesTab.tsx"; -import ClientTab from "./tabs/ClientTab.tsx"; +import ClientTab from "../../tabs/ClientTab/ClientTab.tsx"; -const useDealStatusChangeState = () => { - const { selectedDeal } = useDealPageContext(); +const useCardStatusChangeState = () => { + const { selectedCard } = useCardPageContext(); return { - statusHistory: selectedDeal?.statusHistory || [], + statusHistory: selectedCard?.statusHistory || [], }; }; -const DealEditDrawerStatusChangeTable = () => { - const { statusHistory } = useDealStatusChangeState(); +const CardEditDrawerStatusChangeTable = () => { + const { statusHistory } = useCardStatusChangeState(); - return ; + return ; }; const useDealEditDrawerState = () => { - const { selectedDeal, setSelectedDeal } = useDealPageContext(); + const { selectedCard, setSelectedCard } = useCardPageContext(); return { - isVisible: selectedDeal !== undefined, - onClose: () => setSelectedDeal(undefined), + isVisible: selectedCard !== undefined, + onClose: () => setSelectedCard(undefined), }; }; -const DealEditDrawer: FC = () => { +const CardEditDrawer: FC = () => { const { isVisible, onClose } = useDealEditDrawerState(); const queryClient = useQueryClient(); + + const { selectedCard } = useCardPageContext(); + const modules = new Set(selectedCard?.board.project.modules.map(module => module.key)); + useEffect(() => { if (isVisible) return; - queryClient.invalidateQueries({ queryKey: ["getDealSummaries"] }); + queryClient.invalidateQueries({ queryKey: ["getCardSummaries"] }); }, [isVisible]); const getTabPanel = (value: string, component: ReactNode) => { @@ -58,6 +62,18 @@ const DealEditDrawer: FC = () => { ); }; + const getTab = (key: string, icon: ReactNode, label: string) => { + if (!modules.has(key)) return; + + return ( + + {label} + + ); + }; + return ( { leftSection={}> История - }> - Товары и услуги - - }> - Отгрузка - - }> - Исполнители - + {getTab("servicesAndProducts", , "Товары и услуги")} + {getTab("shipment", , "Отгрузка")} + {getTab("employees", , "Исполнители")} - {getTabPanel("general", )} + + {getTabPanel("general", )} {getTabPanel("client", )} - {getTabPanel("history", )} + {getTabPanel("history", )} {getTabPanel("servicesAndProducts", )} {getTabPanel("shipment", )} {getTabPanel("employees", )} @@ -123,4 +128,4 @@ const DealEditDrawer: FC = () => { ); }; -export default DealEditDrawer; +export default CardEditDrawer; diff --git a/src/pages/DealsPage/drawers/DealPrefillDrawer/DealPrefillDrawer.module.css b/src/pages/CardsPage/drawers/CardPrefillDrawer/CardPrefillDrawer.module.css similarity index 100% rename from src/pages/DealsPage/drawers/DealPrefillDrawer/DealPrefillDrawer.module.css rename to src/pages/CardsPage/drawers/CardPrefillDrawer/CardPrefillDrawer.module.css diff --git a/src/pages/DealsPage/drawers/DealPrefillDrawer/DealPrefillDrawer.tsx b/src/pages/CardsPage/drawers/CardPrefillDrawer/CardPrefillDrawer.tsx similarity index 83% rename from src/pages/DealsPage/drawers/DealPrefillDrawer/DealPrefillDrawer.tsx rename to src/pages/CardsPage/drawers/CardPrefillDrawer/CardPrefillDrawer.tsx index 47a57f6..af82cbf 100644 --- a/src/pages/DealsPage/drawers/DealPrefillDrawer/DealPrefillDrawer.tsx +++ b/src/pages/CardsPage/drawers/CardPrefillDrawer/CardPrefillDrawer.tsx @@ -2,14 +2,14 @@ import { FC, useEffect } from "react"; import { Button, Drawer, Flex, rem, TextInput } from "@mantine/core"; import DealsTable from "./components/tables/DealsTable/DealsTable.tsx"; import Preview from "./components/Preview/Preview.tsx"; -import styles from "./DealPrefillDrawer.module.css"; +import styles from "./CardPrefillDrawer.module.css"; import BaseMarketplaceSelect from "../../../../components/Selects/BaseMarketplaceSelect/BaseMarketplaceSelect.tsx"; import usePrefillDeal from "./hooks/usePrefillDeal.tsx"; import { notifications } from "../../../../shared/lib/notifications.ts"; -import { usePrefillDealContext } from "../../contexts/PrefillDealContext.tsx"; +import { usePrefillCardContext } from "../../contexts/PrefillCardContext.tsx"; -const DealPrefillDrawer: FC = () => { - const { prefillOpened, prefillOnClose, selectedPrefillDeal, setPrefillDeal, prefillDeal } = usePrefillDealContext(); +const CardPrefillDrawer: FC = () => { + const { prefillOpened, prefillOnClose, selectedPrefillCard, setPrefillCard, prefillCard } = usePrefillCardContext(); const { data, form } = usePrefillDeal(); useEffect(() => { @@ -52,19 +52,19 @@ const DealPrefillDrawer: FC = () => { { - prefillDeal && + prefillCard &&