-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(application-system-api): Fix user-profile shared-api module #15439
Conversation
Add validation error handling for bank account and email.
WalkthroughThe changes introduce a shift from using Changes
Sequence DiagramsequenceDiagram
participant Client
participant UserProfileService
participant V2MeApi
Client->>UserProfileService: Request user profile
UserProfileService->>V2MeApi: meUserProfileControllerFindUserProfile()
V2MeApi-->>UserProfileService: Return user profile data
UserProfileService->>UserProfileService: Validate bank and email info
alt Valid data
UserProfileService-->>Client: Return profile data
else Invalid data
UserProfileService-->>Client: Return error
end
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- libs/application/template-api-modules/src/lib/modules/shared/api/user-profile/user-profile.service.ts (4 hunks)
Additional context used
Path-based instructions (1)
libs/application/template-api-modules/src/lib/modules/shared/api/user-profile/user-profile.service.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
Biome
libs/application/template-api-modules/src/lib/modules/shared/api/user-profile/user-profile.service.ts
[error] 28-28: Decorators are not valid here.
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.(parse)
Additional comments not posted (4)
libs/application/template-api-modules/src/lib/modules/shared/api/user-profile/user-profile.service.ts (4)
4-4
: Imports look good.The import statements for
V2MeApi
andTemplateApiError
are appropriate for the new functionality and error handling.Also applies to: 21-21
26-26
: Constructor update aligns with new API usage.The constructor now correctly injects
V2MeApi
instead ofV2UsersApi
, aligning with the updated API usage.
36-36
: Method update to useV2MeApi
is correct.The
userProfileApiWithAuth
method now correctly returnsV2MeApi
instead ofV2UsersApi
, supporting the new API.
41-41
: Enhancements touserProfile
method are appropriate.The
userProfile
method now usesmeUserProfileControllerFindUserProfile
instead ofuserProfileControllerFindUserProfile
and includes validation checks for bank information and email. These changes enhance the robustness of the method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- libs/application/template-api-modules/src/lib/modules/shared/api/user-profile/user-profile.module.ts (2 hunks)
Additional context used
Path-based instructions (1)
libs/application/template-api-modules/src/lib/modules/shared/api/user-profile/user-profile.module.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
Additional comments not posted (3)
libs/application/template-api-modules/src/lib/modules/shared/api/user-profile/user-profile.module.ts (3)
4-4
: LGTM!The import statement correctly changes from
V2UsersApi
toV2MeApi
as per the PR objectives.
20-20
: LGTM!The provider correctly changes from
V2UsersApi
toV2MeApi
as per the PR objectives.
22-25
: LGTM!The factory function correctly creates an instance of
V2MeApi
with the required configuration.
Datadog ReportAll test runs ✅ 23 Total Test Services: 0 Failed, 23 Passed Test ServicesThis report shows up to 10 services
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #15439 +/- ##
==========================================
- Coverage 37.01% 37.01% -0.01%
==========================================
Files 6555 6542 -13
Lines 133959 133567 -392
Branches 38339 38233 -106
==========================================
- Hits 49588 49442 -146
+ Misses 84371 84125 -246
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 65 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
* Use V2MeApi from UserProfile V2. Add validation error handling for bank account and email. * updating module to match service --------- Co-authored-by: Baldur Óli <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
What
Fixing the api used from the user profile v2, so we use the Me version which gets user data based on user access token.
Reinstate the bankInfo and email validation error responses.
Why
To get user profile data from the new user profile database.
Screenshots / Gifs
N/A
Checklist:
Summary by CodeRabbit
New Features
Refactor
V2UsersApi
toV2MeApi
for user profile services.