instructors : receive daily emails for declarative folders
This commit is contained in:
parent
50af70ad7c
commit
395af2fbb0
5 changed files with 181 additions and 0 deletions
|
@ -152,6 +152,8 @@ class Instructeur < ApplicationRecord
|
|||
|
||||
h = {
|
||||
nb_en_construction: groupe.dossiers.en_construction.count,
|
||||
nb_en_instruction: groupe.dossiers.en_instruction.count,
|
||||
nb_accepted: groupe.dossiers.accepte.where(processed_at: Time.zone.yesterday.beginning_of_day..Time.zone.yesterday.end_of_day).count,
|
||||
nb_notification: notifications_for_procedure(procedure, :not_archived).count
|
||||
}
|
||||
|
||||
|
@ -161,6 +163,14 @@ class Instructeur < ApplicationRecord
|
|||
acc << h
|
||||
end
|
||||
|
||||
[["en_instruction", h[:nb_en_instruction]], ["accepte", h[:nb_accepted]]].each do |state, count|
|
||||
if procedure.declarative_with_state == state && count > 0
|
||||
h[:procedure_id] = procedure.id
|
||||
h[:procedure_libelle] = procedure.libelle
|
||||
acc << h
|
||||
end
|
||||
end
|
||||
|
||||
acc
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue