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

The NZ and UK Payroll API has differing methods to call the Pay Templates

Open CyberFerret opened this issue 4 years ago • 1 comments

An inconsistency in the methods used to call the Pay Templates in the NZ and UK payroll API is causing our code to be longer than expected due to having to add conditionals to cater for the difference.

In the NZ Payroll, the method is:

response = xero_client.accounting_api.get_employee_pay_templates(xeroTenantId, employeeID)

whereas in the UK Payroll, the method is:

response = xero_client.accounting_api.get_employee_pay_template(xeroTenantId, employeeID)

(notice the missing plural 's' in get_employe_pay_template the UK variant).

Both of these call the same endpoint of /Employees/{EmployeeID}/PayTemplates, which is pluralised, so I would expect that the methods would be consistently plural for both.

CyberFerret avatar Jun 03 '21 23:06 CyberFerret

Hey @CyberFerret - yeah this could be consolidated. Screen Shot 2021-06-04 at 10 36 36 AM

However technically there is only one pay template per employee so maybe we consolidate to get_employee_pay_template

SerKnight avatar Jun 04 '21 16:06 SerKnight