-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate Invoice PDF #1835
Generate Invoice PDF #1835
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎ To accept the risk, merge this PR and you will not be notified again.
Next stepsWhat is obfuscated code?Obfuscated files are intentionally packed to hide their behavior. This could be a sign of malware. Packages should not obfuscate their code. Consider not using packages with obfuscated code. Take a deeper look at the dependencyTake a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev. Remove the packageIf you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency. Mark a package as acceptable riskTo ignore an alert, reply with a comment starting with
|
Caveat: Turbopack doesn't play nice with react-pdf so we need to disable
--turbo
flag for thepnpm dev
script for this to workThis pull request introduces several changes to enhance the billing and invoicing functionalities. The changes mainly focus on generating and managing invoice prefixes, creating detailed invoice PDFs, and updating the schema to support unique invoice numbers.
Enhancements to Billing and Invoicing:
apps/web/app/api/stripe/webhook/payment-method-attached.ts
: Introduced logic to generate and assign an invoice prefix to a workspace if it doesn't already exist. [1] [2]apps/web/app/api/workspaces/[idOrSlug]/billing/invoices/[invoiceId]/route.tsx
: Added functionality to generate and serve detailed invoice PDFs, including customer and invoice metadata. (apps/web/app/api/workspaces/[idOrSlug]/billing/invoices/[invoiceId]/route.tsxR1-R342)apps/web/lib/actions/partners/confirm-payouts.ts
: Implemented logic to generate the next invoice number for a workspace, ensuring each invoice has a unique identifier. [1] [2]apps/web/scripts/backfill-invoice-prefixes.ts
: Added a script to backfill invoice prefixes for existing workspaces that do not have one.Schema and Utility Updates:
packages/prisma/schema/invoice.prisma
: Updated theInvoice
model to include a uniquenumber
field for invoice identification.packages/prisma/schema/workspace.prisma
: Added aninvoicePrefix
field to theProject
model to store the prefix used for generating unique invoice numbers.apps/web/lib/api/invoices/utils.ts
: Created a utility function to generate a unique invoice prefix.Dependency Additions:
apps/web/package.json
: Added@react-pdf/renderer
andreact-pdf-tailwind
dependencies to support PDF generation. [1] [2]