{ "openapi": "3.1.0", "info": { "title": "AKIRA Ops Suite API", "description": "Internal multi-outlet restaurant operations platform.\n\nAuthenticate with a Supabase access token: `Authorization: Bearer `.", "version": "0.1.0" }, "paths": { "/users/me": { "get": { "tags": [ "users" ], "summary": "The signed-in user", "description": "Profile, global role and outlet memberships for the current session.\n\nThe client uses this to decide which shell to render, so it is the first\ncall after sign-in.", "operationId": "read_me_users_me_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MeResponse" } } } } }, "security": [ { "HTTPBearer": [] } ] }, "patch": { "tags": [ "users" ], "summary": "Update your own details", "description": "Change your own name or phone. Role, outlets and activation are not\neditable here \u2014 those are administrative actions.", "operationId": "update_me_users_me_patch", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateMeRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MeResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/users/roles/grantable": { "get": { "tags": [ "users" ], "summary": "Roles you may assign", "description": "What the signed-in user may grant, plus a plain-language reason for each\nrole they may not. The UI disables the rest with the reason attached rather\nthan omitting them \u2014 a rule you cannot see is a rule you will argue with.", "operationId": "get_grantable_roles_users_roles_grantable_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GrantableRolesResponse" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/users": { "get": { "tags": [ "users" ], "summary": "People you can administer", "description": "Owners and operations managers see everyone. An outlet manager sees only\npeople in their own outlets.", "operationId": "list_users_users_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "outlet_id", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string", "format": "uuid" }, { "type": "null" } ], "title": "Outlet Id" } }, { "name": "role", "in": "query", "required": false, "schema": { "anyOf": [ { "$ref": "#/components/schemas/UserRole" }, { "type": "null" } ], "title": "Role" } }, { "name": "is_active", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Is Active" } }, { "name": "search", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string", "maxLength": 80 }, { "type": "null" } ], "title": "Search" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/UserListItem" }, "title": "Response List Users Users Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/users/invite": { "post": { "tags": [ "users" ], "summary": "Invite someone", "description": "Supabase sends the invitation and owns the token, so no password is ever\nhandled here.\n\nYou can never grant a role at or above your own. An existing address is not\nan error: that person keeps the login they already have.", "operationId": "invite_user_users_invite_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InviteUserRequest" } } }, "required": true }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InviteUserResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/users/{profile_id}": { "get": { "tags": [ "users" ], "summary": "One person", "operationId": "get_user_users__profile_id__get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "profile_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Profile Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserListItem" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "patch": { "tags": [ "users" ], "summary": "Update someone's details", "description": "Deactivating the last active owner is refused: it would lock everyone out\nof outlet and user administration permanently.", "operationId": "update_user_users__profile_id__patch", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "profile_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Profile Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateUserRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserListItem" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/users/{profile_id}/role": { "put": { "tags": [ "users" ], "summary": "Change someone's role", "description": "Outlet roles follow the global role, so the two cannot silently disagree.", "operationId": "set_user_role_users__profile_id__role_put", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "profile_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Profile Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SetRoleRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserListItem" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/users/{profile_id}/outlets": { "put": { "tags": [ "users" ], "summary": "Replace someone's outlets", "description": "Replaces the whole set. The first outlet becomes their primary.", "operationId": "set_user_outlets_users__profile_id__outlets_put", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "profile_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Profile Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SetOutletsRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserListItem" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/users/{profile_id}/pin": { "put": { "tags": [ "users" ], "summary": "Set or clear a shared-tablet PIN", "description": "A PIN attributes floor work on a shared tablet to a real person. It\nauthorises floor actions only, can never approve a run, and is only accepted\non a device already bound to that person's outlet.\n\nSending `null` clears it, which is how a departing staff member comes off\nthe tablet without losing their history. Only shift leads and staff may\nhave one.", "operationId": "set_user_pin_users__profile_id__pin_put", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "profile_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Profile Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SetPinRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserListItem" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/users/{profile_id}/training-delegate": { "put": { "tags": [ "users" ], "summary": "Let a manager restart other people's training (owner only)", "description": "Restarting training is the owner's (D31). This hands it to one manager:\nan operations manager may then restart anyone's, an outlet manager only\npeople at their own outlets. Floor roles cannot hold it.", "operationId": "set_training_delegate_users__profile_id__training_delegate_put", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "profile_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Profile Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SetTrainingDelegateRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserListItem" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/platform/overview": { "get": { "tags": [ "platform" ], "summary": "Across every organisation", "operationId": "read_overview_platform_overview_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PlatformOverview" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/platform/organisations": { "get": { "tags": [ "platform" ], "summary": "Every organisation, with its usage against its allowance", "operationId": "list_organisations_platform_organisations_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/OrganisationRow" }, "type": "array", "title": "Response List Organisations Platform Organisations Get" } } } } }, "security": [ { "HTTPBearer": [] } ] }, "post": { "tags": [ "platform" ], "summary": "A new organisation and its first owner", "operationId": "create_organisation_platform_organisations_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateOrganisationRequest" } } }, "required": true }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateOrganisationResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/platform/organisations/{organisation_id}": { "get": { "tags": [ "platform" ], "summary": "One organisation: usage, outlets, onboarding, owners, activity", "operationId": "read_organisation_platform_organisations__organisation_id__get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "organisation_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Organisation Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OrganisationDetail" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "patch": { "tags": [ "platform" ], "summary": "Change an organisation's details, allowances or onboarding", "operationId": "update_organisation_platform_organisations__organisation_id__patch", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "organisation_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Organisation Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateOrganisationRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OrganisationDetail" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/outlets": { "get": { "tags": [ "outlets" ], "summary": "Outlets you can see", "description": "Owners and operations managers see every outlet. Everyone else sees only\nthe outlets they belong to.", "operationId": "list_outlets_outlets_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "include_inactive", "in": "query", "required": false, "schema": { "type": "boolean", "description": "Include outlets that have been deactivated.", "default": false, "title": "Include Inactive" }, "description": "Include outlets that have been deactivated." } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/OutletResponse" }, "title": "Response List Outlets Outlets Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "tags": [ "outlets" ], "summary": "Create an outlet", "description": "Owner only. The code must be unique and is fixed once created.", "operationId": "create_outlet_outlets_post", "security": [ { "HTTPBearer": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateOutletRequest" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OutletResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/outlets/{outlet_id}": { "get": { "tags": [ "outlets" ], "summary": "One outlet", "operationId": "get_outlet_outlets__outlet_id__get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "outlet_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Outlet Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OutletResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "patch": { "tags": [ "outlets" ], "summary": "Update an outlet", "description": "Owner only. Changes only the fields present in the body. The code cannot\nbe changed \u2014 it appears in exports and printed sheets.", "operationId": "update_outlet_outlets__outlet_id__patch", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "outlet_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Outlet Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateOutletRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OutletResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "delete": { "tags": [ "outlets" ], "summary": "Close an outlet", "description": "Owner only. A soft delete: history is kept, the outlet stops appearing.\n\nRefused with 409 while any checklist run is still pending, in progress or\nawaiting review \u2014 closing the outlet under them would strand work someone\nis in the middle of.", "operationId": "delete_outlet_outlets__outlet_id__delete", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "outlet_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Outlet Id" } } ], "responses": { "204": { "description": "Successful Response" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/onboarding": { "get": { "tags": [ "onboarding" ], "summary": "What this outlet still needs before the app can do its job", "description": "A checklist computed from the data itself, so it can never drift out of\nstep with reality. Omit `outlet_id` when the organisation has one outlet.", "operationId": "read_onboarding_onboarding_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "outlet_id", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string", "format": "uuid" }, { "type": "null" } ], "title": "Outlet Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OnboardingStatus" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/devices": { "get": { "tags": [ "devices" ], "summary": "Registered tablets", "operationId": "list_devices_devices_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "outlet_id", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string", "format": "uuid" }, { "type": "null" } ], "title": "Outlet Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Device" }, "title": "Response List Devices Devices Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "tags": [ "devices" ], "summary": "Register a tablet whose login already exists", "description": "Owner only. Binds an existing Supabase auth account to one outlet.\n\nThe account itself is created out of band, so this API never mints or\ntransports a credential.", "operationId": "register_device_devices_post", "security": [ { "HTTPBearer": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RegisterDeviceRequest" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Device" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/devices/tablets": { "post": { "tags": [ "devices" ], "summary": "Create a tablet, login and all", "description": "Owner only. Makes the Supabase login, binds it to the outlet, and hands\nthe credentials back once.\n\nUntil now this needed somebody to create an account in the Supabase\ndashboard first and paste its id in, which meant an owner could not put a\ntablet on the counter without a developer. The API mints the credential\ninstead \u2014 and because it does, tablets are capped like outlets and people.", "operationId": "create_tablet_devices_tablets_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateTabletRequest" } } }, "required": true }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TabletCredentials" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/devices/{device_id}": { "patch": { "tags": [ "devices" ], "summary": "Rename or suspend a tablet", "operationId": "update_device_devices__device_id__patch", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "device_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Device Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateDeviceRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Device" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "delete": { "tags": [ "devices" ], "summary": "Revoke a tablet", "description": "Owner only. Use this the moment a tablet goes missing: it stops that\naccount reaching any outlet data, without touching the runs it already\nrecorded.", "operationId": "revoke_device_devices__device_id__delete", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "device_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Device Id" } } ], "responses": { "204": { "description": "Successful Response" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/inventory/departments": { "get": { "tags": [ "inventory" ], "summary": "Departments (count stations)", "description": "The organisation's departments, plus the starter kit's (D33).", "operationId": "list_departments_inventory_departments_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/Department" }, "type": "array", "title": "Response List Departments Inventory Departments Get" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/inventory/categories": { "get": { "tags": [ "inventory" ], "summary": "Item categories", "operationId": "list_categories_inventory_categories_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/Category" }, "type": "array", "title": "Response List Categories Inventory Categories Get" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/inventory/items": { "get": { "tags": [ "inventory" ], "summary": "The item catalogue", "description": "The shared catalogue. Levels are included for the outlets the caller can\nsee, so an outlet manager reads their own pars without seeing another\noutlet's.", "operationId": "list_items_inventory_items_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "department_id", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string", "format": "uuid" }, { "type": "null" } ], "title": "Department Id" } }, { "name": "search", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string", "maxLength": 80 }, { "type": "null" } ], "title": "Search" } }, { "name": "include_inactive", "in": "query", "required": false, "schema": { "type": "boolean", "default": false, "title": "Include Inactive" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Item" }, "title": "Response List Items Inventory Items Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "tags": [ "inventory" ], "summary": "Add an item to the catalogue", "description": "Owner or operations manager. The item becomes available to every outlet;\neach outlet sets its own par level.", "operationId": "create_item_inventory_items_post", "security": [ { "HTTPBearer": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateItemRequest" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/inventory/items/{item_id}": { "patch": { "tags": [ "inventory" ], "summary": "Edit a catalogue item", "operationId": "update_item_inventory_items__item_id__patch", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "item_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Item Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateItemRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "delete": { "tags": [ "inventory" ], "summary": "Retire a catalogue item", "description": "Soft delete. History and past counts keep pointing at it; it simply\nstops appearing in the catalogue and on count sheets.", "operationId": "delete_item_inventory_items__item_id__delete", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "item_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Item Id" } } ], "responses": { "204": { "description": "Successful Response" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/inventory/items/{item_id}/levels/{outlet_id}": { "put": { "tags": [ "inventory" ], "summary": "Set an outlet's par level for an item", "description": "An outlet manager sets levels for their own outlet; owners and\noperations managers for any. is_stocked false means the outlet deliberately\ndoes not carry the item, which is different from never having configured it.", "operationId": "set_level_inventory_items__item_id__levels__outlet_id__put", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "item_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Item Id" } }, { "name": "outlet_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Outlet Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SetLevelRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Item" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/inventory/recipes": { "get": { "tags": [ "inventory" ], "summary": "Every recipe, with its ingredient lines", "operationId": "list_recipes_inventory_recipes_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/Recipe" }, "type": "array", "title": "Response List Recipes Inventory Recipes Get" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/inventory/recipes/unmapped": { "get": { "tags": [ "inventory" ], "summary": "Sold menu items with no recipe yet", "description": "The worklist, ordered by units sold \u2014 map the ramen that sells thirty\na night before the seasonal special. Theoretical consumption only counts\nwhat is mapped, so this list is the honesty gap made visible.", "operationId": "unmapped_inventory_recipes_unmapped_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/UnmappedName" }, "type": "array", "title": "Response Unmapped Inventory Recipes Unmapped Get" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/inventory/recipes/{menu_item_name}": { "put": { "tags": [ "inventory" ], "summary": "Create or replace one dish's recipe", "description": "Lines are replaced wholesale \u2014 a recipe is one fact about one dish.\nThe name must match what Petpooja prints on bills; the unmapped list is\nwhere those exact strings come from.", "operationId": "save_recipe_inventory_recipes__menu_item_name__put", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "menu_item_name", "in": "path", "required": true, "schema": { "type": "string", "title": "Menu Item Name" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RecipeSave" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Save Recipe Inventory Recipes Menu Item Name Put" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/inventory/recipes/{recipe_id}": { "delete": { "tags": [ "inventory" ], "summary": "Remove a recipe", "operationId": "delete_recipe_inventory_recipes__recipe_id__delete", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "recipe_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Recipe Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Delete Recipe Inventory Recipes Recipe Id Delete" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/inventory/counts": { "post": { "tags": [ "stock-counts" ], "summary": "Upload a photographed count sheet", "description": "Accepts the sheet, answers immediately; extraction runs behind a\njob_runs bracket and the count appears in `review` when it lands.", "operationId": "upload_sheet_inventory_counts_post", "security": [ { "HTTPBearer": [] } ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_upload_sheet_inventory_counts_post" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Upload Sheet Inventory Counts Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "get": { "tags": [ "stock-counts" ], "summary": "Counts for an outlet, newest first", "operationId": "list_counts_inventory_counts_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "outlet_id", "in": "query", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Outlet Id" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "default": 30, "title": "Limit" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true }, "title": "Response List Counts Inventory Counts Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/inventory/counts/{count_id}": { "get": { "tags": [ "stock-counts" ], "summary": "One count, with every line", "operationId": "get_count_inventory_counts__count_id__get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "count_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Count Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Get Count Inventory Counts Count Id Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/inventory/counts/{count_id}/lines/{line_id}": { "patch": { "tags": [ "stock-counts" ], "summary": "Resolve a line", "operationId": "review_line_inventory_counts__count_id__lines__line_id__patch", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "count_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Count Id" } }, { "name": "line_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Line Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReviewLineRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Review Line Inventory Counts Count Id Lines Line Id Patch" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/inventory/counts/{count_id}/re-extract": { "post": { "tags": [ "stock-counts" ], "summary": "Read the stored sheet again", "description": "The stored file is re-read \u2014 after a failure, or under a newer\nextractor. Existing unconfirmed lines are replaced wholesale.", "operationId": "re_extract_inventory_counts__count_id__re_extract_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "count_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Count Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Re Extract Inventory Counts Count Id Re Extract Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/inventory/counts/{count_id}/confirm": { "post": { "tags": [ "stock-counts" ], "summary": "Sign the count off", "operationId": "confirm_count_inventory_counts__count_id__confirm_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "count_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Count Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Confirm Count Inventory Counts Count Id Confirm Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/inventory/requisitions": { "post": { "tags": [ "stock-counts" ], "summary": "Compute a requisition from a confirmed count", "operationId": "build_requisition_inventory_requisitions_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "count_id", "in": "query", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Count Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Build Requisition Inventory Requisitions Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/inventory/requisitions/{requisition_id}": { "get": { "tags": [ "stock-counts" ], "summary": "One requisition, lines and working", "operationId": "get_requisition_inventory_requisitions__requisition_id__get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "requisition_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Requisition Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Get Requisition Inventory Requisitions Requisition Id Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/inventory/requisitions/{requisition_id}/lines": { "patch": { "tags": [ "stock-counts" ], "summary": "Set a final quantity", "operationId": "set_final_qty_inventory_requisitions__requisition_id__lines_patch", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "requisition_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Requisition Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FinalQtyRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Set Final Qty Inventory Requisitions Requisition Id Lines Patch" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/inventory/requisitions/{requisition_id}/finalise": { "post": { "tags": [ "stock-counts" ], "summary": "Lock the requisition", "operationId": "finalise_requisition_inventory_requisitions__requisition_id__finalise_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "requisition_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Requisition Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Finalise Requisition Inventory Requisitions Requisition Id Finalise Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/settings": { "get": { "tags": [ "settings" ], "summary": "Every setting with its current value", "description": "The full registry, each key resolved to the value in force right now for\nthe caller's organisation (D33); the platform's job times stay global.\nGrouped client-side by `group`.", "operationId": "list_settings_settings_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/SettingView" }, "type": "array", "title": "Response List Settings Settings Get" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/settings/{key}/history": { "get": { "tags": [ "settings" ], "summary": "Every value this setting has held", "description": "The organisation's rows for this key: its own, its outlets', and the\nglobal ones that still apply to it.", "operationId": "setting_history_settings__key__history_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "key", "in": "path", "required": true, "schema": { "type": "string", "title": "Key" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 200, "minimum": 1, "default": 50, "title": "Limit" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/SettingHistoryRow" }, "title": "Response Setting History Settings Key History Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/settings/{key}": { "put": { "tags": [ "settings" ], "summary": "Change a setting", "description": "Inserts a new effective-dated row rather than editing the old one, so\nscoring a past period keeps using the values that were live then.\n\nScoring weights and bands are owner-only; the operational groups\n(integrity, AI review, jobs) accept an operations manager too.", "operationId": "set_setting_settings__key__put", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "key", "in": "path", "required": true, "schema": { "type": "string", "title": "Key" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SetSettingRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SettingView" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/jobs/runs": { "get": { "tags": [ "jobs" ], "summary": "Recent job executions", "description": "Newest first. A gap where a scheduled job should have run is as\nsignificant as a failure row \u2014 both mean the job did not do its work.", "operationId": "list_job_runs_jobs_runs_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 200, "minimum": 1, "default": 50, "title": "Limit" } }, { "name": "job_name", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string", "maxLength": 80 }, { "type": "null" } ], "title": "Job Name" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/JobRun" }, "title": "Response List Job Runs Jobs Runs Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/jobs/schedule": { "get": { "tags": [ "jobs" ], "summary": "What is scheduled, and when it next fires", "operationId": "job_schedule_jobs_schedule_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScheduleView" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/jobs/{job_name}/run": { "post": { "tags": [ "jobs" ], "summary": "Run a scheduled job now (owner only)", "description": "Owner only, and every one of these is safe to press twice.\n\nMaterialisation is idempotent by unique constraint; marking missed only\nmoves runs already past grace; the digest re-sends a report rather than\nchanging anything. Nothing here is destructive, which is why it can be a\nbutton at all \u2014 but it does send mail, so it is not left to ops managers.", "operationId": "run_now_jobs__job_name__run_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "job_name", "in": "path", "required": true, "schema": { "type": "string", "title": "Job Name" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RunJobRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Run Now Jobs Job Name Run Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/dashboard/outlets": { "get": { "tags": [ "dashboard" ], "summary": "One score per outlet the caller can see", "description": "The comparison row across outlets. Ordered by code, not by score \u2014 a\nleague table invites gaming the number rather than doing the work.", "operationId": "outlet_scores_dashboard_outlets_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "days", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 365, "minimum": 1, "default": 28, "title": "Days" } }, { "name": "to", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string", "format": "date" }, { "type": "null" } ], "title": "To" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/OutletHealthRow" }, "title": "Response Outlet Scores Dashboard Outlets Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/dashboard/outlet-health": { "get": { "tags": [ "dashboard" ], "summary": "The four-pillar health card for one outlet", "description": "Everything the card renders: the score, how it was arrived at, what\ndragged it down, and the trend behind it.", "operationId": "outlet_health_dashboard_outlet_health_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "outlet_id", "in": "query", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Outlet Id" } }, { "name": "days", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 365, "minimum": 1, "default": 28, "title": "Days" } }, { "name": "to", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string", "format": "date" }, { "type": "null" } ], "title": "To" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Outlet Health Dashboard Outlet Health Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sales/uploads": { "post": { "tags": [ "sales" ], "summary": "Upload a Petpooja export", "description": "Accepts a Petpooja .xlsx export and parses it in the background.\n\nTwo reports are understood, told apart by their header row: the Orders\nMaster Report (bills) and the Order Listing report (item names per bill).\nThe uploader does not choose \u2014 the file says what it is, and anything\nelse is refused here in the request.\n\nThe outlet is chosen here rather than read from the file: a Petpooja export\nnames only the restaurant, so two outlets produce indistinguishable files.\n\nRe-sending a file already ingested returns the original upload untouched \u2014\nidempotency is on the bytes, not the filename, which carries an export\ntimestamp and changes every time.", "operationId": "upload_export_sales_uploads_post", "security": [ { "HTTPBearer": [] } ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_upload_export_sales_uploads_post" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Upload Export Sales Uploads Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "get": { "tags": [ "sales" ], "summary": "Uploads and how they parsed", "description": "Newest first, each carrying its warnings. A parser that dropped rows\nsilently would be a parser nobody could trust, so what it skipped travels\nwith the upload.", "operationId": "list_uploads_sales_uploads_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "outlet_id", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string", "format": "uuid" }, { "type": "null" } ], "title": "Outlet Id" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 200, "minimum": 1, "default": 50, "title": "Limit" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/UploadRow" }, "title": "Response List Uploads Sales Uploads Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sales/uploads/{upload_id}/reparse": { "post": { "tags": [ "sales" ], "summary": "Parse a stored file again", "description": "Re-read the stored original \u2014 after an adapter version bump, or after\nfixing whatever made it fail. The file is kept precisely so nobody has to\ngo back to Petpooja and export it again.", "operationId": "reparse_sales_uploads__upload_id__reparse_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "upload_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Upload Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Reparse Sales Uploads Upload Id Reparse Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sales/orders": { "get": { "tags": [ "sales" ], "summary": "Ingested bills", "description": "Grouped and filtered by `business_date`, never by the calendar date \u2014\na bill at 00:45 belongs to the night before.", "operationId": "list_orders_sales_orders_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "outlet_id", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string", "format": "uuid" }, { "type": "null" } ], "title": "Outlet Id" } }, { "name": "from", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string", "format": "date" }, { "type": "null" } ], "title": "From" } }, { "name": "to", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string", "format": "date" }, { "type": "null" } ], "title": "To" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 500, "minimum": 1, "default": 100, "title": "Limit" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/OrderRow" }, "title": "Response List Orders Sales Orders Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sales/daily": { "get": { "tags": [ "sales" ], "summary": "Net sales per trading day", "description": "What the Stage 2 sales pillar will read. Here now because it is the\ncheapest way to see whether an ingest landed on the days it should.", "operationId": "daily_sales_daily_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "outlet_id", "in": "query", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Outlet Id" } }, { "name": "from", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string", "format": "date" }, { "type": "null" } ], "title": "From" } }, { "name": "to", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string", "format": "date" }, { "type": "null" } ], "title": "To" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/DailyTotal" }, "title": "Response Daily Sales Daily Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sales/items": { "get": { "tags": [ "sales" ], "summary": "How often each item appears on a bill", "description": "Appearances, not units: the Order Listing carries names without\nquantities, so a bill with two Shoyu Ramen counts once. Empty until a\nlisting has been uploaded for the outlet.", "operationId": "items_sales_items_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "outlet_id", "in": "query", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Outlet Id" } }, { "name": "from", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string", "format": "date" }, { "type": "null" } ], "title": "From" } }, { "name": "to", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string", "format": "date" }, { "type": "null" } ], "title": "To" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ItemSummaryRow" }, "title": "Response Items Sales Items Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sales/menu-items": { "get": { "tags": [ "sales" ], "summary": "The menu map, with the bill spellings that point at each item", "description": "Organisation-level: one menu across its outlets (D29, D33). Empty until\nan Item Wise report has been uploaded.", "operationId": "menu_items_sales_menu_items_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/MenuItemRow" }, "type": "array", "title": "Response Menu Items Sales Menu Items Get" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/sales/menu-items/aliases": { "post": { "tags": [ "sales" ], "summary": "Teach the menu map a spelling bills use", "description": "One spelling maps to exactly one item, case-insensitively, forever.\nAdmin-level because it changes how every outlet's bills are read.", "operationId": "add_menu_alias_sales_menu_items_aliases_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AddMenuAliasRequest" } } }, "required": true }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Response Add Menu Alias Sales Menu Items Aliases Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/sales/menu-items/aliases/{alias_id}": { "delete": { "tags": [ "sales" ], "summary": "Forget a bill spelling", "operationId": "delete_menu_alias_sales_menu_items_aliases__alias_id__delete", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "alias_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Alias Id" } } ], "responses": { "204": { "description": "Successful Response" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sales/menu-mix": { "get": { "tags": [ "sales" ], "summary": "Category attach: share of bills carrying each category", "description": "The beverage-per-ticket, dessert-per-ticket numbers (D29), two ways\nand labelled: Petpooja's own per-period count of bills carrying each\ncategory, and the same thing measured on the bills whose items were\nuploaded. Empty until a Category Wise report has been uploaded; the\nmeasured half stays empty until an Item Wise report has taught the menu\nmap and an Order Listing has supplied names per bill.", "operationId": "menu_mix_sales_menu_mix_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "outlet_id", "in": "query", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Outlet Id" } }, { "name": "from", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string", "format": "date" }, { "type": "null" } ], "title": "From" } }, { "name": "to", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string", "format": "date" }, { "type": "null" } ], "title": "To" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MenuMixResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sales/forecast": { "get": { "tags": [ "sales" ], "summary": "The baseline forecast for the coming days", "description": "Spec 5.1's baseline: median of the last four same weekdays, times a\nclamped 14-day trend, times any manual event flag. Every row carries its\nworking \u2014 the sample dates, the factor, the multiplier \u2014 because a\nforecast a manager cannot check is one they learn to ignore.\n\nThis is the LIVE view; the nightly job stores the same numbers so\naccuracy is scored against what was predicted in advance.", "operationId": "forecast_sales_forecast_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "outlet_id", "in": "query", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Outlet Id" } }, { "name": "days", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 14, "minimum": 1, "default": 7, "title": "Days" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ForecastDay" }, "title": "Response Forecast Sales Forecast Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sales/forecast/accuracy": { "get": { "tags": [ "sales" ], "summary": "How the stored forecasts scored against reality", "description": "MAPE against the rows the nightly job stored BEFORE those days\ntraded. The spec's graduation rule reads from here: a learned model may\nreplace the baseline only when this history says it genuinely loses.", "operationId": "forecast_accuracy_sales_forecast_accuracy_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "outlet_id", "in": "query", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Outlet Id" } }, { "name": "weeks", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 26, "minimum": 1, "default": 8, "title": "Weeks" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Forecast Accuracy Sales Forecast Accuracy Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sales/forecast/events": { "get": { "tags": [ "sales" ], "summary": "Event flags in the forecast window", "operationId": "forecast_events_sales_forecast_events_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "outlet_id", "in": "query", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Outlet Id" } }, { "name": "from", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string", "format": "date" }, { "type": "null" } ], "title": "From" } }, { "name": "to", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string", "format": "date" }, { "type": "null" } ], "title": "To" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ForecastEventRow" }, "title": "Response Forecast Events Sales Forecast Events Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "tags": [ "sales" ], "summary": "Flag an event before it happens", "description": "The manual override in the spec's formula: \"Durga Puja weekend,\nexpect 1.3x\", written down in advance. Outlet-scoped, or group-wide\nwhen no outlet is named.", "operationId": "create_forecast_event_sales_forecast_events_post", "security": [ { "HTTPBearer": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ForecastEventCreate" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ForecastEventRow" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sales/forecast/events/{event_id}": { "delete": { "tags": [ "sales" ], "summary": "Remove an event flag", "operationId": "delete_forecast_event_sales_forecast_events__event_id__delete", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "event_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Event Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Delete Forecast Event Sales Forecast Events Event Id Delete" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/training/me": { "get": { "tags": [ "training" ], "summary": "Whether the walkthrough has to run for the person acting", "operationId": "my_status_training_me_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "version", "in": "query", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 40, "description": "The content version the client carries", "title": "Version" }, "description": "The content version the client carries" }, { "name": "X-Actor-Token", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "On a shared-tablet session: the assertion from /floor/identify.", "title": "X-Actor-Token" }, "description": "On a shared-tablet session: the assertion from /floor/identify." } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TrainingStatus" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/training/me/start": { "post": { "tags": [ "training" ], "summary": "Begin the walkthrough, or resume the attempt already open", "operationId": "start_training_me_start_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "X-Actor-Token", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "On a shared-tablet session: the assertion from /floor/identify.", "title": "X-Actor-Token" }, "description": "On a shared-tablet session: the assertion from /floor/identify." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StartRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TrainingRecord" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/training/me/step": { "post": { "tags": [ "training" ], "summary": "Record that a step was reached", "operationId": "step_training_me_step_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "X-Actor-Token", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "On a shared-tablet session: the assertion from /floor/identify.", "title": "X-Actor-Token" }, "description": "On a shared-tablet session: the assertion from /floor/identify." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StepRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TrainingRecord" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/training/me/complete": { "post": { "tags": [ "training" ], "summary": "Finish the walkthrough", "operationId": "complete_training_me_complete_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "X-Actor-Token", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "On a shared-tablet session: the assertion from /floor/identify.", "title": "X-Actor-Token" }, "description": "On a shared-tablet session: the assertion from /floor/identify." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RecordRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TrainingRecord" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/training/me/skip": { "post": { "tags": [ "training" ], "summary": "Skip the walkthrough (owner only)", "operationId": "skip_training_me_skip_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "X-Actor-Token", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "On a shared-tablet session: the assertion from /floor/identify.", "title": "X-Actor-Token" }, "description": "On a shared-tablet session: the assertion from /floor/identify." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RecordRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TrainingRecord" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/training/people": { "get": { "tags": [ "training" ], "summary": "Who has been through the walkthrough, and who has not", "operationId": "people_status_training_people_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/PersonTraining" }, "type": "array", "title": "Response People Status Training People Get" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/training/people/{profile_id}/reset": { "post": { "tags": [ "training" ], "summary": "Restart somebody's training; their next visit runs the walkthrough again", "description": "The owner may restart anyone's. A manager may only when the owner has\ndelegated it to them (People page), and only for people at their outlets;\nthe service decides and refuses otherwise.", "operationId": "reset_training_people__profile_id__reset_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "profile_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Profile Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PersonTraining" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sop/runs/today": { "get": { "tags": [ "sop-runs" ], "summary": "Today's runs for an outlet", "description": "Scoped by role: staff see staff runs, shift leads see floor runs,\nmanagers see everything at the outlet. 'Today' is the business date \u2014\nat 1am this still returns the evening's checklists.", "operationId": "today_sop_runs_today_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "outlet_id", "in": "query", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Outlet Id" } }, { "name": "X-Actor-Token", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Required on shared-tablet sessions: the assertion from /floor/identify.", "title": "X-Actor-Token" }, "description": "Required on shared-tablet sessions: the assertion from /floor/identify." } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "additionalProperties": true }, "title": "Response Today Sop Runs Today Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sop/runs/materialise": { "post": { "tags": [ "sop-runs" ], "summary": "Create today's runs now", "description": "Manual trigger for the 05:00 job (which arrives in the integrity epic).\nIdempotent \u2014 re-running creates nothing twice.", "operationId": "materialise_sop_runs_materialise_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MaterialiseRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": { "type": "integer" }, "type": "object", "title": "Response Materialise Sop Runs Materialise Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/sop/runs/{run_id}": { "get": { "tags": [ "sop-runs" ], "summary": "One run with its items", "description": "Items carry the snapshot definitions they will be answered against \u2014\nthe version that was live when the run was created, not today's.", "operationId": "get_run_sop_runs__run_id__get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "run_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Run Id" } }, { "name": "X-Actor-Token", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Required on shared-tablet sessions: the assertion from /floor/identify.", "title": "X-Actor-Token" }, "description": "Required on shared-tablet sessions: the assertion from /floor/identify." } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Get Run Sop Runs Run Id Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sop/runs/{run_id}/start": { "post": { "tags": [ "sop-runs" ], "summary": "Start a run", "operationId": "start_sop_runs__run_id__start_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "run_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Run Id" } }, { "name": "X-Actor-Token", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Required on shared-tablet sessions: the assertion from /floor/identify.", "title": "X-Actor-Token" }, "description": "Required on shared-tablet sessions: the assertion from /floor/identify." } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Start Sop Runs Run Id Start Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sop/runs/{run_id}/items/{item_id}": { "patch": { "tags": [ "sop-runs" ], "summary": "Answer an item", "description": "Last write wins, and identical retries are naturally idempotent \u2014 the\noffline queue can safely replay this after a dropped response.", "operationId": "answer_sop_runs__run_id__items__item_id__patch", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "run_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Run Id" } }, { "name": "item_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Item Id" } }, { "name": "Idempotency-Key", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Idempotency-Key" } }, { "name": "X-Actor-Token", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Required on shared-tablet sessions: the assertion from /floor/identify.", "title": "X-Actor-Token" }, "description": "Required on shared-tablet sessions: the assertion from /floor/identify." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AnswerItemRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Answer Sop Runs Run Id Items Item Id Patch" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sop/runs/{run_id}/items/{item_id}/photo-url": { "post": { "tags": [ "sop-runs" ], "summary": "Get a photo upload URL", "description": "A signed grant for one exact object path, minted here so the client\nnever chooses where its bytes land.", "operationId": "photo_url_sop_runs__run_id__items__item_id__photo_url_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "run_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Run Id" } }, { "name": "item_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Item Id" } }, { "name": "X-Actor-Token", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Required on shared-tablet sessions: the assertion from /floor/identify.", "title": "X-Actor-Token" }, "description": "Required on shared-tablet sessions: the assertion from /floor/identify." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PhotoUrlRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Photo Url Sop Runs Run Id Items Item Id Photo Url Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sop/runs/{run_id}/items/{item_id}/photo-confirm": { "post": { "tags": [ "sop-runs" ], "summary": "Confirm an uploaded photo", "description": "Verifies the object exists in storage, then writes the metadata. Never\nthe other way round.\n\nHashing the photo and running the duplicate lookback happen afterwards, in\na background task recorded to job_runs. The response returns as soon as the\nmetadata is written \u2014 the tablet is standing in a kitchen.", "operationId": "photo_confirm_sop_runs__run_id__items__item_id__photo_confirm_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "run_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Run Id" } }, { "name": "item_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Item Id" } }, { "name": "X-Actor-Token", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Required on shared-tablet sessions: the assertion from /floor/identify.", "title": "X-Actor-Token" }, "description": "Required on shared-tablet sessions: the assertion from /floor/identify." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PhotoConfirmRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Photo Confirm Sop Runs Run Id Items Item Id Photo Confirm Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sop/runs/{run_id}/submit": { "post": { "tags": [ "sop-runs" ], "summary": "Submit a run", "description": "Validates completeness (422 lists the offending items), computes the\nscore, late-ness and geofence, raises an exception per critical fail, and\nlocks the run into 'submitted'. Denied geolocation is not a flag \u2014 submit\nproceeds and geo_ok stays null.", "operationId": "submit_sop_runs__run_id__submit_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "run_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Run Id" } }, { "name": "X-Actor-Token", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Required on shared-tablet sessions: the assertion from /floor/identify.", "title": "X-Actor-Token" }, "description": "Required on shared-tablet sessions: the assertion from /floor/identify." } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubmitRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Submit Sop Runs Run Id Submit Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sop/runs": { "get": { "tags": [ "sop-review" ], "summary": "Runs for review", "description": "Oldest submitted first \u2014 the queue rewards clearing the backlog, and\nbulk approve is deliberately not offered anywhere.", "operationId": "list_runs_sop_runs_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "outlet_id", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string", "format": "uuid" }, { "type": "null" } ], "title": "Outlet Id" } }, { "name": "status", "in": "query", "required": false, "schema": { "anyOf": [ { "$ref": "#/components/schemas/RunStatus" }, { "type": "null" } ], "title": "Status" } }, { "name": "from", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string", "format": "date" }, { "type": "null" } ], "title": "From" } }, { "name": "to", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string", "format": "date" }, { "type": "null" } ], "title": "To" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 200, "minimum": 1, "default": 100, "title": "Limit" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/QueueRow" }, "title": "Response List Runs Sop Runs Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sop/runs/{run_id}/detail": { "get": { "tags": [ "sop-review" ], "summary": "A run for review, with photo view URLs", "description": "Items with their snapshot definitions, integrity flags, and short-lived\nsigned photo URLs minted per request \u2014 never stored, expired in minutes.", "operationId": "run_detail_sop_runs__run_id__detail_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "run_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Run Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Run Detail Sop Runs Run Id Detail Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sop/runs/{run_id}/viewed": { "post": { "tags": [ "sop-review" ], "summary": "Record that the reviewer opened a photo", "operationId": "mark_viewed_sop_runs__run_id__viewed_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "run_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Run Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarkViewedRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": { "type": "boolean" }, "title": "Response Mark Viewed Sop Runs Run Id Viewed Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sop/runs/{run_id}/approve": { "post": { "tags": [ "sop-review" ], "summary": "Approve a run", "description": "Locks the run. Refused when the approver is the submitter \u2014 here, and\nagain by the database CHECK if this code were ever bypassed.", "operationId": "approve_run_sop_runs__run_id__approve_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "run_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Run Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Approve Run Sop Runs Run Id Approve Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sop/runs/{run_id}/reject": { "post": { "tags": [ "sop-review" ], "summary": "Reject a run back to the floor", "description": "Back to in_progress with the reason attached. Clears results on the\nnamed items only \u2014 the rest of the run stays done.", "operationId": "reject_run_sop_runs__run_id__reject_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "run_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Run Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RejectRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Reject Run Sop Runs Run Id Reject Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sop/exceptions": { "get": { "tags": [ "sop-review" ], "summary": "The exception board", "operationId": "list_exceptions_sop_exceptions_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "outlet_id", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string", "format": "uuid" }, { "type": "null" } ], "title": "Outlet Id" } }, { "name": "status", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Status" } }, { "name": "severity", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Severity" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 200, "minimum": 1, "default": 100, "title": "Limit" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ExceptionRow" }, "title": "Response List Exceptions Sop Exceptions Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sop/exceptions/{exception_id}/acknowledge": { "post": { "tags": [ "sop-review" ], "summary": "Acknowledge an exception", "operationId": "acknowledge_exception_sop_exceptions__exception_id__acknowledge_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "exception_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Exception Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": { "type": "string" }, "title": "Response Acknowledge Exception Sop Exceptions Exception Id Acknowledge Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sop/exceptions/{exception_id}/resolve": { "post": { "tags": [ "sop-review" ], "summary": "Resolve an exception", "operationId": "resolve_exception_sop_exceptions__exception_id__resolve_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "exception_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Exception Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResolveRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": { "type": "string" }, "title": "Response Resolve Exception Sop Exceptions Exception Id Resolve Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sop/exceptions/{exception_id}/waive": { "post": { "tags": [ "sop-review" ], "summary": "Waive an exception (owner / ops manager)", "description": "Waiving says \"we accept this and are not fixing it\" \u2014 a call above the\noutlet, so it needs the network roles and always a reason.", "operationId": "waive_exception_sop_exceptions__exception_id__waive_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "exception_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Exception Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WaiveRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": { "type": "string" }, "title": "Response Waive Exception Sop Exceptions Exception Id Waive Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sop/reference-photos": { "get": { "tags": [ "sop-reference-photos" ], "summary": "Reference standards for an outlet, including the ones not captured yet", "description": "Every photo-requiring item, with its standard attached if one exists.\n\nListing the gaps is the whole job. A screen that showed only what has been\ncaptured would make an outlet with two standards look finished.", "operationId": "list_reference_photos_sop_reference_photos_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "outlet_id", "in": "query", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Outlet Id" } }, { "name": "template_id", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string", "format": "uuid" }, { "type": "null" } ], "title": "Template Id" } }, { "name": "missing_only", "in": "query", "required": false, "schema": { "type": "boolean", "default": false, "title": "Missing Only" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ReferencePhoto" }, "title": "Response List Reference Photos Sop Reference Photos Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "tags": [ "sop-reference-photos" ], "summary": "Set an outlet's reference standard for an item", "description": "Confirms the object exists, retires the previous standard, and records\nthe new one. The luminance measurement runs afterwards: a standard shot in\na dark room would make every honest submission look bright by comparison,\nso the number is captured for the same reason submissions are measured.", "operationId": "set_reference_photo_sop_reference_photos_post", "security": [ { "HTTPBearer": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ConfirmReferenceRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Set Reference Photo Sop Reference Photos Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sop/reference-photos/upload-url": { "post": { "tags": [ "sop-reference-photos" ], "summary": "Get an upload URL for a reference standard", "operationId": "reference_upload_url_sop_reference_photos_upload_url_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReferenceUploadRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": { "type": "string" }, "type": "object", "title": "Response Reference Upload Url Sop Reference Photos Upload Url Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/sop/reference-photos/{reference_id}": { "delete": { "tags": [ "sop-reference-photos" ], "summary": "Retire a reference standard", "operationId": "retire_reference_photo_sop_reference_photos__reference_id__delete", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "reference_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Reference Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": { "type": "string" }, "title": "Response Retire Reference Photo Sop Reference Photos Reference Id Delete" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sop/categories": { "get": { "tags": [ "sop" ], "summary": "SOP categories", "description": "The organisation's categories plus the starter kit's (D33).", "operationId": "list_categories_sop_categories_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/CategoryOut" }, "type": "array", "title": "Response List Categories Sop Categories Get" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/sop/templates": { "get": { "tags": [ "sop" ], "summary": "Checklist templates", "operationId": "list_templates_sop_templates_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "category_id", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string", "format": "uuid" }, { "type": "null" } ], "title": "Category Id" } }, { "name": "include_inactive", "in": "query", "required": false, "schema": { "type": "boolean", "default": true, "title": "Include Inactive" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/TemplateSummary" }, "title": "Response List Templates Sop Templates Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "tags": [ "sop" ], "summary": "Create a template", "operationId": "create_template_sop_templates_post", "security": [ { "HTTPBearer": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateTemplateRequest" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TemplateDetail" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sop/templates/{template_id}": { "get": { "tags": [ "sop" ], "summary": "One template with its items", "operationId": "get_template_sop_templates__template_id__get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "template_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Template Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TemplateDetail" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "patch": { "tags": [ "sop" ], "summary": "Edit template details", "description": "Name, category, frequency, day part, active flag. None of these bumps\nthe version \u2014 only item changes are material.", "operationId": "update_template_sop_templates__template_id__patch", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "template_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Template Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateTemplateRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TemplateDetail" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sop/templates/{template_id}/duplicate": { "post": { "tags": [ "sop" ], "summary": "Duplicate a template", "description": "A fresh version-1 copy, inactive and unassigned, ready to edit.", "operationId": "duplicate_template_sop_templates__template_id__duplicate_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "template_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Template Id" } } ], "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TemplateDetail" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sop/templates/{template_id}/items": { "post": { "tags": [ "sop" ], "summary": "Add an item", "description": "Bumps the template version and snapshots every item, in one transaction.", "operationId": "add_item_sop_templates__template_id__items_post", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "template_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Template Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ItemFields" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TemplateDetail" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sop/templates/{template_id}/items/{item_id}": { "patch": { "tags": [ "sop" ], "summary": "Edit an item", "description": "Every field here is material: the edit bumps the version, and runs\nrecorded before it keep rendering the old definition.", "operationId": "update_item_sop_templates__template_id__items__item_id__patch", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "template_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Template Id" } }, { "name": "item_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Item Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateTemplateItemRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TemplateDetail" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "delete": { "tags": [ "sop" ], "summary": "Remove an item", "description": "Hard delete only if no run has ever answered against it; otherwise a\nsoft delete that keeps history renderable.", "operationId": "delete_item_sop_templates__template_id__items__item_id__delete", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "template_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Template Id" } }, { "name": "item_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Item Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TemplateDetail" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sop/templates/{template_id}/items/reorder": { "put": { "tags": [ "sop" ], "summary": "Reorder items", "description": "Takes every current item id in the new order. Partial lists are refused\nrather than silently dropping the forgotten items.", "operationId": "reorder_items_sop_templates__template_id__items_reorder_put", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "template_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Template Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReorderRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TemplateDetail" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sop/assignments": { "get": { "tags": [ "sop" ], "summary": "Template-to-outlet assignments", "operationId": "list_assignments_sop_assignments_get", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "outlet_id", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string", "format": "uuid" }, { "type": "null" } ], "title": "Outlet Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Assignment" }, "title": "Response List Assignments Sop Assignments Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "tags": [ "sop" ], "summary": "Assign a template to an outlet", "operationId": "create_assignment_sop_assignments_post", "security": [ { "HTTPBearer": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateAssignmentRequest" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Assignment" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/sop/assignments/{assignment_id}": { "patch": { "tags": [ "sop" ], "summary": "Edit an assignment", "operationId": "update_assignment_sop_assignments__assignment_id__patch", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "assignment_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Assignment Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateAssignmentRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Assignment" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "delete": { "tags": [ "sop" ], "summary": "Remove an assignment", "description": "Soft delete. Runs already materialised from it are untouched; no new\nones are created.", "operationId": "delete_assignment_sop_assignments__assignment_id__delete", "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "assignment_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Assignment Id" } } ], "responses": { "204": { "description": "Successful Response" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/floor/staff": { "get": { "tags": [ "floor" ], "summary": "Who can identify on this tablet", "description": "The PIN-pad picker: floor staff of the tablet's outlet. Only meaningful\non a device session; an individual login is already somebody.", "operationId": "list_floor_staff_floor_staff_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/FloorStaff" }, "type": "array", "title": "Response List Floor Staff Floor Staff Get" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/floor/identify": { "post": { "tags": [ "floor" ], "summary": "Enter your PIN", "description": "Turns a device session plus a correct PIN into a short-lived actor\nassertion. Five wrong attempts lock the PIN for five minutes. Every\nfailure is audited.\n\nThe assertion authorises floor actions only. It can never approve a run\nand never reaches the management shell.", "operationId": "identify_floor_identify_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/IdentifyRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/IdentifyResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } }, "security": [ { "HTTPBearer": [] } ] } }, "/healthz": { "get": { "tags": [ "meta" ], "summary": "Healthz", "description": "Liveness probe. Must never touch the database.", "operationId": "healthz_healthz_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Response Healthz Healthz Get" } } } } } } }, "/readyz": { "get": { "tags": [ "meta" ], "summary": "Readyz", "description": "Readiness probe. Unlike /healthz this does check the database, because a\nprocess that cannot reach Postgres is running but not serving.", "operationId": "readyz_readyz_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Response Readyz Readyz Get" } } } } } } } }, "components": { "schemas": { "ActivityRow": { "properties": { "at": { "type": "string", "format": "date-time", "title": "At" }, "actor_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Actor Name" }, "action": { "type": "string", "title": "Action" }, "entity_table": { "type": "string", "title": "Entity Table" }, "outlet_code": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Outlet Code" } }, "type": "object", "required": [ "at", "actor_name", "action", "entity_table", "outlet_code" ], "title": "ActivityRow" }, "AddMenuAliasRequest": { "properties": { "alias": { "type": "string", "maxLength": 120, "minLength": 1, "title": "Alias" }, "menu_item_name": { "type": "string", "maxLength": 120, "minLength": 1, "title": "Menu Item Name" } }, "additionalProperties": false, "type": "object", "required": [ "alias", "menu_item_name" ], "title": "AddMenuAliasRequest" }, "Allowance": { "properties": { "used": { "type": "integer", "title": "Used" }, "allowed": { "type": "integer", "title": "Allowed" } }, "type": "object", "required": [ "used", "allowed" ], "title": "Allowance", "description": "Used against allowed, for one kind of thing." }, "AnswerItemRequest": { "properties": { "result": { "$ref": "#/components/schemas/ItemResult" }, "value_numeric": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Value Numeric" }, "value_text": { "anyOf": [ { "type": "string", "maxLength": 500 }, { "type": "null" } ], "title": "Value Text" }, "note": { "anyOf": [ { "type": "string", "maxLength": 1000 }, { "type": "null" } ], "title": "Note" } }, "additionalProperties": false, "type": "object", "required": [ "result" ], "title": "AnswerItemRequest" }, "Assignment": { "properties": { "id": { "type": "string", "format": "uuid", "title": "Id" }, "template_id": { "type": "string", "format": "uuid", "title": "Template Id" }, "template_name": { "type": "string", "title": "Template Name" }, "outlet_id": { "type": "string", "format": "uuid", "title": "Outlet Id" }, "outlet_code": { "type": "string", "title": "Outlet Code" }, "assigned_role": { "$ref": "#/components/schemas/UserRole" }, "active_weekdays": { "items": { "type": "integer" }, "type": "array", "title": "Active Weekdays" }, "interval_days": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Interval Days" }, "due_time_local": { "type": "string", "format": "time", "title": "Due Time Local" }, "grace_minutes": { "type": "integer", "title": "Grace Minutes" }, "is_active": { "type": "boolean", "title": "Is Active" } }, "type": "object", "required": [ "id", "template_id", "template_name", "outlet_id", "outlet_code", "assigned_role", "active_weekdays", "interval_days", "due_time_local", "grace_minutes", "is_active" ], "title": "Assignment" }, "Body_upload_export_sales_uploads_post": { "properties": { "outlet_id": { "type": "string", "format": "uuid", "title": "Outlet Id" }, "file": { "type": "string", "contentMediaType": "application/octet-stream", "title": "File" } }, "type": "object", "required": [ "outlet_id", "file" ], "title": "Body_upload_export_sales_uploads_post" }, "Body_upload_sheet_inventory_counts_post": { "properties": { "outlet_id": { "type": "string", "format": "uuid", "title": "Outlet Id" }, "file": { "type": "string", "contentMediaType": "application/octet-stream", "title": "File" } }, "type": "object", "required": [ "outlet_id", "file" ], "title": "Body_upload_sheet_inventory_counts_post" }, "Category": { "properties": { "id": { "type": "string", "format": "uuid", "title": "Id" }, "key": { "type": "string", "title": "Key" }, "label": { "type": "string", "title": "Label" }, "label_bn": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Label Bn" }, "sort_order": { "type": "integer", "title": "Sort Order" } }, "type": "object", "required": [ "id", "key", "label", "label_bn", "sort_order" ], "title": "Category" }, "CategoryOut": { "properties": { "id": { "type": "string", "format": "uuid", "title": "Id" }, "key": { "type": "string", "title": "Key" }, "label": { "type": "string", "title": "Label" }, "label_bn": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Label Bn" }, "sort_order": { "type": "integer", "title": "Sort Order" }, "icon": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Icon" } }, "type": "object", "required": [ "id", "key", "label", "label_bn", "sort_order", "icon" ], "title": "CategoryOut" }, "ConfirmReferenceRequest": { "properties": { "outlet_id": { "type": "string", "format": "uuid", "title": "Outlet Id" }, "template_item_id": { "type": "string", "format": "uuid", "title": "Template Item Id" }, "path": { "type": "string", "maxLength": 500, "minLength": 1, "title": "Path" }, "caption": { "anyOf": [ { "type": "string", "maxLength": 300 }, { "type": "null" } ], "title": "Caption" }, "caption_bn": { "anyOf": [ { "type": "string", "maxLength": 300 }, { "type": "null" } ], "title": "Caption Bn" } }, "additionalProperties": false, "type": "object", "required": [ "outlet_id", "template_item_id", "path" ], "title": "ConfirmReferenceRequest" }, "CreateAssignmentRequest": { "properties": { "template_id": { "type": "string", "format": "uuid", "title": "Template Id" }, "outlet_id": { "type": "string", "format": "uuid", "title": "Outlet Id" }, "assigned_role": { "$ref": "#/components/schemas/UserRole" }, "active_weekdays": { "items": { "type": "integer" }, "type": "array", "title": "Active Weekdays", "default": [ 0, 1, 2, 3, 4, 5, 6 ] }, "interval_days": { "anyOf": [ { "type": "integer", "exclusiveMinimum": 0.0 }, { "type": "null" } ], "title": "Interval Days" }, "due_time_local": { "type": "string", "format": "time", "title": "Due Time Local" }, "grace_minutes": { "type": "integer", "maximum": 480.0, "minimum": 0.0, "title": "Grace Minutes", "default": 30 } }, "additionalProperties": false, "type": "object", "required": [ "template_id", "outlet_id", "assigned_role", "due_time_local" ], "title": "CreateAssignmentRequest" }, "CreateItemRequest": { "properties": { "name": { "type": "string", "maxLength": 120, "minLength": 1, "title": "Name" }, "name_bn": { "anyOf": [ { "type": "string", "maxLength": 120 }, { "type": "null" } ], "title": "Name Bn" }, "department_id": { "type": "string", "format": "uuid", "title": "Department Id" }, "category_id": { "anyOf": [ { "type": "string", "format": "uuid" }, { "type": "null" } ], "title": "Category Id" }, "unit": { "$ref": "#/components/schemas/InventoryUnit" }, "notes": { "anyOf": [ { "type": "string", "maxLength": 500 }, { "type": "null" } ], "title": "Notes" } }, "additionalProperties": false, "type": "object", "required": [ "name", "department_id", "unit" ], "title": "CreateItemRequest" }, "CreateOrganisationRequest": { "properties": { "name": { "type": "string", "maxLength": 120, "minLength": 1, "title": "Name" }, "slug": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,38}[a-z0-9]$", "title": "Slug" }, "owner_full_name": { "type": "string", "maxLength": 120, "minLength": 1, "title": "Owner Full Name" }, "owner_email": { "type": "string", "format": "email", "title": "Owner Email" }, "max_outlets": { "type": "integer", "maximum": 100000.0, "minimum": 1.0, "title": "Max Outlets", "default": 100000 }, "max_people": { "type": "integer", "maximum": 100000.0, "minimum": 1.0, "title": "Max People", "default": 100000 }, "max_devices": { "type": "integer", "maximum": 100000.0, "minimum": 1.0, "title": "Max Devices", "default": 10000 } }, "additionalProperties": false, "type": "object", "required": [ "name", "slug", "owner_full_name", "owner_email" ], "title": "CreateOrganisationRequest" }, "CreateOrganisationResponse": { "properties": { "organisation": { "$ref": "#/components/schemas/OrganisationDetail" }, "owner_profile_id": { "type": "string", "format": "uuid", "title": "Owner Profile Id" }, "invite_sent": { "type": "boolean", "title": "Invite Sent" }, "detail": { "type": "string", "title": "Detail" } }, "type": "object", "required": [ "organisation", "owner_profile_id", "invite_sent", "detail" ], "title": "CreateOrganisationResponse" }, "CreateOutletRequest": { "properties": { "name": { "type": "string", "maxLength": 120, "minLength": 1, "title": "Name" }, "address_line": { "anyOf": [ { "type": "string", "maxLength": 250 }, { "type": "null" } ], "title": "Address Line" }, "city": { "anyOf": [ { "type": "string", "maxLength": 80 }, { "type": "null" } ], "title": "City" }, "geo_lat": { "anyOf": [ { "type": "number", "maximum": 90.0, "minimum": -90.0 }, { "type": "null" } ], "title": "Geo Lat" }, "geo_lng": { "anyOf": [ { "type": "number", "maximum": 180.0, "minimum": -180.0 }, { "type": "null" } ], "title": "Geo Lng" }, "geofence_radius_m": { "type": "integer", "maximum": 5000.0, "exclusiveMinimum": 0.0, "title": "Geofence Radius M", "default": 150 }, "timezone": { "type": "string", "maxLength": 64, "title": "Timezone", "default": "Asia/Kolkata" }, "opened_on": { "anyOf": [ { "type": "string", "format": "date" }, { "type": "null" } ], "title": "Opened On" }, "code": { "type": "string", "maxLength": 20, "minLength": 3, "pattern": "^[A-Z0-9][A-Z0-9-]*$", "title": "Code" } }, "additionalProperties": false, "type": "object", "required": [ "name", "code" ], "title": "CreateOutletRequest" }, "CreateTabletRequest": { "properties": { "outlet_id": { "type": "string", "format": "uuid", "title": "Outlet Id" }, "label": { "type": "string", "maxLength": 120, "minLength": 1, "title": "Label" } }, "additionalProperties": false, "type": "object", "required": [ "outlet_id", "label" ], "title": "CreateTabletRequest" }, "CreateTemplateRequest": { "properties": { "name": { "type": "string", "maxLength": 160, "minLength": 1, "title": "Name" }, "name_bn": { "anyOf": [ { "type": "string", "maxLength": 160 }, { "type": "null" } ], "title": "Name Bn" }, "description": { "anyOf": [ { "type": "string", "maxLength": 1000 }, { "type": "null" } ], "title": "Description" }, "category_id": { "type": "string", "format": "uuid", "title": "Category Id" }, "frequency": { "$ref": "#/components/schemas/Frequency" }, "day_part": { "$ref": "#/components/schemas/DayPart", "default": "any" } }, "additionalProperties": false, "type": "object", "required": [ "name", "category_id", "frequency" ], "title": "CreateTemplateRequest" }, "DailyTotal": { "properties": { "business_date": { "type": "string", "format": "date", "title": "Business Date" }, "bills": { "type": "integer", "title": "Bills" }, "net_paise": { "type": "integer", "title": "Net Paise" }, "covers": { "type": "integer", "title": "Covers" } }, "type": "object", "required": [ "business_date", "bills", "net_paise", "covers" ], "title": "DailyTotal" }, "DayPart": { "type": "string", "enum": [ "opening", "mid", "closing", "any" ], "title": "DayPart" }, "Department": { "properties": { "id": { "type": "string", "format": "uuid", "title": "Id" }, "key": { "type": "string", "title": "Key" }, "label": { "type": "string", "title": "Label" }, "label_bn": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Label Bn" }, "sort_order": { "type": "integer", "title": "Sort Order" }, "item_count": { "type": "integer", "title": "Item Count", "default": 0 } }, "type": "object", "required": [ "id", "key", "label", "label_bn", "sort_order" ], "title": "Department" }, "Device": { "properties": { "id": { "type": "string", "format": "uuid", "title": "Id" }, "outlet_id": { "type": "string", "format": "uuid", "title": "Outlet Id" }, "outlet_code": { "type": "string", "title": "Outlet Code" }, "outlet_name": { "type": "string", "title": "Outlet Name" }, "label": { "type": "string", "title": "Label" }, "is_active": { "type": "boolean", "title": "Is Active" }, "last_seen_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Last Seen At" }, "created_at": { "type": "string", "format": "date-time", "title": "Created At" } }, "type": "object", "required": [ "id", "outlet_id", "outlet_code", "outlet_name", "label", "is_active", "last_seen_at", "created_at" ], "title": "Device" }, "DeviceSummary": { "properties": { "device_id": { "type": "string", "format": "uuid", "title": "Device Id" }, "outlet_id": { "type": "string", "format": "uuid", "title": "Outlet Id" }, "label": { "type": "string", "title": "Label" } }, "type": "object", "required": [ "device_id", "outlet_id", "label" ], "title": "DeviceSummary", "description": "Present only when the caller is a shared outlet tablet." }, "ExceptionRow": { "properties": { "id": { "type": "string", "format": "uuid", "title": "Id" }, "outlet_id": { "type": "string", "format": "uuid", "title": "Outlet Id" }, "outlet_code": { "type": "string", "title": "Outlet Code" }, "business_date": { "type": "string", "format": "date", "title": "Business Date" }, "severity": { "type": "string", "title": "Severity" }, "status": { "type": "string", "title": "Status" }, "title": { "type": "string", "title": "Title" }, "detail": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Detail" }, "photo_path": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Photo Path" }, "assigned_to_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Assigned To Name" }, "resolved_by_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Resolved By Name" }, "resolution_note": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Resolution Note" }, "created_at": { "type": "string", "format": "date-time", "title": "Created At" }, "age_hours": { "type": "number", "title": "Age Hours" } }, "type": "object", "required": [ "id", "outlet_id", "outlet_code", "business_date", "severity", "status", "title", "detail", "photo_path", "assigned_to_name", "resolved_by_name", "resolution_note", "created_at", "age_hours" ], "title": "ExceptionRow" }, "FinalQtyRequest": { "properties": { "item_id": { "type": "string", "format": "uuid", "title": "Item Id" }, "final_qty": { "anyOf": [ { "type": "number", "minimum": 0.0 }, { "type": "null" } ], "title": "Final Qty" } }, "additionalProperties": false, "type": "object", "required": [ "item_id" ], "title": "FinalQtyRequest" }, "FloorStaff": { "properties": { "profile_id": { "type": "string", "format": "uuid", "title": "Profile Id" }, "full_name": { "type": "string", "title": "Full Name" }, "role": { "type": "string", "title": "Role" }, "has_pin": { "type": "boolean", "title": "Has Pin" } }, "type": "object", "required": [ "profile_id", "full_name", "role", "has_pin" ], "title": "FloorStaff" }, "ForecastDay": { "properties": { "target_date": { "type": "string", "format": "date", "title": "Target Date" }, "net_paise": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Net Paise" }, "covers": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Covers" }, "reason": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Reason" }, "components": { "additionalProperties": true, "type": "object", "title": "Components" } }, "type": "object", "required": [ "target_date", "net_paise", "covers", "reason", "components" ], "title": "ForecastDay" }, "ForecastEventCreate": { "properties": { "outlet_id": { "anyOf": [ { "type": "string", "format": "uuid" }, { "type": "null" } ], "title": "Outlet Id" }, "event_date": { "type": "string", "format": "date", "title": "Event Date" }, "multiplier": { "type": "number", "maximum": 5.0, "exclusiveMinimum": 0.0, "title": "Multiplier" }, "label": { "type": "string", "maxLength": 120, "minLength": 1, "title": "Label" } }, "type": "object", "required": [ "event_date", "multiplier", "label" ], "title": "ForecastEventCreate" }, "ForecastEventRow": { "properties": { "id": { "type": "string", "format": "uuid", "title": "Id" }, "outlet_id": { "anyOf": [ { "type": "string", "format": "uuid" }, { "type": "null" } ], "title": "Outlet Id" }, "event_date": { "type": "string", "format": "date", "title": "Event Date" }, "multiplier": { "type": "number", "title": "Multiplier" }, "label": { "type": "string", "title": "Label" }, "created_by_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Created By Name" }, "created_at": { "type": "string", "format": "date-time", "title": "Created At" } }, "type": "object", "required": [ "id", "outlet_id", "event_date", "multiplier", "label", "created_at" ], "title": "ForecastEventRow" }, "Frequency": { "type": "string", "enum": [ "per_shift", "daily", "alternate_day", "weekly", "fortnightly", "monthly" ], "title": "Frequency" }, "GrantableRolesResponse": { "properties": { "grantable": { "items": { "$ref": "#/components/schemas/UserRole" }, "type": "array", "title": "Grantable" }, "all_roles": { "items": { "$ref": "#/components/schemas/UserRole" }, "type": "array", "title": "All Roles" }, "reasons": { "additionalProperties": { "type": "string" }, "type": "object", "title": "Reasons" } }, "type": "object", "required": [ "grantable", "all_roles", "reasons" ], "title": "GrantableRolesResponse", "description": "What the signed-in user may assign, so the UI can disable the rest with\nan explanation instead of hiding it." }, "HTTPValidationError": { "properties": { "detail": { "items": { "$ref": "#/components/schemas/ValidationError" }, "type": "array", "title": "Detail" } }, "type": "object", "title": "HTTPValidationError" }, "IdentifyRequest": { "properties": { "profile_id": { "type": "string", "format": "uuid", "title": "Profile Id" }, "pin": { "type": "string", "maxLength": 8, "minLength": 4, "title": "Pin" } }, "additionalProperties": false, "type": "object", "required": [ "profile_id", "pin" ], "title": "IdentifyRequest" }, "IdentifyResponse": { "properties": { "actor_token": { "type": "string", "title": "Actor Token" }, "expires_at": { "type": "integer", "title": "Expires At" }, "profile_id": { "type": "string", "format": "uuid", "title": "Profile Id" }, "full_name": { "type": "string", "title": "Full Name" }, "role": { "type": "string", "title": "Role" } }, "type": "object", "required": [ "actor_token", "expires_at", "profile_id", "full_name", "role" ], "title": "IdentifyResponse" }, "InventoryUnit": { "type": "string", "enum": [ "piece", "gram", "kilogram", "millilitre", "litre", "roll", "packet", "box", "bottle", "jug" ], "title": "InventoryUnit" }, "InviteUserRequest": { "properties": { "email": { "type": "string", "format": "email", "title": "Email" }, "full_name": { "type": "string", "maxLength": 120, "minLength": 1, "title": "Full Name" }, "global_role": { "$ref": "#/components/schemas/UserRole" }, "outlet_ids": { "items": { "type": "string", "format": "uuid" }, "type": "array", "minItems": 1, "title": "Outlet Ids" }, "employee_code": { "anyOf": [ { "type": "string", "maxLength": 30 }, { "type": "null" } ], "title": "Employee Code" }, "phone": { "anyOf": [ { "type": "string", "maxLength": 20 }, { "type": "null" } ], "title": "Phone" } }, "additionalProperties": false, "type": "object", "required": [ "email", "full_name", "global_role", "outlet_ids" ], "title": "InviteUserRequest" }, "InviteUserResponse": { "properties": { "profile_id": { "type": "string", "format": "uuid", "title": "Profile Id" }, "email": { "type": "string", "format": "email", "title": "Email" }, "invite_sent": { "type": "boolean", "title": "Invite Sent" }, "detail": { "type": "string", "title": "Detail" } }, "type": "object", "required": [ "profile_id", "email", "invite_sent", "detail" ], "title": "InviteUserResponse" }, "Item": { "properties": { "id": { "type": "string", "format": "uuid", "title": "Id" }, "name": { "type": "string", "title": "Name" }, "name_bn": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Name Bn" }, "department_id": { "type": "string", "format": "uuid", "title": "Department Id" }, "department_label": { "type": "string", "title": "Department Label" }, "category_id": { "anyOf": [ { "type": "string", "format": "uuid" }, { "type": "null" } ], "title": "Category Id" }, "category_label": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Category Label" }, "unit": { "$ref": "#/components/schemas/InventoryUnit" }, "notes": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Notes" }, "is_active": { "type": "boolean", "title": "Is Active" }, "levels": { "items": { "$ref": "#/components/schemas/OutletLevel" }, "type": "array", "title": "Levels", "default": [] } }, "type": "object", "required": [ "id", "name", "name_bn", "department_id", "department_label", "category_id", "category_label", "unit", "notes", "is_active" ], "title": "Item" }, "ItemFields": { "properties": { "title": { "type": "string", "maxLength": 250, "minLength": 1, "title": "Title" }, "title_bn": { "anyOf": [ { "type": "string", "maxLength": 250 }, { "type": "null" } ], "title": "Title Bn" }, "instruction": { "anyOf": [ { "type": "string", "maxLength": 1000 }, { "type": "null" } ], "title": "Instruction" }, "instruction_bn": { "anyOf": [ { "type": "string", "maxLength": 1000 }, { "type": "null" } ], "title": "Instruction Bn" }, "requires_photo": { "type": "boolean", "title": "Requires Photo", "default": false }, "requires_value": { "type": "boolean", "title": "Requires Value", "default": false }, "value_type": { "anyOf": [ { "$ref": "#/components/schemas/ValueType" }, { "type": "null" } ] }, "value_min": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Value Min" }, "value_max": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Value Max" }, "value_unit": { "anyOf": [ { "type": "string", "maxLength": 20 }, { "type": "null" } ], "title": "Value Unit" }, "is_critical": { "type": "boolean", "title": "Is Critical", "default": false }, "allow_na": { "type": "boolean", "title": "Allow Na", "default": false } }, "additionalProperties": false, "type": "object", "required": [ "title" ], "title": "ItemFields" }, "ItemResult": { "type": "string", "enum": [ "pass", "fail", "na", "pending" ], "title": "ItemResult" }, "ItemSummaryRow": { "properties": { "item_name": { "type": "string", "title": "Item Name" }, "bills": { "type": "integer", "title": "Bills" }, "first_date": { "type": "string", "format": "date", "title": "First Date" }, "last_date": { "type": "string", "format": "date", "title": "Last Date" } }, "type": "object", "required": [ "item_name", "bills", "first_date", "last_date" ], "title": "ItemSummaryRow" }, "JobRun": { "properties": { "id": { "type": "string", "format": "uuid", "title": "Id" }, "job_name": { "type": "string", "title": "Job Name" }, "status": { "type": "string", "title": "Status" }, "outlet_id": { "anyOf": [ { "type": "string", "format": "uuid" }, { "type": "null" } ], "title": "Outlet Id" }, "business_date": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Business Date" }, "started_at": { "type": "string", "format": "date-time", "title": "Started At" }, "finished_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Finished At" }, "duration_ms": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Duration Ms" }, "detail": { "additionalProperties": true, "type": "object", "title": "Detail" }, "error_detail": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Error Detail" }, "triggered_by_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Triggered By Name" } }, "type": "object", "required": [ "id", "job_name", "status", "outlet_id", "business_date", "started_at", "finished_at", "duration_ms", "detail", "error_detail", "triggered_by_name" ], "title": "JobRun" }, "MarkViewedRequest": { "properties": { "item_id": { "type": "string", "format": "uuid", "title": "Item Id" } }, "additionalProperties": false, "type": "object", "required": [ "item_id" ], "title": "MarkViewedRequest" }, "MaterialiseRequest": { "properties": { "business_date": { "anyOf": [ { "type": "string", "format": "date" }, { "type": "null" } ], "title": "Business Date" } }, "additionalProperties": false, "type": "object", "title": "MaterialiseRequest" }, "MeResponse": { "properties": { "profile_id": { "type": "string", "format": "uuid", "title": "Profile Id" }, "full_name": { "type": "string", "title": "Full Name" }, "email": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Email" }, "phone": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Phone" }, "employee_code": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Employee Code" }, "global_role": { "$ref": "#/components/schemas/UserRole" }, "is_active": { "type": "boolean", "title": "Is Active" }, "is_management": { "type": "boolean", "title": "Is Management" }, "is_global": { "type": "boolean", "title": "Is Global" }, "is_platform_admin": { "type": "boolean", "title": "Is Platform Admin", "default": false }, "organisation": { "anyOf": [ { "$ref": "#/components/schemas/OrganisationSummary" }, { "type": "null" } ] }, "mfa_required": { "type": "boolean", "title": "Mfa Required", "default": false }, "mfa_verified": { "type": "boolean", "title": "Mfa Verified", "default": false }, "has_pin": { "type": "boolean", "title": "Has Pin" }, "can_restart_training": { "type": "boolean", "title": "Can Restart Training" }, "outlets": { "items": { "$ref": "#/components/schemas/OutletSummary" }, "type": "array", "title": "Outlets" }, "device": { "anyOf": [ { "$ref": "#/components/schemas/DeviceSummary" }, { "type": "null" } ] } }, "type": "object", "required": [ "profile_id", "full_name", "email", "phone", "employee_code", "global_role", "is_active", "is_management", "is_global", "has_pin", "can_restart_training", "outlets" ], "title": "MeResponse" }, "MenuAlias": { "properties": { "id": { "type": "string", "format": "uuid", "title": "Id" }, "alias": { "type": "string", "title": "Alias" } }, "type": "object", "required": [ "id", "alias" ], "title": "MenuAlias" }, "MenuItemRow": { "properties": { "id": { "type": "string", "format": "uuid", "title": "Id" }, "name": { "type": "string", "title": "Name" }, "category": { "type": "string", "title": "Category" }, "petpooja_code": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Petpooja Code" }, "aliases": { "items": { "$ref": "#/components/schemas/MenuAlias" }, "type": "array", "title": "Aliases" } }, "type": "object", "required": [ "id", "name", "category", "petpooja_code", "aliases" ], "title": "MenuItemRow" }, "MenuMixCategory": { "properties": { "category": { "type": "string", "title": "Category" }, "orders": { "type": "integer", "title": "Orders" }, "share_of_bills": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Share Of Bills" }, "items": { "type": "integer", "title": "Items" }, "items_per_order": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Items Per Order" }, "net_sales_paise": { "type": "integer", "title": "Net Sales Paise" }, "avg_spend_per_bill_paise": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Avg Spend Per Bill Paise" }, "share_of_net_pct": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Share Of Net Pct" }, "is_charge": { "type": "boolean", "title": "Is Charge" } }, "type": "object", "required": [ "category", "orders", "share_of_bills", "items", "items_per_order", "net_sales_paise", "avg_spend_per_bill_paise", "share_of_net_pct", "is_charge" ], "title": "MenuMixCategory" }, "MenuMixMeasured": { "properties": { "from": { "anyOf": [ { "type": "string", "format": "date" }, { "type": "null" } ], "title": "From" }, "to": { "anyOf": [ { "type": "string", "format": "date" }, { "type": "null" } ], "title": "To" }, "bills_measured": { "type": "integer", "title": "Bills Measured" }, "categories": { "items": { "$ref": "#/components/schemas/MenuMixMeasuredCategory" }, "type": "array", "title": "Categories" }, "unmapped_item_names": { "items": { "type": "string" }, "type": "array", "title": "Unmapped Item Names" } }, "type": "object", "required": [ "bills_measured", "categories", "unmapped_item_names" ], "title": "MenuMixMeasured" }, "MenuMixMeasuredCategory": { "properties": { "category": { "type": "string", "title": "Category" }, "bills_with": { "type": "integer", "title": "Bills With" }, "share_of_bills": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Share Of Bills" } }, "type": "object", "required": [ "category", "bills_with", "share_of_bills" ], "title": "MenuMixMeasuredCategory" }, "MenuMixReported": { "properties": { "period_start": { "type": "string", "format": "date", "title": "Period Start" }, "period_end": { "type": "string", "format": "date", "title": "Period End" }, "bills_in_period": { "type": "integer", "title": "Bills In Period" }, "categories": { "items": { "$ref": "#/components/schemas/MenuMixCategory" }, "type": "array", "title": "Categories" } }, "type": "object", "required": [ "period_start", "period_end", "bills_in_period", "categories" ], "title": "MenuMixReported" }, "MenuMixResponse": { "properties": { "outlet_id": { "type": "string", "format": "uuid", "title": "Outlet Id" }, "menu_items_known": { "type": "integer", "title": "Menu Items Known" }, "reported": { "anyOf": [ { "$ref": "#/components/schemas/MenuMixReported" }, { "type": "null" } ] }, "measured": { "$ref": "#/components/schemas/MenuMixMeasured" } }, "type": "object", "required": [ "outlet_id", "menu_items_known", "reported", "measured" ], "title": "MenuMixResponse" }, "OnboardingStatus": { "properties": { "outlet_id": { "type": "string", "format": "uuid", "title": "Outlet Id" }, "steps": { "items": { "$ref": "#/components/schemas/OnboardingStep" }, "type": "array", "title": "Steps" }, "required_done": { "type": "integer", "title": "Required Done" }, "required_total": { "type": "integer", "title": "Required Total" }, "recommended_done": { "type": "integer", "title": "Recommended Done" }, "recommended_total": { "type": "integer", "title": "Recommended Total" }, "ready": { "type": "boolean", "title": "Ready" } }, "type": "object", "required": [ "outlet_id", "steps", "required_done", "required_total", "recommended_done", "recommended_total", "ready" ], "title": "OnboardingStatus" }, "OnboardingStep": { "properties": { "key": { "type": "string", "title": "Key" }, "title": { "type": "string", "title": "Title" }, "why": { "type": "string", "title": "Why" }, "how": { "type": "string", "title": "How" }, "required": { "type": "boolean", "title": "Required" }, "done": { "type": "boolean", "title": "Done" }, "count": { "type": "integer", "title": "Count" }, "href": { "type": "string", "title": "Href" } }, "type": "object", "required": [ "key", "title", "why", "how", "required", "done", "count", "href" ], "title": "OnboardingStep" }, "OrderRow": { "properties": { "id": { "type": "string", "format": "uuid", "title": "Id" }, "outlet_id": { "type": "string", "format": "uuid", "title": "Outlet Id" }, "outlet_code": { "type": "string", "title": "Outlet Code" }, "external_bill_no": { "type": "string", "title": "External Bill No" }, "business_date": { "type": "string", "format": "date", "title": "Business Date" }, "ordered_at": { "type": "string", "format": "date-time", "title": "Ordered At" }, "channel": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Channel" }, "covers": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Covers" }, "gross_paise": { "type": "integer", "title": "Gross Paise" }, "discount_paise": { "type": "integer", "title": "Discount Paise" }, "tax_paise": { "type": "integer", "title": "Tax Paise" }, "net_paise": { "type": "integer", "title": "Net Paise" }, "payment_mode": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Payment Mode" }, "table_no": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Table No" }, "has_phone": { "type": "boolean", "title": "Has Phone" }, "items": { "items": { "type": "string" }, "type": "array", "title": "Items" } }, "type": "object", "required": [ "id", "outlet_id", "outlet_code", "external_bill_no", "business_date", "ordered_at", "channel", "covers", "gross_paise", "discount_paise", "tax_paise", "net_paise", "payment_mode", "table_no", "has_phone", "items" ], "title": "OrderRow" }, "OrganisationDetail": { "properties": { "organisation_id": { "type": "string", "format": "uuid", "title": "Organisation Id" }, "slug": { "type": "string", "title": "Slug" }, "name": { "type": "string", "title": "Name" }, "is_active": { "type": "boolean", "title": "Is Active" }, "onboarded_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Onboarded At" }, "created_at": { "type": "string", "format": "date-time", "title": "Created At" }, "owners": { "type": "integer", "title": "Owners" }, "usage": { "$ref": "#/components/schemas/OrganisationUsage" }, "people_by_role": { "additionalProperties": { "type": "integer" }, "type": "object", "title": "People By Role" }, "outlets": { "items": { "$ref": "#/components/schemas/OutletUsage" }, "type": "array", "title": "Outlets" }, "owner_logins": { "items": { "$ref": "#/components/schemas/OwnerRow" }, "type": "array", "title": "Owner Logins" }, "recent_activity": { "items": { "$ref": "#/components/schemas/ActivityRow" }, "type": "array", "title": "Recent Activity" } }, "type": "object", "required": [ "organisation_id", "slug", "name", "is_active", "onboarded_at", "created_at", "owners", "usage", "people_by_role", "outlets", "owner_logins", "recent_activity" ], "title": "OrganisationDetail" }, "OrganisationRow": { "properties": { "organisation_id": { "type": "string", "format": "uuid", "title": "Organisation Id" }, "slug": { "type": "string", "title": "Slug" }, "name": { "type": "string", "title": "Name" }, "is_active": { "type": "boolean", "title": "Is Active" }, "onboarded_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Onboarded At" }, "created_at": { "type": "string", "format": "date-time", "title": "Created At" }, "owners": { "type": "integer", "title": "Owners" }, "usage": { "$ref": "#/components/schemas/OrganisationUsage" } }, "type": "object", "required": [ "organisation_id", "slug", "name", "is_active", "onboarded_at", "created_at", "owners", "usage" ], "title": "OrganisationRow" }, "OrganisationSummary": { "properties": { "organisation_id": { "type": "string", "format": "uuid", "title": "Organisation Id" }, "slug": { "type": "string", "title": "Slug" }, "name": { "type": "string", "title": "Name" }, "onboarded": { "type": "boolean", "title": "Onboarded" } }, "type": "object", "required": [ "organisation_id", "slug", "name", "onboarded" ], "title": "OrganisationSummary", "description": "The tenant the caller belongs to (D33)." }, "OrganisationUsage": { "properties": { "outlets": { "$ref": "#/components/schemas/Allowance" }, "people": { "$ref": "#/components/schemas/Allowance" }, "tablets": { "$ref": "#/components/schemas/Allowance" }, "checklist_templates": { "type": "integer", "title": "Checklist Templates" }, "active_assignments": { "type": "integer", "title": "Active Assignments" }, "runs_30d": { "type": "integer", "title": "Runs 30D" }, "runs_approved_30d": { "type": "integer", "title": "Runs Approved 30D" }, "runs_missed_30d": { "type": "integer", "title": "Runs Missed 30D" }, "uploads_30d": { "type": "integer", "title": "Uploads 30D" }, "last_upload_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Last Upload At" }, "bills_30d": { "type": "integer", "title": "Bills 30D" }, "net_sales_30d_paise": { "type": "integer", "title": "Net Sales 30D Paise" }, "last_activity_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Last Activity At" } }, "type": "object", "required": [ "outlets", "people", "tablets", "checklist_templates", "active_assignments", "runs_30d", "runs_approved_30d", "runs_missed_30d", "uploads_30d", "last_upload_at", "bills_30d", "net_sales_30d_paise", "last_activity_at" ], "title": "OrganisationUsage", "description": "What one customer has and does. The 30-day figures are by business\ndate, so a trading night that runs past midnight counts once." }, "OutletHealthRow": { "properties": { "outlet_id": { "type": "string", "format": "uuid", "title": "Outlet Id" }, "outlet_code": { "type": "string", "title": "Outlet Code" }, "outlet_name": { "type": "string", "title": "Outlet Name" }, "score": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Score" }, "band": { "type": "string", "title": "Band" }, "capped_by_critical": { "type": "boolean", "title": "Capped By Critical" }, "pillars": { "additionalProperties": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "type": "object", "title": "Pillars" }, "unmeasured": { "items": { "type": "string" }, "type": "array", "title": "Unmeasured" } }, "type": "object", "required": [ "outlet_id", "outlet_code", "outlet_name", "score", "band", "capped_by_critical", "pillars", "unmeasured" ], "title": "OutletHealthRow" }, "OutletLevel": { "properties": { "outlet_id": { "type": "string", "format": "uuid", "title": "Outlet Id" }, "outlet_code": { "type": "string", "title": "Outlet Code" }, "par_level": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Par Level" }, "reorder_qty": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Reorder Qty" }, "order_unit": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Order Unit" }, "is_stocked": { "type": "boolean", "title": "Is Stocked" } }, "type": "object", "required": [ "outlet_id", "outlet_code", "par_level", "reorder_qty", "order_unit", "is_stocked" ], "title": "OutletLevel" }, "OutletResponse": { "properties": { "name": { "type": "string", "maxLength": 120, "minLength": 1, "title": "Name" }, "address_line": { "anyOf": [ { "type": "string", "maxLength": 250 }, { "type": "null" } ], "title": "Address Line" }, "city": { "anyOf": [ { "type": "string", "maxLength": 80 }, { "type": "null" } ], "title": "City" }, "geo_lat": { "anyOf": [ { "type": "number", "maximum": 90.0, "minimum": -90.0 }, { "type": "null" } ], "title": "Geo Lat" }, "geo_lng": { "anyOf": [ { "type": "number", "maximum": 180.0, "minimum": -180.0 }, { "type": "null" } ], "title": "Geo Lng" }, "geofence_radius_m": { "type": "integer", "maximum": 5000.0, "exclusiveMinimum": 0.0, "title": "Geofence Radius M", "default": 150 }, "timezone": { "type": "string", "maxLength": 64, "title": "Timezone", "default": "Asia/Kolkata" }, "opened_on": { "anyOf": [ { "type": "string", "format": "date" }, { "type": "null" } ], "title": "Opened On" }, "id": { "type": "string", "format": "uuid", "title": "Id" }, "code": { "type": "string", "title": "Code" }, "is_active": { "type": "boolean", "title": "Is Active" }, "member_count": { "type": "integer", "title": "Member Count", "default": 0 }, "device_count": { "type": "integer", "title": "Device Count", "default": 0 } }, "type": "object", "required": [ "name", "id", "code", "is_active" ], "title": "OutletResponse" }, "OutletSummary": { "properties": { "outlet_id": { "type": "string", "format": "uuid", "title": "Outlet Id" }, "code": { "type": "string", "title": "Code" }, "name": { "type": "string", "title": "Name" }, "role_at_outlet": { "$ref": "#/components/schemas/UserRole" }, "is_primary": { "type": "boolean", "title": "Is Primary" } }, "type": "object", "required": [ "outlet_id", "code", "name", "role_at_outlet", "is_primary" ], "title": "OutletSummary" }, "OutletUsage": { "properties": { "outlet_id": { "type": "string", "format": "uuid", "title": "Outlet Id" }, "code": { "type": "string", "title": "Code" }, "name": { "type": "string", "title": "Name" }, "city": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "City" }, "is_active": { "type": "boolean", "title": "Is Active" }, "tablets": { "type": "integer", "title": "Tablets" }, "active_assignments": { "type": "integer", "title": "Active Assignments" }, "runs_30d": { "type": "integer", "title": "Runs 30D" }, "bills_30d": { "type": "integer", "title": "Bills 30D" }, "net_sales_30d_paise": { "type": "integer", "title": "Net Sales 30D Paise" }, "last_upload_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Last Upload At" }, "onboarding_done": { "type": "integer", "title": "Onboarding Done" }, "onboarding_total": { "type": "integer", "title": "Onboarding Total" } }, "type": "object", "required": [ "outlet_id", "code", "name", "city", "is_active", "tablets", "active_assignments", "runs_30d", "bills_30d", "net_sales_30d_paise", "last_upload_at", "onboarding_done", "onboarding_total" ], "title": "OutletUsage" }, "OwnerRow": { "properties": { "profile_id": { "type": "string", "format": "uuid", "title": "Profile Id" }, "full_name": { "type": "string", "title": "Full Name" }, "email": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Email" }, "is_active": { "type": "boolean", "title": "Is Active" }, "last_seen_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Last Seen At" } }, "type": "object", "required": [ "profile_id", "full_name", "email", "is_active", "last_seen_at" ], "title": "OwnerRow" }, "PersonTraining": { "properties": { "profile_id": { "type": "string", "format": "uuid", "title": "Profile Id" }, "full_name": { "type": "string", "title": "Full Name" }, "global_role": { "$ref": "#/components/schemas/UserRole" }, "is_active": { "type": "boolean", "title": "Is Active" }, "track": { "type": "string", "enum": [ "management", "floor" ], "title": "Track" }, "status": { "type": "string", "enum": [ "not_started", "in_progress", "completed", "skipped", "reset" ], "title": "Status" }, "version": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Version" }, "language": { "anyOf": [ { "type": "string", "enum": [ "en", "bn" ] }, { "type": "null" } ], "title": "Language" }, "last_step": { "type": "integer", "title": "Last Step" }, "total_steps": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Total Steps" }, "started_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Started At" }, "completed_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Completed At" }, "skipped_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Skipped At" }, "triggered_by_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Triggered By Name" }, "reset_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Reset At" }, "reset_by_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Reset By Name" }, "can_reset": { "type": "boolean", "title": "Can Reset" } }, "type": "object", "required": [ "profile_id", "full_name", "global_role", "is_active", "track", "status", "version", "language", "last_step", "total_steps", "started_at", "completed_at", "skipped_at", "triggered_by_name", "reset_at", "reset_by_name", "can_reset" ], "title": "PersonTraining", "description": "One row of the owner's 'who has been trained' view." }, "PhotoConfirmRequest": { "properties": { "path": { "type": "string", "maxLength": 500, "minLength": 1, "title": "Path" } }, "additionalProperties": false, "type": "object", "required": [ "path" ], "title": "PhotoConfirmRequest" }, "PhotoUrlRequest": { "properties": { "content_type": { "type": "string", "title": "Content Type" }, "byte_size": { "type": "integer", "exclusiveMinimum": 0.0, "title": "Byte Size" } }, "additionalProperties": false, "type": "object", "required": [ "content_type", "byte_size" ], "title": "PhotoUrlRequest" }, "PlatformOverview": { "properties": { "organisations": { "type": "integer", "title": "Organisations" }, "organisations_active": { "type": "integer", "title": "Organisations Active" }, "organisations_onboarded": { "type": "integer", "title": "Organisations Onboarded" }, "outlets": { "type": "integer", "title": "Outlets" }, "people": { "type": "integer", "title": "People" }, "tablets": { "type": "integer", "title": "Tablets" }, "runs_30d": { "type": "integer", "title": "Runs 30D" }, "runs_approved_30d": { "type": "integer", "title": "Runs Approved 30D" }, "bills_30d": { "type": "integer", "title": "Bills 30D" }, "net_sales_30d_paise": { "type": "integer", "title": "Net Sales 30D Paise" } }, "type": "object", "required": [ "organisations", "organisations_active", "organisations_onboarded", "outlets", "people", "tablets", "runs_30d", "runs_approved_30d", "bills_30d", "net_sales_30d_paise" ], "title": "PlatformOverview", "description": "Across every organisation. What the vendor looks at first." }, "QueueRow": { "properties": { "id": { "type": "string", "format": "uuid", "title": "Id" }, "outlet_id": { "type": "string", "format": "uuid", "title": "Outlet Id" }, "outlet_code": { "type": "string", "title": "Outlet Code" }, "template_name": { "type": "string", "title": "Template Name" }, "template_name_bn": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Template Name Bn" }, "business_date": { "type": "string", "format": "date", "title": "Business Date" }, "status": { "type": "string", "title": "Status" }, "submitted_by_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Submitted By Name" }, "submitted_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Submitted At" }, "score_pct": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Score Pct" }, "critical_fail_count": { "type": "integer", "title": "Critical Fail Count" }, "integrity_flag_count": { "type": "integer", "title": "Integrity Flag Count" }, "is_late": { "type": "boolean", "title": "Is Late" }, "item_count": { "type": "integer", "title": "Item Count" }, "fail_count": { "type": "integer", "title": "Fail Count" } }, "type": "object", "required": [ "id", "outlet_id", "outlet_code", "template_name", "template_name_bn", "business_date", "status", "submitted_by_name", "submitted_at", "score_pct", "critical_fail_count", "integrity_flag_count", "is_late", "item_count", "fail_count" ], "title": "QueueRow" }, "Recipe": { "properties": { "id": { "type": "string", "format": "uuid", "title": "Id" }, "menu_item_name": { "type": "string", "title": "Menu Item Name" }, "is_active": { "type": "boolean", "title": "Is Active" }, "notes": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Notes" }, "lines": { "items": { "$ref": "#/components/schemas/RecipeLineOut" }, "type": "array", "title": "Lines" } }, "type": "object", "required": [ "id", "menu_item_name", "is_active", "notes", "lines" ], "title": "Recipe" }, "RecipeLineIn": { "properties": { "item_id": { "type": "string", "format": "uuid", "title": "Item Id" }, "qty_per_unit": { "type": "number", "exclusiveMinimum": 0.0, "title": "Qty Per Unit" } }, "type": "object", "required": [ "item_id", "qty_per_unit" ], "title": "RecipeLineIn" }, "RecipeLineOut": { "properties": { "item_id": { "type": "string", "format": "uuid", "title": "Item Id" }, "item_name": { "type": "string", "title": "Item Name" }, "unit": { "type": "string", "title": "Unit" }, "qty_per_unit": { "type": "number", "title": "Qty Per Unit" } }, "type": "object", "required": [ "item_id", "item_name", "unit", "qty_per_unit" ], "title": "RecipeLineOut" }, "RecipeSave": { "properties": { "lines": { "items": { "$ref": "#/components/schemas/RecipeLineIn" }, "type": "array", "minItems": 1, "title": "Lines" }, "notes": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Notes" }, "is_active": { "type": "boolean", "title": "Is Active", "default": true } }, "type": "object", "required": [ "lines" ], "title": "RecipeSave" }, "RecordRequest": { "properties": { "record_id": { "type": "string", "format": "uuid", "title": "Record Id" } }, "additionalProperties": false, "type": "object", "required": [ "record_id" ], "title": "RecordRequest" }, "ReferencePhoto": { "properties": { "id": { "anyOf": [ { "type": "string", "format": "uuid" }, { "type": "null" } ], "title": "Id" }, "template_item_id": { "type": "string", "format": "uuid", "title": "Template Item Id" }, "title": { "type": "string", "title": "Title" }, "title_bn": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Title Bn" }, "instruction": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Instruction" }, "requires_photo": { "type": "boolean", "title": "Requires Photo" }, "is_critical": { "type": "boolean", "title": "Is Critical" }, "template_id": { "type": "string", "format": "uuid", "title": "Template Id" }, "template_name": { "type": "string", "title": "Template Name" }, "photo_path": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Photo Path" }, "photo_view_url": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Photo View Url" }, "caption": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Caption" }, "caption_bn": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Caption Bn" }, "luminance_mean": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Luminance Mean" }, "captured_by_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Captured By Name" }, "captured_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Captured At" } }, "type": "object", "required": [ "id", "template_item_id", "title", "title_bn", "instruction", "requires_photo", "is_critical", "template_id", "template_name", "photo_path", "photo_view_url", "caption", "caption_bn", "luminance_mean", "captured_by_name", "captured_at" ], "title": "ReferencePhoto" }, "ReferenceUploadRequest": { "properties": { "outlet_id": { "type": "string", "format": "uuid", "title": "Outlet Id" }, "template_item_id": { "type": "string", "format": "uuid", "title": "Template Item Id" }, "content_type": { "type": "string", "title": "Content Type" }, "byte_size": { "type": "integer", "exclusiveMinimum": 0.0, "title": "Byte Size" } }, "additionalProperties": false, "type": "object", "required": [ "outlet_id", "template_item_id", "content_type", "byte_size" ], "title": "ReferenceUploadRequest" }, "RegisterDeviceRequest": { "properties": { "outlet_id": { "type": "string", "format": "uuid", "title": "Outlet Id" }, "label": { "type": "string", "maxLength": 120, "minLength": 1, "title": "Label" }, "auth_user_id": { "type": "string", "format": "uuid", "title": "Auth User Id" } }, "additionalProperties": false, "type": "object", "required": [ "outlet_id", "label", "auth_user_id" ], "title": "RegisterDeviceRequest" }, "RejectRequest": { "properties": { "reason": { "type": "string", "maxLength": 1000, "minLength": 3, "title": "Reason" }, "item_ids": { "items": { "type": "string", "format": "uuid" }, "type": "array", "minItems": 1, "title": "Item Ids" } }, "additionalProperties": false, "type": "object", "required": [ "reason", "item_ids" ], "title": "RejectRequest" }, "ReorderRequest": { "properties": { "item_ids": { "items": { "type": "string", "format": "uuid" }, "type": "array", "minItems": 1, "title": "Item Ids" } }, "additionalProperties": false, "type": "object", "required": [ "item_ids" ], "title": "ReorderRequest" }, "ResolveRequest": { "properties": { "resolution_note": { "type": "string", "maxLength": 1000, "minLength": 3, "title": "Resolution Note" } }, "additionalProperties": false, "type": "object", "required": [ "resolution_note" ], "title": "ResolveRequest" }, "ReviewLineRequest": { "properties": { "item_id": { "anyOf": [ { "type": "string", "format": "uuid" }, { "type": "null" } ], "title": "Item Id" }, "qty": { "anyOf": [ { "type": "number", "minimum": 0.0 }, { "type": "null" } ], "title": "Qty" }, "requested_qty": { "anyOf": [ { "type": "number", "minimum": 0.0 }, { "type": "null" } ], "title": "Requested Qty" }, "remember_alias": { "type": "boolean", "title": "Remember Alias", "default": false } }, "additionalProperties": false, "type": "object", "title": "ReviewLineRequest" }, "RunJobRequest": { "properties": { "business_date": { "anyOf": [ { "type": "string", "format": "date" }, { "type": "null" } ], "title": "Business Date" } }, "additionalProperties": false, "type": "object", "title": "RunJobRequest" }, "RunStatus": { "type": "string", "enum": [ "pending", "in_progress", "submitted", "approved", "rejected", "missed" ], "title": "RunStatus" }, "ScheduleView": { "properties": { "running": { "type": "boolean", "title": "Running" }, "jobs": { "items": { "$ref": "#/components/schemas/ScheduledJob" }, "type": "array", "title": "Jobs" } }, "type": "object", "required": [ "running", "jobs" ], "title": "ScheduleView" }, "ScheduledJob": { "properties": { "id": { "type": "string", "title": "Id" }, "name": { "type": "string", "title": "Name" }, "trigger": { "type": "string", "title": "Trigger" }, "next_run_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Next Run At" } }, "type": "object", "required": [ "id", "name", "trigger", "next_run_at" ], "title": "ScheduledJob" }, "SetLevelRequest": { "properties": { "par_level": { "anyOf": [ { "type": "number", "minimum": 0.0 }, { "type": "null" } ], "title": "Par Level" }, "reorder_qty": { "anyOf": [ { "type": "number", "minimum": 0.0 }, { "type": "null" } ], "title": "Reorder Qty" }, "order_unit": { "anyOf": [ { "type": "number", "exclusiveMinimum": 0.0 }, { "type": "null" } ], "title": "Order Unit" }, "is_stocked": { "type": "boolean", "title": "Is Stocked", "default": true } }, "additionalProperties": false, "type": "object", "title": "SetLevelRequest" }, "SetOutletsRequest": { "properties": { "outlet_ids": { "items": { "type": "string", "format": "uuid" }, "type": "array", "title": "Outlet Ids" } }, "additionalProperties": false, "type": "object", "required": [ "outlet_ids" ], "title": "SetOutletsRequest", "description": "Replaces the whole membership set, rather than adding to it.\n\nA replace makes the resulting state obvious from the request. An add/remove\npair leaves the caller guessing what the person ended up with." }, "SetPinRequest": { "properties": { "pin": { "anyOf": [ { "type": "string", "maxLength": 8, "minLength": 4 }, { "type": "null" } ], "title": "Pin" } }, "additionalProperties": false, "type": "object", "title": "SetPinRequest" }, "SetRoleRequest": { "properties": { "global_role": { "$ref": "#/components/schemas/UserRole" } }, "additionalProperties": false, "type": "object", "required": [ "global_role" ], "title": "SetRoleRequest" }, "SetSettingRequest": { "properties": { "value": { "title": "Value" }, "note": { "anyOf": [ { "type": "string", "maxLength": 500 }, { "type": "null" } ], "title": "Note" }, "effective_from": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Effective From" }, "outlet_id": { "anyOf": [ { "type": "string", "format": "uuid" }, { "type": "null" } ], "title": "Outlet Id" } }, "additionalProperties": false, "type": "object", "required": [ "value" ], "title": "SetSettingRequest" }, "SetTrainingDelegateRequest": { "properties": { "enabled": { "type": "boolean", "title": "Enabled" } }, "additionalProperties": false, "type": "object", "required": [ "enabled" ], "title": "SetTrainingDelegateRequest" }, "SettingHistoryRow": { "properties": { "id": { "type": "string", "format": "uuid", "title": "Id" }, "scope": { "type": "string", "title": "Scope" }, "outlet_id": { "anyOf": [ { "type": "string", "format": "uuid" }, { "type": "null" } ], "title": "Outlet Id" }, "value": { "title": "Value" }, "effective_from": { "type": "string", "format": "date-time", "title": "Effective From" }, "note": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Note" }, "set_by_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Set By Name" }, "created_at": { "type": "string", "format": "date-time", "title": "Created At" } }, "type": "object", "required": [ "id", "scope", "outlet_id", "value", "effective_from", "note", "set_by_name", "created_at" ], "title": "SettingHistoryRow" }, "SettingView": { "properties": { "key": { "type": "string", "title": "Key" }, "group": { "type": "string", "title": "Group" }, "type": { "type": "string", "title": "Type" }, "label": { "type": "string", "title": "Label" }, "description": { "type": "string", "title": "Description" }, "outlet_overridable": { "type": "boolean", "title": "Outlet Overridable" }, "minimum": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Minimum" }, "maximum": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Maximum" }, "choices": { "items": { "type": "string" }, "type": "array", "title": "Choices" }, "default": { "title": "Default" }, "value": { "title": "Value" }, "is_set": { "type": "boolean", "title": "Is Set" } }, "type": "object", "required": [ "key", "group", "type", "label", "description", "outlet_overridable", "minimum", "maximum", "choices", "default", "value", "is_set" ], "title": "SettingView", "description": "One setting as the admin screen shows it: definition plus current value." }, "StartRequest": { "properties": { "version": { "type": "string", "maxLength": 40, "minLength": 1, "title": "Version" }, "total_steps": { "type": "integer", "maximum": 200.0, "minimum": 1.0, "title": "Total Steps" }, "language": { "type": "string", "enum": [ "en", "bn" ], "title": "Language" } }, "additionalProperties": false, "type": "object", "required": [ "version", "total_steps", "language" ], "title": "StartRequest" }, "StepRequest": { "properties": { "record_id": { "type": "string", "format": "uuid", "title": "Record Id" }, "step": { "type": "integer", "maximum": 200.0, "minimum": 1.0, "title": "Step" } }, "additionalProperties": false, "type": "object", "required": [ "record_id", "step" ], "title": "StepRequest" }, "SubmitRequest": { "properties": { "geo_lat": { "anyOf": [ { "type": "number", "maximum": 90.0, "minimum": -90.0 }, { "type": "null" } ], "title": "Geo Lat" }, "geo_lng": { "anyOf": [ { "type": "number", "maximum": 180.0, "minimum": -180.0 }, { "type": "null" } ], "title": "Geo Lng" } }, "additionalProperties": false, "type": "object", "title": "SubmitRequest" }, "TabletCredentials": { "properties": { "device": { "$ref": "#/components/schemas/Device" }, "email": { "type": "string", "title": "Email" }, "password": { "type": "string", "title": "Password" }, "detail": { "type": "string", "title": "Detail" } }, "type": "object", "required": [ "device", "email", "password", "detail" ], "title": "TabletCredentials", "description": "Shown once, at creation, and never retrievable again.\n\nA tablet cannot receive mail, so there is no reset link and no \"forgot\npassword\" to fall back on: if this is lost, the owner makes a new tablet.\nSaying so on the screen is part of the feature." }, "TemplateDetail": { "properties": { "id": { "type": "string", "format": "uuid", "title": "Id" }, "name": { "type": "string", "title": "Name" }, "name_bn": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Name Bn" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Description" }, "category_id": { "type": "string", "format": "uuid", "title": "Category Id" }, "category_key": { "type": "string", "title": "Category Key" }, "category_label": { "type": "string", "title": "Category Label" }, "frequency": { "$ref": "#/components/schemas/Frequency" }, "day_part": { "$ref": "#/components/schemas/DayPart" }, "version": { "type": "integer", "title": "Version" }, "is_active": { "type": "boolean", "title": "Is Active" }, "item_count": { "type": "integer", "title": "Item Count" }, "critical_count": { "type": "integer", "title": "Critical Count" }, "assignment_count": { "type": "integer", "title": "Assignment Count" }, "items": { "items": { "$ref": "#/components/schemas/TemplateItem" }, "type": "array", "title": "Items" }, "warnings": { "items": { "type": "string" }, "type": "array", "title": "Warnings" } }, "type": "object", "required": [ "id", "name", "name_bn", "description", "category_id", "category_key", "category_label", "frequency", "day_part", "version", "is_active", "item_count", "critical_count", "assignment_count", "items", "warnings" ], "title": "TemplateDetail" }, "TemplateItem": { "properties": { "id": { "type": "string", "format": "uuid", "title": "Id" }, "sort_order": { "type": "integer", "title": "Sort Order" }, "title": { "type": "string", "title": "Title" }, "title_bn": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Title Bn" }, "instruction": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Instruction" }, "instruction_bn": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Instruction Bn" }, "reference_photo_path": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Reference Photo Path" }, "requires_photo": { "type": "boolean", "title": "Requires Photo" }, "requires_value": { "type": "boolean", "title": "Requires Value" }, "value_type": { "anyOf": [ { "$ref": "#/components/schemas/ValueType" }, { "type": "null" } ] }, "value_min": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Value Min" }, "value_max": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Value Max" }, "value_unit": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Value Unit" }, "is_critical": { "type": "boolean", "title": "Is Critical" }, "allow_na": { "type": "boolean", "title": "Allow Na" } }, "type": "object", "required": [ "id", "sort_order", "title", "title_bn", "instruction", "instruction_bn", "reference_photo_path", "requires_photo", "requires_value", "value_type", "value_min", "value_max", "value_unit", "is_critical", "allow_na" ], "title": "TemplateItem" }, "TemplateSummary": { "properties": { "id": { "type": "string", "format": "uuid", "title": "Id" }, "name": { "type": "string", "title": "Name" }, "name_bn": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Name Bn" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Description" }, "category_id": { "type": "string", "format": "uuid", "title": "Category Id" }, "category_key": { "type": "string", "title": "Category Key" }, "category_label": { "type": "string", "title": "Category Label" }, "frequency": { "$ref": "#/components/schemas/Frequency" }, "day_part": { "$ref": "#/components/schemas/DayPart" }, "version": { "type": "integer", "title": "Version" }, "is_active": { "type": "boolean", "title": "Is Active" }, "item_count": { "type": "integer", "title": "Item Count" }, "critical_count": { "type": "integer", "title": "Critical Count" }, "assignment_count": { "type": "integer", "title": "Assignment Count" } }, "type": "object", "required": [ "id", "name", "name_bn", "description", "category_id", "category_key", "category_label", "frequency", "day_part", "version", "is_active", "item_count", "critical_count", "assignment_count" ], "title": "TemplateSummary" }, "TrainingRecord": { "properties": { "id": { "type": "string", "format": "uuid", "title": "Id" }, "profile_id": { "type": "string", "format": "uuid", "title": "Profile Id" }, "track": { "type": "string", "enum": [ "management", "floor" ], "title": "Track" }, "version": { "type": "string", "title": "Version" }, "language": { "anyOf": [ { "type": "string", "enum": [ "en", "bn" ] }, { "type": "null" } ], "title": "Language" }, "total_steps": { "type": "integer", "title": "Total Steps" }, "last_step": { "type": "integer", "title": "Last Step" }, "status": { "type": "string", "enum": [ "not_started", "in_progress", "completed", "skipped", "reset" ], "title": "Status" }, "started_at": { "type": "string", "format": "date-time", "title": "Started At" }, "updated_at": { "type": "string", "format": "date-time", "title": "Updated At" }, "completed_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Completed At" }, "skipped_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Skipped At" }, "triggered_by": { "anyOf": [ { "type": "string", "format": "uuid" }, { "type": "null" } ], "title": "Triggered By" }, "triggered_by_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Triggered By Name" } }, "type": "object", "required": [ "id", "profile_id", "track", "version", "language", "total_steps", "last_step", "status", "started_at", "updated_at", "completed_at", "skipped_at", "triggered_by", "triggered_by_name" ], "title": "TrainingRecord" }, "TrainingStatus": { "properties": { "profile_id": { "type": "string", "format": "uuid", "title": "Profile Id" }, "full_name": { "type": "string", "title": "Full Name" }, "role": { "$ref": "#/components/schemas/UserRole" }, "track": { "type": "string", "enum": [ "management", "floor" ], "title": "Track" }, "version": { "type": "string", "title": "Version" }, "required": { "type": "boolean", "title": "Required" }, "can_skip": { "type": "boolean", "title": "Can Skip" }, "record": { "anyOf": [ { "$ref": "#/components/schemas/TrainingRecord" }, { "type": "null" } ] } }, "type": "object", "required": [ "profile_id", "full_name", "role", "track", "version", "required", "can_skip", "record" ], "title": "TrainingStatus", "description": "What the client needs to decide whether to run the tour right now." }, "UnmappedName": { "properties": { "item_name": { "type": "string", "title": "Item Name" }, "units": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Units" }, "last_seen": { "title": "Last Seen" } }, "type": "object", "required": [ "item_name", "units", "last_seen" ], "title": "UnmappedName" }, "UpdateAssignmentRequest": { "properties": { "assigned_role": { "anyOf": [ { "$ref": "#/components/schemas/UserRole" }, { "type": "null" } ] }, "active_weekdays": { "anyOf": [ { "items": { "type": "integer" }, "type": "array" }, { "type": "null" } ], "title": "Active Weekdays" }, "interval_days": { "anyOf": [ { "type": "integer", "exclusiveMinimum": 0.0 }, { "type": "null" } ], "title": "Interval Days" }, "due_time_local": { "anyOf": [ { "type": "string", "format": "time" }, { "type": "null" } ], "title": "Due Time Local" }, "grace_minutes": { "anyOf": [ { "type": "integer", "maximum": 480.0, "minimum": 0.0 }, { "type": "null" } ], "title": "Grace Minutes" }, "is_active": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Is Active" } }, "additionalProperties": false, "type": "object", "title": "UpdateAssignmentRequest" }, "UpdateDeviceRequest": { "properties": { "label": { "anyOf": [ { "type": "string", "maxLength": 120, "minLength": 1 }, { "type": "null" } ], "title": "Label" }, "is_active": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Is Active" } }, "additionalProperties": false, "type": "object", "title": "UpdateDeviceRequest" }, "UpdateItemRequest": { "properties": { "name": { "anyOf": [ { "type": "string", "maxLength": 120, "minLength": 1 }, { "type": "null" } ], "title": "Name" }, "name_bn": { "anyOf": [ { "type": "string", "maxLength": 120 }, { "type": "null" } ], "title": "Name Bn" }, "category_id": { "anyOf": [ { "type": "string", "format": "uuid" }, { "type": "null" } ], "title": "Category Id" }, "unit": { "anyOf": [ { "$ref": "#/components/schemas/InventoryUnit" }, { "type": "null" } ] }, "notes": { "anyOf": [ { "type": "string", "maxLength": 500 }, { "type": "null" } ], "title": "Notes" }, "is_active": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Is Active" } }, "additionalProperties": false, "type": "object", "title": "UpdateItemRequest" }, "UpdateMeRequest": { "properties": { "full_name": { "anyOf": [ { "type": "string", "maxLength": 120, "minLength": 1 }, { "type": "null" } ], "title": "Full Name" }, "phone": { "anyOf": [ { "type": "string", "maxLength": 20 }, { "type": "null" } ], "title": "Phone" } }, "additionalProperties": false, "type": "object", "title": "UpdateMeRequest", "description": "Only what a person may change about themselves.\n\nRole, outlets and activation are deliberately absent: allowing them here\nwould let anyone promote themselves through their own profile." }, "UpdateOrganisationRequest": { "properties": { "name": { "anyOf": [ { "type": "string", "maxLength": 120, "minLength": 1 }, { "type": "null" } ], "title": "Name" }, "is_active": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Is Active" }, "onboarded": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Onboarded" }, "max_outlets": { "anyOf": [ { "type": "integer", "maximum": 100000.0, "minimum": 1.0 }, { "type": "null" } ], "title": "Max Outlets" }, "max_people": { "anyOf": [ { "type": "integer", "maximum": 100000.0, "minimum": 1.0 }, { "type": "null" } ], "title": "Max People" }, "max_devices": { "anyOf": [ { "type": "integer", "maximum": 100000.0, "minimum": 1.0 }, { "type": "null" } ], "title": "Max Devices" } }, "additionalProperties": false, "type": "object", "title": "UpdateOrganisationRequest", "description": "Everything the vendor controls about a customer. Each field is optional\nso the screen can save one section without resending the rest." }, "UpdateOutletRequest": { "properties": { "name": { "anyOf": [ { "type": "string", "maxLength": 120, "minLength": 1 }, { "type": "null" } ], "title": "Name" }, "address_line": { "anyOf": [ { "type": "string", "maxLength": 250 }, { "type": "null" } ], "title": "Address Line" }, "city": { "anyOf": [ { "type": "string", "maxLength": 80 }, { "type": "null" } ], "title": "City" }, "geo_lat": { "anyOf": [ { "type": "number", "maximum": 90.0, "minimum": -90.0 }, { "type": "null" } ], "title": "Geo Lat" }, "geo_lng": { "anyOf": [ { "type": "number", "maximum": 180.0, "minimum": -180.0 }, { "type": "null" } ], "title": "Geo Lng" }, "geofence_radius_m": { "anyOf": [ { "type": "integer", "maximum": 5000.0, "exclusiveMinimum": 0.0 }, { "type": "null" } ], "title": "Geofence Radius M" }, "timezone": { "anyOf": [ { "type": "string", "maxLength": 64 }, { "type": "null" } ], "title": "Timezone" }, "opened_on": { "anyOf": [ { "type": "string", "format": "date" }, { "type": "null" } ], "title": "Opened On" }, "is_active": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Is Active" } }, "additionalProperties": false, "type": "object", "title": "UpdateOutletRequest", "description": "Every field optional: a PATCH changes only what it names.\n\n`code` is absent on purpose. It appears in exports, conversation and\nprinted sheets, so renaming it silently would break references nobody is\ntracking." }, "UpdateTemplateItemRequest": { "properties": { "title": { "anyOf": [ { "type": "string", "maxLength": 250, "minLength": 1 }, { "type": "null" } ], "title": "Title" }, "title_bn": { "anyOf": [ { "type": "string", "maxLength": 250 }, { "type": "null" } ], "title": "Title Bn" }, "instruction": { "anyOf": [ { "type": "string", "maxLength": 1000 }, { "type": "null" } ], "title": "Instruction" }, "instruction_bn": { "anyOf": [ { "type": "string", "maxLength": 1000 }, { "type": "null" } ], "title": "Instruction Bn" }, "requires_photo": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Requires Photo" }, "requires_value": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Requires Value" }, "value_type": { "anyOf": [ { "$ref": "#/components/schemas/ValueType" }, { "type": "null" } ] }, "value_min": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Value Min" }, "value_max": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "title": "Value Max" }, "value_unit": { "anyOf": [ { "type": "string", "maxLength": 20 }, { "type": "null" } ], "title": "Value Unit" }, "is_critical": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Is Critical" }, "allow_na": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Allow Na" } }, "additionalProperties": false, "type": "object", "title": "UpdateTemplateItemRequest", "description": "Partial edit. Every field here is material (D11): changing any of them\nbumps the template version so history keeps rendering what was true." }, "UpdateTemplateRequest": { "properties": { "name": { "anyOf": [ { "type": "string", "maxLength": 160, "minLength": 1 }, { "type": "null" } ], "title": "Name" }, "name_bn": { "anyOf": [ { "type": "string", "maxLength": 160 }, { "type": "null" } ], "title": "Name Bn" }, "description": { "anyOf": [ { "type": "string", "maxLength": 1000 }, { "type": "null" } ], "title": "Description" }, "category_id": { "anyOf": [ { "type": "string", "format": "uuid" }, { "type": "null" } ], "title": "Category Id" }, "frequency": { "anyOf": [ { "$ref": "#/components/schemas/Frequency" }, { "type": "null" } ] }, "day_part": { "anyOf": [ { "$ref": "#/components/schemas/DayPart" }, { "type": "null" } ] }, "is_active": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Is Active" } }, "additionalProperties": false, "type": "object", "title": "UpdateTemplateRequest", "description": "Template-level fields only. None of these is a material change, so none\nbumps the version \u2014 the items are the contract with history, not the\nlabel on the folder." }, "UpdateUserRequest": { "properties": { "full_name": { "anyOf": [ { "type": "string", "maxLength": 120, "minLength": 1 }, { "type": "null" } ], "title": "Full Name" }, "phone": { "anyOf": [ { "type": "string", "maxLength": 20 }, { "type": "null" } ], "title": "Phone" }, "employee_code": { "anyOf": [ { "type": "string", "maxLength": 30 }, { "type": "null" } ], "title": "Employee Code" }, "is_active": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Is Active" } }, "additionalProperties": false, "type": "object", "title": "UpdateUserRequest" }, "UploadRow": { "properties": { "id": { "type": "string", "format": "uuid", "title": "Id" }, "outlet_id": { "type": "string", "format": "uuid", "title": "Outlet Id" }, "outlet_code": { "type": "string", "title": "Outlet Code" }, "source": { "type": "string", "title": "Source" }, "original_filename": { "type": "string", "title": "Original Filename" }, "file_sha256": { "type": "string", "title": "File Sha256" }, "status": { "type": "string", "title": "Status" }, "row_count": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Row Count" }, "period_start": { "anyOf": [ { "type": "string", "format": "date" }, { "type": "null" } ], "title": "Period Start" }, "period_end": { "anyOf": [ { "type": "string", "format": "date" }, { "type": "null" } ], "title": "Period End" }, "warnings": { "items": { "additionalProperties": true, "type": "object" }, "type": "array", "title": "Warnings" }, "error_detail": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Error Detail" }, "adapter_version": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Adapter Version" }, "parsed_net_paise": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Parsed Net Paise" }, "restaurant_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Restaurant Name" }, "uploaded_by_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Uploaded By Name" }, "created_at": { "type": "string", "format": "date-time", "title": "Created At" }, "parsed_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Parsed At" } }, "type": "object", "required": [ "id", "outlet_id", "outlet_code", "source", "original_filename", "file_sha256", "status", "row_count", "period_start", "period_end", "warnings", "error_detail", "adapter_version", "parsed_net_paise", "uploaded_by_name", "created_at", "parsed_at" ], "title": "UploadRow" }, "UserListItem": { "properties": { "profile_id": { "type": "string", "format": "uuid", "title": "Profile Id" }, "full_name": { "type": "string", "title": "Full Name" }, "email": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Email" }, "phone": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Phone" }, "employee_code": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Employee Code" }, "global_role": { "$ref": "#/components/schemas/UserRole" }, "is_active": { "type": "boolean", "title": "Is Active" }, "has_pin": { "type": "boolean", "title": "Has Pin" }, "can_restart_training": { "type": "boolean", "title": "Can Restart Training" }, "last_seen_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Last Seen At" }, "outlets": { "items": { "$ref": "#/components/schemas/OutletSummary" }, "type": "array", "title": "Outlets" } }, "type": "object", "required": [ "profile_id", "full_name", "email", "phone", "employee_code", "global_role", "is_active", "has_pin", "can_restart_training", "last_seen_at", "outlets" ], "title": "UserListItem", "description": "A person as they appear in the admin table." }, "UserRole": { "type": "string", "enum": [ "owner", "ops_manager", "outlet_manager", "shift_lead", "staff", "platform_admin" ], "title": "UserRole" }, "ValidationError": { "properties": { "loc": { "items": { "anyOf": [ { "type": "string" }, { "type": "integer" } ] }, "type": "array", "title": "Location" }, "msg": { "type": "string", "title": "Message" }, "type": { "type": "string", "title": "Error Type" }, "input": { "title": "Input" }, "ctx": { "type": "object", "title": "Context" } }, "type": "object", "required": [ "loc", "msg", "type" ], "title": "ValidationError" }, "ValueType": { "type": "string", "enum": [ "number", "text", "temperature_c", "time" ], "title": "ValueType" }, "WaiveRequest": { "properties": { "reason": { "type": "string", "maxLength": 1000, "minLength": 3, "title": "Reason" } }, "additionalProperties": false, "type": "object", "required": [ "reason" ], "title": "WaiveRequest" } }, "securitySchemes": { "HTTPBearer": { "type": "http", "scheme": "bearer" } } } }