---
title: "Documents"
description: "Tiedostot ja kansiot. Jokainen sovellus on moduuli samalla tietomallilla."
canonical: "https://obop.dev/fi/apps/documents/"
lang: "fi"
---

# Documents

## Mihin se on tarkoitettu

A register of business documents with folder, kind, owner, expiry and confidentiality. It stores references to documents, not the file contents.

## Mitä paketti tekee ja mitä ei

A register of business documents: folders, document records with kind, owner, expiry and confidentiality, and a draft, published and archived flow. It stores references and, when you upload one, the file itself. Confidentiality is enforced: confidential and restricted documents are visible only to their owner and to documents.manager; public and internal ones to everyone who may read documents.

## Moduulin tiedot

- **Versio:** `0.3.0`
- **Tekijä:** SpaceCorps
- **Lisenssi:** [AGPL-3.0-or-later](https://spdx.org/licenses/AGPL-3.0-or-later.html)
- **Vaatii ytimen:** `^0.2` (nykyinen ydin on 0.2.0)
- **Kypsyys:** Beta
- **Luokat:** Tuottavuus

## Mallit

### `documents_folder`

A folder that groups documents

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

| Kenttä | Tyyppi | Tietoluokka | Henkilötieto | Ryhmä | Agentit näkevät | Kuvaus |
|---|---|---|---|---|---|---|
| `name` | text | `none` | ei | `documents.user` | selkoisena | Folder name |
| `parent_id` | ref → documents_folder | `none` | ei | `documents.user` | selkoisena | The folder this one sits in |
| `description` | longtext | `none` | ei | `documents.user` | selkoisena | What belongs in the folder |

### `documents_document`

A contract, policy, certificate or other document on record

Lukuryhmä: `documents.user`. Kirjoitusryhmä: `documents.user`.

| Kenttä | Tyyppi | Tietoluokka | Henkilötieto | Ryhmä | Agentit näkevät | Kuvaus |
|---|---|---|---|---|---|---|
| `title` | text | `none` | ei | `documents.user` | selkoisena | Document title |
| `folder_id` | ref → documents_folder | `none` | ei | `documents.user` | selkoisena | The folder the document is filed in |
| `kind` | select (contract, invoice, policy, report, certificate, other) | `none` | ei | `documents.user` | selkoisena | Type of document: contract, invoice, policy, report, certificate, other |
| `confidentiality` | select (public, internal, confidential, restricted) | `none` | ei | `documents.user` | selkoisena | Who may see it: public and internal documents everyone who may read documents, confidential and restricted ones only the owner and documents.manager |
| `open_to_all` | bool | `none` | ei | `documents.user` | selkoisena | Whether everyone who may read documents can see this one: true for public and internal documents |
| `owner` | text | `internal` | kyllä | `documents.user` | maskattu | User name of the person responsible for the document; the person who creates it unless set otherwise. Owners see their confidential documents |
| `reference` | text | `none` | ei | `documents.user` | selkoisena | Reference number, for example a contract number |
| `location` | text | `none` | ei | `documents.user` | selkoisena | Where the file is stored, such as a link or archive box |
| `attachment` | file | `internal` | ei | `documents.user` | selkoisena | The document file itself (PDF, image, text, spreadsheet or office document, up to 25 MiB); served only as a download to people who may read the record |
| `expires_on` | date | `none` | ei | `documents.user` | selkoisena | Date after which the document is no longer valid (YYYY-MM-DD) |
| `summary` | longtext | `none` | ei | `documents.user` | selkoisena | What the document says, in a few lines |
| `state` | select (draft, published, archived) | `none` | ei | `documents.user` | selkoisena | Document status: draft, published, archived |

## Työnkulut

### `documents_document`

| Toiminto | Siirtää | Kuka voi suorittaa | Hyväksyntä |
|---|---|---|---|
| `documents_document.publish` | state: draft → published | `documents.user` | ei |
| `documents_document.archive` | state: published → archived | `documents.manager` | ei |

## Käyttöoikeusryhmät

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

- `documents.manager`
- `documents.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: `documents_folder.delete`, `documents_document.delete`.

Henkilötiedot maskataan paikkamerkeiksi: `documents_document.owner`.

## Riippuvuudet

Ei ole.

## Asennus

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

```bash
obop modules install-from documents
```

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

## Tee oma

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