import type { BulkActivityHierarchyPayload, BulkMilestoneHierarchyPayload, BulkPhaseHierarchyPayload, BulkStructureNode } from '../types/bulkStructure'; /** * Minimal shape required from existing ordered entities. * * Existing phases, milestones or activities are only used here * to determine where new items should be appended. * * generateRanksAtEnd() currently expects an Ordered-compatible * object, which contains both id and rank. */ interface RankedItem { id: string; rank: string; } /** * Public builder used when bulk inserting activities directly * into an existing milestone. * * Flow: * * parsed BulkStructureNode[] * -> assign ranks after existing activities * -> convert nested tasks * -> BulkActivityHierarchyPayload[] * * Example: * * Parsed: * * Activity 1 * Task 1 * Activity 2 * * Existing activities: * * [ * { id: 'existing-1', rank: '...' } * ] * * Output: * * [ * { * name: 'Activity 1', * rank: '', * tasks: [ * { name: 'Task 1' } * ] * }, * { * name: 'Activity 2', * rank: '' * } * ] */ export declare function buildActivityHierarchy(nodes: BulkStructureNode[], existingActivities: RankedItem[]): BulkActivityHierarchyPayload[]; /** * Converts parsed milestone nodes into ranked milestone payloads. * * Root milestones are ranked after the milestones already present * in the existing phase. * * Activities nested inside a newly-created milestone start with an * empty existing activity list because that milestone does not yet * contain any activities. * * Example parsed input: * * Milestone 1 * Activity 1 * Task 1 * Activity 2 * Milestone 2 * * Output: * * [ * { * name: 'Milestone 1', * rank: '', * activities: [ * { * name: 'Activity 1', * rank: '', * tasks: [ * { name: 'Task 1' } * ] * }, * { * name: 'Activity 2', * rank: '' * } * ] * }, * { * name: 'Milestone 2', * rank: '' * } * ] */ export declare function buildMilestoneHierarchy(nodes: BulkStructureNode[], existingMilestones: RankedItem[]): BulkMilestoneHierarchyPayload[]; /** * Converts parsed phase nodes into the final ranked phase hierarchy payload. * * Root phases are ranked after the phases already present in the project. * * Milestones inside a newly-created phase start with an empty existing * milestone list because the new phase has no existing milestones yet. * * The same rule continues recursively: * * new phase * -> new milestones * -> new activities * -> new tasks * * Only phase, milestone and activity receive ranks. * Tasks do not. * * ------------------------------------------------------------ * Example * ------------------------------------------------------------ * * Parsed input: * * Phase 1 * Milestone 1 * Activity 1 * Task 1 * Activity 2 * Phase 2 * * Output: * * [ * { * name: 'Phase 1', * rank: '', * milestones: [ * { * name: 'Milestone 1', * rank: '', * activities: [ * { * name: 'Activity 1', * rank: '', * tasks: [ * { * name: 'Task 1' * } * ] * }, * { * name: 'Activity 2', * rank: '' * } * ] * } * ] * }, * { * name: 'Phase 2', * rank: '' * } * ] * * Overall responsibility of this file: * * parsed generic hierarchy * -> add frontend-owned ranks * -> produce GraphQL/domain hierarchy payload * * The backend remains responsible for IDs, foreign keys, defaults, * slugs, statuses and persistence. */ export declare function buildPhaseHierarchy(nodes: BulkStructureNode[], existingPhases: RankedItem[]): BulkPhaseHierarchyPayload[]; export {};