Skip to content

fix #114: fix config#115

Merged
arthurgregorio merged 2 commits into
mainfrom
114-cost-center-display-name-issue
Apr 25, 2026
Merged

fix #114: fix config#115
arthurgregorio merged 2 commits into
mainfrom
114-cost-center-display-name-issue

Conversation

@arthurgregorio

Copy link
Copy Markdown
Member

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

@arthurgregorio arthurgregorio self-assigned this Apr 22, 2026
Copilot AI review requested due to automatic review settings April 22, 2026 02:44
@arthurgregorio arthurgregorio linked an issue Apr 22, 2026 that may be closed by this pull request

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 rewrite CostCenter.name to 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.

Comment thread src/main/kotlin/br/com/webbudget/domain/entities/registration/CostCenter.kt Outdated
@sonarqubecloud

Copy link
Copy Markdown

@arthurgregorio arthurgregorio merged commit 7a79330 into main Apr 25, 2026
3 checks passed
@arthurgregorio arthurgregorio deleted the 114-cost-center-display-name-issue branch April 25, 2026 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cost center display name issue

2 participants