feat(project-finance): add finance data export functionality

- Implemented a new endpoint in the project finance controller to export financial data as an Excel file, allowing users to download project finance details.
- Enhanced the frontend to include an export button that triggers the finance data export, with appropriate loading states and error handling.
- Added functionality to group exported data by status, priority, or phases, improving the usability of the exported reports.
- Updated the project finance API service to handle the export request and return the generated Excel file as a Blob.
This commit is contained in:
chamiakJ
2025-05-29 01:17:05 +05:30
parent a87ea46b97
commit b8cc9b5b73
4 changed files with 437 additions and 2 deletions

View File

@@ -49,4 +49,18 @@ export const projectFinanceApiService = {
);
return response.data;
},
exportFinanceData: async (
projectId: string,
groupBy: 'status' | 'priority' | 'phases' = 'status'
): Promise<Blob> => {
const response = await apiClient.get(
`${rootUrl}/project/${projectId}/export`,
{
params: { groupBy },
responseType: 'blob'
}
);
return response.data;
},
}