Aman-Mittal opened a new pull request, #866:
URL: https://github.com/apache/fineract-backoffice-ui/pull/866
Two of the three operations in #789. The third, deleting a GL account, is
deliberately **not** here — ADR 0006 is why, and that is explained at the
bottom. #789 stays open for it.
## Closure comments
`PUT /glclosures/{id}` carries a single optional `comments` and nothing else
— readable straight off the generated request model, which has exactly one
field. So the closing date is immutable **at the API**, not merely by
convention in a form.
The existing form therefore serves edit mode with the office and the closing
date rendered read-only, rather than as inputs the platform would ignore. Until
now, correcting a comment meant deleting the closure — which re-opens the
period — and closing it again.
`get` and `update` join the `AccountingClosureApi` port; the generated calls
stay inside the adapter. The update sends no `dateFormat` or `locale`, because
there is no date in the body to parse.
## Charge definitions
An unused or mistyped charge stayed selectable on every product and account
form. Delete is gated on `DELETE_CHARGE`, and the refusal for a charge still
attached to a product or account arrives in Fineract's own words through
`error.interceptor.ts`. The list reloads only on success, so a charge the
platform kept stays on screen — pinned by a test.
## Two things found on the way
**The Re-open action was ungated.** It deletes a closure and lets entries be
posted into a closed period again, and any authenticated user who could see the
screen was offered it. It now requires `DELETE_GLCLOSURE`.
**One existing closure test was passing for the wrong reason.** Once the
handler became async, `expect(remove).not.toHaveBeenCalled()` held because the
call had not been reached yet — not because the decline was honoured. Both
confirm tests now await the handler, and both go through `DialogService`
instead of the browser's `confirm()`, which carried an untranslated string and
could not be asserted on.
## Why the GL account delete is not in here
It needs a unit test, and a new test file importing the generated client
fails `local/no-generated-api-import` — which is exactly the outcome [ADR
0006](DOCS/adr/0006-generated-api-boundary.md) describes: *"a new file
importing the generated client fails CI"*, and existing suppressions only ever
fall.
The chart-of-accounts screen predates the adapter boundary and is
suppressed, so adding the delete call to it passes lint, but it cannot be
covered by a test without a new suppression I am not willing to add. Doing that
operation properly means giving GL accounts a contract in `core/adapters/api`
first — which also changes how the chart renders `type` and `usage`, since
those arrive as objects and the row currently leans on the generated shape.
That is its own change with its own visual blast radius, not something to hide
inside this one.
I had it written and reverted it for this reason, which I think is the
ratchet working as designed.
## Checks
Unit suite **332 files / 2889 tests**, `npm run build` clean, and `lint`,
`tsc`, `format:check`, `i18n:check`, `api:surface` (656 operations, the three
new ones recorded), `check:route-permissions`, `check:a11y-names`,
`check:template-text`, `check:ui-primitives`, `check:responsive`,
`check:nav-ids`, `check:icons` all pass.
--
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]