package p.studio.workspaces.assets.details.bank;

import p.packer.messages.assets.AssetFamilyCatalog;
import p.studio.workspaces.assets.messages.AssetWorkspaceBankCompositionFile;

import java.util.List;
import java.util.Map;

final class AssetDetailsFallbackBankCompositionFamilySupport extends AssetDetailsAbstractBankCompositionFamilySupport {
    private final AssetBankCapacityService capacityService = new AssetBankCapacityService();

    @Override
    public boolean supports(AssetFamilyCatalog assetFamily) {
        return true;
    }

    @Override
    protected boolean canAdd(
            AssetDetailsBankCompositionDraft currentDraft,
            List<AssetWorkspaceBankCompositionFile> accepted,
            AssetWorkspaceBankCompositionFile candidate) {
        return true;
    }

    @Override
    public AssetDetailsBankCompositionCapacityState evaluate(AssetDetailsBankCompositionDraft draft) {
        return capacityService.evaluate(
                AssetFamilyCatalog.UNKNOWN,
                draft.selectedFiles().size(),
                Map.of(),
                Map.of(),
                0L);
    }
}
