createExtendTrialGrant method
Create an extend_trial grant: adds days days to the target's trial window.
Implementation
Future<AdminGrantModel> createExtendTrialGrant({
String? targetUserId,
String? targetOrgId,
required int days,
String? reason,
}) async {
assert((targetUserId == null) ^ (targetOrgId == null));
final response = await _client
.from('admin_grants')
.insert({
'target_user_id': ?targetUserId,
'target_org_id': ?targetOrgId,
'grant_type': 'extend_trial',
'trial_extension_days': days,
'reason': ?reason,
'granted_by': _client.auth.currentUser?.id,
})
.select()
.single();
return AdminGrantModel.fromJson(response);
}