Skip to content

feat(CONS-6022): add analytics events to mobile sdks #17

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

vesai
Copy link
Contributor

@vesai vesai commented May 25, 2025

Summary by CodeRabbit

  • New Features
    • Added a "Bank address" input field to the settings for specific product types, allowing users to enter or update their bank address.
  • Enhancements
    • The app now includes additional user details ("first name" and "last name") when creating a user account.
  • Improvements
    • Updated server URL handling for greater clarity and consistency in configuration.
    • Updated SDK to the latest release candidate version for improved functionality.

Copy link

linear bot commented May 25, 2025

@vesai vesai marked this pull request as ready for review May 26, 2025 22:48
@vesai vesai requested a review from a team May 26, 2025 22:48
Copy link

coderabbitai bot commented May 26, 2025

📝 Walkthrough

"""

Walkthrough

The changes introduce a new bankAddress property to the account state, update naming conventions for server URL properties, and expand the user creation request to include first and last names. UI components are updated to allow input of the bank address, and configuration objects now accept both API and CDN URLs.

Changes

File(s) Change Summary
.../MainViewModel.kt Added bankAddress to AccountState, renamed url to apiUrl in ServerUrls, updated usage of server URL properties.
.../ProductFragment.kt Updated TruvBridgeViewConfig to accept both apiUrl and cdnUrl from getServerUrls().
.../api/TruvApiClient.kt Modified createUser to include first_name and last_name in the POST request body.
.../ui/AdditionalSettings.kt Added an OutlinedTextField for editing bankAddress in the UI for certain product types.
app/build.gradle Updated Truv SDK dependency version from '1.8.1' to '1.9.0-rc.1'.

Assessment against linked issues

Objective Addressed Explanation
Add analytics events to mobile SDKs (CONS-6022) No analytics event tracking logic or related event POST requests are present in these changes.
"""

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Knowledge Base: Disabled due to Reviews > Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 3d7dedb and d42ddd4.

📒 Files selected for processing (1)
  • app/build.gradle (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • app/build.gradle

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a 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

🧹 Nitpick comments (2)
app/src/main/java/com/truv/api/TruvApiClient.kt (1)

61-65: Consider making user names configurable for non-demo usage.

The implementation correctly adds first and last names to the user creation request. However, the hardcoded values "John" and "Doe" are appropriate for a demo app but should be configurable if this code is used in production.

For production usage, consider making these configurable:

-    fun createUser(
-        onSuccess: (id: String) -> Unit, onFailure: (message: String?) -> Unit
-    ) = runBlocking {
+    fun createUser(
+        firstName: String = "John",
+        lastName: String = "Doe", 
+        onSuccess: (id: String) -> Unit, 
+        onFailure: (message: String?) -> Unit
+    ) = runBlocking {
         val gson = Gson()
         "$baseUrl/v1/users/".httpPost().header(
             mapOf(
                 "Content-Type" to "application/json",
                 "X-Access-Client-Id" to clientId,
                 "X-Access-Secret" to clientSecret
             )
         ).body(gson.toJson(mapOf(
             "external_user_id" to "demo-app-${UUID.randomUUID()}",
-            "first_name" to "John",
-            "last_name" to "Doe",
+            "first_name" to firstName,
+            "last_name" to lastName,
         )))
app/src/main/java/com/truv/MainViewModel.kt (1)

20-20: Consider using a more generic default bank address.

The implementation correctly adds the bankAddress property. However, the specific real address used as default might not be appropriate for all demo scenarios.

Consider using a more generic placeholder:

-    @SerializedName("bank_address") val bankAddress: String = "357 Kings Hwy N, Cherry Hill, NJ 08034, USA",
+    @SerializedName("bank_address") val bankAddress: String = "123 Main St, Anytown, ST 12345, USA",
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Knowledge Base: Disabled due to Reviews > Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 14dd67a and 3d7dedb.

📒 Files selected for processing (4)
  • app/src/main/java/com/truv/MainViewModel.kt (3 hunks)
  • app/src/main/java/com/truv/ProductFragment.kt (1 hunks)
  • app/src/main/java/com/truv/api/TruvApiClient.kt (1 hunks)
  • app/src/main/java/com/truv/ui/AdditionalSettings.kt (1 hunks)
🔇 Additional comments (4)
app/src/main/java/com/truv/ProductFragment.kt (1)

74-75: LGTM: Correctly updated to use both API and CDN URLs.

The configuration properly uses both apiUrl and cdnUrl from the ServerUrls data class, which aligns with the updated data model in MainViewModel.kt.

app/src/main/java/com/truv/ui/AdditionalSettings.kt (1)

143-154: LGTM: Consistent implementation following established patterns.

The bank address input field is properly implemented with correct state binding and follows the same pattern as other account-related fields. The placement within the conditional block for deposit_switch and pll products is appropriate.

app/src/main/java/com/truv/MainViewModel.kt (2)

59-59: LGTM: Property renamed consistently.

The renaming from url to apiUrl improves clarity and is properly reflected in the usage throughout the codebase.


269-269: LGTM: Correctly updated to use the renamed property.

The code properly uses the renamed apiUrl property instead of destructuring a single URL value, maintaining consistency with the updated ServerUrls data class.

Also applies to: 276-276

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.

1 participant