package com.bcxin.tenant.domain.repositories.composites;

import com.bcxin.Infrastructures.enums.DepartImPermissionType;
import lombok.Getter;

import java.util.Collection;

@Getter
public class BatchImportDepart {
    private final String organId;
    private final Collection<DepartItem> departs;

    public BatchImportDepart(String organId, Collection<DepartItem> departs) {
        this.organId = organId;
        this.departs = departs;
    }

    public static BatchImportDepart create(String organId, Collection<DepartItem> departs) {
        return new BatchImportDepart(organId, departs);
    }

    public static class DepartItem
    {
        private final String name;
        private final String displayOrder;
        private final String parentTreeName;
        private final DepartImPermissionType permissionType;

        public DepartItem(String name, String displayOrder, String parentTreeName, DepartImPermissionType permissionType) {
            this.name = name;
            this.displayOrder = displayOrder;
            this.parentTreeName = parentTreeName;
            this.permissionType = permissionType;
        }

        public static DepartItem create(String name, String displayOrder, String parentTreeName, DepartImPermissionType permissionType) {
            return new DepartItem(name, displayOrder, parentTreeName, permissionType);
        }
    }
}
