Repository navigation
feat(facility): settings for location, opening details and price list… - #169
Conversation
|
@Bolajiomo99 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
@Bolajiomo99 Thanks for the PR. It can't be merged yet. To unblock it: Merge conflicts: this branch conflicts with Push to this same branch and CI will re-run. Once it's green and conflict-free, it'll be reviewed for merge. |
|
@Bolajiomo99 This PR now has merge conflicts with git fetch upstream # upstream = https://github.com/DocForum/docforum-web.git
git rebase upstream/main
# resolve the conflicts, re-run the tests, then:
git push --force-with-leaseThe usual culprits are shared docs like Automated message. It won't repeat unless the PR conflicts again after your next push. |
|
@Bolajiomo99 CI is failing on this branch against the latest Frontend (typecheck + test + build)
This PR also conflicts with |
5f7a052 to
ccc5737
Compare
|
@Bolajiomo99 The Browser (journeys + accessibility + visual) job fails the visual regression check: the rendered page no longer matches the committed baseline: If the visual change is intentional, regenerate those baselines in the same Linux/Playwright setup CI uses (see the visual-testing notes in |
🔎 Preview build (downloadable artifact)Download the preview artifact · build log
|
|
@Bolajiomo99 After updating this branch with Unit tests ( The price-version mock data now has twice the rows the test expects. It looks like both your seed and Browser (visual): Then push. |
|
@Bolajiomo99 Still the same test failure as my earlier comment: |
afeezorobsco-cyber
left a comment
There was a problem hiding this comment.
Malware scan clean, all checks green.
Closes #56
Summary
This PR implements issue #56 — Phase W4 Facility settings: location, opening details and price list. It gives facility owners and staff a single, dedicated Facility settings screen (/facility/settings) where they can:
The screen is role-gated to the facility role, added to the header navigation, and cross-linked from every existing facility page tab bar so it is discoverable from the fulfillment queue, order verification, team management and payouts screens.
This implements the facility management flow described in the PRD §4 facility core flows (Phase W4).
Description
Background
Facilities were already able to manage staff ([Phase W4] Facility staff accounts: invite, list and remove #51), verify orders ([Phase W4] Scan-to-verify orders with the device camera #52) and view their payout ledger ([Phase W4] Facility payout ledger with per-order escrow status and terms #53), but they had no way to self-serve the data that patients and the platform depend on most:
Without this screen, every one of those changes required a manual backend/database change, which is unscalable and error-prone. [Phase W4] Facility settings: location, opening details and price list #56 closes that gap.
What was built
src/features/facility-settings/components/LocationContactEditor.tsx
src/features/facility-settings/components/PriceListEditor.tsx
src/features/facility-settings/hooks/useUnsavedChangesGuard.ts
The app uses HashRouter, which is not a data router, so useBlocker / unstable_usePrompt are unavailable. The guard therefore:
The guard is active while either editor has unsaved changes, so the two editors are combined via the FacilitySettingsView wrapper.
Assumed API contract (dependency not yet landed)
This feature depends on two docforum-core issues that have not landed yet:
Because of that, the endpoint shapes below are assumed and mirrored in src/types/models.ts. They are recorded in ARCHITECTURE_ESSENTIALS.md under "Known assumptions" so they can be reconciled once the backend lands. No deviation will be silent — this section is the contract to check.
Method Path Body
GET /facilities/:facilityId/settings —
PATCH /facilities/:facilityId/settings FacilitySettingsInput
GET /catalog/items?query= —
GET /facilities/:facilityId/prices —
POST /facilities/:facilityId/prices FacilityPriceInput
All calls go through docforum-core's API via apiFetch — no direct Stellar/escrow calls are made from this repo (architecture hard rule 1).
Important note for the maintainer
If docforum-core#74 / [Platform] Demo mode for the public preview: explore every role without a backend #127 land with different shapes, the single places to change are:
The components consume those through React Query hooks only, so a shape change should be a contained update.
Acceptance checklist
Tests
New tests:
Results
npm run typecheck # clean
npm test # 43 files, 396/396 tests passing
npm run build # green (tsc -b && vite build)
npm run check:dist # green (no mock code in production bundle)
Screenshots
Captured with Playwright against the mock dev server, desktop (1440×1000) and mobile (390×844):
Screens changed / PRD flows
Follow-ups / notes for maintainers