From d5073fa676f2956c2b0ea4f45851526b9d55c2f2 Mon Sep 17 00:00:00 2001 From: Runar Sverrisson Date: Wed, 27 May 2026 09:54:17 +0000 Subject: [PATCH 1/4] Handle nested internal references When inlining nested interal references, the inliner loses the full context of the schema and crashes (since it is trying to resolve a reference that does not exist in the sub schema it is currently working with). Keep track of the full schema for the file that is being process and pass that down to be able to resolve absolute internal references. --- src/Service/InlineService.php | 8 +- .../schema.dist.json | 13731 ++++++++++++++++ .../inline-nested-internal-refs/schema.json | 3609 ++++ 3 files changed, 17346 insertions(+), 2 deletions(-) create mode 100644 tests/inlined-schemas/inline-nested-internal-refs/schema.dist.json create mode 100644 tests/inlined-schemas/inline-nested-internal-refs/schema.json diff --git a/src/Service/InlineService.php b/src/Service/InlineService.php index 95adcb3..70a4629 100644 --- a/src/Service/InlineService.php +++ b/src/Service/InlineService.php @@ -58,7 +58,7 @@ public function inline(string $schemaFile): Document $this->components = []; $this->allOfPaths = []; - $document = $this->processDocument($schemaDocument); + $document = $this->processDocument($schemaDocument, $schemaDocument); $allOfPaths = array_unique($this->allOfPaths); if ($allOfPaths) { $merger = new AllOfMerger($document); @@ -98,6 +98,7 @@ private function getRefName(Reference $reference, SchemaType $type): string private function processDocument( Document&WritableDocument $document, + Document $fileRoot, ?Reference $rootReference = null, ?string $parentPath = null, ): Document&WritableDocument { @@ -134,7 +135,7 @@ private function processDocument( } if ($reference->isInternal()) { - $subDocument = $document->get($reference->getPath()); + $subDocument = $fileRoot->get($reference->getPath()); if (!is_array($subDocument)) { throw new \BadMethodCallException('Failed to resolve internal model properly'); } @@ -142,16 +143,19 @@ private function processDocument( $refName, $subDocument, // @phpstan-ignore argument.type ); + $nextFileRoot = $fileRoot; } else { $referenceDocument = BasicDocument::fromDocument($this->referenceResolver->resolve($reference)); $nextParentPath .= $documentPaths[0]; + $nextFileRoot = $referenceDocument; } $schemaId = $referenceDocument->get()['$id'] ?? $refName; // reserve schema to avoid infinite recursion $this->components[$type->name][$refName] = $schemaId; $this->components[$type->name][$refName] = $this->processDocument( $referenceDocument, + $nextFileRoot, $reference, $nextParentPath, )->get(); diff --git a/tests/inlined-schemas/inline-nested-internal-refs/schema.dist.json b/tests/inlined-schemas/inline-nested-internal-refs/schema.dist.json new file mode 100644 index 0000000..ce81858 --- /dev/null +++ b/tests/inlined-schemas/inline-nested-internal-refs/schema.dist.json @@ -0,0 +1,13731 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "parking api", + "version": "1.0", + "contact": { + "name": "Stefna ehf", + "url": "https://stefna.is", + "email": "no-support@stefna.is" + } + }, + "servers": [ + { + "description": "production", + "url": "https://api.checkit.is" + }, + { + "description": "staging", + "url": "https://staging.api.checkit.is" + }, + { + "description": "development", + "url": "http://localhost:9988" + }, + { + "description": "testing", + "url": "http://localhost:9856" + } + ], + "tags": [ + { + "name": "Kiosk", + "description": "Endpoints that can be accessed from kiosks.\n\nKiosks must only use custom create Bearer tokens for authentication. And shall not contain the api key. " + }, + { + "name": "Visits" + }, + { + "name": "Products" + }, + { + "name": "Admin" + }, + { + "name": "Testing", + "description": "endpoints only available in development and testing" + }, + { + "name": "Webhook", + "description": "endpoints used by webhooks" + }, + { + "name": "Whitelist", + "description": "Endpoints related to whitelisting " + }, + { + "name": "Photo", + "description": "Endpoints related to photos " + }, + { + "name": "Account", + "description": "Endpoints related to accounts and customers " + } + ], + "paths": { + "/auth/login": { + "post": { + "tags": [ + "Admin" + ], + "summary": "Authenticate accounts", + "operationId": "createBearerToken", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "title": "Wrapper around account and bearer token", + "type": "object", + "required": [ + "access_token", + "account" + ], + "properties": { + "access_token": { + "type": "string" + }, + "account": { + "title": "Account", + "type": "object", + "required": [ + "id", + "role", + "status" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "role": { + "type": "string", + "enum": [ + "operator", + "customer", + "partner" + ] + }, + "name": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "active", + "inactive" + ] + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "options": { + "type": "object", + "properties": { + "free-parking-time": { + "type": "string" + }, + "expireTime": { + "type": "string", + "description": "Default expire time for whitelist entries.\nAccepts formats from https://www.php.net/manual/en/datetime.formats.php" + } + } + } + }, + "$id": "Account" + } + }, + "$id": "AuthenticatedAccount" + } + } + } + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + }, + "500": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "InternalError" + } + }, + "security": [ + { + "api-key": [] + } + ], + "requestBody": { + "description": "Password based login payload", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "device_uuid": { + "type": "string", + "format": "uuid" + }, + "provider": { + "type": "string", + "enum": [ + "password", + "lost-password", + "change-password", + "token" + ] + }, + "id": { + "type": "string" + }, + "password": { + "type": "string", + "format": "password" + } + }, + "required": [ + "device_uuid", + "provider", + "id", + "password" + ] + } + } + }, + "$id": "PasswordLogin" + } + }, + "parameters": [] + }, + "/accounts": { + "post": { + "summary": "Create new account", + "operationId": "createAccount", + "tags": [ + "Account" + ], + "responses": { + "201": { + "description": "OK" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + }, + "500": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "InternalError" + } + }, + "requestBody": { + "description": "Create account payload", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "account": { + "title": "Account", + "type": "object", + "required": [ + "id", + "role", + "status" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "role": { + "type": "string", + "enum": [ + "operator", + "customer", + "partner" + ] + }, + "name": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "active", + "inactive" + ] + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "options": { + "type": "object", + "properties": { + "free-parking-time": { + "type": "string" + }, + "expireTime": { + "type": "string", + "description": "Default expire time for whitelist entries.\nAccepts formats from https://www.php.net/manual/en/datetime.formats.php" + } + } + } + }, + "$id": "Account" + }, + "customer": { + "title": "Customer", + "type": "object", + "required": [ + "id", + "language" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" + }, + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "email": { + "type": "string", + "format": "email", + "nullable": true + }, + "phone": { + "type": "string", + "nullable": true, + "example": "4648700" + }, + "language": { + "type": "string", + "maxLength": 2, + "minLength": 2, + "example": "is" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "options": { + "type": "object", + "properties": { + "sendInvoicesToEmail": { + "type": "boolean" + }, + "sendInvoicesToPublishingSystem": { + "type": "boolean" + }, + "billingMethod": { + "type": "string", + "enum": [ + "daily", + "monthly" + ] + }, + "billingSsn": { + "type": "string" + } + }, + "$id": "CustomerOption" + } + }, + "$id": "Customer" + }, + "authentication": { + "type": "object", + "required": [ + "email", + "password" + ], + "properties": { + "email": { + "type": "string", + "format": "email" + }, + "password": { + "type": "string", + "format": "password" + }, + "expire": { + "type": "string", + "nullable": true, + "format": "date-time" + } + }, + "$id": "PasswordInfo" + } + }, + "required": [ + "account" + ] + } + } + }, + "$id": "CreateAccountPayload" + } + }, + "get": { + "summary": "List accounts", + "operationId": "searchAccounts", + "tags": [ + "Account" + ], + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "next" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "readOnly": true, + "properties": { + "next": { + "type": "string", + "nullable": true + }, + "previous": { + "type": "string", + "nullable": true + }, + "accounts": { + "type": "array", + "items": { + "title": "Account", + "type": "object", + "required": [ + "id", + "role", + "status" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "role": { + "type": "string", + "enum": [ + "operator", + "customer", + "partner" + ] + }, + "name": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "active", + "inactive" + ] + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "options": { + "type": "object", + "properties": { + "free-parking-time": { + "type": "string" + }, + "expireTime": { + "type": "string", + "description": "Default expire time for whitelist entries.\nAccepts formats from https://www.php.net/manual/en/datetime.formats.php" + } + } + } + }, + "$id": "Account" + } + } + }, + "$id": "AccountsResponse" + } + } + } + } + } + } + }, + "/account/{id}": { + "parameters": [ + { + "schema": { + "type": "string", + "format": "uuid" + }, + "name": "id", + "in": "path", + "required": true + } + ], + "get": { + "summary": "Retrieve single account", + "operationId": "getAccount", + "tags": [ + "Account" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "title": "Account", + "type": "object", + "required": [ + "id", + "role", + "status" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "role": { + "type": "string", + "enum": [ + "operator", + "customer", + "partner" + ] + }, + "name": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "active", + "inactive" + ] + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "options": { + "type": "object", + "properties": { + "free-parking-time": { + "type": "string" + }, + "expireTime": { + "type": "string", + "description": "Default expire time for whitelist entries.\nAccepts formats from https://www.php.net/manual/en/datetime.formats.php" + } + } + } + }, + "$id": "Account" + } + } + } + }, + "400": { + "description": "Generic input error", + "content": { + "application/json": { + "schema": { + "title": "Exception handle by underlying system", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "exception": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "messages": { + "type": "string", + "nullable": true + } + }, + "$id": "ErrorException" + } + } + }, + "$id": "InputError" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + }, + "500": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "InternalError" + } + } + }, + "put": { + "summary": "Update account", + "operationId": "updateAccount", + "tags": [ + "Account" + ], + "responses": { + "200": { + "description": "Account updated" + }, + "303": { + "description": "Generic redirect response", + "headers": { + "Location": { + "description": "new location for resource", + "schema": { + "type": "string" + } + } + }, + "$id": "Redirect" + }, + "400": { + "description": "Generic input error", + "content": { + "application/json": { + "schema": { + "title": "Exception handle by underlying system", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "exception": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "messages": { + "type": "string", + "nullable": true + } + }, + "$id": "ErrorException" + } + } + }, + "$id": "InputError" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + }, + "500": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "InternalError" + } + }, + "requestBody": { + "required": true, + "content": { + "*/*": { + "schema": { + "title": "Account", + "type": "object", + "required": [ + "id", + "role", + "status" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "role": { + "type": "string", + "enum": [ + "operator", + "customer", + "partner" + ] + }, + "name": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "active", + "inactive" + ] + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "options": { + "type": "object", + "properties": { + "free-parking-time": { + "type": "string" + }, + "expireTime": { + "type": "string", + "description": "Default expire time for whitelist entries.\nAccepts formats from https://www.php.net/manual/en/datetime.formats.php" + } + } + } + }, + "$id": "Account" + } + } + } + } + }, + "delete": { + "summary": "Remove account", + "operationId": "deleteAccount", + "tags": [ + "Account" + ], + "responses": { + "204": { + "description": "ok" + }, + "400": { + "description": "Generic input error", + "content": { + "application/json": { + "schema": { + "title": "Exception handle by underlying system", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "exception": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "messages": { + "type": "string", + "nullable": true + } + }, + "$id": "ErrorException" + } + } + }, + "$id": "InputError" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + }, + "500": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "InternalError" + } + } + } + }, + "/account/{id}/logins": { + "parameters": [ + { + "schema": { + "type": "string", + "format": "uuid" + }, + "name": "id", + "in": "path", + "required": true + } + ], + "get": { + "summary": "Get login alternatives for account", + "operationId": "getAccountLogins", + "tags": [ + "Account" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "title": "AccountLogin", + "type": "object", + "required": [ + "email" + ], + "properties": { + "accountId": { + "type": "string", + "format": "uuid" + }, + "email": { + "type": "string", + "format": "email" + }, + "expire": { + "type": "string", + "nullable": true, + "format": "date-time" + } + }, + "$id": "AccountLogin" + } + } + } + } + } + } + }, + "post": { + "summary": "Create login credentials", + "operationId": "createAccountLogin", + "tags": [ + "Account" + ], + "responses": { + "201": { + "description": "Account login created" + }, + "303": { + "description": "Generic redirect response", + "headers": { + "Location": { + "description": "new location for resource", + "schema": { + "type": "string" + } + } + }, + "$id": "Redirect" + }, + "400": { + "description": "Generic input error", + "content": { + "application/json": { + "schema": { + "title": "Exception handle by underlying system", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "exception": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "messages": { + "type": "string", + "nullable": true + } + }, + "$id": "ErrorException" + } + } + }, + "$id": "InputError" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + }, + "500": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "InternalError" + } + }, + "requestBody": { + "content": { + "*/*": { + "schema": { + "type": "object", + "required": [ + "email", + "password" + ], + "properties": { + "email": { + "type": "string", + "format": "email" + }, + "password": { + "type": "string", + "format": "password" + }, + "expire": { + "type": "string", + "nullable": true, + "format": "date-time" + } + }, + "$id": "PasswordInfo" + } + } + } + } + }, + "delete": { + "summary": "Delete account login", + "operationId": "deleteAccountLogin", + "tags": [ + "Account" + ], + "parameters": [ + { + "schema": { + "type": "string", + "format": "email" + }, + "in": "query", + "name": "email", + "required": true + } + ], + "responses": { + "204": { + "description": "ok" + }, + "400": { + "description": "Generic input error", + "content": { + "application/json": { + "schema": { + "title": "Exception handle by underlying system", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "exception": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "messages": { + "type": "string", + "nullable": true + } + }, + "$id": "ErrorException" + } + } + }, + "$id": "InputError" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + }, + "500": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "InternalError" + } + } + } + }, + "/customers": { + "post": { + "summary": "Create customer", + "operationId": "createCustomer", + "tags": [ + "Account" + ], + "responses": { + "201": { + "description": "OK" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + }, + "500": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "InternalError" + } + }, + "requestBody": { + "description": "Create customer", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "account": { + "oneOf": [ + { + "title": "Account", + "type": "object", + "required": [ + "id", + "role", + "status" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "role": { + "type": "string", + "enum": [ + "operator", + "customer", + "partner" + ] + }, + "name": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "active", + "inactive" + ] + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "options": { + "type": "object", + "properties": { + "free-parking-time": { + "type": "string" + }, + "expireTime": { + "type": "string", + "description": "Default expire time for whitelist entries.\nAccepts formats from https://www.php.net/manual/en/datetime.formats.php" + } + } + } + }, + "$id": "Account" + }, + { + "x-required": "self", + "type": "string", + "format": "uuid", + "example": "040546c4-58bd-49cf-9741-6cb42daf6728", + "$id": "AccountId" + } + ] + }, + "customer": { + "title": "Customer", + "type": "object", + "required": [ + "id", + "language" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" + }, + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "email": { + "type": "string", + "format": "email", + "nullable": true + }, + "phone": { + "type": "string", + "nullable": true, + "example": "4648700" + }, + "language": { + "type": "string", + "maxLength": 2, + "minLength": 2, + "example": "is" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "options": { + "type": "object", + "properties": { + "sendInvoicesToEmail": { + "type": "boolean" + }, + "sendInvoicesToPublishingSystem": { + "type": "boolean" + }, + "billingMethod": { + "type": "string", + "enum": [ + "daily", + "monthly" + ] + }, + "billingSsn": { + "type": "string" + } + }, + "$id": "CustomerOption" + } + }, + "$id": "Customer" + } + }, + "required": [ + "account", + "customer" + ] + } + } + }, + "$id": "CreateCustomerPayload" + } + }, + "get": { + "summary": "Search customers", + "operationId": "searchCustomers", + "tags": [ + "Account" + ], + "parameters": [ + { + "schema": { + "type": "string", + "enum": [ + "latest", + "want-monthly-billing" + ] + }, + "in": "query", + "name": "collection", + "description": "Pre defined search collections" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "name", + "description": "Find by customer name supports wildcard" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "email", + "description": "Find by customer email supports wildcard" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "ssn", + "description": "Find by customer kennitala supports wildcard" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "next" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "readOnly": true, + "properties": { + "next": { + "type": "string", + "nullable": true + }, + "previous": { + "type": "string", + "nullable": true + }, + "customers": { + "type": "array", + "items": { + "title": "Customer", + "type": "object", + "required": [ + "id", + "language" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" + }, + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "email": { + "type": "string", + "format": "email", + "nullable": true + }, + "phone": { + "type": "string", + "nullable": true, + "example": "4648700" + }, + "language": { + "type": "string", + "maxLength": 2, + "minLength": 2, + "example": "is" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "options": { + "type": "object", + "properties": { + "sendInvoicesToEmail": { + "type": "boolean" + }, + "sendInvoicesToPublishingSystem": { + "type": "boolean" + }, + "billingMethod": { + "type": "string", + "enum": [ + "daily", + "monthly" + ] + }, + "billingSsn": { + "type": "string" + } + }, + "$id": "CustomerOption" + } + }, + "$id": "Customer" + } + } + }, + "$id": "CustomersResponse" + } + } + } + } + } + } + }, + "/customer/{id}": { + "parameters": [ + { + "schema": { + "type": "string", + "format": "uuid" + }, + "name": "id", + "in": "path", + "required": true + } + ], + "get": { + "summary": "Retrieve single customer", + "operationId": "getCustomer", + "tags": [ + "Account" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "title": "Customer", + "type": "object", + "required": [ + "id", + "language" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" + }, + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "email": { + "type": "string", + "format": "email", + "nullable": true + }, + "phone": { + "type": "string", + "nullable": true, + "example": "4648700" + }, + "language": { + "type": "string", + "maxLength": 2, + "minLength": 2, + "example": "is" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "options": { + "type": "object", + "properties": { + "sendInvoicesToEmail": { + "type": "boolean" + }, + "sendInvoicesToPublishingSystem": { + "type": "boolean" + }, + "billingMethod": { + "type": "string", + "enum": [ + "daily", + "monthly" + ] + }, + "billingSsn": { + "type": "string" + } + }, + "$id": "CustomerOption" + } + }, + "$id": "Customer" + } + } + } + }, + "400": { + "description": "Generic input error", + "content": { + "application/json": { + "schema": { + "title": "Exception handle by underlying system", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "exception": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "messages": { + "type": "string", + "nullable": true + } + }, + "$id": "ErrorException" + } + } + }, + "$id": "InputError" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + }, + "500": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "InternalError" + } + } + }, + "put": { + "summary": "Update customer", + "operationId": "updateCustomer", + "tags": [ + "Account" + ], + "requestBody": { + "content": { + "*/*": { + "schema": { + "title": "Customer", + "type": "object", + "required": [ + "id", + "language" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" + }, + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "email": { + "type": "string", + "format": "email", + "nullable": true + }, + "phone": { + "type": "string", + "nullable": true, + "example": "4648700" + }, + "language": { + "type": "string", + "maxLength": 2, + "minLength": 2, + "example": "is" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "options": { + "type": "object", + "properties": { + "sendInvoicesToEmail": { + "type": "boolean" + }, + "sendInvoicesToPublishingSystem": { + "type": "boolean" + }, + "billingMethod": { + "type": "string", + "enum": [ + "daily", + "monthly" + ] + }, + "billingSsn": { + "type": "string" + } + }, + "$id": "CustomerOption" + } + }, + "$id": "Customer" + } + } + } + }, + "responses": { + "301": { + "description": "Generic redirect response", + "headers": { + "Location": { + "description": "new location for resource", + "schema": { + "type": "string" + } + } + }, + "$id": "Redirect" + }, + "303": { + "description": "Generic redirect response", + "headers": { + "Location": { + "description": "new location for resource", + "schema": { + "type": "string" + } + } + }, + "$id": "Redirect" + }, + "400": { + "description": "Generic input error", + "content": { + "application/json": { + "schema": { + "title": "Exception handle by underlying system", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "exception": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "messages": { + "type": "string", + "nullable": true + } + }, + "$id": "ErrorException" + } + } + }, + "$id": "InputError" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + }, + "500": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "InternalError" + } + } + } + }, + "/visits": { + "get": { + "summary": "Search visits", + "operationId": "getVisits", + "tags": [ + "Visits" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "readOnly": true, + "properties": { + "next": { + "type": "string", + "nullable": true + }, + "previous": { + "type": "string", + "nullable": true + }, + "total": { + "nullable": true, + "type": "integer" + }, + "extra": { + "nullable": true, + "type": "object" + }, + "visits": { + "type": "array", + "items": { + "title": "Visit", + "type": "object", + "required": [ + "id", + "startedOn", + "plate", + "status" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623" + }, + "startedOn": { + "type": "string", + "format": "date-time" + }, + "endedOn": { + "type": "string", + "format": "date-time" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE111" + }, + "status": { + "type": "string", + "enum": [ + "new", + "need-payment", + "need-plate", + "completed" + ] + }, + "paymentStatus": { + "type": "string", + "enum": [ + "whitelisted", + "kiosk", + "company-invoice", + "owner-invoice", + "failed", + "void" + ] + }, + "price": { + "type": "object", + "nullable": true, + "properties": { + "amount": { + "type": "number", + "example": 1250 + }, + "currency": { + "type": "string", + "maxLength": 3, + "minLength": 3, + "example": "ISK" + } + }, + "$id": "Money" + }, + "vehicle": { + "title": "Vehicle", + "type": "object", + "required": [ + "id", + "useGroup", + "vehicleCategory", + "registeredOn" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "deb4b244-945f-45c8-a67c-dc7939387ed6" + }, + "regno": { + "type": "string" + }, + "permno": { + "type": "string" + }, + "vin": { + "type": "string" + }, + "vehicleCategory": { + "type": "string" + }, + "vehicleGroup": { + "type": "string" + }, + "useGroup": { + "type": "string" + }, + "make": { + "type": "string", + "example": "Volvo" + }, + "model": { + "type": "string" + }, + "modelYear": { + "type": "string", + "example": "2019" + }, + "color": { + "type": "string", + "example": "blue" + }, + "massinro": { + "type": "string" + }, + "massladen": { + "type": "string" + }, + "taxGroup": { + "type": "string" + }, + "registeredOn": { + "type": "string", + "format": "date-time" + }, + "category": { + "type": "string", + "enum": [ + "light", + "heavy" + ] + }, + "country": { + "type": "string", + "description": "Country code", + "maxLength": 2, + "example": "is" + }, + "operator": { + "title": "Owner or Operator", + "type": "object", + "required": [ + "ssn", + "name" + ], + "properties": { + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "insuranceCode": { + "type": "string" + }, + "registrationDate": { + "type": "string", + "format": "date-time" + }, + "purchaseDate": { + "type": "string", + "format": "date-time" + } + }, + "$id": "VehicleOwner" + }, + "owner": { + "title": "Owner or Operator", + "type": "object", + "required": [ + "ssn", + "name" + ], + "properties": { + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "insuranceCode": { + "type": "string" + }, + "registrationDate": { + "type": "string", + "format": "date-time" + }, + "purchaseDate": { + "type": "string", + "format": "date-time" + } + }, + "$id": "VehicleOwner" + } + }, + "$id": "Vehicle" + }, + "customer": { + "title": "Customer", + "type": "object", + "required": [ + "id", + "language" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" + }, + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "email": { + "type": "string", + "format": "email", + "nullable": true + }, + "phone": { + "type": "string", + "nullable": true, + "example": "4648700" + }, + "language": { + "type": "string", + "maxLength": 2, + "minLength": 2, + "example": "is" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "options": { + "type": "object", + "properties": { + "sendInvoicesToEmail": { + "type": "boolean" + }, + "sendInvoicesToPublishingSystem": { + "type": "boolean" + }, + "billingMethod": { + "type": "string", + "enum": [ + "daily", + "monthly" + ] + }, + "billingSsn": { + "type": "string" + } + }, + "$id": "CustomerOption" + } + }, + "$id": "Customer" + }, + "entrancePhoto": { + "type": "object", + "required": [ + "id", + "capturedOn", + "plate", + "status", + "camera" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" + }, + "capturedOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE333" + }, + "score": { + "type": "integer" + }, + "url": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "new", + "need-review", + "force-review", + "reviewed", + "deleted", + "failed" + ] + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "camera": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" + }, + "name": { + "type": "string", + "example": "Entrance camera" + }, + "brand": { + "type": "string", + "example": "Raftakn" + }, + "location": { + "type": "string", + "enum": [ + "entrance", + "exit" + ] + } + }, + "$id": "Camera" + } + }, + "$id": "Photo" + }, + "exitPhoto": { + "type": "object", + "required": [ + "id", + "capturedOn", + "plate", + "status", + "camera" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" + }, + "capturedOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE333" + }, + "score": { + "type": "integer" + }, + "url": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "new", + "need-review", + "force-review", + "reviewed", + "deleted", + "failed" + ] + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "camera": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" + }, + "name": { + "type": "string", + "example": "Entrance camera" + }, + "brand": { + "type": "string", + "example": "Raftakn" + }, + "location": { + "type": "string", + "enum": [ + "entrance", + "exit" + ] + } + }, + "$id": "Camera" + } + }, + "$id": "Photo" + }, + "invoice": { + "title": "Invoice object", + "type": "object", + "readOnly": true, + "required": [ + "id", + "status", + "language" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623" + }, + "status": { + "type": "string", + "enum": [ + "paid", + "refunded", + "incomplete", + "failed", + "draft" + ] + }, + "productId": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623", + "nullable": true + }, + "price": { + "type": "object", + "nullable": true, + "properties": { + "amount": { + "type": "number", + "example": 1250 + }, + "currency": { + "type": "string", + "maxLength": 3, + "minLength": 3, + "example": "ISK" + } + }, + "$id": "Money" + }, + "invoiceEmail": { + "type": "string", + "format": "email" + }, + "language": { + "type": "string", + "enum": [ + "is", + "en" + ] + }, + "receipt": { + "description": "Payment receipt", + "type": "object", + "readOnly": true, + "properties": { + "type": { + "type": "string", + "enum": [ + "visa", + "mastercard", + "amex", + "discover", + "other", + "electron", + "maestro" + ] + }, + "card": { + "type": "string", + "description": "Masked Card Number", + "example": "****-****-****-4444" + } + }, + "$id": "Receipt" + }, + "createdOn": { + "type": "string", + "format": "date-time" + } + }, + "$id": "Invoice" + } + }, + "$id": "Visit" + } + } + }, + "$id": "VisitsResponse" + } + } + } + }, + "400": { + "description": "Generic input error", + "content": { + "application/json": { + "schema": { + "title": "Exception handle by underlying system", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "exception": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "messages": { + "type": "string", + "nullable": true + } + }, + "$id": "ErrorException" + } + } + }, + "$id": "InputError" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + }, + "500": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "InternalError" + } + }, + "description": "List and filter visits\n\nIf bearer token does not belong to operator list will be filter on customerId", + "parameters": [ + { + "schema": { + "type": "string", + "enum": [ + "new", + "open", + "review", + "closed", + "need-payment" + ] + }, + "in": "query", + "name": "status", + "description": "Visit status" + }, + { + "schema": { + "type": "string", + "enum": [ + "latest", + "export", + "open", + "checkin", + "unpaid" + ] + }, + "in": "query", + "name": "collection", + "description": "Pre defined search collections" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "plate", + "description": "Find by licence plate supports wildcard" + }, + { + "schema": { + "type": "string", + "format": "date" + }, + "in": "query", + "name": "date", + "description": "Visits on this day" + }, + { + "schema": { + "type": "string", + "format": "date-time", + "example": "2020-07-23T07:12:52+02:00" + }, + "in": "query", + "name": "date.from" + }, + { + "schema": { + "type": "string", + "format": "date-time", + "example": "2020-07-23T07:12:52+02:00" + }, + "in": "query", + "name": "date.to" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "card.lastFour" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "next" + }, + { + "schema": { + "type": "string", + "enum": [ + "whitelisted", + "kiosk", + "company-invoice", + "owner-invoice", + "failed", + "void" + ] + }, + "in": "query", + "name": "payment.status", + "description": "Payment status" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "ssn", + "description": "Find by vehicle owner" + }, + { + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "price" + ] + }, + "uniqueItems": true + }, + "style": "form", + "explode": false, + "in": "query", + "name": "aggregate", + "description": "Find by vehicle owner" + } + ] + }, + "post": { + "summary": "Create visit", + "operationId": "createVisit", + "tags": [ + "Visits" + ], + "responses": { + "200": { + "description": "Visit created" + }, + "301": { + "description": "Generic redirect response", + "headers": { + "Location": { + "description": "new location for resource", + "schema": { + "type": "string" + } + } + }, + "$id": "Redirect" + }, + "303": { + "description": "Generic redirect response", + "headers": { + "Location": { + "description": "new location for resource", + "schema": { + "type": "string" + } + } + }, + "$id": "Redirect" + }, + "400": { + "description": "Generic input error", + "content": { + "application/json": { + "schema": { + "title": "Exception handle by underlying system", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "exception": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "messages": { + "type": "string", + "nullable": true + } + }, + "$id": "ErrorException" + } + } + }, + "$id": "InputError" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + }, + "422": { + "description": "Error that happens when creating already created data", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "messages": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid" + } + } + } + } + }, + "$id": "WrongEndpoint" + }, + "500": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "InternalError" + } + }, + "requestBody": { + "required": true, + "content": { + "*/*": { + "schema": { + "title": "Visit", + "type": "object", + "required": [ + "id", + "startedOn", + "plate", + "status" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623" + }, + "startedOn": { + "type": "string", + "format": "date-time" + }, + "endedOn": { + "type": "string", + "format": "date-time" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE111" + }, + "status": { + "type": "string", + "enum": [ + "new", + "need-payment", + "need-plate", + "completed" + ] + }, + "paymentStatus": { + "type": "string", + "enum": [ + "whitelisted", + "kiosk", + "company-invoice", + "owner-invoice", + "failed", + "void" + ] + }, + "price": { + "type": "object", + "nullable": true, + "properties": { + "amount": { + "type": "number", + "example": 1250 + }, + "currency": { + "type": "string", + "maxLength": 3, + "minLength": 3, + "example": "ISK" + } + }, + "$id": "Money" + }, + "vehicle": { + "title": "Vehicle", + "type": "object", + "required": [ + "id", + "useGroup", + "vehicleCategory", + "registeredOn" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "deb4b244-945f-45c8-a67c-dc7939387ed6" + }, + "regno": { + "type": "string" + }, + "permno": { + "type": "string" + }, + "vin": { + "type": "string" + }, + "vehicleCategory": { + "type": "string" + }, + "vehicleGroup": { + "type": "string" + }, + "useGroup": { + "type": "string" + }, + "make": { + "type": "string", + "example": "Volvo" + }, + "model": { + "type": "string" + }, + "modelYear": { + "type": "string", + "example": "2019" + }, + "color": { + "type": "string", + "example": "blue" + }, + "massinro": { + "type": "string" + }, + "massladen": { + "type": "string" + }, + "taxGroup": { + "type": "string" + }, + "registeredOn": { + "type": "string", + "format": "date-time" + }, + "category": { + "type": "string", + "enum": [ + "light", + "heavy" + ] + }, + "country": { + "type": "string", + "description": "Country code", + "maxLength": 2, + "example": "is" + }, + "operator": { + "title": "Owner or Operator", + "type": "object", + "required": [ + "ssn", + "name" + ], + "properties": { + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "insuranceCode": { + "type": "string" + }, + "registrationDate": { + "type": "string", + "format": "date-time" + }, + "purchaseDate": { + "type": "string", + "format": "date-time" + } + }, + "$id": "VehicleOwner" + }, + "owner": { + "title": "Owner or Operator", + "type": "object", + "required": [ + "ssn", + "name" + ], + "properties": { + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "insuranceCode": { + "type": "string" + }, + "registrationDate": { + "type": "string", + "format": "date-time" + }, + "purchaseDate": { + "type": "string", + "format": "date-time" + } + }, + "$id": "VehicleOwner" + } + }, + "$id": "Vehicle" + }, + "customer": { + "title": "Customer", + "type": "object", + "required": [ + "id", + "language" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" + }, + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "email": { + "type": "string", + "format": "email", + "nullable": true + }, + "phone": { + "type": "string", + "nullable": true, + "example": "4648700" + }, + "language": { + "type": "string", + "maxLength": 2, + "minLength": 2, + "example": "is" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "options": { + "type": "object", + "properties": { + "sendInvoicesToEmail": { + "type": "boolean" + }, + "sendInvoicesToPublishingSystem": { + "type": "boolean" + }, + "billingMethod": { + "type": "string", + "enum": [ + "daily", + "monthly" + ] + }, + "billingSsn": { + "type": "string" + } + }, + "$id": "CustomerOption" + } + }, + "$id": "Customer" + }, + "entrancePhoto": { + "type": "object", + "required": [ + "id", + "capturedOn", + "plate", + "status", + "camera" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" + }, + "capturedOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE333" + }, + "score": { + "type": "integer" + }, + "url": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "new", + "need-review", + "force-review", + "reviewed", + "deleted", + "failed" + ] + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "camera": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" + }, + "name": { + "type": "string", + "example": "Entrance camera" + }, + "brand": { + "type": "string", + "example": "Raftakn" + }, + "location": { + "type": "string", + "enum": [ + "entrance", + "exit" + ] + } + }, + "$id": "Camera" + } + }, + "$id": "Photo" + }, + "exitPhoto": { + "type": "object", + "required": [ + "id", + "capturedOn", + "plate", + "status", + "camera" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" + }, + "capturedOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE333" + }, + "score": { + "type": "integer" + }, + "url": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "new", + "need-review", + "force-review", + "reviewed", + "deleted", + "failed" + ] + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "camera": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" + }, + "name": { + "type": "string", + "example": "Entrance camera" + }, + "brand": { + "type": "string", + "example": "Raftakn" + }, + "location": { + "type": "string", + "enum": [ + "entrance", + "exit" + ] + } + }, + "$id": "Camera" + } + }, + "$id": "Photo" + }, + "invoice": { + "title": "Invoice object", + "type": "object", + "readOnly": true, + "required": [ + "id", + "status", + "language" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623" + }, + "status": { + "type": "string", + "enum": [ + "paid", + "refunded", + "incomplete", + "failed", + "draft" + ] + }, + "productId": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623", + "nullable": true + }, + "price": { + "type": "object", + "nullable": true, + "properties": { + "amount": { + "type": "number", + "example": 1250 + }, + "currency": { + "type": "string", + "maxLength": 3, + "minLength": 3, + "example": "ISK" + } + }, + "$id": "Money" + }, + "invoiceEmail": { + "type": "string", + "format": "email" + }, + "language": { + "type": "string", + "enum": [ + "is", + "en" + ] + }, + "receipt": { + "description": "Payment receipt", + "type": "object", + "readOnly": true, + "properties": { + "type": { + "type": "string", + "enum": [ + "visa", + "mastercard", + "amex", + "discover", + "other", + "electron", + "maestro" + ] + }, + "card": { + "type": "string", + "description": "Masked Card Number", + "example": "****-****-****-4444" + } + }, + "$id": "Receipt" + }, + "createdOn": { + "type": "string", + "format": "date-time" + } + }, + "$id": "Invoice" + } + }, + "$id": "Visit" + } + } + } + } + } + }, + "/visits/counts": { + "get": { + "summary": "Get visit counts", + "operationId": "countVisits", + "tags": [ + "Visits" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "count": { + "type": "integer" + } + } + } + } + } + }, + "400": { + "description": "Generic input error", + "content": { + "application/json": { + "schema": { + "title": "Exception handle by underlying system", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "exception": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "messages": { + "type": "string", + "nullable": true + } + }, + "$id": "ErrorException" + } + } + }, + "$id": "InputError" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + }, + "500": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "InternalError" + } + }, + "description": "List and filter visits\n\nIf bearer token does not belong to operator list will be filter on customerId", + "parameters": [ + { + "schema": { + "type": "string", + "enum": [ + "new", + "open", + "review", + "closed", + "need-payment" + ] + }, + "in": "query", + "name": "status", + "description": "Visit status" + }, + { + "schema": { + "type": "string", + "enum": [ + "latest", + "export", + "open", + "checkin" + ] + }, + "in": "query", + "name": "collection", + "description": "Pre defined search collections" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "plate", + "description": "Find by licence plate supports wildcard" + }, + { + "schema": { + "type": "string", + "format": "date" + }, + "in": "query", + "name": "date", + "description": "Visits on this day" + }, + { + "schema": { + "type": "string", + "format": "date-time", + "example": "2020-07-23T07:12:52+02:00" + }, + "in": "query", + "name": "date.from" + }, + { + "schema": { + "type": "string", + "format": "date-time", + "example": "2020-07-23T07:12:52+02:00" + }, + "in": "query", + "name": "date.to" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "card.lastFour" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "next" + }, + { + "schema": { + "type": "string", + "enum": [ + "whitelisted", + "kiosk", + "company-invoice", + "owner-invoice", + "failed", + "void" + ] + }, + "in": "query", + "name": "payment.status", + "description": "Payment status" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "ssn", + "description": "Find by vehicle owner" + } + ] + } + }, + "/visit/{id}": { + "parameters": [ + { + "schema": { + "type": "string", + "format": "uuid" + }, + "name": "id", + "in": "path", + "required": true + } + ], + "get": { + "operationId": "getVisit", + "summary": "Retrieve visit", + "description": "If bearer token does not belong to operator list will be filter on customerId", + "tags": [ + "Visits" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "title": "Visit", + "type": "object", + "required": [ + "id", + "startedOn", + "plate", + "status" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623" + }, + "startedOn": { + "type": "string", + "format": "date-time" + }, + "endedOn": { + "type": "string", + "format": "date-time" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE111" + }, + "status": { + "type": "string", + "enum": [ + "new", + "need-payment", + "need-plate", + "completed" + ] + }, + "paymentStatus": { + "type": "string", + "enum": [ + "whitelisted", + "kiosk", + "company-invoice", + "owner-invoice", + "failed", + "void" + ] + }, + "price": { + "type": "object", + "nullable": true, + "properties": { + "amount": { + "type": "number", + "example": 1250 + }, + "currency": { + "type": "string", + "maxLength": 3, + "minLength": 3, + "example": "ISK" + } + }, + "$id": "Money" + }, + "vehicle": { + "title": "Vehicle", + "type": "object", + "required": [ + "id", + "useGroup", + "vehicleCategory", + "registeredOn" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "deb4b244-945f-45c8-a67c-dc7939387ed6" + }, + "regno": { + "type": "string" + }, + "permno": { + "type": "string" + }, + "vin": { + "type": "string" + }, + "vehicleCategory": { + "type": "string" + }, + "vehicleGroup": { + "type": "string" + }, + "useGroup": { + "type": "string" + }, + "make": { + "type": "string", + "example": "Volvo" + }, + "model": { + "type": "string" + }, + "modelYear": { + "type": "string", + "example": "2019" + }, + "color": { + "type": "string", + "example": "blue" + }, + "massinro": { + "type": "string" + }, + "massladen": { + "type": "string" + }, + "taxGroup": { + "type": "string" + }, + "registeredOn": { + "type": "string", + "format": "date-time" + }, + "category": { + "type": "string", + "enum": [ + "light", + "heavy" + ] + }, + "country": { + "type": "string", + "description": "Country code", + "maxLength": 2, + "example": "is" + }, + "operator": { + "title": "Owner or Operator", + "type": "object", + "required": [ + "ssn", + "name" + ], + "properties": { + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "insuranceCode": { + "type": "string" + }, + "registrationDate": { + "type": "string", + "format": "date-time" + }, + "purchaseDate": { + "type": "string", + "format": "date-time" + } + }, + "$id": "VehicleOwner" + }, + "owner": { + "title": "Owner or Operator", + "type": "object", + "required": [ + "ssn", + "name" + ], + "properties": { + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "insuranceCode": { + "type": "string" + }, + "registrationDate": { + "type": "string", + "format": "date-time" + }, + "purchaseDate": { + "type": "string", + "format": "date-time" + } + }, + "$id": "VehicleOwner" + } + }, + "$id": "Vehicle" + }, + "customer": { + "title": "Customer", + "type": "object", + "required": [ + "id", + "language" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" + }, + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "email": { + "type": "string", + "format": "email", + "nullable": true + }, + "phone": { + "type": "string", + "nullable": true, + "example": "4648700" + }, + "language": { + "type": "string", + "maxLength": 2, + "minLength": 2, + "example": "is" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "options": { + "type": "object", + "properties": { + "sendInvoicesToEmail": { + "type": "boolean" + }, + "sendInvoicesToPublishingSystem": { + "type": "boolean" + }, + "billingMethod": { + "type": "string", + "enum": [ + "daily", + "monthly" + ] + }, + "billingSsn": { + "type": "string" + } + }, + "$id": "CustomerOption" + } + }, + "$id": "Customer" + }, + "entrancePhoto": { + "type": "object", + "required": [ + "id", + "capturedOn", + "plate", + "status", + "camera" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" + }, + "capturedOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE333" + }, + "score": { + "type": "integer" + }, + "url": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "new", + "need-review", + "force-review", + "reviewed", + "deleted", + "failed" + ] + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "camera": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" + }, + "name": { + "type": "string", + "example": "Entrance camera" + }, + "brand": { + "type": "string", + "example": "Raftakn" + }, + "location": { + "type": "string", + "enum": [ + "entrance", + "exit" + ] + } + }, + "$id": "Camera" + } + }, + "$id": "Photo" + }, + "exitPhoto": { + "type": "object", + "required": [ + "id", + "capturedOn", + "plate", + "status", + "camera" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" + }, + "capturedOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE333" + }, + "score": { + "type": "integer" + }, + "url": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "new", + "need-review", + "force-review", + "reviewed", + "deleted", + "failed" + ] + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "camera": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" + }, + "name": { + "type": "string", + "example": "Entrance camera" + }, + "brand": { + "type": "string", + "example": "Raftakn" + }, + "location": { + "type": "string", + "enum": [ + "entrance", + "exit" + ] + } + }, + "$id": "Camera" + } + }, + "$id": "Photo" + }, + "invoice": { + "title": "Invoice object", + "type": "object", + "readOnly": true, + "required": [ + "id", + "status", + "language" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623" + }, + "status": { + "type": "string", + "enum": [ + "paid", + "refunded", + "incomplete", + "failed", + "draft" + ] + }, + "productId": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623", + "nullable": true + }, + "price": { + "type": "object", + "nullable": true, + "properties": { + "amount": { + "type": "number", + "example": 1250 + }, + "currency": { + "type": "string", + "maxLength": 3, + "minLength": 3, + "example": "ISK" + } + }, + "$id": "Money" + }, + "invoiceEmail": { + "type": "string", + "format": "email" + }, + "language": { + "type": "string", + "enum": [ + "is", + "en" + ] + }, + "receipt": { + "description": "Payment receipt", + "type": "object", + "readOnly": true, + "properties": { + "type": { + "type": "string", + "enum": [ + "visa", + "mastercard", + "amex", + "discover", + "other", + "electron", + "maestro" + ] + }, + "card": { + "type": "string", + "description": "Masked Card Number", + "example": "****-****-****-4444" + } + }, + "$id": "Receipt" + }, + "createdOn": { + "type": "string", + "format": "date-time" + } + }, + "$id": "Invoice" + } + }, + "$id": "Visit" + } + } + } + }, + "400": { + "description": "Generic input error", + "content": { + "application/json": { + "schema": { + "title": "Exception handle by underlying system", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "exception": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "messages": { + "type": "string", + "nullable": true + } + }, + "$id": "ErrorException" + } + } + }, + "$id": "InputError" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + }, + "500": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "InternalError" + } + } + }, + "put": { + "operationId": "updateVisit", + "summary": "Update visit", + "tags": [ + "Visits" + ], + "requestBody": { + "content": { + "*/*": { + "schema": { + "title": "Visit", + "type": "object", + "required": [ + "id", + "startedOn", + "plate", + "status" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623" + }, + "startedOn": { + "type": "string", + "format": "date-time" + }, + "endedOn": { + "type": "string", + "format": "date-time" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE111" + }, + "status": { + "type": "string", + "enum": [ + "new", + "need-payment", + "need-plate", + "completed" + ] + }, + "paymentStatus": { + "type": "string", + "enum": [ + "whitelisted", + "kiosk", + "company-invoice", + "owner-invoice", + "failed", + "void" + ] + }, + "price": { + "type": "object", + "nullable": true, + "properties": { + "amount": { + "type": "number", + "example": 1250 + }, + "currency": { + "type": "string", + "maxLength": 3, + "minLength": 3, + "example": "ISK" + } + }, + "$id": "Money" + }, + "vehicle": { + "title": "Vehicle", + "type": "object", + "required": [ + "id", + "useGroup", + "vehicleCategory", + "registeredOn" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "deb4b244-945f-45c8-a67c-dc7939387ed6" + }, + "regno": { + "type": "string" + }, + "permno": { + "type": "string" + }, + "vin": { + "type": "string" + }, + "vehicleCategory": { + "type": "string" + }, + "vehicleGroup": { + "type": "string" + }, + "useGroup": { + "type": "string" + }, + "make": { + "type": "string", + "example": "Volvo" + }, + "model": { + "type": "string" + }, + "modelYear": { + "type": "string", + "example": "2019" + }, + "color": { + "type": "string", + "example": "blue" + }, + "massinro": { + "type": "string" + }, + "massladen": { + "type": "string" + }, + "taxGroup": { + "type": "string" + }, + "registeredOn": { + "type": "string", + "format": "date-time" + }, + "category": { + "type": "string", + "enum": [ + "light", + "heavy" + ] + }, + "country": { + "type": "string", + "description": "Country code", + "maxLength": 2, + "example": "is" + }, + "operator": { + "title": "Owner or Operator", + "type": "object", + "required": [ + "ssn", + "name" + ], + "properties": { + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "insuranceCode": { + "type": "string" + }, + "registrationDate": { + "type": "string", + "format": "date-time" + }, + "purchaseDate": { + "type": "string", + "format": "date-time" + } + }, + "$id": "VehicleOwner" + }, + "owner": { + "title": "Owner or Operator", + "type": "object", + "required": [ + "ssn", + "name" + ], + "properties": { + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "insuranceCode": { + "type": "string" + }, + "registrationDate": { + "type": "string", + "format": "date-time" + }, + "purchaseDate": { + "type": "string", + "format": "date-time" + } + }, + "$id": "VehicleOwner" + } + }, + "$id": "Vehicle" + }, + "customer": { + "title": "Customer", + "type": "object", + "required": [ + "id", + "language" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" + }, + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "email": { + "type": "string", + "format": "email", + "nullable": true + }, + "phone": { + "type": "string", + "nullable": true, + "example": "4648700" + }, + "language": { + "type": "string", + "maxLength": 2, + "minLength": 2, + "example": "is" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "options": { + "type": "object", + "properties": { + "sendInvoicesToEmail": { + "type": "boolean" + }, + "sendInvoicesToPublishingSystem": { + "type": "boolean" + }, + "billingMethod": { + "type": "string", + "enum": [ + "daily", + "monthly" + ] + }, + "billingSsn": { + "type": "string" + } + }, + "$id": "CustomerOption" + } + }, + "$id": "Customer" + }, + "entrancePhoto": { + "type": "object", + "required": [ + "id", + "capturedOn", + "plate", + "status", + "camera" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" + }, + "capturedOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE333" + }, + "score": { + "type": "integer" + }, + "url": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "new", + "need-review", + "force-review", + "reviewed", + "deleted", + "failed" + ] + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "camera": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" + }, + "name": { + "type": "string", + "example": "Entrance camera" + }, + "brand": { + "type": "string", + "example": "Raftakn" + }, + "location": { + "type": "string", + "enum": [ + "entrance", + "exit" + ] + } + }, + "$id": "Camera" + } + }, + "$id": "Photo" + }, + "exitPhoto": { + "type": "object", + "required": [ + "id", + "capturedOn", + "plate", + "status", + "camera" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" + }, + "capturedOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE333" + }, + "score": { + "type": "integer" + }, + "url": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "new", + "need-review", + "force-review", + "reviewed", + "deleted", + "failed" + ] + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "camera": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" + }, + "name": { + "type": "string", + "example": "Entrance camera" + }, + "brand": { + "type": "string", + "example": "Raftakn" + }, + "location": { + "type": "string", + "enum": [ + "entrance", + "exit" + ] + } + }, + "$id": "Camera" + } + }, + "$id": "Photo" + }, + "invoice": { + "title": "Invoice object", + "type": "object", + "readOnly": true, + "required": [ + "id", + "status", + "language" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623" + }, + "status": { + "type": "string", + "enum": [ + "paid", + "refunded", + "incomplete", + "failed", + "draft" + ] + }, + "productId": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623", + "nullable": true + }, + "price": { + "type": "object", + "nullable": true, + "properties": { + "amount": { + "type": "number", + "example": 1250 + }, + "currency": { + "type": "string", + "maxLength": 3, + "minLength": 3, + "example": "ISK" + } + }, + "$id": "Money" + }, + "invoiceEmail": { + "type": "string", + "format": "email" + }, + "language": { + "type": "string", + "enum": [ + "is", + "en" + ] + }, + "receipt": { + "description": "Payment receipt", + "type": "object", + "readOnly": true, + "properties": { + "type": { + "type": "string", + "enum": [ + "visa", + "mastercard", + "amex", + "discover", + "other", + "electron", + "maestro" + ] + }, + "card": { + "type": "string", + "description": "Masked Card Number", + "example": "****-****-****-4444" + } + }, + "$id": "Receipt" + }, + "createdOn": { + "type": "string", + "format": "date-time" + } + }, + "$id": "Invoice" + } + }, + "$id": "Visit" + } + } + } + }, + "responses": { + "301": { + "description": "Generic redirect response", + "headers": { + "Location": { + "description": "new location for resource", + "schema": { + "type": "string" + } + } + }, + "$id": "Redirect" + }, + "303": { + "description": "Generic redirect response", + "headers": { + "Location": { + "description": "new location for resource", + "schema": { + "type": "string" + } + } + }, + "$id": "Redirect" + }, + "400": { + "description": "Generic input error", + "content": { + "application/json": { + "schema": { + "title": "Exception handle by underlying system", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "exception": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "messages": { + "type": "string", + "nullable": true + } + }, + "$id": "ErrorException" + } + } + }, + "$id": "InputError" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + }, + "500": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "InternalError" + } + } + } + }, + "/visit/{id}/renewVehicle": { + "post": { + "operationId": "renewVisitVehicleInformation", + "description": "Query IVR for new vehicle information", + "responses": { + "200": { + "description": "OK" + }, + "400": { + "description": "Generic input error", + "content": { + "application/json": { + "schema": { + "title": "Exception handle by underlying system", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "exception": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "messages": { + "type": "string", + "nullable": true + } + }, + "$id": "ErrorException" + } + } + }, + "$id": "InputError" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + }, + "500": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "InternalError" + } + } + }, + "parameters": [ + { + "schema": { + "type": "string", + "format": "uuid" + }, + "name": "id", + "in": "path", + "required": true + } + ] + }, + "/visit/{id}/receipt": { + "parameters": [ + { + "schema": { + "type": "string", + "format": "uuid" + }, + "name": "id", + "in": "path", + "required": true + } + ], + "post": { + "operationId": "sendVisitReceipt", + "summary": "Send receipt to email", + "requestBody": { + "description": "Send receipt body", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "format": "email" + }, + "language": { + "type": "string", + "enum": [ + "is", + "en" + ] + } + }, + "required": [ + "email", + "language" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK" + }, + "400": { + "description": "Generic input error", + "content": { + "application/json": { + "schema": { + "title": "Exception handle by underlying system", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "exception": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "messages": { + "type": "string", + "nullable": true + } + }, + "$id": "ErrorException" + } + } + }, + "$id": "InputError" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + }, + "500": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "InternalError" + } + } + } + }, + "/invoice/{id}": { + "parameters": [ + { + "schema": { + "type": "string", + "format": "uuid" + }, + "name": "id", + "in": "path", + "required": true + } + ], + "get": { + "operationId": "getInvoice", + "summary": "Retrieve invoice", + "description": "If bearer token does not belong to operator list will be filter on customerId", + "tags": [ + "Visits" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "title": "Invoice object", + "type": "object", + "readOnly": true, + "required": [ + "id", + "status", + "language" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623" + }, + "status": { + "type": "string", + "enum": [ + "paid", + "refunded", + "incomplete", + "failed", + "draft" + ] + }, + "productId": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623", + "nullable": true + }, + "price": { + "type": "object", + "nullable": true, + "properties": { + "amount": { + "type": "number", + "example": 1250 + }, + "currency": { + "type": "string", + "maxLength": 3, + "minLength": 3, + "example": "ISK" + } + }, + "$id": "Money" + }, + "invoiceEmail": { + "type": "string", + "format": "email" + }, + "language": { + "type": "string", + "enum": [ + "is", + "en" + ] + }, + "receipt": { + "description": "Payment receipt", + "type": "object", + "readOnly": true, + "properties": { + "type": { + "type": "string", + "enum": [ + "visa", + "mastercard", + "amex", + "discover", + "other", + "electron", + "maestro" + ] + }, + "card": { + "type": "string", + "description": "Masked Card Number", + "example": "****-****-****-4444" + } + }, + "$id": "Receipt" + }, + "createdOn": { + "type": "string", + "format": "date-time" + } + }, + "$id": "Invoice" + } + } + } + }, + "400": { + "description": "Generic input error", + "content": { + "application/json": { + "schema": { + "title": "Exception handle by underlying system", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "exception": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "messages": { + "type": "string", + "nullable": true + } + }, + "$id": "ErrorException" + } + } + }, + "$id": "InputError" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + }, + "500": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "InternalError" + } + } + } + }, + "/products": { + "get": { + "summary": "Get all products", + "operationId": "searchProducts", + "tags": [ + "Kiosk", + "Products" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "aec5c6f3-130c-4928-8ffa-470918d94cc9" + }, + "type": { + "type": "string", + "enum": [ + "default", + "visit" + ], + "example": "visit" + }, + "price": { + "type": "object", + "nullable": true, + "properties": { + "amount": { + "type": "number", + "example": 1250 + }, + "currency": { + "type": "string", + "maxLength": 3, + "minLength": 3, + "example": "ISK" + } + }, + "$id": "Money" + }, + "currency": { + "type": "string", + "maxLength": 3, + "minLength": 3, + "example": "ISK" + }, + "vehicleCategory": { + "type": "string", + "enum": [ + "light", + "heavy" + ] + }, + "category": { + "type": "string" + }, + "name": { + "type": "object", + "example": { + "en": "Name in english", + "is": "Name in icelandic" + }, + "additionalProperties": { + "type": "string" + } + } + }, + "$id": "Product" + } + } + } + } + }, + "400": { + "description": "Generic input error", + "content": { + "application/json": { + "schema": { + "title": "Exception handle by underlying system", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "exception": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "messages": { + "type": "string", + "nullable": true + } + }, + "$id": "ErrorException" + } + } + }, + "$id": "InputError" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + }, + "500": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "InternalError" + } + }, + "security": [ + { + "bearer-token": [] + }, + { + "api-key": [] + } + ] + } + }, + "/admin/create-role-bearer-token": { + "post": { + "summary": "Create role based bearer token", + "operationId": "createRoleBearerToken", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "role": { + "type": "string", + "enum": [ + "webhook", + "kiosk", + "whitelist" + ] + } + } + } + } + }, + "$id": "CreateRoleBearerToken" + }, + "tags": [ + "Admin" + ], + "responses": { + "200": { + "description": "Create new bearer token", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "access_token": { + "type": "string" + } + } + } + } + } + } + }, + "security": [ + { + "api-key": [] + } + ] + } + }, + "/kiosk/register-payment": { + "post": { + "tags": [ + "Kiosk" + ], + "summary": "Register payments for Kiosks", + "operationId": "registerKioskPayment", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "plate", + "quantity", + "product", + "card", + "language" + ], + "properties": { + "plate": { + "type": "string", + "example": "ICE222" + }, + "quantity": { + "description": "The number of \"time units\". Each time unit is 24 hours in this case", + "type": "number", + "example": 1 + }, + "product": { + "anyOf": [ + { + "x-required": "self", + "type": "string", + "format": "uuid", + "example": "040546c4-58bd-49cf-9741-6cb42daf6728", + "$id": "ProductId" + }, + { + "x-required": "self", + "type": "string", + "$id": "ProductCode" + } + ] + }, + "card": { + "anyOf": [ + { + "description": "Simplified card information without ppi", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "visa", + "mastercard", + "amex", + "discover", + "other", + "electron", + "maestro" + ] + }, + "last_four": { + "type": "string", + "maxLength": 4, + "minLength": 4, + "example": "4444" + } + }, + "$id": "ReceiptCard" + }, + { + "type": "object", + "required": [ + "number", + "expire" + ], + "properties": { + "number": { + "type": "string" + }, + "ccv": { + "type": "string" + }, + "expire": { + "type": "string", + "format": "date" + } + }, + "$id": "Card" + } + ] + }, + "payment": { + "type": "object", + "nullable": true, + "required": [ + "amount", + "currency", + "transactionId", + "authorizationId" + ], + "properties": { + "amount": { + "type": "number", + "example": 1250 + }, + "currency": { + "type": "string", + "maxLength": 3, + "minLength": 3, + "example": "ISK" + }, + "transactionId": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + }, + "authorizationId": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + } + }, + "$id": "Payment" + }, + "language": { + "type": "string", + "enum": [ + "is", + "en" + ] + }, + "email": { + "description": "Email address for receipts. If specified the API should send a email with a receipt.", + "type": "string", + "nullable": true + } + } + } + } + }, + "$id": "RegisterKioskPayment" + }, + "responses": { + "200": { + "description": "Payment registered", + "content": { + "application/json": { + "schema": { + "x-required": "self", + "type": "string", + "format": "uuid", + "example": "040546c4-58bd-49cf-9741-6cb42daf6728", + "$id": "InvoiceId" + } + } + } + }, + "400": { + "description": "Generic input error", + "content": { + "application/json": { + "schema": { + "title": "Exception handle by underlying system", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "exception": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "messages": { + "type": "string", + "nullable": true + } + }, + "$id": "ErrorException" + } + } + }, + "$id": "InputError" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + }, + "500": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "InternalError" + } + } + } + }, + "/kiosk/search-visits": { + "get": { + "summary": "Search visits", + "operationId": "kioskSearchVisits", + "tags": [ + "Kiosk" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "readOnly": true, + "properties": { + "next": { + "type": "string", + "nullable": true + }, + "previous": { + "type": "string", + "nullable": true + }, + "total": { + "nullable": true, + "type": "integer" + }, + "extra": { + "nullable": true, + "type": "object" + }, + "visits": { + "type": "array", + "items": { + "title": "Visit", + "type": "object", + "required": [ + "id", + "startedOn", + "plate", + "status" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623" + }, + "startedOn": { + "type": "string", + "format": "date-time" + }, + "endedOn": { + "type": "string", + "format": "date-time" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE111" + }, + "status": { + "type": "string", + "enum": [ + "new", + "need-payment", + "need-plate", + "completed" + ] + }, + "paymentStatus": { + "type": "string", + "enum": [ + "whitelisted", + "kiosk", + "company-invoice", + "owner-invoice", + "failed", + "void" + ] + }, + "price": { + "type": "object", + "nullable": true, + "properties": { + "amount": { + "type": "number", + "example": 1250 + }, + "currency": { + "type": "string", + "maxLength": 3, + "minLength": 3, + "example": "ISK" + } + }, + "$id": "Money" + }, + "vehicle": { + "title": "Vehicle", + "type": "object", + "required": [ + "id", + "useGroup", + "vehicleCategory", + "registeredOn" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "deb4b244-945f-45c8-a67c-dc7939387ed6" + }, + "regno": { + "type": "string" + }, + "permno": { + "type": "string" + }, + "vin": { + "type": "string" + }, + "vehicleCategory": { + "type": "string" + }, + "vehicleGroup": { + "type": "string" + }, + "useGroup": { + "type": "string" + }, + "make": { + "type": "string", + "example": "Volvo" + }, + "model": { + "type": "string" + }, + "modelYear": { + "type": "string", + "example": "2019" + }, + "color": { + "type": "string", + "example": "blue" + }, + "massinro": { + "type": "string" + }, + "massladen": { + "type": "string" + }, + "taxGroup": { + "type": "string" + }, + "registeredOn": { + "type": "string", + "format": "date-time" + }, + "category": { + "type": "string", + "enum": [ + "light", + "heavy" + ] + }, + "country": { + "type": "string", + "description": "Country code", + "maxLength": 2, + "example": "is" + }, + "operator": { + "title": "Owner or Operator", + "type": "object", + "required": [ + "ssn", + "name" + ], + "properties": { + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "insuranceCode": { + "type": "string" + }, + "registrationDate": { + "type": "string", + "format": "date-time" + }, + "purchaseDate": { + "type": "string", + "format": "date-time" + } + }, + "$id": "VehicleOwner" + }, + "owner": { + "title": "Owner or Operator", + "type": "object", + "required": [ + "ssn", + "name" + ], + "properties": { + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "insuranceCode": { + "type": "string" + }, + "registrationDate": { + "type": "string", + "format": "date-time" + }, + "purchaseDate": { + "type": "string", + "format": "date-time" + } + }, + "$id": "VehicleOwner" + } + }, + "$id": "Vehicle" + }, + "customer": { + "title": "Customer", + "type": "object", + "required": [ + "id", + "language" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" + }, + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "email": { + "type": "string", + "format": "email", + "nullable": true + }, + "phone": { + "type": "string", + "nullable": true, + "example": "4648700" + }, + "language": { + "type": "string", + "maxLength": 2, + "minLength": 2, + "example": "is" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "options": { + "type": "object", + "properties": { + "sendInvoicesToEmail": { + "type": "boolean" + }, + "sendInvoicesToPublishingSystem": { + "type": "boolean" + }, + "billingMethod": { + "type": "string", + "enum": [ + "daily", + "monthly" + ] + }, + "billingSsn": { + "type": "string" + } + }, + "$id": "CustomerOption" + } + }, + "$id": "Customer" + }, + "entrancePhoto": { + "type": "object", + "required": [ + "id", + "capturedOn", + "plate", + "status", + "camera" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" + }, + "capturedOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE333" + }, + "score": { + "type": "integer" + }, + "url": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "new", + "need-review", + "force-review", + "reviewed", + "deleted", + "failed" + ] + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "camera": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" + }, + "name": { + "type": "string", + "example": "Entrance camera" + }, + "brand": { + "type": "string", + "example": "Raftakn" + }, + "location": { + "type": "string", + "enum": [ + "entrance", + "exit" + ] + } + }, + "$id": "Camera" + } + }, + "$id": "Photo" + }, + "exitPhoto": { + "type": "object", + "required": [ + "id", + "capturedOn", + "plate", + "status", + "camera" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" + }, + "capturedOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE333" + }, + "score": { + "type": "integer" + }, + "url": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "new", + "need-review", + "force-review", + "reviewed", + "deleted", + "failed" + ] + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "camera": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" + }, + "name": { + "type": "string", + "example": "Entrance camera" + }, + "brand": { + "type": "string", + "example": "Raftakn" + }, + "location": { + "type": "string", + "enum": [ + "entrance", + "exit" + ] + } + }, + "$id": "Camera" + } + }, + "$id": "Photo" + }, + "invoice": { + "title": "Invoice object", + "type": "object", + "readOnly": true, + "required": [ + "id", + "status", + "language" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623" + }, + "status": { + "type": "string", + "enum": [ + "paid", + "refunded", + "incomplete", + "failed", + "draft" + ] + }, + "productId": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623", + "nullable": true + }, + "price": { + "type": "object", + "nullable": true, + "properties": { + "amount": { + "type": "number", + "example": 1250 + }, + "currency": { + "type": "string", + "maxLength": 3, + "minLength": 3, + "example": "ISK" + } + }, + "$id": "Money" + }, + "invoiceEmail": { + "type": "string", + "format": "email" + }, + "language": { + "type": "string", + "enum": [ + "is", + "en" + ] + }, + "receipt": { + "description": "Payment receipt", + "type": "object", + "readOnly": true, + "properties": { + "type": { + "type": "string", + "enum": [ + "visa", + "mastercard", + "amex", + "discover", + "other", + "electron", + "maestro" + ] + }, + "card": { + "type": "string", + "description": "Masked Card Number", + "example": "****-****-****-4444" + } + }, + "$id": "Receipt" + }, + "createdOn": { + "type": "string", + "format": "date-time" + } + }, + "$id": "Invoice" + } + }, + "$id": "Visit" + } + } + }, + "$id": "VisitsResponse" + } + } + } + }, + "400": { + "description": "Generic input error", + "content": { + "application/json": { + "schema": { + "title": "Exception handle by underlying system", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "exception": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "messages": { + "type": "string", + "nullable": true + } + }, + "$id": "ErrorException" + } + } + }, + "$id": "InputError" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + }, + "500": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "InternalError" + } + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "plate", + "description": "Find by licence plate supports wildcard" + } + ] + } + }, + "/purchase-product": { + "post": { + "tags": [ + "Kiosk" + ], + "summary": "Purchase a product", + "operationId": "purchaseProduct", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "vehicle", + "customer", + "product", + "card" + ], + "properties": { + "vehicle": { + "type": "object", + "oneOf": [ + { + "required": [ + "plate" + ] + }, + { + "required": [ + "id" + ] + } + ], + "properties": { + "plate": { + "type": "string", + "example": "ICE222" + }, + "id": { + "description": "Id of vehicle know to us", + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623" + } + }, + "$id": "VehicleLookup" + }, + "customer": { + "anyOf": [ + { + "title": "SimpleCustomer", + "type": "object", + "required": [ + "name", + "language" + ], + "properties": { + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "email": { + "type": "string", + "format": "email", + "nullable": true + }, + "phone": { + "type": "string", + "nullable": true, + "example": "4648700" + }, + "language": { + "type": "string", + "maxLength": 2, + "minLength": 2, + "example": "is" + } + }, + "$id": "SimpleCustomer" + }, + { + "title": "Customer", + "type": "object", + "required": [ + "id", + "language" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" + }, + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "email": { + "type": "string", + "format": "email", + "nullable": true + }, + "phone": { + "type": "string", + "nullable": true, + "example": "4648700" + }, + "language": { + "type": "string", + "maxLength": 2, + "minLength": 2, + "example": "is" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "options": { + "type": "object", + "properties": { + "sendInvoicesToEmail": { + "type": "boolean" + }, + "sendInvoicesToPublishingSystem": { + "type": "boolean" + }, + "billingMethod": { + "type": "string", + "enum": [ + "daily", + "monthly" + ] + }, + "billingSsn": { + "type": "string" + } + }, + "$id": "CustomerOption" + } + }, + "$id": "Customer" + } + ] + }, + "product": { + "x-required": "self", + "type": "string", + "format": "uuid", + "example": "040546c4-58bd-49cf-9741-6cb42daf6728", + "$id": "ProductId" + }, + "card": { + "type": "object", + "required": [ + "number", + "expire" + ], + "properties": { + "number": { + "type": "string" + }, + "ccv": { + "type": "string" + }, + "expire": { + "type": "string", + "format": "date" + } + }, + "$id": "Card" + }, + "provider": { + "type": "string", + "enum": [ + "borgun", + "valitor-pay", + "testing", + "testing2" + ] + } + } + } + } + }, + "$id": "PurchaseProduct" + }, + "responses": { + "200": { + "description": "Payment registered", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "readOnly": true, + "required": [ + "invoiceId", + "form" + ], + "properties": { + "invoiceId": { + "x-required": "self", + "type": "string", + "format": "uuid", + "example": "040546c4-58bd-49cf-9741-6cb42daf6728", + "$id": "InvoiceId" + }, + "form": { + "type": "object", + "required": [ + "html", + "fields", + "url" + ], + "properties": { + "html": { + "type": "string" + }, + "fields": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "url": { + "type": "string" + } + } + } + }, + "$id": "PaymentFormResponse" + }, + { + "x-required": "self", + "type": "string", + "format": "uuid", + "example": "040546c4-58bd-49cf-9741-6cb42daf6728", + "$id": "InvoiceId" + } + ] + } + } + } + }, + "400": { + "description": "Generic input error", + "content": { + "application/json": { + "schema": { + "title": "Exception handle by underlying system", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "exception": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "messages": { + "type": "string", + "nullable": true + } + }, + "$id": "ErrorException" + } + } + }, + "$id": "InputError" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + }, + "500": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "InternalError" + } + }, + "security": [ + { + "bearer-token": [] + }, + { + "api-key": [] + } + ] + } + }, + "/ping/bearer": { + "get": { + "tags": [ + "Testing" + ], + "operationId": "testBearerToken", + "responses": { + "200": { + "description": "OK" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + }, + "500": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "InternalError" + } + } + } + }, + "/ping/redirect": { + "post": { + "tags": [ + "Testing" + ], + "operationId": "testTokenRedirect", + "responses": { + "201": { + "description": "OK" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + } + } + }, + "get": { + "tags": [ + "Testing" + ], + "operationId": "testTacToken", + "responses": { + "200": { + "description": "OK" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + } + } + } + }, + "/ping/key": { + "get": { + "operationId": "testApiKey", + "tags": [ + "Testing" + ], + "responses": { + "200": { + "description": "OK" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + } + }, + "security": [ + { + "api-key": [] + } + ] + } + }, + "/ping/webhook": { + "post": { + "operationId": "testHookAccess", + "tags": [ + "Testing" + ], + "responses": { + "200": { + "description": "OK" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + } + }, + "security": [ + { + "hook-security": [], + "bearer-token": [] + } + ] + } + }, + "/ping/kiosk": { + "post": { + "operationId": "testKioskAccess", + "tags": [ + "Testing" + ], + "responses": { + "200": { + "description": "OK" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + } + }, + "security": [ + { + "bearer-token": [] + } + ] + } + }, + "/ping/whitelist": { + "post": { + "operationId": "testWhitelistAccess", + "tags": [ + "Testing" + ], + "responses": { + "200": { + "description": "OK" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + } + }, + "security": [ + { + "bearer-token": [] + } + ] + } + }, + "/photos/{type}": { + "parameters": [ + { + "schema": { + "type": "string", + "enum": [ + "open-alpr", + "open-alpr-test" + ] + }, + "name": "type", + "in": "path", + "required": true + } + ], + "post": { + "operationId": "importPhoto", + "summary": "Ingest new photo into system", + "requestBody": { + "content": { + "*/*": { + "schema": { + "anyOf": [ + { + "type": "object", + "properties": { + "epoch_start": { + "description": "Capture date", + "type": "integer" + }, + "camera_id": { + "description": "Numeric id of camera", + "type": "integer" + }, + "agent_uid": { + "type": "string" + }, + "best_uuid": { + "description": "Unique id of best match", + "type": "string" + }, + "best_plate_number": { + "description": "Best guess for license plate", + "type": "string" + }, + "best_confidence": { + "description": "Ocr score", + "type": "number" + }, + "best_region": { + "description": "Guess for the license plate region", + "type": "string" + }, + "best_region_confidence": { + "type": "number" + }, + "company_id": { + "type": "string", + "format": "uuid" + }, + "version": { + "type": "integer" + }, + "vehicle_crop_jpeg": { + "description": "Base64 encoded jpeg preview for the photo", + "type": "string" + }, + "is_parked": { + "type": "boolean" + }, + "vehicle": { + "type": "object", + "properties": { + "color": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "confidence": { + "type": "number" + } + } + } + }, + "make": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "confidence": { + "type": "number" + } + } + } + }, + "body": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "confidence": { + "type": "number" + } + } + } + } + } + } + }, + "$id": "OpenALPR" + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK" + }, + "400": { + "description": "Generic input error", + "content": { + "application/json": { + "schema": { + "title": "Exception handle by underlying system", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "exception": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "messages": { + "type": "string", + "nullable": true + } + }, + "$id": "ErrorException" + } + } + }, + "$id": "InputError" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + }, + "500": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "InternalError" + } + }, + "security": [ + { + "hook-security": [] + }, + { + "bearer-token": [] + } + ] + } + }, + "/photos": { + "get": { + "summary": "Search photos", + "operationId": "searchPhotos", + "tags": [ + "Photo" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "readOnly": true, + "properties": { + "next": { + "type": "string", + "nullable": true + }, + "previous": { + "type": "string", + "nullable": true + }, + "photos": { + "type": "array", + "items": { + "type": "object", + "required": [ + "id", + "capturedOn", + "plate", + "status", + "camera" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" + }, + "capturedOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE333" + }, + "score": { + "type": "integer" + }, + "url": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "new", + "need-review", + "force-review", + "reviewed", + "deleted", + "failed" + ] + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "camera": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" + }, + "name": { + "type": "string", + "example": "Entrance camera" + }, + "brand": { + "type": "string", + "example": "Raftakn" + }, + "location": { + "type": "string", + "enum": [ + "entrance", + "exit" + ] + } + }, + "$id": "Camera" + } + }, + "$id": "Photo" + } + } + }, + "$id": "PhotoResponse" + } + } + } + }, + "400": { + "description": "Generic input error", + "content": { + "application/json": { + "schema": { + "title": "Exception handle by underlying system", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "exception": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "messages": { + "type": "string", + "nullable": true + } + }, + "$id": "ErrorException" + } + } + }, + "$id": "InputError" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + }, + "500": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "InternalError" + } + }, + "parameters": [ + { + "schema": { + "type": "string", + "enum": [ + "need-review" + ] + }, + "in": "query", + "name": "collection", + "description": "Pre defined search collections" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "plate", + "description": "Find by licence plate supports wildcard" + }, + { + "schema": { + "type": "string", + "format": "date", + "example": "2020-07-23" + }, + "in": "query", + "name": "date", + "description": "Photo captured on date" + }, + { + "schema": { + "type": "string", + "format": "date-time", + "example": "2020-07-23T07:12:52+02:00" + }, + "in": "query", + "name": "date.from" + }, + { + "schema": { + "type": "string", + "format": "date-time", + "example": "2020-07-23T07:12:52+02:00" + }, + "in": "query", + "name": "date.to" + }, + { + "schema": { + "type": "string", + "format": "uuid" + }, + "in": "query", + "name": "camera.id" + }, + { + "schema": { + "type": "string", + "enum": [ + "entrance", + "exit" + ] + }, + "in": "query", + "name": "camera.location" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "next" + } + ] + } + }, + "/photo/{id}": { + "parameters": [ + { + "schema": { + "type": "string", + "format": "uuid" + }, + "name": "id", + "in": "path", + "required": true + } + ], + "get": { + "summary": "View photo", + "operationId": "getPhoto", + "tags": [ + "Photo" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "id", + "capturedOn", + "plate", + "status", + "camera" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" + }, + "capturedOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE333" + }, + "score": { + "type": "integer" + }, + "url": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "new", + "need-review", + "force-review", + "reviewed", + "deleted", + "failed" + ] + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "camera": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" + }, + "name": { + "type": "string", + "example": "Entrance camera" + }, + "brand": { + "type": "string", + "example": "Raftakn" + }, + "location": { + "type": "string", + "enum": [ + "entrance", + "exit" + ] + } + }, + "$id": "Camera" + } + }, + "$id": "Photo" + } + } + } + }, + "400": { + "description": "Generic input error", + "content": { + "application/json": { + "schema": { + "title": "Exception handle by underlying system", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "exception": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "messages": { + "type": "string", + "nullable": true + } + }, + "$id": "ErrorException" + } + } + }, + "$id": "InputError" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + }, + "500": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "InternalError" + } + } + }, + "put": { + "summary": "Update photo", + "operationId": "updatePhoto", + "tags": [ + "Photo" + ], + "responses": { + "200": { + "description": "Photo updated" + }, + "303": { + "description": "Generic redirect response", + "headers": { + "Location": { + "description": "new location for resource", + "schema": { + "type": "string" + } + } + }, + "$id": "Redirect" + }, + "400": { + "description": "Generic input error", + "content": { + "application/json": { + "schema": { + "title": "Exception handle by underlying system", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "exception": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "messages": { + "type": "string", + "nullable": true + } + }, + "$id": "ErrorException" + } + } + }, + "$id": "InputError" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + }, + "500": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "InternalError" + } + }, + "requestBody": { + "content": { + "*/*": { + "schema": { + "type": "object", + "required": [ + "id", + "capturedOn", + "plate", + "status", + "camera" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" + }, + "capturedOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE333" + }, + "score": { + "type": "integer" + }, + "url": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "new", + "need-review", + "force-review", + "reviewed", + "deleted", + "failed" + ] + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "camera": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" + }, + "name": { + "type": "string", + "example": "Entrance camera" + }, + "brand": { + "type": "string", + "example": "Raftakn" + }, + "location": { + "type": "string", + "enum": [ + "entrance", + "exit" + ] + } + }, + "$id": "Camera" + } + }, + "$id": "Photo" + } + } + } + } + }, + "delete": { + "summary": "Remove photo", + "operationId": "deletePhoto", + "tags": [ + "Photo" + ], + "responses": { + "204": { + "description": "ok" + }, + "400": { + "description": "Generic input error", + "content": { + "application/json": { + "schema": { + "title": "Exception handle by underlying system", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "exception": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "messages": { + "type": "string", + "nullable": true + } + }, + "$id": "ErrorException" + } + } + }, + "$id": "InputError" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + }, + "500": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "InternalError" + } + } + } + }, + "/whitelist": { + "get": { + "summary": "List whitelisted vehicles", + "operationId": "getWhitelistedVehicles", + "tags": [ + "Whitelist" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "readOnly": true, + "properties": { + "next": { + "type": "string", + "nullable": true + }, + "previous": { + "type": "string", + "nullable": true + }, + "whitelists": { + "type": "array", + "items": { + "title": "Visit", + "type": "object", + "required": [ + "plate", + "reason" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623" + }, + "activeFrom": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "expireOn": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE111" + }, + "reason": { + "type": "string" + }, + "author": { + "type": "string", + "nullable": true + } + }, + "$id": "Whitelist" + } + } + }, + "$id": "WhitelistResponse" + } + } + } + }, + "400": { + "description": "Generic input error", + "content": { + "application/json": { + "schema": { + "title": "Exception handle by underlying system", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "exception": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "messages": { + "type": "string", + "nullable": true + } + }, + "$id": "ErrorException" + } + } + }, + "$id": "InputError" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + }, + "500": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "InternalError" + } + }, + "parameters": [ + { + "schema": { + "type": "string", + "enum": [ + "app", + "cpanel" + ] + }, + "in": "query", + "name": "collection", + "description": "Pre defined search collections" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "plate", + "description": "Find by licence plate supports wildcard" + }, + { + "schema": { + "type": "string", + "enum": [ + "on", + "off", + "1", + "0", + "true", + "false" + ] + }, + "in": "query", + "name": "active", + "description": "Active whitelisted plates" + }, + { + "schema": { + "type": "string", + "format": "date", + "example": "2020-07-23" + }, + "in": "query", + "name": "expire", + "description": "Plates expiring on day" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "next" + } + ] + }, + "post": { + "summary": "Add new plate to whitelist", + "operationId": "addWhitelistPlate", + "responses": { + "200": { + "description": "Plate added" + }, + "301": { + "description": "Generic redirect response", + "headers": { + "Location": { + "description": "new location for resource", + "schema": { + "type": "string" + } + } + }, + "$id": "Redirect" + }, + "303": { + "description": "Generic redirect response", + "headers": { + "Location": { + "description": "new location for resource", + "schema": { + "type": "string" + } + } + }, + "$id": "Redirect" + }, + "400": { + "description": "Generic input error", + "content": { + "application/json": { + "schema": { + "title": "Exception handle by underlying system", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "exception": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "messages": { + "type": "string", + "nullable": true + } + }, + "$id": "ErrorException" + } + } + }, + "$id": "InputError" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + }, + "422": { + "description": "Error that happens when creating already created data", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "messages": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid" + } + } + } + } + }, + "$id": "WrongEndpoint" + }, + "500": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "InternalError" + } + }, + "requestBody": { + "content": { + "*/*": { + "schema": { + "title": "Visit", + "type": "object", + "required": [ + "plate", + "reason" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623" + }, + "activeFrom": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "expireOn": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE111" + }, + "reason": { + "type": "string" + }, + "author": { + "type": "string", + "nullable": true + } + }, + "$id": "Whitelist" + } + } + } + } + } + }, + "/whitelist/{id}": { + "parameters": [ + { + "schema": { + "type": "string", + "format": "uuid" + }, + "name": "id", + "in": "path", + "required": true + } + ], + "get": { + "summary": "View whitelist entry", + "operationId": "getWhitelistEntry", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "title": "Visit", + "type": "object", + "required": [ + "plate", + "reason" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623" + }, + "activeFrom": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "expireOn": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE111" + }, + "reason": { + "type": "string" + }, + "author": { + "type": "string", + "nullable": true + } + }, + "$id": "Whitelist" + } + } + } + }, + "400": { + "description": "Generic input error", + "content": { + "application/json": { + "schema": { + "title": "Exception handle by underlying system", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "exception": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "messages": { + "type": "string", + "nullable": true + } + }, + "$id": "ErrorException" + } + } + }, + "$id": "InputError" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + }, + "500": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "InternalError" + } + } + }, + "put": { + "deprecated": true, + "summary": "Update whitelist entry", + "operationId": "updateWhitelistEntry", + "responses": { + "200": { + "description": "Entry updated" + }, + "303": { + "description": "Generic redirect response", + "headers": { + "Location": { + "description": "new location for resource", + "schema": { + "type": "string" + } + } + }, + "$id": "Redirect" + }, + "400": { + "description": "Generic input error", + "content": { + "application/json": { + "schema": { + "title": "Exception handle by underlying system", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "exception": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "messages": { + "type": "string", + "nullable": true + } + }, + "$id": "ErrorException" + } + } + }, + "$id": "InputError" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + }, + "500": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "InternalError" + } + }, + "requestBody": { + "content": { + "*/*": { + "schema": { + "title": "Visit", + "type": "object", + "required": [ + "plate", + "reason" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623" + }, + "activeFrom": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "expireOn": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE111" + }, + "reason": { + "type": "string" + }, + "author": { + "type": "string", + "nullable": true + } + }, + "$id": "Whitelist" + } + } + } + } + }, + "delete": { + "deprecated": true, + "summary": "Remove whitelist entry", + "operationId": "deleteWhitelistEntry", + "responses": { + "204": { + "description": "ok" + }, + "400": { + "description": "Generic input error", + "content": { + "application/json": { + "schema": { + "title": "Exception handle by underlying system", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "exception": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "messages": { + "type": "string", + "nullable": true + } + }, + "$id": "ErrorException" + } + } + }, + "$id": "InputError" + }, + "401": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Unauthorized" + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "Forbidden" + }, + "404": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "NotFound" + }, + "500": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + }, + "$id": "InternalError" + } + } + } + } + }, + "components": { + "schemas": { + "Account": { + "title": "Account", + "type": "object", + "required": [ + "id", + "role", + "status" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "role": { + "type": "string", + "enum": [ + "operator", + "customer", + "partner" + ] + }, + "name": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "active", + "inactive" + ] + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "options": { + "type": "object", + "properties": { + "free-parking-time": { + "type": "string" + }, + "expireTime": { + "type": "string", + "description": "Default expire time for whitelist entries.\nAccepts formats from https://www.php.net/manual/en/datetime.formats.php" + } + } + } + } + }, + "AccountId": { + "x-required": "self", + "type": "string", + "format": "uuid", + "example": "040546c4-58bd-49cf-9741-6cb42daf6728" + }, + "AccountLogin": { + "title": "AccountLogin", + "type": "object", + "required": [ + "email" + ], + "properties": { + "accountId": { + "type": "string", + "format": "uuid" + }, + "email": { + "type": "string", + "format": "email" + }, + "expire": { + "type": "string", + "nullable": true, + "format": "date-time" + } + } + }, + "AccountsResponse": { + "type": "object", + "readOnly": true, + "properties": { + "next": { + "type": "string", + "nullable": true + }, + "previous": { + "type": "string", + "nullable": true + }, + "accounts": { + "type": "array", + "items": { + "title": "Account", + "type": "object", + "required": [ + "id", + "role", + "status" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "role": { + "type": "string", + "enum": [ + "operator", + "customer", + "partner" + ] + }, + "name": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "active", + "inactive" + ] + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "options": { + "type": "object", + "properties": { + "free-parking-time": { + "type": "string" + }, + "expireTime": { + "type": "string", + "description": "Default expire time for whitelist entries.\nAccepts formats from https://www.php.net/manual/en/datetime.formats.php" + } + } + } + }, + "$id": "Account" + } + } + } + }, + "AuthenticatedAccount": { + "title": "Wrapper around account and bearer token", + "type": "object", + "required": [ + "access_token", + "account" + ], + "properties": { + "access_token": { + "type": "string" + }, + "account": { + "title": "Account", + "type": "object", + "required": [ + "id", + "role", + "status" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "role": { + "type": "string", + "enum": [ + "operator", + "customer", + "partner" + ] + }, + "name": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "active", + "inactive" + ] + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "options": { + "type": "object", + "properties": { + "free-parking-time": { + "type": "string" + }, + "expireTime": { + "type": "string", + "description": "Default expire time for whitelist entries.\nAccepts formats from https://www.php.net/manual/en/datetime.formats.php" + } + } + } + }, + "$id": "Account" + } + } + }, + "Camera": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" + }, + "name": { + "type": "string", + "example": "Entrance camera" + }, + "brand": { + "type": "string", + "example": "Raftakn" + }, + "location": { + "type": "string", + "enum": [ + "entrance", + "exit" + ] + } + } + }, + "Card": { + "type": "object", + "required": [ + "number", + "expire" + ], + "properties": { + "number": { + "type": "string" + }, + "ccv": { + "type": "string" + }, + "expire": { + "type": "string", + "format": "date" + } + } + }, + "Customer": { + "title": "Customer", + "type": "object", + "required": [ + "id", + "language" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" + }, + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "email": { + "type": "string", + "format": "email", + "nullable": true + }, + "phone": { + "type": "string", + "nullable": true, + "example": "4648700" + }, + "language": { + "type": "string", + "maxLength": 2, + "minLength": 2, + "example": "is" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "options": { + "type": "object", + "properties": { + "sendInvoicesToEmail": { + "type": "boolean" + }, + "sendInvoicesToPublishingSystem": { + "type": "boolean" + }, + "billingMethod": { + "type": "string", + "enum": [ + "daily", + "monthly" + ] + }, + "billingSsn": { + "type": "string" + } + }, + "$id": "CustomerOption" + } + } + }, + "CustomerOption": { + "type": "object", + "properties": { + "sendInvoicesToEmail": { + "type": "boolean" + }, + "sendInvoicesToPublishingSystem": { + "type": "boolean" + }, + "billingMethod": { + "type": "string", + "enum": [ + "daily", + "monthly" + ] + }, + "billingSsn": { + "type": "string" + } + } + }, + "CustomersResponse": { + "type": "object", + "readOnly": true, + "properties": { + "next": { + "type": "string", + "nullable": true + }, + "previous": { + "type": "string", + "nullable": true + }, + "customers": { + "type": "array", + "items": { + "title": "Customer", + "type": "object", + "required": [ + "id", + "language" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" + }, + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "email": { + "type": "string", + "format": "email", + "nullable": true + }, + "phone": { + "type": "string", + "nullable": true, + "example": "4648700" + }, + "language": { + "type": "string", + "maxLength": 2, + "minLength": 2, + "example": "is" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "options": { + "type": "object", + "properties": { + "sendInvoicesToEmail": { + "type": "boolean" + }, + "sendInvoicesToPublishingSystem": { + "type": "boolean" + }, + "billingMethod": { + "type": "string", + "enum": [ + "daily", + "monthly" + ] + }, + "billingSsn": { + "type": "string" + } + }, + "$id": "CustomerOption" + } + }, + "$id": "Customer" + } + } + } + }, + "Error": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + } + }, + "ErrorException": { + "title": "Exception handle by underlying system", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "exception": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "messages": { + "type": "string", + "nullable": true + } + } + }, + "Invoice": { + "title": "Invoice object", + "type": "object", + "readOnly": true, + "required": [ + "id", + "status", + "language" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623" + }, + "status": { + "type": "string", + "enum": [ + "paid", + "refunded", + "incomplete", + "failed", + "draft" + ] + }, + "productId": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623", + "nullable": true + }, + "price": { + "type": "object", + "nullable": true, + "properties": { + "amount": { + "type": "number", + "example": 1250 + }, + "currency": { + "type": "string", + "maxLength": 3, + "minLength": 3, + "example": "ISK" + } + }, + "$id": "Money" + }, + "invoiceEmail": { + "type": "string", + "format": "email" + }, + "language": { + "type": "string", + "enum": [ + "is", + "en" + ] + }, + "receipt": { + "description": "Payment receipt", + "type": "object", + "readOnly": true, + "properties": { + "type": { + "type": "string", + "enum": [ + "visa", + "mastercard", + "amex", + "discover", + "other", + "electron", + "maestro" + ] + }, + "card": { + "type": "string", + "description": "Masked Card Number", + "example": "****-****-****-4444" + } + }, + "$id": "Receipt" + }, + "createdOn": { + "type": "string", + "format": "date-time" + } + } + }, + "InvoiceId": { + "x-required": "self", + "type": "string", + "format": "uuid", + "example": "040546c4-58bd-49cf-9741-6cb42daf6728" + }, + "Money": { + "type": "object", + "nullable": true, + "properties": { + "amount": { + "type": "number", + "example": 1250 + }, + "currency": { + "type": "string", + "maxLength": 3, + "minLength": 3, + "example": "ISK" + } + } + }, + "OpenALPR": { + "type": "object", + "properties": { + "epoch_start": { + "description": "Capture date", + "type": "integer" + }, + "camera_id": { + "description": "Numeric id of camera", + "type": "integer" + }, + "agent_uid": { + "type": "string" + }, + "best_uuid": { + "description": "Unique id of best match", + "type": "string" + }, + "best_plate_number": { + "description": "Best guess for license plate", + "type": "string" + }, + "best_confidence": { + "description": "Ocr score", + "type": "number" + }, + "best_region": { + "description": "Guess for the license plate region", + "type": "string" + }, + "best_region_confidence": { + "type": "number" + }, + "company_id": { + "type": "string", + "format": "uuid" + }, + "version": { + "type": "integer" + }, + "vehicle_crop_jpeg": { + "description": "Base64 encoded jpeg preview for the photo", + "type": "string" + }, + "is_parked": { + "type": "boolean" + }, + "vehicle": { + "type": "object", + "properties": { + "color": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "confidence": { + "type": "number" + } + } + } + }, + "make": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "confidence": { + "type": "number" + } + } + } + }, + "body": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "confidence": { + "type": "number" + } + } + } + } + } + } + } + }, + "PasswordInfo": { + "type": "object", + "required": [ + "email", + "password" + ], + "properties": { + "email": { + "type": "string", + "format": "email" + }, + "password": { + "type": "string", + "format": "password" + }, + "expire": { + "type": "string", + "nullable": true, + "format": "date-time" + } + } + }, + "Payment": { + "type": "object", + "nullable": true, + "required": [ + "amount", + "currency", + "transactionId", + "authorizationId" + ], + "properties": { + "amount": { + "type": "number", + "example": 1250 + }, + "currency": { + "type": "string", + "maxLength": 3, + "minLength": 3, + "example": "ISK" + }, + "transactionId": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + }, + "authorizationId": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + } + } + }, + "PaymentFormResponse": { + "type": "object", + "readOnly": true, + "required": [ + "invoiceId", + "form" + ], + "properties": { + "invoiceId": { + "x-required": "self", + "type": "string", + "format": "uuid", + "example": "040546c4-58bd-49cf-9741-6cb42daf6728", + "$id": "InvoiceId" + }, + "form": { + "type": "object", + "required": [ + "html", + "fields", + "url" + ], + "properties": { + "html": { + "type": "string" + }, + "fields": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "url": { + "type": "string" + } + } + } + } + }, + "Photo": { + "type": "object", + "required": [ + "id", + "capturedOn", + "plate", + "status", + "camera" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" + }, + "capturedOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE333" + }, + "score": { + "type": "integer" + }, + "url": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "new", + "need-review", + "force-review", + "reviewed", + "deleted", + "failed" + ] + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "camera": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" + }, + "name": { + "type": "string", + "example": "Entrance camera" + }, + "brand": { + "type": "string", + "example": "Raftakn" + }, + "location": { + "type": "string", + "enum": [ + "entrance", + "exit" + ] + } + }, + "$id": "Camera" + } + } + }, + "PhotoResponse": { + "type": "object", + "readOnly": true, + "properties": { + "next": { + "type": "string", + "nullable": true + }, + "previous": { + "type": "string", + "nullable": true + }, + "photos": { + "type": "array", + "items": { + "type": "object", + "required": [ + "id", + "capturedOn", + "plate", + "status", + "camera" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" + }, + "capturedOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE333" + }, + "score": { + "type": "integer" + }, + "url": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "new", + "need-review", + "force-review", + "reviewed", + "deleted", + "failed" + ] + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "camera": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" + }, + "name": { + "type": "string", + "example": "Entrance camera" + }, + "brand": { + "type": "string", + "example": "Raftakn" + }, + "location": { + "type": "string", + "enum": [ + "entrance", + "exit" + ] + } + }, + "$id": "Camera" + } + }, + "$id": "Photo" + } + } + } + }, + "Product": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "aec5c6f3-130c-4928-8ffa-470918d94cc9" + }, + "type": { + "type": "string", + "enum": [ + "default", + "visit" + ], + "example": "visit" + }, + "price": { + "type": "object", + "nullable": true, + "properties": { + "amount": { + "type": "number", + "example": 1250 + }, + "currency": { + "type": "string", + "maxLength": 3, + "minLength": 3, + "example": "ISK" + } + }, + "$id": "Money" + }, + "currency": { + "type": "string", + "maxLength": 3, + "minLength": 3, + "example": "ISK" + }, + "vehicleCategory": { + "type": "string", + "enum": [ + "light", + "heavy" + ] + }, + "category": { + "type": "string" + }, + "name": { + "type": "object", + "example": { + "en": "Name in english", + "is": "Name in icelandic" + }, + "additionalProperties": { + "type": "string" + } + } + } + }, + "ProductCode": { + "x-required": "self", + "type": "string" + }, + "ProductId": { + "x-required": "self", + "type": "string", + "format": "uuid", + "example": "040546c4-58bd-49cf-9741-6cb42daf6728" + }, + "Receipt": { + "description": "Payment receipt", + "type": "object", + "readOnly": true, + "properties": { + "type": { + "type": "string", + "enum": [ + "visa", + "mastercard", + "amex", + "discover", + "other", + "electron", + "maestro" + ] + }, + "card": { + "type": "string", + "description": "Masked Card Number", + "example": "****-****-****-4444" + } + } + }, + "ReceiptCard": { + "description": "Simplified card information without ppi", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "visa", + "mastercard", + "amex", + "discover", + "other", + "electron", + "maestro" + ] + }, + "last_four": { + "type": "string", + "maxLength": 4, + "minLength": 4, + "example": "4444" + } + } + }, + "SimpleCustomer": { + "title": "SimpleCustomer", + "type": "object", + "required": [ + "name", + "language" + ], + "properties": { + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "email": { + "type": "string", + "format": "email", + "nullable": true + }, + "phone": { + "type": "string", + "nullable": true, + "example": "4648700" + }, + "language": { + "type": "string", + "maxLength": 2, + "minLength": 2, + "example": "is" + } + } + }, + "Vehicle": { + "title": "Vehicle", + "type": "object", + "required": [ + "id", + "useGroup", + "vehicleCategory", + "registeredOn" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "deb4b244-945f-45c8-a67c-dc7939387ed6" + }, + "regno": { + "type": "string" + }, + "permno": { + "type": "string" + }, + "vin": { + "type": "string" + }, + "vehicleCategory": { + "type": "string" + }, + "vehicleGroup": { + "type": "string" + }, + "useGroup": { + "type": "string" + }, + "make": { + "type": "string", + "example": "Volvo" + }, + "model": { + "type": "string" + }, + "modelYear": { + "type": "string", + "example": "2019" + }, + "color": { + "type": "string", + "example": "blue" + }, + "massinro": { + "type": "string" + }, + "massladen": { + "type": "string" + }, + "taxGroup": { + "type": "string" + }, + "registeredOn": { + "type": "string", + "format": "date-time" + }, + "category": { + "type": "string", + "enum": [ + "light", + "heavy" + ] + }, + "country": { + "type": "string", + "description": "Country code", + "maxLength": 2, + "example": "is" + }, + "operator": { + "title": "Owner or Operator", + "type": "object", + "required": [ + "ssn", + "name" + ], + "properties": { + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "insuranceCode": { + "type": "string" + }, + "registrationDate": { + "type": "string", + "format": "date-time" + }, + "purchaseDate": { + "type": "string", + "format": "date-time" + } + }, + "$id": "VehicleOwner" + }, + "owner": { + "title": "Owner or Operator", + "type": "object", + "required": [ + "ssn", + "name" + ], + "properties": { + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "insuranceCode": { + "type": "string" + }, + "registrationDate": { + "type": "string", + "format": "date-time" + }, + "purchaseDate": { + "type": "string", + "format": "date-time" + } + }, + "$id": "VehicleOwner" + } + } + }, + "VehicleLookup": { + "type": "object", + "oneOf": [ + { + "required": [ + "plate" + ] + }, + { + "required": [ + "id" + ] + } + ], + "properties": { + "plate": { + "type": "string", + "example": "ICE222" + }, + "id": { + "description": "Id of vehicle know to us", + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623" + } + } + }, + "VehicleOwner": { + "title": "Owner or Operator", + "type": "object", + "required": [ + "ssn", + "name" + ], + "properties": { + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "insuranceCode": { + "type": "string" + }, + "registrationDate": { + "type": "string", + "format": "date-time" + }, + "purchaseDate": { + "type": "string", + "format": "date-time" + } + } + }, + "Visit": { + "title": "Visit", + "type": "object", + "required": [ + "id", + "startedOn", + "plate", + "status" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623" + }, + "startedOn": { + "type": "string", + "format": "date-time" + }, + "endedOn": { + "type": "string", + "format": "date-time" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE111" + }, + "status": { + "type": "string", + "enum": [ + "new", + "need-payment", + "need-plate", + "completed" + ] + }, + "paymentStatus": { + "type": "string", + "enum": [ + "whitelisted", + "kiosk", + "company-invoice", + "owner-invoice", + "failed", + "void" + ] + }, + "price": { + "type": "object", + "nullable": true, + "properties": { + "amount": { + "type": "number", + "example": 1250 + }, + "currency": { + "type": "string", + "maxLength": 3, + "minLength": 3, + "example": "ISK" + } + }, + "$id": "Money" + }, + "vehicle": { + "title": "Vehicle", + "type": "object", + "required": [ + "id", + "useGroup", + "vehicleCategory", + "registeredOn" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "deb4b244-945f-45c8-a67c-dc7939387ed6" + }, + "regno": { + "type": "string" + }, + "permno": { + "type": "string" + }, + "vin": { + "type": "string" + }, + "vehicleCategory": { + "type": "string" + }, + "vehicleGroup": { + "type": "string" + }, + "useGroup": { + "type": "string" + }, + "make": { + "type": "string", + "example": "Volvo" + }, + "model": { + "type": "string" + }, + "modelYear": { + "type": "string", + "example": "2019" + }, + "color": { + "type": "string", + "example": "blue" + }, + "massinro": { + "type": "string" + }, + "massladen": { + "type": "string" + }, + "taxGroup": { + "type": "string" + }, + "registeredOn": { + "type": "string", + "format": "date-time" + }, + "category": { + "type": "string", + "enum": [ + "light", + "heavy" + ] + }, + "country": { + "type": "string", + "description": "Country code", + "maxLength": 2, + "example": "is" + }, + "operator": { + "title": "Owner or Operator", + "type": "object", + "required": [ + "ssn", + "name" + ], + "properties": { + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "insuranceCode": { + "type": "string" + }, + "registrationDate": { + "type": "string", + "format": "date-time" + }, + "purchaseDate": { + "type": "string", + "format": "date-time" + } + }, + "$id": "VehicleOwner" + }, + "owner": { + "title": "Owner or Operator", + "type": "object", + "required": [ + "ssn", + "name" + ], + "properties": { + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "insuranceCode": { + "type": "string" + }, + "registrationDate": { + "type": "string", + "format": "date-time" + }, + "purchaseDate": { + "type": "string", + "format": "date-time" + } + }, + "$id": "VehicleOwner" + } + }, + "$id": "Vehicle" + }, + "customer": { + "title": "Customer", + "type": "object", + "required": [ + "id", + "language" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" + }, + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "email": { + "type": "string", + "format": "email", + "nullable": true + }, + "phone": { + "type": "string", + "nullable": true, + "example": "4648700" + }, + "language": { + "type": "string", + "maxLength": 2, + "minLength": 2, + "example": "is" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "options": { + "type": "object", + "properties": { + "sendInvoicesToEmail": { + "type": "boolean" + }, + "sendInvoicesToPublishingSystem": { + "type": "boolean" + }, + "billingMethod": { + "type": "string", + "enum": [ + "daily", + "monthly" + ] + }, + "billingSsn": { + "type": "string" + } + }, + "$id": "CustomerOption" + } + }, + "$id": "Customer" + }, + "entrancePhoto": { + "type": "object", + "required": [ + "id", + "capturedOn", + "plate", + "status", + "camera" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" + }, + "capturedOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE333" + }, + "score": { + "type": "integer" + }, + "url": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "new", + "need-review", + "force-review", + "reviewed", + "deleted", + "failed" + ] + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "camera": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" + }, + "name": { + "type": "string", + "example": "Entrance camera" + }, + "brand": { + "type": "string", + "example": "Raftakn" + }, + "location": { + "type": "string", + "enum": [ + "entrance", + "exit" + ] + } + }, + "$id": "Camera" + } + }, + "$id": "Photo" + }, + "exitPhoto": { + "type": "object", + "required": [ + "id", + "capturedOn", + "plate", + "status", + "camera" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" + }, + "capturedOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE333" + }, + "score": { + "type": "integer" + }, + "url": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "new", + "need-review", + "force-review", + "reviewed", + "deleted", + "failed" + ] + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "camera": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" + }, + "name": { + "type": "string", + "example": "Entrance camera" + }, + "brand": { + "type": "string", + "example": "Raftakn" + }, + "location": { + "type": "string", + "enum": [ + "entrance", + "exit" + ] + } + }, + "$id": "Camera" + } + }, + "$id": "Photo" + }, + "invoice": { + "title": "Invoice object", + "type": "object", + "readOnly": true, + "required": [ + "id", + "status", + "language" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623" + }, + "status": { + "type": "string", + "enum": [ + "paid", + "refunded", + "incomplete", + "failed", + "draft" + ] + }, + "productId": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623", + "nullable": true + }, + "price": { + "type": "object", + "nullable": true, + "properties": { + "amount": { + "type": "number", + "example": 1250 + }, + "currency": { + "type": "string", + "maxLength": 3, + "minLength": 3, + "example": "ISK" + } + }, + "$id": "Money" + }, + "invoiceEmail": { + "type": "string", + "format": "email" + }, + "language": { + "type": "string", + "enum": [ + "is", + "en" + ] + }, + "receipt": { + "description": "Payment receipt", + "type": "object", + "readOnly": true, + "properties": { + "type": { + "type": "string", + "enum": [ + "visa", + "mastercard", + "amex", + "discover", + "other", + "electron", + "maestro" + ] + }, + "card": { + "type": "string", + "description": "Masked Card Number", + "example": "****-****-****-4444" + } + }, + "$id": "Receipt" + }, + "createdOn": { + "type": "string", + "format": "date-time" + } + }, + "$id": "Invoice" + } + } + }, + "VisitsResponse": { + "type": "object", + "readOnly": true, + "properties": { + "next": { + "type": "string", + "nullable": true + }, + "previous": { + "type": "string", + "nullable": true + }, + "total": { + "nullable": true, + "type": "integer" + }, + "extra": { + "nullable": true, + "type": "object" + }, + "visits": { + "type": "array", + "items": { + "title": "Visit", + "type": "object", + "required": [ + "id", + "startedOn", + "plate", + "status" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623" + }, + "startedOn": { + "type": "string", + "format": "date-time" + }, + "endedOn": { + "type": "string", + "format": "date-time" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE111" + }, + "status": { + "type": "string", + "enum": [ + "new", + "need-payment", + "need-plate", + "completed" + ] + }, + "paymentStatus": { + "type": "string", + "enum": [ + "whitelisted", + "kiosk", + "company-invoice", + "owner-invoice", + "failed", + "void" + ] + }, + "price": { + "type": "object", + "nullable": true, + "properties": { + "amount": { + "type": "number", + "example": 1250 + }, + "currency": { + "type": "string", + "maxLength": 3, + "minLength": 3, + "example": "ISK" + } + }, + "$id": "Money" + }, + "vehicle": { + "title": "Vehicle", + "type": "object", + "required": [ + "id", + "useGroup", + "vehicleCategory", + "registeredOn" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "deb4b244-945f-45c8-a67c-dc7939387ed6" + }, + "regno": { + "type": "string" + }, + "permno": { + "type": "string" + }, + "vin": { + "type": "string" + }, + "vehicleCategory": { + "type": "string" + }, + "vehicleGroup": { + "type": "string" + }, + "useGroup": { + "type": "string" + }, + "make": { + "type": "string", + "example": "Volvo" + }, + "model": { + "type": "string" + }, + "modelYear": { + "type": "string", + "example": "2019" + }, + "color": { + "type": "string", + "example": "blue" + }, + "massinro": { + "type": "string" + }, + "massladen": { + "type": "string" + }, + "taxGroup": { + "type": "string" + }, + "registeredOn": { + "type": "string", + "format": "date-time" + }, + "category": { + "type": "string", + "enum": [ + "light", + "heavy" + ] + }, + "country": { + "type": "string", + "description": "Country code", + "maxLength": 2, + "example": "is" + }, + "operator": { + "title": "Owner or Operator", + "type": "object", + "required": [ + "ssn", + "name" + ], + "properties": { + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "insuranceCode": { + "type": "string" + }, + "registrationDate": { + "type": "string", + "format": "date-time" + }, + "purchaseDate": { + "type": "string", + "format": "date-time" + } + }, + "$id": "VehicleOwner" + }, + "owner": { + "title": "Owner or Operator", + "type": "object", + "required": [ + "ssn", + "name" + ], + "properties": { + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "insuranceCode": { + "type": "string" + }, + "registrationDate": { + "type": "string", + "format": "date-time" + }, + "purchaseDate": { + "type": "string", + "format": "date-time" + } + }, + "$id": "VehicleOwner" + } + }, + "$id": "Vehicle" + }, + "customer": { + "title": "Customer", + "type": "object", + "required": [ + "id", + "language" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" + }, + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "email": { + "type": "string", + "format": "email", + "nullable": true + }, + "phone": { + "type": "string", + "nullable": true, + "example": "4648700" + }, + "language": { + "type": "string", + "maxLength": 2, + "minLength": 2, + "example": "is" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "options": { + "type": "object", + "properties": { + "sendInvoicesToEmail": { + "type": "boolean" + }, + "sendInvoicesToPublishingSystem": { + "type": "boolean" + }, + "billingMethod": { + "type": "string", + "enum": [ + "daily", + "monthly" + ] + }, + "billingSsn": { + "type": "string" + } + }, + "$id": "CustomerOption" + } + }, + "$id": "Customer" + }, + "entrancePhoto": { + "type": "object", + "required": [ + "id", + "capturedOn", + "plate", + "status", + "camera" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" + }, + "capturedOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE333" + }, + "score": { + "type": "integer" + }, + "url": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "new", + "need-review", + "force-review", + "reviewed", + "deleted", + "failed" + ] + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "camera": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" + }, + "name": { + "type": "string", + "example": "Entrance camera" + }, + "brand": { + "type": "string", + "example": "Raftakn" + }, + "location": { + "type": "string", + "enum": [ + "entrance", + "exit" + ] + } + }, + "$id": "Camera" + } + }, + "$id": "Photo" + }, + "exitPhoto": { + "type": "object", + "required": [ + "id", + "capturedOn", + "plate", + "status", + "camera" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" + }, + "capturedOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE333" + }, + "score": { + "type": "integer" + }, + "url": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "new", + "need-review", + "force-review", + "reviewed", + "deleted", + "failed" + ] + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "camera": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" + }, + "name": { + "type": "string", + "example": "Entrance camera" + }, + "brand": { + "type": "string", + "example": "Raftakn" + }, + "location": { + "type": "string", + "enum": [ + "entrance", + "exit" + ] + } + }, + "$id": "Camera" + } + }, + "$id": "Photo" + }, + "invoice": { + "title": "Invoice object", + "type": "object", + "readOnly": true, + "required": [ + "id", + "status", + "language" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623" + }, + "status": { + "type": "string", + "enum": [ + "paid", + "refunded", + "incomplete", + "failed", + "draft" + ] + }, + "productId": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623", + "nullable": true + }, + "price": { + "type": "object", + "nullable": true, + "properties": { + "amount": { + "type": "number", + "example": 1250 + }, + "currency": { + "type": "string", + "maxLength": 3, + "minLength": 3, + "example": "ISK" + } + }, + "$id": "Money" + }, + "invoiceEmail": { + "type": "string", + "format": "email" + }, + "language": { + "type": "string", + "enum": [ + "is", + "en" + ] + }, + "receipt": { + "description": "Payment receipt", + "type": "object", + "readOnly": true, + "properties": { + "type": { + "type": "string", + "enum": [ + "visa", + "mastercard", + "amex", + "discover", + "other", + "electron", + "maestro" + ] + }, + "card": { + "type": "string", + "description": "Masked Card Number", + "example": "****-****-****-4444" + } + }, + "$id": "Receipt" + }, + "createdOn": { + "type": "string", + "format": "date-time" + } + }, + "$id": "Invoice" + } + }, + "$id": "Visit" + } + } + } + }, + "Whitelist": { + "title": "Visit", + "type": "object", + "required": [ + "plate", + "reason" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623" + }, + "activeFrom": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "expireOn": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE111" + }, + "reason": { + "type": "string" + }, + "author": { + "type": "string", + "nullable": true + } + } + }, + "WhitelistBaseEntry": { + "title": "WhitelistBaseEntry", + "type": "object", + "required": [ + "plate", + "reason", + "objectType" + ], + "discriminator": { + "propertyName": "objectType" + }, + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623" + }, + "author": { + "type": "string", + "nullable": true, + "readOnly": true + }, + "plate": { + "type": "string", + "example": "ICE111" + }, + "activeFrom": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "expireOn": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "createdOn": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "reason": { + "type": "string" + }, + "objectType": { + "type": "string" + } + } + }, + "WhitelistEntries": { + "type": "object", + "readOnly": true, + "required": [ + "entries" + ], + "additionalProperties": false, + "properties": { + "next": { + "type": "string", + "nullable": true + }, + "previous": { + "type": "string", + "nullable": true + }, + "entries": { + "type": "array", + "nullable": false, + "items": { + "title": "WhitelistBaseEntry", + "type": "object", + "required": [ + "plate", + "reason", + "objectType" + ], + "discriminator": { + "propertyName": "objectType" + }, + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623" + }, + "author": { + "type": "string", + "nullable": true, + "readOnly": true + }, + "plate": { + "type": "string", + "example": "ICE111" + }, + "activeFrom": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "expireOn": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "createdOn": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "reason": { + "type": "string" + }, + "objectType": { + "type": "string" + } + }, + "$id": "WhitelistBaseEntry" + } + } + } + }, + "WhitelistResponse": { + "type": "object", + "readOnly": true, + "properties": { + "next": { + "type": "string", + "nullable": true + }, + "previous": { + "type": "string", + "nullable": true + }, + "whitelists": { + "type": "array", + "items": { + "title": "Visit", + "type": "object", + "required": [ + "plate", + "reason" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623" + }, + "activeFrom": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "expireOn": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE111" + }, + "reason": { + "type": "string" + }, + "author": { + "type": "string", + "nullable": true + } + }, + "$id": "Whitelist" + } + } + } + } + }, + "securitySchemes": { + "api-key": { + "name": "X-Api-Key", + "type": "apiKey", + "in": "header", + "description": "Key for none account related endpoints" + }, + "bearer-token": { + "type": "http", + "scheme": "bearer", + "description": "There are 3 types of bearer tokens. \n1. account specific\n2. role specific - used for webhooks and kiosks\n3. location specific - used when endpoints redirect" + }, + "hook-security": { + "name": "wak", + "type": "apiKey", + "in": "query", + "description": "Uses a bearer token that is valid for one endpoint only" + } + }, + "responses": { + "InternalError": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + } + }, + "NotFound": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + } + }, + "Unauthorized": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + } + }, + "Forbidden": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + }, + "$id": "Error" + } + } + } + }, + "InputError": { + "description": "Generic input error", + "content": { + "application/json": { + "schema": { + "title": "Exception handle by underlying system", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "exception": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "messages": { + "type": "string", + "nullable": true + } + }, + "$id": "ErrorException" + } + } + } + }, + "Redirect": { + "description": "Generic redirect response", + "headers": { + "Location": { + "description": "new location for resource", + "schema": { + "type": "string" + } + } + } + }, + "WebhookResponse": { + "description": "Generic redirect response", + "content": { + "*/*": { + "schema": { + "type": "object", + "properties": { + "acknowledge": { + "type": "boolean" + } + } + } + } + } + }, + "WrongEndpoint": { + "description": "Error that happens when creating already created data", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "messages": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid" + } + } + } + } + } + } + }, + "requestBodies": { + "CreateAccountPayload": { + "description": "Create account payload", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "account": { + "title": "Account", + "type": "object", + "required": [ + "id", + "role", + "status" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "role": { + "type": "string", + "enum": [ + "operator", + "customer", + "partner" + ] + }, + "name": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "active", + "inactive" + ] + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "options": { + "type": "object", + "properties": { + "free-parking-time": { + "type": "string" + }, + "expireTime": { + "type": "string", + "description": "Default expire time for whitelist entries.\nAccepts formats from https://www.php.net/manual/en/datetime.formats.php" + } + } + } + }, + "$id": "Account" + }, + "customer": { + "title": "Customer", + "type": "object", + "required": [ + "id", + "language" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" + }, + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "email": { + "type": "string", + "format": "email", + "nullable": true + }, + "phone": { + "type": "string", + "nullable": true, + "example": "4648700" + }, + "language": { + "type": "string", + "maxLength": 2, + "minLength": 2, + "example": "is" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "options": { + "type": "object", + "properties": { + "sendInvoicesToEmail": { + "type": "boolean" + }, + "sendInvoicesToPublishingSystem": { + "type": "boolean" + }, + "billingMethod": { + "type": "string", + "enum": [ + "daily", + "monthly" + ] + }, + "billingSsn": { + "type": "string" + } + }, + "$id": "CustomerOption" + } + }, + "$id": "Customer" + }, + "authentication": { + "type": "object", + "required": [ + "email", + "password" + ], + "properties": { + "email": { + "type": "string", + "format": "email" + }, + "password": { + "type": "string", + "format": "password" + }, + "expire": { + "type": "string", + "nullable": true, + "format": "date-time" + } + }, + "$id": "PasswordInfo" + } + }, + "required": [ + "account" + ] + } + } + } + }, + "CreateCustomerPayload": { + "description": "Create customer", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "account": { + "oneOf": [ + { + "title": "Account", + "type": "object", + "required": [ + "id", + "role", + "status" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "role": { + "type": "string", + "enum": [ + "operator", + "customer", + "partner" + ] + }, + "name": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "active", + "inactive" + ] + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "options": { + "type": "object", + "properties": { + "free-parking-time": { + "type": "string" + }, + "expireTime": { + "type": "string", + "description": "Default expire time for whitelist entries.\nAccepts formats from https://www.php.net/manual/en/datetime.formats.php" + } + } + } + }, + "$id": "Account" + }, + { + "x-required": "self", + "type": "string", + "format": "uuid", + "example": "040546c4-58bd-49cf-9741-6cb42daf6728", + "$id": "AccountId" + } + ] + }, + "customer": { + "title": "Customer", + "type": "object", + "required": [ + "id", + "language" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" + }, + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "email": { + "type": "string", + "format": "email", + "nullable": true + }, + "phone": { + "type": "string", + "nullable": true, + "example": "4648700" + }, + "language": { + "type": "string", + "maxLength": 2, + "minLength": 2, + "example": "is" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "options": { + "type": "object", + "properties": { + "sendInvoicesToEmail": { + "type": "boolean" + }, + "sendInvoicesToPublishingSystem": { + "type": "boolean" + }, + "billingMethod": { + "type": "string", + "enum": [ + "daily", + "monthly" + ] + }, + "billingSsn": { + "type": "string" + } + }, + "$id": "CustomerOption" + } + }, + "$id": "Customer" + } + }, + "required": [ + "account", + "customer" + ] + } + } + } + }, + "CreateRoleBearerToken": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "role": { + "type": "string", + "enum": [ + "webhook", + "kiosk", + "whitelist" + ] + } + } + } + } + } + }, + "PasswordLogin": { + "description": "Password based login payload", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "device_uuid": { + "type": "string", + "format": "uuid" + }, + "provider": { + "type": "string", + "enum": [ + "password", + "lost-password", + "change-password", + "token" + ] + }, + "id": { + "type": "string" + }, + "password": { + "type": "string", + "format": "password" + } + }, + "required": [ + "device_uuid", + "provider", + "id", + "password" + ] + } + } + } + }, + "PurchaseProduct": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "vehicle", + "customer", + "product", + "card" + ], + "properties": { + "vehicle": { + "type": "object", + "oneOf": [ + { + "required": [ + "plate" + ] + }, + { + "required": [ + "id" + ] + } + ], + "properties": { + "plate": { + "type": "string", + "example": "ICE222" + }, + "id": { + "description": "Id of vehicle know to us", + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623" + } + }, + "$id": "VehicleLookup" + }, + "customer": { + "anyOf": [ + { + "title": "SimpleCustomer", + "type": "object", + "required": [ + "name", + "language" + ], + "properties": { + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "email": { + "type": "string", + "format": "email", + "nullable": true + }, + "phone": { + "type": "string", + "nullable": true, + "example": "4648700" + }, + "language": { + "type": "string", + "maxLength": 2, + "minLength": 2, + "example": "is" + } + }, + "$id": "SimpleCustomer" + }, + { + "title": "Customer", + "type": "object", + "required": [ + "id", + "language" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" + }, + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "email": { + "type": "string", + "format": "email", + "nullable": true + }, + "phone": { + "type": "string", + "nullable": true, + "example": "4648700" + }, + "language": { + "type": "string", + "maxLength": 2, + "minLength": 2, + "example": "is" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "options": { + "type": "object", + "properties": { + "sendInvoicesToEmail": { + "type": "boolean" + }, + "sendInvoicesToPublishingSystem": { + "type": "boolean" + }, + "billingMethod": { + "type": "string", + "enum": [ + "daily", + "monthly" + ] + }, + "billingSsn": { + "type": "string" + } + }, + "$id": "CustomerOption" + } + }, + "$id": "Customer" + } + ] + }, + "product": { + "x-required": "self", + "type": "string", + "format": "uuid", + "example": "040546c4-58bd-49cf-9741-6cb42daf6728", + "$id": "ProductId" + }, + "card": { + "type": "object", + "required": [ + "number", + "expire" + ], + "properties": { + "number": { + "type": "string" + }, + "ccv": { + "type": "string" + }, + "expire": { + "type": "string", + "format": "date" + } + }, + "$id": "Card" + }, + "provider": { + "type": "string", + "enum": [ + "borgun", + "valitor-pay", + "testing", + "testing2" + ] + } + } + } + } + } + }, + "RegisterKioskPayment": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "plate", + "quantity", + "product", + "card", + "language" + ], + "properties": { + "plate": { + "type": "string", + "example": "ICE222" + }, + "quantity": { + "description": "The number of \"time units\". Each time unit is 24 hours in this case", + "type": "number", + "example": 1 + }, + "product": { + "anyOf": [ + { + "x-required": "self", + "type": "string", + "format": "uuid", + "example": "040546c4-58bd-49cf-9741-6cb42daf6728", + "$id": "ProductId" + }, + { + "x-required": "self", + "type": "string", + "$id": "ProductCode" + } + ] + }, + "card": { + "anyOf": [ + { + "description": "Simplified card information without ppi", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "visa", + "mastercard", + "amex", + "discover", + "other", + "electron", + "maestro" + ] + }, + "last_four": { + "type": "string", + "maxLength": 4, + "minLength": 4, + "example": "4444" + } + }, + "$id": "ReceiptCard" + }, + { + "type": "object", + "required": [ + "number", + "expire" + ], + "properties": { + "number": { + "type": "string" + }, + "ccv": { + "type": "string" + }, + "expire": { + "type": "string", + "format": "date" + } + }, + "$id": "Card" + } + ] + }, + "payment": { + "type": "object", + "nullable": true, + "required": [ + "amount", + "currency", + "transactionId", + "authorizationId" + ], + "properties": { + "amount": { + "type": "number", + "example": 1250 + }, + "currency": { + "type": "string", + "maxLength": 3, + "minLength": 3, + "example": "ISK" + }, + "transactionId": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + }, + "authorizationId": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + } + }, + "$id": "Payment" + }, + "language": { + "type": "string", + "enum": [ + "is", + "en" + ] + }, + "email": { + "description": "Email address for receipts. If specified the API should send a email with a receipt.", + "type": "string", + "nullable": true + } + } + } + } + } + }, + "TokenLogin": { + "description": "Change password login payload", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "device_uuid": { + "type": "string", + "format": "uuid" + }, + "provider": { + "type": "string", + "enum": [ + "lost-password", + "change-password", + "token" + ] + }, + "token": { + "type": "string" + } + }, + "required": [ + "device_uuid", + "provider", + "token" + ] + } + } + } + } + } + }, + "security": [ + { + "bearer-token": [] + } + ] +} diff --git a/tests/inlined-schemas/inline-nested-internal-refs/schema.json b/tests/inlined-schemas/inline-nested-internal-refs/schema.json new file mode 100644 index 0000000..c7589f0 --- /dev/null +++ b/tests/inlined-schemas/inline-nested-internal-refs/schema.json @@ -0,0 +1,3609 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "parking api", + "version": "1.0", + "contact": { + "name": "Stefna ehf", + "url": "https://stefna.is", + "email": "no-support@stefna.is" + } + }, + "servers": [ + { + "description": "production", + "url": "https://api.checkit.is" + }, + { + "description": "staging", + "url": "https://staging.api.checkit.is" + }, + { + "description": "development", + "url": "http://localhost:9988" + }, + { + "description": "testing", + "url": "http://localhost:9856" + } + ], + "tags": [ + { + "name": "Kiosk", + "description": "Endpoints that can be accessed from kiosks.\n\nKiosks must only use custom create Bearer tokens for authentication. And shall not contain the api key. " + }, + { + "name": "Visits" + }, + { + "name": "Products" + }, + { + "name": "Admin" + }, + { + "name": "Testing", + "description": "endpoints only available in development and testing" + }, + { + "name": "Webhook", + "description": "endpoints used by webhooks" + }, + { + "name": "Whitelist", + "description": "Endpoints related to whitelisting " + }, + { + "name": "Photo", + "description": "Endpoints related to photos " + }, + { + "name": "Account", + "description": "Endpoints related to accounts and customers " + } + ], + "paths": { + "/auth/login": { + "post": { + "tags": [ + "Admin" + ], + "summary": "Authenticate accounts", + "operationId": "createBearerToken", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticatedAccount" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + }, + "security": [ + { + "api-key": [] + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/PasswordLogin" + } + }, + "parameters": [] + }, + "/accounts": { + "post": { + "summary": "Create new account", + "operationId": "createAccount", + "tags": [ + "Account" + ], + "responses": { + "201": { + "description": "OK" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + }, + "requestBody": { + "$ref": "#/components/requestBodies/CreateAccountPayload" + } + }, + "get": { + "summary": "List accounts", + "operationId": "searchAccounts", + "tags": [ + "Account" + ], + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "next" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccountsResponse" + } + } + } + } + } + } + }, + "/account/{id}": { + "parameters": [ + { + "schema": { + "type": "string", + "format": "uuid" + }, + "name": "id", + "in": "path", + "required": true + } + ], + "get": { + "summary": "Retrieve single account", + "operationId": "getAccount", + "tags": [ + "Account" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Account" + } + } + } + }, + "400": { + "$ref": "#/components/responses/InputError" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + } + }, + "put": { + "summary": "Update account", + "operationId": "updateAccount", + "tags": [ + "Account" + ], + "responses": { + "200": { + "description": "Account updated" + }, + "303": { + "$ref": "#/components/responses/Redirect" + }, + "400": { + "$ref": "#/components/responses/InputError" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + }, + "requestBody": { + "required": true, + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Account" + } + } + } + } + }, + "delete": { + "summary": "Remove account", + "operationId": "deleteAccount", + "tags": [ + "Account" + ], + "responses": { + "204": { + "description": "ok" + }, + "400": { + "$ref": "#/components/responses/InputError" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + } + } + }, + "/account/{id}/logins": { + "parameters": [ + { + "schema": { + "type": "string", + "format": "uuid" + }, + "name": "id", + "in": "path", + "required": true + } + ], + "get": { + "summary": "Get login alternatives for account", + "operationId": "getAccountLogins", + "tags": [ + "Account" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AccountLogin" + } + } + } + } + } + } + }, + "post": { + "summary": "Create login credentials", + "operationId": "createAccountLogin", + "tags": [ + "Account" + ], + "responses": { + "201": { + "description": "Account login created" + }, + "303": { + "$ref": "#/components/responses/Redirect" + }, + "400": { + "$ref": "#/components/responses/InputError" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + }, + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/PasswordInfo" + } + } + } + } + }, + "delete": { + "summary": "Delete account login", + "operationId": "deleteAccountLogin", + "tags": [ + "Account" + ], + "parameters": [ + { + "schema": { + "type": "string", + "format": "email" + }, + "in": "query", + "name": "email", + "required": true + } + ], + "responses": { + "204": { + "description": "ok" + }, + "400": { + "$ref": "#/components/responses/InputError" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + } + } + }, + "/customers": { + "post": { + "summary": "Create customer", + "operationId": "createCustomer", + "tags": [ + "Account" + ], + "responses": { + "201": { + "description": "OK" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + }, + "requestBody": { + "$ref": "#/components/requestBodies/CreateCustomerPayload" + } + }, + "get": { + "summary": "Search customers", + "operationId": "searchCustomers", + "tags": [ + "Account" + ], + "parameters": [ + { + "schema": { + "type": "string", + "enum": [ + "latest", + "want-monthly-billing" + ] + }, + "in": "query", + "name": "collection", + "description": "Pre defined search collections" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "name", + "description": "Find by customer name supports wildcard" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "email", + "description": "Find by customer email supports wildcard" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "ssn", + "description": "Find by customer kennitala supports wildcard" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "next" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CustomersResponse" + } + } + } + } + } + } + }, + "/customer/{id}": { + "parameters": [ + { + "schema": { + "type": "string", + "format": "uuid" + }, + "name": "id", + "in": "path", + "required": true + } + ], + "get": { + "summary": "Retrieve single customer", + "operationId": "getCustomer", + "tags": [ + "Account" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Customer" + } + } + } + }, + "400": { + "$ref": "#/components/responses/InputError" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + } + }, + "put": { + "summary": "Update customer", + "operationId": "updateCustomer", + "tags": [ + "Account" + ], + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Customer" + } + } + } + }, + "responses": { + "301": { + "$ref": "#/components/responses/Redirect" + }, + "303": { + "$ref": "#/components/responses/Redirect" + }, + "400": { + "$ref": "#/components/responses/InputError" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + } + } + }, + "/visits": { + "get": { + "summary": "Search visits", + "operationId": "getVisits", + "tags": [ + "Visits" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VisitsResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/InputError" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + }, + "description": "List and filter visits\n\nIf bearer token does not belong to operator list will be filter on customerId", + "parameters": [ + { + "schema": { + "type": "string", + "enum": [ + "new", + "open", + "review", + "closed", + "need-payment" + ] + }, + "in": "query", + "name": "status", + "description": "Visit status" + }, + { + "schema": { + "type": "string", + "enum": [ + "latest", + "export", + "open", + "checkin", + "unpaid" + ] + }, + "in": "query", + "name": "collection", + "description": "Pre defined search collections" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "plate", + "description": "Find by licence plate supports wildcard" + }, + { + "schema": { + "type": "string", + "format": "date" + }, + "in": "query", + "name": "date", + "description": "Visits on this day" + }, + { + "schema": { + "type": "string", + "format": "date-time", + "example": "2020-07-23T07:12:52+02:00" + }, + "in": "query", + "name": "date.from" + }, + { + "schema": { + "type": "string", + "format": "date-time", + "example": "2020-07-23T07:12:52+02:00" + }, + "in": "query", + "name": "date.to" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "card.lastFour" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "next" + }, + { + "schema": { + "type": "string", + "enum": [ + "whitelisted", + "kiosk", + "company-invoice", + "owner-invoice", + "failed", + "void" + ] + }, + "in": "query", + "name": "payment.status", + "description": "Payment status" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "ssn", + "description": "Find by vehicle owner" + }, + { + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "price" + ] + }, + "uniqueItems": true + }, + "style": "form", + "explode": false, + "in": "query", + "name": "aggregate", + "description": "Find by vehicle owner" + } + ] + }, + "post": { + "summary": "Create visit", + "operationId": "createVisit", + "tags": [ + "Visits" + ], + "responses": { + "200": { + "description": "Visit created" + }, + "301": { + "$ref": "#/components/responses/Redirect" + }, + "303": { + "$ref": "#/components/responses/Redirect" + }, + "400": { + "$ref": "#/components/responses/InputError" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "422": { + "$ref": "#/components/responses/WrongEndpoint" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + }, + "requestBody": { + "required": true, + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Visit" + } + } + } + } + } + }, + "/visits/counts": { + "get": { + "summary": "Get visit counts", + "operationId": "countVisits", + "tags": [ + "Visits" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "count": { + "type": "integer" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/InputError" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + }, + "description": "List and filter visits\n\nIf bearer token does not belong to operator list will be filter on customerId", + "parameters": [ + { + "schema": { + "type": "string", + "enum": [ + "new", + "open", + "review", + "closed", + "need-payment" + ] + }, + "in": "query", + "name": "status", + "description": "Visit status" + }, + { + "schema": { + "type": "string", + "enum": [ + "latest", + "export", + "open", + "checkin" + ] + }, + "in": "query", + "name": "collection", + "description": "Pre defined search collections" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "plate", + "description": "Find by licence plate supports wildcard" + }, + { + "schema": { + "type": "string", + "format": "date" + }, + "in": "query", + "name": "date", + "description": "Visits on this day" + }, + { + "schema": { + "type": "string", + "format": "date-time", + "example": "2020-07-23T07:12:52+02:00" + }, + "in": "query", + "name": "date.from" + }, + { + "schema": { + "type": "string", + "format": "date-time", + "example": "2020-07-23T07:12:52+02:00" + }, + "in": "query", + "name": "date.to" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "card.lastFour" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "next" + }, + { + "schema": { + "type": "string", + "enum": [ + "whitelisted", + "kiosk", + "company-invoice", + "owner-invoice", + "failed", + "void" + ] + }, + "in": "query", + "name": "payment.status", + "description": "Payment status" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "ssn", + "description": "Find by vehicle owner" + } + ] + } + }, + "/visit/{id}": { + "parameters": [ + { + "schema": { + "type": "string", + "format": "uuid" + }, + "name": "id", + "in": "path", + "required": true + } + ], + "get": { + "operationId": "getVisit", + "summary": "Retrieve visit", + "description": "If bearer token does not belong to operator list will be filter on customerId", + "tags": [ + "Visits" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Visit" + } + } + } + }, + "400": { + "$ref": "#/components/responses/InputError" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + } + }, + "put": { + "operationId": "updateVisit", + "summary": "Update visit", + "tags": [ + "Visits" + ], + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Visit" + } + } + } + }, + "responses": { + "301": { + "$ref": "#/components/responses/Redirect" + }, + "303": { + "$ref": "#/components/responses/Redirect" + }, + "400": { + "$ref": "#/components/responses/InputError" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + } + } + }, + "/visit/{id}/renewVehicle": { + "post": { + "operationId": "renewVisitVehicleInformation", + "description": "Query IVR for new vehicle information", + "responses": { + "200": { + "description": "OK" + }, + "400": { + "$ref": "#/components/responses/InputError" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + } + }, + "parameters": [ + { + "schema": { + "type": "string", + "format": "uuid" + }, + "name": "id", + "in": "path", + "required": true + } + ] + }, + "/visit/{id}/receipt": { + "parameters": [ + { + "schema": { + "type": "string", + "format": "uuid" + }, + "name": "id", + "in": "path", + "required": true + } + ], + "post": { + "operationId": "sendVisitReceipt", + "summary": "Send receipt to email", + "requestBody": { + "description": "Send receipt body", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "format": "email" + }, + "language": { + "type": "string", + "enum": [ + "is", + "en" + ] + } + }, + "required": [ + "email", + "language" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK" + }, + "400": { + "$ref": "#/components/responses/InputError" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + } + } + }, + "/invoice/{id}": { + "parameters": [ + { + "schema": { + "type": "string", + "format": "uuid" + }, + "name": "id", + "in": "path", + "required": true + } + ], + "get": { + "operationId": "getInvoice", + "summary": "Retrieve invoice", + "description": "If bearer token does not belong to operator list will be filter on customerId", + "tags": [ + "Visits" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Invoice" + } + } + } + }, + "400": { + "$ref": "#/components/responses/InputError" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + } + } + }, + "/products": { + "get": { + "summary": "Get all products", + "operationId": "searchProducts", + "tags": [ + "Kiosk", + "Products" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Product" + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/InputError" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + }, + "security": [ + { + "bearer-token": [] + }, + { + "api-key": [] + } + ] + } + }, + "/admin/create-role-bearer-token": { + "post": { + "summary": "Create role based bearer token", + "operationId": "createRoleBearerToken", + "requestBody": { + "$ref": "#/components/requestBodies/CreateRoleBearerToken" + }, + "tags": [ + "Admin" + ], + "responses": { + "200": { + "description": "Create new bearer token", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "access_token": { + "type": "string" + } + } + } + } + } + } + }, + "security": [ + { + "api-key": [] + } + ] + } + }, + "/kiosk/register-payment": { + "post": { + "tags": [ + "Kiosk" + ], + "summary": "Register payments for Kiosks", + "operationId": "registerKioskPayment", + "requestBody": { + "$ref": "#/components/requestBodies/RegisterKioskPayment" + }, + "responses": { + "200": { + "description": "Payment registered", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvoiceId" + } + } + } + }, + "400": { + "$ref": "#/components/responses/InputError" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + } + } + }, + "/kiosk/search-visits": { + "get": { + "summary": "Search visits", + "operationId": "kioskSearchVisits", + "tags": [ + "Kiosk" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VisitsResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/InputError" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "plate", + "description": "Find by licence plate supports wildcard" + } + ] + } + }, + "/purchase-product": { + "post": { + "tags": [ + "Kiosk" + ], + "summary": "Purchase a product", + "operationId": "purchaseProduct", + "requestBody": { + "$ref": "#/components/requestBodies/PurchaseProduct" + }, + "responses": { + "200": { + "description": "Payment registered", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/PaymentFormResponse" + }, + { + "$ref": "#/components/schemas/InvoiceId" + } + ] + } + } + } + }, + "400": { + "$ref": "#/components/responses/InputError" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + }, + "security": [ + { + "bearer-token": [] + }, + { + "api-key": [] + } + ] + } + }, + "/ping/bearer": { + "get": { + "tags": [ + "Testing" + ], + "operationId": "testBearerToken", + "responses": { + "200": { + "description": "OK" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + } + } + }, + "/ping/redirect": { + "post": { + "tags": [ + "Testing" + ], + "operationId": "testTokenRedirect", + "responses": { + "201": { + "description": "OK" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + }, + "get": { + "tags": [ + "Testing" + ], + "operationId": "testTacToken", + "responses": { + "200": { + "description": "OK" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + } + }, + "/ping/key": { + "get": { + "operationId": "testApiKey", + "tags": [ + "Testing" + ], + "responses": { + "200": { + "description": "OK" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + }, + "security": [ + { + "api-key": [] + } + ] + } + }, + "/ping/webhook": { + "post": { + "operationId": "testHookAccess", + "tags": [ + "Testing" + ], + "responses": { + "200": { + "description": "OK" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + }, + "security": [ + { + "hook-security": [], + "bearer-token": [] + } + ] + } + }, + "/ping/kiosk": { + "post": { + "operationId": "testKioskAccess", + "tags": [ + "Testing" + ], + "responses": { + "200": { + "description": "OK" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + }, + "security": [ + { + "bearer-token": [] + } + ] + } + }, + "/ping/whitelist": { + "post": { + "operationId": "testWhitelistAccess", + "tags": [ + "Testing" + ], + "responses": { + "200": { + "description": "OK" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + }, + "security": [ + { + "bearer-token": [] + } + ] + } + }, + "/photos/{type}": { + "parameters": [ + { + "schema": { + "type": "string", + "enum": [ + "open-alpr", + "open-alpr-test" + ] + }, + "name": "type", + "in": "path", + "required": true + } + ], + "post": { + "operationId": "importPhoto", + "summary": "Ingest new photo into system", + "requestBody": { + "content": { + "*/*": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenALPR" + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK" + }, + "400": { + "$ref": "#/components/responses/InputError" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + }, + "security": [ + { + "hook-security": [] + }, + { + "bearer-token": [] + } + ] + } + }, + "/photos": { + "get": { + "summary": "Search photos", + "operationId": "searchPhotos", + "tags": [ + "Photo" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PhotoResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/InputError" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + }, + "parameters": [ + { + "schema": { + "type": "string", + "enum": [ + "need-review" + ] + }, + "in": "query", + "name": "collection", + "description": "Pre defined search collections" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "plate", + "description": "Find by licence plate supports wildcard" + }, + { + "schema": { + "type": "string", + "format": "date", + "example": "2020-07-23" + }, + "in": "query", + "name": "date", + "description": "Photo captured on date" + }, + { + "schema": { + "type": "string", + "format": "date-time", + "example": "2020-07-23T07:12:52+02:00" + }, + "in": "query", + "name": "date.from" + }, + { + "schema": { + "type": "string", + "format": "date-time", + "example": "2020-07-23T07:12:52+02:00" + }, + "in": "query", + "name": "date.to" + }, + { + "schema": { + "type": "string", + "format": "uuid" + }, + "in": "query", + "name": "camera.id" + }, + { + "schema": { + "type": "string", + "enum": [ + "entrance", + "exit" + ] + }, + "in": "query", + "name": "camera.location" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "next" + } + ] + } + }, + "/photo/{id}": { + "parameters": [ + { + "schema": { + "type": "string", + "format": "uuid" + }, + "name": "id", + "in": "path", + "required": true + } + ], + "get": { + "summary": "View photo", + "operationId": "getPhoto", + "tags": [ + "Photo" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Photo" + } + } + } + }, + "400": { + "$ref": "#/components/responses/InputError" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + } + }, + "put": { + "summary": "Update photo", + "operationId": "updatePhoto", + "tags": [ + "Photo" + ], + "responses": { + "200": { + "description": "Photo updated" + }, + "303": { + "$ref": "#/components/responses/Redirect" + }, + "400": { + "$ref": "#/components/responses/InputError" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + }, + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Photo" + } + } + } + } + }, + "delete": { + "summary": "Remove photo", + "operationId": "deletePhoto", + "tags": [ + "Photo" + ], + "responses": { + "204": { + "description": "ok" + }, + "400": { + "$ref": "#/components/responses/InputError" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + } + } + }, + "/whitelist": { + "get": { + "summary": "List whitelisted vehicles", + "operationId": "getWhitelistedVehicles", + "tags": [ + "Whitelist" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WhitelistResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/InputError" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + }, + "parameters": [ + { + "schema": { + "type": "string", + "enum": [ + "app", + "cpanel" + ] + }, + "in": "query", + "name": "collection", + "description": "Pre defined search collections" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "plate", + "description": "Find by licence plate supports wildcard" + }, + { + "schema": { + "type": "string", + "enum": [ + "on", + "off", + "1", + "0", + "true", + "false" + ] + }, + "in": "query", + "name": "active", + "description": "Active whitelisted plates" + }, + { + "schema": { + "type": "string", + "format": "date", + "example": "2020-07-23" + }, + "in": "query", + "name": "expire", + "description": "Plates expiring on day" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "next" + } + ] + }, + "post": { + "summary": "Add new plate to whitelist", + "operationId": "addWhitelistPlate", + "responses": { + "200": { + "description": "Plate added" + }, + "301": { + "$ref": "#/components/responses/Redirect" + }, + "303": { + "$ref": "#/components/responses/Redirect" + }, + "400": { + "$ref": "#/components/responses/InputError" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "422": { + "$ref": "#/components/responses/WrongEndpoint" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + }, + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Whitelist" + } + } + } + } + } + }, + "/whitelist/{id}": { + "parameters": [ + { + "schema": { + "type": "string", + "format": "uuid" + }, + "name": "id", + "in": "path", + "required": true + } + ], + "get": { + "summary": "View whitelist entry", + "operationId": "getWhitelistEntry", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Whitelist" + } + } + } + }, + "400": { + "$ref": "#/components/responses/InputError" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + } + }, + "put": { + "deprecated": true, + "summary": "Update whitelist entry", + "operationId": "updateWhitelistEntry", + "responses": { + "200": { + "description": "Entry updated" + }, + "303": { + "$ref": "#/components/responses/Redirect" + }, + "400": { + "$ref": "#/components/responses/InputError" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + }, + "requestBody": { + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Whitelist" + } + } + } + } + }, + "delete": { + "deprecated": true, + "summary": "Remove whitelist entry", + "operationId": "deleteWhitelistEntry", + "responses": { + "204": { + "description": "ok" + }, + "400": { + "$ref": "#/components/responses/InputError" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + } + } + } + }, + "components": { + "schemas": { + "Account": { + "title": "Account", + "type": "object", + "required": [ + "id", + "role", + "status" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "role": { + "type": "string", + "enum": [ + "operator", + "customer", + "partner" + ] + }, + "name": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "active", + "inactive" + ] + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "options": { + "type": "object", + "properties": { + "free-parking-time": { + "type": "string" + }, + "expireTime": { + "type": "string", + "description": "Default expire time for whitelist entries.\nAccepts formats from https://www.php.net/manual/en/datetime.formats.php" + } + } + } + } + }, + "AccountId": { + "x-required": "self", + "type": "string", + "format": "uuid", + "example": "040546c4-58bd-49cf-9741-6cb42daf6728" + }, + "AccountLogin": { + "title": "AccountLogin", + "type": "object", + "required": [ + "email" + ], + "properties": { + "accountId": { + "type": "string", + "format": "uuid" + }, + "email": { + "type": "string", + "format": "email" + }, + "expire": { + "type": "string", + "nullable": true, + "format": "date-time" + } + } + }, + "AccountsResponse": { + "type": "object", + "readOnly": true, + "properties": { + "next": { + "type": "string", + "nullable": true + }, + "previous": { + "type": "string", + "nullable": true + }, + "accounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Account" + } + } + } + }, + "AuthenticatedAccount": { + "title": "Wrapper around account and bearer token", + "type": "object", + "required": [ + "access_token", + "account" + ], + "properties": { + "access_token": { + "type": "string" + }, + "account": { + "$ref": "#/components/schemas/Account" + } + } + }, + "Camera": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" + }, + "name": { + "type": "string", + "example": "Entrance camera" + }, + "brand": { + "type": "string", + "example": "Raftakn" + }, + "location": { + "type": "string", + "enum": [ + "entrance", + "exit" + ] + } + } + }, + "Card": { + "type": "object", + "required": [ + "number", + "expire" + ], + "properties": { + "number": { + "type": "string" + }, + "ccv": { + "type": "string" + }, + "expire": { + "type": "string", + "format": "date" + } + } + }, + "Customer": { + "title": "Customer", + "type": "object", + "required": [ + "id", + "language" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" + }, + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "email": { + "type": "string", + "format": "email", + "nullable": true + }, + "phone": { + "type": "string", + "nullable": true, + "example": "4648700" + }, + "language": { + "type": "string", + "maxLength": 2, + "minLength": 2, + "example": "is" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "options": { + "$ref": "#/components/schemas/CustomerOption" + } + } + }, + "CustomerOption": { + "type": "object", + "properties": { + "sendInvoicesToEmail": { + "type": "boolean" + }, + "sendInvoicesToPublishingSystem": { + "type": "boolean" + }, + "billingMethod": { + "type": "string", + "enum": [ + "daily", + "monthly" + ] + }, + "billingSsn": { + "type": "string" + } + } + }, + "CustomersResponse": { + "type": "object", + "readOnly": true, + "properties": { + "next": { + "type": "string", + "nullable": true + }, + "previous": { + "type": "string", + "nullable": true + }, + "customers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Customer" + } + } + } + }, + "Error": { + "title": "Generic Error Object", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "string" + } + } + }, + "ErrorException": { + "title": "Exception handle by underlying system", + "type": "object", + "required": [ + "messages" + ], + "properties": { + "exception": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "messages": { + "type": "string", + "nullable": true + } + } + }, + "Invoice": { + "title": "Invoice object", + "type": "object", + "readOnly": true, + "required": [ + "id", + "status", + "language" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623" + }, + "status": { + "type": "string", + "enum": [ + "paid", + "refunded", + "incomplete", + "failed", + "draft" + ] + }, + "productId": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623", + "nullable": true + }, + "price": { + "$ref": "#/components/schemas/Money" + }, + "invoiceEmail": { + "type": "string", + "format": "email" + }, + "language": { + "type": "string", + "enum": [ + "is", + "en" + ] + }, + "receipt": { + "$ref": "#/components/schemas/Receipt" + }, + "createdOn": { + "type": "string", + "format": "date-time" + } + } + }, + "InvoiceId": { + "x-required": "self", + "type": "string", + "format": "uuid", + "example": "040546c4-58bd-49cf-9741-6cb42daf6728" + }, + "Money": { + "type": "object", + "nullable": true, + "properties": { + "amount": { + "type": "number", + "example": 1250 + }, + "currency": { + "type": "string", + "maxLength": 3, + "minLength": 3, + "example": "ISK" + } + } + }, + "OpenALPR": { + "type": "object", + "properties": { + "epoch_start": { + "description": "Capture date", + "type": "integer" + }, + "camera_id": { + "description": "Numeric id of camera", + "type": "integer" + }, + "agent_uid": { + "type": "string" + }, + "best_uuid": { + "description": "Unique id of best match", + "type": "string" + }, + "best_plate_number": { + "description": "Best guess for license plate", + "type": "string" + }, + "best_confidence": { + "description": "Ocr score", + "type": "number" + }, + "best_region": { + "description": "Guess for the license plate region", + "type": "string" + }, + "best_region_confidence": { + "type": "number" + }, + "company_id": { + "type": "string", + "format": "uuid" + }, + "version": { + "type": "integer" + }, + "vehicle_crop_jpeg": { + "description": "Base64 encoded jpeg preview for the photo", + "type": "string" + }, + "is_parked": { + "type": "boolean" + }, + "vehicle": { + "type": "object", + "properties": { + "color": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "confidence": { + "type": "number" + } + } + } + }, + "make": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "confidence": { + "type": "number" + } + } + } + }, + "body": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "confidence": { + "type": "number" + } + } + } + } + } + } + } + }, + "PasswordInfo": { + "type": "object", + "required": [ + "email", + "password" + ], + "properties": { + "email": { + "type": "string", + "format": "email" + }, + "password": { + "type": "string", + "format": "password" + }, + "expire": { + "type": "string", + "nullable": true, + "format": "date-time" + } + } + }, + "Payment": { + "type": "object", + "nullable": true, + "required": [ + "amount", + "currency", + "transactionId", + "authorizationId" + ], + "properties": { + "amount": { + "type": "number", + "example": 1250 + }, + "currency": { + "type": "string", + "maxLength": 3, + "minLength": 3, + "example": "ISK" + }, + "transactionId": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + }, + "authorizationId": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + } + } + }, + "PaymentFormResponse": { + "type": "object", + "readOnly": true, + "required": [ + "invoiceId", + "form" + ], + "properties": { + "invoiceId": { + "$ref": "#/components/schemas/InvoiceId" + }, + "form": { + "type": "object", + "required": [ + "html", + "fields", + "url" + ], + "properties": { + "html": { + "type": "string" + }, + "fields": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "url": { + "type": "string" + } + } + } + } + }, + "Photo": { + "type": "object", + "required": [ + "id", + "capturedOn", + "plate", + "status", + "camera" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" + }, + "capturedOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE333" + }, + "score": { + "type": "integer" + }, + "url": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "new", + "need-review", + "force-review", + "reviewed", + "deleted", + "failed" + ] + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "camera": { + "$ref": "#/components/schemas/Camera" + } + } + }, + "PhotoResponse": { + "type": "object", + "readOnly": true, + "properties": { + "next": { + "type": "string", + "nullable": true + }, + "previous": { + "type": "string", + "nullable": true + }, + "photos": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Photo" + } + } + } + }, + "Product": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "aec5c6f3-130c-4928-8ffa-470918d94cc9" + }, + "type": { + "type": "string", + "enum": [ + "default", + "visit" + ], + "example": "visit" + }, + "price": { + "$ref": "#/components/schemas/Money" + }, + "currency": { + "type": "string", + "maxLength": 3, + "minLength": 3, + "example": "ISK" + }, + "vehicleCategory": { + "type": "string", + "enum": [ + "light", + "heavy" + ] + }, + "category": { + "type": "string" + }, + "name": { + "type": "object", + "example": { + "en": "Name in english", + "is": "Name in icelandic" + }, + "additionalProperties": { + "type": "string" + } + } + } + }, + "ProductCode": { + "x-required": "self", + "type": "string" + }, + "ProductId": { + "x-required": "self", + "type": "string", + "format": "uuid", + "example": "040546c4-58bd-49cf-9741-6cb42daf6728" + }, + "Receipt": { + "description": "Payment receipt", + "type": "object", + "readOnly": true, + "properties": { + "type": { + "type": "string", + "enum": [ + "visa", + "mastercard", + "amex", + "discover", + "other", + "electron", + "maestro" + ] + }, + "card": { + "type": "string", + "description": "Masked Card Number", + "example": "****-****-****-4444" + } + } + }, + "ReceiptCard": { + "description": "Simplified card information without ppi", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "visa", + "mastercard", + "amex", + "discover", + "other", + "electron", + "maestro" + ] + }, + "last_four": { + "type": "string", + "maxLength": 4, + "minLength": 4, + "example": "4444" + } + } + }, + "SimpleCustomer": { + "title": "SimpleCustomer", + "type": "object", + "required": [ + "name", + "language" + ], + "properties": { + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "email": { + "type": "string", + "format": "email", + "nullable": true + }, + "phone": { + "type": "string", + "nullable": true, + "example": "4648700" + }, + "language": { + "type": "string", + "maxLength": 2, + "minLength": 2, + "example": "is" + } + } + }, + "Vehicle": { + "title": "Vehicle", + "type": "object", + "required": [ + "id", + "useGroup", + "vehicleCategory", + "registeredOn" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "deb4b244-945f-45c8-a67c-dc7939387ed6" + }, + "regno": { + "type": "string" + }, + "permno": { + "type": "string" + }, + "vin": { + "type": "string" + }, + "vehicleCategory": { + "type": "string" + }, + "vehicleGroup": { + "type": "string" + }, + "useGroup": { + "type": "string" + }, + "make": { + "type": "string", + "example": "Volvo" + }, + "model": { + "type": "string" + }, + "modelYear": { + "type": "string", + "example": "2019" + }, + "color": { + "type": "string", + "example": "blue" + }, + "massinro": { + "type": "string" + }, + "massladen": { + "type": "string" + }, + "taxGroup": { + "type": "string" + }, + "registeredOn": { + "type": "string", + "format": "date-time" + }, + "category": { + "type": "string", + "enum": [ + "light", + "heavy" + ] + }, + "country": { + "type": "string", + "description": "Country code", + "maxLength": 2, + "example": "is" + }, + "operator": { + "$ref": "#/components/schemas/VehicleOwner" + }, + "owner": { + "$ref": "#/components/schemas/VehicleOwner" + } + } + }, + "VehicleLookup": { + "type": "object", + "oneOf": [ + { + "required": [ + "plate" + ] + }, + { + "required": [ + "id" + ] + } + ], + "properties": { + "plate": { + "type": "string", + "example": "ICE222" + }, + "id": { + "description": "Id of vehicle know to us", + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623" + } + } + }, + "VehicleOwner": { + "title": "Owner or Operator", + "type": "object", + "required": [ + "ssn", + "name" + ], + "properties": { + "ssn": { + "type": "string", + "nullable": true, + "description": "Kennitala for icelandic people", + "example": "1122334455" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "insuranceCode": { + "type": "string" + }, + "registrationDate": { + "type": "string", + "format": "date-time" + }, + "purchaseDate": { + "type": "string", + "format": "date-time" + } + } + }, + "Visit": { + "title": "Visit", + "type": "object", + "required": [ + "id", + "startedOn", + "plate", + "status" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623" + }, + "startedOn": { + "type": "string", + "format": "date-time" + }, + "endedOn": { + "type": "string", + "format": "date-time" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE111" + }, + "status": { + "type": "string", + "enum": [ + "new", + "need-payment", + "need-plate", + "completed" + ] + }, + "paymentStatus": { + "type": "string", + "enum": [ + "whitelisted", + "kiosk", + "company-invoice", + "owner-invoice", + "failed", + "void" + ] + }, + "price": { + "$ref": "#/components/schemas/Money" + }, + "vehicle": { + "$ref": "#/components/schemas/Vehicle" + }, + "customer": { + "$ref": "#/components/schemas/Customer" + }, + "entrancePhoto": { + "$ref": "#/components/schemas/Photo" + }, + "exitPhoto": { + "$ref": "#/components/schemas/Photo" + }, + "invoice": { + "$ref": "#/components/schemas/Invoice" + } + } + }, + "VisitsResponse": { + "type": "object", + "readOnly": true, + "properties": { + "next": { + "type": "string", + "nullable": true + }, + "previous": { + "type": "string", + "nullable": true + }, + "total": { + "nullable": true, + "type": "integer" + }, + "extra": { + "nullable": true, + "type": "object" + }, + "visits": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Visit" + } + } + } + }, + "Whitelist": { + "title": "Visit", + "type": "object", + "required": [ + "plate", + "reason" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623" + }, + "activeFrom": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "expireOn": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "plate": { + "type": "string", + "example": "ICE111" + }, + "reason": { + "type": "string" + }, + "author": { + "type": "string", + "nullable": true + } + } + }, + "WhitelistBaseEntry": { + "title": "WhitelistBaseEntry", + "type": "object", + "required": [ + "plate", + "reason", + "objectType" + ], + "discriminator": { + "propertyName": "objectType" + }, + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "985c1032-e079-4597-b1c6-ac2223036623" + }, + "author": { + "type": "string", + "nullable": true, + "readOnly": true + }, + "plate": { + "type": "string", + "example": "ICE111" + }, + "activeFrom": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "expireOn": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "createdOn": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "reason": { + "type": "string" + }, + "objectType": { + "type": "string" + } + } + }, + "WhitelistEntries": { + "type": "object", + "readOnly": true, + "required": [ + "entries" + ], + "additionalProperties": false, + "properties": { + "next": { + "type": "string", + "nullable": true + }, + "previous": { + "type": "string", + "nullable": true + }, + "entries": { + "type": "array", + "nullable": false, + "items": { + "$ref": "#/components/schemas/WhitelistBaseEntry" + } + } + } + }, + "WhitelistResponse": { + "type": "object", + "readOnly": true, + "properties": { + "next": { + "type": "string", + "nullable": true + }, + "previous": { + "type": "string", + "nullable": true + }, + "whitelists": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Whitelist" + } + } + } + } + }, + "securitySchemes": { + "api-key": { + "name": "X-Api-Key", + "type": "apiKey", + "in": "header", + "description": "Key for none account related endpoints" + }, + "bearer-token": { + "type": "http", + "scheme": "bearer", + "description": "There are 3 types of bearer tokens. \n1. account specific\n2. role specific - used for webhooks and kiosks\n3. location specific - used when endpoints redirect" + }, + "hook-security": { + "name": "wak", + "type": "apiKey", + "in": "query", + "description": "Uses a bearer token that is valid for one endpoint only" + } + }, + "responses": { + "InternalError": { + "description": "Unknown internal error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "NotFound": { + "description": "Requested resource not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "Unauthorized": { + "description": "Need to authenticate to access resource", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "Forbidden": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "InputError": { + "description": "Generic input error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorException" + } + } + } + }, + "Redirect": { + "description": "Generic redirect response", + "headers": { + "Location": { + "description": "new location for resource", + "schema": { + "type": "string" + } + } + } + }, + "WebhookResponse": { + "description": "Generic redirect response", + "content": { + "*/*": { + "schema": { + "type": "object", + "properties": { + "acknowledge": { + "type": "boolean" + } + } + } + } + } + }, + "WrongEndpoint": { + "description": "Error that happens when creating already created data", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "messages": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid" + } + } + } + } + } + } + }, + "requestBodies": { + "CreateAccountPayload": { + "description": "Create account payload", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "account": { + "$ref": "#/components/schemas/Account" + }, + "customer": { + "$ref": "#/components/schemas/Customer" + }, + "authentication": { + "$ref": "#/components/schemas/PasswordInfo" + } + }, + "required": [ + "account" + ] + } + } + } + }, + "CreateCustomerPayload": { + "description": "Create customer", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "account": { + "oneOf": [ + { + "$ref": "#/components/schemas/Account" + }, + { + "$ref": "#/components/schemas/AccountId" + } + ] + }, + "customer": { + "$ref": "#/components/schemas/Customer" + } + }, + "required": [ + "account", + "customer" + ] + } + } + } + }, + "CreateRoleBearerToken": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "role": { + "type": "string", + "enum": [ + "webhook", + "kiosk", + "whitelist" + ] + } + } + } + } + } + }, + "PasswordLogin": { + "description": "Password based login payload", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "device_uuid": { + "type": "string", + "format": "uuid" + }, + "provider": { + "type": "string", + "enum": [ + "password", + "lost-password", + "change-password", + "token" + ] + }, + "id": { + "type": "string" + }, + "password": { + "type": "string", + "format": "password" + } + }, + "required": [ + "device_uuid", + "provider", + "id", + "password" + ] + } + } + } + }, + "PurchaseProduct": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "vehicle", + "customer", + "product", + "card" + ], + "properties": { + "vehicle": { + "$ref": "#/components/schemas/VehicleLookup" + }, + "customer": { + "anyOf": [ + { + "$ref": "#/components/schemas/SimpleCustomer" + }, + { + "$ref": "#/components/schemas/Customer" + } + ] + }, + "product": { + "$ref": "#/components/schemas/ProductId" + }, + "card": { + "$ref": "#/components/schemas/Card" + }, + "provider": { + "type": "string", + "enum": [ + "borgun", + "valitor-pay", + "testing", + "testing2" + ] + } + } + } + } + } + }, + "RegisterKioskPayment": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "plate", + "quantity", + "product", + "card", + "language" + ], + "properties": { + "plate": { + "type": "string", + "example": "ICE222" + }, + "quantity": { + "description": "The number of \"time units\". Each time unit is 24 hours in this case", + "type": "number", + "example": 1 + }, + "product": { + "anyOf": [ + { + "$ref": "#/components/schemas/ProductId" + }, + { + "$ref": "#/components/schemas/ProductCode" + } + ] + }, + "card": { + "anyOf": [ + { + "$ref": "#/components/schemas/ReceiptCard" + }, + { + "$ref": "#/components/schemas/Card" + } + ] + }, + "payment": { + "$ref": "#/components/schemas/Payment" + }, + "language": { + "type": "string", + "enum": [ + "is", + "en" + ] + }, + "email": { + "description": "Email address for receipts. If specified the API should send a email with a receipt.", + "type": "string", + "nullable": true + } + } + } + } + } + }, + "TokenLogin": { + "description": "Change password login payload", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "device_uuid": { + "type": "string", + "format": "uuid" + }, + "provider": { + "type": "string", + "enum": [ + "lost-password", + "change-password", + "token" + ] + }, + "token": { + "type": "string" + } + }, + "required": [ + "device_uuid", + "provider", + "token" + ] + } + } + } + } + } + }, + "security": [ + { + "bearer-token": [] + } + ] +} \ No newline at end of file From 8e9a5b0e60e16cb5170fc365aab7542917b6a4b0 Mon Sep 17 00:00:00 2001 From: Runar Sverrisson Date: Thu, 28 May 2026 09:38:53 +0000 Subject: [PATCH 2/4] Simplify test Original schema comes from checkit, remove all the additional fluff that has nothing to do with the issue. --- .../schema.dist.json | 13708 +--------------- .../inline-nested-internal-refs/schema.json | 3585 +--- 2 files changed, 95 insertions(+), 17198 deletions(-) diff --git a/tests/inlined-schemas/inline-nested-internal-refs/schema.dist.json b/tests/inlined-schemas/inline-nested-internal-refs/schema.dist.json index ce81858..55b3510 100644 --- a/tests/inlined-schemas/inline-nested-internal-refs/schema.dist.json +++ b/tests/inlined-schemas/inline-nested-internal-refs/schema.dist.json @@ -9,486 +9,43 @@ "email": "no-support@stefna.is" } }, - "servers": [ - { - "description": "production", - "url": "https://api.checkit.is" - }, - { - "description": "staging", - "url": "https://staging.api.checkit.is" - }, - { - "description": "development", - "url": "http://localhost:9988" - }, - { - "description": "testing", - "url": "http://localhost:9856" - } - ], - "tags": [ - { - "name": "Kiosk", - "description": "Endpoints that can be accessed from kiosks.\n\nKiosks must only use custom create Bearer tokens for authentication. And shall not contain the api key. " - }, - { - "name": "Visits" - }, - { - "name": "Products" - }, - { - "name": "Admin" - }, - { - "name": "Testing", - "description": "endpoints only available in development and testing" - }, - { - "name": "Webhook", - "description": "endpoints used by webhooks" - }, - { - "name": "Whitelist", - "description": "Endpoints related to whitelisting " - }, - { - "name": "Photo", - "description": "Endpoints related to photos " - }, - { - "name": "Account", - "description": "Endpoints related to accounts and customers " - } - ], "paths": { - "/auth/login": { - "post": { - "tags": [ - "Admin" - ], - "summary": "Authenticate accounts", - "operationId": "createBearerToken", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "title": "Wrapper around account and bearer token", - "type": "object", - "required": [ - "access_token", - "account" - ], - "properties": { - "access_token": { - "type": "string" - }, - "account": { - "title": "Account", - "type": "object", - "required": [ - "id", - "role", - "status" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "role": { - "type": "string", - "enum": [ - "operator", - "customer", - "partner" - ] - }, - "name": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "active", - "inactive" - ] - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "options": { - "type": "object", - "properties": { - "free-parking-time": { - "type": "string" - }, - "expireTime": { - "type": "string", - "description": "Default expire time for whitelist entries.\nAccepts formats from https://www.php.net/manual/en/datetime.formats.php" - } - } - } - }, - "$id": "Account" - } - }, - "$id": "AuthenticatedAccount" - } - } - } - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - }, - "500": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "InternalError" - } - }, - "security": [ - { - "api-key": [] - } - ], - "requestBody": { - "description": "Password based login payload", - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "device_uuid": { - "type": "string", - "format": "uuid" - }, - "provider": { - "type": "string", - "enum": [ - "password", - "lost-password", - "change-password", - "token" - ] - }, - "id": { - "type": "string" - }, - "password": { - "type": "string", - "format": "password" - } - }, - "required": [ - "device_uuid", - "provider", - "id", - "password" - ] - } - } - }, - "$id": "PasswordLogin" - } - }, - "parameters": [] - }, - "/accounts": { + "/customer": { "post": { - "summary": "Create new account", - "operationId": "createAccount", - "tags": [ - "Account" - ], + "summary": "Create new customer", + "operationId": "createCustomer", "responses": { "201": { "description": "OK" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - }, - "500": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "InternalError" } }, "requestBody": { - "description": "Create account payload", + "description": "Create customer payload", "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { - "account": { - "title": "Account", - "type": "object", - "required": [ - "id", - "role", - "status" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "role": { - "type": "string", - "enum": [ - "operator", - "customer", - "partner" - ] - }, - "name": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "active", - "inactive" - ] - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "options": { - "type": "object", - "properties": { - "free-parking-time": { - "type": "string" - }, - "expireTime": { - "type": "string", - "description": "Default expire time for whitelist entries.\nAccepts formats from https://www.php.net/manual/en/datetime.formats.php" - } - } - } - }, - "$id": "Account" - }, "customer": { "title": "Customer", "type": "object", "required": [ - "id", - "language" + "id" ], "properties": { "id": { "type": "string", - "format": "uuid", - "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" - }, - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" + "format": "uuid" }, "name": { "type": "string", "nullable": true, "example": "Albert Albertsson" }, - "email": { - "type": "string", - "format": "email", - "nullable": true - }, - "phone": { - "type": "string", - "nullable": true, - "example": "4648700" - }, - "language": { - "type": "string", - "maxLength": 2, - "minLength": 2, - "example": "is" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, "options": { "type": "object", "properties": { - "sendInvoicesToEmail": { - "type": "boolean" - }, - "sendInvoicesToPublishingSystem": { - "type": "boolean" - }, - "billingMethod": { - "type": "string", - "enum": [ - "daily", - "monthly" - ] - }, "billingSsn": { "type": "string" } @@ -497,12770 +54,85 @@ } }, "$id": "Customer" - }, - "authentication": { - "type": "object", - "required": [ - "email", - "password" - ], - "properties": { - "email": { - "type": "string", - "format": "email" - }, - "password": { - "type": "string", - "format": "password" - }, - "expire": { - "type": "string", - "nullable": true, - "format": "date-time" - } - }, - "$id": "PasswordInfo" } }, "required": [ - "account" + "customer" ] } } }, - "$id": "CreateAccountPayload" + "$id": "CreateCustomerPayload" } - }, - "get": { - "summary": "List accounts", - "operationId": "searchAccounts", - "tags": [ - "Account" + } + } + }, + "components": { + "schemas": { + "Customer": { + "title": "Customer", + "type": "object", + "required": [ + "id" ], - "parameters": [ - { - "schema": { - "type": "string" + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Albert Albertsson" + }, + "options": { + "type": "object", + "properties": { + "billingSsn": { + "type": "string" + } }, - "in": "query", - "name": "next" + "$id": "CustomerOption" } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { + } + }, + "CustomerOption": { + "type": "object", + "properties": { + "billingSsn": { + "type": "string" + } + } + } + }, + "requestBodies": { + "CreateCustomerPayload": { + "description": "Create customer payload", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "customer": { + "title": "Customer", "type": "object", - "readOnly": true, + "required": [ + "id" + ], "properties": { - "next": { + "id": { "type": "string", - "nullable": true + "format": "uuid" }, - "previous": { + "name": { "type": "string", - "nullable": true - }, - "accounts": { - "type": "array", - "items": { - "title": "Account", - "type": "object", - "required": [ - "id", - "role", - "status" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "role": { - "type": "string", - "enum": [ - "operator", - "customer", - "partner" - ] - }, - "name": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "active", - "inactive" - ] - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "options": { - "type": "object", - "properties": { - "free-parking-time": { - "type": "string" - }, - "expireTime": { - "type": "string", - "description": "Default expire time for whitelist entries.\nAccepts formats from https://www.php.net/manual/en/datetime.formats.php" - } - } - } - }, - "$id": "Account" - } - } - }, - "$id": "AccountsResponse" - } - } - } - } - } - } - }, - "/account/{id}": { - "parameters": [ - { - "schema": { - "type": "string", - "format": "uuid" - }, - "name": "id", - "in": "path", - "required": true - } - ], - "get": { - "summary": "Retrieve single account", - "operationId": "getAccount", - "tags": [ - "Account" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "title": "Account", - "type": "object", - "required": [ - "id", - "role", - "status" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "role": { - "type": "string", - "enum": [ - "operator", - "customer", - "partner" - ] - }, - "name": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "active", - "inactive" - ] - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "options": { - "type": "object", - "properties": { - "free-parking-time": { - "type": "string" - }, - "expireTime": { - "type": "string", - "description": "Default expire time for whitelist entries.\nAccepts formats from https://www.php.net/manual/en/datetime.formats.php" - } - } - } - }, - "$id": "Account" - } - } - } - }, - "400": { - "description": "Generic input error", - "content": { - "application/json": { - "schema": { - "title": "Exception handle by underlying system", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "exception": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "messages": { - "type": "string", - "nullable": true - } - }, - "$id": "ErrorException" - } - } - }, - "$id": "InputError" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - }, - "500": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "InternalError" - } - } - }, - "put": { - "summary": "Update account", - "operationId": "updateAccount", - "tags": [ - "Account" - ], - "responses": { - "200": { - "description": "Account updated" - }, - "303": { - "description": "Generic redirect response", - "headers": { - "Location": { - "description": "new location for resource", - "schema": { - "type": "string" - } - } - }, - "$id": "Redirect" - }, - "400": { - "description": "Generic input error", - "content": { - "application/json": { - "schema": { - "title": "Exception handle by underlying system", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "exception": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "messages": { - "type": "string", - "nullable": true - } - }, - "$id": "ErrorException" - } - } - }, - "$id": "InputError" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - }, - "500": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "InternalError" - } - }, - "requestBody": { - "required": true, - "content": { - "*/*": { - "schema": { - "title": "Account", - "type": "object", - "required": [ - "id", - "role", - "status" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "role": { - "type": "string", - "enum": [ - "operator", - "customer", - "partner" - ] - }, - "name": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "active", - "inactive" - ] - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "options": { - "type": "object", - "properties": { - "free-parking-time": { - "type": "string" - }, - "expireTime": { - "type": "string", - "description": "Default expire time for whitelist entries.\nAccepts formats from https://www.php.net/manual/en/datetime.formats.php" - } - } - } - }, - "$id": "Account" - } - } - } - } - }, - "delete": { - "summary": "Remove account", - "operationId": "deleteAccount", - "tags": [ - "Account" - ], - "responses": { - "204": { - "description": "ok" - }, - "400": { - "description": "Generic input error", - "content": { - "application/json": { - "schema": { - "title": "Exception handle by underlying system", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "exception": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "messages": { - "type": "string", - "nullable": true - } - }, - "$id": "ErrorException" - } - } - }, - "$id": "InputError" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - }, - "500": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "InternalError" - } - } - } - }, - "/account/{id}/logins": { - "parameters": [ - { - "schema": { - "type": "string", - "format": "uuid" - }, - "name": "id", - "in": "path", - "required": true - } - ], - "get": { - "summary": "Get login alternatives for account", - "operationId": "getAccountLogins", - "tags": [ - "Account" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "title": "AccountLogin", - "type": "object", - "required": [ - "email" - ], - "properties": { - "accountId": { - "type": "string", - "format": "uuid" - }, - "email": { - "type": "string", - "format": "email" - }, - "expire": { - "type": "string", - "nullable": true, - "format": "date-time" - } - }, - "$id": "AccountLogin" - } - } - } - } - } - } - }, - "post": { - "summary": "Create login credentials", - "operationId": "createAccountLogin", - "tags": [ - "Account" - ], - "responses": { - "201": { - "description": "Account login created" - }, - "303": { - "description": "Generic redirect response", - "headers": { - "Location": { - "description": "new location for resource", - "schema": { - "type": "string" - } - } - }, - "$id": "Redirect" - }, - "400": { - "description": "Generic input error", - "content": { - "application/json": { - "schema": { - "title": "Exception handle by underlying system", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "exception": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "messages": { - "type": "string", - "nullable": true - } - }, - "$id": "ErrorException" - } - } - }, - "$id": "InputError" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - }, - "500": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "InternalError" - } - }, - "requestBody": { - "content": { - "*/*": { - "schema": { - "type": "object", - "required": [ - "email", - "password" - ], - "properties": { - "email": { - "type": "string", - "format": "email" - }, - "password": { - "type": "string", - "format": "password" - }, - "expire": { - "type": "string", - "nullable": true, - "format": "date-time" - } - }, - "$id": "PasswordInfo" - } - } - } - } - }, - "delete": { - "summary": "Delete account login", - "operationId": "deleteAccountLogin", - "tags": [ - "Account" - ], - "parameters": [ - { - "schema": { - "type": "string", - "format": "email" - }, - "in": "query", - "name": "email", - "required": true - } - ], - "responses": { - "204": { - "description": "ok" - }, - "400": { - "description": "Generic input error", - "content": { - "application/json": { - "schema": { - "title": "Exception handle by underlying system", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "exception": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "messages": { - "type": "string", - "nullable": true - } - }, - "$id": "ErrorException" - } - } - }, - "$id": "InputError" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - }, - "500": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "InternalError" - } - } - } - }, - "/customers": { - "post": { - "summary": "Create customer", - "operationId": "createCustomer", - "tags": [ - "Account" - ], - "responses": { - "201": { - "description": "OK" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - }, - "500": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "InternalError" - } - }, - "requestBody": { - "description": "Create customer", - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "account": { - "oneOf": [ - { - "title": "Account", - "type": "object", - "required": [ - "id", - "role", - "status" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "role": { - "type": "string", - "enum": [ - "operator", - "customer", - "partner" - ] - }, - "name": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "active", - "inactive" - ] - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "options": { - "type": "object", - "properties": { - "free-parking-time": { - "type": "string" - }, - "expireTime": { - "type": "string", - "description": "Default expire time for whitelist entries.\nAccepts formats from https://www.php.net/manual/en/datetime.formats.php" - } - } - } - }, - "$id": "Account" - }, - { - "x-required": "self", - "type": "string", - "format": "uuid", - "example": "040546c4-58bd-49cf-9741-6cb42daf6728", - "$id": "AccountId" - } - ] - }, - "customer": { - "title": "Customer", - "type": "object", - "required": [ - "id", - "language" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" - }, - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "email": { - "type": "string", - "format": "email", - "nullable": true - }, - "phone": { - "type": "string", - "nullable": true, - "example": "4648700" - }, - "language": { - "type": "string", - "maxLength": 2, - "minLength": 2, - "example": "is" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "options": { - "type": "object", - "properties": { - "sendInvoicesToEmail": { - "type": "boolean" - }, - "sendInvoicesToPublishingSystem": { - "type": "boolean" - }, - "billingMethod": { - "type": "string", - "enum": [ - "daily", - "monthly" - ] - }, - "billingSsn": { - "type": "string" - } - }, - "$id": "CustomerOption" - } - }, - "$id": "Customer" - } - }, - "required": [ - "account", - "customer" - ] - } - } - }, - "$id": "CreateCustomerPayload" - } - }, - "get": { - "summary": "Search customers", - "operationId": "searchCustomers", - "tags": [ - "Account" - ], - "parameters": [ - { - "schema": { - "type": "string", - "enum": [ - "latest", - "want-monthly-billing" - ] - }, - "in": "query", - "name": "collection", - "description": "Pre defined search collections" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "name", - "description": "Find by customer name supports wildcard" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "email", - "description": "Find by customer email supports wildcard" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "ssn", - "description": "Find by customer kennitala supports wildcard" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "next" - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "readOnly": true, - "properties": { - "next": { - "type": "string", - "nullable": true - }, - "previous": { - "type": "string", - "nullable": true - }, - "customers": { - "type": "array", - "items": { - "title": "Customer", - "type": "object", - "required": [ - "id", - "language" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" - }, - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "email": { - "type": "string", - "format": "email", - "nullable": true - }, - "phone": { - "type": "string", - "nullable": true, - "example": "4648700" - }, - "language": { - "type": "string", - "maxLength": 2, - "minLength": 2, - "example": "is" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "options": { - "type": "object", - "properties": { - "sendInvoicesToEmail": { - "type": "boolean" - }, - "sendInvoicesToPublishingSystem": { - "type": "boolean" - }, - "billingMethod": { - "type": "string", - "enum": [ - "daily", - "monthly" - ] - }, - "billingSsn": { - "type": "string" - } - }, - "$id": "CustomerOption" - } - }, - "$id": "Customer" - } - } - }, - "$id": "CustomersResponse" - } - } - } - } - } - } - }, - "/customer/{id}": { - "parameters": [ - { - "schema": { - "type": "string", - "format": "uuid" - }, - "name": "id", - "in": "path", - "required": true - } - ], - "get": { - "summary": "Retrieve single customer", - "operationId": "getCustomer", - "tags": [ - "Account" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "title": "Customer", - "type": "object", - "required": [ - "id", - "language" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" - }, - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "email": { - "type": "string", - "format": "email", - "nullable": true - }, - "phone": { - "type": "string", - "nullable": true, - "example": "4648700" - }, - "language": { - "type": "string", - "maxLength": 2, - "minLength": 2, - "example": "is" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "options": { - "type": "object", - "properties": { - "sendInvoicesToEmail": { - "type": "boolean" - }, - "sendInvoicesToPublishingSystem": { - "type": "boolean" - }, - "billingMethod": { - "type": "string", - "enum": [ - "daily", - "monthly" - ] - }, - "billingSsn": { - "type": "string" - } - }, - "$id": "CustomerOption" - } - }, - "$id": "Customer" - } - } - } - }, - "400": { - "description": "Generic input error", - "content": { - "application/json": { - "schema": { - "title": "Exception handle by underlying system", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "exception": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "messages": { - "type": "string", - "nullable": true - } - }, - "$id": "ErrorException" - } - } - }, - "$id": "InputError" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - }, - "500": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "InternalError" - } - } - }, - "put": { - "summary": "Update customer", - "operationId": "updateCustomer", - "tags": [ - "Account" - ], - "requestBody": { - "content": { - "*/*": { - "schema": { - "title": "Customer", - "type": "object", - "required": [ - "id", - "language" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" - }, - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "email": { - "type": "string", - "format": "email", - "nullable": true - }, - "phone": { - "type": "string", - "nullable": true, - "example": "4648700" - }, - "language": { - "type": "string", - "maxLength": 2, - "minLength": 2, - "example": "is" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "options": { - "type": "object", - "properties": { - "sendInvoicesToEmail": { - "type": "boolean" - }, - "sendInvoicesToPublishingSystem": { - "type": "boolean" - }, - "billingMethod": { - "type": "string", - "enum": [ - "daily", - "monthly" - ] - }, - "billingSsn": { - "type": "string" - } - }, - "$id": "CustomerOption" - } - }, - "$id": "Customer" - } - } - } - }, - "responses": { - "301": { - "description": "Generic redirect response", - "headers": { - "Location": { - "description": "new location for resource", - "schema": { - "type": "string" - } - } - }, - "$id": "Redirect" - }, - "303": { - "description": "Generic redirect response", - "headers": { - "Location": { - "description": "new location for resource", - "schema": { - "type": "string" - } - } - }, - "$id": "Redirect" - }, - "400": { - "description": "Generic input error", - "content": { - "application/json": { - "schema": { - "title": "Exception handle by underlying system", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "exception": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "messages": { - "type": "string", - "nullable": true - } - }, - "$id": "ErrorException" - } - } - }, - "$id": "InputError" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - }, - "500": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "InternalError" - } - } - } - }, - "/visits": { - "get": { - "summary": "Search visits", - "operationId": "getVisits", - "tags": [ - "Visits" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "readOnly": true, - "properties": { - "next": { - "type": "string", - "nullable": true - }, - "previous": { - "type": "string", - "nullable": true - }, - "total": { - "nullable": true, - "type": "integer" - }, - "extra": { - "nullable": true, - "type": "object" - }, - "visits": { - "type": "array", - "items": { - "title": "Visit", - "type": "object", - "required": [ - "id", - "startedOn", - "plate", - "status" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623" - }, - "startedOn": { - "type": "string", - "format": "date-time" - }, - "endedOn": { - "type": "string", - "format": "date-time" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE111" - }, - "status": { - "type": "string", - "enum": [ - "new", - "need-payment", - "need-plate", - "completed" - ] - }, - "paymentStatus": { - "type": "string", - "enum": [ - "whitelisted", - "kiosk", - "company-invoice", - "owner-invoice", - "failed", - "void" - ] - }, - "price": { - "type": "object", - "nullable": true, - "properties": { - "amount": { - "type": "number", - "example": 1250 - }, - "currency": { - "type": "string", - "maxLength": 3, - "minLength": 3, - "example": "ISK" - } - }, - "$id": "Money" - }, - "vehicle": { - "title": "Vehicle", - "type": "object", - "required": [ - "id", - "useGroup", - "vehicleCategory", - "registeredOn" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "deb4b244-945f-45c8-a67c-dc7939387ed6" - }, - "regno": { - "type": "string" - }, - "permno": { - "type": "string" - }, - "vin": { - "type": "string" - }, - "vehicleCategory": { - "type": "string" - }, - "vehicleGroup": { - "type": "string" - }, - "useGroup": { - "type": "string" - }, - "make": { - "type": "string", - "example": "Volvo" - }, - "model": { - "type": "string" - }, - "modelYear": { - "type": "string", - "example": "2019" - }, - "color": { - "type": "string", - "example": "blue" - }, - "massinro": { - "type": "string" - }, - "massladen": { - "type": "string" - }, - "taxGroup": { - "type": "string" - }, - "registeredOn": { - "type": "string", - "format": "date-time" - }, - "category": { - "type": "string", - "enum": [ - "light", - "heavy" - ] - }, - "country": { - "type": "string", - "description": "Country code", - "maxLength": 2, - "example": "is" - }, - "operator": { - "title": "Owner or Operator", - "type": "object", - "required": [ - "ssn", - "name" - ], - "properties": { - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "insuranceCode": { - "type": "string" - }, - "registrationDate": { - "type": "string", - "format": "date-time" - }, - "purchaseDate": { - "type": "string", - "format": "date-time" - } - }, - "$id": "VehicleOwner" - }, - "owner": { - "title": "Owner or Operator", - "type": "object", - "required": [ - "ssn", - "name" - ], - "properties": { - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "insuranceCode": { - "type": "string" - }, - "registrationDate": { - "type": "string", - "format": "date-time" - }, - "purchaseDate": { - "type": "string", - "format": "date-time" - } - }, - "$id": "VehicleOwner" - } - }, - "$id": "Vehicle" - }, - "customer": { - "title": "Customer", - "type": "object", - "required": [ - "id", - "language" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" - }, - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "email": { - "type": "string", - "format": "email", - "nullable": true - }, - "phone": { - "type": "string", - "nullable": true, - "example": "4648700" - }, - "language": { - "type": "string", - "maxLength": 2, - "minLength": 2, - "example": "is" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "options": { - "type": "object", - "properties": { - "sendInvoicesToEmail": { - "type": "boolean" - }, - "sendInvoicesToPublishingSystem": { - "type": "boolean" - }, - "billingMethod": { - "type": "string", - "enum": [ - "daily", - "monthly" - ] - }, - "billingSsn": { - "type": "string" - } - }, - "$id": "CustomerOption" - } - }, - "$id": "Customer" - }, - "entrancePhoto": { - "type": "object", - "required": [ - "id", - "capturedOn", - "plate", - "status", - "camera" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" - }, - "capturedOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE333" - }, - "score": { - "type": "integer" - }, - "url": { - "type": "string", - "nullable": true - }, - "status": { - "type": "string", - "enum": [ - "new", - "need-review", - "force-review", - "reviewed", - "deleted", - "failed" - ] - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "camera": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" - }, - "name": { - "type": "string", - "example": "Entrance camera" - }, - "brand": { - "type": "string", - "example": "Raftakn" - }, - "location": { - "type": "string", - "enum": [ - "entrance", - "exit" - ] - } - }, - "$id": "Camera" - } - }, - "$id": "Photo" - }, - "exitPhoto": { - "type": "object", - "required": [ - "id", - "capturedOn", - "plate", - "status", - "camera" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" - }, - "capturedOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE333" - }, - "score": { - "type": "integer" - }, - "url": { - "type": "string", - "nullable": true - }, - "status": { - "type": "string", - "enum": [ - "new", - "need-review", - "force-review", - "reviewed", - "deleted", - "failed" - ] - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "camera": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" - }, - "name": { - "type": "string", - "example": "Entrance camera" - }, - "brand": { - "type": "string", - "example": "Raftakn" - }, - "location": { - "type": "string", - "enum": [ - "entrance", - "exit" - ] - } - }, - "$id": "Camera" - } - }, - "$id": "Photo" - }, - "invoice": { - "title": "Invoice object", - "type": "object", - "readOnly": true, - "required": [ - "id", - "status", - "language" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623" - }, - "status": { - "type": "string", - "enum": [ - "paid", - "refunded", - "incomplete", - "failed", - "draft" - ] - }, - "productId": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623", - "nullable": true - }, - "price": { - "type": "object", - "nullable": true, - "properties": { - "amount": { - "type": "number", - "example": 1250 - }, - "currency": { - "type": "string", - "maxLength": 3, - "minLength": 3, - "example": "ISK" - } - }, - "$id": "Money" - }, - "invoiceEmail": { - "type": "string", - "format": "email" - }, - "language": { - "type": "string", - "enum": [ - "is", - "en" - ] - }, - "receipt": { - "description": "Payment receipt", - "type": "object", - "readOnly": true, - "properties": { - "type": { - "type": "string", - "enum": [ - "visa", - "mastercard", - "amex", - "discover", - "other", - "electron", - "maestro" - ] - }, - "card": { - "type": "string", - "description": "Masked Card Number", - "example": "****-****-****-4444" - } - }, - "$id": "Receipt" - }, - "createdOn": { - "type": "string", - "format": "date-time" - } - }, - "$id": "Invoice" - } - }, - "$id": "Visit" - } - } - }, - "$id": "VisitsResponse" - } - } - } - }, - "400": { - "description": "Generic input error", - "content": { - "application/json": { - "schema": { - "title": "Exception handle by underlying system", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "exception": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "messages": { - "type": "string", - "nullable": true - } - }, - "$id": "ErrorException" - } - } - }, - "$id": "InputError" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - }, - "500": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "InternalError" - } - }, - "description": "List and filter visits\n\nIf bearer token does not belong to operator list will be filter on customerId", - "parameters": [ - { - "schema": { - "type": "string", - "enum": [ - "new", - "open", - "review", - "closed", - "need-payment" - ] - }, - "in": "query", - "name": "status", - "description": "Visit status" - }, - { - "schema": { - "type": "string", - "enum": [ - "latest", - "export", - "open", - "checkin", - "unpaid" - ] - }, - "in": "query", - "name": "collection", - "description": "Pre defined search collections" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "plate", - "description": "Find by licence plate supports wildcard" - }, - { - "schema": { - "type": "string", - "format": "date" - }, - "in": "query", - "name": "date", - "description": "Visits on this day" - }, - { - "schema": { - "type": "string", - "format": "date-time", - "example": "2020-07-23T07:12:52+02:00" - }, - "in": "query", - "name": "date.from" - }, - { - "schema": { - "type": "string", - "format": "date-time", - "example": "2020-07-23T07:12:52+02:00" - }, - "in": "query", - "name": "date.to" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "card.lastFour" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "next" - }, - { - "schema": { - "type": "string", - "enum": [ - "whitelisted", - "kiosk", - "company-invoice", - "owner-invoice", - "failed", - "void" - ] - }, - "in": "query", - "name": "payment.status", - "description": "Payment status" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "ssn", - "description": "Find by vehicle owner" - }, - { - "schema": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "price" - ] - }, - "uniqueItems": true - }, - "style": "form", - "explode": false, - "in": "query", - "name": "aggregate", - "description": "Find by vehicle owner" - } - ] - }, - "post": { - "summary": "Create visit", - "operationId": "createVisit", - "tags": [ - "Visits" - ], - "responses": { - "200": { - "description": "Visit created" - }, - "301": { - "description": "Generic redirect response", - "headers": { - "Location": { - "description": "new location for resource", - "schema": { - "type": "string" - } - } - }, - "$id": "Redirect" - }, - "303": { - "description": "Generic redirect response", - "headers": { - "Location": { - "description": "new location for resource", - "schema": { - "type": "string" - } - } - }, - "$id": "Redirect" - }, - "400": { - "description": "Generic input error", - "content": { - "application/json": { - "schema": { - "title": "Exception handle by underlying system", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "exception": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "messages": { - "type": "string", - "nullable": true - } - }, - "$id": "ErrorException" - } - } - }, - "$id": "InputError" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - }, - "422": { - "description": "Error that happens when creating already created data", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "messages": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid" - } - } - } - } - }, - "$id": "WrongEndpoint" - }, - "500": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "InternalError" - } - }, - "requestBody": { - "required": true, - "content": { - "*/*": { - "schema": { - "title": "Visit", - "type": "object", - "required": [ - "id", - "startedOn", - "plate", - "status" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623" - }, - "startedOn": { - "type": "string", - "format": "date-time" - }, - "endedOn": { - "type": "string", - "format": "date-time" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE111" - }, - "status": { - "type": "string", - "enum": [ - "new", - "need-payment", - "need-plate", - "completed" - ] - }, - "paymentStatus": { - "type": "string", - "enum": [ - "whitelisted", - "kiosk", - "company-invoice", - "owner-invoice", - "failed", - "void" - ] - }, - "price": { - "type": "object", - "nullable": true, - "properties": { - "amount": { - "type": "number", - "example": 1250 - }, - "currency": { - "type": "string", - "maxLength": 3, - "minLength": 3, - "example": "ISK" - } - }, - "$id": "Money" - }, - "vehicle": { - "title": "Vehicle", - "type": "object", - "required": [ - "id", - "useGroup", - "vehicleCategory", - "registeredOn" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "deb4b244-945f-45c8-a67c-dc7939387ed6" - }, - "regno": { - "type": "string" - }, - "permno": { - "type": "string" - }, - "vin": { - "type": "string" - }, - "vehicleCategory": { - "type": "string" - }, - "vehicleGroup": { - "type": "string" - }, - "useGroup": { - "type": "string" - }, - "make": { - "type": "string", - "example": "Volvo" - }, - "model": { - "type": "string" - }, - "modelYear": { - "type": "string", - "example": "2019" - }, - "color": { - "type": "string", - "example": "blue" - }, - "massinro": { - "type": "string" - }, - "massladen": { - "type": "string" - }, - "taxGroup": { - "type": "string" - }, - "registeredOn": { - "type": "string", - "format": "date-time" - }, - "category": { - "type": "string", - "enum": [ - "light", - "heavy" - ] - }, - "country": { - "type": "string", - "description": "Country code", - "maxLength": 2, - "example": "is" - }, - "operator": { - "title": "Owner or Operator", - "type": "object", - "required": [ - "ssn", - "name" - ], - "properties": { - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "insuranceCode": { - "type": "string" - }, - "registrationDate": { - "type": "string", - "format": "date-time" - }, - "purchaseDate": { - "type": "string", - "format": "date-time" - } - }, - "$id": "VehicleOwner" - }, - "owner": { - "title": "Owner or Operator", - "type": "object", - "required": [ - "ssn", - "name" - ], - "properties": { - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "insuranceCode": { - "type": "string" - }, - "registrationDate": { - "type": "string", - "format": "date-time" - }, - "purchaseDate": { - "type": "string", - "format": "date-time" - } - }, - "$id": "VehicleOwner" - } - }, - "$id": "Vehicle" - }, - "customer": { - "title": "Customer", - "type": "object", - "required": [ - "id", - "language" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" - }, - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "email": { - "type": "string", - "format": "email", - "nullable": true - }, - "phone": { - "type": "string", - "nullable": true, - "example": "4648700" - }, - "language": { - "type": "string", - "maxLength": 2, - "minLength": 2, - "example": "is" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "options": { - "type": "object", - "properties": { - "sendInvoicesToEmail": { - "type": "boolean" - }, - "sendInvoicesToPublishingSystem": { - "type": "boolean" - }, - "billingMethod": { - "type": "string", - "enum": [ - "daily", - "monthly" - ] - }, - "billingSsn": { - "type": "string" - } - }, - "$id": "CustomerOption" - } - }, - "$id": "Customer" - }, - "entrancePhoto": { - "type": "object", - "required": [ - "id", - "capturedOn", - "plate", - "status", - "camera" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" - }, - "capturedOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE333" - }, - "score": { - "type": "integer" - }, - "url": { - "type": "string", - "nullable": true - }, - "status": { - "type": "string", - "enum": [ - "new", - "need-review", - "force-review", - "reviewed", - "deleted", - "failed" - ] - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "camera": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" - }, - "name": { - "type": "string", - "example": "Entrance camera" - }, - "brand": { - "type": "string", - "example": "Raftakn" - }, - "location": { - "type": "string", - "enum": [ - "entrance", - "exit" - ] - } - }, - "$id": "Camera" - } - }, - "$id": "Photo" - }, - "exitPhoto": { - "type": "object", - "required": [ - "id", - "capturedOn", - "plate", - "status", - "camera" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" - }, - "capturedOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE333" - }, - "score": { - "type": "integer" - }, - "url": { - "type": "string", - "nullable": true - }, - "status": { - "type": "string", - "enum": [ - "new", - "need-review", - "force-review", - "reviewed", - "deleted", - "failed" - ] - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "camera": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" - }, - "name": { - "type": "string", - "example": "Entrance camera" - }, - "brand": { - "type": "string", - "example": "Raftakn" - }, - "location": { - "type": "string", - "enum": [ - "entrance", - "exit" - ] - } - }, - "$id": "Camera" - } - }, - "$id": "Photo" - }, - "invoice": { - "title": "Invoice object", - "type": "object", - "readOnly": true, - "required": [ - "id", - "status", - "language" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623" - }, - "status": { - "type": "string", - "enum": [ - "paid", - "refunded", - "incomplete", - "failed", - "draft" - ] - }, - "productId": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623", - "nullable": true - }, - "price": { - "type": "object", - "nullable": true, - "properties": { - "amount": { - "type": "number", - "example": 1250 - }, - "currency": { - "type": "string", - "maxLength": 3, - "minLength": 3, - "example": "ISK" - } - }, - "$id": "Money" - }, - "invoiceEmail": { - "type": "string", - "format": "email" - }, - "language": { - "type": "string", - "enum": [ - "is", - "en" - ] - }, - "receipt": { - "description": "Payment receipt", - "type": "object", - "readOnly": true, - "properties": { - "type": { - "type": "string", - "enum": [ - "visa", - "mastercard", - "amex", - "discover", - "other", - "electron", - "maestro" - ] - }, - "card": { - "type": "string", - "description": "Masked Card Number", - "example": "****-****-****-4444" - } - }, - "$id": "Receipt" - }, - "createdOn": { - "type": "string", - "format": "date-time" - } - }, - "$id": "Invoice" - } - }, - "$id": "Visit" - } - } - } - } - } - }, - "/visits/counts": { - "get": { - "summary": "Get visit counts", - "operationId": "countVisits", - "tags": [ - "Visits" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "count": { - "type": "integer" - } - } - } - } - } - }, - "400": { - "description": "Generic input error", - "content": { - "application/json": { - "schema": { - "title": "Exception handle by underlying system", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "exception": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "messages": { - "type": "string", - "nullable": true - } - }, - "$id": "ErrorException" - } - } - }, - "$id": "InputError" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - }, - "500": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "InternalError" - } - }, - "description": "List and filter visits\n\nIf bearer token does not belong to operator list will be filter on customerId", - "parameters": [ - { - "schema": { - "type": "string", - "enum": [ - "new", - "open", - "review", - "closed", - "need-payment" - ] - }, - "in": "query", - "name": "status", - "description": "Visit status" - }, - { - "schema": { - "type": "string", - "enum": [ - "latest", - "export", - "open", - "checkin" - ] - }, - "in": "query", - "name": "collection", - "description": "Pre defined search collections" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "plate", - "description": "Find by licence plate supports wildcard" - }, - { - "schema": { - "type": "string", - "format": "date" - }, - "in": "query", - "name": "date", - "description": "Visits on this day" - }, - { - "schema": { - "type": "string", - "format": "date-time", - "example": "2020-07-23T07:12:52+02:00" - }, - "in": "query", - "name": "date.from" - }, - { - "schema": { - "type": "string", - "format": "date-time", - "example": "2020-07-23T07:12:52+02:00" - }, - "in": "query", - "name": "date.to" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "card.lastFour" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "next" - }, - { - "schema": { - "type": "string", - "enum": [ - "whitelisted", - "kiosk", - "company-invoice", - "owner-invoice", - "failed", - "void" - ] - }, - "in": "query", - "name": "payment.status", - "description": "Payment status" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "ssn", - "description": "Find by vehicle owner" - } - ] - } - }, - "/visit/{id}": { - "parameters": [ - { - "schema": { - "type": "string", - "format": "uuid" - }, - "name": "id", - "in": "path", - "required": true - } - ], - "get": { - "operationId": "getVisit", - "summary": "Retrieve visit", - "description": "If bearer token does not belong to operator list will be filter on customerId", - "tags": [ - "Visits" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "title": "Visit", - "type": "object", - "required": [ - "id", - "startedOn", - "plate", - "status" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623" - }, - "startedOn": { - "type": "string", - "format": "date-time" - }, - "endedOn": { - "type": "string", - "format": "date-time" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE111" - }, - "status": { - "type": "string", - "enum": [ - "new", - "need-payment", - "need-plate", - "completed" - ] - }, - "paymentStatus": { - "type": "string", - "enum": [ - "whitelisted", - "kiosk", - "company-invoice", - "owner-invoice", - "failed", - "void" - ] - }, - "price": { - "type": "object", - "nullable": true, - "properties": { - "amount": { - "type": "number", - "example": 1250 - }, - "currency": { - "type": "string", - "maxLength": 3, - "minLength": 3, - "example": "ISK" - } - }, - "$id": "Money" - }, - "vehicle": { - "title": "Vehicle", - "type": "object", - "required": [ - "id", - "useGroup", - "vehicleCategory", - "registeredOn" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "deb4b244-945f-45c8-a67c-dc7939387ed6" - }, - "regno": { - "type": "string" - }, - "permno": { - "type": "string" - }, - "vin": { - "type": "string" - }, - "vehicleCategory": { - "type": "string" - }, - "vehicleGroup": { - "type": "string" - }, - "useGroup": { - "type": "string" - }, - "make": { - "type": "string", - "example": "Volvo" - }, - "model": { - "type": "string" - }, - "modelYear": { - "type": "string", - "example": "2019" - }, - "color": { - "type": "string", - "example": "blue" - }, - "massinro": { - "type": "string" - }, - "massladen": { - "type": "string" - }, - "taxGroup": { - "type": "string" - }, - "registeredOn": { - "type": "string", - "format": "date-time" - }, - "category": { - "type": "string", - "enum": [ - "light", - "heavy" - ] - }, - "country": { - "type": "string", - "description": "Country code", - "maxLength": 2, - "example": "is" - }, - "operator": { - "title": "Owner or Operator", - "type": "object", - "required": [ - "ssn", - "name" - ], - "properties": { - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "insuranceCode": { - "type": "string" - }, - "registrationDate": { - "type": "string", - "format": "date-time" - }, - "purchaseDate": { - "type": "string", - "format": "date-time" - } - }, - "$id": "VehicleOwner" - }, - "owner": { - "title": "Owner or Operator", - "type": "object", - "required": [ - "ssn", - "name" - ], - "properties": { - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "insuranceCode": { - "type": "string" - }, - "registrationDate": { - "type": "string", - "format": "date-time" - }, - "purchaseDate": { - "type": "string", - "format": "date-time" - } - }, - "$id": "VehicleOwner" - } - }, - "$id": "Vehicle" - }, - "customer": { - "title": "Customer", - "type": "object", - "required": [ - "id", - "language" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" - }, - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "email": { - "type": "string", - "format": "email", - "nullable": true - }, - "phone": { - "type": "string", - "nullable": true, - "example": "4648700" - }, - "language": { - "type": "string", - "maxLength": 2, - "minLength": 2, - "example": "is" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "options": { - "type": "object", - "properties": { - "sendInvoicesToEmail": { - "type": "boolean" - }, - "sendInvoicesToPublishingSystem": { - "type": "boolean" - }, - "billingMethod": { - "type": "string", - "enum": [ - "daily", - "monthly" - ] - }, - "billingSsn": { - "type": "string" - } - }, - "$id": "CustomerOption" - } - }, - "$id": "Customer" - }, - "entrancePhoto": { - "type": "object", - "required": [ - "id", - "capturedOn", - "plate", - "status", - "camera" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" - }, - "capturedOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE333" - }, - "score": { - "type": "integer" - }, - "url": { - "type": "string", - "nullable": true - }, - "status": { - "type": "string", - "enum": [ - "new", - "need-review", - "force-review", - "reviewed", - "deleted", - "failed" - ] - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "camera": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" - }, - "name": { - "type": "string", - "example": "Entrance camera" - }, - "brand": { - "type": "string", - "example": "Raftakn" - }, - "location": { - "type": "string", - "enum": [ - "entrance", - "exit" - ] - } - }, - "$id": "Camera" - } - }, - "$id": "Photo" - }, - "exitPhoto": { - "type": "object", - "required": [ - "id", - "capturedOn", - "plate", - "status", - "camera" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" - }, - "capturedOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE333" - }, - "score": { - "type": "integer" - }, - "url": { - "type": "string", - "nullable": true - }, - "status": { - "type": "string", - "enum": [ - "new", - "need-review", - "force-review", - "reviewed", - "deleted", - "failed" - ] - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "camera": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" - }, - "name": { - "type": "string", - "example": "Entrance camera" - }, - "brand": { - "type": "string", - "example": "Raftakn" - }, - "location": { - "type": "string", - "enum": [ - "entrance", - "exit" - ] - } - }, - "$id": "Camera" - } - }, - "$id": "Photo" - }, - "invoice": { - "title": "Invoice object", - "type": "object", - "readOnly": true, - "required": [ - "id", - "status", - "language" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623" - }, - "status": { - "type": "string", - "enum": [ - "paid", - "refunded", - "incomplete", - "failed", - "draft" - ] - }, - "productId": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623", - "nullable": true - }, - "price": { - "type": "object", - "nullable": true, - "properties": { - "amount": { - "type": "number", - "example": 1250 - }, - "currency": { - "type": "string", - "maxLength": 3, - "minLength": 3, - "example": "ISK" - } - }, - "$id": "Money" - }, - "invoiceEmail": { - "type": "string", - "format": "email" - }, - "language": { - "type": "string", - "enum": [ - "is", - "en" - ] - }, - "receipt": { - "description": "Payment receipt", - "type": "object", - "readOnly": true, - "properties": { - "type": { - "type": "string", - "enum": [ - "visa", - "mastercard", - "amex", - "discover", - "other", - "electron", - "maestro" - ] - }, - "card": { - "type": "string", - "description": "Masked Card Number", - "example": "****-****-****-4444" - } - }, - "$id": "Receipt" - }, - "createdOn": { - "type": "string", - "format": "date-time" - } - }, - "$id": "Invoice" - } - }, - "$id": "Visit" - } - } - } - }, - "400": { - "description": "Generic input error", - "content": { - "application/json": { - "schema": { - "title": "Exception handle by underlying system", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "exception": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "messages": { - "type": "string", - "nullable": true - } - }, - "$id": "ErrorException" - } - } - }, - "$id": "InputError" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - }, - "500": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "InternalError" - } - } - }, - "put": { - "operationId": "updateVisit", - "summary": "Update visit", - "tags": [ - "Visits" - ], - "requestBody": { - "content": { - "*/*": { - "schema": { - "title": "Visit", - "type": "object", - "required": [ - "id", - "startedOn", - "plate", - "status" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623" - }, - "startedOn": { - "type": "string", - "format": "date-time" - }, - "endedOn": { - "type": "string", - "format": "date-time" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE111" - }, - "status": { - "type": "string", - "enum": [ - "new", - "need-payment", - "need-plate", - "completed" - ] - }, - "paymentStatus": { - "type": "string", - "enum": [ - "whitelisted", - "kiosk", - "company-invoice", - "owner-invoice", - "failed", - "void" - ] - }, - "price": { - "type": "object", - "nullable": true, - "properties": { - "amount": { - "type": "number", - "example": 1250 - }, - "currency": { - "type": "string", - "maxLength": 3, - "minLength": 3, - "example": "ISK" - } - }, - "$id": "Money" - }, - "vehicle": { - "title": "Vehicle", - "type": "object", - "required": [ - "id", - "useGroup", - "vehicleCategory", - "registeredOn" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "deb4b244-945f-45c8-a67c-dc7939387ed6" - }, - "regno": { - "type": "string" - }, - "permno": { - "type": "string" - }, - "vin": { - "type": "string" - }, - "vehicleCategory": { - "type": "string" - }, - "vehicleGroup": { - "type": "string" - }, - "useGroup": { - "type": "string" - }, - "make": { - "type": "string", - "example": "Volvo" - }, - "model": { - "type": "string" - }, - "modelYear": { - "type": "string", - "example": "2019" - }, - "color": { - "type": "string", - "example": "blue" - }, - "massinro": { - "type": "string" - }, - "massladen": { - "type": "string" - }, - "taxGroup": { - "type": "string" - }, - "registeredOn": { - "type": "string", - "format": "date-time" - }, - "category": { - "type": "string", - "enum": [ - "light", - "heavy" - ] - }, - "country": { - "type": "string", - "description": "Country code", - "maxLength": 2, - "example": "is" - }, - "operator": { - "title": "Owner or Operator", - "type": "object", - "required": [ - "ssn", - "name" - ], - "properties": { - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "insuranceCode": { - "type": "string" - }, - "registrationDate": { - "type": "string", - "format": "date-time" - }, - "purchaseDate": { - "type": "string", - "format": "date-time" - } - }, - "$id": "VehicleOwner" - }, - "owner": { - "title": "Owner or Operator", - "type": "object", - "required": [ - "ssn", - "name" - ], - "properties": { - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "insuranceCode": { - "type": "string" - }, - "registrationDate": { - "type": "string", - "format": "date-time" - }, - "purchaseDate": { - "type": "string", - "format": "date-time" - } - }, - "$id": "VehicleOwner" - } - }, - "$id": "Vehicle" - }, - "customer": { - "title": "Customer", - "type": "object", - "required": [ - "id", - "language" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" - }, - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "email": { - "type": "string", - "format": "email", - "nullable": true - }, - "phone": { - "type": "string", - "nullable": true, - "example": "4648700" - }, - "language": { - "type": "string", - "maxLength": 2, - "minLength": 2, - "example": "is" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "options": { - "type": "object", - "properties": { - "sendInvoicesToEmail": { - "type": "boolean" - }, - "sendInvoicesToPublishingSystem": { - "type": "boolean" - }, - "billingMethod": { - "type": "string", - "enum": [ - "daily", - "monthly" - ] - }, - "billingSsn": { - "type": "string" - } - }, - "$id": "CustomerOption" - } - }, - "$id": "Customer" - }, - "entrancePhoto": { - "type": "object", - "required": [ - "id", - "capturedOn", - "plate", - "status", - "camera" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" - }, - "capturedOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE333" - }, - "score": { - "type": "integer" - }, - "url": { - "type": "string", - "nullable": true - }, - "status": { - "type": "string", - "enum": [ - "new", - "need-review", - "force-review", - "reviewed", - "deleted", - "failed" - ] - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "camera": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" - }, - "name": { - "type": "string", - "example": "Entrance camera" - }, - "brand": { - "type": "string", - "example": "Raftakn" - }, - "location": { - "type": "string", - "enum": [ - "entrance", - "exit" - ] - } - }, - "$id": "Camera" - } - }, - "$id": "Photo" - }, - "exitPhoto": { - "type": "object", - "required": [ - "id", - "capturedOn", - "plate", - "status", - "camera" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" - }, - "capturedOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE333" - }, - "score": { - "type": "integer" - }, - "url": { - "type": "string", - "nullable": true - }, - "status": { - "type": "string", - "enum": [ - "new", - "need-review", - "force-review", - "reviewed", - "deleted", - "failed" - ] - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "camera": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" - }, - "name": { - "type": "string", - "example": "Entrance camera" - }, - "brand": { - "type": "string", - "example": "Raftakn" - }, - "location": { - "type": "string", - "enum": [ - "entrance", - "exit" - ] - } - }, - "$id": "Camera" - } - }, - "$id": "Photo" - }, - "invoice": { - "title": "Invoice object", - "type": "object", - "readOnly": true, - "required": [ - "id", - "status", - "language" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623" - }, - "status": { - "type": "string", - "enum": [ - "paid", - "refunded", - "incomplete", - "failed", - "draft" - ] - }, - "productId": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623", - "nullable": true - }, - "price": { - "type": "object", - "nullable": true, - "properties": { - "amount": { - "type": "number", - "example": 1250 - }, - "currency": { - "type": "string", - "maxLength": 3, - "minLength": 3, - "example": "ISK" - } - }, - "$id": "Money" - }, - "invoiceEmail": { - "type": "string", - "format": "email" - }, - "language": { - "type": "string", - "enum": [ - "is", - "en" - ] - }, - "receipt": { - "description": "Payment receipt", - "type": "object", - "readOnly": true, - "properties": { - "type": { - "type": "string", - "enum": [ - "visa", - "mastercard", - "amex", - "discover", - "other", - "electron", - "maestro" - ] - }, - "card": { - "type": "string", - "description": "Masked Card Number", - "example": "****-****-****-4444" - } - }, - "$id": "Receipt" - }, - "createdOn": { - "type": "string", - "format": "date-time" - } - }, - "$id": "Invoice" - } - }, - "$id": "Visit" - } - } - } - }, - "responses": { - "301": { - "description": "Generic redirect response", - "headers": { - "Location": { - "description": "new location for resource", - "schema": { - "type": "string" - } - } - }, - "$id": "Redirect" - }, - "303": { - "description": "Generic redirect response", - "headers": { - "Location": { - "description": "new location for resource", - "schema": { - "type": "string" - } - } - }, - "$id": "Redirect" - }, - "400": { - "description": "Generic input error", - "content": { - "application/json": { - "schema": { - "title": "Exception handle by underlying system", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "exception": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "messages": { - "type": "string", - "nullable": true - } - }, - "$id": "ErrorException" - } - } - }, - "$id": "InputError" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - }, - "500": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "InternalError" - } - } - } - }, - "/visit/{id}/renewVehicle": { - "post": { - "operationId": "renewVisitVehicleInformation", - "description": "Query IVR for new vehicle information", - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Generic input error", - "content": { - "application/json": { - "schema": { - "title": "Exception handle by underlying system", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "exception": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "messages": { - "type": "string", - "nullable": true - } - }, - "$id": "ErrorException" - } - } - }, - "$id": "InputError" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - }, - "500": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "InternalError" - } - } - }, - "parameters": [ - { - "schema": { - "type": "string", - "format": "uuid" - }, - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/visit/{id}/receipt": { - "parameters": [ - { - "schema": { - "type": "string", - "format": "uuid" - }, - "name": "id", - "in": "path", - "required": true - } - ], - "post": { - "operationId": "sendVisitReceipt", - "summary": "Send receipt to email", - "requestBody": { - "description": "Send receipt body", - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "email": { - "type": "string", - "format": "email" - }, - "language": { - "type": "string", - "enum": [ - "is", - "en" - ] - } - }, - "required": [ - "email", - "language" - ] - } - } - } - }, - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Generic input error", - "content": { - "application/json": { - "schema": { - "title": "Exception handle by underlying system", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "exception": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "messages": { - "type": "string", - "nullable": true - } - }, - "$id": "ErrorException" - } - } - }, - "$id": "InputError" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - }, - "500": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "InternalError" - } - } - } - }, - "/invoice/{id}": { - "parameters": [ - { - "schema": { - "type": "string", - "format": "uuid" - }, - "name": "id", - "in": "path", - "required": true - } - ], - "get": { - "operationId": "getInvoice", - "summary": "Retrieve invoice", - "description": "If bearer token does not belong to operator list will be filter on customerId", - "tags": [ - "Visits" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "title": "Invoice object", - "type": "object", - "readOnly": true, - "required": [ - "id", - "status", - "language" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623" - }, - "status": { - "type": "string", - "enum": [ - "paid", - "refunded", - "incomplete", - "failed", - "draft" - ] - }, - "productId": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623", - "nullable": true - }, - "price": { - "type": "object", - "nullable": true, - "properties": { - "amount": { - "type": "number", - "example": 1250 - }, - "currency": { - "type": "string", - "maxLength": 3, - "minLength": 3, - "example": "ISK" - } - }, - "$id": "Money" - }, - "invoiceEmail": { - "type": "string", - "format": "email" - }, - "language": { - "type": "string", - "enum": [ - "is", - "en" - ] - }, - "receipt": { - "description": "Payment receipt", - "type": "object", - "readOnly": true, - "properties": { - "type": { - "type": "string", - "enum": [ - "visa", - "mastercard", - "amex", - "discover", - "other", - "electron", - "maestro" - ] - }, - "card": { - "type": "string", - "description": "Masked Card Number", - "example": "****-****-****-4444" - } - }, - "$id": "Receipt" - }, - "createdOn": { - "type": "string", - "format": "date-time" - } - }, - "$id": "Invoice" - } - } - } - }, - "400": { - "description": "Generic input error", - "content": { - "application/json": { - "schema": { - "title": "Exception handle by underlying system", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "exception": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "messages": { - "type": "string", - "nullable": true - } - }, - "$id": "ErrorException" - } - } - }, - "$id": "InputError" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - }, - "500": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "InternalError" - } - } - } - }, - "/products": { - "get": { - "summary": "Get all products", - "operationId": "searchProducts", - "tags": [ - "Kiosk", - "Products" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "aec5c6f3-130c-4928-8ffa-470918d94cc9" - }, - "type": { - "type": "string", - "enum": [ - "default", - "visit" - ], - "example": "visit" - }, - "price": { - "type": "object", - "nullable": true, - "properties": { - "amount": { - "type": "number", - "example": 1250 - }, - "currency": { - "type": "string", - "maxLength": 3, - "minLength": 3, - "example": "ISK" - } - }, - "$id": "Money" - }, - "currency": { - "type": "string", - "maxLength": 3, - "minLength": 3, - "example": "ISK" - }, - "vehicleCategory": { - "type": "string", - "enum": [ - "light", - "heavy" - ] - }, - "category": { - "type": "string" - }, - "name": { - "type": "object", - "example": { - "en": "Name in english", - "is": "Name in icelandic" - }, - "additionalProperties": { - "type": "string" - } - } - }, - "$id": "Product" - } - } - } - } - }, - "400": { - "description": "Generic input error", - "content": { - "application/json": { - "schema": { - "title": "Exception handle by underlying system", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "exception": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "messages": { - "type": "string", - "nullable": true - } - }, - "$id": "ErrorException" - } - } - }, - "$id": "InputError" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - }, - "500": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "InternalError" - } - }, - "security": [ - { - "bearer-token": [] - }, - { - "api-key": [] - } - ] - } - }, - "/admin/create-role-bearer-token": { - "post": { - "summary": "Create role based bearer token", - "operationId": "createRoleBearerToken", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "role": { - "type": "string", - "enum": [ - "webhook", - "kiosk", - "whitelist" - ] - } - } - } - } - }, - "$id": "CreateRoleBearerToken" - }, - "tags": [ - "Admin" - ], - "responses": { - "200": { - "description": "Create new bearer token", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "access_token": { - "type": "string" - } - } - } - } - } - } - }, - "security": [ - { - "api-key": [] - } - ] - } - }, - "/kiosk/register-payment": { - "post": { - "tags": [ - "Kiosk" - ], - "summary": "Register payments for Kiosks", - "operationId": "registerKioskPayment", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "plate", - "quantity", - "product", - "card", - "language" - ], - "properties": { - "plate": { - "type": "string", - "example": "ICE222" - }, - "quantity": { - "description": "The number of \"time units\". Each time unit is 24 hours in this case", - "type": "number", - "example": 1 - }, - "product": { - "anyOf": [ - { - "x-required": "self", - "type": "string", - "format": "uuid", - "example": "040546c4-58bd-49cf-9741-6cb42daf6728", - "$id": "ProductId" - }, - { - "x-required": "self", - "type": "string", - "$id": "ProductCode" - } - ] - }, - "card": { - "anyOf": [ - { - "description": "Simplified card information without ppi", - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "visa", - "mastercard", - "amex", - "discover", - "other", - "electron", - "maestro" - ] - }, - "last_four": { - "type": "string", - "maxLength": 4, - "minLength": 4, - "example": "4444" - } - }, - "$id": "ReceiptCard" - }, - { - "type": "object", - "required": [ - "number", - "expire" - ], - "properties": { - "number": { - "type": "string" - }, - "ccv": { - "type": "string" - }, - "expire": { - "type": "string", - "format": "date" - } - }, - "$id": "Card" - } - ] - }, - "payment": { - "type": "object", - "nullable": true, - "required": [ - "amount", - "currency", - "transactionId", - "authorizationId" - ], - "properties": { - "amount": { - "type": "number", - "example": 1250 - }, - "currency": { - "type": "string", - "maxLength": 3, - "minLength": 3, - "example": "ISK" - }, - "transactionId": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "number" - } - ] - }, - "authorizationId": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "number" - } - ] - } - }, - "$id": "Payment" - }, - "language": { - "type": "string", - "enum": [ - "is", - "en" - ] - }, - "email": { - "description": "Email address for receipts. If specified the API should send a email with a receipt.", - "type": "string", - "nullable": true - } - } - } - } - }, - "$id": "RegisterKioskPayment" - }, - "responses": { - "200": { - "description": "Payment registered", - "content": { - "application/json": { - "schema": { - "x-required": "self", - "type": "string", - "format": "uuid", - "example": "040546c4-58bd-49cf-9741-6cb42daf6728", - "$id": "InvoiceId" - } - } - } - }, - "400": { - "description": "Generic input error", - "content": { - "application/json": { - "schema": { - "title": "Exception handle by underlying system", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "exception": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "messages": { - "type": "string", - "nullable": true - } - }, - "$id": "ErrorException" - } - } - }, - "$id": "InputError" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - }, - "500": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "InternalError" - } - } - } - }, - "/kiosk/search-visits": { - "get": { - "summary": "Search visits", - "operationId": "kioskSearchVisits", - "tags": [ - "Kiosk" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "readOnly": true, - "properties": { - "next": { - "type": "string", - "nullable": true - }, - "previous": { - "type": "string", - "nullable": true - }, - "total": { - "nullable": true, - "type": "integer" - }, - "extra": { - "nullable": true, - "type": "object" - }, - "visits": { - "type": "array", - "items": { - "title": "Visit", - "type": "object", - "required": [ - "id", - "startedOn", - "plate", - "status" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623" - }, - "startedOn": { - "type": "string", - "format": "date-time" - }, - "endedOn": { - "type": "string", - "format": "date-time" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE111" - }, - "status": { - "type": "string", - "enum": [ - "new", - "need-payment", - "need-plate", - "completed" - ] - }, - "paymentStatus": { - "type": "string", - "enum": [ - "whitelisted", - "kiosk", - "company-invoice", - "owner-invoice", - "failed", - "void" - ] - }, - "price": { - "type": "object", - "nullable": true, - "properties": { - "amount": { - "type": "number", - "example": 1250 - }, - "currency": { - "type": "string", - "maxLength": 3, - "minLength": 3, - "example": "ISK" - } - }, - "$id": "Money" - }, - "vehicle": { - "title": "Vehicle", - "type": "object", - "required": [ - "id", - "useGroup", - "vehicleCategory", - "registeredOn" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "deb4b244-945f-45c8-a67c-dc7939387ed6" - }, - "regno": { - "type": "string" - }, - "permno": { - "type": "string" - }, - "vin": { - "type": "string" - }, - "vehicleCategory": { - "type": "string" - }, - "vehicleGroup": { - "type": "string" - }, - "useGroup": { - "type": "string" - }, - "make": { - "type": "string", - "example": "Volvo" - }, - "model": { - "type": "string" - }, - "modelYear": { - "type": "string", - "example": "2019" - }, - "color": { - "type": "string", - "example": "blue" - }, - "massinro": { - "type": "string" - }, - "massladen": { - "type": "string" - }, - "taxGroup": { - "type": "string" - }, - "registeredOn": { - "type": "string", - "format": "date-time" - }, - "category": { - "type": "string", - "enum": [ - "light", - "heavy" - ] - }, - "country": { - "type": "string", - "description": "Country code", - "maxLength": 2, - "example": "is" - }, - "operator": { - "title": "Owner or Operator", - "type": "object", - "required": [ - "ssn", - "name" - ], - "properties": { - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "insuranceCode": { - "type": "string" - }, - "registrationDate": { - "type": "string", - "format": "date-time" - }, - "purchaseDate": { - "type": "string", - "format": "date-time" - } - }, - "$id": "VehicleOwner" - }, - "owner": { - "title": "Owner or Operator", - "type": "object", - "required": [ - "ssn", - "name" - ], - "properties": { - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "insuranceCode": { - "type": "string" - }, - "registrationDate": { - "type": "string", - "format": "date-time" - }, - "purchaseDate": { - "type": "string", - "format": "date-time" - } - }, - "$id": "VehicleOwner" - } - }, - "$id": "Vehicle" - }, - "customer": { - "title": "Customer", - "type": "object", - "required": [ - "id", - "language" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" - }, - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "email": { - "type": "string", - "format": "email", - "nullable": true - }, - "phone": { - "type": "string", - "nullable": true, - "example": "4648700" - }, - "language": { - "type": "string", - "maxLength": 2, - "minLength": 2, - "example": "is" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "options": { - "type": "object", - "properties": { - "sendInvoicesToEmail": { - "type": "boolean" - }, - "sendInvoicesToPublishingSystem": { - "type": "boolean" - }, - "billingMethod": { - "type": "string", - "enum": [ - "daily", - "monthly" - ] - }, - "billingSsn": { - "type": "string" - } - }, - "$id": "CustomerOption" - } - }, - "$id": "Customer" - }, - "entrancePhoto": { - "type": "object", - "required": [ - "id", - "capturedOn", - "plate", - "status", - "camera" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" - }, - "capturedOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE333" - }, - "score": { - "type": "integer" - }, - "url": { - "type": "string", - "nullable": true - }, - "status": { - "type": "string", - "enum": [ - "new", - "need-review", - "force-review", - "reviewed", - "deleted", - "failed" - ] - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "camera": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" - }, - "name": { - "type": "string", - "example": "Entrance camera" - }, - "brand": { - "type": "string", - "example": "Raftakn" - }, - "location": { - "type": "string", - "enum": [ - "entrance", - "exit" - ] - } - }, - "$id": "Camera" - } - }, - "$id": "Photo" - }, - "exitPhoto": { - "type": "object", - "required": [ - "id", - "capturedOn", - "plate", - "status", - "camera" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" - }, - "capturedOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE333" - }, - "score": { - "type": "integer" - }, - "url": { - "type": "string", - "nullable": true - }, - "status": { - "type": "string", - "enum": [ - "new", - "need-review", - "force-review", - "reviewed", - "deleted", - "failed" - ] - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "camera": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" - }, - "name": { - "type": "string", - "example": "Entrance camera" - }, - "brand": { - "type": "string", - "example": "Raftakn" - }, - "location": { - "type": "string", - "enum": [ - "entrance", - "exit" - ] - } - }, - "$id": "Camera" - } - }, - "$id": "Photo" - }, - "invoice": { - "title": "Invoice object", - "type": "object", - "readOnly": true, - "required": [ - "id", - "status", - "language" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623" - }, - "status": { - "type": "string", - "enum": [ - "paid", - "refunded", - "incomplete", - "failed", - "draft" - ] - }, - "productId": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623", - "nullable": true - }, - "price": { - "type": "object", - "nullable": true, - "properties": { - "amount": { - "type": "number", - "example": 1250 - }, - "currency": { - "type": "string", - "maxLength": 3, - "minLength": 3, - "example": "ISK" - } - }, - "$id": "Money" - }, - "invoiceEmail": { - "type": "string", - "format": "email" - }, - "language": { - "type": "string", - "enum": [ - "is", - "en" - ] - }, - "receipt": { - "description": "Payment receipt", - "type": "object", - "readOnly": true, - "properties": { - "type": { - "type": "string", - "enum": [ - "visa", - "mastercard", - "amex", - "discover", - "other", - "electron", - "maestro" - ] - }, - "card": { - "type": "string", - "description": "Masked Card Number", - "example": "****-****-****-4444" - } - }, - "$id": "Receipt" - }, - "createdOn": { - "type": "string", - "format": "date-time" - } - }, - "$id": "Invoice" - } - }, - "$id": "Visit" - } - } - }, - "$id": "VisitsResponse" - } - } - } - }, - "400": { - "description": "Generic input error", - "content": { - "application/json": { - "schema": { - "title": "Exception handle by underlying system", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "exception": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "messages": { - "type": "string", - "nullable": true - } - }, - "$id": "ErrorException" - } - } - }, - "$id": "InputError" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - }, - "500": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "InternalError" - } - }, - "parameters": [ - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "plate", - "description": "Find by licence plate supports wildcard" - } - ] - } - }, - "/purchase-product": { - "post": { - "tags": [ - "Kiosk" - ], - "summary": "Purchase a product", - "operationId": "purchaseProduct", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "vehicle", - "customer", - "product", - "card" - ], - "properties": { - "vehicle": { - "type": "object", - "oneOf": [ - { - "required": [ - "plate" - ] - }, - { - "required": [ - "id" - ] - } - ], - "properties": { - "plate": { - "type": "string", - "example": "ICE222" - }, - "id": { - "description": "Id of vehicle know to us", - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623" - } - }, - "$id": "VehicleLookup" - }, - "customer": { - "anyOf": [ - { - "title": "SimpleCustomer", - "type": "object", - "required": [ - "name", - "language" - ], - "properties": { - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "email": { - "type": "string", - "format": "email", - "nullable": true - }, - "phone": { - "type": "string", - "nullable": true, - "example": "4648700" - }, - "language": { - "type": "string", - "maxLength": 2, - "minLength": 2, - "example": "is" - } - }, - "$id": "SimpleCustomer" - }, - { - "title": "Customer", - "type": "object", - "required": [ - "id", - "language" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" - }, - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "email": { - "type": "string", - "format": "email", - "nullable": true - }, - "phone": { - "type": "string", - "nullable": true, - "example": "4648700" - }, - "language": { - "type": "string", - "maxLength": 2, - "minLength": 2, - "example": "is" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "options": { - "type": "object", - "properties": { - "sendInvoicesToEmail": { - "type": "boolean" - }, - "sendInvoicesToPublishingSystem": { - "type": "boolean" - }, - "billingMethod": { - "type": "string", - "enum": [ - "daily", - "monthly" - ] - }, - "billingSsn": { - "type": "string" - } - }, - "$id": "CustomerOption" - } - }, - "$id": "Customer" - } - ] - }, - "product": { - "x-required": "self", - "type": "string", - "format": "uuid", - "example": "040546c4-58bd-49cf-9741-6cb42daf6728", - "$id": "ProductId" - }, - "card": { - "type": "object", - "required": [ - "number", - "expire" - ], - "properties": { - "number": { - "type": "string" - }, - "ccv": { - "type": "string" - }, - "expire": { - "type": "string", - "format": "date" - } - }, - "$id": "Card" - }, - "provider": { - "type": "string", - "enum": [ - "borgun", - "valitor-pay", - "testing", - "testing2" - ] - } - } - } - } - }, - "$id": "PurchaseProduct" - }, - "responses": { - "200": { - "description": "Payment registered", - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "type": "object", - "readOnly": true, - "required": [ - "invoiceId", - "form" - ], - "properties": { - "invoiceId": { - "x-required": "self", - "type": "string", - "format": "uuid", - "example": "040546c4-58bd-49cf-9741-6cb42daf6728", - "$id": "InvoiceId" - }, - "form": { - "type": "object", - "required": [ - "html", - "fields", - "url" - ], - "properties": { - "html": { - "type": "string" - }, - "fields": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "url": { - "type": "string" - } - } - } - }, - "$id": "PaymentFormResponse" - }, - { - "x-required": "self", - "type": "string", - "format": "uuid", - "example": "040546c4-58bd-49cf-9741-6cb42daf6728", - "$id": "InvoiceId" - } - ] - } - } - } - }, - "400": { - "description": "Generic input error", - "content": { - "application/json": { - "schema": { - "title": "Exception handle by underlying system", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "exception": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "messages": { - "type": "string", - "nullable": true - } - }, - "$id": "ErrorException" - } - } - }, - "$id": "InputError" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - }, - "500": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "InternalError" - } - }, - "security": [ - { - "bearer-token": [] - }, - { - "api-key": [] - } - ] - } - }, - "/ping/bearer": { - "get": { - "tags": [ - "Testing" - ], - "operationId": "testBearerToken", - "responses": { - "200": { - "description": "OK" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - }, - "500": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "InternalError" - } - } - } - }, - "/ping/redirect": { - "post": { - "tags": [ - "Testing" - ], - "operationId": "testTokenRedirect", - "responses": { - "201": { - "description": "OK" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - } - } - }, - "get": { - "tags": [ - "Testing" - ], - "operationId": "testTacToken", - "responses": { - "200": { - "description": "OK" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - } - } - } - }, - "/ping/key": { - "get": { - "operationId": "testApiKey", - "tags": [ - "Testing" - ], - "responses": { - "200": { - "description": "OK" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - } - }, - "security": [ - { - "api-key": [] - } - ] - } - }, - "/ping/webhook": { - "post": { - "operationId": "testHookAccess", - "tags": [ - "Testing" - ], - "responses": { - "200": { - "description": "OK" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - } - }, - "security": [ - { - "hook-security": [], - "bearer-token": [] - } - ] - } - }, - "/ping/kiosk": { - "post": { - "operationId": "testKioskAccess", - "tags": [ - "Testing" - ], - "responses": { - "200": { - "description": "OK" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - } - }, - "security": [ - { - "bearer-token": [] - } - ] - } - }, - "/ping/whitelist": { - "post": { - "operationId": "testWhitelistAccess", - "tags": [ - "Testing" - ], - "responses": { - "200": { - "description": "OK" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - } - }, - "security": [ - { - "bearer-token": [] - } - ] - } - }, - "/photos/{type}": { - "parameters": [ - { - "schema": { - "type": "string", - "enum": [ - "open-alpr", - "open-alpr-test" - ] - }, - "name": "type", - "in": "path", - "required": true - } - ], - "post": { - "operationId": "importPhoto", - "summary": "Ingest new photo into system", - "requestBody": { - "content": { - "*/*": { - "schema": { - "anyOf": [ - { - "type": "object", - "properties": { - "epoch_start": { - "description": "Capture date", - "type": "integer" - }, - "camera_id": { - "description": "Numeric id of camera", - "type": "integer" - }, - "agent_uid": { - "type": "string" - }, - "best_uuid": { - "description": "Unique id of best match", - "type": "string" - }, - "best_plate_number": { - "description": "Best guess for license plate", - "type": "string" - }, - "best_confidence": { - "description": "Ocr score", - "type": "number" - }, - "best_region": { - "description": "Guess for the license plate region", - "type": "string" - }, - "best_region_confidence": { - "type": "number" - }, - "company_id": { - "type": "string", - "format": "uuid" - }, - "version": { - "type": "integer" - }, - "vehicle_crop_jpeg": { - "description": "Base64 encoded jpeg preview for the photo", - "type": "string" - }, - "is_parked": { - "type": "boolean" - }, - "vehicle": { - "type": "object", - "properties": { - "color": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "confidence": { - "type": "number" - } - } - } - }, - "make": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "confidence": { - "type": "number" - } - } - } - }, - "body": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "confidence": { - "type": "number" - } - } - } - } - } - } - }, - "$id": "OpenALPR" - } - ] - } - } - } - }, - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Generic input error", - "content": { - "application/json": { - "schema": { - "title": "Exception handle by underlying system", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "exception": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "messages": { - "type": "string", - "nullable": true - } - }, - "$id": "ErrorException" - } - } - }, - "$id": "InputError" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - }, - "500": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "InternalError" - } - }, - "security": [ - { - "hook-security": [] - }, - { - "bearer-token": [] - } - ] - } - }, - "/photos": { - "get": { - "summary": "Search photos", - "operationId": "searchPhotos", - "tags": [ - "Photo" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "readOnly": true, - "properties": { - "next": { - "type": "string", - "nullable": true - }, - "previous": { - "type": "string", - "nullable": true - }, - "photos": { - "type": "array", - "items": { - "type": "object", - "required": [ - "id", - "capturedOn", - "plate", - "status", - "camera" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" - }, - "capturedOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE333" - }, - "score": { - "type": "integer" - }, - "url": { - "type": "string", - "nullable": true - }, - "status": { - "type": "string", - "enum": [ - "new", - "need-review", - "force-review", - "reviewed", - "deleted", - "failed" - ] - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "camera": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" - }, - "name": { - "type": "string", - "example": "Entrance camera" - }, - "brand": { - "type": "string", - "example": "Raftakn" - }, - "location": { - "type": "string", - "enum": [ - "entrance", - "exit" - ] - } - }, - "$id": "Camera" - } - }, - "$id": "Photo" - } - } - }, - "$id": "PhotoResponse" - } - } - } - }, - "400": { - "description": "Generic input error", - "content": { - "application/json": { - "schema": { - "title": "Exception handle by underlying system", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "exception": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "messages": { - "type": "string", - "nullable": true - } - }, - "$id": "ErrorException" - } - } - }, - "$id": "InputError" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - }, - "500": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "InternalError" - } - }, - "parameters": [ - { - "schema": { - "type": "string", - "enum": [ - "need-review" - ] - }, - "in": "query", - "name": "collection", - "description": "Pre defined search collections" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "plate", - "description": "Find by licence plate supports wildcard" - }, - { - "schema": { - "type": "string", - "format": "date", - "example": "2020-07-23" - }, - "in": "query", - "name": "date", - "description": "Photo captured on date" - }, - { - "schema": { - "type": "string", - "format": "date-time", - "example": "2020-07-23T07:12:52+02:00" - }, - "in": "query", - "name": "date.from" - }, - { - "schema": { - "type": "string", - "format": "date-time", - "example": "2020-07-23T07:12:52+02:00" - }, - "in": "query", - "name": "date.to" - }, - { - "schema": { - "type": "string", - "format": "uuid" - }, - "in": "query", - "name": "camera.id" - }, - { - "schema": { - "type": "string", - "enum": [ - "entrance", - "exit" - ] - }, - "in": "query", - "name": "camera.location" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "next" - } - ] - } - }, - "/photo/{id}": { - "parameters": [ - { - "schema": { - "type": "string", - "format": "uuid" - }, - "name": "id", - "in": "path", - "required": true - } - ], - "get": { - "summary": "View photo", - "operationId": "getPhoto", - "tags": [ - "Photo" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "id", - "capturedOn", - "plate", - "status", - "camera" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" - }, - "capturedOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE333" - }, - "score": { - "type": "integer" - }, - "url": { - "type": "string", - "nullable": true - }, - "status": { - "type": "string", - "enum": [ - "new", - "need-review", - "force-review", - "reviewed", - "deleted", - "failed" - ] - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "camera": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" - }, - "name": { - "type": "string", - "example": "Entrance camera" - }, - "brand": { - "type": "string", - "example": "Raftakn" - }, - "location": { - "type": "string", - "enum": [ - "entrance", - "exit" - ] - } - }, - "$id": "Camera" - } - }, - "$id": "Photo" - } - } - } - }, - "400": { - "description": "Generic input error", - "content": { - "application/json": { - "schema": { - "title": "Exception handle by underlying system", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "exception": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "messages": { - "type": "string", - "nullable": true - } - }, - "$id": "ErrorException" - } - } - }, - "$id": "InputError" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - }, - "500": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "InternalError" - } - } - }, - "put": { - "summary": "Update photo", - "operationId": "updatePhoto", - "tags": [ - "Photo" - ], - "responses": { - "200": { - "description": "Photo updated" - }, - "303": { - "description": "Generic redirect response", - "headers": { - "Location": { - "description": "new location for resource", - "schema": { - "type": "string" - } - } - }, - "$id": "Redirect" - }, - "400": { - "description": "Generic input error", - "content": { - "application/json": { - "schema": { - "title": "Exception handle by underlying system", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "exception": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "messages": { - "type": "string", - "nullable": true - } - }, - "$id": "ErrorException" - } - } - }, - "$id": "InputError" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - }, - "500": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "InternalError" - } - }, - "requestBody": { - "content": { - "*/*": { - "schema": { - "type": "object", - "required": [ - "id", - "capturedOn", - "plate", - "status", - "camera" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" - }, - "capturedOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE333" - }, - "score": { - "type": "integer" - }, - "url": { - "type": "string", - "nullable": true - }, - "status": { - "type": "string", - "enum": [ - "new", - "need-review", - "force-review", - "reviewed", - "deleted", - "failed" - ] - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "camera": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" - }, - "name": { - "type": "string", - "example": "Entrance camera" - }, - "brand": { - "type": "string", - "example": "Raftakn" - }, - "location": { - "type": "string", - "enum": [ - "entrance", - "exit" - ] - } - }, - "$id": "Camera" - } - }, - "$id": "Photo" - } - } - } - } - }, - "delete": { - "summary": "Remove photo", - "operationId": "deletePhoto", - "tags": [ - "Photo" - ], - "responses": { - "204": { - "description": "ok" - }, - "400": { - "description": "Generic input error", - "content": { - "application/json": { - "schema": { - "title": "Exception handle by underlying system", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "exception": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "messages": { - "type": "string", - "nullable": true - } - }, - "$id": "ErrorException" - } - } - }, - "$id": "InputError" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - }, - "500": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "InternalError" - } - } - } - }, - "/whitelist": { - "get": { - "summary": "List whitelisted vehicles", - "operationId": "getWhitelistedVehicles", - "tags": [ - "Whitelist" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "readOnly": true, - "properties": { - "next": { - "type": "string", - "nullable": true - }, - "previous": { - "type": "string", - "nullable": true - }, - "whitelists": { - "type": "array", - "items": { - "title": "Visit", - "type": "object", - "required": [ - "plate", - "reason" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623" - }, - "activeFrom": { - "type": "string", - "nullable": true, - "format": "date-time" - }, - "expireOn": { - "type": "string", - "nullable": true, - "format": "date-time" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE111" - }, - "reason": { - "type": "string" - }, - "author": { - "type": "string", - "nullable": true - } - }, - "$id": "Whitelist" - } - } - }, - "$id": "WhitelistResponse" - } - } - } - }, - "400": { - "description": "Generic input error", - "content": { - "application/json": { - "schema": { - "title": "Exception handle by underlying system", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "exception": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "messages": { - "type": "string", - "nullable": true - } - }, - "$id": "ErrorException" - } - } - }, - "$id": "InputError" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - }, - "500": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "InternalError" - } - }, - "parameters": [ - { - "schema": { - "type": "string", - "enum": [ - "app", - "cpanel" - ] - }, - "in": "query", - "name": "collection", - "description": "Pre defined search collections" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "plate", - "description": "Find by licence plate supports wildcard" - }, - { - "schema": { - "type": "string", - "enum": [ - "on", - "off", - "1", - "0", - "true", - "false" - ] - }, - "in": "query", - "name": "active", - "description": "Active whitelisted plates" - }, - { - "schema": { - "type": "string", - "format": "date", - "example": "2020-07-23" - }, - "in": "query", - "name": "expire", - "description": "Plates expiring on day" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "next" - } - ] - }, - "post": { - "summary": "Add new plate to whitelist", - "operationId": "addWhitelistPlate", - "responses": { - "200": { - "description": "Plate added" - }, - "301": { - "description": "Generic redirect response", - "headers": { - "Location": { - "description": "new location for resource", - "schema": { - "type": "string" - } - } - }, - "$id": "Redirect" - }, - "303": { - "description": "Generic redirect response", - "headers": { - "Location": { - "description": "new location for resource", - "schema": { - "type": "string" - } - } - }, - "$id": "Redirect" - }, - "400": { - "description": "Generic input error", - "content": { - "application/json": { - "schema": { - "title": "Exception handle by underlying system", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "exception": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "messages": { - "type": "string", - "nullable": true - } - }, - "$id": "ErrorException" - } - } - }, - "$id": "InputError" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - }, - "422": { - "description": "Error that happens when creating already created data", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "messages": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid" - } - } - } - } - }, - "$id": "WrongEndpoint" - }, - "500": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "InternalError" - } - }, - "requestBody": { - "content": { - "*/*": { - "schema": { - "title": "Visit", - "type": "object", - "required": [ - "plate", - "reason" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623" - }, - "activeFrom": { - "type": "string", - "nullable": true, - "format": "date-time" - }, - "expireOn": { - "type": "string", - "nullable": true, - "format": "date-time" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE111" - }, - "reason": { - "type": "string" - }, - "author": { - "type": "string", - "nullable": true - } - }, - "$id": "Whitelist" - } - } - } - } - } - }, - "/whitelist/{id}": { - "parameters": [ - { - "schema": { - "type": "string", - "format": "uuid" - }, - "name": "id", - "in": "path", - "required": true - } - ], - "get": { - "summary": "View whitelist entry", - "operationId": "getWhitelistEntry", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "title": "Visit", - "type": "object", - "required": [ - "plate", - "reason" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623" - }, - "activeFrom": { - "type": "string", - "nullable": true, - "format": "date-time" - }, - "expireOn": { - "type": "string", - "nullable": true, - "format": "date-time" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE111" - }, - "reason": { - "type": "string" - }, - "author": { - "type": "string", - "nullable": true - } - }, - "$id": "Whitelist" - } - } - } - }, - "400": { - "description": "Generic input error", - "content": { - "application/json": { - "schema": { - "title": "Exception handle by underlying system", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "exception": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "messages": { - "type": "string", - "nullable": true - } - }, - "$id": "ErrorException" - } - } - }, - "$id": "InputError" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - }, - "500": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "InternalError" - } - } - }, - "put": { - "deprecated": true, - "summary": "Update whitelist entry", - "operationId": "updateWhitelistEntry", - "responses": { - "200": { - "description": "Entry updated" - }, - "303": { - "description": "Generic redirect response", - "headers": { - "Location": { - "description": "new location for resource", - "schema": { - "type": "string" - } - } - }, - "$id": "Redirect" - }, - "400": { - "description": "Generic input error", - "content": { - "application/json": { - "schema": { - "title": "Exception handle by underlying system", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "exception": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "messages": { - "type": "string", - "nullable": true - } - }, - "$id": "ErrorException" - } - } - }, - "$id": "InputError" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - }, - "500": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "InternalError" - } - }, - "requestBody": { - "content": { - "*/*": { - "schema": { - "title": "Visit", - "type": "object", - "required": [ - "plate", - "reason" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623" - }, - "activeFrom": { - "type": "string", - "nullable": true, - "format": "date-time" - }, - "expireOn": { - "type": "string", - "nullable": true, - "format": "date-time" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE111" - }, - "reason": { - "type": "string" - }, - "author": { - "type": "string", - "nullable": true - } - }, - "$id": "Whitelist" - } - } - } - } - }, - "delete": { - "deprecated": true, - "summary": "Remove whitelist entry", - "operationId": "deleteWhitelistEntry", - "responses": { - "204": { - "description": "ok" - }, - "400": { - "description": "Generic input error", - "content": { - "application/json": { - "schema": { - "title": "Exception handle by underlying system", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "exception": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "messages": { - "type": "string", - "nullable": true - } - }, - "$id": "ErrorException" - } - } - }, - "$id": "InputError" - }, - "401": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Unauthorized" - }, - "403": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "Forbidden" - }, - "404": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "NotFound" - }, - "500": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - }, - "$id": "InternalError" - } - } - } - } - }, - "components": { - "schemas": { - "Account": { - "title": "Account", - "type": "object", - "required": [ - "id", - "role", - "status" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "role": { - "type": "string", - "enum": [ - "operator", - "customer", - "partner" - ] - }, - "name": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "active", - "inactive" - ] - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "options": { - "type": "object", - "properties": { - "free-parking-time": { - "type": "string" - }, - "expireTime": { - "type": "string", - "description": "Default expire time for whitelist entries.\nAccepts formats from https://www.php.net/manual/en/datetime.formats.php" - } - } - } - } - }, - "AccountId": { - "x-required": "self", - "type": "string", - "format": "uuid", - "example": "040546c4-58bd-49cf-9741-6cb42daf6728" - }, - "AccountLogin": { - "title": "AccountLogin", - "type": "object", - "required": [ - "email" - ], - "properties": { - "accountId": { - "type": "string", - "format": "uuid" - }, - "email": { - "type": "string", - "format": "email" - }, - "expire": { - "type": "string", - "nullable": true, - "format": "date-time" - } - } - }, - "AccountsResponse": { - "type": "object", - "readOnly": true, - "properties": { - "next": { - "type": "string", - "nullable": true - }, - "previous": { - "type": "string", - "nullable": true - }, - "accounts": { - "type": "array", - "items": { - "title": "Account", - "type": "object", - "required": [ - "id", - "role", - "status" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "role": { - "type": "string", - "enum": [ - "operator", - "customer", - "partner" - ] - }, - "name": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "active", - "inactive" - ] - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "options": { - "type": "object", - "properties": { - "free-parking-time": { - "type": "string" - }, - "expireTime": { - "type": "string", - "description": "Default expire time for whitelist entries.\nAccepts formats from https://www.php.net/manual/en/datetime.formats.php" - } - } - } - }, - "$id": "Account" - } - } - } - }, - "AuthenticatedAccount": { - "title": "Wrapper around account and bearer token", - "type": "object", - "required": [ - "access_token", - "account" - ], - "properties": { - "access_token": { - "type": "string" - }, - "account": { - "title": "Account", - "type": "object", - "required": [ - "id", - "role", - "status" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "role": { - "type": "string", - "enum": [ - "operator", - "customer", - "partner" - ] - }, - "name": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "active", - "inactive" - ] - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "options": { - "type": "object", - "properties": { - "free-parking-time": { - "type": "string" - }, - "expireTime": { - "type": "string", - "description": "Default expire time for whitelist entries.\nAccepts formats from https://www.php.net/manual/en/datetime.formats.php" - } - } - } - }, - "$id": "Account" - } - } - }, - "Camera": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" - }, - "name": { - "type": "string", - "example": "Entrance camera" - }, - "brand": { - "type": "string", - "example": "Raftakn" - }, - "location": { - "type": "string", - "enum": [ - "entrance", - "exit" - ] - } - } - }, - "Card": { - "type": "object", - "required": [ - "number", - "expire" - ], - "properties": { - "number": { - "type": "string" - }, - "ccv": { - "type": "string" - }, - "expire": { - "type": "string", - "format": "date" - } - } - }, - "Customer": { - "title": "Customer", - "type": "object", - "required": [ - "id", - "language" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" - }, - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "email": { - "type": "string", - "format": "email", - "nullable": true - }, - "phone": { - "type": "string", - "nullable": true, - "example": "4648700" - }, - "language": { - "type": "string", - "maxLength": 2, - "minLength": 2, - "example": "is" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "options": { - "type": "object", - "properties": { - "sendInvoicesToEmail": { - "type": "boolean" - }, - "sendInvoicesToPublishingSystem": { - "type": "boolean" - }, - "billingMethod": { - "type": "string", - "enum": [ - "daily", - "monthly" - ] - }, - "billingSsn": { - "type": "string" - } - }, - "$id": "CustomerOption" - } - } - }, - "CustomerOption": { - "type": "object", - "properties": { - "sendInvoicesToEmail": { - "type": "boolean" - }, - "sendInvoicesToPublishingSystem": { - "type": "boolean" - }, - "billingMethod": { - "type": "string", - "enum": [ - "daily", - "monthly" - ] - }, - "billingSsn": { - "type": "string" - } - } - }, - "CustomersResponse": { - "type": "object", - "readOnly": true, - "properties": { - "next": { - "type": "string", - "nullable": true - }, - "previous": { - "type": "string", - "nullable": true - }, - "customers": { - "type": "array", - "items": { - "title": "Customer", - "type": "object", - "required": [ - "id", - "language" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" - }, - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "email": { - "type": "string", - "format": "email", - "nullable": true - }, - "phone": { - "type": "string", - "nullable": true, - "example": "4648700" - }, - "language": { - "type": "string", - "maxLength": 2, - "minLength": 2, - "example": "is" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "options": { - "type": "object", - "properties": { - "sendInvoicesToEmail": { - "type": "boolean" - }, - "sendInvoicesToPublishingSystem": { - "type": "boolean" - }, - "billingMethod": { - "type": "string", - "enum": [ - "daily", - "monthly" - ] - }, - "billingSsn": { - "type": "string" - } - }, - "$id": "CustomerOption" - } - }, - "$id": "Customer" - } - } - } - }, - "Error": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - } - }, - "ErrorException": { - "title": "Exception handle by underlying system", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "exception": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "messages": { - "type": "string", - "nullable": true - } - } - }, - "Invoice": { - "title": "Invoice object", - "type": "object", - "readOnly": true, - "required": [ - "id", - "status", - "language" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623" - }, - "status": { - "type": "string", - "enum": [ - "paid", - "refunded", - "incomplete", - "failed", - "draft" - ] - }, - "productId": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623", - "nullable": true - }, - "price": { - "type": "object", - "nullable": true, - "properties": { - "amount": { - "type": "number", - "example": 1250 - }, - "currency": { - "type": "string", - "maxLength": 3, - "minLength": 3, - "example": "ISK" - } - }, - "$id": "Money" - }, - "invoiceEmail": { - "type": "string", - "format": "email" - }, - "language": { - "type": "string", - "enum": [ - "is", - "en" - ] - }, - "receipt": { - "description": "Payment receipt", - "type": "object", - "readOnly": true, - "properties": { - "type": { - "type": "string", - "enum": [ - "visa", - "mastercard", - "amex", - "discover", - "other", - "electron", - "maestro" - ] - }, - "card": { - "type": "string", - "description": "Masked Card Number", - "example": "****-****-****-4444" - } - }, - "$id": "Receipt" - }, - "createdOn": { - "type": "string", - "format": "date-time" - } - } - }, - "InvoiceId": { - "x-required": "self", - "type": "string", - "format": "uuid", - "example": "040546c4-58bd-49cf-9741-6cb42daf6728" - }, - "Money": { - "type": "object", - "nullable": true, - "properties": { - "amount": { - "type": "number", - "example": 1250 - }, - "currency": { - "type": "string", - "maxLength": 3, - "minLength": 3, - "example": "ISK" - } - } - }, - "OpenALPR": { - "type": "object", - "properties": { - "epoch_start": { - "description": "Capture date", - "type": "integer" - }, - "camera_id": { - "description": "Numeric id of camera", - "type": "integer" - }, - "agent_uid": { - "type": "string" - }, - "best_uuid": { - "description": "Unique id of best match", - "type": "string" - }, - "best_plate_number": { - "description": "Best guess for license plate", - "type": "string" - }, - "best_confidence": { - "description": "Ocr score", - "type": "number" - }, - "best_region": { - "description": "Guess for the license plate region", - "type": "string" - }, - "best_region_confidence": { - "type": "number" - }, - "company_id": { - "type": "string", - "format": "uuid" - }, - "version": { - "type": "integer" - }, - "vehicle_crop_jpeg": { - "description": "Base64 encoded jpeg preview for the photo", - "type": "string" - }, - "is_parked": { - "type": "boolean" - }, - "vehicle": { - "type": "object", - "properties": { - "color": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "confidence": { - "type": "number" - } - } - } - }, - "make": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "confidence": { - "type": "number" - } - } - } - }, - "body": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "confidence": { - "type": "number" - } - } - } - } - } - } - } - }, - "PasswordInfo": { - "type": "object", - "required": [ - "email", - "password" - ], - "properties": { - "email": { - "type": "string", - "format": "email" - }, - "password": { - "type": "string", - "format": "password" - }, - "expire": { - "type": "string", - "nullable": true, - "format": "date-time" - } - } - }, - "Payment": { - "type": "object", - "nullable": true, - "required": [ - "amount", - "currency", - "transactionId", - "authorizationId" - ], - "properties": { - "amount": { - "type": "number", - "example": 1250 - }, - "currency": { - "type": "string", - "maxLength": 3, - "minLength": 3, - "example": "ISK" - }, - "transactionId": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "number" - } - ] - }, - "authorizationId": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "number" - } - ] - } - } - }, - "PaymentFormResponse": { - "type": "object", - "readOnly": true, - "required": [ - "invoiceId", - "form" - ], - "properties": { - "invoiceId": { - "x-required": "self", - "type": "string", - "format": "uuid", - "example": "040546c4-58bd-49cf-9741-6cb42daf6728", - "$id": "InvoiceId" - }, - "form": { - "type": "object", - "required": [ - "html", - "fields", - "url" - ], - "properties": { - "html": { - "type": "string" - }, - "fields": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "url": { - "type": "string" - } - } - } - } - }, - "Photo": { - "type": "object", - "required": [ - "id", - "capturedOn", - "plate", - "status", - "camera" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" - }, - "capturedOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE333" - }, - "score": { - "type": "integer" - }, - "url": { - "type": "string", - "nullable": true - }, - "status": { - "type": "string", - "enum": [ - "new", - "need-review", - "force-review", - "reviewed", - "deleted", - "failed" - ] - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "camera": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" - }, - "name": { - "type": "string", - "example": "Entrance camera" - }, - "brand": { - "type": "string", - "example": "Raftakn" - }, - "location": { - "type": "string", - "enum": [ - "entrance", - "exit" - ] - } - }, - "$id": "Camera" - } - } - }, - "PhotoResponse": { - "type": "object", - "readOnly": true, - "properties": { - "next": { - "type": "string", - "nullable": true - }, - "previous": { - "type": "string", - "nullable": true - }, - "photos": { - "type": "array", - "items": { - "type": "object", - "required": [ - "id", - "capturedOn", - "plate", - "status", - "camera" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" - }, - "capturedOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE333" - }, - "score": { - "type": "integer" - }, - "url": { - "type": "string", - "nullable": true - }, - "status": { - "type": "string", - "enum": [ - "new", - "need-review", - "force-review", - "reviewed", - "deleted", - "failed" - ] - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "camera": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" - }, - "name": { - "type": "string", - "example": "Entrance camera" - }, - "brand": { - "type": "string", - "example": "Raftakn" - }, - "location": { - "type": "string", - "enum": [ - "entrance", - "exit" - ] - } - }, - "$id": "Camera" - } - }, - "$id": "Photo" - } - } - } - }, - "Product": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "aec5c6f3-130c-4928-8ffa-470918d94cc9" - }, - "type": { - "type": "string", - "enum": [ - "default", - "visit" - ], - "example": "visit" - }, - "price": { - "type": "object", - "nullable": true, - "properties": { - "amount": { - "type": "number", - "example": 1250 - }, - "currency": { - "type": "string", - "maxLength": 3, - "minLength": 3, - "example": "ISK" - } - }, - "$id": "Money" - }, - "currency": { - "type": "string", - "maxLength": 3, - "minLength": 3, - "example": "ISK" - }, - "vehicleCategory": { - "type": "string", - "enum": [ - "light", - "heavy" - ] - }, - "category": { - "type": "string" - }, - "name": { - "type": "object", - "example": { - "en": "Name in english", - "is": "Name in icelandic" - }, - "additionalProperties": { - "type": "string" - } - } - } - }, - "ProductCode": { - "x-required": "self", - "type": "string" - }, - "ProductId": { - "x-required": "self", - "type": "string", - "format": "uuid", - "example": "040546c4-58bd-49cf-9741-6cb42daf6728" - }, - "Receipt": { - "description": "Payment receipt", - "type": "object", - "readOnly": true, - "properties": { - "type": { - "type": "string", - "enum": [ - "visa", - "mastercard", - "amex", - "discover", - "other", - "electron", - "maestro" - ] - }, - "card": { - "type": "string", - "description": "Masked Card Number", - "example": "****-****-****-4444" - } - } - }, - "ReceiptCard": { - "description": "Simplified card information without ppi", - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "visa", - "mastercard", - "amex", - "discover", - "other", - "electron", - "maestro" - ] - }, - "last_four": { - "type": "string", - "maxLength": 4, - "minLength": 4, - "example": "4444" - } - } - }, - "SimpleCustomer": { - "title": "SimpleCustomer", - "type": "object", - "required": [ - "name", - "language" - ], - "properties": { - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "email": { - "type": "string", - "format": "email", - "nullable": true - }, - "phone": { - "type": "string", - "nullable": true, - "example": "4648700" - }, - "language": { - "type": "string", - "maxLength": 2, - "minLength": 2, - "example": "is" - } - } - }, - "Vehicle": { - "title": "Vehicle", - "type": "object", - "required": [ - "id", - "useGroup", - "vehicleCategory", - "registeredOn" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "deb4b244-945f-45c8-a67c-dc7939387ed6" - }, - "regno": { - "type": "string" - }, - "permno": { - "type": "string" - }, - "vin": { - "type": "string" - }, - "vehicleCategory": { - "type": "string" - }, - "vehicleGroup": { - "type": "string" - }, - "useGroup": { - "type": "string" - }, - "make": { - "type": "string", - "example": "Volvo" - }, - "model": { - "type": "string" - }, - "modelYear": { - "type": "string", - "example": "2019" - }, - "color": { - "type": "string", - "example": "blue" - }, - "massinro": { - "type": "string" - }, - "massladen": { - "type": "string" - }, - "taxGroup": { - "type": "string" - }, - "registeredOn": { - "type": "string", - "format": "date-time" - }, - "category": { - "type": "string", - "enum": [ - "light", - "heavy" - ] - }, - "country": { - "type": "string", - "description": "Country code", - "maxLength": 2, - "example": "is" - }, - "operator": { - "title": "Owner or Operator", - "type": "object", - "required": [ - "ssn", - "name" - ], - "properties": { - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "insuranceCode": { - "type": "string" - }, - "registrationDate": { - "type": "string", - "format": "date-time" - }, - "purchaseDate": { - "type": "string", - "format": "date-time" - } - }, - "$id": "VehicleOwner" - }, - "owner": { - "title": "Owner or Operator", - "type": "object", - "required": [ - "ssn", - "name" - ], - "properties": { - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "insuranceCode": { - "type": "string" - }, - "registrationDate": { - "type": "string", - "format": "date-time" - }, - "purchaseDate": { - "type": "string", - "format": "date-time" - } - }, - "$id": "VehicleOwner" - } - } - }, - "VehicleLookup": { - "type": "object", - "oneOf": [ - { - "required": [ - "plate" - ] - }, - { - "required": [ - "id" - ] - } - ], - "properties": { - "plate": { - "type": "string", - "example": "ICE222" - }, - "id": { - "description": "Id of vehicle know to us", - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623" - } - } - }, - "VehicleOwner": { - "title": "Owner or Operator", - "type": "object", - "required": [ - "ssn", - "name" - ], - "properties": { - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "insuranceCode": { - "type": "string" - }, - "registrationDate": { - "type": "string", - "format": "date-time" - }, - "purchaseDate": { - "type": "string", - "format": "date-time" - } - } - }, - "Visit": { - "title": "Visit", - "type": "object", - "required": [ - "id", - "startedOn", - "plate", - "status" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623" - }, - "startedOn": { - "type": "string", - "format": "date-time" - }, - "endedOn": { - "type": "string", - "format": "date-time" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE111" - }, - "status": { - "type": "string", - "enum": [ - "new", - "need-payment", - "need-plate", - "completed" - ] - }, - "paymentStatus": { - "type": "string", - "enum": [ - "whitelisted", - "kiosk", - "company-invoice", - "owner-invoice", - "failed", - "void" - ] - }, - "price": { - "type": "object", - "nullable": true, - "properties": { - "amount": { - "type": "number", - "example": 1250 - }, - "currency": { - "type": "string", - "maxLength": 3, - "minLength": 3, - "example": "ISK" - } - }, - "$id": "Money" - }, - "vehicle": { - "title": "Vehicle", - "type": "object", - "required": [ - "id", - "useGroup", - "vehicleCategory", - "registeredOn" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "deb4b244-945f-45c8-a67c-dc7939387ed6" - }, - "regno": { - "type": "string" - }, - "permno": { - "type": "string" - }, - "vin": { - "type": "string" - }, - "vehicleCategory": { - "type": "string" - }, - "vehicleGroup": { - "type": "string" - }, - "useGroup": { - "type": "string" - }, - "make": { - "type": "string", - "example": "Volvo" - }, - "model": { - "type": "string" - }, - "modelYear": { - "type": "string", - "example": "2019" - }, - "color": { - "type": "string", - "example": "blue" - }, - "massinro": { - "type": "string" - }, - "massladen": { - "type": "string" - }, - "taxGroup": { - "type": "string" - }, - "registeredOn": { - "type": "string", - "format": "date-time" - }, - "category": { - "type": "string", - "enum": [ - "light", - "heavy" - ] - }, - "country": { - "type": "string", - "description": "Country code", - "maxLength": 2, - "example": "is" - }, - "operator": { - "title": "Owner or Operator", - "type": "object", - "required": [ - "ssn", - "name" - ], - "properties": { - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "insuranceCode": { - "type": "string" - }, - "registrationDate": { - "type": "string", - "format": "date-time" - }, - "purchaseDate": { - "type": "string", - "format": "date-time" - } - }, - "$id": "VehicleOwner" - }, - "owner": { - "title": "Owner or Operator", - "type": "object", - "required": [ - "ssn", - "name" - ], - "properties": { - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "insuranceCode": { - "type": "string" - }, - "registrationDate": { - "type": "string", - "format": "date-time" - }, - "purchaseDate": { - "type": "string", - "format": "date-time" - } - }, - "$id": "VehicleOwner" - } - }, - "$id": "Vehicle" - }, - "customer": { - "title": "Customer", - "type": "object", - "required": [ - "id", - "language" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" - }, - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "email": { - "type": "string", - "format": "email", - "nullable": true - }, - "phone": { - "type": "string", - "nullable": true, - "example": "4648700" - }, - "language": { - "type": "string", - "maxLength": 2, - "minLength": 2, - "example": "is" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "options": { - "type": "object", - "properties": { - "sendInvoicesToEmail": { - "type": "boolean" - }, - "sendInvoicesToPublishingSystem": { - "type": "boolean" - }, - "billingMethod": { - "type": "string", - "enum": [ - "daily", - "monthly" - ] - }, - "billingSsn": { - "type": "string" - } - }, - "$id": "CustomerOption" - } - }, - "$id": "Customer" - }, - "entrancePhoto": { - "type": "object", - "required": [ - "id", - "capturedOn", - "plate", - "status", - "camera" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" - }, - "capturedOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE333" - }, - "score": { - "type": "integer" - }, - "url": { - "type": "string", - "nullable": true - }, - "status": { - "type": "string", - "enum": [ - "new", - "need-review", - "force-review", - "reviewed", - "deleted", - "failed" - ] - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "camera": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" - }, - "name": { - "type": "string", - "example": "Entrance camera" - }, - "brand": { - "type": "string", - "example": "Raftakn" - }, - "location": { - "type": "string", - "enum": [ - "entrance", - "exit" - ] - } - }, - "$id": "Camera" - } - }, - "$id": "Photo" - }, - "exitPhoto": { - "type": "object", - "required": [ - "id", - "capturedOn", - "plate", - "status", - "camera" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" - }, - "capturedOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE333" - }, - "score": { - "type": "integer" - }, - "url": { - "type": "string", - "nullable": true - }, - "status": { - "type": "string", - "enum": [ - "new", - "need-review", - "force-review", - "reviewed", - "deleted", - "failed" - ] - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "camera": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" - }, - "name": { - "type": "string", - "example": "Entrance camera" - }, - "brand": { - "type": "string", - "example": "Raftakn" - }, - "location": { - "type": "string", - "enum": [ - "entrance", - "exit" - ] - } - }, - "$id": "Camera" - } - }, - "$id": "Photo" - }, - "invoice": { - "title": "Invoice object", - "type": "object", - "readOnly": true, - "required": [ - "id", - "status", - "language" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623" - }, - "status": { - "type": "string", - "enum": [ - "paid", - "refunded", - "incomplete", - "failed", - "draft" - ] - }, - "productId": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623", - "nullable": true - }, - "price": { - "type": "object", - "nullable": true, - "properties": { - "amount": { - "type": "number", - "example": 1250 - }, - "currency": { - "type": "string", - "maxLength": 3, - "minLength": 3, - "example": "ISK" - } - }, - "$id": "Money" - }, - "invoiceEmail": { - "type": "string", - "format": "email" - }, - "language": { - "type": "string", - "enum": [ - "is", - "en" - ] - }, - "receipt": { - "description": "Payment receipt", - "type": "object", - "readOnly": true, - "properties": { - "type": { - "type": "string", - "enum": [ - "visa", - "mastercard", - "amex", - "discover", - "other", - "electron", - "maestro" - ] - }, - "card": { - "type": "string", - "description": "Masked Card Number", - "example": "****-****-****-4444" - } - }, - "$id": "Receipt" - }, - "createdOn": { - "type": "string", - "format": "date-time" - } - }, - "$id": "Invoice" - } - } - }, - "VisitsResponse": { - "type": "object", - "readOnly": true, - "properties": { - "next": { - "type": "string", - "nullable": true - }, - "previous": { - "type": "string", - "nullable": true - }, - "total": { - "nullable": true, - "type": "integer" - }, - "extra": { - "nullable": true, - "type": "object" - }, - "visits": { - "type": "array", - "items": { - "title": "Visit", - "type": "object", - "required": [ - "id", - "startedOn", - "plate", - "status" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623" - }, - "startedOn": { - "type": "string", - "format": "date-time" - }, - "endedOn": { - "type": "string", - "format": "date-time" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE111" - }, - "status": { - "type": "string", - "enum": [ - "new", - "need-payment", - "need-plate", - "completed" - ] - }, - "paymentStatus": { - "type": "string", - "enum": [ - "whitelisted", - "kiosk", - "company-invoice", - "owner-invoice", - "failed", - "void" - ] - }, - "price": { - "type": "object", - "nullable": true, - "properties": { - "amount": { - "type": "number", - "example": 1250 - }, - "currency": { - "type": "string", - "maxLength": 3, - "minLength": 3, - "example": "ISK" - } - }, - "$id": "Money" - }, - "vehicle": { - "title": "Vehicle", - "type": "object", - "required": [ - "id", - "useGroup", - "vehicleCategory", - "registeredOn" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "deb4b244-945f-45c8-a67c-dc7939387ed6" - }, - "regno": { - "type": "string" - }, - "permno": { - "type": "string" - }, - "vin": { - "type": "string" - }, - "vehicleCategory": { - "type": "string" - }, - "vehicleGroup": { - "type": "string" - }, - "useGroup": { - "type": "string" - }, - "make": { - "type": "string", - "example": "Volvo" - }, - "model": { - "type": "string" - }, - "modelYear": { - "type": "string", - "example": "2019" - }, - "color": { - "type": "string", - "example": "blue" - }, - "massinro": { - "type": "string" - }, - "massladen": { - "type": "string" - }, - "taxGroup": { - "type": "string" - }, - "registeredOn": { - "type": "string", - "format": "date-time" - }, - "category": { - "type": "string", - "enum": [ - "light", - "heavy" - ] - }, - "country": { - "type": "string", - "description": "Country code", - "maxLength": 2, - "example": "is" - }, - "operator": { - "title": "Owner or Operator", - "type": "object", - "required": [ - "ssn", - "name" - ], - "properties": { - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "insuranceCode": { - "type": "string" - }, - "registrationDate": { - "type": "string", - "format": "date-time" - }, - "purchaseDate": { - "type": "string", - "format": "date-time" - } - }, - "$id": "VehicleOwner" - }, - "owner": { - "title": "Owner or Operator", - "type": "object", - "required": [ - "ssn", - "name" - ], - "properties": { - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "insuranceCode": { - "type": "string" - }, - "registrationDate": { - "type": "string", - "format": "date-time" - }, - "purchaseDate": { - "type": "string", - "format": "date-time" - } - }, - "$id": "VehicleOwner" - } - }, - "$id": "Vehicle" - }, - "customer": { - "title": "Customer", - "type": "object", - "required": [ - "id", - "language" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" - }, - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "email": { - "type": "string", - "format": "email", - "nullable": true - }, - "phone": { - "type": "string", - "nullable": true, - "example": "4648700" - }, - "language": { - "type": "string", - "maxLength": 2, - "minLength": 2, - "example": "is" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "options": { - "type": "object", - "properties": { - "sendInvoicesToEmail": { - "type": "boolean" - }, - "sendInvoicesToPublishingSystem": { - "type": "boolean" - }, - "billingMethod": { - "type": "string", - "enum": [ - "daily", - "monthly" - ] - }, - "billingSsn": { - "type": "string" - } - }, - "$id": "CustomerOption" - } - }, - "$id": "Customer" - }, - "entrancePhoto": { - "type": "object", - "required": [ - "id", - "capturedOn", - "plate", - "status", - "camera" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" - }, - "capturedOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE333" - }, - "score": { - "type": "integer" - }, - "url": { - "type": "string", - "nullable": true - }, - "status": { - "type": "string", - "enum": [ - "new", - "need-review", - "force-review", - "reviewed", - "deleted", - "failed" - ] - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "camera": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" - }, - "name": { - "type": "string", - "example": "Entrance camera" - }, - "brand": { - "type": "string", - "example": "Raftakn" - }, - "location": { - "type": "string", - "enum": [ - "entrance", - "exit" - ] - } - }, - "$id": "Camera" - } - }, - "$id": "Photo" - }, - "exitPhoto": { - "type": "object", - "required": [ - "id", - "capturedOn", - "plate", - "status", - "camera" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" - }, - "capturedOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE333" - }, - "score": { - "type": "integer" - }, - "url": { - "type": "string", - "nullable": true - }, - "status": { - "type": "string", - "enum": [ - "new", - "need-review", - "force-review", - "reviewed", - "deleted", - "failed" - ] - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "camera": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" - }, - "name": { - "type": "string", - "example": "Entrance camera" - }, - "brand": { - "type": "string", - "example": "Raftakn" - }, - "location": { - "type": "string", - "enum": [ - "entrance", - "exit" - ] - } - }, - "$id": "Camera" - } - }, - "$id": "Photo" - }, - "invoice": { - "title": "Invoice object", - "type": "object", - "readOnly": true, - "required": [ - "id", - "status", - "language" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623" - }, - "status": { - "type": "string", - "enum": [ - "paid", - "refunded", - "incomplete", - "failed", - "draft" - ] - }, - "productId": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623", - "nullable": true - }, - "price": { - "type": "object", - "nullable": true, - "properties": { - "amount": { - "type": "number", - "example": 1250 - }, - "currency": { - "type": "string", - "maxLength": 3, - "minLength": 3, - "example": "ISK" - } - }, - "$id": "Money" - }, - "invoiceEmail": { - "type": "string", - "format": "email" - }, - "language": { - "type": "string", - "enum": [ - "is", - "en" - ] - }, - "receipt": { - "description": "Payment receipt", - "type": "object", - "readOnly": true, - "properties": { - "type": { - "type": "string", - "enum": [ - "visa", - "mastercard", - "amex", - "discover", - "other", - "electron", - "maestro" - ] - }, - "card": { - "type": "string", - "description": "Masked Card Number", - "example": "****-****-****-4444" - } - }, - "$id": "Receipt" - }, - "createdOn": { - "type": "string", - "format": "date-time" - } - }, - "$id": "Invoice" - } - }, - "$id": "Visit" - } - } - } - }, - "Whitelist": { - "title": "Visit", - "type": "object", - "required": [ - "plate", - "reason" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623" - }, - "activeFrom": { - "type": "string", - "nullable": true, - "format": "date-time" - }, - "expireOn": { - "type": "string", - "nullable": true, - "format": "date-time" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE111" - }, - "reason": { - "type": "string" - }, - "author": { - "type": "string", - "nullable": true - } - } - }, - "WhitelistBaseEntry": { - "title": "WhitelistBaseEntry", - "type": "object", - "required": [ - "plate", - "reason", - "objectType" - ], - "discriminator": { - "propertyName": "objectType" - }, - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623" - }, - "author": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "plate": { - "type": "string", - "example": "ICE111" - }, - "activeFrom": { - "type": "string", - "nullable": true, - "format": "date-time" - }, - "expireOn": { - "type": "string", - "nullable": true, - "format": "date-time" - }, - "createdOn": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "reason": { - "type": "string" - }, - "objectType": { - "type": "string" - } - } - }, - "WhitelistEntries": { - "type": "object", - "readOnly": true, - "required": [ - "entries" - ], - "additionalProperties": false, - "properties": { - "next": { - "type": "string", - "nullable": true - }, - "previous": { - "type": "string", - "nullable": true - }, - "entries": { - "type": "array", - "nullable": false, - "items": { - "title": "WhitelistBaseEntry", - "type": "object", - "required": [ - "plate", - "reason", - "objectType" - ], - "discriminator": { - "propertyName": "objectType" - }, - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623" - }, - "author": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "plate": { - "type": "string", - "example": "ICE111" - }, - "activeFrom": { - "type": "string", - "nullable": true, - "format": "date-time" - }, - "expireOn": { - "type": "string", - "nullable": true, - "format": "date-time" - }, - "createdOn": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "reason": { - "type": "string" - }, - "objectType": { - "type": "string" - } - }, - "$id": "WhitelistBaseEntry" - } - } - } - }, - "WhitelistResponse": { - "type": "object", - "readOnly": true, - "properties": { - "next": { - "type": "string", - "nullable": true - }, - "previous": { - "type": "string", - "nullable": true - }, - "whitelists": { - "type": "array", - "items": { - "title": "Visit", - "type": "object", - "required": [ - "plate", - "reason" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623" - }, - "activeFrom": { - "type": "string", - "nullable": true, - "format": "date-time" - }, - "expireOn": { - "type": "string", - "nullable": true, - "format": "date-time" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE111" - }, - "reason": { - "type": "string" - }, - "author": { - "type": "string", - "nullable": true - } - }, - "$id": "Whitelist" - } - } - } - } - }, - "securitySchemes": { - "api-key": { - "name": "X-Api-Key", - "type": "apiKey", - "in": "header", - "description": "Key for none account related endpoints" - }, - "bearer-token": { - "type": "http", - "scheme": "bearer", - "description": "There are 3 types of bearer tokens. \n1. account specific\n2. role specific - used for webhooks and kiosks\n3. location specific - used when endpoints redirect" - }, - "hook-security": { - "name": "wak", - "type": "apiKey", - "in": "query", - "description": "Uses a bearer token that is valid for one endpoint only" - } - }, - "responses": { - "InternalError": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - } - }, - "NotFound": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - } - }, - "Unauthorized": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - } - }, - "Forbidden": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - }, - "$id": "Error" - } - } - } - }, - "InputError": { - "description": "Generic input error", - "content": { - "application/json": { - "schema": { - "title": "Exception handle by underlying system", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "exception": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "messages": { - "type": "string", - "nullable": true - } - }, - "$id": "ErrorException" - } - } - } - }, - "Redirect": { - "description": "Generic redirect response", - "headers": { - "Location": { - "description": "new location for resource", - "schema": { - "type": "string" - } - } - } - }, - "WebhookResponse": { - "description": "Generic redirect response", - "content": { - "*/*": { - "schema": { - "type": "object", - "properties": { - "acknowledge": { - "type": "boolean" - } - } - } - } - } - }, - "WrongEndpoint": { - "description": "Error that happens when creating already created data", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "messages": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid" - } - } - } - } - } - } - }, - "requestBodies": { - "CreateAccountPayload": { - "description": "Create account payload", - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "account": { - "title": "Account", - "type": "object", - "required": [ - "id", - "role", - "status" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "role": { - "type": "string", - "enum": [ - "operator", - "customer", - "partner" - ] - }, - "name": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "active", - "inactive" - ] - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "options": { - "type": "object", - "properties": { - "free-parking-time": { - "type": "string" - }, - "expireTime": { - "type": "string", - "description": "Default expire time for whitelist entries.\nAccepts formats from https://www.php.net/manual/en/datetime.formats.php" - } - } - } - }, - "$id": "Account" - }, - "customer": { - "title": "Customer", - "type": "object", - "required": [ - "id", - "language" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" - }, - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "email": { - "type": "string", - "format": "email", - "nullable": true - }, - "phone": { - "type": "string", - "nullable": true, - "example": "4648700" - }, - "language": { - "type": "string", - "maxLength": 2, - "minLength": 2, - "example": "is" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "options": { - "type": "object", - "properties": { - "sendInvoicesToEmail": { - "type": "boolean" - }, - "sendInvoicesToPublishingSystem": { - "type": "boolean" - }, - "billingMethod": { - "type": "string", - "enum": [ - "daily", - "monthly" - ] - }, - "billingSsn": { - "type": "string" - } - }, - "$id": "CustomerOption" - } - }, - "$id": "Customer" - }, - "authentication": { - "type": "object", - "required": [ - "email", - "password" - ], - "properties": { - "email": { - "type": "string", - "format": "email" - }, - "password": { - "type": "string", - "format": "password" - }, - "expire": { - "type": "string", - "nullable": true, - "format": "date-time" - } - }, - "$id": "PasswordInfo" - } - }, - "required": [ - "account" - ] - } - } - } - }, - "CreateCustomerPayload": { - "description": "Create customer", - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "account": { - "oneOf": [ - { - "title": "Account", - "type": "object", - "required": [ - "id", - "role", - "status" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "role": { - "type": "string", - "enum": [ - "operator", - "customer", - "partner" - ] - }, - "name": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "active", - "inactive" - ] - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "options": { - "type": "object", - "properties": { - "free-parking-time": { - "type": "string" - }, - "expireTime": { - "type": "string", - "description": "Default expire time for whitelist entries.\nAccepts formats from https://www.php.net/manual/en/datetime.formats.php" - } - } - } - }, - "$id": "Account" - }, - { - "x-required": "self", - "type": "string", - "format": "uuid", - "example": "040546c4-58bd-49cf-9741-6cb42daf6728", - "$id": "AccountId" - } - ] - }, - "customer": { - "title": "Customer", - "type": "object", - "required": [ - "id", - "language" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" - }, - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "email": { - "type": "string", - "format": "email", - "nullable": true - }, - "phone": { - "type": "string", - "nullable": true, - "example": "4648700" - }, - "language": { - "type": "string", - "maxLength": 2, - "minLength": 2, - "example": "is" - }, - "createdOn": { - "type": "string", - "format": "date-time" + "nullable": true, + "example": "Albert Albertsson" }, "options": { "type": "object", "properties": { - "sendInvoicesToEmail": { - "type": "boolean" - }, - "sendInvoicesToPublishingSystem": { - "type": "boolean" - }, - "billingMethod": { - "type": "string", - "enum": [ - "daily", - "monthly" - ] - }, "billingSsn": { "type": "string" } @@ -13272,460 +144,12 @@ } }, "required": [ - "account", "customer" ] } } } - }, - "CreateRoleBearerToken": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "role": { - "type": "string", - "enum": [ - "webhook", - "kiosk", - "whitelist" - ] - } - } - } - } - } - }, - "PasswordLogin": { - "description": "Password based login payload", - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "device_uuid": { - "type": "string", - "format": "uuid" - }, - "provider": { - "type": "string", - "enum": [ - "password", - "lost-password", - "change-password", - "token" - ] - }, - "id": { - "type": "string" - }, - "password": { - "type": "string", - "format": "password" - } - }, - "required": [ - "device_uuid", - "provider", - "id", - "password" - ] - } - } - } - }, - "PurchaseProduct": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "vehicle", - "customer", - "product", - "card" - ], - "properties": { - "vehicle": { - "type": "object", - "oneOf": [ - { - "required": [ - "plate" - ] - }, - { - "required": [ - "id" - ] - } - ], - "properties": { - "plate": { - "type": "string", - "example": "ICE222" - }, - "id": { - "description": "Id of vehicle know to us", - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623" - } - }, - "$id": "VehicleLookup" - }, - "customer": { - "anyOf": [ - { - "title": "SimpleCustomer", - "type": "object", - "required": [ - "name", - "language" - ], - "properties": { - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "email": { - "type": "string", - "format": "email", - "nullable": true - }, - "phone": { - "type": "string", - "nullable": true, - "example": "4648700" - }, - "language": { - "type": "string", - "maxLength": 2, - "minLength": 2, - "example": "is" - } - }, - "$id": "SimpleCustomer" - }, - { - "title": "Customer", - "type": "object", - "required": [ - "id", - "language" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" - }, - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "email": { - "type": "string", - "format": "email", - "nullable": true - }, - "phone": { - "type": "string", - "nullable": true, - "example": "4648700" - }, - "language": { - "type": "string", - "maxLength": 2, - "minLength": 2, - "example": "is" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "options": { - "type": "object", - "properties": { - "sendInvoicesToEmail": { - "type": "boolean" - }, - "sendInvoicesToPublishingSystem": { - "type": "boolean" - }, - "billingMethod": { - "type": "string", - "enum": [ - "daily", - "monthly" - ] - }, - "billingSsn": { - "type": "string" - } - }, - "$id": "CustomerOption" - } - }, - "$id": "Customer" - } - ] - }, - "product": { - "x-required": "self", - "type": "string", - "format": "uuid", - "example": "040546c4-58bd-49cf-9741-6cb42daf6728", - "$id": "ProductId" - }, - "card": { - "type": "object", - "required": [ - "number", - "expire" - ], - "properties": { - "number": { - "type": "string" - }, - "ccv": { - "type": "string" - }, - "expire": { - "type": "string", - "format": "date" - } - }, - "$id": "Card" - }, - "provider": { - "type": "string", - "enum": [ - "borgun", - "valitor-pay", - "testing", - "testing2" - ] - } - } - } - } - } - }, - "RegisterKioskPayment": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "plate", - "quantity", - "product", - "card", - "language" - ], - "properties": { - "plate": { - "type": "string", - "example": "ICE222" - }, - "quantity": { - "description": "The number of \"time units\". Each time unit is 24 hours in this case", - "type": "number", - "example": 1 - }, - "product": { - "anyOf": [ - { - "x-required": "self", - "type": "string", - "format": "uuid", - "example": "040546c4-58bd-49cf-9741-6cb42daf6728", - "$id": "ProductId" - }, - { - "x-required": "self", - "type": "string", - "$id": "ProductCode" - } - ] - }, - "card": { - "anyOf": [ - { - "description": "Simplified card information without ppi", - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "visa", - "mastercard", - "amex", - "discover", - "other", - "electron", - "maestro" - ] - }, - "last_four": { - "type": "string", - "maxLength": 4, - "minLength": 4, - "example": "4444" - } - }, - "$id": "ReceiptCard" - }, - { - "type": "object", - "required": [ - "number", - "expire" - ], - "properties": { - "number": { - "type": "string" - }, - "ccv": { - "type": "string" - }, - "expire": { - "type": "string", - "format": "date" - } - }, - "$id": "Card" - } - ] - }, - "payment": { - "type": "object", - "nullable": true, - "required": [ - "amount", - "currency", - "transactionId", - "authorizationId" - ], - "properties": { - "amount": { - "type": "number", - "example": 1250 - }, - "currency": { - "type": "string", - "maxLength": 3, - "minLength": 3, - "example": "ISK" - }, - "transactionId": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "number" - } - ] - }, - "authorizationId": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "number" - } - ] - } - }, - "$id": "Payment" - }, - "language": { - "type": "string", - "enum": [ - "is", - "en" - ] - }, - "email": { - "description": "Email address for receipts. If specified the API should send a email with a receipt.", - "type": "string", - "nullable": true - } - } - } - } - } - }, - "TokenLogin": { - "description": "Change password login payload", - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "device_uuid": { - "type": "string", - "format": "uuid" - }, - "provider": { - "type": "string", - "enum": [ - "lost-password", - "change-password", - "token" - ] - }, - "token": { - "type": "string" - } - }, - "required": [ - "device_uuid", - "provider", - "token" - ] - } - } - } } } - }, - "security": [ - { - "bearer-token": [] - } - ] + } } diff --git a/tests/inlined-schemas/inline-nested-internal-refs/schema.json b/tests/inlined-schemas/inline-nested-internal-refs/schema.json index c7589f0..83a6684 100644 --- a/tests/inlined-schemas/inline-nested-internal-refs/schema.json +++ b/tests/inlined-schemas/inline-nested-internal-refs/schema.json @@ -9,3601 +9,74 @@ "email": "no-support@stefna.is" } }, - "servers": [ - { - "description": "production", - "url": "https://api.checkit.is" - }, - { - "description": "staging", - "url": "https://staging.api.checkit.is" - }, - { - "description": "development", - "url": "http://localhost:9988" - }, - { - "description": "testing", - "url": "http://localhost:9856" - } - ], - "tags": [ - { - "name": "Kiosk", - "description": "Endpoints that can be accessed from kiosks.\n\nKiosks must only use custom create Bearer tokens for authentication. And shall not contain the api key. " - }, - { - "name": "Visits" - }, - { - "name": "Products" - }, - { - "name": "Admin" - }, - { - "name": "Testing", - "description": "endpoints only available in development and testing" - }, - { - "name": "Webhook", - "description": "endpoints used by webhooks" - }, - { - "name": "Whitelist", - "description": "Endpoints related to whitelisting " - }, - { - "name": "Photo", - "description": "Endpoints related to photos " - }, - { - "name": "Account", - "description": "Endpoints related to accounts and customers " - } - ], - "paths": { - "/auth/login": { - "post": { - "tags": [ - "Admin" - ], - "summary": "Authenticate accounts", - "operationId": "createBearerToken", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AuthenticatedAccount" - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - }, - "security": [ - { - "api-key": [] - } - ], - "requestBody": { - "$ref": "#/components/requestBodies/PasswordLogin" - } - }, - "parameters": [] - }, - "/accounts": { - "post": { - "summary": "Create new account", - "operationId": "createAccount", - "tags": [ - "Account" - ], - "responses": { - "201": { - "description": "OK" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - }, - "requestBody": { - "$ref": "#/components/requestBodies/CreateAccountPayload" - } - }, - "get": { - "summary": "List accounts", - "operationId": "searchAccounts", - "tags": [ - "Account" - ], - "parameters": [ - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "next" - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AccountsResponse" - } - } - } - } - } - } - }, - "/account/{id}": { - "parameters": [ - { - "schema": { - "type": "string", - "format": "uuid" - }, - "name": "id", - "in": "path", - "required": true - } - ], - "get": { - "summary": "Retrieve single account", - "operationId": "getAccount", - "tags": [ - "Account" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Account" - } - } - } - }, - "400": { - "$ref": "#/components/responses/InputError" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - } - }, - "put": { - "summary": "Update account", - "operationId": "updateAccount", - "tags": [ - "Account" - ], - "responses": { - "200": { - "description": "Account updated" - }, - "303": { - "$ref": "#/components/responses/Redirect" - }, - "400": { - "$ref": "#/components/responses/InputError" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - }, - "requestBody": { - "required": true, - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/Account" - } - } - } - } - }, - "delete": { - "summary": "Remove account", - "operationId": "deleteAccount", - "tags": [ - "Account" - ], - "responses": { - "204": { - "description": "ok" - }, - "400": { - "$ref": "#/components/responses/InputError" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - } - } - }, - "/account/{id}/logins": { - "parameters": [ - { - "schema": { - "type": "string", - "format": "uuid" - }, - "name": "id", - "in": "path", - "required": true - } - ], - "get": { - "summary": "Get login alternatives for account", - "operationId": "getAccountLogins", - "tags": [ - "Account" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AccountLogin" - } - } - } - } - } - } - }, - "post": { - "summary": "Create login credentials", - "operationId": "createAccountLogin", - "tags": [ - "Account" - ], - "responses": { - "201": { - "description": "Account login created" - }, - "303": { - "$ref": "#/components/responses/Redirect" - }, - "400": { - "$ref": "#/components/responses/InputError" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - }, - "requestBody": { - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/PasswordInfo" - } - } - } - } - }, - "delete": { - "summary": "Delete account login", - "operationId": "deleteAccountLogin", - "tags": [ - "Account" - ], - "parameters": [ - { - "schema": { - "type": "string", - "format": "email" - }, - "in": "query", - "name": "email", - "required": true - } - ], - "responses": { - "204": { - "description": "ok" - }, - "400": { - "$ref": "#/components/responses/InputError" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - } - } - }, - "/customers": { - "post": { - "summary": "Create customer", - "operationId": "createCustomer", - "tags": [ - "Account" - ], - "responses": { - "201": { - "description": "OK" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - }, - "requestBody": { - "$ref": "#/components/requestBodies/CreateCustomerPayload" - } - }, - "get": { - "summary": "Search customers", - "operationId": "searchCustomers", - "tags": [ - "Account" - ], - "parameters": [ - { - "schema": { - "type": "string", - "enum": [ - "latest", - "want-monthly-billing" - ] - }, - "in": "query", - "name": "collection", - "description": "Pre defined search collections" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "name", - "description": "Find by customer name supports wildcard" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "email", - "description": "Find by customer email supports wildcard" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "ssn", - "description": "Find by customer kennitala supports wildcard" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "next" - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CustomersResponse" - } - } - } - } - } - } - }, - "/customer/{id}": { - "parameters": [ - { - "schema": { - "type": "string", - "format": "uuid" - }, - "name": "id", - "in": "path", - "required": true - } - ], - "get": { - "summary": "Retrieve single customer", - "operationId": "getCustomer", - "tags": [ - "Account" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Customer" - } - } - } - }, - "400": { - "$ref": "#/components/responses/InputError" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - } - }, - "put": { - "summary": "Update customer", - "operationId": "updateCustomer", - "tags": [ - "Account" - ], - "requestBody": { - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/Customer" - } - } - } - }, - "responses": { - "301": { - "$ref": "#/components/responses/Redirect" - }, - "303": { - "$ref": "#/components/responses/Redirect" - }, - "400": { - "$ref": "#/components/responses/InputError" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - } - } - }, - "/visits": { - "get": { - "summary": "Search visits", - "operationId": "getVisits", - "tags": [ - "Visits" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VisitsResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/InputError" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - }, - "description": "List and filter visits\n\nIf bearer token does not belong to operator list will be filter on customerId", - "parameters": [ - { - "schema": { - "type": "string", - "enum": [ - "new", - "open", - "review", - "closed", - "need-payment" - ] - }, - "in": "query", - "name": "status", - "description": "Visit status" - }, - { - "schema": { - "type": "string", - "enum": [ - "latest", - "export", - "open", - "checkin", - "unpaid" - ] - }, - "in": "query", - "name": "collection", - "description": "Pre defined search collections" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "plate", - "description": "Find by licence plate supports wildcard" - }, - { - "schema": { - "type": "string", - "format": "date" - }, - "in": "query", - "name": "date", - "description": "Visits on this day" - }, - { - "schema": { - "type": "string", - "format": "date-time", - "example": "2020-07-23T07:12:52+02:00" - }, - "in": "query", - "name": "date.from" - }, - { - "schema": { - "type": "string", - "format": "date-time", - "example": "2020-07-23T07:12:52+02:00" - }, - "in": "query", - "name": "date.to" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "card.lastFour" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "next" - }, - { - "schema": { - "type": "string", - "enum": [ - "whitelisted", - "kiosk", - "company-invoice", - "owner-invoice", - "failed", - "void" - ] - }, - "in": "query", - "name": "payment.status", - "description": "Payment status" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "ssn", - "description": "Find by vehicle owner" - }, - { - "schema": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "price" - ] - }, - "uniqueItems": true - }, - "style": "form", - "explode": false, - "in": "query", - "name": "aggregate", - "description": "Find by vehicle owner" - } - ] - }, - "post": { - "summary": "Create visit", - "operationId": "createVisit", - "tags": [ - "Visits" - ], - "responses": { - "200": { - "description": "Visit created" - }, - "301": { - "$ref": "#/components/responses/Redirect" - }, - "303": { - "$ref": "#/components/responses/Redirect" - }, - "400": { - "$ref": "#/components/responses/InputError" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "422": { - "$ref": "#/components/responses/WrongEndpoint" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - }, - "requestBody": { - "required": true, - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/Visit" - } - } - } - } - } - }, - "/visits/counts": { - "get": { - "summary": "Get visit counts", - "operationId": "countVisits", - "tags": [ - "Visits" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "count": { - "type": "integer" - } - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/InputError" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - }, - "description": "List and filter visits\n\nIf bearer token does not belong to operator list will be filter on customerId", - "parameters": [ - { - "schema": { - "type": "string", - "enum": [ - "new", - "open", - "review", - "closed", - "need-payment" - ] - }, - "in": "query", - "name": "status", - "description": "Visit status" - }, - { - "schema": { - "type": "string", - "enum": [ - "latest", - "export", - "open", - "checkin" - ] - }, - "in": "query", - "name": "collection", - "description": "Pre defined search collections" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "plate", - "description": "Find by licence plate supports wildcard" - }, - { - "schema": { - "type": "string", - "format": "date" - }, - "in": "query", - "name": "date", - "description": "Visits on this day" - }, - { - "schema": { - "type": "string", - "format": "date-time", - "example": "2020-07-23T07:12:52+02:00" - }, - "in": "query", - "name": "date.from" - }, - { - "schema": { - "type": "string", - "format": "date-time", - "example": "2020-07-23T07:12:52+02:00" - }, - "in": "query", - "name": "date.to" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "card.lastFour" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "next" - }, - { - "schema": { - "type": "string", - "enum": [ - "whitelisted", - "kiosk", - "company-invoice", - "owner-invoice", - "failed", - "void" - ] - }, - "in": "query", - "name": "payment.status", - "description": "Payment status" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "ssn", - "description": "Find by vehicle owner" - } - ] - } - }, - "/visit/{id}": { - "parameters": [ - { - "schema": { - "type": "string", - "format": "uuid" - }, - "name": "id", - "in": "path", - "required": true - } - ], - "get": { - "operationId": "getVisit", - "summary": "Retrieve visit", - "description": "If bearer token does not belong to operator list will be filter on customerId", - "tags": [ - "Visits" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Visit" - } - } - } - }, - "400": { - "$ref": "#/components/responses/InputError" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - } - }, - "put": { - "operationId": "updateVisit", - "summary": "Update visit", - "tags": [ - "Visits" - ], - "requestBody": { - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/Visit" - } - } - } - }, - "responses": { - "301": { - "$ref": "#/components/responses/Redirect" - }, - "303": { - "$ref": "#/components/responses/Redirect" - }, - "400": { - "$ref": "#/components/responses/InputError" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - } - } - }, - "/visit/{id}/renewVehicle": { - "post": { - "operationId": "renewVisitVehicleInformation", - "description": "Query IVR for new vehicle information", - "responses": { - "200": { - "description": "OK" - }, - "400": { - "$ref": "#/components/responses/InputError" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - } - }, - "parameters": [ - { - "schema": { - "type": "string", - "format": "uuid" - }, - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/visit/{id}/receipt": { - "parameters": [ - { - "schema": { - "type": "string", - "format": "uuid" - }, - "name": "id", - "in": "path", - "required": true - } - ], - "post": { - "operationId": "sendVisitReceipt", - "summary": "Send receipt to email", - "requestBody": { - "description": "Send receipt body", - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "email": { - "type": "string", - "format": "email" - }, - "language": { - "type": "string", - "enum": [ - "is", - "en" - ] - } - }, - "required": [ - "email", - "language" - ] - } - } - } - }, - "responses": { - "200": { - "description": "OK" - }, - "400": { - "$ref": "#/components/responses/InputError" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - } - } - }, - "/invoice/{id}": { - "parameters": [ - { - "schema": { - "type": "string", - "format": "uuid" - }, - "name": "id", - "in": "path", - "required": true - } - ], - "get": { - "operationId": "getInvoice", - "summary": "Retrieve invoice", - "description": "If bearer token does not belong to operator list will be filter on customerId", - "tags": [ - "Visits" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Invoice" - } - } - } - }, - "400": { - "$ref": "#/components/responses/InputError" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - } - } - }, - "/products": { - "get": { - "summary": "Get all products", - "operationId": "searchProducts", - "tags": [ - "Kiosk", - "Products" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Product" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/InputError" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - }, - "security": [ - { - "bearer-token": [] - }, - { - "api-key": [] - } - ] - } - }, - "/admin/create-role-bearer-token": { - "post": { - "summary": "Create role based bearer token", - "operationId": "createRoleBearerToken", - "requestBody": { - "$ref": "#/components/requestBodies/CreateRoleBearerToken" - }, - "tags": [ - "Admin" - ], - "responses": { - "200": { - "description": "Create new bearer token", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "access_token": { - "type": "string" - } - } - } - } - } - } - }, - "security": [ - { - "api-key": [] - } - ] - } - }, - "/kiosk/register-payment": { - "post": { - "tags": [ - "Kiosk" - ], - "summary": "Register payments for Kiosks", - "operationId": "registerKioskPayment", - "requestBody": { - "$ref": "#/components/requestBodies/RegisterKioskPayment" - }, - "responses": { - "200": { - "description": "Payment registered", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvoiceId" - } - } - } - }, - "400": { - "$ref": "#/components/responses/InputError" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - } - } - }, - "/kiosk/search-visits": { - "get": { - "summary": "Search visits", - "operationId": "kioskSearchVisits", - "tags": [ - "Kiosk" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VisitsResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/InputError" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - }, - "parameters": [ - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "plate", - "description": "Find by licence plate supports wildcard" - } - ] - } - }, - "/purchase-product": { - "post": { - "tags": [ - "Kiosk" - ], - "summary": "Purchase a product", - "operationId": "purchaseProduct", - "requestBody": { - "$ref": "#/components/requestBodies/PurchaseProduct" - }, - "responses": { - "200": { - "description": "Payment registered", - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/PaymentFormResponse" - }, - { - "$ref": "#/components/schemas/InvoiceId" - } - ] - } - } - } - }, - "400": { - "$ref": "#/components/responses/InputError" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - }, - "security": [ - { - "bearer-token": [] - }, - { - "api-key": [] - } - ] - } - }, - "/ping/bearer": { - "get": { - "tags": [ - "Testing" - ], - "operationId": "testBearerToken", - "responses": { - "200": { - "description": "OK" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - } - } - }, - "/ping/redirect": { - "post": { - "tags": [ - "Testing" - ], - "operationId": "testTokenRedirect", - "responses": { - "201": { - "description": "OK" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - } - } - }, - "get": { - "tags": [ - "Testing" - ], - "operationId": "testTacToken", - "responses": { - "200": { - "description": "OK" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - } - } - } - }, - "/ping/key": { - "get": { - "operationId": "testApiKey", - "tags": [ - "Testing" - ], - "responses": { - "200": { - "description": "OK" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - } - }, - "security": [ - { - "api-key": [] - } - ] - } - }, - "/ping/webhook": { - "post": { - "operationId": "testHookAccess", - "tags": [ - "Testing" - ], - "responses": { - "200": { - "description": "OK" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - } - }, - "security": [ - { - "hook-security": [], - "bearer-token": [] - } - ] - } - }, - "/ping/kiosk": { - "post": { - "operationId": "testKioskAccess", - "tags": [ - "Testing" - ], - "responses": { - "200": { - "description": "OK" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - } - }, - "security": [ - { - "bearer-token": [] - } - ] - } - }, - "/ping/whitelist": { - "post": { - "operationId": "testWhitelistAccess", - "tags": [ - "Testing" - ], - "responses": { - "200": { - "description": "OK" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - } - }, - "security": [ - { - "bearer-token": [] - } - ] - } - }, - "/photos/{type}": { - "parameters": [ - { - "schema": { - "type": "string", - "enum": [ - "open-alpr", - "open-alpr-test" - ] - }, - "name": "type", - "in": "path", - "required": true - } - ], - "post": { - "operationId": "importPhoto", - "summary": "Ingest new photo into system", - "requestBody": { - "content": { - "*/*": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenALPR" - } - ] - } - } - } - }, - "responses": { - "200": { - "description": "OK" - }, - "400": { - "$ref": "#/components/responses/InputError" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - }, - "security": [ - { - "hook-security": [] - }, - { - "bearer-token": [] - } - ] - } - }, - "/photos": { - "get": { - "summary": "Search photos", - "operationId": "searchPhotos", - "tags": [ - "Photo" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PhotoResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/InputError" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - }, - "parameters": [ - { - "schema": { - "type": "string", - "enum": [ - "need-review" - ] - }, - "in": "query", - "name": "collection", - "description": "Pre defined search collections" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "plate", - "description": "Find by licence plate supports wildcard" - }, - { - "schema": { - "type": "string", - "format": "date", - "example": "2020-07-23" - }, - "in": "query", - "name": "date", - "description": "Photo captured on date" - }, - { - "schema": { - "type": "string", - "format": "date-time", - "example": "2020-07-23T07:12:52+02:00" - }, - "in": "query", - "name": "date.from" - }, - { - "schema": { - "type": "string", - "format": "date-time", - "example": "2020-07-23T07:12:52+02:00" - }, - "in": "query", - "name": "date.to" - }, - { - "schema": { - "type": "string", - "format": "uuid" - }, - "in": "query", - "name": "camera.id" - }, - { - "schema": { - "type": "string", - "enum": [ - "entrance", - "exit" - ] - }, - "in": "query", - "name": "camera.location" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "next" - } - ] - } - }, - "/photo/{id}": { - "parameters": [ - { - "schema": { - "type": "string", - "format": "uuid" - }, - "name": "id", - "in": "path", - "required": true - } - ], - "get": { - "summary": "View photo", - "operationId": "getPhoto", - "tags": [ - "Photo" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Photo" - } - } - } - }, - "400": { - "$ref": "#/components/responses/InputError" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - } - }, - "put": { - "summary": "Update photo", - "operationId": "updatePhoto", - "tags": [ - "Photo" - ], - "responses": { - "200": { - "description": "Photo updated" - }, - "303": { - "$ref": "#/components/responses/Redirect" - }, - "400": { - "$ref": "#/components/responses/InputError" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - }, - "requestBody": { - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/Photo" - } - } - } - } - }, - "delete": { - "summary": "Remove photo", - "operationId": "deletePhoto", - "tags": [ - "Photo" - ], - "responses": { - "204": { - "description": "ok" - }, - "400": { - "$ref": "#/components/responses/InputError" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - } - } - }, - "/whitelist": { - "get": { - "summary": "List whitelisted vehicles", - "operationId": "getWhitelistedVehicles", - "tags": [ - "Whitelist" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/WhitelistResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/InputError" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - }, - "parameters": [ - { - "schema": { - "type": "string", - "enum": [ - "app", - "cpanel" - ] - }, - "in": "query", - "name": "collection", - "description": "Pre defined search collections" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "plate", - "description": "Find by licence plate supports wildcard" - }, - { - "schema": { - "type": "string", - "enum": [ - "on", - "off", - "1", - "0", - "true", - "false" - ] - }, - "in": "query", - "name": "active", - "description": "Active whitelisted plates" - }, - { - "schema": { - "type": "string", - "format": "date", - "example": "2020-07-23" - }, - "in": "query", - "name": "expire", - "description": "Plates expiring on day" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "next" - } - ] - }, - "post": { - "summary": "Add new plate to whitelist", - "operationId": "addWhitelistPlate", - "responses": { - "200": { - "description": "Plate added" - }, - "301": { - "$ref": "#/components/responses/Redirect" - }, - "303": { - "$ref": "#/components/responses/Redirect" - }, - "400": { - "$ref": "#/components/responses/InputError" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "422": { - "$ref": "#/components/responses/WrongEndpoint" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - }, - "requestBody": { - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/Whitelist" - } - } - } - } - } - }, - "/whitelist/{id}": { - "parameters": [ - { - "schema": { - "type": "string", - "format": "uuid" - }, - "name": "id", - "in": "path", - "required": true - } - ], - "get": { - "summary": "View whitelist entry", - "operationId": "getWhitelistEntry", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Whitelist" - } - } - } - }, - "400": { - "$ref": "#/components/responses/InputError" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - } - }, - "put": { - "deprecated": true, - "summary": "Update whitelist entry", - "operationId": "updateWhitelistEntry", - "responses": { - "200": { - "description": "Entry updated" - }, - "303": { - "$ref": "#/components/responses/Redirect" - }, - "400": { - "$ref": "#/components/responses/InputError" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - }, - "requestBody": { - "content": { - "*/*": { - "schema": { - "$ref": "#/components/schemas/Whitelist" - } - } - } - } - }, - "delete": { - "deprecated": true, - "summary": "Remove whitelist entry", - "operationId": "deleteWhitelistEntry", - "responses": { - "204": { - "description": "ok" - }, - "400": { - "$ref": "#/components/responses/InputError" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - } - } - } - }, - "components": { - "schemas": { - "Account": { - "title": "Account", - "type": "object", - "required": [ - "id", - "role", - "status" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "role": { - "type": "string", - "enum": [ - "operator", - "customer", - "partner" - ] - }, - "name": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "active", - "inactive" - ] - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "options": { - "type": "object", - "properties": { - "free-parking-time": { - "type": "string" - }, - "expireTime": { - "type": "string", - "description": "Default expire time for whitelist entries.\nAccepts formats from https://www.php.net/manual/en/datetime.formats.php" - } - } - } - } - }, - "AccountId": { - "x-required": "self", - "type": "string", - "format": "uuid", - "example": "040546c4-58bd-49cf-9741-6cb42daf6728" - }, - "AccountLogin": { - "title": "AccountLogin", - "type": "object", - "required": [ - "email" - ], - "properties": { - "accountId": { - "type": "string", - "format": "uuid" - }, - "email": { - "type": "string", - "format": "email" - }, - "expire": { - "type": "string", - "nullable": true, - "format": "date-time" - } - } - }, - "AccountsResponse": { - "type": "object", - "readOnly": true, - "properties": { - "next": { - "type": "string", - "nullable": true - }, - "previous": { - "type": "string", - "nullable": true - }, - "accounts": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Account" - } - } - } - }, - "AuthenticatedAccount": { - "title": "Wrapper around account and bearer token", - "type": "object", - "required": [ - "access_token", - "account" - ], - "properties": { - "access_token": { - "type": "string" - }, - "account": { - "$ref": "#/components/schemas/Account" - } - } - }, - "Camera": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "55aafb52-d3dc-42b7-a866-5fc4dcb6d36d" - }, - "name": { - "type": "string", - "example": "Entrance camera" - }, - "brand": { - "type": "string", - "example": "Raftakn" - }, - "location": { - "type": "string", - "enum": [ - "entrance", - "exit" - ] - } - } - }, - "Card": { - "type": "object", - "required": [ - "number", - "expire" - ], - "properties": { - "number": { - "type": "string" - }, - "ccv": { - "type": "string" - }, - "expire": { - "type": "string", - "format": "date" - } - } - }, - "Customer": { - "title": "Customer", - "type": "object", - "required": [ - "id", - "language" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "5d291621-7ddb-4af1-a6cb-a78af5762211" - }, - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "email": { - "type": "string", - "format": "email", - "nullable": true - }, - "phone": { - "type": "string", - "nullable": true, - "example": "4648700" - }, - "language": { - "type": "string", - "maxLength": 2, - "minLength": 2, - "example": "is" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "options": { - "$ref": "#/components/schemas/CustomerOption" - } - } - }, - "CustomerOption": { - "type": "object", - "properties": { - "sendInvoicesToEmail": { - "type": "boolean" - }, - "sendInvoicesToPublishingSystem": { - "type": "boolean" - }, - "billingMethod": { - "type": "string", - "enum": [ - "daily", - "monthly" - ] - }, - "billingSsn": { - "type": "string" - } - } - }, - "CustomersResponse": { - "type": "object", - "readOnly": true, - "properties": { - "next": { - "type": "string", - "nullable": true - }, - "previous": { - "type": "string", - "nullable": true - }, - "customers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Customer" - } - } - } - }, - "Error": { - "title": "Generic Error Object", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "messages": { - "type": "string" - } - } - }, - "ErrorException": { - "title": "Exception handle by underlying system", - "type": "object", - "required": [ - "messages" - ], - "properties": { - "exception": { - "type": "object", - "properties": { - "message": { - "type": "string" - } - } - }, - "messages": { - "type": "string", - "nullable": true - } - } - }, - "Invoice": { - "title": "Invoice object", - "type": "object", - "readOnly": true, - "required": [ - "id", - "status", - "language" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623" - }, - "status": { - "type": "string", - "enum": [ - "paid", - "refunded", - "incomplete", - "failed", - "draft" - ] - }, - "productId": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623", - "nullable": true - }, - "price": { - "$ref": "#/components/schemas/Money" - }, - "invoiceEmail": { - "type": "string", - "format": "email" - }, - "language": { - "type": "string", - "enum": [ - "is", - "en" - ] - }, - "receipt": { - "$ref": "#/components/schemas/Receipt" - }, - "createdOn": { - "type": "string", - "format": "date-time" - } - } - }, - "InvoiceId": { - "x-required": "self", - "type": "string", - "format": "uuid", - "example": "040546c4-58bd-49cf-9741-6cb42daf6728" - }, - "Money": { - "type": "object", - "nullable": true, - "properties": { - "amount": { - "type": "number", - "example": 1250 - }, - "currency": { - "type": "string", - "maxLength": 3, - "minLength": 3, - "example": "ISK" - } - } - }, - "OpenALPR": { - "type": "object", - "properties": { - "epoch_start": { - "description": "Capture date", - "type": "integer" - }, - "camera_id": { - "description": "Numeric id of camera", - "type": "integer" - }, - "agent_uid": { - "type": "string" - }, - "best_uuid": { - "description": "Unique id of best match", - "type": "string" - }, - "best_plate_number": { - "description": "Best guess for license plate", - "type": "string" - }, - "best_confidence": { - "description": "Ocr score", - "type": "number" - }, - "best_region": { - "description": "Guess for the license plate region", - "type": "string" - }, - "best_region_confidence": { - "type": "number" - }, - "company_id": { - "type": "string", - "format": "uuid" - }, - "version": { - "type": "integer" - }, - "vehicle_crop_jpeg": { - "description": "Base64 encoded jpeg preview for the photo", - "type": "string" - }, - "is_parked": { - "type": "boolean" - }, - "vehicle": { - "type": "object", - "properties": { - "color": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "confidence": { - "type": "number" - } - } - } - }, - "make": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "confidence": { - "type": "number" - } - } - } - }, - "body": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "confidence": { - "type": "number" - } - } - } - } - } - } - } - }, - "PasswordInfo": { - "type": "object", - "required": [ - "email", - "password" - ], - "properties": { - "email": { - "type": "string", - "format": "email" - }, - "password": { - "type": "string", - "format": "password" - }, - "expire": { - "type": "string", - "nullable": true, - "format": "date-time" - } - } - }, - "Payment": { - "type": "object", - "nullable": true, - "required": [ - "amount", - "currency", - "transactionId", - "authorizationId" - ], - "properties": { - "amount": { - "type": "number", - "example": 1250 - }, - "currency": { - "type": "string", - "maxLength": 3, - "minLength": 3, - "example": "ISK" - }, - "transactionId": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "number" - } - ] - }, - "authorizationId": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "number" - } - ] - } - } - }, - "PaymentFormResponse": { - "type": "object", - "readOnly": true, - "required": [ - "invoiceId", - "form" - ], - "properties": { - "invoiceId": { - "$ref": "#/components/schemas/InvoiceId" - }, - "form": { - "type": "object", - "required": [ - "html", - "fields", - "url" - ], - "properties": { - "html": { - "type": "string" - }, - "fields": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "url": { - "type": "string" - } - } - } - } - }, - "Photo": { - "type": "object", - "required": [ - "id", - "capturedOn", - "plate", - "status", - "camera" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "bcecde96-5535-430e-ba4f-c8af5f2d5811" - }, - "capturedOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE333" - }, - "score": { - "type": "integer" - }, - "url": { - "type": "string", - "nullable": true - }, - "status": { - "type": "string", - "enum": [ - "new", - "need-review", - "force-review", - "reviewed", - "deleted", - "failed" - ] - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "camera": { - "$ref": "#/components/schemas/Camera" - } - } - }, - "PhotoResponse": { - "type": "object", - "readOnly": true, - "properties": { - "next": { - "type": "string", - "nullable": true - }, - "previous": { - "type": "string", - "nullable": true - }, - "photos": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Photo" - } - } - } - }, - "Product": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "aec5c6f3-130c-4928-8ffa-470918d94cc9" - }, - "type": { - "type": "string", - "enum": [ - "default", - "visit" - ], - "example": "visit" - }, - "price": { - "$ref": "#/components/schemas/Money" - }, - "currency": { - "type": "string", - "maxLength": 3, - "minLength": 3, - "example": "ISK" - }, - "vehicleCategory": { - "type": "string", - "enum": [ - "light", - "heavy" - ] - }, - "category": { - "type": "string" - }, - "name": { - "type": "object", - "example": { - "en": "Name in english", - "is": "Name in icelandic" - }, - "additionalProperties": { - "type": "string" - } - } - } - }, - "ProductCode": { - "x-required": "self", - "type": "string" - }, - "ProductId": { - "x-required": "self", - "type": "string", - "format": "uuid", - "example": "040546c4-58bd-49cf-9741-6cb42daf6728" - }, - "Receipt": { - "description": "Payment receipt", - "type": "object", - "readOnly": true, - "properties": { - "type": { - "type": "string", - "enum": [ - "visa", - "mastercard", - "amex", - "discover", - "other", - "electron", - "maestro" - ] - }, - "card": { - "type": "string", - "description": "Masked Card Number", - "example": "****-****-****-4444" - } - } - }, - "ReceiptCard": { - "description": "Simplified card information without ppi", - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "visa", - "mastercard", - "amex", - "discover", - "other", - "electron", - "maestro" - ] - }, - "last_four": { - "type": "string", - "maxLength": 4, - "minLength": 4, - "example": "4444" - } - } - }, - "SimpleCustomer": { - "title": "SimpleCustomer", - "type": "object", - "required": [ - "name", - "language" - ], - "properties": { - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "email": { - "type": "string", - "format": "email", - "nullable": true - }, - "phone": { - "type": "string", - "nullable": true, - "example": "4648700" - }, - "language": { - "type": "string", - "maxLength": 2, - "minLength": 2, - "example": "is" - } - } - }, - "Vehicle": { - "title": "Vehicle", - "type": "object", - "required": [ - "id", - "useGroup", - "vehicleCategory", - "registeredOn" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "deb4b244-945f-45c8-a67c-dc7939387ed6" - }, - "regno": { - "type": "string" - }, - "permno": { - "type": "string" - }, - "vin": { - "type": "string" - }, - "vehicleCategory": { - "type": "string" - }, - "vehicleGroup": { - "type": "string" - }, - "useGroup": { - "type": "string" - }, - "make": { - "type": "string", - "example": "Volvo" - }, - "model": { - "type": "string" - }, - "modelYear": { - "type": "string", - "example": "2019" - }, - "color": { - "type": "string", - "example": "blue" - }, - "massinro": { - "type": "string" - }, - "massladen": { - "type": "string" - }, - "taxGroup": { - "type": "string" - }, - "registeredOn": { - "type": "string", - "format": "date-time" - }, - "category": { - "type": "string", - "enum": [ - "light", - "heavy" - ] - }, - "country": { - "type": "string", - "description": "Country code", - "maxLength": 2, - "example": "is" - }, - "operator": { - "$ref": "#/components/schemas/VehicleOwner" - }, - "owner": { - "$ref": "#/components/schemas/VehicleOwner" - } - } - }, - "VehicleLookup": { - "type": "object", - "oneOf": [ - { - "required": [ - "plate" - ] - }, - { - "required": [ - "id" - ] - } - ], - "properties": { - "plate": { - "type": "string", - "example": "ICE222" - }, - "id": { - "description": "Id of vehicle know to us", - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623" - } - } - }, - "VehicleOwner": { - "title": "Owner or Operator", - "type": "object", - "required": [ - "ssn", - "name" - ], - "properties": { - "ssn": { - "type": "string", - "nullable": true, - "description": "Kennitala for icelandic people", - "example": "1122334455" - }, - "name": { - "type": "string", - "nullable": true, - "example": "Albert Albertsson" - }, - "insuranceCode": { - "type": "string" - }, - "registrationDate": { - "type": "string", - "format": "date-time" - }, - "purchaseDate": { - "type": "string", - "format": "date-time" - } - } - }, - "Visit": { - "title": "Visit", - "type": "object", - "required": [ - "id", - "startedOn", - "plate", - "status" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623" - }, - "startedOn": { - "type": "string", - "format": "date-time" - }, - "endedOn": { - "type": "string", - "format": "date-time" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE111" - }, - "status": { - "type": "string", - "enum": [ - "new", - "need-payment", - "need-plate", - "completed" - ] - }, - "paymentStatus": { - "type": "string", - "enum": [ - "whitelisted", - "kiosk", - "company-invoice", - "owner-invoice", - "failed", - "void" - ] - }, - "price": { - "$ref": "#/components/schemas/Money" - }, - "vehicle": { - "$ref": "#/components/schemas/Vehicle" - }, - "customer": { - "$ref": "#/components/schemas/Customer" - }, - "entrancePhoto": { - "$ref": "#/components/schemas/Photo" - }, - "exitPhoto": { - "$ref": "#/components/schemas/Photo" - }, - "invoice": { - "$ref": "#/components/schemas/Invoice" - } - } - }, - "VisitsResponse": { - "type": "object", - "readOnly": true, - "properties": { - "next": { - "type": "string", - "nullable": true - }, - "previous": { - "type": "string", - "nullable": true - }, - "total": { - "nullable": true, - "type": "integer" - }, - "extra": { - "nullable": true, - "type": "object" - }, - "visits": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Visit" - } + "paths": { + "/customer": { + "post": { + "summary": "Create new customer", + "operationId": "createCustomer", + "responses": { + "201": { + "description": "OK" } + }, + "requestBody": { + "$ref": "#/components/requestBodies/CreateCustomerPayload" } - }, - "Whitelist": { - "title": "Visit", + } + } + }, + "components": { + "schemas": { + "Customer": { + "title": "Customer", "type": "object", "required": [ - "plate", - "reason" + "id" ], "properties": { "id": { "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623" - }, - "activeFrom": { - "type": "string", - "nullable": true, - "format": "date-time" + "format": "uuid" }, - "expireOn": { + "name": { "type": "string", "nullable": true, - "format": "date-time" - }, - "createdOn": { - "type": "string", - "format": "date-time" - }, - "plate": { - "type": "string", - "example": "ICE111" - }, - "reason": { - "type": "string" + "example": "Albert Albertsson" }, - "author": { - "type": "string", - "nullable": true + "options": { + "$ref": "#/components/schemas/CustomerOption" } } }, - "WhitelistBaseEntry": { - "title": "WhitelistBaseEntry", + "CustomerOption": { "type": "object", - "required": [ - "plate", - "reason", - "objectType" - ], - "discriminator": { - "propertyName": "objectType" - }, "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "985c1032-e079-4597-b1c6-ac2223036623" - }, - "author": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "plate": { - "type": "string", - "example": "ICE111" - }, - "activeFrom": { - "type": "string", - "nullable": true, - "format": "date-time" - }, - "expireOn": { - "type": "string", - "nullable": true, - "format": "date-time" - }, - "createdOn": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "reason": { - "type": "string" - }, - "objectType": { + "billingSsn": { "type": "string" } } - }, - "WhitelistEntries": { - "type": "object", - "readOnly": true, - "required": [ - "entries" - ], - "additionalProperties": false, - "properties": { - "next": { - "type": "string", - "nullable": true - }, - "previous": { - "type": "string", - "nullable": true - }, - "entries": { - "type": "array", - "nullable": false, - "items": { - "$ref": "#/components/schemas/WhitelistBaseEntry" - } - } - } - }, - "WhitelistResponse": { - "type": "object", - "readOnly": true, - "properties": { - "next": { - "type": "string", - "nullable": true - }, - "previous": { - "type": "string", - "nullable": true - }, - "whitelists": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Whitelist" - } - } - } - } - }, - "securitySchemes": { - "api-key": { - "name": "X-Api-Key", - "type": "apiKey", - "in": "header", - "description": "Key for none account related endpoints" - }, - "bearer-token": { - "type": "http", - "scheme": "bearer", - "description": "There are 3 types of bearer tokens. \n1. account specific\n2. role specific - used for webhooks and kiosks\n3. location specific - used when endpoints redirect" - }, - "hook-security": { - "name": "wak", - "type": "apiKey", - "in": "query", - "description": "Uses a bearer token that is valid for one endpoint only" - } - }, - "responses": { - "InternalError": { - "description": "Unknown internal error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "NotFound": { - "description": "Requested resource not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "Unauthorized": { - "description": "Need to authenticate to access resource", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "Forbidden": { - "description": "Access denied", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "InputError": { - "description": "Generic input error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorException" - } - } - } - }, - "Redirect": { - "description": "Generic redirect response", - "headers": { - "Location": { - "description": "new location for resource", - "schema": { - "type": "string" - } - } - } - }, - "WebhookResponse": { - "description": "Generic redirect response", - "content": { - "*/*": { - "schema": { - "type": "object", - "properties": { - "acknowledge": { - "type": "boolean" - } - } - } - } - } - }, - "WrongEndpoint": { - "description": "Error that happens when creating already created data", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "messages": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid" - } - } - } - } - } } }, "requestBodies": { - "CreateAccountPayload": { - "description": "Create account payload", - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "account": { - "$ref": "#/components/schemas/Account" - }, - "customer": { - "$ref": "#/components/schemas/Customer" - }, - "authentication": { - "$ref": "#/components/schemas/PasswordInfo" - } - }, - "required": [ - "account" - ] - } - } - } - }, "CreateCustomerPayload": { - "description": "Create customer", + "description": "Create customer payload", "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { - "account": { - "oneOf": [ - { - "$ref": "#/components/schemas/Account" - }, - { - "$ref": "#/components/schemas/AccountId" - } - ] - }, "customer": { "$ref": "#/components/schemas/Customer" } }, "required": [ - "account", "customer" ] } } } - }, - "CreateRoleBearerToken": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "role": { - "type": "string", - "enum": [ - "webhook", - "kiosk", - "whitelist" - ] - } - } - } - } - } - }, - "PasswordLogin": { - "description": "Password based login payload", - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "device_uuid": { - "type": "string", - "format": "uuid" - }, - "provider": { - "type": "string", - "enum": [ - "password", - "lost-password", - "change-password", - "token" - ] - }, - "id": { - "type": "string" - }, - "password": { - "type": "string", - "format": "password" - } - }, - "required": [ - "device_uuid", - "provider", - "id", - "password" - ] - } - } - } - }, - "PurchaseProduct": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "vehicle", - "customer", - "product", - "card" - ], - "properties": { - "vehicle": { - "$ref": "#/components/schemas/VehicleLookup" - }, - "customer": { - "anyOf": [ - { - "$ref": "#/components/schemas/SimpleCustomer" - }, - { - "$ref": "#/components/schemas/Customer" - } - ] - }, - "product": { - "$ref": "#/components/schemas/ProductId" - }, - "card": { - "$ref": "#/components/schemas/Card" - }, - "provider": { - "type": "string", - "enum": [ - "borgun", - "valitor-pay", - "testing", - "testing2" - ] - } - } - } - } - } - }, - "RegisterKioskPayment": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "plate", - "quantity", - "product", - "card", - "language" - ], - "properties": { - "plate": { - "type": "string", - "example": "ICE222" - }, - "quantity": { - "description": "The number of \"time units\". Each time unit is 24 hours in this case", - "type": "number", - "example": 1 - }, - "product": { - "anyOf": [ - { - "$ref": "#/components/schemas/ProductId" - }, - { - "$ref": "#/components/schemas/ProductCode" - } - ] - }, - "card": { - "anyOf": [ - { - "$ref": "#/components/schemas/ReceiptCard" - }, - { - "$ref": "#/components/schemas/Card" - } - ] - }, - "payment": { - "$ref": "#/components/schemas/Payment" - }, - "language": { - "type": "string", - "enum": [ - "is", - "en" - ] - }, - "email": { - "description": "Email address for receipts. If specified the API should send a email with a receipt.", - "type": "string", - "nullable": true - } - } - } - } - } - }, - "TokenLogin": { - "description": "Change password login payload", - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "device_uuid": { - "type": "string", - "format": "uuid" - }, - "provider": { - "type": "string", - "enum": [ - "lost-password", - "change-password", - "token" - ] - }, - "token": { - "type": "string" - } - }, - "required": [ - "device_uuid", - "provider", - "token" - ] - } - } - } } } - }, - "security": [ - { - "bearer-token": [] - } - ] -} \ No newline at end of file + } +} From 20b2509779997daf2a22a42cc4806aba0e3f45a1 Mon Sep 17 00:00:00 2001 From: Runar Sverrisson Date: Wed, 27 May 2026 10:26:07 +0000 Subject: [PATCH 3/4] Fix a potential issue for inlining a nested allOf internal structure --- src/Service/InlineService.php | 5 +- .../schema.dist.json | 98 +++++++++++++++++++ .../inline-allOf-internal-nested/schema.json | 54 ++++++++++ 3 files changed, 154 insertions(+), 3 deletions(-) create mode 100644 tests/inlined-schemas/inline-allOf-internal-nested/schema.dist.json create mode 100644 tests/inlined-schemas/inline-allOf-internal-nested/schema.json diff --git a/src/Service/InlineService.php b/src/Service/InlineService.php index 70a4629..5d8acbf 100644 --- a/src/Service/InlineService.php +++ b/src/Service/InlineService.php @@ -108,7 +108,7 @@ private function processDocument( $type = $this->resolveSchemaType($documentPaths); $refName = $this->getRefName($reference, $type); - $nextParentPath = $parentPath; + $nextParentPath = ($parentPath ?? '') . $documentPaths[0]; if ( isset($this->components[$type->name][$refName]) && $this->components[$type->name][$refName] @@ -147,7 +147,6 @@ private function processDocument( } else { $referenceDocument = BasicDocument::fromDocument($this->referenceResolver->resolve($reference)); - $nextParentPath .= $documentPaths[0]; $nextFileRoot = $referenceDocument; } $schemaId = $referenceDocument->get()['$id'] ?? $refName; @@ -202,7 +201,7 @@ private function processDocumentPaths( elseif ($processAllOf && str_contains($path, '/allOf/')) { $stripped = substr($path, 0, (int)strpos($path, '/allOf/')); $this->modelAllOfPaths[$parentName][] = $stripped; - $this->allOfPaths[] = $parentPath . $stripped; + $this->allOfPaths[] = ($parentPath ?? '') . $stripped; } $document->set($path, $schema); } diff --git a/tests/inlined-schemas/inline-allOf-internal-nested/schema.dist.json b/tests/inlined-schemas/inline-allOf-internal-nested/schema.dist.json new file mode 100644 index 0000000..51e19c3 --- /dev/null +++ b/tests/inlined-schemas/inline-allOf-internal-nested/schema.dist.json @@ -0,0 +1,98 @@ +{ + "openapi": "3.0.0", + "paths": { + "/test": { + "get": { + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "sub": { + "properties": { + "subIntermediate": { + "allOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "$id": "Base" + }, + { + "type": "object", + "properties": { + "intermediate": { + "type": "boolean" + } + } + } + ] + } + }, + "$id": "Intermediate" + } + }, + "$id": "NestedAllOf" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Base": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + "Intermediate": { + "properties": { + "subIntermediate": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "intermediate": { + "type": "boolean" + } + } + } + } + }, + "NestedAllOf": { + "type": "object", + "properties": { + "sub": { + "properties": { + "subIntermediate": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "intermediate": { + "type": "boolean" + } + } + } + }, + "$id": "Intermediate" + } + } + } + } + } +} \ No newline at end of file diff --git a/tests/inlined-schemas/inline-allOf-internal-nested/schema.json b/tests/inlined-schemas/inline-allOf-internal-nested/schema.json new file mode 100644 index 0000000..8799732 --- /dev/null +++ b/tests/inlined-schemas/inline-allOf-internal-nested/schema.json @@ -0,0 +1,54 @@ +{ + "openapi": "3.0.0", + "paths": { + "/test": { + "get": { + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NestedAllOf" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Base": { + "type": "object", + "properties": { + "id": { "type": "string" } + } + }, + "Intermediate": { + "properties": { + "subIntermediate": { + "allOf": [ + { "$ref": "#/components/schemas/Base" }, + { + "type": "object", + "properties": { + "intermediate": { "type": "boolean" } + } + } + ] + } + } + }, + "NestedAllOf": { + "type": "object", + "properties": { + "sub": { + "$ref": "#/components/schemas/Intermediate" + } + } + } + } + } +} From 2e69adc47abb0be8f432396dec63b7bd6be4988d Mon Sep 17 00:00:00 2001 From: Runar Sverrisson Date: Thu, 28 May 2026 12:05:12 +0000 Subject: [PATCH 4/4] Fix phpstan error --- src/ReferenceResolver/LocalReferenceResolver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ReferenceResolver/LocalReferenceResolver.php b/src/ReferenceResolver/LocalReferenceResolver.php index 9fbe311..e4e4666 100644 --- a/src/ReferenceResolver/LocalReferenceResolver.php +++ b/src/ReferenceResolver/LocalReferenceResolver.php @@ -40,7 +40,7 @@ public function resolve(Reference $reference): Document foreach ($tryKeys as $tryKey) { if ($this->rootDocument->has($tryKey)) { - /** @var array{"$id"?: string, id?: string, ...}|string $resolvedDocument */ + /** @var array{"$id"?: string, id?: string, ...}|string $resolvedDocument */ $resolvedDocument = $this->rootDocument->get($tryKey); if (!is_array($resolvedDocument)) { throw DocumentParseError::invalidContent($tryKey);