feat(contacts): finish PMS-17 story (portal flag, drop dead alias) #22
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/contacts-story-pms-17"
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?
Implements YouTrack story PMS-17 (contacts / companies / sites). One commit per sub-task.
Sub-tasks
update_sitesilent no-op: already shipped in the audit-batch series; closed administratively.create_portal_accessoncreate_contact: flipscontacts.is_portal_user = TRUEwhen set. The customer-side "pick a password" step belongs to the portal-session flow (PMS-26), so noportal_password_hashis minted here; the agent shares the portal URL out-of-band./companiesalias:.nest("/companies", Router::new())matched nothing and made/api/v1/companieslook mysteriously 404. Removed; canonical path is/api/v1/contacts/companies/...(documented inline).Behaviour-visible changes
POST /api/v1/contacts/contactswithcreate_portal_access: truenow flips the contact'sis_portal_userflag (visible on subsequent GETs).GET /api/v1/companiesno longer matches; the canonical endpoint is/api/v1/contacts/companies.Test plan
cargo check --bin mokosh-serverclean (verified locally).POST /api/v1/contacts/contacts {"create_portal_access": true, ...}-> subsequentGET /api/v1/contacts/contacts/:idshows"is_portal_user": true.curl /api/v1/companiesreturns the global 404 (or fallback HTML, depending on host header), not a/companies404.Closes #PMS-17
`.nest("/companies", Router::new())` matched nothing, so `/api/v1/companies` returned a misleading 404 instead of either succeeding as an alias or returning a route-not-found from the parent. The canonical company endpoints already live under `/api/v1/contacts/companies/...`; clients pointing at the old path need to update. #PMS-20 State DonePull request closed