rsa13: add type-evenement endpoint (#84252)
Cf. [[bouches-du-rhone-cd13:Spec_Beta#EN-RECETTE-v17-apitype-evenement-GET-liste-des-types-d%C3%A9v%C3%A8nements]]
This commit is contained in:
parent
0b4de669fd
commit
4465d64903
|
@ -1976,6 +1976,31 @@ class RSA13Resource(BaseResource, HTTPResource):
|
|||
def sous_action(self, request, email, ip=None):
|
||||
return self.get('sousaction/', email=email, ip=ip)
|
||||
|
||||
@endpoint(
|
||||
description=_('Get event types'),
|
||||
name='type-evenement',
|
||||
parameters=parameters(),
|
||||
json_schema_response=response_schema(
|
||||
{
|
||||
'type': 'array',
|
||||
'items': {
|
||||
'type': 'object',
|
||||
'required': ['id', 'text'],
|
||||
'properties': {
|
||||
'id': {
|
||||
'type': 'string',
|
||||
},
|
||||
'text': {
|
||||
'type': 'string',
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
),
|
||||
)
|
||||
def type_evenement(self, request, email, ip=None):
|
||||
return self.get('type-evenement/', email=email, ip=ip)
|
||||
|
||||
|
||||
DEFAULTS = {
|
||||
'beneficiaire_csv_columns': [
|
||||
|
|
|
@ -1378,6 +1378,24 @@ def test_sous_action(app, rsa13, url):
|
|||
}
|
||||
|
||||
|
||||
TYPE_EVENEMENT = {
|
||||
'err': 0,
|
||||
'data': [
|
||||
{'id': 2, 'text': 'Entretien Accueil'},
|
||||
{'id': 3, 'text': 'Entretien Diagnostic'},
|
||||
{'id': 4, 'text': 'Entretien Parcours'},
|
||||
{'id': 5, 'text': 'Atelier'},
|
||||
{'id': 6, 'text': 'Information collective'},
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
@mock_response(['/api/type-evenement/', TYPE_EVENEMENT])
|
||||
def test_type_evenement(app, rsa13, url):
|
||||
response = app.get(url + 'type-evenement/')
|
||||
assert response.json == TYPE_EVENEMENT
|
||||
|
||||
|
||||
def test_csv_columns_migration(migration, settings):
|
||||
old_apps = migration.before([('rsa13', '0001_initial')])
|
||||
|
||||
|
|
Loading…
Reference in New Issue