Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions docs/payroll_uk/Employee.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Name | Type | Description | Notes
**payroll_calendar_id** | **String** | Xero unique identifier for the payroll calendar of the employee | [optional]
**updated_date_utc** | **DateTime** | UTC timestamp of last update to the employee | [optional]
**created_date_utc** | **DateTime** | UTC timestamp when the employee was created in Xero | [optional]
**ni_category** | [**NICategoryLetter**](NICategoryLetter.md) | | [optional]
**ni_categories** | [**Array<NICategory>**](NICategory.md) | The employee's NI categories | [optional]
**national_insurance_number** | **String** | National insurance number of the employee | [optional]
**is_off_payroll_worker** | **Boolean** | Whether the employee is an off payroll worker | [optional]

Expand All @@ -40,6 +42,8 @@ instance = XeroRuby::PayrollUk::Employee.new(employee_id: d90457c4-f1be-4f2e-b4e
payroll_calendar_id: null,
updated_date_utc: null,
created_date_utc: null,
ni_category: null,
ni_categories: null,
national_insurance_number: AB123456C,
is_off_payroll_worker: null)
```
Expand Down
6 changes: 4 additions & 2 deletions docs/payroll_uk/Employment.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Name | Type | Description | Notes
**payroll_calendar_id** | **String** | Xero unique identifier for the payroll calendar of the employee | [optional]
**start_date** | **Date** | Start date of the employment (YYYY-MM-DD) | [optional]
**employee_number** | **String** | The employment number of the employee | [optional]
**ni_category** | **String** | The NI Category of the employee | [optional]
**ni_category** | [**NICategoryLetter**](NICategoryLetter.md) | | [optional]
**ni_categories** | [**Array<NICategory>**](NICategory.md) | The employee's NI categories | [optional]

## Code Sample

Expand All @@ -17,7 +18,8 @@ require 'XeroRuby::PayrollUk'
instance = XeroRuby::PayrollUk::Employment.new(payroll_calendar_id: null,
start_date: null,
employee_number: 7,
ni_category: A)
ni_category: null,
ni_categories: null)
```


25 changes: 25 additions & 0 deletions docs/payroll_uk/NICategory.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# XeroRuby::PayrollUk::NICategory

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**start_date** | **Date** | The start date of the NI category (YYYY-MM-DD) | [optional]
**ni_category** | [**NICategoryLetter**](NICategoryLetter.md) | |
**ni_category_id** | **Float** | Xero unique identifier for the NI category | [optional]
**date_first_employed_as_civilian** | **Date** | The date in which the employee was first employed as a civilian (YYYY-MM-DD) | [optional]
**workplace_postcode** | **String** | The workplace postcode |

## Code Sample

```ruby
require 'XeroRuby::PayrollUk'

instance = XeroRuby::PayrollUk::NICategory.new(start_date: Mon Dec 02 00:00:00 GMT 2024,
ni_category: null,
ni_category_id: 15,
date_first_employed_as_civilian: Mon Dec 02 00:00:00 GMT 2024,
workplace_postcode: SW1A 1AA)
```


16 changes: 16 additions & 0 deletions docs/payroll_uk/NICategoryLetter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# XeroRuby::PayrollUk::NICategoryLetter

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

## Code Sample

```ruby
require 'XeroRuby::PayrollUk'

instance = XeroRuby::PayrollUk::NICategoryLetter.new()
```


17 changes: 17 additions & 0 deletions docs/payroll_uk/NICategoryOneOf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# XeroRuby::PayrollUk::NICategoryOneOf

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ni_category** | **String** | | [optional]

## Code Sample

```ruby
require 'XeroRuby::PayrollUk'

instance = XeroRuby::PayrollUk::NICategoryOneOf.new(ni_category: null)
```


17 changes: 17 additions & 0 deletions docs/payroll_uk/NICategoryOneOf1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# XeroRuby::PayrollUk::NICategoryOneOf1

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ni_category** | **String** | | [optional]

## Code Sample

```ruby
require 'XeroRuby::PayrollUk'

instance = XeroRuby::PayrollUk::NICategoryOneOf1.new(ni_category: null)
```


2 changes: 1 addition & 1 deletion docs/payroll_uk/PayrollUkApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ api_instance = xero_client.<api_set>

xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant
employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # String | Employee id for single object
employment = { "PayrollCalendarID": "216d80e6-af55-47b1-b718-9457c3f5d2fe", "StartDate": "2020-04-01", "EmployeeNumber": "123ABC", "NICategory": "A" } # Employment |
employment = { "PayrollCalendarID": "216d80e6-af55-47b1-b718-9457c3f5d2fe", "StartDate": "2020-04-01", "NICategories": [ { "NICategory": "A", "StartDate": "2020-05-01" } ], "EmployeeNumber": "123ABC" } # Employment |
opts = {
idempotency_key: 'KEY_VALUE' # String | This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
}
Expand Down
97 changes: 91 additions & 6 deletions docs/payroll_uk/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1595,6 +1595,16 @@
"format" : "date-time",
"x-is-datetime" : true
},
"niCategory" : {
"$ref" : "#/components/schemas/NICategoryLetter"
},
"niCategories" : {
"type" : "array",
"description" : "The employee's NI categories",
"items" : {
"$ref" : "#/components/schemas/NICategory"
}
},
"nationalInsuranceNumber" : {
"type" : "string",
"description" : "National insurance number of the employee",
Expand Down Expand Up @@ -2262,7 +2272,7 @@
};
defs["Employment"] = {
"title" : "",
"required" : [ "EmployeeNumber", "NICategory", "PayrollCalendarID", "StartDate" ],
"required" : [ "EmployeeNumber", "NICategories", "PayrollCalendarID", "StartDate" ],
"type" : "object",
"properties" : {
"payrollCalendarID" : {
Expand All @@ -2282,10 +2292,14 @@
"example" : "7"
},
"niCategory" : {
"type" : "string",
"description" : "The NI Category of the employee",
"example" : "A",
"enum" : [ "A", "B", "C", "F", "H", "I", "J", "L", "M", "S", "V", "X", "Z" ]
"$ref" : "#/components/schemas/NICategoryLetter"
},
"niCategories" : {
"type" : "array",
"description" : "The employee's NI categories",
"items" : {
"$ref" : "#/components/schemas/NICategory"
}
}
},
"description" : ""
Expand Down Expand Up @@ -2502,6 +2516,75 @@
}
},
"description" : ""
};
defs["NICategory"] = {
"title" : "",
"required" : [ "niCategory", "workplacePostcode" ],
"type" : "object",
"properties" : {
"startDate" : {
"type" : "string",
"description" : "The start date of the NI category (YYYY-MM-DD)",
"format" : "date",
"example" : "2024-12-02",
"x-is-date" : true
},
"niCategory" : {
"$ref" : "#/components/schemas/NICategoryLetter"
},
"niCategoryID" : {
"type" : "number",
"description" : "Xero unique identifier for the NI category",
"example" : 15
},
"dateFirstEmployedAsCivilian" : {
"type" : "string",
"description" : "The date in which the employee was first employed as a civilian (YYYY-MM-DD)",
"format" : "date",
"example" : "2024-12-02",
"x-is-date" : true
},
"workplacePostcode" : {
"type" : "string",
"description" : "The workplace postcode",
"example" : "SW1A 1AA"
}
},
"description" : "",
"oneOf" : [ {
"$ref" : "#/components/schemas/NICategory_oneOf"
}, {
"$ref" : "#/components/schemas/NICategory_oneOf_1"
} ]
};
defs["NICategoryLetter"] = {
"title" : "",
"type" : "string",
"description" : "The employee's NI Category letter.",
"example" : "I",
"enum" : [ "A", "B", "C", "D", "E", "F", "H", "I", "J", "K", "L", "M", "N", "S", "V", "X", "Z" ]
};
defs["NICategory_oneOf"] = {
"title" : "",
"required" : [ "workplacePostcode" ],
"properties" : {
"niCategory" : {
"type" : "string",
"enum" : [ "F", "I", "L", "S", "N", "E", "D", "K" ]
}
},
"description" : ""
};
defs["NICategory_oneOf_1"] = {
"title" : "",
"required" : [ "dateFirstEmployedAsCivilian" ],
"properties" : {
"niCategory" : {
"type" : "string",
"enum" : [ "V" ]
}
},
"description" : ""
};
defs["Pagination"] = {
"title" : "",
Expand Down Expand Up @@ -5714,6 +5797,8 @@ <h3>Usage and SDK Samples</h3>
start_date: start_date
}

ni_categories = {

begin
response = xero_client.accounting_api.create_employment(xero_tenant_id, employee_id, employment, idempotency_key)
return response
Expand Down Expand Up @@ -5845,7 +5930,7 @@ <h2>Parameters</h2>
"schema" : {
"$ref" : "#/components/schemas/Employment"
},
"example" : "{ \"PayrollCalendarID\": \"216d80e6-af55-47b1-b718-9457c3f5d2fe\", \"StartDate\": \"2020-04-01\", \"EmployeeNumber\": \"123ABC\", \"NICategory\": \"A\" }"
"example" : "{ \"PayrollCalendarID\": \"216d80e6-af55-47b1-b718-9457c3f5d2fe\", \"StartDate\": \"2020-04-01\", \"NICategories\": [ { \"NICategory\": \"A\", \"StartDate\": \"2020-05-01\" } ], \"EmployeeNumber\": \"123ABC\" }"
}
},
"required" : true
Expand Down
4 changes: 4 additions & 0 deletions lib/xero-ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@
require 'xero-ruby/models/payroll_uk/leave_type'
require 'xero-ruby/models/payroll_uk/leave_type_object'
require 'xero-ruby/models/payroll_uk/leave_types'
require 'xero-ruby/models/payroll_uk/ni_category'
require 'xero-ruby/models/payroll_uk/ni_category_letter'
require 'xero-ruby/models/payroll_uk/ni_category_one_of'
require 'xero-ruby/models/payroll_uk/ni_category_one_of1'
require 'xero-ruby/models/payroll_uk/pagination'
require 'xero-ruby/models/payroll_uk/pay_run'
require 'xero-ruby/models/payroll_uk/pay_run_calendar'
Expand Down
24 changes: 23 additions & 1 deletion lib/xero-ruby/models/payroll_uk/employee.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ class Employee
# UTC timestamp when the employee was created in Xero
attr_accessor :created_date_utc


attr_accessor :ni_category

# The employee's NI categories
attr_accessor :ni_categories

# National insurance number of the employee
attr_accessor :national_insurance_number

Expand Down Expand Up @@ -105,6 +111,8 @@ def self.attribute_map
:'payroll_calendar_id' => :'payrollCalendarID',
:'updated_date_utc' => :'updatedDateUTC',
:'created_date_utc' => :'createdDateUTC',
:'ni_category' => :'niCategory',
:'ni_categories' => :'niCategories',
:'national_insurance_number' => :'nationalInsuranceNumber',
:'is_off_payroll_worker' => :'isOffPayrollWorker'
}
Expand All @@ -127,6 +135,8 @@ def self.openapi_types
:'payroll_calendar_id' => :'String',
:'updated_date_utc' => :'DateTime',
:'created_date_utc' => :'DateTime',
:'ni_category' => :'NICategoryLetter',
:'ni_categories' => :'Array<NICategory>',
:'national_insurance_number' => :'String',
:'is_off_payroll_worker' => :'Boolean'
}
Expand Down Expand Up @@ -203,6 +213,16 @@ def initialize(attributes = {})
self.created_date_utc = attributes[:'created_date_utc']
end

if attributes.key?(:'ni_category')
self.ni_category = attributes[:'ni_category']
end

if attributes.key?(:'ni_categories')
if (value = attributes[:'ni_categories']).is_a?(Array)
self.ni_categories = value
end
end

if attributes.key?(:'national_insurance_number')
self.national_insurance_number = attributes[:'national_insurance_number']
end
Expand Down Expand Up @@ -256,6 +276,8 @@ def ==(o)
payroll_calendar_id == o.payroll_calendar_id &&
updated_date_utc == o.updated_date_utc &&
created_date_utc == o.created_date_utc &&
ni_category == o.ni_category &&
ni_categories == o.ni_categories &&
national_insurance_number == o.national_insurance_number &&
is_off_payroll_worker == o.is_off_payroll_worker
end
Expand All @@ -269,7 +291,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[employee_id, title, first_name, last_name, date_of_birth, address, email, gender, phone_number, start_date, end_date, payroll_calendar_id, updated_date_utc, created_date_utc, national_insurance_number, is_off_payroll_worker].hash
[employee_id, title, first_name, last_name, date_of_birth, address, email, gender, phone_number, start_date, end_date, payroll_calendar_id, updated_date_utc, created_date_utc, ni_category, ni_categories, national_insurance_number, is_off_payroll_worker].hash
end

# Builds the object from hash
Expand Down
Loading