From dfa280d4786c5f297c268d85d019399921165950 Mon Sep 17 00:00:00 2001 From: Steve Sullivan Date: Mon, 30 Mar 2026 15:53:12 -0700 Subject: [PATCH 1/3] Add exceptions for FTE check --- config/config.rb | 9 +++++++++ config/ucpath_codes.yml | 8 ++++++++ lib/ucpath/jobs.rb | 2 ++ lib/ucpath/user.rb | 2 +- spec/lib/ucpath_spec.rb | 1 + 5 files changed, 21 insertions(+), 1 deletion(-) diff --git a/config/config.rb b/config/config.rb index 50ba0cc..d47b5fd 100644 --- a/config/config.rb +++ b/config/config.rb @@ -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) diff --git a/config/ucpath_codes.yml b/config/ucpath_codes.yml index 14c4d14..787a735 100644 --- a/config/ucpath_codes.yml +++ b/config/ucpath_codes.yml @@ -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" diff --git a/lib/ucpath/jobs.rb b/lib/ucpath/jobs.rb index d6fa9c6..3327036 100644 --- a/lib/ucpath/jobs.rb +++ b/lib/ucpath/jobs.rb @@ -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) diff --git a/lib/ucpath/user.rb b/lib/ucpath/user.rb index c25d7f2..0825647 100644 --- a/lib/ucpath/user.rb +++ b/lib/ucpath/user.rb @@ -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 diff --git a/spec/lib/ucpath_spec.rb b/spec/lib/ucpath_spec.rb index 5dd4fc8..fa984e9 100644 --- a/spec/lib/ucpath_spec.rb +++ b/spec/lib/ucpath_spec.rb @@ -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) end context "when hr_status_code is not 'A'" do From c72d4b5bcee89f52e61c6b9cd64b6b7d5f17ed36 Mon Sep 17 00:00:00 2001 From: Steve Sullivan Date: Mon, 30 Mar 2026 17:23:05 -0700 Subject: [PATCH 2/3] Add test for skip_fte_check? --- spec/lib/config_spec.rb | 54 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 4 deletions(-) diff --git a/spec/lib/config_spec.rb b/spec/lib/config_spec.rb index 62a7eca..8113c7e 100644 --- a/spec/lib/config_spec.rb +++ b/spec/lib/config_spec.rb @@ -1,11 +1,57 @@ # frozen_string_literal: true +# rubocop:disable Metrics/BlockLength describe Config do - it 'help returns help' do - expect(Config.help).to start_with('Alma User Load Usage:') + describe '.help' do + it 'returns help' do + expect(Config.help).to start_with('Alma User Load Usage:') + end end - it 'config setting for change log days is 7' do - expect(Config.setting('change_log_days')).to eq(7) + describe '.setting' do + it 'returns change log days as 7' do + expect(Config.setting('change_log_days')).to eq(7) + end end end + +describe Config do + describe '.skip_fte_check?' do + let(:job_code) { 'TEST_CODE' } + + before do + allow(Config).to receive(:check_ucpath_code).and_return(false) + end + + context 'when job_code is in fte_check_exclusions' do + before do + allow(Config).to receive(:check_ucpath_code) + .with('fte_check_exclusions', job_code) + .and_return(true) + end + + it 'returns true' do + expect(Config.skip_fte_check?(job_code)).to be(true) + end + end + + context 'when job_code is in emeritus_job_code' do + before do + allow(Config).to receive(:check_ucpath_code) + .with('emeritus_job_code', job_code) + .and_return(true) + end + + it 'returns true' do + expect(Config.skip_fte_check?(job_code)).to be(true) + end + end + + context 'when job_code is in neither list' do + it 'returns false' do + expect(Config.skip_fte_check?(job_code)).to be(false) + end + end + end +end +# rubocop:enable Metrics/BlockLength From c14935a06da1bac612c573bfb21fb2377113125e Mon Sep 17 00:00:00 2001 From: Steve Sullivan Date: Tue, 31 Mar 2026 09:31:51 -0700 Subject: [PATCH 3/3] Adding some integration tests for the fte check --- spec/lib/config_spec.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/spec/lib/config_spec.rb b/spec/lib/config_spec.rb index 8113c7e..a847e45 100644 --- a/spec/lib/config_spec.rb +++ b/spec/lib/config_spec.rb @@ -54,4 +54,20 @@ end end end + +describe Config do + describe '.skip_fte_check? (with real config values)' do + it 'returns true for a job code in fte_check_exclusions' do + expect(Config.skip_fte_check?('CWR016')).to be(true) + end + + it 'returns true for a job code in emeritus_job_code' do + expect(Config.skip_fte_check?('009902')).to be(true) + end + + it 'returns false for a job code not in either list' do + expect(Config.skip_fte_check?('TOTALLY_FAKE_CODE')).to be(false) + end + end +end # rubocop:enable Metrics/BlockLength