Build a backend service that handles a (very simple) recruiting process. The process requires two types of objects: job offers and applications from candidates. minimum required fields for the objects are:
Offer:
jobTitle (unique)
startDate
numberOfApplications
Application:
related offer
candidate email (unique per Offer)
resume text
applicationStatus (APPLIED, INVITED, REJECTED, HIRED)
Not all of the fields have to be persisted. You may use ad hoc calculation, event sourcing, or whatever you see fit. These are the fields that must be returned by the API. You may add fields where necessary.
- user has to be able to create a job offer and read a single and list all offers.
- candidate has to be able to apply for an offer.
- user has to be able to read one and list all applications per offer.
- user has to be able to progress the status of an application.
- user has to be able to track the number of applications.
- status change triggers a notification (*)
(*) a log output will suffice as a notification here, but you should design it as if each status change triggers a completely different business case.
use SpringBoot to build this service. The service must run standalone and must not require any third party software to be installed. the service must communicate Json over http (REST). return proper status codes for the most common problems. the data does not have to be stored permanently, it may be handled in-memory during runtime.
- a description how to build and use the service
- clean code
- use of the spring framework and spring best practices
- structure of the project
- how you test your code
- JDK8+
- Maven
- Postman or any other Rest Client
git clone https://github.com/vinaypoddar1/offer-application.git
cd offer-application
mvn clean install
mvn spring-boot:run //by deafult it will run on port 8080
Content-Type:application/json
POST localhost:8080/heavenHR/v1/offers
{
"jobTitle":"Python",
"startDate":"2018-10-20"
}
201 CREATED
{
"timestamp": 1538210407225,
"status": 201,
"error": "Created",
"message": "Offer Created Successfully",
"path": "/heavenHR/v1/offers"
}
GET localhost:8080/heavenHR/v1/offers
200 OK
[
{
"jobTitle": "Python",
"startDate": 1538206614998,
"numberOfApplications": 0
}
]
GET localhost:8080/heavenHR/v1/offers/{Job-Title}
Example:
GET localhost:8080/heavenHR/v1/offers/Python
200 OK
{
"jobTitle": "Python",
"startDate": 1538206614998,
"numberOfApplications": 0
}
POST localhost:8080/heavenHR/v1/offers/{Job-Title}/applications
Example:
POST localhost:8080/heavenHR/v1/offers/Python/applications
{
"offer":"Python",
"candidateEmail":"paul@aol.com",
"resumeText":"Sample Python Resume"
}
201 CREATED
{
"timestamp": 1538210475739,
"status": 201,
"error": "Created",
"message": "Application Created Successfully",
"path": "/heavenHR/v1/offers/Python/applications"
}
POST localhost:8080/heavenHR/v1/offers/{Job-Title}/applications/track
Example:
POST localhost:8080/heavenHR/v1/offers/Python/applications/track
{
"email":"paul@aol.com"
}
200 OK
{
"candidateEmail": "paul@aol.com",
"resumeText":"Sample Python Resume",
"applicationStatus": "APPLIED",
"offerTitle": "Python"
}
GET localhost:8080/heavenHR/v1/offers/{Job-Title}/applications
Example:
GET localhost:8080/heavenHR/v1/offers/Python/applications
200 OK
[
{
"candidateEmail": "paul@aol.com",
"resumeText":"Sample Python Resume",
"applicationStatus": "APPLIED",
"offerTitle": "Python"
}
]
PUT localhost:8080/heavenHR/v1/offers/{Job-Title}/applications/update
Example:
PUT localhost:8080/heavenHR/v1/offers/Python/applications/update
{
"email":"paul@aol.com",
"status": "HIRED"
}
200 OK
{
"timestamp": 1538210295889,
"status": 200,
"error": "OK",
"message": "Application Status Updated Successfully",
"path": "/heavenHR/v1/offers/Python/applications/update"
}
GET localhost:8080/heavenHR/v1/offers/{Job-Title}
Example:
GET localhost:8080/heavenHR/v1/offers/Python
200 OK
{
"jobTitle": "Python",
"startDate": 1538206614998,
"numberOfApplications": 1
}
POST localhost:8080/heavenHR/v1/offers/applications/email
{
"email":"paul@aol.com"
}
200 OK
[
{
"candidateEmail": "paul@aol.com",
"resumeText":"Sample Python Resume",
"applicationStatus": "HIRED", // Yippie!!!
"offerTitle": "Python"
}
]