Fix: Restoring Missing BFF Routes from the Original Lambda Contract
Fix: Restoring Missing BFF Routes from the Original Lambda Contract
Version: v0.1.86
Background
The myProp frontend communicates with backend services through a Backend-for-Frontend (BFF) compatibility layer located at src/app/api/bff/[...path]/route.ts. This layer acts as a proxy, translating requests from the Vue app into the correct calls against the letmc API.
The original Lambda app.js defined the full set of routes the Vue app expects. During the migration to the Next.js BFF layer, several of these routes were not carried over, leaving gaps between what the app called and what the BFF could handle.
What Was Missing
The following routes existed in the original Lambda contract but were absent from the BFF handler:
POST Routes
POST /company/theme/generic
Fetches the generic Vuetify theme colour configuration used as the base white-label theme for all agency portals.
POST /company/theme/account
Fetches per-account theme overrides, allowing individual agency accounts to customise their brand colours on top of the generic theme.
POST /company/urls/account
Fetches per-account URL configuration, used to resolve agency-specific routing and link behaviour.
POST /company/dropdowns
Fetches enum dropdown values used across the portal — status labels, property types, tenancy types, and other enumerated lists that populate form fields and display values.
POST /accounts/tenant/prospect/application-data
Fetches application data for a tenant prospect, used during the onboarding and referencing flow.
POST /properties/tenancies/listings
Fetches tenancy listings associated with properties, used in landlord and tenant views to display live tenancy information.
GET Routes
GET /download/:fileID
Proxies file download requests through to the letmc API. The BFF resolves the fileID parameter and forwards the request to:
GET /{clientName}/download/{fileID}?api_key=<key>
This route is essential for downloading documents such as tenancy agreements, financial statements, inspection reports, and any other files surfaced in the portal.
Fix Applied
- All missing
POSTroutes have been registered in thePOST_ROUTESsection ofsrc/app/api/bff/[...path]/route.ts. - The
GET /download/:fileIDroute has been registered in theGET_ROUTESsection with correct proxy logic to the letmc API, includingapi_keyquery parameter forwarding.
Impact
These missing routes meant the Vue app was silently failing or receiving unhandled responses for a significant set of core features:
- Theming — agency brand colours and per-account overrides were not loading correctly.
- Configuration — per-account URLs could not be resolved.
- Forms — dropdown/enum values were unavailable, breaking form population.
- Tenant onboarding — prospect application data could not be fetched.
- Property views — tenancy listings were not rendering.
- File access — document and statement downloads were broken.
All of the above are now correctly routed through the BFF layer.
Related Files
src/app/api/bff/[...path]/route.ts— BFF route handler (POST_ROUTES and GET_ROUTES sections updated)