import { type TenantConfig } from "../schema";
export declare function createDefaultConfig(tenantId: string): Promise<TenantConfig>;
export declare function getConfig(tenantId: string): Promise<TenantConfig | null>;
export declare function updateConfig(tenantId: string, patch: Partial<Pick<TenantConfig, "widgetConfig" | "monthlyTokenBudget" | "maxToolCallsPerTurn">>): Promise<TenantConfig | null>;
/**
 * Activates or renews the tenant's subscription for one calendar month starting `now`.
 * Used identically for the first subscribe and every later renewal (including lapsed
 * ones): it unconditionally overwrites both period fields, so a late renewal re-anchors
 * the schedule on the actual renewal moment rather than the original cadence.
 */
export declare function renewSubscription(tenantId: string, now?: Date): Promise<TenantConfig | null>;
/**
 * Super-admin "grant more tokens" action: adds to the existing monthlyTokenBudget
 * rather than replacing it, so repeated top-ups accumulate. Done as a single atomic
 * `SET x = x + amount` rather than a read-then-write to avoid a lost update if two
 * top-ups land concurrently.
 */
export declare function addTokenBudget(tenantId: string, amount: number): Promise<TenantConfig | null>;
/**
 * Super-admin "extend subscription" action: pushes subscriptionPeriodEnd forward by
 * `days` without touching subscriptionPeriodStart, unlike renewSubscription which
 * resets both. Extends from the later of "now" and the current end date, so it
 * always adds net new time whether the subscription is still active or already
 * lapsed (extending a lapsed period from its old end date would still leave it
 * lapsed).
 */
export declare function extendSubscription(tenantId: string, days: number, now?: Date): Promise<TenantConfig | null>;
