from data_process import pre_process,process
from models.project_data import SubProjectModel,SubProjectItemModel


def process_project(project: SubProjectModel) -> bool:
    """
    分析处理数据
    :param project: 项目
    :return: None
    """
    if _pre_process_data(project):
        if process_data(project):
            return True
        else:
            return False
    else:
        return False


def _pre_process_data(project: SubProjectModel) -> bool:
    """
    预处理数据
    :param project: 项目
    :return: None
    """
    return pre_process.PreProcess().run(project)

def process_data(project: SubProjectModel) -> bool:
    """
    处理数据
    :param project: 项目编号
    :return: None
    """
    return process.Process().run(project)

def process_item(project_item: SubProjectItemModel) -> bool:
    """
    处理数据
    :param project_item: 项目明细
    :return: None
    """
    return process.Process().process_item(project_item)