Help in Transform

Dear all, I need support in transform, where I validate the date received by the leave_end_date field, and I need it to return in the field if the condition is “active” or “vacation” in the first minute of the future day, that is, example: if leave_end_date is equal to “2025-02-10” I need you to consult and activate it only if the date is “2025-02-11”

follow the transform

 {
        "name": "PP_Employee_status_V1",
        "type": "lookup",
        "attributes": {
            "input": {
                "type": "static",
                "attributes": {
                     "dataFimAfastamento": {
                        "attributes": {
                            "values": [
                                {
                                    "attributes": {
                                        "firstDate": {
                                            "attributes": {
                                                "expression": "+1d",
                                                "input": {
                                                    "attributes": {
                                                        "input": {
                                                            "attributes": {
                                                                "attributeName": "leave_end_date",
                                                                "sourceName": "ms-witchcraft-absences - PROD"
                                                            },
                                                            "type": "accountAttribute"
                                                        },
                                                        "inputFormat": "yyyy-MM-dd",
                                                        "outputFormat": "ISO8601"
                                                    },
                                                    "type": "dateFormat"
                                                }
                                            },
                                            "type": "dateMath"
                                        },
                                        "secondDate": "now",
                                        "operator": "gt",
                                        "positiveCondition": "ativo",
                                        "negativeCondition": "ferias"
                                    },
                                    "type": "dateCompare"
                                },
                                "null"
                            ]
                        },
                        "type": "firstValid"
                    },
                    "status": {
                        "attributes": {
                            "values": [
                                {
                                    "attributes": {
                                        "attributeName": "employee_status",
                                        "sourceName": "ms-witchcraft-absences - PROD"
                                    },
                                    "type": "accountAttribute"
                                },
                                "null"
                            ]
                        },
                        "type": "firstValid"
                    },
                   
                    "value": "#if($status == 'ATIVO' && $dataFimAfastamento == 'ativo')1#elseif($status == 'Férias' && $dataFimAfastamento == 'ativo')1#elseif($status == 'Férias' && $dataFimAfastamento == 'ferias')2#{else}1#end"
                }
            },
            "table": {
                "1": "ativo",
                "2": "ferias",
                "default": "outros"
            }
        },
        "internal": false
    }

I think you got the logic in dateCompare reversed.
You are returning “ativo” when (leave_end_date + 1d) gt now which means if the leave_end_date is in future. try using lte instead of gt

Thanks, for now, it seems to work, my head was exploding, with the logic confusing me lol.

Another question, how do I know what time Sailpoint now is?
Since I need this update to be carried out in the first minute of the day.

now is always the current UTC time to the last second (or milli second)