{ "openapi": "3.0.0", "components": { "examples": {}, "headers": {}, "parameters": {}, "requestBodies": {}, "responses": {}, "schemas": { "ApiResponse": { "properties": { "status": { "type": "string" }, "message": { "type": "string" }, "success": { "type": "boolean" }, "data": { "properties": {}, "type": "object", "nullable": true }, "token": { "type": "string" }, "code": { "type": "number", "format": "double" } }, "required": [ "success", "code" ], "type": "object", "additionalProperties": false }, "CreateVehicleDto": { "properties": { "plateNumber": { "type": "string" } }, "required": [ "plateNumber" ], "type": "object", "additionalProperties": false }, "UpdateVehicleDto": { "properties": { "plateNumber": { "type": "string" } }, "type": "object", "additionalProperties": false }, "ERole": { "enum": [ "ADMIN", "CUSTOMER" ], "type": "string" }, "RegisterUserDto": { "properties": { "name": { "type": "string" }, "password": { "type": "string" }, "role": { "$ref": "#/components/schemas/ERole" }, "email": { "type": "string" } }, "required": [ "name", "password", "email" ], "type": "object", "additionalProperties": false }, "UpdateUserDto": { "properties": { "name": { "type": "string" }, "password": { "type": "string" }, "email": { "type": "string" } }, "type": "object", "additionalProperties": false }, "EPaymentMethod": { "enum": [ "CASH", "CARD" ], "type": "string" }, "UpdateParkingSpotDto": { "properties": { "spotNumber": { "type": "string" }, "isOccupied": { "type": "boolean" } }, "type": "object", "additionalProperties": false }, "CreateParkingDto": { "properties": { "name": { "type": "string" }, "address": { "type": "string" }, "price": { "type": "number", "format": "double" } }, "required": [ "name", "address", "price" ], "type": "object", "additionalProperties": false }, "UpdateParkingDto": { "properties": { "name": { "type": "string" }, "address": { "type": "string" }, "pricePerHour": { "type": "number", "format": "double" } }, "type": "object", "additionalProperties": false }, "CreateBookingDto": { "properties": { "startTime": { "type": "string" }, "requestedHours": { "type": "number", "format": "double" }, "customerId": { "type": "string" }, "vehicleId": { "type": "string" }, "spotId": { "type": "string" } }, "required": [ "startTime", "requestedHours", "customerId", "vehicleId", "spotId" ], "type": "object", "additionalProperties": false }, "EBookingStatus": { "enum": [ "PENDING", "APPROVED", "ACTIVE", "COMPLETED", "CANCELLED" ], "type": "string" }, "UpdateBookingDto": { "properties": { "endTime": { "type": "string" }, "status": { "$ref": "#/components/schemas/EBookingStatus" }, "startTime": { "type": "string" } }, "type": "object", "additionalProperties": false }, "LoginDto": { "properties": { "email": { "type": "string" }, "password": { "type": "string" } }, "required": [ "email", "password" ], "type": "object", "additionalProperties": false } }, "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" } } }, "info": { "title": "api", "version": "1.0.0", "license": { "name": "ISC" }, "contact": { "name": "cielo-b" } }, "paths": { "/vehicle": { "post": { "operationId": "CreateVehicle", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "201": { "description": "Vehicle created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "400": { "description": "Bad Request - Vehicle already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "404": { "description": "Owner not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Vehicle" ], "security": [ { "bearerAuth": [ "CUSTOMER" ] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateVehicleDto" } } } } }, "get": { "operationId": "GetAllVehicles", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "403": { "description": "Forbidden - Admin access required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Vehicle" ], "security": [ { "bearerAuth": [ "ADMIN" ] } ], "parameters": [] } }, "/vehicle/my-vehicles": { "get": { "operationId": "GetMyVehicles", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Vehicle" ], "security": [ { "bearerAuth": [ "CUSTOMER" ] } ], "parameters": [] } }, "/vehicle/{id}": { "get": { "operationId": "GetVehicleById", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "404": { "description": "Vehicle not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Vehicle" ], "security": [ { "bearerAuth": [] } ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } } ] }, "put": { "operationId": "UpdateVehicle", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "400": { "description": "Bad Request - License plate already in use", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "403": { "description": "Forbidden - Can only update your own vehicles", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "404": { "description": "Vehicle not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Vehicle" ], "security": [ { "bearerAuth": [ "CUSTOMER" ] } ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateVehicleDto" } } } } }, "delete": { "operationId": "DeleteVehicle", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "400": { "description": "Bad Request - Vehicle has active bookings", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "403": { "description": "Forbidden - Can only delete your own vehicles", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "404": { "description": "Vehicle not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Vehicle" ], "security": [ { "bearerAuth": [ "CUSTOMER" ] } ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } } ] } }, "/user/register": { "post": { "operationId": "RegisterUser", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "201": { "description": "User registered successfully.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "User" ], "security": [], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RegisterUserDto" } } } } } }, "/user": { "get": { "operationId": "GetAllUsers", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "403": { "description": "Forbidden - Admin access required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "User" ], "security": [ { "bearerAuth": [ "ADMIN" ] } ], "parameters": [] } }, "/user/{id}": { "get": { "operationId": "GetUserById", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "404": { "description": "User not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "User" ], "security": [ { "bearerAuth": [] } ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } } ] }, "delete": { "operationId": "DeleteUserById", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "403": { "description": "Forbidden - Admin access required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "404": { "description": "User not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "User" ], "security": [ { "bearerAuth": [ "ADMIN" ] } ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } } ] }, "put": { "operationId": "UpdateUser", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "400": { "description": "Bad request - Validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "403": { "description": "Forbidden - Can only update own account", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "404": { "description": "User not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "User" ], "security": [ { "bearerAuth": [] } ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateUserDto" } } } } } }, "/receipt/by-id/{id}": { "get": { "operationId": "GetReceiptById", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "404": { "description": "Receipt not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Receipt" ], "security": [ { "bearerAuth": [] } ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } } ] } }, "/receipt/my-receipts": { "get": { "operationId": "GetMyReceipts", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Receipt" ], "security": [ { "bearerAuth": [ "CUSTOMER" ] } ], "parameters": [] } }, "/receipt": { "get": { "operationId": "GetAllReceipts", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Receipt" ], "security": [ { "bearerAuth": [ "ADMIN" ] } ], "parameters": [] } }, "/payment/process/{bookingId}": { "post": { "operationId": "ProcessPayment", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "400": { "description": "Bad Request - Invalid booking status", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "403": { "description": "Forbidden - Admin access required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "404": { "description": "Booking not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Payment" ], "security": [ { "bearerAuth": [ "ADMIN" ] } ], "parameters": [ { "in": "path", "name": "bookingId", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "paymentMethod": { "$ref": "#/components/schemas/EPaymentMethod" } }, "required": [ "paymentMethod" ], "type": "object" } } } } } }, "/payment/booking/{bookingId}": { "get": { "operationId": "GetPaymentByBookingId", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "404": { "description": "Payment not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Payment" ], "security": [ { "bearerAuth": [] } ], "parameters": [ { "in": "path", "name": "bookingId", "required": true, "schema": { "type": "string" } } ] } }, "/parking/{parkingId}/spots/create": { "post": { "operationId": "CreateParkingSpot", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "201": { "description": "Parking spot created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "400": { "description": "Bad request - Invalid parking ID", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "403": { "description": "Forbidden - Admin access required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "404": { "description": "Parking lot not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Parking Spots" ], "security": [ { "bearerAuth": [ "ADMIN" ] } ], "parameters": [ { "in": "path", "name": "parkingId", "required": true, "schema": { "type": "string" } } ] } }, "/parking/spots": { "get": { "operationId": "GetAllSpotsGroupedByParking", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Parking Spots" ], "security": [ { "bearerAuth": [] } ], "parameters": [] } }, "/parking/{parkingId}/spots": { "get": { "operationId": "GetSpotsByParkingId", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "400": { "description": "Bad request - Invalid parking ID", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "404": { "description": "Parking not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Parking Spots" ], "security": [ { "bearerAuth": [] } ], "parameters": [ { "in": "path", "name": "parkingId", "required": true, "schema": { "type": "string" } } ] } }, "/parking/spots/{spotId}": { "get": { "operationId": "GetSpotById", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "400": { "description": "Bad request - Invalid spot ID", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "404": { "description": "Spot not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Parking Spots" ], "security": [ { "bearerAuth": [] } ], "parameters": [ { "in": "path", "name": "spotId", "required": true, "schema": { "type": "string" } } ] }, "put": { "operationId": "UpdateSpot", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "403": { "description": "Forbidden - Admin access required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "404": { "description": "Spot not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Parking Spots" ], "security": [ { "bearerAuth": [ "ADMIN" ] } ], "parameters": [ { "in": "path", "name": "spotId", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateParkingSpotDto" } } } } }, "delete": { "operationId": "DeleteSpot", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "400": { "description": "Bad request - Invalid spot ID", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "403": { "description": "Forbidden - Admin access required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "404": { "description": "Spot not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Parking Spots" ], "security": [ { "bearerAuth": [ "ADMIN" ] } ], "parameters": [ { "in": "path", "name": "spotId", "required": true, "schema": { "type": "string" } } ] } }, "/parking/{spotId}/start-direct-parking": { "post": { "operationId": "StartDirectParking", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "201": { "description": "Direct parking started successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "400": { "description": "Bad Request - Spot occupied or invalid data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "404": { "description": "Spot, customer or vehicle not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Parking Spots" ], "security": [ { "bearerAuth": [ "CUSTOMER" ] } ], "parameters": [ { "in": "path", "name": "spotId", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "vehicleId": { "type": "string" } }, "required": [ "vehicleId" ], "type": "object" } } } } } }, "/parking/{spotId}/complete-direct-parking": { "post": { "operationId": "CompleteDirectParking", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "400": { "description": "Bad Request - No active session", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "404": { "description": "Spot not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Parking Spots" ], "security": [ { "bearerAuth": [ "CUSTOMER" ] } ], "parameters": [ { "in": "path", "name": "spotId", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "hoursParked": { "type": "number", "format": "double" } }, "required": [ "hoursParked" ], "type": "object" } } } } } }, "/parking/{spotId}/active-session": { "get": { "operationId": "GetActiveParkingSession", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "404": { "description": "No active session found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Parking Spots" ], "security": [ { "bearerAuth": [ "ADMIN", "CUSTOMER" ] } ], "parameters": [ { "in": "path", "name": "spotId", "required": true, "schema": { "type": "string" } } ] } }, "/parking/create": { "post": { "operationId": "CreateParking", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "201": { "description": "Parking created successfully.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "403": { "description": "Forbidden - Admin access required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Parking" ], "security": [ { "bearerAuth": [ "ADMIN" ] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateParkingDto" } } } } } }, "/parking": { "get": { "operationId": "GetAllParkings", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Parking" ], "security": [ { "bearerAuth": [] } ], "parameters": [] } }, "/parking/{id}": { "get": { "operationId": "GetParkingById", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "404": { "description": "Parking not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Parking" ], "security": [ { "bearerAuth": [] } ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } } ] }, "put": { "operationId": "UpdateParking", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "403": { "description": "Forbidden - Admin access required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "404": { "description": "Parking not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Parking" ], "security": [ { "bearerAuth": [ "ADMIN" ] } ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateParkingDto" } } } } }, "delete": { "operationId": "DeleteParking", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "403": { "description": "Forbidden - Admin access required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "404": { "description": "Parking not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Parking" ], "security": [ { "bearerAuth": [ "ADMIN" ] } ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } } ] } }, "/booking/create": { "post": { "operationId": "CreateBooking", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "201": { "description": "Booking created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "400": { "description": "Bad Request - Spot not available or invalid data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "403": { "description": "Forbidden - Customer access required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Booking" ], "security": [ { "bearerAuth": [ "CUSTOMER" ] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateBookingDto" } } } } } }, "/booking": { "get": { "operationId": "GetAllBookings", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "403": { "description": "Forbidden - Admin access required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Booking" ], "security": [ { "bearerAuth": [ "ADMIN" ] } ], "parameters": [] } }, "/booking/mine": { "get": { "operationId": "GetMyBookings", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "403": { "description": "Forbidden - Customer access required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Booking" ], "security": [ { "bearerAuth": [ "CUSTOMER" ] } ], "parameters": [] } }, "/booking/by-id/{id}": { "get": { "operationId": "GetBookingById", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "403": { "description": "Forbidden - Owner or admin access required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "404": { "description": "Booking not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Booking" ], "security": [ { "bearerAuth": [] } ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } } ] } }, "/booking/{id}": { "put": { "operationId": "UpdateBooking", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "400": { "description": "Bad request - Invalid status transition", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "403": { "description": "Forbidden - Owner or admin access required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "404": { "description": "Booking not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Booking" ], "security": [ { "bearerAuth": [ "ADMIN", "CUSTOMER" ] } ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateBookingDto" } } } } }, "delete": { "operationId": "DeleteBooking", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "403": { "description": "Forbidden - Owner or admin access required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "404": { "description": "Booking not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Booking" ], "security": [ { "bearerAuth": [ "ADMIN", "CUSTOMER" ] } ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } } ] } }, "/booking/{id}/start-parking": { "post": { "operationId": "StartParking", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "400": { "description": "Bad request - Invalid booking status", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "403": { "description": "Forbidden - Owner access required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "404": { "description": "Booking not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Booking" ], "security": [ { "bearerAuth": [ "CUSTOMER" ] } ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } } ] } }, "/booking/{id}/complete-parking": { "post": { "operationId": "CompleteParking", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "400": { "description": "Bad request - Invalid booking status", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "403": { "description": "Forbidden - Owner access required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "404": { "description": "Booking not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Booking" ], "security": [ { "bearerAuth": [ "CUSTOMER" ] } ], "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "type": "string" } } ] } }, "/auth/login": { "post": { "operationId": "Login", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }, "401": { "description": "Invalid credentials", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } } }, "tags": [ "Authentication" ], "security": [], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginDto" } } } } } } }, "servers": [ { "url": "/" } ] }