Skip to content

Commit 32d8a6c

Browse files
committed
CLC-1055: Add missing job_info and job_list offsets to fix
1 parent f7c6949 commit 32d8a6c

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

cielo24_gem/lib/cielo24/actions.rb

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,18 +247,29 @@ def assert_argument(arg, arg_name)
247247
end
248248

249249
def fix_job_info_offsets(job_info)
250-
keys = %w(CreationDate StartDate DueDate CompletedDate ReturnDate AuthorizationDate)
251-
keys.each do |key|
252-
job_info[key] = WebUtils.to_utc(job_info[key])
250+
top_keys = %w(CreationDate StartDate DueDate CompletedDate ReturnDate AuthorizationDate)
251+
task_keys = %w(TaskRequestTime)
252+
job_info = fix_offsets(job_info, top_keys)
253+
job_info.Tasks = job_info.Tasks.map do |task_item|
254+
fix_offsets(task_item, task_keys)
253255
end
254256
job_info
255257
end
256258

257259
def fix_job_list_offsets(job_list)
258-
job_list.ActiveJobs = job_list.ActiveJobs.map do |job|
259-
fix_job_info_offsets job
260+
keys = %w(CreationDate CreationTime StartDate StartTime DueDate CompletedDate
261+
ReturnDate CompletedTime AuthorizationDate)
262+
job_list.ActiveJobs = job_list.ActiveJobs.map do |job_item|
263+
fix_offsets(job_item, keys)
260264
end
261265
job_list
262266
end
267+
268+
def fix_offsets(hash, keys)
269+
keys.each do |key|
270+
hash[key] = WebUtils.to_utc(hash[key])
271+
end
272+
hash
273+
end
263274
end
264275
end

0 commit comments

Comments
 (0)