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

Implement Billing and Invoicing Functionality #69

Merged

Conversation

sweep-ai[bot]
Copy link
Contributor

@sweep-ai sweep-ai bot commented Jul 27, 2024

Purpose

This pull request introduces the core billing and invoicing functionality for the Liberu Billing application. It includes the ability to generate invoices, process recurring billing, and send overdue invoice reminders.

Description

The changes in this pull request include:

  1. BillingService: A new BillingService class that handles the core billing and invoicing logic, including:

    • Generating invoices for active subscriptions
    • Processing recurring billing by renewing subscriptions and generating new invoices
    • Sending overdue invoice reminders
  2. Invoice Model: The Invoice model has been updated to include a sendInvoiceEmail() method that sends the invoice to the customer's email.

  3. InvoiceGenerated and OverdueInvoiceReminder Mails: New mail classes have been added to handle the email notifications for invoice generation and overdue invoice reminders.

  4. Subscription Model: The Subscription model has been updated to include methods for renewing subscriptions and checking if a subscription is active.

  5. Console Kernel: The application's console kernel has been updated to schedule the daily execution of the billing and overdue reminder processes.

  6. BillingServiceTest: A new unit test suite has been added to ensure the correct functioning of the BillingService.

Summary

This pull request introduces the following changes:

  • app/Services/BillingService.php: Implements the core billing and invoicing logic.
  • app/Models/Invoice.php: Adds the sendInvoiceEmail() method to the Invoice model.
  • app/Mail/InvoiceGenerated.php and app/Mail/OverdueInvoiceReminder.php: New mail classes for invoice generation and overdue invoice reminders.
  • app/Models/Subscription.php: Adds methods for renewing subscriptions and checking if a subscription is active.
  • app/Console/Kernel.php: Schedules the daily execution of the billing and overdue reminder processes.
  • tests/Unit/Services/BillingServiceTest.php: A new unit test suite for the BillingService.

Suggested changes from Sweep Chat by @curtisdelicata. Continue chatting at https://sweep-chat-demo.vercel.app/c/17360bd8-b7ff-4102-b250-0723e9496f0e.

@curtisdelicata curtisdelicata merged commit 4d259c3 into main Jul 27, 2024
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant