49 lines
2.6 KiB
Markdown
49 lines
2.6 KiB
Markdown
# Design — Appraiser Review Letter Platform
|
|
|
|
This document now serves as a compact architecture summary. The broader current-state reference is [PRODUCT_SPEC.md](/home/paulh/.openclaw/workspace/projects/salesforce-appraiser-review-letter/docs/PRODUCT_SPEC.md).
|
|
|
|
## Current architecture
|
|
|
|
### Salesforce records
|
|
- `Appraiser_Case__c` is the parent business object
|
|
- `Appraiser_Case_Deficiency__c` is the canonical child object
|
|
|
|
### Configuration
|
|
- `CLM_Account_Setting__mdt` stores account-level CLM and eSignature configuration
|
|
|
|
### CLM path
|
|
- [AppraiserCasePayloadBuilder.cls](/home/paulh/.openclaw/workspace/projects/salesforce-appraiser-review-letter/force-app/main/default/classes/AppraiserCasePayloadBuilder.cls)
|
|
- [CLMDocGenCallout.cls](/home/paulh/.openclaw/workspace/projects/salesforce-appraiser-review-letter/force-app/main/default/classes/CLMDocGenCallout.cls)
|
|
- [CLMAdminService.cls](/home/paulh/.openclaw/workspace/projects/salesforce-appraiser-review-letter/force-app/main/default/classes/CLMAdminService.cls)
|
|
- [clmDocGenWorkbench](/home/paulh/.openclaw/workspace/projects/salesforce-appraiser-review-letter/force-app/main/default/lwc/clmDocGenWorkbench/clmDocGenWorkbench.js)
|
|
|
|
### eSignature path
|
|
- [DocusignESignatureService.cls](/home/paulh/.openclaw/workspace/projects/salesforce-appraiser-review-letter/force-app/main/default/classes/DocusignESignatureService.cls)
|
|
- [docusignEsignWorkbench](/home/paulh/.openclaw/workspace/projects/salesforce-appraiser-review-letter/force-app/main/default/lwc/docusignEsignWorkbench/docusignEsignWorkbench.js)
|
|
|
|
## CLM merge design
|
|
- Salesforce builds XML merge data from the case and related deficiencies.
|
|
- CLM document generation uses `documentxmlmergetasks`.
|
|
- Folder and template selection are account-configurable and browsable in the UI.
|
|
- Task results and generated-document references are persisted back to `Appraiser_Case__c`.
|
|
- Generated CLM output can be downloaded via Named Credential and attached to the case as a Salesforce File.
|
|
|
|
## eSignature design
|
|
- Separate Named Credentials are used for REST calls and account-server OAuth/userinfo calls.
|
|
- The service currently supports:
|
|
- login information
|
|
- OAuth user info
|
|
- discovered accounts
|
|
- template listing
|
|
- envelope listing
|
|
- The current eSignature panel is an operator/admin browsing surface, not yet a business workflow.
|
|
|
|
## Design principles
|
|
- prefer account-based config over environment-only config
|
|
- keep DocuSign callouts in Apex behind UI-facing service methods
|
|
- persist important CLM results onto the business record
|
|
- use record-page or action-based LWCs for operator flows instead of Execute Anonymous
|
|
|
|
---
|
|
Last updated: 2026-04-09
|