Skip to content

fix: validate claim amount against coverage limit - #767

Open
edehvictor wants to merge 1 commit into
Parashield-Protocol:mainfrom
edehvictor:fix/claim-coverage-limit-698
Open

edehvictor wants to merge 1 commit into
Parashield-Protocol:mainfrom
edehvictor:fix/claim-coverage-limit-698

Conversation

@edehvictor

Copy link
Copy Markdown
Contributor

Closes #698

Summary

This change adds a coverage-limit validation step to manual claim submission. Before a claim record is created or a Soroban transaction is submitted, the service now loads the policy product and compares the policy claim amount with the configured maximum coverage.

What Changed

  • Added a guard in ClaimsService.submitClaim for policies whose stored coverage exceeds the product coverage limit.
  • Added a clear 400 Bad Request response describing the requested claim amount and the maximum permitted amount.
  • Added a not-found response when the policy references a product that no longer exists.
  • Kept duplicate-claim checks and on-chain submission after validation so invalid claims cannot create records or trigger payouts.

Testing

  • Not run, per request.
  • No install, build, test, or CI check was performed.

@drips-wave

drips-wave Bot commented Oct 17, 2026

Copy link
Copy Markdown

@edehvictor Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

[bug] Claims module does not validate claim amount against policy coverage limit

1 participant