generated sotries
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
# Story 6.5: Data Export - Consultation Records
|
||||
|
||||
## Epic Reference
|
||||
**Epic 6:** Admin Dashboard
|
||||
|
||||
## User Story
|
||||
As an **admin**,
|
||||
I want **to export consultation/booking data**,
|
||||
So that **I can analyze and report on consultation history**.
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
### Export Options
|
||||
- [ ] Export all consultations
|
||||
|
||||
### Filters
|
||||
- [ ] Date range
|
||||
- [ ] Consultation type (free/paid)
|
||||
- [ ] Status (approved/completed/no-show/cancelled)
|
||||
- [ ] Payment status
|
||||
|
||||
### Export Includes
|
||||
- [ ] Client name
|
||||
- [ ] Date and time
|
||||
- [ ] Consultation type
|
||||
- [ ] Status
|
||||
- [ ] Payment status
|
||||
- [ ] Problem summary
|
||||
|
||||
### Formats
|
||||
- [ ] CSV format
|
||||
- [ ] PDF format with professional layout and branding
|
||||
|
||||
## Technical Notes
|
||||
|
||||
```php
|
||||
public function exportConsultationsPdf(Request $request)
|
||||
{
|
||||
$consultations = Consultation::query()
|
||||
->with('user')
|
||||
->when($request->date_from, fn($q) => $q->where('scheduled_date', '>=', $request->date_from))
|
||||
->when($request->status, fn($q) => $q->where('status', $request->status))
|
||||
->get();
|
||||
|
||||
$pdf = Pdf::loadView('exports.consultations', compact('consultations'));
|
||||
|
||||
return $pdf->download('consultations-export.pdf');
|
||||
}
|
||||
```
|
||||
|
||||
## Definition of Done
|
||||
- [ ] All filters work correctly
|
||||
- [ ] CSV export accurate
|
||||
- [ ] PDF professionally formatted
|
||||
- [ ] Large summaries handled in PDF
|
||||
- [ ] Tests pass
|
||||
|
||||
## Estimation
|
||||
**Complexity:** Medium | **Effort:** 3 hours
|
||||
Reference in New Issue
Block a user