{ "openapi": "3.0.0", "info": { "version": "1.0.0", "title": "API Documentation", "description": "This is the API documentation for the application." }, "servers": [ { "url": "http://localhost:8081" } ], "paths": { "/api/products/": { "get": { "tags": [ "Products" ], "description": "", "parameters": [ { "name": "_page", "in": "query", "schema": { "type": "string" } }, { "name": "_size", "in": "query", "schema": { "type": "string" } }, { "name": "_order", "in": "query", "schema": { "type": "string" } }, { "name": "activesOnly", "in": "query", "schema": { "type": "string" } }, { "name": "search", "in": "query", "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK" }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/Unauthorized" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/InternalServerError" } } } } }, "security": [ { "bearerAuth": {} } ] }, "post": { "tags": [ "Products" ], "description": "", "responses": { "200": { "description": "OK" }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/Unauthorized" } } } }, "402": { "description": "Payment Required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PaymentRequired" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/PaymentRequired" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/InternalServerError" } } } } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateOrUpdateProduct" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/CreateOrUpdateProduct" } } } } } }, "/api/products/{id}": { "get": { "tags": [ "Products" ], "description": "", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK" }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/Unauthorized" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/NotFound" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/InternalServerError" } } } } }, "security": [ { "bearerAuth": {} } ] }, "put": { "tags": [ "Products" ], "description": "", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK" }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/Unauthorized" } } } }, "402": { "description": "Payment Required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PaymentRequired" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/PaymentRequired" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/NotFound" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/InternalServerError" } } } } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateOrUpdateProduct" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/CreateOrUpdateProduct" } } } } } }, "/api/products/{id}/toggle-status": { "patch": { "tags": [ "Products" ], "description": "", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/Unauthorized" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/NotFound" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/InternalServerError" } } } } } } }, "/api/facilities/": { "get": { "tags": [ "Facilities" ], "description": "", "parameters": [ { "name": "_page", "in": "query", "schema": { "type": "string" } }, { "name": "_size", "in": "query", "schema": { "type": "string" } }, { "name": "_order", "in": "query", "schema": { "type": "string" } }, { "name": "activesOnly", "in": "query", "schema": { "type": "string" } }, { "name": "search", "in": "query", "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK" }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/Unauthorized" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/InternalServerError" } } } } } }, "post": { "tags": [ "Facilities" ], "description": "", "responses": { "200": { "description": "OK" }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/Unauthorized" } } } }, "402": { "description": "Payment Required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PaymentRequired" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/PaymentRequired" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/InternalServerError" } } } } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateOrUpdateFacility" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/CreateOrUpdateFacility" } } } } } }, "/api/facilities/{id}/products": { "get": { "tags": [ "Facilities" ], "description": "", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK" }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/Unauthorized" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/NotFound" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/InternalServerError" } } } } } } }, "/api/facilities/{id}/transactions": { "get": { "tags": [ "Facilities" ], "description": "", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "schema", "in": "query", "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK" }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/Unauthorized" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/NotFound" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/InternalServerError" } } } } } } }, "/api/facilities/{id}": { "get": { "tags": [ "Facilities" ], "description": "", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK" }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/Unauthorized" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/NotFound" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/InternalServerError" } } } } } }, "put": { "tags": [ "Facilities" ], "description": "", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK" }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/Unauthorized" } } } }, "402": { "description": "Payment Required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PaymentRequired" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/PaymentRequired" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/NotFound" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/InternalServerError" } } } } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateOrUpdateFacility" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/CreateOrUpdateFacility" } } } } } }, "/api/facilities/{id}/toggle-status": { "patch": { "tags": [ "Facilities" ], "description": "", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/Unauthorized" } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotFound" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/NotFound" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/InternalServerError" } } } } } } } }, "components": { "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer" } }, "schemas": { "Unauthorized": { "type": "object", "properties": { "code": { "type": "string", "example": "401" } }, "xml": { "name": "Unauthorized" } }, "NotFound": { "type": "object", "properties": { "code": { "type": "string", "example": "404" }, "message": { "type": "string", "example": "" } }, "xml": { "name": "NotFound" } }, "InternalServerError": { "type": "object", "properties": { "code": { "type": "string", "example": "500" }, "message": { "type": "string", "example": "" } }, "xml": { "name": "InternalServerError" } }, "PaymentRequired": { "type": "object", "properties": { "code": { "type": "string", "example": "402" }, "message": { "type": "string", "example": "" } }, "xml": { "name": "PaymentRequired" } }, "Page": { "type": "object", "properties": { "current": { "type": "number", "example": 1 }, "total": { "type": "number", "example": 1 }, "size": { "type": "number", "example": 10 } }, "xml": { "name": "Page" } }, "HateoasLink": { "type": "object", "properties": { "rel": { "type": "string", "example": "rel" }, "href": { "type": "string", "example": "/api/endpoint" }, "method": { "type": "string", "example": "METHOD" } }, "xml": { "name": "HateoasLink" } }, "Product": { "type": "object", "properties": { "id": { "type": "string", "example": "id" }, "name": { "type": "string", "example": "product name" }, "description": { "type": "string", "example": "product description" }, "price": { "type": "number", "example": 100 }, "active": { "type": "boolean", "example": true }, "facilityId": { "type": "number", "example": 1 }, "createdAt": { "type": "string", "example": "2025-01-01T01:00:00.000Z" }, "updatedAt": { "type": "string", "example": "2025-01-01T01:00:00.000Z" }, "_links": { "type": "array", "items": { "xml": { "name": "hateoaslink" }, "$ref": "#/components/schemas/HateoasLink" } } }, "xml": { "name": "Product" } }, "CreateOrUpdateProduct": { "type": "object", "properties": { "name": { "type": "string", "example": "product name" }, "description": { "type": "string", "example": "product description" }, "price": { "type": "number", "example": 100 }, "active": { "type": "boolean", "example": true }, "facilityId": { "type": "number", "example": 1 } }, "xml": { "name": "CreateOrUpdateProduct" } }, "Facility": { "type": "object", "properties": { "id": { "type": "string", "example": "id" }, "name": { "type": "string", "example": "facility name" }, "description": { "type": "string", "example": "facility description" }, "type": { "type": "string", "example": "store, attraction or other" }, "latitude": { "type": "number", "example": -10 }, "longitude": { "type": "number", "example": 10 }, "active": { "type": "boolean", "example": true }, "createdAt": { "type": "string", "example": "2025-01-01T01:00:00.000Z" }, "updatedAt": { "type": "string", "example": "2025-01-01T01:00:00.000Z" }, "_links": { "type": "array", "items": { "xml": { "name": "hateoaslink" }, "$ref": "#/components/schemas/HateoasLink" } } }, "xml": { "name": "Facility" } }, "CreateOrUpdateFacility": { "type": "object", "properties": { "name": { "type": "string", "example": "facility name" }, "description": { "type": "string", "example": "facility description" }, "type": { "type": "string", "example": "store, attraction or other" }, "latitude": { "type": "number", "example": -10 }, "longitude": { "type": "number", "example": 10 }, "active": { "type": "boolean", "example": true } }, "xml": { "name": "CreateOrUpdateFacility" } } } } }