def create_order_summary_on_salesforce_task(success, sp_id): tm = TaskManager() invoice_json = tm.get_subprocess_data(sp_id) return tm.process_task(sp_id, 'CREATE ORDER SUMMARY', success, lambda: create_order_summary(invoice_json))
def send_collections_email_task(success, customer_email, sp_id): tm = TaskManager() json = tm.get_subprocess_data(sp_id) file_name = json['file_name'] return tm.process_task(sp_id, 'SENDING EMAIL', success, lambda : send_email(COLLECTIONS_EMAIL_TITLE, COLLECTIONS_EMAIL_BODY, EMAIL_FROM, customer_email, file_name, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', json))
def send_invoice_email_task(success, sp_id): tm = TaskManager() json = tm.get_subprocess_data(sp_id) customer_email = json['customer']['email'] file_name = json['pdf_file_name'] return tm.process_task(sp_id, 'SENDING EMAIL', success, lambda : send_email(INVOCE_EMAIL_TITLE, INVOICE_EMAIL_BODY, EMAIL_FROM, customer_email, file_name, 'application/pdf', json))
def send_invoice_email_task(success, sp_id): tm = TaskManager() json = tm.get_subprocess_data(sp_id) customer_email = json['customer']['email'] file_name = json['pdf_file_name'] return tm.process_task( sp_id, 'SENDING EMAIL', success, lambda: send_email(INVOCE_EMAIL_TITLE, INVOICE_EMAIL_BODY, EMAIL_FROM, customer_email, file_name, 'application/pdf', json))
def send_collections_email_task(success, customer_email, sp_id): tm = TaskManager() json = tm.get_subprocess_data(sp_id) file_name = json['file_name'] return tm.process_task( sp_id, 'SENDING EMAIL', success, lambda: send_email( COLLECTIONS_EMAIL_TITLE, COLLECTIONS_EMAIL_BODY, EMAIL_FROM, customer_email, file_name, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', json))
def generate_pdf_and_upload_task(success, sp_id): tm = TaskManager() return tm.process_task( sp_id, 'INVOICING', success, lambda: generate_pdf_and_upload(tm.get_subprocess_data(sp_id)))
def generate_revenue_report_task(success, orders, sp_id): tm = TaskManager() return tm.process_task(sp_id, 'GENERATING REVENUES REPORT', success, lambda : generate_revenue_report(orders))
def generate_journal_task(success, orders, sp_id): tm = TaskManager() json = tm.get_subprocess_data(sp_id) return tm.process_task(sp_id, 'GENERATING JOURNAL', success, lambda : generate_journal(json, orders))
def charge_user_task(success, sp_id): tm = TaskManager() json = tm.get_subprocess_data(sp_id) return tm.process_task(sp_id, 'CHARGING',success, lambda : charge_user(json))
def send_contracting_email_task(success, account, sp_id): tm = TaskManager() return tm.process_task(sp_id, 'SEND CONTRACTING EMAIL', success, lambda: (True, None))
def create_order_task(success, sp_id): tm = TaskManager() return tm.process_task(sp_id, 'RATING', success, lambda : create_order(tm.get_subprocess_data(sp_id)))
def download_and_parse_sdr_task(success, bucket_key, tef_account, sp_id): tm = TaskManager() return tm.process_task(sp_id, 'RATING', success, lambda : download_and_parse_sdr(bucket_key, tef_account))
def update_contact_on_salesforce_task(success, status, contact_id, invoicing_address, order_code, sp_id): tm = TaskManager() return tm.process_task(sp_id, 'NOTIFY SALESFORCE', success, lambda : update_contact(status, contact_id, invoicing_address, order_code))
def get_customer_details_from_sf_task(success, sp_id): tm = TaskManager() return tm.process_task(sp_id, 'CUSTOMER DATA', success, lambda : customer_details_from_sf(tm.get_subprocess_data(sp_id)))
def activate_contract_on_salesforce_task(success, contract, sp_id): tm = TaskManager() return tm.process_task(sp_id, 'ACTIVATE CONTRACT', success, lambda: activate_contract(contract))
def send_contracting_email_task(success, account, sp_id): tm = TaskManager() return tm.process_task(sp_id, 'SEND CONTRACTING EMAIL', success, lambda : (True, None))
def activate_contract_on_salesforce_task(success, contract, sp_id): tm = TaskManager() return tm.process_task(sp_id, 'ACTIVATE CONTRACT', success, lambda : activate_contract(contract))
def rate_from_order_task(success, order, line_items, billing_address, sp_id): tm = TaskManager() return tm.process_task(sp_id, 'RATING', success, lambda : rate_from_order(order, line_items, billing_address))
def create_order_summary_on_salesforce_task(success, sp_id): tm = TaskManager() invoice_json = tm.get_subprocess_data(sp_id) return tm.process_task(sp_id, 'CREATE ORDER SUMMARY', success, lambda : create_order_summary(invoice_json))
def get_customer_details_from_sf_task(success, sp_id): tm = TaskManager() return tm.process_task( sp_id, 'CUSTOMER DATA', success, lambda: customer_details_from_sf(tm.get_subprocess_data(sp_id)))
def update_contact_on_salesforce_task(success, status, contact_id, invoicing_address, order_code, sp_id): tm = TaskManager() return tm.process_task( sp_id, 'NOTIFY SALESFORCE', success, lambda: update_contact( status, contact_id, invoicing_address, order_code))