Initial commit: Horux Despachos project
This commit is contained in:
78
apps/web/lib/api/constancias.ts
Normal file
78
apps/web/lib/api/constancias.ts
Normal file
@@ -0,0 +1,78 @@
|
||||
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 = () =>
|
||||
apiClient.post<Constancia>('/documentos/constancias/consultar').then(r => r.data);
|
||||
|
||||
export const descargarConstanciaPdf = (id: number) =>
|
||||
apiClient.get(`/documentos/constancias/${id}/pdf`, { responseType: 'blob' }).then(r => r.data as Blob);
|
||||
Reference in New Issue
Block a user