xero-ruby icon indicating copy to clipboard operation
xero-ruby copied to clipboard

Unable to push future leave requests in NZ Payroll any longer

Open CyberFerret opened this issue 1 year ago • 3 comments

We are currently using version 4.3.0 of the xero-ruby gem, and recently noticed that we are no longer able to push leave applications that are future dated. Past dated leave applications still work OK, but our customers used to be able to push future dated ones as well, up until a few weeks ago.

The exception thrown by the gem is:

invalid value for "period_status", must be one of ["Approved", "Completed"].

and the backtrace is:

vendor/bundle/ruby/3.0.0/gems/xero-ruby-4.3.0/lib/xero-ruby/models/payroll_nz/leave_period.rb:127 period_status=
vendor/bundle/ruby/3.0.0/gems/xero-ruby-4.3.0/lib/xero-ruby/models/payroll_nz/leave_period.rb:175 block in build_from_hash
vendor/bundle/ruby/3.0.0/gems/xero-ruby-4.3.0/lib/xero-ruby/models/payroll_nz/leave_period.rb:167 each_pair
vendor/bundle/ruby/3.0.0/gems/xero-ruby-4.3.0/lib/xero-ruby/models/payroll_nz/leave_period.rb:167 build_from_hash
vendor/bundle/ruby/3.0.0/gems/xero-ruby-4.3.0/lib/xero-ruby/models/payroll_nz/leave_period.rb:159 build_from_hash
vendor/bundle/ruby/3.0.0/gems/xero-ruby-4.3.0/lib/xero-ruby/models/payroll_nz/leave_periods.rb:177 _deserialize
vendor/bundle/ruby/3.0.0/gems/xero-ruby-4.3.0/lib/xero-ruby/models/payroll_nz/leave_periods.rb:128 block (2 levels) in build_from_hash
vendor/bundle/ruby/3.0.0/gems/xero-ruby-4.3.0/lib/xero-ruby/models/payroll_nz/leave_periods.rb:128 map
vendor/bundle/ruby/3.0.0/gems/xero-ruby-4.3.0/lib/xero-ruby/models/payroll_nz/leave_periods.rb:128 block in build_from_hash
vendor/bundle/ruby/3.0.0/gems/xero-ruby-4.3.0/lib/xero-ruby/models/payroll_nz/leave_periods.rb:123 each_pair

Pushing future dated leave still seems to work via direct API calls so we are a bit puzzled as to why it is no longer working via the gem.

CyberFerret avatar May 19 '24 23:05 CyberFerret

PETOSS-423

github-actions[bot] avatar May 19 '24 23:05 github-actions[bot]

Thanks for raising an issue, a ticket has been created to track your request

github-actions[bot] avatar May 19 '24 23:05 github-actions[bot]

Update: Further investigation reveals that this exception happens when we are trying to read the NZ Leave Periods for further processing within our app. It looks like the gem doesn't know how to handle this property and store it in the returned object.

CyberFerret avatar May 28 '24 07:05 CyberFerret