{"openapi":"3.1.0","info":{"title":"RFM Analyzer","description":"Веб-приложение для RFM-анализа клиентской базы","version":"1.0.0"},"paths":{"/auth/sessions":{"get":{"tags":["auth"],"summary":"List Sessions","operationId":"list_sessions_auth_sessions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/auth/sessions/{session_id}":{"delete":{"tags":["auth"],"summary":"Delete Session","operationId":"delete_session_auth_sessions__session_id__delete","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/register":{"post":{"tags":["auth"],"summary":"Register","description":"Регистрация нового пользователя.","operationId":"register_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserRegister"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/login":{"post":{"tags":["auth"],"summary":"Login","description":"Вход в систему.","operationId":"login_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserLogin"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/refresh":{"post":{"tags":["auth"],"summary":"Refresh","description":"Одноразово ротирует refresh-токен и выдаёт новый короткий access JWT.","operationId":"refresh_auth_refresh_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}}}}},"/auth/logout":{"post":{"tags":["auth"],"summary":"Logout","operationId":"logout_auth_logout_post","responses":{"204":{"description":"Successful Response"}}}},"/auth/profile":{"get":{"tags":["auth"],"summary":"Get Profile","description":"Информация о текущем пользователе.","operationId":"get_profile_auth_profile_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserInfo"}}}}}}},"/auth/change-password":{"post":{"tags":["auth"],"summary":"Change Password","operationId":"change_password_auth_change_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/forgot-password":{"post":{"tags":["auth"],"summary":"Forgot Password","description":"Запрос на сброс пароля.\nСоздаёт токен сброса и отправляет ссылку на email пользователя.","operationId":"forgot_password_auth_forgot_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/reset-password":{"post":{"tags":["auth"],"summary":"Reset Password","description":"Сброс пароля с использованием токена.","operationId":"reset_password_auth_reset_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/health":{"get":{"tags":["rfm"],"summary":"Health Check","description":"Проверка работоспособности сервера.","operationId":"health_check_api_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/ready":{"get":{"tags":["rfm"],"summary":"Readiness","operationId":"readiness_api_ready_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/inspect":{"post":{"tags":["rfm"],"summary":"Inspect Upload","operationId":"inspect_upload_api_inspect_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_inspect_upload_api_inspect_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/segments":{"get":{"tags":["rfm"],"summary":"Get Segments Info","description":"Возвращает описания и рекомендации для всех сегментов.","operationId":"get_segments_info_api_segments_get","parameters":[{"name":"scale","in":"query","required":false,"schema":{"type":"integer","maximum":5,"minimum":3,"description":"Шкала оценок (3 или 5)","default":5,"title":"Scale"},"description":"Шкала оценок (3 или 5)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/results":{"get":{"tags":["rfm"],"summary":"Results Page","operationId":"results_page_api_results_get","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":100000,"minimum":1,"default":50,"title":"Per Page"}},{"name":"segment","in":"query","required":false,"schema":{"type":"string","maxLength":200,"default":"","title":"Segment"}},{"name":"search","in":"query","required":false,"schema":{"type":"string","maxLength":500,"default":"","title":"Search"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"enum":["customer_id","recency_days","frequency","monetary","r_score","f_score","m_score","rfm_code","segment"],"type":"string"},{"type":"null"}],"title":"Sort By"}},{"name":"sort_dir","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"asc","title":"Sort Dir"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedRFMResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/upload":{"post":{"tags":["rfm"],"summary":"Upload File","description":"Загрузка файла с транзакциями и выполнение RFM-анализа.\n\nПоддерживаемые форматы: CSV, XLSX.\nОжидаемые колонки: customer_id, amount и transaction_date или payment_count.\n\nПараметры:\n- method: \"quantile\" (по умолчанию) или \"fixed\"\n- thresholds_json: JSON с границами для fixed-метода (RFMThresholds)\n- page: номер страницы (по умолчанию 1)\n- per_page: записей на странице (по умолчанию 50, макс. 100000)\n\nЕсли файл не передан, используются кешированные результаты для текущего пользователя.","operationId":"upload_file_api_upload_post","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Номер страницы","default":1,"title":"Page"},"description":"Номер страницы"},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":100000,"minimum":1,"description":"Записей на странице","default":50,"title":"Per Page"},"description":"Записей на странице"}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_file_api_upload_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedRFMResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Entity"},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Request Entity Too Large"}}}},"/api/analyze":{"post":{"tags":["rfm"],"summary":"Analyze With Params","description":"Загрузка файла с параметрами RFM-анализа.\n\nПоддерживаемые форматы: CSV, XLSX.\nОжидаемые колонки: customer_id, amount и transaction_date или payment_count.\n\nПараметры:\n- method: \"quantile\" (по умолчанию) или \"fixed\"\n- thresholds_json: JSON с границами для fixed-метода (RFMThresholds)\n- page, per_page: пагинация","operationId":"analyze_with_params_api_analyze_post","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Номер страницы","default":1,"title":"Page"},"description":"Номер страницы"},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":100000,"minimum":1,"description":"Записей на странице","default":50,"title":"Per Page"},"description":"Записей на странице"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_analyze_with_params_api_analyze_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedRFMResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Entity"},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Request Entity Too Large"}}}},"/api/demo":{"get":{"tags":["rfm"],"summary":"Demo Data","description":"Загрузка демо-данных для авторизованных пользователей с активной подпиской.\nВыполняет RFM-анализ на встроенном sample_transactions.csv\nи сохраняет результат в кеш пользователя.","operationId":"demo_data_api_demo_get","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Номер страницы","default":1,"title":"Page"},"description":"Номер страницы"},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":100000,"minimum":1,"description":"Записей на странице","default":50,"title":"Per Page"},"description":"Записей на странице"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedRFMResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Entity"}}}},"/api/export":{"get":{"tags":["rfm"],"summary":"Export Results","operationId":"export_results_api_export_get","parameters":[{"name":"fmt","in":"query","required":false,"schema":{"type":"string","description":"Формат экспорта: csv или xlsx","default":"csv","title":"Fmt"},"description":"Формат экспорта: csv или xlsx"},{"name":"segment","in":"query","required":false,"schema":{"type":"string","maxLength":200,"default":"","title":"Segment"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/guest/inspect":{"post":{"tags":["guest"],"summary":"Inspect Guest Upload","operationId":"inspect_guest_upload_api_guest_inspect_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_inspect_guest_upload_api_guest_inspect_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/guest/demo":{"get":{"tags":["guest"],"summary":"Guest Demo Data","description":"Публичный эндпоинт для демо-данных (без авторизации).\nВыполняет RFM-анализ на встроенном sample_transactions.csv.","operationId":"guest_demo_data_api_guest_demo_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedRFMResponse"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/guest/upload":{"post":{"tags":["guest"],"summary":"Guest Upload File","description":"Публичный эндпоинт для гостевого режима (без авторизации).\n\n- Выполняет RFM-анализ загруженного файла\n- Возвращает максимум 10 записей\n- Не сохраняет результаты в БД (нет кеша)\n- Не требует токена авторизации","operationId":"guest_upload_file_api_guest_upload_post","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Номер страницы","default":1,"title":"Page"},"description":"Номер страницы"},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":10,"minimum":1,"description":"Максимум 10 записей для гостя","default":10,"title":"Per Page"},"description":"Максимум 10 записей для гостя"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_guest_upload_file_api_guest_upload_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedRFMResponse"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unprocessable Entity"},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Request Entity Too Large"}}}},"/api/enterprise/segment-templates":{"get":{"tags":["enterprise"],"summary":"Segment Templates","operationId":"segment_templates_api_enterprise_segment_templates_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/enterprise/segment-profiles/validate":{"post":{"tags":["enterprise"],"summary":"Validate Profile","operationId":"validate_profile_api_enterprise_segment_profiles_validate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentProfileInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/enterprise/segment-profiles":{"get":{"tags":["enterprise"],"summary":"List Profiles","operationId":"list_profiles_api_enterprise_segment_profiles_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["enterprise"],"summary":"Create Profile","operationId":"create_profile_api_enterprise_segment_profiles_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentProfileInput"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/enterprise/segment-profiles/{profile_id}":{"put":{"tags":["enterprise"],"summary":"Update Profile","operationId":"update_profile_api_enterprise_segment_profiles__profile_id__put","parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"integer","title":"Profile Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentProfileInput"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["enterprise"],"summary":"Delete Profile","operationId":"delete_profile_api_enterprise_segment_profiles__profile_id__delete","parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"integer","title":"Profile Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/enterprise/api-keys":{"get":{"tags":["enterprise"],"summary":"List Api Keys","operationId":"list_api_keys_api_enterprise_api_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["enterprise"],"summary":"Create Api Key","operationId":"create_api_key_api_enterprise_api_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/enterprise/api-keys/{key_id}":{"delete":{"tags":["enterprise"],"summary":"Revoke Api Key","operationId":"revoke_api_key_api_enterprise_api_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"integer","title":"Key Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analyze":{"post":{"tags":["public-api-v1"],"summary":"Analyze File","operationId":"analyze_file_api_v1_analyze_post","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_analyze_file_api_v1_analyze_post"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analyze/json":{"post":{"tags":["public-api-v1"],"summary":"Analyze Json","operationId":"analyze_json_api_v1_analyze_json_post","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiJsonAnalysisRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}":{"get":{"tags":["public-api-v1"],"summary":"Job Status","operationId":"job_status_api_v1_jobs__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}/results":{"get":{"tags":["public-api-v1"],"summary":"Job Results","operationId":"job_results_api_v1_jobs__job_id__results_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":10000,"minimum":1,"default":50,"title":"Per Page"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs/{job_id}/export":{"get":{"tags":["public-api-v1"],"summary":"Job Export","operationId":"job_export_api_v1_jobs__job_id__export_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"fmt","in":"query","required":false,"schema":{"type":"string","default":"csv","title":"Fmt"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/usage":{"get":{"tags":["public-api-v1"],"summary":"Usage","operationId":"usage_api_v1_usage_get","parameters":[{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/request-logs":{"get":{"tags":["public-api-v1"],"summary":"Request Logs","operationId":"request_logs_api_v1_request_logs_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/payment/create":{"post":{"tags":["payment"],"summary":"Create Payment Endpoint","description":"Создаёт платёж в ЮKassa для оформления подписки.\n\nВозвращает URL для редиректа на страницу оплаты ЮKassa.","operationId":"create_payment_endpoint_payment_create_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/PaymentCreateRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentCreateResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/payment/webhook":{"post":{"tags":["payment"],"summary":"Payment Webhook","description":"Webhook для приёма уведомлений от ЮKassa.\n\nЮKassa присылает сюда события:\n- payment.succeeded\n- payment.canceled\n- payment.waiting_for_capture","operationId":"payment_webhook_payment_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/payment/status":{"get":{"tags":["payment"],"summary":"Get Payment Status","description":"Проверяет статус платежа.\n\nСначала проверяет локальный статус в БД.\nЕсли платёж в статусе pending — делает запрос в ЮKassa для обновления.","operationId":"get_payment_status_payment_status_get","parameters":[{"name":"payment_id","in":"query","required":true,"schema":{"type":"string","description":"ID платежа в нашей системе","title":"Payment Id"},"description":"ID платежа в нашей системе"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/payment/cancel":{"post":{"tags":["payment"],"summary":"Cancel Subscription Endpoint","description":"Отменяет подписку пользователя.\nДоступ сохраняется до конца оплаченного периода.","operationId":"cancel_subscription_endpoint_payment_cancel_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/payment/subscription":{"get":{"tags":["payment"],"summary":"Get Subscription Endpoint","description":"Возвращает информацию о подписке текущего пользователя.","operationId":"get_subscription_endpoint_payment_subscription_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionInfo"}}}}}}},"/admin/me":{"get":{"tags":["admin"],"summary":"Admin Me","operationId":"admin_me_admin_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/users":{"get":{"tags":["admin"],"summary":"List Users","operationId":"list_users_admin_users_get","parameters":[{"name":"search","in":"query","required":false,"schema":{"type":"string","maxLength":200,"default":"","title":"Search"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Per Page"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/users/{user_id}":{"patch":{"tags":["admin"],"summary":"Update User","operationId":"update_user_admin_users__user_id__patch","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["admin"],"summary":"Delete User","operationId":"delete_user_admin_users__user_id__delete","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/articles":{"get":{"tags":["articles"],"summary":"Public Articles","operationId":"public_articles_api_articles_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/articles/{slug}":{"get":{"tags":["articles"],"summary":"Public Article","operationId":"public_article_api_articles__slug__get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/articles":{"get":{"tags":["articles"],"summary":"Admin Articles","operationId":"admin_articles_admin_articles_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["articles"],"summary":"Create Article","operationId":"create_article_admin_articles_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleData"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/articles/{article_id}":{"put":{"tags":["articles"],"summary":"Update Article","operationId":"update_article_admin_articles__article_id__put","parameters":[{"name":"article_id","in":"path","required":true,"schema":{"type":"integer","title":"Article Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleData"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["articles"],"summary":"Delete Article","operationId":"delete_article_admin_articles__article_id__delete","parameters":[{"name":"article_id","in":"path","required":true,"schema":{"type":"integer","title":"Article Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/article-images":{"post":{"tags":["articles"],"summary":"Upload Image","operationId":"upload_image_admin_article_images_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_image_admin_article_images_post"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/media/articles/{filename}":{"get":{"tags":["articles"],"summary":"Image File","operationId":"image_file_media_articles__filename__get","parameters":[{"name":"filename","in":"path","required":true,"schema":{"type":"string","title":"Filename"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/articles":{"get":{"summary":"Articles Page","operationId":"articles_page_articles_head","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"head":{"summary":"Articles Page","operationId":"articles_page_articles_head","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/articles/{slug}":{"head":{"summary":"Article Page","operationId":"article_page_articles__slug__head","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Article Page","operationId":"article_page_articles__slug__head","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sitemap.xml":{"get":{"summary":"Sitemap","operationId":"sitemap_sitemap_xml_head","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"head":{"summary":"Sitemap","operationId":"sitemap_sitemap_xml_head","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/{full_path}":{"head":{"summary":"Serve Frontend","description":"Раздача HTML-страниц фронтенда.","operationId":"serve_frontend__full_path__head","parameters":[{"name":"full_path","in":"path","required":true,"schema":{"type":"string","title":"Full Path"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Serve Frontend","description":"Раздача HTML-страниц фронтенда.","operationId":"serve_frontend__full_path__head","parameters":[{"name":"full_path","in":"path","required":true,"schema":{"type":"string","title":"Full Path"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"ApiJsonAnalysisRequest":{"properties":{"transactions":{"items":{"$ref":"#/components/schemas/ApiTransaction"},"type":"array","minItems":1,"title":"Transactions"},"method":{"type":"string","title":"Method","default":"quantile"},"scale":{"type":"integer","title":"Scale","default":5},"thresholds":{"anyOf":[{"$ref":"#/components/schemas/RFMThresholds"},{"type":"null"}]},"segment_profile_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Segment Profile Id"},"webhook_url":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Webhook Url"}},"type":"object","required":["transactions"],"title":"ApiJsonAnalysisRequest"},"ApiKeyCreate":{"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"}},"type":"object","required":["name"],"title":"ApiKeyCreate"},"ApiTransaction":{"properties":{"customer_id":{"type":"string","maxLength":500,"minLength":1,"title":"Customer Id"},"transaction_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transaction Date"},"amount":{"type":"number","title":"Amount"},"payment_count":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Payment Count"}},"type":"object","required":["customer_id","amount"],"title":"ApiTransaction"},"ArticleData":{"properties":{"author":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Author"},"author_first_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Author First Name"},"author_last_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Author Last Name"},"author_bio":{"anyOf":[{"type":"string","maxLength":3000},{"type":"null"}],"title":"Author Bio"},"author_photo":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Author Photo"},"seo_title":{"anyOf":[{"type":"string","maxLength":240},{"type":"null"}],"title":"Seo Title"},"seo_description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Seo Description"},"content_format":{"type":"string","enum":["text","html"],"title":"Content Format","default":"text"},"title":{"type":"string","maxLength":240,"minLength":2,"title":"Title"},"slug":{"type":"string","maxLength":240,"minLength":2,"title":"Slug"},"excerpt":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Excerpt"},"content":{"type":"string","maxLength":100000,"minLength":1,"title":"Content"},"is_published":{"type":"boolean","title":"Is Published","default":false}},"type":"object","required":["title","slug","content"],"title":"ArticleData"},"Body_analyze_file_api_v1_analyze_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"method":{"type":"string","title":"Method","default":"quantile"},"scale":{"type":"integer","title":"Scale","default":5},"thresholds_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thresholds Json"},"segment_profile_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Segment Profile Id"},"column_mapping_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Column Mapping Json"},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url"}},"type":"object","required":["file"],"title":"Body_analyze_file_api_v1_analyze_post"},"Body_analyze_with_params_api_analyze_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"method":{"type":"string","title":"Method","default":"quantile"},"thresholds_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thresholds Json"},"column_mapping_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Column Mapping Json"},"scale":{"type":"integer","title":"Scale","default":5},"segment_profile_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Segment Profile Id"}},"type":"object","required":["file"],"title":"Body_analyze_with_params_api_analyze_post"},"Body_guest_upload_file_api_guest_upload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"method":{"type":"string","title":"Method","default":"quantile"},"thresholds_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thresholds Json"},"column_mapping_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Column Mapping Json"},"scale":{"type":"integer","title":"Scale","default":5}},"type":"object","required":["file"],"title":"Body_guest_upload_file_api_guest_upload_post"},"Body_inspect_guest_upload_api_guest_inspect_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_inspect_guest_upload_api_guest_inspect_post"},"Body_inspect_upload_api_inspect_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_inspect_upload_api_inspect_post"},"Body_upload_file_api_upload_post":{"properties":{"file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"File"},"method":{"type":"string","title":"Method","default":"quantile"},"thresholds_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thresholds Json"},"column_mapping_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Column Mapping Json"},"scale":{"type":"integer","title":"Scale","default":5},"segment_profile_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Segment Profile Id"}},"type":"object","title":"Body_upload_file_api_upload_post"},"Body_upload_image_admin_article_images_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_image_admin_article_images_post"},"ChangePasswordRequest":{"properties":{"current_password":{"type":"string","title":"Current Password"},"new_password":{"type":"string","title":"New Password"}},"type":"object","required":["current_password","new_password"],"title":"ChangePasswordRequest"},"ErrorResponse":{"properties":{"detail":{"type":"string","title":"Detail"}},"type":"object","required":["detail"],"title":"ErrorResponse"},"ForgotPasswordRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"ForgotPasswordRequest"},"ForgotPasswordResponse":{"properties":{"message":{"type":"string","title":"Message"}},"type":"object","required":["message"],"title":"ForgotPasswordResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"PaginatedRFMResponse":{"properties":{"total_customers":{"type":"integer","title":"Total Customers"},"page":{"type":"integer","title":"Page"},"per_page":{"type":"integer","title":"Per Page"},"total_pages":{"type":"integer","title":"Total Pages"},"results":{"items":{"$ref":"#/components/schemas/RFMResult"},"type":"array","title":"Results"},"segments_summary":{"additionalProperties":{"type":"integer"},"type":"object","title":"Segments Summary"},"is_guest":{"type":"boolean","title":"Is Guest","default":false}},"type":"object","required":["total_customers","page","per_page","total_pages","results","segments_summary"],"title":"PaginatedRFMResponse","description":"Ответ с пагинацией для RFM-анализа."},"PaymentCreateRequest":{"properties":{"plan":{"anyOf":[{"type":"string","enum":["premium","enterprise"]},{"type":"null"}],"title":"Plan"}},"type":"object","title":"PaymentCreateRequest"},"PaymentCreateResponse":{"properties":{"confirmation_url":{"type":"string","title":"Confirmation Url"},"payment_id":{"type":"string","title":"Payment Id"}},"type":"object","required":["confirmation_url","payment_id"],"title":"PaymentCreateResponse","description":"Ответ на запрос создания платежа."},"PaymentStatusResponse":{"properties":{"payment_id":{"type":"string","title":"Payment Id"},"status":{"type":"string","title":"Status"},"amount":{"type":"number","title":"Amount"},"currency":{"type":"string","title":"Currency","default":"RUB"},"paid_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paid At"}},"type":"object","required":["payment_id","status","amount"],"title":"PaymentStatusResponse","description":"Статус платежа."},"RFMResult":{"properties":{"customer_id":{"type":"string","title":"Customer Id"},"recency_days":{"type":"integer","title":"Recency Days"},"frequency":{"type":"integer","title":"Frequency"},"monetary":{"type":"number","title":"Monetary"},"r_score":{"type":"integer","title":"R Score"},"f_score":{"type":"integer","title":"F Score"},"m_score":{"type":"integer","title":"M Score"},"rfm_code":{"type":"string","title":"Rfm Code"},"segment":{"type":"string","title":"Segment"}},"type":"object","required":["customer_id","recency_days","frequency","monetary","r_score","f_score","m_score","rfm_code","segment"],"title":"RFMResult"},"RFMThresholds":{"properties":{"r_bins":{"items":{"type":"number"},"type":"array","title":"R Bins"},"f_bins":{"items":{"type":"number"},"type":"array","title":"F Bins"},"m_bins":{"items":{"type":"number"},"type":"array","title":"M Bins"},"scale":{"type":"integer","title":"Scale","default":5}},"type":"object","required":["r_bins","f_bins","m_bins"],"title":"RFMThresholds","description":"Фиксированные границы для шкалирования R, F, M.\n\nДля шкалы 5 (по умолчанию):\n    Каждый список содержит 5 значений — верхние границы для баллов 5,4,3,2,1.\n    Значения выше последней границы получают минимальный балл (1 для R, 5 для F/M).\n\n    Пример для R (дни):\n        r_bins = [7, 30, 90, 180, 365]\n        означает:\n        - 0-7 дней → 5 баллов\n        - 8-30 дней → 4 балла\n        - 31-90 дней → 3 балла\n        - 91-180 дней → 2 балла\n        - 181-365 дней → 1 балл\n        - более 365 дней → 1 балл\n\n    Пример для F (кол-во покупок):\n        f_bins = [1, 2, 4, 9, 20]\n        означает:\n        - 0-1 покупок → 1 балл\n        - 2 покупки → 2 балла\n        - 3-4 покупки → 3 балла\n        - 5-9 покупок → 4 балла\n        - 10-20 покупок → 5 баллов\n        - более 20 покупок → 5 баллов\n\nДля шкалы 3:\n    Каждый список содержит 3 значения — верхние границы для баллов 3,2,1."},"ResetPasswordRequest":{"properties":{"token":{"type":"string","title":"Token"},"new_password":{"type":"string","title":"New Password"}},"type":"object","required":["token","new_password"],"title":"ResetPasswordRequest"},"SegmentProfileInput":{"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name"},"scale":{"type":"integer","title":"Scale","default":5},"rules":{"items":{"$ref":"#/components/schemas/SegmentRuleInput"},"type":"array","maxItems":50,"minItems":1,"title":"Rules"},"is_active":{"type":"boolean","title":"Is Active","default":false}},"type":"object","required":["name","rules"],"title":"SegmentProfileInput"},"SegmentRuleInput":{"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name"},"priority":{"type":"integer","maximum":1000.0,"minimum":1.0,"title":"Priority"},"r_min":{"type":"integer","title":"R Min","default":1},"r_max":{"type":"integer","title":"R Max","default":5},"f_min":{"type":"integer","title":"F Min","default":1},"f_max":{"type":"integer","title":"F Max","default":5},"m_min":{"type":"integer","title":"M Min","default":1},"m_max":{"type":"integer","title":"M Max","default":5},"color":{"type":"string","maxLength":20,"title":"Color","default":"#64748b"},"description":{"type":"string","maxLength":1000,"title":"Description","default":""},"actions":{"type":"string","maxLength":2000,"title":"Actions","default":""},"campaign_goal":{"type":"string","maxLength":1000,"title":"Campaign Goal","default":""},"campaign_mechanic":{"type":"string","maxLength":2000,"title":"Campaign Mechanic","default":""},"campaign_message":{"type":"string","maxLength":4000,"title":"Campaign Message","default":""},"enabled":{"type":"boolean","title":"Enabled","default":true},"rfm_codes":{"items":{"type":"string"},"type":"array","maxItems":125,"title":"Rfm Codes"}},"type":"object","required":["name","priority"],"title":"SegmentRuleInput"},"SubscriptionInfo":{"properties":{"status":{"type":"string","title":"Status"},"has_access":{"type":"boolean","title":"Has Access","default":false},"current_period_start":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Period Start"},"current_period_end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Period End"},"price":{"type":"number","title":"Price","default":0.0},"currency":{"type":"string","title":"Currency","default":"RUB"},"plan":{"type":"string","title":"Plan","default":"demo"},"features":{"items":{"type":"string"},"type":"array","title":"Features","default":[]}},"type":"object","required":["status"],"title":"SubscriptionInfo","description":"Информация о подписке пользователя."},"TokenResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"expires_in":{"type":"integer","title":"Expires In","default":900}},"type":"object","required":["access_token"],"title":"TokenResponse"},"UserInfo":{"properties":{"id":{"type":"integer","title":"Id"},"email":{"type":"string","title":"Email"},"username":{"type":"string","title":"Username"}},"type":"object","required":["id","email","username"],"title":"UserInfo"},"UserLogin":{"properties":{"username":{"type":"string","title":"Username"},"password":{"type":"string","title":"Password"}},"type":"object","required":["username","password"],"title":"UserLogin"},"UserRegister":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"username":{"type":"string","title":"Username"},"password":{"type":"string","title":"Password"},"consent":{"type":"boolean","title":"Consent","default":false}},"type":"object","required":["email","username","password"],"title":"UserRegister"},"UserUpdate":{"properties":{"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username"},"admin_comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Admin Comment"},"subscription_status":{"anyOf":[{"type":"string","enum":["none","active","cancelled","expired"]},{"type":"null"}],"title":"Subscription Status"},"current_period_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Current Period End"},"plan":{"anyOf":[{"type":"string","enum":["demo","premium","enterprise"]},{"type":"null"}],"title":"Plan"}},"type":"object","title":"UserUpdate"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}