diff --git a/app/graphql/api/v2/stored_query.rb b/app/graphql/api/v2/stored_query.rb index e04896f81..e2b5c78c0 100644 --- a/app/graphql/api/v2/stored_query.rb +++ b/app/graphql/api/v2/stored_query.rb @@ -281,6 +281,8 @@ class API::V2::StoredQuery dateExpiration dateSuppressionParUsager dateDerniereCorrectionEnAttente @include(if: $includeCorrections) + dateDerniereModificationChamps + dateDerniereModificationAnnotations motivation motivationAttachment { ...FileFragment diff --git a/app/graphql/schema.graphql b/app/graphql/schema.graphql index ae37dadee..52d58d1ad 100644 --- a/app/graphql/schema.graphql +++ b/app/graphql/schema.graphql @@ -1418,6 +1418,16 @@ type Dossier { """ 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. """ diff --git a/app/graphql/types/dossier_type.rb b/app/graphql/types/dossier_type.rb index 2aca07737..783b0e332 100644 --- a/app/graphql/types/dossier_type.rb +++ b/app/graphql/types/dossier_type.rb @@ -26,6 +26,9 @@ module Types 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_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_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 @@ -89,6 +92,14 @@ module Types Loaders::Association.for(object.class, :pending_correction).load(object).then { _1&.created_at } 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 if object.user_deleted? :deleted