feat: projects and boards
This commit is contained in:
@@ -23,13 +23,17 @@ export type { BarcodeTemplateSchema } from './models/BarcodeTemplateSchema';
|
|||||||
export type { BarcodeTemplateSizeSchema } from './models/BarcodeTemplateSizeSchema';
|
export type { BarcodeTemplateSizeSchema } from './models/BarcodeTemplateSizeSchema';
|
||||||
export type { BarcodeTemplateUpdateRequest } from './models/BarcodeTemplateUpdateRequest';
|
export type { BarcodeTemplateUpdateRequest } from './models/BarcodeTemplateUpdateRequest';
|
||||||
export type { BarcodeTemplateUpdateResponse } from './models/BarcodeTemplateUpdateResponse';
|
export type { BarcodeTemplateUpdateResponse } from './models/BarcodeTemplateUpdateResponse';
|
||||||
|
export type { BaseBoardSchema } from './models/BaseBoardSchema';
|
||||||
export type { BaseEnumListSchema } from './models/BaseEnumListSchema';
|
export type { BaseEnumListSchema } from './models/BaseEnumListSchema';
|
||||||
export type { BaseEnumSchema } from './models/BaseEnumSchema';
|
export type { BaseEnumSchema } from './models/BaseEnumSchema';
|
||||||
export type { BaseMarketplaceSchema } from './models/BaseMarketplaceSchema';
|
export type { BaseMarketplaceSchema } from './models/BaseMarketplaceSchema';
|
||||||
|
export type { BaseProjectSchema } from './models/BaseProjectSchema';
|
||||||
export type { BaseShippingWarehouseSchema } from './models/BaseShippingWarehouseSchema';
|
export type { BaseShippingWarehouseSchema } from './models/BaseShippingWarehouseSchema';
|
||||||
|
export type { BaseStatusSchema } from './models/BaseStatusSchema';
|
||||||
export type { BaseTransactionTagSchema } from './models/BaseTransactionTagSchema';
|
export type { BaseTransactionTagSchema } from './models/BaseTransactionTagSchema';
|
||||||
export type { BillPaymentStatus } from './models/BillPaymentStatus';
|
export type { BillPaymentStatus } from './models/BillPaymentStatus';
|
||||||
export type { BillStatusUpdateRequest } from './models/BillStatusUpdateRequest';
|
export type { BillStatusUpdateRequest } from './models/BillStatusUpdateRequest';
|
||||||
|
export type { BoardSchema } from './models/BoardSchema';
|
||||||
export type { Body_parse_deals_excel } from './models/Body_parse_deals_excel';
|
export type { Body_parse_deals_excel } from './models/Body_parse_deals_excel';
|
||||||
export type { Body_upload_passport_image } from './models/Body_upload_passport_image';
|
export type { Body_upload_passport_image } from './models/Body_upload_passport_image';
|
||||||
export type { Body_upload_product_barcode_image } from './models/Body_upload_product_barcode_image';
|
export type { Body_upload_product_barcode_image } from './models/Body_upload_product_barcode_image';
|
||||||
@@ -52,6 +56,8 @@ export type { ClientUpdateRequest } from './models/ClientUpdateRequest';
|
|||||||
export type { ClientUpdateResponse } from './models/ClientUpdateResponse';
|
export type { ClientUpdateResponse } from './models/ClientUpdateResponse';
|
||||||
export type { CreateBarcodeTemplateAttributeRequest } from './models/CreateBarcodeTemplateAttributeRequest';
|
export type { CreateBarcodeTemplateAttributeRequest } from './models/CreateBarcodeTemplateAttributeRequest';
|
||||||
export type { CreateBarcodeTemplateAttributeResponse } from './models/CreateBarcodeTemplateAttributeResponse';
|
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 { CreateBoxInDealSchema } from './models/CreateBoxInDealSchema';
|
||||||
export type { CreateBoxInPalletSchema } from './models/CreateBoxInPalletSchema';
|
export type { CreateBoxInPalletSchema } from './models/CreateBoxInPalletSchema';
|
||||||
export type { CreateDealBillRequest } from './models/CreateDealBillRequest';
|
export type { CreateDealBillRequest } from './models/CreateDealBillRequest';
|
||||||
@@ -73,6 +79,8 @@ export type { CreatePositionRequest } from './models/CreatePositionRequest';
|
|||||||
export type { CreatePositionResponse } from './models/CreatePositionResponse';
|
export type { CreatePositionResponse } from './models/CreatePositionResponse';
|
||||||
export type { CreatePriceCategoryRequest } from './models/CreatePriceCategoryRequest';
|
export type { CreatePriceCategoryRequest } from './models/CreatePriceCategoryRequest';
|
||||||
export type { CreatePriceCategoryResponse } from './models/CreatePriceCategoryResponse';
|
export type { CreatePriceCategoryResponse } from './models/CreatePriceCategoryResponse';
|
||||||
|
export type { CreateProjectRequest } from './models/CreateProjectRequest';
|
||||||
|
export type { CreateProjectResponse } from './models/CreateProjectResponse';
|
||||||
export type { CreateResidualBoxRequest } from './models/CreateResidualBoxRequest';
|
export type { CreateResidualBoxRequest } from './models/CreateResidualBoxRequest';
|
||||||
export type { CreateResidualBoxResponse } from './models/CreateResidualBoxResponse';
|
export type { CreateResidualBoxResponse } from './models/CreateResidualBoxResponse';
|
||||||
export type { CreateResidualPalletRequest } from './models/CreateResidualPalletRequest';
|
export type { CreateResidualPalletRequest } from './models/CreateResidualPalletRequest';
|
||||||
@@ -86,6 +94,8 @@ export type { CreateServicesKitResponse } from './models/CreateServicesKitRespon
|
|||||||
export type { CreateShippingProductSchema } from './models/CreateShippingProductSchema';
|
export type { CreateShippingProductSchema } from './models/CreateShippingProductSchema';
|
||||||
export type { CreateShippingWarehouseRequest } from './models/CreateShippingWarehouseRequest';
|
export type { CreateShippingWarehouseRequest } from './models/CreateShippingWarehouseRequest';
|
||||||
export type { CreateShippingWarehouseResponse } from './models/CreateShippingWarehouseResponse';
|
export type { CreateShippingWarehouseResponse } from './models/CreateShippingWarehouseResponse';
|
||||||
|
export type { CreateStatusRequest } from './models/CreateStatusRequest';
|
||||||
|
export type { CreateStatusResponse } from './models/CreateStatusResponse';
|
||||||
export type { CreateTaskResponse } from './models/CreateTaskResponse';
|
export type { CreateTaskResponse } from './models/CreateTaskResponse';
|
||||||
export type { CreateTransactionTagRequest } from './models/CreateTransactionTagRequest';
|
export type { CreateTransactionTagRequest } from './models/CreateTransactionTagRequest';
|
||||||
export type { CreateUserRequest } from './models/CreateUserRequest';
|
export type { CreateUserRequest } from './models/CreateUserRequest';
|
||||||
@@ -109,7 +119,6 @@ export type { DealCreateGroupRequest } from './models/DealCreateGroupRequest';
|
|||||||
export type { DealCreateGroupResponse } from './models/DealCreateGroupResponse';
|
export type { DealCreateGroupResponse } from './models/DealCreateGroupResponse';
|
||||||
export type { DealCreateGuestUrlRequest } from './models/DealCreateGuestUrlRequest';
|
export type { DealCreateGuestUrlRequest } from './models/DealCreateGuestUrlRequest';
|
||||||
export type { DealCreateGuestUrlResponse } from './models/DealCreateGuestUrlResponse';
|
export type { DealCreateGuestUrlResponse } from './models/DealCreateGuestUrlResponse';
|
||||||
export type { DealCreateRequest } from './models/DealCreateRequest';
|
|
||||||
export type { DealDeleteProductRequest } from './models/DealDeleteProductRequest';
|
export type { DealDeleteProductRequest } from './models/DealDeleteProductRequest';
|
||||||
export type { DealDeleteProductResponse } from './models/DealDeleteProductResponse';
|
export type { DealDeleteProductResponse } from './models/DealDeleteProductResponse';
|
||||||
export type { DealDeleteProductsRequest } from './models/DealDeleteProductsRequest';
|
export type { DealDeleteProductsRequest } from './models/DealDeleteProductsRequest';
|
||||||
@@ -158,6 +167,7 @@ export type { DealUpdateServiceQuantityRequest } from './models/DealUpdateServic
|
|||||||
export type { DealUpdateServiceQuantityResponse } from './models/DealUpdateServiceQuantityResponse';
|
export type { DealUpdateServiceQuantityResponse } from './models/DealUpdateServiceQuantityResponse';
|
||||||
export type { DealUpdateServiceRequest } from './models/DealUpdateServiceRequest';
|
export type { DealUpdateServiceRequest } from './models/DealUpdateServiceRequest';
|
||||||
export type { DealUpdateServiceResponse } from './models/DealUpdateServiceResponse';
|
export type { DealUpdateServiceResponse } from './models/DealUpdateServiceResponse';
|
||||||
|
export type { DeleteBoardResponse } from './models/DeleteBoardResponse';
|
||||||
export type { DeleteBoxResponse } from './models/DeleteBoxResponse';
|
export type { DeleteBoxResponse } from './models/DeleteBoxResponse';
|
||||||
export type { DeleteDepartmentResponse } from './models/DeleteDepartmentResponse';
|
export type { DeleteDepartmentResponse } from './models/DeleteDepartmentResponse';
|
||||||
export type { DeleteDepartmentSectionResponse } from './models/DeleteDepartmentSectionResponse';
|
export type { DeleteDepartmentSectionResponse } from './models/DeleteDepartmentSectionResponse';
|
||||||
@@ -172,6 +182,7 @@ export type { DeletePositionRequest } from './models/DeletePositionRequest';
|
|||||||
export type { DeletePositionResponse } from './models/DeletePositionResponse';
|
export type { DeletePositionResponse } from './models/DeletePositionResponse';
|
||||||
export type { DeletePriceCategoryRequest } from './models/DeletePriceCategoryRequest';
|
export type { DeletePriceCategoryRequest } from './models/DeletePriceCategoryRequest';
|
||||||
export type { DeletePriceCategoryResponse } from './models/DeletePriceCategoryResponse';
|
export type { DeletePriceCategoryResponse } from './models/DeletePriceCategoryResponse';
|
||||||
|
export type { DeleteProjectResponse } from './models/DeleteProjectResponse';
|
||||||
export type { DeleteResidualBoxResponse } from './models/DeleteResidualBoxResponse';
|
export type { DeleteResidualBoxResponse } from './models/DeleteResidualBoxResponse';
|
||||||
export type { DeleteResidualPalletResponse } from './models/DeleteResidualPalletResponse';
|
export type { DeleteResidualPalletResponse } from './models/DeleteResidualPalletResponse';
|
||||||
export type { DeleteResidualProductResponse } from './models/DeleteResidualProductResponse';
|
export type { DeleteResidualProductResponse } from './models/DeleteResidualProductResponse';
|
||||||
@@ -179,6 +190,7 @@ export type { DeleteShiftResponse } from './models/DeleteShiftResponse';
|
|||||||
export type { DeleteShippingProductResponse } from './models/DeleteShippingProductResponse';
|
export type { DeleteShippingProductResponse } from './models/DeleteShippingProductResponse';
|
||||||
export type { DeleteShippingWarehouseRequest } from './models/DeleteShippingWarehouseRequest';
|
export type { DeleteShippingWarehouseRequest } from './models/DeleteShippingWarehouseRequest';
|
||||||
export type { DeleteShippingWarehouseResponse } from './models/DeleteShippingWarehouseResponse';
|
export type { DeleteShippingWarehouseResponse } from './models/DeleteShippingWarehouseResponse';
|
||||||
|
export type { DeleteStatusResponse } from './models/DeleteStatusResponse';
|
||||||
export type { DeleteTransactionResponse } from './models/DeleteTransactionResponse';
|
export type { DeleteTransactionResponse } from './models/DeleteTransactionResponse';
|
||||||
export type { DeleteTransactionTagResponse } from './models/DeleteTransactionTagResponse';
|
export type { DeleteTransactionTagResponse } from './models/DeleteTransactionTagResponse';
|
||||||
export type { DeleteUserRequest } from './models/DeleteUserRequest';
|
export type { DeleteUserRequest } from './models/DeleteUserRequest';
|
||||||
@@ -211,6 +223,7 @@ export type { GetAvailableEmployeesToAssignResponse } from './models/GetAvailabl
|
|||||||
export type { GetAvailableUsersForDepartmentSectionResponse } from './models/GetAvailableUsersForDepartmentSectionResponse';
|
export type { GetAvailableUsersForDepartmentSectionResponse } from './models/GetAvailableUsersForDepartmentSectionResponse';
|
||||||
export type { GetBarcodeTemplateByIdRequest } from './models/GetBarcodeTemplateByIdRequest';
|
export type { GetBarcodeTemplateByIdRequest } from './models/GetBarcodeTemplateByIdRequest';
|
||||||
export type { GetBarcodeTemplateByIdResponse } from './models/GetBarcodeTemplateByIdResponse';
|
export type { GetBarcodeTemplateByIdResponse } from './models/GetBarcodeTemplateByIdResponse';
|
||||||
|
export type { GetBoardsResponse } from './models/GetBoardsResponse';
|
||||||
export type { GetClientMarketplacesRequest } from './models/GetClientMarketplacesRequest';
|
export type { GetClientMarketplacesRequest } from './models/GetClientMarketplacesRequest';
|
||||||
export type { GetClientMarketplacesResponse } from './models/GetClientMarketplacesResponse';
|
export type { GetClientMarketplacesResponse } from './models/GetClientMarketplacesResponse';
|
||||||
export type { GetDealBillById } from './models/GetDealBillById';
|
export type { GetDealBillById } from './models/GetDealBillById';
|
||||||
@@ -229,6 +242,7 @@ export type { GetProfitChartDataRequest } from './models/GetProfitChartDataReque
|
|||||||
export type { GetProfitChartDataResponse } from './models/GetProfitChartDataResponse';
|
export type { GetProfitChartDataResponse } from './models/GetProfitChartDataResponse';
|
||||||
export type { GetProfitTableDataRequest } from './models/GetProfitTableDataRequest';
|
export type { GetProfitTableDataRequest } from './models/GetProfitTableDataRequest';
|
||||||
export type { GetProfitTableDataResponse } from './models/GetProfitTableDataResponse';
|
export type { GetProfitTableDataResponse } from './models/GetProfitTableDataResponse';
|
||||||
|
export type { GetProjectsResponse } from './models/GetProjectsResponse';
|
||||||
export type { GetResidualBoxResponse } from './models/GetResidualBoxResponse';
|
export type { GetResidualBoxResponse } from './models/GetResidualBoxResponse';
|
||||||
export type { GetResidualPalletResponse } from './models/GetResidualPalletResponse';
|
export type { GetResidualPalletResponse } from './models/GetResidualPalletResponse';
|
||||||
export type { GetServiceKitSchema } from './models/GetServiceKitSchema';
|
export type { GetServiceKitSchema } from './models/GetServiceKitSchema';
|
||||||
@@ -285,6 +299,8 @@ export type { ProductUploadImageResponse } from './models/ProductUploadImageResp
|
|||||||
export type { ProfitChartDataItem } from './models/ProfitChartDataItem';
|
export type { ProfitChartDataItem } from './models/ProfitChartDataItem';
|
||||||
export type { ProfitTableDataItem } from './models/ProfitTableDataItem';
|
export type { ProfitTableDataItem } from './models/ProfitTableDataItem';
|
||||||
export type { ProfitTableGroupBy } from './models/ProfitTableGroupBy';
|
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 { ReceiptBoxSchema } from './models/ReceiptBoxSchema';
|
||||||
export type { ReceiptPalletSchema } from './models/ReceiptPalletSchema';
|
export type { ReceiptPalletSchema } from './models/ReceiptPalletSchema';
|
||||||
export type { ResidualBoxSchema } from './models/ResidualBoxSchema';
|
export type { ResidualBoxSchema } from './models/ResidualBoxSchema';
|
||||||
@@ -319,12 +335,17 @@ export type { ShippingWarehouseSchema } from './models/ShippingWarehouseSchema';
|
|||||||
export type { StartPauseByShiftIdResponse } from './models/StartPauseByShiftIdResponse';
|
export type { StartPauseByShiftIdResponse } from './models/StartPauseByShiftIdResponse';
|
||||||
export type { StartPauseByUserIdResponse } from './models/StartPauseByUserIdResponse';
|
export type { StartPauseByUserIdResponse } from './models/StartPauseByUserIdResponse';
|
||||||
export type { StartShiftResponse } from './models/StartShiftResponse';
|
export type { StartShiftResponse } from './models/StartShiftResponse';
|
||||||
|
export type { StatusSchema } from './models/StatusSchema';
|
||||||
export type { SynchronizeMarketplaceRequest } from './models/SynchronizeMarketplaceRequest';
|
export type { SynchronizeMarketplaceRequest } from './models/SynchronizeMarketplaceRequest';
|
||||||
export type { TaskInfoResponse } from './models/TaskInfoResponse';
|
export type { TaskInfoResponse } from './models/TaskInfoResponse';
|
||||||
export type { TimeTrackingData } from './models/TimeTrackingData';
|
export type { TimeTrackingData } from './models/TimeTrackingData';
|
||||||
export type { TimeTrackingRecord } from './models/TimeTrackingRecord';
|
export type { TimeTrackingRecord } from './models/TimeTrackingRecord';
|
||||||
export type { TransactionSchemaBase } from './models/TransactionSchemaBase';
|
export type { TransactionSchemaBase } from './models/TransactionSchemaBase';
|
||||||
export type { TransactionTagSchema } from './models/TransactionTagSchema';
|
export type { TransactionTagSchema } from './models/TransactionTagSchema';
|
||||||
|
export type { UpdateBoardOrderRequest } from './models/UpdateBoardOrderRequest';
|
||||||
|
export type { UpdateBoardOrderResponse } from './models/UpdateBoardOrderResponse';
|
||||||
|
export type { UpdateBoardRequest } from './models/UpdateBoardRequest';
|
||||||
|
export type { UpdateBoardResponse } from './models/UpdateBoardResponse';
|
||||||
export type { UpdateBoxRequest } from './models/UpdateBoxRequest';
|
export type { UpdateBoxRequest } from './models/UpdateBoxRequest';
|
||||||
export type { UpdateBoxResponse } from './models/UpdateBoxResponse';
|
export type { UpdateBoxResponse } from './models/UpdateBoxResponse';
|
||||||
export type { UpdateBoxSchema } from './models/UpdateBoxSchema';
|
export type { UpdateBoxSchema } from './models/UpdateBoxSchema';
|
||||||
@@ -340,6 +361,8 @@ export type { UpdatePlanningWorkShiftRequest } from './models/UpdatePlanningWork
|
|||||||
export type { UpdatePlanningWorkShiftResponse } from './models/UpdatePlanningWorkShiftResponse';
|
export type { UpdatePlanningWorkShiftResponse } from './models/UpdatePlanningWorkShiftResponse';
|
||||||
export type { UpdatePriceCategoryRequest } from './models/UpdatePriceCategoryRequest';
|
export type { UpdatePriceCategoryRequest } from './models/UpdatePriceCategoryRequest';
|
||||||
export type { UpdatePriceCategoryResponse } from './models/UpdatePriceCategoryResponse';
|
export type { UpdatePriceCategoryResponse } from './models/UpdatePriceCategoryResponse';
|
||||||
|
export type { UpdateProjectRequest } from './models/UpdateProjectRequest';
|
||||||
|
export type { UpdateProjectResponse } from './models/UpdateProjectResponse';
|
||||||
export type { UpdateResidualProductRequest } from './models/UpdateResidualProductRequest';
|
export type { UpdateResidualProductRequest } from './models/UpdateResidualProductRequest';
|
||||||
export type { UpdateResidualProductResponse } from './models/UpdateResidualProductResponse';
|
export type { UpdateResidualProductResponse } from './models/UpdateResidualProductResponse';
|
||||||
export type { UpdateResidualProductSchema } from './models/UpdateResidualProductSchema';
|
export type { UpdateResidualProductSchema } from './models/UpdateResidualProductSchema';
|
||||||
@@ -351,6 +374,10 @@ export type { UpdateShippingProductResponse } from './models/UpdateShippingProdu
|
|||||||
export type { UpdateShippingProductSchema } from './models/UpdateShippingProductSchema';
|
export type { UpdateShippingProductSchema } from './models/UpdateShippingProductSchema';
|
||||||
export type { UpdateShippingWarehouseRequest } from './models/UpdateShippingWarehouseRequest';
|
export type { UpdateShippingWarehouseRequest } from './models/UpdateShippingWarehouseRequest';
|
||||||
export type { UpdateShippingWarehouseResponse } from './models/UpdateShippingWarehouseResponse';
|
export type { UpdateShippingWarehouseResponse } from './models/UpdateShippingWarehouseResponse';
|
||||||
|
export type { UpdateStatusOrderRequest } from './models/UpdateStatusOrderRequest';
|
||||||
|
export type { UpdateStatusOrderResponse } from './models/UpdateStatusOrderResponse';
|
||||||
|
export type { UpdateStatusRequest } from './models/UpdateStatusRequest';
|
||||||
|
export type { UpdateStatusResponse } from './models/UpdateStatusResponse';
|
||||||
export type { UpdateTimeTrackingRecordRequest } from './models/UpdateTimeTrackingRecordRequest';
|
export type { UpdateTimeTrackingRecordRequest } from './models/UpdateTimeTrackingRecordRequest';
|
||||||
export type { UpdateTimeTrackingRecordResponse } from './models/UpdateTimeTrackingRecordResponse';
|
export type { UpdateTimeTrackingRecordResponse } from './models/UpdateTimeTrackingRecordResponse';
|
||||||
export type { UpdateTransactionRequest } from './models/UpdateTransactionRequest';
|
export type { UpdateTransactionRequest } from './models/UpdateTransactionRequest';
|
||||||
@@ -375,19 +402,23 @@ export type { WorkShiftSchema } from './models/WorkShiftSchema';
|
|||||||
export { AuthService } from './services/AuthService';
|
export { AuthService } from './services/AuthService';
|
||||||
export { BarcodeService } from './services/BarcodeService';
|
export { BarcodeService } from './services/BarcodeService';
|
||||||
export { BillingService } from './services/BillingService';
|
export { BillingService } from './services/BillingService';
|
||||||
|
export { BoardService } from './services/BoardService';
|
||||||
export { ClientService } from './services/ClientService';
|
export { ClientService } from './services/ClientService';
|
||||||
export { DealService } from './services/DealService';
|
export { DealService } from './services/DealService';
|
||||||
|
export { DealGroupService } from './services/DealGroupService';
|
||||||
export { DepartmentService } from './services/DepartmentService';
|
export { DepartmentService } from './services/DepartmentService';
|
||||||
export { MarketplaceService } from './services/MarketplaceService';
|
export { MarketplaceService } from './services/MarketplaceService';
|
||||||
export { PayrollService } from './services/PayrollService';
|
export { PayrollService } from './services/PayrollService';
|
||||||
export { PositionService } from './services/PositionService';
|
export { PositionService } from './services/PositionService';
|
||||||
export { ProductService } from './services/ProductService';
|
export { ProductService } from './services/ProductService';
|
||||||
|
export { ProjectService } from './services/ProjectService';
|
||||||
export { ResiduesService } from './services/ResiduesService';
|
export { ResiduesService } from './services/ResiduesService';
|
||||||
export { RoleService } from './services/RoleService';
|
export { RoleService } from './services/RoleService';
|
||||||
export { ServiceService } from './services/ServiceService';
|
export { ServiceService } from './services/ServiceService';
|
||||||
export { ShippingService } from './services/ShippingService';
|
export { ShippingService } from './services/ShippingService';
|
||||||
export { ShippingWarehouseService } from './services/ShippingWarehouseService';
|
export { ShippingWarehouseService } from './services/ShippingWarehouseService';
|
||||||
export { StatisticsService } from './services/StatisticsService';
|
export { StatisticsService } from './services/StatisticsService';
|
||||||
|
export { StatusService } from './services/StatusService';
|
||||||
export { TaskService } from './services/TaskService';
|
export { TaskService } from './services/TaskService';
|
||||||
export { TimeTrackingService } from './services/TimeTrackingService';
|
export { TimeTrackingService } from './services/TimeTrackingService';
|
||||||
export { TransactionService } from './services/TransactionService';
|
export { TransactionService } from './services/TransactionService';
|
||||||
|
|||||||
9
src/client/models/BaseBoardSchema.ts
Normal file
9
src/client/models/BaseBoardSchema.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
export type BaseBoardSchema = {
|
||||||
|
name: string;
|
||||||
|
projectId: number;
|
||||||
|
};
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
/* istanbul ignore file */
|
/* istanbul ignore file */
|
||||||
/* tslint:disable */
|
/* tslint:disable */
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
export type DealCreateRequest = {
|
export type BaseProjectSchema = {
|
||||||
name: string;
|
name: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
9
src/client/models/BaseStatusSchema.ts
Normal file
9
src/client/models/BaseStatusSchema.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
export type BaseStatusSchema = {
|
||||||
|
name: string;
|
||||||
|
boardId: number;
|
||||||
|
};
|
||||||
|
|
||||||
15
src/client/models/BoardSchema.ts
Normal file
15
src/client/models/BoardSchema.ts
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
import type { ProjectSchema } from './ProjectSchema';
|
||||||
|
import type { StatusSchema } from './StatusSchema';
|
||||||
|
export type BoardSchema = {
|
||||||
|
name: string;
|
||||||
|
projectId: number;
|
||||||
|
id: number;
|
||||||
|
ordinalNumber: number;
|
||||||
|
dealStatuses: Array<StatusSchema>;
|
||||||
|
project: ProjectSchema;
|
||||||
|
};
|
||||||
|
|
||||||
9
src/client/models/CreateBoardRequest.ts
Normal file
9
src/client/models/CreateBoardRequest.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
import type { BaseBoardSchema } from './BaseBoardSchema';
|
||||||
|
export type CreateBoardRequest = {
|
||||||
|
board: BaseBoardSchema;
|
||||||
|
};
|
||||||
|
|
||||||
9
src/client/models/CreateBoardResponse.ts
Normal file
9
src/client/models/CreateBoardResponse.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
export type CreateBoardResponse = {
|
||||||
|
ok: boolean;
|
||||||
|
message: string;
|
||||||
|
};
|
||||||
|
|
||||||
@@ -5,6 +5,7 @@
|
|||||||
import type { ProductFromExcelSchema } from './ProductFromExcelSchema';
|
import type { ProductFromExcelSchema } from './ProductFromExcelSchema';
|
||||||
export type CreateDealsFromExcelRequest = {
|
export type CreateDealsFromExcelRequest = {
|
||||||
clientId: number;
|
clientId: number;
|
||||||
|
statusId: number;
|
||||||
products: Array<ProductFromExcelSchema>;
|
products: Array<ProductFromExcelSchema>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
9
src/client/models/CreateProjectRequest.ts
Normal file
9
src/client/models/CreateProjectRequest.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
import type { BaseProjectSchema } from './BaseProjectSchema';
|
||||||
|
export type CreateProjectRequest = {
|
||||||
|
project: BaseProjectSchema;
|
||||||
|
};
|
||||||
|
|
||||||
9
src/client/models/CreateProjectResponse.ts
Normal file
9
src/client/models/CreateProjectResponse.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
export type CreateProjectResponse = {
|
||||||
|
ok: boolean;
|
||||||
|
message: string;
|
||||||
|
};
|
||||||
|
|
||||||
9
src/client/models/CreateStatusRequest.ts
Normal file
9
src/client/models/CreateStatusRequest.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
import type { BaseStatusSchema } from './BaseStatusSchema';
|
||||||
|
export type CreateStatusRequest = {
|
||||||
|
status: BaseStatusSchema;
|
||||||
|
};
|
||||||
|
|
||||||
9
src/client/models/CreateStatusResponse.ts
Normal file
9
src/client/models/CreateStatusResponse.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
export type CreateStatusResponse = {
|
||||||
|
ok: boolean;
|
||||||
|
message: string;
|
||||||
|
};
|
||||||
|
|
||||||
@@ -2,6 +2,8 @@
|
|||||||
/* istanbul ignore file */
|
/* istanbul ignore file */
|
||||||
/* tslint:disable */
|
/* tslint:disable */
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
|
import type { BoardSchema } from './BoardSchema';
|
||||||
|
import type { StatusSchema } from './StatusSchema';
|
||||||
import type { UserSchema } from './UserSchema';
|
import type { UserSchema } from './UserSchema';
|
||||||
export type DealGeneralInfoSchema = {
|
export type DealGeneralInfoSchema = {
|
||||||
name: string;
|
name: string;
|
||||||
@@ -13,5 +15,7 @@ export type DealGeneralInfoSchema = {
|
|||||||
deliveryDate?: (string | null);
|
deliveryDate?: (string | null);
|
||||||
receivingSlotDate?: (string | null);
|
receivingSlotDate?: (string | null);
|
||||||
manager?: (UserSchema | null);
|
manager?: (UserSchema | null);
|
||||||
|
board: BoardSchema;
|
||||||
|
status: StatusSchema;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -12,5 +12,6 @@ export type DealQuickCreateRequest = {
|
|||||||
shippingWarehouse: string;
|
shippingWarehouse: string;
|
||||||
baseMarketplace: BaseMarketplaceSchema;
|
baseMarketplace: BaseMarketplaceSchema;
|
||||||
category?: (ServicePriceCategorySchema | null);
|
category?: (ServicePriceCategorySchema | null);
|
||||||
|
statusId: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
/* istanbul ignore file */
|
/* istanbul ignore file */
|
||||||
/* tslint:disable */
|
/* tslint:disable */
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
|
import type { BoardSchema } from './BoardSchema';
|
||||||
import type { BoxSchema } from './BoxSchema';
|
import type { BoxSchema } from './BoxSchema';
|
||||||
import type { ClientSchema } from './ClientSchema';
|
import type { ClientSchema } from './ClientSchema';
|
||||||
import type { DealBillRequestSchema } from './DealBillRequestSchema';
|
import type { DealBillRequestSchema } from './DealBillRequestSchema';
|
||||||
@@ -13,13 +14,15 @@ import type { DealStatusHistorySchema } from './DealStatusHistorySchema';
|
|||||||
import type { PalletSchema } from './PalletSchema';
|
import type { PalletSchema } from './PalletSchema';
|
||||||
import type { ServicePriceCategorySchema } from './ServicePriceCategorySchema';
|
import type { ServicePriceCategorySchema } from './ServicePriceCategorySchema';
|
||||||
import type { ShippingWarehouseSchema } from './ShippingWarehouseSchema';
|
import type { ShippingWarehouseSchema } from './ShippingWarehouseSchema';
|
||||||
|
import type { StatusSchema } from './StatusSchema';
|
||||||
import type { UserSchema } from './UserSchema';
|
import type { UserSchema } from './UserSchema';
|
||||||
export type DealSchema = {
|
export type DealSchema = {
|
||||||
id: number;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
clientId: number;
|
clientId: number;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
currentStatus: number;
|
status: StatusSchema;
|
||||||
|
board: BoardSchema;
|
||||||
services: Array<DealServiceSchema>;
|
services: Array<DealServiceSchema>;
|
||||||
products: Array<DealProductSchema>;
|
products: Array<DealProductSchema>;
|
||||||
statusHistory: Array<DealStatusHistorySchema>;
|
statusHistory: Array<DealStatusHistorySchema>;
|
||||||
|
|||||||
@@ -2,12 +2,13 @@
|
|||||||
/* istanbul ignore file */
|
/* istanbul ignore file */
|
||||||
/* tslint:disable */
|
/* tslint:disable */
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
|
import type { StatusSchema } from './StatusSchema';
|
||||||
import type { UserSchema } from './UserSchema';
|
import type { UserSchema } from './UserSchema';
|
||||||
export type DealStatusHistorySchema = {
|
export type DealStatusHistorySchema = {
|
||||||
user: UserSchema;
|
user: UserSchema;
|
||||||
changedAt: string;
|
changedAt: string;
|
||||||
fromStatus: number;
|
fromStatus: StatusSchema;
|
||||||
toStatus: number;
|
toStatus: StatusSchema;
|
||||||
nextStatusDeadline: (string | null);
|
nextStatusDeadline: (string | null);
|
||||||
comment?: (string | null);
|
comment?: (string | null);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,16 +3,17 @@
|
|||||||
/* tslint:disable */
|
/* tslint:disable */
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import type { BaseMarketplaceSchema } from './BaseMarketplaceSchema';
|
import type { BaseMarketplaceSchema } from './BaseMarketplaceSchema';
|
||||||
|
import type { BoardSchema } from './BoardSchema';
|
||||||
import type { DealBillRequestSchema } from './DealBillRequestSchema';
|
import type { DealBillRequestSchema } from './DealBillRequestSchema';
|
||||||
import type { DealGroupSchema } from './DealGroupSchema';
|
import type { DealGroupSchema } from './DealGroupSchema';
|
||||||
|
import type { StatusSchema } from './StatusSchema';
|
||||||
export type DealSummary = {
|
export type DealSummary = {
|
||||||
id: number;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
clientName: string;
|
clientName: string;
|
||||||
changedAt: string;
|
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
deadline?: (string | null);
|
status: StatusSchema;
|
||||||
status: number;
|
board: BoardSchema;
|
||||||
totalPrice: number;
|
totalPrice: number;
|
||||||
rank: number;
|
rank: number;
|
||||||
baseMarketplace?: (BaseMarketplaceSchema | null);
|
baseMarketplace?: (BaseMarketplaceSchema | null);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
export type DealSummaryReorderRequest = {
|
export type DealSummaryReorderRequest = {
|
||||||
dealId: number;
|
dealId: number;
|
||||||
status: number;
|
statusId: number;
|
||||||
index: number;
|
index: number;
|
||||||
deadline?: (string | null);
|
deadline?: (string | null);
|
||||||
comment?: (string | null);
|
comment?: (string | null);
|
||||||
|
|||||||
9
src/client/models/DeleteBoardResponse.ts
Normal file
9
src/client/models/DeleteBoardResponse.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
export type DeleteBoardResponse = {
|
||||||
|
ok: boolean;
|
||||||
|
message: string;
|
||||||
|
};
|
||||||
|
|
||||||
9
src/client/models/DeleteProjectResponse.ts
Normal file
9
src/client/models/DeleteProjectResponse.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
export type DeleteProjectResponse = {
|
||||||
|
ok: boolean;
|
||||||
|
message: string;
|
||||||
|
};
|
||||||
|
|
||||||
9
src/client/models/DeleteStatusResponse.ts
Normal file
9
src/client/models/DeleteStatusResponse.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
export type DeleteStatusResponse = {
|
||||||
|
ok: boolean;
|
||||||
|
message: string;
|
||||||
|
};
|
||||||
|
|
||||||
9
src/client/models/GetBoardsResponse.ts
Normal file
9
src/client/models/GetBoardsResponse.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
import type { BoardSchema } from './BoardSchema';
|
||||||
|
export type GetBoardsResponse = {
|
||||||
|
boards: Array<BoardSchema>;
|
||||||
|
};
|
||||||
|
|
||||||
@@ -6,9 +6,12 @@ export type GetProfitChartDataRequest = {
|
|||||||
dateRange: any[];
|
dateRange: any[];
|
||||||
clientId: number;
|
clientId: number;
|
||||||
baseMarketplaceKey: string;
|
baseMarketplaceKey: string;
|
||||||
|
projectId: number;
|
||||||
|
boardId: number;
|
||||||
dealStatusId: number;
|
dealStatusId: number;
|
||||||
managerId: number;
|
managerId: number;
|
||||||
expenseTagId: number;
|
expenseTagId: number;
|
||||||
incomeTagId: number;
|
incomeTagId: number;
|
||||||
|
isCompletedOnly: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -7,10 +7,13 @@ export type GetProfitTableDataRequest = {
|
|||||||
dateRange: any[];
|
dateRange: any[];
|
||||||
clientId: number;
|
clientId: number;
|
||||||
baseMarketplaceKey: string;
|
baseMarketplaceKey: string;
|
||||||
|
projectId: number;
|
||||||
|
boardId: number;
|
||||||
dealStatusId: number;
|
dealStatusId: number;
|
||||||
managerId: number;
|
managerId: number;
|
||||||
expenseTagId: number;
|
expenseTagId: number;
|
||||||
incomeTagId: number;
|
incomeTagId: number;
|
||||||
|
isCompletedOnly: boolean;
|
||||||
groupTableBy: ProfitTableGroupBy;
|
groupTableBy: ProfitTableGroupBy;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
9
src/client/models/GetProjectsResponse.ts
Normal file
9
src/client/models/GetProjectsResponse.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
import type { ProjectSchemaWithCount } from './ProjectSchemaWithCount';
|
||||||
|
export type GetProjectsResponse = {
|
||||||
|
projects: Array<ProjectSchemaWithCount>;
|
||||||
|
};
|
||||||
|
|
||||||
@@ -2,4 +2,4 @@
|
|||||||
/* istanbul ignore file */
|
/* istanbul ignore file */
|
||||||
/* tslint:disable */
|
/* tslint:disable */
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
export type ProfitTableGroupBy = 0 | 1 | 2 | 3 | 4 | 5;
|
export type ProfitTableGroupBy = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
||||||
|
|||||||
9
src/client/models/ProjectSchema.ts
Normal file
9
src/client/models/ProjectSchema.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
export type ProjectSchema = {
|
||||||
|
name: string;
|
||||||
|
id: number;
|
||||||
|
};
|
||||||
|
|
||||||
12
src/client/models/StatusSchema.ts
Normal file
12
src/client/models/StatusSchema.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
export type StatusSchema = {
|
||||||
|
name: string;
|
||||||
|
boardId: number;
|
||||||
|
id: number;
|
||||||
|
ordinalNumber: number;
|
||||||
|
isDeleted?: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
10
src/client/models/UpdateBoardOrderRequest.ts
Normal file
10
src/client/models/UpdateBoardOrderRequest.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
export type UpdateBoardOrderRequest = {
|
||||||
|
projectId: number;
|
||||||
|
boardId: number;
|
||||||
|
newOrdinalNumber: number;
|
||||||
|
};
|
||||||
|
|
||||||
9
src/client/models/UpdateBoardOrderResponse.ts
Normal file
9
src/client/models/UpdateBoardOrderResponse.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
export type UpdateBoardOrderResponse = {
|
||||||
|
ok: boolean;
|
||||||
|
message: string;
|
||||||
|
};
|
||||||
|
|
||||||
9
src/client/models/UpdateBoardRequest.ts
Normal file
9
src/client/models/UpdateBoardRequest.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
import type { BoardSchema } from './BoardSchema';
|
||||||
|
export type UpdateBoardRequest = {
|
||||||
|
board: BoardSchema;
|
||||||
|
};
|
||||||
|
|
||||||
9
src/client/models/UpdateBoardResponse.ts
Normal file
9
src/client/models/UpdateBoardResponse.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
export type UpdateBoardResponse = {
|
||||||
|
ok: boolean;
|
||||||
|
message: string;
|
||||||
|
};
|
||||||
|
|
||||||
9
src/client/models/UpdateProjectRequest.ts
Normal file
9
src/client/models/UpdateProjectRequest.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
import type { ProjectSchema } from './ProjectSchema';
|
||||||
|
export type UpdateProjectRequest = {
|
||||||
|
project: ProjectSchema;
|
||||||
|
};
|
||||||
|
|
||||||
9
src/client/models/UpdateProjectResponse.ts
Normal file
9
src/client/models/UpdateProjectResponse.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
export type UpdateProjectResponse = {
|
||||||
|
ok: boolean;
|
||||||
|
message: string;
|
||||||
|
};
|
||||||
|
|
||||||
10
src/client/models/UpdateStatusOrderRequest.ts
Normal file
10
src/client/models/UpdateStatusOrderRequest.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
export type UpdateStatusOrderRequest = {
|
||||||
|
boardId: number;
|
||||||
|
statusId: number;
|
||||||
|
newOrdinalNumber: number;
|
||||||
|
};
|
||||||
|
|
||||||
9
src/client/models/UpdateStatusOrderResponse.ts
Normal file
9
src/client/models/UpdateStatusOrderResponse.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
export type UpdateStatusOrderResponse = {
|
||||||
|
ok: boolean;
|
||||||
|
message: string;
|
||||||
|
};
|
||||||
|
|
||||||
9
src/client/models/UpdateStatusRequest.ts
Normal file
9
src/client/models/UpdateStatusRequest.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
import type { StatusSchema } from './StatusSchema';
|
||||||
|
export type UpdateStatusRequest = {
|
||||||
|
status: StatusSchema;
|
||||||
|
};
|
||||||
|
|
||||||
9
src/client/models/UpdateStatusResponse.ts
Normal file
9
src/client/models/UpdateStatusResponse.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
export type UpdateStatusResponse = {
|
||||||
|
ok: boolean;
|
||||||
|
message: string;
|
||||||
|
};
|
||||||
|
|
||||||
119
src/client/services/BoardService.ts
Normal file
119
src/client/services/BoardService.ts
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
import type { CreateBoardRequest } from '../models/CreateBoardRequest';
|
||||||
|
import type { CreateBoardResponse } from '../models/CreateBoardResponse';
|
||||||
|
import type { DeleteBoardResponse } from '../models/DeleteBoardResponse';
|
||||||
|
import type { GetBoardsResponse } from '../models/GetBoardsResponse';
|
||||||
|
import type { UpdateBoardOrderRequest } from '../models/UpdateBoardOrderRequest';
|
||||||
|
import type { UpdateBoardOrderResponse } from '../models/UpdateBoardOrderResponse';
|
||||||
|
import type { UpdateBoardRequest } from '../models/UpdateBoardRequest';
|
||||||
|
import type { UpdateBoardResponse } from '../models/UpdateBoardResponse';
|
||||||
|
import type { CancelablePromise } from '../core/CancelablePromise';
|
||||||
|
import { OpenAPI } from '../core/OpenAPI';
|
||||||
|
import { request as __request } from '../core/request';
|
||||||
|
export class BoardService {
|
||||||
|
/**
|
||||||
|
* Get Boards
|
||||||
|
* @returns GetBoardsResponse Successful Response
|
||||||
|
* @throws ApiError
|
||||||
|
*/
|
||||||
|
public static getBoards({
|
||||||
|
projectId,
|
||||||
|
}: {
|
||||||
|
projectId: number,
|
||||||
|
}): CancelablePromise<GetBoardsResponse> {
|
||||||
|
return __request(OpenAPI, {
|
||||||
|
method: 'GET',
|
||||||
|
url: '/board/{project_id}',
|
||||||
|
path: {
|
||||||
|
'project_id': projectId,
|
||||||
|
},
|
||||||
|
errors: {
|
||||||
|
422: `Validation Error`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Create Board
|
||||||
|
* @returns CreateBoardResponse Successful Response
|
||||||
|
* @throws ApiError
|
||||||
|
*/
|
||||||
|
public static createBoard({
|
||||||
|
requestBody,
|
||||||
|
}: {
|
||||||
|
requestBody: CreateBoardRequest,
|
||||||
|
}): CancelablePromise<CreateBoardResponse> {
|
||||||
|
return __request(OpenAPI, {
|
||||||
|
method: 'POST',
|
||||||
|
url: '/board/',
|
||||||
|
body: requestBody,
|
||||||
|
mediaType: 'application/json',
|
||||||
|
errors: {
|
||||||
|
422: `Validation Error`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Update Board
|
||||||
|
* @returns UpdateBoardResponse Successful Response
|
||||||
|
* @throws ApiError
|
||||||
|
*/
|
||||||
|
public static updateBoard({
|
||||||
|
requestBody,
|
||||||
|
}: {
|
||||||
|
requestBody: UpdateBoardRequest,
|
||||||
|
}): CancelablePromise<UpdateBoardResponse> {
|
||||||
|
return __request(OpenAPI, {
|
||||||
|
method: 'PATCH',
|
||||||
|
url: '/board/',
|
||||||
|
body: requestBody,
|
||||||
|
mediaType: 'application/json',
|
||||||
|
errors: {
|
||||||
|
422: `Validation Error`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Update Board Order
|
||||||
|
* @returns UpdateBoardOrderResponse Successful Response
|
||||||
|
* @throws ApiError
|
||||||
|
*/
|
||||||
|
public static updateBoardOrder({
|
||||||
|
requestBody,
|
||||||
|
}: {
|
||||||
|
requestBody: UpdateBoardOrderRequest,
|
||||||
|
}): CancelablePromise<UpdateBoardOrderResponse> {
|
||||||
|
return __request(OpenAPI, {
|
||||||
|
method: 'PATCH',
|
||||||
|
url: '/board/order',
|
||||||
|
body: requestBody,
|
||||||
|
mediaType: 'application/json',
|
||||||
|
errors: {
|
||||||
|
422: `Validation Error`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Delete Board
|
||||||
|
* @returns DeleteBoardResponse Successful Response
|
||||||
|
* @throws ApiError
|
||||||
|
*/
|
||||||
|
public static deleteBoard({
|
||||||
|
boardId,
|
||||||
|
}: {
|
||||||
|
boardId: number,
|
||||||
|
}): CancelablePromise<DeleteBoardResponse> {
|
||||||
|
return __request(OpenAPI, {
|
||||||
|
method: 'DELETE',
|
||||||
|
url: '/board/{board_id}',
|
||||||
|
path: {
|
||||||
|
'board_id': boardId,
|
||||||
|
},
|
||||||
|
errors: {
|
||||||
|
422: `Validation Error`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
119
src/client/services/DealGroupService.ts
Normal file
119
src/client/services/DealGroupService.ts
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* 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 { CancelablePromise } from '../core/CancelablePromise';
|
||||||
|
import { OpenAPI } from '../core/OpenAPI';
|
||||||
|
import { request as __request } from '../core/request';
|
||||||
|
export class DealGroupService {
|
||||||
|
/**
|
||||||
|
* Create Group
|
||||||
|
* @returns DealCreateGroupResponse Successful Response
|
||||||
|
* @throws ApiError
|
||||||
|
*/
|
||||||
|
public static createDealGroup({
|
||||||
|
requestBody,
|
||||||
|
}: {
|
||||||
|
requestBody: DealCreateGroupRequest,
|
||||||
|
}): CancelablePromise<DealCreateGroupResponse> {
|
||||||
|
return __request(OpenAPI, {
|
||||||
|
method: 'POST',
|
||||||
|
url: '/deal-group/',
|
||||||
|
body: requestBody,
|
||||||
|
mediaType: 'application/json',
|
||||||
|
errors: {
|
||||||
|
422: `Validation Error`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Update Group
|
||||||
|
* @returns DealGroupUpdateResponse Successful Response
|
||||||
|
* @throws ApiError
|
||||||
|
*/
|
||||||
|
public static updateDealGroup({
|
||||||
|
requestBody,
|
||||||
|
}: {
|
||||||
|
requestBody: DealGroupUpdateRequest,
|
||||||
|
}): CancelablePromise<DealGroupUpdateResponse> {
|
||||||
|
return __request(OpenAPI, {
|
||||||
|
method: 'PATCH',
|
||||||
|
url: '/deal-group/',
|
||||||
|
body: requestBody,
|
||||||
|
mediaType: 'application/json',
|
||||||
|
errors: {
|
||||||
|
422: `Validation Error`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Change Status
|
||||||
|
* @returns DealGroupChangeStatusResponse Successful Response
|
||||||
|
* @throws ApiError
|
||||||
|
*/
|
||||||
|
public static changeStatus({
|
||||||
|
requestBody,
|
||||||
|
}: {
|
||||||
|
requestBody: DealGroupChangeStatusRequest,
|
||||||
|
}): CancelablePromise<DealGroupChangeStatusResponse> {
|
||||||
|
return __request(OpenAPI, {
|
||||||
|
method: 'PATCH',
|
||||||
|
url: '/deal-group/change-status',
|
||||||
|
body: requestBody,
|
||||||
|
mediaType: 'application/json',
|
||||||
|
errors: {
|
||||||
|
422: `Validation Error`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Add Deal
|
||||||
|
* @returns DealAddToGroupResponse Successful Response
|
||||||
|
* @throws ApiError
|
||||||
|
*/
|
||||||
|
public static addDeal({
|
||||||
|
requestBody,
|
||||||
|
}: {
|
||||||
|
requestBody: DealAddToGroupRequest,
|
||||||
|
}): CancelablePromise<DealAddToGroupResponse> {
|
||||||
|
return __request(OpenAPI, {
|
||||||
|
method: 'POST',
|
||||||
|
url: '/deal-group/deal',
|
||||||
|
body: requestBody,
|
||||||
|
mediaType: 'application/json',
|
||||||
|
errors: {
|
||||||
|
422: `Validation Error`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Remove Deal
|
||||||
|
* @returns DealRemoveFromGroupResponse Successful Response
|
||||||
|
* @throws ApiError
|
||||||
|
*/
|
||||||
|
public static removeDeal({
|
||||||
|
requestBody,
|
||||||
|
}: {
|
||||||
|
requestBody: DealRemoveFromGroupRequest,
|
||||||
|
}): CancelablePromise<DealRemoveFromGroupResponse> {
|
||||||
|
return __request(OpenAPI, {
|
||||||
|
method: 'DELETE',
|
||||||
|
url: '/deal-group/deal',
|
||||||
|
body: requestBody,
|
||||||
|
mediaType: 'application/json',
|
||||||
|
errors: {
|
||||||
|
422: `Validation Error`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,17 +13,12 @@ import type { DealAddServiceRequest } from '../models/DealAddServiceRequest';
|
|||||||
import type { DealAddServiceResponse } from '../models/DealAddServiceResponse';
|
import type { DealAddServiceResponse } from '../models/DealAddServiceResponse';
|
||||||
import type { DealAddServicesRequest } from '../models/DealAddServicesRequest';
|
import type { DealAddServicesRequest } from '../models/DealAddServicesRequest';
|
||||||
import type { DealAddServicesResponse } from '../models/DealAddServicesResponse';
|
import type { DealAddServicesResponse } from '../models/DealAddServicesResponse';
|
||||||
import type { DealAddToGroupRequest } from '../models/DealAddToGroupRequest';
|
|
||||||
import type { DealAddToGroupResponse } from '../models/DealAddToGroupResponse';
|
|
||||||
import type { DealChangeStatusRequest } from '../models/DealChangeStatusRequest';
|
import type { DealChangeStatusRequest } from '../models/DealChangeStatusRequest';
|
||||||
import type { DealChangeStatusResponse } from '../models/DealChangeStatusResponse';
|
import type { DealChangeStatusResponse } from '../models/DealChangeStatusResponse';
|
||||||
import type { DealCompleteRequest } from '../models/DealCompleteRequest';
|
import type { DealCompleteRequest } from '../models/DealCompleteRequest';
|
||||||
import type { DealCompleteResponse } from '../models/DealCompleteResponse';
|
import type { DealCompleteResponse } from '../models/DealCompleteResponse';
|
||||||
import type { DealCreateGroupRequest } from '../models/DealCreateGroupRequest';
|
|
||||||
import type { DealCreateGroupResponse } from '../models/DealCreateGroupResponse';
|
|
||||||
import type { DealCreateGuestUrlRequest } from '../models/DealCreateGuestUrlRequest';
|
import type { DealCreateGuestUrlRequest } from '../models/DealCreateGuestUrlRequest';
|
||||||
import type { DealCreateGuestUrlResponse } from '../models/DealCreateGuestUrlResponse';
|
import type { DealCreateGuestUrlResponse } from '../models/DealCreateGuestUrlResponse';
|
||||||
import type { DealCreateRequest } from '../models/DealCreateRequest';
|
|
||||||
import type { DealDeleteProductRequest } from '../models/DealDeleteProductRequest';
|
import type { DealDeleteProductRequest } from '../models/DealDeleteProductRequest';
|
||||||
import type { DealDeleteProductResponse } from '../models/DealDeleteProductResponse';
|
import type { DealDeleteProductResponse } from '../models/DealDeleteProductResponse';
|
||||||
import type { DealDeleteProductsRequest } from '../models/DealDeleteProductsRequest';
|
import type { DealDeleteProductsRequest } from '../models/DealDeleteProductsRequest';
|
||||||
@@ -35,10 +30,6 @@ import type { DealDeleteServiceResponse } from '../models/DealDeleteServiceRespo
|
|||||||
import type { DealDeleteServicesRequest } from '../models/DealDeleteServicesRequest';
|
import type { DealDeleteServicesRequest } from '../models/DealDeleteServicesRequest';
|
||||||
import type { DealDeleteServicesResponse } from '../models/DealDeleteServicesResponse';
|
import type { DealDeleteServicesResponse } from '../models/DealDeleteServicesResponse';
|
||||||
import type { DealGetAllResponse } from '../models/DealGetAllResponse';
|
import type { DealGetAllResponse } from '../models/DealGetAllResponse';
|
||||||
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 { DealPrefillRequest } from '../models/DealPrefillRequest';
|
import type { DealPrefillRequest } from '../models/DealPrefillRequest';
|
||||||
import type { DealPrefillResponse } from '../models/DealPrefillResponse';
|
import type { DealPrefillResponse } from '../models/DealPrefillResponse';
|
||||||
import type { DealProductAddKitRequest } from '../models/DealProductAddKitRequest';
|
import type { DealProductAddKitRequest } from '../models/DealProductAddKitRequest';
|
||||||
@@ -47,8 +38,6 @@ import type { DealQuickCreateRequest } from '../models/DealQuickCreateRequest';
|
|||||||
import type { DealQuickCreateResponse } from '../models/DealQuickCreateResponse';
|
import type { DealQuickCreateResponse } from '../models/DealQuickCreateResponse';
|
||||||
import type { DealRecalculatePriceRequest } from '../models/DealRecalculatePriceRequest';
|
import type { DealRecalculatePriceRequest } from '../models/DealRecalculatePriceRequest';
|
||||||
import type { DealRecalculatePriceResponse } from '../models/DealRecalculatePriceResponse';
|
import type { DealRecalculatePriceResponse } from '../models/DealRecalculatePriceResponse';
|
||||||
import type { DealRemoveFromGroupRequest } from '../models/DealRemoveFromGroupRequest';
|
|
||||||
import type { DealRemoveFromGroupResponse } from '../models/DealRemoveFromGroupResponse';
|
|
||||||
import type { DealSchema } from '../models/DealSchema';
|
import type { DealSchema } from '../models/DealSchema';
|
||||||
import type { DealServicesCopyRequest } from '../models/DealServicesCopyRequest';
|
import type { DealServicesCopyRequest } from '../models/DealServicesCopyRequest';
|
||||||
import type { DealServicesCopyResponse } from '../models/DealServicesCopyResponse';
|
import type { DealServicesCopyResponse } from '../models/DealServicesCopyResponse';
|
||||||
@@ -74,26 +63,6 @@ import type { CancelablePromise } from '../core/CancelablePromise';
|
|||||||
import { OpenAPI } from '../core/OpenAPI';
|
import { OpenAPI } from '../core/OpenAPI';
|
||||||
import { request as __request } from '../core/request';
|
import { request as __request } from '../core/request';
|
||||||
export class DealService {
|
export class DealService {
|
||||||
/**
|
|
||||||
* Create
|
|
||||||
* @returns any Successful Response
|
|
||||||
* @throws ApiError
|
|
||||||
*/
|
|
||||||
public static createDealCreatePost({
|
|
||||||
requestBody,
|
|
||||||
}: {
|
|
||||||
requestBody: DealCreateRequest,
|
|
||||||
}): CancelablePromise<any> {
|
|
||||||
return __request(OpenAPI, {
|
|
||||||
method: 'POST',
|
|
||||||
url: '/deal/create',
|
|
||||||
body: requestBody,
|
|
||||||
mediaType: 'application/json',
|
|
||||||
errors: {
|
|
||||||
422: `Validation Error`,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Delete
|
* Delete
|
||||||
* @returns DealDeleteResponse Successful Response
|
* @returns DealDeleteResponse Successful Response
|
||||||
@@ -750,104 +719,4 @@ export class DealService {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Add To Group
|
|
||||||
* @returns DealAddToGroupResponse Successful Response
|
|
||||||
* @throws ApiError
|
|
||||||
*/
|
|
||||||
public static addDealToGroup({
|
|
||||||
requestBody,
|
|
||||||
}: {
|
|
||||||
requestBody: DealAddToGroupRequest,
|
|
||||||
}): CancelablePromise<DealAddToGroupResponse> {
|
|
||||||
return __request(OpenAPI, {
|
|
||||||
method: 'POST',
|
|
||||||
url: '/deal/add-to-group',
|
|
||||||
body: requestBody,
|
|
||||||
mediaType: 'application/json',
|
|
||||||
errors: {
|
|
||||||
422: `Validation Error`,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Create Group
|
|
||||||
* @returns DealCreateGroupResponse Successful Response
|
|
||||||
* @throws ApiError
|
|
||||||
*/
|
|
||||||
public static createDealGroup({
|
|
||||||
requestBody,
|
|
||||||
}: {
|
|
||||||
requestBody: DealCreateGroupRequest,
|
|
||||||
}): CancelablePromise<DealCreateGroupResponse> {
|
|
||||||
return __request(OpenAPI, {
|
|
||||||
method: 'POST',
|
|
||||||
url: '/deal/create-group',
|
|
||||||
body: requestBody,
|
|
||||||
mediaType: 'application/json',
|
|
||||||
errors: {
|
|
||||||
422: `Validation Error`,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Remove From Group
|
|
||||||
* @returns DealRemoveFromGroupResponse Successful Response
|
|
||||||
* @throws ApiError
|
|
||||||
*/
|
|
||||||
public static removeDealFromGroup({
|
|
||||||
requestBody,
|
|
||||||
}: {
|
|
||||||
requestBody: DealRemoveFromGroupRequest,
|
|
||||||
}): CancelablePromise<DealRemoveFromGroupResponse> {
|
|
||||||
return __request(OpenAPI, {
|
|
||||||
method: 'POST',
|
|
||||||
url: '/deal/remove-from-group',
|
|
||||||
body: requestBody,
|
|
||||||
mediaType: 'application/json',
|
|
||||||
errors: {
|
|
||||||
422: `Validation Error`,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Update Group
|
|
||||||
* @returns DealGroupUpdateResponse Successful Response
|
|
||||||
* @throws ApiError
|
|
||||||
*/
|
|
||||||
public static updateDealGroup({
|
|
||||||
requestBody,
|
|
||||||
}: {
|
|
||||||
requestBody: DealGroupUpdateRequest,
|
|
||||||
}): CancelablePromise<DealGroupUpdateResponse> {
|
|
||||||
return __request(OpenAPI, {
|
|
||||||
method: 'POST',
|
|
||||||
url: '/deal/group/update',
|
|
||||||
body: requestBody,
|
|
||||||
mediaType: 'application/json',
|
|
||||||
errors: {
|
|
||||||
422: `Validation Error`,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Change Group Status
|
|
||||||
* @returns DealGroupChangeStatusResponse Successful Response
|
|
||||||
* @throws ApiError
|
|
||||||
*/
|
|
||||||
public static changeDealGroupStatus({
|
|
||||||
requestBody,
|
|
||||||
}: {
|
|
||||||
requestBody: DealGroupChangeStatusRequest,
|
|
||||||
}): CancelablePromise<DealGroupChangeStatusResponse> {
|
|
||||||
return __request(OpenAPI, {
|
|
||||||
method: 'POST',
|
|
||||||
url: '/deal/group/change-status',
|
|
||||||
body: requestBody,
|
|
||||||
mediaType: 'application/json',
|
|
||||||
errors: {
|
|
||||||
422: `Validation Error`,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
87
src/client/services/ProjectService.ts
Normal file
87
src/client/services/ProjectService.ts
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
import type { CreateProjectRequest } from '../models/CreateProjectRequest';
|
||||||
|
import type { CreateProjectResponse } from '../models/CreateProjectResponse';
|
||||||
|
import type { DeleteProjectResponse } from '../models/DeleteProjectResponse';
|
||||||
|
import type { GetProjectsResponse } from '../models/GetProjectsResponse';
|
||||||
|
import type { UpdateProjectRequest } from '../models/UpdateProjectRequest';
|
||||||
|
import type { UpdateProjectResponse } from '../models/UpdateProjectResponse';
|
||||||
|
import type { CancelablePromise } from '../core/CancelablePromise';
|
||||||
|
import { OpenAPI } from '../core/OpenAPI';
|
||||||
|
import { request as __request } from '../core/request';
|
||||||
|
export class ProjectService {
|
||||||
|
/**
|
||||||
|
* Get Projects
|
||||||
|
* @returns GetProjectsResponse Successful Response
|
||||||
|
* @throws ApiError
|
||||||
|
*/
|
||||||
|
public static getProjects(): CancelablePromise<GetProjectsResponse> {
|
||||||
|
return __request(OpenAPI, {
|
||||||
|
method: 'GET',
|
||||||
|
url: '/project/',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Create Project
|
||||||
|
* @returns CreateProjectResponse Successful Response
|
||||||
|
* @throws ApiError
|
||||||
|
*/
|
||||||
|
public static createProject({
|
||||||
|
requestBody,
|
||||||
|
}: {
|
||||||
|
requestBody: CreateProjectRequest,
|
||||||
|
}): CancelablePromise<CreateProjectResponse> {
|
||||||
|
return __request(OpenAPI, {
|
||||||
|
method: 'POST',
|
||||||
|
url: '/project/',
|
||||||
|
body: requestBody,
|
||||||
|
mediaType: 'application/json',
|
||||||
|
errors: {
|
||||||
|
422: `Validation Error`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Update Project
|
||||||
|
* @returns UpdateProjectResponse Successful Response
|
||||||
|
* @throws ApiError
|
||||||
|
*/
|
||||||
|
public static updateProject({
|
||||||
|
requestBody,
|
||||||
|
}: {
|
||||||
|
requestBody: UpdateProjectRequest,
|
||||||
|
}): CancelablePromise<UpdateProjectResponse> {
|
||||||
|
return __request(OpenAPI, {
|
||||||
|
method: 'PATCH',
|
||||||
|
url: '/project/',
|
||||||
|
body: requestBody,
|
||||||
|
mediaType: 'application/json',
|
||||||
|
errors: {
|
||||||
|
422: `Validation Error`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Delete Project
|
||||||
|
* @returns DeleteProjectResponse Successful Response
|
||||||
|
* @throws ApiError
|
||||||
|
*/
|
||||||
|
public static deleteProject({
|
||||||
|
projectId,
|
||||||
|
}: {
|
||||||
|
projectId: number,
|
||||||
|
}): CancelablePromise<DeleteProjectResponse> {
|
||||||
|
return __request(OpenAPI, {
|
||||||
|
method: 'DELETE',
|
||||||
|
url: '/project/{project_id}',
|
||||||
|
path: {
|
||||||
|
'project_id': projectId,
|
||||||
|
},
|
||||||
|
errors: {
|
||||||
|
422: `Validation Error`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
97
src/client/services/StatusService.ts
Normal file
97
src/client/services/StatusService.ts
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
import type { CreateStatusRequest } from '../models/CreateStatusRequest';
|
||||||
|
import type { CreateStatusResponse } from '../models/CreateStatusResponse';
|
||||||
|
import type { DeleteStatusResponse } from '../models/DeleteStatusResponse';
|
||||||
|
import type { UpdateStatusOrderRequest } from '../models/UpdateStatusOrderRequest';
|
||||||
|
import type { UpdateStatusOrderResponse } from '../models/UpdateStatusOrderResponse';
|
||||||
|
import type { UpdateStatusRequest } from '../models/UpdateStatusRequest';
|
||||||
|
import type { UpdateStatusResponse } from '../models/UpdateStatusResponse';
|
||||||
|
import type { CancelablePromise } from '../core/CancelablePromise';
|
||||||
|
import { OpenAPI } from '../core/OpenAPI';
|
||||||
|
import { request as __request } from '../core/request';
|
||||||
|
export class StatusService {
|
||||||
|
/**
|
||||||
|
* Create Status
|
||||||
|
* @returns CreateStatusResponse Successful Response
|
||||||
|
* @throws ApiError
|
||||||
|
*/
|
||||||
|
public static createStatus({
|
||||||
|
requestBody,
|
||||||
|
}: {
|
||||||
|
requestBody: CreateStatusRequest,
|
||||||
|
}): CancelablePromise<CreateStatusResponse> {
|
||||||
|
return __request(OpenAPI, {
|
||||||
|
method: 'POST',
|
||||||
|
url: '/status/',
|
||||||
|
body: requestBody,
|
||||||
|
mediaType: 'application/json',
|
||||||
|
errors: {
|
||||||
|
422: `Validation Error`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Update Status
|
||||||
|
* @returns UpdateStatusResponse Successful Response
|
||||||
|
* @throws ApiError
|
||||||
|
*/
|
||||||
|
public static updateStatus({
|
||||||
|
requestBody,
|
||||||
|
}: {
|
||||||
|
requestBody: UpdateStatusRequest,
|
||||||
|
}): CancelablePromise<UpdateStatusResponse> {
|
||||||
|
return __request(OpenAPI, {
|
||||||
|
method: 'PATCH',
|
||||||
|
url: '/status/',
|
||||||
|
body: requestBody,
|
||||||
|
mediaType: 'application/json',
|
||||||
|
errors: {
|
||||||
|
422: `Validation Error`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Update Status Order
|
||||||
|
* @returns UpdateStatusOrderResponse Successful Response
|
||||||
|
* @throws ApiError
|
||||||
|
*/
|
||||||
|
public static updateStatusOrder({
|
||||||
|
requestBody,
|
||||||
|
}: {
|
||||||
|
requestBody: UpdateStatusOrderRequest,
|
||||||
|
}): CancelablePromise<UpdateStatusOrderResponse> {
|
||||||
|
return __request(OpenAPI, {
|
||||||
|
method: 'PATCH',
|
||||||
|
url: '/status/order',
|
||||||
|
body: requestBody,
|
||||||
|
mediaType: 'application/json',
|
||||||
|
errors: {
|
||||||
|
422: `Validation Error`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Delete Status
|
||||||
|
* @returns DeleteStatusResponse Successful Response
|
||||||
|
* @throws ApiError
|
||||||
|
*/
|
||||||
|
public static deleteStatus({
|
||||||
|
statusId,
|
||||||
|
}: {
|
||||||
|
statusId: number,
|
||||||
|
}): CancelablePromise<DeleteStatusResponse> {
|
||||||
|
return __request(OpenAPI, {
|
||||||
|
method: 'DELETE',
|
||||||
|
url: '/status/{status_id}',
|
||||||
|
path: {
|
||||||
|
'status_id': statusId,
|
||||||
|
},
|
||||||
|
errors: {
|
||||||
|
422: `Validation Error`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
54
src/components/BoardSelect/BoardSelect.tsx
Normal file
54
src/components/BoardSelect/BoardSelect.tsx
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
import ObjectSelect, { ObjectSelectProps } from "../ObjectSelect/ObjectSelect.tsx";
|
||||||
|
import { FC, useEffect, useState } from "react";
|
||||||
|
import { BoardSchema, BoardService, ProjectSchema } from "../../client";
|
||||||
|
|
||||||
|
type OtherProps = {
|
||||||
|
project: ProjectSchema | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
type SelectProps = Omit<ObjectSelectProps<BoardSchema | null>, "data" | "getLabelFn" | "getValueFn">;
|
||||||
|
|
||||||
|
type Props = OtherProps & SelectProps;
|
||||||
|
|
||||||
|
const BoardSelect: FC<Props> = ({ project, ...props }) => {
|
||||||
|
const [boards, setBoards] = useState<BoardSchema[]>([]);
|
||||||
|
const [isInitial, setIsInitial] = useState<boolean>(true);
|
||||||
|
|
||||||
|
const onClear = () => props.onChange(null);
|
||||||
|
|
||||||
|
const fetchBoards = () => {
|
||||||
|
if (!project?.id) {
|
||||||
|
setBoards([]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
BoardService.getBoards({
|
||||||
|
projectId: project?.id,
|
||||||
|
})
|
||||||
|
.then(({ boards }) => {
|
||||||
|
setBoards(boards);
|
||||||
|
})
|
||||||
|
.catch(err => console.log(err));
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
fetchBoards();
|
||||||
|
if (isInitial) {
|
||||||
|
setIsInitial(false);
|
||||||
|
} else {
|
||||||
|
onClear();
|
||||||
|
}
|
||||||
|
}, [project?.id]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ObjectSelect
|
||||||
|
data={boards}
|
||||||
|
searchable
|
||||||
|
placeholder={"Выберите доску"}
|
||||||
|
onClear={onClear}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default BoardSelect;
|
||||||
40
src/components/DealStatusSelect/DealStatusSelect.tsx
Normal file
40
src/components/DealStatusSelect/DealStatusSelect.tsx
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
import ObjectSelect, { ObjectSelectProps } from "../ObjectSelect/ObjectSelect.tsx";
|
||||||
|
import { FC, useEffect, useState } from "react";
|
||||||
|
import { BoardSchema, StatusSchema } from "../../client";
|
||||||
|
|
||||||
|
type OtherProps = {
|
||||||
|
board: BoardSchema | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
type SelectProps = Omit<ObjectSelectProps<StatusSchema | null>, "data" | "getLabelFn" | "getValueFn">;
|
||||||
|
|
||||||
|
type Props = OtherProps & SelectProps;
|
||||||
|
|
||||||
|
const DealStatusSelect: FC<Props> = ({ board, ...props}) => {
|
||||||
|
const [isInitial, setIsInitial] = useState<boolean>(true);
|
||||||
|
|
||||||
|
const filteredData = board?.dealStatuses.filter(
|
||||||
|
status => !status.isDeleted,
|
||||||
|
) ?? [];
|
||||||
|
|
||||||
|
const onClear = () => props.onChange(null);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (isInitial) {
|
||||||
|
setIsInitial(false);
|
||||||
|
} else {
|
||||||
|
onClear();
|
||||||
|
}
|
||||||
|
}, [board?.id]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ObjectSelect
|
||||||
|
data={filteredData}
|
||||||
|
searchable
|
||||||
|
placeholder={"Выберите статус"}
|
||||||
|
onClear={onClear}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
export default DealStatusSelect;
|
||||||
37
src/components/Dnd/Boards/Board/Board.module.scss
Normal file
37
src/components/Dnd/Boards/Board/Board.module.scss
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
.boards-select-element {
|
||||||
|
border-bottom: solid gray 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.board {
|
||||||
|
padding: 0.5em 1em 0.3em 1em;
|
||||||
|
text-wrap: nowrap;
|
||||||
|
cursor: pointer !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.selected-board {
|
||||||
|
padding: 0.5em 1em 0.3em 1em;
|
||||||
|
text-wrap: nowrap;
|
||||||
|
border-radius: var(--item-border-radius);
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
border-bottom-right-radius: 0;
|
||||||
|
border: solid gray 1px;
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.board-during-dnd {
|
||||||
|
background-color: var(--color-gray-10);
|
||||||
|
}
|
||||||
|
|
||||||
|
.board::after {
|
||||||
|
content: "";
|
||||||
|
}
|
||||||
|
|
||||||
|
.board-drag-over {
|
||||||
|
@mixin light {
|
||||||
|
background-color: var(--mantine-color-gray-1);
|
||||||
|
}
|
||||||
|
@mixin dark {
|
||||||
|
background-color: var(--mantine-color-dark-5);
|
||||||
|
}
|
||||||
|
border-radius: var(--item-border-radius);
|
||||||
|
}
|
||||||
97
src/components/Dnd/Boards/Board/Board.tsx
Normal file
97
src/components/Dnd/Boards/Board/Board.tsx
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
import { Draggable, Droppable } from "@hello-pangea/dnd";
|
||||||
|
import { BoardSchema } from "../../../../client";
|
||||||
|
import { useContextMenu } from "mantine-contextmenu";
|
||||||
|
import { IconEdit, IconPlus, IconTrash } from "@tabler/icons-react";
|
||||||
|
import classNames from "classnames";
|
||||||
|
import styles from "./Board.module.scss";
|
||||||
|
import useStatus from "../../Statuses/Status/hooks/useStatus.tsx";
|
||||||
|
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
board: BoardSchema;
|
||||||
|
selectedBoard: BoardSchema | null;
|
||||||
|
setSelectedBoard: (board: BoardSchema) => void;
|
||||||
|
onEditBoardClick: (board: BoardSchema) => void;
|
||||||
|
onDeleteBoardClick: (board: BoardSchema) => void;
|
||||||
|
isBoardDragEnded: boolean;
|
||||||
|
refetch: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Board = ({
|
||||||
|
board,
|
||||||
|
selectedBoard,
|
||||||
|
setSelectedBoard,
|
||||||
|
onEditBoardClick,
|
||||||
|
onDeleteBoardClick,
|
||||||
|
isBoardDragEnded,
|
||||||
|
refetch,
|
||||||
|
}: Props) => {
|
||||||
|
|
||||||
|
const { showContextMenu } = useContextMenu();
|
||||||
|
|
||||||
|
const { onCreateStatusClick } = useStatus({ refetch });
|
||||||
|
|
||||||
|
const contextMenu = (board: BoardSchema) => showContextMenu([
|
||||||
|
{
|
||||||
|
key: "complete",
|
||||||
|
onClick: () => onEditBoardClick(board),
|
||||||
|
title: "Переименовать",
|
||||||
|
icon: <IconEdit />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "add-status",
|
||||||
|
onClick: () => onCreateStatusClick(board),
|
||||||
|
title: "Новый статус",
|
||||||
|
icon: <IconPlus />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "delete",
|
||||||
|
onClick: () => onDeleteBoardClick(board),
|
||||||
|
title: "Удалить",
|
||||||
|
icon: <IconTrash />,
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Droppable
|
||||||
|
droppableId={board.id.toString()}
|
||||||
|
direction={"horizontal"}
|
||||||
|
>
|
||||||
|
{provided => (
|
||||||
|
<div
|
||||||
|
{...provided.droppableProps}
|
||||||
|
ref={provided.innerRef}
|
||||||
|
>
|
||||||
|
<Draggable
|
||||||
|
draggableId={board.id.toString()}
|
||||||
|
index={board.ordinalNumber}
|
||||||
|
>
|
||||||
|
{(provided) => (
|
||||||
|
<div
|
||||||
|
{...provided.draggableProps}
|
||||||
|
{...provided.dragHandleProps}
|
||||||
|
ref={provided.innerRef}
|
||||||
|
|
||||||
|
className={classNames(
|
||||||
|
styles["boards-select-element"],
|
||||||
|
board.id === selectedBoard?.id ?
|
||||||
|
styles["selected-board"] :
|
||||||
|
styles["board"],
|
||||||
|
!isBoardDragEnded && styles["board-during-dnd"],
|
||||||
|
)}
|
||||||
|
|
||||||
|
onClick={() => setSelectedBoard(board)}
|
||||||
|
onContextMenu={contextMenu(board)}
|
||||||
|
>
|
||||||
|
{board.name}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</Draggable>
|
||||||
|
{provided.placeholder}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</Droppable>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Board;
|
||||||
90
src/components/Dnd/Boards/Boards/Boards.tsx
Normal file
90
src/components/Dnd/Boards/Boards/Boards.tsx
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
import { Box, Center, Group, Stack } from "@mantine/core";
|
||||||
|
import { DragDropContext } from "@hello-pangea/dnd";
|
||||||
|
import { BoardSchema, DealSummary, ProjectSchema } 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";
|
||||||
|
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
project: ProjectSchema | null;
|
||||||
|
summariesRaw: DealSummary[];
|
||||||
|
refetchSummaries: () => void;
|
||||||
|
boards: BoardSchema[];
|
||||||
|
refetchBoards: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Boards = (props: Props) => {
|
||||||
|
const {
|
||||||
|
selectedBoard,
|
||||||
|
setSelectedBoard,
|
||||||
|
onCreateBoardClick,
|
||||||
|
onEditBoardClick,
|
||||||
|
onDeleteBoardClick,
|
||||||
|
} = useBoards(props);
|
||||||
|
|
||||||
|
const {
|
||||||
|
onBoardDragEnd,
|
||||||
|
isBoardDragEnded,
|
||||||
|
setIsBoardDragEnded,
|
||||||
|
} = useBoardsDnd(props);
|
||||||
|
|
||||||
|
const getBoardsTabs = () => {
|
||||||
|
return (
|
||||||
|
<DragDropContext
|
||||||
|
onDragStart={() => {
|
||||||
|
setIsBoardDragEnded(false);
|
||||||
|
}}
|
||||||
|
onDragEnd={onBoardDragEnd}
|
||||||
|
>
|
||||||
|
<Group
|
||||||
|
mx={"3%"}
|
||||||
|
mb={"md"}
|
||||||
|
gap={0}
|
||||||
|
align={"end"}
|
||||||
|
wrap={"nowrap"}
|
||||||
|
>
|
||||||
|
{props.boards.map((board: BoardSchema) => (
|
||||||
|
<Board
|
||||||
|
key={board.id}
|
||||||
|
|
||||||
|
board={board}
|
||||||
|
selectedBoard={selectedBoard}
|
||||||
|
setSelectedBoard={setSelectedBoard}
|
||||||
|
onEditBoardClick={onEditBoardClick}
|
||||||
|
onDeleteBoardClick={onDeleteBoardClick}
|
||||||
|
isBoardDragEnded={isBoardDragEnded}
|
||||||
|
refetch={props.refetchBoards}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
<Center
|
||||||
|
px={"md"}
|
||||||
|
py={"xs"}
|
||||||
|
style={{ cursor: "pointer", borderBottom: "solid gray 1px" }}
|
||||||
|
onClick={onCreateBoardClick}
|
||||||
|
>
|
||||||
|
<IconPlus />
|
||||||
|
</Center>
|
||||||
|
<Box w={"100%"} style={{ borderBottom: "solid gray 1px" }}></Box>
|
||||||
|
</Group>
|
||||||
|
</DragDropContext>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Stack>
|
||||||
|
{getBoardsTabs()}
|
||||||
|
<Statuses
|
||||||
|
selectedBoard={selectedBoard}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
<PrefillDealsWithExcelDrawer board={selectedBoard}/>
|
||||||
|
</Stack>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Boards;
|
||||||
83
src/components/Dnd/Boards/Boards/hooks/useBoards.tsx
Normal file
83
src/components/Dnd/Boards/Boards/hooks/useBoards.tsx
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import { BoardSchema, BoardService, ProjectSchema } from "../../../../../client";
|
||||||
|
import { modals } from "@mantine/modals";
|
||||||
|
import { notifications } from "../../../../../shared/lib/notifications.ts";
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
boards: BoardSchema[];
|
||||||
|
refetchBoards: () => void;
|
||||||
|
project: ProjectSchema | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const useBoards = ({ boards, refetchBoards, project }: Props) => {
|
||||||
|
const [selectedBoard, setSelectedBoard] = useState<BoardSchema | null>(null);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (boards.length > 0 && selectedBoard === null) {
|
||||||
|
setSelectedBoard(boards[0]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (selectedBoard) {
|
||||||
|
// Update selected board after changing all boards
|
||||||
|
let newBoard = boards.find(board => board.id === selectedBoard.id);
|
||||||
|
|
||||||
|
if (!newBoard && boards.length > 0) {
|
||||||
|
newBoard = boards[0]
|
||||||
|
}
|
||||||
|
setSelectedBoard(newBoard ?? null);
|
||||||
|
}
|
||||||
|
}, [boards]);
|
||||||
|
|
||||||
|
const onEditBoardClick = (board: BoardSchema) => {
|
||||||
|
if (!project) return;
|
||||||
|
modals.openContextModal({
|
||||||
|
modal: "boardModal",
|
||||||
|
title: "Редактирование доски",
|
||||||
|
withCloseButton: false,
|
||||||
|
innerProps: {
|
||||||
|
projectId: project.id,
|
||||||
|
board,
|
||||||
|
refetchBoards,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const onCreateBoardClick = () => {
|
||||||
|
if (!project) return;
|
||||||
|
modals.openContextModal({
|
||||||
|
modal: "boardModal",
|
||||||
|
title: "Добавление доски",
|
||||||
|
withCloseButton: false,
|
||||||
|
innerProps: {
|
||||||
|
projectId: project.id,
|
||||||
|
refetchBoards,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const onDeleteBoardClick = (board: BoardSchema) => {
|
||||||
|
if (!board) return;
|
||||||
|
BoardService.deleteBoard({
|
||||||
|
boardId: board.id,
|
||||||
|
})
|
||||||
|
.then(({ ok, message }) => {
|
||||||
|
if (!ok) {
|
||||||
|
notifications.error({ message });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
refetchBoards();
|
||||||
|
})
|
||||||
|
.catch(err => console.log(err));
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
selectedBoard,
|
||||||
|
setSelectedBoard,
|
||||||
|
onCreateBoardClick,
|
||||||
|
onEditBoardClick,
|
||||||
|
onDeleteBoardClick,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default useBoards;
|
||||||
53
src/components/Dnd/Boards/Boards/hooks/useBoardsDnd.tsx
Normal file
53
src/components/Dnd/Boards/Boards/hooks/useBoardsDnd.tsx
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
import { DropResult } from "@hello-pangea/dnd";
|
||||||
|
import { BoardSchema, BoardService } from "../../../../../client";
|
||||||
|
import { notifications } from "../../../../../shared/lib/notifications.ts";
|
||||||
|
import { useState } from "react";
|
||||||
|
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
boards: BoardSchema[];
|
||||||
|
refetchBoards: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const useBoardsDnd = ({ boards, refetchBoards }: Props) => {
|
||||||
|
const [isBoardDragEnded, setIsBoardDragEnded] = useState(true);
|
||||||
|
|
||||||
|
const updateBoardOrder = (board: BoardSchema, newOrdinalNumber: number) => {
|
||||||
|
BoardService.updateBoardOrder({
|
||||||
|
requestBody: {
|
||||||
|
projectId: board.projectId,
|
||||||
|
boardId: board.id,
|
||||||
|
newOrdinalNumber,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(({ ok, message }) => {
|
||||||
|
if (!ok) notifications.error({ message });
|
||||||
|
refetchBoards();
|
||||||
|
})
|
||||||
|
};
|
||||||
|
|
||||||
|
const onBoardDragEnd = async (result: DropResult) => {
|
||||||
|
setIsBoardDragEnded(true);
|
||||||
|
|
||||||
|
// If there is no changes
|
||||||
|
if (!result.destination || result.destination == result.source) return;
|
||||||
|
|
||||||
|
// Checking for valid dealId
|
||||||
|
const boardId = parseInt(result.draggableId);
|
||||||
|
if (isNaN(boardId)) return;
|
||||||
|
|
||||||
|
// Checking for valid deal
|
||||||
|
const board = boards.find(board => board.id == boardId);
|
||||||
|
if (!board) return;
|
||||||
|
|
||||||
|
updateBoardOrder(board, result.destination.index);
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
onBoardDragEnd,
|
||||||
|
isBoardDragEnded,
|
||||||
|
setIsBoardDragEnded,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default useBoardsDnd;
|
||||||
@@ -1,226 +0,0 @@
|
|||||||
import { FC } from "react";
|
|
||||||
import { DealService, DealSummary } from "../../../client";
|
|
||||||
import styles from "./DealSummaryCard.module.css";
|
|
||||||
|
|
||||||
import {
|
|
||||||
ActionIcon,
|
|
||||||
Badge,
|
|
||||||
CopyButton,
|
|
||||||
Flex,
|
|
||||||
Image,
|
|
||||||
Indicator,
|
|
||||||
IndicatorProps,
|
|
||||||
Popover,
|
|
||||||
rem,
|
|
||||||
Text,
|
|
||||||
ThemeIcon,
|
|
||||||
Tooltip,
|
|
||||||
} from "@mantine/core";
|
|
||||||
import { useDealPageContext } from "../../../pages/LeadsPage/contexts/DealPageContext.tsx";
|
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
||||||
import { faCheck } from "@fortawesome/free-solid-svg-icons";
|
|
||||||
import { DealStatus } from "../../../shared/enums/DealStatus.ts";
|
|
||||||
import { IconCheck, IconLayoutGridRemove, IconTrash } from "@tabler/icons-react";
|
|
||||||
import { useContextMenu } from "mantine-contextmenu";
|
|
||||||
import useDealSummaryState from "./useDealSummaryState.tsx";
|
|
||||||
|
|
||||||
type Props = {
|
|
||||||
dealSummary: DealSummary;
|
|
||||||
color?: string
|
|
||||||
};
|
|
||||||
|
|
||||||
const DealSummaryCard: FC<Props> = ({ dealSummary, color }) => {
|
|
||||||
const { showContextMenu } = useContextMenu();
|
|
||||||
const { setSelectedDeal } = useDealPageContext();
|
|
||||||
const { onDelete, onComplete, onDeleteFromGroup } = useDealSummaryState();
|
|
||||||
|
|
||||||
const onDealSummaryClick = () => {
|
|
||||||
DealService.getDealById({ dealId: dealSummary.id }).then(deal => {
|
|
||||||
setSelectedDeal(deal);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const getIndicatorProps = (): IndicatorProps => {
|
|
||||||
if (!dealSummary.deliveryDate)
|
|
||||||
return { disabled: true };
|
|
||||||
|
|
||||||
const deliveryDate = new Date(dealSummary.deliveryDate);
|
|
||||||
const currentDate = new Date();
|
|
||||||
const diff = deliveryDate.getTime() - currentDate.getTime();
|
|
||||||
const diffDays = Math.ceil(diff / (1000 * 3600 * 24));
|
|
||||||
|
|
||||||
if (dealSummary.status < DealStatus.IN_DELIVERY) {
|
|
||||||
if (diffDays <= 2 && diffDays > 1) {
|
|
||||||
return {
|
|
||||||
color: "yellow",
|
|
||||||
};
|
|
||||||
}
|
|
||||||
if (diffDays <= 1) {
|
|
||||||
return {
|
|
||||||
color: "red",
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
disabled: false,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
return { disabled: true };
|
|
||||||
};
|
|
||||||
const isPaid = () => {
|
|
||||||
return dealSummary.billRequest?.paid || dealSummary.group?.billRequest?.paid;
|
|
||||||
}
|
|
||||||
const isLockedInsideGroup = () => {
|
|
||||||
return dealSummary.group && !dealSummary.group.billRequest;
|
|
||||||
}
|
|
||||||
return (
|
|
||||||
<Indicator
|
|
||||||
position={"top-end"}
|
|
||||||
withBorder
|
|
||||||
size={15}
|
|
||||||
processing
|
|
||||||
{...getIndicatorProps()}
|
|
||||||
>
|
|
||||||
|
|
||||||
<div
|
|
||||||
onContextMenu={showContextMenu([
|
|
||||||
...isLockedInsideGroup() ? [{
|
|
||||||
key: "removeFromGroup",
|
|
||||||
onClick: () => onDeleteFromGroup(dealSummary),
|
|
||||||
title: "Убрать из группы",
|
|
||||||
icon: <IconLayoutGridRemove />,
|
|
||||||
}] : [],
|
|
||||||
{
|
|
||||||
key: "complete",
|
|
||||||
onClick: () => onComplete(dealSummary),
|
|
||||||
title: "Завершить",
|
|
||||||
icon: <IconCheck />,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "delete",
|
|
||||||
onClick: () => onDelete(dealSummary),
|
|
||||||
title: "Удалить",
|
|
||||||
icon: <IconTrash />,
|
|
||||||
},
|
|
||||||
])}
|
|
||||||
onClick={() => onDealSummaryClick()}
|
|
||||||
className={styles["container"]}
|
|
||||||
style={{ backgroundColor: color }}
|
|
||||||
>
|
|
||||||
<Flex direction={"column"} flex={1} gap={rem(3)}>
|
|
||||||
<Flex justify={"space-between"}>
|
|
||||||
|
|
||||||
<Text
|
|
||||||
c={"gray.6"}
|
|
||||||
size={"xs"}
|
|
||||||
|
|
||||||
>
|
|
||||||
{dealSummary.clientName}
|
|
||||||
</Text>
|
|
||||||
</Flex>
|
|
||||||
|
|
||||||
<Text
|
|
||||||
c={"blue.5"}
|
|
||||||
size={"sm"}>
|
|
||||||
{dealSummary.name}
|
|
||||||
</Text>
|
|
||||||
<Flex
|
|
||||||
// align={"center"}
|
|
||||||
direction={"column"}
|
|
||||||
justify={"space-between"}
|
|
||||||
>
|
|
||||||
<Text
|
|
||||||
size={"sm"}
|
|
||||||
c={"gray.6"}>
|
|
||||||
{dealSummary.shipmentWarehouseName || "Склад не указан"}
|
|
||||||
</Text>
|
|
||||||
<Text
|
|
||||||
c={"gray.6"}
|
|
||||||
size={"sm"}
|
|
||||||
>
|
|
||||||
{dealSummary.totalPrice.toLocaleString("ru-RU")} руб,{" "}
|
|
||||||
</Text>
|
|
||||||
<Text
|
|
||||||
c={"gray.6"}
|
|
||||||
size={"sm"}>
|
|
||||||
{dealSummary.totalProducts.toLocaleString("ru-RU")} тов.
|
|
||||||
</Text>
|
|
||||||
</Flex>
|
|
||||||
<Flex direction={"column"}>
|
|
||||||
{dealSummary.deliveryDate && (
|
|
||||||
<Text
|
|
||||||
c={"blue.5"}
|
|
||||||
size={"sm"}>
|
|
||||||
Доставка: {(new Date(dealSummary.deliveryDate)).toLocaleDateString("ru-RU")}
|
|
||||||
</Text>
|
|
||||||
)}
|
|
||||||
{dealSummary.receivingSlotDate && (
|
|
||||||
<Text
|
|
||||||
c={"blue.5"}
|
|
||||||
size={"sm"}>
|
|
||||||
Слот: {(new Date(dealSummary.receivingSlotDate)).toLocaleDateString("ru-RU")}
|
|
||||||
</Text>
|
|
||||||
)}
|
|
||||||
</Flex>
|
|
||||||
<Flex align={"center"} justify={"space-between"}>
|
|
||||||
<Flex align={"center"} gap={rem(5)}>
|
|
||||||
<CopyButton value={dealSummary.id.toString()}>
|
|
||||||
{({ copy, copied }) => (
|
|
||||||
<Popover
|
|
||||||
opened={copied}
|
|
||||||
withArrow>
|
|
||||||
<Popover.Target>
|
|
||||||
<div
|
|
||||||
onClick={e => {
|
|
||||||
e.stopPropagation();
|
|
||||||
copy();
|
|
||||||
}}
|
|
||||||
className={styles["flex-item"]}>
|
|
||||||
<Badge
|
|
||||||
variant={"light"}
|
|
||||||
radius={"sm"}>
|
|
||||||
ID: {dealSummary.id}
|
|
||||||
</Badge>
|
|
||||||
</div>
|
|
||||||
</Popover.Target>
|
|
||||||
<Popover.Dropdown>
|
|
||||||
<Flex
|
|
||||||
justify={"center"}
|
|
||||||
align={"center"}
|
|
||||||
gap={rem(5)}>
|
|
||||||
<FontAwesomeIcon
|
|
||||||
bounce
|
|
||||||
style={{ animationIterationCount: 1 }}
|
|
||||||
icon={faCheck}
|
|
||||||
/>
|
|
||||||
<Text size={"xs"}>
|
|
||||||
ID сделки скопирован
|
|
||||||
</Text>
|
|
||||||
</Flex>
|
|
||||||
</Popover.Dropdown>
|
|
||||||
</Popover>
|
|
||||||
)}
|
|
||||||
</CopyButton>
|
|
||||||
{isPaid() && (
|
|
||||||
<Tooltip label={"Оплачен"}>
|
|
||||||
<ThemeIcon variant={"transparent"}>
|
|
||||||
<IconCheck />
|
|
||||||
</ThemeIcon>
|
|
||||||
</Tooltip>
|
|
||||||
)}
|
|
||||||
</Flex>
|
|
||||||
|
|
||||||
<ActionIcon variant={"transparent"}>
|
|
||||||
<Image
|
|
||||||
src={dealSummary.baseMarketplace?.iconUrl || ""}
|
|
||||||
/>
|
|
||||||
</ActionIcon>
|
|
||||||
</Flex>
|
|
||||||
|
|
||||||
</Flex>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</Indicator>
|
|
||||||
|
|
||||||
);
|
|
||||||
};
|
|
||||||
export default DealSummaryCard;
|
|
||||||
@@ -3,12 +3,16 @@ import { useState } from "react";
|
|||||||
import styles from "./CreateDealButton.module.css";
|
import styles from "./CreateDealButton.module.css";
|
||||||
import { Text, Transition } from "@mantine/core";
|
import { Text, Transition } from "@mantine/core";
|
||||||
import CreateDealFrom from "../CreateDealForm/CreateDealFrom.tsx";
|
import CreateDealFrom from "../CreateDealForm/CreateDealFrom.tsx";
|
||||||
import { DealService } from "../../../client";
|
import { DealService, StatusSchema } from "../../../../client";
|
||||||
import { useQueryClient } from "@tanstack/react-query";
|
import { useQueryClient } from "@tanstack/react-query";
|
||||||
import { dateWithoutTimezone } from "../../../shared/lib/date.ts";
|
import { dateWithoutTimezone } from "../../../../shared/lib/date.ts";
|
||||||
import { usePrefillDealContext } from "../../../pages/LeadsPage/contexts/PrefillDealContext.tsx";
|
import { usePrefillDealContext } from "../../../../pages/DealsPage/contexts/PrefillDealContext.tsx";
|
||||||
|
|
||||||
const CreateDealButton = () => {
|
type Props = {
|
||||||
|
status: StatusSchema;
|
||||||
|
}
|
||||||
|
|
||||||
|
const CreateDealButton = ({ status }: Props) => {
|
||||||
const [isCreating, setIsCreating] = useState(false);
|
const [isCreating, setIsCreating] = useState(false);
|
||||||
const [isTransitionEnded, setIsTransitionEnded] = useState(true);
|
const [isTransitionEnded, setIsTransitionEnded] = useState(true);
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
@@ -43,6 +47,7 @@ const CreateDealButton = () => {
|
|||||||
acceptanceDate: dateWithoutTimezone(
|
acceptanceDate: dateWithoutTimezone(
|
||||||
quickDeal.acceptanceDate,
|
quickDeal.acceptanceDate,
|
||||||
),
|
),
|
||||||
|
statusId: status.id,
|
||||||
},
|
},
|
||||||
}).then(async (result) => {
|
}).then(async (result) => {
|
||||||
if (prefillDeal) {
|
if (prefillDeal) {
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
import { Button, rem, Textarea, TextInput } from "@mantine/core";
|
import { Button, rem, Textarea, TextInput } from "@mantine/core";
|
||||||
import { QuickDeal } from "../../../types/QuickDeal.ts";
|
import { QuickDeal } from "../../../../types/QuickDeal.ts";
|
||||||
import { FC } from "react";
|
import { FC } from "react";
|
||||||
import { useForm } from "@mantine/form";
|
import { useForm } from "@mantine/form";
|
||||||
import styles from "./CreateDealForm.module.css";
|
import styles from "./CreateDealForm.module.css";
|
||||||
import ClientAutocomplete from "../../Selects/ClientAutocomplete/ClientAutocomplete.tsx";
|
import ClientAutocomplete from "../../../Selects/ClientAutocomplete/ClientAutocomplete.tsx";
|
||||||
import { DateTimePicker } from "@mantine/dates";
|
import { DateTimePicker } from "@mantine/dates";
|
||||||
import ShippingWarehouseAutocomplete
|
import ShippingWarehouseAutocomplete
|
||||||
from "../../Selects/ShippingWarehouseAutocomplete/ShippingWarehouseAutocomplete.tsx";
|
from "../../../Selects/ShippingWarehouseAutocomplete/ShippingWarehouseAutocomplete.tsx";
|
||||||
import BaseMarketplaceSelect from "../../Selects/BaseMarketplaceSelect/BaseMarketplaceSelect.tsx";
|
import BaseMarketplaceSelect from "../../../Selects/BaseMarketplaceSelect/BaseMarketplaceSelect.tsx";
|
||||||
import ServicePriceCategorySelect from "../../Selects/ServicePriceCategorySelect/ServicePriceCategorySelect.tsx";
|
import ServicePriceCategorySelect from "../../../Selects/ServicePriceCategorySelect/ServicePriceCategorySelect.tsx";
|
||||||
import { usePrefillDealContext } from "../../../pages/LeadsPage/contexts/PrefillDealContext.tsx";
|
import { usePrefillDealContext } from "../../../../pages/DealsPage/contexts/PrefillDealContext.tsx";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
onSubmit: (quickDeal: QuickDeal) => void;
|
onSubmit: (quickDeal: QuickDeal) => void;
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import styles from "./CreateDealsFromFileButton.module.css";
|
import styles from "./CreateDealsFromFileButton.module.css";
|
||||||
import { Text } from "@mantine/core";
|
import { Text } from "@mantine/core";
|
||||||
import { usePrefillDealsWithExcelContext } from "../../../pages/LeadsPage/contexts/PrefillDealsWithExcelContext.tsx";
|
import { usePrefillDealsWithExcelContext } from "../../../../pages/DealsPage/contexts/PrefillDealsWithExcelContext.tsx";
|
||||||
|
|
||||||
const CreateDealsFromFileButton = () => {
|
const CreateDealsFromFileButton = () => {
|
||||||
const { prefillWithExcelOnOpen } = usePrefillDealsWithExcelContext();
|
const { prefillWithExcelOnOpen } = usePrefillDealsWithExcelContext();
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
import { DealGroupSchema, DealService, DealSummary } from "../../../client";
|
import { DealGroupSchema, DealGroupService, DealSummary } from "../../../../client";
|
||||||
import { FC, useEffect, useMemo, useState } from "react";
|
import { FC, useEffect, useMemo, useState } from "react";
|
||||||
import DealSummaryCard from "../DealSummaryCard/DealSummaryCard.tsx";
|
import DealSummaryCard from "../DealSummaryCard/DealSummaryCard.tsx";
|
||||||
import { Flex, rem, Text, TextInput, useMantineColorScheme } from "@mantine/core";
|
import { Flex, rem, Text, TextInput, useMantineColorScheme } from "@mantine/core";
|
||||||
import { IconGripHorizontal } from "@tabler/icons-react";
|
import { IconGripHorizontal } from "@tabler/icons-react";
|
||||||
import { useDebouncedValue } from "@mantine/hooks";
|
import { useDebouncedValue } from "@mantine/hooks";
|
||||||
import { notifications } from "../../../shared/lib/notifications.ts";
|
import { notifications } from "../../../../shared/lib/notifications.ts";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
deals: DealSummary[];
|
deals: DealSummary[];
|
||||||
@@ -19,7 +19,7 @@ export const DealGroupView: FC<Props> = ({ deals, group }) => {
|
|||||||
const totalProducts = useMemo(() => deals.reduce((acc, deal) => acc + deal.totalProducts, 0), [deals]);
|
const totalProducts = useMemo(() => deals.reduce((acc, deal) => acc + deal.totalProducts, 0), [deals]);
|
||||||
const updateName = () => {
|
const updateName = () => {
|
||||||
if (debouncedName === group.name) return;
|
if (debouncedName === group.name) return;
|
||||||
DealService.updateDealGroup({
|
DealGroupService.updateDealGroup({
|
||||||
requestBody: {
|
requestBody: {
|
||||||
data: {
|
data: {
|
||||||
...group,
|
...group,
|
||||||
173
src/components/Dnd/Deals/DealSummaryCard/DealSummaryCard.tsx
Normal file
173
src/components/Dnd/Deals/DealSummaryCard/DealSummaryCard.tsx
Normal file
@@ -0,0 +1,173 @@
|
|||||||
|
import { FC } from "react";
|
||||||
|
import { DealService, DealSummary } from "../../../../client";
|
||||||
|
import styles from "./DealSummaryCard.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 { 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";
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
dealSummary: DealSummary;
|
||||||
|
color?: string
|
||||||
|
};
|
||||||
|
|
||||||
|
const DealSummaryCard: FC<Props> = ({ dealSummary, color }) => {
|
||||||
|
const { showContextMenu } = useContextMenu();
|
||||||
|
const { setSelectedDeal } = useDealPageContext();
|
||||||
|
const { onDelete, onComplete, onDeleteFromGroup } = useDealSummaryState();
|
||||||
|
|
||||||
|
const onDealSummaryClick = () => {
|
||||||
|
DealService.getDealById({ dealId: dealSummary.id }).then(deal => {
|
||||||
|
setSelectedDeal(deal);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const isPaid = () => {
|
||||||
|
return dealSummary.billRequest?.paid || dealSummary.group?.billRequest?.paid;
|
||||||
|
};
|
||||||
|
const isLockedInsideGroup = () => {
|
||||||
|
return dealSummary.group && !dealSummary.group.billRequest;
|
||||||
|
};
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
onContextMenu={showContextMenu([
|
||||||
|
...isLockedInsideGroup() ? [{
|
||||||
|
key: "removeFromGroup",
|
||||||
|
onClick: () => onDeleteFromGroup(dealSummary),
|
||||||
|
title: "Убрать из группы",
|
||||||
|
icon: <IconLayoutGridRemove />,
|
||||||
|
}] : [],
|
||||||
|
{
|
||||||
|
key: "complete",
|
||||||
|
onClick: () => onComplete(dealSummary),
|
||||||
|
title: "Завершить",
|
||||||
|
icon: <IconCheck />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "delete",
|
||||||
|
onClick: () => onDelete(dealSummary),
|
||||||
|
title: "Удалить",
|
||||||
|
icon: <IconTrash />,
|
||||||
|
},
|
||||||
|
])}
|
||||||
|
onClick={() => onDealSummaryClick()}
|
||||||
|
className={styles["container"]}
|
||||||
|
style={{ backgroundColor: color }}
|
||||||
|
>
|
||||||
|
<Flex direction={"column"} flex={1} gap={rem(3)}>
|
||||||
|
<Flex justify={"space-between"}>
|
||||||
|
|
||||||
|
<Text
|
||||||
|
c={"gray.6"}
|
||||||
|
size={"xs"}
|
||||||
|
|
||||||
|
>
|
||||||
|
{dealSummary.clientName}
|
||||||
|
</Text>
|
||||||
|
</Flex>
|
||||||
|
|
||||||
|
<Text
|
||||||
|
c={"blue.5"}
|
||||||
|
size={"sm"}>
|
||||||
|
{dealSummary.name}
|
||||||
|
</Text>
|
||||||
|
<Flex
|
||||||
|
// align={"center"}
|
||||||
|
direction={"column"}
|
||||||
|
justify={"space-between"}
|
||||||
|
>
|
||||||
|
<Text
|
||||||
|
size={"sm"}
|
||||||
|
c={"gray.6"}>
|
||||||
|
{dealSummary.shipmentWarehouseName || "Склад не указан"}
|
||||||
|
</Text>
|
||||||
|
<Text
|
||||||
|
c={"gray.6"}
|
||||||
|
size={"sm"}
|
||||||
|
>
|
||||||
|
{dealSummary.totalPrice.toLocaleString("ru-RU")} руб,{" "}
|
||||||
|
</Text>
|
||||||
|
<Text
|
||||||
|
c={"gray.6"}
|
||||||
|
size={"sm"}>
|
||||||
|
{dealSummary.totalProducts.toLocaleString("ru-RU")} тов.
|
||||||
|
</Text>
|
||||||
|
</Flex>
|
||||||
|
<Flex direction={"column"}>
|
||||||
|
{dealSummary.deliveryDate && (
|
||||||
|
<Text
|
||||||
|
c={"blue.5"}
|
||||||
|
size={"sm"}>
|
||||||
|
Доставка: {(new Date(dealSummary.deliveryDate)).toLocaleDateString("ru-RU")}
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
|
{dealSummary.receivingSlotDate && (
|
||||||
|
<Text
|
||||||
|
c={"blue.5"}
|
||||||
|
size={"sm"}>
|
||||||
|
Слот: {(new Date(dealSummary.receivingSlotDate)).toLocaleDateString("ru-RU")}
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
|
</Flex>
|
||||||
|
<Flex align={"center"} justify={"space-between"}>
|
||||||
|
<Flex align={"center"} gap={rem(5)}>
|
||||||
|
<CopyButton value={dealSummary.id.toString()}>
|
||||||
|
{({ copy, copied }) => (
|
||||||
|
<Popover
|
||||||
|
opened={copied}
|
||||||
|
withArrow>
|
||||||
|
<Popover.Target>
|
||||||
|
<div
|
||||||
|
onClick={e => {
|
||||||
|
e.stopPropagation();
|
||||||
|
copy();
|
||||||
|
}}
|
||||||
|
className={styles["flex-item"]}>
|
||||||
|
<Badge
|
||||||
|
variant={"light"}
|
||||||
|
radius={"sm"}>
|
||||||
|
ID: {dealSummary.id}
|
||||||
|
</Badge>
|
||||||
|
</div>
|
||||||
|
</Popover.Target>
|
||||||
|
<Popover.Dropdown>
|
||||||
|
<Flex
|
||||||
|
justify={"center"}
|
||||||
|
align={"center"}
|
||||||
|
gap={rem(5)}>
|
||||||
|
<FontAwesomeIcon
|
||||||
|
bounce
|
||||||
|
style={{ animationIterationCount: 1 }}
|
||||||
|
icon={faCheck}
|
||||||
|
/>
|
||||||
|
<Text size={"xs"}>
|
||||||
|
ID сделки скопирован
|
||||||
|
</Text>
|
||||||
|
</Flex>
|
||||||
|
</Popover.Dropdown>
|
||||||
|
</Popover>
|
||||||
|
)}
|
||||||
|
</CopyButton>
|
||||||
|
{isPaid() && (
|
||||||
|
<Tooltip label={"Оплачен"}>
|
||||||
|
<ThemeIcon variant={"transparent"}>
|
||||||
|
<IconCheck />
|
||||||
|
</ThemeIcon>
|
||||||
|
</Tooltip>
|
||||||
|
)}
|
||||||
|
</Flex>
|
||||||
|
|
||||||
|
<ActionIcon variant={"transparent"}>
|
||||||
|
<Image
|
||||||
|
src={dealSummary.baseMarketplace?.iconUrl || ""}
|
||||||
|
/>
|
||||||
|
</ActionIcon>
|
||||||
|
</Flex>
|
||||||
|
</Flex>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
export default DealSummaryCard;
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import { DealService, DealSummary } from "../../../client";
|
import { DealGroupService, DealService, DealSummary } from "../../../../client";
|
||||||
import { useDealPageContext } from "../../../pages/LeadsPage/contexts/DealPageContext.tsx";
|
import { useDealPageContext } from "../../../../pages/DealsPage/contexts/DealPageContext.tsx";
|
||||||
import { modals } from "@mantine/modals";
|
import { modals } from "@mantine/modals";
|
||||||
import { Text } from "@mantine/core";
|
import { Text } from "@mantine/core";
|
||||||
import { notifications } from "../../../shared/lib/notifications.ts";
|
import { notifications } from "../../../../shared/lib/notifications.ts";
|
||||||
|
|
||||||
const useDealSummaryState = () => {
|
const useDealSummaryState = () => {
|
||||||
const { refetchDeals } = useDealPageContext();
|
const { refetchDeals } = useDealPageContext();
|
||||||
@@ -76,7 +76,7 @@ const useDealSummaryState = () => {
|
|||||||
labels: { confirm: "Да", cancel: "Нет" },
|
labels: { confirm: "Да", cancel: "Нет" },
|
||||||
confirmProps: { color: "red" },
|
confirmProps: { color: "red" },
|
||||||
onConfirm: () => {
|
onConfirm: () => {
|
||||||
DealService.removeDealFromGroup({
|
DealGroupService.removeDeal({
|
||||||
requestBody: {
|
requestBody: {
|
||||||
dealId: summary.id,
|
dealId: summary.id,
|
||||||
},
|
},
|
||||||
@@ -5,15 +5,6 @@
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header {
|
|
||||||
display: flex;
|
|
||||||
align-items: stretch;
|
|
||||||
text-align: center;
|
|
||||||
flex-direction: column;
|
|
||||||
/*border: solid var(--item-border-size) var(--mantine-color-default-border);*/
|
|
||||||
/*border-radius: var(--item-border-radius);*/
|
|
||||||
}
|
|
||||||
|
|
||||||
.items-list {
|
.items-list {
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -1,46 +1,37 @@
|
|||||||
import { FC } from "react";
|
import { FC } from "react";
|
||||||
import styles from "./Board.module.css";
|
import styles from "./DealsDndColumn.module.css";
|
||||||
import { Divider, Text, Title } from "@mantine/core";
|
|
||||||
import { Draggable, Droppable } from "@hello-pangea/dnd";
|
import { Draggable, Droppable } from "@hello-pangea/dnd";
|
||||||
import CreateDealButton from "../CreateDealButton/CreateDealButton.tsx";
|
import CreateDealButton from "../CreateDealButton/CreateDealButton.tsx";
|
||||||
import { DealGroupSchema, DealSummary } from "../../../client";
|
import { DealGroupSchema, DealSummary, StatusSchema } from "../../../../client";
|
||||||
import DealSummaryCard from "../DealSummaryCard/DealSummaryCard.tsx";
|
import DealSummaryCard from "../DealSummaryCard/DealSummaryCard.tsx";
|
||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
import { getPluralForm } from "../../../shared/lib/utils.ts";
|
import { groupBy, has, uniq } from "lodash";
|
||||||
import { groupBy, has, sum, uniq } from "lodash";
|
|
||||||
import { DealGroupView } from "../DealGroupView/DealGroupView.tsx";
|
import { DealGroupView } from "../DealGroupView/DealGroupView.tsx";
|
||||||
import CreateDealsFromFileButton from "../CreateDealsFromFileButton/CreateDealsFromFileButton.tsx";
|
import CreateDealsFromFileButton from "../CreateDealsFromFileButton/CreateDealsFromFileButton.tsx";
|
||||||
|
import DragState from "../../../../pages/DealsPage/enums/DragState.ts";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
droppableId: string;
|
status: StatusSchema;
|
||||||
title: string;
|
|
||||||
withCreateButton?: boolean;
|
withCreateButton?: boolean;
|
||||||
summaries: DealSummary[];
|
summaries: DealSummary[];
|
||||||
color: string;
|
dragState: DragState;
|
||||||
};
|
};
|
||||||
|
|
||||||
type GroupWithDeals = { group: DealGroupSchema, deals: DealSummary[] }
|
type GroupWithDeals = { group: DealGroupSchema, deals: DealSummary[] }
|
||||||
|
|
||||||
export const Board: FC<Props> = ({
|
export const DealsDndColumn: FC<Props> = ({
|
||||||
droppableId,
|
status,
|
||||||
title,
|
summaries,
|
||||||
summaries,
|
dragState,
|
||||||
color,
|
withCreateButton = false,
|
||||||
withCreateButton = false,
|
}) => {
|
||||||
}) => {
|
const isDropDisabled = dragState === DragState.DRAG_STATUS;
|
||||||
const getDealsText = () => {
|
const droppableId = status.id.toString();
|
||||||
const pluralForm = getPluralForm(
|
|
||||||
summaries.length,
|
|
||||||
"сделка",
|
|
||||||
"сделки",
|
|
||||||
"сделок",
|
|
||||||
);
|
|
||||||
return `${summaries.length} ${pluralForm}: ${sum(summaries.map(summary => summary.totalPrice)).toLocaleString("ru-RU")}₽`;
|
|
||||||
};
|
|
||||||
const isGroup = (obj: GroupWithDeals | DealSummary): obj is GroupWithDeals => {
|
const isGroup = (obj: GroupWithDeals | DealSummary): obj is GroupWithDeals => {
|
||||||
return has(obj, "deals");
|
return has(obj, "deals");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const getDealGroups = (): GroupWithDeals[] => {
|
const getDealGroups = (): GroupWithDeals[] => {
|
||||||
const groups = uniq<DealGroupSchema>(summaries.filter(s => s.group).map(summary => summary.group) as DealGroupSchema[]);
|
const groups = uniq<DealGroupSchema>(summaries.filter(s => s.group).map(summary => summary.group) as DealGroupSchema[]);
|
||||||
if (groups.length === 0) return [];
|
if (groups.length === 0) return [];
|
||||||
@@ -110,96 +101,89 @@ export const Board: FC<Props> = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const renderDeal = (deal: DealSummary) => {
|
const renderDeal = (deal: DealSummary) => {
|
||||||
return (<Draggable
|
return (
|
||||||
|
<Draggable
|
||||||
draggableId={deal.id.toString()}
|
draggableId={deal.id.toString()}
|
||||||
index={deal.rank}
|
index={deal.rank}
|
||||||
key={deal.id}>
|
key={deal.id}>
|
||||||
{(provided, snapshot) => (
|
{(provided, snapshot) => (
|
||||||
<div
|
|
||||||
{...provided.draggableProps}
|
|
||||||
{...provided.dragHandleProps}
|
|
||||||
ref={provided.innerRef}>
|
|
||||||
<div
|
<div
|
||||||
style={{
|
{...provided.draggableProps}
|
||||||
transition: "transform 0.1s ease-in-out",
|
{...provided.dragHandleProps}
|
||||||
transform: snapshot.combineWith ? "scale(0.85)" : "none",
|
ref={provided.innerRef}>
|
||||||
color: snapshot.combineWith ? "red" : "black",
|
<div
|
||||||
}}
|
style={{
|
||||||
>
|
transition: "transform 0.1s ease-in-out",
|
||||||
<DealSummaryCard
|
transform: snapshot.combineWith ? "scale(0.85)" : "none",
|
||||||
dealSummary={deal}
|
color: snapshot.combineWith ? "red" : "black",
|
||||||
/>
|
}}
|
||||||
</div>
|
>
|
||||||
|
<DealSummaryCard
|
||||||
|
dealSummary={deal}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Draggable>);
|
</Draggable>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
const renderGroup = (obj: GroupWithDeals) => {
|
const renderGroup = (obj: GroupWithDeals) => {
|
||||||
const { deals, group } = obj;
|
const { deals, group } = obj;
|
||||||
return (<Draggable
|
return (
|
||||||
draggableId={"group-" + group.id}
|
<Draggable
|
||||||
index={deals[0].rank}
|
draggableId={"group-" + group.id}
|
||||||
key={"group-" + group.id}
|
index={deals[0].rank}
|
||||||
>
|
key={"group-" + group.id}
|
||||||
{(provided) => (
|
>
|
||||||
<div
|
{(provided) => (
|
||||||
{...provided.draggableProps}
|
|
||||||
{...provided.dragHandleProps}
|
|
||||||
ref={provided.innerRef}
|
|
||||||
>
|
|
||||||
<DealGroupView
|
|
||||||
deals={deals}
|
|
||||||
group={group}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</Draggable>);
|
|
||||||
};
|
|
||||||
return (
|
|
||||||
<div className={styles["container"]}>
|
|
||||||
<div className={styles["header"]}>
|
|
||||||
<Title size={"h4"}>{title}</Title>
|
|
||||||
<Text>{getDealsText()}</Text>
|
|
||||||
<Divider
|
|
||||||
size={"xl"}
|
|
||||||
my={10}
|
|
||||||
color={color}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<Droppable
|
|
||||||
isCombineEnabled
|
|
||||||
droppableId={droppableId}>
|
|
||||||
{(provided, snapshot) => (
|
|
||||||
<div
|
<div
|
||||||
|
{...provided.draggableProps}
|
||||||
|
{...provided.dragHandleProps}
|
||||||
ref={provided.innerRef}
|
ref={provided.innerRef}
|
||||||
className={classNames(
|
>
|
||||||
styles["items-list"],
|
<DealGroupView
|
||||||
snapshot.isDraggingOver &&
|
deals={deals}
|
||||||
!snapshot.draggingFromThisWith &&
|
group={group}
|
||||||
styles["items-list-drag-over"],
|
/>
|
||||||
)}
|
|
||||||
{...provided.droppableProps}>
|
|
||||||
{withCreateButton && (
|
|
||||||
<>
|
|
||||||
<CreateDealButton />
|
|
||||||
<CreateDealsFromFileButton />
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
{getDealsAndGroups().map(obj => {
|
|
||||||
if (isGroup(obj)) {
|
|
||||||
return renderGroup(obj);
|
|
||||||
}
|
|
||||||
return renderDeal(obj);
|
|
||||||
})}
|
|
||||||
{provided.placeholder}
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Droppable>
|
</Draggable>
|
||||||
</div>
|
);
|
||||||
|
};
|
||||||
|
return (
|
||||||
|
<Droppable
|
||||||
|
isDropDisabled={isDropDisabled}
|
||||||
|
isCombineEnabled
|
||||||
|
droppableId={droppableId}>
|
||||||
|
{(provided, snapshot) => (
|
||||||
|
<div
|
||||||
|
ref={provided.innerRef}
|
||||||
|
className={classNames(
|
||||||
|
styles["items-list"],
|
||||||
|
snapshot.isDraggingOver &&
|
||||||
|
!snapshot.draggingFromThisWith &&
|
||||||
|
styles["items-list-drag-over"],
|
||||||
|
)}
|
||||||
|
{...provided.droppableProps}>
|
||||||
|
{withCreateButton && (
|
||||||
|
<>
|
||||||
|
<CreateDealButton status={status}/>
|
||||||
|
<CreateDealsFromFileButton />
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
{getDealsAndGroups().map(obj => {
|
||||||
|
if (isGroup(obj)) {
|
||||||
|
return renderGroup(obj);
|
||||||
|
}
|
||||||
|
return renderDeal(obj);
|
||||||
|
})}
|
||||||
|
{provided.placeholder}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</Droppable>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Board;
|
export default DealsDndColumn;
|
||||||
|
|
||||||
213
src/components/Dnd/Deals/DealsDndColumn/hooks/useDealsDnd.tsx
Normal file
213
src/components/Dnd/Deals/DealsDndColumn/hooks/useDealsDnd.tsx
Normal file
@@ -0,0 +1,213 @@
|
|||||||
|
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 { notifications } from "../../../../../shared/lib/notifications.ts";
|
||||||
|
import { dateWithoutTimezone } from "../../../../../shared/lib/date.ts";
|
||||||
|
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
summariesRaw: DealSummary[];
|
||||||
|
refetchSummaries: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const useDealsDnd = ({
|
||||||
|
summariesRaw,
|
||||||
|
refetchSummaries,
|
||||||
|
}: Props) => {
|
||||||
|
const [summaries, setSummaries] = useState(summariesRaw);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setSummaries(summariesRaw);
|
||||||
|
}, [summariesRaw]);
|
||||||
|
|
||||||
|
const recalculate = async (dealId: number) => {
|
||||||
|
return DealService.recalculateDealPrice({
|
||||||
|
requestBody: {
|
||||||
|
dealId: dealId,
|
||||||
|
},
|
||||||
|
}).then(({ ok, message }) => {
|
||||||
|
notifications.guess(ok, { message });
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const onDelete = (dealId: number) => {
|
||||||
|
const summary = summaries.find(summary => summary.id == dealId);
|
||||||
|
if (!summary) return;
|
||||||
|
modals.openConfirmModal({
|
||||||
|
title: "Удаление сделки",
|
||||||
|
children: (
|
||||||
|
<Flex>
|
||||||
|
Вы действительно хотите удалить сделку {summary.name}?
|
||||||
|
</Flex>
|
||||||
|
),
|
||||||
|
onConfirm: () => {
|
||||||
|
DealService.deleteDeal({
|
||||||
|
requestBody: { dealId: dealId },
|
||||||
|
}).then(async ({ ok, message }) => {
|
||||||
|
notifications.guess(ok, { message });
|
||||||
|
if (!ok) return;
|
||||||
|
await refetchSummaries();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
labels: {
|
||||||
|
confirm: "Удалить",
|
||||||
|
cancel: "Отмена",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const onSuccess = (dealId: number) => {
|
||||||
|
const summary = summaries.find(summary => summary.id == dealId);
|
||||||
|
if (!summary) return;
|
||||||
|
modals.openConfirmModal({
|
||||||
|
title: "Завершение сделки",
|
||||||
|
children: (
|
||||||
|
<Flex>
|
||||||
|
Вы действительно хотите завершить сделку {summary.name}?
|
||||||
|
</Flex>
|
||||||
|
),
|
||||||
|
onConfirm: () => {
|
||||||
|
DealService.completeDeal({
|
||||||
|
requestBody: { dealId: dealId },
|
||||||
|
}).then(async ({ ok, message }) => {
|
||||||
|
notifications.guess(ok, { message });
|
||||||
|
if (!ok) return;
|
||||||
|
await refetchSummaries();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
labels: {
|
||||||
|
confirm: "Завершить",
|
||||||
|
cancel: "Отмена",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const onCombine = async (result: DropResult) => {
|
||||||
|
if (!result.combine) return;
|
||||||
|
const destination = result.combine.draggableId;
|
||||||
|
const source = result.draggableId;
|
||||||
|
if (!destination || !source) return;
|
||||||
|
const sourceId = parseInt(source);
|
||||||
|
if (destination.includes("group")) {
|
||||||
|
const groupId = parseInt(destination.split("-")[1]);
|
||||||
|
DealGroupService.addDeal({
|
||||||
|
requestBody: {
|
||||||
|
dealId: sourceId,
|
||||||
|
groupId: groupId,
|
||||||
|
},
|
||||||
|
}).then(async response => {
|
||||||
|
if (!response.ok) {
|
||||||
|
notifications.error({ message: response.message });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await refetchSummaries();
|
||||||
|
await recalculate(sourceId);
|
||||||
|
await refetchSummaries();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
const destinationId = parseInt(destination);
|
||||||
|
// creating new group
|
||||||
|
DealGroupService.createDealGroup({
|
||||||
|
requestBody: {
|
||||||
|
draggingDealId: sourceId,
|
||||||
|
hoveredDealId: destinationId,
|
||||||
|
},
|
||||||
|
}).then(async response => {
|
||||||
|
if (!response.ok) {
|
||||||
|
notifications.error({ message: response.message });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await refetchSummaries();
|
||||||
|
await recalculate(sourceId);
|
||||||
|
await refetchSummaries();
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const moveGroup = async (result: DropResult) => {
|
||||||
|
const groupId = parseInt(result.draggableId.split("-")[1]);
|
||||||
|
const destination = result.destination?.droppableId;
|
||||||
|
if (!destination) return;
|
||||||
|
const statusId = parseInt(destination);
|
||||||
|
DealGroupService.changeStatus({
|
||||||
|
requestBody: {
|
||||||
|
groupId: groupId,
|
||||||
|
newStatus: statusId,
|
||||||
|
},
|
||||||
|
}).then(async response => {
|
||||||
|
if (!response.ok) {
|
||||||
|
notifications.error({ message: response.message });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await refetchSummaries();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const onDealDragEnd = async (result: DropResult) => {
|
||||||
|
if (result.combine) {
|
||||||
|
return onCombine(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
// If there is no changes
|
||||||
|
if (!result.destination || result.destination == result.source) return;
|
||||||
|
|
||||||
|
// Checking for valid dealId
|
||||||
|
if (result.draggableId.includes("group")) {
|
||||||
|
return moveGroup(result);
|
||||||
|
}
|
||||||
|
const dealId = parseInt(result.draggableId);
|
||||||
|
if (isNaN(dealId)) return;
|
||||||
|
|
||||||
|
// Checking for valid deal
|
||||||
|
const summary = summaries.find(summary => summary.id == dealId);
|
||||||
|
if (!summary) return;
|
||||||
|
|
||||||
|
// Checking if it is custom actions
|
||||||
|
const droppableId = result.destination.droppableId;
|
||||||
|
if (droppableId === "DELETE") {
|
||||||
|
onDelete(dealId);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (droppableId === "SUCCESS") {
|
||||||
|
onSuccess(dealId);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const statusId = Number.parseInt(droppableId);
|
||||||
|
const request: Partial<DealSummaryReorderRequest> = {
|
||||||
|
dealId,
|
||||||
|
index: result.destination.index,
|
||||||
|
statusId,
|
||||||
|
};
|
||||||
|
if (statusId == summary.status.id) {
|
||||||
|
DealService.reorderDealSummaries({
|
||||||
|
requestBody: request as DealSummaryReorderRequest,
|
||||||
|
}).then(async response => {
|
||||||
|
setSummaries(response.summaries);
|
||||||
|
await refetchSummaries();
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
DealService.reorderDealSummaries({
|
||||||
|
requestBody: {
|
||||||
|
dealId,
|
||||||
|
statusId,
|
||||||
|
index: result.destination.index,
|
||||||
|
comment: "",
|
||||||
|
deadline: dateWithoutTimezone(new Date()),
|
||||||
|
},
|
||||||
|
}).then(async response => {
|
||||||
|
setSummaries(response.summaries);
|
||||||
|
await refetchSummaries();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
summaries,
|
||||||
|
onDealDragEnd,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default useDealsDnd;
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
const colors = [
|
||||||
|
"#4A90E2",
|
||||||
|
"#D3D3D3",
|
||||||
|
"#F5A623",
|
||||||
|
"#7ED321",
|
||||||
|
"#6A0DAD",
|
||||||
|
"#D0021B",
|
||||||
|
"#417505",
|
||||||
|
];
|
||||||
|
|
||||||
|
const getColumnColor = (colIndex: number) => {
|
||||||
|
if (colIndex < 0) return "";
|
||||||
|
|
||||||
|
if (colIndex >= colors.length) {
|
||||||
|
colIndex %= colors.length;
|
||||||
|
}
|
||||||
|
return colors[colIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
export default getColumnColor;
|
||||||
66
src/components/Dnd/Deals/DealsDndFooter/DealsDndFooter.tsx
Normal file
66
src/components/Dnd/Deals/DealsDndFooter/DealsDndFooter.tsx
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
import { Flex, rem } from "@mantine/core";
|
||||||
|
import classNames from "classnames";
|
||||||
|
import styles from "../../../../pages/DealsPage/ui/DealsPage.module.css";
|
||||||
|
import { Droppable } from "@hello-pangea/dnd";
|
||||||
|
import DragState from "../../../../pages/DealsPage/enums/DragState.ts";
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
dragState: DragState;
|
||||||
|
}
|
||||||
|
|
||||||
|
const DealsDndFooter = ({ dragState }: Props) => {
|
||||||
|
const isDealDragEnded = dragState === DragState.DRAG_ENDED;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Flex
|
||||||
|
justify={"space-between"}
|
||||||
|
gap={rem(10)}>
|
||||||
|
<div
|
||||||
|
className={classNames(
|
||||||
|
styles["delete"],
|
||||||
|
isDealDragEnded && styles["delete-hidden"],
|
||||||
|
)}>
|
||||||
|
<Droppable droppableId={"DELETE"}>
|
||||||
|
{(provided, snapshot) => (
|
||||||
|
<>
|
||||||
|
<div
|
||||||
|
{...provided.droppableProps}
|
||||||
|
ref={provided.innerRef}>
|
||||||
|
{!isDealDragEnded &&
|
||||||
|
!snapshot.isDraggingOver && (
|
||||||
|
<span>Удалить</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
{provided.placeholder}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</Droppable>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
className={classNames(
|
||||||
|
styles["delete"],
|
||||||
|
isDealDragEnded && styles["delete-hidden"],
|
||||||
|
)}>
|
||||||
|
<Droppable droppableId={"SUCCESS"}>
|
||||||
|
{(provided, snapshot) => (
|
||||||
|
<>
|
||||||
|
<div
|
||||||
|
{...provided.droppableProps}
|
||||||
|
ref={provided.innerRef}>
|
||||||
|
{!isDealDragEnded &&
|
||||||
|
!snapshot.isDraggingOver && (
|
||||||
|
<span>
|
||||||
|
Успешно завершена
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
{provided.placeholder}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</Droppable>
|
||||||
|
</div>
|
||||||
|
</Flex>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default DealsDndFooter;
|
||||||
104
src/components/Dnd/Statuses/Status/Status.tsx
Normal file
104
src/components/Dnd/Statuses/Status/Status.tsx
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
import styles from "../../../../pages/DealsPage/ui/DealsPage.module.css";
|
||||||
|
import { Divider, Text, Title } from "@mantine/core";
|
||||||
|
import getColumnColor from "../../Deals/DealsDndColumn/utils/getColumnColor.ts";
|
||||||
|
import { DealSummary, StatusSchema } from "../../../../client";
|
||||||
|
import { getPluralForm } from "../../../../shared/lib/utils.ts";
|
||||||
|
import { sum } from "lodash";
|
||||||
|
import { Draggable, Droppable } from "@hello-pangea/dnd";
|
||||||
|
import DragState from "../../../../pages/DealsPage/enums/DragState.ts";
|
||||||
|
import { useContextMenu } from "mantine-contextmenu";
|
||||||
|
import { IconEdit, IconTrash } from "@tabler/icons-react";
|
||||||
|
import useStatus from "./hooks/useStatus.tsx";
|
||||||
|
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
status: StatusSchema;
|
||||||
|
index: number;
|
||||||
|
summaries: DealSummary[];
|
||||||
|
dragState: DragState;
|
||||||
|
refetch: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Status = ({ summaries, status, dragState, index, refetch }: Props) => {
|
||||||
|
const isDropDisabled = dragState === DragState.DRAG_DEAL;
|
||||||
|
|
||||||
|
const {
|
||||||
|
onEditStatusClick,
|
||||||
|
onDeleteStatusClick,
|
||||||
|
} = useStatus({ refetch });
|
||||||
|
|
||||||
|
const getDealsText = () => {
|
||||||
|
const pluralForm = getPluralForm(
|
||||||
|
summaries.length,
|
||||||
|
"сделка",
|
||||||
|
"сделки",
|
||||||
|
"сделок",
|
||||||
|
);
|
||||||
|
return `${summaries.length} ${pluralForm}: ${sum(summaries.map(summary => summary.totalPrice)).toLocaleString("ru-RU")}₽`;
|
||||||
|
};
|
||||||
|
|
||||||
|
const { showContextMenu } = useContextMenu();
|
||||||
|
|
||||||
|
const contextMenu = () => showContextMenu([
|
||||||
|
{
|
||||||
|
key: "complete",
|
||||||
|
onClick: () => onEditStatusClick(status),
|
||||||
|
title: "Переименовать",
|
||||||
|
icon: <IconEdit />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "delete",
|
||||||
|
onClick: () => onDeleteStatusClick(status),
|
||||||
|
title: "Удалить",
|
||||||
|
icon: <IconTrash />,
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Droppable
|
||||||
|
isDropDisabled={isDropDisabled}
|
||||||
|
droppableId={"status-" + status.id.toString()}
|
||||||
|
direction={"horizontal"}
|
||||||
|
>
|
||||||
|
{provided => (
|
||||||
|
<div
|
||||||
|
{...provided.droppableProps}
|
||||||
|
ref={provided.innerRef}
|
||||||
|
>
|
||||||
|
<Draggable
|
||||||
|
draggableId={"status-" + status.id.toString()}
|
||||||
|
index={status.ordinalNumber}
|
||||||
|
>
|
||||||
|
{(provided) => (
|
||||||
|
<div
|
||||||
|
{...provided.draggableProps}
|
||||||
|
{...provided.dragHandleProps}
|
||||||
|
ref={provided.innerRef}
|
||||||
|
|
||||||
|
className={styles["header-statuses"]}
|
||||||
|
onContextMenu={contextMenu()}
|
||||||
|
>
|
||||||
|
<Title
|
||||||
|
style={{ textAlign: "center" }}
|
||||||
|
size={"h4"}>
|
||||||
|
{status.name}
|
||||||
|
</Title>
|
||||||
|
<Text style={{ textAlign: "center", textWrap: "nowrap" }}>
|
||||||
|
{getDealsText()}
|
||||||
|
</Text>
|
||||||
|
<Divider
|
||||||
|
size={"xl"}
|
||||||
|
my={10}
|
||||||
|
color={getColumnColor(index)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</Draggable>
|
||||||
|
{provided.placeholder}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</Droppable>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Status;
|
||||||
57
src/components/Dnd/Statuses/Status/hooks/useStatus.tsx
Normal file
57
src/components/Dnd/Statuses/Status/hooks/useStatus.tsx
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
import { BoardSchema, StatusSchema, StatusService } from "../../../../../client";
|
||||||
|
import { modals } from "@mantine/modals";
|
||||||
|
import { notifications } from "../../../../../shared/lib/notifications.ts";
|
||||||
|
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
refetch: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const useStatus = ({ refetch }: Props) => {
|
||||||
|
const onEditStatusClick = (status: StatusSchema) => {
|
||||||
|
modals.openContextModal({
|
||||||
|
modal: "statusModal",
|
||||||
|
title: "Редактирование статуса",
|
||||||
|
withCloseButton: false,
|
||||||
|
innerProps: {
|
||||||
|
status,
|
||||||
|
refetch,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const onCreateStatusClick = (board: BoardSchema) => {
|
||||||
|
modals.openContextModal({
|
||||||
|
modal: "statusModal",
|
||||||
|
title: "Добавление статуса",
|
||||||
|
withCloseButton: false,
|
||||||
|
innerProps: {
|
||||||
|
boardId: board.id,
|
||||||
|
refetch,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const onDeleteStatusClick = (status: StatusSchema) => {
|
||||||
|
if (!status) return;
|
||||||
|
StatusService.deleteStatus({
|
||||||
|
statusId: status.id,
|
||||||
|
})
|
||||||
|
.then(({ ok, message }) => {
|
||||||
|
if (!ok) {
|
||||||
|
notifications.error({ message });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
refetch();
|
||||||
|
})
|
||||||
|
.catch(err => console.log(err));
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
onEditStatusClick,
|
||||||
|
onCreateStatusClick,
|
||||||
|
onDeleteStatusClick,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default useStatus;
|
||||||
86
src/components/Dnd/Statuses/Statuses/Statuses.tsx
Normal file
86
src/components/Dnd/Statuses/Statuses/Statuses.tsx
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
import { BoardSchema, DealSummary, StatusSchema } from "../../../../client";
|
||||||
|
import DealsDndColumn from "../../Deals/DealsDndColumn/DealsDndColumn.tsx";
|
||||||
|
import styles from "../../../../pages/DealsPage/ui/DealsPage.module.css";
|
||||||
|
import DealsDndFooter from "../../Deals/DealsDndFooter/DealsDndFooter.tsx";
|
||||||
|
import { Flex, rem, Stack } from "@mantine/core";
|
||||||
|
import { DragDropContext } from "@hello-pangea/dnd";
|
||||||
|
import useDnd from "../../../../pages/DealsPage/hooks/useDnd.tsx";
|
||||||
|
import Status from "../Status/Status.tsx";
|
||||||
|
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
selectedBoard: BoardSchema | null;
|
||||||
|
summariesRaw: DealSummary[];
|
||||||
|
refetchSummaries: () => void;
|
||||||
|
refetchBoards: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Statuses = ({
|
||||||
|
selectedBoard,
|
||||||
|
summariesRaw,
|
||||||
|
refetchSummaries,
|
||||||
|
refetchBoards,
|
||||||
|
}: Props) => {
|
||||||
|
const {
|
||||||
|
summaries,
|
||||||
|
dragState,
|
||||||
|
onDragStart,
|
||||||
|
onDragEnd,
|
||||||
|
} = useDnd({
|
||||||
|
selectedBoard,
|
||||||
|
summariesRaw,
|
||||||
|
refetchSummaries,
|
||||||
|
refetchBoards,
|
||||||
|
});
|
||||||
|
|
||||||
|
const statusDndColumn = (status: StatusSchema, index: number) => {
|
||||||
|
const filteredSummaries = summaries.filter(
|
||||||
|
summary => summary.status.id == status.id,
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Stack key={status.id} gap={0} flex={1} maw={rem(250)}>
|
||||||
|
<Status
|
||||||
|
summaries={filteredSummaries}
|
||||||
|
index={index}
|
||||||
|
status={status}
|
||||||
|
dragState={dragState}
|
||||||
|
refetch={refetchBoards}
|
||||||
|
/>
|
||||||
|
<DealsDndColumn
|
||||||
|
withCreateButton={index === 0}
|
||||||
|
summaries={filteredSummaries}
|
||||||
|
status={status}
|
||||||
|
dragState={dragState}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const statuses = selectedBoard?.dealStatuses
|
||||||
|
.filter(status => !status.isDeleted)
|
||||||
|
.sort((a, b) => a.ordinalNumber - b.ordinalNumber) ?? [];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<DragDropContext
|
||||||
|
onDragStart={onDragStart}
|
||||||
|
onDragEnd={onDragEnd}
|
||||||
|
>
|
||||||
|
<Flex
|
||||||
|
justify={"space-between"}
|
||||||
|
direction={"column"}
|
||||||
|
>
|
||||||
|
<Flex className={styles["statuses"]}>
|
||||||
|
{selectedBoard &&
|
||||||
|
statuses.map(((status: StatusSchema, index: number) => {
|
||||||
|
return statusDndColumn(status, index);
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
</Flex>
|
||||||
|
<DealsDndFooter dragState={dragState} />
|
||||||
|
</Flex>
|
||||||
|
</DragDropContext>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Statuses;
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
import { DropResult } from "@hello-pangea/dnd";
|
||||||
|
import { BoardSchema, StatusSchema, StatusService } from "../../../../../client";
|
||||||
|
import { notifications } from "../../../../../shared/lib/notifications.ts";
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
board: BoardSchema | null;
|
||||||
|
refetch: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const useStatusesDnd = ({ refetch, board }: Props) => {
|
||||||
|
const updateStatusOrder = (status: StatusSchema, newOrdinalNumber: number) => {
|
||||||
|
if (!board) return;
|
||||||
|
|
||||||
|
StatusService.updateStatusOrder({
|
||||||
|
requestBody: {
|
||||||
|
boardId: board.id,
|
||||||
|
statusId: status.id,
|
||||||
|
newOrdinalNumber,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then(({ ok, message }) => {
|
||||||
|
if (!ok) notifications.error({ message });
|
||||||
|
refetch();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const onStatusDragEnd = async (result: DropResult) => {
|
||||||
|
if (!board) return;
|
||||||
|
|
||||||
|
// If there is no changes
|
||||||
|
if (!result.destination || result.destination == result.source) return;
|
||||||
|
|
||||||
|
// Checking for valid dealId
|
||||||
|
const statusIdStr = result.draggableId.replace("status-", "");
|
||||||
|
const statusId = parseInt(statusIdStr);
|
||||||
|
if (isNaN(statusId)) return;
|
||||||
|
|
||||||
|
// Checking for valid deal
|
||||||
|
const status = board.dealStatuses.find(board => board.id == statusId);
|
||||||
|
if (!status) return;
|
||||||
|
|
||||||
|
updateStatusOrder(status, result.destination.index);
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
onStatusDragEnd,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default useStatusesDnd;
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { FC } from "react";
|
import { FC } from "react";
|
||||||
import ObjectSelect, { ObjectSelectProps } from "../ObjectSelect/ObjectSelect.tsx";
|
import ObjectSelect, { ObjectSelectProps } from "../ObjectSelect/ObjectSelect.tsx";
|
||||||
import { UserSchema } from "../../client";
|
import { UserSchema } from "../../client";
|
||||||
import useManagersList from "../../pages/LeadsPage/hooks/useManagersList.tsx";
|
import useManagersList from "../../pages/DealsPage/hooks/useManagersList.tsx";
|
||||||
|
|
||||||
type Props = Omit<
|
type Props = Omit<
|
||||||
ObjectSelectProps<UserSchema | null>,
|
ObjectSelectProps<UserSchema | null>,
|
||||||
@@ -15,6 +15,7 @@ const UserSelect: FC<Props> = props => {
|
|||||||
getLabelFn={(manager: UserSchema) => `${manager.firstName} ${manager.secondName}`}
|
getLabelFn={(manager: UserSchema) => `${manager.firstName} ${manager.secondName}`}
|
||||||
getValueFn={(manager: UserSchema) => manager.id.toString()}
|
getValueFn={(manager: UserSchema) => manager.id.toString()}
|
||||||
clearable
|
clearable
|
||||||
|
searchable
|
||||||
{...props}
|
{...props}
|
||||||
onClear={() => props.onChange(null)}
|
onClear={() => props.onChange(null)}
|
||||||
/>
|
/>
|
||||||
|
|||||||
43
src/components/ProjectSelect/ProjectSelect.tsx
Normal file
43
src/components/ProjectSelect/ProjectSelect.tsx
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
import ObjectSelect, { ObjectSelectProps } from "../ObjectSelect/ObjectSelect.tsx";
|
||||||
|
import { FC, useEffect, useState } from "react";
|
||||||
|
import { ProjectSchema, ProjectService } from "../../client";
|
||||||
|
|
||||||
|
type OtherProps = {
|
||||||
|
data?: ProjectSchema[];
|
||||||
|
}
|
||||||
|
|
||||||
|
type SelectProps = Omit<ObjectSelectProps<ProjectSchema | null>, "data" | "getLabelFn" | "getValueFn">;
|
||||||
|
|
||||||
|
type Props = OtherProps & SelectProps;
|
||||||
|
|
||||||
|
const ProjectSelect: FC<Props> = ({ data, ...props }) => {
|
||||||
|
const [projects, setProjects] = useState<ProjectSchema[]>(data ?? []);
|
||||||
|
|
||||||
|
const onClear = () => props.onChange(null);
|
||||||
|
|
||||||
|
const fetchProjects = () => {
|
||||||
|
ProjectService.getProjects()
|
||||||
|
.then(({ projects }) => {
|
||||||
|
setProjects(projects);
|
||||||
|
})
|
||||||
|
.catch(err => console.log(err));
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!data) {
|
||||||
|
fetchProjects();
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ObjectSelect
|
||||||
|
data={projects}
|
||||||
|
searchable
|
||||||
|
placeholder={"Выберите проект"}
|
||||||
|
onClear={onClear}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default ProjectSelect;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import SimpleUsersTable from "../../pages/LeadsPage/components/SimpleUsersTable/SimpleUsersTable.tsx";
|
import SimpleUsersTable from "../../pages/DealsPage/components/SimpleUsersTable/SimpleUsersTable.tsx";
|
||||||
import { ContextModalProps } from "@mantine/modals";
|
import { ContextModalProps } from "@mantine/modals";
|
||||||
import { Flex, rem } from "@mantine/core";
|
import { Flex, rem } from "@mantine/core";
|
||||||
import { UserSchema } from "../../client";
|
import { UserSchema } from "../../client";
|
||||||
|
|||||||
@@ -3,13 +3,13 @@ import CreateServiceCategoryModal from "../pages/ServicesPage/modals/CreateServi
|
|||||||
import CreateServiceModal from "../pages/ServicesPage/modals/CreateServiceModal.tsx";
|
import CreateServiceModal from "../pages/ServicesPage/modals/CreateServiceModal.tsx";
|
||||||
import createProductModal from "../pages/ProductsPage/modals/CreateProductModal/CreateProductModal.tsx";
|
import createProductModal from "../pages/ProductsPage/modals/CreateProductModal/CreateProductModal.tsx";
|
||||||
import ProductFormModal from "../pages/ClientsPage/modals/ClientFormModal/ClientFormModal.tsx";
|
import ProductFormModal from "../pages/ClientsPage/modals/ClientFormModal/ClientFormModal.tsx";
|
||||||
import AddDealServiceModal from "../pages/LeadsPage/modals/AddDealServiceModal.tsx";
|
import AddDealServiceModal from "../pages/DealsPage/modals/AddDealServiceModal.tsx";
|
||||||
import AddDealProductModal from "../pages/LeadsPage/modals/AddDealProductModal.tsx";
|
import AddDealProductModal from "../pages/DealsPage/modals/AddDealProductModal.tsx";
|
||||||
import PrintBarcodeModal from "./PrintBarcodeModal/PrintBarcodeModal.tsx";
|
import PrintBarcodeModal from "./PrintBarcodeModal/PrintBarcodeModal.tsx";
|
||||||
import AddBarcodeModal from "./AddBarcodeModal/AddBarcodeModal.tsx";
|
import AddBarcodeModal from "./AddBarcodeModal/AddBarcodeModal.tsx";
|
||||||
import BarcodeTemplateFormModal
|
import BarcodeTemplateFormModal
|
||||||
from "../pages/BarcodePage/modals/BarcodeTemplateFormModal/BarcodeTemplateFormModal.tsx";
|
from "../pages/BarcodePage/modals/BarcodeTemplateFormModal/BarcodeTemplateFormModal.tsx";
|
||||||
import ProductServiceFormModal from "../pages/LeadsPage/modals/ProductServiceFormModal.tsx";
|
import ProductServiceFormModal from "../pages/DealsPage/modals/ProductServiceFormModal.tsx";
|
||||||
import UserFormModal from "../pages/AdminPage/modals/UserFormModal/UserFormModal.tsx";
|
import UserFormModal from "../pages/AdminPage/modals/UserFormModal/UserFormModal.tsx";
|
||||||
import EmployeeSelectModal from "./EmployeeSelectModal/EmployeeSelectModal.tsx";
|
import EmployeeSelectModal from "./EmployeeSelectModal/EmployeeSelectModal.tsx";
|
||||||
import EmployeeTableModal from "./EmployeeTableModal/EmployeeTableModal.tsx";
|
import EmployeeTableModal from "./EmployeeTableModal/EmployeeTableModal.tsx";
|
||||||
@@ -18,22 +18,25 @@ import PayRateFormModal from "../pages/AdminPage/modals/PayRateFormModal/PayRate
|
|||||||
import CreatePaymentRecordModal from "../pages/AdminPage/modals/CreatePaymentRecordModal/CreatePaymentRecordModal.tsx";
|
import CreatePaymentRecordModal from "../pages/AdminPage/modals/CreatePaymentRecordModal/CreatePaymentRecordModal.tsx";
|
||||||
import ServiceKitModalForm from "../pages/ServicesPage/modals/ServicesKitModalForm.tsx";
|
import ServiceKitModalForm from "../pages/ServicesPage/modals/ServicesKitModalForm.tsx";
|
||||||
import ServicesKitSelectModal from "./ServicesKitSelectModal/ServicesKitSelectModal.tsx";
|
import ServicesKitSelectModal from "./ServicesKitSelectModal/ServicesKitSelectModal.tsx";
|
||||||
import SelectDealProductsModal from "../pages/LeadsPage/modals/SelectDealProductsModal.tsx";
|
import SelectDealProductsModal from "../pages/DealsPage/modals/SelectDealProductsModal.tsx";
|
||||||
import ShippingWarehouseForm from "../pages/ShippingWarehousesPage/modals/ShippingWarehouseForm.tsx";
|
import ShippingWarehouseForm from "../pages/ShippingWarehousesPage/modals/ShippingWarehouseForm.tsx";
|
||||||
import MarketplaceFormModal from "../pages/MarketplacesPage/modals/MarketplaceFormModal/MarketplaceFormModal.tsx";
|
import MarketplaceFormModal from "../pages/MarketplacesPage/modals/MarketplaceFormModal/MarketplaceFormModal.tsx";
|
||||||
import ServicePriceCategoryForm from "../pages/ServicesPage/modals/ServicePriceCategoryForm.tsx";
|
import ServicePriceCategoryForm from "../pages/ServicesPage/modals/ServicePriceCategoryForm.tsx";
|
||||||
import ScanningModal from "./ScanningModal/ScanningModal.tsx";
|
import ScanningModal from "./ScanningModal/ScanningModal.tsx";
|
||||||
import TransactionFormModal from "../pages/AdminPage/tabs/Transactions/modals/TransactionFormModal.tsx";
|
import TransactionFormModal from "../pages/AdminPage/tabs/Transactions/modals/TransactionFormModal.tsx";
|
||||||
import TransactionTagsModal from "../pages/AdminPage/tabs/Transactions/modals/TransactionTagsModal.tsx";
|
import TransactionTagsModal from "../pages/AdminPage/tabs/Transactions/modals/TransactionTagsModal.tsx";
|
||||||
import ShippingProductModal from "../pages/LeadsPage/tabs/ShippingTab/modals/ShippingProductModal.tsx";
|
import ShippingProductModal from "../pages/DealsPage/tabs/ShippingTab/modals/ShippingProductModal.tsx";
|
||||||
import DepartmentModal from "../pages/AdminPage/tabs/OrganizationalStructureTab/modals/DepartmentModal.tsx";
|
import DepartmentModal from "../pages/AdminPage/tabs/OrganizationalStructureTab/modals/DepartmentModal.tsx";
|
||||||
import AddUserToDepartmentModal
|
import AddUserToDepartmentModal
|
||||||
from "../pages/AdminPage/tabs/OrganizationalStructureTab/modals/AddUserToDepartmentModal.tsx";
|
from "../pages/AdminPage/tabs/OrganizationalStructureTab/modals/AddUserToDepartmentModal.tsx";
|
||||||
import AssignUserModal from "../pages/LeadsPage/tabs/EmployeesTab/modals/AssignUserModal.tsx";
|
import AssignUserModal from "../pages/DealsPage/tabs/EmployeesTab/modals/AssignUserModal.tsx";
|
||||||
import ResidualProductModal from "../pages/ResiduesPage/modals/ResidualProductModal/ResidualProductModal.tsx";
|
import ResidualProductModal from "../pages/ResiduesPage/modals/ResidualProductModal/ResidualProductModal.tsx";
|
||||||
import NewReceiptModal from "../pages/ReceiptPage/components/NewReceipt/modals/NewReceiptModal.tsx";
|
import NewReceiptModal from "../pages/ReceiptPage/components/NewReceipt/modals/NewReceiptModal.tsx";
|
||||||
import ReceiptModal from "../pages/ReceiptPage/components/ReceiptEditing/modals/ReceiptModal.tsx";
|
import ReceiptModal from "../pages/ReceiptPage/components/ReceiptEditing/modals/ReceiptModal.tsx";
|
||||||
import SelectScannedProductModal from "../pages/ReceiptPage/modals/SelectScannedProductModal.tsx";
|
import SelectScannedProductModal from "../pages/ReceiptPage/modals/SelectScannedProductModal.tsx";
|
||||||
|
import ProjectsModal from "../pages/DealsPage/modals/ProjectsModal/ProjectsModal.tsx";
|
||||||
|
import BoardModal from "../pages/DealsPage/modals/BoardModal/BoardModal.tsx";
|
||||||
|
import StatusModal from "../pages/DealsPage/modals/StatusModal/StatusModal.tsx";
|
||||||
|
|
||||||
export const modals = {
|
export const modals = {
|
||||||
enterDeadline: EnterDeadlineModal,
|
enterDeadline: EnterDeadlineModal,
|
||||||
@@ -70,4 +73,7 @@ export const modals = {
|
|||||||
departmentModal: DepartmentModal,
|
departmentModal: DepartmentModal,
|
||||||
addUserToDepartmentModal: AddUserToDepartmentModal,
|
addUserToDepartmentModal: AddUserToDepartmentModal,
|
||||||
assignUserModal: AssignUserModal,
|
assignUserModal: AssignUserModal,
|
||||||
|
projectsModal: ProjectsModal,
|
||||||
|
boardModal: BoardModal,
|
||||||
|
statusModal: StatusModal,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useParams } from "@tanstack/react-router";
|
import { useParams } from "@tanstack/react-router";
|
||||||
import { DealPageContextProvider, useDealPageContext } from "../../LeadsPage/contexts/DealPageContext.tsx";
|
import { DealPageContextProvider, useDealPageContext } from "../../DealsPage/contexts/DealPageContext.tsx";
|
||||||
import ProductAndServiceTab from "../../LeadsPage/tabs/ProductAndServiceTab/ProductAndServiceTab.tsx";
|
import ProductAndServiceTab from "../../DealsPage/tabs/ProductAndServiceTab/ProductAndServiceTab.tsx";
|
||||||
import { FC, useEffect } from "react";
|
import { FC, useEffect } from "react";
|
||||||
import { DealService } from "../../../client";
|
import { DealService } from "../../../client";
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
import { useMemo } from "react";
|
import { useMemo } from "react";
|
||||||
import { MRT_ColumnDef } from "mantine-react-table";
|
import { MRT_ColumnDef } from "mantine-react-table";
|
||||||
import { DealStatusHistorySchema } from "../../../../client";
|
import { DealStatusHistorySchema } from "../../../../client";
|
||||||
import {
|
|
||||||
DealStatus,
|
|
||||||
DealStatusDictionary,
|
|
||||||
} from "../../../../shared/enums/DealStatus.ts";
|
|
||||||
import { Spoiler, Text } from "@mantine/core";
|
import { Spoiler, Text } from "@mantine/core";
|
||||||
|
|
||||||
export const useDealStatusChangeTableColumns = () => {
|
export const useDealStatusChangeTableColumns = () => {
|
||||||
@@ -22,16 +18,12 @@ export const useDealStatusChangeTableColumns = () => {
|
|||||||
`${row.user.firstName} ${row.user.secondName}`,
|
`${row.user.firstName} ${row.user.secondName}`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessorKey: "fromStatus",
|
accessorKey: "fromStatus.name",
|
||||||
header: "Из статуса",
|
header: "Из статуса",
|
||||||
accessorFn: row =>
|
|
||||||
DealStatusDictionary[row.fromStatus as DealStatus],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessorKey: "toStatus",
|
accessorKey: "toStatus.name",
|
||||||
header: "В статус",
|
header: "В статус",
|
||||||
accessorFn: row =>
|
|
||||||
DealStatusDictionary[row.toStatus as DealStatus],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessorKey: "comment",
|
accessorKey: "comment",
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
import ObjectSelect, {
|
|
||||||
ObjectSelectProps,
|
|
||||||
} from "../../../../components/ObjectSelect/ObjectSelect.tsx";
|
|
||||||
import { FC } from "react";
|
|
||||||
import { DealStatuses } from "../../../../shared/enums/DealStatus.ts";
|
|
||||||
|
|
||||||
type DealStatus = {
|
|
||||||
name: string;
|
|
||||||
id: number;
|
|
||||||
};
|
|
||||||
type Props = Omit<ObjectSelectProps<DealStatus>, "data">;
|
|
||||||
|
|
||||||
const DealStatusSelect: FC<Props> = props => {
|
|
||||||
const data: DealStatus[] = DealStatuses;
|
|
||||||
return (
|
|
||||||
<ObjectSelect
|
|
||||||
data={data}
|
|
||||||
{...props}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
export default DealStatusSelect;
|
|
||||||
@@ -6,7 +6,7 @@ import { BaseTable } from "../../../../components/BaseTable/BaseTable.tsx";
|
|||||||
import { ActionIcon, Flex, Tooltip } from "@mantine/core";
|
import { ActionIcon, Flex, Tooltip } from "@mantine/core";
|
||||||
import { IconEdit } from "@tabler/icons-react";
|
import { IconEdit } from "@tabler/icons-react";
|
||||||
import { MRT_TableOptions } from "mantine-react-table";
|
import { MRT_TableOptions } from "mantine-react-table";
|
||||||
import { useDealPageContext } from "../../../LeadsPage/contexts/DealPageContext.tsx";
|
import { useDealPageContext } from "../../contexts/DealPageContext.tsx";
|
||||||
|
|
||||||
type RestProps = {
|
type RestProps = {
|
||||||
viewOnly?: boolean;
|
viewOnly?: boolean;
|
||||||
|
|||||||
@@ -42,15 +42,6 @@ const useDealsTableColumns = () => {
|
|||||||
header: "Клиент",
|
header: "Клиент",
|
||||||
enableSorting: false,
|
enableSorting: false,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
Cell: ({ row }) =>
|
|
||||||
new Date(row.original.deadline || 0).toLocaleString("ru-RU"),
|
|
||||||
accessorKey: "deadline",
|
|
||||||
header: "Дедлайн",
|
|
||||||
sortingFn: (rowA, rowB) =>
|
|
||||||
new Date(rowB.original.deadline || 0).getTime() -
|
|
||||||
new Date(rowA.original.deadline || 0).getTime(),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
header: "Общая стоимость",
|
header: "Общая стоимость",
|
||||||
Cell: ({ row }) =>
|
Cell: ({ row }) =>
|
||||||
|
|||||||
@@ -0,0 +1,127 @@
|
|||||||
|
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 PageBlock from "../../../../components/PageBlock/PageBlock.tsx";
|
||||||
|
import DisplayMode from "../../enums/DisplayMode.ts";
|
||||||
|
import { UseFormReturnType } from "@mantine/form";
|
||||||
|
import { DealsPageState } from "../../hooks/useDealsPageState.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";
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
displayMode: DisplayMode;
|
||||||
|
setDisplayMode: React.Dispatch<React.SetStateAction<DisplayMode>>;
|
||||||
|
form: UseFormReturnType<DealsPageState>;
|
||||||
|
projects: ProjectSchema[];
|
||||||
|
refetchProjects: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const LeadsPageHeader = ({
|
||||||
|
displayMode,
|
||||||
|
setDisplayMode,
|
||||||
|
form,
|
||||||
|
projects,
|
||||||
|
refetchProjects,
|
||||||
|
}: Props) => {
|
||||||
|
const openModal = () => {
|
||||||
|
modals.openContextModal({
|
||||||
|
modal: "projectsModal",
|
||||||
|
title: "Проекты",
|
||||||
|
innerProps: {
|
||||||
|
onUpdate: refetchProjects,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const getHeaderInputsBoard = () => {
|
||||||
|
return (
|
||||||
|
<div className={styles["top-panel"]}
|
||||||
|
style={{
|
||||||
|
display: displayMode === DisplayMode.BOARD ? "flex" : "none",
|
||||||
|
}}>
|
||||||
|
<ActionIcon
|
||||||
|
size={"lg"}
|
||||||
|
onClick={openModal}
|
||||||
|
variant={"default"}>
|
||||||
|
<IconEdit />
|
||||||
|
</ActionIcon>
|
||||||
|
<ObjectSelect
|
||||||
|
placeholder={"Выберите проект"}
|
||||||
|
data={projects}
|
||||||
|
{...form.getInputProps("project")}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const getHeaderInputsTable = () => {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={styles["top-panel"]}
|
||||||
|
style={{
|
||||||
|
display: displayMode === DisplayMode.TABLE ? "flex" : "none",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<DealsTableFiltersModal
|
||||||
|
form={form}
|
||||||
|
projects={projects}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<PageBlock style={{ flex: 0 }}>
|
||||||
|
<Flex
|
||||||
|
align={"center"}
|
||||||
|
justify={"space-between"}>
|
||||||
|
<Flex
|
||||||
|
gap={rem(10)}
|
||||||
|
direction={"column"}
|
||||||
|
align={"center"}>
|
||||||
|
<Text size={"xs"}>Вид</Text>
|
||||||
|
<Flex gap={rem(10)}>
|
||||||
|
<ActionIcon
|
||||||
|
onClick={() =>
|
||||||
|
setDisplayMode(DisplayMode.BOARD)
|
||||||
|
}
|
||||||
|
variant={
|
||||||
|
displayMode === DisplayMode.BOARD
|
||||||
|
? "filled"
|
||||||
|
: "default"
|
||||||
|
}>
|
||||||
|
<IconMenuDeep
|
||||||
|
style={{ rotate: "-90deg" }}
|
||||||
|
/>
|
||||||
|
</ActionIcon>
|
||||||
|
<ActionIcon
|
||||||
|
onClick={() =>
|
||||||
|
setDisplayMode(DisplayMode.TABLE)
|
||||||
|
}
|
||||||
|
variant={
|
||||||
|
displayMode === DisplayMode.TABLE
|
||||||
|
? "filled"
|
||||||
|
: "default"
|
||||||
|
}>
|
||||||
|
<IconMenu2 />
|
||||||
|
</ActionIcon>
|
||||||
|
</Flex>
|
||||||
|
</Flex>
|
||||||
|
<motion.div
|
||||||
|
key={displayMode}
|
||||||
|
initial={{ opacity: 0 }}
|
||||||
|
animate={{ opacity: 1 }}
|
||||||
|
transition={{ duration: 0.2 }}>
|
||||||
|
{getHeaderInputsTable()}
|
||||||
|
{getHeaderInputsBoard()}
|
||||||
|
</motion.div>
|
||||||
|
</Flex>
|
||||||
|
</PageBlock>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default LeadsPageHeader;
|
||||||
@@ -3,7 +3,7 @@ import { useDisclosure } from "@mantine/hooks";
|
|||||||
import { DealsWithExcelForm, ProductExcelData } from "../drawers/PrefillDealWithExcelDrawer/types.tsx";
|
import { DealsWithExcelForm, ProductExcelData } from "../drawers/PrefillDealWithExcelDrawer/types.tsx";
|
||||||
import { FileWithPath } from "@mantine/dropzone";
|
import { FileWithPath } from "@mantine/dropzone";
|
||||||
import { notifications } from "../../../shared/lib/notifications.ts";
|
import { notifications } from "../../../shared/lib/notifications.ts";
|
||||||
import { DealService, type ProductFromExcelSchema, ProductSchema } from "../../../client";
|
import { DealService, type ProductFromExcelSchema, ProductSchema, StatusSchema } from "../../../client";
|
||||||
import UseExcelDropzone from "../../../types/UseExcelDropzone.tsx";
|
import UseExcelDropzone from "../../../types/UseExcelDropzone.tsx";
|
||||||
import { useForm, UseFormReturnType } from "@mantine/form";
|
import { useForm, UseFormReturnType } from "@mantine/form";
|
||||||
import { useDealPageContext } from "./DealPageContext.tsx";
|
import { useDealPageContext } from "./DealPageContext.tsx";
|
||||||
@@ -16,7 +16,7 @@ type PrefillDealsWithExcelContextState = {
|
|||||||
onProductSelectChange: (barcode: string, selectedProduct: ProductSchema) => void,
|
onProductSelectChange: (barcode: string, selectedProduct: ProductSchema) => void,
|
||||||
onDrop: (files: FileWithPath[]) => void;
|
onDrop: (files: FileWithPath[]) => void;
|
||||||
excelDropzone: UseExcelDropzone;
|
excelDropzone: UseExcelDropzone;
|
||||||
createDeals: (values: DealsWithExcelForm) => void;
|
createDeals: (values: DealsWithExcelForm, status: StatusSchema) => void;
|
||||||
form: UseFormReturnType<DealsWithExcelForm>;
|
form: UseFormReturnType<DealsWithExcelForm>;
|
||||||
errors: string[];
|
errors: string[];
|
||||||
};
|
};
|
||||||
@@ -24,6 +24,7 @@ type PrefillDealsWithExcelContextState = {
|
|||||||
const PrefillDealsWithExcelContext = createContext<PrefillDealsWithExcelContextState | undefined>(
|
const PrefillDealsWithExcelContext = createContext<PrefillDealsWithExcelContextState | undefined>(
|
||||||
undefined,
|
undefined,
|
||||||
);
|
);
|
||||||
|
|
||||||
const usePrefillDealsWithExcelContextState = () => {
|
const usePrefillDealsWithExcelContextState = () => {
|
||||||
const [prefillWithExcelOpened, { open, close }] = useDisclosure(false);
|
const [prefillWithExcelOpened, { open, close }] = useDisclosure(false);
|
||||||
const { refetchDeals } = useDealPageContext();
|
const { refetchDeals } = useDealPageContext();
|
||||||
@@ -90,7 +91,7 @@ const usePrefillDealsWithExcelContextState = () => {
|
|||||||
form.reset();
|
form.reset();
|
||||||
};
|
};
|
||||||
|
|
||||||
const createDeals = (values: DealsWithExcelForm) => {
|
const createDeals = (values: DealsWithExcelForm, status: StatusSchema) => {
|
||||||
const products: ProductFromExcelSchema[] = barcodeProductsMap.entries().map(([, productData]) => {
|
const products: ProductFromExcelSchema[] = barcodeProductsMap.entries().map(([, productData]) => {
|
||||||
return {
|
return {
|
||||||
productId: productData.selectedProduct!.id,
|
productId: productData.selectedProduct!.id,
|
||||||
@@ -102,6 +103,7 @@ const usePrefillDealsWithExcelContextState = () => {
|
|||||||
requestBody: {
|
requestBody: {
|
||||||
products,
|
products,
|
||||||
clientId: values.client?.id ?? -1,
|
clientId: values.client?.id ?? -1,
|
||||||
|
statusId: status.id,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then(({ ok, message }) => {
|
.then(({ ok, message }) => {
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { FC } from "react";
|
import { FC, useState } from "react";
|
||||||
import { useDealPageContext } from "../../../contexts/DealPageContext.tsx";
|
import { useDealPageContext } from "../../../contexts/DealPageContext.tsx";
|
||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
@@ -14,8 +14,14 @@ import {
|
|||||||
Tooltip,
|
Tooltip,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { useForm } from "@mantine/form";
|
import { useForm } from "@mantine/form";
|
||||||
import { ClientService, DealSchema, DealService, ShippingWarehouseSchema } from "../../../../../client";
|
import {
|
||||||
import { DealStatus, DealStatusDictionary } from "../../../../../shared/enums/DealStatus.ts";
|
ClientService,
|
||||||
|
DealSchema,
|
||||||
|
DealService,
|
||||||
|
ProjectSchema,
|
||||||
|
ShippingWarehouseSchema,
|
||||||
|
StatusSchema,
|
||||||
|
} from "../../../../../client";
|
||||||
import { isEqual } from "lodash";
|
import { isEqual } from "lodash";
|
||||||
import { notifications } from "../../../../../shared/lib/notifications.ts";
|
import { notifications } from "../../../../../shared/lib/notifications.ts";
|
||||||
import { useQueryClient } from "@tanstack/react-query";
|
import { useQueryClient } from "@tanstack/react-query";
|
||||||
@@ -27,10 +33,13 @@ import ButtonCopy from "../../../../../components/ButtonCopy/ButtonCopy.tsx";
|
|||||||
import FileSaver from "file-saver";
|
import FileSaver from "file-saver";
|
||||||
import { dateWithoutTimezone, getCurrentDateTimeForFilename } from "../../../../../shared/lib/date.ts";
|
import { dateWithoutTimezone, getCurrentDateTimeForFilename } from "../../../../../shared/lib/date.ts";
|
||||||
import { IconBarcode, IconPrinter } from "@tabler/icons-react";
|
import { IconBarcode, IconPrinter } from "@tabler/icons-react";
|
||||||
import styles from "../../../ui/LeadsPage.module.css";
|
import styles from "../../../ui/DealsPage.module.css";
|
||||||
import { base64ToBlob } from "../../../../../shared/lib/utils.ts";
|
import { base64ToBlob } from "../../../../../shared/lib/utils.ts";
|
||||||
import { DatePickerInput } from "@mantine/dates";
|
import { DatePickerInput } from "@mantine/dates";
|
||||||
import ManagerSelect from "../../../../../components/ManagerSelect/ManagerSelect.tsx";
|
import ManagerSelect from "../../../../../components/ManagerSelect/ManagerSelect.tsx";
|
||||||
|
import ProjectSelect from "../../../../../components/ProjectSelect/ProjectSelect.tsx";
|
||||||
|
import BoardSelect from "../../../../../components/BoardSelect/BoardSelect.tsx";
|
||||||
|
import DealStatusSelect from "../../../../../components/DealStatusSelect/DealStatusSelect.tsx";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
deal: DealSchema;
|
deal: DealSchema;
|
||||||
@@ -42,6 +51,7 @@ const Content: FC<Props> = ({ deal }) => {
|
|||||||
const { setSelectedDeal } = useDealPageContext();
|
const { setSelectedDeal } = useDealPageContext();
|
||||||
const clipboard = useClipboard();
|
const clipboard = useClipboard();
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
|
const [project, setProject] = useState<ProjectSchema | null>(deal.board.project);
|
||||||
|
|
||||||
// ignore typescript
|
// ignore typescript
|
||||||
|
|
||||||
@@ -61,6 +71,8 @@ const Content: FC<Props> = ({ deal }) => {
|
|||||||
value.length > 0
|
value.length > 0
|
||||||
? null
|
? null
|
||||||
: "Название сделки не может быть пустым",
|
: "Название сделки не может быть пустым",
|
||||||
|
status: (value: StatusSchema) =>
|
||||||
|
!value && "Статус для сделки не выбран",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const updateDealInfo = async (values: DealGeneralFormType) => {
|
const updateDealInfo = async (values: DealGeneralFormType) => {
|
||||||
@@ -147,15 +159,20 @@ const Content: FC<Props> = ({ deal }) => {
|
|||||||
"ru-RU",
|
"ru-RU",
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<TextInput
|
<ProjectSelect
|
||||||
disabled
|
value={project}
|
||||||
placeholder={"Текущий статус"}
|
onChange={setProject}
|
||||||
label={"Текущий статус"}
|
label={"Проект"}
|
||||||
value={
|
/>
|
||||||
DealStatusDictionary[
|
<BoardSelect
|
||||||
deal.currentStatus as DealStatus
|
project={project}
|
||||||
]
|
{...form.getInputProps("board")}
|
||||||
}
|
label={"Доска"}
|
||||||
|
/>
|
||||||
|
<DealStatusSelect
|
||||||
|
board={form.values.board}
|
||||||
|
{...form.getInputProps("status")}
|
||||||
|
label={"Статус"}
|
||||||
/>
|
/>
|
||||||
{deal.category && (
|
{deal.category && (
|
||||||
<TextInput
|
<TextInput
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user