66 lines
1.9 KiB
TypeScript
66 lines
1.9 KiB
TypeScript
/**
|
|
* Customer Domain - Contract
|
|
*
|
|
* Business types and provider-specific mapping types.
|
|
* Validated types are derived from schemas (see schema.ts).
|
|
*/
|
|
|
|
import type { IsoDateTimeString } from "../common/types";
|
|
import type { CustomerAddress } from "./schema";
|
|
|
|
// ============================================================================
|
|
// Customer Profile (Core Type)
|
|
// ============================================================================
|
|
|
|
/**
|
|
* CustomerProfile - Core profile data following WHMCS client structure
|
|
* Used as the base for authenticated users in the portal
|
|
*/
|
|
export interface CustomerProfile {
|
|
id: string;
|
|
email: string;
|
|
firstname?: string | null;
|
|
lastname?: string | null;
|
|
fullname?: string | null;
|
|
companyname?: string | null;
|
|
phonenumber?: string | null;
|
|
address?: CustomerAddress;
|
|
language?: string | null;
|
|
currencyCode?: string | null;
|
|
createdAt?: IsoDateTimeString | null;
|
|
updatedAt?: IsoDateTimeString | null;
|
|
}
|
|
|
|
// ============================================================================
|
|
// Salesforce Integration Types (Provider-Specific, Not Validated)
|
|
// ============================================================================
|
|
|
|
export interface SalesforceAccountFieldMap {
|
|
internetEligibility: string;
|
|
customerNumber: string;
|
|
}
|
|
|
|
export interface SalesforceAccountRecord {
|
|
Id: string;
|
|
Name?: string | null;
|
|
WH_Account__c?: string | null;
|
|
[key: string]: unknown;
|
|
}
|
|
|
|
// ============================================================================
|
|
// Re-export Types from Schema (Schema-First Approach)
|
|
// ============================================================================
|
|
|
|
export type {
|
|
CustomerAddress,
|
|
Address,
|
|
CustomerEmailPreferences,
|
|
CustomerUser,
|
|
CustomerStats,
|
|
Customer,
|
|
AddressFormData,
|
|
} from './schema';
|
|
|
|
// Re-export helper function
|
|
export { addressFormToRequest } from './schema';
|