Purpose
This procedure (automatic schedule task) is designed to close declaration after end date ends.
Process configuration
Name | Description | Format | Default value |
---|---|---|---|
DECLARATION_AUTOTERMINATION_SCHEDULE | How often to perform this task | Cron Format | “0 0-4 * * * *” |
Job logic
Fetch records from OPS.declarations, where:
is_active = TRUE
status not in [closed, terminated, rejected]
end_date < current_date()
Update all records to:
status = ‘closed’
updated_at = now()
updated_by = SYSTEM_USER