import type { TFunction } from "i18next";
import { type PrismaTransaction } from '../../../prisma';
import { CreditType } from '../../../prisma/enums';
type LowCreditBalanceResultBase = {
    team?: {
        id: number;
        name: string;
        adminAndOwners: {
            id: number;
            name: string | null;
            email: string;
            t: TFunction;
        }[];
    };
    user?: {
        id: number;
        name: string | null;
        email: string;
        t: TFunction;
    };
};
type LowCreditBalanceLimitReachedResult = LowCreditBalanceResultBase & {
    type: "LIMIT_REACHED";
    teamId?: number | null;
    userId?: number | null;
};
type LowCreditBalanceWarningResult = LowCreditBalanceResultBase & {
    type: "WARNING";
    balance: number;
};
type LowCreditBalanceResult = LowCreditBalanceLimitReachedResult | LowCreditBalanceWarningResult | null;
export declare class CreditService {
    chargeCredits({ userId, teamId, credits, bookingUid, smsSid, smsSegments, }: {
        userId?: number;
        teamId?: number;
        credits: number | null;
        bookingUid?: string;
        smsSid?: string;
        smsSegments?: number;
    }): Promise<{
        teamId: number | undefined;
        userId: number | undefined;
    }>;
    hasAvailableCredits({ userId, teamId }: {
        userId?: number | null;
        teamId?: number | null;
    }): Promise<boolean>;
    getTeamWithAvailableCredits(userId: number): Promise<{
        teamId: number;
        availableCredits: number;
        creditType: "MONTHLY" | "ADDITIONAL";
        limitReached?: undefined;
    } | {
        teamId: number;
        availableCredits: number;
        creditType: "ADDITIONAL";
        limitReached: boolean;
    } | null>;
    protected _getTeamWithAvailableCredits({ userId, tx }: {
        userId: number;
        tx: PrismaTransaction;
    }): Promise<{
        teamId: number;
        availableCredits: number;
        creditType: "MONTHLY" | "ADDITIONAL";
        limitReached?: undefined;
    } | {
        teamId: number;
        availableCredits: number;
        creditType: "ADDITIONAL";
        limitReached: boolean;
    } | null>;
    getUserOrTeamToCharge({ credits, userId, teamId, }: {
        credits: number;
        userId?: number | null;
        teamId?: number | null;
    }): Promise<{
        teamId: number;
        remainingCredits: number;
        creditType: "MONTHLY" | "ADDITIONAL";
        userId?: undefined;
    } | {
        remainingCredits: number;
        teamId: number;
        availableCredits: number;
        creditType: "MONTHLY" | "ADDITIONAL";
        limitReached?: undefined;
        userId?: undefined;
    } | {
        remainingCredits: number;
        teamId: number;
        availableCredits: number;
        creditType: "ADDITIONAL";
        limitReached: boolean;
        userId?: undefined;
    } | {
        userId: number;
        remainingCredits: number;
        creditType: "ADDITIONAL";
        teamId?: undefined;
    } | null>;
    protected _getUserOrTeamToCharge({ credits, userId, teamId, tx, }: {
        credits: number;
        userId?: number | null;
        teamId?: number | null;
        tx: PrismaTransaction;
    }): Promise<{
        teamId: number;
        remainingCredits: number;
        creditType: "MONTHLY" | "ADDITIONAL";
        userId?: undefined;
    } | {
        remainingCredits: number;
        teamId: number;
        availableCredits: number;
        creditType: "MONTHLY" | "ADDITIONAL";
        limitReached?: undefined;
        userId?: undefined;
    } | {
        remainingCredits: number;
        teamId: number;
        availableCredits: number;
        creditType: "ADDITIONAL";
        limitReached: boolean;
        userId?: undefined;
    } | {
        userId: number;
        remainingCredits: number;
        creditType: "ADDITIONAL";
        teamId?: undefined;
    } | null>;
    protected _createExpenseLog(props: {
        bookingUid?: string;
        smsSid?: string;
        teamId?: number;
        userId?: number;
        credits: number | null;
        creditType: CreditType;
        smsSegments?: number;
        tx: PrismaTransaction;
    }): Promise<void>;
    protected _handleLowCreditBalance({ teamId, userId, remainingCredits, tx, }: {
        teamId?: number | null;
        userId?: number | null;
        remainingCredits: number;
        tx: PrismaTransaction;
    }): Promise<LowCreditBalanceResult>;
    private _handleLowCreditBalanceResult;
    handleLowCreditBalance({ teamId, userId, remainingCredits, }: {
        teamId?: number | null;
        userId?: number | null;
        remainingCredits: number;
    }): Promise<void>;
    getMonthlyCredits(teamId: number): Promise<number>;
    calculateCreditsFromPrice(price: number): number | null;
    getAllCredits({ userId, teamId }: {
        userId?: number | null;
        teamId?: number | null;
    }): Promise<{
        totalMonthlyCredits: number;
        totalRemainingMonthlyCredits: number;
        additionalCredits: number;
    }>;
    protected _getAllCredits({ userId, teamId, tx, }: {
        userId?: number | null;
        teamId?: number | null;
        tx: PrismaTransaction;
    }): Promise<{
        totalMonthlyCredits: number;
        totalRemainingMonthlyCredits: number;
        additionalCredits: number;
    }>;
    getAllCreditsForTeam(teamId: number): Promise<{
        totalMonthlyCredits: number;
        totalRemainingMonthlyCredits: number;
        additionalCredits: number;
    }>;
    protected _getAllCreditsForTeam({ teamId, tx }: {
        teamId: number;
        tx: PrismaTransaction;
    }): Promise<{
        totalMonthlyCredits: number;
        totalRemainingMonthlyCredits: number;
        additionalCredits: number;
    }>;
}
export {};
//# sourceMappingURL=credit-service.d.ts.map