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_namespaceBilling::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:
- Avoid selecting different subscriptions in different parts of the codebase
- Improve maintainability and reduce confusion
- Potentially improve performance by consolidating the lookup logic
Related discussion: #15654 (comment 3038292971)
Edited by Tyler Amos