- Updated address retrieval in user service to replace billing info with a dedicated address method. - Adjusted API endpoints to use `PATCH /api/me/address` for address updates instead of billing updates. - Enhanced documentation to reflect changes in address management processes and API usage. - Removed deprecated types and services related to billing address handling, streamlining the codebase.
72 lines
1.5 KiB
TypeScript
72 lines
1.5 KiB
TypeScript
// Subscription types from WHMCS
|
|
import type { SubscriptionStatus } from "../enums/status";
|
|
import type { WhmcsEntity } from "../common";
|
|
|
|
export type SubscriptionBillingCycle =
|
|
| "Monthly"
|
|
| "Quarterly"
|
|
| "Semi-Annually"
|
|
| "Annually"
|
|
| "Biennially"
|
|
| "Triennially"
|
|
| "One-time";
|
|
|
|
|
|
export interface Subscription extends WhmcsEntity {
|
|
serviceId: number;
|
|
productName: string;
|
|
domain?: string;
|
|
cycle: SubscriptionBillingCycle;
|
|
status: SubscriptionStatus;
|
|
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 type ConfigOptionType = "dropdown" | "radio" | "quantity";
|
|
|
|
export interface ConfigOption {
|
|
id: number;
|
|
name: string;
|
|
type: ConfigOptionType;
|
|
options: ConfigOptionValue[];
|
|
}
|
|
|
|
export interface ConfigOptionValue {
|
|
id: number;
|
|
name: string;
|
|
price?: number;
|
|
}
|