Admin project workflow: create, bid, accept, invoice on property page #179

Open
opened 2026-06-08 04:57:05 +00:00 by ldraney · 0 comments
Owner

Type

Feature

Lineage

Child of spike #121. Part of Phase 3. Depends on #122 (ServiceRequest model), #176 (projects section on property page).

Repo

ldraney/landscaping-assistant

User Story

As an admin, when a customer calls requesting a project (e.g., "build a retaining wall"), I want to go to that property's detail page, create a new project, set a bid, and manage the workflow through acceptance and payment — all from one place.

Context

The flow admin experiences:

  1. Customer calls → admin opens the property page
  2. Admin clicks "New Project", enters description → project appears as pending bid
  3. Admin sets a price/bid → status becomes quoted
  4. Customer accepts the bid (on their property page or via emailed link) → status becomes accepted — work can begin here
  5. Customer is invoiced by email with a Stripe payment link, OR can pay directly on the project page → status becomes paid
  6. Admin schedules and completes the work → scheduledcompleted

Note: #122's current transition graph is requested → quoted → paid → scheduled → completed. This ticket likely needs an accepted state between quoted and paid, because work often begins after acceptance but before payment. The migration to add this state should be part of this ticket or a prerequisite patch to #122.

File Targets

  • app/controllers/service_requests_controller.rb (new — create, update, accept, pay actions)
  • app/views/service_requests/_new_project_form.html.erb (new — inline form on property page)
  • app/views/service_requests/_property_projects.html.erb (update from #176 — add status badges, bid display, accept/pay buttons)
  • app/views/service_requests/_project_card.html.erb (new — individual project card with status, price, actions)
  • app/assets/stylesheets/application.css (add project card, status badge, form styles)
  • app/mailers/invoice_mailer.rb (new — sends Stripe payment link to client)
  • config/routes.rb (add service_request routes nested under properties)
  • spec/requests/service_requests_spec.rb (new)

Acceptance Criteria

  • Admin can create a new project from the property detail page (description field + submit)
  • New project appears in the property's projects section with status "pending bid"
  • Admin can set/update a bid price on the project
  • Client can accept the bid (button on their property view)
  • On acceptance, client is emailed an invoice with a Stripe payment link
  • Client can also pay directly on the project page (Stripe embedded or redirect)
  • Admin sees full status progression: requested → quoted → accepted → paid → scheduled → completed
  • Status badges are color-coded per status
  • Works on mobile (44px touch targets)

Test Expectations

  • spec/requests/service_requests_spec.rb: CRUD, status transitions, authorization
  • spec/mailers/invoice_mailer_spec.rb: email content and Stripe link
  • Run: bundle exec rspec

Constraints

  • CSS follows ~/ror-css-guide
  • Mobile-first
  • Stripe integration may depend on #125 — if #125 isn't done yet, stub the payment link and mark the Stripe AC as blocked

Feature Flag

None

Checklist

  • PR opened
  • Tests pass
  • No unrelated changes
  • #122 — ServiceRequest model (hard dependency)
  • #176 — Projects section on property page (hard dependency)
  • #125 — Stripe integration (soft dependency — can stub)
  • #123 — Client request UI (overlapping scope — client acceptance flow)
  • #121 — parent spike
### Type Feature ### Lineage Child of spike #121. Part of Phase 3. Depends on #122 (ServiceRequest model), #176 (projects section on property page). ### Repo `ldraney/landscaping-assistant` ### User Story As an admin, when a customer calls requesting a project (e.g., "build a retaining wall"), I want to go to that property's detail page, create a new project, set a bid, and manage the workflow through acceptance and payment — all from one place. ### Context The flow admin experiences: 1. Customer calls → admin opens the property page 2. Admin clicks "New Project", enters description → project appears as **pending bid** 3. Admin sets a price/bid → status becomes **quoted** 4. Customer accepts the bid (on their property page or via emailed link) → status becomes **accepted** — work can begin here 5. Customer is invoiced by email with a Stripe payment link, OR can pay directly on the project page → status becomes **paid** 6. Admin schedules and completes the work → **scheduled** → **completed** **Note:** #122's current transition graph is `requested → quoted → paid → scheduled → completed`. This ticket likely needs an `accepted` state between `quoted` and `paid`, because work often begins after acceptance but before payment. The migration to add this state should be part of this ticket or a prerequisite patch to #122. ### File Targets - `app/controllers/service_requests_controller.rb` (new — create, update, accept, pay actions) - `app/views/service_requests/_new_project_form.html.erb` (new — inline form on property page) - `app/views/service_requests/_property_projects.html.erb` (update from #176 — add status badges, bid display, accept/pay buttons) - `app/views/service_requests/_project_card.html.erb` (new — individual project card with status, price, actions) - `app/assets/stylesheets/application.css` (add project card, status badge, form styles) - `app/mailers/invoice_mailer.rb` (new — sends Stripe payment link to client) - `config/routes.rb` (add service_request routes nested under properties) - `spec/requests/service_requests_spec.rb` (new) ### Acceptance Criteria - [ ] Admin can create a new project from the property detail page (description field + submit) - [ ] New project appears in the property's projects section with status "pending bid" - [ ] Admin can set/update a bid price on the project - [ ] Client can accept the bid (button on their property view) - [ ] On acceptance, client is emailed an invoice with a Stripe payment link - [ ] Client can also pay directly on the project page (Stripe embedded or redirect) - [ ] Admin sees full status progression: requested → quoted → accepted → paid → scheduled → completed - [ ] Status badges are color-coded per status - [ ] Works on mobile (44px touch targets) ### Test Expectations - `spec/requests/service_requests_spec.rb`: CRUD, status transitions, authorization - `spec/mailers/invoice_mailer_spec.rb`: email content and Stripe link - Run: `bundle exec rspec` ### Constraints - CSS follows `~/ror-css-guide` - Mobile-first - Stripe integration may depend on #125 — if #125 isn't done yet, stub the payment link and mark the Stripe AC as blocked ### Feature Flag None ### Checklist - [ ] PR opened - [ ] Tests pass - [ ] No unrelated changes ### Related - #122 — ServiceRequest model (hard dependency) - #176 — Projects section on property page (hard dependency) - #125 — Stripe integration (soft dependency — can stub) - #123 — Client request UI (overlapping scope — client acceptance flow) - #121 — parent spike
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ldraney/landscaping-assistant#179
No description provided.