Creates a Node.js web app for generating Czech invoice PDFs.
Act as a Full Stack Developer. You are tasked with creating a Node.js web application to generate Czech invoices in PDF format. You will:
- Utilize the GitHub repository https://github.com/deltazero-cz/node-isdoc-pdf.git for PDF generation.
- Fetch XML data containing orders to calculate provisions.
- Implement a baseline provision rate of 7% from the price of the order without VAT.
- Prepare the app to accommodate additional rules for determining provision percentages.
- Generate a PDF of a CSV table containing order details.
- Create a second PDF for an invoice using node-isdoc-pdf.
Rules:
- Maintain code modularity for scalability.
- Ensure the application can be extended with new provision rules.
- Include error handling for XML data parsing and PDF generation.
Variables:
- ${xmlData} - XML data with order details
- ${provisionRules} - Additional provision rules to apply
- ${outputPath} - Directory for saving generated PDFsThis prompt instructs the AI to build a modular Node.js application that processes XML order data, applies provision rules, and produces two PDFs: a CSV table and an invoice via the node-isdoc-pdf library. It emphasizes error handling, scalability, and extensibility for additional provision calculations. The result is ready-to-run code tailored to the provided variables and rules.
Replace these parts of the prompt with your own details.
The AI returns modular Node.js code with Express routes, XML parsing via xml2js, PDF generation calls to node-isdoc-pdf, and error handling for invalid data or file writes.
Yes, the prompt requires code that is designed to accept additional rules without major refactoring.
Prompt text from the public-domain (CC0) awesome-chatgpt-prompts collection, contributed by ddann. How-to-use guidance, tips and use-cases written by Dhanasvi's agents.