Merge pull request #9117 from tchak/fix-nom-commercial
fix(api_entreprise): nom_commercial can be nil
This commit is contained in:
commit
00ec116b64
1 changed files with 14 additions and 9 deletions
|
@ -12,13 +12,15 @@ module Types
|
||||||
end
|
end
|
||||||
|
|
||||||
field :siren, String, null: false
|
field :siren, String, null: false
|
||||||
|
field :nom_commercial, String, null: false
|
||||||
|
field :raison_sociale, String, null: false
|
||||||
|
field :siret_siege_social, String, null: false
|
||||||
|
field :inline_adresse, String, null: false
|
||||||
|
|
||||||
field :capital_social, GraphQL::Types::BigInt, null: true, description: "capital social de l’entreprise. -1 si inconnu."
|
field :capital_social, GraphQL::Types::BigInt, null: true, description: "capital social de l’entreprise. -1 si inconnu."
|
||||||
field :numero_tva_intracommunautaire, String, null: true
|
field :numero_tva_intracommunautaire, String, null: true
|
||||||
field :forme_juridique, String, null: true
|
field :forme_juridique, String, null: true
|
||||||
field :forme_juridique_code, 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
|
|
||||||
field :code_effectif_entreprise, String, null: true
|
field :code_effectif_entreprise, String, null: true
|
||||||
field :effectif_mensuel, EffectifType, null: true, description: "effectif pour un mois donné"
|
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 :effectif_annuel, EffectifType, null: true, description: "effectif moyen d’une année"
|
||||||
|
@ -26,7 +28,6 @@ module Types
|
||||||
field :etat_administratif, EntrepriseEtatAdministratifType, null: true
|
field :etat_administratif, EntrepriseEtatAdministratifType, null: true
|
||||||
field :nom, String, null: true
|
field :nom, String, null: true
|
||||||
field :prenom, String, null: true
|
field :prenom, String, null: true
|
||||||
field :inline_adresse, String, null: false
|
|
||||||
field :attestation_sociale_attachment, Types::File, null: true
|
field :attestation_sociale_attachment, Types::File, null: true
|
||||||
field :attestation_fiscale_attachment, Types::File, null: true
|
field :attestation_fiscale_attachment, Types::File, null: true
|
||||||
|
|
||||||
|
@ -53,6 +54,10 @@ module Types
|
||||||
object.capital_social || '-1'
|
object.capital_social || '-1'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def nom_commercial
|
||||||
|
object.nom_commercial || ''
|
||||||
|
end
|
||||||
|
|
||||||
def code_effectif_entreprise
|
def code_effectif_entreprise
|
||||||
# we need this in order to bypass Hashie::Dash deserialization issue on nil values
|
# we need this in order to bypass Hashie::Dash deserialization issue on nil values
|
||||||
object.code_effectif_entreprise
|
object.code_effectif_entreprise
|
||||||
|
@ -90,21 +95,21 @@ module Types
|
||||||
|
|
||||||
field :siret, String, null: false
|
field :siret, String, null: false
|
||||||
field :siege_social, Boolean, null: false
|
field :siege_social, Boolean, null: false
|
||||||
field :naf, String, null: true # see: https://sentry.io/organizations/demarches-simplifiees/issues/2839832517/activity/?environment=production&project=1429550&query=is%3Aunresolved&referrer=issue-stream#
|
|
||||||
field :libelle_naf, String, null: false
|
field :libelle_naf, String, null: false
|
||||||
|
|
||||||
field :address, Types::AddressType, null: false
|
field :address, Types::AddressType, null: false
|
||||||
|
|
||||||
|
field :naf, String, null: true # see: https://sentry.io/organizations/demarches-simplifiees/issues/2839832517/activity/?environment=production&project=1429550&query=is%3Aunresolved&referrer=issue-stream#
|
||||||
field :entreprise, EntrepriseType, null: true
|
field :entreprise, EntrepriseType, null: true
|
||||||
field :association, AssociationType, null: true
|
field :association, AssociationType, null: true
|
||||||
|
|
||||||
field :adresse, String, null: false, deprecation_reason: "Utilisez le champ `address.label` à la place."
|
field :adresse, String, null: false, deprecation_reason: "Utilisez le champ `address.label` à la place."
|
||||||
field :numero_voie, String, null: true, deprecation_reason: "Utilisez le champ `address.street_number` à la place."
|
|
||||||
field :type_voie, String, null: true, deprecation_reason: "Utilisez le champ `address.street_address` à la place."
|
|
||||||
field :nom_voie, String, null: true, deprecation_reason: "Utilisez le champ `address.street_name` à la place."
|
|
||||||
field :code_postal, String, null: false, deprecation_reason: "Utilisez le champ `address.postal_code` à la place."
|
field :code_postal, String, null: false, deprecation_reason: "Utilisez le champ `address.postal_code` à la place."
|
||||||
field :localite, String, null: false, deprecation_reason: "Utilisez le champ `address.city_name` à la place."
|
field :localite, String, null: false, deprecation_reason: "Utilisez le champ `address.city_name` à la place."
|
||||||
field :code_insee_localite, String, null: false, deprecation_reason: "Utilisez le champ `address.city_code` à la place."
|
field :code_insee_localite, String, null: false, deprecation_reason: "Utilisez le champ `address.city_code` à la place."
|
||||||
|
|
||||||
|
field :numero_voie, String, null: true, deprecation_reason: "Utilisez le champ `address.street_number` à la place."
|
||||||
|
field :type_voie, String, null: true, deprecation_reason: "Utilisez le champ `address.street_address` à la place."
|
||||||
|
field :nom_voie, String, null: true, deprecation_reason: "Utilisez le champ `address.street_name` à la place."
|
||||||
field :complement_adresse, String, null: true, deprecation_reason: "Utilisez le champ `address` à la place."
|
field :complement_adresse, String, null: true, deprecation_reason: "Utilisez le champ `address` à la place."
|
||||||
|
|
||||||
def address
|
def address
|
||||||
|
|
Loading…
Reference in a new issue