buildEntitlementsFromTransactions

fun buildEntitlementsFromTransactions(transactionsByEntitlement: Map<String, List<EntitlementTransaction>>, rawEntitlementsByProductId: Map<String, Set<Entitlement>>, productIdsByEntitlementId: Map<String, Set<String>>): Map<String, List<Entitlement>>(source)

Builds enriched entitlements from transactions grouped by entitlement ID.

This method processes transactions and enriches the raw entitlements from the server with computed properties based on the user's transaction history.

Return

Map of product ID to set of enriched entitlements

Parameters

transactionsByEntitlement

Map of entitlement ID to list of transactions for that entitlement

rawEntitlementsByProductId

Map of product ID to set of entitlements from server config

productIdsByEntitlementId

Map of entitlement ID to all product IDs that can unlock it (from config)