Day detail page: DayExclusion model and remove-from-list button #236
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Feature
Lineage
Decomposed from #233 (3 of 4). Depends on #235 ("Previously" accordion must exist to have a remove button).
Repo
ldraney/landscaping-assistantUser Story
As a crew lead or admin
I want to remove a property from the "Previously Tuesdays" list
So that properties we no longer service on that day stop cluttering the planning view
Context
The "Previously [Day]s" accordion (#235) shows all properties historically assigned on a weekday. Some properties may no longer be relevant (e.g., a client moved, service changed to a different day). Users need a way to exclude a property from the recurring list for a specific weekday without deleting historical data.
This introduces a
DayExclusionmodel -- a lightweight join table that records "property X is excluded from the Previously list for weekday Y." The "Previously" query filters out excluded properties.File Targets
Files to create:
db/migrate/XXXXXX_create_day_exclusions.rb-- migration forday_exclusionstableapp/models/day_exclusion.rb-- model with validationsapp/views/days/_previously_item.html.erb-- extract item partial with remove button (if not already extracted in #235)Files to modify:
app/controllers/days_controller.rb-- addexcludeaction (POST), update@previouslyquery to filter out excluded propertiesconfig/routes.rb-- addpost "/days/:date/exclude", to: "days#exclude", as: :day_excludeapp/views/days/_previously_section.html.erb-- add remove button per itemspec/requests/days_spec.rb-- add specs for exclusionSchema:
day_exclusions[property_id, wday]belongs_to :propertyFeature Flag
Flag: none
Additive behavior on the new day detail page.
Acceptance Criteria
DayExclusionrecord for that property + wdayTest Expectations
/days/:date/excludewith property_id creates exclusion and returns turbo streambundle exec rspec spec/requests/days_spec.rb spec/models/day_exclusion_spec.rbConstraints
work_queue_items/destroy.turbo_stream.erbwdayuses Ruby'sDate#wdayconvention: Sunday=0, Monday=1, ..., Saturday=6Checklist
Related
project-landscaping-assistantScope Review: READY
Review note:
review-1474-2026-06-15Ticket is well-scoped with complete template, verified traceability, accurate file targets, and testable acceptance criteria. Dependencies (#234, #235) are correctly documented and must land first. Execution order: #234 -> #235 -> #236 -> #237.
One systemic note (not blocking):
arch-rails-apparchitecture note exists in pal-e-docs (affects all rails-app board items, not just this one)