2024-04-29 00:17:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-11-09 16:41:32 +01:00
|
|
|
class ResetExpiringDossiersJob < ApplicationJob
|
|
|
|
def perform(procedure)
|
2023-12-05 17:49:19 +01:00
|
|
|
procedure
|
|
|
|
.dossiers
|
2023-11-09 16:41:32 +01:00
|
|
|
.in_batches do |relation|
|
2023-12-05 17:49:19 +01:00
|
|
|
relation.each do |dossier|
|
|
|
|
if dossier.expiration_started?
|
|
|
|
dossier.update(brouillon_close_to_expiration_notice_sent_at: nil,
|
|
|
|
en_construction_close_to_expiration_notice_sent_at: nil,
|
|
|
|
termine_close_to_expiration_notice_sent_at: nil)
|
|
|
|
end
|
|
|
|
end
|
2023-11-09 16:41:32 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|