- Introduced MeStatus module to aggregate customer status, integrating dashboard summary, payment methods, internet eligibility, and residence card verification. - Updated dashboard hooks to utilize MeStatus for improved data fetching and error handling. - Enhanced notification handling across various modules, including cancellation notifications for internet and SIM services, ensuring timely user alerts. - Refactored related schemas and services to support new dashboard tasks and notification types, improving overall user engagement and experience.
97 lines
2.4 KiB
TypeScript
97 lines
2.4 KiB
TypeScript
/**
|
|
* Catalog Domain - Contract
|
|
*
|
|
* Constants and types for the catalog domain.
|
|
* Most types are derived from schemas (see schema.ts).
|
|
*/
|
|
|
|
// ============================================================================
|
|
// Salesforce Field Mapping (Provider-Specific, Not Validated)
|
|
// ============================================================================
|
|
|
|
/**
|
|
* Salesforce Product2 field mapping
|
|
* This is provider-specific and not validated at runtime
|
|
*/
|
|
export interface SalesforceProductFieldMap {
|
|
sku: string;
|
|
portalCategory: string;
|
|
portalCatalog: string;
|
|
portalAccessible: string;
|
|
itemClass: string;
|
|
billingCycle: string;
|
|
whmcsProductId: string;
|
|
whmcsProductName: string;
|
|
internetPlanTier: string;
|
|
internetOfferingType: string;
|
|
displayOrder: string;
|
|
bundledAddon: string;
|
|
isBundledAddon: string;
|
|
simDataSize: string;
|
|
simPlanType: string;
|
|
simHasFamilyDiscount: string;
|
|
vpnRegion: string;
|
|
}
|
|
|
|
// ============================================================================
|
|
// Pricing and Filter Types
|
|
// ============================================================================
|
|
|
|
/**
|
|
* Pricing tier for display purposes
|
|
*/
|
|
export interface PricingTier {
|
|
name: string;
|
|
price: number;
|
|
billingCycle: "Monthly" | "Onetime" | "Annual";
|
|
description?: string;
|
|
features?: string[];
|
|
isRecommended?: boolean;
|
|
originalPrice?: number;
|
|
}
|
|
|
|
/**
|
|
* Standardized pricing display info
|
|
* Used for consistent price rendering across Frontend and BFF
|
|
*/
|
|
export interface CatalogPriceInfo {
|
|
display: string;
|
|
monthly: number | null;
|
|
oneTime: number | null;
|
|
currency: string;
|
|
}
|
|
|
|
/**
|
|
* Catalog filtering options
|
|
*/
|
|
export interface CatalogFilter {
|
|
category?: string;
|
|
priceMin?: number;
|
|
priceMax?: number;
|
|
search?: string;
|
|
}
|
|
|
|
// ============================================================================
|
|
// Re-export Types from Schema (Schema-First Approach)
|
|
// ============================================================================
|
|
|
|
export type {
|
|
CatalogProductBase,
|
|
CatalogPricebookEntry,
|
|
// Internet products
|
|
InternetCatalogProduct,
|
|
InternetPlanTemplate,
|
|
InternetPlanCatalogItem,
|
|
InternetInstallationCatalogItem,
|
|
InternetAddonCatalogItem,
|
|
InternetEligibilityStatus,
|
|
InternetEligibilityDetails,
|
|
// SIM products
|
|
SimCatalogProduct,
|
|
SimActivationFeeCatalogItem,
|
|
// VPN products
|
|
VpnCatalogProduct,
|
|
// Union type
|
|
CatalogProduct,
|
|
} from "./schema.js";
|