/** * Account Service * * Manages accounts, account users, and seat limits * Multi-tenant seat system: $5 per seat */ export type AccountPlan = 'starter' | 'pro' | 'enterprise'; export interface SeatUsage { used: number; max: number; canAdd: boolean; } export declare const AccountService: { /** * Get account for a user */ getAccountForUser(userId: string): Promise<{ name: string; id: string; createdAt: Date; updatedAt: Date; stripeCustomerId: string | null; slug: string; plan: string; maxSeats: number; } | null>; /** * Get account user record for a user */ getAccountUser(userId: string, accountId?: string): Promise<({ user: { name: string | null; id: string; email: string; hashedPassword: string | null; emailVerified: Date | null; subscription: string; defaultJiraProjectKey: string | null; defaultAiModel: string | null; createdAt: Date; updatedAt: Date; hostingTarget: string | null; phoneNumber: string | null; timeZone: string | null; locale: string | null; isNewUser: boolean; onboardingStep: number; communicationPreferences: import("@prisma/client/runtime/client").JsonValue | null; jiraPreferences: import("@prisma/client/runtime/client").JsonValue | null; }; account: { name: string; id: string; createdAt: Date; updatedAt: Date; stripeCustomerId: string | null; slug: string; plan: string; maxSeats: number; }; } & { id: string; createdAt: Date; updatedAt: Date; userId: string; accountId: string; role: string; active: boolean; }) | null>; /** * List all users in an account */ listUsers(accountId: string): Promise<({ user: { name: string | null; id: string; email: string; createdAt: Date; }; } & { id: string; createdAt: Date; updatedAt: Date; userId: string; accountId: string; role: string; active: boolean; })[]>; /** * Check if account can add another seat */ canAddSeat(accountId: string): Promise; /** * Get seat usage for an account */ getSeatUsage(accountId: string): Promise; /** * Add user to account (enforces seat limits) */ addUserToAccount(accountId: string, userId: string, role?: "OWNER" | "ADMIN" | "MEMBER"): Promise<{ id: string; createdAt: Date; updatedAt: Date; userId: string; accountId: string; role: string; active: boolean; }>; /** * Remove user from account (deactivate) */ removeUserFromAccount(accountId: string, userId: string): Promise<{ id: string; createdAt: Date; updatedAt: Date; userId: string; accountId: string; role: string; active: boolean; }>; /** * Update account plan and recalculate maxSeats */ updateAccountPlan(accountId: string, plan: AccountPlan): Promise<{ name: string; id: string; createdAt: Date; updatedAt: Date; stripeCustomerId: string | null; slug: string; plan: string; maxSeats: number; }>; /** * Create a new account */ createAccount(name: string, slug: string, plan: AccountPlan | undefined, ownerUserId: string): Promise<{ users: ({ user: { name: string | null; id: string; email: string; hashedPassword: string | null; emailVerified: Date | null; subscription: string; defaultJiraProjectKey: string | null; defaultAiModel: string | null; createdAt: Date; updatedAt: Date; hostingTarget: string | null; phoneNumber: string | null; timeZone: string | null; locale: string | null; isNewUser: boolean; onboardingStep: number; communicationPreferences: import("@prisma/client/runtime/client").JsonValue | null; jiraPreferences: import("@prisma/client/runtime/client").JsonValue | null; }; } & { id: string; createdAt: Date; updatedAt: Date; userId: string; accountId: string; role: string; active: boolean; })[]; } & { name: string; id: string; createdAt: Date; updatedAt: Date; stripeCustomerId: string | null; slug: string; plan: string; maxSeats: number; }>; /** * Get account by ID */ getAccountById(accountId: string): Promise<({ users: ({ user: { name: string | null; id: string; email: string; }; } & { id: string; createdAt: Date; updatedAt: Date; userId: string; accountId: string; role: string; active: boolean; })[]; } & { name: string; id: string; createdAt: Date; updatedAt: Date; stripeCustomerId: string | null; slug: string; plan: string; maxSeats: number; }) | null>; /** * Update account maxSeats (for seat purchases) */ updateAccountSeats(accountId: string, newMaxSeats: number): Promise<{ name: string; id: string; createdAt: Date; updatedAt: Date; stripeCustomerId: string | null; slug: string; plan: string; maxSeats: number; }>; }; //# sourceMappingURL=account.service.d.ts.map