Expense Agent: capture submission policy evaluation history
Nobody has claimed this yet.
- Dominant language
- AL
- Stars
- 683
- Forks
- 459
- Avg merge
- 3d 26m
- Merged PRs (30d)
- 633
Description
Scope
Capture a report-level policy-evaluation snapshot for each expense report submission or resubmission. Checks on drafts/recalled reports must not create activity history.
Related planning: AB#634361 (activity history) and AB#626515 (policy evaluation). This issue does not replace or close either slice.
Companion service implementation: https://microsoft.ghe.com/bic/BC-ExpenseAgent/issues/2754
Expected behavior
- Reuse
PolicyEvaluatedwith an explicit snapshot outcome, passed/failed line-policy counts, distinct flagged expense-line categories, and the latest underlying evaluation time. - Capture complete current evidence during submission, or after the existing line confirmation checks that the entire pending-approval report is ready.
- Require submission history and enforce at most one snapshot since the latest Submitted/Resubmitted activity.
- Reuse the existing activity-log management codeunit. No new API actions, capability, callback, submission token, context hashing, or header-invalidation changes.
- Keep the activity API read-only and detailed policy-evaluation records intact.
- Preserve history through posting and keep existing API actions compatible.
- Respect the BC policy feature switch; never infer a clear result from missing evaluations.
Validation
Add AL unit/API coverage for both capture paths, repeated confirmation, resubmission, pending/non-pending states, incomplete/current evaluations, feature-off/no-policy behavior, category aggregation, and posting.
AL compilation, publication, runtime tests, and live cross-repository validation remain pending.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the existing PolicyEvaluated activity record and activity-log management codeunit, then review the current submission, resubmission, and line-confirmation entry points. Add AL unit/API coverage for both capture paths and the listed edge cases; done means compilation, publication, runtime tests, and cross-repository validation pass without changing the read-only API or detailed evaluation records.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, backend, testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100