Skip to content

feat(payouts): implement instructor revenue breakdown and payouts system#767

Merged
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
dorismaduegbunam:feature/instructor-revenue-payouts
Jun 2, 2026
Merged

feat(payouts): implement instructor revenue breakdown and payouts system#767
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
dorismaduegbunam:feature/instructor-revenue-payouts

Conversation

@dorismaduegbunam
Copy link
Copy Markdown
Contributor

Description

This PR introduces the core infrastructure for instructors to view their revenue breakdown, manage their payout profiles, review historical payout records, and receive automated email notifications when a payout is processed.

closes #563

Resolves

  • Issue: Instructors should see revenue earned.

Changes Made

  • Entities & Relationships
    • Added InstructorPayoutProfile to track instructor preferences (e.g. payout schedule, payment method, details).
    • Added InstructorPayout to act as an immutable ledger of transactions (historical payouts).
  • Service & Controller (PayoutsModule)
    • Implemented getRevenueBreakdown which aggregates active Course items, completed Payment records, and processed Refund items to compute Gross Revenue, Total Refunds, and Net Revenue globally and per-course.
    • Implemented secure CRUD endpoints for managing settings and fetching historical payouts.
    • Provided an admin-facing process endpoint to record payouts and trigger automated email logic.
  • Email Notifications
    • Injected an instructor_payout template configuration into the NotificationTemplateService seed.
    • Integrated payout execution directly with NotificationsService with graceful fallbacks if the templated engine drops.
  • Housekeeping
    • Resolved an untracked syntax and duplicate definition bug within notifications.service.ts and notifications.queue.ts caused by an earlier merge conflict upstream.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 2, 2026

@dorismaduegbunam 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

@RUKAYAT-CODER
Copy link
Copy Markdown
Contributor

Thank you for contributing to the project.

@RUKAYAT-CODER RUKAYAT-CODER merged commit b5a6f5f into rinafcode:main Jun 2, 2026
1 check failed
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.

Add instructor revenue insights and payout information

2 participants