Files
state-corp-backend/docs/implementation/contract-drafts.md
Aleksandr Meshchryakov e61f92200d
All checks were successful
CI/CD Pipeline / Code Quality Checks (pull_request) Successful in 2m11s
CI/CD Pipeline / Run Tests (pull_request) Successful in 4m32s
CI/CD Pipeline / Build and Push Dev Images (pull_request) Has been skipped
CI/CD Pipeline / Deploy Dev via Compose (pull_request) Has been skipped
CI/CD Pipeline / Code Quality Checks (push) Successful in 1m20s
CI/CD Pipeline / Run Tests (push) Successful in 3m21s
CI/CD Pipeline / Build and Push Dev Images (push) Has been skipped
CI/CD Pipeline / Deploy Dev via Compose (push) Has been skipped
fix(user): remove email from accounts
2026-10-01 10:20:01 +02:00

100 lines
2.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Контрактные черновики (Pass 1 draft)
## Конвенции ответов upload (F-2..F-6)
### Success (queued/async)
```json
{
"upload_id": "uuid",
"form": "f2",
"report_year": 2026,
"report_quarter": 1,
"report_period_display": "I квартал 2026",
"status": "queued",
"job_id": "uuid",
"created_at": "2026-04-14T10:22:00+03:00"
}
```
### Success (sync, может быть без job_id)
```json
{
"upload_id": "uuid",
"form": "f2",
"report_year": 2026,
"report_quarter": 1,
"report_period_display": "I квартал 2026",
"status": "done",
"created_at": "2026-04-14T10:22:00+03:00",
"result": {
"batch_id": 123,
"loaded_count": 10,
"skipped_count": 2,
"errors": []
}
}
```
### Error (валидация multipart)
```json
{
"error_code": "validation_error",
"error_message": "Validation failed",
"details": [
{
"field": "report_year",
"code": "invalid",
"message": "report_year is required"
},
{
"field": "file",
"code": "invalid_file_type",
"message": "Unsupported file extension"
}
]
}
```
## users/me contract (ожидаемый)
```json
{
"id": 1,
"username": "admin",
"phone": "+79990000000",
"is_active": true,
"role": "admin",
"role_label": "Администратор системы",
"capabilities": {
"can_access_admin_page": false
},
"profile": {
"first_name": "Администратор",
"middle_name": "",
"last_name": "",
"full_name": "Администратор"
}
}
```
## Organizations list contract (expected fields)
```json
{
"id": "uuid",
"short_name": "АО «Альфа»",
"full_name": "Акционерное общество Альфа",
"corporation_scope": ["rosatom"],
"corporation_scope_label": ["Госкорпорация «Росатом»"],
"organization_type": "ao",
"organization_type_label": "Акционерное общество",
"inn": "7405000428",
"ogrn": "1027400661650",
"kpp": "745001001",
"okpo": "07624755",
"active_registry_names": ["Реестр госкорпорации Росатом"]
}
```
## Отдельный note по неясностям
- Для F-3/F-5/F-6 endpoint период нужно согласовать в рамках Pass 1 после проверки форматов файлов и старых контрактов.
- Статусы для upload: если sync выполняется мгновенно, статус `done`, если в очередь — `queued` и `job_id` обязателен.