libra/docs/stories/story-8.9-admin-notificatio...

75 lines
1.7 KiB
Markdown

# Story 8.9: Admin Notification - New Booking
## Epic Reference
**Epic 8:** Email Notification System
## User Story
As an **admin**,
I want **to be notified when a client submits a booking request**,
So that **I can review and respond promptly**.
## Acceptance Criteria
### Trigger
- [ ] Sent on booking submission by client
### Recipient
- [ ] Admin email address
### Content
- [ ] "New Consultation Request"
- [ ] Client name (individual or company)
- [ ] Requested date and time
- [ ] Problem summary (full)
- [ ] Client contact info
- [ ] "Review Request" button/link
### Priority
- [ ] Clear indicator in subject line
### Language
- [ ] Admin language preference (or default)
## Technical Notes
```php
class NewBookingAdminNotification extends Notification
{
use Queueable;
public function __construct(
public Consultation $consultation
) {}
public function via(object $notifiable): array
{
return ['mail'];
}
public function toMail(object $notifiable): MailMessage
{
return (new MailMessage)
->subject('[Action Required] New Consultation Request')
->markdown('emails.admin.new-booking', [
'consultation' => $this->consultation,
'client' => $this->consultation->user,
]);
}
}
// Trigger in booking submission
$admin = User::where('user_type', 'admin')->first();
$admin?->notify(new NewBookingAdminNotification($consultation));
```
## Definition of Done
- [ ] Email sent to admin on new booking
- [ ] All client info included
- [ ] Problem summary shown
- [ ] Review link works
- [ ] Priority clear in subject
- [ ] Tests pass
## Estimation
**Complexity:** Low | **Effort:** 2 hours