Stu Mason
Stu Mason

Activity

StuMason/cleanconnect
TidyLinker.com
TypeScript
Pull Request Merged

PR #163 merged: feat: Rebook button on completed jobs

Summary

  • Surface the existing repost-as-draft flow as a one-click Rebook action on both the client job listing (Client/Jobs/Index.tsx) and detail page (Client/Jobs/Show.tsx), so repeat clients can duplicate a previous booking without re-entering everything.
  • Underlying RepostJobPosting action is unchanged except it now also clears preferred_date, preferred_time and flexible_dates on the new draft so the client picks a fresh slot (carrying the old date over never makes sense for a rebook).
  • ClientJobData DTO now exposes can_repost whenever a user is supplied (not just when detailed: true), and JobController@index passes the user through so the listing rows know whether to show the button.

This is the surfacing-only interpretation of "Rebook" per Stu's clarification — a one-click duplicate of a completed booking that drops the client at wizard step six to review and republish. We did not add a "book the same cleaner directly, skip the quote stage" path — that's a separate, much larger ticket.

Test plan

  • php artisan test --filter=repost (15 passing — existing repost coverage + 2 new tests for date clearing and detail preservation)
  • php artisan test tests/Feature/DataTransferObjects/ClientJobDataTest.php tests/Feature/Client/JobControllerTest.php (44 passing — confirms exposing can_repost on the listing didn't break the existing JobController/DTO behaviour)
  • vendor/bin/pint --dirty clean
  • prettier --check clean
  • eslint clean
  • Manual smoke: completed job in My Jobs shows the Rebook button, click takes you to the post-job wizard at step six with services / address / property details copied and date fields blank
  • Manual smoke: cancelled job behaves the same (policy already allows repost for both Completed and Cancelled)
+147
additions
-5
deletions
8
files changed