- Auto-update fiscal data on org creation via updateOrgLegalOnCreate - Add Carta Manifiesto embedded iframe in CSD config page - Fix CSF scraper: 60s timeout + manual RFC fallback when SAT doesn't auto-populate - Fix contribuyenteId propagation in constancia frontend hooks/API - Fix needsInitialSync to check per-contribuyente, not just per-tenant - Fix documento notifications for global_admin using viewingTenantId - Extract CSF manually for Carlos Husberto Torres Romero - Trigger initial SAT sync for Carlos Husberto Torres Romero - Update org legal data in Facturapi for Carlos Husberto (tax_system 612 + address) Files changed: - apps/api/src/controllers/documentos.controller.ts - apps/api/src/jobs/sat-sync.job.ts - apps/api/src/services/constancia.service.ts - apps/api/src/services/contribuyente-facturapi.service.ts - apps/api/src/services/sat/sat-csf-login.ts - apps/web/app/(dashboard)/configuracion/csd/page.tsx - apps/web/lib/api/constancias.ts - apps/web/lib/hooks/use-constancias.ts - docs/sessions/2026-05-17-facturapi-csf-sync-notifications.md
81 lines
2.1 KiB
TypeScript
81 lines
2.1 KiB
TypeScript
import { apiClient } from './client';
|
|
|
|
export interface DomicilioCsf {
|
|
codigoPostal?: string;
|
|
tipoVialidad?: string;
|
|
nombreVialidad?: string;
|
|
numeroExterior?: string;
|
|
numeroInterior?: string;
|
|
colonia?: string;
|
|
localidad?: string;
|
|
municipio?: string;
|
|
entidadFederativa?: string;
|
|
entreCalle?: string;
|
|
yCalle?: string;
|
|
}
|
|
|
|
export interface RegimenCsf {
|
|
nombre: string;
|
|
fechaInicio: string;
|
|
fechaFin?: string;
|
|
}
|
|
|
|
export interface ObligacionCsf {
|
|
descripcion: string;
|
|
descripcionVencimiento: string;
|
|
fechaInicio: string;
|
|
fechaFin?: string;
|
|
}
|
|
|
|
export interface ActividadEconomicaCsf {
|
|
orden: number;
|
|
descripcion: string;
|
|
porcentaje: number;
|
|
fechaInicio: string;
|
|
fechaFin?: string;
|
|
}
|
|
|
|
export interface ConstanciaDatos {
|
|
rfc: string;
|
|
curp?: string;
|
|
idCIF: string;
|
|
nombre?: string;
|
|
primerApellido?: string;
|
|
segundoApellido?: string;
|
|
razonSocial?: string;
|
|
nombreComercial?: string;
|
|
fechaInicioOperaciones: string;
|
|
estatusPadron: string;
|
|
fechaUltimoCambioEstado?: string;
|
|
lugarFechaEmision: string;
|
|
domicilio: DomicilioCsf;
|
|
actividadesEconomicas: ActividadEconomicaCsf[];
|
|
regimenes: RegimenCsf[];
|
|
obligaciones: ObligacionCsf[];
|
|
}
|
|
|
|
export interface Constancia {
|
|
id: number;
|
|
rfc: string;
|
|
idCif: string | null;
|
|
razonSocial: string | null;
|
|
estatusPadron: string | null;
|
|
fechaEmision: string | null;
|
|
datos: ConstanciaDatos;
|
|
fechaConsulta: string;
|
|
createdAt: string;
|
|
}
|
|
|
|
export const listConstancias = (contribuyenteId?: string) => {
|
|
const params = contribuyenteId ? `?contribuyenteId=${encodeURIComponent(contribuyenteId)}` : '';
|
|
return apiClient.get<Constancia[]>(`/documentos/constancias${params}`).then(r => r.data);
|
|
};
|
|
|
|
export const consultarConstancia = (contribuyenteId?: string) => {
|
|
const params = contribuyenteId ? `?contribuyenteId=${encodeURIComponent(contribuyenteId)}` : '';
|
|
return apiClient.post<Constancia>(`/documentos/constancias/consultar${params}`).then(r => r.data);
|
|
};
|
|
|
|
export const descargarConstanciaPdf = (id: number) =>
|
|
apiClient.get(`/documentos/constancias/${id}/pdf`, { responseType: 'blob' }).then(r => r.data as Blob);
|