Implement Billing and Invoicing Functionality #69
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
BillingService: A new
BillingService
class that handles the core billing and invoicing logic, including:Invoice Model: The
Invoice
model has been updated to include asendInvoiceEmail()
method that sends the invoice to the customer's email.InvoiceGenerated and OverdueInvoiceReminder Mails: New mail classes have been added to handle the email notifications for invoice generation and overdue invoice reminders.
Subscription Model: The
Subscription
model has been updated to include methods for renewing subscriptions and checking if a subscription is active.Console Kernel: The application's console kernel has been updated to schedule the daily execution of the billing and overdue reminder processes.
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 thesendInvoiceEmail()
method to theInvoice
model.app/Mail/InvoiceGenerated.php
andapp/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 theBillingService
.Suggested changes from Sweep Chat by @curtisdelicata. Continue chatting at https://sweep-chat-demo.vercel.app/c/17360bd8-b7ff-4102-b250-0723e9496f0e.