The codebase has both TrackOccupancy and EnhancedTrackOccupancy classes, creating duplication and confusion. Consolidate into single class with unified API.
Current Issues:
- Two classes with overlapping functionality
- Confusion about which to use
- Duplicate code maintenance
- Inconsistent APIs
Proposed Solution:
- Merge
EnhancedTrackOccupancy functionality into base TrackOccupancy
- Provide high-level API:
add_wagon(), remove_wagon(), get_wagons_in_sequence()
- Keep low-level API:
add_occupant(), remove_occupant()
- Add
TrackWagonQueue value object for sequence tracking
Benefits:
- Single source of truth
- Simplified architecture
- Consistent API
Breaking Changes:
TrackOccupancy API changed with new high-level methods
TrackOccupancyRepository now provides get_wagons_on_track() method
The codebase has both
TrackOccupancyandEnhancedTrackOccupancyclasses, creating duplication and confusion. Consolidate into single class with unified API.Current Issues:
Proposed Solution:
EnhancedTrackOccupancyfunctionality into baseTrackOccupancyadd_wagon(),remove_wagon(),get_wagons_in_sequence()add_occupant(),remove_occupant()TrackWagonQueuevalue object for sequence trackingBenefits:
Breaking Changes:
TrackOccupancyAPI changed with new high-level methodsTrackOccupancyRepositorynow providesget_wagons_on_track()method