// SPDX-FileCopyrightText: 2026 FocusFlow contributors
// SPDX-License-Identifier: AGPL-3.0-only

part of '../../models.dart';

/// Typed validation error thrown by domain model constructors.
class DomainValidationException extends ArgumentError {
  /// Creates a `DomainValidationException` instance with the values required by its invariants.
  /// Callers should pass already-normalized scheduler data because validation and defaulting belong at the model or service boundary, not in arbitrary UI code.
  DomainValidationException({
    required this.code,
    required Object? invalidValue,
    required String name,
    required String message,
  }) : super.value(invalidValue, name, message);

  /// Stable category for application and persistence layers.
  final DomainValidationCode code;
}
