from lib.database.db_manager import DBManager


class ExpireMaestroManager:
    db_params = None
    db_man = None

    def __init__(self, mode):
        self.db_man = DBManager(mode)

    def get_30days_left_maestro_list(self):
        unpaid_30days_sql = 'select * from maestro \
where DATE(AvailableActivateDateTime) - INTERVAL 30 DAY = DATE(NOW()) AND ActivateStatus = 1'
        day30_maestro_list = self.db_man.select(unpaid_30days_sql)
        return day30_maestro_list

    def get_7days_left_maestro_list(self):
        unpaid_7days_sql = 'select * from maestro \
where DATE(AvailableActivateDateTime) - INTERVAL 7 DAY = DATE(NOW()) AND ActivateStatus = 1'
        day7_maestro_list = self.db_man.select(unpaid_7days_sql)
        return day7_maestro_list