- Introduced a new Notification model in the Prisma schema to manage in-app notifications for users. - Integrated the NotificationsModule into the BFF application, allowing for the handling of notifications related to user actions and events. - Updated the CatalogCdcSubscriber to create notifications for account eligibility and verification status changes, improving user engagement. - Enhanced the CheckoutRegistrationService to create opportunities for SIM orders, integrating with the new notifications system. - Refactored various modules to include the NotificationsModule, ensuring seamless interaction and notification handling across the application. - Updated the frontend to display notification alerts in the AppShell header, enhancing user experience and accessibility.
166 lines
4.5 KiB
TypeScript
166 lines
4.5 KiB
TypeScript
/**
|
|
* Salesforce Field Maps
|
|
*
|
|
* Centralized mapping of logical field names to Salesforce API field names.
|
|
* This provides a single source of truth for all Salesforce custom fields
|
|
* used by the Customer Portal.
|
|
*
|
|
* Usage:
|
|
* ```typescript
|
|
* import { ACCOUNT_FIELDS } from "@customer-portal/domain/salesforce";
|
|
*
|
|
* const eligibilityValue = account[ACCOUNT_FIELDS.eligibility.value];
|
|
* ```
|
|
*/
|
|
|
|
// =============================================================================
|
|
// Account Fields
|
|
// =============================================================================
|
|
|
|
export const ACCOUNT_FIELDS = {
|
|
// Standard fields
|
|
id: "Id",
|
|
name: "Name",
|
|
personEmail: "PersonEmail",
|
|
phone: "Phone",
|
|
|
|
// Portal identification
|
|
customerNumber: "SF_Account_No__c",
|
|
portalStatus: "Portal_Status__c",
|
|
registrationSource: "Portal_Registration_Source__c",
|
|
lastSignIn: "Portal_Last_SignIn__c",
|
|
|
|
// WHMCS integration
|
|
whmcsAccountId: "WH_Account__c",
|
|
|
|
// Internet eligibility
|
|
eligibility: {
|
|
value: "Internet_Eligibility__c",
|
|
status: "Internet_Eligibility_Status__c",
|
|
requestedAt: "Internet_Eligibility_Request_Date_Time__c",
|
|
checkedAt: "Internet_Eligibility_Checked_Date_Time__c",
|
|
notes: "Internet_Eligibility_Notes__c",
|
|
caseId: "Internet_Eligibility_Case_Id__c",
|
|
},
|
|
|
|
// ID verification
|
|
verification: {
|
|
status: "Id_Verification_Status__c",
|
|
submittedAt: "Id_Verification_Submitted_Date_Time__c",
|
|
verifiedAt: "Id_Verification_Verified_Date_Time__c",
|
|
note: "Id_Verification_Note__c",
|
|
rejectionMessage: "Id_Verification_Rejection_Message__c",
|
|
},
|
|
|
|
// Address fields
|
|
address: {
|
|
street: "BillingStreet",
|
|
city: "BillingCity",
|
|
state: "BillingState",
|
|
postalCode: "BillingPostalCode",
|
|
country: "BillingCountry",
|
|
},
|
|
} as const;
|
|
|
|
export type AccountFieldKey = keyof typeof ACCOUNT_FIELDS;
|
|
|
|
// =============================================================================
|
|
// Opportunity Fields
|
|
// =============================================================================
|
|
|
|
export const OPPORTUNITY_FIELDS = {
|
|
// Standard fields
|
|
id: "Id",
|
|
name: "Name",
|
|
accountId: "AccountId",
|
|
stage: "StageName",
|
|
closeDate: "CloseDate",
|
|
probability: "Probability",
|
|
|
|
// Product classification
|
|
commodityType: "CommodityType",
|
|
applicationStage: "Application_Stage__c",
|
|
|
|
// Portal integration
|
|
portalSource: "Portal_Source__c",
|
|
whmcsServiceId: "WHMCS_Service_ID__c",
|
|
|
|
// Cancellation
|
|
cancellationNotice: "CancellationNotice__c",
|
|
scheduledCancellationDate: "ScheduledCancellationDateAndTime__c",
|
|
lineReturn: "LineReturn__c",
|
|
} as const;
|
|
|
|
export type OpportunityFieldKey = keyof typeof OPPORTUNITY_FIELDS;
|
|
|
|
// =============================================================================
|
|
// Order Fields
|
|
// =============================================================================
|
|
|
|
export const ORDER_FIELDS = {
|
|
// Standard fields
|
|
id: "Id",
|
|
orderNumber: "OrderNumber",
|
|
accountId: "AccountId",
|
|
opportunityId: "OpportunityId",
|
|
status: "Status",
|
|
effectiveDate: "EffectiveDate",
|
|
totalAmount: "TotalAmount",
|
|
|
|
// Activation tracking
|
|
activationStatus: "Activation_Status__c",
|
|
activationErrorCode: "Activation_Error_Code__c",
|
|
activationErrorMessage: "Activation_Error_Message__c",
|
|
activationLastAttemptAt: "Activation_Last_Attempt_At__c",
|
|
|
|
// WHMCS integration
|
|
whmcsOrderId: "WHMCS_Order_ID__c",
|
|
|
|
// Address fields
|
|
billing: {
|
|
street: "BillingStreet",
|
|
city: "BillingCity",
|
|
state: "BillingState",
|
|
postalCode: "BillingPostalCode",
|
|
country: "BillingCountry",
|
|
},
|
|
} as const;
|
|
|
|
export type OrderFieldKey = keyof typeof ORDER_FIELDS;
|
|
|
|
// =============================================================================
|
|
// Case Fields
|
|
// =============================================================================
|
|
|
|
export const CASE_FIELDS = {
|
|
// Standard fields
|
|
id: "Id",
|
|
caseNumber: "CaseNumber",
|
|
accountId: "AccountId",
|
|
contactId: "ContactId",
|
|
opportunityId: "OpportunityId",
|
|
subject: "Subject",
|
|
description: "Description",
|
|
status: "Status",
|
|
priority: "Priority",
|
|
origin: "Origin",
|
|
type: "Type",
|
|
|
|
// Portal fields
|
|
createdAt: "CreatedDate",
|
|
closedAt: "ClosedDate",
|
|
} as const;
|
|
|
|
export type CaseFieldKey = keyof typeof CASE_FIELDS;
|
|
|
|
// =============================================================================
|
|
// Combined Export
|
|
// =============================================================================
|
|
|
|
export const SALESFORCE_FIELDS = {
|
|
account: ACCOUNT_FIELDS,
|
|
opportunity: OPPORTUNITY_FIELDS,
|
|
order: ORDER_FIELDS,
|
|
case: CASE_FIELDS,
|
|
} as const;
|