Skip to content

Require verified KYC status before creating a payout for an instructor #166

Description

@SYLVIANNORUKA

Description: KycService.getVerificationStatus explicitly exists "used by payouts module" per its own comment, yet PayoutsService.createPayout never calls it — a payout record (and eventually funds) can be created for an instructor who has never submitted or been approved for KYC, defeating the purpose of the KYC gate described in KycService.review's notification copy ("You are now eligible to receive payouts").

Requirements:

  • Inject KycService into PayoutsService and call getVerificationStatus(instructorId) in createPayout, rejecting with ForbiddenException when isVerified is false.
  • Surface a clear error message directing the instructor to complete KYC.
  • Add a test asserting payout creation for an unverified instructor is rejected, and succeeds for a verified one.

Acceptance Criteria:

  • POST /payouts for an instructor without an APPROVED KYC submission returns 403 with a clear message.
  • POST /payouts for a KYC-verified instructor continues to succeed.

Technical Details:
Files: src/modules/payouts/payouts.service.ts, src/modules/payouts/payouts.module.ts, src/modules/kyc/kyc.service.ts, src/modules/kyc/kyc.module.ts
Libraries: prisma, @nestjs/common

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions