- Reorganized admin settings into tabbed interface (General, Security, Payment Methods) - Vertical tabs on desktop, horizontal scrollable on mobile - Moved Payment Methods from separate menu to Settings tab - Fixed admin profile reuse and dashboard blocking - Fixed maintenance mode guard to use AppConfig model - Added admin auto-redirect after login (admins → /admin, users → /) - Reorganized documentation into docs/ folder structure - Created comprehensive README and documentation index - Added PWA and Web Push notifications to to-do list
202 lines
5.9 KiB
TypeScript
202 lines
5.9 KiB
TypeScript
import { PrismaService } from '../prisma/prisma.service';
|
|
export declare class AdminUsersService {
|
|
private readonly prisma;
|
|
constructor(prisma: PrismaService);
|
|
findAll(search?: string): Promise<{
|
|
id: string;
|
|
email: string;
|
|
createdAt: Date;
|
|
emailVerified: boolean;
|
|
name: string | null;
|
|
role: string;
|
|
suspendedAt: Date | null;
|
|
lastLoginAt: Date | null;
|
|
_count: {
|
|
transactions: number;
|
|
wallets: number;
|
|
};
|
|
}[]>;
|
|
findOne(id: string): Promise<({
|
|
subscriptions: ({
|
|
plan: {
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
name: string;
|
|
currency: string;
|
|
slug: string;
|
|
description: string | null;
|
|
price: import("@prisma/client/runtime/library").Decimal;
|
|
durationType: string;
|
|
durationDays: number | null;
|
|
trialDays: number;
|
|
features: import("@prisma/client/runtime/library").JsonValue;
|
|
badge: string | null;
|
|
badgeColor: string | null;
|
|
highlightColor: string | null;
|
|
sortOrder: number;
|
|
isActive: boolean;
|
|
isVisible: boolean;
|
|
isFeatured: boolean;
|
|
maxWallets: number | null;
|
|
maxGoals: number | null;
|
|
maxTeamMembers: number | null;
|
|
apiEnabled: boolean;
|
|
apiRateLimit: number | null;
|
|
};
|
|
} & {
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
status: string;
|
|
userId: string;
|
|
planId: string;
|
|
startDate: Date;
|
|
endDate: Date;
|
|
isTrialUsed: boolean;
|
|
trialEndDate: Date | null;
|
|
cancelledAt: Date | null;
|
|
cancellationReason: string | null;
|
|
})[];
|
|
_count: {
|
|
transactions: number;
|
|
wallets: number;
|
|
payments: number;
|
|
};
|
|
} & {
|
|
id: string;
|
|
email: string;
|
|
phone: string | null;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
status: string;
|
|
emailVerified: boolean;
|
|
passwordHash: string | null;
|
|
name: string | null;
|
|
avatarUrl: string | null;
|
|
defaultCurrency: string | null;
|
|
timeZone: string | null;
|
|
otpEmailEnabled: boolean;
|
|
otpWhatsappEnabled: boolean;
|
|
otpTotpEnabled: boolean;
|
|
otpTotpSecret: string | null;
|
|
role: string;
|
|
suspendedAt: Date | null;
|
|
suspendedReason: string | null;
|
|
lastLoginAt: Date | null;
|
|
}) | null>;
|
|
updateRole(id: string, role: string): Promise<{
|
|
id: string;
|
|
email: string;
|
|
phone: string | null;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
status: string;
|
|
emailVerified: boolean;
|
|
passwordHash: string | null;
|
|
name: string | null;
|
|
avatarUrl: string | null;
|
|
defaultCurrency: string | null;
|
|
timeZone: string | null;
|
|
otpEmailEnabled: boolean;
|
|
otpWhatsappEnabled: boolean;
|
|
otpTotpEnabled: boolean;
|
|
otpTotpSecret: string | null;
|
|
role: string;
|
|
suspendedAt: Date | null;
|
|
suspendedReason: string | null;
|
|
lastLoginAt: Date | null;
|
|
}>;
|
|
suspend(id: string, reason: string): Promise<{
|
|
id: string;
|
|
email: string;
|
|
phone: string | null;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
status: string;
|
|
emailVerified: boolean;
|
|
passwordHash: string | null;
|
|
name: string | null;
|
|
avatarUrl: string | null;
|
|
defaultCurrency: string | null;
|
|
timeZone: string | null;
|
|
otpEmailEnabled: boolean;
|
|
otpWhatsappEnabled: boolean;
|
|
otpTotpEnabled: boolean;
|
|
otpTotpSecret: string | null;
|
|
role: string;
|
|
suspendedAt: Date | null;
|
|
suspendedReason: string | null;
|
|
lastLoginAt: Date | null;
|
|
}>;
|
|
unsuspend(id: string): Promise<{
|
|
id: string;
|
|
email: string;
|
|
phone: string | null;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
status: string;
|
|
emailVerified: boolean;
|
|
passwordHash: string | null;
|
|
name: string | null;
|
|
avatarUrl: string | null;
|
|
defaultCurrency: string | null;
|
|
timeZone: string | null;
|
|
otpEmailEnabled: boolean;
|
|
otpWhatsappEnabled: boolean;
|
|
otpTotpEnabled: boolean;
|
|
otpTotpSecret: string | null;
|
|
role: string;
|
|
suspendedAt: Date | null;
|
|
suspendedReason: string | null;
|
|
lastLoginAt: Date | null;
|
|
}>;
|
|
grantProAccess(userId: string, planSlug: string, durationDays: number): Promise<{
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
status: string;
|
|
userId: string;
|
|
planId: string;
|
|
startDate: Date;
|
|
endDate: Date;
|
|
isTrialUsed: boolean;
|
|
trialEndDate: Date | null;
|
|
cancelledAt: Date | null;
|
|
cancellationReason: string | null;
|
|
}>;
|
|
getStats(): Promise<{
|
|
totalUsers: number;
|
|
activeSubscriptions: number;
|
|
suspendedUsers: number;
|
|
}>;
|
|
create(data: {
|
|
email: string;
|
|
password: string;
|
|
name?: string;
|
|
role?: string;
|
|
}): Promise<{
|
|
id: string;
|
|
email: string;
|
|
createdAt: Date;
|
|
emailVerified: boolean;
|
|
name: string | null;
|
|
role: string;
|
|
}>;
|
|
update(id: string, data: {
|
|
email?: string;
|
|
name?: string;
|
|
role?: string;
|
|
}): Promise<{
|
|
id: string;
|
|
email: string;
|
|
createdAt: Date;
|
|
emailVerified: boolean;
|
|
name: string | null;
|
|
role: string;
|
|
}>;
|
|
delete(id: string): Promise<{
|
|
message: string;
|
|
}>;
|
|
}
|