Save requested amounts¶
Steps¶
- The user edits requested amounts on claims that are editable (BR-SCR-003). Reimburse all instead sets each amount to the allowed amount (BR-SCR-005).
ClaimsTable.jsposts aReimbursementsUpdateJSON body to the update-reimbursements handler. No anti-forgery token is sent (BR-APP-006); large forms are allowed (BR-APP-007).- The handler maps each modified claim and calls the claim update of
NDReimbursementAPI.Client(known from the call site; package internals are unknown**). The audit user name is taken from the request (TD-APP-005). The handler catches any exception, logs it and setssuccessfulto false. - The handler returns
{ success: true }when no exception occurred and{ success: false }when one was caught.ClaimsTable.jsresolves its promise whenresponse.successis true and rejects it otherwise; the page callsrefreshPage()on success.
Process flow¶
The diagram shows the save call and its two JSON outcomes, { success: true } and { success: false }; an exception in any step of the handler's try region (validation, mapping or updates) yields the failure outcome.
flowchart TD
A["Edit amounts"] --> B["POST UpdateReimbursements JSON"]
subgraph T["Handler try region"]
V["Validate user name, claim id and value"] --> C["Map claims"]
C --> D["UpdateClaimAsync via API client"]
end
B --> V
D -- "No exception" --> E["Return { success: true }"]
T -- "Exception caught, logged" --> G["Return { success: false }"]
E --> F["Refresh page"]
G --> H["Script rejects the promise"]
Note: Statements marked with
**could not be confirmed; treat as unknown until verified.
Related documentation¶
Sources¶
- src/NDReimbursementWebApp/Pages/NDReimbursement.cshtml.cs
- src/NDReimbursementWebApp/wwwroot/js/ClaimsTable.js