- Add Plan, Subscription, Payment, PaymentMethod, Coupon models - Add ApiKey, Webhook models for API access - Add AppConfig model for dynamic configuration - Add role, suspendedAt fields to User model - Create comprehensive seeder with: - Admin user (dwindi.ramadhana@gmail.com) - Default plans (Free, Pro Monthly, Pro Yearly) - Payment methods (BCA, Mandiri, GoPay) - App config (maintenance mode) - Zero data loss migration strategy
59 lines
1.5 KiB
TypeScript
59 lines
1.5 KiB
TypeScript
import { UsersService } from './users.service';
|
|
interface RequestWithUser extends Request {
|
|
user: {
|
|
userId: string;
|
|
email: string;
|
|
};
|
|
}
|
|
export declare class UsersController {
|
|
private readonly users;
|
|
constructor(users: UsersService);
|
|
me(): 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;
|
|
} | null>;
|
|
updateProfile(req: RequestWithUser, body: {
|
|
name?: string;
|
|
phone?: string;
|
|
}): Promise<{
|
|
success: boolean;
|
|
message: string;
|
|
user: {
|
|
id: string;
|
|
email: string;
|
|
phone: string | null;
|
|
name: string | null;
|
|
avatarUrl: string | null;
|
|
};
|
|
}>;
|
|
getAuthInfo(req: RequestWithUser): Promise<{
|
|
hasGoogleAuth: boolean;
|
|
hasPassword: boolean;
|
|
}>;
|
|
deleteAccount(req: RequestWithUser, body: {
|
|
password: string;
|
|
}): Promise<{
|
|
success: boolean;
|
|
message: string;
|
|
}>;
|
|
}
|
|
export {};
|