Files
tabungin/apps/api/dist/admin/admin-users.service.d.ts
dwindown 1c28e51b53 docs: update implementation plan and add backend completion summary
- Mark backend as complete in IMPLEMENTATION_PLAN.md
- Create ADMIN_BACKEND_COMPLETE.md with full documentation
- Document all API endpoints
- Add testing instructions
- Add deployment notes
2025-10-11 14:37:18 +07:00

174 lines
5.3 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;
}>;
}