As we build the Grainchek mobile app a key component is the function of the feed. A feed needs to report to the user how many hours were spent on the tasks included. A feed has a time range, list of tasks it adds and possibly a list of sub-feeds to be included with the original. Each event in a stream should be counted in the feed only once if it falls within the time range and list of tasks for the feed. In the model above how many hours should the P1: F1 accumulate? What about P3: F4? Which feed should I look at to see how many hours were spent on break for the first day of P2?
In the Grainchek app we also need to be able to handle a data model similar to the one above. When a sub-feed is included within another feed, only events that are included in all time ranges should be accumulated. When a feed specifies tasks of a sub-feed, only those tasks are accumulated from the sub-feed. How many hours should P1: F3 accumulate? This user is using P2 only to accumulate other feeds.
In the first example-
P1:F1 should add up to 270
P3:F4 should add up to 300
The F2 feed includes break time for the first day
In the second example-
P1:F3 should add up to 420 (The event T1-120 does not fall within the time range set by the parent feed)