90 lines
1.6 KiB
TypeScript
Raw Normal View History

// User and authentication types
export interface User {
id: string;
email: string;
firstName?: string;
lastName?: string;
company?: string;
phone?: string;
address?: UserAddress;
2025-08-21 15:24:40 +09:00
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;
2025-08-21 15:24:40 +09:00
type:
| "invoice_created"
| "invoice_paid"
| "service_activated"
| "case_created"
| "case_closed";
title: string;
description?: string;
2025-08-21 15:24:40 +09:00
date: string; // ISO
relatedId?: number; // ID of related invoice, subscription, etc.
metadata?: Record<string, unknown>;
}
export interface AuthTokens {
accessToken: string;
refreshToken?: string;
2025-08-21 15:24:40 +09:00
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;
2025-08-21 15:24:40 +09:00
whmcsToken?: string; // From OIDC or ValidateLogin
}
export interface SetPasswordRequest {
password: string;
confirmPassword: string;
}