Ejemplo n.º 1
0
    def post(self):
        req = request.get_json()
        pipeline_id = RequestHandler.get_pipeline_id(req, True)
        threshold = RequestHandler.get_threshold(req, False)
        frameworks = Pipeline.get_frameworks_from_pipeline_id(pipeline_id)

        match_table_data = get_match_table(pipeline_id, frameworks, threshold)
        response = ResponseHandler.create_response(match_table_data, 200)
        return response
Ejemplo n.º 2
0
    def post(self):
        req = request.get_json()
        pipeline_id = RequestHandler.get_pipeline_id(req, True)
        pipeline = Pipeline.get_pipeline_from_id(pipeline_id)

        match_table_selections = RequestHandler.get_match_table_selections(
            req,
            True
        )
        
        self.set_match_table_selections(pipeline, match_table_selections)
        
        response_data = self.make_response_data(pipeline_id, pipeline, match_table_selections)
        response = ResponseHandler.create_response(response_data, 200)
        return response
Ejemplo n.º 3
0
    def post(self):
        req = request.get_json()
        pipeline_id = RequestHandler.get_pipeline_id(req, True)
        _ = Pipeline.get_pipeline_from_id(pipeline_id)

        framework_recommendations = get_framework_recommendations(pipeline_id)

        response = ResponseHandler.create_response(framework_recommendations, 200)
        return response
Ejemplo n.º 4
0
    def post(self):
        req = request.get_json()
        pipeline_id = RequestHandler.get_pipeline_id(req, True)
        _ = Pipeline.get_pipeline_from_id(pipeline_id)

        preview_data = get_preview(pipeline_id)
        resp_data = self.create_response_data(pipeline_id, preview_data, req)
        response = ResponseHandler.create_response(resp_data, 200)
        return response
Ejemplo n.º 5
0
    def post(self):
        req = request.get_json()
        pipeline_id = RequestHandler.get_pipeline_id(req, True)
        pipeline = Pipeline.get_pipeline_from_id(pipeline_id)

        self.extract_and_save_to_pipeline(req, pipeline)

        resp_data = self.create_response_data(pipeline)
        response = self.make_response(resp_data)
        return response
Ejemplo n.º 6
0
    def post(self):
        req = request.get_json()
        pipeline_id = RequestHandler.get_pipeline_id(req, True)
        _ = Pipeline.get_pipeline_from_id(pipeline_id)

        score, explanation = Pipeline.calculate_score(pipeline_id)

        resp = {
            c.PIPELINE_ID: str(pipeline_id),
            c.TIMESTAMP: str(datetime.datetime.now()),
            "score": str(score),
            "explanation": str(explanation)
        }

        response = ResponseHandler.create_response(resp, 200)
        return response
    def post(self):
        req = request.get_json()

        pipeline_id = RequestHandler.get_pipeline_id(req, True)        
        pipeline = Pipeline.get_pipeline_from_id(pipeline_id)
        
        competencies = req[c.FRAMEWORKS].get(c.COMPETENCY)
        occupations = req[c.FRAMEWORKS].get(c.OCCUPATION)
        industries = req[c.FRAMEWORKS].get(c.INDUSTRY)
        
        self.validate(pipeline_id, competencies)

        frameworks = self.compile_frameworks(competencies, occupations, industries)
        self.store_given_frameworks(pipeline, frameworks)

        resp_data = self.create_response_data(pipeline_id)
        response = ResponseHandler.create_response(resp_data, 200)
        return response
Ejemplo n.º 8
0
    def post(self):
        req = request.get_json()
        pipeline_id = RequestHandler.get_pipeline_id(req, True)
        pipeline = Pipeline.get_pipeline_from_id(pipeline_id)

        job_schema_plus_file = generate_job_schema_plus(pipeline_id)

        schema, data = self.convert_jspf_to_human_readable(
            pipeline, job_schema_plus_file)

        resp_data = self.create_response_data(pipeline_id,
                                              job_schema_plus_file, schema,
                                              data)

        self.save_output(job_schema_plus_file, schema, data, pipeline_id)

        response = ResponseHandler.create_response(resp_data, 200)
        return response
Ejemplo n.º 9
0
    def extract_and_save_to_pipeline(self, req, pipeline):
        job_title = RequestHandler.get_job_title(req)
        primary_economic_activity = RequestHandler.get_primary_economic_activity(
            req)
        employer_name = RequestHandler.get_employer_name(req)
        employer_overview = RequestHandler.get_employer_overview(req)
        employer_email = RequestHandler.get_employer_email(req)
        employer_website = RequestHandler.get_employer_website(req)
        employer_address = RequestHandler.get_employer_address(req)
        employer_phone = RequestHandler.get_employer_phone(req)
        competency = RequestHandler.get_competency(req)
        job_summary = RequestHandler.get_job_summary(req)
        industry_code = RequestHandler.get_industry_code(req)
        occupation_code = RequestHandler.get_occupation_code(req)
        job_location = RequestHandler.get_job_location(req)
        job_location_type = RequestHandler.get_job_location_type(req)
        employment_unit = RequestHandler.get_employment_unit(req)
        employer_identifier = RequestHandler.get_employer_identifier(req)
        assessment = RequestHandler.get_assessment(req)
        employment_agreement = RequestHandler.get_employment_agreement(req)
        job_term = RequestHandler.get_job_term(req)
        job_schedule = RequestHandler.get_job_schedule(req)
        work_hours = RequestHandler.get_work_hours(req)
        requirements = RequestHandler.get_requirements(req)
        application_location_requirement = RequestHandler.get_application_location_requirement(
            req)
        citizenship_requirement = RequestHandler.get_citizenship_requirement(
            req)
        physical_requirement = RequestHandler.get_physical_requirement(req)
        sensory_requirement = RequestHandler.get_sensory_requirement(req)
        security_clearance_requirement = RequestHandler.get_security_clearance_requirement(
            req)
        special_commitment = RequestHandler.get_special_commitment(req)
        currency = RequestHandler.get_currency(req)
        minimum = RequestHandler.get_minimum(req)
        maximum = RequestHandler.get_maximum(req)
        frequency = RequestHandler.get_frequency(req)
        incentive_compensation = RequestHandler.get_incentive_compensation(req)
        job_benefits = RequestHandler.get_job_benefits(req)
        date_posted = RequestHandler.get_date_posted(req)
        valid_through = RequestHandler.get_valid_through(req)
        job_openings = RequestHandler.get_job_openings(req)

        pipeline.job_title = job_title
        pipeline.primary_economic_activity = primary_economic_activity
        pipeline.employer_name = employer_name
        pipeline.employer_overview = employer_overview
        pipeline.employer_email = employer_email
        pipeline.employer_website = employer_website
        pipeline.employer_address = employer_address
        pipeline.employer_phone = employer_phone
        pipeline.competency = competency
        pipeline.job_summary = job_summary
        pipeline.industry_code = industry_code
        pipeline.occupation_code = occupation_code
        pipeline.job_location = job_location
        pipeline.job_location_type = job_location_type
        pipeline.employment_unit = employment_unit
        pipeline.employer_identifier = employer_identifier
        pipeline.assessment = assessment
        pipeline.employment_agreement = employment_agreement
        pipeline.job_term = job_term
        pipeline.job_schedule = job_schedule
        pipeline.work_hours = work_hours
        pipeline.requirements = requirements
        pipeline.application_location_requirement = application_location_requirement
        pipeline.citizenship_requirement = citizenship_requirement
        pipeline.physical_requirement = physical_requirement
        pipeline.sensory_requirement = sensory_requirement
        pipeline.security_clearance_requirement = security_clearance_requirement
        pipeline.special_commitment = special_commitment
        pipeline.currency = currency
        pipeline.minimum = minimum
        pipeline.maximum = maximum
        pipeline.frequency = frequency
        pipeline.incentive_compensation = incentive_compensation
        pipeline.job_benefits = job_benefits
        pipeline.date_posted = date_posted
        pipeline.valid_through = valid_through
        pipeline.job_openings = job_openings

        DB.session.commit()