feat(graphql): expose last_champ_updated_at and last_champ_private_updated_at on api
This commit is contained in:
parent
8431771a61
commit
a8398a71b1
3 changed files with 23 additions and 0 deletions
|
@ -281,6 +281,8 @@ class API::V2::StoredQuery
|
||||||
dateExpiration
|
dateExpiration
|
||||||
dateSuppressionParUsager
|
dateSuppressionParUsager
|
||||||
dateDerniereCorrectionEnAttente @include(if: $includeCorrections)
|
dateDerniereCorrectionEnAttente @include(if: $includeCorrections)
|
||||||
|
dateDerniereModificationChamps
|
||||||
|
dateDerniereModificationAnnotations
|
||||||
motivation
|
motivation
|
||||||
motivationAttachment {
|
motivationAttachment {
|
||||||
...FileFragment
|
...FileFragment
|
||||||
|
|
|
@ -1418,6 +1418,16 @@ type Dossier {
|
||||||
"""
|
"""
|
||||||
dateDerniereModification: ISO8601DateTime!
|
dateDerniereModification: ISO8601DateTime!
|
||||||
|
|
||||||
|
"""
|
||||||
|
Date de la dernière modification des annotations.
|
||||||
|
"""
|
||||||
|
dateDerniereModificationAnnotations: ISO8601DateTime!
|
||||||
|
|
||||||
|
"""
|
||||||
|
Date de la dernière modification des champs.
|
||||||
|
"""
|
||||||
|
dateDerniereModificationChamps: ISO8601DateTime!
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Date d’expiration.
|
Date d’expiration.
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -26,6 +26,9 @@ module Types
|
||||||
field :date_traitement, GraphQL::Types::ISO8601DateTime, "Date du dernier traitement.", null: true, method: :processed_at
|
field :date_traitement, GraphQL::Types::ISO8601DateTime, "Date du dernier 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 :date_derniere_modification, GraphQL::Types::ISO8601DateTime, "Date de la dernière modification.", null: false, method: :updated_at
|
||||||
|
|
||||||
|
field :date_derniere_modification_champs, GraphQL::Types::ISO8601DateTime, "Date de la dernière modification des champs.", null: false
|
||||||
|
field :date_derniere_modification_annotations, GraphQL::Types::ISO8601DateTime, "Date de la dernière modification des annotations.", null: false
|
||||||
|
|
||||||
field :date_suppression_par_usager, GraphQL::Types::ISO8601DateTime, "Date de la suppression par l’usager.", null: true, method: :hidden_by_user_at
|
field :date_suppression_par_usager, GraphQL::Types::ISO8601DateTime, "Date de la suppression par l’usager.", null: true, method: :hidden_by_user_at
|
||||||
field :date_suppression_par_administration, GraphQL::Types::ISO8601DateTime, "Date de la suppression par l’administration.", null: true, method: :hidden_by_administration_at
|
field :date_suppression_par_administration, GraphQL::Types::ISO8601DateTime, "Date de la suppression par l’administration.", null: true, method: :hidden_by_administration_at
|
||||||
field :date_expiration, GraphQL::Types::ISO8601DateTime, "Date d’expiration.", null: true
|
field :date_expiration, GraphQL::Types::ISO8601DateTime, "Date d’expiration.", null: true
|
||||||
|
@ -89,6 +92,14 @@ module Types
|
||||||
Loaders::Association.for(object.class, :pending_correction).load(object).then { _1&.created_at }
|
Loaders::Association.for(object.class, :pending_correction).load(object).then { _1&.created_at }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def date_derniere_modification_champs
|
||||||
|
object.last_champ_updated_at || object.created_at
|
||||||
|
end
|
||||||
|
|
||||||
|
def date_derniere_modification_annotations
|
||||||
|
object.last_champ_private_updated_at || object.created_at
|
||||||
|
end
|
||||||
|
|
||||||
def connection_usager
|
def connection_usager
|
||||||
if object.user_deleted?
|
if object.user_deleted?
|
||||||
:deleted
|
:deleted
|
||||||
|
|
Loading…
Reference in a new issue