feat: income
This commit is contained in:
@@ -23,9 +23,9 @@ export type { BarcodeTemplateUpdateRequest } from './models/BarcodeTemplateUpdat
|
|||||||
export type { BarcodeTemplateUpdateResponse } from './models/BarcodeTemplateUpdateResponse';
|
export type { BarcodeTemplateUpdateResponse } from './models/BarcodeTemplateUpdateResponse';
|
||||||
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 { BaseExpenseTagSchema } from './models/BaseExpenseTagSchema';
|
|
||||||
export type { BaseMarketplaceSchema } from './models/BaseMarketplaceSchema';
|
export type { BaseMarketplaceSchema } from './models/BaseMarketplaceSchema';
|
||||||
export type { BaseShippingWarehouseSchema } from './models/BaseShippingWarehouseSchema';
|
export type { BaseShippingWarehouseSchema } from './models/BaseShippingWarehouseSchema';
|
||||||
|
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 { Body_upload_passport_image } from './models/Body_upload_passport_image';
|
export type { Body_upload_passport_image } from './models/Body_upload_passport_image';
|
||||||
@@ -50,7 +50,6 @@ 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';
|
||||||
export type { CreateDealBillResponse } from './models/CreateDealBillResponse';
|
export type { CreateDealBillResponse } from './models/CreateDealBillResponse';
|
||||||
export type { CreateExpenseTagRequest } from './models/CreateExpenseTagRequest';
|
|
||||||
export type { CreateMarketplaceRequest } from './models/CreateMarketplaceRequest';
|
export type { CreateMarketplaceRequest } from './models/CreateMarketplaceRequest';
|
||||||
export type { CreateMarketplaceResponse } from './models/CreateMarketplaceResponse';
|
export type { CreateMarketplaceResponse } from './models/CreateMarketplaceResponse';
|
||||||
export type { CreatePalletResponse } from './models/CreatePalletResponse';
|
export type { CreatePalletResponse } from './models/CreatePalletResponse';
|
||||||
@@ -69,6 +68,7 @@ export type { CreateShippingProductSchema } from './models/CreateShippingProduct
|
|||||||
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 { CreateTaskResponse } from './models/CreateTaskResponse';
|
export type { CreateTaskResponse } from './models/CreateTaskResponse';
|
||||||
|
export type { CreateTransactionTagRequest } from './models/CreateTransactionTagRequest';
|
||||||
export type { CreateUserRequest } from './models/CreateUserRequest';
|
export type { CreateUserRequest } from './models/CreateUserRequest';
|
||||||
export type { CreateUserResponse } from './models/CreateUserResponse';
|
export type { CreateUserResponse } from './models/CreateUserResponse';
|
||||||
export type { DealAddKitRequest } from './models/DealAddKitRequest';
|
export type { DealAddKitRequest } from './models/DealAddKitRequest';
|
||||||
@@ -139,8 +139,6 @@ export type { DealUpdateServiceQuantityResponse } from './models/DealUpdateServi
|
|||||||
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 { DeleteBoxResponse } from './models/DeleteBoxResponse';
|
export type { DeleteBoxResponse } from './models/DeleteBoxResponse';
|
||||||
export type { DeleteExpenseResponse } from './models/DeleteExpenseResponse';
|
|
||||||
export type { DeleteExpenseTagResponse } from './models/DeleteExpenseTagResponse';
|
|
||||||
export type { DeleteMarketplaceRequest } from './models/DeleteMarketplaceRequest';
|
export type { DeleteMarketplaceRequest } from './models/DeleteMarketplaceRequest';
|
||||||
export type { DeleteMarketplaceResponse } from './models/DeleteMarketplaceResponse';
|
export type { DeleteMarketplaceResponse } from './models/DeleteMarketplaceResponse';
|
||||||
export type { DeletePalletResponse } from './models/DeletePalletResponse';
|
export type { DeletePalletResponse } from './models/DeletePalletResponse';
|
||||||
@@ -156,8 +154,8 @@ 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 { ExpenseSchemaBase } from './models/ExpenseSchemaBase';
|
export type { DeleteTransactionResponse } from './models/DeleteTransactionResponse';
|
||||||
export type { ExpenseTagSchema } from './models/ExpenseTagSchema';
|
export type { DeleteTransactionTagResponse } from './models/DeleteTransactionTagResponse';
|
||||||
export type { FinishPauseByShiftIdResponse } from './models/FinishPauseByShiftIdResponse';
|
export type { FinishPauseByShiftIdResponse } from './models/FinishPauseByShiftIdResponse';
|
||||||
export type { FinishPauseByUserIdResponse } from './models/FinishPauseByUserIdResponse';
|
export type { FinishPauseByUserIdResponse } from './models/FinishPauseByUserIdResponse';
|
||||||
export type { FinishShiftByIdResponse } from './models/FinishShiftByIdResponse';
|
export type { FinishShiftByIdResponse } from './models/FinishShiftByIdResponse';
|
||||||
@@ -166,8 +164,6 @@ export type { GetAllBarcodeTemplateAttributesResponse } from './models/GetAllBar
|
|||||||
export type { GetAllBarcodeTemplateSizesResponse } from './models/GetAllBarcodeTemplateSizesResponse';
|
export type { GetAllBarcodeTemplateSizesResponse } from './models/GetAllBarcodeTemplateSizesResponse';
|
||||||
export type { GetAllBarcodeTemplatesResponse } from './models/GetAllBarcodeTemplatesResponse';
|
export type { GetAllBarcodeTemplatesResponse } from './models/GetAllBarcodeTemplatesResponse';
|
||||||
export type { GetAllBaseMarketplacesResponse } from './models/GetAllBaseMarketplacesResponse';
|
export type { GetAllBaseMarketplacesResponse } from './models/GetAllBaseMarketplacesResponse';
|
||||||
export type { GetAllExpensesResponse } from './models/GetAllExpensesResponse';
|
|
||||||
export type { GetAllExpenseTagsResponse } from './models/GetAllExpenseTagsResponse';
|
|
||||||
export type { GetAllPayRatesResponse } from './models/GetAllPayRatesResponse';
|
export type { GetAllPayRatesResponse } from './models/GetAllPayRatesResponse';
|
||||||
export type { GetAllPayrollSchemeResponse } from './models/GetAllPayrollSchemeResponse';
|
export type { GetAllPayrollSchemeResponse } from './models/GetAllPayrollSchemeResponse';
|
||||||
export type { GetAllPositionsResponse } from './models/GetAllPositionsResponse';
|
export type { GetAllPositionsResponse } from './models/GetAllPositionsResponse';
|
||||||
@@ -175,6 +171,9 @@ export type { GetAllPriceCategoriesResponse } from './models/GetAllPriceCategori
|
|||||||
export type { GetAllRolesResponse } from './models/GetAllRolesResponse';
|
export type { GetAllRolesResponse } from './models/GetAllRolesResponse';
|
||||||
export type { GetAllServicesKitsResponse } from './models/GetAllServicesKitsResponse';
|
export type { GetAllServicesKitsResponse } from './models/GetAllServicesKitsResponse';
|
||||||
export type { GetAllShippingWarehousesResponse } from './models/GetAllShippingWarehousesResponse';
|
export type { GetAllShippingWarehousesResponse } from './models/GetAllShippingWarehousesResponse';
|
||||||
|
export type { GetAllTransactionsRequest } from './models/GetAllTransactionsRequest';
|
||||||
|
export type { GetAllTransactionsResponse } from './models/GetAllTransactionsResponse';
|
||||||
|
export type { GetAllTransactionTagsResponse } from './models/GetAllTransactionTagsResponse';
|
||||||
export type { GetAllUsersResponse } from './models/GetAllUsersResponse';
|
export type { GetAllUsersResponse } from './models/GetAllUsersResponse';
|
||||||
export type { GetBarcodeTemplateByIdRequest } from './models/GetBarcodeTemplateByIdRequest';
|
export type { GetBarcodeTemplateByIdRequest } from './models/GetBarcodeTemplateByIdRequest';
|
||||||
export type { GetBarcodeTemplateByIdResponse } from './models/GetBarcodeTemplateByIdResponse';
|
export type { GetBarcodeTemplateByIdResponse } from './models/GetBarcodeTemplateByIdResponse';
|
||||||
@@ -196,6 +195,7 @@ export type { GetProfitTableDataResponse } from './models/GetProfitTableDataResp
|
|||||||
export type { GetServiceKitSchema } from './models/GetServiceKitSchema';
|
export type { GetServiceKitSchema } from './models/GetServiceKitSchema';
|
||||||
export type { GetTimeTrackingRecordsRequest } from './models/GetTimeTrackingRecordsRequest';
|
export type { GetTimeTrackingRecordsRequest } from './models/GetTimeTrackingRecordsRequest';
|
||||||
export type { GetTimeTrackingRecordsResponse } from './models/GetTimeTrackingRecordsResponse';
|
export type { GetTimeTrackingRecordsResponse } from './models/GetTimeTrackingRecordsResponse';
|
||||||
|
export type { GetTransactionTagsResponse } from './models/GetTransactionTagsResponse';
|
||||||
export type { GetWorkShiftsResponse } from './models/GetWorkShiftsResponse';
|
export type { GetWorkShiftsResponse } from './models/GetWorkShiftsResponse';
|
||||||
export type { GroupBillRequestSchema } from './models/GroupBillRequestSchema';
|
export type { GroupBillRequestSchema } from './models/GroupBillRequestSchema';
|
||||||
export type { HTTPValidationError } from './models/HTTPValidationError';
|
export type { HTTPValidationError } from './models/HTTPValidationError';
|
||||||
@@ -266,14 +266,11 @@ export type { SynchronizeMarketplaceRequest } from './models/SynchronizeMarketpl
|
|||||||
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 { TransactionTagSchema } from './models/TransactionTagSchema';
|
||||||
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';
|
||||||
export type { UpdateExpenseRequest } from './models/UpdateExpenseRequest';
|
|
||||||
export type { UpdateExpenseResponse } from './models/UpdateExpenseResponse';
|
|
||||||
export type { UpdateExpenseSchema } from './models/UpdateExpenseSchema';
|
|
||||||
export type { UpdateExpenseTagRequest } from './models/UpdateExpenseTagRequest';
|
|
||||||
export type { UpdateExpenseTagResponse } from './models/UpdateExpenseTagResponse';
|
|
||||||
export type { UpdateMarketplaceRequest } from './models/UpdateMarketplaceRequest';
|
export type { UpdateMarketplaceRequest } from './models/UpdateMarketplaceRequest';
|
||||||
export type { UpdateMarketplaceResponse } from './models/UpdateMarketplaceResponse';
|
export type { UpdateMarketplaceResponse } from './models/UpdateMarketplaceResponse';
|
||||||
export type { UpdatePayRateRequest } from './models/UpdatePayRateRequest';
|
export type { UpdatePayRateRequest } from './models/UpdatePayRateRequest';
|
||||||
@@ -290,6 +287,11 @@ export type { UpdateShippingWarehouseRequest } from './models/UpdateShippingWare
|
|||||||
export type { UpdateShippingWarehouseResponse } from './models/UpdateShippingWarehouseResponse';
|
export type { UpdateShippingWarehouseResponse } from './models/UpdateShippingWarehouseResponse';
|
||||||
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 { UpdateTransactionResponse } from './models/UpdateTransactionResponse';
|
||||||
|
export type { UpdateTransactionSchema } from './models/UpdateTransactionSchema';
|
||||||
|
export type { UpdateTransactionTagRequest } from './models/UpdateTransactionTagRequest';
|
||||||
|
export type { UpdateTransactionTagResponse } from './models/UpdateTransactionTagResponse';
|
||||||
export type { UpdateUserRequest } from './models/UpdateUserRequest';
|
export type { UpdateUserRequest } from './models/UpdateUserRequest';
|
||||||
export type { UpdateUserResponse } from './models/UpdateUserResponse';
|
export type { UpdateUserResponse } from './models/UpdateUserResponse';
|
||||||
export type { UploadPassportImageResponse } from './models/UploadPassportImageResponse';
|
export type { UploadPassportImageResponse } from './models/UploadPassportImageResponse';
|
||||||
@@ -305,7 +307,6 @@ export { BarcodeService } from './services/BarcodeService';
|
|||||||
export { BillingService } from './services/BillingService';
|
export { BillingService } from './services/BillingService';
|
||||||
export { ClientService } from './services/ClientService';
|
export { ClientService } from './services/ClientService';
|
||||||
export { DealService } from './services/DealService';
|
export { DealService } from './services/DealService';
|
||||||
export { ExpenseService } from './services/ExpenseService';
|
|
||||||
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';
|
||||||
@@ -317,5 +318,6 @@ export { ShippingWarehouseService } from './services/ShippingWarehouseService';
|
|||||||
export { StatisticsService } from './services/StatisticsService';
|
export { StatisticsService } from './services/StatisticsService';
|
||||||
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 { UserService } from './services/UserService';
|
export { UserService } from './services/UserService';
|
||||||
export { WorkShiftsService } from './services/WorkShiftsService';
|
export { WorkShiftsService } from './services/WorkShiftsService';
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
/* istanbul ignore file */
|
/* istanbul ignore file */
|
||||||
/* tslint:disable */
|
/* tslint:disable */
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
export type BaseExpenseTagSchema = {
|
export type BaseTransactionTagSchema = {
|
||||||
name: string;
|
name: string;
|
||||||
|
isIncome: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
9
src/client/models/CreateTransactionTagRequest.ts
Normal file
9
src/client/models/CreateTransactionTagRequest.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
import type { BaseTransactionTagSchema } from './BaseTransactionTagSchema';
|
||||||
|
export type CreateTransactionTagRequest = {
|
||||||
|
tag: BaseTransactionTagSchema;
|
||||||
|
};
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
/* istanbul ignore file */
|
/* istanbul ignore file */
|
||||||
/* tslint:disable */
|
/* tslint:disable */
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
export type UpdateExpenseResponse = {
|
export type DeleteTransactionResponse = {
|
||||||
ok: boolean;
|
ok: boolean;
|
||||||
message: string;
|
message: string;
|
||||||
};
|
};
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
/* istanbul ignore file */
|
/* istanbul ignore file */
|
||||||
/* tslint:disable */
|
/* tslint:disable */
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
export type DeleteExpenseResponse = {
|
export type DeleteTransactionTagResponse = {
|
||||||
ok: boolean;
|
ok: boolean;
|
||||||
message: string;
|
message: string;
|
||||||
};
|
};
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
/* generated using openapi-typescript-codegen -- do not edit */
|
|
||||||
/* istanbul ignore file */
|
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
import type { ExpenseTagSchema } from './ExpenseTagSchema';
|
|
||||||
export type GetAllExpenseTagsResponse = {
|
|
||||||
tags: Array<ExpenseTagSchema>;
|
|
||||||
};
|
|
||||||
|
|
||||||
9
src/client/models/GetAllTransactionTagsResponse.ts
Normal file
9
src/client/models/GetAllTransactionTagsResponse.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
import type { TransactionTagSchema } from './TransactionTagSchema';
|
||||||
|
export type GetAllTransactionTagsResponse = {
|
||||||
|
tags: Array<TransactionTagSchema>;
|
||||||
|
};
|
||||||
|
|
||||||
8
src/client/models/GetAllTransactionsRequest.ts
Normal file
8
src/client/models/GetAllTransactionsRequest.ts
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
export type GetAllTransactionsRequest = {
|
||||||
|
isIncome: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
@@ -2,10 +2,10 @@
|
|||||||
/* istanbul ignore file */
|
/* istanbul ignore file */
|
||||||
/* tslint:disable */
|
/* tslint:disable */
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import type { ExpenseSchemaBase } from './ExpenseSchemaBase';
|
|
||||||
import type { PaginationInfoSchema } from './PaginationInfoSchema';
|
import type { PaginationInfoSchema } from './PaginationInfoSchema';
|
||||||
export type GetAllExpensesResponse = {
|
import type { TransactionSchemaBase } from './TransactionSchemaBase';
|
||||||
expenses: Array<ExpenseSchemaBase>;
|
export type GetAllTransactionsResponse = {
|
||||||
|
transactions: Array<TransactionSchemaBase>;
|
||||||
paginationInfo: PaginationInfoSchema;
|
paginationInfo: PaginationInfoSchema;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -8,6 +8,7 @@ export type GetProfitChartDataRequest = {
|
|||||||
baseMarketplaceKey: string;
|
baseMarketplaceKey: string;
|
||||||
dealStatusId: number;
|
dealStatusId: number;
|
||||||
managerId: number;
|
managerId: number;
|
||||||
tagId: number;
|
expenseTagId: number;
|
||||||
|
incomeTagId: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ export type GetProfitTableDataRequest = {
|
|||||||
baseMarketplaceKey: string;
|
baseMarketplaceKey: string;
|
||||||
dealStatusId: number;
|
dealStatusId: number;
|
||||||
managerId: number;
|
managerId: number;
|
||||||
tagId: number;
|
expenseTagId: number;
|
||||||
|
incomeTagId: number;
|
||||||
groupTableBy: ProfitTableGroupBy;
|
groupTableBy: ProfitTableGroupBy;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
9
src/client/models/GetTransactionTagsResponse.ts
Normal file
9
src/client/models/GetTransactionTagsResponse.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
import type { TransactionTagSchema } from './TransactionTagSchema';
|
||||||
|
export type GetTransactionTagsResponse = {
|
||||||
|
tags: Array<TransactionTagSchema>;
|
||||||
|
};
|
||||||
|
|
||||||
@@ -2,15 +2,16 @@
|
|||||||
/* istanbul ignore file */
|
/* istanbul ignore file */
|
||||||
/* tslint:disable */
|
/* tslint:disable */
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import type { ExpenseTagSchema } from './ExpenseTagSchema';
|
import type { TransactionTagSchema } from './TransactionTagSchema';
|
||||||
import type { UserSchema } from './UserSchema';
|
import type { UserSchema } from './UserSchema';
|
||||||
export type ExpenseSchemaBase = {
|
export type TransactionSchemaBase = {
|
||||||
id: number;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
comment: string;
|
comment: string;
|
||||||
amount: number;
|
amount: number;
|
||||||
createdByUser: UserSchema;
|
createdByUser: UserSchema;
|
||||||
spentDate: string;
|
spentDate: string;
|
||||||
tags: Array<ExpenseTagSchema>;
|
isIncome: boolean;
|
||||||
|
tags: Array<TransactionTagSchema>;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -2,8 +2,9 @@
|
|||||||
/* istanbul ignore file */
|
/* istanbul ignore file */
|
||||||
/* tslint:disable */
|
/* tslint:disable */
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
export type ExpenseTagSchema = {
|
export type TransactionTagSchema = {
|
||||||
name: string;
|
name: string;
|
||||||
|
isIncome: boolean;
|
||||||
id: number;
|
id: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
/* generated using openapi-typescript-codegen -- do not edit */
|
|
||||||
/* istanbul ignore file */
|
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
import type { UpdateExpenseSchema } from './UpdateExpenseSchema';
|
|
||||||
export type UpdateExpenseRequest = {
|
|
||||||
expense: UpdateExpenseSchema;
|
|
||||||
};
|
|
||||||
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
/* generated using openapi-typescript-codegen -- do not edit */
|
|
||||||
/* istanbul ignore file */
|
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
import type { ExpenseTagSchema } from './ExpenseTagSchema';
|
|
||||||
export type UpdateExpenseTagRequest = {
|
|
||||||
tag: ExpenseTagSchema;
|
|
||||||
};
|
|
||||||
|
|
||||||
9
src/client/models/UpdateTransactionRequest.ts
Normal file
9
src/client/models/UpdateTransactionRequest.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
import type { UpdateTransactionSchema } from './UpdateTransactionSchema';
|
||||||
|
export type UpdateTransactionRequest = {
|
||||||
|
transaction: UpdateTransactionSchema;
|
||||||
|
};
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
/* istanbul ignore file */
|
/* istanbul ignore file */
|
||||||
/* tslint:disable */
|
/* tslint:disable */
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
export type UpdateExpenseTagResponse = {
|
export type UpdateTransactionResponse = {
|
||||||
ok: boolean;
|
ok: boolean;
|
||||||
message: string;
|
message: string;
|
||||||
};
|
};
|
||||||
@@ -2,12 +2,13 @@
|
|||||||
/* istanbul ignore file */
|
/* istanbul ignore file */
|
||||||
/* tslint:disable */
|
/* tslint:disable */
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
export type UpdateExpenseSchema = {
|
export type UpdateTransactionSchema = {
|
||||||
id?: (number | null);
|
id?: (number | null);
|
||||||
name: string;
|
name: string;
|
||||||
comment?: (string | null);
|
comment?: (string | null);
|
||||||
amount: number;
|
amount: number;
|
||||||
spentDate: string;
|
spentDate: string;
|
||||||
|
isIncome: boolean;
|
||||||
tags?: Array<string>;
|
tags?: Array<string>;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -2,8 +2,8 @@
|
|||||||
/* istanbul ignore file */
|
/* istanbul ignore file */
|
||||||
/* tslint:disable */
|
/* tslint:disable */
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import type { BaseExpenseTagSchema } from './BaseExpenseTagSchema';
|
import type { TransactionTagSchema } from './TransactionTagSchema';
|
||||||
export type CreateExpenseTagRequest = {
|
export type UpdateTransactionTagRequest = {
|
||||||
tag: BaseExpenseTagSchema;
|
tag: TransactionTagSchema;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
/* istanbul ignore file */
|
/* istanbul ignore file */
|
||||||
/* tslint:disable */
|
/* tslint:disable */
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
export type DeleteExpenseTagResponse = {
|
export type UpdateTransactionTagResponse = {
|
||||||
ok: boolean;
|
ok: boolean;
|
||||||
message: string;
|
message: string;
|
||||||
};
|
};
|
||||||
@@ -1,155 +0,0 @@
|
|||||||
/* generated using openapi-typescript-codegen -- do not edit */
|
|
||||||
/* istanbul ignore file */
|
|
||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
import type { CreateExpenseTagRequest } from '../models/CreateExpenseTagRequest';
|
|
||||||
import type { DeleteExpenseResponse } from '../models/DeleteExpenseResponse';
|
|
||||||
import type { DeleteExpenseTagResponse } from '../models/DeleteExpenseTagResponse';
|
|
||||||
import type { GetAllExpensesResponse } from '../models/GetAllExpensesResponse';
|
|
||||||
import type { GetAllExpenseTagsResponse } from '../models/GetAllExpenseTagsResponse';
|
|
||||||
import type { UpdateExpenseRequest } from '../models/UpdateExpenseRequest';
|
|
||||||
import type { UpdateExpenseResponse } from '../models/UpdateExpenseResponse';
|
|
||||||
import type { UpdateExpenseTagRequest } from '../models/UpdateExpenseTagRequest';
|
|
||||||
import type { UpdateExpenseTagResponse } from '../models/UpdateExpenseTagResponse';
|
|
||||||
import type { CancelablePromise } from '../core/CancelablePromise';
|
|
||||||
import { OpenAPI } from '../core/OpenAPI';
|
|
||||||
import { request as __request } from '../core/request';
|
|
||||||
export class ExpenseService {
|
|
||||||
/**
|
|
||||||
* Get All
|
|
||||||
* @returns GetAllExpensesResponse Successful Response
|
|
||||||
* @throws ApiError
|
|
||||||
*/
|
|
||||||
public static getAllExpenses({
|
|
||||||
page,
|
|
||||||
itemsPerPage,
|
|
||||||
}: {
|
|
||||||
page?: (number | null),
|
|
||||||
itemsPerPage?: (number | null),
|
|
||||||
}): CancelablePromise<GetAllExpensesResponse> {
|
|
||||||
return __request(OpenAPI, {
|
|
||||||
method: 'GET',
|
|
||||||
url: '/expense/get-all',
|
|
||||||
query: {
|
|
||||||
'page': page,
|
|
||||||
'items_per_page': itemsPerPage,
|
|
||||||
},
|
|
||||||
errors: {
|
|
||||||
422: `Validation Error`,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Update Expense
|
|
||||||
* @returns UpdateExpenseResponse Successful Response
|
|
||||||
* @throws ApiError
|
|
||||||
*/
|
|
||||||
public static updateExpense({
|
|
||||||
requestBody,
|
|
||||||
}: {
|
|
||||||
requestBody: UpdateExpenseRequest,
|
|
||||||
}): CancelablePromise<UpdateExpenseResponse> {
|
|
||||||
return __request(OpenAPI, {
|
|
||||||
method: 'POST',
|
|
||||||
url: '/expense/update',
|
|
||||||
body: requestBody,
|
|
||||||
mediaType: 'application/json',
|
|
||||||
errors: {
|
|
||||||
422: `Validation Error`,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Delete Expense
|
|
||||||
* @returns DeleteExpenseResponse Successful Response
|
|
||||||
* @throws ApiError
|
|
||||||
*/
|
|
||||||
public static deleteExpense({
|
|
||||||
expenseId,
|
|
||||||
}: {
|
|
||||||
expenseId: number,
|
|
||||||
}): CancelablePromise<DeleteExpenseResponse> {
|
|
||||||
return __request(OpenAPI, {
|
|
||||||
method: 'DELETE',
|
|
||||||
url: '/expense/delete/{expense_id}',
|
|
||||||
path: {
|
|
||||||
'expense_id': expenseId,
|
|
||||||
},
|
|
||||||
errors: {
|
|
||||||
422: `Validation Error`,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Get All
|
|
||||||
* @returns GetAllExpenseTagsResponse Successful Response
|
|
||||||
* @throws ApiError
|
|
||||||
*/
|
|
||||||
public static getAllExpenseTags(): CancelablePromise<GetAllExpenseTagsResponse> {
|
|
||||||
return __request(OpenAPI, {
|
|
||||||
method: 'GET',
|
|
||||||
url: '/expense/get-all-tags',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Update Expense
|
|
||||||
* @returns UpdateExpenseTagResponse Successful Response
|
|
||||||
* @throws ApiError
|
|
||||||
*/
|
|
||||||
public static createExpenseTag({
|
|
||||||
requestBody,
|
|
||||||
}: {
|
|
||||||
requestBody: CreateExpenseTagRequest,
|
|
||||||
}): CancelablePromise<UpdateExpenseTagResponse> {
|
|
||||||
return __request(OpenAPI, {
|
|
||||||
method: 'POST',
|
|
||||||
url: '/expense/create-tag',
|
|
||||||
body: requestBody,
|
|
||||||
mediaType: 'application/json',
|
|
||||||
errors: {
|
|
||||||
422: `Validation Error`,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Update Expense
|
|
||||||
* @returns UpdateExpenseTagResponse Successful Response
|
|
||||||
* @throws ApiError
|
|
||||||
*/
|
|
||||||
public static updateExpenseTag({
|
|
||||||
requestBody,
|
|
||||||
}: {
|
|
||||||
requestBody: UpdateExpenseTagRequest,
|
|
||||||
}): CancelablePromise<UpdateExpenseTagResponse> {
|
|
||||||
return __request(OpenAPI, {
|
|
||||||
method: 'POST',
|
|
||||||
url: '/expense/update-tag',
|
|
||||||
body: requestBody,
|
|
||||||
mediaType: 'application/json',
|
|
||||||
errors: {
|
|
||||||
422: `Validation Error`,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Update Expense
|
|
||||||
* @returns DeleteExpenseTagResponse Successful Response
|
|
||||||
* @throws ApiError
|
|
||||||
*/
|
|
||||||
public static deleteExpenseTag({
|
|
||||||
tagId,
|
|
||||||
}: {
|
|
||||||
tagId: number,
|
|
||||||
}): CancelablePromise<DeleteExpenseTagResponse> {
|
|
||||||
return __request(OpenAPI, {
|
|
||||||
method: 'DELETE',
|
|
||||||
url: '/expense/delete-tag/{tag_id}',
|
|
||||||
path: {
|
|
||||||
'tag_id': tagId,
|
|
||||||
},
|
|
||||||
errors: {
|
|
||||||
422: `Validation Error`,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -139,7 +139,7 @@ export class ShippingService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Generate Deal Qr Code
|
* Generate Deal Qr Code Pdf
|
||||||
* @returns any Successful Response
|
* @returns any Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
@@ -160,7 +160,7 @@ export class ShippingService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Generate Deal Qr Code
|
* Generate Pallets Pdf
|
||||||
* @returns any Successful Response
|
* @returns any Successful Response
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
@@ -180,4 +180,25 @@ export class ShippingService {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Generate Boxes Pdf
|
||||||
|
* @returns any Successful Response
|
||||||
|
* @throws ApiError
|
||||||
|
*/
|
||||||
|
public static getBoxesPdf({
|
||||||
|
dealId,
|
||||||
|
}: {
|
||||||
|
dealId: number,
|
||||||
|
}): CancelablePromise<any> {
|
||||||
|
return __request(OpenAPI, {
|
||||||
|
method: 'GET',
|
||||||
|
url: '/shipping/pdf/boxes/{deal_id}',
|
||||||
|
path: {
|
||||||
|
'deal_id': dealId,
|
||||||
|
},
|
||||||
|
errors: {
|
||||||
|
422: `Validation Error`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
182
src/client/services/TransactionService.ts
Normal file
182
src/client/services/TransactionService.ts
Normal file
@@ -0,0 +1,182 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
import type { CreateTransactionTagRequest } from '../models/CreateTransactionTagRequest';
|
||||||
|
import type { DeleteTransactionResponse } from '../models/DeleteTransactionResponse';
|
||||||
|
import type { DeleteTransactionTagResponse } from '../models/DeleteTransactionTagResponse';
|
||||||
|
import type { GetAllTransactionsRequest } from '../models/GetAllTransactionsRequest';
|
||||||
|
import type { GetAllTransactionsResponse } from '../models/GetAllTransactionsResponse';
|
||||||
|
import type { GetAllTransactionTagsResponse } from '../models/GetAllTransactionTagsResponse';
|
||||||
|
import type { GetTransactionTagsResponse } from '../models/GetTransactionTagsResponse';
|
||||||
|
import type { UpdateTransactionRequest } from '../models/UpdateTransactionRequest';
|
||||||
|
import type { UpdateTransactionResponse } from '../models/UpdateTransactionResponse';
|
||||||
|
import type { UpdateTransactionTagRequest } from '../models/UpdateTransactionTagRequest';
|
||||||
|
import type { UpdateTransactionTagResponse } from '../models/UpdateTransactionTagResponse';
|
||||||
|
import type { CancelablePromise } from '../core/CancelablePromise';
|
||||||
|
import { OpenAPI } from '../core/OpenAPI';
|
||||||
|
import { request as __request } from '../core/request';
|
||||||
|
export class TransactionService {
|
||||||
|
/**
|
||||||
|
* Get All
|
||||||
|
* @returns GetAllTransactionsResponse Successful Response
|
||||||
|
* @throws ApiError
|
||||||
|
*/
|
||||||
|
public static getAllTransactions({
|
||||||
|
requestBody,
|
||||||
|
page,
|
||||||
|
itemsPerPage,
|
||||||
|
}: {
|
||||||
|
requestBody: GetAllTransactionsRequest,
|
||||||
|
page?: (number | null),
|
||||||
|
itemsPerPage?: (number | null),
|
||||||
|
}): CancelablePromise<GetAllTransactionsResponse> {
|
||||||
|
return __request(OpenAPI, {
|
||||||
|
method: 'POST',
|
||||||
|
url: '/transaction/get-all',
|
||||||
|
query: {
|
||||||
|
'page': page,
|
||||||
|
'items_per_page': itemsPerPage,
|
||||||
|
},
|
||||||
|
body: requestBody,
|
||||||
|
mediaType: 'application/json',
|
||||||
|
errors: {
|
||||||
|
422: `Validation Error`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Update Transaction
|
||||||
|
* @returns UpdateTransactionResponse Successful Response
|
||||||
|
* @throws ApiError
|
||||||
|
*/
|
||||||
|
public static updateTransaction({
|
||||||
|
requestBody,
|
||||||
|
}: {
|
||||||
|
requestBody: UpdateTransactionRequest,
|
||||||
|
}): CancelablePromise<UpdateTransactionResponse> {
|
||||||
|
return __request(OpenAPI, {
|
||||||
|
method: 'POST',
|
||||||
|
url: '/transaction/update',
|
||||||
|
body: requestBody,
|
||||||
|
mediaType: 'application/json',
|
||||||
|
errors: {
|
||||||
|
422: `Validation Error`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Delete Transaction
|
||||||
|
* @returns DeleteTransactionResponse Successful Response
|
||||||
|
* @throws ApiError
|
||||||
|
*/
|
||||||
|
public static deleteTransaction({
|
||||||
|
transactionId,
|
||||||
|
}: {
|
||||||
|
transactionId: number,
|
||||||
|
}): CancelablePromise<DeleteTransactionResponse> {
|
||||||
|
return __request(OpenAPI, {
|
||||||
|
method: 'DELETE',
|
||||||
|
url: '/transaction/delete/{transaction_id}',
|
||||||
|
path: {
|
||||||
|
'transaction_id': transactionId,
|
||||||
|
},
|
||||||
|
errors: {
|
||||||
|
422: `Validation Error`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Get All Transaction Tags
|
||||||
|
* @returns GetAllTransactionTagsResponse Successful Response
|
||||||
|
* @throws ApiError
|
||||||
|
*/
|
||||||
|
public static getAllTransactionTags(): CancelablePromise<GetAllTransactionTagsResponse> {
|
||||||
|
return __request(OpenAPI, {
|
||||||
|
method: 'GET',
|
||||||
|
url: '/transaction/get-all-tags',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Get Transaction Tags
|
||||||
|
* @returns GetTransactionTagsResponse Successful Response
|
||||||
|
* @throws ApiError
|
||||||
|
*/
|
||||||
|
public static getTransactionTags({
|
||||||
|
isIncome,
|
||||||
|
}: {
|
||||||
|
isIncome: boolean,
|
||||||
|
}): CancelablePromise<GetTransactionTagsResponse> {
|
||||||
|
return __request(OpenAPI, {
|
||||||
|
method: 'GET',
|
||||||
|
url: '/transaction/get-tags/{is_income}',
|
||||||
|
path: {
|
||||||
|
'is_income': isIncome,
|
||||||
|
},
|
||||||
|
errors: {
|
||||||
|
422: `Validation Error`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Create Transaction Tag
|
||||||
|
* @returns UpdateTransactionTagResponse Successful Response
|
||||||
|
* @throws ApiError
|
||||||
|
*/
|
||||||
|
public static createTransactionTag({
|
||||||
|
requestBody,
|
||||||
|
}: {
|
||||||
|
requestBody: CreateTransactionTagRequest,
|
||||||
|
}): CancelablePromise<UpdateTransactionTagResponse> {
|
||||||
|
return __request(OpenAPI, {
|
||||||
|
method: 'POST',
|
||||||
|
url: '/transaction/create-tag',
|
||||||
|
body: requestBody,
|
||||||
|
mediaType: 'application/json',
|
||||||
|
errors: {
|
||||||
|
422: `Validation Error`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Update Transaction Tag
|
||||||
|
* @returns UpdateTransactionTagResponse Successful Response
|
||||||
|
* @throws ApiError
|
||||||
|
*/
|
||||||
|
public static updateTransactionTag({
|
||||||
|
requestBody,
|
||||||
|
}: {
|
||||||
|
requestBody: UpdateTransactionTagRequest,
|
||||||
|
}): CancelablePromise<UpdateTransactionTagResponse> {
|
||||||
|
return __request(OpenAPI, {
|
||||||
|
method: 'POST',
|
||||||
|
url: '/transaction/update-tag',
|
||||||
|
body: requestBody,
|
||||||
|
mediaType: 'application/json',
|
||||||
|
errors: {
|
||||||
|
422: `Validation Error`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Update Transaction Tag
|
||||||
|
* @returns DeleteTransactionTagResponse Successful Response
|
||||||
|
* @throws ApiError
|
||||||
|
*/
|
||||||
|
public static deleteTransactionTag({
|
||||||
|
tagId,
|
||||||
|
}: {
|
||||||
|
tagId: number,
|
||||||
|
}): CancelablePromise<DeleteTransactionTagResponse> {
|
||||||
|
return __request(OpenAPI, {
|
||||||
|
method: 'DELETE',
|
||||||
|
url: '/transaction/delete-tag/{tag_id}',
|
||||||
|
path: {
|
||||||
|
'tag_id': tagId,
|
||||||
|
},
|
||||||
|
errors: {
|
||||||
|
422: `Validation Error`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -22,8 +22,8 @@ import ShippingWarehouseForm from "../pages/ShippingWarehousesPage/modals/Shippi
|
|||||||
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 ExpenseFormModal from "../pages/AdminPage/tabs/Expenses/modals/ExpenseFormModal.tsx";
|
import TransactionFormModal from "../pages/AdminPage/tabs/Transactions/modals/TransactionFormModal.tsx";
|
||||||
import ExpenseTagsModal from "../pages/AdminPage/tabs/Expenses/modals/ExpenseTagsModal.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/LeadsPage/tabs/ShippingTab/modals/ShippingProductModal.tsx";
|
||||||
|
|
||||||
export const modals = {
|
export const modals = {
|
||||||
@@ -51,7 +51,7 @@ export const modals = {
|
|||||||
marketplaceFormModal: MarketplaceFormModal,
|
marketplaceFormModal: MarketplaceFormModal,
|
||||||
servicePriceCategoryForm: ServicePriceCategoryForm,
|
servicePriceCategoryForm: ServicePriceCategoryForm,
|
||||||
scanningModal: ScanningModal,
|
scanningModal: ScanningModal,
|
||||||
expenseFormModal: ExpenseFormModal,
|
transactionFormModal: TransactionFormModal,
|
||||||
expenseTagsModal: ExpenseTagsModal,
|
transactionTagsModal: TransactionTagsModal,
|
||||||
shippingProductModal: ShippingProductModal,
|
shippingProductModal: ShippingProductModal,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import { motion } from "framer-motion";
|
|||||||
import FinancesTab from "./tabs/Finances/FinancesTab.tsx";
|
import FinancesTab from "./tabs/Finances/FinancesTab.tsx";
|
||||||
import WorkTimeTable from "./tabs/WorkTimeTable/ui/WorkTimeTable.tsx";
|
import WorkTimeTable from "./tabs/WorkTimeTable/ui/WorkTimeTable.tsx";
|
||||||
import { WorkShiftsTab } from "./tabs/WorkShifts/WorkShiftsTab.tsx";
|
import { WorkShiftsTab } from "./tabs/WorkShifts/WorkShiftsTab.tsx";
|
||||||
import { ExpensesTab } from "./tabs/Expenses/ExpensesTab.tsx";
|
import { TransactionsTab } from "./tabs/Transactions/TransactionsTab.tsx";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import { RootState } from "../../redux/store.ts";
|
import { RootState } from "../../redux/store.ts";
|
||||||
|
|
||||||
@@ -62,9 +62,9 @@ const AdminPage = () => {
|
|||||||
</Tabs.Tab>
|
</Tabs.Tab>
|
||||||
{isAdmin && (
|
{isAdmin && (
|
||||||
<Tabs.Tab
|
<Tabs.Tab
|
||||||
value={"expenses"}
|
value={"transactions"}
|
||||||
leftSection={<IconCoins />}>
|
leftSection={<IconCoins />}>
|
||||||
Расходы
|
Доходы и расходы
|
||||||
</Tabs.Tab>
|
</Tabs.Tab>
|
||||||
)}
|
)}
|
||||||
</Tabs.List>
|
</Tabs.List>
|
||||||
@@ -108,12 +108,12 @@ const AdminPage = () => {
|
|||||||
<WorkShiftsTab />
|
<WorkShiftsTab />
|
||||||
</motion.div>
|
</motion.div>
|
||||||
</Tabs.Panel>
|
</Tabs.Panel>
|
||||||
<Tabs.Panel value={"expenses"}>
|
<Tabs.Panel value={"transactions"}>
|
||||||
<motion.div
|
<motion.div
|
||||||
initial={{ opacity: 0 }}
|
initial={{ opacity: 0 }}
|
||||||
animate={{ opacity: 1 }}
|
animate={{ opacity: 1 }}
|
||||||
transition={{ duration: 0.2 }}>
|
transition={{ duration: 0.2 }}>
|
||||||
<ExpensesTab />
|
<TransactionsTab />
|
||||||
</motion.div>
|
</motion.div>
|
||||||
</Tabs.Panel>
|
</Tabs.Panel>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|||||||
10
src/pages/AdminPage/hooks/useAllTransactionTagsList.tsx
Normal file
10
src/pages/AdminPage/hooks/useAllTransactionTagsList.tsx
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import ObjectList from "../../../hooks/objectList.tsx";
|
||||||
|
import { TransactionService } from "../../../client";
|
||||||
|
|
||||||
|
const useAllTransactionTagsList = () =>
|
||||||
|
ObjectList({
|
||||||
|
queryFn: () => TransactionService.getAllTransactionTags(),
|
||||||
|
getObjectsFn: response => response.tags,
|
||||||
|
queryKey: "getAllTransactionTags",
|
||||||
|
});
|
||||||
|
export default useAllTransactionTagsList;
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
import ObjectList from "../../../hooks/objectList.tsx";
|
|
||||||
import { ExpenseService } from "../../../client";
|
|
||||||
|
|
||||||
const useExpenseTagsList = () =>
|
|
||||||
ObjectList({
|
|
||||||
queryFn: ExpenseService.getAllExpenseTags,
|
|
||||||
getObjectsFn: response => response.tags,
|
|
||||||
queryKey: "getAllExpenseTags",
|
|
||||||
});
|
|
||||||
export default useExpenseTagsList;
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
import { Pagination } from "../../../types/Pagination.ts";
|
|
||||||
import { ObjectListWithPagination } from "../../../hooks/objectList.tsx";
|
|
||||||
import { ExpenseService } from "../../../client";
|
|
||||||
|
|
||||||
|
|
||||||
export const useExpensesList = (pagination: Pagination) =>
|
|
||||||
ObjectListWithPagination({
|
|
||||||
queryFn: () => ExpenseService.getAllExpenses(pagination),
|
|
||||||
queryKey: "getExpenses",
|
|
||||||
getObjectsFn: response => response.expenses,
|
|
||||||
pagination,
|
|
||||||
});
|
|
||||||
16
src/pages/AdminPage/hooks/useTransactionTagsList.tsx
Normal file
16
src/pages/AdminPage/hooks/useTransactionTagsList.tsx
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import ObjectList from "../../../hooks/objectList.tsx";
|
||||||
|
import { TransactionService } from "../../../client";
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
isIncome: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
const useTransactionTagsList = ({ isIncome }: Props) =>
|
||||||
|
ObjectList({
|
||||||
|
queryFn: () => TransactionService.getTransactionTags(
|
||||||
|
{ isIncome },
|
||||||
|
),
|
||||||
|
getObjectsFn: response => response.tags,
|
||||||
|
queryKey: "getTransactionTags",
|
||||||
|
});
|
||||||
|
export default useTransactionTagsList;
|
||||||
21
src/pages/AdminPage/hooks/useTransactionsList.tsx
Normal file
21
src/pages/AdminPage/hooks/useTransactionsList.tsx
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
import { Pagination } from "../../../types/Pagination.ts";
|
||||||
|
import { ObjectListWithPagination } from "../../../hooks/objectList.tsx";
|
||||||
|
import { TransactionService } from "../../../client";
|
||||||
|
|
||||||
|
type TransitionType = {
|
||||||
|
isIncome: boolean
|
||||||
|
};
|
||||||
|
type Props = Pagination & TransitionType;
|
||||||
|
|
||||||
|
export const useTransactionsList = (props: Props) =>
|
||||||
|
ObjectListWithPagination({
|
||||||
|
queryFn: () => TransactionService.getAllTransactions({
|
||||||
|
requestBody: {
|
||||||
|
isIncome: props.isIncome,
|
||||||
|
},
|
||||||
|
...props,
|
||||||
|
}),
|
||||||
|
queryKey: "getTransactions",
|
||||||
|
getObjectsFn: response => response.transactions,
|
||||||
|
pagination: props,
|
||||||
|
});
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
import { TagsInput, TagsInputProps } from "@mantine/core";
|
|
||||||
import useExpenseTagsList from "../../../hooks/useExpenseTagsList.tsx";
|
|
||||||
|
|
||||||
|
|
||||||
type Props = Omit<TagsInputProps, "data">;
|
|
||||||
|
|
||||||
const ExpenseTagsInput = (props: Props) => {
|
|
||||||
const { objects } = useExpenseTagsList();
|
|
||||||
return (
|
|
||||||
<TagsInput
|
|
||||||
data={objects.map(object => object.name)}
|
|
||||||
{...props}
|
|
||||||
label={"Теги"}
|
|
||||||
placeholder={"Выберите теги"}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default ExpenseTagsInput;
|
|
||||||
@@ -1,39 +1,44 @@
|
|||||||
import { useExpensesList } from "../../hooks/useExpensesList.tsx";
|
import { useTransactionsList } from "../../hooks/useTransactionsList.tsx";
|
||||||
import { useExpensesTableColumns } from "./hooks/useExpensesTableColumns.tsx";
|
import { useTransactionsTableColumns } from "./hooks/useTransactionsTableColumns.tsx";
|
||||||
import { ExpenseSchemaBase, ExpenseService } from "../../../../client";
|
import { TransactionSchemaBase, TransactionService } from "../../../../client";
|
||||||
import { dateToString } from "../../../../types/utils.ts";
|
import { dateToString } from "../../../../types/utils.ts";
|
||||||
import { notifications } from "../../../../shared/lib/notifications.ts";
|
import { notifications } from "../../../../shared/lib/notifications.ts";
|
||||||
import { modals } from "@mantine/modals";
|
import { modals } from "@mantine/modals";
|
||||||
import { BaseTable } from "../../../../components/BaseTable/BaseTable.tsx";
|
import { BaseTable } from "../../../../components/BaseTable/BaseTable.tsx";
|
||||||
import { Pagination, Flex, rem, Button, Tooltip, ActionIcon } from "@mantine/core";
|
import { ActionIcon, Button, Flex, Pagination, rem, Tooltip } from "@mantine/core";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { IconEdit, IconTrash } from "@tabler/icons-react";
|
import { IconEdit, IconTrash } from "@tabler/icons-react";
|
||||||
import { MRT_TableOptions } from "mantine-react-table";
|
import { MRT_TableOptions } from "mantine-react-table";
|
||||||
import { Expense } from "./types/Expense.tsx";
|
import { Transaction } from "./types/Transaction.tsx";
|
||||||
|
import { TransactionsSegmentedControl, TransactionType } from "./components/TransactionsSegmentedControl.tsx";
|
||||||
|
|
||||||
|
|
||||||
export const ExpensesTab = () => {
|
export const TransactionsTab = () => {
|
||||||
|
const [transactionType, setTransactionType] = useState<TransactionType>(TransactionType.EXPENSE);
|
||||||
|
const isIncome = transactionType === TransactionType.INCOME;
|
||||||
|
|
||||||
const [totalPages, setTotalPages] = useState(10);
|
const [totalPages, setTotalPages] = useState(10);
|
||||||
const [page, setPage] = useState(1);
|
const [page, setPage] = useState(1);
|
||||||
const {
|
const {
|
||||||
pagination: paginationInfo,
|
pagination: paginationInfo,
|
||||||
objects: expenses,
|
objects: transactions,
|
||||||
refetch,
|
refetch,
|
||||||
} = useExpensesList({ page: page, itemsPerPage: 10 });
|
} = useTransactionsList({ page: page, itemsPerPage: 10, isIncome });
|
||||||
const columns = useExpensesTableColumns();
|
const columns = useTransactionsTableColumns();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!paginationInfo ) return;
|
if (!paginationInfo) return;
|
||||||
if (!paginationInfo.totalPages) setTotalPages(0);
|
if (!paginationInfo.totalPages) setTotalPages(0);
|
||||||
else setTotalPages(paginationInfo.totalPages);
|
else setTotalPages(paginationInfo.totalPages);
|
||||||
}, [paginationInfo]);
|
}, [paginationInfo]);
|
||||||
|
|
||||||
const onUpdate = (expense: Expense) => {
|
const onUpdate = (transaction: Transaction) => {
|
||||||
ExpenseService.updateExpense({
|
TransactionService.updateTransaction({
|
||||||
requestBody: {
|
requestBody: {
|
||||||
expense: {
|
transaction: {
|
||||||
...expense,
|
...transaction,
|
||||||
spentDate: dateToString(new Date(expense.spentDate)) ?? "",
|
spentDate: dateToString(new Date(transaction.spentDate)) ?? "",
|
||||||
|
isIncome,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@@ -44,33 +49,37 @@ export const ExpensesTab = () => {
|
|||||||
.catch(err => console.log(err));
|
.catch(err => console.log(err));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const modalTitleSuffix = isIncome ? "доходах" : "расходах";
|
||||||
|
|
||||||
const onCreateClick = () => {
|
const onCreateClick = () => {
|
||||||
modals.openContextModal({
|
modals.openContextModal({
|
||||||
modal: "expenseFormModal",
|
modal: "transactionFormModal",
|
||||||
title: "Создание записи о расходах",
|
title: `Создание записи о ${modalTitleSuffix}`,
|
||||||
withCloseButton: false,
|
withCloseButton: false,
|
||||||
innerProps: {
|
innerProps: {
|
||||||
onCreate: onUpdate,
|
onCreate: onUpdate,
|
||||||
|
isIncome,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const onEditClick = (expense: ExpenseSchemaBase) => {
|
const onEditClick = (transaction: TransactionSchemaBase) => {
|
||||||
const expenseToEdit = { ...expense, tags: expense.tags.map(tag => tag.name) };
|
const expenseToEdit = { ...transaction, tags: transaction.tags.map(tag => tag.name) };
|
||||||
modals.openContextModal({
|
modals.openContextModal({
|
||||||
modal: "expenseFormModal",
|
modal: "transactionFormModal",
|
||||||
title: "Редактирование записи о расходах",
|
title: `Редактирование записи о ${modalTitleSuffix}`,
|
||||||
withCloseButton: false,
|
withCloseButton: false,
|
||||||
innerProps: {
|
innerProps: {
|
||||||
onChange: event => onUpdate(event),
|
onChange: onUpdate,
|
||||||
element: expenseToEdit,
|
element: expenseToEdit,
|
||||||
|
isIncome,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const onDeleteClick = (expense: ExpenseSchemaBase) => {
|
const onDeleteClick = (transaction: TransactionSchemaBase) => {
|
||||||
ExpenseService.deleteExpense({
|
TransactionService.deleteTransaction({
|
||||||
expenseId: expense.id,
|
transactionId: transaction.id,
|
||||||
})
|
})
|
||||||
.then(async ({ ok, message }) => {
|
.then(async ({ ok, message }) => {
|
||||||
notifications.guess(ok, { message });
|
notifications.guess(ok, { message });
|
||||||
@@ -81,24 +90,48 @@ export const ExpensesTab = () => {
|
|||||||
|
|
||||||
const onTagChange = async () => {
|
const onTagChange = async () => {
|
||||||
await refetch();
|
await refetch();
|
||||||
}
|
};
|
||||||
|
|
||||||
const onTagsEditClick = () => {
|
const onTagsEditClick = () => {
|
||||||
modals.openContextModal({
|
modals.openContextModal({
|
||||||
modal: "expenseTagsModal",
|
modal: "transactionTagsModal",
|
||||||
title: "Редактирование тегов",
|
title: "Редактирование тегов",
|
||||||
withCloseButton: false,
|
withCloseButton: false,
|
||||||
innerProps: { onChange: onTagChange },
|
innerProps: {
|
||||||
|
onChange: onTagChange,
|
||||||
|
isIncome,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
|
const getCreateTransactionLabel = (): string => {
|
||||||
|
if (transactionType === TransactionType.EXPENSE) {
|
||||||
|
return "Создать запись о расходах";
|
||||||
|
}
|
||||||
|
return "Создать запись о доходах";
|
||||||
|
};
|
||||||
|
|
||||||
|
const getEditTagLabel = (): string => {
|
||||||
|
if (transactionType === TransactionType.EXPENSE) {
|
||||||
|
return "Редактировать теги для расходов";
|
||||||
|
}
|
||||||
|
return "Редактировать теги для доходов";
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex
|
<Flex
|
||||||
direction={"column"}
|
direction={"column"}
|
||||||
h={"100%"}
|
h={"100%"}
|
||||||
gap={rem(10)}>
|
gap={0}>
|
||||||
|
<TransactionsSegmentedControl
|
||||||
|
value={transactionType.toString()}
|
||||||
|
onChange={event => {
|
||||||
|
setPage(1);
|
||||||
|
setTransactionType(parseInt(event));
|
||||||
|
}}
|
||||||
|
/>
|
||||||
<BaseTable
|
<BaseTable
|
||||||
data={expenses}
|
data={transactions}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
restProps={
|
restProps={
|
||||||
{
|
{
|
||||||
@@ -111,12 +144,12 @@ export const ExpensesTab = () => {
|
|||||||
<Button
|
<Button
|
||||||
variant={"default"}
|
variant={"default"}
|
||||||
onClick={() => onCreateClick()}>
|
onClick={() => onCreateClick()}>
|
||||||
Создать запись о расходах
|
{getCreateTransactionLabel()}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
variant={"default"}
|
variant={"default"}
|
||||||
onClick={() => onTagsEditClick()}>
|
onClick={() => onTagsEditClick()}>
|
||||||
Редактировать теги
|
{getEditTagLabel()}
|
||||||
</Button>
|
</Button>
|
||||||
</Flex>
|
</Flex>
|
||||||
),
|
),
|
||||||
@@ -138,7 +171,7 @@ export const ExpensesTab = () => {
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Flex>
|
</Flex>
|
||||||
),
|
),
|
||||||
} as MRT_TableOptions<ExpenseSchemaBase>
|
} as MRT_TableOptions<TransactionSchemaBase>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{totalPages > 1 && (
|
{totalPages > 1 && (
|
||||||
@@ -1,31 +1,35 @@
|
|||||||
import { BaseExpenseTagSchema } from "../../../../../client";
|
import { BaseTransactionTagSchema } from "../../../../../client";
|
||||||
import { Button, Stack, TextInput } from "@mantine/core";
|
import { Button, Stack, TextInput } from "@mantine/core";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { notifications } from "../../../../../shared/lib/notifications.ts";
|
import { notifications } from "../../../../../shared/lib/notifications.ts";
|
||||||
|
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
onCreate: (tag: BaseExpenseTagSchema) => void;
|
onCreate: (tag: BaseTransactionTagSchema) => void;
|
||||||
|
isIncome: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const CreateExpenseTagForm = ({ onCreate }: Props) => {
|
const CreateTransactionTagForm = ({ onCreate, isIncome }: Props) => {
|
||||||
const [expenseTag, setExpenseTag] = useState<string>("");
|
const [transactionTag, setTransactionTag] = useState<string>("");
|
||||||
|
|
||||||
const onCreateClick = () => {
|
const onCreateClick = () => {
|
||||||
if (expenseTag.length === 0) {
|
if (transactionTag.length === 0) {
|
||||||
notifications.error({ message: "Нельзя добавить тег без названия" });
|
notifications.error({ message: "Нельзя добавить тег без названия" });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
onCreate({ name: expenseTag });
|
onCreate({
|
||||||
setExpenseTag("");
|
name: transactionTag,
|
||||||
|
isIncome: isIncome,
|
||||||
|
});
|
||||||
|
setTransactionTag("");
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack>
|
<Stack>
|
||||||
<TextInput
|
<TextInput
|
||||||
label={"Добавить тег"}
|
label={"Добавить тег"}
|
||||||
value={expenseTag}
|
value={transactionTag}
|
||||||
onChange={event => setExpenseTag(event.target.value)}
|
onChange={event => setTransactionTag(event.target.value)}
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
variant={"default"}
|
variant={"default"}
|
||||||
@@ -36,4 +40,4 @@ const CreateExpenseTagForm = ({ onCreate }: Props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default CreateExpenseTagForm;
|
export default CreateTransactionTagForm;
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
import { TagsInput, TagsInputProps } from "@mantine/core";
|
||||||
|
import useTransactionTagsList from "../../../hooks/useTransactionTagsList.tsx";
|
||||||
|
|
||||||
|
|
||||||
|
type IsIncome = {
|
||||||
|
isIncome: boolean;
|
||||||
|
}
|
||||||
|
type Props = Omit<TagsInputProps, "data"> & IsIncome;
|
||||||
|
|
||||||
|
const TransactionTagsInput = (props: Props) => {
|
||||||
|
const { objects } = useTransactionTagsList({ isIncome: props.isIncome });
|
||||||
|
return (
|
||||||
|
<TagsInput
|
||||||
|
data={objects.map(object => object.name)}
|
||||||
|
{...props}
|
||||||
|
label={"Теги"}
|
||||||
|
placeholder={"Выберите теги"}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default TransactionTagsInput;
|
||||||
@@ -1,33 +1,36 @@
|
|||||||
import { CRUDTableProps } from "../../../../../types/CRUDTable.tsx";
|
import { CRUDTableProps } from "../../../../../types/CRUDTable.tsx";
|
||||||
import { BaseExpenseTagSchema, ExpenseTagSchema } from "../../../../../client";
|
import { BaseTransactionTagSchema, TransactionTagSchema } from "../../../../../client";
|
||||||
import { FC, useState } from "react";
|
import { FC, useState } from "react";
|
||||||
import { ActionIcon, Flex, Stack, Tooltip } from "@mantine/core";
|
import { ActionIcon, Flex, Stack, Tooltip } from "@mantine/core";
|
||||||
import { IconCheck, IconEdit, IconTrash } from "@tabler/icons-react";
|
import { IconCheck, IconEdit, IconTrash } from "@tabler/icons-react";
|
||||||
import { MRT_TableOptions } from "mantine-react-table";
|
import { MRT_TableOptions } from "mantine-react-table";
|
||||||
import { BaseTable } from "../../../../../components/BaseTable/BaseTable.tsx";
|
import { BaseTable } from "../../../../../components/BaseTable/BaseTable.tsx";
|
||||||
import { useExpenseTagsTableColumns } from "../hooks/useExpenseTagsTableColumns.tsx";
|
import { useTransactionTagsTableColumns } from "../hooks/useTransactionTagsTableColumns.tsx";
|
||||||
import CreateExpenseTagForm from "./CreateExpenseTagForm.tsx";
|
import CreateTransactionTagForm from "./CreateTransactionTagForm.tsx";
|
||||||
|
|
||||||
|
type isIncome = {
|
||||||
|
isIncome: boolean;
|
||||||
|
}
|
||||||
|
type Props = CRUDTableProps<TransactionTagSchema, BaseTransactionTagSchema> & isIncome;
|
||||||
|
|
||||||
type Props = CRUDTableProps<ExpenseTagSchema, BaseExpenseTagSchema>;
|
const TransactionTagsTable: FC<Props> = ({ items, onCreate, onDelete, onChange, isIncome }) => {
|
||||||
|
|
||||||
const ExpenseTagsTable: FC<Props> = ({ items, onCreate, onDelete, onChange }) => {
|
|
||||||
const [editingTagId, setEditingTagId] = useState<number>(-1);
|
const [editingTagId, setEditingTagId] = useState<number>(-1);
|
||||||
const [tagName, setTagName] = useState<string>("");
|
const [tagName, setTagName] = useState<string>("");
|
||||||
|
|
||||||
const columns = useExpenseTagsTableColumns({ editingTagId, setTagName });
|
const columns = useTransactionTagsTableColumns({ editingTagId, setTagName });
|
||||||
|
|
||||||
const onStartEditing = (tag: ExpenseTagSchema) => {
|
const onStartEditing = (tag: TransactionTagSchema) => {
|
||||||
setEditingTagId(tag.id);
|
setEditingTagId(tag.id);
|
||||||
setTagName(tag.name);
|
setTagName(tag.name);
|
||||||
};
|
};
|
||||||
|
|
||||||
const onFinishEditing = (tag: ExpenseTagSchema) => {
|
const onFinishEditing = (tag: TransactionTagSchema) => {
|
||||||
if (!onChange) return;
|
if (!onChange) return;
|
||||||
if (tag.name !== tagName) {
|
if (tag.name !== tagName) {
|
||||||
onChange({
|
onChange({
|
||||||
id: editingTagId,
|
id: editingTagId,
|
||||||
name: tagName,
|
name: tagName,
|
||||||
|
isIncome: isIncome,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,7 +40,10 @@ const ExpenseTagsTable: FC<Props> = ({ items, onCreate, onDelete, onChange }) =>
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack>
|
<Stack>
|
||||||
<CreateExpenseTagForm onCreate={item => onCreate && onCreate(item)} />
|
<CreateTransactionTagForm
|
||||||
|
onCreate={item => onCreate && onCreate(item)}
|
||||||
|
isIncome={isIncome}
|
||||||
|
/>
|
||||||
<BaseTable
|
<BaseTable
|
||||||
data={items}
|
data={items}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
@@ -74,11 +80,11 @@ const ExpenseTagsTable: FC<Props> = ({ items, onCreate, onDelete, onChange }) =>
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Flex>
|
</Flex>
|
||||||
),
|
),
|
||||||
} as MRT_TableOptions<ExpenseTagSchema>
|
} as MRT_TableOptions<TransactionTagSchema>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default ExpenseTagsTable;
|
export default TransactionTagsTable;
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import { SegmentedControl, SegmentedControlProps } from "@mantine/core";
|
||||||
|
import { FC } from "react";
|
||||||
|
|
||||||
|
export enum TransactionType {
|
||||||
|
EXPENSE,
|
||||||
|
INCOME,
|
||||||
|
}
|
||||||
|
|
||||||
|
type Props = Omit<SegmentedControlProps, "data">;
|
||||||
|
const data = [
|
||||||
|
{
|
||||||
|
label: "Расходы",
|
||||||
|
value: TransactionType.EXPENSE.toString(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Доходы",
|
||||||
|
value: TransactionType.INCOME.toString(),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export const TransactionsSegmentedControl: FC<Props> = props => {
|
||||||
|
return (
|
||||||
|
<SegmentedControl
|
||||||
|
data={data}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -1,6 +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 { ExpenseTagSchema } from "../../../../../client";
|
import { TransactionTagSchema } from "../../../../../client";
|
||||||
import { TextInput } from "@mantine/core";
|
import { TextInput } from "@mantine/core";
|
||||||
|
|
||||||
|
|
||||||
@@ -9,10 +9,10 @@ type Props = {
|
|||||||
setTagName: (tagName: string) => void;
|
setTagName: (tagName: string) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const useExpenseTagsTableColumns = ({
|
export const useTransactionTagsTableColumns = ({
|
||||||
editingTagId, setTagName,
|
editingTagId, setTagName,
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
return useMemo<MRT_ColumnDef<ExpenseTagSchema>[]>(
|
return useMemo<MRT_ColumnDef<TransactionTagSchema>[]>(
|
||||||
() => [
|
() => [
|
||||||
{
|
{
|
||||||
accessorKey: "name",
|
accessorKey: "name",
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
import { useMemo } from "react";
|
import { useMemo } from "react";
|
||||||
import { MRT_ColumnDef } from "mantine-react-table";
|
import { MRT_ColumnDef } from "mantine-react-table";
|
||||||
import { ExpenseSchemaBase } from "../../../../../client";
|
import { TransactionSchemaBase } from "../../../../../client";
|
||||||
import { formatDate } from "../../../../../types/utils.ts";
|
import { formatDate } from "../../../../../types/utils.ts";
|
||||||
|
|
||||||
|
|
||||||
export const useExpensesTableColumns = () => {
|
export const useTransactionsTableColumns = () => {
|
||||||
return useMemo<MRT_ColumnDef<ExpenseSchemaBase>[]>(
|
return useMemo<MRT_ColumnDef<TransactionSchemaBase>[]>(
|
||||||
() => [
|
() => [
|
||||||
{
|
{
|
||||||
accessorKey: "spentDate",
|
accessorKey: "spentDate",
|
||||||
@@ -3,22 +3,25 @@ import { useForm } from "@mantine/form";
|
|||||||
import { Flex, NumberInput, rem, TextInput } from "@mantine/core";
|
import { Flex, NumberInput, rem, TextInput } from "@mantine/core";
|
||||||
import BaseFormModal, { CreateEditFormProps } from "../../../../ClientsPage/modals/BaseFormModal/BaseFormModal.tsx";
|
import BaseFormModal, { CreateEditFormProps } from "../../../../ClientsPage/modals/BaseFormModal/BaseFormModal.tsx";
|
||||||
import { DatePickerInput } from "@mantine/dates";
|
import { DatePickerInput } from "@mantine/dates";
|
||||||
import ExpenseTagsInput from "../components/ExpenseTagsInput.tsx";
|
import TransactionTagsInput from "../components/TransactionTagsInput.tsx";
|
||||||
import { Expense } from "../types/Expense.tsx";
|
import { Transaction } from "../types/Transaction.tsx";
|
||||||
|
|
||||||
type Props = CreateEditFormProps<Expense>;
|
type IsIncome = {
|
||||||
|
isIncome: boolean;
|
||||||
|
}
|
||||||
|
type Props = CreateEditFormProps<Transaction> & IsIncome;
|
||||||
|
|
||||||
const ExpenseFormModal = ({
|
const TransactionFormModal = ({
|
||||||
context,
|
context,
|
||||||
id,
|
id,
|
||||||
innerProps,
|
innerProps,
|
||||||
}: ContextModalProps<Props>) => {
|
}: ContextModalProps<Props>) => {
|
||||||
const isEditing = "element" in innerProps;
|
const isEditing = "element" in innerProps;
|
||||||
const initialValue: Partial<Expense> = isEditing
|
const initialValue: Partial<Transaction> = isEditing
|
||||||
? innerProps.element
|
? innerProps.element
|
||||||
: {};
|
: {};
|
||||||
|
|
||||||
const form = useForm<Partial<Expense>>({
|
const form = useForm<Partial<Transaction>>({
|
||||||
initialValues: initialValue,
|
initialValues: initialValue,
|
||||||
validate: {
|
validate: {
|
||||||
name: name => !name && "Необходимо указать наименование",
|
name: name => !name && "Необходимо указать наименование",
|
||||||
@@ -59,8 +62,9 @@ const ExpenseFormModal = ({
|
|||||||
placeholder={"Укажите дату расхода"}
|
placeholder={"Укажите дату расхода"}
|
||||||
valueFormat={"DD.MM.YYYY"}
|
valueFormat={"DD.MM.YYYY"}
|
||||||
/>
|
/>
|
||||||
<ExpenseTagsInput
|
<TransactionTagsInput
|
||||||
{...form.getInputProps("tags")}
|
{...form.getInputProps("tags")}
|
||||||
|
isIncome={innerProps.isIncome}
|
||||||
/>
|
/>
|
||||||
</Flex>
|
</Flex>
|
||||||
</BaseFormModal.Body>
|
</BaseFormModal.Body>
|
||||||
@@ -68,4 +72,4 @@ const ExpenseFormModal = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default ExpenseFormModal;
|
export default TransactionFormModal;
|
||||||
@@ -1,23 +1,24 @@
|
|||||||
import { ContextModalProps } from "@mantine/modals";
|
import { ContextModalProps } from "@mantine/modals";
|
||||||
import { BaseExpenseTagSchema, ExpenseService, ExpenseTagSchema } from "../../../../../client";
|
import { BaseTransactionTagSchema, TransactionService, TransactionTagSchema } from "../../../../../client";
|
||||||
import useExpenseTagsList from "../../../hooks/useExpenseTagsList.tsx";
|
import useTransactionTagsList from "../../../hooks/useTransactionTagsList.tsx";
|
||||||
import ExpenseTagsTable from "../components/ExpenseTagsTable.tsx";
|
import TransactionTagsTable from "../components/TransactionTagsTable.tsx";
|
||||||
import { useCRUD } from "../../../../../hooks/useCRUD.tsx";
|
import { useCRUD } from "../../../../../hooks/useCRUD.tsx";
|
||||||
import { notifications } from "../../../../../shared/lib/notifications.ts";
|
import { notifications } from "../../../../../shared/lib/notifications.ts";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
onChange: () => Promise<void>;
|
onChange: () => Promise<void>;
|
||||||
|
isIncome: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
const ExpenseTagsModal = ({
|
const TransactionTagsModal = ({
|
||||||
innerProps,
|
innerProps,
|
||||||
}: ContextModalProps<Props>) => {
|
}: ContextModalProps<Props>) => {
|
||||||
const { onChange: onTagChange } = innerProps;
|
const { onChange: onTagChange } = innerProps;
|
||||||
const { objects: expenseTags, refetch } = useExpenseTagsList();
|
const { objects: expenseTags, refetch } = useTransactionTagsList({ isIncome: innerProps.isIncome });
|
||||||
|
|
||||||
const crud = useCRUD<ExpenseTagSchema, BaseExpenseTagSchema>({
|
const crud = useCRUD<TransactionTagSchema, BaseTransactionTagSchema>({
|
||||||
onChange: tag => {
|
onChange: tag => {
|
||||||
ExpenseService.updateExpenseTag({
|
TransactionService.updateTransactionTag({
|
||||||
requestBody: {
|
requestBody: {
|
||||||
tag,
|
tag,
|
||||||
},
|
},
|
||||||
@@ -31,9 +32,12 @@ const ExpenseTagsModal = ({
|
|||||||
.catch(err => console.log(err));
|
.catch(err => console.log(err));
|
||||||
},
|
},
|
||||||
onCreate: tag => {
|
onCreate: tag => {
|
||||||
ExpenseService.createExpenseTag({
|
TransactionService.createTransactionTag({
|
||||||
requestBody: {
|
requestBody: {
|
||||||
tag,
|
tag: {
|
||||||
|
...tag,
|
||||||
|
isIncome: innerProps.isIncome,
|
||||||
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then(async ({ ok, message }) => {
|
.then(async ({ ok, message }) => {
|
||||||
@@ -45,7 +49,7 @@ const ExpenseTagsModal = ({
|
|||||||
.catch(err => console.log(err));
|
.catch(err => console.log(err));
|
||||||
},
|
},
|
||||||
onDelete: (tag) => {
|
onDelete: (tag) => {
|
||||||
ExpenseService.deleteExpenseTag({
|
TransactionService.deleteTransactionTag({
|
||||||
tagId: tag.id,
|
tagId: tag.id,
|
||||||
})
|
})
|
||||||
.then(async ({ ok, message }) => {
|
.then(async ({ ok, message }) => {
|
||||||
@@ -58,8 +62,12 @@ const ExpenseTagsModal = ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ExpenseTagsTable {...crud} items={expenseTags} />
|
<TransactionTagsTable
|
||||||
|
{...crud}
|
||||||
|
items={expenseTags}
|
||||||
|
isIncome={innerProps.isIncome}
|
||||||
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default ExpenseTagsModal;
|
export default TransactionTagsModal;
|
||||||
@@ -1,11 +1,12 @@
|
|||||||
import type { UserSchema } from "../../../../../client";
|
import type { UserSchema } from "../../../../../client";
|
||||||
|
|
||||||
export type Expense = {
|
export type Transaction = {
|
||||||
id: number;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
comment: string;
|
comment: string;
|
||||||
amount: number;
|
amount: number;
|
||||||
createdByUser: UserSchema;
|
createdByUser: UserSchema;
|
||||||
spentDate: string;
|
spentDate: string;
|
||||||
|
isIncome: boolean;
|
||||||
tags: Array<string>;
|
tags: Array<string>;
|
||||||
};
|
};
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
import { FC } from "react";
|
|
||||||
import useExpenseTagsList from "../../../AdminPage/hooks/useExpenseTagsList.tsx";
|
|
||||||
import { ExpenseTagSchema } from "../../../../client";
|
|
||||||
import ObjectSelect, { ObjectSelectProps } from "../../../../components/ObjectSelect/ObjectSelect.tsx";
|
|
||||||
|
|
||||||
type Props = Omit<
|
|
||||||
ObjectSelectProps<ExpenseTagSchema | null>,
|
|
||||||
"data" | "getValueFn" | "getLabelFn"
|
|
||||||
>;
|
|
||||||
const ExpenseTagSelect: FC<Props> = props => {
|
|
||||||
const { objects: tags } = useExpenseTagsList();
|
|
||||||
return (
|
|
||||||
<ObjectSelect
|
|
||||||
data={tags}
|
|
||||||
getLabelFn={(tag: ExpenseTagSchema) => tag.name}
|
|
||||||
getValueFn={(tag: ExpenseTagSchema) => tag.id.toString()}
|
|
||||||
clearable
|
|
||||||
{...props}
|
|
||||||
onClear={() => props.onChange(null)}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
export default ExpenseTagSelect;
|
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import { FC } from "react";
|
||||||
|
import { TransactionTagSchema } from "../../../../client";
|
||||||
|
import ObjectSelect, { ObjectSelectProps } from "../../../../components/ObjectSelect/ObjectSelect.tsx";
|
||||||
|
import useAllTransactionTagsList from "../../../AdminPage/hooks/useAllTransactionTagsList.tsx";
|
||||||
|
|
||||||
|
type IsIncome = {
|
||||||
|
isIncome: boolean;
|
||||||
|
}
|
||||||
|
type Props = Omit<
|
||||||
|
ObjectSelectProps<TransactionTagSchema | null>,
|
||||||
|
"data" | "getValueFn" | "getLabelFn"
|
||||||
|
> & IsIncome;
|
||||||
|
const TransactionTagSelect: FC<Props> = props => {
|
||||||
|
let { objects: tags } = useAllTransactionTagsList();
|
||||||
|
tags = tags.filter(tag => tag.isIncome === props.isIncome);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ObjectSelect
|
||||||
|
data={tags}
|
||||||
|
getLabelFn={(tag: TransactionTagSchema) => tag.name}
|
||||||
|
getValueFn={(tag: TransactionTagSchema) => tag.id.toString()}
|
||||||
|
clearable
|
||||||
|
{...props}
|
||||||
|
onClear={() => props.onChange(null)}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
export default TransactionTagSelect;
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { DatePickerInput, DatePickerInputProps } from "@mantine/dates";
|
import { DatePickerInput, DatePickerInputProps } from "@mantine/dates";
|
||||||
import { Divider, Stack, Text } from "@mantine/core";
|
import { Divider, Stack, Text } from "@mantine/core";
|
||||||
import ClientSelectNew from "../../../../../../components/Selects/ClientSelectNew/ClientSelectNew.tsx";
|
import ClientSelectNew from "../../../../../../components/Selects/ClientSelectNew/ClientSelectNew.tsx";
|
||||||
import { BaseMarketplaceSchema, ClientSchema, ExpenseTagSchema, UserSchema } from "../../../../../../client";
|
import { BaseMarketplaceSchema, ClientSchema, TransactionTagSchema, UserSchema } from "../../../../../../client";
|
||||||
import { ObjectSelectProps } from "../../../../../../components/ObjectSelect/ObjectSelect.tsx";
|
import { ObjectSelectProps } from "../../../../../../components/ObjectSelect/ObjectSelect.tsx";
|
||||||
import BaseMarketplaceSelect
|
import BaseMarketplaceSelect
|
||||||
from "../../../../../../components/Selects/BaseMarketplaceSelect/BaseMarketplaceSelect.tsx";
|
from "../../../../../../components/Selects/BaseMarketplaceSelect/BaseMarketplaceSelect.tsx";
|
||||||
@@ -9,35 +9,34 @@ import DealStatusSelect from "../../../../../DealsPage/components/DealStatusSele
|
|||||||
import { DealStatusType } from "../../../../../../shared/enums/DealStatus.ts";
|
import { DealStatusType } from "../../../../../../shared/enums/DealStatus.ts";
|
||||||
import { ProfitTableSegmentedControl } from "../ProfitTableSegmentedControl/ProfitTableSegmentedControl.tsx";
|
import { ProfitTableSegmentedControl } from "../ProfitTableSegmentedControl/ProfitTableSegmentedControl.tsx";
|
||||||
import ManagerSelect from "../../../../../../components/ManagerSelect/ManagerSelect.tsx";
|
import ManagerSelect from "../../../../../../components/ManagerSelect/ManagerSelect.tsx";
|
||||||
import ExpenseTagSelect from "../../../../components/ExpenseTagSelect/ExpenseTagSelect.tsx";
|
import TransactionTagSelect from "../../../../components/ExpenseTagSelect/TransactionTagSelect.tsx";
|
||||||
|
|
||||||
|
|
||||||
|
type SelectProps<T> = Omit<
|
||||||
|
ObjectSelectProps<T>,
|
||||||
|
"data" | "getValueFn" | "getLabelFn"
|
||||||
|
>;
|
||||||
|
|
||||||
type FiltersProps = {
|
type FiltersProps = {
|
||||||
datePickerProps?: DatePickerInputProps<"range">;
|
datePickerProps?: DatePickerInputProps<"range">;
|
||||||
|
|
||||||
clientSelectProps?: Omit<ObjectSelectProps<ClientSchema>, "data">;
|
clientSelectProps?: Omit<ObjectSelectProps<ClientSchema>, "data">;
|
||||||
onClientClear?: () => void;
|
onClientClear?: () => void;
|
||||||
|
|
||||||
baseMarketplaceSelectProps?: Omit<
|
baseMarketplaceSelectProps?: SelectProps<BaseMarketplaceSchema>;
|
||||||
ObjectSelectProps<BaseMarketplaceSchema>,
|
|
||||||
"data" | "getValueFn" | "getLabelFn"
|
|
||||||
>;
|
|
||||||
onBaseMarketplaceClear?: () => void;
|
onBaseMarketplaceClear?: () => void;
|
||||||
|
|
||||||
dealStatusSelectProps?: Omit<ObjectSelectProps<DealStatusType>, "data">;
|
dealStatusSelectProps?: Omit<ObjectSelectProps<DealStatusType>, "data">;
|
||||||
onDealStatusClear?: () => void;
|
onDealStatusClear?: () => void;
|
||||||
|
|
||||||
managerSelectProps?: Omit<
|
managerSelectProps?: SelectProps<UserSchema | null | undefined>;
|
||||||
ObjectSelectProps<UserSchema | null>,
|
|
||||||
"data" | "getValueFn" | "getLabelFn"
|
|
||||||
>;
|
|
||||||
onManagerClear?: () => void;
|
onManagerClear?: () => void;
|
||||||
|
|
||||||
tagSelectProps?: Omit<
|
expenseTagSelectProps?: SelectProps<TransactionTagSchema | null>;
|
||||||
ObjectSelectProps<ExpenseTagSchema | null>,
|
onExpenseTagClear?: () => void;
|
||||||
"data" | "getValueFn" | "getLabelFn"
|
|
||||||
>;
|
incomeTagSelectProps?: SelectProps<TransactionTagSchema | null>;
|
||||||
onTagClear?: () => void;
|
onIncomeTagClear?: () => void;
|
||||||
|
|
||||||
groupTableByProps?: {
|
groupTableByProps?: {
|
||||||
value: string,
|
value: string,
|
||||||
@@ -46,20 +45,24 @@ type FiltersProps = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const Filters = (props: FiltersProps) => {
|
export const Filters = (props: FiltersProps) => {
|
||||||
const {
|
const getTransactionTagsSelect = (isIncome: boolean) => {
|
||||||
datePickerProps,
|
const selectProps = isIncome ? props.incomeTagSelectProps : props.expenseTagSelectProps;
|
||||||
clientSelectProps,
|
if (!selectProps) return;
|
||||||
onClientClear,
|
const onClear = isIncome ? props.onIncomeTagClear : props.onExpenseTagClear;
|
||||||
baseMarketplaceSelectProps,
|
const label = "Фильтры для " + (isIncome ? "доходов:" : "расходов:");
|
||||||
onBaseMarketplaceClear,
|
return (
|
||||||
dealStatusSelectProps,
|
<>
|
||||||
onDealStatusClear,
|
<Divider />
|
||||||
managerSelectProps,
|
<Text>{label}</Text>
|
||||||
onManagerClear,
|
<TransactionTagSelect
|
||||||
tagSelectProps,
|
{...selectProps}
|
||||||
onTagClear,
|
onClear={onClear}
|
||||||
groupTableByProps,
|
placeholder={"Выберите тег"}
|
||||||
} = props;
|
isIncome={isIncome}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack mb={"lg"}>
|
<Stack mb={"lg"}>
|
||||||
@@ -67,64 +70,55 @@ export const Filters = (props: FiltersProps) => {
|
|||||||
<Text>
|
<Text>
|
||||||
Фильтры для выручки и прибыли:
|
Фильтры для выручки и прибыли:
|
||||||
</Text>
|
</Text>
|
||||||
{datePickerProps &&
|
{props.datePickerProps &&
|
||||||
<DatePickerInput
|
<DatePickerInput
|
||||||
{...datePickerProps}
|
{...props.datePickerProps}
|
||||||
type="range"
|
type="range"
|
||||||
placeholder="Выберите даты"
|
placeholder="Выберите даты"
|
||||||
maxDate={new Date()}
|
maxDate={new Date()}
|
||||||
valueFormat={"DD.MM.YYYY"}
|
valueFormat={"DD.MM.YYYY"}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
{dealStatusSelectProps &&
|
{props.dealStatusSelectProps &&
|
||||||
<DealStatusSelect
|
<DealStatusSelect
|
||||||
{...dealStatusSelectProps}
|
{...props.dealStatusSelectProps}
|
||||||
onClear={onDealStatusClear}
|
onClear={props.onDealStatusClear}
|
||||||
clearable
|
clearable
|
||||||
placeholder={"Выберите статус"}
|
placeholder={"Выберите статус"}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
{clientSelectProps &&
|
{props.clientSelectProps &&
|
||||||
<ClientSelectNew
|
<ClientSelectNew
|
||||||
{...clientSelectProps}
|
{...props.clientSelectProps}
|
||||||
onClear={onClientClear}
|
onClear={props.onClientClear}
|
||||||
clearable
|
clearable
|
||||||
searchable
|
searchable
|
||||||
placeholder={"Выберите клиента"}
|
placeholder={"Выберите клиента"}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
{baseMarketplaceSelectProps &&
|
{props.baseMarketplaceSelectProps &&
|
||||||
<BaseMarketplaceSelect
|
<BaseMarketplaceSelect
|
||||||
{...baseMarketplaceSelectProps}
|
{...props.baseMarketplaceSelectProps}
|
||||||
onClear={onBaseMarketplaceClear}
|
onClear={props.onBaseMarketplaceClear}
|
||||||
clearable
|
clearable
|
||||||
placeholder={"Выберите маркетплейс"}
|
placeholder={"Выберите маркетплейс"}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
{managerSelectProps &&
|
{props.managerSelectProps &&
|
||||||
<ManagerSelect
|
<ManagerSelect
|
||||||
{...managerSelectProps}
|
{...props.managerSelectProps}
|
||||||
onClear={onManagerClear}
|
onClear={props.onManagerClear}
|
||||||
placeholder={"Выберите менеджера"}
|
placeholder={"Выберите менеджера"}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
{tagSelectProps &&
|
{getTransactionTagsSelect(false)}
|
||||||
<>
|
{getTransactionTagsSelect(true)}
|
||||||
<Divider />
|
{props.groupTableByProps &&
|
||||||
<Text>Фильтры для расходов:</Text>
|
|
||||||
<ExpenseTagSelect
|
|
||||||
{...tagSelectProps}
|
|
||||||
onClear={onTagClear}
|
|
||||||
placeholder={"Выберите тег"}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
}
|
|
||||||
{groupTableByProps &&
|
|
||||||
<>
|
<>
|
||||||
<Divider />
|
<Divider />
|
||||||
<Text>Группировка таблицы:</Text>
|
<Text>Группировка таблицы:</Text>
|
||||||
<ProfitTableSegmentedControl
|
<ProfitTableSegmentedControl
|
||||||
{...groupTableByProps}
|
{...props.groupTableByProps}
|
||||||
orientation={"vertical"}
|
orientation={"vertical"}
|
||||||
size={"md"}
|
size={"md"}
|
||||||
w={"100%"}
|
w={"100%"}
|
||||||
|
|||||||
@@ -29,7 +29,8 @@ const useProfitTabContextState = () => {
|
|||||||
marketplace: null,
|
marketplace: null,
|
||||||
dealStatus: defaultDealStatus,
|
dealStatus: defaultDealStatus,
|
||||||
manager: null,
|
manager: null,
|
||||||
tag: null,
|
expenseTag: null,
|
||||||
|
incomeTag: null,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const [isChartLoading, setIsChartLoading] = useState(false);
|
const [isChartLoading, setIsChartLoading] = useState(false);
|
||||||
@@ -49,7 +50,8 @@ const useProfitTabContextState = () => {
|
|||||||
baseMarketplaceKey: form.values.marketplace?.key ?? "all",
|
baseMarketplaceKey: form.values.marketplace?.key ?? "all",
|
||||||
dealStatusId: form.values.dealStatus?.id ?? -1,
|
dealStatusId: form.values.dealStatus?.id ?? -1,
|
||||||
managerId: form.values.manager?.id ?? -1,
|
managerId: form.values.manager?.id ?? -1,
|
||||||
tagId: form.values.tag?.id ?? -1,
|
expenseTagId: form.values.expenseTag?.id ?? -1,
|
||||||
|
incomeTagId: form.values.incomeTag?.id ?? -1,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -44,8 +44,10 @@ export const ProfitFiltersModal = ({ form }: Props) => {
|
|||||||
onDealStatusClear={() => form.setFieldValue("dealStatus", null)}
|
onDealStatusClear={() => form.setFieldValue("dealStatus", null)}
|
||||||
managerSelectProps={form.getInputProps("manager")}
|
managerSelectProps={form.getInputProps("manager")}
|
||||||
onManagerClear={() => form.setFieldValue("manager", null)}
|
onManagerClear={() => form.setFieldValue("manager", null)}
|
||||||
tagSelectProps={form.getInputProps("tag")}
|
expenseTagSelectProps={form.getInputProps("expenseTag")}
|
||||||
onTagClear={() => form.setFieldValue("tag", null)}
|
onExpenseTagClear={() => form.setFieldValue("expenseTag", null)}
|
||||||
|
incomeTagSelectProps={form.getInputProps("incomeTag")}
|
||||||
|
onIncomeTagClear={() => form.setFieldValue("incomeTag", null)}
|
||||||
/>
|
/>
|
||||||
</Modal>
|
</Modal>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import {
|
import {
|
||||||
GroupStatisticsTable,
|
GroupStatisticsTable,
|
||||||
} from "../tabs/ProfitTab/components/ProfitTableSegmentedControl/ProfitTableSegmentedControl.tsx";
|
} from "../tabs/ProfitTab/components/ProfitTableSegmentedControl/ProfitTableSegmentedControl.tsx";
|
||||||
import { BaseMarketplaceSchema, ClientSchema, ExpenseTagSchema, UserSchema } from "../../../client";
|
import { BaseMarketplaceSchema, ClientSchema, TransactionTagSchema, UserSchema } from "../../../client";
|
||||||
import { DealStatusType } from "../../../shared/enums/DealStatus.ts";
|
import { DealStatusType } from "../../../shared/enums/DealStatus.ts";
|
||||||
|
|
||||||
export interface FormFilters {
|
export interface FormFilters {
|
||||||
@@ -11,5 +11,6 @@ export interface FormFilters {
|
|||||||
marketplace: BaseMarketplaceSchema | null;
|
marketplace: BaseMarketplaceSchema | null;
|
||||||
dealStatus: DealStatusType | null;
|
dealStatus: DealStatusType | null;
|
||||||
manager: UserSchema | null;
|
manager: UserSchema | null;
|
||||||
tag: ExpenseTagSchema | null;
|
expenseTag: TransactionTagSchema | null;
|
||||||
|
incomeTag: TransactionTagSchema | null;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user