Skip to content

[29.x] - Slice 638116: [Expense Agent][VENDOR] Adding interim approver to the workflow (January '27) - #14412

Open
v-rohangarg20 wants to merge 4 commits into
releases/29.xfrom
features/Bug-660313-29.x-Adding-interim-approver-to-the-workflow
Open

v-rohangarg20 wants to merge 4 commits into
releases/29.xfrom
features/Bug-660313-29.x-Adding-interim-approver-to-the-workflow

Conversation

@v-rohangarg20

@v-rohangarg20 v-rohangarg20 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

What & why

Backports configurable interim approval for Expense Agent from #14409 to releases/29.x. Administrators can set an Expense Report Interim Approver per expense user in Expense Approval Setup. The approver is shown on the expense user and prepopulated on the expense report when the agent is enabled. The existing workflow routes the report to the interim approver before the final approver.

  • On submission, the workflow resolves the interim approver again, applies active alternate coverage, and clears assignments that are no longer eligible or conflict with the submitter or final approver. The activity log records new assignments, including when an alternate takes over.
  • Can Overwrite Interim Approver controls whether submitters can assign or change the interim approver. The Business Central action and the InterimApproverOverwrite web app capability use the same setting. System delegation can still apply an alternate when overwrite is off.
  • The Expense Approval Setup API exposes the interim approver number and system ID as read-only properties. Removing approval rights or deleting an expense user prompts before clearing affected setup references.

Linked work

AB#660313

How I validated this

  • I read the full diff and it contains only changes I intended.
  • I built the affected app(s) locally with no new analyzer warnings.
  • I ran the change in Business Central and confirmed it behaves as expected.
  • I added or updated tests for the new behavior, or explained below why none are needed.

What I tested and the outcome (required — be specific: scenarios, commands, screenshots for UI changes)

Risk & compatibility

  • Can Overwrite Interim Approver defaults to off with no upgrade step. Submitters cannot manually assign or change the interim approver, even if none is configured, until an administrator enables the option.
  • The backport adds setup fields and read-only API properties. If no eligible interim approver remains at submission, the report routes directly to the final approver.

@v-rohangarg20
v-rohangarg20 requested a review from a team November 23, 2026 05:18
@v-rohangarg20
v-rohangarg20 requested a review from a team as a code owner November 23, 2026 05:18
@github-actions github-actions Bot added AL: Apps (W1) Add-on apps for W1 Team: Finance GitHub request for Finance area labels Nov 23, 2026
@github-actions github-actions Bot added this to the Version 29.2 milestone Nov 23, 2026
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 1

Recommendation: Accept with Suggestions

What this PR does

Adds a configured interim approver per expense user, submission-time refresh and alternate coverage, and a shared overwrite setting for Business Central and the web capability. Read-only API properties expose the setup.

Submission resolves the final approver first, clears ineligible or conflicting interim assignments, and retains the existing interim-before-final approval sequence. Reference cleanup collects confirmations before writing. Tests cover sequential approval, overwrite rules, setup changes, conflicts, delegation, and alternate-assignment logging.

Problem-solution fit

Fit: Partial

The configurable routing and overwrite behavior match the requested workflow, but normal unchanged prefilled assignments are missing from assignment history.

Suggestions

S1 (🟠 Moderate): Cover ineligible interim approvers at submission
Add a test that removes the prefilled interim approver's approval rights after report creation, then submits with overwriting enabled. Assert that both interim fields are cleared and the final approver becomes active. The existing removal test checks setup cleanup but does not exercise this submission-time routing branch.

S2 (🟠 Moderate): Record the prefilled interim approver in history
Log the configured interim approver on first submission even when it was prefilled at report creation. When that approver is unchanged and has no alternate, this comparison returns false, so no InterimApproverAssigned event records the assignment. Add a test for this normal setup-driven flow.

Risk assessment and necessity

Risk: The main regression surface is approval routing and its audit history, not amount calculation or ledger posting. The overwrite setting intentionally defaults to off, and invalid interim assignments intentionally fall back to final approval. Schema/API additions are additive, and system delegation remains available when submitter overwriting is disabled.

Necessity: Without this feature, interim approvers must be assigned report by report, and administrators cannot centrally configure or control submitter overrides across clients. Reusing the established sequential approval workflow keeps the feature scoped.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=14412 round=1 by=alexei-dobriansky at=2026-11-23T08:35:54.1562569Z lastSha=17105804318fe48f360f05045bbf48143578fc8d reviewKey=8c46e51ea092ce98ea42e5216c4c603004166b7d5b85dc336ffc2970ecbd94f0 suggestions=S1@7324678a,S2@7e78a03c

@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 2

Recommendation: Accept with Suggestions

What this PR does

Adds configured interim approvers, submission-time refresh and alternate coverage, and a shared overwrite setting for Business Central and the web capability. The existing workflow requires interim approval before final approval.

The latest changes disable drill-down on the read-only interim approver name and give the new capability enum value ordinal 12. These changes do not alter routing or address the two earlier suggestions. The capability is new in this change, and its API output uses the enum name rather than its ordinal.

Problem-solution fit

Fit: Partial

The configurable routing and overwrite behavior match the requested workflow. A normal unchanged prefilled interim assignment still has no assignment-history event.

Status of previous suggestions
ID Title Status Author response
S1 Cover ineligible interim approvers at submission Not addressed No response; the submission-time eligibility test is still missing.
S2 Record the prefilled interim approver in history Not addressed No response; the logging comparison is unchanged.

S1 (🟠 Moderate): Cover ineligible interim approvers at submission
Add a test that removes the prefilled interim approver's approval rights after report creation, then submits with overwriting enabled. Assert that both interim fields are cleared and the final approver becomes active. The existing removal test checks setup cleanup but does not exercise this submission-time routing branch.

S2 (🟠 Moderate): Record the prefilled interim approver in history
Log the configured interim approver on first submission even when it was prefilled at report creation. When that approver is unchanged and has no alternate, the comparison returns false, so no InterimApproverAssigned event records the assignment. Add a test for this normal setup-driven flow.

New observations (commits since round 1)

None — the display and enum changes introduce no new findings.

Risk assessment and necessity

Risk: The main regression surface remains approval routing and activity history, not amount calculation or ledger posting. The overwrite option intentionally defaults to off, so existing submitters need an administrator to enable manual assignment. Schema and read-only API additions are additive; system alternate delegation remains available. The latest display and enum changes add little risk and introduce no new BaseApp event dependency. Tests were read, not executed; no build or runtime verification was performed.

Necessity: Central setup avoids assigning interim approvers report by report and gives administrators consistent overwrite control across clients. Reusing the existing sequential approval workflow keeps the feature and its release backport scoped.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=14412 round=2 by=alexei-dobriansky at=2026-11-23T14:43:30Z lastSha=22638544338343403d1cc85f0be132661f41eb79 reviewKey=5f3c60905da655756ffe294b9d956e2444d1f8c0d445a9564bdf5efe41f64d90 suggestions=S1@7324678a:notaddressed,S2@7e78a03c:notaddressed parentRound=1

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Stale Status Check Deleted

The Pull Request Build workflow run for this PR was older than 72 hours and has been deleted.

📋 Why was it deleted?

Status checks that are too old may no longer reflect the current state of the target branch. To ensure this PR is validated against the latest code and passes up-to-date checks, a fresh build is required.


🔄 How to trigger a new status check:

  1. 📤 Push a new commit to the PR branch, or
  2. 🔁 Close and reopen the PR

This will automatically trigger a new Pull Request Build workflow run.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

This branch was previously deployed

1 inactive (outdated) deployment
triage — 17105804 Deployed Nov 23, 2026 by v-rohangarg20 via Classify team ownership #11766
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1 Team: Finance GitHub request for Finance area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants