Open dhanashri-dotcom opened 1 week ago
Currently the API is calling a real API hosted in AWS. We want the API to call a placeholder "API" that you have built or modified. As a bonus, explore how to configure the frontend to use the placeholder API or real API at "runtime" (hint: environment variables).
Updated:
Task 1: Design API Endpoint Description: Design the API structure, including the endpoint URLs, HTTP methods, and the request/response body. Ensure the API conforms the REST standards. Acceptance Criteria:
/api/v1/return-to-work-score
).POST
) is decided.Task2: Create Placeholder Functions for API Simulation Description: Create placeholder API functions to simulate the Return-To-Work score calculation. These functions will return a hardcoded or calculated score until the real API is available. Acceptance Criteria:
{
"clientId": "12345",
"updatedClientInfo": {
"educationLevel": "Bachelor's",
"employmentStatus": "Part-time",
"medicalCondition": "Stable"
}
}
res.json
might have a structure:
const result = {
probability: 85,
interventions: [
"Attend job skills workshop: increased by 2.5%",
"Participate in language improvement classes: increased by 3%",
"Join professional networking events: increased by 2%"
]
};
res.json(result);
Task: Identify an API that calculates the new Return-To-Work score based on the updated client information. Create placeholder API calls for frontend development if the backend APIs don’t exist yet. Description: Inform the backend team about the api. Add temporary placeholder functions to simulate API interactions to calculate the Return-To-Work score using updated client information and store the new score in the database. Acceptance Criteria: