As others mentioned, your approach is correct, and I would leverage the delete account feature New Capability: Delete Accounts on Termination via Lifecycle Management - Announcements / Product News - SailPoint Developer Community which comes with its own advantages like it is auditable, cost effective only if your source supports delete operation. If the source does not support, then you may think about the cloud rules (either before provisioning rule or Services Standard before provisioning rule)
Below is a sample transform with only 90days calculation based on end date, you can add more conditions based on your scenario.
{
"name": "Calculate delete LCS",
"type": "static",
"attributes": {
"day90Term": {
"attributes": {
"negativeCondition": "FALSE",
"positiveCondition": "TRUE",
"firstDate": {
"attributes": {
"input": {
"attributes": {
"values": [
{
"attributes": {
"attributeName": "END_DATE",
"sourceName": "HR Source"
},
"type": "accountAttribute"
},
"12/31/9999"
],
"ignoreErrors": "true"
},
"type": "firstValid"
},
"inputFormat": "MM/dd/yyyy",
"outputFormat": "ISO8601"
},
"type": "dateFormat"
},
"secondDate": {
"attributes": {
"input": {
"attributes": {
"expression": "now-90d/d"
},
"type": "dateMath"
},
"inputFormat": "yyyy-MM-dd'T'HH:mm",
"outputFormat": "ISO8601"
},
"type": "dateFormat"
},
"operator": "lte"
},
"type": "dateCompare"
}
},
"value": "#if ($day90Term == 'TRUE')delete#{else}others#end"
}