def login(cls, username, password): path = "api/authenticate" data = {"password": username, "username": password} response = Request.execute_post_request(path, data) return response['id_token']
def create_random_company_contact_person(cls, company_id, authorization=""): return Request.execute_post_request("api/company/%d/company-contact-people" % company_id, { 'companyId': company_id, 'first_name': "Javier Hernán", 'last_name': "Caballero Garcia", 'email': "*****@*****.**", 'telephone': "2634200463", 'job_possition': "Jefe" }, authorization=authorization)
def create_traceability_audit(cls, traceability_audit, authorization=""): return Request.execute_post_request('api/traceability-audits', traceability_audit, authorization=authorization)
def review_audit_recommendation(cls, recommendation, authorization=""): return Request.execute_put_request("api/recommendations", recommendation, authorization=authorization)
def review_audit_process_recommendation(cls, audit_process_recommendation, authorization=""): return Request.execute_put_request("api/audit-process-recommendations", audit_process_recommendation, authorization=authorization)
def finish_traceability_audit(cls, traceability_audit_id, authorization=""): return Request.execute_put_request( "api/traceability-audits/%s/finish" % traceability_audit_id, {}, authorization=authorization)
def get_one_traceability_audit(cls, traceability_audit_id, authorization=""): return Request.execute_get_request("api/traceability-audits/%s" % traceability_audit_id, authorization=authorization)
def get_all_traceability_audit(cls, authorization=""): return Request.execute_get_request("api/traceability-audits", authorization=authorization)
def get_all_process(cls, authorization=""): return Request.execute_get_request('api/audit-processes?pagination=false', authorization=authorization)
def get_company_contact_person(cls, company_id, authorization=""): return Request.execute_get_request("api/company/%s/company-contact-people?pagination=false" % company_id, authorization=authorization)
def get_recommendation(cls, company_id, authorization=""): return Request.execute_get_request( "api/recommendation-next-category/%s" % company_id, authorization=authorization)
def get_all_companies(cls, authorization=""): return Request.execute_get_request('api/companies?pagination=false', authorization=authorization)
def get_certificate(cls, cuit): return Request.execute_get_request("api/search_result/%s" % cuit)
def get_company(cls, company_id, authorization=""): return Request.execute_get_request("api/companies/%s" % company_id, authorization=authorization)