/// <summary> /// Update Employee /// </summary> /// <remarks> /// Updates the employee with the specified ID. /// Only fields to be updated need be specified. Fields left unspecified or null will not be changed. /// To update a field provide the new value, to specifically clear a value use the string "(clear)". /// </remarks> public Task <EmployeeUpdateResponseModel> UpdateEmployeeAsync(int businessId, int employeeId, NzUnstructuredEmployeeModel model, CancellationToken cancellationToken = default) { return(ApiRequestAsync <EmployeeUpdateResponseModel, NzUnstructuredEmployeeModel>($"/business/{businessId}/employee/unstructured/{employeeId}", model, Method.PUT, cancellationToken)); }
/// <summary> /// Update Employee /// </summary> /// <remarks> /// Updates the employee with the specified ID. /// Only fields to be updated need be specified. Fields left unspecified or null will not be changed. /// To update a field provide the new value, to specifically clear a value use the string "(clear)". /// </remarks> public EmployeeUpdateResponseModel UpdateEmployee(int businessId, int employeeId, NzUnstructuredEmployeeModel model) { return(ApiRequest <EmployeeUpdateResponseModel, NzUnstructuredEmployeeModel>($"/business/{businessId}/employee/unstructured/{employeeId}", model, Method.PUT)); }
/// <summary> /// Create or Update Employee /// </summary> /// <remarks> /// <p>If an ID is passed or an existing employee is matched (according to the matchType parameter), it will /// be updated. Otherwise a new employee will be created. /// </p> /// <p> /// MatchType parameter values: /// <list><li>Standard (default): attempts to match an existing employee - first, based on the IRD number, /// then based on first name + surname + date of birth /// </li><li>None: do not attempt to match an existing employee (create a new one) /// </li></list></p> /// <p> /// An employee may be created with a status of 'Incomplete' by specifying at least the minimum fields; firstName, surname, startDate, employmentType, /// taxCodeDeclaration_IrdNumber, taxCodeDeclaration_EsctRate, kiwiSaver_EnrollmentStatus.<br /> /// For an employee record to be considered 'Complete' the following groups of data are required: /// <list><li>Basic Details (Name, Start Date, Date of Birth and Address Details)</li><li>Tax Code Declaration (Tax Code and Employment Type)</li><li>Pay Run Defaults (Default Pay Category, Pay Cycle and Location)</li><li>Locations (at least one)</li><li>Bank Account/s (at least one)</li><li>Kiwi Saver Contribution Plan</li></list></p> /// </remarks> public EmployeeUpdateResponseModel CreateOrUpdateEmployee(int businessId, NzUnstructuredEmployeeModel model, CreateOrUpdateEmployeeQueryModel request) { return(ApiRequest <EmployeeUpdateResponseModel, NzUnstructuredEmployeeModel>($"/business/{businessId}/employee/unstructured?matchType={request.MatchType}", model, Method.POST)); }
/// <summary> /// Create or Update Employee /// </summary> /// <remarks> /// <p>If an ID is passed or an existing employee is matched (according to the matchType parameter), it will /// be updated. Otherwise a new employee will be created. /// </p> /// <p> /// MatchType parameter values: /// <list><li>Standard (default): attempts to match an existing employee - first, based on the IRD number, /// then based on first name + surname + date of birth /// </li><li>None: do not attempt to match an existing employee (create a new one) /// </li></list></p> /// <p> /// An employee may be created with a status of 'Incomplete' by specifying at least the minimum fields; firstName, surname, startDate, employmentType, /// taxCodeDeclaration_IrdNumber, taxCodeDeclaration_EsctRate, kiwiSaver_EnrollmentStatus.<br /> /// For an employee record to be considered 'Complete' the following groups of data are required: /// <list><li>Basic Details (Name, Start Date, Date of Birth and Address Details)</li><li>Tax Code Declaration (Tax Code and Employment Type)</li><li>Pay Run Defaults (Default Pay Category, Pay Cycle and Location)</li><li>Locations (at least one)</li><li>Bank Account/s (at least one)</li><li>Kiwi Saver Contribution Plan</li></list></p> /// </remarks> public Task <EmployeeUpdateResponseModel> CreateOrUpdateEmployeeAsync(int businessId, NzUnstructuredEmployeeModel model, CreateOrUpdateEmployeeQueryModel request, CancellationToken cancellationToken = default) { return(ApiRequestAsync <EmployeeUpdateResponseModel, NzUnstructuredEmployeeModel>($"/business/{businessId}/employee/unstructured?matchType={request.MatchType}", model, Method.POST, cancellationToken)); }
/// <summary> /// Create or Update Employee /// </summary> /// <remarks> /// <p>If an ID is passed or an existing employee is matched (according to the matchType parameter), it will /// be updated. Otherwise a new employee will be created. /// </p> /// <p> /// MatchType parameter values: /// <list><li>Standard (default): attempts to match an existing employee - first, based on the IRD number, /// then based on first name + surname + date of birth /// </li><li>None: do not attempt to match an existing employee (create a new one) /// </li></list></p> /// <p> /// An employee may be created with a status of 'Incomplete' by specifying at least the minimum fields; firstName, surname, startDate, employmentType, /// taxCodeDeclaration_IrdNumber, taxCodeDeclaration_EsctRate, kiwiSaver_EnrollmentStatus.<br /> /// For an employee record to be considered 'Complete' the following groups of data are required: /// <list><li>Basic Details (Name, Start Date, Date of Birth and Address Details)</li><li>Tax Code Declaration (Tax Code and Employment Type)</li><li>Pay Run Defaults (Default Pay Category, Pay Cycle and Location)</li><li>Locations (at least one)</li><li>Bank Account/s (at least one)</li><li>Kiwi Saver Contribution Plan</li></list></p> /// </remarks> public EmployeeUpdateResponseModel CreateOrUpdateEmployee(int businessId, NzUnstructuredEmployeeModel model) { return(ApiRequest <EmployeeUpdateResponseModel, NzUnstructuredEmployeeModel>($"/business/{businessId}/employee/unstructured", model, Method.POST)); }