- Java 17 or higher
- Git
-
Clone the repository
git clone https://github.com/1234-ad/workforce-management-api.git cd workforce-management-api -
Make gradlew executable (Linux/Mac)
chmod +x gradlew
-
Run the application
# Linux/Mac ./gradlew bootRun # Windows gradlew.bat bootRun
-
Verify it's running
- Open browser to: http://localhost:8080/api/tasks
- You should see sample tasks in JSON format
# Make the script executable
chmod +x test-api.sh
# Run the comprehensive test
./test-api.sh- Import
Workforce-Management-API.postman_collection.json - Set the
baseUrlvariable tohttp://localhost:8080 - Run the requests in order
Get all tasks:
curl http://localhost:8080/api/tasksCreate a new task:
curl -X POST http://localhost:8080/api/tasks \
-H "Content-Type: application/json" \
-H "X-User-ID: manager1" \
-d '{
"title": "Test Task",
"description": "Testing the API",
"startDate": "2025-08-05",
"dueDate": "2025-08-08",
"assignedStaffId": "staff1",
"assignedStaffName": "John Doe",
"priority": "HIGH"
}'Get tasks by priority:
curl http://localhost:8080/api/tasks/priority/HIGH- Task Reassignment: Use
/api/tasks/assign-by-ref/{customerRef}- old task gets cancelled - Cancelled Task Filtering: Cancelled tasks don't appear in listings
- Smart Date Filtering:
/api/tasks/date-range?startDate=2025-08-05&endDate=2025-08-05 - Priority Management:
/api/tasks/priority/HIGH - Comments: POST to
/api/tasks/{id}/comments - Activity History: GET
/api/tasks/{id}shows full history
The application starts with sample tasks:
- Customer onboarding task (staff1)
- Sales follow-up task (staff2)
Port already in use:
# Change port in src/main/resources/application.properties
server.port=8081Java version issues:
# Check Java version
java -version
# Should be Java 17 or higherBuild issues:
# Clean and rebuild
./gradlew clean build| Method | Endpoint | Description |
|---|---|---|
| GET | /api/tasks |
Get all active tasks |
| POST | /api/tasks |
Create new task |
| GET | /api/tasks/{id} |
Get task with history |
| GET | /api/tasks/staff/{staffId} |
Get tasks by staff |
| GET | /api/tasks/priority/{priority} |
Get tasks by priority |
| GET | /api/tasks/today |
Get today's tasks |
| GET | /api/tasks/date-range |
Smart date filtering |
| PUT | /api/tasks/{id}/priority |
Update priority |
| POST | /api/tasks/{id}/comments |
Add comment |
| POST | /api/tasks/assign-by-ref/{ref} |
Reassign task |
| PUT | /api/tasks/{id}/status |
Update status |
The video demonstration should cover:
- Starting the application
- Testing basic CRUD operations
- Demonstrating bug fixes (reassignment, filtering)
- Showing new features (priority, comments, smart filtering)
- Viewing activity history and comments
Remember to:
- ✅ Public GitHub repository
- ✅ Video demonstration (5-10 minutes)
- ✅ SUBMISSION.md completed
- ✅ Email with subject: "Railse backend Assignment"