Skip to content

Add a contract entrypoint to query a business's KYC verification status and rejection reason in one read #1741

Description

@Baskarayelu

📋 Description

verification.rs exposes is_business_verified, get_verification, and bucket listers like get_rejected_businesses. A client wanting "is this business verified, and if rejected, why?" must call multiple functions and unpack the full BusinessVerification. This issue adds a compact get_business_kyc_status(business) -> (KycState, Option<String>).

Why this matters: the most common KYC query is "status + reason". A single compact read avoids deserializing the whole verification record and gives the UI a stable, minimal contract.

🎯 Requirements & Context

  • Add get_business_kyc_status(env, business) -> Option<(KycState, Option<String>)> deriving from get_verification.
  • Return None for businesses with no verification record.
  • Reason is Some only when the state is rejected; otherwise None.
  • Reuse existing state enum; do not duplicate it. Add /// docs.

Context & constraints

  • SDK 25.1.1. Pure read; no auth.

🛠️ Suggested Execution

git checkout -b feature/business-kyc-status-query
cargo test -p quicklendx-contracts business_kyc_status -- --nocapture
cargo clippy -p quicklendx-contracts --all-targets -- -D warnings
  • Edge cases: no record (None); verified (reason None); rejected (reason Some); pending.

Example commit message

feat(kyc): add compact get_business_kyc_status (state + rejection reason)

Single read returning verification state and reason instead of unpacking the
full record.

✅ Acceptance Criteria & Guidelines

Requirement Target
Compact status+reason read Required
None for missing record Required
Test coverage ≥ 95%
cargo clippy clean Required
Timeframe 96 hours from assignment

💬 Community & Support

Join Discord: https://discord.gg/VpngvTjWa — comment to claim. 🚀

Metadata

Metadata

Assignees

No one assigned

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions