Commit Graph

8 Commits

Author SHA1 Message Date
paulh 8fb9df01db Retrieve AcctDemo_NamedCreds into source; add to manifest
SecuredEndpoint credential pointing to account-d.docusign.com, backed by
the DocusignJWT external credential. Referenced by DTC_CLM_Demo account
setting for ESignature_Auth_Named_Credential__c.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 21:01:23 -04:00
paulh 0ce516bbfc Fix LWC async bug, null guard, stale sample script; update manifest
LWC fixes:
- clmDocGenWorkbench: resetSelectionsToDefaults was a sync onclick handler
  calling async initializeDefaults without await — isBusy not set and errors
  silently dropped; made the method async and added await
- clmRequestPreview: loadPreview called from refreshAll (account/letter change
  handlers) without a recordId guard; a null appraiserCaseId would propagate
  to the Apex AuraHandledException; added early return with a user-facing message

manifest/package.xml:
- Was missing CLM_Account_Setting__mdt and CLM_Letter_Definition__mdt objects
  and all 17 custom metadata records
- Missing DocusignESignatureService and its test class
- Missing docusignEsignWorkbench and clmRequestPreview LWC components
- Missing NamedCredential section entirely (CLMs1*, CLMuat*, Esignature_Demo)
- Missing CLM Account Setting and Letter Definition layouts

scripts/apex/createSampleAppraiserCase.apex:
- Rewrote entirely; old version referenced the deleted Appraiser_Deficiency__c
  object, Sort_Order__c, Deficiency_Number__c as a string, and the deleted
  AppraiserCaseDocGenService class
- Now uses Appraiser_Case_Deficiency__c with correct field types
- Populates all appraiser identity/address fields added since original version
- Debug output uses AppraiserCasePayloadBuilder and CLMDocGenCallout

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 20:50:57 -04:00
paulh 45814dc2d5 Add CLMAdminService, DocusignESignatureService, and fix code review issues
New classes:
- CLMAdminService: UI-facing orchestration — account/letter settings from
  metadata, document generation, task status polling, file attachment,
  folder browsing; persists all CLM results to Appraiser_Case__c
- DocusignESignatureService: eSignature API browsing (accounts, templates,
  envelopes, login info, user info)
- CLMAdminServiceTest, CLMDocGenCalloutTest, DocusignESignatureServiceTest

Updated classes (AppraiserCasePayloadBuilder, CLMDocGenCallout):
- CLMDocGenCallout: full XML merge callout stack, task status polling,
  document download, recursive document href discovery, account-based
  endpoint building; HTTP_TIMEOUT made public
- AppraiserCasePayloadBuilder: formatMailingAddress made public so
  CLMAdminService can reuse it rather than duplicating the logic

Code review bug fixes:
- Fix null fields emitting literal "null" in generated XML — add safeValue()
  helper; String.valueOf(null) returns "null" so escapeXml's null guard
  never fired
- Fix unguarded inline SOQL in getCaseContext and getDocGenPreview — throws
  QueryException for missing records instead of AuraHandledException; now
  uses list query with isEmpty guard
- Remove duplicate formatAddress in CLMAdminService; delegate to
  AppraiserCasePayloadBuilder.formatMailingAddress
- Replace hardcoded 30000 timeout in performGet with CLMDocGenCallout.HTTP_TIMEOUT
- Remove duplicate JSDoc on getTaskStatus

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 20:36:16 -04:00
paulh 62b78faf1a Add new Salesforce metadata for account-based CLM and eSignature integration
- Appraiser_Case__c: appraiser identity/address fields, FHA case number,
  CLM tracking fields (task ID/URL/status), generated document fields,
  attached file fields, Letter_Sent_Date__c
- Appraiser_Case_Deficiency__c: Reference__c field, blank-record validation rule
- CLM_Account_Setting__mdt and CLM_Letter_Definition__mdt: per-account CLM
  and eSignature configuration with seeded records for DTC_CLM_Demo,
  DTC_IAM_Enterprise, DTC_HUD_Demo
- CLM_Environment_Setting__mdt: UAT/S1 environment defaults
- Named credentials: CLMs1NamedCreds, CLMs1Download, Esignature_Demo_NamedCreds
- LWC: clmDocGenWorkbench, docusignEsignWorkbench, clmRequestPreview
- Layouts, record page, permission sets, quick action, app, tabs, manifest

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 20:35:59 -04:00
paulh 703fb0c0ba Remove legacy Appraiser_Deficiency__c object and AppraiserCaseDocGenService
Replaced by Appraiser_Case_Deficiency__c (master-detail, with Reference__c
field) and the XML-merge-based CLMDocGenCallout/CLMAdminService stack.
Also removes placeholder named credentials CLMNamedCred and CLMuatDownloadNamedCreds
superseded by the account-specific credential set.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 20:35:42 -04:00
paulh e058dedb82 Create Appraiser Case custom record and DocGen service 2026-04-05 14:31:51 -04:00
paulh 1e532029fa Add Appraiser Review Letter template and XML merge data 2026-04-05 14:22:57 -04:00
paulh 63b1bfd758 Initial commit: Salesforce Appraiser Review Letter with DocuSign CLM integration 2026-04-03 12:13:59 -04:00