From aa91344308c4e273e8b1152a7c8dd87a003d9f80 Mon Sep 17 00:00:00 2001 From: Chris Mytton Date: Wed, 8 May 2024 12:36:52 +0100 Subject: [PATCH] [Bexley][Whitespace] Remove service mapping script Bexley have provided us with a manually created mapping between service items and services, meaning this script is no longer needed. Removing the script also means that we can't accidentally overwrite the service mapping they provided in the future. --- bin/whitespace/bexley-service-mapping | 57 ---------------------- conf/council-bexley_whitespace.yml-example | 2 +- 2 files changed, 1 insertion(+), 58 deletions(-) delete mode 100755 bin/whitespace/bexley-service-mapping diff --git a/bin/whitespace/bexley-service-mapping b/bin/whitespace/bexley-service-mapping deleted file mode 100755 index 1d78cf946..000000000 --- a/bin/whitespace/bexley-service-mapping +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env perl - -BEGIN { - use File::Basename qw(dirname); - use File::Spec; - my $d = dirname(File::Spec->rel2abs($0)); - require "$d/../../setenv.pl"; -} - -use Integrations::Whitespace; - -if ($ARGV[0] eq '-h') { - print "Usage: $0\n"; - print "This script generates the YAML for the service_mapping key of the configuration.\n"; - exit; -} - -my $whitespace = Integrations::Whitespace->new(config_filename => 'bexley_whitespace'); - -my $services = $whitespace->GetServices; - -# Find all services where the ServiceName starts with "Missed" -my @missed_services = grep { $_->{ServiceName} =~ /^Missed/ } @$services; - -my %output; - -for my $service (@missed_services) { - my $service_items = $whitespace->GetServiceItems($service->{ServiceID}); - - for my $service_item (@$service_items) { - push @{ $output{$service_item->{ServiceItemName}} }, { - service_id => $service->{ServiceID}, - service_name => $service->{ServiceName}, - service_item_id => $service_item->{ServiceItemID}, - service_item_description => $service_item->{ServiceItemDescription}, - }; - } - -} - -print "service_mapping:\n"; -for my $service_item_name (keys %output) { - my $service_items = $output{$service_item_name}; - my $service_item = $service_items->[0]; - print " $service_item_name:\n"; - print " service_item_id: " . $service_item->{service_item_id} . " # $service_item->{service_item_description}\n"; - print " service_id: " . $service_item->{service_id} . " # $service_item->{service_name}\n"; - - if (@{ $service_items } > 1) { - print " # Also found " . (scalar @{ $service_items } - 1) . " other related service(s):\n"; - - for my $i (1 .. $#{ $service_items }) { - my $service_item = $service_items->[$i]; - print " # service_id: " . $service_item->{service_id} . " # $service_item->{service_name}\n"; - } - } -} diff --git a/conf/council-bexley_whitespace.yml-example b/conf/council-bexley_whitespace.yml-example index 351faae0f..2ddfcc5ab 100644 --- a/conf/council-bexley_whitespace.yml-example +++ b/conf/council-bexley_whitespace.yml-example @@ -10,4 +10,4 @@ category_mapping: name: Report missed collection group: Waste -service_mapping: # Replace with output from `bin/whitespace/bexley-service-mapping` +service_mapping: {} # Copy from staging/live config