Nettoyage des dossiers préremplis abandonnés (#8341)

* Clean prefilled dossiers
This commit is contained in:
Damien Le Thiec 2023-01-12 16:14:42 +01:00 committed by GitHub
parent 82df012933
commit d5bfe84381
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,7 @@
class Cron::ExpiredPrefilledDossiersDeletionJob < Cron::CronJob
self.schedule_expression = "every day at 3:00"
def perform
Dossier.prefilled.state_brouillon.where(user_id: nil, updated_at: ..5.days.ago).destroy_all
end
end