refactor: migrate namespace from Core\Commerce to Core\Mod\Commerce

Align commerce module with the monorepo module structure by updating
all namespaces to use the Core\Mod\Commerce convention. This change
supports the recent monorepo separation and ensures consistency with
other modules.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Snider 2026-01-27 16:23:12 +00:00
parent a74a02f406
commit a774f4e285
148 changed files with 4345 additions and 535 deletions

View file

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Core\Commerce;
namespace Core\Mod\Commerce;
use Core\Events\AdminPanelBooting;
use Core\Events\ApiRoutesRegistering;
@ -11,11 +11,11 @@ use Core\Events\WebRoutesRegistering;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider;
use Core\Commerce\Listeners\ProvisionSocialHostSubscription;
use Core\Commerce\Listeners\RewardAgentReferralOnSubscription;
use Core\Commerce\Services\PaymentGateway\BTCPayGateway;
use Core\Commerce\Services\PaymentGateway\PaymentGatewayContract;
use Core\Commerce\Services\PaymentGateway\StripeGateway;
use Core\Mod\Commerce\Listeners\ProvisionSocialHostSubscription;
use Core\Mod\Commerce\Listeners\RewardAgentReferralOnSubscription;
use Core\Mod\Commerce\Services\PaymentGateway\BTCPayGateway;
use Core\Mod\Commerce\Services\PaymentGateway\PaymentGatewayContract;
use Core\Mod\Commerce\Services\PaymentGateway\StripeGateway;
/**
* Commerce Module Boot
@ -46,9 +46,9 @@ class Boot extends ServiceProvider
// Laravel event listeners (not lifecycle events)
Event::subscribe(ProvisionSocialHostSubscription::class);
Event::listen(\Core\Commerce\Events\SubscriptionCreated::class, RewardAgentReferralOnSubscription::class);
Event::listen(\Core\Commerce\Events\SubscriptionRenewed::class, Listeners\ResetUsageOnRenewal::class);
Event::listen(\Core\Commerce\Events\OrderPaid::class, Listeners\CreateReferralCommission::class);
Event::listen(\Core\Mod\Commerce\Events\SubscriptionCreated::class, RewardAgentReferralOnSubscription::class);
Event::listen(\Core\Mod\Commerce\Events\SubscriptionRenewed::class, Listeners\ResetUsageOnRenewal::class);
Event::listen(\Core\Mod\Commerce\Events\OrderPaid::class, Listeners\CreateReferralCommission::class);
}
public function register(): void
@ -59,21 +59,21 @@ class Boot extends ServiceProvider
);
// Core Services
$this->app->singleton(\Core\Commerce\Services\CommerceService::class);
$this->app->singleton(\Core\Commerce\Services\SubscriptionService::class);
$this->app->singleton(\Core\Commerce\Services\InvoiceService::class);
$this->app->singleton(\Core\Commerce\Services\PermissionMatrixService::class);
$this->app->singleton(\Core\Commerce\Services\CouponService::class);
$this->app->singleton(\Core\Commerce\Services\TaxService::class);
$this->app->singleton(\Core\Commerce\Services\CurrencyService::class);
$this->app->singleton(\Core\Commerce\Services\ContentOverrideService::class);
$this->app->singleton(\Core\Commerce\Services\DunningService::class);
$this->app->singleton(\Core\Commerce\Services\SkuParserService::class);
$this->app->singleton(\Core\Commerce\Services\SkuBuilderService::class);
$this->app->singleton(\Core\Commerce\Services\CreditNoteService::class);
$this->app->singleton(\Core\Commerce\Services\PaymentMethodService::class);
$this->app->singleton(\Core\Commerce\Services\UsageBillingService::class);
$this->app->singleton(\Core\Commerce\Services\ReferralService::class);
$this->app->singleton(\Core\Mod\Commerce\Services\CommerceService::class);
$this->app->singleton(\Core\Mod\Commerce\Services\SubscriptionService::class);
$this->app->singleton(\Core\Mod\Commerce\Services\InvoiceService::class);
$this->app->singleton(\Core\Mod\Commerce\Services\PermissionMatrixService::class);
$this->app->singleton(\Core\Mod\Commerce\Services\CouponService::class);
$this->app->singleton(\Core\Mod\Commerce\Services\TaxService::class);
$this->app->singleton(\Core\Mod\Commerce\Services\CurrencyService::class);
$this->app->singleton(\Core\Mod\Commerce\Services\ContentOverrideService::class);
$this->app->singleton(\Core\Mod\Commerce\Services\DunningService::class);
$this->app->singleton(\Core\Mod\Commerce\Services\SkuParserService::class);
$this->app->singleton(\Core\Mod\Commerce\Services\SkuBuilderService::class);
$this->app->singleton(\Core\Mod\Commerce\Services\CreditNoteService::class);
$this->app->singleton(\Core\Mod\Commerce\Services\PaymentMethodService::class);
$this->app->singleton(\Core\Mod\Commerce\Services\UsageBillingService::class);
$this->app->singleton(\Core\Mod\Commerce\Services\ReferralService::class);
// Payment Gateways
$this->app->singleton('commerce.gateway.btcpay', function ($app) {

View file

@ -2,12 +2,12 @@
declare(strict_types=1);
namespace Core\Commerce\Concerns;
namespace Core\Mod\Commerce\Concerns;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Core\Commerce\Models\ContentOverride;
use Core\Commerce\Models\Entity;
use Core\Commerce\Services\ContentOverrideService;
use Core\Mod\Commerce\Models\ContentOverride;
use Core\Mod\Commerce\Models\Entity;
use Core\Mod\Commerce\Services\ContentOverrideService;
/**
* Trait for models that can have content overrides.

View file

@ -1,10 +1,10 @@
<?php
namespace Core\Commerce\Console;
namespace Core\Mod\Commerce\Console;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Log;
use Core\Commerce\Models\Order;
use Core\Mod\Commerce\Models\Order;
class CleanupExpiredOrders extends Command
{

View file

@ -2,10 +2,10 @@
declare(strict_types=1);
namespace Core\Commerce\Console;
namespace Core\Mod\Commerce\Console;
use Illuminate\Console\Command;
use Core\Commerce\Services\ReferralService;
use Core\Mod\Commerce\Services\ReferralService;
/**
* Mature referral commissions that are past their maturation date.

View file

@ -2,9 +2,9 @@
declare(strict_types=1);
namespace Core\Commerce\Console;
namespace Core\Mod\Commerce\Console;
use Core\Commerce\Models\Subscription;
use Core\Mod\Commerce\Models\Subscription;
use Mod\Trees\Models\TreePlanting;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Log;

View file

@ -1,11 +1,11 @@
<?php
namespace Core\Commerce\Console;
namespace Core\Mod\Commerce\Console;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Log;
use Core\Commerce\Services\DunningService;
use Core\Commerce\Services\SubscriptionService;
use Core\Mod\Commerce\Services\DunningService;
use Core\Mod\Commerce\Services\SubscriptionService;
class ProcessDunning extends Command
{
@ -269,7 +269,7 @@ class ProcessDunning extends Command
$this->info('Stage 5: Expired Subscriptions');
if ($dryRun) {
$count = \Core\Commerce\Models\Subscription::query()
$count = \Core\Mod\Commerce\Models\Subscription::query()
->active()
->whereNotNull('cancelled_at')
->where('current_period_end', '<=', now())

View file

@ -2,10 +2,10 @@
declare(strict_types=1);
namespace Core\Commerce\Console;
namespace Core\Mod\Commerce\Console;
use Illuminate\Console\Command;
use Core\Commerce\Services\CurrencyService;
use Core\Mod\Commerce\Services\CurrencyService;
/**
* Refresh exchange rates from configured provider.
@ -30,7 +30,7 @@ class RefreshExchangeRates extends Command
$this->line("Provider: {$provider}");
// Check if rates need refresh
if (! $this->option('force') && ! \Core\Commerce\Models\ExchangeRate::needsRefresh()) {
if (! $this->option('force') && ! \Core\Mod\Commerce\Models\ExchangeRate::needsRefresh()) {
$this->info('Rates are still fresh. Use --force to refresh anyway.');
return self::SUCCESS;

View file

@ -1,10 +1,10 @@
<?php
namespace Core\Commerce\Console;
namespace Core\Mod\Commerce\Console;
use Core\Commerce\Models\Subscription;
use Core\Commerce\Notifications\UpcomingRenewal;
use Core\Commerce\Services\CommerceService;
use Core\Mod\Commerce\Models\Subscription;
use Core\Mod\Commerce\Notifications\UpcomingRenewal;
use Core\Mod\Commerce\Services\CommerceService;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Log;

View file

@ -1,11 +1,11 @@
<?php
namespace Core\Commerce\Console;
namespace Core\Mod\Commerce\Console;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Log;
use Core\Commerce\Models\Subscription;
use Core\Commerce\Services\UsageBillingService;
use Core\Mod\Commerce\Models\Subscription;
use Core\Mod\Commerce\Services\UsageBillingService;
/**
* Sync usage records to Stripe metered billing.

View file

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Core\Commerce\Contracts;
namespace Core\Mod\Commerce\Contracts;
/**
* Contract for entities that can place orders.

View file

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Core\Commerce\Controllers\Api;
namespace Core\Mod\Commerce\Controllers\Api;
use Core\Front\Controller;
use Core\Mod\Tenant\Models\Package;
@ -10,12 +10,12 @@ use Core\Mod\Tenant\Models\Workspace;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Core\Commerce\Models\Invoice;
use Core\Commerce\Models\Order;
use Core\Commerce\Models\Subscription;
use Core\Commerce\Services\CommerceService;
use Core\Commerce\Services\InvoiceService;
use Core\Commerce\Services\SubscriptionService;
use Core\Mod\Commerce\Models\Invoice;
use Core\Mod\Commerce\Models\Order;
use Core\Mod\Commerce\Models\Subscription;
use Core\Mod\Commerce\Services\CommerceService;
use Core\Mod\Commerce\Services\InvoiceService;
use Core\Mod\Commerce\Services\SubscriptionService;
/**
* Commerce REST API for MCP agents and external integrations.

View file

@ -2,11 +2,11 @@
declare(strict_types=1);
namespace Core\Commerce\Controllers;
namespace Core\Mod\Commerce\Controllers;
use Core\Front\Controller;
use Core\Commerce\Models\Invoice;
use Core\Commerce\Services\InvoiceService;
use Core\Mod\Commerce\Models\Invoice;
use Core\Mod\Commerce\Services\InvoiceService;
use Core\Mod\Tenant\Models\User;
use Illuminate\Http\Request;
use Illuminate\Http\Response;

View file

@ -2,12 +2,12 @@
declare(strict_types=1);
namespace Core\Commerce\Controllers;
namespace Core\Mod\Commerce\Controllers;
use Core\Front\Controller;
use Core\Commerce\Models\Entity;
use Core\Commerce\Services\PermissionLockedException;
use Core\Commerce\Services\PermissionMatrixService;
use Core\Mod\Commerce\Models\Entity;
use Core\Mod\Commerce\Services\PermissionLockedException;
use Core\Mod\Commerce\Services\PermissionMatrixService;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;

View file

@ -1,18 +1,18 @@
<?php
namespace Core\Commerce\Controllers\Webhooks;
namespace Core\Mod\Commerce\Controllers\Webhooks;
use Core\Front\Controller;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Core\Commerce\Models\Order;
use Core\Commerce\Models\Payment;
use Core\Commerce\Notifications\OrderConfirmation;
use Core\Commerce\Services\CommerceService;
use Core\Commerce\Services\PaymentGateway\BTCPayGateway;
use Core\Commerce\Services\WebhookLogger;
use Core\Mod\Commerce\Models\Order;
use Core\Mod\Commerce\Models\Payment;
use Core\Mod\Commerce\Notifications\OrderConfirmation;
use Core\Mod\Commerce\Services\CommerceService;
use Core\Mod\Commerce\Services\PaymentGateway\BTCPayGateway;
use Core\Mod\Commerce\Services\WebhookLogger;
/**
* Handle BTCPay Server webhooks.

View file

@ -1,6 +1,6 @@
<?php
namespace Core\Commerce\Controllers\Webhooks;
namespace Core\Mod\Commerce\Controllers\Webhooks;
use Carbon\Carbon;
use Core\Front\Controller;
@ -10,17 +10,17 @@ use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Core\Commerce\Models\Order;
use Core\Commerce\Models\Payment;
use Core\Commerce\Models\PaymentMethod;
use Core\Commerce\Models\Subscription;
use Core\Commerce\Notifications\OrderConfirmation;
use Core\Commerce\Notifications\PaymentFailed;
use Core\Commerce\Notifications\SubscriptionCancelled;
use Core\Commerce\Services\CommerceService;
use Core\Commerce\Services\InvoiceService;
use Core\Commerce\Services\PaymentGateway\StripeGateway;
use Core\Commerce\Services\WebhookLogger;
use Core\Mod\Commerce\Models\Order;
use Core\Mod\Commerce\Models\Payment;
use Core\Mod\Commerce\Models\PaymentMethod;
use Core\Mod\Commerce\Models\Subscription;
use Core\Mod\Commerce\Notifications\OrderConfirmation;
use Core\Mod\Commerce\Notifications\PaymentFailed;
use Core\Mod\Commerce\Notifications\SubscriptionCancelled;
use Core\Mod\Commerce\Services\CommerceService;
use Core\Mod\Commerce\Services\InvoiceService;
use Core\Mod\Commerce\Services\PaymentGateway\StripeGateway;
use Core\Mod\Commerce\Services\WebhookLogger;
/**
* Handle Stripe webhooks.

View file

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Core\Commerce\Data;
namespace Core\Mod\Commerce\Data;
/**
* A bundle of items (pipe-separated in SKU string).

View file

@ -1,8 +1,8 @@
<?php
namespace Core\Commerce\Data;
namespace Core\Mod\Commerce\Data;
use Core\Commerce\Models\Coupon;
use Core\Mod\Commerce\Models\Coupon;
/**
* Coupon validation result.

View file

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Core\Commerce\Data;
namespace Core\Mod\Commerce\Data;
/**
* A parsed SKU item with its options.

View file

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Core\Commerce\Data;
namespace Core\Mod\Commerce\Data;
/**
* A single option on a SKU.

View file

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Core\Commerce\Data;
namespace Core\Mod\Commerce\Data;
use Illuminate\Support\Collection;

View file

@ -2,12 +2,12 @@
declare(strict_types=1);
namespace Core\Commerce\Events;
namespace Core\Mod\Commerce\Events;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
use Core\Commerce\Models\Order;
use Core\Commerce\Models\Payment;
use Core\Mod\Commerce\Models\Order;
use Core\Mod\Commerce\Models\Payment;
/**
* Event fired when an order is successfully paid.

View file

@ -1,8 +1,8 @@
<?php
namespace Core\Commerce\Events;
namespace Core\Mod\Commerce\Events;
use Core\Commerce\Models\Subscription;
use Core\Mod\Commerce\Models\Subscription;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;

View file

@ -1,8 +1,8 @@
<?php
namespace Core\Commerce\Events;
namespace Core\Mod\Commerce\Events;
use Core\Commerce\Models\Subscription;
use Core\Mod\Commerce\Models\Subscription;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;

View file

@ -1,8 +1,8 @@
<?php
namespace Core\Commerce\Events;
namespace Core\Mod\Commerce\Events;
use Core\Commerce\Models\Subscription;
use Core\Mod\Commerce\Models\Subscription;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;

View file

@ -1,8 +1,8 @@
<?php
namespace Core\Commerce\Events;
namespace Core\Mod\Commerce\Events;
use Core\Commerce\Models\Subscription;
use Core\Mod\Commerce\Models\Subscription;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;

View file

@ -2,10 +2,10 @@
declare(strict_types=1);
namespace Core\Commerce\Exceptions;
namespace Core\Mod\Commerce\Exceptions;
use Exception;
use Core\Commerce\Models\Subscription;
use Core\Mod\Commerce\Models\Subscription;
/**
* Exception thrown when a subscription has exceeded its pause cycle limit.

View file

@ -2,10 +2,10 @@
declare(strict_types=1);
namespace Core\Commerce\Jobs;
namespace Core\Mod\Commerce\Jobs;
use Core\Commerce\Events\SubscriptionRenewed;
use Core\Commerce\Models\Subscription;
use Core\Mod\Commerce\Events\SubscriptionRenewed;
use Core\Mod\Commerce\Models\Subscription;
use Core\Mod\Tenant\Models\EntitlementLog;
use Core\Mod\Tenant\Models\WorkspacePackage;
use Core\Mod\Tenant\Services\EntitlementService;

View file

@ -2,12 +2,12 @@
declare(strict_types=1);
namespace Core\Commerce\Listeners;
namespace Core\Mod\Commerce\Listeners;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Support\Facades\Log;
use Core\Commerce\Events\OrderPaid;
use Core\Commerce\Services\ReferralService;
use Core\Mod\Commerce\Events\OrderPaid;
use Core\Mod\Commerce\Services\ReferralService;
/**
* Creates referral commission when an order is paid.

View file

@ -1,12 +1,12 @@
<?php
namespace Core\Commerce\Listeners;
namespace Core\Mod\Commerce\Listeners;
use Core\Commerce\Jobs\ProcessSubscriptionRenewal;
use Core\Commerce\Events\SubscriptionCancelled;
use Core\Commerce\Events\SubscriptionCreated;
use Core\Commerce\Events\SubscriptionRenewed;
use Core\Commerce\Events\SubscriptionUpdated;
use Core\Mod\Commerce\Jobs\ProcessSubscriptionRenewal;
use Core\Mod\Commerce\Events\SubscriptionCancelled;
use Core\Mod\Commerce\Events\SubscriptionCreated;
use Core\Mod\Commerce\Events\SubscriptionRenewed;
use Core\Mod\Commerce\Events\SubscriptionUpdated;
use Core\Mod\Tenant\Models\Package;
use Core\Mod\Tenant\Models\WorkspacePackage;
use Core\Mod\Tenant\Services\EntitlementService;

View file

@ -1,9 +1,9 @@
<?php
namespace Core\Commerce\Listeners;
namespace Core\Mod\Commerce\Listeners;
use Core\Commerce\Events\SubscriptionRenewed;
use Core\Commerce\Services\UsageBillingService;
use Core\Mod\Commerce\Events\SubscriptionRenewed;
use Core\Mod\Commerce\Services\UsageBillingService;
/**
* Reset usage records when a subscription renews.

View file

@ -2,9 +2,9 @@
declare(strict_types=1);
namespace Core\Commerce\Listeners;
namespace Core\Mod\Commerce\Listeners;
use Core\Commerce\Events\SubscriptionCreated;
use Core\Mod\Commerce\Events\SubscriptionCreated;
use Mod\Trees\Models\TreePlanting;
use Core\Mod\Tenant\Models\AgentReferralBonus;
use Illuminate\Support\Facades\Log;

View file

@ -2,9 +2,9 @@
declare(strict_types=1);
namespace Core\Commerce\Mail;
namespace Core\Mod\Commerce\Mail;
use Core\Commerce\Models\Invoice;
use Core\Mod\Commerce\Models\Invoice;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Attachment;

View file

@ -1,8 +1,8 @@
<?php
namespace Core\Commerce\Mcp\Tools;
namespace Core\Mod\Commerce\Mcp\Tools;
use Core\Commerce\Models\Coupon;
use Core\Mod\Commerce\Models\Coupon;
use Illuminate\Contracts\JsonSchema\JsonSchema;
use Laravel\Mcp\Request;
use Laravel\Mcp\Response;

View file

@ -1,8 +1,8 @@
<?php
namespace Core\Commerce\Mcp\Tools;
namespace Core\Mod\Commerce\Mcp\Tools;
use Core\Commerce\Models\Subscription;
use Core\Mod\Commerce\Models\Subscription;
use Core\Mod\Tenant\Models\Workspace;
use Illuminate\Contracts\JsonSchema\JsonSchema;
use Laravel\Mcp\Request;

View file

@ -1,8 +1,8 @@
<?php
namespace Core\Commerce\Mcp\Tools;
namespace Core\Mod\Commerce\Mcp\Tools;
use Core\Commerce\Models\Invoice;
use Core\Mod\Commerce\Models\Invoice;
use Illuminate\Contracts\JsonSchema\JsonSchema;
use Laravel\Mcp\Request;
use Laravel\Mcp\Response;

View file

@ -1,9 +1,9 @@
<?php
namespace Core\Commerce\Mcp\Tools;
namespace Core\Mod\Commerce\Mcp\Tools;
use Core\Commerce\Models\Subscription;
use Core\Commerce\Services\SubscriptionService;
use Core\Mod\Commerce\Models\Subscription;
use Core\Mod\Commerce\Services\SubscriptionService;
use Core\Mod\Tenant\Models\Workspace;
use Core\Mod\Tenant\Models\Package;
use Illuminate\Contracts\JsonSchema\JsonSchema;

View file

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Core\Commerce\Middleware;
namespace Core\Mod\Commerce\Middleware;
use Closure;
use Illuminate\Http\Request;

View file

@ -2,10 +2,10 @@
declare(strict_types=1);
namespace Core\Commerce\Middleware;
namespace Core\Mod\Commerce\Middleware;
use Core\Commerce\Models\Entity;
use Core\Commerce\Services\PermissionMatrixService;
use Core\Mod\Commerce\Models\Entity;
use Core\Mod\Commerce\Services\PermissionMatrixService;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Str;

View file

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Core\Commerce\Models;
namespace Core\Mod\Commerce\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

View file

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Core\Commerce\Models;
namespace Core\Mod\Commerce\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;

View file

@ -1,11 +1,11 @@
<?php
namespace Core\Commerce\Models;
namespace Core\Mod\Commerce\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Core\Commerce\Contracts\Orderable;
use Core\Mod\Commerce\Contracts\Orderable;
use Spatie\Activitylog\LogOptions;
use Spatie\Activitylog\Traits\LogsActivity;
@ -36,9 +36,9 @@ class Coupon extends Model
use HasFactory;
use LogsActivity;
protected static function newFactory(): \Core\Commerce\Database\Factories\CouponFactory
protected static function newFactory(): \Core\Mod\Commerce\Database\Factories\CouponFactory
{
return \Core\Commerce\Database\Factories\CouponFactory::new();
return \Core\Mod\Commerce\Database\Factories\CouponFactory::new();
}
protected $fillable = [

View file

@ -1,6 +1,6 @@
<?php
namespace Core\Commerce\Models;
namespace Core\Mod\Commerce\Models;
use Core\Mod\Tenant\Models\Workspace;
use Illuminate\Database\Eloquent\Model;

View file

@ -1,6 +1,6 @@
<?php
namespace Core\Commerce\Models;
namespace Core\Mod\Commerce\Models;
use Core\Mod\Tenant\Models\User;
use Core\Mod\Tenant\Models\Workspace;

View file

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Core\Commerce\Models;
namespace Core\Mod\Commerce\Models;
use Core\Mod\Tenant\Models\Workspace;
use Illuminate\Database\Eloquent\Factories\HasFactory;

View file

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Core\Commerce\Models;
namespace Core\Mod\Commerce\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Cache;

View file

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Core\Commerce\Models;
namespace Core\Mod\Commerce\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

View file

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Core\Commerce\Models;
namespace Core\Mod\Commerce\Models;
use Core\Mod\Tenant\Models\User;
use Illuminate\Database\Eloquent\Model;

View file

@ -1,6 +1,6 @@
<?php
namespace Core\Commerce\Models;
namespace Core\Mod\Commerce\Models;
use Core\Mod\Tenant\Models\Workspace;
use Illuminate\Database\Eloquent\Factories\HasFactory;
@ -35,9 +35,9 @@ class Invoice extends Model
{
use HasFactory;
protected static function newFactory(): \Core\Commerce\Database\Factories\InvoiceFactory
protected static function newFactory(): \Core\Mod\Commerce\Database\Factories\InvoiceFactory
{
return \Core\Commerce\Database\Factories\InvoiceFactory::new();
return \Core\Mod\Commerce\Database\Factories\InvoiceFactory::new();
}
protected $fillable = [

View file

@ -1,6 +1,6 @@
<?php
namespace Core\Commerce\Models;
namespace Core\Mod\Commerce\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

View file

@ -1,6 +1,6 @@
<?php
namespace Core\Commerce\Models;
namespace Core\Mod\Commerce\Models;
use Core\Mod\Tenant\Models\User;
use Core\Mod\Tenant\Models\Workspace;
@ -10,7 +10,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\Relations\MorphTo;
use Core\Commerce\Contracts\Orderable;
use Core\Mod\Commerce\Contracts\Orderable;
use Spatie\Activitylog\LogOptions;
use Spatie\Activitylog\Traits\LogsActivity;
@ -46,9 +46,9 @@ class Order extends Model
use HasFactory;
use LogsActivity;
protected static function newFactory(): \Core\Commerce\Database\Factories\OrderFactory
protected static function newFactory(): \Core\Mod\Commerce\Database\Factories\OrderFactory
{
return \Core\Commerce\Database\Factories\OrderFactory::new();
return \Core\Mod\Commerce\Database\Factories\OrderFactory::new();
}
protected $fillable = [
@ -291,7 +291,7 @@ class Order extends Model
*/
public function getFormattedTotalAttribute(): string
{
$currencyService = app(\Core\Commerce\Services\CurrencyService::class);
$currencyService = app(\Core\Mod\Commerce\Services\CurrencyService::class);
return $currencyService->format($this->total, $this->display_currency);
}
@ -301,7 +301,7 @@ class Order extends Model
*/
public function getFormattedSubtotalAttribute(): string
{
$currencyService = app(\Core\Commerce\Services\CurrencyService::class);
$currencyService = app(\Core\Mod\Commerce\Services\CurrencyService::class);
return $currencyService->format($this->subtotal, $this->display_currency);
}
@ -311,7 +311,7 @@ class Order extends Model
*/
public function getFormattedTaxAmountAttribute(): string
{
$currencyService = app(\Core\Commerce\Services\CurrencyService::class);
$currencyService = app(\Core\Mod\Commerce\Services\CurrencyService::class);
return $currencyService->format($this->tax_amount, $this->display_currency);
}
@ -321,7 +321,7 @@ class Order extends Model
*/
public function getFormattedDiscountAmountAttribute(): string
{
$currencyService = app(\Core\Commerce\Services\CurrencyService::class);
$currencyService = app(\Core\Mod\Commerce\Services\CurrencyService::class);
return $currencyService->format($this->discount_amount, $this->display_currency);
}
@ -341,7 +341,7 @@ class Order extends Model
return $amount;
}
return \Core\Commerce\Models\ExchangeRate::convert(
return \Core\Mod\Commerce\Models\ExchangeRate::convert(
$amount,
$this->display_currency,
$baseCurrency
@ -363,7 +363,7 @@ class Order extends Model
return $amount;
}
return \Core\Commerce\Models\ExchangeRate::convert(
return \Core\Mod\Commerce\Models\ExchangeRate::convert(
$amount,
$baseCurrency,
$this->display_currency

View file

@ -1,6 +1,6 @@
<?php
namespace Core\Commerce\Models;
namespace Core\Mod\Commerce\Models;
use Core\Mod\Tenant\Models\Package;
use Illuminate\Database\Eloquent\Model;

View file

@ -1,6 +1,6 @@
<?php
namespace Core\Commerce\Models;
namespace Core\Mod\Commerce\Models;
use Core\Mod\Tenant\Models\Workspace;
use Illuminate\Database\Eloquent\Factories\HasFactory;
@ -33,9 +33,9 @@ class Payment extends Model
{
use HasFactory;
protected static function newFactory(): \Core\Commerce\Database\Factories\PaymentFactory
protected static function newFactory(): \Core\Mod\Commerce\Database\Factories\PaymentFactory
{
return \Core\Commerce\Database\Factories\PaymentFactory::new();
return \Core\Mod\Commerce\Database\Factories\PaymentFactory::new();
}
protected $fillable = [

View file

@ -1,6 +1,6 @@
<?php
namespace Core\Commerce\Models;
namespace Core\Mod\Commerce\Models;
use Core\Mod\Tenant\Models\User;
use Core\Mod\Tenant\Models\Workspace;

View file

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Core\Commerce\Models;
namespace Core\Mod\Commerce\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

View file

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Core\Commerce\Models;
namespace Core\Mod\Commerce\Models;
use Core\Mod\Tenant\Models\User;
use Illuminate\Database\Eloquent\Model;

View file

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Core\Commerce\Models;
namespace Core\Mod\Commerce\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
@ -10,7 +10,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Str;
use Core\Commerce\Concerns\HasContentOverrides;
use Core\Mod\Commerce\Concerns\HasContentOverrides;
use Spatie\Activitylog\LogOptions;
use Spatie\Activitylog\Traits\LogsActivity;
@ -287,7 +287,7 @@ class Product extends Model
public function formatPrice(int $amount, ?string $currency = null): string
{
$currency = $currency ?? $this->currency;
$currencyService = app(\Core\Commerce\Services\CurrencyService::class);
$currencyService = app(\Core\Mod\Commerce\Services\CurrencyService::class);
return $currencyService->format($amount, $currency, isCents: true);
}

View file

@ -2,11 +2,11 @@
declare(strict_types=1);
namespace Core\Commerce\Models;
namespace Core\Mod\Commerce\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Core\Commerce\Concerns\HasContentOverrides;
use Core\Mod\Commerce\Concerns\HasContentOverrides;
/**
* Product Assignment - Links products to M2/M3 entities.

View file

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Core\Commerce\Models;
namespace Core\Mod\Commerce\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

View file

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Core\Commerce\Models;
namespace Core\Mod\Commerce\Models;
use Core\Mod\Tenant\Models\User;
use Illuminate\Database\Eloquent\Model;

View file

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Core\Commerce\Models;
namespace Core\Mod\Commerce\Models;
use Core\Mod\Tenant\Models\User;
use Illuminate\Database\Eloquent\Model;

View file

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Core\Commerce\Models;
namespace Core\Mod\Commerce\Models;
use Core\Mod\Tenant\Models\User;
use Illuminate\Database\Eloquent\Model;

View file

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Core\Commerce\Models;
namespace Core\Mod\Commerce\Models;
use Core\Mod\Tenant\Models\User;
use Illuminate\Database\Eloquent\Model;

View file

@ -1,6 +1,6 @@
<?php
namespace Core\Commerce\Models;
namespace Core\Mod\Commerce\Models;
use Core\Mod\Tenant\Models\User;
use Illuminate\Database\Eloquent\Factories\HasFactory;

View file

@ -1,6 +1,6 @@
<?php
namespace Core\Commerce\Models;
namespace Core\Mod\Commerce\Models;
use Core\Mod\Tenant\Models\Workspace;
use Core\Mod\Tenant\Models\WorkspacePackage;
@ -8,8 +8,8 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Core\Commerce\Events\SubscriptionCreated;
use Core\Commerce\Events\SubscriptionUpdated;
use Core\Mod\Commerce\Events\SubscriptionCreated;
use Core\Mod\Commerce\Events\SubscriptionUpdated;
use Spatie\Activitylog\LogOptions;
use Spatie\Activitylog\Traits\LogsActivity;
@ -39,9 +39,9 @@ class Subscription extends Model
use HasFactory;
use LogsActivity;
protected static function newFactory(): \Core\Commerce\Database\Factories\SubscriptionFactory
protected static function newFactory(): \Core\Mod\Commerce\Database\Factories\SubscriptionFactory
{
return \Core\Commerce\Database\Factories\SubscriptionFactory::new();
return \Core\Mod\Commerce\Database\Factories\SubscriptionFactory::new();
}
/**

View file

@ -1,6 +1,6 @@
<?php
namespace Core\Commerce\Models;
namespace Core\Mod\Commerce\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;

View file

@ -1,6 +1,6 @@
<?php
namespace Core\Commerce\Models;
namespace Core\Mod\Commerce\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

View file

@ -1,6 +1,6 @@
<?php
namespace Core\Commerce\Models;
namespace Core\Mod\Commerce\Models;
use Core\Mod\Tenant\Models\User;
use Core\Mod\Tenant\Models\Workspace;

View file

@ -1,6 +1,6 @@
<?php
namespace Core\Commerce\Models;
namespace Core\Mod\Commerce\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;

View file

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Core\Commerce\Models;
namespace Core\Mod\Commerce\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

View file

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Core\Commerce\Models;
namespace Core\Mod\Commerce\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

View file

@ -1,8 +1,8 @@
<?php
namespace Core\Commerce\Notifications;
namespace Core\Mod\Commerce\Notifications;
use Core\Commerce\Models\Subscription;
use Core\Mod\Commerce\Models\Subscription;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;

View file

@ -1,9 +1,9 @@
<?php
namespace Core\Commerce\Notifications;
namespace Core\Mod\Commerce\Notifications;
use Core\Commerce\Models\Order;
use Core\Commerce\Services\CommerceService;
use Core\Mod\Commerce\Models\Order;
use Core\Mod\Commerce\Services\CommerceService;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;

View file

@ -1,8 +1,8 @@
<?php
namespace Core\Commerce\Notifications;
namespace Core\Mod\Commerce\Notifications;
use Core\Commerce\Models\Subscription;
use Core\Mod\Commerce\Models\Subscription;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;

View file

@ -1,8 +1,8 @@
<?php
namespace Core\Commerce\Notifications;
namespace Core\Mod\Commerce\Notifications;
use Core\Commerce\Models\Invoice;
use Core\Mod\Commerce\Models\Invoice;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;

View file

@ -1,9 +1,9 @@
<?php
namespace Core\Commerce\Notifications;
namespace Core\Mod\Commerce\Notifications;
use Core\Commerce\Models\Refund;
use Core\Commerce\Services\CommerceService;
use Core\Mod\Commerce\Models\Refund;
use Core\Mod\Commerce\Services\CommerceService;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;

View file

@ -1,8 +1,8 @@
<?php
namespace Core\Commerce\Notifications;
namespace Core\Mod\Commerce\Notifications;
use Core\Commerce\Models\Subscription;
use Core\Mod\Commerce\Models\Subscription;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;

View file

@ -1,12 +1,12 @@
<?php
namespace Core\Commerce\Notifications;
namespace Core\Mod\Commerce\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
use Core\Commerce\Models\Subscription;
use Core\Mod\Commerce\Models\Subscription;
class SubscriptionPaused extends Notification implements ShouldQueue
{

View file

@ -1,9 +1,9 @@
<?php
namespace Core\Commerce\Notifications;
namespace Core\Mod\Commerce\Notifications;
use Core\Commerce\Models\Subscription;
use Core\Commerce\Services\CommerceService;
use Core\Mod\Commerce\Models\Subscription;
use Core\Mod\Commerce\Services\CommerceService;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;

128
Service/Boot.php Normal file
View file

@ -0,0 +1,128 @@
<?php
declare(strict_types=1);
namespace Core\Service\Commerce;
use Core\Commerce\Models\Order;
use Core\Events\AdminPanelBooting;
use Core\Front\Admin\AdminMenuRegistry;
use Core\Service\Contracts\ServiceDefinition;
use Core\Service\ServiceVersion;
use Illuminate\Support\ServiceProvider;
/**
* Commerce Service
*
* Orders and subscriptions service layer.
* Uses Core\Commerce as the engine.
*/
class Boot extends ServiceProvider implements ServiceDefinition
{
/**
* Events this service listens to.
*
* @var array<class-string, string>
*/
public static array $listens = [
AdminPanelBooting::class => 'onAdminPanel',
];
/**
* Bootstrap the service.
*/
public function boot(): void
{
app(AdminMenuRegistry::class)->register($this);
}
/**
* Get the service definition for seeding platform_services.
*/
public static function definition(): array
{
return [
'code' => 'commerce',
'module' => 'Commerce',
'name' => 'Commerce',
'tagline' => 'Orders and subscriptions',
'description' => 'Manage orders, subscriptions, and billing for your digital products.',
'icon' => 'shopping-cart',
'color' => 'green',
'entitlement_code' => 'core.srv.commerce',
'sort_order' => 70,
];
}
/**
* Admin menu items for this service.
*/
public function adminMenuItems(): array
{
$isServices = request()->routeIs('hub.services') && request()->route('service') === 'commerce';
return [
[
'group' => 'services',
'service' => 'commerce',
'priority' => 70,
'entitlement' => 'core.srv.commerce',
'item' => fn () => [
'label' => 'Commerce',
'icon' => 'shopping-cart',
'color' => 'green',
'href' => route('hub.services', ['service' => 'commerce']),
'active' => $isServices,
'children' => [
['label' => 'Dashboard', 'icon' => 'gauge', 'href' => route('hub.services', ['service' => 'commerce']), 'active' => $isServices && in_array(request()->route('tab'), [null, 'dashboard'])],
['label' => 'Orders', 'icon' => 'receipt', 'href' => route('hub.services', ['service' => 'commerce', 'tab' => 'orders']), 'active' => $isServices && request()->route('tab') === 'orders', 'badge' => $this->pendingOrders()],
['label' => 'Subscriptions', 'icon' => 'rotate', 'href' => route('hub.services', ['service' => 'commerce', 'tab' => 'subscriptions']), 'active' => $isServices && request()->route('tab') === 'subscriptions'],
['label' => 'Coupons', 'icon' => 'ticket', 'href' => route('hub.services', ['service' => 'commerce', 'tab' => 'coupons']), 'active' => $isServices && request()->route('tab') === 'coupons'],
],
],
],
];
}
/**
* Get pending orders count.
*/
protected function pendingOrders(): ?int
{
$count = Order::whereIn('status', ['pending', 'processing'])->count();
return $count ?: null;
}
/**
* Register admin panel components.
*/
public function onAdminPanel(AdminPanelBooting $event): void
{
// Service-specific admin routes could go here
// Components are registered by Core\Commerce
}
public function menuPermissions(): array
{
return [];
}
public function canViewMenu(?object $user, ?object $workspace): bool
{
return $user !== null;
}
public static function version(): ServiceVersion
{
return new ServiceVersion(1, 0, 0);
}
/**
* Service dependencies.
*/
public static function dependencies(): array
{
return [];
}
}

View file

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Core\Commerce\Services;
namespace Core\Mod\Commerce\Services;
use Illuminate\Cache\RateLimiter;
use Illuminate\Http\Request;

View file

@ -1,20 +1,20 @@
<?php
namespace Core\Commerce\Services;
namespace Core\Mod\Commerce\Services;
use Core\Mod\Tenant\Models\Package;
use Core\Mod\Tenant\Models\Workspace;
use Core\Mod\Tenant\Services\EntitlementService;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
use Core\Commerce\Contracts\Orderable;
use Core\Commerce\Models\Coupon;
use Core\Commerce\Models\Invoice;
use Core\Commerce\Models\Order;
use Core\Commerce\Models\OrderItem;
use Core\Commerce\Models\Payment;
use Core\Commerce\Models\Subscription;
use Core\Commerce\Services\PaymentGateway\PaymentGatewayContract;
use Core\Mod\Commerce\Contracts\Orderable;
use Core\Mod\Commerce\Models\Coupon;
use Core\Mod\Commerce\Models\Invoice;
use Core\Mod\Commerce\Models\Order;
use Core\Mod\Commerce\Models\OrderItem;
use Core\Mod\Commerce\Models\Payment;
use Core\Mod\Commerce\Models\Subscription;
use Core\Mod\Commerce\Services\PaymentGateway\PaymentGatewayContract;
/**
* Main commerce orchestration service.
@ -342,7 +342,7 @@ class CommerceService
}
// Dispatch OrderPaid event for referral tracking and other listeners
event(new \Core\Commerce\Events\OrderPaid($order, $payment));
event(new \Core\Mod\Commerce\Events\OrderPaid($order, $payment));
});
}
@ -491,7 +491,7 @@ class CommerceService
Payment $payment,
?float $amount = null,
?string $reason = null
): \Core\Commerce\Models\Refund {
): \Core\Mod\Commerce\Models\Refund {
$amountCents = $amount
? (int) ($amount * 100)
: (int) (($payment->amount - $payment->amount_refunded) * 100);

View file

@ -2,12 +2,12 @@
declare(strict_types=1);
namespace Core\Commerce\Services;
namespace Core\Mod\Commerce\Services;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Collection;
use Core\Commerce\Models\ContentOverride;
use Core\Commerce\Models\Entity;
use Core\Mod\Commerce\Models\ContentOverride;
use Core\Mod\Commerce\Models\Entity;
/**
* Content Override Service - Sparse override resolution for white-label commerce.

View file

@ -1,15 +1,15 @@
<?php
namespace Core\Commerce\Services;
namespace Core\Mod\Commerce\Services;
use Core\Mod\Tenant\Models\Package;
use Core\Mod\Tenant\Models\Workspace;
use Illuminate\Database\Eloquent\Model;
use Core\Commerce\Contracts\Orderable;
use Core\Commerce\Data\CouponValidationResult;
use Core\Commerce\Models\Coupon;
use Core\Commerce\Models\CouponUsage;
use Core\Commerce\Models\Order;
use Core\Mod\Commerce\Contracts\Orderable;
use Core\Mod\Commerce\Data\CouponValidationResult;
use Core\Mod\Commerce\Models\Coupon;
use Core\Mod\Commerce\Models\CouponUsage;
use Core\Mod\Commerce\Models\Order;
/**
* Coupon validation and application service.

View file

@ -1,15 +1,15 @@
<?php
namespace Core\Commerce\Services;
namespace Core\Mod\Commerce\Services;
use Core\Mod\Tenant\Models\User;
use Core\Mod\Tenant\Models\Workspace;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Core\Commerce\Models\CreditNote;
use Core\Commerce\Models\Order;
use Core\Commerce\Models\Refund;
use Core\Mod\Commerce\Models\CreditNote;
use Core\Mod\Commerce\Models\Order;
use Core\Mod\Commerce\Models\Refund;
class CreditNoteService
{

View file

@ -2,13 +2,13 @@
declare(strict_types=1);
namespace Core\Commerce\Services;
namespace Core\Mod\Commerce\Services;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Session;
use Core\Commerce\Models\ExchangeRate;
use Core\Mod\Commerce\Models\ExchangeRate;
/**
* Currency service for multi-currency support.

View file

@ -1,17 +1,17 @@
<?php
namespace Core\Commerce\Services;
namespace Core\Mod\Commerce\Services;
use Carbon\Carbon;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Core\Commerce\Models\Invoice;
use Core\Commerce\Models\Subscription;
use Core\Commerce\Notifications\AccountSuspended;
use Core\Commerce\Notifications\PaymentFailed;
use Core\Commerce\Notifications\PaymentRetry;
use Core\Commerce\Notifications\SubscriptionCancelled;
use Core\Commerce\Notifications\SubscriptionPaused;
use Core\Mod\Commerce\Models\Invoice;
use Core\Mod\Commerce\Models\Subscription;
use Core\Mod\Commerce\Notifications\AccountSuspended;
use Core\Mod\Commerce\Notifications\PaymentFailed;
use Core\Mod\Commerce\Notifications\PaymentRetry;
use Core\Mod\Commerce\Notifications\SubscriptionCancelled;
use Core\Mod\Commerce\Notifications\SubscriptionPaused;
use Core\Mod\Tenant\Services\EntitlementService;
/**

View file

@ -1,15 +1,15 @@
<?php
namespace Core\Commerce\Services;
namespace Core\Mod\Commerce\Services;
use Barryvdh\DomPDF\Facade\Pdf;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Storage;
use Core\Commerce\Mail\InvoiceGenerated;
use Core\Commerce\Models\Invoice;
use Core\Commerce\Models\InvoiceItem;
use Core\Commerce\Models\Order;
use Core\Commerce\Models\Payment;
use Core\Mod\Commerce\Mail\InvoiceGenerated;
use Core\Mod\Commerce\Models\Invoice;
use Core\Mod\Commerce\Models\InvoiceItem;
use Core\Mod\Commerce\Models\Order;
use Core\Mod\Commerce\Models\Payment;
use Core\Mod\Tenant\Models\Workspace;
/**

View file

@ -1,14 +1,14 @@
<?php
namespace Core\Commerce\Services\PaymentGateway;
namespace Core\Mod\Commerce\Services\PaymentGateway;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Str;
use Core\Commerce\Models\Order;
use Core\Commerce\Models\Payment;
use Core\Commerce\Models\PaymentMethod;
use Core\Commerce\Models\Subscription;
use Core\Mod\Commerce\Models\Order;
use Core\Mod\Commerce\Models\Payment;
use Core\Mod\Commerce\Models\PaymentMethod;
use Core\Mod\Commerce\Models\Subscription;
use Core\Mod\Tenant\Models\Workspace;
/**

View file

@ -1,12 +1,12 @@
<?php
namespace Core\Commerce\Services\PaymentGateway;
namespace Core\Mod\Commerce\Services\PaymentGateway;
use Core\Commerce\Models\Order;
use Core\Commerce\Models\Payment;
use Core\Commerce\Models\PaymentMethod;
use Core\Commerce\Models\Refund;
use Core\Commerce\Models\Subscription;
use Core\Mod\Commerce\Models\Order;
use Core\Mod\Commerce\Models\Payment;
use Core\Mod\Commerce\Models\PaymentMethod;
use Core\Mod\Commerce\Models\Refund;
use Core\Mod\Commerce\Models\Subscription;
use Core\Mod\Tenant\Models\Workspace;
/**

View file

@ -1,14 +1,14 @@
<?php
namespace Core\Commerce\Services\PaymentGateway;
namespace Core\Mod\Commerce\Services\PaymentGateway;
use Core\Mod\Tenant\Models\Workspace;
use Illuminate\Support\Facades\Log;
use Core\Commerce\Models\Order;
use Core\Commerce\Models\Payment;
use Core\Commerce\Models\PaymentMethod;
use Core\Commerce\Models\Refund;
use Core\Commerce\Models\Subscription;
use Core\Mod\Commerce\Models\Order;
use Core\Mod\Commerce\Models\Payment;
use Core\Mod\Commerce\Models\PaymentMethod;
use Core\Mod\Commerce\Models\Refund;
use Core\Mod\Commerce\Models\Subscription;
use Stripe\StripeClient;
/**

View file

@ -1,14 +1,14 @@
<?php
namespace Core\Commerce\Services;
namespace Core\Mod\Commerce\Services;
use Core\Mod\Tenant\Models\User;
use Core\Mod\Tenant\Models\Workspace;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Core\Commerce\Models\PaymentMethod;
use Core\Commerce\Services\PaymentGateway\StripeGateway;
use Core\Mod\Commerce\Models\PaymentMethod;
use Core\Mod\Commerce\Services\PaymentGateway\StripeGateway;
/**
* Service for managing payment methods.

View file

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Core\Commerce\Services;
namespace Core\Mod\Commerce\Services;
use Exception;

View file

@ -2,11 +2,11 @@
declare(strict_types=1);
namespace Core\Commerce\Services;
namespace Core\Mod\Commerce\Services;
use Core\Commerce\Models\Entity;
use Core\Commerce\Models\PermissionMatrix;
use Core\Commerce\Models\PermissionRequest;
use Core\Mod\Commerce\Models\Entity;
use Core\Mod\Commerce\Models\PermissionMatrix;
use Core\Mod\Commerce\Models\PermissionRequest;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;

View file

@ -2,9 +2,9 @@
declare(strict_types=1);
namespace Core\Commerce\Services;
namespace Core\Mod\Commerce\Services;
use Core\Commerce\Models\Entity;
use Core\Mod\Commerce\Models\Entity;
/**
* Result of a permission check in the Commerce Matrix.

View file

@ -2,11 +2,11 @@
declare(strict_types=1);
namespace Core\Commerce\Services;
namespace Core\Mod\Commerce\Services;
use Core\Commerce\Models\Entity;
use Core\Commerce\Models\Product;
use Core\Commerce\Models\ProductAssignment;
use Core\Mod\Commerce\Models\Entity;
use Core\Mod\Commerce\Models\Product;
use Core\Mod\Commerce\Models\ProductAssignment;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Support\Facades\DB;

View file

@ -1,6 +1,6 @@
<?php
namespace Core\Commerce\Services;
namespace Core\Mod\Commerce\Services;
/**
* Data transfer object for proration calculations.

View file

@ -2,18 +2,18 @@
declare(strict_types=1);
namespace Core\Commerce\Services;
namespace Core\Mod\Commerce\Services;
use Core\Mod\Tenant\Models\User;
use Mod\Bio\Models\Page;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Str;
use Core\Commerce\Models\Order;
use Core\Commerce\Models\Referral;
use Core\Commerce\Models\ReferralCode;
use Core\Commerce\Models\ReferralCommission;
use Core\Commerce\Models\ReferralPayout;
use Core\Mod\Commerce\Models\Order;
use Core\Mod\Commerce\Models\Referral;
use Core\Mod\Commerce\Models\ReferralCode;
use Core\Mod\Commerce\Models\ReferralCommission;
use Core\Mod\Commerce\Models\ReferralPayout;
/**
* Service for managing referrals and affiliate commissions.

View file

@ -1,10 +1,10 @@
<?php
namespace Core\Commerce\Services;
namespace Core\Mod\Commerce\Services;
use Core\Commerce\Models\Payment;
use Core\Commerce\Models\Refund;
use Core\Commerce\Notifications\RefundProcessed;
use Core\Mod\Commerce\Models\Payment;
use Core\Mod\Commerce\Models\Refund;
use Core\Mod\Commerce\Notifications\RefundProcessed;
use Core\Mod\Tenant\Models\User;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;

View file

@ -2,11 +2,11 @@
declare(strict_types=1);
namespace Core\Commerce\Services;
namespace Core\Mod\Commerce\Services;
use Core\Commerce\Data\ParsedItem;
use Core\Commerce\Data\SkuOption;
use Core\Commerce\Data\SkuParseResult;
use Core\Mod\Commerce\Data\ParsedItem;
use Core\Mod\Commerce\Data\SkuOption;
use Core\Mod\Commerce\Data\SkuParseResult;
/**
* Build compound SKU strings from structured data.

View file

@ -2,11 +2,11 @@
declare(strict_types=1);
namespace Core\Commerce\Services;
namespace Core\Mod\Commerce\Services;
use Core\Commerce\Models\Entity;
use Core\Commerce\Models\Product;
use Core\Commerce\Models\ProductAssignment;
use Core\Mod\Commerce\Models\Entity;
use Core\Mod\Commerce\Models\Product;
use Core\Mod\Commerce\Models\ProductAssignment;
use Illuminate\Support\Collection;
/**

Some files were not shown because too many files have changed in this diff Show more