diff --git a/pyproject.toml b/pyproject.toml index d11c959..08dd864 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools>=61.0","requests"] build-backend = "setuptools.build_meta" [project] name = "demarches-simpy" -version = "0.0.10" +version = "0.0.11" authors = [ { name="Esteban Rodriguez (Z3ZEL)", email="contact@rodriguez-esteban.com" }, ] diff --git a/src/demarches_simpy/dossier.py b/src/demarches_simpy/dossier.py index aa83ac4..afba796 100644 --- a/src/demarches_simpy/dossier.py +++ b/src/demarches_simpy/dossier.py @@ -155,6 +155,15 @@ def get_number(self) -> int: return self.get_data()['dossier']['number'] else: return self.number + def get_deposit_date(self) -> str: + r''' + Get the deposit date of the dossier. + + Returns + ------- + the deposit date of the dossier + ''' + return self.get_data()['dossier']['dateDepot'] #TODO: check type unified with an enum and make tests @@ -250,7 +259,7 @@ def get_fields(self) -> dict: raw_fields = self.force_fetch().get_data()['dossier']['champs'] fields = dict(map(lambda x : (x['label'], {'stringValue' : x['stringValue'], "id":x['id']}), raw_fields)) self.fields = fields - return fields + return self.fields #Annotations retrieve TODO: revoir type def get_annotations(self) -> list[dict[str, dict]]: diff --git a/src/demarches_simpy/query/dossier_data.graphql b/src/demarches_simpy/query/dossier_data.graphql index 6eb4509..8a7477b 100644 --- a/src/demarches_simpy/query/dossier_data.graphql +++ b/src/demarches_simpy/query/dossier_data.graphql @@ -2,7 +2,7 @@ query getDossier($dossierNumber: Int!, $includeChamps : Boolean = false, $includ { dossier(number: $dossierNumber) { - id number state + id number state dateDepot attestation { filename url