Aman-Mittal opened a new pull request, #169: URL: https://github.com/apache/fineract-consumer-facing/pull/169
Closes #168. This puts the generated BFF client and Ionic's overlay controllers behind contracts in `src/app/core/adapters`. It follows the adapter boundary of apache/fineract-backoffice-ui (its ADR 0003 and ADR 0006), so the two Angular clients are organized the same way. ## Changes **Ports and adapters** (`core/adapters/api`) - There is one port per BFF domain: audit, auth, beneficiary, consent, loan, registration, savings, summary, transfer and user. Each `<domain>.api.ts` holds the model types, an `XxxApi` interface and an `XXX_API` token whose default factory binds `BffXxxApi` in `bff-<domain>.api.ts`. Nothing is registered in `app.config.ts`. - Transport details move into the adapters: the `X-Device-Fingerprint` argument, the loan `withdraw` command segment, and defaults for absent paging fields (`mapPage`, `mapUserCharges`, `mapAccountsSummary`). **OVERLAY** (`core/adapters/overlay`) - It wraps `ToastController`, which was used in five places: `NotificationService`, the error interceptor, and the change-password, forgot-password and beneficiaries screens. **Enforcement** - `local/no-generated-api-import` is adapted from the back-office rule of the same name and has its own node tests. It rejects `@bff/client`, its subpaths and relative paths into `src/openapi-client` outside the adapters, `app.config.ts` and the shared spec setup. - `no-restricted-imports` keeps Ionic's controllers inside the overlay adapter. - Specs are not exempt, and the boundary starts with no suppressions. **Docs** - A new `docs/frontend/architecture/adapter-boundary.adoc` describes the structure. It explains why the ports re-export the BFF's own DTOs where the back-office UI declares hand-written models: the BFF is already this project's anti-corruption layer over Fineract. ## No behavioural change - **Existing specs:** the first commit is the refactor alone, and the existing specs pass on it without edits (125/125). The store specs drive the real code path down to `HttpTestingController` and assert the exact URLs and bodies the BFF receives. - **Migrated specs:** the second commit moves specs onto the ports and adds 10 adapter tests, bringing the total to 135/135. `ionic-overlay.adapter.spec.ts` pins the translation to Ionic's `create()` arguments, including the cancel-role dismiss button. - **Toast position:** the three success toasts used Ionic's default position, which is `bottom`; they now pass `bottom` explicitly. - **Local checks:** `npm run lint` (including the new rule), `npm run test:eslint-rules`, `npm run format:check` and `npm run build` pass. ## Not in this PR - **I18N adapter:** ngx-translate is still imported by 26 files. Wrapping it in an `I18N` adapter with its own pipe, as the back-office UI does, touches every template, so it is better as its own change. - **Audit submission:** `AuditService` keeps its own `fetch` with `keepalive`, which `HttpClient` cannot replace. It now takes its types from `core/adapters`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
