# Data Model

# Introduction

The service can save and manage the notes added from a Digital user related to one or more entities of external services. With the same model it is possible to represent even folders, groups of identifiers of external entities that have logical relationship between them. To use the service it is necessary a user token that is compatible with teamsystemId.

# Model

Annotation is the base model in which the entire service is based. It has the following format:

```JSON
{
    "id": "string",
    "type": "string",
    "text": "string",
    "classification": "string",
    "referencing_date": "date",
    "reference_period": "string",
    "reference_type": "string",
    "reference_ids": [
      "string"
    ],
    "deleted": "boolean",
    "ownership": {
        "type": "string",
        "identifier": "string"
    },
    "item_classifier": "string",
    "inserted_by": "string",
    "inserted_at": "date",
    "modified_at": "date"
}
```

- **id**: unique identifier of the annotation, in UUID format
- **type**: specifies the annotation type. It can have the following values: 
    - **NOTE**
    - **FOLDER**
- **text**: contains information about the annotation. It has a maximum length of 1000 characters. Depending on the type, the information contained can be: 
    - **note text**: the text value, in case the annotation is of type NOTE
    - **folder name**: the name of the folder, in case the annotation is of type FOLDER
- **classification**: it can have the following possible values: 
    - **PERSONALIZZATO**
    - **BANCA**
    - **BILANCIO**
    - **DICHIARAZIONI**
    - **CONTENZIOSO**
- **referencing\_date**: the referencing date
- **reference\_period:** the year of reference
- **reference\_type**: the reference type, at the moment the only possible value is **DOCSTORE**
- **reference\_ids**: the ids of the related documents
- **deleted**: specifies if the annotation is deleted or not
- **ownership**: specifies the ownership of the annotation. It contains the following 2 fields: 
    - **type**: it can be **WS** or **ITEM**
    - **identifier**: the item identifier
- **item\_classifier**: it can be **ACCOUNTANT** or **COMPANY**
- **inserted\_by**: the name of the creator of the annotation
- **inserted\_at**: the timestamp of the annotation creation
- **modified\_at**: the timestamp of the last edit of the annotation