Expose RechargeAccount direction as string property#539
Conversation
So API calls to get details are clear
📝 WalkthroughWalkthroughA computed ChangesRechargeAccount DirectionType
Swagger metadata
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/Payments.Core/Domain/RechargeAccount.cs (1)
22-24: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider a clearer property name.
DirectionTypereturns the direction's name (e.g. "Credit"), not a "type" per se —DirectionNameorDirectionStringwould better convey intent. Purely stylistic, not blocking.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/Payments.Core/Domain/RechargeAccount.cs` around lines 22 - 24, Rename the RechargeAccount computed property DirectionType to a clearer name such as DirectionName or DirectionString, and update any internal references to match; the property currently returns Direction.ToString(), so the new name should better reflect that it exposes the direction’s string representation rather than a type.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/Payments.Core/Domain/RechargeAccount.cs`:
- Around line 22-24: Rename the RechargeAccount computed property DirectionType
to a clearer name such as DirectionName or DirectionString, and update any
internal references to match; the property currently returns
Direction.ToString(), so the new name should better reflect that it exposes the
direction’s string representation rather than a type.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: b3848c7f-38fa-4726-aa39-20dbc777cf75
📒 Files selected for processing (2)
src/Payments.Core/Domain/RechargeAccount.cstests/Payments.Tests/DatabaseTests/RechargeAccountTests.cs
Remove redundant X-Auth-Token header parameter to avoid confusion with the main authorization flow. Update the Swagger API contact information to the central CAES help portal URL.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/Payments.Mvc/Swagger/SecurityRequirementsOperationFilter.cs (1)
50-67: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove dead code instead of commenting it out.
The
operation.Parameterslist initialization (Lines 50-53) is now unused since the only parameter addition is commented out (Lines 55-67). Delete both instead of leaving commented-out code behind; version control already preserves history if it's needed later.♻️ Proposed cleanup
- if (operation.Parameters == null) - { - operation.Parameters = new List<OpenApiParameter>(); - } - - //Having this parameter causes confusion in swagger UI as the main authorization must be used - //operation.Parameters.Add(new OpenApiParameter - //{ - // Name = "X-Auth-Token", //ApiKeyMiddleware.HeaderKey, - // In = ParameterLocation.Header, - // Description = "access token", - // Required = true, - // Schema = new OpenApiSchema - // { - // Type = "string", - // Default = new OpenApiString("ApiKey"), - // } - //}); }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/Payments.Mvc/Swagger/SecurityRequirementsOperationFilter.cs` around lines 50 - 67, Remove the dead code from SecurityRequirementsOperationFilter: the operation.Parameters null-initialization and the commented-out OpenApiParameter block are no longer used. Update the method that builds the Swagger operation so it no longer creates Parameters solely for the removed X-Auth-Token entry, and keep the implementation focused on the active security requirements logic.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/Payments.Mvc/Swagger/SecurityRequirementsOperationFilter.cs`:
- Around line 50-67: Remove the dead code from
SecurityRequirementsOperationFilter: the operation.Parameters
null-initialization and the commented-out OpenApiParameter block are no longer
used. Update the method that builds the Swagger operation so it no longer
creates Parameters solely for the removed X-Auth-Token entry, and keep the
implementation focused on the active security requirements logic.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 81a6e287-dd84-4c46-80ba-1d7084253cb1
📒 Files selected for processing (2)
src/Payments.Mvc/Startup.cssrc/Payments.Mvc/Swagger/SecurityRequirementsOperationFilter.cs
So API calls to get details are clear
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Documentation / API Updates
X-Auth-Tokenheader from Swagger operations.