package com.cameleer.server.core.runtime;

/**
 * Hook called by domain services before creating a new entity. Implementations enforce
 * environment-level policy (e.g., license caps) without dragging Spring or app-module types
 * into core.
 *
 * <p>The guard is consulted with the current count; implementations throw to abort creation.
 * The {@link #NOOP} singleton is the default for tests and for boot configurations that haven't
 * wired enforcement yet.</p>
 */
@FunctionalInterface
public interface CreateGuard {

    /** Throw to reject creation; otherwise return normally. */
    void check(long current);

    CreateGuard NOOP = c -> { };
}
