/simplify pass: efficiency + code-quality batch #52
Loading…
Reference in a new issue
No description provided.
Delete branch "develop"
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?
Summary
Batch from a /simplify pass — efficiency wins + code-quality cleanups across the API.
Efficiency
AsNoTracking()added to every read-only repo queryFindAccountStateAsyncslim projection for the auth filter (was loading the full Roles→Permissions graph to read two booleans)AccountActiveRequirementFilterresolves the user state once and shares it withPermissionRequirementFilterviaHttpContext.Items— saves one cache/DB round-trip per authenticated requestRemoveByPatternAsync(Redis SCAN) to tag-basedInvalidateTagAsyncToggleFavoriteswrites the join row directly instead of loading the full favourites graphCreateUserparallelizes its independentGetDefaultRole/GetTokenTypeawaitsRolePerUserService.UpdateUserRolescomputes add/remove deltas instead of full delete-then-insertRespirationExerciseServicedrops the redundant user cache+DB round-trip in Update/DeleteCode quality
ApiResponse.Ok(...)standardized across controllers (~80 sites)PermissionLabelsconstants replace stringly-typed permission labels (renamed fromPermissionsto avoid thecesizen_api.Api.Permissionsnamespace collision)UserRepository: single sharedToReturnDtoprojection across all four read pathsGlobalExceptionHandler: expected exceptions downgraded fromLogErrortoLogInformationTest plan
🤖 Generated with Claude Code