<?php

declare(strict_types=1);

namespace Drupal\nodehive_path_alias\Plugin\Validation\Constraint;

use Symfony\Component\Validator\Constraint;

/**
 * Validation constraint for unique path aliases scoped per NodeHive space.
 *
 * Replaces core UniquePathAlias via hook_validation_constraint_alter.
 * Uniqueness is checked per (alias + langcode + nodehive_space).
 */
final class NodehiveSpaceUniquePathAliasConstraint extends Constraint {

  /**
   * Violation message when alias is already in use in this space.
   */
  public string $message = 'The alias %alias is already in use in this space.';

  /**
   * Violation message when alias exists with different capitalization.
   */
  public string $differentCapitalizationMessage = 'The alias %alias could not be added because it is already in use in this space with different capitalization: %stored_alias.';

}
