@startuml

skinparam sequence {
         	ArrowColor SteelBlue
         	ActorBorderColor Dimgray
         	LifeLineBorderColor MidnightBlue
         	LifeLineBackgroundColor #A9DCDF

         	ParticipantBorderColor Dimgray
         	ParticipantBackgroundColor SteelBlue
         	ParticipantFontName Calibri Bold
         	ParticipantFontSize 17
         	ParticipantFontColor Ivory

         	ActorBackgroundColor SteelBlue
         	ActorFontColor MidnightBlue
         	ActorFontSize 17
         	ActorFontName Aapex

         }
skinparam note {
BorderColor SteelBlue
}
autonumber
hidefootbox

":ComfortLevelService" -> ":HouseRepo": getHouseGA()
":ComfortLevelService" -> ":ExternalSensorRepo": getNearestTemperatureSensor(gaID,gaLocation)
":ExternalSensorRepo" -> "ExternalSensor\nCRUD": findSensorsByGaId(gaId)
":ExternalSensorRepo" -> ":ExternalSensorRepo": getNearestTemperatureSensor\n(gaLocation,temperature)

loop for each day in time interval
":ComfortLevelService" -> ":InternalSensorRepo": rL = getReadingsInSpecificDay(day,sensorID)
":InternalSensorRepo"->"InternalSensors\nReadingsCRUD": findReadingsInSpecificDay\n(day,sensorID)
":ComfortLevelService" -> ":ExternalSensorRepo": outAverage = dailyAverageOfReadings(day,sensorID)
":ExternalSensorRepo" -> "ExternalSensor\nReadingsCRUD": findReadingsInSpecificDay\n(day,sensorID)
":ComfortLevelService" -> ":ComfortLevelService":
note right #FFFF
 can be:
    maxTemp = getMaxTemperatureForComfortLevel(outAverage,category)
   or
    minTemp = getMinTemperatureForComfortLevel(outAverage,category)
end note

":ComfortLevelService" -> ":ComfortLevelService":
note right #FFFF
 can be:
    getReadingsAboveComfortLevel(rL,maxTemp)
   or
    getReadingsBelowComfortLevel(rL,minTemp)
end note
end

@enduml