Stu Mason
Stu Mason

Activity

StuMason/cleanconnect
TidyLinker.com
TypeScript
Pull Request Opened

PR #147 opened: fix: auto-approve portfolio items + backfill stuck pending uploads

Summary

Cleaner uploads were hardcoded to approved=false in CreatePortfolioItem and nothing in the codebase ever flipped them — no admin route, no command, no listener.

Production state on main:

  • 0 approved portfolio items
  • 24 stranded pending across 2 cleaners
  • Kateryna alone has 23 photos invisible since 14 April

This switches to auto-approve on upload (matching the existing trust model — verified cleaners already write their own bio, set rates, etc.), and backfills the stuck items so they land on public profiles immediately.

Changes

  • CreatePortfolioItem sets approved=true + approved_at on upload.
  • New migration backfill_approved_portfolio_items flips all currently-pending items to approved in a single update.
  • Updated two tests that asserted the old approved=false default (the controller test now also asserts approved_at is set).

Existing safeguards

  • Cleaner-side visible/hide/edit/delete works.
  • Admin-side moderation does NOT exist yet — no admin portfolio routes or controller. If a bad photo gets through, today's only options are:
    • Cleaner hides/deletes it (we can ask them to).
    • Direct DB update.
  • Worth a follow-up ticket: small admin "hide portfolio item" route mirroring the existing verifications/support patterns. Skipped from this PR to keep it tight; risk is low because these are cleaners advertising their own work.

Test plan

  • Pest: 40 portfolio-related tests pass (12 in PortfolioControllerTest, 8 in CreatePortfolioItemTest, plus PublicProfileTest + DTO tests)
  • Pint, Prettier, ESLint clean
  • Smoke: as a cleaner, upload a new photo — verify it appears immediately on public profile
  • Smoke after deploy: visit Kateryna's public profile and confirm her 23 photos render
+39
additions
-5
deletions
4
files changed