---
title: "Planning"
description: "Vuorot ja resurssit. Jokainen sovellus on moduuli samalla tietomallilla."
canonical: "https://obop-platform.sliplane.app/fi/apps/planning/"
lang: "fi"
---

# Planning

## Mihin se on tarkoitettu

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.

## Mitä paketti tekee ja mitä ei

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.

## Mallit

### `planning_role`

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

Lukuryhmä: `planning.user`. Kirjoitusryhmä: `planning.manager`.

| Kenttä | Tyyppi | Tietoluokka | Henkilötieto | Ryhmä | Agentit näkevät | Kuvaus |
|---|---|---|---|---|---|---|
| `name` | text | `none` | ei | `planning.user` | selkoisena | Role name |
| `note` | longtext | `none` | ei | `planning.user` | selkoisena | What the role involves |

### `planning_template`

A reusable shift pattern to copy into shifts

Lukuryhmä: `planning.user`. Kirjoitusryhmä: `planning.manager`.

| Kenttä | Tyyppi | Tietoluokka | Henkilötieto | Ryhmä | Agentit näkevät | Kuvaus |
|---|---|---|---|---|---|---|
| `name` | text | `none` | ei | `planning.user` | selkoisena | Template name, for example Morning shift |
| `role_id` | ref → planning_role | `none` | ei | `planning.user` | selkoisena | The role the template is for |
| `start_minute` | number | `none` | ei | `planning.user` | selkoisena | Start in minutes since midnight (540 is 09:00) |
| `end_minute` | number | `none` | ei | `planning.user` | selkoisena | 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

Lukuryhmä: `planning.user`. Kirjoitusryhmä: `planning.manager`.

| Kenttä | Tyyppi | Tietoluokka | Henkilötieto | Ryhmä | Agentit näkevät | Kuvaus |
|---|---|---|---|---|---|---|
| `name` | text | `none` | ei | `planning.user` | selkoisena | Short title, for example Opening shift |
| `role_id` | ref → planning_role | `none` | ei | `planning.user` | selkoisena | The role needed |
| `employee_id` | ref → hr_employee | `internal` | kyllä | `planning.user` | maskattu | Employee the shift is assigned to; empty for an open shift |
| `work_date` | date | `none` | ei | `planning.user` | selkoisena | Day of the shift (YYYY-MM-DD) |
| `start_minute` | number | `none` | ei | `planning.user` | selkoisena | Start in minutes since midnight, 0 to 1439 (540 is 09:00) |
| `end_minute` | number | `none` | ei | `planning.user` | selkoisena | End in minutes since midnight, 0 to 1439 (1020 is 17:00) |
| `note` | longtext | `none` | ei | `planning.user` | selkoisena | Instructions for whoever works the shift |
| `state` | select (open, published, confirmed) | `none` | ei | `planning.user` | selkoisena | Shift status: open, published, confirmed |

## Työnkulut

### `planning_shift`

| Toiminto | Siirtää | Kuka voi suorittaa | Hyväksyntä |
|---|---|---|---|
| `planning_shift.publish` | state: open → published | `planning.manager` | ei |
| `planning_shift.unpublish` | state: published → open | `planning.manager` | ei |
| `planning_shift.confirm` | state: published → confirmed | `planning.manager` | ei |

## Käyttöoikeusryhmät

Tämän sovelluksen käyttämät ryhmät:

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

## Hyväksyntävaiheet

Mikään tämän sovelluksen vaihe ei vaadi hyväksyntää tietueiden poistamista lukuun ottamatta.

## Mitä agentit voivat ja eivät voi tehdä

Agentti voi lukea, hakea, luoda ja päivittää tämän sovelluksen tietueita sekä suorittaa toiminnot, jotka eivät vaadi hyväksyntää, tunnisteensa käyttöoikeusryhmien rajoissa.

Se voi vain ehdottaa näitä vaiheita, ja ihmisen on hyväksyttävä ne: `planning_role.delete`, `planning_template.delete`, `planning_shift.delete`.

Henkilötiedot maskataan paikkamerkeiksi: `planning_shift.employee_id`.

## Riippuvuudet

- `hr`

## Asennus

Asenna se Customize-sovelluksesta (Marketplace) tai komentoriviltä:

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

Vaatii tietokannan ja ylläpitäjän oikeudet.

## Tee oma

[Moduulioppaassa näytetään, miten tällaiset sovellukset kirjoitetaan](/fi/docs/reference/module-manifest/)
