# Configurator Basics

## Glossary
 - The word "Configurator" is used for the product as a whole, something that the client orders and a link that provides the same setup (apart from minor adjustments for the individual apartment). In the following, the word is used with the last meaning (a link).
 - The word "Type" is used interchangeable with the word "Configurator" (in Configurator 1.0 and Configurator 2.0) or interchangeable with the word "Apartment" (in Configurator 2.0 if each apartment has a separate link). In the following we will not use the term to avoid confusion.

## Introduction
 - A Configurator in Strapi is the highest level in the hierarchy within a project.
 - Each Configurator has a separate link.
 - Each link also needs an apartment nr (`?nr=HO.1.01`). 
 - If multiple apartments use the same Configurator, most data will be reused and the locally saved Configuration will share the same slot. (not desirable - should be fixed) 

## Hierarchy

``` plantuml
@startuml
!define STYLE_RG
!includeurl https://raw.githubusercontent.com/raumgleiter/PlantUML-Style/master/PlantUML_Style.puml
!include <tupadr3/common>
!include <tupadr3/font-awesome/rocket>
!include <tupadr3/font-awesome-5/user>

' All Skinparams: https://plantuml-documentation.readthedocs.io/en/latest/formatting/all-skin-params.html
' skinparam defaultTextAlignment center

' allowmixing
' skinparam ClassAttributeIconSize 0.1
' skinparam CircledCharacterRadius 0
' skinparam CircledCharacterFontSize 0

'-----------------------------------------------------------------------------

'left to right direction

'******************************************************************************

'-----------------------------------------------------------------------------

class Apartment {
  The physical apartment.
  Has it's own floorplan.
  (doesn't exist in strapi)
}

package Core {
  class Configurator {
    The link to the configuration tool.
  }
  class Scene {
    A location in the apartment.
  }
  class Viewpoint {
    A camera position at the location.
    Can also be used as a floor or part of the floorplan.
  }
  class Option {
    Something users can choose.
  }
  class Variant {
    The available things to choose.
    + price
  }
}

class Configuration {
  A saved state of a Configurator.
}
class price_adjustment {
  Prices are set in the Variant.
  A price adjustment can overwrite it based on the Configurator.
}
class Preset {
  Also known as "Design Line".
  At the beginning of the experience,
  the user can select between different Presets.
  Marks, what Variant is used for which Preset.
}

Apartment "* or 1" ..> "1" Configurator
Configurator "*" --> "*" Scene
Scene "1" --o "1..*" Viewpoint
Scene "*" --> "*" Option
Option "1" --o "*" Variant
Variant "1" --o "0..*" price_adjustment
Configurator "1" <-- "*" price_adjustment

Variant "*" --> "0..*" Preset

Option "*" <-- "*" Configuration
Configurator "1" <-- "*" Configuration


'-----------------------------------------------------------------------------

'******************************************************************************

@enduml
```

