I need some help on what's the best way of implementing solidity code that keeps track of a user's daily data. Once the day passes it's stored in an array for every single day that passes and that daily data is reset for the next day. I would like to get some ideas or sample code related to this?
If I am not explaining it correctly think of it as if someone wants to keep track of their homework everyday. We keep a history of all the days that have passed and are able to show on the UI the current day homework and any of the days in the past.
My current implementation is the following:
mapping(address => Homework) public daily; mapping(address => Homework) public overall;
Is this the right approach, I am basically running a scheduler to run every day and once it executes the daily would be reset for each user and push in the daily to the overall. But I cannot get access to the keys for the mapping making this approach difficult. Any other suggestions?