diff options
author | M Somerville <matthew-github@dracos.co.uk> | 2020-11-04 13:45:20 +0000 |
---|---|---|
committer | M Somerville <matthew-github@dracos.co.uk> | 2020-11-11 10:37:44 +0000 |
commit | 5e2f1b3509391f891955db8b8fe05dbf40b7a041 (patch) | |
tree | 8bc4f1fd87a12e8191ee8b80df87f5d5ecc146c1 /perllib/Integrations | |
parent | 3f70d1f0b4d543072eda2d1b59092a5b9e6b3253 (diff) |
[Bromley] Adapt if last instance is in future.
Diffstat (limited to 'perllib/Integrations')
-rw-r--r-- | perllib/Integrations/Echo.pm | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/perllib/Integrations/Echo.pm b/perllib/Integrations/Echo.pm index 28dd1e9bc..bf4b453e6 100644 --- a/perllib/Integrations/Echo.pm +++ b/perllib/Integrations/Echo.pm @@ -89,25 +89,31 @@ sub GetTasks { push @refs, \%a; } - return [ - { + if ($self->sample_data) { + my %lookup = map { $_->[0] . ',' . $_->[1] => 1 } @_; + my $data = []; + push @$data, { Ref => { Value => { anyType => [ 123, 456 ] } }, State => { Name => 'Completed' }, Resolution => { Ref => { Value => { anyType => 187 } }, Name => 'Wrong Bin Out' }, TaskTypeId => 3216, CompletedDate => { DateTime => '2020-05-27T10:00:00Z' } - }, - { + } if $lookup{"123,456"}; + push @$data, { Ref => { Value => { anyType => [ 234, 567 ] } }, State => { Name => 'Outstanding' }, CompletedDate => undef - }, - { + } if $lookup{"234,567"}; + push @$data, { Ref => { Value => { anyType => [ 345, 678 ] } }, State => { Name => 'Not Completed' } - }, - { Ref => { Value => { anyType => [ 456, 789 ] } }, CompletedDate => undef }, - ] if $self->sample_data; + } if $lookup{"345,678"}; + push @$data, { + Ref => { Value => { anyType => [ 456, 789 ] } }, + CompletedDate => undef + } if $lookup{"456,789"}; + return $data; + } # This creates XML of the form <taskRefs><ObjectRef>...</ObjectRef><ObjectRef>...</ObjectRef>...</taskRefs> # uncoverable statement @@ -188,6 +194,7 @@ sub GetServiceUnitsForObject { OriginalScheduledDate => { DateTime => '2020-06-03T00:00:00Z' }, }, LastInstance => { + OriginalScheduledDate => { DateTime => '2020-05-27T00:00:00Z' }, CurrentScheduledDate => { DateTime => '2020-05-27T00:00:00Z' }, Ref => { Value => { anyType => [ 123, 456 ] } }, }, @@ -207,6 +214,7 @@ sub GetServiceUnitsForObject { OriginalScheduledDate => { DateTime => '2020-06-10T00:00:00Z' }, }, LastInstance => { + OriginalScheduledDate => { DateTime => '2020-05-27T00:00:00Z' }, CurrentScheduledDate => { DateTime => '2020-05-27T00:00:00Z' }, Ref => { Value => { anyType => [ 234, 567 ] } }, }, @@ -226,6 +234,7 @@ sub GetServiceUnitsForObject { OriginalScheduledDate => { DateTime => '2020-06-03T00:00:00Z' }, }, LastInstance => { + OriginalScheduledDate => { DateTime => '2020-05-18T00:00:00Z' }, CurrentScheduledDate => { DateTime => '2020-05-20T00:00:00Z' }, Ref => { Value => { anyType => [ 345, 678 ] } }, }, @@ -241,6 +250,7 @@ sub GetServiceUnitsForObject { ServiceTaskSchedules => { ServiceTaskSchedule => [ { EndDate => { DateTime => '2020-01-01T00:00:00Z' }, LastInstance => { + OriginalScheduledDate => { DateTime => '2019-12-31T00:00:00Z' }, CurrentScheduledDate => { DateTime => '2019-12-31T00:00:00Z' }, }, }, { @@ -250,6 +260,7 @@ sub GetServiceUnitsForObject { OriginalScheduledDate => { DateTime => '2020-06-01T00:00:00Z' }, }, LastInstance => { + OriginalScheduledDate => { DateTime => '2020-05-18T00:00:00Z' }, CurrentScheduledDate => { DateTime => '2020-05-18T00:00:00Z' }, Ref => { Value => { anyType => [ 456, 789 ] } }, }, |