Merge pull request #5661 from tchak/graphql-titre-identite

Add titre identite champ to GraphQL
This commit is contained in:
Paul Chavard 2020-12-17 17:36:26 +01:00 committed by GitHub
commit cb902516e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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::RepetitionChampType,
Types::Champs::SiretChampType, Types::Champs::SiretChampType,
Types::Champs::TextChampType, Types::Champs::TextChampType,
Types::Champs::TitreIdentiteChampType,
Types::GeoAreas::ParcelleCadastraleType, Types::GeoAreas::ParcelleCadastraleType,
Types::GeoAreas::SelectionUtilisateurType, Types::GeoAreas::SelectionUtilisateurType,
Types::PersonneMoraleType, Types::PersonneMoraleType,

View file

@ -1197,6 +1197,33 @@ type TextChamp implements Champ {
value: String 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 { enum TypeDeChamp {
""" """
Adresse Adresse

View file

@ -33,6 +33,8 @@ module Types
Types::Champs::LinkedDropDownListChampType Types::Champs::LinkedDropDownListChampType
when ::Champs::CiviliteChamp when ::Champs::CiviliteChamp
Types::Champs::CiviliteChampType Types::Champs::CiviliteChampType
when ::Champs::TitreIdentiteChamp
Types::Champs::TitreIdentiteChampType
else else
Types::Champs::TextChampType Types::Champs::TextChampType
end 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 class TypesDeChamp::TitreIdentiteTypeDeChamp < TypesDeChamp::TypeDeChampBase
FRANCE_CONNECT = 'france_connect'
PIECE_JUSTIFICATIVE = 'piece_justificative'
end end