- Install sonner package and create Toaster component - Add toast notifications to all admin dashboard operations: * AdminPlans: create, update, delete, reorder, toggle visibility * AdminPaymentMethods: create, update, delete, reorder, toggle active * AdminUsers: suspend, unsuspend, grant pro access * AdminPayments: verify, reject * AdminSettings: save settings - Add toast notifications to all member dashboard operations: * Wallets: create, update, delete * Transactions: create, update, delete * Profile: update name, avatar, phone, password, delete account * OTP: enable/disable email, WhatsApp, authenticator - Replace all alert() calls with toast.success/error/warning - Add proper success/error messages in Bahasa Indonesia - Implement smart plan deletion (permanent if no subscriptions, soft delete if has subscriptions) - Fix admin redirect after login (admin goes to /admin, users to /) - Exclude admin accounts from subscription distribution chart - Show inactive plans with visual indicators - Add real revenue data to admin dashboard charts - Use formatLargeNumber for consistent number formatting
226 lines
7.6 KiB
TypeScript
226 lines
7.6 KiB
TypeScript
import { AdminPaymentsService } from './admin-payments.service';
|
|
interface RequestWithUser {
|
|
user: {
|
|
userId: string;
|
|
};
|
|
}
|
|
export declare class AdminPaymentsController {
|
|
private readonly service;
|
|
constructor(service: AdminPaymentsService);
|
|
findAll(status?: string): Promise<({
|
|
user: {
|
|
id: string;
|
|
email: string;
|
|
name: string | null;
|
|
};
|
|
subscription: ({
|
|
plan: {
|
|
id: string;
|
|
currency: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
name: 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;
|
|
userId: string;
|
|
status: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
planId: string;
|
|
startDate: Date;
|
|
endDate: Date;
|
|
isTrialUsed: boolean;
|
|
trialEndDate: Date | null;
|
|
cancelledAt: Date | null;
|
|
cancellationReason: string | null;
|
|
}) | null;
|
|
} & {
|
|
id: string;
|
|
userId: string;
|
|
subscriptionId: string | null;
|
|
invoiceNumber: string;
|
|
amount: import("@prisma/client/runtime/library").Decimal;
|
|
currency: string;
|
|
method: string;
|
|
tripayReference: string | null;
|
|
tripayFee: import("@prisma/client/runtime/library").Decimal | null;
|
|
totalAmount: import("@prisma/client/runtime/library").Decimal;
|
|
paymentChannel: string | null;
|
|
paymentUrl: string | null;
|
|
qrUrl: string | null;
|
|
status: string;
|
|
proofImageUrl: string | null;
|
|
transferDate: Date | null;
|
|
verifiedBy: string | null;
|
|
verifiedAt: Date | null;
|
|
rejectionReason: string | null;
|
|
couponId: string | null;
|
|
discountAmount: import("@prisma/client/runtime/library").Decimal | null;
|
|
notes: string | null;
|
|
expiresAt: Date | null;
|
|
paidAt: Date | null;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
})[]>;
|
|
getPendingCount(): Promise<number>;
|
|
getMonthlyRevenue(): Promise<{
|
|
month: string;
|
|
revenue: number;
|
|
users: number;
|
|
}[]>;
|
|
findOne(id: string): Promise<({
|
|
user: {
|
|
id: string;
|
|
email: string;
|
|
name: string | null;
|
|
};
|
|
subscription: ({
|
|
plan: {
|
|
id: string;
|
|
currency: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
name: 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;
|
|
userId: string;
|
|
status: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
planId: string;
|
|
startDate: Date;
|
|
endDate: Date;
|
|
isTrialUsed: boolean;
|
|
trialEndDate: Date | null;
|
|
cancelledAt: Date | null;
|
|
cancellationReason: string | null;
|
|
}) | null;
|
|
} & {
|
|
id: string;
|
|
userId: string;
|
|
subscriptionId: string | null;
|
|
invoiceNumber: string;
|
|
amount: import("@prisma/client/runtime/library").Decimal;
|
|
currency: string;
|
|
method: string;
|
|
tripayReference: string | null;
|
|
tripayFee: import("@prisma/client/runtime/library").Decimal | null;
|
|
totalAmount: import("@prisma/client/runtime/library").Decimal;
|
|
paymentChannel: string | null;
|
|
paymentUrl: string | null;
|
|
qrUrl: string | null;
|
|
status: string;
|
|
proofImageUrl: string | null;
|
|
transferDate: Date | null;
|
|
verifiedBy: string | null;
|
|
verifiedAt: Date | null;
|
|
rejectionReason: string | null;
|
|
couponId: string | null;
|
|
discountAmount: import("@prisma/client/runtime/library").Decimal | null;
|
|
notes: string | null;
|
|
expiresAt: Date | null;
|
|
paidAt: Date | null;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
}) | null>;
|
|
verify(id: string, req: RequestWithUser): Promise<{
|
|
id: string;
|
|
userId: string;
|
|
subscriptionId: string | null;
|
|
invoiceNumber: string;
|
|
amount: import("@prisma/client/runtime/library").Decimal;
|
|
currency: string;
|
|
method: string;
|
|
tripayReference: string | null;
|
|
tripayFee: import("@prisma/client/runtime/library").Decimal | null;
|
|
totalAmount: import("@prisma/client/runtime/library").Decimal;
|
|
paymentChannel: string | null;
|
|
paymentUrl: string | null;
|
|
qrUrl: string | null;
|
|
status: string;
|
|
proofImageUrl: string | null;
|
|
transferDate: Date | null;
|
|
verifiedBy: string | null;
|
|
verifiedAt: Date | null;
|
|
rejectionReason: string | null;
|
|
couponId: string | null;
|
|
discountAmount: import("@prisma/client/runtime/library").Decimal | null;
|
|
notes: string | null;
|
|
expiresAt: Date | null;
|
|
paidAt: Date | null;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
}>;
|
|
reject(id: string, req: RequestWithUser, body: {
|
|
reason: string;
|
|
}): Promise<{
|
|
id: string;
|
|
userId: string;
|
|
subscriptionId: string | null;
|
|
invoiceNumber: string;
|
|
amount: import("@prisma/client/runtime/library").Decimal;
|
|
currency: string;
|
|
method: string;
|
|
tripayReference: string | null;
|
|
tripayFee: import("@prisma/client/runtime/library").Decimal | null;
|
|
totalAmount: import("@prisma/client/runtime/library").Decimal;
|
|
paymentChannel: string | null;
|
|
paymentUrl: string | null;
|
|
qrUrl: string | null;
|
|
status: string;
|
|
proofImageUrl: string | null;
|
|
transferDate: Date | null;
|
|
verifiedBy: string | null;
|
|
verifiedAt: Date | null;
|
|
rejectionReason: string | null;
|
|
couponId: string | null;
|
|
discountAmount: import("@prisma/client/runtime/library").Decimal | null;
|
|
notes: string | null;
|
|
expiresAt: Date | null;
|
|
paidAt: Date | null;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
}>;
|
|
}
|
|
export {};
|