This section explains the profileType creation process in order to make different comparisons between the actual user's consumtion and its profile type.
# Profile type data
The profileType data are stored in the profile doctype and includes the following informations :
```jsx
{
housingType:HousingType
constructionYear:ConstructionYear
area:number
occupantsNumber:number
outsideFacingWalls:OutsideFacingWalls
floor:Floor
heating:IndividualOrCollective
hotWater:IndividualOrCollective
individualInsulationWork:IndividualInsulationWork
facilitiesInstallation:FacilitiesInstallation
hotWaterEquipment:HotWaterEquipment[]
warmingFluid:FluidType|null
hotWaterFluid:FluidType|null
cookingFluid:FluidType
}
```
Each profileType value is an enum that you can find in the application. The values are set by default to a default profileType and needs to be completed by the user in order to become accurate.
# Profile type form
User should answer a form to be able to set its profile type.
User should answer a form to be able to set its profile type.
Here you can see the different methods provided by the profileType service. These methods allows to calculate the average consumption depending on the information gathered in user's profileType.
| getMonthlyForecast(month: number) : MonthlyForecast | Used to get the monthly forecast for a given month |
| getFluidForecast(fluidType: FluidType, month: number) : FluidForecast | Used to get the monthly forecast for a given FluidType |
| getDetailsMonthlyForecast(fluidType: FluidType, month: number): DetailsMonthlyForecast | Used to get the details of a fluidForecast. For each fluid return the related consumptions. |
| getMonthColdWaterConsumption(month: number): number | Returns the cold water consumption in L for a given month |
| getMonthElectricSpecificConsumption(month: number): number | Returns the electric specific consumption in kWh for a given month |
| getMonthCookingConsumption(month: number): number | Returns the cooking consumption in kWh for a given month |
| getMonthEcs(month: number) : number | Returns the hot water consumption in kWh for a given month |
| getMonthHeating(month: number): number | Returns the heating consumption in kWh for a given month |
| calculateTotalConsumption(spreadConsumption: number, profileType: ProfileType, month: number) : number | Returns the total ECS consumption with applyied corrections to the spreadConsumption depending on users facilities. |
| calculateSpreadNeeds(profileType: ProfileType, month: number): number | Calculate the water spread consumption |
| calculateMonthWaterRawNeeds(profileType: ProfileType, month: number) : number | Returns the raw water needs of a home |
| calculateWarmingEstimatedConsumption(): number | Calculates the estimated consumption of a home |
| calculateWarmingCorrectedConsumption(estimatedConsumption: number): number | Apply the different corrections to the estimated heating consumption |
| calculateWarmingMonthConsumption(correctedConsumption: number, month: number): number | Apply dju ratio to the corrected heating consumption |
Here is an example of a MonthlyForecast, which is the only function directly called by the analizis component :
```jsx
{
fluidForecast:[
{
detailsMonthlyForecast:{
coldWaterConsumption:null,
cookingConsumption:null,
ecsConsumption:null,
electricSpecificConsumption:266,
heatingConsumption:4074,
},
fluidType:0,
load:4340,
value:670.96,
},
{
detailsMonthlyForecast:{
coldWaterConsumption:14911,
cookingConsumption:null,
ecsConsumption:null,
electricSpecificConsumption:null,
heatingConsumption:null,
},
fluidType:1,
load:14911,
value:46.224,
},
{
detailsMonthlyForecast:{
coldWaterConsumption:null,
cookingConsumption:85,
ecsConsumption:290,
electricSpecificConsumption:null,
heatingConsumption:null,
},
fluidType:2,
load:375,
value:29.737,
},
],
month:1,
totalValue:746.921,
}
```
In these data, the load is in kWh for gaz and electricity (fluidtype 0 and 2) and in L for water. Value and totalValue are given in euros. The different consumption are distributed to their corresponding fluidType according to the variables **_warmingFluid, hotWaterFluid, cookingFluid _**. For example, if the cookingFluid is gaz, then its value will be stored in the fluidType 2 and nulled in the others.
Also, we consider that if the heating or the hotwater are collective, we don't calcute it because the user can never access his personnal consumption, so it doesn't takes place in the calculation.