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

import cn.axzo.msg.center.service.enums.AppTerminalTypeEnum;
import cn.axzo.msg.center.service.enums.TerminalTypeEnum;
import cn.axzo.msg.center.service.pending.ClientRequest;
import lombok.Getter;
import lombok.Setter;

import java.util.List;
import java.util.Set;

/**
 * @author yanglin
 */
@Setter
@Getter
public class GetPendingTodosRequest implements ClientRequest {
    /**
     * 待办执行人id
     */
    private Set<Long> personIds;
    /**
     * 待办单位id
     */
    private Set<Long> ouIds;
    /**
     * 模版id
     */
    private Set<String> templateCodes;
    /**
     * 项目id
     */
    private List<Long> workspaceIds;
    /**
     * 最大查询数据. 最多不超过 5000
     */
    private int limit = 10;

    private TerminalTypeEnum terminalType;

    private AppTerminalTypeEnum appTerminalType;

    public int determineLimit() {
        if (limit <= 0)
            return 10;
        return Math.min(limit, 5000);
    }

}