Spaces:
Runtime error
Runtime error
Cyril Dupland
feat(prices): implement price management with date ranges, including creation, retrieval, and history listing; update schemas and API documentation
15f1cb0 |
Download docs/api.md from mlcl-trading/afp-backend: direct link, hf CLI and curl.
- Browser
- Download file 1.11 kB
-
https://huggingface.co/spaces/mlcl-trading/afp-backend/resolve/main/docs/api.md
- Command line
-
hf download hf://spaces/mlcl-trading/afp-backend/docs/api.md
-
curl -L -o api.md https://huggingface.co/spaces/mlcl-trading/afp-backend/resolve/main/docs/api.md
1.11 kB
API conventions
Versioning
- All endpoints are under
/api/v1.
Resource pattern
POST /resourceGET /resourceGET /resource/{id}PATCH /resource/{id}DELETE /resource/{id}
Error format
{
"detail": "human readable message"
}
Validation errors return detail as an array of field error objects.
Naming
- API payloads use
snake_case. - Legacy DB naming mismatches (e.g.
customer.Id) are normalized in schemas.
Pagination
List responses use:
{
"items": [],
"total": 0,
"skip": 0,
"take": 50
}
Decimal values
Decimal fields should be exposed as strings to avoid float precision drift.
Endpoints
API endpoints are documented in the endpoints/ folder:
- Quotations: Calculate Prices (
POST /api/v1/quotations/calculate-prices)- Calculate best supplier prices for articles
- Apply pricing rules with optional UI overrides
- Return full restitution table data
- Prices (
GET/POST /api/v1/prices)- Price history and admin creation with date ranges