package cn.axzo.workflow.common.model.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.List;

/**
 * 组织架构人员选择器
 * 协同组织列表的限制条件
 *
 * @author tanjie@axzo.cn
 * @date 2023/11/14 11:29
 */
@Data
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class CooperationOrgDTO implements Serializable {
    private static final long serialVersionUID = 4739924705980062997L;

    /**
     * 企业组织架构范围
     **/
    private List<OrgScope> orgScopes;
    /**
     * 班组组织架构范围
     **/
    private List<OrgScope> workerTeamScopes;

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class OrgScope implements Serializable {
        private static final long serialVersionUID = 2782005617953300935L;
        /**
         * 工作台类型
         * <p>
         * 1 - 企业
         * 2 - 项目
         * 6 - oms
         */
        private Integer workspaceType;
        /**
         * 工作台ID
         */
        private Long workspaceId;
        /**
         * 单位 ID/班组单位 ID
         */
        private Long ouId;
        /**
         * 组织关系节点 ID
         */
        private Long nodeId;

        public OrgScope(Integer workspaceType, Long workspaceId, Long ouId) {
            this.workspaceType = workspaceType;
            this.workspaceId = workspaceId;
            this.ouId = ouId;
        }
    }

}
