From f9a323d136b9270e2f1f601532e45f5744bbee59 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Fri, 17 Jan 2025 16:45:57 +0530 Subject: [PATCH] feat: reset captain usage on stripe webhook --- .../enterprise/billing/handle_stripe_event_service.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/enterprise/app/services/enterprise/billing/handle_stripe_event_service.rb b/enterprise/app/services/enterprise/billing/handle_stripe_event_service.rb index 1ddf00d7a..c3c570596 100644 --- a/enterprise/app/services/enterprise/billing/handle_stripe_event_service.rb +++ b/enterprise/app/services/enterprise/billing/handle_stripe_event_service.rb @@ -22,6 +22,7 @@ class Enterprise::Billing::HandleStripeEventService update_account_attributes(subscription, plan) change_plan_features + reset_captain_usage end def update_account_attributes(subscription, plan) @@ -56,6 +57,10 @@ class Enterprise::Billing::HandleStripeEventService account.save! end + def reset_captain_usage + account.reset_response_usage + end + def ensure_event_context(event) @event = event end