Skip to content

Refactor BuildStatement with improved validation and flow#1718

Merged
StuartFerguson merged 1 commit intomasterfrom
refactor/#1666_reduce_complexity_in_buildstatement
Apr 7, 2026
Merged

Refactor BuildStatement with improved validation and flow#1718
StuartFerguson merged 1 commit intomasterfrom
refactor/#1666_reduce_complexity_in_buildstatement

Conversation

@StuartFerguson
Copy link
Copy Markdown
Member

Refactored the BuildStatement method to enhance structure, readability, and error handling. Introduced helper methods GetStatementAggregate and GetValidMerchant to encapsulate aggregate retrieval and validation logic. The new implementation ensures merchants exist and have addresses before building statements, and uses early returns for failure cases. The previous implementation was commented out and replaced with this improved version.

closes #1666

Refactored the BuildStatement method to enhance structure, readability, and error handling. Introduced helper methods GetStatementAggregate and GetValidMerchant to encapsulate aggregate retrieval and validation logic. The new implementation ensures merchants exist and have addresses before building statements, and uses early returns for failure cases. The previous implementation was commented out and replaced with this improved version.
@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · -5 duplication

Metric Results
Complexity 0
Duplication -5

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

@StuartFerguson StuartFerguson merged commit e037140 into master Apr 7, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Complexity] Method MerchantStatementDomainService::BuildStatement has a cyclomatic complexity of 9 (limit is 8)

1 participant