Skip to content

feat!: update module to be compatible with saucebase 2.0 - #23

Merged
sauce-base merged 8 commits into
mainfrom
dev-v2
Jun 4, 2026
Merged

feat!: update module to be compatible with saucebase 2.0#23
sauce-base merged 8 commits into
mainfrom
dev-v2

Conversation

@roble

@roble roble commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

This pull request includes several important changes to improve consistency, modernize structure, and streamline the Billing module. The most significant updates are the migration from module.json to composer.json for versioning and metadata, restructuring of the codebase to use a src/ directory, and various naming and automation adjustments for improved developer experience.

Module structure and configuration:

  • Migrated module metadata and versioning from module.json (now deleted) to composer.json, including adding a version field and updating autoload paths to use the src/ directory. Also registered the BillingServiceProvider in the composer.json extra section. [1] [2] [3]
  • Updated the GitHub release workflow to use composer.json for versioning instead of module.json.
  • Changed the main PHP namespace autoload path from app/ to src/ in composer.json for better alignment with modern Laravel package conventions.

Testing and automation:

  • Standardized test and code generation commands to use lowercase billing instead of Billing across workflow files, documentation, and the Taskfile.yml. [1] [2] [3]
  • Added a db:seed task to Taskfile.yml and introduced a DatabaseSeeder class in database/seeders to support database seeding for the Billing module. [1] [2]

Codebase cleanup and improvements:

  • Removed the unused RouteServiceProvider in favor of grouping routes directly in routes/api.php. [1] [2]
  • Refactored JavaScript entry points: replaced the logic in resources/js/app.ts with a re-export, and moved Billing module setup and icon registration to resources/js/vue/app.ts for better organization. [1] [2]
  • Updated navigation route definitions to use closure-based route generation for consistency and improved flexibility. [1] [2]

Other updates:

  • Updated the copyright year in the LICENSE file.
  • Set the license to proprietary and minimum stability to stable in composer.json.

roble added 8 commits April 25, 2026 21:58
- Implemented SubscriptionCancelledNotification, SubscriptionCreatedNotification, SubscriptionResumedNotification, and SubscriptionUpdatedNotification for handling subscription-related email notifications.
- Created SubscriptionPolicy to manage subscription update permissions.
- Developed BillingServiceProvider to register billing services and commands.
- Introduced BillingService to handle checkout processing, webhooks, and subscription management.
- Added StripeGateway for Stripe payment processing, including customer creation and checkout session management.
- Implemented PaymentGatewayManager to manage payment gateway drivers.
- Created Billable trait for associating users with billing customers.
- Added a test for the DatabaseSeeder to ensure it runs correctly.
Implement billing notifications, services, and database seeding
feat!: Refactor billing module and add checkout and plans components
Copilot AI review requested due to automatic review settings June 3, 2026 18:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modernizes the Billing module for Saucebase 2.0 by migrating module metadata/versioning to composer.json, adopting a src/-based structure, and expanding the module’s billing capabilities (Stripe gateway integration, checkout/subscription flows, and Filament admin UI).

Changes:

  • Migrates module metadata/versioning from module.json to composer.json, updates autoloading to src/, and adjusts workflows/docs to the new module naming/version source.
  • Introduces a Stripe-backed billing domain (models, services, webhooks, events/listeners, notifications) plus checkout and settings UI pages.
  • Adds database seeding support and module tasks, and removes the module RouteServiceProvider in favor of direct route grouping.

Reviewed changes

Copilot reviewed 17 out of 108 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/Feature/DatabaseSeederTest.php Adds a feature test for module seeding.
Taskfile.yml Normalizes module name casing; adds db:seed task.
src/Traits/Billable.php Adds a Billable trait to relate a user to a billing customer.
src/Services/PaymentGatewayManager.php Adds gateway manager for resolving payment drivers (Stripe).
src/Services/Gateways/StripeGateway.php Implements Stripe gateway operations (customers, sessions, webhooks, subscriptions).
src/Services/BillingService.php Core billing orchestration (checkout, webhooks, fulfillment, payments/subscriptions).
src/Providers/BillingServiceProvider.php Updates module provider wiring and config/view loading.
src/Policies/SubscriptionPolicy.php Adds authorization policy for subscription updates.
src/Notifications/SubscriptionUpdatedNotification.php Adds email notification for cancellation pending / past-due states.
src/Notifications/SubscriptionResumedNotification.php Adds email notification for resumed subscriptions.
src/Notifications/SubscriptionCreatedNotification.php Adds welcome email for newly created subscriptions.
src/Notifications/SubscriptionCancelledNotification.php Adds email notification for cancelled subscriptions.
src/Notifications/PaymentSucceededNotification.php Adds payment success email (optionally links invoice).
src/Notifications/PaymentFailedNotification.php Adds payment failure email.
src/Models/WebhookEvent.php Adds model for webhook idempotency/auditing.
src/Models/Subscription.php Adds subscription model + relations + casts.
src/Models/Product.php Adds product catalog model with scopes and slugs.
src/Models/Price.php Adds price model with currency/billing scheme support.
src/Models/PaymentProvider.php Adds payment provider model.
src/Models/PaymentMethod.php Adds payment method model and casts.
src/Models/Payment.php Adds payment model and relations.
src/Models/Invoice.php Adds invoice model and relations.
src/Models/Customer.php Adds customer model and relations.
src/Models/CheckoutSession.php Adds checkout session model (UUID route key, expiry, status).
src/Listeners/SyncSubscriberRole.php Syncs subscriber role based on subscription state.
src/Listeners/SendSubscriptionUpdatedNotification.php Sends “updated” notification for cancellation pending / past due.
src/Listeners/SendSubscriptionResumedNotification.php Sends “resumed” notification.
src/Listeners/SendSubscriptionCreatedNotification.php Sends “created” notification.
src/Listeners/SendSubscriptionCancelledNotification.php Sends “cancelled” notification.
src/Listeners/SendPaymentSucceededNotification.php Sends payment succeeded notification.
src/Listeners/SendPaymentFailedNotification.php Sends payment failed notification.
src/Http/Requests/SubscribeRequest.php Adds a request validator for subscription-related input.
src/Http/Middleware/RedirectToRegister.php Adds middleware to preserve intended URL and redirect guests to register.
src/Http/Controllers/WebhookController.php Adds webhook endpoint controller with error handling.
src/Http/Controllers/SubscriptionController.php Adds cancel/resume subscription endpoints.
src/Http/Controllers/SettingsBillingController.php Adds billing settings page controller (Inertia).
src/Http/Controllers/CheckoutController.php Adds checkout session create/show/store flow.
src/Http/Controllers/BillingPortalController.php Adds redirect to provider billing portal.
src/Http/Controllers/BillingPlansController.php Adds public plans page controller.
src/Filament/Widgets/SubscriptionsChartWidget.php Adds subscriptions chart widget.
src/Filament/Widgets/RevenueChartWidget.php Adds revenue chart widget.
src/Filament/Widgets/ConversionChartWidget.php Adds checkout conversion chart widget.
src/Filament/Widgets/BillingSaasStatsWidget.php Adds SaaS stats overview widget (MRR, revenue, conversion).
src/Filament/Resources/Subscriptions/Tables/SubscriptionsTable.php Adds Filament table configuration for subscriptions.
src/Filament/Resources/Subscriptions/SubscriptionResource.php Adds Filament subscription resource definition.
src/Filament/Resources/Subscriptions/Schemas/SubscriptionInfolist.php Adds Filament subscription infolist schema.
src/Filament/Resources/Subscriptions/Pages/ViewSubscription.php Adds Filament “view subscription” page.
src/Filament/Resources/Subscriptions/Pages/ListSubscriptions.php Adds Filament “list subscriptions” page.
src/Filament/Resources/Products/Tables/ProductsTable.php Adds Filament table configuration for products.
src/Filament/Resources/Products/Schemas/ProductInfolist.php Adds Filament product infolist schema.
src/Filament/Resources/Products/Schemas/ProductForm.php Adds Filament product form schema.
src/Filament/Resources/Products/ProductResource.php Adds Filament product resource definition.
src/Filament/Resources/Products/Pages/ViewProduct.php Adds Filament “view product” page.
src/Filament/Resources/Products/Pages/ListProducts.php Adds Filament “list products” page.
src/Filament/Resources/Products/Pages/EditProduct.php Adds Filament “edit product” page.
src/Filament/Resources/Products/Pages/CreateProduct.php Adds Filament “create product” page.
src/Filament/Resources/Customers/Tables/CustomersTable.php Adds Filament table configuration for customers.
src/Filament/Resources/Customers/Schemas/CustomerInfolist.php Adds Filament customer infolist schema.
src/Filament/Resources/Customers/Pages/ViewCustomer.php Adds Filament “view customer” page.
src/Filament/Resources/Customers/Pages/ListCustomers.php Adds Filament “list customers” page.
src/Filament/Resources/Customers/CustomerResource.php Adds Filament customer resource definition.
src/Filament/Pages/BillingDashboard.php Adds Filament billing dashboard page with date filtering.
src/Filament/BillingPlugin.php Adds navigation group sorting for the plugin.
src/Events/SubscriptionUpdated.php Adds subscription updated event.
src/Events/SubscriptionResumed.php Adds subscription resumed event.
src/Events/SubscriptionCreated.php Adds subscription created event.
src/Events/SubscriptionCancelled.php Adds subscription cancelled event.
src/Events/PaymentSucceeded.php Adds payment succeeded event.
src/Events/PaymentFailed.php Adds payment failed event.
src/Events/InvoicePaid.php Adds invoice paid event.
src/Events/CheckoutCompleted.php Adds checkout completed event.
src/Enums/WebhookEventType.php Adds normalized webhook event enum.
src/Enums/SubscriptionStatus.php Adds subscription status enum with Filament display helpers.
src/Enums/PaymentStatus.php Adds payment status enum with Filament display helpers.
src/Enums/PaymentMethodType.php Adds payment method type enum + category mapping.
src/Enums/InvoiceStatus.php Adds invoice status enum with Filament display helpers.
src/Enums/Currency.php Adds currency enum with formatting and default-from-config.
src/Enums/CheckoutSessionStatus.php Adds checkout session status enum.
src/Enums/BillingScheme.php Adds billing scheme enum.
src/Data/WebhookData.php Adds webhook DTO.
src/Data/PaymentMethodDetails.php Adds payment method details DTO (TypeScript-transformable).
src/Data/PaymentMethodData.php Adds payment method DTO (TypeScript-transformable).
src/Data/CustomerData.php Adds customer DTO.
src/Data/CheckoutResultData.php Adds checkout result DTO.
src/Data/CheckoutData.php Adds checkout DTO.
src/Data/AddressData.php Adds address DTO.
src/Contracts/PaymentGatewayInterface.php Adds a gateway contract for billing providers.
src/Console/ExpireCheckoutSessionsCommand.php Adds command to expire/abandon checkout sessions.
routes/web.php Adjusts web routes grouping and checkout/settings endpoints.
routes/navigation.php Updates navigation route generation to closure-based routes.
routes/api.php Defines webhook API route and groups under api middleware.
resources/js/vue/utils/intervals.ts Adds interval display/normalization helpers for UI.
resources/js/vue/pages/SettingsBilling.vue Adds billing settings UI page (subscription, payment method, invoices).
resources/js/vue/pages/Plans.vue Adds plans/pricing page UI.
resources/js/vue/pages/Checkout.vue Adds checkout UI page.
resources/js/vue/layouts/CheckoutLayout.vue Adds checkout page layout.
resources/js/vue/components/ProductSection.vue Minor template slot formatting adjustment.
resources/js/vue/components/ProductCard.vue Adds pricing card UI component.
resources/js/vue/app.ts Moves billing module JS setup/after-mount logic into Vue subtree.
resources/js/app.ts Re-exports from new Vue module entrypoint.
module.json Removes legacy module metadata file.
LICENSE Updates copyright year.
database/seeders/DatabaseSeeder.php Adds module DatabaseSeeder entrypoint.
composer.json Adds explicit version, updates autoload path to src/, and registers provider.
CLAUDE.md Updates e2e command to match lowercase module name.
app/Providers/RouteServiceProvider.php Removes module RouteServiceProvider.
.github/workflows/test.yml Updates module input to lowercase billing.
.github/workflows/release.yml Updates release workflow to read version from composer.json.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread composer.json
Comment on lines +18 to +19
"license": "proprietary",
"minimum-stability": "stable",
Comment on lines +13 to +18
public function test_module_database_seeder_runs(): void
{
$this->seed(DatabaseSeeder::class);

$this->assertTrue(true);
}
@sauce-base
sauce-base merged commit 071ac60 into main Jun 4, 2026
4 of 5 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.

3 participants