Skip to content

Commit 9c582e0

Browse files
author
sangeet-joy_xero
committed
PETOSS-712 - changes for NI category updates from openAPI
1 parent c320b29 commit 9c582e0

File tree

8 files changed

+268
-27
lines changed

8 files changed

+268
-27
lines changed

docs/payroll-uk/index.html

Lines changed: 91 additions & 6 deletions
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" : "",
@@ -5715,6 +5798,8 @@ <h3>Usage and SDK Samples</h3>
57155798
startDate: startDate
57165799
};
57175800

5801+
const niCategories: NICategories = {
5802+
57185803
try {
57195804
const response = await xero.accountingApi.createEmployment(xeroTenantId, employeeID, employment, idempotencyKey);
57205805
console.log(response.body || response.response.statusCode)
@@ -5846,7 +5931,7 @@ <h2>Parameters</h2>
58465931
"schema" : {
58475932
"$ref" : "#/components/schemas/Employment"
58485933
},
5849-
"example" : "{ \"PayrollCalendarID\": \"216d80e6-af55-47b1-b718-9457c3f5d2fe\", \"StartDate\": \"2020-04-01\", \"EmployeeNumber\": \"123ABC\", \"NICategory\": \"A\" }"
5934+
"example" : "{ \"PayrollCalendarID\": \"216d80e6-af55-47b1-b718-9457c3f5d2fe\", \"StartDate\": \"2020-04-01\", \"NICategories\": [ { \"NICategory\": \"A\", \"StartDate\": \"2020-05-01\" } ], \"EmployeeNumber\": \"123ABC\" }"
58505935
}
58515936
},
58525937
"required" : true

src/gen/model/payroll-uk/employee.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import { Address } from '././address';
2+
import { NICategory } from '././nICategory';
3+
import { NICategoryLetter } from '././nICategoryLetter';
24

35
export class Employee {
46
/**
@@ -54,6 +56,11 @@ export class Employee {
5456
* UTC timestamp when the employee was created in Xero
5557
*/
5658
'createdDateUTC'?: Date;
59+
'niCategory'?: NICategoryLetter;
60+
/**
61+
* The employee\'s NI categories
62+
*/
63+
'niCategories'?: Array<NICategory>;
5764
/**
5865
* National insurance number of the employee
5966
*/
@@ -136,6 +143,16 @@ export class Employee {
136143
"baseName": "createdDateUTC",
137144
"type": "Date"
138145
},
146+
{
147+
"name": "niCategory",
148+
"baseName": "niCategory",
149+
"type": "NICategoryLetter"
150+
},
151+
{
152+
"name": "niCategories",
153+
"baseName": "niCategories",
154+
"type": "Array<NICategory>"
155+
},
139156
{
140157
"name": "nationalInsuranceNumber",
141158
"baseName": "nationalInsuranceNumber",

src/gen/model/payroll-uk/employment.ts

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { NICategory } from '././nICategory';
2+
import { NICategoryLetter } from '././nICategoryLetter';
13

24
export class Employment {
35
/**
@@ -12,10 +14,11 @@ export class Employment {
1214
* The employment number of the employee
1315
*/
1416
'employeeNumber'?: string;
17+
'niCategory'?: NICategoryLetter;
1518
/**
16-
* The NI Category of the employee
19+
* The employee\'s NI categories
1720
*/
18-
'niCategory'?: Employment.NiCategoryEnum;
21+
'niCategories'?: Array<NICategory>;
1922

2023
static discriminator: string | undefined = undefined;
2124

@@ -38,28 +41,16 @@ export class Employment {
3841
{
3942
"name": "niCategory",
4043
"baseName": "niCategory",
41-
"type": "Employment.NiCategoryEnum"
44+
"type": "NICategoryLetter"
45+
},
46+
{
47+
"name": "niCategories",
48+
"baseName": "niCategories",
49+
"type": "Array<NICategory>"
4250
} ];
4351

4452
static getAttributeTypeMap() {
4553
return Employment.attributeTypeMap;
4654
}
4755
}
4856

49-
export namespace Employment {
50-
export enum NiCategoryEnum {
51-
A = <any> 'A',
52-
B = <any> 'B',
53-
C = <any> 'C',
54-
F = <any> 'F',
55-
H = <any> 'H',
56-
I = <any> 'I',
57-
J = <any> 'J',
58-
L = <any> 'L',
59-
M = <any> 'M',
60-
S = <any> 'S',
61-
V = <any> 'V',
62-
X = <any> 'X',
63-
Z = <any> 'Z'
64-
}
65-
}

src/gen/model/payroll-uk/models.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ export * from '././leavePeriods';
5555
export * from '././leaveType';
5656
export * from '././leaveTypeObject';
5757
export * from '././leaveTypes';
58+
export * from '././nICategory';
59+
export * from '././nICategoryLetter';
60+
export * from '././nICategoryOneOf';
61+
export * from '././nICategoryOneOf1';
5862
export * from '././pagination';
5963
export * from '././payRun';
6064
export * from '././payRunCalendar';
@@ -146,6 +150,10 @@ import { LeavePeriods } from '././leavePeriods';
146150
import { LeaveType } from '././leaveType';
147151
import { LeaveTypeObject } from '././leaveTypeObject';
148152
import { LeaveTypes } from '././leaveTypes';
153+
import { NICategory } from '././nICategory';
154+
import { NICategoryLetter } from '././nICategoryLetter';
155+
import { NICategoryOneOf } from '././nICategoryOneOf';
156+
import { NICategoryOneOf1 } from '././nICategoryOneOf1';
149157
import { Pagination } from '././pagination';
150158
import { PayRun } from '././payRun';
151159
import { PayRunCalendar } from '././payRunCalendar';
@@ -207,8 +215,10 @@ let enumsMap: {[index: string]: any} = {
207215
"EmployeeStatutoryLeaveSummary.TypeEnum": EmployeeStatutoryLeaveSummary.TypeEnum,
208216
"EmployeeStatutoryLeaveSummary.StatusEnum": EmployeeStatutoryLeaveSummary.StatusEnum,
209217
"EmployeeStatutorySickLeave.EntitlementFailureReasonsEnum": EmployeeStatutorySickLeave.EntitlementFailureReasonsEnum,
210-
"Employment.NiCategoryEnum": Employment.NiCategoryEnum,
211218
"LeavePeriod.PeriodStatusEnum": LeavePeriod.PeriodStatusEnum,
219+
"NICategoryLetter": NICategoryLetter,
220+
"NICategoryOneOf.NiCategoryEnum": NICategoryOneOf.NiCategoryEnum,
221+
"NICategoryOneOf1.NiCategoryEnum": NICategoryOneOf1.NiCategoryEnum,
212222
"PayRun.PayRunStatusEnum": PayRun.PayRunStatusEnum,
213223
"PayRun.PayRunTypeEnum": PayRun.PayRunTypeEnum,
214224
"PayRun.CalendarTypeEnum": PayRun.CalendarTypeEnum,
@@ -279,6 +289,9 @@ let typeMap: {[index: string]: any} = {
279289
"LeaveType": LeaveType,
280290
"LeaveTypeObject": LeaveTypeObject,
281291
"LeaveTypes": LeaveTypes,
292+
"NICategory": NICategory,
293+
"NICategoryOneOf": NICategoryOneOf,
294+
"NICategoryOneOf1": NICategoryOneOf1,
282295
"Pagination": Pagination,
283296
"PayRun": PayRun,
284297
"PayRunCalendar": PayRunCalendar,
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import { NICategoryLetter } from '././nICategoryLetter';
2+
import { NICategoryOneOf } from '././nICategoryOneOf';
3+
import { NICategoryOneOf1 } from '././nICategoryOneOf1';
4+
5+
export class NICategory {
6+
/**
7+
* The start date of the NI category (YYYY-MM-DD)
8+
*/
9+
'startDate'?: string;
10+
'niCategory': NICategoryLetter;
11+
/**
12+
* Xero unique identifier for the NI category
13+
*/
14+
'niCategoryID'?: number;
15+
/**
16+
* The date in which the employee was first employed as a civilian (YYYY-MM-DD)
17+
*/
18+
'dateFirstEmployedAsCivilian'?: string;
19+
/**
20+
* The workplace postcode
21+
*/
22+
'workplacePostcode': string;
23+
24+
static discriminator: string | undefined = undefined;
25+
26+
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
27+
{
28+
"name": "startDate",
29+
"baseName": "startDate",
30+
"type": "string"
31+
},
32+
{
33+
"name": "niCategory",
34+
"baseName": "niCategory",
35+
"type": "NICategoryLetter"
36+
},
37+
{
38+
"name": "niCategoryID",
39+
"baseName": "niCategoryID",
40+
"type": "number"
41+
},
42+
{
43+
"name": "dateFirstEmployedAsCivilian",
44+
"baseName": "dateFirstEmployedAsCivilian",
45+
"type": "string"
46+
},
47+
{
48+
"name": "workplacePostcode",
49+
"baseName": "workplacePostcode",
50+
"type": "string"
51+
} ];
52+
53+
static getAttributeTypeMap() {
54+
return NICategory.attributeTypeMap;
55+
}
56+
}
57+
58+
export namespace NICategory {
59+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
/**
3+
* The employee\'s NI Category letter.
4+
*/
5+
export enum NICategoryLetter {
6+
A = <any> 'A',
7+
B = <any> 'B',
8+
C = <any> 'C',
9+
D = <any> 'D',
10+
E = <any> 'E',
11+
F = <any> 'F',
12+
H = <any> 'H',
13+
I = <any> 'I',
14+
J = <any> 'J',
15+
K = <any> 'K',
16+
L = <any> 'L',
17+
M = <any> 'M',
18+
N = <any> 'N',
19+
S = <any> 'S',
20+
V = <any> 'V',
21+
X = <any> 'X',
22+
Z = <any> 'Z'
23+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
export class NICategoryOneOf {
3+
'niCategory'?: NICategoryOneOf.NiCategoryEnum;
4+
5+
static discriminator: string | undefined = undefined;
6+
7+
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
8+
{
9+
"name": "niCategory",
10+
"baseName": "niCategory",
11+
"type": "NICategoryOneOf.NiCategoryEnum"
12+
} ];
13+
14+
static getAttributeTypeMap() {
15+
return NICategoryOneOf.attributeTypeMap;
16+
}
17+
}
18+
19+
export namespace NICategoryOneOf {
20+
export enum NiCategoryEnum {
21+
F = <any> 'F',
22+
I = <any> 'I',
23+
L = <any> 'L',
24+
S = <any> 'S',
25+
N = <any> 'N',
26+
E = <any> 'E',
27+
D = <any> 'D',
28+
K = <any> 'K'
29+
}
30+
}

0 commit comments

Comments
 (0)