Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
9 changes: 9 additions & 0 deletions config/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ def check_ucpath_code(type, value)
@ucpath_codes[type].include? value
end

# If the Job Code is in either the fte_check_exclusions or emeritus_job_code
# lists, you must skip the FTE check..., otherwise DO NOT skip the check.
def skip_fte_check?(job_code)
return true if check_ucpath_code('fte_check_exclusions', job_code)
return true if check_ucpath_code('emeritus_job_code', job_code)

false
end

private

def load_settings!(path)
Expand Down
8 changes: 8 additions & 0 deletions config/ucpath_codes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,11 @@ uc_extension_faculty:
# of any student affiliations
priority_job_codes:
- "006761"

# The 0FTE (percent of full time employment) excludes these
# job codes
fte_check_exclusions:
- "CWR022"
- "CWR015"
- "CWR003"
- "CWR016"
2 changes: 2 additions & 0 deletions lib/ucpath/jobs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ def valid_org_relationship?(j)
# 4. The job will be ineligible if the percentage of full time is zero
# Note - percentage of full time can appear in 2 different places (ugh)
def positive_full_time?(j)
return true if Config.skip_fte_check?(j.job_code)

values = []
values << j.percent_of_fulltime if j.respond_to?(:percent_of_fulltime)
values << j.percent_of_fulltime_job if j.respond_to?(:percent_of_fulltime_job)
Expand Down
2 changes: 1 addition & 1 deletion lib/ucpath/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def create_user_record
# PERCENT OF FULL TIME CHECK
# AP-559 If an employee is in a position that is 0 FTE,
# their record should should be filtered out from the UCPath files.
if percent_of_fulltime.zero? && percent_of_fulltime_job.zero?
if !Config.skip_fte_check?(job_code) && (percent_of_fulltime.zero? && percent_of_fulltime_job.zero?)
logger.info "#{id} - Ineligible: Percentage of Full Time Check"
return nil
end
Expand Down
1 change: 1 addition & 0 deletions spec/lib/ucpath_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,7 @@ def eligible(job)

before do
allow(Date).to receive(:today).and_return(today)
allow(Config).to receive(:skip_fte_check?).and_return(false)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you configured this but do you have a test to call the method with a true return and one for a false return?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. The branch is covered..., but I don't have an explicit test for skip_fte_check (there are just tests that touch both scenarios), but probably good to have an explicit test for that purpose...I'll add that in!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added test for FTE function

end

context "when hr_status_code is not 'A'" do
Expand Down
Loading