feat(cfdi): descarga masiva de XMLs como ZIP, limite 1,000
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user