package com.bcxin.api.interfaces.commons;
import lombok.Getter;

import java.io.Serializable;

@Getter
public class CommonImportResponse implements Serializable {
    private final String resourceId;
    private final int totalSuccess;
    private final int totalFailed;
    private final int totalCount;
    private final int totalPending;
    private final String message;
    private String downloadUrl;

    public CommonImportResponse(String resourceId, int totalCount, int totalSuccess, int totalFailed,String message) {
        this.resourceId = resourceId;
        this.totalSuccess = totalSuccess;
        this.totalFailed = totalFailed;
        this.totalCount = totalCount;
        this.totalPending = totalCount - totalSuccess - totalFailed;

        this.message = message;
    }

    public void buildDownloadUrl(String downloadUrl) {
        this.downloadUrl = downloadUrl;
    }

    public static CommonImportResponse create(
            String resourceId, int totalCount, int totalSuccess,
            int totalFailed,String message) {
        return new CommonImportResponse(resourceId, totalCount, totalSuccess, totalFailed,message);
    }
}
