from pydantic import BaseModel

from src.util.string_util import is_not_empty


class InstEmpCsvDownloadViewModel(BaseModel):
    subtitle: str = '施設担当者データCSVダウンロード'
    is_search: bool = False
    ta_cd: str = ''
    inst_cd: str = ''
    emp_cd: str = ''
    emp_chg_type_cd: str = ''
    apply_date_from: str = ''
    start_date_from: str = ''
    start_date_to: str = ''
    end_date_from: str = ''
    end_date_to: str = ''
    create_date_from: str = ''
    create_date_to: str = ''
    update_date_from: str = ''
    update_date_to: str = ''
    select_table: str = ''
    data_count: int = 0
    result_msg: str = ''
    download_file_url: str = ''
    file_name: str = ''

    def is_select_table_empty(self):
        return not is_not_empty(self.select_table)

    def is_download_file_url_empty(self):
        return not is_not_empty(self.download_file_url)
