Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ni category updates from Open API #400

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
97 changes: 91 additions & 6 deletions docs/v4/payroll-uk/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1593,6 +1593,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 @@ -2260,7 +2270,7 @@
};
defs["Employment"] = {
"title" : "",
"required" : [ "EmployeeNumber", "NICategory", "PayrollCalendarID", "StartDate" ],
"required" : [ "EmployeeNumber", "NICategories", "PayrollCalendarID", "StartDate" ],
"type" : "object",
"properties" : {
"payrollCalendarID" : {
Expand All @@ -2280,10 +2290,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 @@ -2500,6 +2514,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 @@ -5872,6 +5955,8 @@ <h3>Usage and SDK Samples</h3>
Employment employment = new Employment();
employment.setPayrollCalendarID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
employment.setStartDate(startDate);

NICategories niCategories = new NICategories();

try {
EmploymentObject result = apiInstance.createEmployment(accessToken, xeroTenantId, employeeID, employment, idempotencyKey);
Expand Down Expand Up @@ -6006,7 +6091,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
98 changes: 98 additions & 0 deletions src/main/java/com/xero/models/payrolluk/Employee.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import com.fasterxml.jackson.annotation.JsonValue;
import com.xero.api.StringUtil;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.UUID;
import org.threeten.bp.LocalDate;
Expand Down Expand Up @@ -116,6 +118,12 @@ public static GenderEnum fromValue(String value) {
@JsonProperty("createdDateUTC")
private LocalDateTime createdDateUTC;

@JsonProperty("niCategory")
private NICategoryLetter niCategory;

@JsonProperty("niCategories")
private List<NICategory> niCategories = new ArrayList<NICategory>();

@JsonProperty("nationalInsuranceNumber")
private String nationalInsuranceNumber;

Expand Down Expand Up @@ -619,6 +627,90 @@ public void setCreatedDateUTC(LocalDateTime createdDateUTC) {
this.createdDateUTC = createdDateUTC;
}

/**
* niCategory
*
* @param niCategory NICategoryLetter
* @return Employee
*/
public Employee niCategory(NICategoryLetter niCategory) {
this.niCategory = niCategory;
return this;
}

/**
* Get niCategory
*
* @return niCategory
*/
@ApiModelProperty(value = "")
/**
* niCategory
*
* @return niCategory NICategoryLetter
*/
public NICategoryLetter getNiCategory() {
return niCategory;
}

/**
* niCategory
*
* @param niCategory NICategoryLetter
*/
public void setNiCategory(NICategoryLetter niCategory) {
this.niCategory = niCategory;
}

/**
* The employee&#39;s NI categories
*
* @param niCategories List&lt;NICategory&gt;
* @return Employee
*/
public Employee niCategories(List<NICategory> niCategories) {
this.niCategories = niCategories;
return this;
}

/**
* The employee&#39;s NI categories
*
* @param niCategoriesItem NICategory
* @return Employee
*/
public Employee addNiCategoriesItem(NICategory niCategoriesItem) {
if (this.niCategories == null) {
this.niCategories = new ArrayList<NICategory>();
}
this.niCategories.add(niCategoriesItem);
return this;
}

/**
* The employee&#39;s NI categories
*
* @return niCategories
*/
@ApiModelProperty(value = "The employee's NI categories")
/**
* The employee&#39;s NI categories
*
* @return niCategories List<NICategory>
*/
public List<NICategory> getNiCategories() {
return niCategories;
}

/**
* The employee&#39;s NI categories
*
* @param niCategories List&lt;NICategory&gt;
*/
public void setNiCategories(List<NICategory> niCategories) {
this.niCategories = niCategories;
}

/**
* National insurance number of the employee
*
Expand Down Expand Up @@ -712,6 +804,8 @@ public boolean equals(java.lang.Object o) {
&& Objects.equals(this.payrollCalendarID, employee.payrollCalendarID)
&& Objects.equals(this.updatedDateUTC, employee.updatedDateUTC)
&& Objects.equals(this.createdDateUTC, employee.createdDateUTC)
&& Objects.equals(this.niCategory, employee.niCategory)
&& Objects.equals(this.niCategories, employee.niCategories)
&& Objects.equals(this.nationalInsuranceNumber, employee.nationalInsuranceNumber)
&& Objects.equals(this.isOffPayrollWorker, employee.isOffPayrollWorker);
}
Expand All @@ -733,6 +827,8 @@ public int hashCode() {
payrollCalendarID,
updatedDateUTC,
createdDateUTC,
niCategory,
niCategories,
nationalInsuranceNumber,
isOffPayrollWorker);
}
Expand All @@ -755,6 +851,8 @@ public String toString() {
sb.append(" payrollCalendarID: ").append(toIndentedString(payrollCalendarID)).append("\n");
sb.append(" updatedDateUTC: ").append(toIndentedString(updatedDateUTC)).append("\n");
sb.append(" createdDateUTC: ").append(toIndentedString(createdDateUTC)).append("\n");
sb.append(" niCategory: ").append(toIndentedString(niCategory)).append("\n");
sb.append(" niCategories: ").append(toIndentedString(niCategories)).append("\n");
sb.append(" nationalInsuranceNumber: ")
.append(toIndentedString(nationalInsuranceNumber))
.append("\n");
Expand Down
Loading