[GraphQL]: normalize date names in French (#4561)

GraphQL : normalise le nom des dates en français
This commit is contained in:
Pierre de La Morinerie 2019-11-27 12:29:57 +01:00 committed by GitHub
commit c4fc213384
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 64 additions and 31 deletions

View file

@ -1,10 +1,12 @@
type Avis { type Avis {
answer: String
attachmentUrl: URL attachmentUrl: URL
createdAt: ISO8601DateTime! dateQuestion: ISO8601DateTime!
email: String! dateReponse: ISO8601DateTime
expert: Profile
id: ID! id: ID!
instructeur: Profile!
question: String! question: String!
reponse: String
} }
type CarteChamp implements Champ { type CarteChamp implements Champ {
@ -160,12 +162,30 @@ Une demarche
""" """
type Demarche { type Demarche {
annotationDescriptors: [ChampDescriptor!]! annotationDescriptors: [ChampDescriptor!]!
archivedAt: ISO8601DateTime
champDescriptors: [ChampDescriptor!]! champDescriptors: [ChampDescriptor!]!
createdAt: ISO8601DateTime!
""" """
Déscription de la démarche. Date de la création.
"""
dateCreation: ISO8601DateTime!
"""
Date de la dernière modification.
"""
dateDerniereModification: ISO8601DateTime!
"""
Date de la fermeture.
"""
dateFermeture: ISO8601DateTime
"""
Date de la publication.
"""
datePublication: ISO8601DateTime!
"""
Description de la démarche.
""" """
description: String! description: String!
@ -225,8 +245,11 @@ type Demarche {
L'état de la démarche. L'état de la démarche.
""" """
state: DemarcheState! state: DemarcheState!
"""
Le titre de la démarche.
"""
title: String! title: String!
updatedAt: ISO8601DateTime!
} }
enum DemarcheState { enum DemarcheState {
@ -280,6 +303,11 @@ type Dossier {
avis: [Avis!]! avis: [Avis!]!
champs: [Champ!]! champs: [Champ!]!
"""
Date de la dernière modification.
"""
dateDerniereModification: ISO8601DateTime!
""" """
Date de dépôt. Date de dépôt.
""" """
@ -309,11 +337,6 @@ type Dossier {
L'état du dossier. L'état du dossier.
""" """
state: DossierState! state: DossierState!
"""
Date de dernière mise à jour.
"""
updatedAt: ISO8601DateTime!
usager: Profile! usager: Profile!
} }

View file

@ -1,12 +1,17 @@
module Types module Types
class AvisType < Types::BaseObject class AvisType < Types::BaseObject
global_id_field :id global_id_field :id
field :email, String, null: false
field :question, String, null: false, method: :introduction field :question, String, null: false, method: :introduction
field :answer, String, null: true field :reponse, String, null: true, method: :answer
field :created_at, GraphQL::Types::ISO8601DateTime, null: false field :date_question, GraphQL::Types::ISO8601DateTime, null: false, method: :created_at
field :date_reponse, GraphQL::Types::ISO8601DateTime, null: true, method: :updated_at
field :attachment_url, Types::URL, null: true, extensions: [ field :attachment_url, Types::URL, null: true, extensions: [
{ Extensions::Attachment => { attachment: :piece_justificative_file } } { Extensions::Attachment => { attachment: :piece_justificative_file } }
] ]
field :instructeur, Types::ProfileType, null: false, method: :claimant
field :expert, Types::ProfileType, null: true, method: :instructeur
end end
end end

View file

@ -10,13 +10,14 @@ module Types
global_id_field :id global_id_field :id
field :number, Int, "Le numero de la démarche.", null: false, method: :id field :number, Int, "Le numero de la démarche.", null: false, method: :id
field :title, String, null: false, method: :libelle field :title, String, "Le titre de la démarche.", null: false, method: :libelle
field :description, String, "Déscription de la démarche.", null: false field :description, String, "Description de la démarche.", null: false
field :state, DemarcheState, "L'état de la démarche.", null: false field :state, DemarcheState, "L'état de la démarche.", null: false
field :created_at, GraphQL::Types::ISO8601DateTime, null: false field :date_creation, GraphQL::Types::ISO8601DateTime, "Date de la création.", null: false, method: :created_at
field :updated_at, GraphQL::Types::ISO8601DateTime, null: false field :date_publication, GraphQL::Types::ISO8601DateTime, "Date de la publication.", null: false, method: :published_at
field :archived_at, GraphQL::Types::ISO8601DateTime, null: true field :date_derniere_modification, GraphQL::Types::ISO8601DateTime, "Date de la dernière modification.", null: false, method: :updated_at
field :date_fermeture, GraphQL::Types::ISO8601DateTime, "Date de la fermeture.", null: true, method: :archived_at
field :groupe_instructeurs, [Types::GroupeInstructeurType], null: false field :groupe_instructeurs, [Types::GroupeInstructeurType], null: false

View file

@ -11,11 +11,11 @@ module Types
global_id_field :id global_id_field :id
field :number, Int, "Le numero du dossier.", null: false, method: :id field :number, Int, "Le numero du dossier.", null: false, method: :id
field :state, DossierState, "L'état du dossier.", null: false field :state, DossierState, "L'état du dossier.", null: false
field :updated_at, GraphQL::Types::ISO8601DateTime, "Date de dernière mise à jour.", null: false
field :date_passage_en_construction, GraphQL::Types::ISO8601DateTime, "Date de dépôt.", null: false, method: :en_construction_at field :date_passage_en_construction, GraphQL::Types::ISO8601DateTime, "Date de dépôt.", null: false, method: :en_construction_at
field :date_passage_en_instruction, GraphQL::Types::ISO8601DateTime, "Date de passage en instruction.", null: true, method: :en_instruction_at field :date_passage_en_instruction, GraphQL::Types::ISO8601DateTime, "Date de passage en instruction.", null: true, method: :en_instruction_at
field :date_traitement, GraphQL::Types::ISO8601DateTime, "Date de traitement.", null: true, method: :processed_at field :date_traitement, GraphQL::Types::ISO8601DateTime, "Date de traitement.", null: true, method: :processed_at
field :date_derniere_modification, GraphQL::Types::ISO8601DateTime, "Date de la dernière modification.", null: false, method: :updated_at
field :archived, Boolean, null: false field :archived, Boolean, null: false

View file

@ -30,9 +30,9 @@ describe API::V2::GraphqlController do
title title
description description
state state
createdAt dateCreation
updatedAt dateDerniereModification
archivedAt dateFermeture
groupeInstructeurs { groupeInstructeurs {
label label
instructeurs { instructeurs {
@ -80,9 +80,9 @@ describe API::V2::GraphqlController do
title: procedure.libelle, title: procedure.libelle,
description: procedure.description, description: procedure.description,
state: 'brouillon', state: 'brouillon',
archivedAt: nil, dateFermeture: nil,
createdAt: procedure.created_at.iso8601, dateCreation: procedure.created_at.iso8601,
updatedAt: procedure.updated_at.iso8601, dateDerniereModification: procedure.updated_at.iso8601,
groupeInstructeurs: [ groupeInstructeurs: [
{ {
instructeurs: [{ email: instructeur.email }], instructeurs: [{ email: instructeur.email }],
@ -139,7 +139,7 @@ describe API::V2::GraphqlController do
id id
number number
state state
updatedAt dateDerniereModification
datePassageEnConstruction datePassageEnConstruction
datePassageEnInstruction datePassageEnInstruction
dateTraitement dateTraitement
@ -159,9 +159,13 @@ describe API::V2::GraphqlController do
attachmentUrl attachmentUrl
} }
avis { avis {
email expert {
email
}
question question
answer reponse
dateQuestion
dateReponse
attachmentUrl attachmentUrl
} }
champs { champs {
@ -179,7 +183,7 @@ describe API::V2::GraphqlController do
id: dossier.to_typed_id, id: dossier.to_typed_id,
number: dossier.id, number: dossier.id,
state: 'en_construction', state: 'en_construction',
updatedAt: dossier.updated_at.iso8601, dateDerniereModification: dossier.updated_at.iso8601,
datePassageEnConstruction: dossier.en_construction_at.iso8601, datePassageEnConstruction: dossier.en_construction_at.iso8601,
datePassageEnInstruction: nil, datePassageEnInstruction: nil,
dateTraitement: nil, dateTraitement: nil,