style: fix rubocop module length

This commit is contained in:
Shivam Mishra
2026-01-14 11:33:53 +05:30
parent 2484a4f074
commit dc60b6b6fa
@@ -58,20 +58,10 @@ module Enterprise::Account::PlanUsageAndLimits
def get_captain_limits(type)
total_count = captain_monthly_limit[type.to_s].to_i
usage_key = type == :documents ? CAPTAIN_DOCUMENTS_USAGE : CAPTAIN_RESPONSES_USAGE
consumed = [custom_attributes[usage_key].to_i, 0].max
consumed = if type == :documents
custom_attributes[CAPTAIN_DOCUMENTS_USAGE].to_i || 0
else
custom_attributes[CAPTAIN_RESPONSES_USAGE].to_i || 0
end
consumed = 0 if consumed.negative?
{
total_count: total_count,
current_available: (total_count - consumed).clamp(0, total_count),
consumed: consumed
}
{ total_count: total_count, current_available: (total_count - consumed).clamp(0, total_count), consumed: consumed }
end
def default_captain_limits