fix(cli): use absolute paths for logos and generate 6 distinct PDFs
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 5s
Build & Deploy / 🧪 QA (push) Failing after 12s
Build & Deploy / 🏗️ Build (push) Failing after 14s
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🩺 Health Check (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 5s
Build & Deploy / 🧪 QA (push) Failing after 12s
Build & Deploy / 🏗️ Build (push) Failing after 14s
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🩺 Health Check (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
This commit is contained in:
@@ -100,6 +100,15 @@ async function main() {
|
|||||||
|
|
||||||
const engine = new PdfEngine();
|
const engine = new PdfEngine();
|
||||||
|
|
||||||
|
const headerIcon = path.join(
|
||||||
|
monorepoRoot,
|
||||||
|
"apps/web/src/assets/logo/Icon-Black-Transparent.png",
|
||||||
|
);
|
||||||
|
const footerLogo = path.join(
|
||||||
|
monorepoRoot,
|
||||||
|
"apps/web/src/assets/logo/Logo-Black-Transparent.png",
|
||||||
|
);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const conceptResult = await conceptPipeline.run({
|
const conceptResult = await conceptPipeline.run({
|
||||||
briefing,
|
briefing,
|
||||||
@@ -116,7 +125,10 @@ async function main() {
|
|||||||
konzeptDir,
|
konzeptDir,
|
||||||
`${companyName}_Konzept_${timestamp}.pdf`,
|
`${companyName}_Konzept_${timestamp}.pdf`,
|
||||||
);
|
);
|
||||||
await engine.generateConceptPdf(conceptResult, conceptPdfPath);
|
await engine.generateConceptPdf(conceptResult, conceptPdfPath, {
|
||||||
|
headerIcon,
|
||||||
|
footerLogo,
|
||||||
|
});
|
||||||
console.log(`✅ Created Concept PDF at: ${conceptPdfPath}`);
|
console.log(`✅ Created Concept PDF at: ${conceptPdfPath}`);
|
||||||
|
|
||||||
console.log("\n==================================================");
|
console.log("\n==================================================");
|
||||||
@@ -143,6 +155,7 @@ async function main() {
|
|||||||
await engine.generateEstimatePdf(
|
await engine.generateEstimatePdf(
|
||||||
estimationResult.formState,
|
estimationResult.formState,
|
||||||
estimationPdfPath,
|
estimationPdfPath,
|
||||||
|
{ headerIcon, footerLogo },
|
||||||
);
|
);
|
||||||
console.log(`✅ Created Angebot PDF at: ${estimationPdfPath}`);
|
console.log(`✅ Created Angebot PDF at: ${estimationPdfPath}`);
|
||||||
|
|
||||||
@@ -151,7 +164,7 @@ async function main() {
|
|||||||
agbDir,
|
agbDir,
|
||||||
`${companyName}_AGBs_${timestamp}.pdf`,
|
`${companyName}_AGBs_${timestamp}.pdf`,
|
||||||
);
|
);
|
||||||
await engine.generateAgbsPdf(agbPdfPath, {});
|
await engine.generateAgbsPdf(agbPdfPath, { headerIcon, footerLogo });
|
||||||
console.log(`✅ Created AGBs PDF at: ${agbPdfPath}`);
|
console.log(`✅ Created AGBs PDF at: ${agbPdfPath}`);
|
||||||
|
|
||||||
console.log("\n📄 Generating Deckblatt PDF...");
|
console.log("\n📄 Generating Deckblatt PDF...");
|
||||||
@@ -162,6 +175,7 @@ async function main() {
|
|||||||
await engine.generateFrontPagePdf(
|
await engine.generateFrontPagePdf(
|
||||||
estimationResult.formState,
|
estimationResult.formState,
|
||||||
deckblattPdfPath,
|
deckblattPdfPath,
|
||||||
|
{ headerIcon },
|
||||||
);
|
);
|
||||||
console.log(`✅ Created Deckblatt PDF at: ${deckblattPdfPath}`);
|
console.log(`✅ Created Deckblatt PDF at: ${deckblattPdfPath}`);
|
||||||
|
|
||||||
@@ -170,7 +184,10 @@ async function main() {
|
|||||||
abschlussDir,
|
abschlussDir,
|
||||||
`${companyName}_Abschluss_${timestamp}.pdf`,
|
`${companyName}_Abschluss_${timestamp}.pdf`,
|
||||||
);
|
);
|
||||||
await engine.generateClosingPdf(abschlussPdfPath, {});
|
await engine.generateClosingPdf(abschlussPdfPath, {
|
||||||
|
headerIcon,
|
||||||
|
footerLogo,
|
||||||
|
});
|
||||||
console.log(`✅ Created Abschluss PDF at: ${abschlussPdfPath}`);
|
console.log(`✅ Created Abschluss PDF at: ${abschlussPdfPath}`);
|
||||||
} else {
|
} else {
|
||||||
console.log("\n⚠️ No formState generated, skipping Estimation PDF.");
|
console.log("\n⚠️ No formState generated, skipping Estimation PDF.");
|
||||||
@@ -182,7 +199,7 @@ async function main() {
|
|||||||
infoDir,
|
infoDir,
|
||||||
`${companyName}_Arbeitsweise_${timestamp}.pdf`,
|
`${companyName}_Arbeitsweise_${timestamp}.pdf`,
|
||||||
);
|
);
|
||||||
await engine.generateInfoPdf(infoPdfPath, {});
|
await engine.generateInfoPdf(infoPdfPath, { headerIcon, footerLogo });
|
||||||
console.log(`✅ Created Arbeitsweise PDF at: ${infoPdfPath}`);
|
console.log(`✅ Created Arbeitsweise PDF at: ${infoPdfPath}`);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(`\n❌ Pipeline failed: ${(e as Error).message}`);
|
console.error(`\n❌ Pipeline failed: ${(e as Error).message}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user