feat(api.mandataire): add missing mandataire_first_name/last_name
Co-authored-by: Colin Darie <colin@darie.eu>
This commit is contained in:
parent
31168f9602
commit
77927e41bc
4 changed files with 17 additions and 3 deletions
|
@ -294,6 +294,9 @@ class API::V2::StoredQuery
|
|||
usager {
|
||||
email
|
||||
}
|
||||
prenomMandataire
|
||||
nomMandataire
|
||||
deposeParUnTiers
|
||||
connectionUsager
|
||||
groupeInstructeur {
|
||||
...GroupeInstructeurFragment
|
||||
|
|
|
@ -1416,6 +1416,7 @@ type Dossier {
|
|||
dateTraitementSVASVR: ISO8601DateTime
|
||||
demandeur: Demandeur!
|
||||
demarche: DemarcheDescriptor!
|
||||
deposeParUnTiers: Boolean
|
||||
|
||||
"""
|
||||
L’URL du GeoJSON contenant les données cartographiques du dossier.
|
||||
|
@ -1427,6 +1428,7 @@ type Dossier {
|
|||
messages(id: ID): [Message!]!
|
||||
motivation: String
|
||||
motivationAttachment: File
|
||||
nomMandataire: String
|
||||
|
||||
"""
|
||||
Le numero du dossier.
|
||||
|
@ -1438,6 +1440,7 @@ type Dossier {
|
|||
"""
|
||||
pdf: File
|
||||
prefilled: Boolean!
|
||||
prenomMandataire: String
|
||||
revision: Revision! @deprecated(reason: "Utilisez le champ `demarche.revision` à la place.")
|
||||
|
||||
"""
|
||||
|
|
|
@ -50,10 +50,14 @@ module Types
|
|||
field :attestation, Types::File, "L’URL de l’attestation au format PDF.", null: true
|
||||
|
||||
field :usager, Types::ProfileType, "Profile de l'usager déposant le dossier", null: false
|
||||
|
||||
field :groupe_instructeur, Types::GroupeInstructeurType, null: false
|
||||
field :revision, Types::RevisionType, null: false, deprecation_reason: 'Utilisez le champ `demarche.revision` à la place.'
|
||||
|
||||
field :demandeur, Types::DemandeurType, null: false
|
||||
field :prenom_mandataire, String, null: true, method: :mandataire_first_name
|
||||
field :nom_mandataire, String, null: true, method: :mandataire_last_name
|
||||
field :depose_par_un_tiers, Boolean, method: :for_tiers
|
||||
|
||||
field :instructeurs, [Types::ProfileType], null: false
|
||||
|
||||
|
@ -89,8 +93,8 @@ module Types
|
|||
if object.user_deleted?
|
||||
:deleted
|
||||
else
|
||||
user_loader.then do |user|
|
||||
if user.france_connect_information.present?
|
||||
user_loader.then do |_user|
|
||||
if object.user_from_france_connect?
|
||||
:france_connect
|
||||
else
|
||||
:password
|
||||
|
|
|
@ -1193,7 +1193,7 @@ class Dossier < ApplicationRecord
|
|||
columns = [
|
||||
['ID', id.to_s],
|
||||
['Email', user_email_for(:display)],
|
||||
['FranceConnect ?', user.france_connect_information.present?]
|
||||
['FranceConnect ?', user_from_france_connect?]
|
||||
]
|
||||
|
||||
if procedure.for_individual?
|
||||
|
@ -1386,6 +1386,10 @@ class Dossier < ApplicationRecord
|
|||
"#{mandataire_first_name} #{mandataire_last_name}"
|
||||
end
|
||||
|
||||
def user_from_france_connect?
|
||||
user.france_connect_information.present?
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def create_missing_traitemets
|
||||
|
|
Loading…
Reference in a new issue