59 lines
1.3 KiB
TypeScript
59 lines
1.3 KiB
TypeScript
|
|
// Subscription types from WHMCS
|
||
|
|
|
||
|
|
export interface Subscription {
|
||
|
|
id: number;
|
||
|
|
serviceId: number;
|
||
|
|
productName: string;
|
||
|
|
domain?: string;
|
||
|
|
cycle: 'Monthly' | 'Quarterly' | 'Semi-Annually' | 'Annually' | 'Biennially' | 'Triennially' | string;
|
||
|
|
status: 'Active' | 'Suspended' | 'Terminated' | 'Cancelled' | 'Pending' | 'Completed' | string;
|
||
|
|
nextDue?: string; // ISO
|
||
|
|
amount: number;
|
||
|
|
currency: string;
|
||
|
|
currencySymbol?: string; // e.g., '¥', '$'
|
||
|
|
registrationDate: string; // ISO
|
||
|
|
notes?: string;
|
||
|
|
customFields?: Record<string, string>;
|
||
|
|
// Additional WHMCS fields
|
||
|
|
orderNumber?: string;
|
||
|
|
groupName?: string;
|
||
|
|
paymentMethod?: string;
|
||
|
|
serverName?: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface SubscriptionList {
|
||
|
|
subscriptions: Subscription[];
|
||
|
|
totalCount: number;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface Product {
|
||
|
|
id: number;
|
||
|
|
name: string;
|
||
|
|
description?: string;
|
||
|
|
group: string;
|
||
|
|
pricing: ProductPricing[];
|
||
|
|
features?: string[];
|
||
|
|
configOptions?: ConfigOption[];
|
||
|
|
available: boolean;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface ProductPricing {
|
||
|
|
cycle: string;
|
||
|
|
price: number;
|
||
|
|
currency: string;
|
||
|
|
setup?: number;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface ConfigOption {
|
||
|
|
id: number;
|
||
|
|
name: string;
|
||
|
|
type: 'dropdown' | 'radio' | 'quantity' | string;
|
||
|
|
options: ConfigOptionValue[];
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface ConfigOptionValue {
|
||
|
|
id: number;
|
||
|
|
name: string;
|
||
|
|
price?: number;
|
||
|
|
}
|