Aman-Mittal opened a new issue, #682: URL: https://github.com/apache/fineract-backoffice-ui/issues/682
The smallest ADR 0006 step available, and the one the existing contract already names as its own next move. `office.api.ts` says so in as many words: > `list()` only, for now. [...] Creating and editing an office stays on the generated client until `office-form.component.ts` is migrated; adding `create()` and `update()` here before anything calls them would be the speculative abstraction ADR 0006 and `AGENTS.md` both warn against. So the condition it was waiting for is the content of this issue: migrate the callers, and add the operations as part of doing it. ## Scope Four files, and they stop importing the generated client outright — no other generated service is involved: ``` src/app/features/organization/offices/office-form.component.ts getOffices, getOfficesOfficeId, postOffices, putOfficesOfficeId src/app/features/organization/offices/office-form.component.test.ts src/app/shared/components/create-office-dialog/create-office-dialog.component.ts getOffices, postOffices src/app/shared/components/create-office-dialog/create-office-dialog.component.test.ts ``` ## Why the mapping already earns its keep The `Office` model and its mapper exist and are tested. The disagreement is recorded in #653 and verified against a running instance: `GetOfficesResponse` declares `openingDate?: string` while Fineract sends `[2009, 1, 1]`, and it omits `parentId`/`parentName`, which the payload carries. Nothing new has to be justified here — only the write side added and four call sites moved. Two things to get right on the write side, since this is where they bite: - **`dateFormat` and `locale` belong in the adapter, not the form.** That is rule 2 in `DOCS/ADAPTERS.md`; the accounting-closure form used to set them and no longer does. Fineract parses a date strictly against the format it is told to use, so a form that owns that detail is a form that can produce a 500. - **`openingDate` goes out as a string, not an array.** The inbound conversion is `toIsoFineractDate()`; outbound is `formatDateToFineract()` plus `FINERACT_DATE_FORMAT`. They are not symmetric, and `core/utils/date-formatter.ts` explains why at length. Doing this together with #680 (`STAFF_API`) clears **10 files** rather than 4, because `office-view` and the staff forms each need both. Offices and staff are one domain in Fineract's model anyway — staff are scoped by office. ## Acceptance - `OfficeApi` gains `get`, `create`, `update`, each with a caller. - The four files above are gone from `eslint-suppressions.json` after `npm run lint:prune`. - Specs mock the contract, not `OfficesService` — a fixture built from a generated type inherits the spec's blind spots. - `npm run lint` passes and the suite still passes. -- 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]
