feat(custom): Commission Engine reliability + security rules from the V1 build#4
Closed
TiguniaOG wants to merge 2 commits into
Closed
feat(custom): Commission Engine reliability + security rules from the V1 build#4TiguniaOG wants to merge 2 commits into
TiguniaOG wants to merge 2 commits into
Conversation
Five custom/knowledge/reliability rules, each encoding a real defect that slipped through the CommissionCentral V1 engine build (Tigunia-Apps/commissions-management#84): rolling-period window must be trailing not forward; re-derive dependent fields after a record-mutation event; match a return/credit memo to its source via item application not the order link; reopen a Released sales document before editing TestStatusOpen fields; split allocations must reconcile to the rounded line total. Each with .good.al/.bad.al samples per skills/write.md. (Four older pending rules — band integrity, OnInsert in-flight Rec staging, SecurityFiltering invalidity, CLE Remaining-Amount timing — remain for a follow-up batch.) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Completes the V1 build knowledge contribution: whole-set trigger validation (stage committed siblings + overlay Rec), reading customer ledger Remaining Amount after application detailed entries post, interval/breakpoint band contiguity, and SecurityFiltering not being a permission-set property or per-user row isolation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds 9 org-specific AL coding rules to the
custom/layer, each surfaced and verified during the CommissionCentral V1 Commission Engine build (commissions-management epic microsoft#51, follow-up #84). Every rule encodes a BC-specific defect we actually hit and fixed, with a.good.al/.bad.alsample pair. All atomic, ≤30 lines, no fenced code, 6/6 frontmatter fields; all 9 index cleanly (Build-KnowledgeIndex.ps1→ 167 articles, 0 parse errors).Two commits: the first seeded 5 reliability rules; the second adds 4 more (3 reliability + 1 security) to complete the batch.
Reliability (8)
rolling-period-window-must-be-trailing-not-forward— a rolling-periodDateFormulamust apply the period as a trailing offset (negate / step back); a positive1Mapplied forward lands in the future and empties the window. (Cap-period blocker, PR #80.)re-derive-dependent-fields-after-a-record-mutation-event— re-derive dependent amounts (e.g. net payable) after a mutate-the-record extension event; a hook firing after the derivation leaves the dependent field stale. (PR #80.)match-return-to-source-via-item-application-not-order-link— match a return/credit memo to its shipment via the item application (Appl.-from Item Entry→ ILEDocument No.), notSales Cr.Memo Line."Order No."(blank on a return-order-sourced credit memo). (ENG-8 / #59.)reopen-released-sales-document-before-editing-status-open-fields— modifying aTestStatusOpenfield (e.g.Unit Price) on a Released sales order errors; reopen first (Qty. to Ship/Qty. to Invoiceare exempt). (ENG-8 / #59.)split-allocations-reconcile-to-rounded-line-total— split allocations must reconcile to the rounded line total (largest-remainder / last-share-absorbs-residual), not round each share independently. (#71.)interval-bands-must-be-contiguous-no-gaps-or-overlaps— tier/breakpoint bands must be validated for contiguity (no gaps, no overlaps) across the whole set, including on delete.stage-committed-siblings-and-overlay-rec-for-set-validation-in-triggers—OnInsert/OnModifycan't see the in-flightRecvia a plain table scan; stage committed siblings and overlayRecto validate the post-change set.read-cust-ledger-remaining-amount-after-application-detailed-entries-post— don't read a Cust. Ledger Entry's Remaining Amount inGen. Jnl.-Post Line.OnAfterApplyCustLedgEntry(fires before the application detailed entries post); react toDetailed Cust. Ledg. Entry.OnAfterInsertEvent(Entry Type = Application).Security (1)
securityfiltering-is-not-per-user-row-isolation-or-a-permissionset-property—SecurityFilteringis not a permission-set property and does not by itself isolate rows per user; true per-user row security needs configured security filters, or isolate at the application layer. (BL-07 rep data isolation.)Provenance
Each rule cites the originating commissions-management issue/PR in its
## See also. Sources: the engine epic microsoft#51 build and the close-out review.🤖 Generated with Claude Code