Stu Mason
Stu Mason

Activity

StuMason/cleanconnect
TidyLinker.com
TypeScript
Pull Request Opened

PR #123 opened: fix: review cleanup — route bugs, missing controller, tests, DRY

Summary

Fixes all issues from the #121 review plus the missing FeaturedCleanerController that didn't make it into the #120 squash merge.

Bugs fixed:

  • Route order: /nudge/bulk and /nudge/launch-announcement moved before {user} params (were unreachable)
  • Profile nudge auto-detects missing bio/services instead of always defaulting to "a bio"
  • NudgeButton removed dead processing prop — sentIds render guard already prevents spam
  • EmailSignup::count() no longer called twice in getPreLaunchData

Missing from #120 squash merge:

  • FeaturedCleanerController + admin page + Homepage sidebar nav item

Standards fixes:

  • BulkNudgeRequest form request (authorize checks isAdmin)
  • adminUserIds computed once and passed through
  • Message::count() instead of DB::table('messages')
  • Eager load roles on recent registrations (N+1 fix)
  • Eager load cleanerProfile.services for bulk profile nudges
  • EmailSignup::unconverted() scope with subquery replaces triplicated filter logic
  • VerificationStatus enum in NotifyMatchingCleanersTest
  • PHPDoc on all NudgeController methods

Test coverage:

  • NudgeControllerTest: auth, all 4 nudge types, bulk validation, route reachability

Test plan

  • 83 tests passed (322 assertions)
  • Pint, Prettier, ESLint clean
  • npm run build clean
+654
additions
-142
deletions
16
files changed