Property detail page: Projects section (depends on #122) #176

Open
opened 2026-06-08 04:36:00 +00:00 by ldraney · 3 comments
Owner

Type

Feature

Lineage

Split from #126 (CSS refresh). Child of spike #121. Part of Phase 3. Depends on #122 (ServiceRequest model — MERGED).

Repo

ldraney/landscaping-assistant

User Story

As a crew lead or admin, I want to see active and completed projects on the property detail page so I can track one-off work and service requests alongside the property's regular services.

Context

The property detail page (refreshed in #126) needs a Projects/Requests section showing ServiceRequests for the property. This is the admin/lead-facing display — the client-facing request form is #123. Projects are ServiceRequest records.

Source of truth for statuses is the model (ServiceRequest::STATUSES and ServiceRequest::VALID_TRANSITIONS), not docs/service-requests.md (which may lag behind).

File Targets

  • app/views/properties/show.html.erb (update — add projects/requests section)
  • app/views/properties/_service_requests.html.erb (new partial — lives under properties/ since it renders from properties#show)
  • app/assets/stylesheets/application.css (add project list and status badge styles — reuse existing .status-indicator and .role-badge patterns at lines 1564-1616)
  • app/controllers/properties_controller.rb (eager-load service_requests in show action)
  • spec/requests/properties_spec.rb (update show spec)

Acceptance Criteria

  • Projects/Requests section visible on property detail page below property details
  • Shows active requests (status: requested, quoted, accepted, paid, scheduled) grouped together
  • Shows completed/declined requests separately (collapsible or below active)
  • Each request shows: description, request_type badge, status badge, price (if quoted/paid)
  • Empty state when no requests exist ("No projects or requests yet")
  • Works on mobile (44px touch targets, proper spacing)

Test Expectations

  • spec/requests/properties_spec.rb: show page includes projects section, renders request details
  • Run: bundle exec rspec

Constraints

  • CSS follows ~/ror-css-guide — no Tailwind, design tokens in :root
  • Mobile-first, one breakpoint at 600px
  • Read-only display in this ticket — admin CRUD is #179, client request form is #123
  • Reuse existing .status-indicator and .role-badge CSS patterns for status/type badges
  • Reference ServiceRequest::STATUSES in the model as source of truth for status values

Feature Flag

None

Checklist

  • PR opened
  • Tests pass
  • No unrelated changes
  • #122 — ServiceRequest model (MERGED)
  • #126 — CSS refresh (MERGED)
  • #206 — Missing decline transitions (bug — does not block this display ticket)
  • #123 — Client request form (sibling ticket)
  • #179 — Admin project workflow (depends on this display)
### Type Feature ### Lineage Split from #126 (CSS refresh). Child of spike #121. Part of Phase 3. Depends on #122 (ServiceRequest model — MERGED). ### Repo `ldraney/landscaping-assistant` ### User Story As a crew lead or admin, I want to see active and completed projects on the property detail page so I can track one-off work and service requests alongside the property's regular services. ### Context The property detail page (refreshed in #126) needs a Projects/Requests section showing ServiceRequests for the property. This is the **admin/lead-facing display** — the client-facing request form is #123. Projects are ServiceRequest records. **Source of truth for statuses is the model** (`ServiceRequest::STATUSES` and `ServiceRequest::VALID_TRANSITIONS`), not `docs/service-requests.md` (which may lag behind). ### File Targets - `app/views/properties/show.html.erb` (update — add projects/requests section) - `app/views/properties/_service_requests.html.erb` (new partial — lives under properties/ since it renders from properties#show) - `app/assets/stylesheets/application.css` (add project list and status badge styles — reuse existing `.status-indicator` and `.role-badge` patterns at lines 1564-1616) - `app/controllers/properties_controller.rb` (eager-load service_requests in show action) - `spec/requests/properties_spec.rb` (update show spec) ### Acceptance Criteria - [ ] Projects/Requests section visible on property detail page below property details - [ ] Shows active requests (status: requested, quoted, accepted, paid, scheduled) grouped together - [ ] Shows completed/declined requests separately (collapsible or below active) - [ ] Each request shows: description, request_type badge, status badge, price (if quoted/paid) - [ ] Empty state when no requests exist ("No projects or requests yet") - [ ] Works on mobile (44px touch targets, proper spacing) ### Test Expectations - `spec/requests/properties_spec.rb`: show page includes projects section, renders request details - Run: `bundle exec rspec` ### Constraints - CSS follows `~/ror-css-guide` — no Tailwind, design tokens in :root - Mobile-first, one breakpoint at 600px - Read-only display in this ticket — admin CRUD is #179, client request form is #123 - Reuse existing `.status-indicator` and `.role-badge` CSS patterns for status/type badges - Reference `ServiceRequest::STATUSES` in the model as source of truth for status values ### Feature Flag None ### Checklist - [ ] PR opened - [ ] Tests pass - [ ] No unrelated changes ### Related - #122 — ServiceRequest model (MERGED) - #126 — CSS refresh (MERGED) - #206 — Missing decline transitions (bug — does not block this display ticket) - #123 — Client request form (sibling ticket) - #179 — Admin project workflow (depends on this display)
Author
Owner

Scope Review: NEEDS_REFINEMENT

Review note: review-1403-2026-06-07

Template complete, all file targets verified, dependencies (#122, #126) confirmed merged. One fixable issue blocks READY:

  • [BODY] docs/service-requests.md does not exist in the repo. The Context and Constraints sections reference it. Either create the doc (separate ticket) or inline the status lifecycle values (requested, quoted, paid, scheduled, completed, declined from ServiceRequest::STATUSES). The model is the source of truth.
  • [SCOPE] No arch-rails-app note exists in pal-e-docs (platform-wide gap, not blocking this ticket specifically).
## Scope Review: NEEDS_REFINEMENT Review note: `review-1403-2026-06-07` Template complete, all file targets verified, dependencies (#122, #126) confirmed merged. One fixable issue blocks READY: - **`[BODY]`** `docs/service-requests.md` does not exist in the repo. The Context and Constraints sections reference it. Either create the doc (separate ticket) or inline the status lifecycle values (`requested, quoted, paid, scheduled, completed, declined` from `ServiceRequest::STATUSES`). The model is the source of truth. - **`[SCOPE]`** No `arch-rails-app` note exists in pal-e-docs (platform-wide gap, not blocking this ticket specifically).
Author
Owner

Scope update (post review-1403-2026-06-07):

New dependency: #195 (auth prereqs — session sub, accepted status, current_crew_member helper).

Property access model clarified:

Role Properties visible Projects visible Can edit
Client Own only (via owner_sub = session sub) On own property No
Member All All No
Lead All All Yes
Admin All All Yes

docs/service-requests.md will exist once PR #182 merges (already approved, pending merge).

**Scope update (post review-1403-2026-06-07):** New dependency: #195 (auth prereqs — session sub, accepted status, current_crew_member helper). **Property access model clarified:** | Role | Properties visible | Projects visible | Can edit | |---|---|---|---| | Client | Own only (via owner_sub = session sub) | On own property | No | | Member | All | All | No | | Lead | All | All | Yes | | Admin | All | All | Yes | `docs/service-requests.md` will exist once PR #182 merges (already approved, pending merge).
Author
Owner

Access update: Request creation is NOT client-only. Any role can create a service request from the property detail page:

  • Member/Lead/Admin — can submit requests on any property they can view
  • Only admin sets the bid. Only the client accepts.
**Access update:** Request creation is NOT client-only. Any role can create a service request from the property detail page: - **Member/Lead/Admin** — can submit requests on any property they can view - Only **admin** sets the bid. Only the **client** accepts.
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#176
No description provided.