Quality on timeseries dataframe needs to be aggregated for every aggregation step.
We must do this because the current implementation of aggregated quality only supports aggregation on grid area, metering point type and resolution.
But in reality we need to aggregate quality for all types of grouping we work with.
Examples of groupings:
step 1 - IN grid area, OUT grid area, Resolution
step 2 - IN grid area, Resolution and OUT grid area, Resolution
Grid area, Resolution
Grid area, BRP, Resolution
Grid area, Energy Supplier, Resolution
Grid area, BRP, Energy Supplier, Resolution
One way to solve this would be to create a function which corresponds to each grouping and aggregate quality in those steps.
UPDATE:
We should refactor table to hold numeric values where it's applicable, eg. Quality, ConnectionState etc.
Maybe we should just add more columns, so we keep the normal column representation besides the numeric column.
Quality is aggregated per grouping stated in the description
Rules for aggregated quality based on quality must comply with rules stated here #118045