diff --git a/docs/payroll-uk/index.html b/docs/payroll-uk/index.html index 5c96b83b..38c2fbd3 100644 --- a/docs/payroll-uk/index.html +++ b/docs/payroll-uk/index.html @@ -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", @@ -2262,7 +2272,7 @@ }; defs["Employment"] = { "title" : "", - "required" : [ "EmployeeNumber", "NICategory", "PayrollCalendarID", "StartDate" ], + "required" : [ "EmployeeNumber", "NICategories", "PayrollCalendarID", "StartDate" ], "type" : "object", "properties" : { "payrollCalendarID" : { @@ -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" : "" @@ -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" : "", @@ -5715,6 +5798,8 @@

Usage and SDK Samples

startDate: startDate }; +const niCategories: NICategories = { + try { const response = await xero.accountingApi.createEmployment(xeroTenantId, employeeID, employment, idempotencyKey); console.log(response.body || response.response.statusCode) @@ -5846,7 +5931,7 @@

Parameters

"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 diff --git a/src/gen/model/payroll-uk/employee.ts b/src/gen/model/payroll-uk/employee.ts index c405e6fe..05551438 100644 --- a/src/gen/model/payroll-uk/employee.ts +++ b/src/gen/model/payroll-uk/employee.ts @@ -1,4 +1,6 @@ import { Address } from '././address'; +import { NICategory } from '././nICategory'; +import { NICategoryLetter } from '././nICategoryLetter'; export class Employee { /** @@ -54,6 +56,11 @@ export class Employee { * UTC timestamp when the employee was created in Xero */ 'createdDateUTC'?: Date; + 'niCategory'?: NICategoryLetter; + /** + * The employee\'s NI categories + */ + 'niCategories'?: Array; /** * National insurance number of the employee */ @@ -136,6 +143,16 @@ export class Employee { "baseName": "createdDateUTC", "type": "Date" }, + { + "name": "niCategory", + "baseName": "niCategory", + "type": "NICategoryLetter" + }, + { + "name": "niCategories", + "baseName": "niCategories", + "type": "Array" + }, { "name": "nationalInsuranceNumber", "baseName": "nationalInsuranceNumber", diff --git a/src/gen/model/payroll-uk/employment.ts b/src/gen/model/payroll-uk/employment.ts index af76f3c4..db85b7fc 100644 --- a/src/gen/model/payroll-uk/employment.ts +++ b/src/gen/model/payroll-uk/employment.ts @@ -1,3 +1,5 @@ +import { NICategory } from '././nICategory'; +import { NICategoryLetter } from '././nICategoryLetter'; export class Employment { /** @@ -12,10 +14,11 @@ export class Employment { * The employment number of the employee */ 'employeeNumber'?: string; + 'niCategory'?: NICategoryLetter; /** - * The NI Category of the employee + * The employee\'s NI categories */ - 'niCategory'?: Employment.NiCategoryEnum; + 'niCategories'?: Array; static discriminator: string | undefined = undefined; @@ -38,7 +41,12 @@ export class Employment { { "name": "niCategory", "baseName": "niCategory", - "type": "Employment.NiCategoryEnum" + "type": "NICategoryLetter" + }, + { + "name": "niCategories", + "baseName": "niCategories", + "type": "Array" } ]; static getAttributeTypeMap() { @@ -46,20 +54,3 @@ export class Employment { } } -export namespace Employment { - export enum NiCategoryEnum { - A = 'A', - B = 'B', - C = 'C', - F = 'F', - H = 'H', - I = 'I', - J = 'J', - L = 'L', - M = 'M', - S = 'S', - V = 'V', - X = 'X', - Z = 'Z' - } -} diff --git a/src/gen/model/payroll-uk/models.ts b/src/gen/model/payroll-uk/models.ts index 9b62edfc..73ad438f 100644 --- a/src/gen/model/payroll-uk/models.ts +++ b/src/gen/model/payroll-uk/models.ts @@ -55,6 +55,10 @@ export * from '././leavePeriods'; export * from '././leaveType'; export * from '././leaveTypeObject'; export * from '././leaveTypes'; +export * from '././nICategory'; +export * from '././nICategoryLetter'; +export * from '././nICategoryOneOf'; +export * from '././nICategoryOneOf1'; export * from '././pagination'; export * from '././payRun'; export * from '././payRunCalendar'; @@ -146,6 +150,10 @@ import { LeavePeriods } from '././leavePeriods'; import { LeaveType } from '././leaveType'; import { LeaveTypeObject } from '././leaveTypeObject'; import { LeaveTypes } from '././leaveTypes'; +import { NICategory } from '././nICategory'; +import { NICategoryLetter } from '././nICategoryLetter'; +import { NICategoryOneOf } from '././nICategoryOneOf'; +import { NICategoryOneOf1 } from '././nICategoryOneOf1'; import { Pagination } from '././pagination'; import { PayRun } from '././payRun'; import { PayRunCalendar } from '././payRunCalendar'; @@ -207,8 +215,10 @@ let enumsMap: {[index: string]: any} = { "EmployeeStatutoryLeaveSummary.TypeEnum": EmployeeStatutoryLeaveSummary.TypeEnum, "EmployeeStatutoryLeaveSummary.StatusEnum": EmployeeStatutoryLeaveSummary.StatusEnum, "EmployeeStatutorySickLeave.EntitlementFailureReasonsEnum": EmployeeStatutorySickLeave.EntitlementFailureReasonsEnum, - "Employment.NiCategoryEnum": Employment.NiCategoryEnum, "LeavePeriod.PeriodStatusEnum": LeavePeriod.PeriodStatusEnum, + "NICategoryLetter": NICategoryLetter, + "NICategoryOneOf.NiCategoryEnum": NICategoryOneOf.NiCategoryEnum, + "NICategoryOneOf1.NiCategoryEnum": NICategoryOneOf1.NiCategoryEnum, "PayRun.PayRunStatusEnum": PayRun.PayRunStatusEnum, "PayRun.PayRunTypeEnum": PayRun.PayRunTypeEnum, "PayRun.CalendarTypeEnum": PayRun.CalendarTypeEnum, @@ -279,6 +289,9 @@ let typeMap: {[index: string]: any} = { "LeaveType": LeaveType, "LeaveTypeObject": LeaveTypeObject, "LeaveTypes": LeaveTypes, + "NICategory": NICategory, + "NICategoryOneOf": NICategoryOneOf, + "NICategoryOneOf1": NICategoryOneOf1, "Pagination": Pagination, "PayRun": PayRun, "PayRunCalendar": PayRunCalendar, diff --git a/src/gen/model/payroll-uk/nICategory.ts b/src/gen/model/payroll-uk/nICategory.ts new file mode 100644 index 00000000..f0bd13df --- /dev/null +++ b/src/gen/model/payroll-uk/nICategory.ts @@ -0,0 +1,59 @@ +import { NICategoryLetter } from '././nICategoryLetter'; +import { NICategoryOneOf } from '././nICategoryOneOf'; +import { NICategoryOneOf1 } from '././nICategoryOneOf1'; + +export class NICategory { + /** + * The start date of the NI category (YYYY-MM-DD) + */ + 'startDate'?: string; + 'niCategory': NICategoryLetter; + /** + * Xero unique identifier for the NI category + */ + 'niCategoryID'?: number; + /** + * The date in which the employee was first employed as a civilian (YYYY-MM-DD) + */ + 'dateFirstEmployedAsCivilian'?: string; + /** + * The workplace postcode + */ + 'workplacePostcode': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "startDate", + "baseName": "startDate", + "type": "string" + }, + { + "name": "niCategory", + "baseName": "niCategory", + "type": "NICategoryLetter" + }, + { + "name": "niCategoryID", + "baseName": "niCategoryID", + "type": "number" + }, + { + "name": "dateFirstEmployedAsCivilian", + "baseName": "dateFirstEmployedAsCivilian", + "type": "string" + }, + { + "name": "workplacePostcode", + "baseName": "workplacePostcode", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return NICategory.attributeTypeMap; + } +} + +export namespace NICategory { +} diff --git a/src/gen/model/payroll-uk/nICategoryLetter.ts b/src/gen/model/payroll-uk/nICategoryLetter.ts new file mode 100644 index 00000000..b989a77d --- /dev/null +++ b/src/gen/model/payroll-uk/nICategoryLetter.ts @@ -0,0 +1,23 @@ + +/** +* The employee\'s NI Category letter. +*/ +export enum NICategoryLetter { + A = 'A', + B = 'B', + C = 'C', + D = 'D', + E = 'E', + F = 'F', + H = 'H', + I = 'I', + J = 'J', + K = 'K', + L = 'L', + M = 'M', + N = 'N', + S = 'S', + V = 'V', + X = 'X', + Z = 'Z' +} diff --git a/src/gen/model/payroll-uk/nICategoryOneOf.ts b/src/gen/model/payroll-uk/nICategoryOneOf.ts new file mode 100644 index 00000000..f30ed486 --- /dev/null +++ b/src/gen/model/payroll-uk/nICategoryOneOf.ts @@ -0,0 +1,30 @@ + +export class NICategoryOneOf { + 'niCategory'?: NICategoryOneOf.NiCategoryEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "niCategory", + "baseName": "niCategory", + "type": "NICategoryOneOf.NiCategoryEnum" + } ]; + + static getAttributeTypeMap() { + return NICategoryOneOf.attributeTypeMap; + } +} + +export namespace NICategoryOneOf { + export enum NiCategoryEnum { + F = 'F', + I = 'I', + L = 'L', + S = 'S', + N = 'N', + E = 'E', + D = 'D', + K = 'K' + } +} diff --git a/src/gen/model/payroll-uk/nICategoryOneOf1.ts b/src/gen/model/payroll-uk/nICategoryOneOf1.ts new file mode 100644 index 00000000..e0b45f38 --- /dev/null +++ b/src/gen/model/payroll-uk/nICategoryOneOf1.ts @@ -0,0 +1,23 @@ + +export class NICategoryOneOf1 { + 'niCategory'?: NICategoryOneOf1.NiCategoryEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "niCategory", + "baseName": "niCategory", + "type": "NICategoryOneOf1.NiCategoryEnum" + } ]; + + static getAttributeTypeMap() { + return NICategoryOneOf1.attributeTypeMap; + } +} + +export namespace NICategoryOneOf1 { + export enum NiCategoryEnum { + V = 'V' + } +}