PdfOrchestrator

@Service
class PdfOrchestrator(pdfClient: PdfServiceClient, templateRepository: DocumentTemplateRepository, tenantRepository: TenantRepository, storageService: StorageService)(source)

Constructors

Link copied to clipboard
constructor(pdfClient: PdfServiceClient, templateRepository: DocumentTemplateRepository, tenantRepository: TenantRepository, storageService: StorageService)

Functions

Link copied to clipboard
fun generateAndStore(templateCode: String, htmlContent: String, extraVars: Map<String, String> = emptyMap()): String

Gera o PDF, Salva no Storage R2 e retorna a URL Assinada. Este é o método que o Controller final deve chamar para persistir documentos.

Link copied to clipboard
fun generateBytes(templateCode: String, htmlContent: String, extraVars: Map<String, String> = emptyMap()): ByteArray

Gera o PDF e retorna os bytes (Útil para Preview imediato sem salvar).