feat(cfdi): descarga masiva de XMLs como ZIP, limite 1,000

This commit is contained in:
Horux Dev
2026-05-24 21:19:56 +00:00
parent 80e2c099d9
commit 5c940847af
5 changed files with 131 additions and 1 deletions

View File

@@ -357,6 +357,13 @@ export async function getXmlById(pool: Pool, id: string): Promise<string | null>
return rows[0]?.xml_original || null;
}
export async function getXmlsByIds(pool: Pool, ids: number[]): Promise<{ id: number; uuid: string; xml: string | null }[]> {
const { rows } = await pool.query(`
SELECT id, uuid, xml_original FROM cfdis WHERE id = ANY($1)
`, [ids]);
return rows.map((r: any) => ({ id: r.id, uuid: r.uuid, xml: r.xml_original || null }));
}
export interface CreateCfdiData {
uuid: string;
type: 'EMITIDO' | 'RECIBIDO';