@@ -56,6 +56,39 @@ Depends on the type of an exploration, either the exploration remains in progres
When the user finish the exploration, he got a success message and five more stars on his challenge progression.
## Action
Action is a feature which in the user has to apply an ecogesture for a given duration in order to reduce his consumption. An action refers to the model **UserAction** in the app, and is an extention of an ecogesture to which we add an _startDate_ and a _userActionState_, allowing user to manage the action state depending on user's progress.
```jsx
UserAction{
ecogesture:Ecogesture|null
state:UserActionState
startDate:DateTime|null
}
```
Unlike the exploration, duel and quiz, there is no relationship for an action in the **ChallengeEntity** model, given that the action is picked by the user. So once it is picked, it is directly stored in the current **UserChallenge**.
When a user launches an action, there is several possible cases :
### The user has not completed his consumption profile
If the user's profile has never been completed, the application will purpose him the default action list which is defined in the action service. The first one of this list will be shown at first, and if the user wants to pick another one, he'll have the choice between the three ecogestures of the default list.
### The user has completed his consumption profile
If the user has completed his profile, the application will purpose him a list of three custom ecogestures. The list is built the following way :
1. First we look for the action that haven't been done yet
2. We pick only the actions that are available for the user's connected fluids
3. We pick the action that are appliable during the current season. At this moment, if the list is smaller than 3, we complete it with actions whose value for property **Season** is _NONE_
4. If the list is still smaller than 3 after this, we complete with default actions (This case is rare)
5. Finally, we sort the list of action by efficency and then difficulty. We put the most efficient actions and with the lowest difficulty in first.
At any moment of an action, a user can consult his progress through a clock icon and the ending date of his action.
The accomplishment of an action is only conditionned by the duration. Once the user completes an action, he'll see a notification on the app and then win his five stars when he comes back to the action screen.