Skip to content

Add device_status table for tracking device availability#253

Open
chrisyamas wants to merge 5 commits intodevelopfrom
feature/issue-242-device-status
Open

Add device_status table for tracking device availability#253
chrisyamas wants to merge 5 commits intodevelopfrom
feature/issue-242-device-status

Conversation

@chrisyamas
Copy link
Copy Markdown
Contributor

Summary

This PR adds a new device_status table for tracking device operational status changes over time. The reason for this change is to enable agencies to understand data gaps due to device outages versus actual service patterns.

This is a non-breaking change (new optional table).

Resolves #242

Schema Design

Fields:

  • device_status_id (required, unique) - primary key
  • service_date (optional) - service date for the status record
  • record_timestamp (required) - when the status record was created in the system
  • status_change_timestamp (required) - when the device status actually changed
  • device_id (required) - foreign key to devices table
  • status_type (required) - type of status (online, offline, maintenance, error, degraded, etc.)
  • status_reason (optional) - reason for the status change

Design Decisions (per Dec 2025 working group):

  • two timestamps: record_timestamp vs status_change_timestamp - this allows for retroactive recording
  • service_date is optional, as device status may not align with transit service dates
  • this table excludes resolution time fields, as that type of data is uncharacteristic to the TIDES scope (seems more like administrative, work-order-like, and would require updating records)

Files Changed

New:

  • spec/device_status.schema.json - new table schema
  • samples/template/TIDES/device_status.csv - template csv file

Modified:

  • spec/tides-datapackage-profile.json - added to tides-table enum
  • samples/template/TIDES/datapackage.json - added resource entry
  • CHANGELOG.md - documented new table

- See related discussion in #242 and Fall 2025 TIDES Issues Working Group follow-up meeting notes from December 10.

Usage Notes

Each record represents a single status change event. To determine device availability over a time period, consumers query status changes and apply logic based on the most recent status_change_timestamp.

Review checklist

Per change management policy, the following must be met before feature branch changes can merge to develop branch:

  • All JSON files validate
  • Reviewed and approved by 2+ contributors or board members

@chrisyamas chrisyamas added this to the v2.0 milestone Jan 8, 2026
@chrisyamas chrisyamas self-assigned this Jan 8, 2026
@chrisyamas chrisyamas added the 📄 spec Pertains to the specification itself label Jan 8, 2026
@chrisyamas chrisyamas requested review from a team as code owners January 8, 2026 16:44
@chrisyamas chrisyamas added the 🔄 normative change A normative change requires approval of TIDES Board label Jan 8, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 8, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 8, 2026

Data Validation Report

Sample Status
./samples/template/TIDES ⚠️

@chrisyamas chrisyamas changed the base branch from main to develop March 12, 2026 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔄 normative change A normative change requires approval of TIDES Board 📄 spec Pertains to the specification itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

📄🚀 – Add device_status table for tracking device maintenance and availability

1 participant