Stu Mason
Stu Mason

Activity

StuMason/cleanconnect
TidyLinker.com
TypeScript
Pull Request Merged

PR #55 merged: Add cleaner earnings, dashboard KPIs, and client invoice PDFs

Summary

  • KPI Dashboard Widgets: Replace "Coming Soon" placeholders with real data (earnings this month, jobs completed, hours worked, average rating)
  • Cleaner Earnings Ledger: New page at /cleaner/earnings with payment history and payout status badges
  • Client Invoice PDFs: Download PDF invoices for completed jobs with cleaner amount, platform fee, and total breakdown

Changes

Backend

  • CleanerDashboardStatsData DTO for dashboard KPIs
  • EarningsController with paginated payment history
  • EarningEntryData DTO for earnings entries
  • InvoiceData DTO and GenerateInvoicePdf action using laravel-dompdf
  • PaymentPolicy with viewInvoice authorization
  • payments() hasManyThrough relationship on JobPosting

Frontend

  • Updated cleaner Dashboard with real KPI values
  • New Earnings/Index.tsx page with summary cards and payment table
  • Added payout status types to StatusBadge (processing, paid, failed)
  • Download Invoice button on completed job view

Tests

  • 22 feature tests covering DTOs, controllers, and actions
  • 13 browser tests for dashboard stats, earnings page, and invoice download

Test plan

  • Login as cleaner, verify dashboard shows real earnings/jobs/rating
  • Visit /cleaner/earnings, verify payment history displays correctly
  • Login as client with completed job, verify Download Invoice button appears
  • Click Download Invoice, verify PDF downloads with correct details
+2834
additions
-81
deletions
32
files changed