Skip to content

Commit

Permalink
Added newTranslations to the alteration schema (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lekshmi authored Jul 10, 2020
1 parent 2bb8314 commit 6c8f936
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/registry_schemas/example_data/schema_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -925,9 +925,10 @@
'nrNumber': 'NR123567'
},
'alterNameTranslations': {
'newTranslations': ['Financière de l’Odet'],
'modifiedTranslations': [{
'oldValue': 'A1 Ltd.',
'newValue': 'A2 Ltd'
'newValue': 'Société Générale'
}],
'ceasedTranslations': ['B1', 'B2']
},
Expand Down
13 changes: 11 additions & 2 deletions src/registry_schemas/schemas/alteration_name_translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,17 @@
"title": "Change of name translations",
"anyOf": [
{"required": ["modifiedTranslations"]},
{"required": ["ceasedTranslations"]}
{"required": ["ceasedTranslations"]},
{"required": ["newTranslations"]}
],
"properties": {
"newTranslations": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[ A-Za-zÀ-ÿ_@./#’&+-]*$"
}
},
"modifiedTranslations": {
"type": "array",
"items": {
Expand All @@ -23,7 +31,8 @@
},
"newValue": {
"type": "string",
"title": "New Translation"
"title": "New Translation",
"pattern": "^[ A-Za-zÀ-ÿ_@./#’&+-]*$"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/registry_schemas/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
Development release segment: .devN
"""

__version__ = '2.5.16' # pylint: disable=invalid-name
__version__ = '2.5.17' # pylint: disable=invalid-name
1 change: 1 addition & 0 deletions tests/unit/test_alteration.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def test_validate_invalid_name_translation_alteration():
alteration_json = copy.deepcopy(ALTERATION)
del alteration_json['alterNameTranslations']['modifiedTranslations']
del alteration_json['alterNameTranslations']['ceasedTranslations']
del alteration_json['alterNameTranslations']['newTranslations']

is_valid, errors = validate(alteration_json, 'alteration')

Expand Down

0 comments on commit 6c8f936

Please sign in to comment.