from algorithmContract.customFilter import CustomFilter


class DataFilter:
    def __init__(self, powerFarmID: str, turbines: list, dataBatchNum: str, beginTime: str, endTime: str, excludingMonths: list, customFilter: dict[str,CustomFilter]):
        self.powerFarmID = powerFarmID
        self.turbines = turbines
        self.dataBatchNum = dataBatchNum
        self.beginTime = beginTime
        self.endTime = endTime
        self.excludingMonths = excludingMonths
        self.customFilter = customFilter

    def to_dict(self):
        return {
            "powerFarmID": self.powerFarmID,
            "turbines": self.turbines,
            "dataBatchNum": self.dataBatchNum,
            "beginTime": self.beginTime,
            "endTime": self.endTime,
            "excludingMonths": self.excludingMonths,
            "customFilter": {key: filter.to_dict() for key, filter in self.customFilter.items()}
        }
