{
  "openapi": "3.0.1",
  "info": {
    "title": "XDPeople.Soba.Table.WebAPI",
    "version": "1.0"
  },
  "paths": {
    "/gateway/online-orders/connection": {
      "get": {
        "tags": [
          "OnlineOrders"
        ],
        "summary": "Returns the current XD connection status for the authenticated tenant.",
        "description": "Lightweight endpoint intended for periodic connectivity checks.\r\nAlways returns 200 OK with the current connection state; does not send messages to XD.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/XdConnectionStatusDTO"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/XdConnectionStatusDTO"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/XdConnectionStatusDTO"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          }
        }
      }
    },
    "/gateway/online-orders/table": {
      "post": {
        "tags": [
          "OnlineOrders"
        ],
        "summary": "Sends table orders",
        "description": "This endpoint is for indoor table orders with hierarchical item structure.\r\nTableId must be different from 0.",
        "requestBody": {
          "description": "Request with hierarchical order items",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TableOrderRequestDTO"
              },
              "example": {
                "tableId": 10,
                "employeeId": 1,
                "personsNumber": 2,
                "items": [
                  {
                    "keyId": "ITEM001",
                    "description": "Coca-Cola",
                    "quantity": 2,
                    "price": 1.5,
                    "optionsLineId": 0,
                    "subItems": [
                      {
                        "keyId": "SUBITEM01",
                        "description": "Com Gelo e Limão",
                        "quantity": 1,
                        "price": 0.2,
                        "optionsLineId": 0,
                        "subItems": null
                      }
                    ]
                  },
                  {
                    "keyId": "ITEM002",
                    "description": "Pizza Margherita",
                    "quantity": 1,
                    "price": 8.0,
                    "optionsLineId": 0,
                    "subItems": null
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/TableOrderRequestDTO"
              },
              "example": {
                "tableId": 10,
                "employeeId": 1,
                "personsNumber": 2,
                "items": [
                  {
                    "keyId": "ITEM001",
                    "description": "Coca-Cola",
                    "quantity": 2,
                    "price": 1.5,
                    "optionsLineId": 0,
                    "subItems": [
                      {
                        "keyId": "SUBITEM01",
                        "description": "Com Gelo e Limão",
                        "quantity": 1,
                        "price": 0.2,
                        "optionsLineId": 0,
                        "subItems": null
                      }
                    ]
                  },
                  {
                    "keyId": "ITEM002",
                    "description": "Pizza Margherita",
                    "quantity": 1,
                    "price": 8.0,
                    "optionsLineId": 0,
                    "subItems": null
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TableOrderRequestDTO"
              },
              "example": {
                "tableId": 10,
                "employeeId": 1,
                "personsNumber": 2,
                "items": [
                  {
                    "keyId": "ITEM001",
                    "description": "Coca-Cola",
                    "quantity": 2,
                    "price": 1.5,
                    "optionsLineId": 0,
                    "subItems": [
                      {
                        "keyId": "SUBITEM01",
                        "description": "Com Gelo e Limão",
                        "quantity": 1,
                        "price": 0.2,
                        "optionsLineId": 0,
                        "subItems": null
                      }
                    ]
                  },
                  {
                    "keyId": "ITEM002",
                    "description": "Pizza Margherita",
                    "quantity": 1,
                    "price": 8.0,
                    "optionsLineId": 0,
                    "subItems": null
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          }
        }
      }
    },
    "/gateway/online-orders/table/close-account": {
      "post": {
        "tags": [
          "OnlineOrders"
        ],
        "summary": "Closes table account (billing)",
        "description": "This endpoint closes the account for a table and generates a bill.",
        "requestBody": {
          "description": "Request with billing information",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TableBillRequestDTO"
              },
              "example": {
                "tableId": 10,
                "totalAmount": 35.8,
                "customerVat": "501234567",
                "customerName": "João Silva",
                "customerAddress": "Rua das Flores, 123",
                "customerPostalCode": "1000-001",
                "customerCity": "Lisboa",
                "customerCountryISO3166Alpha2": "PT",
                "customerEmail": "joao.silva@email.pt",
                "mobilePhone": "+351 912 345 678",
                "paymentTypeId": 0,
                "employeeId": 1
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/TableBillRequestDTO"
              },
              "example": {
                "tableId": 10,
                "totalAmount": 35.8,
                "customerVat": "501234567",
                "customerName": "João Silva",
                "customerAddress": "Rua das Flores, 123",
                "customerPostalCode": "1000-001",
                "customerCity": "Lisboa",
                "customerCountryISO3166Alpha2": "PT",
                "customerEmail": "joao.silva@email.pt",
                "mobilePhone": "+351 912 345 678",
                "paymentTypeId": 0,
                "employeeId": 1
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TableBillRequestDTO"
              },
              "example": {
                "tableId": 10,
                "totalAmount": 35.8,
                "customerVat": "501234567",
                "customerName": "João Silva",
                "customerAddress": "Rua das Flores, 123",
                "customerPostalCode": "1000-001",
                "customerCity": "Lisboa",
                "customerCountryISO3166Alpha2": "PT",
                "customerEmail": "joao.silva@email.pt",
                "mobilePhone": "+351 912 345 678",
                "paymentTypeId": 0,
                "employeeId": 1
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TableBillResponseDTO"
                },
                "example": {
                  "documentTypeId": 1,
                  "documentSerieId": 1,
                  "documentNumber": 4523
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TableBillResponseDTO"
                },
                "example": {
                  "documentTypeId": 1,
                  "documentSerieId": 1,
                  "documentNumber": 4523
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TableBillResponseDTO"
                },
                "example": {
                  "documentTypeId": 1,
                  "documentSerieId": 1,
                  "documentNumber": 4523
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          }
        }
      }
    },
    "/gateway/online-orders/table/transfer": {
      "post": {
        "tags": [
          "OnlineOrders"
        ],
        "summary": "Transfers items from one table to another",
        "description": "This endpoint is for transferring items between tables.\r\nRequires source table, destination table and list of items (UniqueId, Quantity) to transfer.",
        "requestBody": {
          "description": "Request with source table, destination table and items to transfer",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TableOrderTransferRequestDTO"
              },
              "example": {
                "sourceTableId": 10,
                "destinationTableId": 12,
                "employeeId": 1,
                "items": [
                  {
                    "uniqueId": "a8d8f8f8-f8f8-f8f8-f8f8-f8f8f8f8f8f8",
                    "itemType": 0,
                    "quantity": 1,
                    "items": null
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/TableOrderTransferRequestDTO"
              },
              "example": {
                "sourceTableId": 10,
                "destinationTableId": 12,
                "employeeId": 1,
                "items": [
                  {
                    "uniqueId": "a8d8f8f8-f8f8-f8f8-f8f8-f8f8f8f8f8f8",
                    "itemType": 0,
                    "quantity": 1,
                    "items": null
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TableOrderTransferRequestDTO"
              },
              "example": {
                "sourceTableId": 10,
                "destinationTableId": 12,
                "employeeId": 1,
                "items": [
                  {
                    "uniqueId": "a8d8f8f8-f8f8-f8f8-f8f8-f8f8f8f8f8f8",
                    "itemType": 0,
                    "quantity": 1,
                    "items": null
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          }
        }
      }
    },
    "/gateway/online-orders/table/void": {
      "post": {
        "tags": [
          "OnlineOrders"
        ],
        "summary": "Void items from a table order",
        "description": "This endpoint is for void items from a table order.\r\nRequires UniqueId (Guid) of the items to void, Quantity and CancellationReasonId.",
        "requestBody": {
          "description": "Request with items to void",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TableOrderVoidRequestDTO"
              },
              "example": {
                "tableId": 10,
                "employeeId": 1,
                "items": [
                  {
                    "uniqueId": "a8d8f8f8-f8f8-f8f8-f8f8-f8f8f8f8f8f8",
                    "keyId": "ITEM001",
                    "itemType": 0,
                    "quantity": 1,
                    "cancellationReasonId": 1,
                    "items": null
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/TableOrderVoidRequestDTO"
              },
              "example": {
                "tableId": 10,
                "employeeId": 1,
                "items": [
                  {
                    "uniqueId": "a8d8f8f8-f8f8-f8f8-f8f8-f8f8f8f8f8f8",
                    "keyId": "ITEM001",
                    "itemType": 0,
                    "quantity": 1,
                    "cancellationReasonId": 1,
                    "items": null
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TableOrderVoidRequestDTO"
              },
              "example": {
                "tableId": 10,
                "employeeId": 1,
                "items": [
                  {
                    "uniqueId": "a8d8f8f8-f8f8-f8f8-f8f8-f8f8f8f8f8f8",
                    "keyId": "ITEM001",
                    "itemType": 0,
                    "quantity": 1,
                    "cancellationReasonId": 1,
                    "items": null
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          }
        }
      }
    },
    "/gateway/table-zones": {
      "get": {
        "tags": [
          "TableZones"
        ],
        "summary": "Retrieves all available table zones.",
        "description": "This endpoint returns a list of all defined table zones,  \r\nwhich can be used to organize tables by areas or sections.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TableZoneDTO"
                  }
                },
                "example": [
                  {
                    "id": 1,
                    "terminal": 1,
                    "description": "Sala Principal",
                    "initialValue": 1,
                    "finalValue": 20,
                    "itemPrice": 1,
                    "employees": "1,2,3",
                    "syncStamp": null,
                    "useAlternativeTax": false,
                    "terminals": "1,2",
                    "initialUserOnly": false
                  },
                  {
                    "id": 2,
                    "terminal": 1,
                    "description": "Esplanada",
                    "initialValue": 21,
                    "finalValue": 40,
                    "itemPrice": 2,
                    "employees": "1,2",
                    "syncStamp": null,
                    "useAlternativeTax": true,
                    "terminals": "1",
                    "initialUserOnly": true
                  }
                ]
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TableZoneDTO"
                  }
                },
                "example": [
                  {
                    "id": 1,
                    "terminal": 1,
                    "description": "Sala Principal",
                    "initialValue": 1,
                    "finalValue": 20,
                    "itemPrice": 1,
                    "employees": "1,2,3",
                    "syncStamp": null,
                    "useAlternativeTax": false,
                    "terminals": "1,2",
                    "initialUserOnly": false
                  },
                  {
                    "id": 2,
                    "terminal": 1,
                    "description": "Esplanada",
                    "initialValue": 21,
                    "finalValue": 40,
                    "itemPrice": 2,
                    "employees": "1,2",
                    "syncStamp": null,
                    "useAlternativeTax": true,
                    "terminals": "1",
                    "initialUserOnly": true
                  }
                ]
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TableZoneDTO"
                  }
                },
                "example": [
                  {
                    "id": 1,
                    "terminal": 1,
                    "description": "Sala Principal",
                    "initialValue": 1,
                    "finalValue": 20,
                    "itemPrice": 1,
                    "employees": "1,2,3",
                    "syncStamp": null,
                    "useAlternativeTax": false,
                    "terminals": "1,2",
                    "initialUserOnly": false
                  },
                  {
                    "id": 2,
                    "terminal": 1,
                    "description": "Esplanada",
                    "initialValue": 21,
                    "finalValue": 40,
                    "itemPrice": 2,
                    "employees": "1,2",
                    "syncStamp": null,
                    "useAlternativeTax": true,
                    "terminals": "1",
                    "initialUserOnly": true
                  }
                ]
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          }
        }
      }
    },
    "/gateway/table-zones/{id}/tables": {
      "get": {
        "tags": [
          "TableZones"
        ],
        "summary": "Retrieves all tables located within a specific zone.",
        "description": "This endpoint allows fetching the list of tables assigned  \r\nto a particular zone inside the restaurant or area.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The identifier of the zone to retrieve tables from.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/XConfigSalezoneAreaObjectDTO"
                  }
                },
                "example": [
                  {
                    "id": 1,
                    "saleZoneAreaId": 1,
                    "description": "Mesa 1",
                    "status": 0,
                    "total": 0,
                    "subTotalReference": null,
                    "scontaPrinterId": null,
                    "fcontaPrinterId": null,
                    "loginDate": null,
                    "logoutDate": null,
                    "defaultSerieId": null,
                    "defaultDocumentTypeId": null,
                    "serviceTxCanceled": null,
                    "discount": null,
                    "numberPersons": null,
                    "freeTable": true,
                    "cardSerieId": null,
                    "saleZoneAreaObjectId1": null,
                    "saleZoneAreaObjectId2": null,
                    "inactive": false,
                    "blockTransferTo": false,
                    "blockTransferFrom": false,
                    "initialUserOnly": false,
                    "initialUser": 0,
                    "publicRelationsId": 0,
                    "serviceTxSuspended": false,
                    "printOrderOnCloseAccount": false
                  },
                  {
                    "id": 2,
                    "saleZoneAreaId": 1,
                    "description": "Mesa 2",
                    "status": 1,
                    "total": 25.5,
                    "subTotalReference": null,
                    "scontaPrinterId": null,
                    "fcontaPrinterId": null,
                    "loginDate": "2026-03-31T12:30:00",
                    "logoutDate": null,
                    "defaultSerieId": null,
                    "defaultDocumentTypeId": null,
                    "serviceTxCanceled": null,
                    "discount": null,
                    "numberPersons": 4,
                    "freeTable": false,
                    "cardSerieId": null,
                    "saleZoneAreaObjectId1": null,
                    "saleZoneAreaObjectId2": null,
                    "inactive": false,
                    "blockTransferTo": false,
                    "blockTransferFrom": false,
                    "initialUserOnly": false,
                    "initialUser": 1,
                    "publicRelationsId": 0,
                    "serviceTxSuspended": false,
                    "printOrderOnCloseAccount": false
                  }
                ]
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/XConfigSalezoneAreaObjectDTO"
                  }
                },
                "example": [
                  {
                    "id": 1,
                    "saleZoneAreaId": 1,
                    "description": "Mesa 1",
                    "status": 0,
                    "total": 0,
                    "subTotalReference": null,
                    "scontaPrinterId": null,
                    "fcontaPrinterId": null,
                    "loginDate": null,
                    "logoutDate": null,
                    "defaultSerieId": null,
                    "defaultDocumentTypeId": null,
                    "serviceTxCanceled": null,
                    "discount": null,
                    "numberPersons": null,
                    "freeTable": true,
                    "cardSerieId": null,
                    "saleZoneAreaObjectId1": null,
                    "saleZoneAreaObjectId2": null,
                    "inactive": false,
                    "blockTransferTo": false,
                    "blockTransferFrom": false,
                    "initialUserOnly": false,
                    "initialUser": 0,
                    "publicRelationsId": 0,
                    "serviceTxSuspended": false,
                    "printOrderOnCloseAccount": false
                  },
                  {
                    "id": 2,
                    "saleZoneAreaId": 1,
                    "description": "Mesa 2",
                    "status": 1,
                    "total": 25.5,
                    "subTotalReference": null,
                    "scontaPrinterId": null,
                    "fcontaPrinterId": null,
                    "loginDate": "2026-03-31T12:30:00",
                    "logoutDate": null,
                    "defaultSerieId": null,
                    "defaultDocumentTypeId": null,
                    "serviceTxCanceled": null,
                    "discount": null,
                    "numberPersons": 4,
                    "freeTable": false,
                    "cardSerieId": null,
                    "saleZoneAreaObjectId1": null,
                    "saleZoneAreaObjectId2": null,
                    "inactive": false,
                    "blockTransferTo": false,
                    "blockTransferFrom": false,
                    "initialUserOnly": false,
                    "initialUser": 1,
                    "publicRelationsId": 0,
                    "serviceTxSuspended": false,
                    "printOrderOnCloseAccount": false
                  }
                ]
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/XConfigSalezoneAreaObjectDTO"
                  }
                },
                "example": [
                  {
                    "id": 1,
                    "saleZoneAreaId": 1,
                    "description": "Mesa 1",
                    "status": 0,
                    "total": 0,
                    "subTotalReference": null,
                    "scontaPrinterId": null,
                    "fcontaPrinterId": null,
                    "loginDate": null,
                    "logoutDate": null,
                    "defaultSerieId": null,
                    "defaultDocumentTypeId": null,
                    "serviceTxCanceled": null,
                    "discount": null,
                    "numberPersons": null,
                    "freeTable": true,
                    "cardSerieId": null,
                    "saleZoneAreaObjectId1": null,
                    "saleZoneAreaObjectId2": null,
                    "inactive": false,
                    "blockTransferTo": false,
                    "blockTransferFrom": false,
                    "initialUserOnly": false,
                    "initialUser": 0,
                    "publicRelationsId": 0,
                    "serviceTxSuspended": false,
                    "printOrderOnCloseAccount": false
                  },
                  {
                    "id": 2,
                    "saleZoneAreaId": 1,
                    "description": "Mesa 2",
                    "status": 1,
                    "total": 25.5,
                    "subTotalReference": null,
                    "scontaPrinterId": null,
                    "fcontaPrinterId": null,
                    "loginDate": "2026-03-31T12:30:00",
                    "logoutDate": null,
                    "defaultSerieId": null,
                    "defaultDocumentTypeId": null,
                    "serviceTxCanceled": null,
                    "discount": null,
                    "numberPersons": 4,
                    "freeTable": false,
                    "cardSerieId": null,
                    "saleZoneAreaObjectId1": null,
                    "saleZoneAreaObjectId2": null,
                    "inactive": false,
                    "blockTransferTo": false,
                    "blockTransferFrom": false,
                    "initialUserOnly": false,
                    "initialUser": 1,
                    "publicRelationsId": 0,
                    "serviceTxSuspended": false,
                    "printOrderOnCloseAccount": false
                  }
                ]
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          }
        }
      }
    },
    "/gateway/tables": {
      "get": {
        "tags": [
          "Tables"
        ],
        "summary": "Retrieves the list of tables available for a specific employee and terminal.",
        "description": "This endpoint returns the tables accessible to the given employee on the specified terminal.\r\nRequired query parameters: employeeId, terminalId, and tableFilter.\r\nTableFilter options:\r\n<list type=\"bullet\"><item><description><b>Free (0)</b> - Returns only free tables.</description></item><item><description><b>Open (1)</b> - Returns only open/occupied tables.</description></item></list>",
        "parameters": [
          {
            "name": "employeeId",
            "in": "query",
            "description": "The identifier of the employee requesting the tables.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "terminalId",
            "in": "query",
            "description": "The identifier of the terminal being used.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "tableFilter",
            "in": "query",
            "description": "The filter that determines which tables are returned.",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/TableFilter"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/XConfigSalezoneAreaObjectDTO"
                },
                "example": {
                  "id": 1,
                  "saleZoneAreaId": 1,
                  "description": "Mesa 1",
                  "status": 0,
                  "total": 0,
                  "subTotalReference": null,
                  "scontaPrinterId": null,
                  "fcontaPrinterId": null,
                  "loginDate": null,
                  "logoutDate": null,
                  "defaultSerieId": null,
                  "defaultDocumentTypeId": null,
                  "serviceTxCanceled": null,
                  "discount": null,
                  "numberPersons": 0,
                  "freeTable": true,
                  "cardSerieId": null,
                  "saleZoneAreaObjectId1": null,
                  "saleZoneAreaObjectId2": null,
                  "inactive": false,
                  "blockTransferTo": false,
                  "blockTransferFrom": false,
                  "initialUserOnly": false,
                  "initialUser": 0,
                  "publicRelationsId": 0,
                  "serviceTxSuspended": false,
                  "printOrderOnCloseAccount": false
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/XConfigSalezoneAreaObjectDTO"
                },
                "example": {
                  "id": 1,
                  "saleZoneAreaId": 1,
                  "description": "Mesa 1",
                  "status": 0,
                  "total": 0,
                  "subTotalReference": null,
                  "scontaPrinterId": null,
                  "fcontaPrinterId": null,
                  "loginDate": null,
                  "logoutDate": null,
                  "defaultSerieId": null,
                  "defaultDocumentTypeId": null,
                  "serviceTxCanceled": null,
                  "discount": null,
                  "numberPersons": 0,
                  "freeTable": true,
                  "cardSerieId": null,
                  "saleZoneAreaObjectId1": null,
                  "saleZoneAreaObjectId2": null,
                  "inactive": false,
                  "blockTransferTo": false,
                  "blockTransferFrom": false,
                  "initialUserOnly": false,
                  "initialUser": 0,
                  "publicRelationsId": 0,
                  "serviceTxSuspended": false,
                  "printOrderOnCloseAccount": false
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/XConfigSalezoneAreaObjectDTO"
                },
                "example": {
                  "id": 1,
                  "saleZoneAreaId": 1,
                  "description": "Mesa 1",
                  "status": 0,
                  "total": 0,
                  "subTotalReference": null,
                  "scontaPrinterId": null,
                  "fcontaPrinterId": null,
                  "loginDate": null,
                  "logoutDate": null,
                  "defaultSerieId": null,
                  "defaultDocumentTypeId": null,
                  "serviceTxCanceled": null,
                  "discount": null,
                  "numberPersons": 0,
                  "freeTable": true,
                  "cardSerieId": null,
                  "saleZoneAreaObjectId1": null,
                  "saleZoneAreaObjectId2": null,
                  "inactive": false,
                  "blockTransferTo": false,
                  "blockTransferFrom": false,
                  "initialUserOnly": false,
                  "initialUser": 0,
                  "publicRelationsId": 0,
                  "serviceTxSuspended": false,
                  "printOrderOnCloseAccount": false
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          }
        }
      }
    },
    "/gateway/tables/{id}/cart": {
      "delete": {
        "tags": [
          "Tables"
        ],
        "summary": "Clears all items from the specified table cart.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The identifier (number) of the table.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "terminalId",
            "in": "query",
            "description": "The identifier of the terminal requesting the operation.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "employeeId",
            "in": "query",
            "description": "The identifier of the employee requesting the operation.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique key (UUID/GUID) to ensure request idempotency",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "f6f25916-9e17-4cd7-94c9-abc56d555261"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          }
        }
      }
    },
    "/gateway/tables/{id}/details": {
      "get": {
        "tags": [
          "Tables"
        ],
        "summary": "Retrieves the detailed information of a specific table.",
        "description": "This endpoint returns the list of details/consumptions for a specific table",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Table identifier",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TableDetailsDTO"
                },
                "example": {
                  "id": 10,
                  "saleZoneAreaId": 1,
                  "description": "Mesa 10",
                  "status": 1,
                  "customerKeyId": "CLI001",
                  "orders": [
                    {
                      "uniqueId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                      "itemKeyId": "ITEM001",
                      "itemGroupId": 1,
                      "itemType": 0,
                      "sortKey": 1,
                      "description": "Coca-Cola",
                      "quantity": 2,
                      "total": 3.0,
                      "subItems": [
                        {
                          "uniqueId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
                          "itemKeyId": "COMP001",
                          "itemType": 3,
                          "quantity": 1,
                          "description": "Com Gelo e Limão",
                          "attributeName": null,
                          "attributeValue": null
                        }
                      ]
                    },
                    {
                      "uniqueId": "c3d4e5f6-a7b8-9012-cdef-123456789012",
                      "itemKeyId": "ITEM002",
                      "itemGroupId": 2,
                      "itemType": 0,
                      "sortKey": 2,
                      "description": "Francesinha",
                      "quantity": 1,
                      "total": 12.5,
                      "subItems": []
                    }
                  ],
                  "summary": {
                    "totalAmount": 15.5
                  }
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TableDetailsDTO"
                },
                "example": {
                  "id": 10,
                  "saleZoneAreaId": 1,
                  "description": "Mesa 10",
                  "status": 1,
                  "customerKeyId": "CLI001",
                  "orders": [
                    {
                      "uniqueId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                      "itemKeyId": "ITEM001",
                      "itemGroupId": 1,
                      "itemType": 0,
                      "sortKey": 1,
                      "description": "Coca-Cola",
                      "quantity": 2,
                      "total": 3.0,
                      "subItems": [
                        {
                          "uniqueId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
                          "itemKeyId": "COMP001",
                          "itemType": 3,
                          "quantity": 1,
                          "description": "Com Gelo e Limão",
                          "attributeName": null,
                          "attributeValue": null
                        }
                      ]
                    },
                    {
                      "uniqueId": "c3d4e5f6-a7b8-9012-cdef-123456789012",
                      "itemKeyId": "ITEM002",
                      "itemGroupId": 2,
                      "itemType": 0,
                      "sortKey": 2,
                      "description": "Francesinha",
                      "quantity": 1,
                      "total": 12.5,
                      "subItems": []
                    }
                  ],
                  "summary": {
                    "totalAmount": 15.5
                  }
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TableDetailsDTO"
                },
                "example": {
                  "id": 10,
                  "saleZoneAreaId": 1,
                  "description": "Mesa 10",
                  "status": 1,
                  "customerKeyId": "CLI001",
                  "orders": [
                    {
                      "uniqueId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                      "itemKeyId": "ITEM001",
                      "itemGroupId": 1,
                      "itemType": 0,
                      "sortKey": 1,
                      "description": "Coca-Cola",
                      "quantity": 2,
                      "total": 3.0,
                      "subItems": [
                        {
                          "uniqueId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
                          "itemKeyId": "COMP001",
                          "itemType": 3,
                          "quantity": 1,
                          "description": "Com Gelo e Limão",
                          "attributeName": null,
                          "attributeValue": null
                        }
                      ]
                    },
                    {
                      "uniqueId": "c3d4e5f6-a7b8-9012-cdef-123456789012",
                      "itemKeyId": "ITEM002",
                      "itemGroupId": 2,
                      "itemType": 0,
                      "sortKey": 2,
                      "description": "Francesinha",
                      "quantity": 1,
                      "total": 12.5,
                      "subItems": []
                    }
                  ],
                  "summary": {
                    "totalAmount": 15.5
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          }
        }
      }
    },
    "/gateway/tables/{id}/item": {
      "put": {
        "tags": [
          "Tables"
        ],
        "summary": "Selects and temporarily marks an item for cancellation.",
        "description": "This endpoint is used to select an item that the user intends to cancel.\r\nThe cancellation is not permanent until the confirmation endpoint is called.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The table number where the item belongs.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "terminalId",
            "in": "query",
            "description": "The identifier of the terminal requesting the cancellation.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "employeeId",
            "in": "query",
            "description": "The identifier of the employee requesting the cancellation.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique key (UUID/GUID) to ensure request idempotency",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "87f36733-1ec2-4bf7-ba71-1031c4c356f2"
            }
          }
        ],
        "requestBody": {
          "description": "The details of the item to be marked for cancellation.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ItemCancellationDTO"
              },
              "example": {
                "itemKeyId": "PROD-125",
                "sortKey": 1,
                "quantity": 2,
                "cancellationReasonId": 1
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ItemCancellationDTO"
              },
              "example": {
                "itemKeyId": "PROD-125",
                "sortKey": 1,
                "quantity": 2,
                "cancellationReasonId": 1
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ItemCancellationDTO"
              },
              "example": {
                "itemKeyId": "PROD-125",
                "sortKey": 1,
                "quantity": 2,
                "cancellationReasonId": 1
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Tables"
        ],
        "summary": "Adds a new item to the specified table cart.",
        "description": "This endpoint allows inserting an item into the cart of a specific table.  \r\nIt requires the employee and terminal identifiers, along with the item details provided in the request body.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The table number where the item will be added.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "employeeId",
            "in": "query",
            "description": "The identifier of the employee performing the action.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "terminalId",
            "in": "query",
            "description": "The identifier of the terminal from which the request originates.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique key (UUID/GUID) to ensure request idempotency",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "1bfe090d-da6c-4c05-81d0-3f70b4fa4403"
            }
          }
        ],
        "requestBody": {
          "description": "The item details, including product information, quantity, and pricing.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ItemSelectionDTO"
              },
              "example": {
                "keyId": "PROD-125",
                "description": null,
                "quantity": 2,
                "price": 0,
                "isItemOffer": false,
                "menuItems": null,
                "complements": null,
                "customComposition": null,
                "pizzaComponents": null
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ItemSelectionDTO"
              },
              "example": {
                "keyId": "PROD-125",
                "description": null,
                "quantity": 2,
                "price": 0,
                "isItemOffer": false,
                "menuItems": null,
                "complements": null,
                "customComposition": null,
                "pizzaComponents": null
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ItemSelectionDTO"
              },
              "example": {
                "keyId": "PROD-125",
                "description": null,
                "quantity": 2,
                "price": 0,
                "isItemOffer": false,
                "menuItems": null,
                "complements": null,
                "customComposition": null,
                "pizzaComponents": null
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          }
        }
      }
    },
    "/gateway/tables/{id}/orders": {
      "post": {
        "tags": [
          "Tables"
        ],
        "summary": "Send the items from the cart to the specific table.",
        "description": "This endpoint sends the items added to the cart to the table.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The identifier (number) of the table to be saved.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "terminalId",
            "in": "query",
            "description": "The identifier of the terminal where the action originates.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "employeeId",
            "in": "query",
            "description": "The identifier of the employee performing the operation.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "customerKeyId",
            "in": "query",
            "description": "The unique customer key associated with the table.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Unique key (UUID/GUID) to ensure request idempotency",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "46b1eb28-0d2e-423a-9aaf-500df8a21aec"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          }
        }
      }
    },
    "/gateway/tables/{id}/summary": {
      "get": {
        "tags": [
          "Tables"
        ],
        "summary": "Retrieves the summary of a specific table.",
        "description": "This endpoint returns general information about the table, such as its\r\nidentifier, assigned waiter, occupancy state, and other contextual data\r\nthat represent the table's summary.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The table number to retrieve the summary for.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TableSummaryDTO"
                },
                "example": {
                  "id": 10,
                  "saleZoneAreaId": 1,
                  "status": 1,
                  "statusDescription": "Com Movimento",
                  "total": 35.8,
                  "subTotalReference": null,
                  "description": "Mesa 10",
                  "terminalId": 1,
                  "discount": 0,
                  "loginDate": "2026-03-31T12:30:00",
                  "logoutDate": null,
                  "customer": {
                    "keyId": "CLI001",
                    "name": "João Silva",
                    "contactPhone": "+351 912 345 678",
                    "contactEmail": "joao.silva@email.pt"
                  },
                  "user": {
                    "id": 1,
                    "name": "Carlos Empregado"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TableSummaryDTO"
                },
                "example": {
                  "id": 10,
                  "saleZoneAreaId": 1,
                  "status": 1,
                  "statusDescription": "Com Movimento",
                  "total": 35.8,
                  "subTotalReference": null,
                  "description": "Mesa 10",
                  "terminalId": 1,
                  "discount": 0,
                  "loginDate": "2026-03-31T12:30:00",
                  "logoutDate": null,
                  "customer": {
                    "keyId": "CLI001",
                    "name": "João Silva",
                    "contactPhone": "+351 912 345 678",
                    "contactEmail": "joao.silva@email.pt"
                  },
                  "user": {
                    "id": 1,
                    "name": "Carlos Empregado"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TableSummaryDTO"
                },
                "example": {
                  "id": 10,
                  "saleZoneAreaId": 1,
                  "status": 1,
                  "statusDescription": "Com Movimento",
                  "total": 35.8,
                  "subTotalReference": null,
                  "description": "Mesa 10",
                  "terminalId": 1,
                  "discount": 0,
                  "loginDate": "2026-03-31T12:30:00",
                  "logoutDate": null,
                  "customer": {
                    "keyId": "CLI001",
                    "name": "João Silva",
                    "contactPhone": "+351 912 345 678",
                    "contactEmail": "joao.silva@email.pt"
                  },
                  "user": {
                    "id": 1,
                    "name": "Carlos Empregado"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          }
        }
      }
    },
    "/gateway/tables/batch/details": {
      "post": {
        "tags": [
          "Tables"
        ],
        "summary": "Retrieves detailed information for multiple tables",
        "requestBody": {
          "description": "Request containing table IDs and terminal ID",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchTableDetailsRequest"
              },
              "example": {
                "tableIds": [
                  1,
                  5,
                  10,
                  15
                ]
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchTableDetailsRequest"
              },
              "example": {
                "tableIds": [
                  1,
                  5,
                  10,
                  15
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/BatchTableDetailsRequest"
              },
              "example": {
                "tableIds": [
                  1,
                  5,
                  10,
                  15
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BatchTableDetailsResponse"
                },
                "example": {
                  "tables": [
                    {
                      "id": 1,
                      "saleZoneAreaId": 1,
                      "description": "Mesa 1",
                      "status": 1,
                      "customerKeyId": "CLI001",
                      "orders": [
                        {
                          "uniqueId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                          "itemKeyId": "ITEM001",
                          "itemGroupId": 1,
                          "itemType": 0,
                          "sortKey": 1,
                          "description": "Coca-Cola",
                          "quantity": 2,
                          "total": 3.0,
                          "subItems": []
                        }
                      ],
                      "summary": {
                        "totalAmount": 3.0
                      }
                    },
                    {
                      "id": 5,
                      "saleZoneAreaId": 1,
                      "description": "Mesa 5",
                      "status": 0,
                      "customerKeyId": null,
                      "orders": [],
                      "summary": {
                        "totalAmount": 0
                      }
                    }
                  ]
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchTableDetailsResponse"
                },
                "example": {
                  "tables": [
                    {
                      "id": 1,
                      "saleZoneAreaId": 1,
                      "description": "Mesa 1",
                      "status": 1,
                      "customerKeyId": "CLI001",
                      "orders": [
                        {
                          "uniqueId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                          "itemKeyId": "ITEM001",
                          "itemGroupId": 1,
                          "itemType": 0,
                          "sortKey": 1,
                          "description": "Coca-Cola",
                          "quantity": 2,
                          "total": 3.0,
                          "subItems": []
                        }
                      ],
                      "summary": {
                        "totalAmount": 3.0
                      }
                    },
                    {
                      "id": 5,
                      "saleZoneAreaId": 1,
                      "description": "Mesa 5",
                      "status": 0,
                      "customerKeyId": null,
                      "orders": [],
                      "summary": {
                        "totalAmount": 0
                      }
                    }
                  ]
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchTableDetailsResponse"
                },
                "example": {
                  "tables": [
                    {
                      "id": 1,
                      "saleZoneAreaId": 1,
                      "description": "Mesa 1",
                      "status": 1,
                      "customerKeyId": "CLI001",
                      "orders": [
                        {
                          "uniqueId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                          "itemKeyId": "ITEM001",
                          "itemGroupId": 1,
                          "itemType": 0,
                          "sortKey": 1,
                          "description": "Coca-Cola",
                          "quantity": 2,
                          "total": 3.0,
                          "subItems": []
                        }
                      ],
                      "summary": {
                        "totalAmount": 3.0
                      }
                    },
                    {
                      "id": 5,
                      "saleZoneAreaId": 1,
                      "description": "Mesa 5",
                      "status": 0,
                      "customerKeyId": null,
                      "orders": [],
                      "summary": {
                        "totalAmount": 0
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpResponseError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "BatchTableDetailsRequest": {
        "required": [
          "tableIds"
        ],
        "type": "object",
        "properties": {
          "tableIds": {
            "maxItems": 50,
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "description": "List of table IDs to retrieve details for. Must contain between 1 and 50 IDs."
          }
        },
        "additionalProperties": false,
        "description": "Request DTO for retrieving details of multiple tables in a single batch request."
      },
      "BatchTableDetailsResponse": {
        "type": "object",
        "properties": {
          "tables": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TableDetailsDTO"
            },
            "description": "List of table details for the requested table IDs.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Response DTO containing details for multiple tables requested in a batch."
      },
      "ComplementType": {
        "enum": [
          0,
          1,
          2,
          3,
          4
        ],
        "type": "integer",
        "format": "int32"
      },
      "CompositeDetailType": {
        "enum": [
          0,
          1,
          2
        ],
        "type": "integer",
        "format": "int32"
      },
      "CustomerSummaryDTO": {
        "type": "object",
        "properties": {
          "keyId": {
            "type": "string",
            "description": "Customer unique key identifier.",
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "Customer name.",
            "nullable": true
          },
          "contactPhone": {
            "type": "string",
            "description": "Customer contact phone number.",
            "nullable": true
          },
          "contactEmail": {
            "type": "string",
            "description": "Customer contact email address.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Summary DTO for customer information associated with a table."
      },
      "Error": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "type": {
            "$ref": "#/components/schemas/ErrorType"
          },
          "furtherInformations": {
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ErrorType": {
        "enum": [
          0,
          1,
          2,
          3,
          4,
          5,
          6
        ],
        "type": "integer",
        "format": "int32"
      },
      "HttpResponseError": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "type": {
            "type": "string",
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Error"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ItemCancellationDTO": {
        "required": [
          "itemKeyId",
          "quantity",
          "sortKey"
        ],
        "type": "object",
        "properties": {
          "itemKeyId": {
            "minLength": 1,
            "type": "string",
            "description": "Item key identifier to cancel."
          },
          "sortKey": {
            "maximum": 2147483647,
            "minimum": 1,
            "type": "integer",
            "description": "Sort key of the item line to identify the specific order line.",
            "format": "int32"
          },
          "quantity": {
            "maximum": 2147483647,
            "minimum": 1,
            "type": "integer",
            "description": "Quantity to cancel (must be greater than zero).",
            "format": "int32"
          },
          "cancellationReasonId": {
            "type": "integer",
            "description": "Cancellation reason identifier (0 = no specific reason).",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "DTO for canceling/voiding a specific item on a table order."
      },
      "ItemComplementDTO": {
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ComplementType"
          },
          "item": {
            "$ref": "#/components/schemas/ItemSelectionDTO"
          }
        },
        "additionalProperties": false,
        "description": "DTO for an item complement/observation."
      },
      "ItemCompositionDTO": {
        "type": "object",
        "properties": {
          "detailType": {
            "$ref": "#/components/schemas/CompositeDetailType"
          },
          "keyId": {
            "type": "string",
            "description": "Item key identifier for the composition component.",
            "nullable": true
          },
          "quantity": {
            "type": "integer",
            "description": "Quantity of the composition component (default: 1).",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "DTO for a custom composition detail item."
      },
      "ItemSelectionDTO": {
        "type": "object",
        "properties": {
          "keyId": {
            "type": "string",
            "description": "Item key identifier.",
            "nullable": true
          },
          "description": {
            "type": "string",
            "description": "Item description override. If null, the database description is used.",
            "default": null,
            "nullable": true
          },
          "quantity": {
            "type": "number",
            "description": "Quantity to add (default: 1).",
            "format": "double",
            "default": 1
          },
          "price": {
            "type": "number",
            "description": "Price override (default: 0, uses database price).",
            "format": "double",
            "default": 0
          },
          "isItemOffer": {
            "type": "boolean",
            "description": "Indicates whether this item is an offer/freebie.",
            "default": false
          },
          "menuItems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ItemSelectionDTO"
            },
            "description": "Sub-items for menu-type items (menu components).",
            "default": null,
            "nullable": true
          },
          "complements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ItemComplementDTO"
            },
            "description": "Complements/observations for the item.",
            "default": null,
            "nullable": true
          },
          "customComposition": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ItemCompositionDTO"
            },
            "description": "Custom composition items (for composite/configurable items).",
            "default": null,
            "nullable": true
          },
          "pizzaComponents": {
            "$ref": "#/components/schemas/PizzaComponentsDTO"
          }
        },
        "additionalProperties": false,
        "description": "DTO for selecting an item to add to a table order (legacy format)."
      },
      "ItemType": {
        "enum": [
          0,
          1,
          2,
          3,
          4,
          5,
          6,
          7,
          8,
          9,
          10,
          11,
          12,
          13,
          14,
          15,
          16,
          17,
          18,
          19,
          20,
          21,
          22,
          23,
          24
        ],
        "type": "integer",
        "format": "int32"
      },
      "OrderItemDTO": {
        "type": "object",
        "properties": {
          "keyId": {
            "type": "string",
            "description": "Item KeyId (optional for observations/complements with Description)",
            "nullable": true
          },
          "description": {
            "type": "string",
            "description": "Description (optional, uses database description if not provided)\r\nUsed for observations/complements of free text",
            "default": null,
            "nullable": true
          },
          "quantity": {
            "type": "number",
            "description": "Quantity to order (default: 1).",
            "format": "double",
            "default": 1
          },
          "price": {
            "type": "number",
            "description": "Price override (default: 0, uses database price).",
            "format": "double",
            "default": 0
          },
          "optionsLineId": {
            "type": "integer",
            "description": "Options line identifier for item variants/options (default: 0).",
            "format": "int32",
            "default": 0
          },
          "subItems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderItemDTO"
            },
            "description": "Sub-items (for hierarchical structure: menus, pizzas, etc.)",
            "default": null,
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "DTO for an individual order item with hierarchical sub-items support."
      },
      "OrderTransferItemDTO": {
        "required": [
          "quantity",
          "uniqueId"
        ],
        "type": "object",
        "properties": {
          "uniqueId": {
            "minLength": 1,
            "type": "string",
            "description": "Unique ID of the line of the item to transfer (Guid)"
          },
          "itemType": {
            "type": "integer",
            "description": "Item type (e.g., 0 = Normal, 1 = Menu, etc.).",
            "format": "int32"
          },
          "quantity": {
            "type": "number",
            "description": "Quantity to transfer (default: 1).",
            "format": "double",
            "default": 1
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderTransferItemDTO"
            },
            "description": "Sub-items to transfer along with this item (e.g., complements).",
            "default": null,
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "DTO for individual item to transfer"
      },
      "OrderVoidItemDTO": {
        "required": [
          "keyId",
          "quantity",
          "uniqueId"
        ],
        "type": "object",
        "properties": {
          "uniqueId": {
            "minLength": 1,
            "type": "string",
            "description": "Unique ID of the line of the item to void (Guid)"
          },
          "keyId": {
            "minLength": 1,
            "type": "string",
            "description": "Item key identifier to void."
          },
          "itemType": {
            "type": "integer",
            "description": "Item type (e.g., 0 = Normal, 1 = Menu, etc.).",
            "format": "int32"
          },
          "quantity": {
            "type": "number",
            "description": "Quantity to void (default: 1).",
            "format": "double",
            "default": 1
          },
          "cancellationReasonId": {
            "type": "integer",
            "description": "Cancellation reason identifier (0 = no specific reason).",
            "format": "int32",
            "default": 0
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderVoidItemDTO"
            },
            "description": "Sub-items to void along with this item (e.g., complements).",
            "default": null,
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "DTO for individual item to void"
      },
      "PizzaComponentsDTO": {
        "type": "object",
        "properties": {
          "flavors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PizzaFlavorSelectionDTO"
            },
            "description": "List of pizza flavor selections (each flavor can have its own items and observations).",
            "default": null,
            "nullable": true
          },
          "borderItems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PizzaSelectedItemDTO"
            },
            "description": "List of border/crust items.",
            "default": null,
            "nullable": true
          },
          "extraItems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PizzaSelectedItemDTO"
            },
            "description": "List of extra topping items.",
            "default": null,
            "nullable": true
          },
          "comments": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Free-text comments for the pizza.",
            "default": null,
            "nullable": true
          },
          "priceRuleSelection": {
            "type": "integer",
            "description": "Price rule selection for the pizza (0 = default).",
            "format": "int32",
            "default": 0
          }
        },
        "additionalProperties": false,
        "description": "DTO for pizza-specific components (flavors, borders, extras, comments)."
      },
      "PizzaFlavorSelectionDTO": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer",
            "description": "Flavor index (position on the pizza, e.g., 1 = first half, 2 = second half).",
            "format": "int32"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PizzaSelectedItemDTO"
            },
            "description": "Items/toppings for this flavor.",
            "default": null,
            "nullable": true
          },
          "comments": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Free-text comments for this flavor.",
            "default": null,
            "nullable": true
          },
          "observations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PizzaObservationDTO"
            },
            "description": "Predefined observations for this flavor (with/without modifiers).",
            "default": null,
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "DTO for a pizza flavor selection with its items and observations."
      },
      "PizzaObservationDTO": {
        "type": "object",
        "properties": {
          "keyId": {
            "type": "string",
            "description": "Observation item key identifier.",
            "nullable": true
          },
          "mode": {
            "$ref": "#/components/schemas/PizzaObservationMode"
          }
        },
        "additionalProperties": false,
        "description": "DTO for a pizza observation with mode (with/without)."
      },
      "PizzaObservationMode": {
        "enum": [
          1,
          2
        ],
        "type": "integer",
        "format": "int32"
      },
      "PizzaSelectedItemDTO": {
        "type": "object",
        "properties": {
          "keyId": {
            "type": "string",
            "description": "Item key identifier.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "DTO for a selected pizza item (topping, border, extra)."
      },
      "TableBillRequestDTO": {
        "required": [
          "employeeId",
          "tableId",
          "totalAmount"
        ],
        "type": "object",
        "properties": {
          "tableId": {
            "type": "integer",
            "description": "Table number (must be different from 0)",
            "format": "int32"
          },
          "totalAmount": {
            "type": "number",
            "description": "Total amount to pay",
            "format": "double",
            "default": 0
          },
          "customerVat": {
            "type": "string",
            "description": "Customer VAT number",
            "default": "",
            "nullable": true
          },
          "customerName": {
            "type": "string",
            "description": "Customer name",
            "default": "",
            "nullable": true
          },
          "customerAddress": {
            "type": "string",
            "description": "Customer address",
            "default": "",
            "nullable": true
          },
          "customerPostalCode": {
            "type": "string",
            "description": "Customer postal code",
            "default": "",
            "nullable": true
          },
          "customerCity": {
            "type": "string",
            "description": "Customer city",
            "default": "",
            "nullable": true
          },
          "customerCountryISO3166Alpha2": {
            "type": "string",
            "description": "Customer country code in ISO 3166-1 Alpha-2 format (e.g., \"AO\",\"PT\",\"BR\")",
            "default": "",
            "nullable": true
          },
          "customerEmail": {
            "type": "string",
            "description": "Customer email (optional; if provided, the invoice will be sent to the customer)",
            "default": "",
            "nullable": true
          },
          "mobilePhone": {
            "type": "string",
            "description": "Mobile phone number",
            "default": "",
            "nullable": true
          },
          "paymentTypeId": {
            "type": "integer",
            "description": "Payment type ID (optional, 0 = uses default \"OU\" payment type)",
            "format": "int32",
            "default": 0
          },
          "employeeId": {
            "type": "integer",
            "description": "Employee/user identifier who is closing the account.",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "DTO for closing table account (billing)"
      },
      "TableBillResponseDTO": {
        "type": "object",
        "properties": {
          "documentTypeId": {
            "type": "integer",
            "description": "Fiscal document type",
            "format": "int32"
          },
          "documentSerieId": {
            "type": "integer",
            "description": "Fiscal series used at the time the document was issued.",
            "format": "int32"
          },
          "documentNumber": {
            "type": "integer",
            "description": "Sequential document number within the fiscal series.",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "Response DTO after closing a table account (billing), containing the fiscal document details."
      },
      "TableDetailsDTO": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Table unique identifier.",
            "format": "int32"
          },
          "saleZoneAreaId": {
            "type": "integer",
            "description": "Sale zone area identifier the table belongs to.",
            "format": "int32"
          },
          "description": {
            "type": "string",
            "description": "Table description/name.",
            "nullable": true
          },
          "status": {
            "$ref": "#/components/schemas/TableStatus"
          },
          "customerKeyId": {
            "type": "string",
            "description": "Customer key identifier associated with the table.",
            "nullable": true
          },
          "orders": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TableOrdersItemDTO"
            },
            "description": "List of order line items currently on the table.",
            "nullable": true
          },
          "summary": {
            "$ref": "#/components/schemas/TableOrdersSummaryDTO"
          }
        },
        "additionalProperties": false,
        "description": "Detailed table DTO including current orders and summary totals."
      },
      "TableFilter": {
        "enum": [
          0,
          1
        ],
        "type": "integer",
        "format": "int32"
      },
      "TableOrderRequestDTO": {
        "required": [
          "employeeId",
          "items",
          "tableId"
        ],
        "type": "object",
        "properties": {
          "tableId": {
            "type": "integer",
            "description": "Table number (must be different from 0)",
            "format": "int32"
          },
          "employeeId": {
            "type": "integer",
            "description": "Employee/user identifier placing the order.",
            "format": "int32"
          },
          "personsNumber": {
            "type": "integer",
            "description": "Number of people at the table",
            "format": "int32",
            "default": 0
          },
          "items": {
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderItemDTO"
            },
            "description": "List of items to add to the order (at least one required)."
          }
        },
        "additionalProperties": false,
        "description": "DTO for table order requests with hierarchical item structure"
      },
      "TableOrderSubItemDTO": {
        "type": "object",
        "properties": {
          "uniqueId": {
            "type": "string",
            "description": "Unique identifier (GUID) for this sub-item line.",
            "nullable": true
          },
          "itemKeyId": {
            "type": "string",
            "description": "Item key identifier.",
            "nullable": true
          },
          "itemType": {
            "$ref": "#/components/schemas/ItemType"
          },
          "quantity": {
            "type": "number",
            "description": "Quantity of the sub-item.",
            "format": "double",
            "nullable": true
          },
          "description": {
            "type": "string",
            "description": "Sub-item description/name.",
            "nullable": true
          },
          "attributeName": {
            "type": "string",
            "description": "Attribute name (for item attributes/modifiers).",
            "nullable": true
          },
          "attributeValue": {
            "type": "string",
            "description": "Attribute value (for item attributes/modifiers).",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "DTO for a sub-item within a table order item (e.g., complement, observation)."
      },
      "TableOrderTransferRequestDTO": {
        "required": [
          "destinationTableId",
          "employeeId",
          "items",
          "sourceTableId"
        ],
        "type": "object",
        "properties": {
          "sourceTableId": {
            "type": "integer",
            "description": "Source table identifier to transfer items from.",
            "format": "int32"
          },
          "destinationTableId": {
            "type": "integer",
            "description": "Destination table identifier to transfer items to.",
            "format": "int32"
          },
          "employeeId": {
            "type": "integer",
            "description": "Employee/user identifier performing the transfer.",
            "format": "int32"
          },
          "items": {
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderTransferItemDTO"
            },
            "description": "List of items to transfer (at least one required)."
          }
        },
        "additionalProperties": false,
        "description": "DTO for table order transfer requests"
      },
      "TableOrderVoidRequestDTO": {
        "required": [
          "employeeId",
          "items",
          "tableId"
        ],
        "type": "object",
        "properties": {
          "tableId": {
            "type": "integer",
            "description": "Table number (must be different from 0)",
            "format": "int32"
          },
          "employeeId": {
            "type": "integer",
            "description": "Employee/user identifier performing the void.",
            "format": "int32"
          },
          "items": {
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderVoidItemDTO"
            },
            "description": "List of items to void (at least one required)."
          }
        },
        "additionalProperties": false,
        "description": "DTO for table order void requests"
      },
      "TableOrdersItemDTO": {
        "type": "object",
        "properties": {
          "uniqueId": {
            "type": "string",
            "description": "Unique identifier (GUID) for this order line.",
            "nullable": true
          },
          "itemKeyId": {
            "type": "string",
            "description": "Item key identifier.",
            "nullable": true
          },
          "itemGroupId": {
            "type": "integer",
            "description": "Item group identifier.",
            "format": "int32"
          },
          "itemType": {
            "$ref": "#/components/schemas/ItemType"
          },
          "sortKey": {
            "type": "integer",
            "description": "Sort key for ordering the items in the list.",
            "format": "int32",
            "nullable": true
          },
          "description": {
            "type": "string",
            "description": "Item description/name.",
            "nullable": true
          },
          "quantity": {
            "type": "number",
            "description": "Quantity ordered.",
            "format": "double",
            "nullable": true
          },
          "total": {
            "type": "number",
            "description": "Total amount for this line item.",
            "format": "double",
            "nullable": true
          },
          "subItems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TableOrderSubItemDTO"
            },
            "description": "Sub-items (complements, menu components, pizza toppings, etc.).",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "DTO for a single order item on a table."
      },
      "TableOrdersSummaryDTO": {
        "type": "object",
        "properties": {
          "totalAmount": {
            "type": "number",
            "description": "Total amount of all orders on the table.",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Summary DTO with total amounts for a table's orders."
      },
      "TableStatus": {
        "enum": [
          0,
          1,
          2,
          3,
          4
        ],
        "type": "integer",
        "format": "int32"
      },
      "TableSummaryDTO": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Table unique identifier.",
            "format": "int32"
          },
          "saleZoneAreaId": {
            "type": "integer",
            "description": "Sale zone area identifier the table belongs to.",
            "format": "int32"
          },
          "status": {
            "$ref": "#/components/schemas/TableStatus"
          },
          "statusDescription": {
            "type": "string",
            "description": "Human-readable status description.",
            "nullable": true
          },
          "total": {
            "type": "number",
            "description": "Current total amount on the table.",
            "format": "double",
            "nullable": true
          },
          "subTotalReference": {
            "type": "string",
            "description": "Subtotal reference information.",
            "nullable": true
          },
          "description": {
            "type": "string",
            "description": "Table description/name.",
            "nullable": true
          },
          "terminalId": {
            "type": "integer",
            "description": "Terminal identifier currently serving this table.",
            "format": "int32",
            "nullable": true
          },
          "discount": {
            "type": "number",
            "description": "Discount percentage applied to the table.",
            "format": "double",
            "nullable": true
          },
          "loginDate": {
            "type": "string",
            "description": "Date and time the table was opened/logged in.",
            "format": "date-time",
            "nullable": true
          },
          "logoutDate": {
            "type": "string",
            "description": "Date and time the table was closed/logged out.",
            "format": "date-time",
            "nullable": true
          },
          "customer": {
            "$ref": "#/components/schemas/CustomerSummaryDTO"
          },
          "user": {
            "$ref": "#/components/schemas/UserSummaryDTO"
          }
        },
        "additionalProperties": false,
        "description": "Summary DTO for table listing, containing status, totals, and associated customer/user info."
      },
      "TableZoneDTO": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Zone unique identifier.",
            "format": "int32"
          },
          "terminal": {
            "type": "integer",
            "description": "Terminal identifier associated with this zone.",
            "format": "int32",
            "nullable": true
          },
          "description": {
            "type": "string",
            "description": "Zone description/name.",
            "nullable": true
          },
          "initialValue": {
            "type": "integer",
            "description": "Initial table number in this zone range.",
            "format": "int32",
            "nullable": true
          },
          "finalValue": {
            "type": "integer",
            "description": "Final table number in this zone range.",
            "format": "int32",
            "nullable": true
          },
          "itemPrice": {
            "type": "integer",
            "description": "Default item price line for this zone.",
            "format": "int32",
            "nullable": true
          },
          "employees": {
            "type": "string",
            "description": "Comma-separated list of employee IDs allowed in this zone.",
            "nullable": true
          },
          "syncStamp": {
            "type": "string",
            "description": "Last synchronization timestamp.",
            "format": "date-time",
            "nullable": true
          },
          "useAlternativeTax": {
            "type": "boolean",
            "description": "Indicates whether this zone uses alternative tax rates."
          },
          "terminals": {
            "type": "string",
            "description": "Comma-separated list of terminal IDs allowed in this zone.",
            "nullable": true
          },
          "initialUserOnly": {
            "type": "boolean",
            "description": "Indicates whether only the initial user can operate tables in this zone."
          }
        },
        "additionalProperties": false,
        "description": "DTO for table zone (sale zone area) configuration."
      },
      "UserSummaryDTO": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "User unique identifier.",
            "format": "int32"
          },
          "name": {
            "type": "string",
            "description": "User display name.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Summary DTO for user/employee information associated with a table."
      },
      "XConfigSalezoneAreaObjectDTO": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Table unique identifier.",
            "format": "int32"
          },
          "saleZoneAreaId": {
            "type": "integer",
            "description": "Sale zone area identifier the table belongs to.",
            "format": "int32"
          },
          "description": {
            "type": "string",
            "description": "Table description/name.",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "description": "Table status code.",
            "format": "int32",
            "nullable": true
          },
          "total": {
            "type": "number",
            "description": "Current total amount on the table.",
            "format": "double",
            "nullable": true
          },
          "subTotalReference": {
            "type": "string",
            "description": "Subtotal reference information.",
            "nullable": true
          },
          "scontaPrinterId": {
            "type": "integer",
            "description": "Sub-account printer identifier.",
            "format": "int32",
            "nullable": true
          },
          "fcontaPrinterId": {
            "type": "integer",
            "description": "Final account printer identifier.",
            "format": "int32",
            "nullable": true
          },
          "loginDate": {
            "type": "string",
            "description": "Date and time the table was opened/logged in.",
            "format": "date-time",
            "nullable": true
          },
          "logoutDate": {
            "type": "string",
            "description": "Date and time the table was closed/logged out.",
            "format": "date-time",
            "nullable": true
          },
          "defaultSerieId": {
            "type": "integer",
            "description": "Default document series identifier for this table.",
            "format": "int32",
            "nullable": true
          },
          "defaultDocumentTypeId": {
            "type": "integer",
            "description": "Default document type identifier for this table.",
            "format": "int32",
            "nullable": true
          },
          "serviceTxCanceled": {
            "type": "boolean",
            "description": "Indicates whether the service tax has been canceled for this table.",
            "nullable": true
          },
          "discount": {
            "type": "number",
            "description": "Discount percentage applied to the table.",
            "format": "double",
            "nullable": true
          },
          "numberPersons": {
            "type": "integer",
            "description": "Number of persons at the table.",
            "format": "int32",
            "nullable": true
          },
          "freeTable": {
            "type": "boolean",
            "description": "Indicates whether this is a free/open table.",
            "nullable": true
          },
          "cardSerieId": {
            "type": "integer",
            "description": "Card series identifier for card-based operations.",
            "format": "int32",
            "nullable": true
          },
          "saleZoneAreaObjectId1": {
            "type": "integer",
            "description": "First linked sale zone area object identifier.",
            "format": "int32",
            "nullable": true
          },
          "saleZoneAreaObjectId2": {
            "type": "integer",
            "description": "Second linked sale zone area object identifier.",
            "format": "int32",
            "nullable": true
          },
          "inactive": {
            "type": "boolean",
            "description": "Indicates whether the table is inactive.",
            "nullable": true
          },
          "blockTransferTo": {
            "type": "boolean",
            "description": "Blocks transfers to this table."
          },
          "blockTransferFrom": {
            "type": "boolean",
            "description": "Blocks transfers from this table."
          },
          "initialUserOnly": {
            "type": "boolean",
            "description": "Only the initial user who opened the table can operate it."
          },
          "initialUser": {
            "type": "integer",
            "description": "Initial user identifier who opened the table.",
            "format": "int32"
          },
          "publicRelationsId": {
            "type": "integer",
            "description": "Public relations/salesperson identifier.",
            "format": "int32"
          },
          "serviceTxSuspended": {
            "type": "boolean",
            "description": "Indicates whether the service tax is suspended for this table."
          },
          "printOrderOnCloseAccount": {
            "type": "boolean",
            "description": "Prints the order automatically when the account is closed."
          }
        },
        "additionalProperties": false,
        "description": "DTO for sale zone area object (table) extended configuration."
      },
      "XdConnectionStatusDTO": {
        "type": "object",
        "properties": {
          "connected": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "Bearer": {
        "type": "http",
        "description": "JWT Authorization header. Enter your token in the text input below.Example: \"abcdef\"",
        "scheme": "Bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "security": [
    {
      "Bearer": []
    }
  ],
  "tags": [
    {
      "name": "OnlineOrders",
      "description": "Controller for sending online orders directly to XDREST"
    },
    {
      "name": "Tables",
      "description": "Controller responsible for managing tables and their operations."
    },
    {
      "name": "TableZones",
      "description": "Controller responsible for managing table zones."
    }
  ]
}