Skip to content
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

Added Comprehensive Invoice Management System with Routes, Controllers, and Bulk Operations #955

Merged
merged 1 commit into from
Nov 10, 2024

Conversation

IkkiOcean
Copy link
Contributor

Description:
This PR introduces the complete invoice management system, including the schema, routes, and controllers. The system allows for efficient management of invoices within the application, with the ability to generate, update, retrieve, and delete invoices. The following updates have been made:

Schema:

The Invoice schema has been created with the following key fields:

  • invoiceId: A unique identifier for the invoice.
  • orderId: A reference to the related order.
  • userId: A reference to the user associated with the order.
  • amount: The total amount for the invoice.
  • invoiceDate: The date when the invoice was generated.
  • dueDate: The date by which the invoice must be paid.
  • status: The payment status of the invoice (either "Paid" or "Unpaid").
  • paymentId: A reference to the associated payment record, if available.

Routes and Controllers Implemented:

  1. POST /generate: Generates a new invoice after payment confirmation. The invoiceId is dynamically created based on the current timestamp.
  2. GET /: Retrieves invoices by filtering on parameters such as userId, orderId, and status. Supports pagination and sorting.
  3. GET /:id: Fetches a specific invoice by its invoiceId.
  4. PATCH /:id/status: Updates the payment status of an invoice (e.g., "Paid", "Unpaid").
  5. DELETE /:id: Deletes an invoice by its invoiceId.
  6. PATCH /mark-overdue: Marks invoices as overdue based on the current date and due date.
  7. GET /summary: Retrieves a summary of invoices filtered by their status (e.g., "Paid", "Unpaid"), and can optionally filter by userId.
  8. POST /generate-bulk: Enables the bulk generation of invoices, useful for handling multiple orders or transactions at once.

Key Features:

  • Invoice Generation: Automatically assigns a unique invoiceId to each invoice and stores important data like the amount, due date, and status.
  • Dynamic Filters: Flexible querying system that allows for filtering invoices by user, order, or payment status.
  • Bulk Invoice Creation: Facilitates the generation of multiple invoices in a single request, ideal for businesses handling large volumes of transactions.
  • Overdue Invoice Management: Automates the process of marking invoices as overdue based on their due date.

Copy link

vercel bot commented Nov 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
agro-tech-ai ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 9, 2024 7:38pm

Copy link
Contributor

github-actions bot commented Nov 9, 2024

Thank you for submitting your pull request! 🙌 We'll review it as soon as possible. In the meantime, please ensure that your changes align with our CONTRIBUTING.md. If there are any specific instructions or feedback regarding your PR, we'll provide them here. Thanks again for your contribution! 😊

@manikumarreddyu manikumarreddyu merged commit 890b11a into manikumarreddyu:main Nov 10, 2024
4 checks passed
Copy link
Contributor

🎉 Your pull request has been successfully merged! 🎉 Thank you for your valuable contribution to our project. Your efforts are greatly appreciated. Feel free to reach out if you have any more contributions or if there's anything else we can assist you with. Keep up the fantastic work! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Develop Payment and Invoice Management System with Schema, Controller, and Functionality for Admin Dashboard
2 participants