Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
Email system

validate_email(email):

if email is in correct format:

            return True

else:

            return False

 

send_email(xml, timer_start):

error_codes = []

contacts = customerContact(xml)

 

if xml does not exist or is empty:

            append 1 to error_codes

 

if xml size > 10485760:

            append 2 to error_codes

 

if not validate_email(contacts[‘cust_email’):

append 3 to error_codes

 

if any error codes:

            raise Input error

create email

try:

            send mail

 

return communication_report(error_codes, timer_start) , contacts[‘cust_email’]

 
Code Block
Health check


healthCheckInfo():


upTime = current time  time server started 

...



alive = True

...



find call_num in database

...



 

...



return {'alive’: alive, 'serverUpTime': upTime, 'numTransactions': call_num, 'currentVersion' : "Version 1 release"}

 

Log 

Code Block
Log 

log_health_check():


create new health check call

...



add call to database

...



 


log_send_invoice(user_id, email_address):


create new send invoice call

...



add call to database
Code Block
Ubl
Extractor 
 Extractor 

customerContact(xml):


turn xml into string invoice

...



find customer in xml

...



find customer info in customer

...



find contact info from the customer info

...



 

...



find seller in xml

...



find seller info in customer

...



find contact info from the seller info

...



 

...



add customer contact info and seller info to dictionary

...



 

...



return contact dictionary

...