Consolidate subscription lookup logic in subscriptions_linked_to_namespace and for_namespaces_mapped

As discussed in #15654 (closed), we should consider consolidating the subscription lookup logic between:

  • Subscriptions::Purchases::Builder#subscriptions_linked_to_namespace
  • Billing::Usage::SubscriptionsAndTrialsFinder#for_namespaces_mapped

Currently, these methods use different logic to retrieve subscriptions, which creates a risk of inconsistency. We should ensure both code paths use the same subscription selection logic to:

  1. Avoid selecting different subscriptions in different parts of the codebase
  2. Improve maintainability and reduce confusion
  3. Potentially improve performance by consolidating the lookup logic

Related discussion: #15654 (comment 3038292971)

Edited Feb 25, 2026 by Tyler Amos
Assignee Loading
Time tracking Loading