Auth prereqs: session sub, accepted status, CrewMember auto-create, current_crew_member helper #195
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
Prereq for #123 (client request UI), #176 (projects display), #179 (admin workflow), #180 (comments). Part of Phase 3.
Repo
ldraney/landscaping-assistantUser Story
As a developer building the service request UI, I need the session to contain the Keycloak sub, an
acceptedstatus on ServiceRequest, and a guaranteed CrewMember record for every user so FK references and access control work correctly.Context
Three gaps identified during scope review of #123 and #176:
sub(UUID). Needed to matchowner_subon properties for client access control.acceptedstate betweenquotedandpaid— work often begins after bid acceptance, before payment.crew_member_idFK. Auto-create on login.current_crew_memberhelper to get the CrewMember record for the logged-in user.File Targets
app/controllers/sessions_controller.rb(update — add sub to session, find_or_create CrewMember)app/controllers/application_controller.rb(update — add current_crew_member helper)app/models/service_request.rb(update — add accepted status and transitions)spec/models/service_request_spec.rb(update — test new transitions)Acceptance Criteria
sub: auth.uid(Keycloak UUID)current_crew_memberhelper available in controllers and viewsTest Expectations
spec/models/service_request_spec.rb: new transition specsbundle exec rspecConstraints
Feature Flag
None
Checklist
Related