Merge pull request #5661 from tchak/graphql-titre-identite
Add titre identite champ to GraphQL
This commit is contained in:
commit
cb902516e0
5 changed files with 48 additions and 0 deletions
|
@ -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,
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
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
|
class TypesDeChamp::TitreIdentiteTypeDeChamp < TypesDeChamp::TypeDeChampBase
|
||||||
|
FRANCE_CONNECT = 'france_connect'
|
||||||
|
PIECE_JUSTIFICATIVE = 'piece_justificative'
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue