developer coding template risk: medium
Node.js Czech Invoice PDF Generator
Act as a Full Stack Developer to create a Node.js web application that generates Czech invoices in PDF format using the node-isdoc-pdf GitHub repository, fetches XML data to calcul…
- Policy sensitive
- Human review
PROMPT
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 PDFs INPUTS
- xmlData REQUIRED
-
XML data with order details
- provisionRules
-
Additional provision rules to apply
- outputPath REQUIRED
-
Directory for saving generated PDFs
ROLES & RULES
Role assignments
- Act as a Full Stack Developer.
- 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.
EXPECTED OUTPUT
- Format
- code
- Constraints
-
- modular for scalability
- extensible provision rules
- error handling for XML parsing and PDF generation
SUCCESS CRITERIA
- 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.
FAILURE MODES
- May not maintain code modularity.
- May not ensure extensibility with new provision rules.
- May omit error handling for XML parsing or PDF generation.
CAVEATS
- Dependencies
-
- ${xmlData} - XML data with order details
- ${provisionRules} - Additional provision rules to apply
- ${outputPath} - Directory for saving generated PDFs
- GitHub repository https://github.com/deltazero-cz/node-isdoc-pdf.git
- Missing context
-
- XML schema or example structure.
- Format of ${provisionRules} (e.g., JSON array, function).
- Specific fields from orders to include in CSV and invoice PDFs.
- Node.js version and full dependency list.
- Input method for variables (CLI, API, etc.).
- Ambiguities
-
- Structure of XML data (${xmlData}) not specified.
- Format and content details of 'CSV table containing order details' unclear.
- Exact application of ${provisionRules} not detailed.
- 'Fetch XML data' ambiguous: input parameter or external source?
QUALITY
- OVERALL
- 0.85
- CLARITY
- 0.85
- SPECIFICITY
- 0.80
- REUSABILITY
- 0.95
- COMPLETENESS
- 0.70
IMPROVEMENT SUGGESTIONS
- Add example XML snippet and describe its structure.
- Define ${provisionRules} as a JSON array of rule objects with examples.
- Specify CSV table columns and PDF styling requirements.
- Clarify if app is a CLI script, Express server, or other; include setup instructions.
- Provide sample output PDF structure or mockups.
USAGE
Copy the prompt above and paste it into your AI of choice — Claude, ChatGPT, Gemini, or anywhere else you're working. Replace any placeholder sections with your own context, then ask for the output.
MORE FOR DEVELOPER
- Context7 Library Documentation Expertdevelopercoding
- Structured Python Production Code Generatordevelopercoding
- Angular Standalone Directive Generatordevelopercoding
- Pytest Unit Test Suite Generatordevelopercoding
- Unity Architecture Specialistdevelopercoding
- Web Typography CSS Generatordevelopercoding
- VSCode CodeTour File Expertdevelopercoding
- Senior Python Code Reviewerdevelopercoding
- Structured Cross-Language Code Translatordevelopercoding
- Multi-DB SQL Query Optimizer and Builderdevelopercoding