2024-04-29 00:17:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-12-01 11:22:20 +01:00
|
|
|
class Dossiers::BatchAlertComponent < ApplicationComponent
|
|
|
|
attr_reader :batch
|
|
|
|
|
|
|
|
def initialize(batch:, procedure:)
|
|
|
|
@batch = batch
|
|
|
|
@procedure = procedure
|
2022-12-05 17:07:59 +01:00
|
|
|
set_seen_at! if batch.finished_at.present?
|
2022-12-01 11:22:20 +01:00
|
|
|
end
|
2022-12-02 12:42:26 +01:00
|
|
|
|
|
|
|
def set_seen_at!
|
|
|
|
@batch.seen_at = Time.zone.now
|
|
|
|
@batch.save
|
|
|
|
end
|
2022-12-01 11:22:20 +01:00
|
|
|
end
|