Cost Report Template Generator #119

Closed
opened 2025-10-03 22:49:47 +00:00 by tegwick · 0 comments
Owner

Create a markdown template system that generates cost note documents from database data with relevant information as contentmatter.

Background

The cost tracking system (Issue #110) stores financial data in the database. We need a way to generate professional cost reports and notes as markdown documents that can be shared, versioned, and integrated with existing documentation workflows.

Requirements

Template System

  • Create a markdown template for cost reports
  • Support dynamic data injection from cost tracking database
  • Generate documents with proper frontmatter/contentmatter structure
  • Include period summaries, cost breakdowns, and allocation details

Content Structure

The generated documents should include:

  • Frontmatter: Metadata about the report (period, total costs, generation date)
  • Content: Formatted cost breakdown with tables and summaries
  • Contentmatter: Structured data for programmatic access

Key Features

  1. Period Reports: Generate reports for specific calculation periods
  2. Cost Category Breakdown: Show costs grouped by categories (Infrastructure, Software, etc.)
  3. Issue Allocation Summary: Display how costs were allocated to active issues
  4. Audit Trail: Include transaction history for transparency
  5. Format Options: Support different output formats (summary, detailed, audit)

Example Output Structure

---
report_type: cost_summary
period_start: 2025-01-01
period_end: 2025-01-31
total_costs: 87.00
currency: EUR
generated_at: 2025-01-31T23:59:59Z
---

# Cost Summary Report - January 2025

## Overview
- **Total Costs**: €87.00
- **Active Issues**: 12
- **Cost per Issue**: €7.25

## Cost Breakdown by Category
[Generated tables with cost data]

## Issue Allocations
[Generated allocation summaries]

<!--
contentmatter:
cost_data:
  total: 87.00
  categories:
    - name: Infrastructure
      amount: 10.00
  allocations:
    - issue_id: 123
      amount: 7.25
-->

Integration Points

  • Integrate with existing template-render command
  • Use MarkiTect's contentmatter system for structured data
  • Support batch generation for multiple periods
  • Enable integration with existing markdown workflows

CLI Interface

markitect cost-report generate --period 2025-01 --format summary
markitect cost-report generate --period 2025-01 --format detailed --output reports/
markitect cost-report template --show  # Display template structure

Acceptance Criteria

  • Template system generates valid markdown with frontmatter/contentmatter
  • Reports include accurate financial data from database
  • Multiple output formats supported (summary, detailed, audit)
  • CLI integration follows MarkiTect patterns
  • Generated documents are ingestible back into MarkiTect
  • Template is customizable and extensible
Create a markdown template system that generates cost note documents from database data with relevant information as contentmatter. ## Background The cost tracking system (Issue #110) stores financial data in the database. We need a way to generate professional cost reports and notes as markdown documents that can be shared, versioned, and integrated with existing documentation workflows. ## Requirements ### Template System - Create a markdown template for cost reports - Support dynamic data injection from cost tracking database - Generate documents with proper frontmatter/contentmatter structure - Include period summaries, cost breakdowns, and allocation details ### Content Structure The generated documents should include: - **Frontmatter**: Metadata about the report (period, total costs, generation date) - **Content**: Formatted cost breakdown with tables and summaries - **Contentmatter**: Structured data for programmatic access ### Key Features 1. **Period Reports**: Generate reports for specific calculation periods 2. **Cost Category Breakdown**: Show costs grouped by categories (Infrastructure, Software, etc.) 3. **Issue Allocation Summary**: Display how costs were allocated to active issues 4. **Audit Trail**: Include transaction history for transparency 5. **Format Options**: Support different output formats (summary, detailed, audit) ### Example Output Structure ```markdown --- report_type: cost_summary period_start: 2025-01-01 period_end: 2025-01-31 total_costs: 87.00 currency: EUR generated_at: 2025-01-31T23:59:59Z --- # Cost Summary Report - January 2025 ## Overview - **Total Costs**: €87.00 - **Active Issues**: 12 - **Cost per Issue**: €7.25 ## Cost Breakdown by Category [Generated tables with cost data] ## Issue Allocations [Generated allocation summaries] <!-- contentmatter: cost_data: total: 87.00 categories: - name: Infrastructure amount: 10.00 allocations: - issue_id: 123 amount: 7.25 --> ``` ### Integration Points - Integrate with existing template-render command - Use MarkiTect's contentmatter system for structured data - Support batch generation for multiple periods - Enable integration with existing markdown workflows ### CLI Interface ```bash markitect cost-report generate --period 2025-01 --format summary markitect cost-report generate --period 2025-01 --format detailed --output reports/ markitect cost-report template --show # Display template structure ``` ## Acceptance Criteria - [ ] Template system generates valid markdown with frontmatter/contentmatter - [ ] Reports include accurate financial data from database - [ ] Multiple output formats supported (summary, detailed, audit) - [ ] CLI integration follows MarkiTect patterns - [ ] Generated documents are ingestible back into MarkiTect - [ ] Template is customizable and extensible
tegwick added this to the Issue Cost Tracking and Estimation project 2025-10-03 22:50:34 +00:00
tegwick moved this to Done in Issue Cost Tracking and Estimation on 2025-10-04 21:41:17 +00:00
Sign in to join this conversation.