Skip to content

IAV-1212: add credits field to subscription prices with performance optimizations

saoud marouane a demandé de fusionner feature/IAV-1212 vers develop
  • Add BigDecimal credits field to StripePriceResponse
  • Add computeCredits() and computeAnnualCredits() public methods in StripeProductHelper
  • Fix annual credits to use full_price_without_discount_cents metadata (not discounted amount)
  • Fix NPE on null conversionRate in compute methods (return BigDecimal.ZERO)
  • Fix ArithmeticException on BigDecimal.divide by adding explicit scale/rounding
  • Fix missing conversionRateEur/Mad in updateProductWithPlans response
  • Optimize getSubscriptionProducts: single DB call instead of N x2 queries
  • Optimize findMostPopularProductId: single Stripe API call with in-memory groupingBy
  • Deduplicate updateConversionRates (delegates to createConversionRates)
  • Centralize computeCredits/computeAnnualCredits in helper (remove duplicates from service)

Closes IAV-1212

Rapports de requête de fusion