nexus-laravel-sales maintained by azaharizaman
Nexus Laravel Sales Adapter
This adapter provides Laravel-specific implementations for the Sales package, enabling integration with other Nexus packages.
Purpose
The Sales package is an atomic package that must remain independently publishable. This adapter layer provides the concrete implementations that integrate Sales with other packages like:
- Nexus\Receivable - For credit limit checking and invoice generation
- Nexus\Inventory - For stock reservation and availability checking
Installation
composer require azaharizaman/nexus-laravel-sales
Adapters Provided
ReceivableCreditLimitCheckerAdapter
Implements Nexus\Sales\Contracts\CreditLimitCheckerInterface by delegating to Nexus\Receivable\Contracts\CreditLimitCheckerInterface.
InventoryStockReservationAdapter
Implements Nexus\Sales\Contracts\StockReservationInterface by delegating to Nexus\Inventory\Contracts\ReservationManagerInterface.
ReceivableInvoiceManagerAdapter
Implements Nexus\Sales\Contracts\InvoiceManagerInterface by delegating to Nexus\Receivable\Contracts\ReceivableManagerInterface.
Service Provider
The SalesAdapterServiceProvider automatically binds the Sales interfaces to their adapter implementations when all required packages are available.
Architecture
This follows the Nexus Three-Layer Architecture:
- Atomic Layer (
packages/Sales) - Pure business logic, no external dependencies - Adapter Layer (
adapters/Laravel/Sales) - Framework-specific implementations - Application Layer - Uses adapters through interfaces
Dependencies
azaharizaman/nexus-sales- The atomic Sales packageazaharizaman/nexus-receivable- For credit checking and invoice generationazaharizaman/nexus-inventory- For stock reservationilluminate/support- Laravel framework componentsilluminate/database- Laravel database components