discourse/plugins/discourse-ai/app/serializers/llm_credit_allocation_serializer.rb
Keegan George 6d9a176bfd
DEV: Apply credit system on daily schedule instead of monthly (#36066)
## 🔍 Overview

This update alters our LLM credit system to apply credits and resets on
a daily schedule rather than monthly.
2025-11-18 09:38:28 -08:00

22 lines
527 B
Ruby
Vendored

# frozen_string_literal: true
class LlmCreditAllocationSerializer < ApplicationSerializer
attributes :id,
:daily_credits,
:daily_used,
:credits_remaining,
:percentage_used,
:percentage_remaining,
:next_reset_at,
:soft_limit_percentage,
:soft_limit_reached,
:hard_limit_reached
def soft_limit_reached
object.soft_limit_reached?
end
def hard_limit_reached
object.hard_limit_reached?
end
end