feat(payroll): emit per-employee failure events in batch claims (#505) - #693
Closed
jjb9707 wants to merge 6 commits into
Closed
feat(payroll): emit per-employee failure events in batch claims (#505)#693jjb9707 wants to merge 6 commits into
jjb9707 wants to merge 6 commits into
Conversation
…lopay#505) Off-chain indexers currently cannot tell which employees/milestones failed in batch_claim_payroll / batch_claim_milestones without re-simulating the batch. Emit a BatchClaimFailedEvent per failed entry (employee/claimant, entry id, error code) so partial-batch failures are observable. The BatchPayrollResult / BatchMilestoneResult return values are unchanged and the batch still continues after a failure. Events reveal only the claimant and error code, never another party's balance.
Contributor
|
Closing since this PR isn't linked to an issue you're assigned to. Please get assigned to an open issue first, then feel free to open a fresh PR referencing it. Thanks for understanding! |
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
Closes #505. Emits a
BatchClaimFailedEventfor every failed entry inbatch_claim_payrollandbatch_claim_milestones, so off-chain indexers and dashboards can surface partial-batch failures without re-simulating the batch.What changed
events.rs: newBatchClaimFailedEvent { agreement_id, employee, entry_id, error_code }withemit_batch_claim_failedhelper.payroll.rs: emit the event in all 8batch_claim_payrollfailure branches and all 5batch_claim_milestonesfailure branches (duplicate / out-of-bounds / not-approved / already-claimed / not-found / unauthorized / no-periods / insufficient-escrow).BatchPayrollResult/BatchMilestoneResultreturn values are untouched and the batch still continues after a failure (no early abort).Security
Each event reveals only the claimant (
employee/contributor) and the error code for that entry — never another employee's balance.Tests added (
test_batch_claim_failure_events.rs)batch_claim_failed_eventand that the valid employee is paid.