Claim Case States

This section provides information on the data structures and enum types used in a smart contract designed to manage insurance claims. The smart contract includes different structures such as ClaimData , ClaimStatus, and ClaimRules that define the different states, rules, and data used in the claim processing. These structures and types provide the necessary information and rules to manage insurance claims efficiently.

ClaimData

struct ClaimData {
  string policyId;
  string documentHash;
  uint40 claimSubmittedAt;
  uint40 claimExpiresAt;
  uint256 claimId;
  uint256 claimRequestedAmount;
  uint256 claimApprovedAmount;
  address currency;
  address claimValidator;
}

ClaimData is a struct that contains information about a claim. It includes the following parameters:

  • policyId: The policy id.

  • documentHash: The hash of the claim document.

  • claimSubmittedAt: The claim submitted time in seconds.

  • claimExpiresAt: The claim expires time in seconds.

  • claimId: The claim id.

  • claimRequestedAmount: The claim amount that is requested by the policy holder.

  • claimApprovedAmount: The claim amount that is approved by the claim validator.

  • currency: The currency address.

  • claimValidator: The claim validator address.

These parameters provide information about the policy, claim submission, expiration, amount, currency, and validator.

ClaimStatus

enum ClaimStatus {
  NotSubmitted,
  Submitted,
  Voting,
  Cancelled,
  Accepted,
  Rejected,
  Expired
}

ClaimStatus is an enum type that defines the different states that a claim can have. These states provide information about the current status of a claim. The different states are:

  • NotSubmitted: The claim is not submitted, if the claim id does not exist.

  • Submitted: The claim is submitted, if the claim is submitted by the policy holder and the claim validator has not voted yet.

  • Voting: The claim is voting, if the claim validator has voted, after that the claim will open for voting by voters.

  • Cancelled: The claim is cancelled, if the claim is cancelled by the policy holder.

  • Accepted: The claim is accepted, if the claim is accepted by the consensus or the governance that finalizes the claim.

  • Rejected: The claim is rejected, if the claim is rejected by the consensus or the governance that finalizes the claim.

  • Expired: The claim is expired, if the claim is not finalized before the claim request until. It means the claim expires at less than the current time, and the status of the claim id is submitted or voting.

ClaimRules

struct ClaimRules {
  uint8 claimAssessmentPeriod;
  uint8 claimConsensusRatio;
  uint256 rewardPerClaimAssessment;
  uint8 validatorRewardRatio;
  uint8 voterRewardRatio;
  uint256 claimAmountPerOnHoldStaking;
  uint256 pointPerClaimAssessment;
}

ClaimRules is a struct that defines the rules for assessing claims. It includes parameters such as:

  • claimAssessmentPeriod: The claim assessment period in days.

  • claimConsensusRatio: The claim assessment consensus ratio in percentage. The value must be less than or equal to 100.

  • rewardPerClaimAssessment: The reward per claim assessment.

  • validatorRewardRatio: The reward ratio for the validator. The value must be less than or equal to 100. The value of validatorRewardRatio + voterRewardRatio must be less than or equal to 100.

  • voterRewardRatio: The reward ratio for the voter. The value must be less than or equal to 100. The value of validatorRewardRatio + voterRewardRatio must be less than or equal to 100.

  • claimAmountPerOnHoldStaking: The claim amount per on-hold staking.

  • pointPerClaimAssessment: The point per claim assessment.

These parameters are used to calculate the rewards for the claim validator and voter, the claim amount per on-hold staking, and the point per claim assessment.

Last updated