{"openapi":"3.1.0","info":{"title":"Lamba API","description":"Hyper-local retail discovery with semantic search","version":"0.1.0"},"paths":{"/api/v1/auth/signup":{"post":{"tags":["Auth V1"],"summary":"Signup","description":"Register a new customer or merchant.\n\nAccepts email OR phone_number. Generates a 6-digit verification code\nand dispatches it via the appropriate channel (email, or WhatsApp for phone numbers).\nThe account is stored as unverified until /verify is called.","operationId":"signup_api_v1_auth_signup_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignUpRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignUpResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/verify":{"post":{"tags":["Auth V1"],"summary":"Verify","description":"Verify a user's registration with their 6-digit code.\n\nSecurity:\n  - Code expires after 10 minutes\n  - Max 5 attempts before code is invalidated (must request new one)","operationId":"verify_api_v1_auth_verify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/resend-code":{"post":{"tags":["Auth V1"],"summary":"Resend Code","description":"Resend verification code for an unverified account.\nRate limited to 3 per minute to prevent abuse.","operationId":"resend_code_api_v1_auth_resend_code_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResendCodeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/forgot-password":{"post":{"tags":["Auth V1"],"summary":"Forgot Password","description":"Send a password reset code by email, or on WhatsApp for phone accounts.\nThe `email` field accepts an email address or a phone number.\nAlways returns the same response, so it can't be used to discover accounts.","operationId":"forgot_password_api_v1_auth_forgot_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/reset-password":{"post":{"tags":["Auth V1"],"summary":"Reset Password","description":"Reset password using the code sent to email.","operationId":"reset_password_api_v1_auth_reset_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/signin":{"post":{"tags":["Auth V1"],"summary":"Signin","description":"Authenticate a user by email or phone number.\n\nReturns JWT access token on success.\nReturns descriptive error payloads:\n  - 401: \"Invalid Credentials\"\n  - 403: \"Unverified Account\"\n  - 429: too many failed attempts for this account (see signin_throttle)","operationId":"signin_api_v1_auth_signin_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignInRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignInResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/refresh":{"post":{"tags":["Auth V1"],"summary":"Refresh","description":"Exchange a refresh token for a new access token and a new refresh token (rotation).\n\nEvery failure is the same 401 with the same message, so the app can't tell (and doesn't\nneed to) whether the session expired, was revoked, or the account was deleted.","operationId":"refresh_api_v1_auth_refresh_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/logout":{"post":{"tags":["Auth V1"],"summary":"Logout","description":"Revoke the session behind a refresh token. Always 204: unknown or expired tokens are fine.","operationId":"logout_api_v1_auth_logout_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogoutRequest"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/me":{"get":{"tags":["Auth V1"],"summary":"Me","description":"The signed-in user. The app calls this at start-up to find out whether its session is still valid.","operationId":"me_api_v1_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignInUserInfo"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/merchant/market":{"get":{"tags":["Merchant V1"],"summary":"Get Market","description":"Retrieve the user's physical market profile if initialized, or 404 if not found.","operationId":"get_market_api_v1_merchant_market_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketResponse"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["Merchant V1"],"summary":"Create Market","description":"Initialize a physical market profile (PostGIS point integration) and upgrade user to merchant.","operationId":"create_market_api_v1_merchant_market_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/merchant/market/status":{"patch":{"tags":["Merchant V1"],"summary":"Update Market Status","description":"Dynamically toggle the merchant's physical market status (Open / Closed or Revert to Auto).","operationId":"update_market_status_api_v1_merchant_market_status_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketStatusUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/merchant/market/location":{"put":{"tags":["Merchant V1"],"summary":"Update Market Location","description":"Move the store pin and/or edit its structured address. Pin moves up to 200 m and any edit of\narea, street and landmark are free; a bigger move or a different governorate is refused (HTTP\n403, bilingual message) and goes through support. Every accepted change is logged in\nmarket_location_changes. The rules are in app/services/market_location.py.","operationId":"update_market_location_api_v1_merchant_market_location_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketLocationUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/merchant/market/profile":{"get":{"tags":["Merchant V1"],"summary":"Get Market Profile","operationId":"get_market_profile_api_v1_merchant_market_profile_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketProfileResponse"}}}}},"security":[{"HTTPBearer":[]}]},"patch":{"tags":["Merchant V1"],"summary":"Update Market Profile","operationId":"update_market_profile_api_v1_merchant_market_profile_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketProfileUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/merchant/market/employees":{"put":{"tags":["Merchant V1"],"summary":"Update Employees","operationId":"update_employees_api_v1_merchant_market_employees_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmployeesUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/merchant/market/items":{"get":{"tags":["Merchant V1"],"summary":"Get Market Items","description":"Retrieve all global items stocked at the merchant's market (including ones under review).","operationId":"get_market_items_api_v1_merchant_market_items_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/MarketItemDashboardResponse"},"type":"array","title":"Response Get Market Items Api V1 Merchant Market Items Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/merchant/market/stats/value":{"get":{"tags":["Merchant V1"],"summary":"Get Market Inventory Value","description":"Total inventory assets value = Σ (price * stock_count) for merchant's items.","operationId":"get_market_inventory_value_api_v1_merchant_market_stats_value_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/merchant/market/items/{item_id}/stock":{"patch":{"tags":["Merchant V1"],"summary":"Toggle Stock","description":"Toggle stock availability status.","operationId":"toggle_stock_api_v1_merchant_market_items__item_id__stock_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Item Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockToggleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketItemDashboardResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/merchant/market/items/{item_id}":{"patch":{"tags":["Merchant V1"],"summary":"Update Market Item","description":"Update a market item's stock count or price, or rename the product.\n\nRenaming changes the shared catalog row, so it is only allowed for a product this\nmerchant created and no other store stocks. A renamed product is re-classified\n(it may go to review) and re-embedded.","operationId":"update_market_item_api_v1_merchant_market_items__item_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Item Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketItemDashboardResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/merchant/items/check":{"post":{"tags":["Merchant V1"],"summary":"Check Item","description":"Search approved catalog items matching the search string (case-insensitive substring).","operationId":"check_item_api_v1_merchant_items_check_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemCheckRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemCheckResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/merchant/items/link":{"post":{"tags":["Merchant V1"],"summary":"Link Item","description":"Link an existing (approved) catalog item to the merchant's physical market.","operationId":"link_item_api_v1_merchant_items_link_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemLinkRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemLinkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/merchant/items/{global_item_id}/photos":{"post":{"tags":["Merchant V1"],"summary":"Add Item Photo","description":"Add a photo to a catalog product this merchant stocks (merchant-crowdsourced catalog photos).\n\nThe first photo of a product becomes its primary (catalog-wide) photo; later ones are\nextras, up to MAX_PHOTOS_PER_ITEM. Stocking the product is required so merchants can\nonly photograph products they actually carry.","operationId":"add_item_photo_api_v1_merchant_items__global_item_id__photos_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"global_item_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Global Item Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_add_item_photo_api_v1_merchant_items__global_item_id__photos_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/merchant/items/new":{"post":{"tags":["Merchant V1"],"summary":"Create New Item","description":"Create a brand-new catalog product or service and stock it in the merchant's market.\n\nOrder: validate -> classify (restriction + category) -> upload images -> save ->\nenrich + embed. Nothing is uploaded for a request that fails validation.","operationId":"create_new_item_api_v1_merchant_items_new_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_new_item_api_v1_merchant_items_new_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemLinkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/merchant/items/upload-csv/{market_id}":{"post":{"tags":["Merchant V1"],"summary":"Upload Items Csv","description":"Bulk ingest/link inventory via CSV (max MAX_CSV_ROWS rows).\nRequired header: name. Optional: barcode, description, stock_count, price.\n\nRows match existing approved catalog items by barcode, then by exact name.\nUnmatched rows are classified in parallel and created as new catalog items\n(embedded from name + description; LLM search terms are filled later by the\nbatch enrichment job, so the request stays fast).","operationId":"upload_items_csv_api_v1_merchant_items_upload_csv__market_id__post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"market_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Market Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_items_csv_api_v1_merchant_items_upload_csv__market_id__post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/merchant/offers":{"get":{"tags":["Merchant V1"],"summary":"List Offers","operationId":"list_offers_api_v1_merchant_offers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/OfferResponse"},"type":"array","title":"Response List Offers Api V1 Merchant Offers Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["Merchant V1"],"summary":"Create Offer","operationId":"create_offer_api_v1_merchant_offers_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfferCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfferResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/merchant/offers/{offer_id}":{"patch":{"tags":["Merchant V1"],"summary":"Update Offer","operationId":"update_offer_api_v1_merchant_offers__offer_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"offer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Offer Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfferUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfferResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Merchant V1"],"summary":"Delete Offer","operationId":"delete_offer_api_v1_merchant_offers__offer_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"offer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Offer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/merchant/market/item/barcode/{barcode}":{"get":{"tags":["Merchant V1"],"summary":"Lookup Item By Barcode","description":"Find a catalog item by barcode (normalized) and whether this branch already stocks it.","operationId":"lookup_item_by_barcode_api_v1_merchant_market_item_barcode__barcode__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"barcode","in":"path","required":true,"schema":{"type":"string","title":"Barcode"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BarcodeLookupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/merchant/checkout":{"post":{"tags":["Merchant V1"],"summary":"Pos Checkout","description":"Deduct stock counts, save persistent transaction receipts, and alert merchant on depleted inventory.","operationId":"pos_checkout_api_v1_merchant_checkout_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/merchant/checkout/history":{"get":{"tags":["Merchant V1"],"summary":"Get Checkout History","description":"Retrieve all POS receipts processed in the last 14 days for this market.","operationId":"get_checkout_history_api_v1_merchant_checkout_history_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/customer/near-markets":{"get":{"tags":["Customer V1"],"summary":"Get Near Markets","description":"Geospatial Proximity query searching for physical shops/markets within a metric distance radius.\nCasts PostGIS coordinates to Geography to compute high-performance metric distance in kilometers.\nSorted by nearest first, capped at a maximum of 5 shops.","operationId":"get_near_markets_api_v1_customer_near_markets_get","parameters":[{"name":"latitude","in":"query","required":true,"schema":{"type":"number","maximum":90.0,"minimum":-90.0,"description":"Latitude of user","title":"Latitude"},"description":"Latitude of user"},{"name":"longitude","in":"query","required":true,"schema":{"type":"number","maximum":180.0,"minimum":-180.0,"description":"Longitude of user","title":"Longitude"},"description":"Longitude of user"},{"name":"radius_km","in":"query","required":false,"schema":{"type":"number","exclusiveMinimum":0.0,"description":"Proximity radius in kilometers","default":5.0,"title":"Radius Km"},"description":"Proximity radius in kilometers"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/NearMarketResponse"},"title":"Response Get Near Markets Api V1 Customer Near Markets Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customer/nearby-items":{"get":{"tags":["Customer V1"],"summary":"Get Nearby Items","description":"Retrieve featured in-stock items from nearby stores for the explore feed.","operationId":"get_nearby_items_api_v1_customer_nearby_items_get","parameters":[{"name":"latitude","in":"query","required":true,"schema":{"type":"number","maximum":90.0,"minimum":-90.0,"title":"Latitude"}},{"name":"longitude","in":"query","required":true,"schema":{"type":"number","maximum":180.0,"minimum":-180.0,"title":"Longitude"}},{"name":"radius_km","in":"query","required":false,"schema":{"type":"number","maximum":100.0,"minimum":0.1,"default":15.0,"title":"Radius Km"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":12,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/NearbyItemResponse"},"title":"Response Get Nearby Items Api V1 Customer Nearby Items Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customer/market/{market_id}/items":{"get":{"tags":["Customer V1"],"summary":"Get Market Catalog","description":"Retrieve categorized inventory catalog for a target physical shop location.\nReturns all merchant-active items (including zero-stock, so the customer app\ncan render an \"Out of Stock\" badge). The ``in_stock`` flag reflects real\navailability (stock_count > 0) so the UI overlay activates correctly.","operationId":"get_market_catalog_api_v1_customer_market__market_id__items_get","parameters":[{"name":"market_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Market Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/CustomerItemResponse"}},"title":"Response Get Market Catalog Api V1 Customer Market  Market Id  Items Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customer/categories":{"get":{"tags":["Customer V1"],"summary":"Get Categories Tree","description":"Retrieve the entire hierarchical category tree recursively in a single query.","operationId":"get_categories_tree_api_v1_customer_categories_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/CategoryNodeResponse"},"type":"array","title":"Response Get Categories Tree Api V1 Customer Categories Get"}}}}}}},"/api/v1/customer/alerts":{"get":{"tags":["Customer V1"],"summary":"Get Customer Alerts","description":"Get all active and inactive search alerts for the authenticated customer.\nAuto-resolves alerts if matching items now exist in the catalog.","operationId":"get_customer_alerts_api_v1_customer_alerts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/SearchAlertResponse"},"type":"array","title":"Response Get Customer Alerts Api V1 Customer Alerts Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/customer/item/{market_item_id}":{"get":{"tags":["Customer V1"],"summary":"Get Market Item Details","description":"Get detailed customer-facing product information, shop operating parameters,\nmultiple images, and branch staff directories for a single market item.","operationId":"get_market_item_details_api_v1_customer_item__market_item_id__get","parameters":[{"name":"market_item_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Market Item Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketItemDetailsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customer/offers":{"get":{"tags":["Customer V1"],"summary":"Get Customer Offers","description":"Retrieve all active, non-expired offers from the offers table.\nSorted by a dynamic proximity + offer power score.","operationId":"get_customer_offers_api_v1_customer_offers_get","parameters":[{"name":"latitude","in":"query","required":true,"schema":{"type":"number","maximum":90.0,"minimum":-90.0,"description":"Latitude of user","title":"Latitude"},"description":"Latitude of user"},{"name":"longitude","in":"query","required":true,"schema":{"type":"number","maximum":180.0,"minimum":-180.0,"description":"Longitude of user","title":"Longitude"},"description":"Longitude of user"},{"name":"query","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional search term matching product/shop name","title":"Query"},"description":"Optional search term matching product/shop name"},{"name":"offer_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by offer type","title":"Offer Type"},"description":"Filter by offer type"},{"name":"max_distance_km","in":"query","required":false,"schema":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"null"}],"description":"Optional maximum distance filter in km","title":"Max Distance Km"},"description":"Optional maximum distance filter in km"},{"name":"category_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Optional category filter ID","title":"Category Id"},"description":"Optional category filter ID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CustomerSpecialOfferResponse"},"title":"Response Get Customer Offers Api V1 Customer Offers Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customer/rating":{"post":{"tags":["Customer V1"],"summary":"Create Location Verified Rating","description":"Submits or updates a 1-to-5 star rating and optional review for a physical store/market.\nIdentity is taken from the JWT (``user``), NOT the request body, so a caller cannot\nrate on behalf of another customer. Strictly verifies the user's current coordinates\nusing PostGIS ST_Distance to enforce a 50 m geofence around the shop.","operationId":"create_location_verified_rating_api_v1_customer_rating_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RatingCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RatingResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/customer/market/{market_id}/ratings":{"get":{"tags":["Customer V1"],"summary":"Get Market Ratings","description":"Retrieve all verified customer reviews, counts, and calculated average rating for a target market.","operationId":"get_market_ratings_api_v1_customer_market__market_id__ratings_get","parameters":[{"name":"market_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Market Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketRatingSummaryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/customer/search-history":{"get":{"tags":["Customer V1"],"summary":"Get Search History","description":"Retrieve the authenticated customer's recent search history, newest first.","operationId":"get_search_history_api_v1_customer_search_history_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SearchHistoryEntry"},"title":"Response Get Search History Api V1 Customer Search History Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Customer V1"],"summary":"Add Search History","description":"Record a new search to the authenticated customer's history.\nDeduplicates consecutive identical queries (case-insensitive).","operationId":"add_search_history_api_v1_customer_search_history_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchHistoryCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchHistoryEntry"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Customer V1"],"summary":"Clear Search History","description":"Delete all search history entries for the authenticated customer.","operationId":"clear_search_history_api_v1_customer_search_history_delete","security":[{"HTTPBearer":[]}],"responses":{"204":{"description":"Successful Response"}}}},"/api/v1/customer/profile":{"patch":{"tags":["Customer V1"],"summary":"Update Customer Profile","description":"Update the authenticated customer's profile (display name, phone).\nOnly provided (non-None) fields are updated.","operationId":"update_customer_profile_api_v1_customer_profile_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileUpdateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/search/hybrid":{"post":{"tags":["Search V1"],"summary":"Hybrid Search","description":"Hybrid text search: multi-query Qwen3 semantic + Arabic tsvector lexical,\nfused with RRF, refined by the Qwen3 reranker, ordered language-aware.\nSingle-pass tiering: exact → recommendations → SearchAlert.","operationId":"hybrid_search_api_v1_search_hybrid_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HybridSearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HybridSearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/search/image":{"post":{"tags":["Search V1"],"summary":"Image Search","description":"Visual product search — disabled in the current text-only phase.\nReturns 410 Gone. Re-enable by setting settings.enable_image_search=True\nand re-introducing the Gemma-VLM → CLIP pipeline.","operationId":"image_search_api_v1_search_image_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_image_search_api_v1_search_image_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HybridSearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/search/double-check":{"post":{"tags":["Search V1"],"summary":"Double Check Search","description":"Secondary fallback: concat original query + user-supplied details, then\nrun the full expansion → RRF → rerank pipeline on the refined query.","operationId":"double_check_search_api_v1_search_double_check_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DoubleCheckSearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HybridSearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/chat/conversations":{"get":{"tags":["Chat"],"summary":"List Conversations","description":"List all conversations for the current user.","operationId":"list_conversations_api_v1_chat_conversations_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ConversationListItem"},"type":"array","title":"Response List Conversations Api V1 Chat Conversations Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["Chat"],"summary":"Start Conversation","description":"Start a new conversation or return existing one, send first message.","operationId":"start_conversation_api_v1_chat_conversations_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartConversationRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/chat/conversations/{conversation_id}/messages":{"get":{"tags":["Chat"],"summary":"Get Messages","description":"Get all messages in a conversation.","operationId":"get_messages_api_v1_chat_conversations__conversation_id__messages_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conversation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MessageResponse"},"title":"Response Get Messages Api V1 Chat Conversations  Conversation Id  Messages Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Chat"],"summary":"Send Message","description":"Send a message in a conversation.","operationId":"send_message_api_v1_chat_conversations__conversation_id__messages_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conversation Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/chat/push-token":{"post":{"tags":["Chat"],"summary":"Register Push Token","description":"Register Expo push token for the current user.","operationId":"register_push_token_api_v1_chat_push_token_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushTokenRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/reports":{"post":{"tags":["Reports V1"],"summary":"Report Product","operationId":"report_product_api_v1_reports_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/account":{"delete":{"tags":["Account"],"summary":"Delete My Account","operationId":"delete_my_account_api_v1_account_delete","responses":{"204":{"description":"Successful Response"}},"security":[{"HTTPBearer":[]}]}},"/health":{"get":{"summary":"Health Check","description":"Health check endpoint for Docker and load balancers.","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AddressParts":{"properties":{"governorate":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Governorate"},"area":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Area"},"street":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Street"},"landmark":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Landmark"}},"type":"object","title":"AddressParts","description":"Next to the one-line `address` text. `governorate` is a key (balqa, amman, ...): the app shows\nits name in the user's language. Everything else is text exactly as the merchant typed it.\nNone of the fields is guaranteed; a store from before the structured address has no parts."},"BarcodeLookupResponse":{"properties":{"exists_in_branch":{"type":"boolean","title":"Exists In Branch"},"market_item_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Market Item Id"},"global_item_id":{"type":"string","format":"uuid","title":"Global Item Id"},"name":{"type":"string","title":"Name"},"name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name Ar"},"name_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name En"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"category_name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Name Ar"},"category_name_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Name En"},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url"},"price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price"},"stock_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Stock Count"},"barcode":{"type":"string","title":"Barcode"}},"type":"object","required":["exists_in_branch","global_item_id","name","barcode"],"title":"BarcodeLookupResponse"},"Body_add_item_photo_api_v1_merchant_items__global_item_id__photos_post":{"properties":{"image":{"type":"string","format":"binary","title":"Image"}},"type":"object","required":["image"],"title":"Body_add_item_photo_api_v1_merchant_items__global_item_id__photos_post"},"Body_create_new_item_api_v1_merchant_items_new_post":{"properties":{"market_id":{"type":"string","format":"uuid","title":"Market Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"barcode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Barcode"},"stock_count":{"type":"integer","title":"Stock Count","default":0},"price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price"},"category_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Category Id"},"listing_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Listing Type","default":"product"},"attributes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Attributes"},"image":{"type":"string","format":"binary","title":"Image"},"secondary_images":{"items":{"type":"string","format":"binary"},"type":"array","title":"Secondary Images","default":[]}},"type":"object","required":["market_id","name","image"],"title":"Body_create_new_item_api_v1_merchant_items_new_post"},"Body_image_search_api_v1_search_image_post":{"properties":{"image":{"type":"string","format":"binary","title":"Image"},"latitude":{"type":"number","title":"Latitude"},"longitude":{"type":"number","title":"Longitude"},"market_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Market Id"},"limit":{"type":"integer","title":"Limit","default":15}},"type":"object","required":["image","latitude","longitude"],"title":"Body_image_search_api_v1_search_image_post"},"Body_upload_items_csv_api_v1_merchant_items_upload_csv__market_id__post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_items_csv_api_v1_merchant_items_upload_csv__market_id__post"},"CatalogItemMatch":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name Ar"},"name_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name En"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"category_name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Name Ar"},"category_name_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Name En"},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url"}},"type":"object","required":["id","name"],"title":"CatalogItemMatch"},"CategoryNodeResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name Ar"},"name_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name En"},"listing_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Listing Type"},"subcategories":{"items":{"$ref":"#/components/schemas/CategoryNodeResponse"},"type":"array","title":"Subcategories","default":[]}},"type":"object","required":["id","name"],"title":"CategoryNodeResponse"},"CheckoutRequest":{"properties":{"items":{"items":{"$ref":"#/components/schemas/POSCheckoutItem"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"CheckoutRequest"},"ConversationListItem":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"market_id":{"type":"string","format":"uuid","title":"Market Id"},"market_name":{"type":"string","title":"Market Name"},"market_name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Market Name Ar"},"product_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Name"},"product_name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Name Ar"},"last_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Message"},"last_message_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Message At"}},"type":"object","required":["id","market_id","market_name"],"title":"ConversationListItem"},"CustomerItemResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"market_item_id":{"type":"string","format":"uuid","title":"Market Item Id"},"name":{"type":"string","title":"Name"},"name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name Ar"},"name_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name En"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"category_name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Name Ar"},"category_name_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Name En"},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url"},"stock_count":{"type":"integer","title":"Stock Count"},"in_stock":{"type":"boolean","title":"In Stock"},"price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price"}},"type":"object","required":["id","market_item_id","name","stock_count","in_stock"],"title":"CustomerItemResponse"},"CustomerSpecialOfferResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"market_item_id":{"type":"string","format":"uuid","title":"Market Item Id"},"offer_type":{"type":"string","title":"Offer Type"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"},"discount_percentage":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Discount Percentage"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"offer_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Offer Summary"},"power":{"type":"number","title":"Power","default":50.0},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"product_id":{"type":"string","format":"uuid","title":"Product Id"},"product_name":{"type":"string","title":"Product Name"},"product_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Description"},"price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price"},"discounted_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Discounted Price"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"category_name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Name Ar"},"category_name_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Name En"},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url"},"stock_count":{"type":"integer","title":"Stock Count"},"in_stock":{"type":"boolean","title":"In Stock"},"shop_id":{"type":"string","format":"uuid","title":"Shop Id"},"shop_name":{"type":"string","title":"Shop Name"},"shop_address":{"type":"string","title":"Shop Address"},"shop_address_parts":{"anyOf":[{"$ref":"#/components/schemas/AddressParts"},{"type":"null"}]},"latitude":{"type":"number","title":"Latitude"},"longitude":{"type":"number","title":"Longitude"},"shop_is_open":{"type":"boolean","title":"Shop Is Open"},"distance_km":{"type":"number","title":"Distance Km"},"sorting_score":{"type":"number","title":"Sorting Score"}},"type":"object","required":["id","market_item_id","offer_type","is_active","created_at","product_id","product_name","stock_count","in_stock","shop_id","shop_name","shop_address","latitude","longitude","shop_is_open","distance_km","sorting_score"],"title":"CustomerSpecialOfferResponse"},"DoubleCheckSearchRequest":{"properties":{"original_query_text":{"type":"string","minLength":1,"title":"Original Query Text","description":"The original search query"},"user_refined_details":{"type":"string","minLength":1,"title":"User Refined Details","description":"User provided details to refine search"},"latitude":{"type":"number","maximum":90.0,"minimum":-90.0,"title":"Latitude","description":"User's latitude coordinate"},"longitude":{"type":"number","maximum":180.0,"minimum":-180.0,"title":"Longitude","description":"User's longitude coordinate"},"market_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Market Id","description":"Optional market ID to filter results locally"},"listing_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Listing Type","description":"Filter by listing type: 'product' or 'service'"}},"type":"object","required":["original_query_text","user_refined_details","latitude","longitude"],"title":"DoubleCheckSearchRequest"},"EmployeesUpdate":{"properties":{"employees":{"items":{"type":"string"},"type":"array","title":"Employees"}},"type":"object","required":["employees"],"title":"EmployeesUpdate","description":"Replace the entire employees list. At least one employee is required."},"ForgotPasswordRequest":{"properties":{"email":{"type":"string","minLength":3,"title":"Email"}},"type":"object","required":["email"],"title":"ForgotPasswordRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HybridSearchRequest":{"properties":{"query_text":{"type":"string","minLength":1,"title":"Query Text","description":"Natural language search query"},"latitude":{"type":"number","maximum":90.0,"minimum":-90.0,"title":"Latitude","description":"User's latitude coordinate"},"longitude":{"type":"number","maximum":180.0,"minimum":-180.0,"title":"Longitude","description":"User's longitude coordinate"},"market_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Market Id","description":"Optional market ID to filter results locally"},"user_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"User Id","description":"Optional user ID to associate search alerts"},"listing_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Listing Type","description":"Filter by listing type: 'product' or 'service'"},"filters":{"anyOf":[{"$ref":"#/components/schemas/SearchFilters"},{"type":"null"}],"description":"Granular filtering parameters"}},"type":"object","required":["query_text","latitude","longitude"],"title":"HybridSearchRequest"},"HybridSearchResponse":{"properties":{"found":{"type":"boolean","title":"Found"},"action":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action"},"search_mode":{"type":"string","title":"Search Mode","description":"'exact_matches' or 'recommendations'","default":"exact_matches"},"results":{"items":{"$ref":"#/components/schemas/HybridSearchResultItem"},"type":"array","title":"Results","default":[]}},"type":"object","required":["found"],"title":"HybridSearchResponse"},"HybridSearchResultItem":{"properties":{"item_id":{"type":"string","format":"uuid","title":"Item Id"},"market_item_id":{"type":"string","format":"uuid","title":"Market Item Id"},"name":{"type":"string","title":"Name"},"name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name Ar"},"name_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name En"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"category_name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Name Ar"},"category_name_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Name En"},"listing_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Listing Type","default":"product"},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url"},"price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price"},"stock_count":{"type":"integer","title":"Stock Count"},"in_stock":{"type":"boolean","title":"In Stock"},"market_id":{"type":"string","format":"uuid","title":"Market Id"},"market_name":{"type":"string","title":"Market Name"},"market_address":{"type":"string","title":"Market Address"},"market_address_parts":{"anyOf":[{"$ref":"#/components/schemas/AddressParts"},{"type":"null"}]},"latitude":{"type":"number","title":"Latitude"},"longitude":{"type":"number","title":"Longitude"},"market_is_open":{"type":"boolean","title":"Market Is Open"},"distance_km":{"type":"number","title":"Distance Km"},"semantic_score":{"type":"number","title":"Semantic Score"},"proximity_score":{"type":"number","title":"Proximity Score"},"final_score":{"type":"number","title":"Final Score"}},"type":"object","required":["item_id","market_item_id","name","stock_count","in_stock","market_id","market_name","market_address","latitude","longitude","market_is_open","distance_km","semantic_score","proximity_score","final_score"],"title":"HybridSearchResultItem"},"ItemCheckRequest":{"properties":{"item_name":{"type":"string","minLength":1,"title":"Item Name"}},"type":"object","required":["item_name"],"title":"ItemCheckRequest"},"ItemCheckResponse":{"properties":{"exists":{"type":"boolean","title":"Exists"},"matches":{"items":{"$ref":"#/components/schemas/CatalogItemMatch"},"type":"array","title":"Matches"}},"type":"object","required":["exists","matches"],"title":"ItemCheckResponse"},"ItemLinkRequest":{"properties":{"item_id":{"type":"string","format":"uuid","title":"Item Id"},"market_id":{"type":"string","format":"uuid","title":"Market Id"},"stock_count":{"type":"integer","minimum":0.0,"title":"Stock Count","default":0}},"type":"object","required":["item_id","market_id"],"title":"ItemLinkRequest"},"ItemLinkResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"market_item_id":{"type":"string","format":"uuid","title":"Market Item Id"},"stock_count":{"type":"integer","title":"Stock Count"},"moderation_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Moderation Status"}},"type":"object","required":["success","message","market_item_id","stock_count"],"title":"ItemLinkResponse"},"ItemUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"stock_count":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Stock Count"},"price":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Price"}},"type":"object","title":"ItemUpdateRequest"},"LogoutRequest":{"properties":{"refresh_token":{"type":"string","maxLength":200,"minLength":20,"title":"Refresh Token"}},"type":"object","required":["refresh_token"],"title":"LogoutRequest"},"MarketCreate":{"properties":{"latitude":{"type":"number","maximum":90.0,"minimum":-90.0,"title":"Latitude"},"longitude":{"type":"number","maximum":180.0,"minimum":-180.0,"title":"Longitude"},"governorate":{"type":"string","title":"Governorate"},"area":{"type":"string","maxLength":120,"title":"Area"},"street":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}],"title":"Street"},"landmark":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Landmark"},"name":{"type":"string","maxLength":255,"minLength":2,"title":"Name"},"business_nature":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Nature","description":"Type/nature of store business"},"operating_hours":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Operating Hours","description":"Structured weekday operating intervals"},"employee_directory":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Employee Directory","description":"Directory of staff assigned to the branch"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone","description":"Store contact phone number"},"is_currently_open":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Currently Open","description":"Whether the market is open or closed","default":true}},"type":"object","required":["latitude","longitude","governorate","area","name"],"title":"MarketCreate"},"MarketItemDashboardResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"item_id":{"type":"string","format":"uuid","title":"Item Id"},"name":{"type":"string","title":"Name"},"name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name Ar"},"name_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name En"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"category_name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Name Ar"},"category_name_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Name En"},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url"},"stock_count":{"type":"integer","title":"Stock Count"},"in_stock":{"type":"boolean","title":"In Stock"},"price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price"},"moderation_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Moderation Status"}},"type":"object","required":["id","item_id","name","stock_count","in_stock"],"title":"MarketItemDashboardResponse"},"MarketItemDetailsResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"item_id":{"type":"string","format":"uuid","title":"Item Id"},"name":{"type":"string","title":"Name"},"name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name Ar"},"name_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name En"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"category":{"type":"string","title":"Category"},"category_name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Name Ar"},"category_name_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Name En"},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url"},"images":{"items":{"type":"string"},"type":"array","title":"Images","default":[]},"stock_count":{"type":"integer","title":"Stock Count"},"price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price"},"in_stock":{"type":"boolean","title":"In Stock"},"shop":{"$ref":"#/components/schemas/ShopDetails"}},"type":"object","required":["id","item_id","name","category","stock_count","in_stock","shop"],"title":"MarketItemDetailsResponse"},"MarketLocationUpdate":{"properties":{"latitude":{"type":"number","maximum":90.0,"minimum":-90.0,"title":"Latitude"},"longitude":{"type":"number","maximum":180.0,"minimum":-180.0,"title":"Longitude"},"governorate":{"type":"string","title":"Governorate"},"area":{"type":"string","maxLength":120,"title":"Area"},"street":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}],"title":"Street"},"landmark":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Landmark"}},"type":"object","required":["latitude","longitude","governorate","area"],"title":"MarketLocationUpdate","description":"PUT /market/location: the whole location, replaced. What may change is decided by the lock policy."},"MarketProfileResponse":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name Ar"},"contact_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Phone"},"contact_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Email"},"employees":{"items":{"type":"string"},"type":"array","title":"Employees","default":[]},"profile_edited_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Profile Edited At"},"name_edited_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Name Edited At"},"is_name_locked":{"type":"boolean","title":"Is Name Locked","default":false}},"type":"object","title":"MarketProfileResponse"},"MarketProfileUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name Ar"},"contact_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Phone"},"contact_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Email"}},"type":"object","title":"MarketProfileUpdate","description":"Update store name and contact info. The name can be changed once (checked in the endpoint).\nThe location has its own endpoint: PUT /api/v1/merchant/market/location."},"MarketRatingSummaryResponse":{"properties":{"average_score":{"type":"number","title":"Average Score"},"total_reviews_count":{"type":"integer","title":"Total Reviews Count"},"ratings":{"items":{"$ref":"#/components/schemas/RatingDetailResponse"},"type":"array","title":"Ratings"}},"type":"object","required":["average_score","total_reviews_count","ratings"],"title":"MarketRatingSummaryResponse"},"MarketResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"merchant_id":{"type":"string","format":"uuid","title":"Merchant Id"},"name":{"type":"string","title":"Name"},"name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name Ar"},"address":{"type":"string","title":"Address"},"governorate":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Governorate"},"area":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Area"},"street":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Street"},"landmark":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Landmark"},"latitude":{"type":"number","title":"Latitude"},"longitude":{"type":"number","title":"Longitude"},"business_nature":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Nature"},"operating_hours":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Operating Hours"},"employee_directory":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Employee Directory"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"contact_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Phone"},"contact_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Email"},"employees":{"items":{"type":"string"},"type":"array","title":"Employees","default":[]},"profile_edited_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Profile Edited At"},"name_edited_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Name Edited At"},"is_name_locked":{"type":"boolean","title":"Is Name Locked","default":false},"is_currently_open":{"type":"boolean","title":"Is Currently Open"},"is_manual_override":{"type":"boolean","title":"Is Manual Override"},"override_set_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Override Set At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"access_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Access Token"}},"type":"object","required":["id","merchant_id","name","address","latitude","longitude","is_currently_open","is_manual_override","created_at"],"title":"MarketResponse"},"MarketStatusUpdateRequest":{"properties":{"is_currently_open":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Currently Open"},"is_manual_override":{"type":"boolean","title":"Is Manual Override"}},"type":"object","required":["is_manual_override"],"title":"MarketStatusUpdateRequest"},"MessageResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"sender_id":{"type":"string","format":"uuid","title":"Sender Id"},"sender_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Name"},"is_me":{"type":"boolean","title":"Is Me","default":false},"text":{"type":"string","title":"Text"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","sender_id","text","created_at"],"title":"MessageResponse"},"NearMarketResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"merchant_id":{"type":"string","format":"uuid","title":"Merchant Id"},"name":{"type":"string","title":"Name"},"name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name Ar"},"name_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name En"},"address":{"type":"string","title":"Address"},"address_parts":{"anyOf":[{"$ref":"#/components/schemas/AddressParts"},{"type":"null"}]},"latitude":{"type":"number","title":"Latitude"},"longitude":{"type":"number","title":"Longitude"},"distance_km":{"type":"number","title":"Distance Km"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"is_currently_open":{"type":"boolean","title":"Is Currently Open"},"is_manual_override":{"type":"boolean","title":"Is Manual Override"},"override_set_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Override Set At"},"average_rating":{"type":"number","title":"Average Rating","default":0.0},"total_reviews":{"type":"integer","title":"Total Reviews","default":0},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","merchant_id","name","address","latitude","longitude","distance_km","is_currently_open","is_manual_override","created_at"],"title":"NearMarketResponse"},"NearbyItemResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"market_item_id":{"type":"string","format":"uuid","title":"Market Item Id"},"name":{"type":"string","title":"Name"},"name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name Ar"},"name_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name En"},"price":{"type":"number","title":"Price"},"market_id":{"type":"string","format":"uuid","title":"Market Id"},"market_name":{"type":"string","title":"Market Name"},"market_name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Market Name Ar"},"market_name_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Market Name En"},"category_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Name"},"category_name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Name Ar"},"category_name_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Name En"},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url"},"is_in_stock":{"type":"boolean","title":"Is In Stock","default":true}},"type":"object","required":["id","market_item_id","name","price","market_id","market_name"],"title":"NearbyItemResponse"},"OfferCreate":{"properties":{"market_item_id":{"type":"string","format":"uuid","title":"Market Item Id"},"offer_type":{"type":"string","title":"Offer Type"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"}},"type":"object","required":["market_item_id","offer_type","config"],"title":"OfferCreate"},"OfferResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"market_id":{"type":"string","format":"uuid","title":"Market Id"},"market_item_id":{"type":"string","format":"uuid","title":"Market Item Id"},"offer_type":{"type":"string","title":"Offer Type"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"is_active":{"type":"boolean","title":"Is Active"},"starts_at":{"type":"string","format":"date-time","title":"Starts At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"item_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Item Name"},"item_name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Item Name Ar"},"item_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Item Price"},"item_image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Item Image Url"}},"type":"object","required":["id","market_id","market_item_id","offer_type","config","is_active","starts_at","created_at"],"title":"OfferResponse"},"OfferUpdate":{"properties":{"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"}},"type":"object","title":"OfferUpdate"},"POSCheckoutItem":{"properties":{"market_item_id":{"type":"string","format":"uuid","title":"Market Item Id"},"quantity":{"type":"integer","minimum":1.0,"title":"Quantity"}},"type":"object","required":["market_item_id","quantity"],"title":"POSCheckoutItem"},"ProfileUpdateRequest":{"properties":{"full_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Full Name"},"phone_number":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Phone Number"}},"type":"object","title":"ProfileUpdateRequest"},"ProfileUpdateResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"user_type":{"type":"string","title":"User Type"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","user_type","created_at"],"title":"ProfileUpdateResponse"},"PushTokenRequest":{"properties":{"token":{"type":"string","maxLength":255,"minLength":10,"title":"Token"}},"type":"object","required":["token"],"title":"PushTokenRequest"},"RatingCreate":{"properties":{"market_id":{"type":"string","format":"uuid","title":"Market Id","description":"ID of the physical store/market to rate"},"customer_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Customer Id","description":"Ignored — identity taken from the JWT"},"score":{"type":"integer","maximum":5.0,"minimum":1.0,"title":"Score","description":"Rating score from 1 to 5"},"review":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Review","description":"Optional written review comment"},"latitude":{"type":"number","maximum":90.0,"minimum":-90.0,"title":"Latitude","description":"Latitude for location geofence validation"},"longitude":{"type":"number","maximum":180.0,"minimum":-180.0,"title":"Longitude","description":"Longitude for location geofence validation"}},"type":"object","required":["market_id","score","latitude","longitude"],"title":"RatingCreate"},"RatingDetailResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"customer_name":{"type":"string","title":"Customer Name"},"score":{"type":"integer","title":"Score"},"review":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Review"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","customer_name","score","created_at"],"title":"RatingDetailResponse"},"RatingResponse":{"properties":{"status":{"type":"string","title":"Status","description":"Success status message","default":"completed rating"},"stored_at":{"type":"string","format":"date-time","title":"Stored At","description":"Timestamp indicating when the rating was stored"}},"type":"object","required":["stored_at"],"title":"RatingResponse"},"RefreshRequest":{"properties":{"refresh_token":{"type":"string","maxLength":200,"minLength":20,"title":"Refresh Token"}},"type":"object","required":["refresh_token"],"title":"RefreshRequest"},"RefreshResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"refresh_token":{"type":"string","title":"Refresh Token"},"expires_in":{"type":"integer","title":"Expires In"},"user":{"$ref":"#/components/schemas/SignInUserInfo"}},"type":"object","required":["access_token","refresh_token","expires_in","user"],"title":"RefreshResponse"},"ReportCreate":{"properties":{"global_item_id":{"type":"string","format":"uuid","title":"Global Item Id"},"market_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Market Id"},"reason":{"type":"string","enum":["restricted_item","wrong_info","offensive","spam","other"],"title":"Reason"},"details":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Details"}},"type":"object","required":["global_item_id","reason"],"title":"ReportCreate"},"ResendCodeRequest":{"properties":{"user_id":{"type":"string","format":"uuid","title":"User Id"}},"type":"object","required":["user_id"],"title":"ResendCodeRequest"},"ResetPasswordRequest":{"properties":{"email":{"type":"string","minLength":3,"title":"Email"},"code":{"type":"string","maxLength":6,"minLength":6,"title":"Code"},"new_password":{"type":"string","maxLength":128,"minLength":8,"title":"New Password"}},"type":"object","required":["email","code","new_password"],"title":"ResetPasswordRequest"},"SearchAlertResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"query_text":{"type":"string","title":"Query Text"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"latitude":{"type":"number","title":"Latitude"},"longitude":{"type":"number","title":"Longitude"}},"type":"object","required":["id","query_text","is_active","created_at","latitude","longitude"],"title":"SearchAlertResponse"},"SearchFilters":{"properties":{"max_distance_km":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Max Distance Km","description":"Geographic proximity radius limit in kilometers"},"business_nature":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Nature","description":"Shop business nature/classification (e.g. Roastery, Grocery)"},"category_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Category Id","description":"Granular category or subcategory filter"},"in_stock_only":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"In Stock Only","description":"Only return items currently in stock"},"price_min":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Price Min","description":"Minimum item price filter"},"price_max":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Price Max","description":"Maximum item price filter"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City","description":"Physical city refinement filter"}},"type":"object","title":"SearchFilters"},"SearchHistoryCreate":{"properties":{"query_text":{"type":"string","maxLength":500,"minLength":1,"title":"Query Text"},"search_type":{"type":"string","title":"Search Type","default":"text"},"result_count":{"type":"integer","minimum":0.0,"title":"Result Count","default":0}},"type":"object","required":["query_text"],"title":"SearchHistoryCreate","description":"Body payload for POST /search-history (identity comes from the JWT)."},"SearchHistoryEntry":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"query_text":{"type":"string","title":"Query Text"},"search_type":{"type":"string","title":"Search Type"},"result_count":{"type":"integer","title":"Result Count"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","query_text","search_type","result_count","created_at"],"title":"SearchHistoryEntry"},"SendMessageRequest":{"properties":{"text":{"type":"string","maxLength":2000,"minLength":1,"title":"Text"}},"type":"object","required":["text"],"title":"SendMessageRequest"},"ShopDetails":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"address":{"type":"string","title":"Address"},"address_parts":{"anyOf":[{"$ref":"#/components/schemas/AddressParts"},{"type":"null"}]},"latitude":{"type":"number","title":"Latitude"},"longitude":{"type":"number","title":"Longitude"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"business_nature":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Nature"},"operating_hours":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Operating Hours"},"employee_directory":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Employee Directory"},"is_currently_open":{"type":"boolean","title":"Is Currently Open"},"is_manual_override":{"type":"boolean","title":"Is Manual Override"},"override_set_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Override Set At"},"average_rating":{"type":"number","title":"Average Rating","default":0.0},"total_reviews":{"type":"integer","title":"Total Reviews","default":0}},"type":"object","required":["id","name","address","latitude","longitude","is_currently_open","is_manual_override"],"title":"ShopDetails"},"SignInRequest":{"properties":{"email_or_phone":{"type":"string","minLength":3,"title":"Email Or Phone"},"password":{"type":"string","title":"Password"},"client_supports_refresh":{"type":"boolean","title":"Client Supports Refresh","default":false}},"type":"object","required":["email_or_phone","password"],"title":"SignInRequest"},"SignInResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"user":{"$ref":"#/components/schemas/SignInUserInfo"},"refresh_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refresh Token"},"expires_in":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires In"}},"type":"object","required":["access_token","user"],"title":"SignInResponse"},"SignInUserInfo":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"user_type":{"type":"string","title":"User Type"},"verified":{"type":"boolean","title":"Verified"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","user_type","verified","created_at"],"title":"SignInUserInfo"},"SignUpRequest":{"properties":{"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email"},"phone_number":{"anyOf":[{"type":"string","maxLength":20,"minLength":8},{"type":"null"}],"title":"Phone Number"},"password":{"type":"string","maxLength":128,"minLength":8,"title":"Password"},"full_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Full Name"},"user_type":{"$ref":"#/components/schemas/UserType","default":"customer"}},"type":"object","required":["password"],"title":"SignUpRequest","description":"Registration request — requires email OR phone_number (not both empty)."},"SignUpResponse":{"properties":{"user_id":{"type":"string","format":"uuid","title":"User Id"},"message":{"type":"string","title":"Message"},"channel":{"type":"string","title":"Channel"}},"type":"object","required":["user_id","message","channel"],"title":"SignUpResponse"},"StartConversationRequest":{"properties":{"market_id":{"type":"string","format":"uuid","title":"Market Id"},"product_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Product Id"},"message":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Message"}},"type":"object","required":["market_id"],"title":"StartConversationRequest"},"StockToggleRequest":{"properties":{"in_stock":{"type":"boolean","title":"In Stock"}},"type":"object","required":["in_stock"],"title":"StockToggleRequest"},"UserType":{"type":"string","enum":["customer","merchant"],"title":"UserType"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VerifyRequest":{"properties":{"user_id":{"type":"string","format":"uuid","title":"User Id"},"verification_code":{"type":"string","maxLength":6,"minLength":6,"title":"Verification Code"}},"type":"object","required":["user_id","verification_code"],"title":"VerifyRequest"},"VerifyResponse":{"properties":{"verified":{"type":"boolean","title":"Verified"},"message":{"type":"string","title":"Message"}},"type":"object","required":["verified","message"],"title":"VerifyResponse"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}