Commit 729ffa9 1 parent 8373204 commit 729ffa9 Copy full SHA for 729ffa9
File tree 2 files changed +28
-15
lines changed
Open311/Endpoint/Integration
2 files changed +28
-15
lines changed Original file line number Diff line number Diff line change @@ -289,9 +289,6 @@ sub perform_request {
289
289
return $response ;
290
290
}
291
291
292
- # TODO Tests
293
- # TODO Comments/POD
294
-
295
292
sub perform_request_graphql {
296
293
my ($self , %args ) = @_ ;
297
294
@@ -325,12 +322,18 @@ sub perform_request_graphql {
325
322
326
323
my $content = decode_json($response -> content);
327
324
328
- # TODO Error handling
329
-
330
325
return $content ;
331
326
}
332
327
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.
334
337
335
338
sub job_status_logs_graphql_query {
336
339
my ( $self , %args ) = @_ ;
@@ -341,8 +344,6 @@ sub job_status_logs_graphql_query {
341
344
my @status_codes
342
345
= keys %{ $self -> config-> {job_reverse_status_mapping } // () };
343
346
344
- # TODO What if dates not present?
345
- # TODO Timezone handling?
346
347
my (
347
348
$start_date ,
348
349
$end_date ,
@@ -389,8 +390,6 @@ sub job_status_logs_graphql_query {
389
390
GRAPHQL
390
391
}
391
392
392
- # TODO In batches?
393
-
394
393
sub jobs_graphql_query {
395
394
my ( $self , %args ) = @_ ;
396
395
Original file line number Diff line number Diff line change @@ -67,17 +67,26 @@ has service_whitelist => (
67
67
}
68
68
);
69
69
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
71
76
72
- # Whether cobrand also fetches jobs from Confirm alongside enquiries
73
77
has handle_jobs => (
74
78
is => ' lazy' ,
75
79
default => sub {
76
80
return $_ [0]-> get_integration-> config-> {graphql_url } ? 1 : 0;
77
81
}
78
82
);
79
83
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
81
90
82
91
has job_service_whitelist => (
83
92
is => ' ro' ,
@@ -242,7 +251,13 @@ has reverse_status_mapping => (
242
251
default => sub { {} }
243
252
);
244
253
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
246
261
247
262
has job_reverse_status_mapping => (
248
263
is => ' ro' ,
@@ -910,7 +925,6 @@ sub get_service_requests {
910
925
next ;
911
926
}
912
927
913
- # TODO Can we assume logs are already ordered by date?
914
928
my $last_status_log = $job -> {statusLogs }[-1];
915
929
916
930
my $status = $self -> job_reverse_status_mapping
You can’t perform that action at this time.
0 commit comments