def post_error_report()

in jobs/eam-integrations/scripts/workday_netsuite_integration.py [0:0]


    def post_error_report(self, operation):
        output_data = None
        
        for record in self.error_lst:
            employees_data = record[0].get('employees', [])
            error_description = record[1]
            row_id = record[2]
            
            for employee in employees_data:                
                output_data = [{
                    "row_id": row_id,
                    "error_description": error_description,
                    "operation": operation,  
                    "External ID": employee.get("External ID"),
                    "Employee ID": employee.get("Employee ID"),
                    "Last Name": employee.get("Last Name"),
                    "First Name": employee.get("First Name"),
                    "Original Hire Date": employee.get("Original Hire Date"),
                    "Most Recent Hire Date": employee.get("Most Recent Hire Date"),
                    "Termination Date": employee.get("Termination Date"),
                    "Employee Type": employee.get("Employee Type"),
                    "Employee Status - Active?": employee.get("Employee Status - Active?"),
                    "Email - Primary Work": employee.get("Email - Primary Work"),
                    "Manager ID": employee.get("Manager ID"),
                    "Cost Center - ID": employee.get("Cost Center - ID"),
                    "Address1": employee.get("Address1"),
                    "Address2": employee.get("Address2"),
                    "State": employee.get("State"),
                    "City": employee.get("City"),
                    "Zipcode": employee.get("Zipcode"),
                    "Country": employee.get("Country"),
                    "CountryName": employee.get("CountryName"),
                    "Company": employee.get("Company"),
                    "DEFAULT CURRENCY FOR EXP. REPORT": employee.get("DEFAULT CURRENCY FOR EXP. REPORT"),
                    "Payment Method": employee.get("Payment Method"),
                    "Class": employee.get("Class", ""),  
                    "newEmployee": employee.get("newEmployee"),
                    "Rehire": employee.get("Rehire"),
                    "InternationalTransfer": False if not employee.get("InternationalTransfer") else employee.get("InternationalTransfer"),
                    "oldCountryCode": employee.get("oldCountryCode"),
                    "oldCountryName": employee.get("oldCountryName")
                }]
                ret = self.ns_restlet.post_error_report(output_data)
                 
        self.error_lst = []