http://localhost:8084
Authorization: Bearer <jwt-token>
X-User-Subject: <user-id>
X-User-Roles: ROLE_CUSTOMER (or ROLE_EMPLOYEE, ROLE_ADMIN)POST /services
Role: EMPLOYEE
{
"appointmentId": "APT-001",
"estimatedHours": 3.0,
"customerId": "customer-uuid",
"assignedEmployeeIds": ["employee-uuid"]
}PATCH /services/{serviceId}
Role: EMPLOYEE
{
"status": "IN_PROGRESS",
"progress": 60,
"notes": "Replaced brake pads",
"estimatedCompletion": "2025-11-05T18:00:00"
}POST /services/{serviceId}/complete
Role: EMPLOYEE
{
"finalNotes": "Service completed successfully",
"actualCost": 250.00,
"additionalCharges": [
{
"description": "Air filter",
"quantity": 1,
"unitPrice": 25.00,
"amount": 25.00
}
]
}POST /services/{serviceId}/photos
Role: EMPLOYEE
Content-Type: multipart/form-data
files: [photo1.jpg, photo2.jpg]POST /services/{serviceId}/notes
Role: EMPLOYEE
{
"note": "Checked all fluid levels",
"isCustomerVisible": true
}POST /projects
Role: CUSTOMER
{
"vehicleId": "VEH-001",
"description": "Install custom exhaust system",
"budget": 5000.00
}PUT /projects/{projectId}/quote
Role: EMPLOYEE/ADMIN
{
"quoteAmount": 5000.00,
"notes": "Labor: $3000, Parts: $2000"
}POST /projects/{projectId}/accept
Role: CUSTOMERPUT /projects/{projectId}/progress
Role: EMPLOYEE/ADMIN
{
"progress": 45
}CREATED- Service just createdIN_PROGRESS- Work in progressON_HOLD- Temporarily pausedCOMPLETED- FinishedCANCELLED- Cancelled
REQUESTED- Customer requestedQUOTED- Quote submittedAPPROVED- Quote acceptedIN_PROGRESS- Work startedCOMPLETED- Project finishedREJECTED- Quote rejectedCANCELLED- Project cancelled
DRAFT- Being preparedPENDING- Awaiting paymentPAID- Payment receivedOVERDUE- Past due dateCANCELLED- Invoice cancelled
graph LR
A[Appointment] -->|Employee creates| B[CREATED]
B -->|Work starts| C[IN_PROGRESS]
C -->|Complete| D[COMPLETED]
D -->|Auto-generate| E[Invoice]
- Employee creates service from appointment
- Service status: CREATED
- Employee adds notes and uploads photos
- Employee updates progress
- Service status changes to IN_PROGRESS
- Employee completes service
- Invoice automatically generated
graph LR
A[Customer Request] -->|Submit| B[REQUESTED]
B -->|Employee quotes| C[QUOTED]
C -->|Customer accepts| D[APPROVED]
C -->|Customer rejects| E[REJECTED]
D -->|Work starts| F[IN_PROGRESS]
F -->|Finish| G[COMPLETED]
- Customer requests modification
- Project status: REQUESTED
- Employee/Admin submits quote
- Project status: QUOTED
- Customer accepts or rejects
- If accepted: APPROVED → IN_PROGRESS → COMPLETED
standard_services- Services from appointmentsprojects- Custom modificationsservice_notes- Work notesprogress_photos- Service photosinvoices- Generated invoicesinvoice_items- Invoice line itemsquotes- Project quotes
curl -X POST http://localhost:8084/services \
-H "Authorization: Bearer $JWT_TOKEN" \
-H "X-User-Subject: employee-uuid-1" \
-H "Content-Type: application/json" \
-d '{
"appointmentId": "APT-001",
"estimatedHours": 3.0,
"customerId": "customer-uuid-1",
"assignedEmployeeIds": ["employee-uuid-1"]
}'curl http://localhost:8084/services \
-H "Authorization: Bearer $JWT_TOKEN" \
-H "X-User-Subject: customer-uuid-1"curl -X POST http://localhost:8084/services/{serviceId}/photos \
-H "Authorization: Bearer $JWT_TOKEN" \
-H "X-User-Subject: employee-uuid-1" \
-F "[email protected]" \
-F "[email protected]"export DB_HOST=localhost
export DB_PORT=5432
export DB_NAME=techtorque_projects
export DB_USER=techtorque
export DB_PASS=techtorque123
export SPRING_PROFILE=devCREATE DATABASE techtorque_projects;cd Project_Service/project-service
./mvnw spring-boot:runIssue: "Service not found"
- Verify serviceId is correct
- Check if service exists in database
Issue: "Unauthorized access"
- Verify JWT token is valid
- Check X-User-Subject header matches user
- Verify user role has permission
Issue: "File upload failed"
- Check file size < 10MB
- Verify uploads directory exists
- Check disk space
Issue: "Invoice not found"
- Verify service has been completed
- Invoice only generated after completion
serviceId: Check database after seeding- Customer: customer-uuid-1, customer-uuid-2
- Employee: employee-uuid-1, employee-uuid-2
- Customer: customer-uuid-1 (2 projects)
- Customer: customer-uuid-2 (1 project)
curl http://localhost:8084/services/{serviceId} \
-H "Authorization: Bearer $JWT_TOKEN" \
-H "X-User-Subject: customer-uuid-1"curl http://localhost:8084/services/{serviceId}/notes \
-H "Authorization: Bearer $JWT_TOKEN" \
-H "X-User-Subject: customer-uuid-1"curl http://localhost:8084/services/{serviceId}/invoice \
-H "Authorization: Bearer $JWT_TOKEN" \
-H "X-User-Subject: customer-uuid-1"-
Enable dev profile for test data:
SPRING_PROFILE=dev -
Check Swagger UI for interactive testing:
http://localhost:8084/swagger-ui/index.html -
View database to verify data:
SELECT * FROM standard_services; SELECT * FROM invoices;
-
Monitor logs for debugging:
tail -f logs/project-service.log
- Swagger UI: http://localhost:8084/swagger-ui/index.html
- API Design: See
complete-api-design.md - Implementation Details: See
IMPLEMENTATION_SUMMARY.md - Audit Report: See
PROJECT_AUDIT_REPORT_2025.md
Quick Links
- README.md - Full documentation
- IMPLEMENTATION_SUMMARY.md - Implementation details
- Swagger UI - Interactive API docs