import { StripeBillingService } from '../../billing/stripe-billling-service';
import type { OrganizationOnboarding } from '../../../../prisma/client';
import type { BillingPeriod } from '../../../../prisma/enums';
import type { TrpcSessionUser } from '../../../../trpc/server/types';
import { OrganizationPermissionService } from "./OrganizationPermissionService";
type OrganizationOnboardingId = string;
type CreatePaymentIntentInput = {
    logo: string | null;
    bio: string | null;
    teams?: {
        id: number;
        isBeingMigrated: boolean;
        slug: string | null;
        name: string;
    }[];
    invitedMembers?: {
        email: string;
    }[];
};
type CreateOnboardingInput = {
    name: string;
    slug: string;
    orgOwnerEmail: string;
    billingPeriod?: BillingPeriod;
    seats?: number | null;
    pricePerSeat?: number | null;
    createdByUserId: number;
};
type PermissionCheckInput = {
    orgOwnerEmail: string;
    teams: {
        id: number;
        isBeingMigrated: boolean;
    }[];
    billingPeriod: BillingPeriod;
    seats: number;
    pricePerSeat: number;
    slug: string;
};
type OrganizationOnboardingForPaymentIntent = Pick<OrganizationOnboarding, "id" | "pricePerSeat" | "billingPeriod" | "seats" | "isComplete" | "orgOwnerEmail" | "slug" | "stripeCustomerId">;
type PaymentConfig = {
    billingPeriod: BillingPeriod;
    seats: number;
    pricePerSeat: number;
};
type StripePrice = {
    priceId: string;
    isCustom: boolean;
};
export declare class OrganizationPaymentService {
    protected billingService: StripeBillingService;
    protected permissionService: OrganizationPermissionService;
    protected user: NonNullable<TrpcSessionUser>;
    constructor(user: NonNullable<TrpcSessionUser>, permissionService?: OrganizationPermissionService);
    protected getOrCreateStripeCustomerId(email: string): Promise<string>;
    protected normalizePaymentConfig(input: {
        billingPeriod?: BillingPeriod;
        seats?: number | null;
        pricePerSeat?: number | null;
    }): PaymentConfig;
    protected getUniqueTeamMembersCount({ teamIds, invitedMembers, }: {
        teamIds: number[];
        invitedMembers?: {
            email: string;
        }[];
    }): Promise<number>;
    createOrganizationOnboarding(input: CreateOnboardingInput): Promise<{
        error: string | null;
        name: string;
        id: string;
        seats: number;
        teams: import('../../../../prisma-client').Prisma.JsonValue;
        logo: string | null;
        bio: string | null;
        slug: string;
        organizationId: number | null;
        stripeCustomerId: string | null;
        billingPeriod: import('../../../../prisma-client').$Enums.BillingPeriod;
        createdAt: Date;
        updatedAt: Date;
        isPlatform: boolean;
        createdById: number;
        orgOwnerEmail: string;
        pricePerSeat: number;
        isDomainConfigured: boolean;
        stripeSubscriptionId: string | null;
        stripeSubscriptionItemId: string | null;
        invitedMembers: import('../../../../prisma-client').Prisma.JsonValue;
        isComplete: boolean;
    }>;
    protected getOrCreatePrice(config: PaymentConfig, organizationOnboardingId: OrganizationOnboardingId, shouldCreateCustomPrice: boolean): Promise<StripePrice>;
    protected createSubscription(stripeCustomerId: string, priceId: string, config: PaymentConfig, organizationOnboardingId: OrganizationOnboardingId, params: URLSearchParams): Promise<{
        checkoutUrl: string | null;
        sessionId: string;
    }>;
    protected validatePermissions(input: PermissionCheckInput): Promise<boolean>;
    createPaymentIntent(input: CreatePaymentIntentInput, organizationOnboarding: OrganizationOnboardingForPaymentIntent): Promise<{
        organizationOnboarding: OrganizationOnboardingForPaymentIntent;
        subscription: null;
        checkoutUrl: null;
        sessionId: null;
    } | {
        organizationOnboarding: OrganizationOnboardingForPaymentIntent;
        subscription: {
            checkoutUrl: string | null;
            sessionId: string;
        };
        checkoutUrl: string | null;
        sessionId: string;
    }>;
}
export {};
//# sourceMappingURL=OrganizationPaymentService.d.ts.map