Skip to content

Implement full CHANGE_DATE structure support#15

Merged
AdamIsrael merged 1 commit intomainfrom
change_date
Dec 8, 2025
Merged

Implement full CHANGE_DATE structure support#15
AdamIsrael merged 1 commit intomainfrom
change_date

Conversation

@AdamIsrael
Copy link
Copy Markdown
Owner

Summary

Implements complete GEDCOM 5.5.1 CHANGE_DATE structure support across all record types, including DATE, TIME, and NOTE fields.

Motivation

Previously, CHANGE_DATE implementation was inconsistent:

  • Some record types only captured the DATE value, discarding TIME and NOTE
  • SourceRecord and NoteRecord skipped CHANGE_DATE parsing entirely

This PR brings full GEDCOM 5.5.1 compliance for change tracking metadata.

Changes

New Type

  • Created ChangeDate struct with date, time, and notes fields
  • Comprehensive parser with 11 unit tests covering all scenarios

Updated Record Types

All 7 GEDCOM record types now use Option<ChangeDate>:

  • ✅ Individual records
  • ✅ Family records
  • ✅ Submitter records
  • ✅ Repository records
  • ✅ Multimedia records
  • ✅ Source records (previously skipping CHAN entirely)
  • ✅ Note records (previously skipping CHAN entirely)

Testing

  • Added comprehensive tests for TIME and NOTE field parsing
  • Updated all existing tests to work with new ChangeDate struct
  • All 266 tests passing (212 unit + 8 main + 25 edge + 21 integration)

Documentation

  • Updated ROADMAP.md to reflect full CHANGE_DATE support
  • Changed status from "basic parsing" to "full support: DATE, TIME, NOTE"

Breaking Changes

⚠️ Breaking API Change: The change_date field type changed from Option<String> to Option<ChangeDate> across all record types.

This is acceptable as confirmed with the maintainer - there are no users yet.

Verification

  • ✅ All 266 tests pass
  • ✅ No clippy warnings (cargo clippy -- -D warnings)
  • ✅ Code properly formatted (cargo fmt)
  • ✅ Successfully builds

Example

Before:

pub change_date: Option<String>  // Only DATE value

After:

pub change_date: Option<ChangeDate>  // Full structure

CHANGE_DATE Structure Now Captures:

n CHAN
  +1 DATE <value>      ✅ Captured
    +2 TIME <value>    ✅ Captured (was discarded)
  +1 NOTE <value>      ✅ Captured (was discarded)

…E fields

Add complete GEDCOM 5.5.1 CHANGE_DATE structure support across all record types.

Previously, CHANGE_DATE was either partially implemented (only capturing DATE)
or completely skipped (SourceRecord and NoteRecord). This commit implements
full support including DATE, TIME, and NOTE fields as specified in GEDCOM 5.5.1.

Changes:
- Add new ChangeDate struct with date, time, and notes fields
- Update all 7 record types to use ChangeDate instead of Option<String>:
  * Individual records
  * Family records
  * Submitter records
  * Repository records
  * Multimedia records
  * Source records (previously skipping CHAN entirely)
  * Note records (previously skipping CHAN entirely)
- Add comprehensive test coverage for all CHANGE_DATE features
- Update ROADMAP.md to reflect full CHANGE_DATE support

Breaking change: change_date field type changed from Option<String> to
Option<ChangeDate> across all record types. This is acceptable as there
are no users yet.

All 266 tests passing. No clippy warnings.
@AdamIsrael AdamIsrael requested a review from Copilot December 8, 2025 15:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements complete GEDCOM 5.5.1 CHANGE_DATE structure support across all record types by introducing a dedicated ChangeDate struct that captures DATE, TIME, and NOTE fields. Previously, some records only stored the DATE value as a string, while SourceRecord and NoteRecord skipped CHANGE_DATE parsing entirely.

Key Changes:

  • Created new ChangeDate struct with comprehensive parsing logic and 11 unit tests
  • Updated all 7 GEDCOM record types to use Option<ChangeDate> instead of Option<String>
  • Enhanced documentation to reflect full CHANGE_DATE support

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/types/change_date.rs New file implementing ChangeDate struct with parser supporting DATE, TIME, and NOTE fields
src/types/mod.rs Added ChangeDate module and export
src/types/submitter.rs Replaced manual CHAN parsing with ChangeDate::parse call and updated tests
src/types/source_record.rs Replaced CHAN skip logic with ChangeDate::parse and updated field type
src/types/repository_record.rs Replaced basic DATE extraction with full ChangeDate::parse
src/types/note_record.rs Replaced CHAN skip logic with ChangeDate::parse
src/types/multimedia_record.rs Replaced basic DATE extraction with full ChangeDate::parse
src/types/individual/individual.rs Replaced manual CHAN parsing with ChangeDate::parse and added test for NOTE field
src/types/family.rs Replaced basic DATE extraction with full ChangeDate::parse and added test for NOTE field
src/main.rs Updated integration tests to work with new ChangeDate struct
docs/ROADMAP.md Updated CHANGE_DATE status from "basic parsing" to "full support" across all record types

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@AdamIsrael AdamIsrael merged commit b8206a7 into main Dec 8, 2025
8 checks passed
@AdamIsrael AdamIsrael deleted the change_date branch December 8, 2025 15:18
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.

2 participants