---
title: "Planning"
description: "Zmiany i zasoby. Każda aplikacja jest modułem na jednym modelu danych."
canonical: "https://obop.dev/pl/apps/planning/"
lang: "pl"
---

# Planning

## Do czego służy

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.

## Co pakiet robi, a czego nie robi

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.

## Modele

### `planning_role`

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

Grupa odczytu: `planning.user`. Grupa zapisu: `planning.manager`.

| Pole | Rodzaj | Klasa danych | Dane osobowe | Grupa | Agenci widzą | Opis |
|---|---|---|---|---|---|---|
| `name` | text | `none` | nie | `planning.user` | jawnie | Role name |
| `note` | longtext | `none` | nie | `planning.user` | jawnie | What the role involves |

### `planning_template`

A reusable shift pattern to copy into shifts

Grupa odczytu: `planning.user`. Grupa zapisu: `planning.manager`.

| Pole | Rodzaj | Klasa danych | Dane osobowe | Grupa | Agenci widzą | Opis |
|---|---|---|---|---|---|---|
| `name` | text | `none` | nie | `planning.user` | jawnie | Template name, for example Morning shift |
| `role_id` | ref → planning_role | `none` | nie | `planning.user` | jawnie | The role the template is for |
| `start_minute` | number | `none` | nie | `planning.user` | jawnie | Start in minutes since midnight (540 is 09:00) |
| `end_minute` | number | `none` | nie | `planning.user` | jawnie | 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

Grupa odczytu: `planning.user`. Grupa zapisu: `planning.manager`.

| Pole | Rodzaj | Klasa danych | Dane osobowe | Grupa | Agenci widzą | Opis |
|---|---|---|---|---|---|---|
| `name` | text | `none` | nie | `planning.user` | jawnie | Short title, for example Opening shift |
| `role_id` | ref → planning_role | `none` | nie | `planning.user` | jawnie | The role needed |
| `employee_id` | ref → hr_employee | `internal` | tak | `planning.user` | zamaskowane | Employee the shift is assigned to; empty for an open shift |
| `work_date` | date | `none` | nie | `planning.user` | jawnie | Day of the shift (YYYY-MM-DD) |
| `start_minute` | number | `none` | nie | `planning.user` | jawnie | Start in minutes since midnight, 0 to 1439 (540 is 09:00) |
| `end_minute` | number | `none` | nie | `planning.user` | jawnie | End in minutes since midnight, 0 to 1439 (1020 is 17:00) |
| `note` | longtext | `none` | nie | `planning.user` | jawnie | Instructions for whoever works the shift |
| `state` | select (open, published, confirmed) | `none` | nie | `planning.user` | jawnie | Shift status: open, published, confirmed |

## Przepływy pracy

### `planning_shift`

| Akcja | Przenosi | Kto może uruchomić | Zatwierdzenie |
|---|---|---|---|
| `planning_shift.publish` | state: open → published | `planning.manager` | nie |
| `planning_shift.unpublish` | state: published → open | `planning.manager` | nie |
| `planning_shift.confirm` | state: published → confirmed | `planning.manager` | nie |

## Grupy uprawnień

Grupy używane przez tę aplikację:

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

## Kroki zatwierdzania

Żaden krok w tej aplikacji nie wymaga zatwierdzenia, poza usuwaniem rekordów.

## Co agenci mogą, a czego nie mogą

Agent może odczytywać, wyszukiwać, tworzyć i aktualizować rekordy tej aplikacji oraz uruchamiać akcje niewymagające zatwierdzenia, w ramach grup uprawnień swojego tokenu.

Te kroki może tylko zaproponować, a człowiek musi je zatwierdzić: `planning_role.delete`, `planning_template.delete`, `planning_shift.delete`.

Dane osobowe są maskowane jako tokeny zastępcze: `planning_shift.employee_id`.

## Zależności

- `hr`

## Instalacja

Zainstaluj ją w aplikacji Customize (Marketplace) lub z wiersza poleceń:

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

Wymaga bazy danych i uprawnień administratora.

## Zbuduj własną

[Przewodnik po modułach pokazuje, jak pisze się takie aplikacje](/pl/docs/reference/module-manifest/)
