aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2020-07-28 17:07:00 +0100
committerM Somerville <matthew-github@dracos.co.uk>2020-11-11 10:29:20 +0000
commit8bcba7034241ec4fd0cdcd66d7c0fa2ba3686a6a (patch)
tree2292fc013a89133987857448bd05c01c17c1e6eb
parent6e51feec73dc05237055575e9409f38134271faf (diff)
[Bromley] Treat out-of-stock requests as open.
Even though it has a resolution code, it is still an open event. Fixes https://github.com/mysociety/fixmystreet-commercial/issues/1946
-rw-r--r--perllib/FixMyStreet/Cobrand/Bromley.pm3
-rw-r--r--perllib/Integrations/Echo.pm3
2 files changed, 4 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Bromley.pm b/perllib/FixMyStreet/Cobrand/Bromley.pm
index add6ac6bb..45cafeb8d 100644
--- a/perllib/FixMyStreet/Cobrand/Bromley.pm
+++ b/perllib/FixMyStreet/Cobrand/Bromley.pm
@@ -595,7 +595,8 @@ sub _parse_open_events {
my $events = shift;
my $open;
foreach (@$events) {
- next if $_->{ResolvedDate} || $_->{ResolutionCodeId}; # Is this the right field?
+ next if $_->{ResolvedDate};
+ next if $_->{ResolutionCodeId} && $_->{ResolutionCodeId} != 584; # Out of Stock
my $event_type = $_->{EventTypeId};
my $service_id = $_->{ServiceId};
if ($event_type == 2104) { # Request
diff --git a/perllib/Integrations/Echo.pm b/perllib/Integrations/Echo.pm
index 2bd98b777..d8608708e 100644
--- a/perllib/Integrations/Echo.pm
+++ b/perllib/Integrations/Echo.pm
@@ -336,7 +336,7 @@ sub GetEventsForObject {
EventTypeId => 2118,
ServiceId => 542,
}, {
- # Request for a new paper container
+ # Request for a new paper container, currently out of stock
EventTypeId => 2104,
Data => { ExtensibleDatum => [
{ Value => 2, DatatypeName => 'Source' },
@@ -348,6 +348,7 @@ sub GetEventsForObject {
},
] },
ServiceId => 535,
+ ResolutionCodeId => 584,
} ] if $type eq 'PointAddress';
return [ {
# Missed collection for service 537 (paper)