• erio's avatar
    refactor: extract helpers to reduce duplication and function length in gateway billing · b4a42a64
    erio authored
    - Extract resolveChannelPricing to DRY the resolver pattern shared by calculateImageCost/calculateTokenCost
    - Remove unnecessary IIFE wrapper and pass accountRateMultiplier as parameter
    - Extract resolveBillingMode, resolveMediaType, optionalSubscriptionID to simplify buildRecordUsageLog (104→65 lines)
    - Extract shouldDeductAPIKeyQuota/shouldUpdateRateLimits/shouldUpdateAccountQuota methods on postUsageBillingParams to unify duplicated billing conditions
    b4a42a64
gateway_service.go 300 KB