1 line
8.9 KiB
JSON
1 line
8.9 KiB
JSON
{"openapi":"3.1.0","info":{"title":"tournme-be","version":"0.1.0"},"paths":{"/auth/register":{"post":{"tags":["Authentication"],"summary":"Register","description":"Register a new padel center with admin user.","operationId":"register_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/login":{"post":{"tags":["Authentication"],"summary":"Login","description":"Login with email and password.","operationId":"login_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/me":{"get":{"tags":["Authentication"],"summary":"Get Me","description":"Get current user info.","operationId":"get_me_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/courts":{"get":{"tags":["Courts"],"summary":"List Courts","description":"List all courts for the current user's center.","operationId":"list_courts_courts_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"skip","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"active_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Active Only"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourtListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Courts"],"summary":"Create Court","description":"Create a new court.","operationId":"create_court_courts_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourtCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourtResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/courts/{court_id}":{"get":{"tags":["Courts"],"summary":"Get Court","description":"Get a court by ID.","operationId":"get_court_courts__court_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"court_id","in":"path","required":true,"schema":{"type":"string","title":"Court Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourtResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Courts"],"summary":"Update Court","description":"Update a court.","operationId":"update_court_courts__court_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"court_id","in":"path","required":true,"schema":{"type":"string","title":"Court Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourtUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourtResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Courts"],"summary":"Delete Court","description":"Soft delete a court.","operationId":"delete_court_courts__court_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"court_id","in":"path","required":true,"schema":{"type":"string","title":"Court Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"summary":"Health Check","description":"Health check endpoint.","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"CourtCreate":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"court_type":{"anyOf":[{"$ref":"#/components/schemas/CourtType"},{"type":"null"}]},"is_active":{"type":"boolean","title":"Is Active","default":true}},"type":"object","required":["name"],"title":"CourtCreate","description":"Schema for creating a court."},"CourtListResponse":{"properties":{"courts":{"items":{"$ref":"#/components/schemas/CourtResponse"},"type":"array","title":"Courts"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"}},"type":"object","required":["courts","total"],"title":"CourtListResponse","description":"Schema for list of courts."},"CourtResponse":{"properties":{"id":{"type":"string","title":"Id"},"padel_center_id":{"type":"string","title":"Padel Center Id"},"name":{"type":"string","title":"Name"},"court_type":{"anyOf":[{"$ref":"#/components/schemas/CourtType"},{"type":"null"}]},"is_active":{"type":"boolean","title":"Is Active"}},"type":"object","required":["id","padel_center_id","name","court_type","is_active"],"title":"CourtResponse","description":"Schema for court response."},"CourtType":{"type":"string","enum":["indoor","outdoor","covered"],"title":"CourtType","description":"Types of padel courts."},"CourtUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Name"},"court_type":{"anyOf":[{"$ref":"#/components/schemas/CourtType"},{"type":"null"}]},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"CourtUpdate","description":"Schema for updating a court."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"LoginRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","minLength":6,"title":"Password"}},"type":"object","required":["email","password"],"title":"LoginRequest","description":"Login request schema."},"LoginResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"user_id":{"type":"string","title":"User Id"},"center_id":{"type":"string","title":"Center Id"},"center_name":{"type":"string","title":"Center Name"},"role":{"type":"string","title":"Role"}},"type":"object","required":["access_token","user_id","center_id","center_name","role"],"title":"LoginResponse","description":"Login response schema."},"RegisterRequest":{"properties":{"center_name":{"type":"string","maxLength":255,"minLength":2,"title":"Center Name"},"center_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Center Address"},"center_contact_email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Center Contact Email"},"center_contact_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Center Contact Phone"},"center_vat_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Center Vat Number"},"admin_email":{"type":"string","format":"email","title":"Admin Email"},"admin_password":{"type":"string","minLength":8,"title":"Admin Password"}},"type":"object","required":["center_name","admin_email","admin_password"],"title":"RegisterRequest","description":"Register new center and admin user."},"UserResponse":{"properties":{"id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role"},"is_active":{"type":"boolean","title":"Is Active"},"center_id":{"type":"string","title":"Center Id"},"center_name":{"type":"string","title":"Center Name"}},"type":"object","required":["id","email","role","is_active","center_id","center_name"],"title":"UserResponse","description":"User info response."},"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"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}} |