feat: async PDF cache i API media putanje za putne naloge
Some checks failed
ERP CI/CD Pipeline / test (push) Has been cancelled
ERP CI/CD Pipeline / Deploy (server git pull + compose) (push) Has been cancelled

Uvodi background request tok za generiranje PDF-a s 24h cache-om i cleanup taskom preko Celery beat-a. Dodaje notification metadata download_url za ponovno preuzimanje bez regeneracije, API image endpointe za putne naloge i račune, te frontend integraciju za async download i produkcijski prikaz slika.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
mariomitte
2026-07-17 16:42:02 +02:00
parent 5e7ec72a4e
commit e8330473cd
17 changed files with 726 additions and 231 deletions

View File

@@ -1,6 +1,11 @@
import { useMemo } from 'preact/hooks';
import ModalShell from '../ui/ModalShell';
import { downloadWorkOrderInvoicesPdf, downloadWorkOrderPdf, downloadWorkOrderServiceRecordsPdf } from '../../stores/fleetDashboardStore';
import {
downloadGeneratedPdfByUrl,
downloadWorkOrderInvoicesPdf,
downloadWorkOrderPdf,
downloadWorkOrderServiceRecordsPdf,
} from '../../stores/fleetDashboardStore';
function formatTimestamp(value) {
if (!value) return '';
@@ -57,6 +62,12 @@ function getEntityAction(notification, meta) {
? 'Preuzmi PDF servisnih zapisa'
: 'Preuzmi PDF putnog naloga',
run() {
if (metadata.download_url) {
return downloadGeneratedPdfByUrl(
metadata.download_url,
metadata.filename || `${metadata.work_order_id}.${metadata.pdf_type || 'work-order'}.pdf`
);
}
if (metadata.pdf_type === 'invoices') {
return downloadWorkOrderInvoicesPdf(metadata.work_order_id);
}