T. Narantuya 0c912fc04f clean up
2025-08-22 17:02:49 +09:00

85 lines
1.6 KiB
TypeScript

// User and authentication types
export interface User {
id: string;
email: string;
firstName?: string;
lastName?: string;
company?: string;
phone?: string;
address?: UserAddress;
createdAt: string; // ISO
updatedAt: string; // ISO
mfaEnabled: boolean;
emailVerified: boolean;
}
export interface UserAddress {
line1: string;
line2?: string;
city: string;
state: string;
postalCode: string;
country: string;
}
export interface UserSummary {
user: User;
stats: {
activeSubscriptions: number;
unpaidInvoices: number;
openCases: number;
totalSpent: number;
currency: string;
};
nextInvoice?: {
id: number;
dueDate: string;
amount: number;
currency: string;
};
recentActivity: Activity[];
}
export interface Activity {
id: string;
type: "invoice_created" | "invoice_paid" | "service_activated" | "case_created" | "case_closed";
title: string;
description?: string;
date: string; // ISO
relatedId?: number; // ID of related invoice, subscription, etc.
metadata?: Record<string, unknown>;
}
export interface AuthTokens {
accessToken: string;
refreshToken?: string;
expiresAt: string; // ISO
}
export interface LoginRequest {
email: string;
password: string;
mfaCode?: string;
}
export interface SignupRequest {
email: string;
password: string;
firstName: string;
lastName: string;
company?: string;
phone?: string;
address?: UserAddress;
}
export interface LinkWhmcsRequest {
email: string;
whmcsToken?: string; // From OIDC or ValidateLogin
}
export interface SetPasswordRequest {
password: string;
confirmPassword: string;
}