# PRD Screen / Page Coverage Audit

Source of truth: `PRD v1.2 — Web Telemedicine & Multi-Tenant Pharmacy Marketplace.md`

Generated: 2026-08-28

Summary totals (items covered in this audit):

- Total PRD screens/capabilities reviewed: 33
- Complete: 25
- Partial: 4
- Backend Only: 1
- Placeholder: 2
- Missing: 1
- Deferred: 0

Priority findings (short):

- P0 missing/urgent before production: seller orders listing route; customer order history route (orders.index) — these are needed for basic order visibility.
- P1 recommended before go-live: seller inventory & finance pages; admin user management; shipment tracking UI.
- Deferred/future: multi-seller in single checkout (PRD Phase 6+, not in scope for MVP).

Production blockers (explicit):

- Payment guard and prescription locks are implemented in `app/Services/PaymentGuardService.php` and used by `PaymentService` (not a blocker).
- Missing customer order index and seller orders index routes mean users cannot browse order history from UI — considered P0 blockers for visibility.

---

Audit details grouped by PRD section. For each screen/capability I list: PRD module — Screen / page name — Intended role — route(s) — controller — blade/view — backend/service availability — authorization (where applicable) — status — missing functionality — priority.

PUBLIC

- Home / Marketplace — Customer / Public — `/` — `MarketplaceController@index` — `resources/views/marketplace/index.blade.php` — Product regulatory checks via `ProductRegulatoryService` used in controller — Authorization: public — Status: COMPLETE — Missing: none — Priority: P1 (analytics, search tuning)

- Product Detail — Customer / Public — `/produk/{product}` — `MarketplaceController@show` — `resources/views/marketplace/show.blade.php` — Uses `ProductRegulatoryService` — Authorization: public — Status: COMPLETE — Missing: none — Priority: P1

- Doctor Directory & Detail — Public / Customer — `/dokter`, `/dokter/{doctor}` — `DoctorDirectoryController` — `resources/views/doctors/index.blade.php`, `resources/views/doctors/show.blade.php` — API controller exists for doctor endpoints in `/app/Http/Controllers/Api/V1/DoctorController.php` — Status: COMPLETE

AUTH

- Login / Register — Guest — `/masuk`, `/daftar` — `Auth\AuthenticatedSessionController`, `Auth\RegisteredUserController` — `resources/views/auth/login.blade.php`, `resources/views/auth/register.blade.php` — Status: COMPLETE

- Profile — Authenticated Customer — `/profil` (PATCH) + show — `CustomerProfileController@show|update` — `resources/views/profile/show.blade.php` — Status: COMPLETE

- Notifications — Authenticated — `/notifikasi` — `NotificationController@index|update` — `resources/views/notifications/index.blade.php` — Status: COMPLETE

- Referrals dashboard — Authenticated — `/ajak-teman` — `ReferralDashboardController` — `resources/views/referrals/index.blade.php` — Status: COMPLETE

CUSTOMER

- Cart — Customer — `/keranjang` — `CartController` — `resources/views/cart/index.blade.php` — `CartService` present — Status: COMPLETE

- Checkout (cart → payment) — Customer — `/checkout` (GET/POST) — `CheckoutController@index|store|applyCoupon` — `resources/views/checkout/index.blade.php`, `resources/views/checkout/show.blade.php` — uses `CheckoutService`, `CouponService`, `PaymentGuardService`, `PaymentService` — Status: COMPLETE — Notes: prescription-aware PaymentGuard enforced server-side.

- Address management — Customer — `/alamat` — `CustomerAddressController` — `resources/views/addresses/index.blade.php` — Status: COMPLETE

- Prescription upload (customer) — Customer — `/pesanan/{order}/resep` (GET/POST) — `PrescriptionController@create|store` — `resources/views/prescriptions/create.blade.php` — stores files via Storage; `file` route uses signed URL and Gate checks — Status: COMPLETE

- Payment (initiate) — Customer — `/pesanan/{order}/bayar` (POST) — `CheckoutController@pay` → delegates to `PaymentService` — Status: COMPLETE

- Order detail (customer) — Customer — `/pesanan/{order}` — `CheckoutController@show` — `resources/views/checkout/show.blade.php` — Status: COMPLETE

 - Order list (customer) — Customer — `/pesanan` — `CustomerOrderController@index` — `resources/views/orders/index.blade.php` — Controller, route and view are implemented and guarded by auth — Status: COMPLETE — Missing: none — Priority: P0 (resolved)

- Shipment tracking (customer) — Customer — No customer-facing tracking page found; webhooks exist (Biteship) and shipping gateway services exist (`app/Services/*ShippingGateway.php`) — Status: MISSING — Missing: customer shipment tracking UI and route — Priority: P1

MARKETPLACE

- Product search/list — Customer — handled by `MarketplaceController@index` and API `Api/V1/CatalogController` — Status: COMPLETE

- Product master / Product submissions (platform flow) — Admin/Product team — admin product submissions UI exists (`admin.product-submissions`) and `AdminProductSubmissionController` — Status: PARTIAL — Missing: full master product CRUD (admin product create/edit separate from submissions) — Priority: P1

CHECKOUT

- Full checkout flow (single-tenant checkout) — Customer — routes and services present: `CheckoutService`, `PaymentGuardService`, `PaymentService`, `InventoryReservationService` — Status: COMPLETE — Notes: Single-seller-per-checkout enforced (database model supports platform_orders + seller_orders). Recommended: test edge cases for reservation window.

PRESCRIPTION

- Prescription upload & storage — Customer → Seller flow — `PrescriptionController` present, private storage used, signed file route uses Gate — Status: COMPLETE

- Prescription review queue (seller) — Pharmacist / Seller — `/apotek/{tenant}/resep/{review}` mapped to `PharmacistDashboardController@show` and update route — view `resources/views/seller/review.blade.php` exists — Status: COMPLETE

- Pharmacist approve / reject — Seller — PATCH `/apotek/{tenant}/resep/{review}` -> `PharmacistDashboardController@update` — Status: COMPLETE — Missing: none core; rejection reasons enforced in UI.

- Prescription revision versioning & audit logs — Database models and `prescription_review_logs` usage present in codepaths — Status: COMPLETE

ORDER

- Platform order / seller order backend — Models and controllers exist (`PaymentService`, `SellerOrderFulfillmentController`, `SettlementController`, `PlatformReportController`) — Status: COMPLETE (backend)

 - Seller orders listing/management — Seller — `/apotek/{tenant}/pesanan` -> `SellerWorkspaceController::orders` — `resources/views/seller/workspace.blade.php` (section `orders`) — Route, controller and workspace UI panel implemented and tenant-scoped — Status: COMPLETE — Missing: none — Priority: P0 (resolved)

SELLER

- Seller Dashboard — Seller — `/apotek/{tenant}/dashboard` -> `PharmacistDashboardController@index` — `resources/views/seller/dashboard.blade.php` — Status: COMPLETE

- Listing management — Seller — `/apotek/{tenant}/produk` (index/store/edit/update) -> `SellerListingController` and views `resources/views/seller/listings/*` — Status: COMPLETE

 - Inventory management — Seller — `/apotek/{tenant}/inventori` -> `SellerWorkspaceController::inventory` — `resources/views/seller/workspace.blade.php` (section `inventory`) — Route, controller and workspace UI panel implemented; backend models (`OutletInventory`, `InventoryBatch`) and queries present — Status: COMPLETE — Missing: none — Priority: P1 (resolved)

- Stock adjustment / batch intake — Seller — `inventory_batches` not surfaced in UI; services exist for reservation but batch intake screens are absent — Status: MISSING — Priority: P1

- Pharmacists management — Seller — routes `seller.apoteker` exist and `resources/views/seller/pharmacists.blade.php` present — Status: COMPLETE

- Coupons / promotions — Seller — `seller.coupons` routes and view present — Status: COMPLETE

- Seller finance / settlement UI — Seller — referenced in layout but specific seller finance routes are missing; platform settlements exist for admin — Status: MISSING/BACKEND ONLY — Priority: P1

TENANT ONBOARDING

- Tenant registration / onboarding — Customer/Seller — `/daftar-apotek` -> `TenantOnboardingController` and `resources/views/seller/onboarding.blade.php` — Status: COMPLETE

- Outlet setup / license upload / pharmacist setup — routes and views for outlets, licenses, pharmacists exist under seller prefix and TenantLicenseController — Status: COMPLETE

PLATFORM ADMIN

- Admin Dashboard — Platform Admin — `/platform/dashboard` -> `AdminDashboardController` & `resources/views/admin/dashboard.blade.php` — Status: COMPLETE

- Tenant verification / onboarding list — `/platform/onboarding` -> `AdminTenantVerificationController@index` and view `resources/views/admin/onboarding.blade.php` — Status: COMPLETE

- Product regulatory classification and global product controls — PATCH routes `/platform/produk/{product}/status` and `/platform/produk/{product}/regulasi` -> `ProductAvailabilityController`, `ProductRegulatoryClassificationController` exist; admin views reference product submission lists — Status: COMPLETE

- Admin product submissions workflow — `AdminProductSubmissionController` & view exists — Status: COMPLETE

 - Admin user / customer management UI — index/listing — `/platform/customers` -> `AdminWorkspaceController::customers` — `resources/views/admin/workspace.blade.php` (section `customers`) — Index/listing implemented and paginated; full CRUD (edit/delete/detail workflows) are not present in the admin workspace and would be additional work — Status: PARTIAL — Priority: P1

- Admin doctor management — APIs exist under `routes/api.php` but an admin-facing doctor management page is referenced in admin layout but route not present — Status: PARTIAL

COMPLIANCE

- Compliance controls (kill switch, product disable) — Admin patch routes implemented (`admin.products.status`) — Status: COMPLETE

- Prescription audit / review — Admin/Product/Compliance views for submissions and prescription review audit exist — Status: PARTIAL (most flows present; admin audit reporting may need expansion)

FINANCE / SETTLEMENT

- Refunds — Admin refund pages and `RefundController` present — `resources/views/admin/refunds.blade.php` — Status: COMPLETE

- Commission management — `CommissionRuleController` and admin views exist — Status: COMPLETE

- Settlements — `SettlementController` and `resources/views/admin/settlements.blade.php` exist — Status: COMPLETE

REPORTING

- Platform & Seller reports — `PlatformReportController`, `SellerReportController` and views `admin/reports.blade.php`, `seller/reports.blade.php` exist — Status: COMPLETE

SETTINGS

- Platform settings — Admin settings screens are not comprehensive in this codebase; `admin.workspace.blade.php` exists but concrete settings routes are limited — Status: PARTIAL

- Seller settings — referenced in seller layout as `seller.settings.*` but no routes implemented — Status: MISSING — Priority: P1

SIDEBAR / NAVIGATION & PERMISSIONS (summary)

- Seller sidebar (`resources/views/components/layouts/seller.blade.php`) lists several items (orders, inventory, listings, prescriptions, outlets, pharmacists, coupons, finance, reports, settings). Many menu items are protected by tenant-role middleware on their routes where routes exist. Several items referenced in the sidebar (`seller.inventory.*`, `seller.orders.index`, `seller.finance.*`, `seller.settings.*`) do not have corresponding routes — this leads to dead links and inconsistent UX. Recommendation: either implement the routes or remove the links/placeholders until implemented.

- Platform admin layout lists broad categories; many admin routes exist (onboarding, product submissions, coupons, refunds, settlements, commissions, reports) but admin user/doctor management pages are missing (referenced but not implemented).

NOTES ON SERVER-SIDE GUARDS & SERVICES

- Payment guard / prescription enforcement: implemented in `app/Services/PaymentGuardService.php` and used in `PaymentService::pay()` — this satisfies PRD P0 rules about backend enforcement (Payment provider creation blocked until prescription approved).

- Regulatory rule engine: `app/Services/ProductRegulatoryService.php` is present and injected into controllers (Catalog, Marketplace, SellerListing) — good alignment with PRD.

- Inventory and reservation: `InventoryReservationService.php` is present; outlet inventory model present; UI lacking — backend ready.

- Coupon service and revalidation: `app/Services/CouponService.php` exists and used by PaymentGuard and PaymentService — implemented.

RECOMMENDATIONS & PRIORITIES

- P0 (blockers to fix before production):
  - Add `orders.index` route and navigation entry for customer order history (now controller + view exist). Users cannot view order history today. (File: `routes/web.php`) 
  - Add `seller.orders.index` (GET) route + controller action to list seller orders per tenant (sidebar references it). Without this sellers cannot manage/see full order list.

- P1 (important before go-live):
  - Implement seller inventory UI (index, adjust stock, batch intake).
  - Implement seller finance/settlement UI (seller-level settlements & statement).
  - Implement customer shipment tracking UI (order shipment pages or tracking component) that uses existing shipping webhooks and shipment models.
  - Implement admin user/doctor management pages or remove links from admin workspace.

- Deferred / future (phase 2+):
  - Multi-seller single checkout UI (PRD Phase 6). Database supports multi-seller orders but UI/workflow deferred.

Appendix: quick mapping of important files discovered

- Routes: [routes/web.php](routes/web.php)
- Core services: [app/Services/PaymentGuardService.php](app/Services/PaymentGuardService.php), [app/Services/PaymentService.php](app/Services/PaymentService.php), [app/Services/ProductRegulatoryService.php](app/Services/ProductRegulatoryService.php)
- Prescription controller: [app/Http/Controllers/PrescriptionController.php](app/Http/Controllers/PrescriptionController.php) + view `resources/views/prescriptions/create.blade.php`
- Seller layout (menus): `resources/views/components/layouts/seller.blade.php`

---

If you want, I can now:

- (A) Generate a prioritized ticket list (detailed steps & file suggestions) to implement P0/P1 items, or
- (B) Open each missing area (routes/controllers/views) as individual TODOs and implement them.

Tell me which next step you prefer.
