Ejemplo n.º 1
0
def search_bidding_by_process(process_id):
    # Some process IDs can come with a '/' char. The frontend should replace
    # it for '_'.
    process_id = process_id.replace("_", "/")
    bi = biddings_inspector.BiddingsInspector()
    response = {"data": bi.get_bidding(process_id=process_id)}
    return response
Ejemplo n.º 2
0
def search_companies_for_bidding(entity_id, bidding_id, process_id):
    # Some process IDs can come with a '/' char. The frontend should replace
    # it for '_'.
    process_id = process_id.replace("_", "/")
    bi = biddings_inspector.BiddingsInspector()
    response = {
        "data": bi.get_bidding_companies(bidding_id, entity_id, process_id)
    }
    return response
Ejemplo n.º 3
0
    def build_companies_bidding_list(self):
        """
        Create a simple list of Names and IDS (CNPJ) of Companies inside Redis.
        This list should not contain duplicated Companies.
        Return:
            (str) status from redis insert operation. "OK" if everything
            was inserted.
        """
        logging.debug("Creating a Companies LIST (Names and IDs).")
        bi = biddings_inspector.BiddingsInspector()

        all_data = bi.get_all_companies()

        self.__connect_redis(db=1)

        key_name = "all_biddings_companies_list"

        return self.redis_connector.set(key_name, json.dumps(all_data))
Ejemplo n.º 4
0
def search_biddings_for_company(company_id):
    bi = biddings_inspector.BiddingsInspector()
    response = {"data": bi.get_bidding_by_company(company_id)}
    return response
Ejemplo n.º 5
0
def search_biddings(entity_id):
    bi = biddings_inspector.BiddingsInspector()
    response = {"data": bi.get_biddings_by_entity(entity_id)}
    return response
Ejemplo n.º 6
0
def search_biddings_open_and_close(entity_id, open_date, close_date):
    bi = biddings_inspector.BiddingsInspector()
    response = {
        "data": bi.get_biddings_by_entity(entity_id, open_date, close_date)
    }
    return response