shoc-backend/SeaHaven.DataServices/Implementation
Alexandre Brandizzi af441894d7 fix(permissions): clean up overrides on user delete and converge concurrent override writes (SH-328)
DeleteUserWithCascadeAsync never removed UserPermissionOverrides rows, and
the FK on UserId is Restrict. Once an override was saved for a member, the
admin hard-delete (DeleteUserAsync -> DeleteUserWithCascadeAsync) failed the
foreign key inside the transaction and the controller surfaced it as a 400,
so the user was never deleted. Add an explicit ExecuteDelete on
UserPermissionOverrides before the user is removed, matching how UserRoles is
already cleared in the same method (no schema change).

SetOverrideAsync was check-then-insert on the composite key with no
DbUpdateException handling, so two concurrent PUTs for the same
(UserId, PermissionKey) let the loser violate PK_UserPermissionOverrides and
return 500. Catch the conflict, detach the pending insert, and converge by
updating the persisted row to the caller's requested state.
2026-09-16 20:27:26 -03:00
..
AccountDataService.cs fix(locations): gate account assignment by scope and active accounts 2026-08-26 14:16:59 -03:00
AssetDataService.cs backend architectural template 2026-05-06 10:49:33 -05:00
CalendarDataService.cs refactor: enforce backend boundaries and optimize dispatch (#30) 2026-07-24 17:35:34 -03:00
CategoryDataService.cs refactor 2026-04-28 18:55:14 -05:00
CommentDataService.cs fix(work-orders): scope legacy GET GetComments by account [SH-221] 2026-08-11 15:18:29 -03:00
CommonDataService.cs refactor: enforce backend boundaries and optimize dispatch (#30) 2026-07-24 17:35:34 -03:00
CompletionDocTemplateDataService.cs feat(work-orders): add Phase 6 slide-over detail comments audit and media API 2026-07-13 13:13:00 -03:00
ContactDataService.cs backend architectural template 2026-05-06 10:49:33 -05:00
DashboardDataService.cs refactor: enforce backend boundaries and optimize dispatch (#30) 2026-07-24 17:35:34 -03:00
DispatchDataService.cs refactor: enforce backend boundaries and optimize dispatch (#30) 2026-07-24 17:35:34 -03:00
DropdownOptionsDataService.cs refactor: enforce backend boundaries and optimize dispatch (#30) 2026-07-24 17:35:34 -03:00
EmployeeDataService.cs backend architectural template 2026-05-06 10:49:33 -05:00
FollowUpDataService.cs refactor: enforce backend boundaries and optimize dispatch (#30) 2026-07-24 17:35:34 -03:00
ForgetPasswordDataService.cs refactor: enforce backend boundaries and optimize dispatch (#30) 2026-07-24 17:35:34 -03:00
LocationDataService.cs fix(locations): preserve contacts when deleting sites 2026-09-15 19:03:54 -03:00
PMScheduleDataService.cs backend architectural template 2026-05-06 10:49:33 -05:00
QuotesDataService.cs refactor: enforce backend boundaries and optimize dispatch (#30) 2026-07-24 17:35:34 -03:00
SettingsDataService.cs refactor: enforce backend boundaries and optimize dispatch (#30) 2026-07-24 17:35:34 -03:00
SyncDataService.cs refactor: enforce backend boundaries and optimize dispatch (#30) 2026-07-24 17:35:34 -03:00
TaskListTemplateDataService.cs refactor: enforce backend boundaries and optimize dispatch (#30) 2026-07-24 17:35:34 -03:00
TeamPermissionOverrideDataService.cs fix(permissions): clean up overrides on user delete and converge concurrent override writes (SH-328) 2026-09-16 20:27:26 -03:00
UpliftDataService.cs fix(work-orders): serialize uplift create and atomic cancel (SH-196) 2026-08-18 10:20:05 -03:00
UserDataService.cs fix(permissions): clean up overrides on user delete and converge concurrent override writes (SH-328) 2026-09-16 20:27:26 -03:00
VendorCompanyRosterDataService.cs feat(vendors): add admin-assigned vendor company Area 2026-09-16 11:34:45 -03:00
VendorDataService.cs feat(vendors): add admin-assigned vendor company Area 2026-09-16 11:34:45 -03:00
VendorDocumentDataService.cs feat(uplifts): complete SH-101 approval lifecycle 2026-08-11 08:58:19 -03:00
VendorOperationsDataService.cs refactor: enforce backend boundaries and optimize dispatch (#30) 2026-07-24 17:35:34 -03:00
WorkOrderAdvancedSearchDataService.cs SH-338: filter unscheduled work orders before pagination (#116) 2026-09-15 16:46:40 -03:00
WorkOrderAuditDataService.cs refactor: enforce backend boundaries and optimize dispatch (#30) 2026-07-24 17:35:34 -03:00
WorkOrderBoardDataService.cs feat(work-orders): include unresolved prior-week rows on GET board 2026-09-02 09:49:56 -03:00
WorkOrderBoardMutationDataService.cs feat(work-orders): capture Site/Vendor/POC snapshot on Completed 2026-09-10 15:46:25 -03:00
WorkOrderCompletionDataService.cs fix(work-orders): scope comments and completion-doc by account [SH-221] 2026-08-11 14:52:02 -03:00
WorkOrderDataService.cs fix(work-orders): scope legacy list/detail GETs by account [SH-221] 2026-08-11 11:57:37 -03:00
WorkOrderDetailDataService.cs !fix(work-orders): fail-closed media account scope with org_scope claim [SH-221] 2026-08-06 10:26:04 -03:00
WorkOrderDomainJobDataService.cs fix(work-orders): derive Past Due from DueDate instead of ScheduledDate 2026-08-13 13:28:25 -03:00
WorkOrderFieldLockDataService.cs refactor: enforce backend boundaries and optimize dispatch (#30) 2026-07-24 17:35:34 -03:00
WorkOrderIngestDataService.cs refactor: enforce backend boundaries and optimize dispatch (#30) 2026-07-24 17:35:34 -03:00
WorkOrderMediaDataService.cs feat(work-orders): authorize WO media content reads 2026-09-08 11:19:41 -03:00
WorkOrderOpsHealthDataService.cs refactor: enforce backend boundaries and optimize dispatch (#30) 2026-07-24 17:35:34 -03:00
WorkOrderReconciliationDataService.cs feat: complete SH-133 procurement reconciliation 2026-07-24 22:13:25 -03:00
WorkOrderWebhookDataService.cs fix(work-orders): apply account scope across create and reads [SH-221] 2026-08-11 10:45:37 -03:00