Skip to content

Commit 8f6930a

Browse files
author
sangeet-joy_xero
committed
PETOSS-712 | Ni category updates from OpenAPI
1 parent 4d950ab commit 8f6930a

16 files changed

+617
-37
lines changed

Diff for: docs/v1/payroll-uk/index.html

+91-6
Original file line numberDiff line numberDiff line change
@@ -1595,6 +1595,16 @@
15951595
"format" : "date-time",
15961596
"x-is-datetime" : true
15971597
},
1598+
"niCategory" : {
1599+
"$ref" : "#/components/schemas/NICategoryLetter"
1600+
},
1601+
"niCategories" : {
1602+
"type" : "array",
1603+
"description" : "The employee's NI categories",
1604+
"items" : {
1605+
"$ref" : "#/components/schemas/NICategory"
1606+
}
1607+
},
15981608
"nationalInsuranceNumber" : {
15991609
"type" : "string",
16001610
"description" : "National insurance number of the employee",
@@ -2262,7 +2272,7 @@
22622272
};
22632273
defs["Employment"] = {
22642274
"title" : "",
2265-
"required" : [ "EmployeeNumber", "NICategory", "PayrollCalendarID", "StartDate" ],
2275+
"required" : [ "EmployeeNumber", "NICategories", "PayrollCalendarID", "StartDate" ],
22662276
"type" : "object",
22672277
"properties" : {
22682278
"payrollCalendarID" : {
@@ -2282,10 +2292,14 @@
22822292
"example" : "7"
22832293
},
22842294
"niCategory" : {
2285-
"type" : "string",
2286-
"description" : "The NI Category of the employee",
2287-
"example" : "A",
2288-
"enum" : [ "A", "B", "C", "F", "H", "I", "J", "L", "M", "S", "V", "X", "Z" ]
2295+
"$ref" : "#/components/schemas/NICategoryLetter"
2296+
},
2297+
"niCategories" : {
2298+
"type" : "array",
2299+
"description" : "The employee's NI categories",
2300+
"items" : {
2301+
"$ref" : "#/components/schemas/NICategory"
2302+
}
22892303
}
22902304
},
22912305
"description" : ""
@@ -2502,6 +2516,75 @@
25022516
}
25032517
},
25042518
"description" : ""
2519+
};
2520+
defs["NICategory"] = {
2521+
"title" : "",
2522+
"required" : [ "niCategory", "workplacePostcode" ],
2523+
"type" : "object",
2524+
"properties" : {
2525+
"startDate" : {
2526+
"type" : "string",
2527+
"description" : "The start date of the NI category (YYYY-MM-DD)",
2528+
"format" : "date",
2529+
"example" : "2024-12-02",
2530+
"x-is-date" : true
2531+
},
2532+
"niCategory" : {
2533+
"$ref" : "#/components/schemas/NICategoryLetter"
2534+
},
2535+
"niCategoryID" : {
2536+
"type" : "number",
2537+
"description" : "Xero unique identifier for the NI category",
2538+
"example" : 15
2539+
},
2540+
"dateFirstEmployedAsCivilian" : {
2541+
"type" : "string",
2542+
"description" : "The date in which the employee was first employed as a civilian (YYYY-MM-DD)",
2543+
"format" : "date",
2544+
"example" : "2024-12-02",
2545+
"x-is-date" : true
2546+
},
2547+
"workplacePostcode" : {
2548+
"type" : "string",
2549+
"description" : "The workplace postcode",
2550+
"example" : "SW1A 1AA"
2551+
}
2552+
},
2553+
"description" : "",
2554+
"oneOf" : [ {
2555+
"$ref" : "#/components/schemas/NICategory_oneOf"
2556+
}, {
2557+
"$ref" : "#/components/schemas/NICategory_oneOf_1"
2558+
} ]
2559+
};
2560+
defs["NICategoryLetter"] = {
2561+
"title" : "",
2562+
"type" : "string",
2563+
"description" : "The employee's NI Category letter.",
2564+
"example" : "I",
2565+
"enum" : [ "A", "B", "C", "D", "E", "F", "H", "I", "J", "K", "L", "M", "N", "S", "V", "X", "Z" ]
2566+
};
2567+
defs["NICategory_oneOf"] = {
2568+
"title" : "",
2569+
"required" : [ "workplacePostcode" ],
2570+
"properties" : {
2571+
"niCategory" : {
2572+
"type" : "string",
2573+
"enum" : [ "F", "I", "L", "S", "N", "E", "D", "K" ]
2574+
}
2575+
},
2576+
"description" : ""
2577+
};
2578+
defs["NICategory_oneOf_1"] = {
2579+
"title" : "",
2580+
"required" : [ "dateFirstEmployedAsCivilian" ],
2581+
"properties" : {
2582+
"niCategory" : {
2583+
"type" : "string",
2584+
"enum" : [ "V" ]
2585+
}
2586+
},
2587+
"description" : ""
25052588
};
25062589
defs["Pagination"] = {
25072590
"title" : "",
@@ -5846,6 +5929,8 @@ <h3>Usage and SDK Samples</h3>
58465929
employment = Employment(
58475930
payroll_calendar_id = "00000000-0000-0000-0000-000000000000",
58485931
start_date = start_date)
5932+
5933+
ni_categories = NICategories(
58495934

58505935
try:
58515936
api_response = api_instance.create_employment(xero_tenant_id, employee_id, employment, idempotency_key)
@@ -5976,7 +6061,7 @@ <h2>Parameters</h2>
59766061
"schema" : {
59776062
"$ref" : "#/components/schemas/Employment"
59786063
},
5979-
"example" : "{ \"PayrollCalendarID\": \"216d80e6-af55-47b1-b718-9457c3f5d2fe\", \"StartDate\": \"2020-04-01\", \"EmployeeNumber\": \"123ABC\", \"NICategory\": \"A\" }"
6064+
"example" : "{ \"PayrollCalendarID\": \"216d80e6-af55-47b1-b718-9457c3f5d2fe\", \"StartDate\": \"2020-04-01\", \"NICategories\": [ { \"NICategory\": \"A\", \"StartDate\": \"2020-05-01\" } ], \"EmployeeNumber\": \"123ABC\" }"
59806065
}
59816066
},
59826067
"required" : true

Diff for: xero_python/payrolluk/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@
9696
from xero_python.payrolluk.models.leave_type import LeaveType
9797
from xero_python.payrolluk.models.leave_type_object import LeaveTypeObject
9898
from xero_python.payrolluk.models.leave_types import LeaveTypes
99+
from xero_python.payrolluk.models.ni_category import NICategory
100+
from xero_python.payrolluk.models.ni_category_letter import NICategoryLetter
101+
from xero_python.payrolluk.models.ni_category_one_of import NICategoryOneOf
102+
from xero_python.payrolluk.models.ni_category_one_of1 import NICategoryOneOf1
99103
from xero_python.payrolluk.models.pagination import Pagination
100104
from xero_python.payrolluk.models.pay_run import PayRun
101105
from xero_python.payrolluk.models.pay_run_calendar import PayRunCalendar

Diff for: xero_python/payrolluk/docs/Employee.md

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ Name | Type | Description | Notes
1717
**payroll_calendar_id** | **str** | Xero unique identifier for the payroll calendar of the employee | [optional]
1818
**updated_date_utc** | **datetime** | UTC timestamp of last update to the employee | [optional]
1919
**created_date_utc** | **datetime** | UTC timestamp when the employee was created in Xero | [optional]
20+
**ni_category** | [**NICategoryLetter**](NICategoryLetter.md) | | [optional]
21+
**ni_categories** | [**list[NICategory]**](NICategory.md) | The employee&#39;s NI categories | [optional]
2022
**national_insurance_number** | **str** | National insurance number of the employee | [optional]
2123
**is_off_payroll_worker** | **bool** | Whether the employee is an off payroll worker | [optional]
2224

Diff for: xero_python/payrolluk/docs/Employment.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ Name | Type | Description | Notes
66
**payroll_calendar_id** | **str** | Xero unique identifier for the payroll calendar of the employee | [optional]
77
**start_date** | **date** | Start date of the employment (YYYY-MM-DD) | [optional]
88
**employee_number** | **str** | The employment number of the employee | [optional]
9-
**ni_category** | **str** | The NI Category of the employee | [optional]
9+
**ni_category** | [**NICategoryLetter**](NICategoryLetter.md) | | [optional]
10+
**ni_categories** | [**list[NICategory]**](NICategory.md) | The employee&#39;s NI categories | [optional]
1011

1112
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1213

Diff for: xero_python/payrolluk/docs/NICategory.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# NICategory
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**start_date** | **date** | The start date of the NI category (YYYY-MM-DD) | [optional]
7+
**ni_category** | [**NICategoryLetter**](NICategoryLetter.md) | |
8+
**ni_category_id** | **float** | Xero unique identifier for the NI category | [optional]
9+
**date_first_employed_as_civilian** | **date** | The date in which the employee was first employed as a civilian (YYYY-MM-DD) | [optional]
10+
**workplace_postcode** | **str** | The workplace postcode |
11+
12+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
13+
14+

Diff for: xero_python/payrolluk/docs/NICategoryLetter.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# NICategoryLetter
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
7+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
8+
9+

Diff for: xero_python/payrolluk/docs/NICategoryOneOf.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# NICategoryOneOf
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**ni_category** | **str** | | [optional]
7+
8+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
9+
10+

Diff for: xero_python/payrolluk/docs/NICategoryOneOf1.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# NICategoryOneOf1
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**ni_category** | **str** | | [optional]
7+
8+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
9+
10+

Diff for: xero_python/payrolluk/docs/PayrollUkApi.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ api_instance = PayrollUkApi(api_client)
901901

902902
xero_tenant_id = 'xero_tenant_id_example' # str | Xero identifier for Tenant
903903
employee_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c' # str | Employee id for single object
904-
employment = { "PayrollCalendarID": "216d80e6-af55-47b1-b718-9457c3f5d2fe", "StartDate": "2020-04-01", "EmployeeNumber": "123ABC", "NICategory": "A" } # Employment |
904+
employment = { "PayrollCalendarID": "216d80e6-af55-47b1-b718-9457c3f5d2fe", "StartDate": "2020-04-01", "NICategories": [ { "NICategory": "A", "StartDate": "2020-05-01" } ], "EmployeeNumber": "123ABC" } # Employment |
905905
idempotency_key = 'KEY_VALUE' # str | This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional)
906906
try:
907907
# Creates employment detail for a specific employee using a unique employee ID

Diff for: xero_python/payrolluk/models/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@
9191
from xero_python.payrolluk.models.leave_type import LeaveType
9292
from xero_python.payrolluk.models.leave_type_object import LeaveTypeObject
9393
from xero_python.payrolluk.models.leave_types import LeaveTypes
94+
from xero_python.payrolluk.models.ni_category import NICategory
95+
from xero_python.payrolluk.models.ni_category_letter import NICategoryLetter
96+
from xero_python.payrolluk.models.ni_category_one_of import NICategoryOneOf
97+
from xero_python.payrolluk.models.ni_category_one_of1 import NICategoryOneOf1
9498
from xero_python.payrolluk.models.pagination import Pagination
9599
from xero_python.payrolluk.models.pay_run import PayRun
96100
from xero_python.payrolluk.models.pay_run_calendar import PayRunCalendar

Diff for: xero_python/payrolluk/models/employee.py

+56
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ class Employee(BaseModel):
4444
"payroll_calendar_id": "str",
4545
"updated_date_utc": "datetime",
4646
"created_date_utc": "datetime",
47+
"ni_category": "NICategoryLetter",
48+
"ni_categories": "list[NICategory]",
4749
"national_insurance_number": "str",
4850
"is_off_payroll_worker": "bool",
4951
}
@@ -63,6 +65,8 @@ class Employee(BaseModel):
6365
"payroll_calendar_id": "payrollCalendarID",
6466
"updated_date_utc": "updatedDateUTC",
6567
"created_date_utc": "createdDateUTC",
68+
"ni_category": "niCategory",
69+
"ni_categories": "niCategories",
6670
"national_insurance_number": "nationalInsuranceNumber",
6771
"is_off_payroll_worker": "isOffPayrollWorker",
6872
}
@@ -83,6 +87,8 @@ def __init__(
8387
payroll_calendar_id=None,
8488
updated_date_utc=None,
8589
created_date_utc=None,
90+
ni_category=None,
91+
ni_categories=None,
8692
national_insurance_number=None,
8793
is_off_payroll_worker=None,
8894
): # noqa: E501
@@ -102,6 +108,8 @@ def __init__(
102108
self._payroll_calendar_id = None
103109
self._updated_date_utc = None
104110
self._created_date_utc = None
111+
self._ni_category = None
112+
self._ni_categories = None
105113
self._national_insurance_number = None
106114
self._is_off_payroll_worker = None
107115
self.discriminator = None
@@ -134,6 +142,10 @@ def __init__(
134142
self.updated_date_utc = updated_date_utc
135143
if created_date_utc is not None:
136144
self.created_date_utc = created_date_utc
145+
if ni_category is not None:
146+
self.ni_category = ni_category
147+
if ni_categories is not None:
148+
self.ni_categories = ni_categories
137149
if national_insurance_number is not None:
138150
self.national_insurance_number = national_insurance_number
139151
if is_off_payroll_worker is not None:
@@ -468,6 +480,50 @@ def created_date_utc(self, created_date_utc):
468480

469481
self._created_date_utc = created_date_utc
470482

483+
@property
484+
def ni_category(self):
485+
"""Gets the ni_category of this Employee. # noqa: E501
486+
487+
488+
:return: The ni_category of this Employee. # noqa: E501
489+
:rtype: NICategoryLetter
490+
"""
491+
return self._ni_category
492+
493+
@ni_category.setter
494+
def ni_category(self, ni_category):
495+
"""Sets the ni_category of this Employee.
496+
497+
498+
:param ni_category: The ni_category of this Employee. # noqa: E501
499+
:type: NICategoryLetter
500+
"""
501+
502+
self._ni_category = ni_category
503+
504+
@property
505+
def ni_categories(self):
506+
"""Gets the ni_categories of this Employee. # noqa: E501
507+
508+
The employee's NI categories # noqa: E501
509+
510+
:return: The ni_categories of this Employee. # noqa: E501
511+
:rtype: list[NICategory]
512+
"""
513+
return self._ni_categories
514+
515+
@ni_categories.setter
516+
def ni_categories(self, ni_categories):
517+
"""Sets the ni_categories of this Employee.
518+
519+
The employee's NI categories # noqa: E501
520+
521+
:param ni_categories: The ni_categories of this Employee. # noqa: E501
522+
:type: list[NICategory]
523+
"""
524+
525+
self._ni_categories = ni_categories
526+
471527
@property
472528
def national_insurance_number(self):
473529
"""Gets the national_insurance_number of this Employee. # noqa: E501

0 commit comments

Comments
 (0)