libra/docs/stories/story-7.2-my-consultations-...

78 lines
2.0 KiB
Markdown

# Story 7.2: My Consultations View
## Epic Reference
**Epic 7:** Client Dashboard
## User Story
As a **client**,
I want **to view all my consultations**,
So that **I can track upcoming appointments and review past sessions**.
## Acceptance Criteria
### Upcoming Consultations Section
- [ ] Date and time
- [ ] Consultation type (free/paid)
- [ ] Status (approved/pending)
- [ ] Payment status (for paid)
- [ ] Download .ics calendar file button
### Pending Requests Section
- [ ] Submitted bookings awaiting approval
- [ ] Submission date
- [ ] Problem summary preview
- [ ] Status: "Pending Review"
### Past Consultations Section
- [ ] Historical consultations
- [ ] Status (completed/cancelled/no-show)
- [ ] Date and type
### Features
- [ ] Visual status indicators
- [ ] Sort by date (default: newest first for past)
- [ ] Pagination if many consultations
- [ ] No edit/cancel capabilities (read-only)
## Technical Notes
```php
new class extends Component {
use WithPagination;
public function with(): array
{
$user = auth()->user();
return [
'upcoming' => $user->consultations()
->approved()
->where('scheduled_date', '>=', today())
->orderBy('scheduled_date')
->orderBy('scheduled_time')
->get(),
'pending' => $user->consultations()
->pending()
->latest()
->get(),
'past' => $user->consultations()
->whereIn('status', ['completed', 'cancelled', 'no_show'])
->orWhere(fn($q) => $q->approved()->where('scheduled_date', '<', today()))
->latest('scheduled_date')
->paginate(10),
];
}
};
```
## Definition of Done
- [ ] All sections display correctly
- [ ] Calendar download works
- [ ] Status indicators clear
- [ ] Read-only (no actions)
- [ ] Pagination works
- [ ] Tests pass
## Estimation
**Complexity:** Medium | **Effort:** 3-4 hours