Skip to content

Commit 729ffa9

Browse files
Add POD and other comments
Also removing various TODOs that have been captured elsewhere.
1 parent 8373204 commit 729ffa9

File tree

2 files changed

+28
-15
lines changed

2 files changed

+28
-15
lines changed

perllib/Integrations/Confirm.pm

+9-10
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,6 @@ sub perform_request {
289289
return $response;
290290
}
291291

292-
# TODO Tests
293-
# TODO Comments/POD
294-
295292
sub perform_request_graphql {
296293
my ($self, %args) = @_;
297294

@@ -325,12 +322,18 @@ sub perform_request_graphql {
325322

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

328-
# TODO Error handling
329-
330325
return $content;
331326
}
332327

333-
# TODO Explain why graphql variables don't work
328+
# GraphQL queries.
329+
# Confirm docs: https://help.dudesolutions.com/Content/PDF/Confirm/v21.10/confirm-v21-10-web-api-specification.pdf
330+
#
331+
# We use GraphQL to fetch 'job' objects from Confirm.
332+
# You can read about GraphQL at https://graphql.org/learn/
333+
# BUT
334+
# it appears that Confirm's implementation lacks some features, notably
335+
# variable support (hence the use of string interpolation below). It also
336+
# tends to ignore faulty filter definitions in favour of fetching everything.
334337

335338
sub job_status_logs_graphql_query {
336339
my ( $self, %args ) = @_;
@@ -341,8 +344,6 @@ sub job_status_logs_graphql_query {
341344
my @status_codes
342345
= keys %{ $self->config->{job_reverse_status_mapping} // () };
343346

344-
# TODO What if dates not present?
345-
# TODO Timezone handling?
346347
my (
347348
$start_date,
348349
$end_date,
@@ -389,8 +390,6 @@ sub job_status_logs_graphql_query {
389390
GRAPHQL
390391
}
391392

392-
# TODO In batches?
393-
394393
sub jobs_graphql_query {
395394
my ( $self, %args ) = @_;
396395

perllib/Open311/Endpoint/Integration/Confirm.pm

+19-5
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,26 @@ has service_whitelist => (
6767
}
6868
);
6969

70-
# TODO POD
70+
=head2 handle_jobs
71+
72+
Whether cobrand fetches jobs from Confirm alongside enquiries. This is
73+
based on whether the cobrand has provided a GraphQL URL in its config.
74+
75+
=cut
7176

72-
# Whether cobrand also fetches jobs from Confirm alongside enquiries
7377
has handle_jobs => (
7478
is => 'lazy',
7579
default => sub {
7680
return $_[0]->get_integration->config->{graphql_url} ? 1 : 0;
7781
}
7882
);
7983

80-
# TODO POD
84+
=head2 job_service_whitelist
85+
86+
Controls the mapping of Confirm job service/subject codes to Open311 services
87+
(as opposed to service_whitelist, which handles enquiry services)
88+
89+
=cut
8190

8291
has job_service_whitelist => (
8392
is => 'ro',
@@ -242,7 +251,13 @@ has reverse_status_mapping => (
242251
default => sub { {} }
243252
);
244253

245-
# TODO POD
254+
=head2 job_reverse_status_mapping
255+
256+
Maps Confirm job status codes to Open311 service request status codes.
257+
Used for service request updates which are generated by job updates in
258+
Confirm, and for job service requests initially fetched from Confirm.
259+
260+
=cut
246261

247262
has job_reverse_status_mapping => (
248263
is => 'ro',
@@ -910,7 +925,6 @@ sub get_service_requests {
910925
next;
911926
}
912927

913-
# TODO Can we assume logs are already ordered by date?
914928
my $last_status_log = $job->{statusLogs}[-1];
915929

916930
my $status = $self->job_reverse_status_mapping

0 commit comments

Comments
 (0)