{
  "components": {
    "schemas": {
      "AddEmailStartRequest": {
        "description": "Symmetric to AddPhoneStartRequest, for verifying/replacing the\nemail on an already-authenticated account \u2014 see\napp.api.v1.endpoints.auth's /auth/email/* endpoints.",
        "properties": {
          "email": {
            "format": "email",
            "title": "Email",
            "type": "string"
          }
        },
        "required": [
          "email"
        ],
        "title": "AddEmailStartRequest",
        "type": "object"
      },
      "AddPhoneStartRequest": {
        "description": "First step of adding/replacing a verified phone number on an\nalready-authenticated account \u2014 see app.api.v1.endpoints.auth's\n/auth/phone/* endpoints. Distinct from CustomerSignupRequest's\nphone step: this one requires an existing session, not a fresh\naccount.",
        "properties": {
          "phone": {
            "title": "Phone",
            "type": "string"
          }
        },
        "required": [
          "phone"
        ],
        "title": "AddPhoneStartRequest",
        "type": "object"
      },
      "AdminAnalyticsOut": {
        "description": "System-performance snapshot for the admin console. period_days\nwindows order_volume/order_status_breakdown/cancellation_rate/\ntop_merchants; active_couriers/active_branches are a live\nright-now count, not windowed by period_days.\n\nrevenue is Yeneb's own cut (service_fee on paid orders \u2014 couriers\nkeep 100% of delivery_fee, see app.models.delivery.CourierEarning),\nnot gross order value, and is superadmin-only: null for a regular\nadmin.",
        "properties": {
          "active_branches": {
            "title": "Active Branches",
            "type": "integer"
          },
          "active_couriers": {
            "title": "Active Couriers",
            "type": "integer"
          },
          "cancellation_rate": {
            "title": "Cancellation Rate",
            "type": "number"
          },
          "order_status_breakdown": {
            "items": {
              "$ref": "#/components/schemas/OrderStatusBreakdownOut"
            },
            "title": "Order Status Breakdown",
            "type": "array"
          },
          "order_volume": {
            "title": "Order Volume",
            "type": "integer"
          },
          "period_days": {
            "title": "Period Days",
            "type": "integer"
          },
          "revenue": {
            "anyOf": [
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revenue"
          },
          "top_branches": {
            "items": {
              "$ref": "#/components/schemas/TopBranchOut"
            },
            "title": "Top Branches",
            "type": "array"
          },
          "top_merchants": {
            "items": {
              "$ref": "#/components/schemas/TopMerchantOut"
            },
            "title": "Top Merchants",
            "type": "array"
          }
        },
        "required": [
          "period_days",
          "order_volume",
          "order_status_breakdown",
          "cancellation_rate",
          "active_couriers",
          "active_branches",
          "top_merchants",
          "top_branches"
        ],
        "title": "AdminAnalyticsOut",
        "type": "object"
      },
      "Body_upload_image_endpoint_api_v1_uploads_image_post": {
        "properties": {
          "file": {
            "contentMediaType": "application/octet-stream",
            "title": "File",
            "type": "string"
          }
        },
        "required": [
          "file"
        ],
        "title": "Body_upload_image_endpoint_api_v1_uploads_image_post",
        "type": "object"
      },
      "BranchApproveRequest": {
        "properties": {
          "approval_status": {
            "enum": [
              "approved",
              "rejected"
            ],
            "title": "Approval Status",
            "type": "string"
          }
        },
        "required": [
          "approval_status"
        ],
        "title": "BranchApproveRequest",
        "type": "object"
      },
      "BranchCreateRequest": {
        "properties": {
          "address": {
            "title": "Address",
            "type": "string"
          },
          "cover_image_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cover Image Url"
          },
          "latitude": {
            "title": "Latitude",
            "type": "number"
          },
          "longitude": {
            "title": "Longitude",
            "type": "number"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "phone": {
            "title": "Phone",
            "type": "string"
          }
        },
        "required": [
          "name",
          "address",
          "latitude",
          "longitude",
          "phone"
        ],
        "title": "BranchCreateRequest",
        "type": "object"
      },
      "BranchHoursUpdateRequest": {
        "description": "Set by the branch's own owner/manager (not an admin-only\nschedule like a courier's shift) \u2014 see the Branch model docstring\non opens_at/closes_at/working_days. All fields optional so a\ncaller can narrow working_days without resending hours, or vice\nversa. Pass opens_at/closes_at as null to clear them back to\n\"no hour restriction\".",
        "properties": {
          "closes_at": {
            "anyOf": [
              {
                "format": "time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Closes At"
          },
          "opens_at": {
            "anyOf": [
              {
                "format": "time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Opens At"
          },
          "working_days": {
            "anyOf": [
              {
                "items": {
                  "type": "integer"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Working Days"
          }
        },
        "title": "BranchHoursUpdateRequest",
        "type": "object"
      },
      "BranchMinimumOrderUpdateRequest": {
        "description": "Set by the branch's own owner/manager, same as hours \u2014 see the\nBranch model docstring on minimum_order_amount. Pass null to clear\nit back to \"no minimum\".",
        "properties": {
          "minimum_order_amount": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Minimum Order Amount"
          }
        },
        "title": "BranchMinimumOrderUpdateRequest",
        "type": "object"
      },
      "BranchOut": {
        "properties": {
          "address": {
            "title": "Address",
            "type": "string"
          },
          "approval_status": {
            "title": "Approval Status",
            "type": "string"
          },
          "average_rating": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Average Rating"
          },
          "closes_at": {
            "anyOf": [
              {
                "format": "time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Closes At"
          },
          "cover_image_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cover Image Url"
          },
          "distance_meters": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Distance Meters"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "is_favorited": {
            "default": false,
            "title": "Is Favorited",
            "type": "boolean"
          },
          "is_open_now": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Open Now"
          },
          "latitude": {
            "title": "Latitude",
            "type": "number"
          },
          "longitude": {
            "title": "Longitude",
            "type": "number"
          },
          "merchant_id": {
            "format": "uuid",
            "title": "Merchant Id",
            "type": "string"
          },
          "minimum_order_amount": {
            "anyOf": [
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Minimum Order Amount"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "opens_at": {
            "anyOf": [
              {
                "format": "time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Opens At"
          },
          "phone": {
            "title": "Phone",
            "type": "string"
          },
          "review_count": {
            "default": 0,
            "title": "Review Count",
            "type": "integer"
          },
          "working_days": {
            "items": {
              "type": "integer"
            },
            "title": "Working Days",
            "type": "array"
          }
        },
        "required": [
          "id",
          "merchant_id",
          "name",
          "address",
          "latitude",
          "longitude",
          "phone",
          "cover_image_url",
          "approval_status",
          "is_active",
          "opens_at",
          "closes_at",
          "working_days",
          "minimum_order_amount"
        ],
        "title": "BranchOut",
        "type": "object"
      },
      "BranchUpdateRequest": {
        "description": "Partial \u2014 only fields actually sent are changed. Doesn't cover\napproval_status (admin-only, see BranchApproveRequest), opens_at/\ncloses_at/working_days (automatic/scheduled, see\nBranchHoursUpdateRequest), or minimum_order_amount (see\nBranchMinimumOrderUpdateRequest) \u2014 each already has its own\ndedicated endpoint. is_active is the manual day-to-day open/closed\nswitch (see the Branch model docstring) \u2014 distinct from the\nscheduled hours, which is_branch_open also factors in.",
        "properties": {
          "address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Address"
          },
          "cover_image_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cover Image Url"
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active"
          },
          "latitude": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latitude"
          },
          "longitude": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Longitude"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          }
        },
        "title": "BranchUpdateRequest",
        "type": "object"
      },
      "BranchWithMenuOut": {
        "properties": {
          "address": {
            "title": "Address",
            "type": "string"
          },
          "approval_status": {
            "title": "Approval Status",
            "type": "string"
          },
          "average_rating": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Average Rating"
          },
          "categories": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/MenuCategoryWithItemsOut"
            },
            "title": "Categories",
            "type": "array"
          },
          "closes_at": {
            "anyOf": [
              {
                "format": "time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Closes At"
          },
          "cover_image_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cover Image Url"
          },
          "distance_meters": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Distance Meters"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "is_favorited": {
            "default": false,
            "title": "Is Favorited",
            "type": "boolean"
          },
          "is_open_now": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Open Now"
          },
          "latitude": {
            "title": "Latitude",
            "type": "number"
          },
          "longitude": {
            "title": "Longitude",
            "type": "number"
          },
          "merchant_id": {
            "format": "uuid",
            "title": "Merchant Id",
            "type": "string"
          },
          "minimum_order_amount": {
            "anyOf": [
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Minimum Order Amount"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "opens_at": {
            "anyOf": [
              {
                "format": "time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Opens At"
          },
          "phone": {
            "title": "Phone",
            "type": "string"
          },
          "review_count": {
            "default": 0,
            "title": "Review Count",
            "type": "integer"
          },
          "working_days": {
            "items": {
              "type": "integer"
            },
            "title": "Working Days",
            "type": "array"
          }
        },
        "required": [
          "id",
          "merchant_id",
          "name",
          "address",
          "latitude",
          "longitude",
          "phone",
          "cover_image_url",
          "approval_status",
          "is_active",
          "opens_at",
          "closes_at",
          "working_days",
          "minimum_order_amount"
        ],
        "title": "BranchWithMenuOut",
        "type": "object"
      },
      "CartItemAddRequest": {
        "properties": {
          "menu_item_id": {
            "format": "uuid",
            "title": "Menu Item Id",
            "type": "string"
          },
          "option_ids": {
            "default": [],
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "title": "Option Ids",
            "type": "array"
          },
          "quantity": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              }
            ],
            "default": "1",
            "title": "Quantity"
          },
          "special_instructions": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Special Instructions"
          }
        },
        "required": [
          "menu_item_id"
        ],
        "title": "CartItemAddRequest",
        "type": "object"
      },
      "CartItemOptionOut": {
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "menu_item_option_id": {
            "format": "uuid",
            "title": "Menu Item Option Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "price_delta": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Price Delta",
            "type": "string"
          }
        },
        "required": [
          "id",
          "menu_item_option_id",
          "name",
          "price_delta"
        ],
        "title": "CartItemOptionOut",
        "type": "object"
      },
      "CartItemOut": {
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "is_available": {
            "title": "Is Available",
            "type": "boolean"
          },
          "line_total": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Line Total",
            "type": "string"
          },
          "menu_item_id": {
            "format": "uuid",
            "title": "Menu Item Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "options": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/CartItemOptionOut"
            },
            "title": "Options",
            "type": "array"
          },
          "quantity": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Quantity",
            "type": "string"
          },
          "special_instructions": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Special Instructions"
          },
          "unit_of_measure": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit Of Measure"
          },
          "unit_price": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Unit Price",
            "type": "string"
          }
        },
        "required": [
          "id",
          "menu_item_id",
          "name",
          "unit_price",
          "quantity",
          "line_total",
          "is_available"
        ],
        "title": "CartItemOut",
        "type": "object"
      },
      "CartItemUpdateRequest": {
        "description": "Quantity only \u2014 changing options/instructions means removing\nthe item and adding it again with the new selection, same as most\ndelivery apps' own UX for editing a customized item.",
        "properties": {
          "quantity": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              }
            ],
            "title": "Quantity"
          }
        },
        "required": [
          "quantity"
        ],
        "title": "CartItemUpdateRequest",
        "type": "object"
      },
      "CartOut": {
        "properties": {
          "branch_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Branch Id"
          },
          "id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "items": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/CartItemOut"
            },
            "title": "Items",
            "type": "array"
          },
          "subtotal": {
            "default": "0.00",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Subtotal",
            "type": "string"
          }
        },
        "title": "CartOut",
        "type": "object"
      },
      "ChangePinRequest": {
        "description": "Changes the PIN on the currently logged-in account \u2014 requires\nthe current PIN as proof this sensitive action is really the\naccount holder, same reasoning as GoogleConnectRequest above.",
        "properties": {
          "current_pin": {
            "title": "Current Pin",
            "type": "string"
          },
          "new_pin": {
            "title": "New Pin",
            "type": "string"
          }
        },
        "required": [
          "current_pin",
          "new_pin"
        ],
        "title": "ChangePinRequest",
        "type": "object"
      },
      "CheckoutRequest": {
        "examples": [
          {
            "delivery_address": "Bole, Addis Ababa",
            "delivery_latitude": 9.01,
            "delivery_longitude": 38.768,
            "delivery_mode": "delivery",
            "payment_method": "cash"
          },
          {
            "delivery_address": "Kazanchis, Addis Ababa",
            "delivery_latitude": 9.02,
            "delivery_longitude": 38.76,
            "delivery_mode": "delivery",
            "payment_method": "chapa",
            "recipient_name": "Marta",
            "recipient_phone": "0911223344"
          }
        ],
        "properties": {
          "delivery_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Address"
          },
          "delivery_latitude": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Latitude"
          },
          "delivery_longitude": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Longitude"
          },
          "delivery_mode": {
            "enum": [
              "takeaway",
              "delivery"
            ],
            "title": "Delivery Mode",
            "type": "string"
          },
          "payment_method": {
            "default": "chapa",
            "enum": [
              "chapa",
              "cash"
            ],
            "title": "Payment Method",
            "type": "string"
          },
          "promo_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Promo Code"
          },
          "recipient_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recipient Name"
          },
          "recipient_phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recipient Phone"
          }
        },
        "required": [
          "delivery_mode"
        ],
        "title": "CheckoutRequest",
        "type": "object"
      },
      "CourierEarningOut": {
        "properties": {
          "amount": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Amount",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "order_id": {
            "format": "uuid",
            "title": "Order Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "order_id",
          "amount",
          "created_at"
        ],
        "title": "CourierEarningOut",
        "type": "object"
      },
      "CourierEarningsSummaryOut": {
        "properties": {
          "delivery_count": {
            "title": "Delivery Count",
            "type": "integer"
          },
          "total_earnings": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Total Earnings",
            "type": "string"
          }
        },
        "required": [
          "total_earnings",
          "delivery_count"
        ],
        "title": "CourierEarningsSummaryOut",
        "type": "object"
      },
      "CourierProfileOut": {
        "properties": {
          "is_online": {
            "title": "Is Online",
            "type": "boolean"
          },
          "shift_end": {
            "anyOf": [
              {
                "format": "time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Shift End"
          },
          "shift_start": {
            "anyOf": [
              {
                "format": "time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Shift Start"
          },
          "user_id": {
            "format": "uuid",
            "title": "User Id",
            "type": "string"
          },
          "working_days": {
            "items": {
              "type": "integer"
            },
            "title": "Working Days",
            "type": "array"
          }
        },
        "required": [
          "user_id",
          "is_online",
          "shift_start",
          "shift_end",
          "working_days"
        ],
        "title": "CourierProfileOut",
        "type": "object"
      },
      "CourierProfileUpdateRequest": {
        "description": "Admin-only \u2014 couriers are full-time staff, not gig workers who\nset their own schedule, so shift hours, the online/offline switch,\nand which days they work are all set by an admin (see\napp.api.v1.endpoints.admin.update_courier_profile). All fields\noptional so an admin can flip just is_online without having to\nre-send shift hours or working days, or vice versa.",
        "properties": {
          "is_online": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Online"
          },
          "shift_end": {
            "anyOf": [
              {
                "format": "time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Shift End"
          },
          "shift_start": {
            "anyOf": [
              {
                "format": "time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Shift Start"
          },
          "working_days": {
            "anyOf": [
              {
                "items": {
                  "type": "integer"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Working Days"
          }
        },
        "title": "CourierProfileUpdateRequest",
        "type": "object"
      },
      "CustomerProfileOut": {
        "properties": {
          "address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Address"
          },
          "date_of_birth": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date Of Birth"
          },
          "default_delivery_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Delivery Address"
          },
          "default_delivery_latitude": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Delivery Latitude"
          },
          "default_delivery_longitude": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Delivery Longitude"
          },
          "default_language": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Language"
          },
          "gender": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gender"
          },
          "nationality": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Nationality"
          },
          "user_id": {
            "format": "uuid",
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "user_id",
          "gender",
          "nationality",
          "date_of_birth",
          "default_language",
          "address",
          "default_delivery_address",
          "default_delivery_latitude",
          "default_delivery_longitude"
        ],
        "title": "CustomerProfileOut",
        "type": "object"
      },
      "CustomerProfileUpdateRequest": {
        "description": "All fields optional and independently settable \u2014 profile\ncompletion is entirely skippable (see\napp.api.v1.endpoints.customer), so a client can send just the one\nfield a customer actually filled in on a given screen without\nhaving to resend the rest.",
        "properties": {
          "address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Address"
          },
          "date_of_birth": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date Of Birth"
          },
          "default_delivery_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Delivery Address"
          },
          "default_delivery_latitude": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Delivery Latitude"
          },
          "default_delivery_longitude": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Delivery Longitude"
          },
          "default_language": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Language"
          },
          "gender": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gender"
          },
          "nationality": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Nationality"
          }
        },
        "title": "CustomerProfileUpdateRequest",
        "type": "object"
      },
      "CustomerSignupRequest": {
        "description": "Customer self-signup \u2014 single-identifier-first: exactly one of\nphone or email, never both. Whichever one is given gets a single\nOTP code and becomes the account's one verified identifier; the\nother stays unset and can be added later, skippably, via\n/auth/phone/* or /auth/email/*. Invited accounts\n(courier/supplier/admin) are unaffected \u2014 still always phone+email\nvia PhoneAndNameRequest, see app.api.v1.endpoints.admin.",
        "examples": [
          {
            "name": "Abebe Kebede",
            "phone": "0912345678"
          }
        ],
        "properties": {
          "email": {
            "anyOf": [
              {
                "format": "email",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          }
        },
        "required": [
          "name"
        ],
        "title": "CustomerSignupRequest",
        "type": "object"
      },
      "DeliveryAssignmentOut": {
        "properties": {
          "courier_id": {
            "format": "uuid",
            "title": "Courier Id",
            "type": "string"
          },
          "delivered_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivered At"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "offered_at": {
            "format": "date-time",
            "title": "Offered At",
            "type": "string"
          },
          "order_id": {
            "format": "uuid",
            "title": "Order Id",
            "type": "string"
          },
          "picked_up_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Picked Up At"
          },
          "responded_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Responded At"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "order_id",
          "courier_id",
          "status",
          "offered_at",
          "responded_at",
          "picked_up_at",
          "delivered_at"
        ],
        "title": "DeliveryAssignmentOut",
        "type": "object"
      },
      "DeliveryHistoryOut": {
        "description": "A courier's own past (and current) delivery assignments,\nregardless of outcome \u2014 offered-then-rejected, accepted-then-\ncancelled, or fully delivered \u2014 see\napp.api.v1.endpoints.courier.list_deliveries. Distinct from\nCourierEarningOut below, which only ever covers completed,\npaid-out deliveries.",
        "properties": {
          "branch_name": {
            "title": "Branch Name",
            "type": "string"
          },
          "courier_id": {
            "format": "uuid",
            "title": "Courier Id",
            "type": "string"
          },
          "delivered_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivered At"
          },
          "delivery_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Address"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "offered_at": {
            "format": "date-time",
            "title": "Offered At",
            "type": "string"
          },
          "order_id": {
            "format": "uuid",
            "title": "Order Id",
            "type": "string"
          },
          "order_status": {
            "title": "Order Status",
            "type": "string"
          },
          "picked_up_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Picked Up At"
          },
          "responded_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Responded At"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "total": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Total",
            "type": "string"
          }
        },
        "required": [
          "id",
          "order_id",
          "courier_id",
          "status",
          "offered_at",
          "responded_at",
          "picked_up_at",
          "delivered_at",
          "branch_name",
          "delivery_address",
          "total",
          "order_status"
        ],
        "title": "DeliveryHistoryOut",
        "type": "object"
      },
      "DeliveryOfferOut": {
        "description": "A DeliveryAssignmentOut plus just enough order context for a\ncourier to decide accept/reject without a second round trip.",
        "properties": {
          "branch_address": {
            "title": "Branch Address",
            "type": "string"
          },
          "branch_name": {
            "title": "Branch Name",
            "type": "string"
          },
          "courier_id": {
            "format": "uuid",
            "title": "Courier Id",
            "type": "string"
          },
          "delivered_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivered At"
          },
          "delivery_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Address"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "offered_at": {
            "format": "date-time",
            "title": "Offered At",
            "type": "string"
          },
          "order_id": {
            "format": "uuid",
            "title": "Order Id",
            "type": "string"
          },
          "picked_up_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Picked Up At"
          },
          "responded_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Responded At"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "total": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Total",
            "type": "string"
          }
        },
        "required": [
          "id",
          "order_id",
          "courier_id",
          "status",
          "offered_at",
          "responded_at",
          "picked_up_at",
          "delivered_at",
          "branch_name",
          "branch_address",
          "delivery_address",
          "total"
        ],
        "title": "DeliveryOfferOut",
        "type": "object"
      },
      "DeviceTokenRegisterRequest": {
        "properties": {
          "platform": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Platform"
          },
          "token": {
            "title": "Token",
            "type": "string"
          }
        },
        "required": [
          "token"
        ],
        "title": "DeviceTokenRegisterRequest",
        "type": "object"
      },
      "DietaryInfo": {
        "properties": {
          "fasting": {
            "default": false,
            "title": "Fasting",
            "type": "boolean"
          },
          "gluten_free": {
            "default": false,
            "title": "Gluten Free",
            "type": "boolean"
          },
          "halal": {
            "default": false,
            "title": "Halal",
            "type": "boolean"
          },
          "vegan": {
            "default": false,
            "title": "Vegan",
            "type": "boolean"
          }
        },
        "title": "DietaryInfo",
        "type": "object"
      },
      "EmailOtpVerifyRequest": {
        "description": "Email + OTP code \u2014 used by /auth/email/verify-otp, the\nemail-keyed counterpart to PhoneOtpVerifyRequest.",
        "properties": {
          "email": {
            "format": "email",
            "title": "Email",
            "type": "string"
          },
          "otp_code": {
            "title": "Otp Code",
            "type": "string"
          }
        },
        "required": [
          "email",
          "otp_code"
        ],
        "title": "EmailOtpVerifyRequest",
        "type": "object"
      },
      "ForgotPinStartRequest": {
        "description": "identifier is a phone number or an email address \u2014 symmetric to\nLoginRequest, since an email-only-signup customer has no phone to\nreset a PIN by SMS with.",
        "properties": {
          "identifier": {
            "title": "Identifier",
            "type": "string"
          }
        },
        "required": [
          "identifier"
        ],
        "title": "ForgotPinStartRequest",
        "type": "object"
      },
      "GoogleConnectRequest": {
        "description": "Links a Google identity to the *currently logged-in* account \u2014\nused by POST /auth/google/connect when GoogleSignInRequest finds an\nemail collision it refuses to auto-link. Requires re-entering the\nPIN even though the caller is already authenticated: proof that\nthis specific sensitive action (permanently attaching a new login\nmethod) is really being done by the account holder, not just\nwhoever is holding an unlocked session.",
        "properties": {
          "id_token": {
            "title": "Id Token",
            "type": "string"
          },
          "pin": {
            "title": "Pin",
            "type": "string"
          }
        },
        "required": [
          "id_token",
          "pin"
        ],
        "title": "GoogleConnectRequest",
        "type": "object"
      },
      "GoogleSignInRequest": {
        "description": "The ID token from the Flutter app's on-device Google Sign-In \u2014\nour backend never sees a Google password or client secret, only\nverifies this token's signature. See\napp.services.google_oauth.verify_google_id_token. Only signs in an\naccount already linked to this Google identity, or creates a new\none \u2014 it never auto-links to an existing phone/email account it\ndoesn't already own; see GoogleConnectRequest for that.",
        "properties": {
          "id_token": {
            "title": "Id Token",
            "type": "string"
          }
        },
        "required": [
          "id_token"
        ],
        "title": "GoogleSignInRequest",
        "type": "object"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail",
            "type": "array"
          }
        },
        "title": "HTTPValidationError",
        "type": "object"
      },
      "InviteResponse": {
        "properties": {
          "debug_otp": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Debug Otp"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "user": {
            "$ref": "#/components/schemas/UserOut"
          }
        },
        "required": [
          "message",
          "user"
        ],
        "title": "InviteResponse",
        "type": "object"
      },
      "LocationUpdateRequest": {
        "properties": {
          "latitude": {
            "title": "Latitude",
            "type": "number"
          },
          "longitude": {
            "title": "Longitude",
            "type": "number"
          }
        },
        "required": [
          "latitude",
          "longitude"
        ],
        "title": "LocationUpdateRequest",
        "type": "object"
      },
      "LoginRequest": {
        "description": "identifier is a phone number or an email address \u2014 detected by\nformat (see app.api.v1.endpoints.auth.login), since signup can now\nleave either one as the verified identifier depending on which\nchannel the customer confirmed. Only a *verified* phone/email can\never be matched at login \u2014 see the User model docstring.",
        "examples": [
          {
            "identifier": "0912345678",
            "pin": "417293"
          }
        ],
        "properties": {
          "identifier": {
            "title": "Identifier",
            "type": "string"
          },
          "pin": {
            "title": "Pin",
            "type": "string"
          }
        },
        "required": [
          "identifier",
          "pin"
        ],
        "title": "LoginRequest",
        "type": "object"
      },
      "LogoutRequest": {
        "properties": {
          "refresh_token": {
            "title": "Refresh Token",
            "type": "string"
          }
        },
        "required": [
          "refresh_token"
        ],
        "title": "LogoutRequest",
        "type": "object"
      },
      "MarketingConsentRequest": {
        "description": "PATCH /auth/me/marketing-consent \u2014 a standalone, explicit opt-in\nstep, separate from signup itself, since by the time the app\nprompts for it the customer is already logged in (see the User\nmodel docstring on marketing_emails_opt_in).",
        "properties": {
          "opt_in": {
            "title": "Opt In",
            "type": "boolean"
          }
        },
        "required": [
          "opt_in"
        ],
        "title": "MarketingConsentRequest",
        "type": "object"
      },
      "MenuCategoryCreateRequest": {
        "properties": {
          "display_order": {
            "default": 0,
            "title": "Display Order",
            "type": "integer"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "title": "MenuCategoryCreateRequest",
        "type": "object"
      },
      "MenuCategoryOut": {
        "properties": {
          "branch_id": {
            "format": "uuid",
            "title": "Branch Id",
            "type": "string"
          },
          "display_order": {
            "title": "Display Order",
            "type": "integer"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "id",
          "branch_id",
          "name",
          "display_order"
        ],
        "title": "MenuCategoryOut",
        "type": "object"
      },
      "MenuCategoryUpdateRequest": {
        "description": "Partial \u2014 only fields actually sent are changed.",
        "properties": {
          "display_order": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Order"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          }
        },
        "title": "MenuCategoryUpdateRequest",
        "type": "object"
      },
      "MenuCategoryWithItemsOut": {
        "properties": {
          "branch_id": {
            "format": "uuid",
            "title": "Branch Id",
            "type": "string"
          },
          "display_order": {
            "title": "Display Order",
            "type": "integer"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "items": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/MenuItemWithOptionsOut"
            },
            "title": "Items",
            "type": "array"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "id",
          "branch_id",
          "name",
          "display_order"
        ],
        "title": "MenuCategoryWithItemsOut",
        "type": "object"
      },
      "MenuItemCreateRequest": {
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "dietary_info": {
            "$ref": "#/components/schemas/DietaryInfo",
            "default": {
              "fasting": false,
              "gluten_free": false,
              "halal": false,
              "vegan": false
            }
          },
          "image_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Url"
          },
          "is_available": {
            "default": true,
            "title": "Is Available",
            "type": "boolean"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              }
            ],
            "title": "Price"
          },
          "unit_of_measure": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit Of Measure"
          }
        },
        "required": [
          "name",
          "price"
        ],
        "title": "MenuItemCreateRequest",
        "type": "object"
      },
      "MenuItemOptionCreateRequest": {
        "properties": {
          "display_order": {
            "default": 0,
            "title": "Display Order",
            "type": "integer"
          },
          "is_available": {
            "default": true,
            "title": "Is Available",
            "type": "boolean"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "price_delta": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              }
            ],
            "default": "0.00",
            "title": "Price Delta"
          }
        },
        "required": [
          "name"
        ],
        "title": "MenuItemOptionCreateRequest",
        "type": "object"
      },
      "MenuItemOptionGroupCreateRequest": {
        "properties": {
          "display_order": {
            "default": 0,
            "title": "Display Order",
            "type": "integer"
          },
          "is_required": {
            "default": false,
            "title": "Is Required",
            "type": "boolean"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "selection_type": {
            "default": "single",
            "enum": [
              "single",
              "multiple"
            ],
            "title": "Selection Type",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "title": "MenuItemOptionGroupCreateRequest",
        "type": "object"
      },
      "MenuItemOptionGroupOut": {
        "properties": {
          "display_order": {
            "title": "Display Order",
            "type": "integer"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "is_required": {
            "title": "Is Required",
            "type": "boolean"
          },
          "menu_item_id": {
            "format": "uuid",
            "title": "Menu Item Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "selection_type": {
            "title": "Selection Type",
            "type": "string"
          }
        },
        "required": [
          "id",
          "menu_item_id",
          "name",
          "selection_type",
          "is_required",
          "display_order"
        ],
        "title": "MenuItemOptionGroupOut",
        "type": "object"
      },
      "MenuItemOptionGroupUpdateRequest": {
        "description": "Partial \u2014 only fields actually sent are changed.",
        "properties": {
          "display_order": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Order"
          },
          "is_required": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Required"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "selection_type": {
            "anyOf": [
              {
                "enum": [
                  "single",
                  "multiple"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Selection Type"
          }
        },
        "title": "MenuItemOptionGroupUpdateRequest",
        "type": "object"
      },
      "MenuItemOptionGroupWithOptionsOut": {
        "properties": {
          "display_order": {
            "title": "Display Order",
            "type": "integer"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "is_required": {
            "title": "Is Required",
            "type": "boolean"
          },
          "menu_item_id": {
            "format": "uuid",
            "title": "Menu Item Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "options": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/MenuItemOptionOut"
            },
            "title": "Options",
            "type": "array"
          },
          "selection_type": {
            "title": "Selection Type",
            "type": "string"
          }
        },
        "required": [
          "id",
          "menu_item_id",
          "name",
          "selection_type",
          "is_required",
          "display_order"
        ],
        "title": "MenuItemOptionGroupWithOptionsOut",
        "type": "object"
      },
      "MenuItemOptionOut": {
        "properties": {
          "display_order": {
            "title": "Display Order",
            "type": "integer"
          },
          "group_id": {
            "format": "uuid",
            "title": "Group Id",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "is_available": {
            "title": "Is Available",
            "type": "boolean"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "price_delta": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Price Delta",
            "type": "string"
          }
        },
        "required": [
          "id",
          "group_id",
          "name",
          "price_delta",
          "display_order",
          "is_available"
        ],
        "title": "MenuItemOptionOut",
        "type": "object"
      },
      "MenuItemOptionUpdateRequest": {
        "description": "Partial \u2014 only fields actually sent are changed.",
        "properties": {
          "display_order": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Order"
          },
          "is_available": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Available"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "price_delta": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Delta"
          }
        },
        "title": "MenuItemOptionUpdateRequest",
        "type": "object"
      },
      "MenuItemOut": {
        "properties": {
          "branch_id": {
            "format": "uuid",
            "title": "Branch Id",
            "type": "string"
          },
          "category_id": {
            "format": "uuid",
            "title": "Category Id",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "dietary_info": {
            "$ref": "#/components/schemas/DietaryInfo"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "image_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Url"
          },
          "is_available": {
            "title": "Is Available",
            "type": "boolean"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "price": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Price",
            "type": "string"
          },
          "unit_of_measure": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit Of Measure"
          }
        },
        "required": [
          "id",
          "branch_id",
          "category_id",
          "name",
          "description",
          "price",
          "image_url",
          "is_available",
          "dietary_info"
        ],
        "title": "MenuItemOut",
        "type": "object"
      },
      "MenuItemUpdateRequest": {
        "description": "Partial \u2014 only fields actually sent are changed. Pass\nunit_of_measure as null to turn a grocery-by-weight item back into\na normal per-piece item (clears its GroceryItemDetails row rather\nthan leaving a stale unit behind); pass category_id to move the\nitem to a different category within the same branch \u2014 see\napp.api.v1.endpoints.branches.update_menu_item.",
        "properties": {
          "category_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Category Id"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "dietary_info": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DietaryInfo"
              },
              {
                "type": "null"
              }
            ]
          },
          "image_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Url"
          },
          "is_available": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Available"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price"
          },
          "unit_of_measure": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit Of Measure"
          }
        },
        "title": "MenuItemUpdateRequest",
        "type": "object"
      },
      "MenuItemWithOptionsOut": {
        "properties": {
          "branch_id": {
            "format": "uuid",
            "title": "Branch Id",
            "type": "string"
          },
          "category_id": {
            "format": "uuid",
            "title": "Category Id",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "dietary_info": {
            "$ref": "#/components/schemas/DietaryInfo"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "image_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Url"
          },
          "is_available": {
            "title": "Is Available",
            "type": "boolean"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "option_groups": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/MenuItemOptionGroupWithOptionsOut"
            },
            "title": "Option Groups",
            "type": "array"
          },
          "price": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Price",
            "type": "string"
          },
          "unit_of_measure": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit Of Measure"
          }
        },
        "required": [
          "id",
          "branch_id",
          "category_id",
          "name",
          "description",
          "price",
          "image_url",
          "is_available",
          "dietary_info"
        ],
        "title": "MenuItemWithOptionsOut",
        "type": "object"
      },
      "MerchantCreateRequest": {
        "description": "name/description/logo_url for the merchant brand itself.\nowner_id is only meaningful when an admin creates this on behalf of\na supplier \u2014 a supplier caller always ends up owning it themselves\nregardless of what (if anything) they pass here; see\napp.api.v1.endpoints.merchants.create_merchant.\n\nbusiness_type defaults to \"restaurant\" \u2014 pass \"grocery\" to create a\ngrocery store instead. Everything downstream (branches, catalog,\ncart, checkout) works identically either way; see the Merchant\nmodel docstring.",
        "properties": {
          "business_type": {
            "default": "restaurant",
            "enum": [
              "restaurant",
              "grocery"
            ],
            "title": "Business Type",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "logo_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Logo Url"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "owner_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Owner Id"
          }
        },
        "required": [
          "name"
        ],
        "title": "MerchantCreateRequest",
        "type": "object"
      },
      "MerchantOut": {
        "properties": {
          "business_type": {
            "title": "Business Type",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "logo_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Logo Url"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "owner_id": {
            "format": "uuid",
            "title": "Owner Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "owner_id",
          "name",
          "description",
          "logo_url",
          "business_type"
        ],
        "title": "MerchantOut",
        "type": "object"
      },
      "MerchantUpdateRequest": {
        "description": "Partial \u2014 only fields actually sent are changed. owner_id is\ndeliberately absent: transferring ownership isn't supported here,\nsame as it never was on create for a supplier caller.",
        "properties": {
          "business_type": {
            "anyOf": [
              {
                "enum": [
                  "restaurant",
                  "grocery"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Business Type"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "logo_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Logo Url"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          }
        },
        "title": "MerchantUpdateRequest",
        "type": "object"
      },
      "MessageResponse": {
        "properties": {
          "debug_otp": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Debug Otp"
          },
          "message": {
            "title": "Message",
            "type": "string"
          }
        },
        "required": [
          "message"
        ],
        "title": "MessageResponse",
        "type": "object"
      },
      "OrderItemOptionOut": {
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "name_snapshot": {
            "title": "Name Snapshot",
            "type": "string"
          },
          "price_delta_snapshot": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Price Delta Snapshot",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name_snapshot",
          "price_delta_snapshot"
        ],
        "title": "OrderItemOptionOut",
        "type": "object"
      },
      "OrderItemOut": {
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "line_total": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Line Total",
            "type": "string"
          },
          "menu_item_id": {
            "format": "uuid",
            "title": "Menu Item Id",
            "type": "string"
          },
          "name_snapshot": {
            "title": "Name Snapshot",
            "type": "string"
          },
          "options": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/OrderItemOptionOut"
            },
            "title": "Options",
            "type": "array"
          },
          "quantity": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Quantity",
            "type": "string"
          },
          "special_instructions": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Special Instructions"
          },
          "unit_price_snapshot": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Unit Price Snapshot",
            "type": "string"
          }
        },
        "required": [
          "id",
          "menu_item_id",
          "name_snapshot",
          "unit_price_snapshot",
          "quantity",
          "special_instructions",
          "line_total"
        ],
        "title": "OrderItemOut",
        "type": "object"
      },
      "OrderOut": {
        "properties": {
          "branch_id": {
            "format": "uuid",
            "title": "Branch Id",
            "type": "string"
          },
          "chapa_checkout_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Chapa Checkout Url"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "delivery_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Address"
          },
          "delivery_fee": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Delivery Fee",
            "type": "string"
          },
          "delivery_latitude": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Latitude"
          },
          "delivery_longitude": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Longitude"
          },
          "delivery_mode": {
            "title": "Delivery Mode",
            "type": "string"
          },
          "discount_amount": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Discount Amount",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "payment_method": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payment Method"
          },
          "payment_status": {
            "title": "Payment Status",
            "type": "string"
          },
          "promo_code_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Promo Code Id"
          },
          "recipient_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recipient Name"
          },
          "recipient_phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recipient Phone"
          },
          "service_fee": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Service Fee",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "subtotal": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Subtotal",
            "type": "string"
          },
          "total": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Total",
            "type": "string"
          },
          "tx_ref": {
            "title": "Tx Ref",
            "type": "string"
          },
          "vat": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Vat",
            "type": "string"
          }
        },
        "required": [
          "id",
          "customer_id",
          "branch_id",
          "status",
          "delivery_mode",
          "delivery_address",
          "delivery_latitude",
          "delivery_longitude",
          "recipient_name",
          "recipient_phone",
          "subtotal",
          "delivery_fee",
          "service_fee",
          "vat",
          "discount_amount",
          "promo_code_id",
          "total",
          "payment_status",
          "tx_ref",
          "chapa_checkout_url",
          "payment_method"
        ],
        "title": "OrderOut",
        "type": "object"
      },
      "OrderStatusBreakdownOut": {
        "properties": {
          "count": {
            "title": "Count",
            "type": "integer"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "status",
          "count"
        ],
        "title": "OrderStatusBreakdownOut",
        "type": "object"
      },
      "OrderStatusUpdateRequest": {
        "properties": {
          "status": {
            "enum": [
              "confirmed",
              "preparing",
              "ready",
              "completed",
              "cancelled"
            ],
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "title": "OrderStatusUpdateRequest",
        "type": "object"
      },
      "OrderTrackingOut": {
        "properties": {
          "assignment_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assignment Status"
          },
          "courier_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Courier Name"
          },
          "courier_phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Courier Phone"
          },
          "last_latitude": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Latitude"
          },
          "last_location_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Location At"
          },
          "last_longitude": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Longitude"
          },
          "order_id": {
            "format": "uuid",
            "title": "Order Id",
            "type": "string"
          },
          "order_status": {
            "title": "Order Status",
            "type": "string"
          }
        },
        "required": [
          "order_id",
          "order_status"
        ],
        "title": "OrderTrackingOut",
        "type": "object"
      },
      "OrderWithItemsOut": {
        "properties": {
          "branch_id": {
            "format": "uuid",
            "title": "Branch Id",
            "type": "string"
          },
          "chapa_checkout_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Chapa Checkout Url"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "delivery_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Address"
          },
          "delivery_fee": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Delivery Fee",
            "type": "string"
          },
          "delivery_latitude": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Latitude"
          },
          "delivery_longitude": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivery Longitude"
          },
          "delivery_mode": {
            "title": "Delivery Mode",
            "type": "string"
          },
          "discount_amount": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Discount Amount",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "items": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/OrderItemOut"
            },
            "title": "Items",
            "type": "array"
          },
          "payment_method": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payment Method"
          },
          "payment_status": {
            "title": "Payment Status",
            "type": "string"
          },
          "promo_code_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Promo Code Id"
          },
          "recipient_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recipient Name"
          },
          "recipient_phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recipient Phone"
          },
          "service_fee": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Service Fee",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "subtotal": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Subtotal",
            "type": "string"
          },
          "total": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Total",
            "type": "string"
          },
          "tx_ref": {
            "title": "Tx Ref",
            "type": "string"
          },
          "vat": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Vat",
            "type": "string"
          }
        },
        "required": [
          "id",
          "customer_id",
          "branch_id",
          "status",
          "delivery_mode",
          "delivery_address",
          "delivery_latitude",
          "delivery_longitude",
          "recipient_name",
          "recipient_phone",
          "subtotal",
          "delivery_fee",
          "service_fee",
          "vat",
          "discount_amount",
          "promo_code_id",
          "total",
          "payment_status",
          "tx_ref",
          "chapa_checkout_url",
          "payment_method"
        ],
        "title": "OrderWithItemsOut",
        "type": "object"
      },
      "OtpVerifyRequest": {
        "description": "identifier (phone or email) + OTP code \u2014 shared by signup,\nforgot-pin, and account activation, all of which now key their OTP\nby whichever identifier the flow is actually verifying.",
        "examples": [
          {
            "identifier": "0912345678",
            "otp_code": "123456"
          }
        ],
        "properties": {
          "identifier": {
            "title": "Identifier",
            "type": "string"
          },
          "otp_code": {
            "title": "Otp Code",
            "type": "string"
          }
        },
        "required": [
          "identifier",
          "otp_code"
        ],
        "title": "OtpVerifyRequest",
        "type": "object"
      },
      "PhoneAndNameRequest": {
        "description": "Phone + name + email \u2014 used when an admin invites a\ncourier/supplier/admin (see app.api.v1.endpoints.admin), where both\nare always mandatory. Customer self-signup uses\nCustomerSignupRequest instead, which only ever requires one of\nphone/email.",
        "properties": {
          "email": {
            "format": "email",
            "title": "Email",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "phone": {
            "title": "Phone",
            "type": "string"
          }
        },
        "required": [
          "phone",
          "name",
          "email"
        ],
        "title": "PhoneAndNameRequest",
        "type": "object"
      },
      "PhoneOtpVerifyRequest": {
        "description": "Phone + OTP code \u2014 used by /auth/phone/verify-otp specifically,\nwhere the identifier is always a phone number.",
        "properties": {
          "otp_code": {
            "title": "Otp Code",
            "type": "string"
          },
          "phone": {
            "title": "Phone",
            "type": "string"
          }
        },
        "required": [
          "phone",
          "otp_code"
        ],
        "title": "PhoneOtpVerifyRequest",
        "type": "object"
      },
      "PinSetRequest": {
        "description": "Verification token + PIN: the final step of signup, forgot-pin\nreset, and account activation.",
        "examples": [
          {
            "pin": "417293",
            "verification_token": "a1b2c3d4..."
          }
        ],
        "properties": {
          "pin": {
            "title": "Pin",
            "type": "string"
          },
          "verification_token": {
            "title": "Verification Token",
            "type": "string"
          }
        },
        "required": [
          "verification_token",
          "pin"
        ],
        "title": "PinSetRequest",
        "type": "object"
      },
      "PromoCodeCreateRequest": {
        "description": "Scope narrows in two steps: merchant_id null means platform-wide\n(any merchant's branch can redeem it) \u2014 only an admin may create a\nplatform-wide code; a supplier must always set their own\nmerchant_id, enforced in\napp.api.v1.endpoints.promo_codes.create_promo_code, not here.\nbranch_id further narrows to just one of that merchant's branches\n\u2014 leave it unset for \"every branch of this merchant.\" branch_id\ncan't be set without merchant_id, and must actually belong to that\nmerchant (also enforced in the endpoint, where the DB is\navailable).\n\nmax_discount_amount only makes sense for a percentage discount\n(caps an otherwise unbounded percentage-of-a-large-order amount) \u2014\nrejected for a fixed_amount code, which is already its own cap.",
        "properties": {
          "branch_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Branch Id"
          },
          "code": {
            "title": "Code",
            "type": "string"
          },
          "discount_type": {
            "enum": [
              "percentage",
              "fixed_amount"
            ],
            "title": "Discount Type",
            "type": "string"
          },
          "discount_value": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              }
            ],
            "title": "Discount Value"
          },
          "max_discount_amount": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Discount Amount"
          },
          "merchant_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Merchant Id"
          },
          "min_order_amount": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Min Order Amount"
          },
          "usage_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Usage Limit"
          },
          "usage_limit_per_customer": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Usage Limit Per Customer"
          },
          "valid_from": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Valid From"
          },
          "valid_until": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Valid Until"
          }
        },
        "required": [
          "code",
          "discount_type",
          "discount_value"
        ],
        "title": "PromoCodeCreateRequest",
        "type": "object"
      },
      "PromoCodeOut": {
        "properties": {
          "branch_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Branch Id"
          },
          "code": {
            "title": "Code",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "discount_type": {
            "title": "Discount Type",
            "type": "string"
          },
          "discount_value": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Discount Value",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "max_discount_amount": {
            "anyOf": [
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Discount Amount"
          },
          "merchant_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Merchant Id"
          },
          "min_order_amount": {
            "anyOf": [
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Min Order Amount"
          },
          "times_used": {
            "title": "Times Used",
            "type": "integer"
          },
          "usage_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Usage Limit"
          },
          "usage_limit_per_customer": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Usage Limit Per Customer"
          },
          "valid_from": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Valid From"
          },
          "valid_until": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Valid Until"
          }
        },
        "required": [
          "id",
          "code",
          "merchant_id",
          "branch_id",
          "discount_type",
          "discount_value",
          "max_discount_amount",
          "min_order_amount",
          "usage_limit",
          "usage_limit_per_customer",
          "times_used",
          "valid_from",
          "valid_until",
          "is_active",
          "created_at"
        ],
        "title": "PromoCodeOut",
        "type": "object"
      },
      "PromoCodeUpdateRequest": {
        "description": "Partial \u2014 only fields actually sent are changed. Deliberately\ndoesn't allow changing code/discount_type/discount_value/\nmerchant_id after creation (a code already advertised or redeemed\nshouldn't quietly change what it does) \u2014 deactivate it and create\na new one instead.",
        "properties": {
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active"
          },
          "max_discount_amount": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Discount Amount"
          },
          "min_order_amount": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Min Order Amount"
          },
          "usage_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Usage Limit"
          },
          "usage_limit_per_customer": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Usage Limit Per Customer"
          },
          "valid_from": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Valid From"
          },
          "valid_until": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Valid Until"
          }
        },
        "title": "PromoCodeUpdateRequest",
        "type": "object"
      },
      "RefreshRequest": {
        "properties": {
          "refresh_token": {
            "title": "Refresh Token",
            "type": "string"
          }
        },
        "required": [
          "refresh_token"
        ],
        "title": "RefreshRequest",
        "type": "object"
      },
      "ReorderResponse": {
        "description": "See app.api.v1.endpoints.orders.reorder_order. cart is the\ncustomer's cart *after* whatever could be added \u2014 always fetch\nthis rather than assuming what was in it before the call, since\nreorder merges into any existing cart contents rather than\nreplacing them.",
        "properties": {
          "added_count": {
            "title": "Added Count",
            "type": "integer"
          },
          "cart": {
            "$ref": "#/components/schemas/CartOut"
          },
          "skipped": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/ReorderSkippedItem"
            },
            "title": "Skipped",
            "type": "array"
          }
        },
        "required": [
          "cart",
          "added_count"
        ],
        "title": "ReorderResponse",
        "type": "object"
      },
      "ReorderSkippedItem": {
        "description": "One line from the original order that couldn't be added back \u2014\ne.g. the item was removed from the menu, marked unavailable, or an\noption it used no longer exists. name is the original\nname_snapshot, not necessarily what the item is called now.",
        "properties": {
          "name": {
            "title": "Name",
            "type": "string"
          },
          "reason": {
            "title": "Reason",
            "type": "string"
          }
        },
        "required": [
          "name",
          "reason"
        ],
        "title": "ReorderSkippedItem",
        "type": "object"
      },
      "ReviewCreateRequest": {
        "properties": {
          "comment": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Comment"
          },
          "rating": {
            "title": "Rating",
            "type": "integer"
          }
        },
        "required": [
          "rating"
        ],
        "title": "ReviewCreateRequest",
        "type": "object"
      },
      "ReviewOut": {
        "properties": {
          "branch_id": {
            "format": "uuid",
            "title": "Branch Id",
            "type": "string"
          },
          "comment": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Comment"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "customer_id": {
            "format": "uuid",
            "title": "Customer Id",
            "type": "string"
          },
          "customer_name": {
            "default": "",
            "title": "Customer Name",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "is_hidden": {
            "title": "Is Hidden",
            "type": "boolean"
          },
          "order_id": {
            "format": "uuid",
            "title": "Order Id",
            "type": "string"
          },
          "rating": {
            "title": "Rating",
            "type": "integer"
          },
          "supplier_reply": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supplier Reply"
          },
          "supplier_reply_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supplier Reply At"
          }
        },
        "required": [
          "id",
          "order_id",
          "customer_id",
          "branch_id",
          "rating",
          "comment",
          "supplier_reply",
          "supplier_reply_at",
          "is_hidden",
          "created_at"
        ],
        "title": "ReviewOut",
        "type": "object"
      },
      "ReviewReplyRequest": {
        "properties": {
          "reply": {
            "title": "Reply",
            "type": "string"
          }
        },
        "required": [
          "reply"
        ],
        "title": "ReviewReplyRequest",
        "type": "object"
      },
      "ReviewUpdateRequest": {
        "description": "Partial \u2014 only fields actually sent are changed. Customer-only\n(see app.api.v1.endpoints.reviews.update_review); doesn't touch\nsupplier_reply or is_hidden, which have their own dedicated\nendpoints and permission models.",
        "properties": {
          "comment": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Comment"
          },
          "rating": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rating"
          }
        },
        "title": "ReviewUpdateRequest",
        "type": "object"
      },
      "ReviewVisibilityRequest": {
        "properties": {
          "is_hidden": {
            "title": "Is Hidden",
            "type": "boolean"
          }
        },
        "required": [
          "is_hidden"
        ],
        "title": "ReviewVisibilityRequest",
        "type": "object"
      },
      "TokenResponse": {
        "properties": {
          "access_token": {
            "title": "Access Token",
            "type": "string"
          },
          "refresh_token": {
            "title": "Refresh Token",
            "type": "string"
          },
          "token_type": {
            "default": "bearer",
            "title": "Token Type",
            "type": "string"
          },
          "user": {
            "$ref": "#/components/schemas/UserOut"
          }
        },
        "required": [
          "access_token",
          "refresh_token",
          "user"
        ],
        "title": "TokenResponse",
        "type": "object"
      },
      "TopBranchOut": {
        "properties": {
          "branch_id": {
            "format": "uuid",
            "title": "Branch Id",
            "type": "string"
          },
          "branch_name": {
            "title": "Branch Name",
            "type": "string"
          },
          "order_count": {
            "title": "Order Count",
            "type": "integer"
          },
          "total_sales": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Total Sales",
            "type": "string"
          }
        },
        "required": [
          "branch_id",
          "branch_name",
          "order_count",
          "total_sales"
        ],
        "title": "TopBranchOut",
        "type": "object"
      },
      "TopMerchantOut": {
        "properties": {
          "merchant_id": {
            "format": "uuid",
            "title": "Merchant Id",
            "type": "string"
          },
          "merchant_name": {
            "title": "Merchant Name",
            "type": "string"
          },
          "order_count": {
            "title": "Order Count",
            "type": "integer"
          },
          "total_sales": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Total Sales",
            "type": "string"
          }
        },
        "required": [
          "merchant_id",
          "merchant_name",
          "order_count",
          "total_sales"
        ],
        "title": "TopMerchantOut",
        "type": "object"
      },
      "UploadResponse": {
        "properties": {
          "url": {
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "url"
        ],
        "title": "UploadResponse",
        "type": "object"
      },
      "UserOut": {
        "properties": {
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "is_email_verified": {
            "title": "Is Email Verified",
            "type": "boolean"
          },
          "is_phone_verified": {
            "title": "Is Phone Verified",
            "type": "boolean"
          },
          "marketing_emails_opt_in": {
            "title": "Marketing Emails Opt In",
            "type": "boolean"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "role": {
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "id",
          "phone",
          "name",
          "email",
          "role",
          "is_phone_verified",
          "is_email_verified",
          "marketing_emails_opt_in",
          "is_active"
        ],
        "title": "UserOut",
        "type": "object"
      },
      "UserStatusUpdateRequest": {
        "description": "Admin-only account activation switch \u2014 see\napp.api.v1.endpoints.admin.update_user_status. is_active is\nalready what app.api.v1.deps.get_current_user and\napp.services.tokens both check on every request, so setting this\nto false immediately blocks both the access and refresh token \u2014\nno separate session-revocation step needed.",
        "properties": {
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          }
        },
        "required": [
          "is_active"
        ],
        "title": "UserStatusUpdateRequest",
        "type": "object"
      },
      "ValidationError": {
        "properties": {
          "ctx": {
            "title": "Context",
            "type": "object"
          },
          "input": {
            "title": "Input"
          },
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "title": "Location",
            "type": "array"
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      },
      "VerificationTokenOnlyRequest": {
        "description": "Just the verification_token from /auth/phone/verify-otp or\n/auth/email/verify-otp \u2014 no PIN involved, unlike PinSetRequest,\nsince adding a phone/email to an already-logged-in account doesn't\ntouch the PIN at all.",
        "properties": {
          "verification_token": {
            "title": "Verification Token",
            "type": "string"
          }
        },
        "required": [
          "verification_token"
        ],
        "title": "VerificationTokenOnlyRequest",
        "type": "object"
      },
      "VerificationTokenResponse": {
        "properties": {
          "expires_in_minutes": {
            "title": "Expires In Minutes",
            "type": "integer"
          },
          "verification_token": {
            "title": "Verification Token",
            "type": "string"
          }
        },
        "required": [
          "verification_token",
          "expires_in_minutes"
        ],
        "title": "VerificationTokenResponse",
        "type": "object"
      }
    },
    "securitySchemes": {
      "HTTPBearer": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "Yeneb CODS backend API. All routes are under `/api/v1`. Bearer-token auth (JWT access token in the `Authorization` header) unless noted otherwise. See `docs/API_ERRORS.md` in the repo for a full per-domain error-code reference, including the cross-cutting rate-limit and auth-failure behavior that applies across nearly every route.",
    "title": "Yeneb CODS API",
    "version": "1.0.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/": {
      "get": {
        "operationId": "root__get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Root"
      }
    },
    "/api/v1/admin/admins": {
      "post": {
        "description": "Only a superadmin can invite another admin \u2014 a regular admin\ncannot grant admin access to anyone, including themselves.",
        "operationId": "invite_admin_api_v1_admin_admins_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PhoneAndNameRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InviteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Invite Admin",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/analytics": {
      "get": {
        "description": "System-performance snapshot for the admin console. Order\nvolume, the status breakdown, cancellation rate, and top\nmerchants/branches are windowed to the last `days` days (default\n30); active couriers/branches are a live right-now count, not\nwindowed \u2014 \"how many can take an order right now\" isn't a\nhistorical question. revenue (Yeneb's own cut, not gross order\nvalue \u2014 see app.services.analytics.get_platform_revenue) is\nsuperadmin-only: a regular admin gets null there. Kept as one\nshared endpoint rather than a second superadmin-only one, since\nevery other field is identical for both roles.",
        "operationId": "get_analytics_api_v1_admin_analytics_get",
        "parameters": [
          {
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "default": 30,
              "maximum": 365,
              "minimum": 1,
              "title": "Days",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminAnalyticsOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Analytics",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/couriers": {
      "post": {
        "operationId": "invite_courier_api_v1_admin_couriers_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PhoneAndNameRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InviteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Invite Courier",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/couriers/{courier_id}": {
      "patch": {
        "description": "Both shift hours and the online/offline switch are admin-only \u2014\ncouriers here are full-time staff on a schedule the business sets,\nnot gig workers picking their own hours (see\napp.api.v1.endpoints.courier.get_profile for the courier's\nread-only view of what's configured for them). A courier needs\nboth is_online and to be inside their shift window to receive\noffers \u2014 see app.services.dispatch.dispatch_next_courier.\nAll fields optional: send just the ones you're changing.",
        "operationId": "update_courier_profile_api_v1_admin_couriers__courier_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "courier_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Courier Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CourierProfileUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourierProfileOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Courier Profile",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/couriers/{courier_id}/earnings": {
      "get": {
        "operationId": "get_courier_earnings_api_v1_admin_couriers__courier_id__earnings_get",
        "parameters": [
          {
            "in": "path",
            "name": "courier_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Courier Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourierEarningsSummaryOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Courier Earnings",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/suppliers": {
      "post": {
        "operationId": "invite_supplier_api_v1_admin_suppliers_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PhoneAndNameRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InviteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Invite Supplier",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/users": {
      "get": {
        "description": "Every account on the platform, across every role \u2014 the roster\nan admin console needs (who's a courier, who's a supplier, who's\nbeen deactivated). Pass role to narrow to one (customer/courier/\nsupplier/manager/admin/superadmin) and/or is_active to filter by\nactive status.",
        "operationId": "list_users_api_v1_admin_users_get",
        "parameters": [
          {
            "in": "query",
            "name": "role",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Role"
            }
          },
          {
            "in": "query",
            "name": "is_active",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Is Active"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/UserOut"
                  },
                  "title": "Response List Users Api V1 Admin Users Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Users",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/admin/users/{user_id}/status": {
      "patch": {
        "description": "Deactivating blocks both login and any already-issued access/\nrefresh token immediately (see UserStatusUpdateRequest) \u2014 no\nseparate session-revocation step needed. Changing an admin's or\nsuperadmin's own status is superadmin-only, the same restriction\nalready used for inviting one in the first place (see\ninvite_admin) \u2014 a regular admin can't lock out, or reactivate,\nanother admin.",
        "operationId": "update_user_status_api_v1_admin_users__user_id__status_patch",
        "parameters": [
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "User Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserStatusUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update User Status",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/v1/auth/activate/complete": {
      "post": {
        "description": "Second step: set a PIN on the invited account and log in.\n\nUnlike /signup/complete, the account already exists (an admin\ncreated it) \u2014 this just sets its PIN for the first time. This is\nalso the moment its phone actually becomes verified \u2014 admin.py's\ninvite flow reserves the phone immediately (it isn't the\nself-service squatting risk the dual-OTP signup path guards\nagainst \u2014 a trusted admin typed it, not an arbitrary end user),\nbut the account itself doesn't get the trust benefits of\nis_phone_verified (login, uniqueness) until this OTP is actually\ncompleted.",
        "operationId": "activate_complete_api_v1_auth_activate_complete_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PinSetRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Activate Complete",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/activate/verify-otp": {
      "post": {
        "description": "First step for a courier/supplier/admin account created by an\nadmin invite: verify the SMS code sent at invite time.",
        "operationId": "activate_verify_otp_api_v1_auth_activate_verify_otp_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PhoneOtpVerifyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerificationTokenResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Activate Verify Otp",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/email/complete": {
      "post": {
        "operationId": "add_email_complete_api_v1_auth_email_complete_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerificationTokenOnlyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Add Email Complete",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/email/start": {
      "post": {
        "description": "Symmetric to /auth/phone/start, for verifying/replacing the\nemail on the logged-in account \u2014 e.g. a customer who signed up\nphone-first, and now wants email notifications/receipts too. The\nOTP row is keyed by the new email itself, same as any other\nidentifier.",
        "operationId": "add_email_start_api_v1_auth_email_start_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddEmailStartRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Add Email Start",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/email/verify-otp": {
      "post": {
        "operationId": "add_email_verify_otp_api_v1_auth_email_verify_otp_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailOtpVerifyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerificationTokenResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Add Email Verify Otp",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/forgot-pin/reset": {
      "post": {
        "operationId": "forgot_pin_reset_api_v1_auth_forgot_pin_reset_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PinSetRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Forgot Pin Reset",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/forgot-pin/start": {
      "post": {
        "description": "identifier is a phone number or an email address \u2014 an\nemail-only-signup customer has no phone to reset a PIN by SMS\nwith, so this supports either (see ForgotPinStartRequest).",
        "operationId": "forgot_pin_start_api_v1_auth_forgot_pin_start_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ForgotPinStartRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Forgot Pin Start",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/forgot-pin/verify-otp": {
      "post": {
        "operationId": "forgot_pin_verify_otp_api_v1_auth_forgot_pin_verify_otp_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OtpVerifyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerificationTokenResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Forgot Pin Verify Otp",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/google": {
      "post": {
        "description": "Sign up or log in with Google. Only ever touches an account\nalready linked to this exact Google identity (google_sub), or\ncreates a brand-new one \u2014 it never auto-links to an existing\nphone/email account on an email match, even though Google has\nverified that email, because Google proving *this* person owns\nthat email doesn't prove they're the same person who created the\nother account. See POST /auth/google/connect for the deliberate,\nPIN-confirmed way to link instead.\n\nNo phone, no PIN for a newly-created account: it authenticates by\npresenting a fresh Google ID token each time (see the User model\ndocstring for how that's told apart from an invited-but-not-yet-\nactivated account, which also has pin_hash=None).",
        "operationId": "google_signin_api_v1_auth_google_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GoogleSignInRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Google Signin",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/google/connect": {
      "post": {
        "description": "Deliberately links a Google identity to the logged-in account \u2014\nwhat an app prompts the user through after google_signin() returns\n409 for an email collision. Requires re-entering the PIN even\nthough the caller is already authenticated, as proof this specific\nsensitive action is really the account holder (see\nGoogleConnectRequest).",
        "operationId": "google_connect_api_v1_auth_google_connect_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GoogleConnectRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Google Connect",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/login": {
      "post": {
        "description": "identifier is a phone number or an email address (see\nLoginRequest) \u2014 only a *verified* one is ever matched, since an\nunverified value on the account was never proven to belong to its\nholder.",
        "operationId": "login_api_v1_auth_login_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Login",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/logout": {
      "post": {
        "operationId": "logout_api_v1_auth_logout_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LogoutRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Logout",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/me": {
      "get": {
        "operationId": "read_current_user_api_v1_auth_me_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserOut"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Read Current User",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/me/marketing-consent": {
      "patch": {
        "description": "A standalone, explicit opt-in step \u2014 asked after signup, not\nbundled into it, since it's presented as its own screen (see the\nUser model docstring on marketing_emails_opt_in).",
        "operationId": "update_marketing_consent_api_v1_auth_me_marketing_consent_patch",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarketingConsentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Marketing Consent",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/me/pin": {
      "patch": {
        "description": "Distinct from the OTP-gated forgot-pin flow (/auth/forgot-pin/*)\n\u2014 this is for a logged-in user who still remembers their current\nPIN and just wants to change it, requiring the current PIN as\nproof, same reasoning as google_connect above.",
        "operationId": "change_pin_api_v1_auth_me_pin_patch",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangePinRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Change Pin",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/phone/complete": {
      "post": {
        "description": "Final step: attaches the now-verified phone to the logged-in\naccount. Re-checks uniqueness (among verified phones only) in case\nsomeone else claimed and verified the same number between /start\nand here.",
        "operationId": "add_phone_complete_api_v1_auth_phone_complete_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerificationTokenOnlyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Add Phone Complete",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/phone/start": {
      "post": {
        "description": "First step of adding/replacing a verified phone number on the\nlogged-in account \u2014 e.g. so a Google Sign-In customer can later\npay via Telebirr, which needs a real Ethiopian phone. Any\nauthenticated account can use this, not just Google ones.",
        "operationId": "add_phone_start_api_v1_auth_phone_start_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddPhoneStartRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Add Phone Start",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/phone/verify-otp": {
      "post": {
        "operationId": "add_phone_verify_otp_api_v1_auth_phone_verify_otp_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PhoneOtpVerifyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerificationTokenResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Add Phone Verify Otp",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/refresh": {
      "post": {
        "description": "Trade a refresh token for a new access token. The refresh token\nis rotated: the one submitted here stops working, and a new one is\nreturned to use next time.",
        "operationId": "refresh_api_v1_auth_refresh_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefreshRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Refresh",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/signup/complete": {
      "post": {
        "description": "Step 3 of customer signup: set a PIN using the verification_token\nfrom /signup/verify-otp. Creates the account and logs the customer\nin immediately. Only the identifier that was actually verified\n(verified.channel \u2014 \"sms\" or \"email\") is set on the new account;\nthe other stays fully unset, since single-identifier signup never\ncollected it (see CustomerSignupRequest).",
        "operationId": "signup_complete_api_v1_auth_signup_complete_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PinSetRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Signup Complete",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/signup/start": {
      "post": {
        "description": "Step 1 of customer signup: name + exactly one of phone or email\n(see CustomerSignupRequest) \u2014 phone-first or email-first, the\ncustomer's choice. Sends a single code to whichever one was given;\nthe other identifier isn't collected at all here and can be added\nlater, skippably, via /auth/phone/* or /auth/email/*.\n\nOnly customers self-signup \u2014 courier, supplier, and admin accounts\nare invited by an admin, see app.api.v1.endpoints.admin.",
        "operationId": "signup_start_api_v1_auth_signup_start_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerSignupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Signup Start",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/signup/verify-otp": {
      "post": {
        "description": "Step 2 of customer signup: verify the code sent to whichever\nidentifier was submitted in /signup/start.\n\nReturns a short-lived verification_token to use in the next step \u2014\nthe code itself isn't needed again.",
        "operationId": "signup_verify_otp_api_v1_auth_signup_verify_otp_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OtpVerifyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerificationTokenResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Signup Verify Otp",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/branches": {
      "get": {
        "description": "Marketplace-wide browse \u2014 every publicly visible (approved +\nactive) branch across every merchant, unlike\napp.api.v1.endpoints.merchants.list_branches, which only ever\nshows one merchant's own branches. This is what a customer app's\nhome/search screen actually calls.\n\nq matches the branch's own name OR any of its available menu\nitems' names (case-insensitive substring) \u2014 searching \"burger\"\nsurfaces a branch selling burgers even if it isn't named \"Burger\"\nanything. Pass lat & lng to sort by distance (nearest first);\nomit for unsorted. Pass business_type (\"restaurant\" or \"grocery\")\nto show just one vertical. Not cached, unlike the single-merchant\nlisting \u2014 an arbitrary q would turn into an unbounded number of\ncache entries for little benefit.",
        "operationId": "list_all_branches_api_v1_branches_get",
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "in": "query",
            "name": "lat",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Lat"
            }
          },
          {
            "in": "query",
            "name": "lng",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Lng"
            }
          },
          {
            "in": "query",
            "name": "business_type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Business Type"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/BranchOut"
                  },
                  "title": "Response List All Branches Api V1 Branches Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List All Branches",
        "tags": [
          "branches"
        ]
      }
    },
    "/api/v1/branches/{branch_id}": {
      "get": {
        "description": "The permission check always hits the DB (it's cheap \u2014 a couple\nof indexed lookups) since it depends on who's asking; only the\n(potentially large) assembled menu payload underneath it is\ncached, keyed by branch_id, since that content is identical for\neveryone who's allowed to see it at all.",
        "operationId": "get_branch_api_v1_branches__branch_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "branch_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Branch Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BranchWithMenuOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Branch",
        "tags": [
          "branches"
        ]
      },
      "patch": {
        "description": "Partial \u2014 only fields actually sent are changed. is_active is\nthe manual day-to-day open/closed switch the branch's own staff\ncontrols (see the Branch model docstring) \u2014 distinct from\nopens_at/closes_at (automatic/scheduled, see update_branch_hours)\nand approval_status (admin-only, see approve_branch).",
        "operationId": "update_branch_api_v1_branches__branch_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "branch_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Branch Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BranchUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BranchOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Branch",
        "tags": [
          "branches"
        ]
      }
    },
    "/api/v1/branches/{branch_id}/approve": {
      "patch": {
        "operationId": "approve_branch_api_v1_branches__branch_id__approve_patch",
        "parameters": [
          {
            "in": "path",
            "name": "branch_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Branch Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BranchApproveRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BranchOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Approve Branch",
        "tags": [
          "branches"
        ]
      }
    },
    "/api/v1/branches/{branch_id}/categories": {
      "post": {
        "operationId": "create_menu_category_api_v1_branches__branch_id__categories_post",
        "parameters": [
          {
            "in": "path",
            "name": "branch_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Branch Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MenuCategoryCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MenuCategoryOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Menu Category",
        "tags": [
          "branches"
        ]
      }
    },
    "/api/v1/branches/{branch_id}/categories/{category_id}": {
      "delete": {
        "description": "Refuses to delete a category that still has active items (409)\n\u2014 move or delete them first, rather than silently orphaning them\n(they'd still exist but never render in any category's menu\nlisting).",
        "operationId": "delete_menu_category_api_v1_branches__branch_id__categories__category_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "branch_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Branch Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "category_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Category Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Menu Category",
        "tags": [
          "branches"
        ]
      },
      "patch": {
        "description": "Partial \u2014 only fields actually sent are changed.",
        "operationId": "update_menu_category_api_v1_branches__branch_id__categories__category_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "branch_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Branch Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "category_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Category Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MenuCategoryUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MenuCategoryOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Menu Category",
        "tags": [
          "branches"
        ]
      }
    },
    "/api/v1/branches/{branch_id}/categories/{category_id}/items": {
      "post": {
        "operationId": "create_menu_item_api_v1_branches__branch_id__categories__category_id__items_post",
        "parameters": [
          {
            "in": "path",
            "name": "branch_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Branch Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "category_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Category Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MenuItemCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MenuItemOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Menu Item",
        "tags": [
          "branches"
        ]
      }
    },
    "/api/v1/branches/{branch_id}/favorite": {
      "delete": {
        "description": "No visibility check, unlike favorite_branch above \u2014 a customer\nmust always be able to remove a favorite even if the branch was\ndeactivated or unapproved after they favorited it. A no-op, not an\nerror, if it wasn't favorited in the first place.",
        "operationId": "unfavorite_branch_api_v1_branches__branch_id__favorite_delete",
        "parameters": [
          {
            "in": "path",
            "name": "branch_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Branch Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Unfavorite Branch",
        "tags": [
          "branches"
        ]
      },
      "post": {
        "description": "Idempotent \u2014 favoriting an already-favorited branch just\nsucceeds again (see app.services.favorites.add_favorite). Requires\nthe branch to actually be visible (same rule as get_branch), so a\ncustomer can't favorite a branch id that doesn't exist or isn't\napproved/active.",
        "operationId": "favorite_branch_api_v1_branches__branch_id__favorite_post",
        "parameters": [
          {
            "in": "path",
            "name": "branch_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Branch Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Favorite Branch",
        "tags": [
          "branches"
        ]
      }
    },
    "/api/v1/branches/{branch_id}/hours": {
      "patch": {
        "description": "Set by the branch's own staff (owner or an assigned manager),\nunlike a courier's shift (admin-only) \u2014 see the Branch model\ndocstring. Partial: only fields actually sent are changed. Pass\nopens_at/closes_at as null to clear them back to \"no hour\nrestriction\" (matches a branch that's never had hours set).",
        "operationId": "update_branch_hours_api_v1_branches__branch_id__hours_patch",
        "parameters": [
          {
            "in": "path",
            "name": "branch_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Branch Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BranchHoursUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BranchOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Branch Hours",
        "tags": [
          "branches"
        ]
      }
    },
    "/api/v1/branches/{branch_id}/items/{item_id}": {
      "delete": {
        "description": "Soft-delete, cascading to the item's own option groups/options\n(see MenuItemOptionGroup/MenuItemOption) \u2014 they have no meaning\nwithout their parent item, unlike a category, which items outlive\nindependently. Past orders keep their own name/price snapshot\nregardless (see OrderItem) and are unaffected.",
        "operationId": "delete_menu_item_api_v1_branches__branch_id__items__item_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "branch_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Branch Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "item_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Item Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Menu Item",
        "tags": [
          "branches"
        ]
      },
      "patch": {
        "description": "Partial \u2014 only fields actually sent are changed. See\nMenuItemUpdateRequest for the unit_of_measure/category_id\nbehavior.",
        "operationId": "update_menu_item_api_v1_branches__branch_id__items__item_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "branch_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Branch Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "item_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Item Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MenuItemUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MenuItemOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Menu Item",
        "tags": [
          "branches"
        ]
      }
    },
    "/api/v1/branches/{branch_id}/items/{item_id}/option-groups": {
      "post": {
        "description": "A branch manager/owner defines the choices customers see on this\nitem (e.g. \"Spice Level\", \"Add-ons\") \u2014 the actual priced options\nwithin a group are added via create_option below.",
        "operationId": "create_option_group_api_v1_branches__branch_id__items__item_id__option_groups_post",
        "parameters": [
          {
            "in": "path",
            "name": "branch_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Branch Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "item_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Item Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MenuItemOptionGroupCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MenuItemOptionGroupOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Option Group",
        "tags": [
          "branches"
        ]
      }
    },
    "/api/v1/branches/{branch_id}/items/{item_id}/option-groups/{group_id}": {
      "delete": {
        "description": "Soft-delete, cascading to the group's own options \u2014 they have\nno meaning without their parent group.",
        "operationId": "delete_option_group_api_v1_branches__branch_id__items__item_id__option_groups__group_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "branch_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Branch Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "item_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Item Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "group_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Group Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Option Group",
        "tags": [
          "branches"
        ]
      },
      "patch": {
        "description": "Partial \u2014 only fields actually sent are changed.",
        "operationId": "update_option_group_api_v1_branches__branch_id__items__item_id__option_groups__group_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "branch_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Branch Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "item_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Item Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "group_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Group Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MenuItemOptionGroupUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MenuItemOptionGroupOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Option Group",
        "tags": [
          "branches"
        ]
      }
    },
    "/api/v1/branches/{branch_id}/items/{item_id}/option-groups/{group_id}/options": {
      "post": {
        "operationId": "create_option_api_v1_branches__branch_id__items__item_id__option_groups__group_id__options_post",
        "parameters": [
          {
            "in": "path",
            "name": "branch_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Branch Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "item_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Item Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "group_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Group Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MenuItemOptionCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MenuItemOptionOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Option",
        "tags": [
          "branches"
        ]
      }
    },
    "/api/v1/branches/{branch_id}/items/{item_id}/option-groups/{group_id}/options/{option_id}": {
      "delete": {
        "operationId": "delete_option_api_v1_branches__branch_id__items__item_id__option_groups__group_id__options__option_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "branch_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Branch Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "item_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Item Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "group_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Group Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "option_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Option Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Option",
        "tags": [
          "branches"
        ]
      },
      "patch": {
        "description": "Partial \u2014 only fields actually sent are changed. Setting\nis_available=false is how an out-of-stock option (e.g. a topping)\ngets hidden without losing its history on past orders.",
        "operationId": "update_option_api_v1_branches__branch_id__items__item_id__option_groups__group_id__options__option_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "branch_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Branch Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "item_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Item Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "group_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Group Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "option_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Option Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MenuItemOptionUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MenuItemOptionOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Option",
        "tags": [
          "branches"
        ]
      }
    },
    "/api/v1/branches/{branch_id}/managers": {
      "post": {
        "description": "Only the merchant owner or an admin can invite a manager \u2014 a\nmanager cannot invite other staff, so this deliberately doesn't\naccept a manager caller even though managers otherwise manage this\nsame branch's menu (see _require_branch_staff).",
        "operationId": "invite_manager_api_v1_branches__branch_id__managers_post",
        "parameters": [
          {
            "in": "path",
            "name": "branch_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Branch Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PhoneAndNameRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InviteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Invite Manager",
        "tags": [
          "branches"
        ]
      }
    },
    "/api/v1/branches/{branch_id}/minimum-order": {
      "patch": {
        "description": "Set by the branch's own staff, same as hours \u2014 see the Branch\nmodel docstring on minimum_order_amount. Pass null to clear it\nback to \"no minimum\".",
        "operationId": "update_branch_minimum_order_api_v1_branches__branch_id__minimum_order_patch",
        "parameters": [
          {
            "in": "path",
            "name": "branch_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Branch Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BranchMinimumOrderUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BranchOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Branch Minimum Order",
        "tags": [
          "branches"
        ]
      }
    },
    "/api/v1/branches/{branch_id}/reviews": {
      "get": {
        "description": "Branch staff (owner/manager) and admins see every review,\nincluding hidden ones (useful for moderation context); everyone\nelse only sees visible ones \u2014 same is_hidden split the\naverage_rating/review_count rollup on BranchOut already applies.",
        "operationId": "list_branch_reviews_api_v1_branches__branch_id__reviews_get",
        "parameters": [
          {
            "in": "path",
            "name": "branch_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Branch Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ReviewOut"
                  },
                  "title": "Response List Branch Reviews Api V1 Branches  Branch Id  Reviews Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Branch Reviews",
        "tags": [
          "branches"
        ]
      }
    },
    "/api/v1/cart": {
      "delete": {
        "operationId": "clear_cart_api_v1_cart_delete",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CartOut"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Clear Cart",
        "tags": [
          "cart"
        ]
      },
      "get": {
        "operationId": "get_cart_api_v1_cart_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CartOut"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Cart",
        "tags": [
          "cart"
        ]
      }
    },
    "/api/v1/cart/items": {
      "post": {
        "operationId": "add_item_api_v1_cart_items_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CartItemAddRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CartOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Add Item",
        "tags": [
          "cart"
        ]
      }
    },
    "/api/v1/cart/items/{item_id}": {
      "delete": {
        "operationId": "remove_item_api_v1_cart_items__item_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "item_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Item Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CartOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Remove Item",
        "tags": [
          "cart"
        ]
      },
      "patch": {
        "operationId": "update_item_api_v1_cart_items__item_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "item_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Item Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CartItemUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CartOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Item",
        "tags": [
          "cart"
        ]
      }
    },
    "/api/v1/courier/deliveries": {
      "get": {
        "description": "Every delivery assignment this courier has ever had, regardless\nof outcome (offered-then-rejected, accepted-then-cancelled, or\nfully delivered) \u2014 most recent first. Distinct from\nget_earnings_summary/list_earnings below, which only ever cover\ncompleted, paid-out deliveries.",
        "operationId": "list_deliveries_api_v1_courier_deliveries_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/DeliveryHistoryOut"
                  },
                  "title": "Response List Deliveries Api V1 Courier Deliveries Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Deliveries",
        "tags": [
          "courier"
        ]
      }
    },
    "/api/v1/courier/deliveries/{assignment_id}/delivered": {
      "post": {
        "description": "Completes the order for delivery-mode orders \u2014 see the\ndelivery-mode carve-out in\napp.api.v1.endpoints.orders.update_order_status, which refuses to\nlet branch staff mark a delivery order COMPLETED directly. For a\ncash order, this is also the moment payment_status actually\nbecomes PAID \u2014 cash is collected on handoff, not upfront.",
        "operationId": "mark_delivered_api_v1_courier_deliveries__assignment_id__delivered_post",
        "parameters": [
          {
            "in": "path",
            "name": "assignment_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Assignment Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryAssignmentOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Mark Delivered",
        "tags": [
          "courier"
        ]
      }
    },
    "/api/v1/courier/deliveries/{assignment_id}/picked-up": {
      "post": {
        "operationId": "mark_picked_up_api_v1_courier_deliveries__assignment_id__picked_up_post",
        "parameters": [
          {
            "in": "path",
            "name": "assignment_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Assignment Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryAssignmentOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Mark Picked Up",
        "tags": [
          "courier"
        ]
      }
    },
    "/api/v1/courier/earnings": {
      "get": {
        "operationId": "list_earnings_api_v1_courier_earnings_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/CourierEarningOut"
                  },
                  "title": "Response List Earnings Api V1 Courier Earnings Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Earnings",
        "tags": [
          "courier"
        ]
      }
    },
    "/api/v1/courier/earnings/summary": {
      "get": {
        "operationId": "get_earnings_summary_api_v1_courier_earnings_summary_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourierEarningsSummaryOut"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Earnings Summary",
        "tags": [
          "courier"
        ]
      }
    },
    "/api/v1/courier/location": {
      "post": {
        "operationId": "post_location_api_v1_courier_location_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LocationUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Post Location Api V1 Courier Location Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Post Location",
        "tags": [
          "courier"
        ]
      }
    },
    "/api/v1/courier/offers/current": {
      "get": {
        "operationId": "get_current_offer_api_v1_courier_offers_current_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryOfferOut"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Current Offer",
        "tags": [
          "courier"
        ]
      }
    },
    "/api/v1/courier/offers/{assignment_id}/accept": {
      "post": {
        "operationId": "accept_offer_api_v1_courier_offers__assignment_id__accept_post",
        "parameters": [
          {
            "in": "path",
            "name": "assignment_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Assignment Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryAssignmentOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Accept Offer",
        "tags": [
          "courier"
        ]
      }
    },
    "/api/v1/courier/offers/{assignment_id}/reject": {
      "post": {
        "operationId": "reject_offer_api_v1_courier_offers__assignment_id__reject_post",
        "parameters": [
          {
            "in": "path",
            "name": "assignment_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Assignment Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryAssignmentOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Reject Offer",
        "tags": [
          "courier"
        ]
      }
    },
    "/api/v1/courier/profile": {
      "get": {
        "description": "Read-only for the courier themselves \u2014 shift hours and the\nonline/offline switch are both set by an admin (see\napp.api.v1.endpoints.admin.update_courier_profile), since couriers\nhere are full-time staff on a fixed schedule, not gig workers\npicking their own hours. This just lets a courier's app show what\nan admin has configured for them.",
        "operationId": "get_profile_api_v1_courier_profile_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourierProfileOut"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Profile",
        "tags": [
          "courier"
        ]
      }
    },
    "/api/v1/customer/favorites": {
      "get": {
        "description": "Most-recently-favorited first (see\napp.services.favorites.list_favorite_branches). is_favorited will\nalways be True on every result here \u2014 still computed the normal\nway (bulk favorited_ids) rather than hardcoded, so this stays\ncorrect if that ever changes.",
        "operationId": "list_favorites_api_v1_customer_favorites_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/BranchOut"
                  },
                  "title": "Response List Favorites Api V1 Customer Favorites Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Favorites",
        "tags": [
          "customer"
        ]
      }
    },
    "/api/v1/customer/profile": {
      "get": {
        "description": "Optional profile details \u2014 never populated unless the customer\nactually filled them in, since profile completion is fully\nskippable (see app.models.customer_profile.CustomerProfile).",
        "operationId": "get_profile_api_v1_customer_profile_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerProfileOut"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Profile",
        "tags": [
          "customer"
        ]
      },
      "patch": {
        "description": "Partial update \u2014 only fields actually sent are changed, so the\nclient can save one profile-completion screen at a time (or just\nthe default delivery address from checkout) without resending\neverything else.",
        "operationId": "update_profile_api_v1_customer_profile_patch",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerProfileUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerProfileOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Profile",
        "tags": [
          "customer"
        ]
      }
    },
    "/api/v1/health": {
      "get": {
        "operationId": "health_check_api_v1_health_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Health Check",
        "tags": [
          "health"
        ]
      }
    },
    "/api/v1/health/db": {
      "get": {
        "operationId": "health_check_db_api_v1_health_db_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Health Check Db",
        "tags": [
          "health"
        ]
      }
    },
    "/api/v1/health/redis": {
      "get": {
        "operationId": "health_check_redis_api_v1_health_redis_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Health Check Redis",
        "tags": [
          "health"
        ]
      }
    },
    "/api/v1/merchants": {
      "get": {
        "description": "Other users only see a merchant once it has at least one\nvisible (approved + active) branch; owners always see their own,\nadmins see everything.\n\nPass business_type (\"restaurant\" or \"grocery\") to show just one \u2014\nthe Flutter app's \"Restaurants\" and \"Grocery\" tabs. Applied after\nthe cache lookup, not as part of the cache key, since the\nunderlying cached list already has everything cheaply filterable\nin-memory \u2014 no need for a second cache entry per type.\n\nOnly cached for customers: they can never own a merchant, so the\ncached \"public\" list (merchants with a visible branch) is always\nexactly what they'd get from an uncached query. Suppliers/admins\nalways hit the DB directly, since their view is personalized.",
        "operationId": "list_merchants_api_v1_merchants_get",
        "parameters": [
          {
            "in": "query",
            "name": "business_type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Business Type"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/MerchantOut"
                  },
                  "title": "Response List Merchants Api V1 Merchants Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Merchants",
        "tags": [
          "merchants"
        ]
      },
      "post": {
        "description": "A supplier creates a merchant brand for themselves (a supplier\nmay own more than one). An admin can instead create one on behalf\nof a supplier by passing owner_id.",
        "operationId": "create_merchant_api_v1_merchants_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MerchantCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Merchant",
        "tags": [
          "merchants"
        ]
      }
    },
    "/api/v1/merchants/{merchant_id}": {
      "get": {
        "description": "No visibility filtering on a single merchant lookup (see\n_get_merchant_or_404) \u2014 every caller who can see it at all sees\nthe same thing, so this is always safe to cache.",
        "operationId": "get_merchant_api_v1_merchants__merchant_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "merchant_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Merchant Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Merchant",
        "tags": [
          "merchants"
        ]
      },
      "patch": {
        "description": "Partial \u2014 only fields actually sent are changed.",
        "operationId": "update_merchant_api_v1_merchants__merchant_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "merchant_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Merchant Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MerchantUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Merchant",
        "tags": [
          "merchants"
        ]
      }
    },
    "/api/v1/merchants/{merchant_id}/branches": {
      "get": {
        "description": "Branches for one merchant. Pass lat & lng to sort by distance\n(nearest first) \u2014 customers tap a merchant and see its branches\nthis way. Omit them for an unsorted list.\n\nCached only for the plain (no lat/lng) list, and only when the\ncaller isn't the owner or an admin \u2014 a distance sort is\ncaller-specific by nature (a different origin point every time)\nand not worth caching, and the owner/admin view includes\nunapproved branches the public cache must never contain.",
        "operationId": "list_branches_api_v1_merchants__merchant_id__branches_get",
        "parameters": [
          {
            "in": "path",
            "name": "merchant_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Merchant Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lat",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Lat"
            }
          },
          {
            "in": "query",
            "name": "lng",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Lng"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/BranchOut"
                  },
                  "title": "Response List Branches Api V1 Merchants  Merchant Id  Branches Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Branches",
        "tags": [
          "merchants"
        ]
      },
      "post": {
        "operationId": "create_branch_api_v1_merchants__merchant_id__branches_post",
        "parameters": [
          {
            "in": "path",
            "name": "merchant_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Merchant Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BranchCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BranchOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Branch",
        "tags": [
          "merchants"
        ]
      }
    },
    "/api/v1/notifications/device-tokens": {
      "post": {
        "description": "Any authenticated role can register a device \u2014 customers,\ncouriers, and supplier/manager staff all receive push\nnotifications (see app.services.order_notifications).",
        "operationId": "register_device_token_api_v1_notifications_device_tokens_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeviceTokenRegisterRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Register Device Token",
        "tags": [
          "notifications"
        ]
      }
    },
    "/api/v1/notifications/device-tokens/{token}": {
      "delete": {
        "description": "Call on logout so a shared/reinstalled device stops receiving\nnotifications meant for the account that just signed out. Scoped\nto the caller's own token \u2014 a no-op, not an error, if it doesn't\nmatch one of theirs.",
        "operationId": "unregister_device_token_api_v1_notifications_device_tokens__token__delete",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "title": "Token",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Unregister Device Token",
        "tags": [
          "notifications"
        ]
      }
    },
    "/api/v1/orders": {
      "get": {
        "description": "Customers see their own orders; suppliers/managers see orders\nfor branches they own/manage; admins see everything. Anyone else\n(e.g. a courier, until delivery assignment exists) sees nothing.",
        "operationId": "list_orders_api_v1_orders_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/OrderOut"
                  },
                  "title": "Response List Orders Api V1 Orders Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Orders",
        "tags": [
          "orders"
        ]
      }
    },
    "/api/v1/orders/checkout": {
      "post": {
        "description": "Turns the customer's cart into a placed order: snapshots each\ncart item's current name/price into an OrderItem (so later menu\nedits can't rewrite order history), clears the cart, and starts a\nChapa payment. The order starts PENDING_PAYMENT \u2014 see the webhook\nin app.api.v1.endpoints.payments for how it becomes CONFIRMED.",
        "operationId": "checkout_api_v1_orders_checkout_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckoutRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderWithItemsOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Checkout",
        "tags": [
          "orders"
        ]
      }
    },
    "/api/v1/orders/{order_id}": {
      "get": {
        "operationId": "get_order_api_v1_orders__order_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "order_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Order Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderWithItemsOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Order",
        "tags": [
          "orders"
        ]
      }
    },
    "/api/v1/orders/{order_id}/cancel": {
      "post": {
        "description": "A customer can self-cancel while PENDING_PAYMENT (a Chapa order\nthat never finished paying) or CONFIRMED (paid, but the branch\nhasn't started preparing it yet). Once PREPARING, the kitchen has\nalready started \u2014 only staff can cancel from there (via\nupdate_order_status), same _cancel_order cleanup either way.",
        "operationId": "cancel_order_api_v1_orders__order_id__cancel_post",
        "parameters": [
          {
            "in": "path",
            "name": "order_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Order Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Cancel Order",
        "tags": [
          "orders"
        ]
      }
    },
    "/api/v1/orders/{order_id}/mark-refunded": {
      "post": {
        "description": "Confirms a REFUND_PENDING order's refund was actually completed\nout of band (bank transfer, Chapa dashboard, etc \u2014 see the\nPaymentStatus docstring). Admin-only: this is a finance action, not\nsomething branch staff or the customer self-report.",
        "operationId": "mark_order_refunded_api_v1_orders__order_id__mark_refunded_post",
        "parameters": [
          {
            "in": "path",
            "name": "order_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Order Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Mark Order Refunded",
        "tags": [
          "orders"
        ]
      }
    },
    "/api/v1/orders/{order_id}/reorder": {
      "post": {
        "description": "Re-adds every line from a past order (any status \u2014 even a\ncancelled one) to the customer's current cart, merging into\nwhatever's already there rather than replacing it. Anything that's\nchanged since \u2014 the item removed/marked unavailable, an option\nthat no longer exists, a quantity that's no longer valid for the\nitem \u2014 is silently dropped and reported back in `skipped`, not\na wholesale failure; the customer still gets everything that's\nstill orderable, same as the item-level skip already used when\ncheckout finds a stale line.",
        "operationId": "reorder_order_api_v1_orders__order_id__reorder_post",
        "parameters": [
          {
            "in": "path",
            "name": "order_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Order Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReorderResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Reorder Order",
        "tags": [
          "orders"
        ]
      }
    },
    "/api/v1/orders/{order_id}/review": {
      "post": {
        "description": "One review per order (see the Review model docstring), and only\nonce it's actually COMPLETED \u2014 reviewing an order that was never\nfulfilled (still in progress, or cancelled) isn't meaningful\nfeedback about the branch.",
        "operationId": "create_review_api_v1_orders__order_id__review_post",
        "parameters": [
          {
            "in": "path",
            "name": "order_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Order Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Review",
        "tags": [
          "orders"
        ]
      }
    },
    "/api/v1/orders/{order_id}/status": {
      "patch": {
        "operationId": "update_order_status_api_v1_orders__order_id__status_patch",
        "parameters": [
          {
            "in": "path",
            "name": "order_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Order Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderStatusUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Order Status",
        "tags": [
          "orders"
        ]
      }
    },
    "/api/v1/orders/{order_id}/tracking": {
      "get": {
        "description": "REST snapshot \u2014 the initial load for a tracking screen before\nit opens the WebSocket below for live updates.",
        "operationId": "get_tracking_api_v1_orders__order_id__tracking_get",
        "parameters": [
          {
            "in": "path",
            "name": "order_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Order Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderTrackingOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Tracking",
        "tags": [
          "tracking"
        ]
      }
    },
    "/api/v1/orders/{order_id}/tracking/ws-ticket": {
      "post": {
        "description": "Mints a short-lived, single-use ticket for the WebSocket\nhandshake below \u2014 call this first, over a normal authenticated\nHTTPS request (so the real access token never leaves an\nAuthorization header), then open the WebSocket with\n`?ticket=...`. Checks the caller can actually see this order right\nnow, same as get_tracking \u2014 belt-and-suspenders with the identical\ncheck the WebSocket itself repeats on connect, so a ticket can't\neven be minted for an order the caller has no business watching.",
        "operationId": "create_tracking_ws_ticket_api_v1_orders__order_id__tracking_ws_ticket_post",
        "parameters": [
          {
            "in": "path",
            "name": "order_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Order Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Create Tracking Ws Ticket Api V1 Orders  Order Id  Tracking Ws Ticket Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Tracking Ws Ticket",
        "tags": [
          "tracking"
        ]
      }
    },
    "/api/v1/promo-codes": {
      "get": {
        "description": "Admins see every code, platform-wide and merchant-scoped alike.\nA supplier only sees codes scoped to a merchant they own \u2014 never\nplatform-wide codes they didn't create and can't manage.",
        "operationId": "list_promo_codes_api_v1_promo_codes_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PromoCodeOut"
                  },
                  "title": "Response List Promo Codes Api V1 Promo Codes Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Promo Codes",
        "tags": [
          "promo-codes"
        ]
      },
      "post": {
        "description": "An admin can create a platform-wide code (merchant_id omitted)\nor scope one to any merchant, optionally narrowed to one branch. A\nsupplier must always scope it to a merchant they own \u2014 never\nplatform-wide, and never someone else's merchant \u2014 and may\nlikewise narrow it to one of their own branches.",
        "operationId": "create_promo_code_api_v1_promo_codes_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PromoCodeCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromoCodeOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Promo Code",
        "tags": [
          "promo-codes"
        ]
      }
    },
    "/api/v1/promo-codes/{promo_id}": {
      "patch": {
        "operationId": "update_promo_code_api_v1_promo_codes__promo_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "promo_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Promo Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PromoCodeUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromoCodeOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Promo Code",
        "tags": [
          "promo-codes"
        ]
      }
    },
    "/api/v1/reviews/{review_id}": {
      "patch": {
        "description": "Only the customer who wrote it can edit it \u2014 not staff (see\nreply_to_review for their side of it) and not other customers.",
        "operationId": "update_review_api_v1_reviews__review_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "review_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Review Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Review",
        "tags": [
          "reviews"
        ]
      }
    },
    "/api/v1/reviews/{review_id}/reply": {
      "post": {
        "description": "A single editable reply from the branch's own staff (owner,\nan assigned manager, or an admin) \u2014 same \"who manages this\nbranch\" rule as everywhere else, see\napp.api.v1.endpoints.branches._require_branch_staff. Setting it\nagain overwrites the previous reply rather than appending, since\nthis is a reply slot, not a thread.",
        "operationId": "reply_to_review_api_v1_reviews__review_id__reply_post",
        "parameters": [
          {
            "in": "path",
            "name": "review_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Review Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewReplyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Reply To Review",
        "tags": [
          "reviews"
        ]
      }
    },
    "/api/v1/reviews/{review_id}/visibility": {
      "patch": {
        "description": "Admin-only moderation \u2014 hides (or unhides) a review from the\npublic listing and the average_rating/review_count rollup without\ndeleting it, see the Review model docstring.",
        "operationId": "set_review_visibility_api_v1_reviews__review_id__visibility_patch",
        "parameters": [
          {
            "in": "path",
            "name": "review_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Review Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewVisibilityRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewOut"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Set Review Visibility",
        "tags": [
          "reviews"
        ]
      }
    },
    "/api/v1/uploads/image": {
      "post": {
        "description": "Generic image upload, used by any feature that needs to attach a\nphoto (courier profile, merchant listing, etc.) once those exist.\nNot tied to a specific domain model yet \u2014 callers just get back a\nURL and store it themselves.\n\nValidated twice: the Content-Type header is a cheap first filter,\nbut the real check is Pillow actually decoding the bytes as one of\nthe allowed formats \u2014 a renamed/relabeled non-image file fails\nhere even if it claimed to be a PNG. Size is capped before either\ncheck touches the bytes, by reading at most one byte past the\nlimit rather than the whole stream up front.",
        "operationId": "upload_image_endpoint_api_v1_uploads_image_post",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_upload_image_endpoint_api_v1_uploads_image_post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Upload Image Endpoint",
        "tags": [
          "uploads"
        ]
      }
    },
    "/api/v1/webhooks/chapa": {
      "post": {
        "description": "Chapa POSTs here when a payment's status changes. We don't trust\nthe payload alone \u2014 a valid HMAC signature only proves the request\ncame from Chapa, not that the transaction data in it is current \u2014\nso on a signature match we still independently re-verify via\nchapa_service.verify_payment before marking anything paid, per\nChapa's own documented best practice. Always returns 200 once the\nsignature checks out, even for an order we can't act on, so Chapa\ndoesn't keep retrying (every 10 min for up to 72 hours) for\nsomething that will never resolve.",
        "operationId": "chapa_webhook_api_v1_webhooks_chapa_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Chapa Webhook Api V1 Webhooks Chapa Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Chapa Webhook",
        "tags": [
          "webhooks"
        ]
      }
    }
  },
  "tags": [
    {
      "description": "Liveness/readiness checks \u2014 no auth, not rate-limited.",
      "name": "health"
    },
    {
      "description": "Signup, login, Google Sign-In, PIN reset/change, invited-account activation, add-phone/add-email.",
      "name": "auth"
    },
    {
      "description": "Admin-console operations: invites, courier management, user roster, analytics.",
      "name": "admin"
    },
    {
      "description": "Image upload (courier/merchant photos, etc.).",
      "name": "uploads"
    },
    {
      "description": "Merchant (business/brand) CRUD and discovery.",
      "name": "merchants"
    },
    {
      "description": "Branch browse/search, settings, and full menu management.",
      "name": "branches"
    },
    {
      "description": "The logged-in customer's single shopping cart.",
      "name": "cart"
    },
    {
      "description": "Checkout, order lifecycle, cancellation, reorder, reviews.",
      "name": "orders"
    },
    {
      "description": "Third-party payment-gateway callbacks (Chapa) \u2014 not called by the app directly.",
      "name": "webhooks"
    },
    {
      "description": "Promo code CRUD.",
      "name": "promo-codes"
    },
    {
      "description": "Editing, staff replies, and admin moderation for reviews.",
      "name": "reviews"
    },
    {
      "description": "Courier-side delivery workflow: offers, pickup/delivery, earnings.",
      "name": "courier"
    },
    {
      "description": "Live order tracking: REST snapshot, WebSocket ticket mint, and the WebSocket feed itself.",
      "name": "tracking"
    },
    {
      "description": "Customer-only self-service: favorites, optional profile.",
      "name": "customer"
    },
    {
      "description": "Push-notification device token registration.",
      "name": "notifications"
    }
  ]
}
