Skip to content

Commit 69611ed

Browse files
author
vignesh.kennadi_xero
committed
Ni category updates from Open API
1 parent 149dfb2 commit 69611ed

File tree

8 files changed

+939
-105
lines changed

8 files changed

+939
-105
lines changed

docs/v4/payroll-uk/index.html

+91-6
Original file line numberDiff line numberDiff line change
@@ -1593,6 +1593,16 @@
15931593
"format" : "date-time",
15941594
"x-is-datetime" : true
15951595
},
1596+
"niCategory" : {
1597+
"$ref" : "#/components/schemas/NICategoryLetter"
1598+
},
1599+
"niCategories" : {
1600+
"type" : "array",
1601+
"description" : "The employee's NI categories",
1602+
"items" : {
1603+
"$ref" : "#/components/schemas/NICategory"
1604+
}
1605+
},
15961606
"nationalInsuranceNumber" : {
15971607
"type" : "string",
15981608
"description" : "National insurance number of the employee",
@@ -2260,7 +2270,7 @@
22602270
};
22612271
defs["Employment"] = {
22622272
"title" : "",
2263-
"required" : [ "EmployeeNumber", "NICategory", "PayrollCalendarID", "StartDate" ],
2273+
"required" : [ "EmployeeNumber", "NICategories", "PayrollCalendarID", "StartDate" ],
22642274
"type" : "object",
22652275
"properties" : {
22662276
"payrollCalendarID" : {
@@ -2280,10 +2290,14 @@
22802290
"example" : "7"
22812291
},
22822292
"niCategory" : {
2283-
"type" : "string",
2284-
"description" : "The NI Category of the employee",
2285-
"example" : "A",
2286-
"enum" : [ "A", "B", "C", "F", "H", "I", "J", "L", "M", "S", "V", "X", "Z" ]
2293+
"$ref" : "#/components/schemas/NICategoryLetter"
2294+
},
2295+
"niCategories" : {
2296+
"type" : "array",
2297+
"description" : "The employee's NI categories",
2298+
"items" : {
2299+
"$ref" : "#/components/schemas/NICategory"
2300+
}
22872301
}
22882302
},
22892303
"description" : ""
@@ -2500,6 +2514,75 @@
25002514
}
25012515
},
25022516
"description" : ""
2517+
};
2518+
defs["NICategory"] = {
2519+
"title" : "",
2520+
"required" : [ "niCategory", "workplacePostcode" ],
2521+
"type" : "object",
2522+
"properties" : {
2523+
"startDate" : {
2524+
"type" : "string",
2525+
"description" : "The start date of the NI category (YYYY-MM-DD)",
2526+
"format" : "date",
2527+
"example" : "2024-12-02",
2528+
"x-is-date" : true
2529+
},
2530+
"niCategory" : {
2531+
"$ref" : "#/components/schemas/NICategoryLetter"
2532+
},
2533+
"niCategoryID" : {
2534+
"type" : "number",
2535+
"description" : "Xero unique identifier for the NI category",
2536+
"example" : 15
2537+
},
2538+
"dateFirstEmployedAsCivilian" : {
2539+
"type" : "string",
2540+
"description" : "The date in which the employee was first employed as a civilian (YYYY-MM-DD)",
2541+
"format" : "date",
2542+
"example" : "2024-12-02",
2543+
"x-is-date" : true
2544+
},
2545+
"workplacePostcode" : {
2546+
"type" : "string",
2547+
"description" : "The workplace postcode",
2548+
"example" : "SW1A 1AA"
2549+
}
2550+
},
2551+
"description" : "",
2552+
"oneOf" : [ {
2553+
"$ref" : "#/components/schemas/NICategory_oneOf"
2554+
}, {
2555+
"$ref" : "#/components/schemas/NICategory_oneOf_1"
2556+
} ]
2557+
};
2558+
defs["NICategoryLetter"] = {
2559+
"title" : "",
2560+
"type" : "string",
2561+
"description" : "The employee's NI Category letter.",
2562+
"example" : "I",
2563+
"enum" : [ "A", "B", "C", "D", "E", "F", "H", "I", "J", "K", "L", "M", "N", "S", "V", "X", "Z" ]
2564+
};
2565+
defs["NICategory_oneOf"] = {
2566+
"title" : "",
2567+
"required" : [ "workplacePostcode" ],
2568+
"properties" : {
2569+
"niCategory" : {
2570+
"type" : "string",
2571+
"enum" : [ "F", "I", "L", "S", "N", "E", "D", "K" ]
2572+
}
2573+
},
2574+
"description" : ""
2575+
};
2576+
defs["NICategory_oneOf_1"] = {
2577+
"title" : "",
2578+
"required" : [ "dateFirstEmployedAsCivilian" ],
2579+
"properties" : {
2580+
"niCategory" : {
2581+
"type" : "string",
2582+
"enum" : [ "V" ]
2583+
}
2584+
},
2585+
"description" : ""
25032586
};
25042587
defs["Pagination"] = {
25052588
"title" : "",
@@ -5872,6 +5955,8 @@ <h3>Usage and SDK Samples</h3>
58725955
Employment employment = new Employment();
58735956
employment.setPayrollCalendarID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
58745957
employment.setStartDate(startDate);
5958+
5959+
NICategories niCategories = new NICategories();
58755960

58765961
try {
58775962
EmploymentObject result = apiInstance.createEmployment(accessToken, xeroTenantId, employeeID, employment, idempotencyKey);
@@ -6006,7 +6091,7 @@ <h2>Parameters</h2>
60066091
"schema" : {
60076092
"$ref" : "#/components/schemas/Employment"
60086093
},
6009-
"example" : "{ \"PayrollCalendarID\": \"216d80e6-af55-47b1-b718-9457c3f5d2fe\", \"StartDate\": \"2020-04-01\", \"EmployeeNumber\": \"123ABC\", \"NICategory\": \"A\" }"
6094+
"example" : "{ \"PayrollCalendarID\": \"216d80e6-af55-47b1-b718-9457c3f5d2fe\", \"StartDate\": \"2020-04-01\", \"NICategories\": [ { \"NICategory\": \"A\", \"StartDate\": \"2020-05-01\" } ], \"EmployeeNumber\": \"123ABC\" }"
60106095
}
60116096
},
60126097
"required" : true

src/main/java/com/xero/models/payrolluk/Employee.java

+98
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
import com.fasterxml.jackson.annotation.JsonValue;
1717
import com.xero.api.StringUtil;
1818
import io.swagger.annotations.ApiModelProperty;
19+
import java.util.ArrayList;
20+
import java.util.List;
1921
import java.util.Objects;
2022
import java.util.UUID;
2123
import org.threeten.bp.LocalDate;
@@ -116,6 +118,12 @@ public static GenderEnum fromValue(String value) {
116118
@JsonProperty("createdDateUTC")
117119
private LocalDateTime createdDateUTC;
118120

121+
@JsonProperty("niCategory")
122+
private NICategoryLetter niCategory;
123+
124+
@JsonProperty("niCategories")
125+
private List<NICategory> niCategories = new ArrayList<NICategory>();
126+
119127
@JsonProperty("nationalInsuranceNumber")
120128
private String nationalInsuranceNumber;
121129

@@ -619,6 +627,90 @@ public void setCreatedDateUTC(LocalDateTime createdDateUTC) {
619627
this.createdDateUTC = createdDateUTC;
620628
}
621629

630+
/**
631+
* niCategory
632+
*
633+
* @param niCategory NICategoryLetter
634+
* @return Employee
635+
*/
636+
public Employee niCategory(NICategoryLetter niCategory) {
637+
this.niCategory = niCategory;
638+
return this;
639+
}
640+
641+
/**
642+
* Get niCategory
643+
*
644+
* @return niCategory
645+
*/
646+
@ApiModelProperty(value = "")
647+
/**
648+
* niCategory
649+
*
650+
* @return niCategory NICategoryLetter
651+
*/
652+
public NICategoryLetter getNiCategory() {
653+
return niCategory;
654+
}
655+
656+
/**
657+
* niCategory
658+
*
659+
* @param niCategory NICategoryLetter
660+
*/
661+
public void setNiCategory(NICategoryLetter niCategory) {
662+
this.niCategory = niCategory;
663+
}
664+
665+
/**
666+
* The employee&#39;s NI categories
667+
*
668+
* @param niCategories List&lt;NICategory&gt;
669+
* @return Employee
670+
*/
671+
public Employee niCategories(List<NICategory> niCategories) {
672+
this.niCategories = niCategories;
673+
return this;
674+
}
675+
676+
/**
677+
* The employee&#39;s NI categories
678+
*
679+
* @param niCategoriesItem NICategory
680+
* @return Employee
681+
*/
682+
public Employee addNiCategoriesItem(NICategory niCategoriesItem) {
683+
if (this.niCategories == null) {
684+
this.niCategories = new ArrayList<NICategory>();
685+
}
686+
this.niCategories.add(niCategoriesItem);
687+
return this;
688+
}
689+
690+
/**
691+
* The employee&#39;s NI categories
692+
*
693+
* @return niCategories
694+
*/
695+
@ApiModelProperty(value = "The employee's NI categories")
696+
/**
697+
* The employee&#39;s NI categories
698+
*
699+
* @return niCategories List<NICategory>
700+
*/
701+
public List<NICategory> getNiCategories() {
702+
return niCategories;
703+
}
704+
705+
/**
706+
* The employee&#39;s NI categories
707+
*
708+
* @param niCategories List&lt;NICategory&gt;
709+
*/
710+
public void setNiCategories(List<NICategory> niCategories) {
711+
this.niCategories = niCategories;
712+
}
713+
622714
/**
623715
* National insurance number of the employee
624716
*
@@ -712,6 +804,8 @@ public boolean equals(java.lang.Object o) {
712804
&& Objects.equals(this.payrollCalendarID, employee.payrollCalendarID)
713805
&& Objects.equals(this.updatedDateUTC, employee.updatedDateUTC)
714806
&& Objects.equals(this.createdDateUTC, employee.createdDateUTC)
807+
&& Objects.equals(this.niCategory, employee.niCategory)
808+
&& Objects.equals(this.niCategories, employee.niCategories)
715809
&& Objects.equals(this.nationalInsuranceNumber, employee.nationalInsuranceNumber)
716810
&& Objects.equals(this.isOffPayrollWorker, employee.isOffPayrollWorker);
717811
}
@@ -733,6 +827,8 @@ public int hashCode() {
733827
payrollCalendarID,
734828
updatedDateUTC,
735829
createdDateUTC,
830+
niCategory,
831+
niCategories,
736832
nationalInsuranceNumber,
737833
isOffPayrollWorker);
738834
}
@@ -755,6 +851,8 @@ public String toString() {
755851
sb.append(" payrollCalendarID: ").append(toIndentedString(payrollCalendarID)).append("\n");
756852
sb.append(" updatedDateUTC: ").append(toIndentedString(updatedDateUTC)).append("\n");
757853
sb.append(" createdDateUTC: ").append(toIndentedString(createdDateUTC)).append("\n");
854+
sb.append(" niCategory: ").append(toIndentedString(niCategory)).append("\n");
855+
sb.append(" niCategories: ").append(toIndentedString(niCategories)).append("\n");
758856
sb.append(" nationalInsuranceNumber: ")
759857
.append(toIndentedString(nationalInsuranceNumber))
760858
.append("\n");

0 commit comments

Comments
 (0)