Routes
interfaces.account.routes
Summary
Account REST handlers — thin API entry points for the account resource, wired to openapi.yaml operationIds by the OpenAPI-first router. All handlers delegate to AccountCrudsService via request.app.state.db_resources.
Classes
Functions
create_account
async
Create a new account.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request |
Request
|
Incoming HTTP request; carries app.state.db_resources. |
required |
body |
dict
|
Account payload forwarded to the service. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
AccountDocument |
The created account. |
delete_account
async
Delete an account by id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request |
Request
|
Incoming HTTP request; carries app.state.db_resources. |
required |
id |
str
|
Account id. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Response |
Empty 204 response on successful delete. |
Raises:
| Type | Description |
|---|---|
HTTPException
|
404 when no account matches the id. |
get_account
async
Get an account by id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request |
Request
|
Incoming HTTP request; carries app.state.db_resources. |
required |
id |
str
|
Account id. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
AccountDocument |
The matching account. |
Raises:
| Type | Description |
|---|---|
HTTPException
|
404 when no account matches the id. |
list_accounts
async
List accounts with pagination.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request |
Request
|
Incoming HTTP request; carries app.state.db_resources. |
required |
skip |
int
|
Number of accounts to skip (offset). Defaults to 0. |
0
|
limit |
int
|
Maximum number of accounts to return. Defaults to 100. |
100
|
Returns:
| Type | Description |
|---|---|
|
list[AccountDocument]: Matching accounts from AccountCrudsService.search. |
update_account
async
Update an account by id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request |
Request
|
Incoming HTTP request; carries app.state.db_resources. |
required |
id |
str
|
Account id. |
required |
body |
dict
|
Fields to update, forwarded to the service. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
AccountDocument |
The updated account. |
Raises:
| Type | Description |
|---|---|
HTTPException
|
404 when no account matches the id. |