copilot_frontend
copilot_budget
View Budget
View budget via encrypted token.
This is a PUBLIC endpoint (no authentication required).
The token contains the encrypted client_data_id. This endpoint:
- Decrypts the token to get client_data_id
- Retrieves client data from presup_datos_presupuesto_cliente
- Retrieves associated budget from presup_presupuestos
- Extracts data from datos_formulario
- Gets panel information from database:
- If selected panel is premium -> also fetches basic panel
- If selected panel is basic -> also fetches premium panel
- Prepares template context with both panel types for comparison
- Renders budget HTML template with the data
Args: token: Encrypted token containing client_data_id request: FastAPI request object (needed for Jinja2) db: Database session
Returns: HTMLResponse with budget visualization or friendly error page (404) if: - Token is invalid or expired - Client data or budget not found in database
get/api/budget/view/{token}
Path parameters
tokenstring required
Response
Successful Response