barsa fcd324df09 Refactor Salesforce utility and improve order handling in checkout process
- Imported salesforceIdSchema and nonEmptyStringSchema from the common domain for better consistency.
- Simplified the creation of SOQL field name validation schema.
- Refactored the InvoiceTable component to utilize useCallback for improved performance.
- Streamlined payment method handling in the PaymentMethodCard component by removing unused props.
- Enhanced the checkout process by integrating new validation schemas and improving cart handling logic.
- Updated various components to ensure better type safety and clarity in data handling.
2025-10-22 11:33:23 +09:00

84 lines
2.1 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;
}
/**
* 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,
// SIM products
SimCatalogProduct,
SimActivationFeeCatalogItem,
// VPN products
VpnCatalogProduct,
// Union type
CatalogProduct,
} from './schema';