I think your model is fine, but given these requirements you are missing an index on.
‘sales_by_goods_and_timerange’.
That index will be an index on sales which indexes the ‘goods’ reference (since it’s an exact match, it’ll be a term on the index) since I assume your sale document will contain a reference to the goods document. The values of that index will need to start with the timestamp.
That brings us to another advice, depending on how you are going to do the range indexes you will need multiple indexes. You might just want to use a timestamp as well next to Year and Month to be a able to write different indexes depending on your requirements: