fix #114: fix config#115
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #114 by moving the “Parent > Child” cost center naming behavior from runtime/controller mapping into the persisted CostCenter.name, so ordering/searching by name works directly at the database level.
Changes:
- Update
CostCenterService.create()to rewriteCostCenter.nameto include parent naming before persisting. - Remove runtime parent-name concatenation from
CostCenterMapper.mapToListView()and align mapper test expectations. - Add a recursive helper to build hierarchical names via parents.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
src/test/kotlin/br/com/webbudget/mappers/registration/CostCenterMapperUTest.kt |
Updates list-view mapper unit test to expect pass-through name behavior. |
src/main/kotlin/br/com/webbudget/domain/services/registration/CostCenterService.kt |
Mutates name on create before validation/persist. |
src/main/kotlin/br/com/webbudget/domain/entities/registration/CostCenter.kt |
Adds name-rewrite method and parent-chain name builder. |
src/main/kotlin/br/com/webbudget/application/mappers/registration/CostCenterMapper.kt |
Removes controller-layer name concatenation; now maps persisted name as-is. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
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.



Objective
Fixing the issue #114
What's changed?
Added the name of the parent to the name when saving to the database
How can I test it?
Run the tests
Additional context
Issue #114