ЕСОЗ - публічна документація

[AUTO] Close declaration

Purpose

This procedure (automatic schedule task) is designed to close declaration after end date ends.

Process configuration

Name

Description

Format

Default value

Name

Description

Format

Default value

DECLARATION_AUTOTERMINATION_SCHEDULE

How often to perform this task

Cron Format

“0 0-4 * * * *”

Job logic

  1. Fetch records from OPS.declarations, where:

    1. is_active = TRUE

    2. status not in [closed, terminated, rejected]

    3. end_date < current_date()

  2. Update all records to:

    1. status = ‘closed’

    2. updated_at = now()

    3. updated_by = SYSTEM_USER

ЕСОЗ - публічна документація