From a26537c77d077bdbb859e2727c1d0981aadab620 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Tue, 26 Jan 2021 14:32:34 +0100 Subject: [PATCH] Make some api entreprise fields optional --- app/graphql/schema.graphql | 8 ++++---- app/graphql/types/personne_morale_type.rb | 8 ++++---- app/models/entreprise.rb | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/graphql/schema.graphql b/app/graphql/schema.graphql index 357922337..8e1db6da2 100644 --- a/app/graphql/schema.graphql +++ b/app/graphql/schema.graphql @@ -803,13 +803,13 @@ type Entreprise { effectif pour un mois donné """ effectifMensuel: Effectif - formeJuridique: String! - formeJuridiqueCode: String! + formeJuridique: String + formeJuridiqueCode: String inlineAdresse: String! - nom: String! + nom: String nomCommercial: String! numeroTvaIntracommunautaire: String! - prenom: String! + prenom: String raisonSociale: String! siren: String! siretSiegeSocial: String! diff --git a/app/graphql/types/personne_morale_type.rb b/app/graphql/types/personne_morale_type.rb index 2a74a0cea..c84f0925d 100644 --- a/app/graphql/types/personne_morale_type.rb +++ b/app/graphql/types/personne_morale_type.rb @@ -9,8 +9,8 @@ module Types field :siren, String, null: false field :capital_social, GraphQL::Types::BigInt, null: false, description: "capital social de l’entreprise. -1 si inconnu." field :numero_tva_intracommunautaire, String, null: false - field :forme_juridique, String, null: false - field :forme_juridique_code, String, null: false + field :forme_juridique, String, null: true + field :forme_juridique_code, String, null: true field :nom_commercial, String, null: false field :raison_sociale, String, null: false field :siret_siege_social, String, null: false @@ -18,8 +18,8 @@ module Types field :effectif_mensuel, EffectifType, null: true, description: "effectif pour un mois donné" field :effectif_annuel, EffectifType, null: true, description: "effectif moyen d’une année" field :date_creation, GraphQL::Types::ISO8601Date, null: false - field :nom, String, null: false - field :prenom, String, null: false + field :nom, String, null: true + field :prenom, String, null: true field :inline_adresse, String, null: false field :attestation_sociale_attachment, Types::File, null: true field :attestation_fiscale_attachment, Types::File, null: true diff --git a/app/models/entreprise.rb b/app/models/entreprise.rb index 3b471cbaf..366a695f5 100644 --- a/app/models/entreprise.rb +++ b/app/models/entreprise.rb @@ -7,8 +7,8 @@ class Entreprise < Hashie::Dash property :siren property :capital_social property :numero_tva_intracommunautaire - property :forme_juridique - property :forme_juridique_code + property :forme_juridique, default: nil + property :forme_juridique_code, default: nil property :nom_commercial property :raison_sociale property :siret_siege_social @@ -19,8 +19,8 @@ class Entreprise < Hashie::Dash property :effectif_annuel property :effectif_annuel_annee property :date_creation - property :nom - property :prenom + property :nom, default: nil + property :prenom, default: nil property :inline_adresse end