orgSubscription function

  1. @riverpod
Future<Subscription?> orgSubscription(
  1. Ref<Object?> ref,
  2. String orgId
)

Current active subscription for an organization, or null if on trial.

Implementation

@riverpod
Future<Subscription?> orgSubscription(Ref ref, String orgId) async {
  final ds = ref.watch(billingDatasourceProvider);
  final model = await ds.getOrgSubscription(orgId);
  return model?.toEntity();
}