-
Notifications
You must be signed in to change notification settings - Fork 76
feat: Implement Salesforce to DocuSign contract automation integration #58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
iamvirul
wants to merge
51
commits into
wso2:main
Choose a base branch
from
iamvirul:integration-sample-for-docusign-salesforce
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,032
−0
Open
Changes from all commits
Commits
Show all changes
51 commits
Select commit
Hold shift + click to select a range
8bc0d02
feat: Implement Salesforce to DocuSign contract automation integration
iamvirul 53aa319
feat: Enhance DocuSign envelope processing with expiration and idempo…
iamvirul 2eab895
feat: Improve contact retrieval logic by adding role-based fallback a…
iamvirul 1423e94
feat: Update DocuSign authentication to use OAuth2 with client ID, cl…
iamvirul 079d38f
feat: Enhance DocuSign envelope creation with reminders and improved …
iamvirul df0cdf7
feat: Enhance email masking for logging to protect PII in contact val…
iamvirul 84be556
feat: Add Id, OpportunityId, and IsPrimary fields to Salesforce SOQL …
iamvirul 470c7b9
feat: Enhance error handling for opportunity field retrieval and temp…
iamvirul 1fe50d7
fix: Update Salesforce listener service path to /data/ChangeEvents.
iamvirul 2edb11a
refactor: remove `salesforceChannelName` configurable and update READ…
iamvirul 7009d5e
feat: Add Salesforce ID validation function and integrate it into key…
iamvirul b857b8b
fix: Extract opportunity ID from Salesforce ChangeEvent metadata inst…
iamvirul f70b865
Update ballerina-integrator/salesforce-closewon-contract-automation/R…
iamvirul 12d3804
Update ballerina-integrator/salesforce-closewon-contract-automation/f…
iamvirul 902c95d
Update ballerina-integrator/salesforce-closewon-contract-automation/R…
iamvirul aff6984
Update ballerina-integrator/salesforce-closewon-contract-automation/.…
iamvirul 0ee8030
Update ballerina-integrator/salesforce-closewon-contract-automation/.…
iamvirul e47ecb3
Update ballerina-integrator/salesforce-closewon-contract-automation/.…
iamvirul 7d8cfcf
Update ballerina-integrator/salesforce-closewon-contract-automation/B…
iamvirul c1cecd1
docs: Condense the integration's functionality description in README …
iamvirul 22753cf
docs: remove "Running Locally" section from README
iamvirul ea769ee
docs: Refine the description of Salesforce opportunity event processi…
iamvirul 635bfb2
docs: Simplify Salesforce setup instructions by removing detailed set…
iamvirul 33df693
chore: remove Dependencies.toml file
iamvirul 199bff4
fix: Standardize 'DocuSign' capitalization to 'Docusign' across docum…
iamvirul 469fcfb
docs: Update WSO2 Integration Platform deployment instructions, speci…
iamvirul 3889c23
feat: add salesforce-closewon-contract-automation to the list of proj…
iamvirul 4348f0a
refactor: consolidate configurations into structured records for impr…
iamvirul d42fb5f
code refactor
iamvirul 6769346
docs: Clarify Salesforce SOAP API requirement for the event listener …
iamvirul 3bd9bc4
refactor: Switch Salesforce event listener authentication from userna…
iamvirul 423c794
feat: Remove `channelName` configuration and update Salesforce listen…
iamvirul d10d735
fix: Extract opportunity ID from Salesforce Change Events using `Chan…
iamvirul 2743bba
feat: Implement robust error handling and comprehensive logging acros…
iamvirul d7b804d
refactor: Replace `ensureType()` calls with direct type narrowing for…
iamvirul c4d0f87
fix: Extract Salesforce event record IDs from event metadata instead …
iamvirul 3f6f30e
refactor: Extract `opportunityId` from a singular `recordId` field in…
iamvirul fb9b615
refactor: Make Salesforce fields optional and add null checks for imp…
iamvirul fdb6510
refactor: standardize optional field syntax for Salesforce record types.
iamvirul 4d20e82
refactor: update Salesforce queries to use generic `record {}` and sa…
iamvirul 3337415
feat: Enhance Docusign integration by refining envelope creation logi…
iamvirul b8f31b3
feat: Improve DocuSign template setup guidance and error troubleshoot…
iamvirul 69a9a49
docs: Streamline Docusign template setup instructions and error troub…
iamvirul 87f8900
Update instructions.md
iamvirul d8b9b4c
Update instructions.md
iamvirul c9fedd6
Merge branch 'main' into integration-sample-for-docusign-salesforce
iamvirul b4fbf6a
refactor: restructure configuration schema into grouped objects and a…
iamvirul a4b1cf4
Update ballerina-integrator/salesforce-closewon-contract-automation/R…
iamvirul cff7366
Update ballerina-integrator/salesforce-closewon-contract-automation/f…
iamvirul 28ce45e
refactor: simplify Salesforce-DocuSign integration diagram flow
iamvirul 86b5e33
Merge branch 'main' into integration-sample-for-docusign-salesforce
iamvirul File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
321 changes: 321 additions & 0 deletions
321
ballerina-integrator/salesforce-closewon-contract-automation/.choreo/config-schema.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,321 @@ | ||
| { | ||
| "$schema": "http://json-schema.org/draft-07/schema#", | ||
| "type": "object", | ||
| "properties": { | ||
| "ballerina": { | ||
| "type": "object", | ||
| "properties": { | ||
| "log": { | ||
| "type": "object", | ||
| "properties": { | ||
| "destinations": { | ||
| "type": "array", | ||
| "items": { | ||
| "anyOf": [ | ||
| { | ||
| "type": "object", | ||
| "properties": { | ||
| "type": { | ||
| "enum": [ | ||
| "stderr", | ||
| "stdout" | ||
| ] | ||
| } | ||
| }, | ||
| "additionalProperties": false, | ||
| "required": [ | ||
| "type" | ||
| ], | ||
| "name": "ballerina/log:2.14.0:StandardDestination" | ||
| }, | ||
| { | ||
| "type": "object", | ||
| "properties": { | ||
| "type": { | ||
| "enum": [ | ||
| "file" | ||
| ] | ||
| }, | ||
| "path": { | ||
| "type": "string" | ||
| }, | ||
| "mode": { | ||
| "enum": [ | ||
| "APPEND", | ||
| "TRUNCATE" | ||
| ] | ||
| } | ||
| }, | ||
| "additionalProperties": false, | ||
| "required": [ | ||
| "type", | ||
| "path", | ||
| "mode" | ||
| ], | ||
| "name": "ballerina/log:2.14.0:FileOutputDestination" | ||
| } | ||
| ] | ||
| }, | ||
| "description": "" | ||
| }, | ||
| "modules": { | ||
| "type": "array", | ||
| "items": { | ||
| "type": "object", | ||
| "properties": { | ||
| "name": { | ||
| "type": "string" | ||
| }, | ||
| "level": { | ||
| "enum": [ | ||
| "WARN", | ||
| "INFO", | ||
| "ERROR", | ||
| "DEBUG" | ||
| ] | ||
| } | ||
| }, | ||
| "additionalProperties": false, | ||
| "required": [ | ||
| "name", | ||
| "level" | ||
| ], | ||
| "name": "ballerina/log:2.14.0:Module" | ||
| }, | ||
| "description": "" | ||
| }, | ||
| "keyValues": { | ||
| "type": "object", | ||
| "properties": { | ||
| "msg": {}, | ||
| "error": {}, | ||
| "stackTrace": {}, | ||
| "module": {} | ||
| }, | ||
| "additionalProperties": false, | ||
| "name": "ballerina/log:2.14.0:AnydataKeyValues", | ||
| "description": "" | ||
| }, | ||
| "format": { | ||
| "enum": [ | ||
| "logfmt", | ||
| "json" | ||
| ], | ||
| "description": "" | ||
| }, | ||
| "level": { | ||
| "enum": [ | ||
| "WARN", | ||
| "INFO", | ||
| "ERROR", | ||
| "DEBUG" | ||
| ], | ||
| "description": "" | ||
| }, | ||
| "enableSensitiveDataMasking": { | ||
| "type": "boolean", | ||
| "description": "" | ||
| } | ||
| }, | ||
| "additionalProperties": false | ||
| } | ||
| }, | ||
| "additionalProperties": false | ||
| }, | ||
| "wso2": { | ||
| "type": "object", | ||
| "properties": { | ||
| "closewon_contract_automation": { | ||
| "type": "object", | ||
| "properties": { | ||
| "salesforceConfig": { | ||
| "type": "object", | ||
| "properties": { | ||
| "clientId": { | ||
| "type": "string" | ||
| }, | ||
| "clientSecret": { | ||
| "type": "string" | ||
| }, | ||
| "refreshToken": { | ||
| "type": "string" | ||
| }, | ||
| "refreshUrl": { | ||
| "type": "string" | ||
| }, | ||
| "baseUrl": { | ||
| "type": "string" | ||
| } | ||
| }, | ||
| "additionalProperties": false, | ||
| "required": [ | ||
| "clientId", | ||
| "clientSecret", | ||
| "refreshToken", | ||
| "refreshUrl", | ||
| "baseUrl" | ||
| ], | ||
| "name": "wso2/closewon_contract_automation:0.1.0:SalesforceConfig", | ||
| "description": "" | ||
| }, | ||
| "docusignConfig": { | ||
| "type": "object", | ||
| "properties": { | ||
| "accountId": { | ||
| "type": "string" | ||
| }, | ||
| "clientId": { | ||
| "type": "string" | ||
| }, | ||
| "clientSecret": { | ||
| "type": "string" | ||
| }, | ||
| "refreshToken": { | ||
| "type": "string" | ||
| }, | ||
| "refreshUrl": { | ||
| "type": "string" | ||
| }, | ||
| "baseUrl": { | ||
| "type": "string" | ||
| } | ||
| }, | ||
| "additionalProperties": false, | ||
| "required": [ | ||
| "accountId", | ||
| "clientId", | ||
| "clientSecret", | ||
| "refreshToken", | ||
| "refreshUrl", | ||
| "baseUrl" | ||
| ], | ||
| "name": "wso2/closewon_contract_automation:0.1.0:DocusignConfig", | ||
| "description": "" | ||
| }, | ||
| "templateSettings": { | ||
| "type": "object", | ||
| "properties": { | ||
| "defaultTemplateId": { | ||
| "type": "string" | ||
| }, | ||
| "templateConfigs": { | ||
| "type": "array", | ||
| "items": { | ||
| "type": "object", | ||
| "properties": { | ||
| "templateId": { | ||
| "type": "string" | ||
| }, | ||
| "productType": { | ||
| "type": "string" | ||
| }, | ||
| "dealType": { | ||
| "type": "string" | ||
| }, | ||
| "expirationDays": { | ||
| "type": "integer" | ||
| } | ||
| }, | ||
| "additionalProperties": false, | ||
| "required": [ | ||
| "templateId" | ||
| ], | ||
| "name": "wso2/closewon_contract_automation:0.1.0:TemplateConfig" | ||
| } | ||
| } | ||
| }, | ||
| "additionalProperties": false, | ||
| "required": [ | ||
| "defaultTemplateId", | ||
| "templateConfigs" | ||
| ], | ||
| "name": "wso2/closewon_contract_automation:0.1.0:TemplateSettings", | ||
| "description": "" | ||
| }, | ||
| "businessRulesConfig": { | ||
| "type": "object", | ||
| "properties": { | ||
| "minimumDealValue": { | ||
| "type": "number" | ||
| }, | ||
| "signerRole": { | ||
| "enum": [ | ||
| "Executive Sponsor", | ||
| "Decision Maker", | ||
| "Billing Contact", | ||
| "Primary Contact" | ||
| ] | ||
| }, | ||
| "ccRecipients": { | ||
| "type": "array", | ||
| "items": { | ||
| "type": "object", | ||
| "properties": { | ||
| "email": { | ||
| "type": "string" | ||
| }, | ||
| "name": { | ||
| "type": "string" | ||
| } | ||
| }, | ||
| "additionalProperties": false, | ||
| "required": [ | ||
| "email", | ||
| "name" | ||
| ], | ||
| "name": "wso2/closewon_contract_automation:0.1.0:CcRecipient" | ||
| } | ||
| }, | ||
| "fieldMappings": { | ||
| "type": "array", | ||
| "items": { | ||
| "type": "object", | ||
| "properties": { | ||
| "opportunityField": { | ||
| "type": "string" | ||
| }, | ||
| "docusignField": { | ||
| "type": "string" | ||
| } | ||
| }, | ||
| "additionalProperties": false, | ||
| "required": [ | ||
| "opportunityField", | ||
| "docusignField" | ||
| ], | ||
| "name": "wso2/closewon_contract_automation:0.1.0:FieldMapping" | ||
| } | ||
| }, | ||
| "contractSentStage": { | ||
| "type": "string" | ||
| }, | ||
| "expirationReminderDays": { | ||
| "type": "integer" | ||
| } | ||
| }, | ||
| "additionalProperties": false, | ||
| "required": [ | ||
| "minimumDealValue", | ||
| "signerRole", | ||
| "ccRecipients", | ||
| "fieldMappings", | ||
| "contractSentStage", | ||
| "expirationReminderDays" | ||
| ], | ||
| "name": "wso2/closewon_contract_automation:0.1.0:BusinessRulesConfig", | ||
| "description": "" | ||
| } | ||
| }, | ||
| "additionalProperties": false, | ||
| "required": [ | ||
| "salesforceConfig", | ||
| "docusignConfig" | ||
| ] | ||
| } | ||
| }, | ||
| "additionalProperties": false | ||
| } | ||
| }, | ||
| "additionalProperties": false, | ||
| "requiredLevel": 3 | ||
| } |
20 changes: 20 additions & 0 deletions
20
ballerina-integrator/salesforce-closewon-contract-automation/.choreo/diagram.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| A(["Start"]):::startNode | ||
| B["Listen to Salesforce Opportunity Events"]:::processNode | ||
| C{"Is 'Closed Won'?"}:::decisionNode | ||
| D["Retrieve Opportunity & Contact Details"]:::processNode | ||
| E["Send DocuSign Envelope"]:::processNode | ||
| F{"Envelope <br/> Created?"}:::decisionNode | ||
| G["Update Stage to 'Contract Sent'"]:::processNode | ||
| H["Log Error"]:::processNode | ||
| I(["End"]):::endNode | ||
|
|
||
| A --> B | ||
| B --> C | ||
| C -- Yes --> D | ||
| C -- No --> I | ||
| D --> E | ||
| E --> F | ||
| F -- Yes --> G | ||
| F -- No --> H | ||
| G --> I | ||
| H --> I | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.