Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bristol] Convert Bristol to a Multi #378

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7c66c92
[Bromley] Add new update state for referral processing.
dracos Mar 19, 2024
5a5b508
[Bromley] Include Title, and single-line Notes.
dracos Mar 22, 2024
7732df9
[Bromley] Add default Event ID.
dracos Mar 22, 2024
ce9ac7d
[Bromley][WW] Truncate text to maximum field length
MorayMySoc Apr 12, 2024
e1b7c5d
Allow through attribute[]s on any updates.
dracos Jul 31, 2024
6252eb4
[Confirm] Allow ignoring of enquiries in certain status
davea Oct 15, 2024
3510ded
[Bexley] Rename Symology service class.
dracos Oct 15, 2024
38259c1
[Symology] Factor out URL/photo line adding.
dracos Oct 15, 2024
0695f1b
[Alloy] Log GET calls.
dracos Oct 16, 2024
97d6e27
Add script to check endpoint certificate expiry dates.
dracos Oct 29, 2024
41cff50
[Passthrough] Log calls made.
dracos Nov 12, 2024
247c2ea
[Alloy] Stop reconstructing updated reports.
dracos Nov 8, 2024
e65a5c4
[Bucks] Cache status API call lookup.
dracos Nov 8, 2024
a953b5d
[Alloy] Increase per-page to 100.
dracos Nov 8, 2024
d3e2853
[Bexley][WW] Implement worksheet sending for delivery requests
nephila-nacrea Oct 24, 2024
765ff93
[Bexley][WW] Use collection_service_id for removal requests
nephila-nacrea Oct 29, 2024
c7a0236
[Bexley][WW] Include location_of_letterbox in Whitespace worksheets
nephila-nacrea Nov 13, 2024
8112149
[Confirm] Log GraphQL errors.
neprune Dec 3, 2024
3954eca
[Whitespace] Make sure SOAP 1.1 is used.
dracos Dec 10, 2024
739c938
[SLWP] Add way to pass in multiple payment details.
dracos Jul 31, 2024
b8e093d
[Confirm] Cope if enquiry JSON returns error.
dracos Dec 11, 2024
881550c
[Brent] Include car park issue type in notes.
dracos Dec 6, 2024
6f47809
[Bristol] Convert Bristol to a Multi
MorayMySoc Dec 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions bin/check-endpoints
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env perl

use strict;
use warnings;
use v5.14;

BEGIN {
use File::Basename qw(dirname);
use File::Spec;
my $d = dirname(File::Spec->rel2abs($0));
require "$d/../setenv.pl";
}

use Getopt::Long;
use Open311::Endpoint::Integration::UK;

my ($verbose);
GetOptions (
'verbose|v' => \$verbose,
);

my $uk = Open311::Endpoint::Integration::UK->new;

$uk->check_endpoints($verbose);
57 changes: 57 additions & 0 deletions conf/council-bristol_alloy.yml-example
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Currently just a copy of Bucks
{
"api_key": "",
"api_url": "",
"rfs_design": '',
"resource_attachment_attribute_id": "",

"category_list_code": "",
"category_title_attribute": "",

"parent_attribute_name": "",

"service_whitelist": {
},

"resource_attribute_defaults": {
},

"request_to_resource_attribute_mapping": {
},
"request_to_resource_attribute_manual_mapping": {
},

"created_datetime_attribute_id": '',

"inspection_attribute_mapping": {
},

"inspection_status_mapping": {
},

"inspection_closure_mapping": {
},

"ignored_defect_types": [
],

"defect_sourcetype_category_mapping": {
},

"defect_status_mapping": {
},

"defect_resource_name": [],

"defect_attribute_mapping": {
},

"contact": {
"code": "",
"attribute_id": "",
"attribute_defaults": {
},
"attribute_mapping": {
},
}
}
2 changes: 2 additions & 0 deletions conf/council-www.bristol.gov.uk.yml-example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
endpoint: https://localhost:4000/
api_key: 123
4 changes: 3 additions & 1 deletion perllib/Integrations/AlloyV2.pm
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ sub api_call {
$request->content(encode_json($body));
$self->logger->debug($call);
$self->logger->debug(encode_json($body));
} else {
$self->logger->debug($call);
}
my $response = $ua->request($request);
if ($response->is_success) {
Expand Down Expand Up @@ -182,7 +184,7 @@ sub search {
return [] unless $result_count;

my $maxPages = 100;
my $pageSize = $result_count <= 2000 ? 20 : ( ceil($result_count / $maxPages) + 1 );
my $pageSize = $result_count <= 10000 ? 100 : ( ceil($result_count / $maxPages) + 1 );
my $pages = int( $result_count / $pageSize ) + 1;

my $query_body = $body_base;
Expand Down
7 changes: 6 additions & 1 deletion perllib/Integrations/Confirm.pm
Original file line number Diff line number Diff line change
Expand Up @@ -315,13 +315,18 @@ sub perform_request_graphql {
my $body = {
query => $query,
};
my $encoded_body = encode_json($body);

$request->content(encode_json($body));
$request->content($encoded_body);

my $response = $self->ua->request($request);

my $content = decode_json($response->content);

if ($content->{errors} && @{$content->{errors}}) {
$self->logger->warn("Got errors in response to GraphQL query $encoded_body: " . $response->content);
}

return $content;
}

Expand Down
4 changes: 3 additions & 1 deletion perllib/Integrations/Surrey/Boomi.pm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ has ua => (
timeout => 3 * 60, # Boomi can take longer than the default 60s when handling large/multiple photos.
);
$ua->ssl_opts(SSL_cipher_list => 'DEFAULT:!DH'); # Disable DH ciphers, server's key is too small apparently
my $hash = encode_base64($self->config->{username} . ':' . $self->config->{password}, "");
my $un = $self->config->{username} || '';
my $pw = $self->config->{password} || '';
my $hash = encode_base64("$un:$pw", "");
$ua->default_header('Authorization' => "Basic $hash");
$ua->default_header('Content-Type' => "application/json");
return $ua;
Expand Down
8 changes: 1 addition & 7 deletions perllib/Integrations/Symology.pm
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,7 @@ sub current_date {
sub SOAP::Serializer::as_ArrayOfAdditionalFieldSend {
my ($self, $value, $name, $type, $attr) = @_;

# Allow individual integrations to provide their own values here, otherwise
# assume it's a simple value for the customer type field.
unless (ref $value eq 'ARRAY') {
$value = [
[ FieldLine => 17, ValueType => 1, DataValue => $value ],
];
}
die unless ref $value eq 'ARRAY';

my $elem = \SOAP::Data
->name('tns:AdditionalFieldSend' => map { [ make_soap_structure(@$_) ] } @$value)
Expand Down
19 changes: 16 additions & 3 deletions perllib/Integrations/Whitespace.pm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ has endpoint => (
$ENV{PERL_LWP_SSL_CA_PATH} = '/etc/ssl/certs' unless $ENV{DEV_USE_SYSTEM_CA_PATH};

my $soap = SOAP::Lite->new(
soapversion => 1.1,
proxy => $self->url,
default_ns => $self->attr,
on_action => sub { $self->attr . $_[1] }
Expand Down Expand Up @@ -67,6 +66,8 @@ sub call {

require SOAP::Lite;
@params = make_soap_structure(@params);
# See comment in Echo.pm
SOAP::Lite->soapversion(1.1);
my $som = $self->endpoint->call(
$method => @params,
$self->security
Expand Down Expand Up @@ -100,17 +101,23 @@ sub CreateWorksheet {
die "No service mapping found for $params->{service_item_name}";
}

my $service_id = $params->{service_code} eq 'request_new_container'
? $service_params->{delivery_service_id}
: $params->{service_code} eq 'request_container_removal'
? $service_params->{collection_service_id}
: $service_params->{service_id};

my $worksheet = ixhash(
Uprn => $params->{uprn},
ServiceId => $service_params->{service_id},
ServiceId => $service_id,
WorksheetReference => $params->{worksheet_reference},
WorksheetMessage => $params->{worksheet_message},
ServiceItemInputs => ixhash(
'wsap:Input.CreateWorksheetInput.ServiceItemInput' => [
ixhash(
'wsap:ServiceItemId' => $service_params->{service_item_id},
'wsap:ServiceItemName' => '',
'wsap:ServiceItemQuantity' => 1,
'wsap:ServiceItemQuantity' => $params->{quantity},
)
]
),
Expand All @@ -127,6 +134,12 @@ sub CreateWorksheet {
'wsap:ServicePropertyValue' => $params->{location_of_containers},
),
},
$params->{location_of_letterbox} ? ({
'wsap:Input.CreateWorksheetInput.ServicePropertyInput' => ixhash(
'wsap:ServicePropertyId' => 82,
'wsap:ServicePropertyValue' => $params->{location_of_letterbox},
),
}) : (),
],
);

Expand Down
Loading
Loading