wip: added location & signatory information

pull/163/head
chrisr3d 2018-02-05 15:51:03 +01:00
parent 54ebb8a96f
commit 8983ebc4b2
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
1 changed files with 17 additions and 8 deletions

View File

@ -11,7 +11,7 @@ mispattributes = {}
outputFileExtension = "xml" outputFileExtension = "xml"
responseType = "application/xml" responseType = "application/xml"
objects_to_parse = ['bank-account', 'person'] objects_to_parse = ['bank-account', 'person', 'geolocation']
goAMLmapping = {'bank-account': 't_account', 'text': 'institution_name', 'institution-code': 'institution_code', goAMLmapping = {'bank-account': 't_account', 'text': 'institution_name', 'institution-code': 'institution_code',
'swift': 'swift', 'branch': 'branch', 'non-banking-institution': 'non_bank_institution', 'swift': 'swift', 'branch': 'branch', 'non-banking-institution': 'non_bank_institution',
@ -23,7 +23,9 @@ goAMLmapping = {'bank-account': 't_account', 'text': 'institution_name', 'instit
'last-name': 'last_name', 'mothers-name': 'mothers_name', 'title': 'title', 'alias': 'alias', 'last-name': 'last_name', 'mothers-name': 'mothers_name', 'title': 'title', 'alias': 'alias',
'date-of-birth': 'birthdate', 'place-of-birth': 'birth_place', 'gender': 'gender', 'date-of-birth': 'birthdate', 'place-of-birth': 'birth_place', 'gender': 'gender',
'passport-number': 'passport_number', 'passport-country': 'passport_country', 'passport-number': 'passport_number', 'passport-country': 'passport_country',
'social-security-number': 'ssn', 'nationality': 'nationality1'} 'social-security-number': 'ssn', 'nationality': 'nationality1', 'identity-card-number': 'id_number',
'geolocation': 'location', 'city': 'city', 'region': 'state', 'country': 'country-code',
'address': 'address', 'zipcode': 'zip'}
class GoAmlGeneration(): class GoAmlGeneration():
def __init__(self): def __init__(self):
@ -55,13 +57,20 @@ class GoAmlGeneration():
def itterate(self): def itterate(self):
for t in self.document: for t in self.document:
self.xml += "<{}>".format(goAMLmapping[t]) self.xml += "<{}>".format(goAMLmapping[t])
for k in self.document[t]: self.fill_xml(t)
try: if t == 'bank-account' and 'person' in self.document:
self.xml += "<{0}>{1}</{0}>".format(goAMLmapping[k], self.document[t][k]) self.xml += "<signatory><t_person>"
except KeyError: self.fill_xml('person')
pass self.xml += "</t_person></signatory>"
self.xml += "</{}>".format(goAMLmapping[t]) self.xml += "</{}>".format(goAMLmapping[t])
def fill_xml(self, t):
for k in self.document[t]:
try:
self.xml += "<{0}>{1}</{0}>".format(goAMLmapping[k], self.document[t][k])
except KeyError:
pass
def handler(q=False): def handler(q=False):
if q is False: if q is False:
return False return False
@ -73,7 +82,7 @@ def handler(q=False):
exp_doc.parse_objects() exp_doc.parse_objects()
exp_doc.build_xml() exp_doc.build_xml()
return {'response': {}, 'data': exp_doc.xml} return {'response': {}, 'data': exp_doc.xml}
#return {'response': [], 'data': str(base64.b64encode(bytes(exp_doc.document, 'utf-8')), 'utf-8')} #return {'response': [], 'data': str(base64.b64encode(bytes(exp_doc.xml, 'utf-8')), 'utf-8')}
def introspection(): def introspection():
modulesetup = {} modulesetup = {}