Skip to content

Save requested amounts

Steps

  1. 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).
  2. ClaimsTable.js posts a ReimbursementsUpdate JSON body to the update-reimbursements handler. No anti-forgery token is sent (BR-APP-006); large forms are allowed (BR-APP-007).
  3. 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 sets successful to false.
  4. The handler returns { success: true } when no exception occurred and { success: false } when one was caught. ClaimsTable.js resolves its promise when response.success is true and rejects it otherwise; the page calls refreshPage() 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.

Sources

  • src/NDReimbursementWebApp/Pages/NDReimbursement.cshtml.cs
  • src/NDReimbursementWebApp/wwwroot/js/ClaimsTable.js