signal_arretes: add support for comment field (#73853) #64

Merged
csechet merged 2 commits from wip/73853-Supporter-le-champ-commentaire-l into main 2023-01-27 14:38:33 +01:00
3 changed files with 10 additions and 1 deletions

View File

@ -87,6 +87,7 @@ REQUEST_SCHEMA = {
'format': 'date',
},
'occupation_end_date': {'description': _('Occupation end date'), 'type': 'string', 'format': 'date'},
'comment': {'description': _('Comment'), 'type': 'string'},
Outdated
Review

en anglais : ('Comment')

en anglais : ('Comment')
},
}
@ -218,6 +219,7 @@ class SignalArretes(BaseResource, HTTPResource):
'qualite': post_data['declarant_quality'],
'SIRET': post_data['declarant_siret'],
'numeroDossier': post_data['file_number'],
'commentaire': post_data['comment'],
'contact': {
'civilite': post_data['declarant_civility'],
'nom': post_data['declarant_name'],

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Passerelle 0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-01-18 15:55+0100\n"
"POT-Creation-Date: 2023-01-27 14:15+0100\n"
"PO-Revision-Date: 2022-11-03 22:06+0100\n"
"Last-Translator: Frederic Peters <fpeters@entrouvert.com>\n"
"Language: fr\n"
@ -4162,6 +4162,10 @@ msgstr "Date de début de l'occupation"
msgid "Occupation end date"
msgstr "Date de fin de l'occupation"
#: apps/signal_arretes/models.py
msgid "Comment"
msgstr "Commentaire :"
#: apps/signal_arretes/models.py
msgid "Get cities available in Signal Arrêtés"
msgstr "Récupérer les communes disponibles dans Signal Arrêtés"

View File

@ -68,6 +68,7 @@ def mock_creation_dodp(url, request):
assert 'SIRET' not in data or data['SIRET'] == '00000000000000'
assert 'numeroDossier' not in data or data['numeroDossier'] == 'reference_dossier'
assert 'commentaire' not in data or data['commentaire'] == 'Wubba Lubba Dub Dub'
assert 'adresseLigne1' not in contact or contact['adresseLigne1'] == '6 Sesame street'
assert 'CP' not in contact or contact['CP'] == '42 42420'
assert 'ville' not in contact or contact['ville'] == 'Melun'
@ -211,6 +212,7 @@ REQUIRED_PARAMETERS = {
'occupation_type': 'Base de vie',
'occupation_start_date': '02/06/2022',
'occupation_end_date': '03/06/2022',
'comment': '',

J'ai l'impression que tu as oublié d'ajouté ce nouveau champ requis "comment" aux champs 'required' de 'REQUEST_SCHEMA'.

J'ai l'impression que tu as oublié d'ajouté ce nouveau champ requis "comment" aux champs 'required' de 'REQUEST_SCHEMA'.

Non, le champ n'est pas requis, c'est déroutant mais les champ vides de "REQUIRED_PARAMETERS" ne sont, en fait, pas requis (mauvais nommage de variable, reliquat des discussions ici : https://dev.entrouvert.org/issues/65822#note-10)

Non, le champ n'est pas requis, c'est déroutant mais les champ vides de "REQUIRED_PARAMETERS" ne sont, en fait, pas requis (mauvais nommage de variable, reliquat des discussions ici : https://dev.entrouvert.org/issues/65822#note-10)
}
@ -229,6 +231,7 @@ def test_create_request(app, connector, mock_signal_arretes):
'declarant_city': 'Melun',
'declarant_phone': '0636656565',
'occupation_lane': 'Sesame Street',
'comment': 'Wubba Lubba Dub Dub',
}
)