2025-10-08 10:33:33 +09:00
|
|
|
/**
|
|
|
|
|
* Customer Domain - Contract
|
2025-12-23 17:53:08 +09:00
|
|
|
*
|
2025-10-08 16:31:42 +09:00
|
|
|
* Constants and provider-specific types.
|
|
|
|
|
* Main domain types exported from schema.ts
|
2025-12-23 17:53:08 +09:00
|
|
|
*
|
2025-10-08 16:31:42 +09:00
|
|
|
* Pattern matches billing and subscriptions domains.
|
2025-10-08 10:33:33 +09:00
|
|
|
*/
|
2025-10-07 17:38:39 +09:00
|
|
|
|
2025-10-08 10:33:33 +09:00
|
|
|
// ============================================================================
|
2025-10-08 16:31:42 +09:00
|
|
|
// User Role Constants
|
2025-10-08 10:33:33 +09:00
|
|
|
// ============================================================================
|
2025-10-07 17:38:39 +09:00
|
|
|
|
2025-10-08 16:31:42 +09:00
|
|
|
export const USER_ROLE = {
|
|
|
|
|
USER: "USER",
|
|
|
|
|
ADMIN: "ADMIN",
|
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
|
|
export type UserRoleValue = (typeof USER_ROLE)[keyof typeof USER_ROLE];
|
2025-10-07 17:38:39 +09:00
|
|
|
|
2025-10-08 10:33:33 +09:00
|
|
|
// ============================================================================
|
|
|
|
|
// Salesforce Integration Types (Provider-Specific, Not Validated)
|
|
|
|
|
// ============================================================================
|
|
|
|
|
|
2025-10-08 16:31:42 +09:00
|
|
|
/**
|
|
|
|
|
* Salesforce account field mapping
|
|
|
|
|
* This is provider-specific and not validated at runtime
|
|
|
|
|
*/
|
2025-10-08 10:33:33 +09:00
|
|
|
export interface SalesforceAccountFieldMap {
|
|
|
|
|
internetEligibility: string;
|
|
|
|
|
customerNumber: string;
|
2025-10-07 17:38:39 +09:00
|
|
|
}
|
|
|
|
|
|
2025-10-08 16:31:42 +09:00
|
|
|
/**
|
2026-02-25 11:30:02 +09:00
|
|
|
* Raw Salesforce record — intentionally permissive.
|
|
|
|
|
* The Salesforce API returns org-specific fields that vary by configuration.
|
|
|
|
|
* Domain mappers validate specific fields; unknown fields are ignored.
|
2025-10-08 16:31:42 +09:00
|
|
|
*/
|
2025-10-08 10:33:33 +09:00
|
|
|
export interface SalesforceAccountRecord {
|
|
|
|
|
Id: string;
|
|
|
|
|
Name?: string | null;
|
|
|
|
|
WH_Account__c?: string | null;
|
|
|
|
|
[key: string]: unknown;
|
2025-10-07 17:38:39 +09:00
|
|
|
}
|
2025-10-08 10:33:33 +09:00
|
|
|
|
2026-01-06 16:52:02 +09:00
|
|
|
/**
|
2026-02-25 11:30:02 +09:00
|
|
|
* Raw Salesforce record — intentionally permissive.
|
|
|
|
|
* The Salesforce API returns org-specific fields that vary by configuration.
|
|
|
|
|
* Domain mappers validate specific fields; unknown fields are ignored.
|
2026-01-06 16:52:02 +09:00
|
|
|
*/
|
|
|
|
|
export interface SalesforceContactRecord {
|
|
|
|
|
Id: string;
|
|
|
|
|
AccountId?: string | null;
|
|
|
|
|
FirstName?: string | null;
|
|
|
|
|
LastName?: string | null;
|
|
|
|
|
Email?: string | null;
|
|
|
|
|
MobilePhone?: string | null;
|
|
|
|
|
Phone?: string | null;
|
|
|
|
|
Sex__c?: string | null;
|
|
|
|
|
Birthdate?: string | null; // YYYY-MM-DD format
|
|
|
|
|
[key: string]: unknown;
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-08 10:33:33 +09:00
|
|
|
// ============================================================================
|
|
|
|
|
// Re-export Types from Schema (Schema-First Approach)
|
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
|
|
export type {
|
2025-10-08 16:31:42 +09:00
|
|
|
User,
|
|
|
|
|
UserAuth,
|
|
|
|
|
UserRole,
|
2025-10-08 10:33:33 +09:00
|
|
|
Address,
|
|
|
|
|
AddressFormData,
|
2025-12-23 17:53:08 +09:00
|
|
|
ResidenceCardVerificationStatus,
|
|
|
|
|
ResidenceCardVerification,
|
|
|
|
|
} from "./schema.js";
|