2019-08-06 11:02:54 +02:00
|
|
|
class InstructeurMailerPreview < ActionMailer::Preview
|
2017-05-12 16:56:46 +02:00
|
|
|
def last_week_overview
|
2019-08-06 11:02:54 +02:00
|
|
|
InstructeurMailer.last_week_overview(Instructeur.first)
|
2017-05-12 16:56:46 +02:00
|
|
|
end
|
2018-02-23 13:44:02 +01:00
|
|
|
|
|
|
|
def send_dossier
|
2019-08-06 11:02:54 +02:00
|
|
|
InstructeurMailer.send_dossier(instructeur, Dossier.new(id: 10, procedure: procedure), target_instructeur)
|
2018-02-23 13:44:02 +01:00
|
|
|
end
|
2018-10-03 11:11:02 +02:00
|
|
|
|
|
|
|
def send_login_token
|
2019-08-06 11:02:54 +02:00
|
|
|
InstructeurMailer.send_login_token(instructeur, "token")
|
2018-10-03 11:11:02 +02:00
|
|
|
end
|
2018-12-20 16:46:44 +01:00
|
|
|
|
2019-08-06 11:02:54 +02:00
|
|
|
def user_to_instructeur
|
|
|
|
InstructeurMailer.user_to_instructeur(instructeur.email)
|
2018-12-20 16:46:44 +01:00
|
|
|
end
|
|
|
|
|
2019-03-13 17:59:33 +01:00
|
|
|
def send_notifications
|
|
|
|
data = [
|
|
|
|
{
|
|
|
|
procedure_libelle: 'une superbe démarche',
|
|
|
|
procedure_id: 213,
|
|
|
|
nb_en_construction: 2,
|
2022-10-06 15:27:18 +02:00
|
|
|
nb_en_instruction: 2,
|
|
|
|
nb_accepted: 4,
|
2019-03-13 17:59:33 +01:00
|
|
|
nb_notification: 2
|
|
|
|
},
|
|
|
|
{
|
|
|
|
procedure_libelle: 'une démarche incroyable',
|
|
|
|
procedure_id: 213,
|
|
|
|
nb_en_construction: 1,
|
2022-10-06 15:27:18 +02:00
|
|
|
nb_en_instruction: 2,
|
|
|
|
nb_accepted: 5,
|
2019-03-13 17:59:33 +01:00
|
|
|
nb_notification: 1
|
|
|
|
}
|
|
|
|
]
|
2019-08-06 11:02:54 +02:00
|
|
|
InstructeurMailer.send_notifications(instructeur, data)
|
2019-03-13 17:59:33 +01:00
|
|
|
end
|
|
|
|
|
2018-12-20 16:46:44 +01:00
|
|
|
private
|
|
|
|
|
2019-08-06 11:02:54 +02:00
|
|
|
def instructeur
|
2019-10-16 16:39:19 +02:00
|
|
|
Instructeur.new(
|
|
|
|
id: 10,
|
|
|
|
user: User.new(email: 'instructeur@administration.gouv.fr')
|
|
|
|
)
|
2018-12-20 16:46:44 +01:00
|
|
|
end
|
2018-12-20 16:49:56 +01:00
|
|
|
|
2019-08-06 11:02:54 +02:00
|
|
|
def target_instructeur
|
2019-10-16 16:39:19 +02:00
|
|
|
Instructeur.new(
|
|
|
|
id: 12,
|
|
|
|
user: User.new(email: 'collegue@administration.gouv.fr')
|
|
|
|
)
|
2018-12-20 16:49:56 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def procedure
|
2019-03-13 17:59:33 +01:00
|
|
|
Procedure.new(id: 15, libelle: 'libelle')
|
|
|
|
end
|
|
|
|
|
|
|
|
def dossier
|
|
|
|
Dossier.new(id: 15, procedure: procedure)
|
2018-12-20 16:49:56 +01:00
|
|
|
end
|
2017-05-12 16:56:46 +02:00
|
|
|
end
|