diff --git a/backend/app/services/export_service.py b/backend/app/services/export_service.py index 1d7148a0..bcdad10f 100644 --- a/backend/app/services/export_service.py +++ b/backend/app/services/export_service.py @@ -175,6 +175,28 @@ def generate_markdown_export(session: Session, options: SessionExport) -> str: lines.append(f"*{decision['timestamp']}*") lines.append("") + # Resolution / Outcome Notes + _raw_notes = getattr(session, 'outcome_notes', None) + outcome_notes = _raw_notes if isinstance(_raw_notes, str) else '' + if outcome_notes.strip() and options.include_outcome_notes: + lines.append("---") + lines.append("") + lines.append("## Resolution") + lines.append("") + lines.append(outcome_notes.strip()) + lines.append("") + + # Next Steps + _raw_next = getattr(session, 'next_steps', None) + next_steps = _raw_next if isinstance(_raw_next, str) else '' + if next_steps.strip() and options.include_next_steps: + lines.append("---") + lines.append("") + lines.append("## Next Steps") + lines.append("") + lines.append(next_steps.strip()) + lines.append("") + return "\n".join(lines) @@ -232,6 +254,24 @@ def generate_text_export(session: Session, options: SessionExport) -> str: if duration_seconds is not None: lines.append(f" Duration: {_format_step_duration(duration_seconds)}") + # Resolution + _raw_notes = getattr(session, 'outcome_notes', None) + outcome_notes = _raw_notes if isinstance(_raw_notes, str) else '' + if outcome_notes.strip() and options.include_outcome_notes: + lines.append("") + lines.append("RESOLUTION") + lines.append("-" * 20) + lines.append(outcome_notes.strip()) + + # Next Steps + _raw_next = getattr(session, 'next_steps', None) + next_steps = _raw_next if isinstance(_raw_next, str) else '' + if next_steps.strip() and options.include_next_steps: + lines.append("") + lines.append("NEXT STEPS") + lines.append("-" * 20) + lines.append(next_steps.strip()) + return "\n".join(lines) @@ -304,6 +344,20 @@ def generate_html_export(session: Session, options: SessionExport) -> str: html_parts.append(f'
') html_parts.append('') + # Resolution + _raw_notes = getattr(session, 'outcome_notes', None) + outcome_notes = _raw_notes if isinstance(_raw_notes, str) else '' + if outcome_notes.strip() and options.include_outcome_notes: + html_parts.append('