Conversation
| end | ||
|
|
||
| def map_job_to_struct(job_hash) | ||
| OpenStruct.new( |
There was a problem hiding this comment.
OpenStruct is deprecated and will be removed from Ruby 3.5
There was a problem hiding this comment.
UGH...yeah. I'll open a ticket to eventually move from openstructs to structs.
There was a problem hiding this comment.
Note - opened AP-584 for that work.
| def find_priority_jobs(job_list) | ||
| job_list.flatten.find do |jh| | ||
| job_code = jh.dig('position', 'jobCode', 'code', 'code') | ||
| status = jh.dig('position', 'active', 'code') |
There was a problem hiding this comment.
Maybe, i'm not reading this right but should it be status = jh.dig('position', 'status', 'code'). Is it parsing ucpath_fields.yml?
There was a problem hiding this comment.
You'd think... but nope, here's the JSON from the API:
"position": {
...
"active": {
"code": "A",
"description": "Active"
},
...
},
There was a problem hiding this comment.
i'm a little confused by this too - i din't think it's parsing that file, but i see a similar json path in that file. how are these two things related?
There was a problem hiding this comment.
maria is correct, it's not parsing ucpath_fields.yml. The new function (find_priority_jobs) is going through the JSON that is returned from the UCPath/Jobs API (looking for any job that is active and in the priority list).
The JSONPath (from ucpath_fields.yml) is used to map data fields from the job hash (from the API) into an OpenStruct which gets passed back to the user object for further processing.
anarchivist
left a comment
There was a problem hiding this comment.
generally looking good - a few comments
|
|
||
| # These jobs will always be considered "eligible" regardless | ||
| # of any student affiliations | ||
| Priority Job Codes: |
There was a problem hiding this comment.
i know we had this before, but i'm a little concerned about YAML keys containing spaces - could we rename this something like priority_job_codes or something similar? (i know we need to make similar changes throughout this file and in the code, too.)
There was a problem hiding this comment.
Sure - that's definitely doable!
| def find_priority_jobs(job_list) | ||
| job_list.flatten.find do |jh| | ||
| job_code = jh.dig('position', 'jobCode', 'code', 'code') | ||
| status = jh.dig('position', 'active', 'code') |
There was a problem hiding this comment.
i'm a little confused by this too - i din't think it's parsing that file, but i see a similar json path in that file. how are these two things related?
No description provided.