Before this commit, the monthly dossiers count was serialized into the
Stat record using human-formatted dates, as:
```ruby
s.dossiers_in_the_last_4_months = {
"octobre 2021"=>409592,
"novembre 2021"=>497823,
"décembre 2021"=>38170,
"janvier 2022"=>0
}
```
Turns out the ordering of keys in a serialized hash is not guaranteed.
After a round-trip to the database, the keys will be wrongly sorted.
Instead we want to save raw Date objects, which will preserve the
ordering. The date formatting can be applied at display-time by the
controller.
Fix#6848
tech(question): discard_and_keep_track! ; are we really keeping track with default_scope { kept } ?
feat(stats): add DeletedDossier in Stat computations
Revert "tech(question): discard_and_keep_track! ; are we really keeping track with default_scope { kept } ?"
This reverts commit d1155b7eeaaf1a9f80189e59667e109541fcb089.
feat(stats): support deleted_dossiers for last_four_months_hash and cumulative_hash. extract sanitize query & merge hashes in methdos
clean(rubocop): lint with rubocop
Update db/migrate/20211126080118_add_index_to_deleted_at_to_deleted_dossiers.rb
Co-authored-by: LeSim <mail@simon.lehericey.net>
fix(rubocop): avoid uneeded allocation
fix(migration): add concurrent index with expected synthax
fix(brakeman): add ignore message since group date_trunc evaluation is used by only ourself