package jnpf.dmsService; import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component; import java.util.HashSet; import java.util.Set; /** Explicit rollout: enabled plus all-batches or a tenant:batch allowlist entry. */ @Data @Component @ConfigurationProperties(prefix = "dms.invalidation") public class DmsInvalidationProperties { private boolean enabled; private boolean allBatches; private Set allowedBatches = new HashSet<>(); public boolean allows(String tenantId, Object batchId) { return enabled && (allBatches || allowedBatches.contains(tenantId + ":" + batchId)); } }