package cn.axzo.msg.center.service.pending.request;

import cn.axzo.msg.center.service.enums.AppTerminalTypeEnum;
import com.alibaba.fastjson.JSON;
import lombok.Data;
import org.apache.commons.collections4.CollectionUtils;

import javax.validation.constraints.NotNull;
import java.util.HashSet;
import java.util.List;

/**
 * @author yanglin
 */
@Data
public class PersonTodoToBeDoneStatRequest {
    @NotNull(message = "personId is required")
    private Long personId;
    private Long ouId;
    private List<AppTerminalTypeEnum> terminals;

    public boolean isFilterByAllTerminals() {
        if (CollectionUtils.isEmpty(terminals)) return false;
        return new HashSet<>(terminals).equals(new HashSet<>(AppTerminalTypeEnum.allTerminals()));
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}
