SFDO-Community / UnsubscribeLink

BSD 3-Clause "New" or "Revised" License
2 stars 5 forks source link

New Apex Classes to handle various scenarios for Public Id generation… #56

Closed scojac-github closed 1 month ago

scojac-github commented 1 month ago

Began writing new genericized classes to handle Public_Id__c generation using new UUID class.

Critical Changes

Changes

New Utility class, batch class, two invocables and test classes to cover all existing use cases for generating Public_Id__c field values.

Changes still needed

  1. Email notification when UUIDBatchJob class completes (similar to what's currently in GenerateAllStrings class).
  2. Flows need to be updated to call new invocable actions.
  3. Deprecate old classes.

Issues Closed

Not closed, per se, but work should address the following items from introductory slide

salesforce-cla[bot] commented 1 month ago

Thanks for the contribution! Before we can merge this, we need @scojac-upenn to sign the Salesforce Inc. Contributor License Agreement.

salgsstyrke commented 1 month ago

@scojac-github thanks so much for doing this! I added the apex-UnsubscribeLnkSingleRecordUUIDInvocable to the flow that creates a UUID for individual records, and I added the apex-UnsubscribeLnkUUIDBatchInvocable to the setup flow to create all the UUIDs for existing records. Both of these work, but those created by the batch look like this: YgLeHrWsHKcyvyPwXfQeXeFu1pxHuMETUxw2jWN90yTSDDbsUYT%2FUC5FyZAg6A4W

and those created individually look like this: db3e74ef-249e-40c3-9f51-ad3a615f05fc

iandrosov commented 1 month ago

@salgsstyrke The reason Batch looks different is due to UUID after generation there is an additional step, URLEncoding is applied. While in the Utility method it's just direct UUID format. db3e74ef-249e-40c3-9f51-ad3a615f05fc During the sprint, we did agree that the use of the UUID format was ok. But if special char - causes issues in Flows we can make it consistent with encoding

I completed the code review but there is a conflict on Flow

iandrosov commented 1 month ago

@scojac-github @salgsstyrke I did a review of changes and resolved all 19 conflicts in Flow XML. However, there was one section had record updates from the main that were removed in this PR. I think that Flow need to review again after this POR merge to confirm. If really those updates to be removed that can be new PR.