<?php

namespace failover;

require_once WD . '/modules/failover/config/failover_enabled_c.php';
require_once WD . '/modules/failover/config/failover_database_enabled_c.php';
require_once WD . '/modules/failover/config/failover_redis_enabled_c.php';
require_once WD . '/modules/failover/config/failover_minio_enabled_c.php';
require_once WD . '/modules/failover/config/failover_max_status_age_seconds_c.php';

use failover\config\failover_database_enabled_c;
use failover\config\failover_enabled_c;
use failover\config\failover_max_status_age_seconds_c;
use failover\config\failover_minio_enabled_c;
use failover\config\failover_redis_enabled_c;
use traits\module_config_t;

class failover_c
{
    use module_config_t;

    public failover_enabled_c $enabled;
    public failover_database_enabled_c $database_enabled;
    public failover_redis_enabled_c $redis_enabled;
    public failover_minio_enabled_c $minio_enabled;
    public failover_max_status_age_seconds_c $max_status_age_seconds;

    public function __construct()
    {
        $this->setupConfig('Failover');
        $this->allowUpdate([
            failover_enabled_c::class,
            failover_database_enabled_c::class,
            failover_redis_enabled_c::class,
            failover_minio_enabled_c::class,
            failover_max_status_age_seconds_c::class,
        ]);

        $this->enabled = new failover_enabled_c();
        $this->database_enabled = new failover_database_enabled_c();
        $this->redis_enabled = new failover_redis_enabled_c();
        $this->minio_enabled = new failover_minio_enabled_c();
        $this->max_status_age_seconds = new failover_max_status_age_seconds_c();
    }
}
