Skip to content

feat(health): add CSV and JSON export for daily health summaries - #35

Merged
johnnyhuy merged 1 commit into
mainfrom
agent/issue-34-daily-summary-export
Nov 9, 2026
Merged

johnnyhuy merged 1 commit into
mainfrom
agent/issue-34-daily-summary-export

Conversation

@johnnyhuy

Copy link
Copy Markdown
Contributor

Adds CSV and JSON file output for daily health summaries. An Array extension on DailyHealthSummary provides csvString, jsonData, writeCSV and writeJSON, so the export pipeline from parsed records to daily summaries now ends in usable files.

Part of #6. Closes #34.

How it was verified:

  • mise run lint - 503 violations, 11 serious in 128 files, same baseline as origin/main. No violations in the two added files.
  • mise run build - passed, Build complete.
  • mise run test - passed, 142 tests with 0 failures. The 9 new DailyHealthSummaryExportTests are listed below.
  • mise run ios:build:dev and mise run ios:test:ui were not run. Nothing user-facing changed. This slice is core export logic only.

Proof, terminal capture from mise run test filtered to the new suite:

Test Case '-[BetterFitTests.DailyHealthSummaryExportTests testCSVEmptyArrayIsHeaderOnly]' passed.
Test Case '-[BetterFitTests.DailyHealthSummaryExportTests testCSVEmptyFieldsForMissingValues]' passed.
Test Case '-[BetterFitTests.DailyHealthSummaryExportTests testCSVHeaderAndRows]' passed.
Test Case '-[BetterFitTests.DailyHealthSummaryExportTests testCSVPreservesArrayOrder]' passed.
Test Case '-[BetterFitTests.DailyHealthSummaryExportTests testExportFromParsedExport]' passed.
Test Case '-[BetterFitTests.DailyHealthSummaryExportTests testJSONEmptyArray]' passed.
Test Case '-[BetterFitTests.DailyHealthSummaryExportTests testJSONRoundTrip]' passed.
Test Case '-[BetterFitTests.DailyHealthSummaryExportTests testJSONUsesISO8601DatesAndSortedKeys]' passed.
Test Case '-[BetterFitTests.DailyHealthSummaryExportTests testWriteCSVAndJSONToDisk]' passed.
Executed 142 tests, with 0 failures (0 unexpected)

Each test name states what it shows. Together they cover the CSV header and row values, empty fields for nil values instead of zeros, a header-only file for empty input, preserving array order, ISO8601 dates with sorted keys in JSON, a JSON round-trip back to the same summaries, writing both formats to disk and reading them back, and an end-to-end run from HealthExportParser through dailySummaries into both exports.

Reviewer notes:

@johnnyhuy
johnnyhuy merged commit 7b65a40 into main Nov 9, 2026
10 checks passed
@johnnyhuy
johnnyhuy deleted the agent/issue-34-daily-summary-export branch November 9, 2026 19:23
This was referenced Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add CSV and JSON export for daily health summaries

1 participant