docs: document AU timesheet line creation best practice in tool descriptions#170
Open
elliotchisholm wants to merge 5 commits into
Open
docs: document AU timesheet line creation best practice in tool descriptions#170elliotchisholm wants to merge 5 commits into
elliotchisholm wants to merge 5 commits into
Conversation
08e1f9e to
9b79979
Compare
- Upgrade xero-node from ^13.3.0 to ^15.0.1 - Add PayrollAuV2Api client to xero-client.ts with lazy init and token sync - Add payroll-au-v2-types.ts shim for AU v2 Timesheet/TimesheetLine types - Fix SDK breaking change: hoursAccruedAnnually renamed to unitsAccruedAnnually - Add vitest for test infrastructure The PayrollAuV2Api is a separate class not wired into XeroClient, so it requires manual instantiation and access token management. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace all AU-specific workaround code with v2 API calls via PayrollAuV2Api. This aligns AU with NZ/UK — all three regions now use the same v2 endpoint patterns. Changes per handler: - approve: remove GET-then-PUT status workaround, call approveTimesheet - revert: remove GET-then-PUT status workaround, call revertTimesheet - delete: remove AU error block, call deleteTimesheet (previously unsupported) - create: remove array wrapping, use single-object createTimesheet - add-line: remove GET-append-PUT workaround, call createTimesheetLine - update-line: remove earningsRateID matching, call updateTimesheetLine by ID - get: call getTimesheet via v2 client - list: remove AU-only params (where/order/ifModifiedSince), use v2 params Breaking input changes for AU callers: - numberOfUnits is now a single number (not array) with a date per line - payrollCalendarID is now required on create - timesheetLineID is now required on update-line Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New handler, tool, and tests for DELETE /timesheets/{id}/lines/{lineId}.
Previously this operation had no MCP tool. Supports AU (via
PayrollAuV2Api), NZ, and UK.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New tools: - list-payroll-calendars: shows pay calendar names, types, and upcoming payment dates. AU uses payrollAUApi.getPayrollCalendars (v1), NZ/UK use getPayRunCalendars. - list-earnings-rates: shows earnings rate IDs, names, and types needed for creating timesheet lines. AU uses payrollAUApi.getPayItems (v1) and extracts the earningsRates array, NZ/UK use getEarningsRates. Both tools support AU, NZ, and UK with region auto-detection. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
For AU payroll, timesheets should be created empty then lines added individually via add-timesheet-line. Passing lines at creation time creates separate rows per day in the Xero UI instead of consolidating them by earnings rate. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
9b79979 to
040d2e0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Updates tool descriptions to document the correct pattern for creating AU timesheets: create the timesheet empty first, then add lines individually.
Why
Adding lines at create time resulted in duplicate rows in the Xero UI due to how the v2 API handles batch line creation. The tool descriptions now guide callers toward the correct two-step approach.
Note for reviewer
This is part of a stacked series — please merge in order (#165–#169 first). Once those merge into main, this PR's diff will show only these changes.
Part 6 of 8 — AU timesheet v2 migration stack.