# Befikreyy — Partner App

## Path
`c:\Users\Administrator\Desktop\projects\befikreyy`

## Routes (19 routes, prefix `/partnerapp`, name `pa.*`)
- splash, login (GET/POST), register (GET/POST), logout (POST)
- home, visits, visit (detail), visit.accept (POST), visit.reject (POST), visit.status (POST)
- earnings, profile, profile.update (POST), availability (POST toggle)
- help, contact, about

## Layout
`resources/views/layouts/app-mobile-partner.blade.php`
- Theme color #0e9f6e (green), vs orange #ff4a1c in customer app
- Header has online/offline toggle pill (form posts to `pa.availability`)
- Bottom nav 4 items: Home / Visits / Earnings / Profile

## Controller
`app/Http\Controllers\PartnerApp\PartnerAppController.php`
- Model: `App\Models\SubscriptionVisit` (table `subscription_visits`, NOT `partner_visits`)
- Column names: `scheduled_date`, `scheduled_slot`, `status` (scheduled/accepted/on_the_way/arrived/in_progress/completed/cancelled)
- `ensureProfile()` helper creates PartnerProfile on first access via `firstOrCreate(['user_id'], [...])`
- Earnings: aggregates via `SubscriptionVisit::where('partner_id', $profile->id)->with('booking')` (NOT `Booking::where('partner_id')` — bookings has customer_id, not partner_id)
- Visit accept/reject/status require `partner_id === $profile->id`, status transitions enforced

## Views (all 11 created in `resources/views/partnerapp/`)
- splash, login, register, home, visits, visit, earnings, profile, help, contact, about

## CSS
- File: `public/assets/bfk-partner-app.css?v=1` (~67KB)
- Base copy of `bfk-app.css` with orange→green recoloring
- Added partner-specific classes: .avail-pill .is-online/.is-offline, .partner-hero, .pa-kpi, .today-row, .today-time, .upcoming-row, .up-date, .visit-card, .vc-date, .vc-time, .vc-svc, .visit-pill-{scheduled|accepted|completed|cancelled}, .earnings-hero, .eh-amount, .eh-stats, .earn-row, .payout-info, .po-step, .quick-grid, .qg-card, .verify-row .is-done/.is-pending

## Demo partner
- rajesh@partner.befikreyy.com / partner123 (user_id=3, profile_id=1, has 3 visits)
- suresh@partner.befikreyy.com / partner123

## Critical gotchas fixed
- @endisset typo on bottom nav → changed to @endif
- SubscriptionVisit columns: scheduled_slot (not time_slot), no accepted_at column in DB
- Booking has no partner_id — use SubscriptionVisit to derive booking→total_paise
