A clean and modular Symfony API for managing car reservations.
- PHP 8.2+
- Symfony 6+
- Doctrine ORM
- MySQL / PostgreSQL (your choice)
- Composer
git clone https://github.com/your-username/car-reservation-api.git
cd car-reservation-apicomposer installBasic CRUD operations for car management.
- URL:
[POST] /car - Description: Create a new car.
- Request Body (JSON):
{
"brand": "Mercedes",
"licensePlate": "0214 TBH",
"model": "SLR"
}- Response (201 CREATED):
{
"id": 6,
"licensePlate": "0214 TBH",
"brand": "Mercedes",
"model": "SLR2"
}- URL:
[DELETE] /car/{id} - Description: Delete a car by ID.
- Response (204 NO-CONTENT)
- URL:
[Get] /car - Description: Get all cars in a list.
- Response (200 OK): List of cars in the database.
- URL:
[Get] /car/{id} - Description: Get a car by ID.
- Response (200 OK): Car information.
- URL:
[POST] /reservation - Description: Create a new reservation.
- Request Body (JSON):
{
"carId": 3,
"userEmail": "alice@example.com",
"startTime": "2025-04-20T10:00:00",
"endTime": "2025-04-20T14:00:00"
}- Response (201 CREATED):
{
"id": 6,
"carId": 4,
"carModel": "SLR",
"carLicensePlate": "0214 TBH",
"carBrand": "Mercedes",
"userEmail": "alice@example.com",
"startTime": {
"date": "2025-04-20 13:00:00.000000",
"timezone_type": 3,
"timezone": "UTC"
},
"endTime": {
"date": "2025-04-20 14:00:00.000000",
"timezone_type": 3,
"timezone": "UTC"
}
}- URL:
[DELETE] /reservation/{id} - Description: Delete a reservation by ID.
- Response (204 NO-CONTENT)
- URL:
[Get] /reservation - Description: Get all reservations in a list.
- Response (200 OK): List of reservations in the database.
- URL:
[Get] /reservation/{id} - Description: Get a reservation by ID.
- Response (200 OK): Reservation information.