> ## Documentation Index
> Fetch the complete documentation index at: https://developers.jobhandy.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Employee offboarding

> Block access, preserve referential integrity, document limitations, and separate account state from deletion or erasure workflows.

The public employee update operation exposes the `blocked` property. Blocking changes account state; it is not a delete operation and must not be described as data erasure.

## Recommended offboarding flow

```mermaid theme={"theme":{"light":"github-light","dark":"github-dark"}}
sequenceDiagram
    participant HR as HR system
    participant INT as Integration
    participant API as JobHandy API
    participant OPS as Operations

    HR->>INT: Employee leaves or access must stop
    INT->>API: GET /employees/{id}
    API-->>INT: Current employee
    INT->>API: PATCH /employees/{id}?dryRun=true {blocked:true}
    API-->>INT: Projected blocked employee
    INT->>API: PATCH /employees/{id} {blocked:true}
    API-->>INT: Persisted employee + request ID
    INT->>OPS: Record result and follow-up tasks
```

## Block the employee

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "blocked": true
}
```

Use dry run first when the change is part of an automated offboarding process.

## What the public contract guarantees

* The employee resource contains a boolean `blocked` state.
* The update endpoint can change that state.
* The employee remains addressable by its resource ID while available in scope.
* The public API does not expose employee deletion.

## What the public contract does not specify

The OpenAPI contract does not enumerate every downstream portal or business effect of a blocked employee. Do not assume that blocking automatically:

* deletes employee data
* cancels, rejects, or archives existing orders
* deletes incidents or attachments
* deletes payroll data
* fulfills a legal erasure request

Handle those processes through the responsible JobHandy and customer business procedures.

## Reactivation

Where the business process permits reactivation, set:

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "blocked": false
}
```

Validate the target state and current tenant scope before applying it.

## Operational checklist

* [ ] JobHandy employee ID is known
* [ ] Current employee state has been read
* [ ] `blocked=true` was validated with dry run
* [ ] Real write succeeded and request ID was stored
* [ ] Open orders and incidents were reviewed by the responsible process owner
* [ ] Local access, schedules, secrets, and exports were handled as required
* [ ] Any deletion or data-subject process was routed separately
