Summary of completed work: - Complete buyer portal (browse, cart, checkout, orders, invoices) - Complete seller portal (orders, manifests, fleet, picking) - Business onboarding wizards (buyer 4-step, seller 5-step) - Email verification and registration flows - Notification system for buyers and sellers - Payment term surcharges and pickup/delivery workflows - Filament admin resources (Business, Brand, Product, Order, Invoice, User) - 51 migrations executed successfully Renamed Company -> Business throughout codebase for consistency. Unified authentication flows with password reset. Added audit trail and telescope for debugging. Next: Week 4 Data Migration (Days 22-28) - Product migration (883 products from cannabrands_crm) - Company migration (81 buyer companies) - User migration (preserve password hashes) - Order history migration
82 lines
2.5 KiB
PHP
82 lines
2.5 KiB
PHP
<?php
|
|
|
|
namespace App\Notifications;
|
|
|
|
use App\Services\NotificationStyleService;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Notifications\Messages\MailMessage;
|
|
use Illuminate\Notifications\Notification;
|
|
|
|
class CompleteBusinessProfileNotification extends Notification
|
|
{
|
|
use Queueable;
|
|
|
|
public $progressPercentage;
|
|
public $nextStep;
|
|
|
|
/**
|
|
* Create a new notification instance.
|
|
*/
|
|
public function __construct($progressPercentage = 0, $nextStep = null)
|
|
{
|
|
$this->progressPercentage = $progressPercentage;
|
|
$this->nextStep = $nextStep;
|
|
}
|
|
|
|
/**
|
|
* Get the setup route based on user type
|
|
*/
|
|
private function getSetupRoute($notifiable): string
|
|
{
|
|
$userType = $notifiable->user_type ?? 'seller';
|
|
return $userType === 'buyer' ? route('buyer.setup.create', 1) : route('seller.setup.create', 1);
|
|
}
|
|
|
|
/**
|
|
* Get the notification's delivery channels.
|
|
*
|
|
* @return array<int, string>
|
|
*/
|
|
public function via(object $notifiable): array
|
|
{
|
|
return ['database'];
|
|
}
|
|
|
|
/**
|
|
* Get the mail representation of the notification.
|
|
*/
|
|
public function toMail(object $notifiable): MailMessage
|
|
{
|
|
return (new MailMessage)
|
|
->subject('Complete Your Business Profile - Cannabrands')
|
|
->line('Welcome to Cannabrands! To get started, please complete your business profile.')
|
|
->action('Complete Profile', $this->getSetupRoute($notifiable))
|
|
->line('This will help us verify your business and get you selling quickly.');
|
|
}
|
|
|
|
/**
|
|
* Get the array representation of the notification.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function toArray(object $notifiable): array
|
|
{
|
|
$style = NotificationStyleService::getStyle('business_setup');
|
|
|
|
return [
|
|
'type' => 'business_setup',
|
|
'title' => 'Complete Your Business Profile',
|
|
'message' => $this->progressPercentage > 0
|
|
? "You're {$this->progressPercentage}% complete. Continue setting up your business profile to start selling."
|
|
: 'Welcome to Cannabrands! Complete your business profile to get started.',
|
|
'action_url' => $this->getSetupRoute($notifiable),
|
|
'action_text' => 'Complete Profile',
|
|
'progress' => $this->progressPercentage,
|
|
'next_step' => $this->nextStep,
|
|
'icon' => $style['icon'],
|
|
'color' => $style['color']
|
|
];
|
|
}
|
|
}
|