add user management functionality with OTP verification and consent handling, DI introduced

This commit is contained in:
2025-08-10 10:38:49 +03:00
parent 6a9061a3de
commit 5d80a68b44
30 changed files with 828 additions and 528 deletions

View File

@ -137,9 +137,14 @@ components:
type: boolean
description: Status of the verification
example: true
message:
type: string
description: Confirmation message
example: "OTP verified successfully"
required:
- redirect_url
- ok
- message
AcceptConsentRequest:
type: object
properties:
@ -147,8 +152,14 @@ components:
type: string
description: The consent challenge to accept
example: "challenge123"
phone_number:
type: string
description: Phone number associated with the consent
example: "+79999999999"
maxLength: 15
required:
- consent_challenge
- phone_number
AcceptConsentResponse:
type: object
properties:

View File

@ -5,35 +5,11 @@ info:
servers:
- url: https://api.example.com/v1
paths:
/users:
get:
summary: Get all users
responses:
'200':
description: A list of users
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/User'
post:
summary: Create a new user
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UserCreate'
responses:
'201':
description: User created
content:
application/json:
schema:
$ref: '#/components/schemas/User'
/users/{userId}:
get:
tags:
- users
operationId: getUserById
summary: Get a user by ID
parameters:
- name: userId
@ -47,92 +23,65 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/User'
type: object
properties:
user:
$ref: '#/components/schemas/User'
required:
- user
'404':
description: User not found
put:
summary: Update a user by ID
parameters:
- name: userId
in: path
required: true
schema:
type: string
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: "User not found"
required:
- message
/users:
post:
tags:
- users
operationId: createUser
summary: "Create a new user with phone number"
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UserUpdate'
$ref: '#/components/schemas/UserCreate'
responses:
'200':
description: User updated
description: User created successfully
content:
application/json:
schema:
$ref: '#/components/schemas/User'
'404':
description: User not found
delete:
summary: Delete a user by ID
parameters:
- name: userId
in: path
required: true
schema:
type: string
responses:
'204':
description: User deleted successfully
'404':
description: User not found
components:
schemas:
User:
type: object
properties:
id:
uuid:
type: string
example: "123"
username:
phone_number:
type: string
example: "johndoe"
email:
type: string
format: email
example: "johndoe@example.com"
required:
- id
- username
- email
- uuid
- phone_number
UserCreate:
type: object
properties:
username:
phone_number:
type: string
example: "johndoe"
email:
type: string
format: email
example: "johndoe@example.com"
password:
type: string
format: password
required:
- username
- email
- password
UserUpdate:
type: object
properties:
username:
type: string
example: "john_doe_updated"
email:
type: string
format: email
example: "johnupdated@example.com"
required:
- username
- email
- phone_number