summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Boulanger <christophe.boulanger@imio.be>2018-03-07 12:36:08 (GMT)
committerChristophe Boulanger <christophe.boulanger@imio.be>2018-03-07 12:36:08 (GMT)
commit16c3a201fd44ceef23702bea6f37ad0a46d51eb6 (patch)
treed6972090149fb035bb1ab43af3e2dd8a4da23060
parenta402ea4d510623ac1426a1c8f9d0748289597d89 (diff)
downloadpasserelle-imio-extra-fees-16c3a201fd44ceef23702bea6f37ad0a46d51eb6.zip
passerelle-imio-extra-fees-16c3a201fd44ceef23702bea6f37ad0a46d51eb6.tar.gz
passerelle-imio-extra-fees-16c3a201fd44ceef23702bea6f37ad0a46d51eb6.tar.bz2
Namur : keep historical bad id value (0.74 and 1.13) and return a dictionary with a good FEE key to datasource instead of list with a 'bad' id (id was the fee value)
-rw-r--r--passerelle_imio_extra_fees/models.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/passerelle_imio_extra_fees/models.py b/passerelle_imio_extra_fees/models.py
index ac77f0b..5e183cf 100644
--- a/passerelle_imio_extra_fees/models.py
+++ b/passerelle_imio_extra_fees/models.py
@@ -81,7 +81,7 @@ class ExtraFees(BaseResource):
max_doc_in_letter = 5
nb_documents = 0
nb_letter = 0
- postage_fee = Decimal('0.74')
+ postage_fee = Decimal(self.belgium_postage_fee)
# Balaie chaque elem du panier pour gerer les exceptions.
for basket_item in data['data']:
if 'demande-de-changement-d-adresse-domicile' in basket_item['request_data']['form_slug']:
@@ -118,6 +118,13 @@ class ExtraFees(BaseResource):
data = self.default_compute(request, **kwargs)
return data
+ # Namur : historical Namur datasource use id like fees value.
+ # So, we need to keep 0.74 and 1.13 like id and use fee key to get real fee value.
+ @endpoint()
+ def namur_fees(self, request):
+ return {'data':[{'id':'0.74','fee':self.belgium_postage_fee,'text':'En Belgique'},
+ {'id':'1.13','fee':self.europe_postage_fee,'text':' l\'├ętranger'}]}
+
# wcs : new webservice call : https://[COMMUNE]-passerelle.guichet-citoyen.be/extra-fees/[CONNECTOR-SLUG]/fees
# datasources : webservice.fees.get('belgium')
@endpoint()