feat(graphql): add timestamps to files and champs

This commit is contained in:
Paul Chavard 2023-07-12 11:06:42 +02:00
parent 2a8b97a30d
commit 32ecbaee61
4 changed files with 121 additions and 2 deletions

View file

@ -80,6 +80,11 @@ type AddressChamp implements Champ {
La valeur du champ sous forme texte.
"""
stringValue: String
"""
Date de dernière modification du champ.
"""
updatedAt: ISO8601DateTime!
}
type AddressChampDescriptor implements ChampDescriptor {
@ -231,6 +236,11 @@ type CarteChamp implements Champ {
La valeur du champ sous forme texte.
"""
stringValue: String
"""
Date de dernière modification du champ.
"""
updatedAt: ISO8601DateTime!
}
type CarteChampDescriptor implements ChampDescriptor {
@ -273,6 +283,11 @@ interface Champ {
La valeur du champ sous forme texte.
"""
stringValue: String
"""
Date de dernière modification du champ.
"""
updatedAt: ISO8601DateTime!
}
interface ChampDescriptor {
@ -315,6 +330,11 @@ type CheckboxChamp implements Champ {
La valeur du champ sous forme texte.
"""
stringValue: String
"""
Date de dernière modification du champ.
"""
updatedAt: ISO8601DateTime!
value: Boolean!
}
@ -370,6 +390,11 @@ type CiviliteChamp implements Champ {
La valeur du champ sous forme texte.
"""
stringValue: String
"""
Date de dernière modification du champ.
"""
updatedAt: ISO8601DateTime!
value: Civilite
}
@ -460,6 +485,11 @@ type CommuneChamp implements Champ {
La valeur du champ sous forme texte.
"""
stringValue: String
"""
Date de dernière modification du champ.
"""
updatedAt: ISO8601DateTime!
}
type CommuneChampDescriptor implements ChampDescriptor {
@ -575,6 +605,11 @@ type DateChamp implements Champ {
"""
stringValue: String
"""
Date de dernière modification du champ.
"""
updatedAt: ISO8601DateTime!
"""
La valeur du champ formaté en ISO8601 (DateTime).
"""
@ -625,6 +660,11 @@ type DatetimeChamp implements Champ {
La valeur du champ sous forme texte.
"""
stringValue: String
"""
Date de dernière modification du champ.
"""
updatedAt: ISO8601DateTime!
}
type DatetimeChampDescriptor implements ChampDescriptor {
@ -667,6 +707,11 @@ type DecimalNumberChamp implements Champ {
La valeur du champ sous forme texte.
"""
stringValue: String
"""
Date de dernière modification du champ.
"""
updatedAt: ISO8601DateTime!
value: Float
}
@ -1143,6 +1188,11 @@ type DepartementChamp implements Champ {
La valeur du champ sous forme texte.
"""
stringValue: String
"""
Date de dernière modification du champ.
"""
updatedAt: ISO8601DateTime!
}
type DepartementChampDescriptor implements ChampDescriptor {
@ -1547,6 +1597,11 @@ type DossierLinkChamp implements Champ {
La valeur du champ sous forme texte.
"""
stringValue: String
"""
Date de dernière modification du champ.
"""
updatedAt: ISO8601DateTime!
}
type DossierLinkChampDescriptor implements ChampDescriptor {
@ -2122,6 +2177,11 @@ type EpciChamp implements Champ {
La valeur du champ sous forme texte.
"""
stringValue: String
"""
Date de dernière modification du champ.
"""
updatedAt: ISO8601DateTime!
}
type EpciChampDescriptor implements ChampDescriptor {
@ -2187,6 +2247,11 @@ type File {
byteSizeBigInt: BigInt!
checksum: String!
contentType: String!
"""
Date de création du fichier.
"""
createdAt: ISO8601DateTime!
filename: String!
url: URL!
}
@ -2639,6 +2704,11 @@ type IntegerNumberChamp implements Champ {
La valeur du champ sous forme texte.
"""
stringValue: String
"""
Date de dernière modification du champ.
"""
updatedAt: ISO8601DateTime!
value: BigInt
}
@ -2684,6 +2754,11 @@ type LinkedDropDownListChamp implements Champ {
La valeur du champ sous forme texte.
"""
stringValue: String
"""
Date de dernière modification du champ.
"""
updatedAt: ISO8601DateTime!
}
type LinkedDropDownListChampDescriptor implements ChampDescriptor {
@ -2768,6 +2843,11 @@ type MultipleDropDownListChamp implements Champ {
La valeur du champ sous forme texte.
"""
stringValue: String
"""
Date de dernière modification du champ.
"""
updatedAt: ISO8601DateTime!
values: [String!]!
}
@ -3114,6 +3194,11 @@ type PaysChamp implements Champ {
La valeur du champ sous forme texte.
"""
stringValue: String
"""
Date de dernière modification du champ.
"""
updatedAt: ISO8601DateTime!
}
type PaysChampDescriptor implements ChampDescriptor {
@ -3223,6 +3308,11 @@ type PieceJustificativeChamp implements Champ {
La valeur du champ sous forme texte.
"""
stringValue: String
"""
Date de dernière modification du champ.
"""
updatedAt: ISO8601DateTime!
}
type PieceJustificativeChampDescriptor implements ChampDescriptor {
@ -3387,6 +3477,11 @@ type RegionChamp implements Champ {
La valeur du champ sous forme texte.
"""
stringValue: String
"""
Date de dernière modification du champ.
"""
updatedAt: ISO8601DateTime!
}
type RegionChampDescriptor implements ChampDescriptor {
@ -3436,6 +3531,11 @@ type RepetitionChamp implements Champ {
La valeur du champ sous forme texte.
"""
stringValue: String
"""
Date de dernière modification du champ.
"""
updatedAt: ISO8601DateTime!
}
type RepetitionChampDescriptor implements ChampDescriptor {
@ -3531,6 +3631,11 @@ type SiretChamp implements Champ {
La valeur du champ sous forme texte.
"""
stringValue: String
"""
Date de dernière modification du champ.
"""
updatedAt: ISO8601DateTime!
}
type SiretChampDescriptor implements ChampDescriptor {
@ -3573,6 +3678,11 @@ type TextChamp implements Champ {
La valeur du champ sous forme texte.
"""
stringValue: String
"""
Date de dernière modification du champ.
"""
updatedAt: ISO8601DateTime!
value: String
}
@ -3646,6 +3756,11 @@ type TitreIdentiteChamp implements Champ {
La valeur du champ sous forme texte.
"""
stringValue: String
"""
Date de dernière modification du champ.
"""
updatedAt: ISO8601DateTime!
}
type TitreIdentiteChampDescriptor implements ChampDescriptor {

View file

@ -5,6 +5,7 @@ module Types
global_id_field :id
field :label, String, "Libellé du champ.", null: false, method: :libelle
field :string_value, String, "La valeur du champ sous forme texte.", null: true, method: :for_api_v2
field :updated_at, GraphQL::Types::ISO8601DateTime, "Date de dernière modification du champ.", null: false
definition_methods do
def resolve_type(object, context)

View file

@ -168,7 +168,8 @@ module Types
url: Rails.application.routes.url_helpers.api_v2_dossier_pdf_url(id: sgid),
byte_size: 0,
byte_size_big_int: '0',
checksum: ''
checksum: '',
created_at: Time.zone.now
}
end
@ -180,7 +181,8 @@ module Types
url: Rails.application.routes.url_helpers.api_v2_dossier_geojson_url(id: sgid),
byte_size: 0,
byte_size_big_int: '0',
checksum: ''
checksum: '',
created_at: Time.zone.now
}
end

View file

@ -6,6 +6,7 @@ module Types
field :byte_size_big_int, GraphQL::Types::BigInt, null: false, method: :byte_size
field :checksum, String, null: false
field :content_type, String, null: false
field :created_at, GraphQL::Types::ISO8601DateTime, "Date de création du fichier.", null: false
def url
if object.is_a?(Hash)