Files
hub/app/Http/Controllers/CustomerController.php
kelly 11c67f491c feat: MySQL data import and parallel test fixes
- Import Cannabrands data from MySQL to PostgreSQL (strains, categories,
  companies, locations, contacts, products, images, invoices)
- Make migrations idempotent for parallel test execution
- Add ParallelTesting setup for separate test databases per process
- Update product type constraint for imported data
- Keep MysqlImport seeders for reference (data already in PG)
2025-12-04 19:26:38 -07:00

62 lines
2.2 KiB
PHP

<?php
namespace App\Http\Controllers;
use App\Models\Business;
class CustomerController extends Controller
{
/**
* Customers entry point - smart gateway to CRM Accounts.
*
* If CRM is enabled (via Sales Suite or CRM feature): redirect to /s/{business}/crm/accounts
* If CRM is disabled: show feature-disabled view
*/
public function index(Business $business)
{
// CRM is included in Sales Suite or can be enabled as standalone feature
if ($business->hasCrmAccess()) {
return redirect()->route('seller.business.crm.accounts.index', $business);
}
return view('seller.crm.feature-disabled', [
'business' => $business,
'feature' => 'Customers',
'description' => 'The Customers feature requires CRM to be enabled for your business.',
'benefits' => [
'Manage all your customer accounts in one place',
'Track contact information and order history',
'Build stronger customer relationships',
'Access customer insights and analytics',
],
]);
}
/**
* Individual customer view - redirect to CRM Account detail.
*
* If CRM is enabled (via Sales Suite or CRM feature): redirect to the account detail page
* If CRM is disabled: show feature-disabled view
*/
public function show(Business $business, $customer)
{
// CRM is included in Sales Suite or can be enabled as standalone feature
if ($business->hasCrmAccess()) {
// Redirect to CRM Account detail - $customer is the account ID
return redirect()->route('seller.business.crm.accounts.show', [$business, $customer]);
}
return view('seller.crm.feature-disabled', [
'business' => $business,
'feature' => 'Customers',
'description' => 'The Customers feature requires CRM to be enabled for your business.',
'benefits' => [
'Manage all your customer accounts in one place',
'Track contact information and order history',
'Build stronger customer relationships',
'Access customer insights and analytics',
],
]);
}
}