Add titre identite champ to GraphQL
This commit is contained in:
parent
302aee0912
commit
09128cb85e
5 changed files with 48 additions and 0 deletions
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
16
app/graphql/types/champs/titre_identite_champ_type.rb
Normal file
16
app/graphql/types/champs/titre_identite_champ_type.rb
Normal 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
|
|
@ -1,2 +1,4 @@
|
|||
class TypesDeChamp::TitreIdentiteTypeDeChamp < TypesDeChamp::TypeDeChampBase
|
||||
FRANCE_CONNECT = 'france_connect'
|
||||
PIECE_JUSTIFICATIVE = 'piece_justificative'
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue