@@ -492,73 +492,76 @@ subtest "create problem with no resource_id" => sub {
492
492
restore_time;
493
493
};
494
494
495
- subtest " check fetch updates" => sub {
496
- my $res = $endpoint -> run_test_request(
497
- GET => ' /servicerequestupdates.json?jurisdiction_id=dummy&start_date=2019-01-01T00:00:00Z&end_date=2019-03-01T02:00:00Z' ,
498
- );
495
+ for my $use_joins_rather_than_parent_calls (1, 0) {
496
+ subtest " check fetch updates (using join: $use_joins_rather_than_parent_calls )" => sub {
497
+ $endpoint -> config-> {use_joins_rather_than_parent_calls } = $use_joins_rather_than_parent_calls ;
498
+ my $res = $endpoint -> run_test_request(
499
+ GET => ' /servicerequestupdates.json?jurisdiction_id=dummy&start_date=2019-01-01T00:00:00Z&end_date=2019-03-01T02:00:00Z' ,
500
+ );
499
501
500
- my $sent = pop @sent ;
501
- ok $res -> is_success, ' valid request'
502
- or diag $res -> content;
502
+ my $sent = pop @sent ;
503
+ ok $res -> is_success, ' valid request'
504
+ or diag $res -> content;
503
505
504
- is_deeply decode_json($res -> content),
505
- [ {
506
- status => ' investigating' ,
507
- service_request_id => ' 3027029' ,
508
- description => ' This is an updated customer response' ,
509
- updated_datetime => ' 2019-01-01T00:32:40Z' ,
510
- update_id => ' 3027029_20190101003240' ,
511
- media_url => ' ' ,
512
- extras => { latest_data_only => 1 },
513
- },
514
- {
515
- status => ' investigating' ,
516
- service_request_id => ' 3027030' ,
517
- description => ' ' ,
518
- updated_datetime => ' 2019-01-01T01:42:40Z' ,
519
- update_id => ' 3027030_20190101014240' ,
520
- media_url => ' ' ,
521
- extras => { latest_data_only => 1 },
522
- },
523
- {
524
- status => ' not_councils_responsibility' ,
525
- service_request_id => ' 3027031' ,
526
- description => ' ' ,
527
- updated_datetime => ' 2019-01-01T01:43:40Z' ,
528
- update_id => ' 3027031_20190101014340' ,
529
- media_url => ' ' ,
530
- external_status_code => ' 01b51bb5c0de101a004154b5' ,
531
- extras => { latest_data_only => 1 },
532
- },
533
- {
534
- status => ' action_scheduled' ,
535
- service_request_id => ' 3027032' ,
536
- description => ' ' ,
537
- updated_datetime => ' 2019-01-01T01:48:13Z' ,
538
- update_id => ' 4947501_20190101014813' ,
539
- media_url => ' ' ,
540
- extras => { latest_data_only => 1 },
541
- },
542
- {
543
- status => ' investigating' ,
544
- service_request_id => ' 3027034' ,
545
- description => ' ' ,
546
- updated_datetime => ' 2019-01-01T01:49:13Z' ,
547
- update_id => ' 3027034_20190101014913' ,
548
- media_url => ' ' ,
549
- extras => { latest_data_only => 1 },
550
- },
551
- {
552
- status => ' open' ,
553
- service_request_id => ' 4947502' ,
554
- description => ' ' ,
555
- updated_datetime => ' 2019-01-01T01:51:08Z' ,
556
- update_id => ' 4947502_20190101015108' ,
557
- media_url => ' ' ,
558
- extras => { latest_data_only => 1 },
559
- }
560
- ], ' correct json returned' ;
561
- };
506
+ is_deeply decode_json($res -> content),
507
+ [ {
508
+ status => ' investigating' ,
509
+ service_request_id => ' 3027029' ,
510
+ description => ' This is an updated customer response' ,
511
+ updated_datetime => ' 2019-01-01T00:32:40Z' ,
512
+ update_id => ' 3027029_20190101003240' ,
513
+ media_url => ' ' ,
514
+ extras => { latest_data_only => 1 },
515
+ },
516
+ {
517
+ status => ' investigating' ,
518
+ service_request_id => ' 3027030' ,
519
+ description => ' ' ,
520
+ updated_datetime => ' 2019-01-01T01:42:40Z' ,
521
+ update_id => ' 3027030_20190101014240' ,
522
+ media_url => ' ' ,
523
+ extras => { latest_data_only => 1 },
524
+ },
525
+ {
526
+ status => ' not_councils_responsibility' ,
527
+ service_request_id => ' 3027031' ,
528
+ description => ' ' ,
529
+ updated_datetime => ' 2019-01-01T01:43:40Z' ,
530
+ update_id => ' 3027031_20190101014340' ,
531
+ media_url => ' ' ,
532
+ external_status_code => ' 01b51bb5c0de101a004154b5' ,
533
+ extras => { latest_data_only => 1 },
534
+ },
535
+ {
536
+ status => ' action_scheduled' ,
537
+ service_request_id => ' 3027032' ,
538
+ description => ' ' ,
539
+ updated_datetime => ' 2019-01-01T01:48:13Z' ,
540
+ update_id => ' 4947501_20190101014813' ,
541
+ media_url => ' ' ,
542
+ extras => { latest_data_only => 1 },
543
+ },
544
+ {
545
+ status => ' investigating' ,
546
+ service_request_id => ' 3027034' ,
547
+ description => ' ' ,
548
+ updated_datetime => ' 2019-01-01T01:49:13Z' ,
549
+ update_id => ' 3027034_20190101014913' ,
550
+ media_url => ' ' ,
551
+ extras => { latest_data_only => 1 },
552
+ },
553
+ {
554
+ status => ' open' ,
555
+ service_request_id => ' 4947502' ,
556
+ description => ' ' ,
557
+ updated_datetime => ' 2019-01-01T01:51:08Z' ,
558
+ update_id => ' 4947502_20190101015108' ,
559
+ media_url => ' ' ,
560
+ extras => { latest_data_only => 1 },
561
+ }
562
+ ], ' correct json returned' ;
563
+ };
564
+ }
562
565
563
566
subtest " check fetch updates with cobrand skipping update where job has unchanged parent defect" => sub {
564
567
my $res = $oxfordshire_endpoint -> run_test_request(
0 commit comments