Add titre identite champ to GraphQL

This commit is contained in:
Paul Chavard 2020-09-24 12:02:14 +02:00
parent 302aee0912
commit 09128cb85e
5 changed files with 48 additions and 0 deletions

View file

@ -50,6 +50,7 @@ class Api::V2::Schema < GraphQL::Schema
Types::Champs::RepetitionChampType,
Types::Champs::SiretChampType,
Types::Champs::TextChampType,
Types::Champs::TitreIdentiteChampType,
Types::GeoAreas::ParcelleCadastraleType,
Types::GeoAreas::SelectionUtilisateurType,
Types::PersonneMoraleType,

View file

@ -1197,6 +1197,33 @@ type TextChamp implements Champ {
value: String
}
type TitreIdentiteChamp implements Champ {
grantType: TitreIdentiteGrantType!
id: ID!
"""
Libellé du champ.
"""
label: String!
"""
La valeur du champ sous forme texte.
"""
stringValue: String
}
enum TitreIdentiteGrantType {
"""
Françe Connect
"""
france_connect
"""
Pièce justificative
"""
piece_justificative
}
enum TypeDeChamp {
"""
Adresse

View file

@ -33,6 +33,8 @@ module Types
Types::Champs::LinkedDropDownListChampType
when ::Champs::CiviliteChamp
Types::Champs::CiviliteChampType
when ::Champs::TitreIdentiteChamp
Types::Champs::TitreIdentiteChampType
else
Types::Champs::TextChampType
end

View file

@ -0,0 +1,16 @@
module Types::Champs
class TitreIdentiteChampType < Types::BaseObject
implements Types::ChampType
class TitreIdentiteGrantTypeType < Types::BaseEnum
value(TypesDeChamp::TitreIdentiteTypeDeChamp::FRANCE_CONNECT, "Françe Connect")
value(TypesDeChamp::TitreIdentiteTypeDeChamp::PIECE_JUSTIFICATIVE, "Pièce justificative")
end
field :grant_type, TitreIdentiteGrantTypeType, null: false
def grant_type
TypesDeChamp::TitreIdentiteTypeDeChamp::PIECE_JUSTIFICATIVE
end
end
end

View file

@ -1,2 +1,4 @@
class TypesDeChamp::TitreIdentiteTypeDeChamp < TypesDeChamp::TypeDeChampBase
FRANCE_CONNECT = 'france_connect'
PIECE_JUSTIFICATIVE = 'piece_justificative'
end