diff --git a/backend/api/v1/modules/a76/clients_and_providers/routes.py b/backend/api/v1/modules/a76/clients_and_providers/routes.py
index 970b71ad..e1db85d7 100644
--- a/backend/api/v1/modules/a76/clients_and_providers/routes.py
+++ b/backend/api/v1/modules/a76/clients_and_providers/routes.py
@@ -61,7 +61,6 @@ async def get_clients_and_providers(
"page_size": limit,
}
-
@router.get("/{client_id}/basic", response_model=ClientProviderBasicDTO)
async def get_clients_and_providers_basic_info(
client_id: int,
@@ -111,6 +110,26 @@ async def update_client_provider(
return client
+@router.get("/{client_id}", response_model=ClientProviderResponseDTO)
+async def get_client_provider_detail(
+ client_id: int,
+ company_id: int = Query(..., description="Company ID"),
+ db: Session = Depends(get_core_db),
+ current_user: dict = Depends(get_current_user),
+):
+ """
+ Obtener un cliente/proveedor completo por ID.
+ Esta es la ruta que tu formulario necesita para cargar los datos.
+ """
+ tenant_id = validate_access_to_resource(db, company_id, current_user)
+
+ # Usamos el servicio para buscar por ID
+ client = ClientProviderService.get_by_id(db, client_id, tenant_id, company_id)
+
+ if not client:
+ raise HTTPException(status_code=404, detail="Client/Provider not found")
+
+ return client
@router.delete("/{client_id}", response_model=bool)
async def delete_client_provider(
diff --git a/frontend/src/lib/api/dashboard/a76/clients-providers.ts b/frontend/src/lib/api/dashboard/a76/clients-providers.ts
index 26d31d69..292e9844 100644
--- a/frontend/src/lib/api/dashboard/a76/clients-providers.ts
+++ b/frontend/src/lib/api/dashboard/a76/clients-providers.ts
@@ -5,14 +5,17 @@
import { api } from '$lib/api';
export interface ClientProviderAddress {
- id?: number;
- street?: string | null;
- neighborhood?: string | null;
- city?: string | null;
- state?: string | null;
- country?: string | null;
- zip_code?: string | null;
- client_id?: number;
+ id?: number;
+ streets?: string | null;
+ neighborhood?: string | null;
+ city?: string | null;
+ state?: string | null;
+ country?: string | null;
+ zip_code?: string | null;
+ client_id?: number;
+ interior_number?: string | null;
+ exterior_number?: string | null;
+ municipality?: string | null;
}
export interface ClientProviderPrograms {
@@ -25,7 +28,7 @@ export interface ClientProviderPrograms {
export interface ClientProvider {
id: number;
rfc: string;
- name: string;
+ name: string;
curp?: string | null;
residence_country?: string | null;
domicile_fiscal?: string | null;
diff --git a/frontend/src/lib/components/dashboard/clients_and_providers/data-table-actions.svelte b/frontend/src/lib/components/dashboard/clients_and_providers/data-table-actions.svelte
index 888b9488..980c6749 100644
--- a/frontend/src/lib/components/dashboard/clients_and_providers/data-table-actions.svelte
+++ b/frontend/src/lib/components/dashboard/clients_and_providers/data-table-actions.svelte
@@ -1,103 +1,102 @@