package p.packer.dtos;

import p.packer.messages.assets.AssetAction;

import java.util.Objects;

public record PackerAssetActionAvailabilityDTO(
        AssetAction action,
        boolean enabled,
        boolean visible,
        String reason) {

    public PackerAssetActionAvailabilityDTO {
        Objects.requireNonNull(action, "action");
        reason = reason == null ? null : reason.trim();
        if (reason != null && reason.isBlank()) {
            reason = null;
        }
    }
}
