Add max_daily_limit_gtq field to lamassu_config: Updated database schema and models to include max_daily_limit_gtq for configurable client limits. Enhanced API and frontend to support this new field, ensuring proper handling and validation in the user interface.
This commit is contained in:
parent
ae50db10c7
commit
7af0e47d48
6 changed files with 75 additions and 3 deletions
25
views_api.py
25
views_api.py
|
|
@ -420,3 +420,28 @@ async def api_delete_lamassu_config(
|
|||
|
||||
await delete_lamassu_config(config_id)
|
||||
return {"message": "Configuration deleted successfully"}
|
||||
|
||||
|
||||
@satmachineadmin_api_router.get("/api/v1/dca/client-limits")
|
||||
async def api_get_client_limits():
|
||||
"""Get client-safe configuration limits (public endpoint - no authentication)"""
|
||||
try:
|
||||
config = await get_active_lamassu_config()
|
||||
if not config:
|
||||
# Return sensible defaults if no config exists
|
||||
return {
|
||||
"max_daily_limit_gtq": 2000,
|
||||
"currency": "GTQ"
|
||||
}
|
||||
|
||||
# Return only client-safe configuration fields
|
||||
return {
|
||||
"max_daily_limit_gtq": config.max_daily_limit_gtq,
|
||||
"currency": "GTQ" # Could be made configurable later
|
||||
}
|
||||
except Exception:
|
||||
# Return defaults on any error
|
||||
return {
|
||||
"max_daily_limit_gtq": 2000,
|
||||
"currency": "GTQ"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue