1010from models_library .api_schemas_webserver .users import (
1111 MyFunctionPermissionsGet ,
1212 MyPermissionGet ,
13- MyProfileGet ,
14- MyProfilePatch ,
13+ MyPhoneConfirm ,
14+ MyPhoneRegister ,
15+ MyProfileRestGet ,
16+ MyProfileRestPatch ,
1517 MyTokenCreate ,
1618 MyTokenGet ,
1719 TokenPathParams ,
3638
3739@router .get (
3840 "/me" ,
39- response_model = Envelope [MyProfileGet ],
41+ response_model = Envelope [MyProfileRestGet ],
4042)
4143async def get_my_profile (): ...
4244
@@ -45,7 +47,58 @@ async def get_my_profile(): ...
4547 "/me" ,
4648 status_code = status .HTTP_204_NO_CONTENT ,
4749)
48- async def update_my_profile (_body : MyProfilePatch ): ...
50+ async def update_my_profile (_body : MyProfileRestPatch ): ...
51+
52+
53+ @router .post (
54+ "/me/phone:register" ,
55+ description = "Starts the phone registration process" ,
56+ status_code = status .HTTP_202_ACCEPTED ,
57+ responses = {
58+ status .HTTP_202_ACCEPTED : {"description" : "Phone registration initiated" },
59+ status .HTTP_401_UNAUTHORIZED : {"description" : "Authentication required" },
60+ status .HTTP_403_FORBIDDEN : {"description" : "Insufficient permissions" },
61+ status .HTTP_422_UNPROCESSABLE_ENTITY : {
62+ "description" : "Invalid phone number format"
63+ },
64+ },
65+ )
66+ async def my_phone_register (_body : MyPhoneRegister ): ...
67+
68+
69+ @router .post (
70+ "/me/phone:resend" ,
71+ description = "Resends the phone registration code" ,
72+ status_code = status .HTTP_202_ACCEPTED ,
73+ responses = {
74+ status .HTTP_202_ACCEPTED : {"description" : "Phone code resent" },
75+ status .HTTP_400_BAD_REQUEST : {
76+ "description" : "No pending phone registration found"
77+ },
78+ status .HTTP_401_UNAUTHORIZED : {"description" : "Authentication required" },
79+ status .HTTP_403_FORBIDDEN : {"description" : "Insufficient permissions" },
80+ },
81+ )
82+ async def my_phone_resend (): ...
83+
84+
85+ @router .post (
86+ "/me/phone:confirm" ,
87+ description = "Confirms the phone registration" ,
88+ status_code = status .HTTP_204_NO_CONTENT ,
89+ responses = {
90+ status .HTTP_204_NO_CONTENT : {"description" : "Phone registration confirmed" },
91+ status .HTTP_400_BAD_REQUEST : {
92+ "description" : "No pending registration or invalid code"
93+ },
94+ status .HTTP_401_UNAUTHORIZED : {"description" : "Authentication required" },
95+ status .HTTP_403_FORBIDDEN : {"description" : "Insufficient permissions" },
96+ status .HTTP_422_UNPROCESSABLE_ENTITY : {
97+ "description" : "Invalid confirmation code format"
98+ },
99+ },
100+ )
101+ async def my_phone_confirm (_body : MyPhoneConfirm ): ...
49102
50103
51104@router .patch (
0 commit comments