package tech.easyflow.skill.imports;

import java.util.ArrayList;
import java.util.List;

/**
 * Skill 导入预览项。
 */
public class SkillImportPreviewItem {

    private String packageId;
    private String name;
    private String description;
    private int referenceCount;
    private int scriptCount;
    private int assetCount;
    private boolean conflict;
    private Boolean overwriteAllowed;
    private String conflictReason;
    private String packageRoot;
    private int resourceCount;
    private String packageHash;
    private List<SkillImportPreviewFile> files = new ArrayList<>();

    /**
     * 获取包内 Skill ID。
     *
     * @return 包内 Skill ID
     */
    public String getPackageId() {
        return packageId;
    }

    /**
     * 设置包内 Skill ID。
     *
     * @param packageId 包内 Skill ID
     */
    public void setPackageId(String packageId) {
        this.packageId = packageId;
    }

    public String getName() { return name; }
    public void setName(String name) { this.name = name; }
    public String getDescription() { return description; }
    public void setDescription(String description) { this.description = description; }
    public int getReferenceCount() { return referenceCount; }
    public void setReferenceCount(int referenceCount) { this.referenceCount = referenceCount; }
    public int getScriptCount() { return scriptCount; }
    public void setScriptCount(int scriptCount) { this.scriptCount = scriptCount; }
    public int getAssetCount() { return assetCount; }
    public void setAssetCount(int assetCount) { this.assetCount = assetCount; }
    public boolean isConflict() { return conflict; }
    public void setConflict(boolean conflict) { this.conflict = conflict; }

    /**
     * 获取当前用户是否允许覆盖同名 Skill。
     *
     * @return 存在冲突时的覆盖许可；无冲突时为空
     */
    public Boolean getOverwriteAllowed() { return overwriteAllowed; }

    /**
     * 设置当前用户是否允许覆盖同名 Skill。
     *
     * @param overwriteAllowed 覆盖许可
     */
    public void setOverwriteAllowed(Boolean overwriteAllowed) { this.overwriteAllowed = overwriteAllowed; }

    /**
     * 获取禁止覆盖的原因编码。
     *
     * @return 原因编码；允许覆盖或无冲突时为空
     */
    public String getConflictReason() { return conflictReason; }

    /**
     * 设置禁止覆盖的原因编码。
     *
     * @param conflictReason 原因编码
     */
    public void setConflictReason(String conflictReason) { this.conflictReason = conflictReason; }
    public String getPackageRoot() { return packageRoot; }
    public void setPackageRoot(String packageRoot) { this.packageRoot = packageRoot; }
    public int getResourceCount() { return resourceCount; }
    public void setResourceCount(int resourceCount) { this.resourceCount = resourceCount; }
    public String getPackageHash() { return packageHash; }
    public void setPackageHash(String packageHash) { this.packageHash = packageHash; }

    /**
     * 获取包内逻辑文件摘要。
     *
     * @return 按规范路径排序的文件摘要
     */
    public List<SkillImportPreviewFile> getFiles() {
        return files;
    }

    /**
     * 设置包内逻辑文件摘要。
     *
     * @param files 文件摘要
     */
    public void setFiles(List<SkillImportPreviewFile> files) {
        this.files = files == null ? new ArrayList<>() : new ArrayList<>(files);
    }
}
