Overview
ShelfWise enables B2B supplier relationships through a connection-based system. Tenants can enable supplier mode to offer products to other businesses, while buyer tenants can request connections to place orders.Enabling Supplier Mode
Before accepting connections, a tenant must enable supplier mode with business details:The
connection_approval_mode determines whether buyer connection requests are automatically approved or require manual review.Connection Lifecycle
Supplier connections follow a state-based workflow managed through theSupplierConnection model.
Connection States
| Status | Description | Can Order |
|---|---|---|
PENDING | Connection requested, awaiting approval | No |
APPROVED | Approved by supplier | Yes |
ACTIVE | Actively ordering | Yes |
SUSPENDED | Temporarily suspended | No |
REJECTED | Connection request denied | No |
Connection Status Methods
Connection Status Methods
app/Enums/ConnectionStatus.php:13Requesting a Connection
Buyer tenants initiate connections:Automatic approval (if enabled)
If the supplier has See:
connection_approval_mode set to auto-approve, the connection is immediately approved:app/Services/SupplierConnectionService.php:32Managing Active Connections
Suspend a connection
Suspend a connection
app/Services/SupplierConnectionService.php:82Reactivate a suspended connection
Reactivate a suspended connection
app/Services/SupplierConnectionService.php:100Update connection terms
Update connection terms
app/Services/SupplierConnectionService.php:113Credit Limit Management
Suppliers can set credit limits per connection to control outstanding balances:Retrieving Connections
For Suppliers
For Buyers
app/Services/SupplierConnectionService.php:130
Authorization
Connection management uses policy-based authorization:app/Http/Controllers/SupplierConnectionController.php:74
Multi-Tenancy Considerations
Supplier connections are intentionally cross-tenant relationships. Unlike typical ShelfWise models that filter by See:
tenant_id, connections link two different tenants:supplier_tenant_id- The supplier’s tenantbuyer_tenant_id- The buyer’s tenant
app/Models/SupplierConnection.php:91