case 1:
habit created today
marked today
case 2:
habit created yesterday
not marked yesterday
marked today
case 3:
habit created yesterday
not marked yesterday
not marked today
case 4:
habit created 5 days back
habit marked on 2nd and 5th day
case 5:
habit created 5 days back
habit marked on 1st and 4th day
case 6:
habit created 5 days back
habit marked on 1st and 5th day
case 7:
habit created 10 days back
marked on 2nd day
case 8:
habit created 10 days back
marked on 5nd day
case 9:
habit created 10 days back
marked on 10th day
case 10:
habit created 10 days back
not marked till date
Algorithm:
Process Habits till updates
if no update exist
goto Fill dummy updates
if only one update exist on created date
add update
goto Fill dummy updates
if more updates exist
fill gaps between each update and last update
Fill dummy updates
if updates less than 7
make updates array size as 7
if updates more than 7 and last update not on today
make updates till today