add [properties-be] - properties crate set entity property#749
Merged
danielkweon merged 17 commits intomainfrom Dec 28, 2025
Merged
Conversation
87ba976 to
bd1c015
Compare
bd1c015 to
5881479
Compare
0528aa8 to
9a8b677
Compare
synoet
approved these changes
Dec 27, 2025
Contributor
synoet
left a comment
There was a problem hiding this comment.
Mostly fine. Please respond to some comments
Comment on lines
+179
to
+183
| // Check edit permission first (permission service is required) | ||
| let permission_service = self | ||
| .permission_service | ||
| .as_ref() | ||
| .ok_or(PropertiesErr::PermissionDenied)?; |
Contributor
There was a problem hiding this comment.
This seems wrong ? WHy is permission_service an Option to start with ?
Contributor
Author
There was a problem hiding this comment.
not every instance of properties service needs permissions - so i made it optional. if permissions is not provided, any business logic requiring permissions fails.
if properties service is only used for stuff like getting options, display names, etc., i thought it would be a bad pattern to always require permissions. i can change this if this isnt a pattern we want.
Add upsert method to PropertiesRepo trait and implementation following hexagonal architecture pattern. This allows inserting or updating entity properties in a single operation, needed for quick_create_task endpoint. - Add upsert_entity_property to PropertiesRepo trait - Implement in PropertiesPgRepo using entity_property_queries - Follow existing patterns for update_entity_property_value_if_exists
Add method to PropertiesRepo trait and implementation following hexagonal architecture pattern. This allows fetching property definitions by ID, needed for property validation in service layer. - Add get_property_definition to PropertiesRepo trait - Implement in PropertiesPgRepo using property_definition_queries - Add property_definition_queries module with SQL query helper
Add method to PropertiesRepo trait and implementation following hexagonal architecture pattern. This allows counting how many option IDs are valid for a property definition, needed for property option validation in service layer. - Add count_valid_property_options to PropertiesRepo trait - Implement in PropertiesPgRepo using entity_property_queries - Add count_valid_property_options query helper function - Add validate_property_options helper method in service layer
…operty_options Match pattern used by other services in codebase - use direct anyhow::bail! without explicit warning logs
…rty_value to shared location
…nd extract handlers
…mail service pattern
- Rename PermissionChecker trait to PermissionService - Rename PermissionCheckerImpl to PermissionServiceImpl - Rename permission_checker.rs to permission_service.rs - Update all references throughout properties and properties_service crates - Simplify import paths by replacing super::super:: with crate:: paths - Update test mocks to use MockPermissionService
…ction Extract repeated mock permission service initialization code into a create_mock_permission_service() helper function. This reduces duplication across 14 test cases and makes future changes to the mock setup easier.
e02b159 to
6d5b963
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
add [properties-be] - set entity property hexagon migration
depends on #752