The CapitalPlacement API is a .NET 8 Web API application designed to manage employer programs and candidate applications. Employers can create programs with custom questions, and candidates can apply to these programs by answering the questions. The application leverages Azure Cosmos DB for data storage and runs on Docker Compose for containerized deployment.
-
Employers:
- Create Program: Employers can create a program with mandatory fields such as title and description, along with custom questions (e.g., Paragraph, Yes/No, Dropdown, Multiple Choice, Date, Number).
- Edit Program: Employers can edit the program details and questions after creation.
-
Candidates:
- View Program: Candidates can view the list of questions for a program.
- Apply to Program: Candidates can submit their application by answering the questions. The application captures mandatory fields such as first name, last name, and email, ensuring that the email is unique.
- Docker and Docker Compose installed
- .NET 8 SDK installed
-
Clone the Repository
git clone https://github.com/your-repo/capitalplacement-api.git cd capitalplacement-api
-
Set Up Docker Compose
The application and the Azure Cosmos DB emulator are configured to run using Docker Compose.
-
Build and Run the Services
docker-compose up --build
This command will build the Docker images and start the services defined in the
docker-compose.yml
file.
- POST
/api/v1/employers/{employerid}/programs/{programid}/submit-application
- Parameters:
employerid
,programid
- Responses:
200 OK
,400 Bad Request
,422 Unprocessable Entity
,500 Internal Server Error
- Parameters:
- POST
/api/v1/employers/{employerid}/programs
- Parameters:
employerid
- Responses:
200 OK
,400 Bad Request
,422 Unprocessable Entity
,500 Internal Server Error
- Parameters:
- GET
/api/v1/employers/{employerid}/programs/{programid}
- Parameters:
employerid
,programid
- Responses:
200 OK
,400 Bad Request
,422 Unprocessable Entity
,500 Internal Server Error
- Parameters:
- PUT
/api/v1/employers/{employerid}/programs/{programid}
- Parameters:
employerid
,programid
- Responses:
204 No Content
,400 Bad Request
,422 Unprocessable Entity
,500 Internal Server Error
- Parameters:
Given extra time, several improvements could be made to enhance the functionality and robustness of the application:
- Validation of DTOs: Implement comprehensive validation for Data Transfer Objects (DTOs) to ensure data integrity and provide meaningful error messages to users.
- Domain Logic Checks:
- Ensure a Candidate Can Apply More Than Once: Implement logic to prevent multiple applications from the same candidate to the same program.
- Ensure All Required Questions Are Answered: Validate that all mandatory questions are answered before accepting an application.
- Ensure Answers Match Question Type: Check that the answers provided by candidates match the expected type of each question.
- Check Questions Exist Before Accepting an Answer: Verify that all questions referenced in the application exist in the program before accepting the answers.
- Adding Unit Tests: Implement robust tests to ensure code stability.
These enhancements would ensure that the application is more robust, user-friendly, and reliable, providing a better experience for both employers and candidates.