2025-08-20 18:02:50 +09:00
|
|
|
// Subscription types from WHMCS
|
2025-08-23 18:02:05 +09:00
|
|
|
import type { SubscriptionStatus } from "./status";
|
2025-08-20 18:02:50 +09:00
|
|
|
|
2025-08-22 17:02:49 +09:00
|
|
|
export type BillingCycle =
|
|
|
|
|
| "Monthly"
|
|
|
|
|
| "Quarterly"
|
|
|
|
|
| "Semi-Annually"
|
|
|
|
|
| "Annually"
|
|
|
|
|
| "Biennially"
|
2025-09-06 13:57:18 +09:00
|
|
|
| "Triennially"
|
|
|
|
|
| "One-time";
|
2025-08-22 17:02:49 +09:00
|
|
|
|
2025-08-20 18:02:50 +09:00
|
|
|
export interface Subscription {
|
|
|
|
|
id: number;
|
|
|
|
|
serviceId: number;
|
|
|
|
|
productName: string;
|
|
|
|
|
domain?: string;
|
2025-08-22 17:02:49 +09:00
|
|
|
cycle: BillingCycle;
|
|
|
|
|
status: SubscriptionStatus;
|
2025-08-21 15:24:40 +09:00
|
|
|
nextDue?: string; // ISO
|
2025-08-20 18:02:50 +09:00
|
|
|
amount: number;
|
|
|
|
|
currency: string;
|
2025-08-30 15:10:24 +09:00
|
|
|
currencySymbol?: string; // e.g., '¥', '¥'
|
2025-08-20 18:02:50 +09:00
|
|
|
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";
|
|
|
|
|
|
2025-08-20 18:02:50 +09:00
|
|
|
export interface ConfigOption {
|
|
|
|
|
id: number;
|
|
|
|
|
name: string;
|
2025-08-22 17:02:49 +09:00
|
|
|
type: ConfigOptionType;
|
2025-08-20 18:02:50 +09:00
|
|
|
options: ConfigOptionValue[];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface ConfigOptionValue {
|
|
|
|
|
id: number;
|
|
|
|
|
name: string;
|
|
|
|
|
price?: number;
|
|
|
|
|
}
|