Skip to content

Commit

Permalink
[FEATURE]
Browse files Browse the repository at this point in the history
-*Dossier.get_deposit_date() : get the creation date of the dossier
[BUG FIX]
- Dossier.get_fields() : crash error undefined variable
(0.0.11)
  • Loading branch information
Z3ZEL committed Aug 1, 2023
1 parent 0af09c9 commit 788026c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
]
Expand Down
11 changes: 10 additions & 1 deletion src/demarches_simpy/dossier.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]]:
Expand Down
2 changes: 1 addition & 1 deletion src/demarches_simpy/query/dossier_data.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 788026c

Please sign in to comment.