Bug 36641: Return '*' for 'default rule'

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Martin Renvoize 2024-07-12 10:15:44 +01:00 committed by Katrin Fischer
parent d34a6046a6
commit 8754e100f4
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834

View file

@ -124,7 +124,11 @@ sub list_rules {
) // {}; ) // {};
push @{$rules}, $effective_rules; push @{$rules}, $effective_rules;
} else { } else {
my $select = [ 'branchcode', 'categorycode', 'itemtype' ]; my $select = [
{ 'COALESCE' => [ 'branchcode', \["'*'"] ], -as => 'branchcode' },
{ 'COALESCE' => [ 'categorycode', \["'*'"] ], -as => 'categorycode' },
{ 'COALESCE' => [ 'itemtype', \["'*'"] ], -as => 'itemtype' }
];
my $as = [ 'branchcode', 'categorycode', 'itemtype' ]; my $as = [ 'branchcode', 'categorycode', 'itemtype' ];
for my $kind ( @{$kinds} ) { for my $kind ( @{$kinds} ) {
push @{$select}, { max => \[ "CASE WHEN rule_name = ? THEN rule_value END", $kind ], -as => $kind }; push @{$select}, { max => \[ "CASE WHEN rule_name = ? THEN rule_value END", $kind ], -as => $kind };