diff --git a/docs/ecolyo/functionalities/initialization.md b/docs/ecolyo/functionalities/initialization.md index 8d5550268cc75503701167080f65dc686dae0bd4..c3bfc13a27869d98649fdf0a34ca379e990533b2 100644 --- a/docs/ecolyo/functionalities/initialization.md +++ b/docs/ecolyo/functionalities/initialization.md @@ -53,3 +53,34 @@ You can see more on [cozy documentation](https://docs.cozy.io/en/cozy-doctypes/d } } ``` + +### UserData creation + +We create a userData and store it in the couchDB under the doctype userData name '**com.grandlyon.ecolyo.userDataName'.** During this process, the objects related to the dataEntity will be be converted to an user version which contains informations about the user(example: user progress, the fluids connected and so on). + +To illustrate this, let's show an example of the conversion of quizEntity to userQuiz : + +```jsx +DuelEntity { + id: string + title: string + description: string + duration: Duration +} +``` + +Becomes : + +```jsx +UserQuiz { + id: string + title: string + description: string + duration: Duration + threshold: number + state: UserDuelState + startDate: string | null + fluidTypes: FluidType[] + userConsumption: number +} +```