shoc-backend/SeaHaven.Services
Alexandre Brandizzi 582af8fb2c fix(workorders): compare manual POC against the followed contact, not any site contact
The manual POC "follow the site" clear-rule compared the edit against every
live Site contact. A work order only ever displays one of them, so editing to
a different live contact (Site has Alice primary and Bob; WO shows Alice; edit
to Bob) matched, cleared the override, and left the row showing Alice with no
audit row written — the SH-379 symptom on a different input. A work order with
a linked WorkOrderContacts POC hit the same bug when the dispatcher typed the
Site's primary: the override cleared and the linked contact showed instead.

Compare the edit against the single contact the work order actually follows —
the linked WorkOrderContacts POC, or else the Site primary (ResolvePrimary) —
matching the board projection's override -> linked -> site precedence, and
store the override whenever the edit differs from it. The create path in
WorkOrderBoardCreateService had the same any-contact rule and gets the same
fix; a supplied PocContactId that is not a live Site contact leaves no follow
target, so the typed POC is stored.

Replaces MatchesAnySiteContact with Matches(name, phone, contact); comment and
PR-body wording updated to state the followed-contact rule. Adds tests for the
second-site-contact edit, the linked-contact-differs edit, and the
second-site-contact create case.
2026-09-18 18:56:29 -03:00
..
Configuration feat(permissions): protect configured account owner (SH-329) 2026-09-16 21:40:22 -03:00
Constants feat(team-members): support pending member creation (SH-325) 2026-09-16 21:41:55 -03:00
DependencyInjection feat(permissions): protect configured account owner (SH-329) 2026-09-16 21:40:22 -03:00
DTOs fix(workorders): persist manual POC override with audit and site-follow (SH-379) 2026-09-18 14:30:54 -03:00
Exceptions feat(services): add global services registry 2026-09-16 17:07:59 -03:00
Helpers fix(workorders): compare manual POC against the followed contact, not any site contact 2026-09-18 18:56:29 -03:00
Implementation fix(workorders): compare manual POC against the followed contact, not any site contact 2026-09-18 18:56:29 -03:00
Interfaces fix(workorders): persist manual POC override with audit and site-follow (SH-379) 2026-09-18 14:30:54 -03:00
Validation feat(locations): manage ordered site contacts 2026-09-15 19:03:54 -03:00
SeaHaven.Services.csproj refactor: enforce backend boundaries and optimize dispatch (#30) 2026-07-24 17:35:34 -03:00