generated sotries

This commit is contained in:
Naser Mansour
2025-12-20 21:04:23 +02:00
parent d889b24f12
commit 8f95089814
65 changed files with 9501 additions and 0 deletions
@@ -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