---
title: "Planning"
description: "Shifts and resources. Plan shifts for employees from reusable templates."
canonical: "https://obop-platform.sliplane.app/apps/planning/"
lang: "en"
---

# Planning

## What it is for

Plan shifts for employees from reusable templates. A shift with nobody assigned is an open shift; the workflow runs from open through published to confirmed by the employee.

## What the package does and does not do

Shifts for employees, with roles and reusable templates. A shift has a day and a start and end in minutes since midnight (0 to 1439; 540 is 09:00). A shift with no employee is an open shift. Workflow: open, published, confirmed by the employee. Needs the Human Resources package.

## Models

### `planning_role`

A role a shift is planned for, for example cashier or electrician

Read group: `planning.user`. Write group: `planning.manager`.

| Field | Kind | Data class | Personal data | Group | Agents see | Description |
|---|---|---|---|---|---|---|
| `name` | text | `none` | no | `planning.user` | in clear | Role name |
| `note` | longtext | `none` | no | `planning.user` | in clear | What the role involves |

### `planning_template`

A reusable shift pattern to copy into shifts

Read group: `planning.user`. Write group: `planning.manager`.

| Field | Kind | Data class | Personal data | Group | Agents see | Description |
|---|---|---|---|---|---|---|
| `name` | text | `none` | no | `planning.user` | in clear | Template name, for example Morning shift |
| `role_id` | ref → planning_role | `none` | no | `planning.user` | in clear | The role the template is for |
| `start_minute` | number | `none` | no | `planning.user` | in clear | Start in minutes since midnight (540 is 09:00) |
| `end_minute` | number | `none` | no | `planning.user` | in clear | End in minutes since midnight (1020 is 17:00) |

### `planning_shift`

A slot of work on one day for one role, optionally assigned to an employee

Read group: `planning.user`. Write group: `planning.manager`.

| Field | Kind | Data class | Personal data | Group | Agents see | Description |
|---|---|---|---|---|---|---|
| `name` | text | `none` | no | `planning.user` | in clear | Short title, for example Opening shift |
| `role_id` | ref → planning_role | `none` | no | `planning.user` | in clear | The role needed |
| `employee_id` | ref → hr_employee | `internal` | yes | `planning.user` | masked | Employee the shift is assigned to; empty for an open shift |
| `work_date` | date | `none` | no | `planning.user` | in clear | Day of the shift (YYYY-MM-DD) |
| `start_minute` | number | `none` | no | `planning.user` | in clear | Start in minutes since midnight, 0 to 1439 (540 is 09:00) |
| `end_minute` | number | `none` | no | `planning.user` | in clear | End in minutes since midnight, 0 to 1439 (1020 is 17:00) |
| `note` | longtext | `none` | no | `planning.user` | in clear | Instructions for whoever works the shift |
| `state` | select (open, published, confirmed) | `none` | no | `planning.user` | in clear | Shift status: open, published, confirmed |

## Workflows

### `planning_shift`

| Action | Moves | Who may run it | Approval |
|---|---|---|---|
| `planning_shift.publish` | state: open → published | `planning.manager` | no |
| `planning_shift.unpublish` | state: published → open | `planning.manager` | no |
| `planning_shift.confirm` | state: published → confirmed | `planning.manager` | no |

## Permission groups

Groups used by this app:

- `planning.manager`
- `planning.user`

## Approval steps

No step in this app needs an approval, apart from deleting records.

## What agents can and cannot do

An agent can read, search, create and update records of this app, and run the actions that need no approval, within the permission groups of its token.

It can only propose these steps, and a person must approve them: `planning_role.delete`, `planning_template.delete`, `planning_shift.delete`.

Personal data is masked as placeholder tokens: `planning_shift.employee_id`.

## Dependencies

- `hr`

## Install

Install it from the Customize app (Marketplace), or from the command line:

```bash
obop modules install-from planning
```

Needs a database and administrator rights.

## Build your own

[The module guide shows how apps like this one are written](/docs/reference/module-manifest/)
