toulouse_maelis: apply correction on bateBirth field (#67782)
This commit is contained in:
parent
c82725cebd
commit
f4d2e5ffd2
|
@ -25,6 +25,24 @@ BOOLEAN_TYPES = [
|
|||
},
|
||||
]
|
||||
|
||||
|
||||
ID_PROPERTIES = {
|
||||
'firstname': {
|
||||
'description': 'Prénom',
|
||||
'type': 'string',
|
||||
},
|
||||
'lastname': {
|
||||
'description': 'Nom',
|
||||
'type': 'string',
|
||||
},
|
||||
'dateBirth': {
|
||||
'description': 'Date de naissance',
|
||||
'type': 'string',
|
||||
'pattern': '^[0-9]{4}-[0-9]{2}-[0-9]{2}$',
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
LINK_SCHEMA = {
|
||||
'$schema': 'http://json-schema.org/draft-04/schema#',
|
||||
'title': 'Link',
|
||||
|
@ -36,43 +54,18 @@ LINK_SCHEMA = {
|
|||
'description': 'Numéro DUI',
|
||||
'type': 'string',
|
||||
},
|
||||
'firstname': {
|
||||
'description': 'Prénom du RL1',
|
||||
'type': 'string',
|
||||
},
|
||||
'lastname': {
|
||||
'description': 'Nom du RL1',
|
||||
'type': 'string',
|
||||
},
|
||||
'dateBirth': {
|
||||
'description': 'Date de naissance du RL1',
|
||||
'type': 'string',
|
||||
'pattern': '^[0-9]{4}-[0-9]{2}-[0-9]{2}$',
|
||||
},
|
||||
},
|
||||
}
|
||||
LINK_SCHEMA['properties'].update(ID_PROPERTIES)
|
||||
|
||||
|
||||
ISEXISTS_SCHEMA = {
|
||||
'$schema': 'http://json-schema.org/draft-04/schema#',
|
||||
'title': 'Link',
|
||||
'description': "Appairage d'un usager Publik à une famille dans Maelis",
|
||||
'type': 'object',
|
||||
'required': ['firstname', 'lastname', 'datebirth'],
|
||||
'properties': {
|
||||
'firstname': {
|
||||
'description': 'Prénom',
|
||||
'type': 'string',
|
||||
},
|
||||
'lastname': {
|
||||
'description': 'Nom',
|
||||
'type': 'string',
|
||||
},
|
||||
'datebirth': {
|
||||
'description': 'Date de naissance',
|
||||
'type': 'string',
|
||||
'pattern': '^[0-9]{4}-[0-9]{2}-[0-9]{2}$',
|
||||
},
|
||||
},
|
||||
'required': ['firstname', 'lastname', 'dateBirth'],
|
||||
'properties': ID_PROPERTIES,
|
||||
}
|
||||
|
||||
ADDRESS_SCHEMA = {
|
||||
|
@ -241,29 +234,17 @@ RLINFO_SCHEMA = {
|
|||
'description': 'civilité (depuis référenciel)',
|
||||
'oneOf': [{'type': 'null'}, {'type': 'string'}],
|
||||
},
|
||||
'firstname': {
|
||||
'description': 'Prénom',
|
||||
'type': 'string',
|
||||
},
|
||||
'lastname': {
|
||||
'description': 'Nom',
|
||||
'type': 'string',
|
||||
},
|
||||
'quality': {
|
||||
'description': 'Qualité',
|
||||
'type': 'string',
|
||||
},
|
||||
'dateBirth': {
|
||||
'description': 'Date de naissance',
|
||||
'type': 'string',
|
||||
'pattern': '^[0-9]{4}-[0-9]{2}-[0-9]{2}$',
|
||||
},
|
||||
'adresse': ADDRESS_SCHEMA,
|
||||
'contact': CONTACT_SCHEMA,
|
||||
'profession': PROFESSION_SCHEMA,
|
||||
'CAFInfo': CAFINFO_SCHEMA,
|
||||
},
|
||||
}
|
||||
RLINFO_SCHEMA['properties'].update(ID_PROPERTIES)
|
||||
|
||||
CHILDBIRTH_SCHEMA = {
|
||||
'$schema': 'http://json-schema.org/draft-04/schema#',
|
||||
|
@ -522,23 +503,10 @@ CHILD_SCHEMA = {
|
|||
{'required': ['birth']}, # updateFamily
|
||||
],
|
||||
'properties': {
|
||||
'firstname': {
|
||||
'description': 'Prénom',
|
||||
'type': 'string',
|
||||
},
|
||||
'lastname': {
|
||||
'description': 'Nom',
|
||||
'type': 'string',
|
||||
},
|
||||
'sexe': {
|
||||
'description': 'Sexe',
|
||||
'type': 'string',
|
||||
},
|
||||
'dateBirth': {
|
||||
'description': 'Date de naissance',
|
||||
'type': 'string',
|
||||
'pattern': '^[0-9]{4}-[0-9]{2}-[0-9]{2}$',
|
||||
},
|
||||
'birth': CHILDBIRTH_SCHEMA,
|
||||
'dietcode': {
|
||||
'description': 'Code de régime alimentaire',
|
||||
|
@ -557,6 +525,7 @@ CHILD_SCHEMA = {
|
|||
'paiInfoBean': PAIINFO_SCHEMA,
|
||||
},
|
||||
}
|
||||
CHILD_SCHEMA['properties'].update(ID_PROPERTIES)
|
||||
|
||||
CONTACTLIGHT_SCHEMA = {
|
||||
'$schema': 'http://json-schema.org/draft-04/schema#',
|
||||
|
@ -595,27 +564,15 @@ FAMILYPERSON_SCHEMA = {
|
|||
'description': 'civilité (depuis référenciel)',
|
||||
'oneOf': [{'type': 'null'}, {'type': 'string'}],
|
||||
},
|
||||
'firstname': {
|
||||
'description': 'Prénom',
|
||||
'type': 'string',
|
||||
},
|
||||
'lastname': {
|
||||
'description': 'Nom',
|
||||
'type': 'string',
|
||||
},
|
||||
'quality': {
|
||||
'description': 'Qualité',
|
||||
'oneOf': [{'type': 'null'}, {'type': 'string'}],
|
||||
},
|
||||
'dateBirth': {
|
||||
'description': 'Date de naissance',
|
||||
'type': 'string',
|
||||
'pattern': '^[0-9]{4}-[0-9]{2}-[0-9]{2}$',
|
||||
},
|
||||
'contact': CONTACTLIGHT_SCHEMA,
|
||||
},
|
||||
'unflatten': True,
|
||||
}
|
||||
FAMILYPERSON_SCHEMA['properties'].update(ID_PROPERTIES)
|
||||
|
||||
AUTHORIZEDPERSON_SCHEMA = {
|
||||
'$schema': 'http://json-schema.org/draft-04/schema#',
|
||||
|
|
|
@ -642,7 +642,7 @@ def test_is_rl_exists(mocked_post, mocked_get, post_response, result, con, app):
|
|||
params = {
|
||||
'firstname': 'Damien',
|
||||
'lastname': 'Costanze',
|
||||
'datebirth': '1980-10-07',
|
||||
'dateBirth': '1980-10-07',
|
||||
}
|
||||
resp = app.post_json(url, params=params)
|
||||
assert resp.json['err'] == 0
|
||||
|
@ -655,7 +655,7 @@ def test_is_rl_exists_schema_error(con, app):
|
|||
params = {
|
||||
'firstname': 'Damien',
|
||||
'lastname': 'Costanze',
|
||||
'datebirth': '1980-10-07 more text',
|
||||
'dateBirth': '1980-10-07 more text',
|
||||
}
|
||||
resp = app.post_json(url, params=params, status=400)
|
||||
assert resp.json['err'] == 1
|
||||
|
@ -679,7 +679,7 @@ def test_is_child_exists(mocked_post, mocked_get, post_response, result, con, ap
|
|||
params = {
|
||||
'firstname': 'Cassandra',
|
||||
'lastname': 'Costanze',
|
||||
'datebirth': '2021-06-22',
|
||||
'dateBirth': '2021-06-22',
|
||||
}
|
||||
resp = app.post_json(url, params=params)
|
||||
assert resp.json['err'] == 0
|
||||
|
|
Loading…
Reference in New Issue