Skip to content
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

Add missing response fields to CustomerInfo. Including transaction Prices #2128

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

vegaro
Copy link
Contributor

@vegaro vegaro commented Feb 7, 2025

This pull request introduces several enhancements and new features to the SubscriptionInfo and related classes in the purchases module. The most important changes include adding new properties to the SubscriptionInfo class, creating a new PriceResponse class, and updating the SubscriptionInfoResponse class to include additional fields.

Enhancements to SubscriptionInfo and related classes:

  • purchases/src/main/kotlin/com/revenuecat/purchases/SubscriptionInfo.kt:

    • Added new properties autoResumeDate, displayName, price, and productPlanIdentifier to the SubscriptionInfo class. [1] [2]
    • Added a locale parameter to the constructor of SubscriptionInfo, for building the price
  • purchases/src/main/kotlin/com/revenuecat/purchases/common/responses/PriceResponse.kt:

    • Created a new PriceResponse class to handle price-related information.
  • purchases/src/main/kotlin/com/revenuecat/purchases/common/responses/SubscriptionInfoResponse.kt:

    • Updated the SubscriptionInfoResponse class to include autoResumeDate, displayName, price, and productPlanIdentifier fields. [1] [2]
  • purchases/src/main/kotlin/com/revenuecat/purchases/models/Transaction.kt:

    • Added new properties displayName, isSandbox, originalPurchaseDate, and price to the Transaction class. [1] [2]

Additional updates:

  • purchases/src/main/kotlin/com/revenuecat/purchases/utils/PriceExtensions.kt:
    • Changed the visibility of MICRO_MULTIPLIER to internal.

@vegaro vegaro force-pushed the cc-328-add-prices-to-customerinfo-transactions branch from 120a014 to c9eec4e Compare February 11, 2025 13:21
@vegaro vegaro added the pr:fix A bug fix label Feb 11, 2025
@vegaro vegaro marked this pull request as ready for review February 11, 2025 15:33
Copy link

codecov bot commented Feb 11, 2025

Codecov Report

Attention: Patch coverage is 53.57143% with 26 lines in your changes missing coverage. Please review.

Project coverage is 80.72%. Comparing base (9f3bc1e) to head (68c0085).

Files with missing lines Patch % Lines
...nuecat/purchases/common/responses/PriceResponse.kt 30.76% 8 Missing and 1 partial ⚠️
...otlin/com/revenuecat/purchases/SubscriptionInfo.kt 50.00% 7 Missing and 1 partial ⚠️
...hases/common/responses/SubscriptionInfoResponse.kt 33.33% 8 Missing ⚠️
...lin/com/revenuecat/purchases/models/Transaction.kt 92.85% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2128      +/-   ##
==========================================
- Coverage   80.87%   80.72%   -0.16%     
==========================================
  Files         275      276       +1     
  Lines        9293     9347      +54     
  Branches     1296     1300       +4     
==========================================
+ Hits         7516     7545      +29     
- Misses       1233     1255      +22     
- Partials      544      547       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +82 to +85
/**
* The display name of the subscription.
*/
val displayName: String?,
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the one set in the dashboard right?

import java.util.Locale

@Serializable
internal class PriceResponse(
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be a data class instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:fix A bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants