feat(holiday-system): add holiday population functionality and API integration

- Implemented a new API endpoint to populate country holidays in the database.
- Enhanced the HolidayController to handle holiday population logic for multiple countries.
- Updated the holiday API router to include the new populate endpoint.
- Added a service method in the frontend to trigger holiday population.
- Integrated a button in the admin center overview for easy access to populate holidays.
- Improved error handling and user feedback during the holiday population process.
This commit is contained in:
chamikaJ
2025-07-17 11:27:29 +05:30
parent 5214368354
commit f73c151da2
5 changed files with 380 additions and 240 deletions

View File

@@ -65,4 +65,10 @@ export const holidayApiService = {
const response = await apiClient.get<IServerResponse<IHolidayCalendarEvent[]>>(`${rootUrl}/calendar?year=${year}&month=${month}`);
return response.data;
},
// Populate holidays
populateCountryHolidays: async (): Promise<IServerResponse<any>> => {
const response = await apiClient.post<IServerResponse<any>>(`${rootUrl}/populate`);
return response.data;
},
};