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

# Contracts

> Manage employment relationships between users and your company

## Overview

A **Contract** in Firstwork represents the formal relationship between a User and a Company. It's the core entity for workforce management — tracking employment status, role assignments, legal entity affiliation, and access permissions.

## Contract Model

| Field         | Description                                                |
| ------------- | ---------------------------------------------------------- |
| User          | The individual this contract belongs to                    |
| Company       | The organization the contract is with                      |
| Legal Entity  | The subsidiary or entity under which the contract operates |
| Status        | Current status (ACTIVE, INACTIVE, TERMINATED, etc.)        |
| Is Admin      | Whether this contract has admin privileges                 |
| Contract Type | Employee, contractor, temporary, etc.                      |
| Start Date    | When the contract begins                                   |
| End Date      | When the contract ends (if applicable)                     |
| Work Location | Assigned work location                                     |

## Contract Statuses

```mermaid theme={null}
stateDiagram-v2
    [*] --> Active: Contract created
    Active --> Inactive: Suspended
    Inactive --> Active: Reactivated
    Active --> Terminated: Employment ended
    Terminated --> [*]
```

| Status     | Description                   |
| ---------- | ----------------------------- |
| ACTIVE     | Currently employed/contracted |
| INACTIVE   | Temporarily suspended         |
| TERMINATED | Employment has ended          |
| PENDING    | Awaiting activation           |

## Access Control

Each contract is assigned an **Access Control List (ACL)** that determines what data and actions the user can access within the company.

### Permission Levels

* **Super Admin** — Full access to all resources and settings
* **Admin** — Broad access with some restrictions
* **Manager** — Access to their team and assigned resources
* **Staff** — Limited access based on role
* **Read-Only** — View-only access

### Permission Rules

Permissions are defined through **Permission Rules** that specify:

* **Action** — READ or WRITE
* **Entity Type** — What type of data (applications, forms, contracts, etc.)
* **Scope** — Inclusion or exclusion rules

Permissions are managed through the dashboard under **Settings > Access Control**.

## Contract Creation

Contracts can be created in several ways:

### Manual Creation

Admins can create contracts through the dashboard by associating a user with the company.

### Via Automation

The **Contract Creation Action** in automations can automatically create contracts when certain conditions are met (e.g., a candidate reaches the "Offer Accepted" stage).

### Bulk Creation

For high-volume operations, Firstwork supports **bulk contract creation**, enabling you to onboard hundreds of workers simultaneously.

### Via API

External systems can create contracts through the API.

## Contract and Onboarding

When a contract is created (typically after a successful hiring process), the user can be enrolled in an **Onboarding Flow** that guides them through:

1. Additional document collection
2. Policy acknowledgments
3. Training course enrollment (LMS)
4. System access provisioning
5. Equipment requests

## Automations

Contracts can trigger automations when:

* **Status changes** — Contract activated, suspended, or terminated
* **Field updates** — Legal entity changed, role updated
* **Scheduled events** — Contract expiration approaching

Common automation actions for contracts:

* Send welcome/exit emails
* Update external systems via webhooks
* Enroll in training courses

## Bulk Operations

Firstwork supports bulk contract operations:

* **Bulk create** — Create multiple contracts from a CSV or hiring flow
* **Bulk status update** — Change status for multiple contracts
* **Bulk automation trigger** — Fire automations for selected contracts

These operations run reliably in the background with progress tracking and error handling.
