Skip to content

Leave Tool

The Leave tool replaces direct Xero leave submissions with an in-app workflow. Employees submit leave requests, which go through a two-tier approval process (manager → executive). On final approval, the leave is automatically synced to Xero, Productive.io, the Tribe Google Calendar, and posted to Slack.

  • Leave balances — Cached from Xero, shown before submitting a request
  • Two-tier approval — Manager approval then executive approval (with shortcuts for managers and executives)
  • External integrations — Xero LeaveApplication, Productive booking, Google Calendar event, Slack notification
  • Cancellation — Reverses all external integrations when approved leave is cancelled
  • Pending badge — Sidebar badge showing count of requests awaiting your approval
  • Audit trail — Full history of every action on a request
Employee submits → pending_manager → Manager approves → pending_exec → Executive approves → approved
Manager/Head submits → pending_exec → Executive approves → approved
Executive submits → approved (auto)
  • pending_manager: Approver must be is_manager=1 in a shared squad, or an executive
  • pending_exec: Approver must have access_level = 'executive'
LevelViewSubmit/ApproveManage (retry integrations)
ExecutiveAll requestsYes + auto-approve ownYes
HeadAll requestsYesNo
ManagerOwn + squadYesNo
LeadOwn onlySubmit onlyNo
EmployeeOwn onlySubmit onlyNo

On executive approval (or auto-approval for executives), the following run independently:

  1. Xero — Creates a LeaveApplication via Payroll AU API
  2. Productive — Creates a time-off booking
  3. Google Calendar — Creates an all-day event on the Tribe calendar
  4. Slack — Posts to #company-leave with leave details

Each integration runs independently — a failure in one doesn’t block the others. Failed integrations are stored and can be retried by executives.

ComponentPurpose
leave-page.tsxMain page: tabs (My Leave, Pending, All), balance card, form/detail sheets
leave-request-form.tsxSubmit leave: type, dates, hours, notes
leave-request-list.tsxList of requests with status, type, dates
leave-request-detail.tsxFull detail with actions, integration status, history timeline
leave-balances-card.tsxLeave balance grid with refresh button
leave-status-badge.tsxColoured status badge (pending/approved/rejected/cancelled)
leave-integration-status.tsxPer-integration success/failure indicators with retry button
  • ?tab=mine|pending|all — active tab
  • ?id=<leave-request-id> — selected request detail view
TablePurpose
leave_typesCached from Xero PayItems (ID, name, is_paid)
leave_balancesPer-user balances cached from Xero (1hr TTL)
leave_requestsCore table: user, type, dates, hours, status, external IDs, integration errors
leave_request_historyAudit trail: action, actor, comment, timestamp