package Common::RSDB::StaticList;

use strict;
use warnings;

use lib '/app/tools/common/lib';
use Common::YamlConfig;

sub clientDB {
    my $config = Common::YamlConfig::get_config( __PACKAGE__, 'NOACCESSORS' );
    foreach my $id ( sort { $a <=> $b } keys %{$config} ) {
        my $conf = $config->{$id};
        delete $config->{$id} if $conf->{'inactive'};
        $conf->{'username'} = 'dbuser'    unless defined $conf->{'username'};
        $conf->{'password'} = 'redStripe' unless defined $conf->{'password'};
    }
    %{$config};
}

sub allClientDB {
    my $config = Common::YamlConfig::get_config( __PACKAGE__, 'NOACCESSORS' );
    foreach my $id ( sort { $a <=> $b } keys %{$config} ) {
        my $conf = $config->{$id};
        $conf->{'username'} = 'dbuser'    unless defined $conf->{'username'};
        $conf->{'password'} = 'redStripe' unless defined $conf->{'password'};
    }
    $config;
}

1;
