copilot_frontend
copilot_budget
Get Complete Budget Form
Gets ALL data needed for the budget form in ONE request.
This endpoint combines:
- Client contact data from HubSpot (by email)
- Commercial agent data (from user or comercial_id param for admin)
- All catalogs:
- Panels (active)
- Micro investors (active)
- Promotions (active)
- Extras (active)
- Provinces (all with production data)
- Structures (active)
- Payment methods (all)
- Discount backups (all)
- Financing entities (unique, from active coefficients only)
- Available financing months (unique, from active coefficients only)
Protected Endpoint: Requires JWT authentication and 'ui_comercial' or 'admin' role
Args: email: Client email to search in HubSpot comercial_id: Commercial ID to impersonate (only for admin) current_user: Current authenticated user db: Database session
Returns: CompleteBudgetFormResponse: Complete form data with client, commercial, and all catalogs
Raises: ErrValidation: If comercial_id cannot be determined ErrNotFound: If commercial or client not found ErrHubSpot: If error fetching client from HubSpot
get/api/budget/form
Query parameters
emailstring required
comercial_idinteger nullable
Commercial ID (admin uses this to impersonate)
Commercial ID (admin uses this to impersonate)
Response
Successful Response