Skip to content

Feature/insurance batch premium semantics#348

Open
AbuJulaybeeb wants to merge 26 commits intoRemitwise-Org:mainfrom
AbuJulaybeeb:feature/insurance-batch-premium-semantics
Open

Feature/insurance batch premium semantics#348
AbuJulaybeeb wants to merge 26 commits intoRemitwise-Org:mainfrom
AbuJulaybeeb:feature/insurance-batch-premium-semantics

Conversation

@AbuJulaybeeb
Copy link
Copy Markdown

@AbuJulaybeeb AbuJulaybeeb commented Mar 23, 2026

closes #280

Refactored the batch_pay_premiums logic in insurance/src/lib.rs to ensure deterministic batch processing. This update prevents the entire batch from reverting when encountering invalid states (e.g., inactive or unauthorized policies), allowing for partial success execution.

Key Changes
Implemented safer batch handling to avoid full transaction failure on individual policy errors.

Introduced InsuranceEvent::BatchPaymentResult to provide clear feedback on:

Total number of policies processed

Number of successful payments

Reworked and expanded test coverage in insurance/src/test.rs to validate mixed batch scenarios, including:

Valid policies

Inactive policies

Unauthorized policies

Resolved over 40 critical syntax and compilation issues across insurance/src/lib.rs and insurance/src/test.rs, including:

Missing module closures

Stray or improperly injected code

Duplicate or conflicting function signatures

Impact
Improves system resilience by enabling partial batch execution

Enhances observability through structured event reporting

Restores CI stability and ensures successful builds

@Baskarayelu
Copy link
Copy Markdown
Contributor

Please resolve the conflicts

@AbuJulaybeeb
Copy link
Copy Markdown
Author

Please review and merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement deterministic batch premium payment result semantics

2 participants