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

part of '../../child_tasks.dart';

/// Command input for breaking one parent task into direct children.
class ChildTaskBreakUpRequest {
  /// Creates a `ChildTaskBreakUpRequest` 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.
  ChildTaskBreakUpRequest({
    required String parentTaskId,
    required List<ChildTaskEntry> entries,
    required String operationId,
  })  : parentTaskId = _requiredTrimmed(parentTaskId, 'parentTaskId'),
        entries = List<ChildTaskEntry>.unmodifiable(entries),
        operationId = _requiredTrimmed(operationId, 'operationId');

  /// Parent task that will own every created child.
  final String parentTaskId;

  /// Ordered child rows supplied by the caller.
  final List<ChildTaskEntry> entries;

  /// Idempotency key for the application command that creates the children.
  final String operationId;
}
