@@ -203,6 +203,10 @@ sub post_service_request {
203
203
204
204
$args -> {service_code_alloy }
205
205
= $self -> _munge_service_code( $args -> {service_code } );
206
+ my $rfs_design = $self -> config-> {rfs_design };
207
+ if (ref $rfs_design eq ' HASH' ) {
208
+ $rfs_design = $rfs_design -> {$args -> {service_code_alloy }} || $rfs_design -> {$self -> rfs_design_fallback};
209
+ }
206
210
207
211
my $rfs_design = $self -> config-> {rfs_design };
208
212
if (ref $rfs_design eq ' HASH' ) {
@@ -388,37 +392,9 @@ sub _search_for_code_by_argument {
388
392
return undef ;
389
393
}
390
394
391
- my $body = $self -> find_item_body(
392
- dodi_code => $dodi_code ,
393
- attribute_code => $attribute_code ,
394
- search_term => $search_term ,
395
- );
396
-
397
- my $results = $self -> alloy-> search($body );
398
-
399
- return undef unless @$results ;
400
- my $result = $results -> [0];
401
-
402
- # Sanity check that our filtering to one result is the correct result
403
- my $a = $self -> alloy-> attributes_to_hash( $result );
404
- return undef unless $a -> {$attribute_code } && $a -> {$attribute_code } eq $search_term ;
405
- $result -> {attributes } = $a ;
406
-
407
- return $result ;
408
- }
409
-
410
- =head2 find_item_body
411
-
412
- Builds query body for looking up a specific item in Alloy.
413
-
414
- =cut
415
-
416
- sub find_item_body {
417
- my ( $self , %params ) = @_ ;
418
-
419
- return {
395
+ my $body = {
420
396
properties => {
421
- dodiCode => $params { dodi_code } ,
397
+ dodiCode => $dodi_code ,
422
398
collectionCode => " Live" ,
423
399
attributes => [ ' all' ],
424
400
},
@@ -429,19 +405,31 @@ sub find_item_body {
429
405
{
430
406
type => " Attribute" ,
431
407
properties => {
432
- attributeCode => $params { attribute_code } ,
408
+ attributeCode => $attribute_code ,
433
409
},
434
410
},
435
411
{
436
412
type => " String" ,
437
413
properties => {
438
- value => [ $params { search_term } ]
414
+ value => [ $search_term ]
439
415
}
440
416
}
441
417
]
442
418
}
443
419
]
444
420
};
421
+
422
+ my $results = $self -> alloy-> search($body );
423
+
424
+ return undef unless @$results ;
425
+ my $result = $results -> [0];
426
+
427
+ # Sanity check that our filtering to one result is the correct result
428
+ my $a = $self -> alloy-> attributes_to_hash( $result );
429
+ return undef unless $a -> {$attribute_code } && $a -> {$attribute_code } eq $search_term ;
430
+ $result -> {attributes } = $a ;
431
+
432
+ return $result ;
445
433
}
446
434
447
435
=head2 _create_contact
0 commit comments