72 lines
1.5 KiB
TypeScript
Raw Normal View History

// Subscription types from WHMCS
import type { SubscriptionStatus } from "../enums/status";
import type { WhmcsEntity } from "../common";
export type SubscriptionBillingCycle =
2025-08-22 17:02:49 +09:00
| "Monthly"
| "Quarterly"
| "Semi-Annually"
| "Annually"
| "Biennially"
| "Triennially"
| "One-time";
2025-08-22 17:02:49 +09:00
export interface Subscription extends WhmcsEntity {
serviceId: number;
productName: string;
domain?: string;
cycle: SubscriptionBillingCycle;
2025-08-22 17:02:49 +09:00
status: SubscriptionStatus;
2025-08-21 15:24:40 +09:00
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;
}
2025-08-22 17:02:49 +09:00
export type ConfigOptionType = "dropdown" | "radio" | "quantity";
export interface ConfigOption {
id: number;
name: string;
2025-08-22 17:02:49 +09:00
type: ConfigOptionType;
options: ConfigOptionValue[];
}
export interface ConfigOptionValue {
id: number;
name: string;
price?: number;
}