2024-04-29 00:17:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-09-07 10:03:17 +02:00
|
|
|
class PrefillIdentity
|
|
|
|
attr_reader :dossier, :params
|
|
|
|
|
|
|
|
def initialize(dossier, params)
|
|
|
|
@dossier = dossier
|
|
|
|
@params = params
|
|
|
|
end
|
|
|
|
|
|
|
|
def to_h
|
|
|
|
if dossier.procedure.for_individual?
|
|
|
|
{
|
|
|
|
prenom: params["identite_prenom"],
|
|
|
|
nom: params["identite_nom"],
|
|
|
|
gender: ["M.", "Mme"].include?(params["identite_genre"]) ? params["identite_genre"] : nil
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|