Car Management
Overview
Each member can add multiple cars to their personal garage. One car can be marked as primary — used for event applications and the leaderboard car rating.
Workflow
Step-by-Step: Add a Car
- Log in and navigate to Garage (
/garage). - Click "Add Car".
- Fill in the form:
- Make (e.g., Renault, Dacia, Alpine)
- Model (e.g., Clio, Sandero)
- Year
- License Plate / Registration Number
- Mileage
- Color (optional)
- Click "Save".
- The car appears in your garage.
Step-by-Step: Set Primary Car
- In your garage, find the car you want to mark as primary.
- Click the "★ Set as Primary" button on the car card.
- The primary badge appears on the selected car.
- Only one car can be primary at a time — changing primary updates the previous one.
Security Notes
- Ownership enforced via SpEL:
@garageSecurityService.isOwner(carId, auth)— accessing another user's car returns 403. - All car operations require authentication (ROLE_USER minimum).
- Deleting a car also removes associated maintenance alerts.
QA Checklist
- Add car → appears in garage
- Edit car details → changes saved
- Set car as primary → primary badge shown, previous primary unmarked
- Delete car → removed from garage
- Access another user's car via API → 403 Forbidden
- View garage without login → 401 Unauthorized