Conversation
- Define user stories (Heights P1, Flexible Tides P2, Generic Callback P1) - Add functional requirements FR-001 to FR-010 - Add acceptance scenarios and edge cases - Include requirements quality checklist
- Document API endpoint decisions (v2?heights) - Define package structure (Repository/Gateway at root) - Plan for getTideHeights and getTides methods - Note breaking change for TidesCallback<T> refactoring
- Define TideHeights, Height, Tides, TideDataType entities - Add TidesResponse and HeightResponse DTOs - Define generic TidesCallback<T> interface - Add WorldTides.getTideHeights and getTides method signatures
- Add Kotlin and Java usage examples for getTideHeights and getTides - Define 31 implementation tasks across 5 phases - Organize tasks by user story for independent delivery - Include parallel execution opportunities and MVP strategy
BREAKING CHANGE: TidesCallback is now TidesCallback<T>. Existing consumers using the Java-style callback must update their code to specify the type. - TidesCallback now accepts type parameter for result type - Updated getTideExtremes to use TidesCallback<TideExtremes>
- Move WorldTidesRepository.kt from extremes/ to package root - Move WorldTidesGateway.kt from extremes/ to package root - Update imports in RetrofitClient.kt - Repository and Gateway are now shared infrastructure
- Add Height model (date, height) - Add TideHeights wrapper class - Add HeightResponse and TideHeightsResponse DTOs - Add heights endpoint to WorldTidesGateway - Add heights method to WorldTidesRepository - Add getTideHeights methods to WorldTides (Kotlin + Java)
- Add TideDataType enum (HEIGHTS, EXTREMES) - Add Tides model with optional heights and extremes - Add TidesResponse DTO for combined API responses - Add dynamic tides endpoint to WorldTidesGateway - Add tides method to WorldTidesRepository - Add getTides methods to WorldTides (Kotlin + Java)
- Add getTideHeights (Kotlin lambda + Java callback) - Add getTides with flexible TideDataType list parameter - Both methods support Kotlin Result pattern and Java callback
- Mark Heights as supported in API table - Add getTideHeights usage examples (Kotlin + Java) - Add getTides usage examples for flexible data requests - Update existing examples to reflect generic TidesCallback<T>
- Add WorldTidesGatewayHeightsTest (10 tests) - Add WorldTidesRepositoryHeightsTest (4 tests) - Add WorldTidesGatewayTidesTest (9 tests) - Add WorldTidesRepositoryTidesTest (7 tests) - Add TideDataTypeTest (4 tests) - Add HeightTest (5 tests) - Add TideHeightsTest (4 tests) - Add TidesTest (6 tests) - Update WorldTidesTest with getTideHeights/getTides tests (6 new tests) - Fix existing tests for generic TidesCallback<T> and package moves Total: 69 tests (55 new, 14 existing)
- Add Heights API, Tides API to CHANGELOG - Document breaking change for TidesCallback<T> - Add new models and test coverage to CHANGELOG - Mark all Phase 5 tasks complete
BREAKING CHANGE: Height.date is now Date instead of Date? Removes null-date test case as it's no longer valid.
Adds toExtreme(), toTideExtremes(), toHeight(), toTideHeights() extensions. Includes unit tests for all mapping functions. Refactors WorldTidesRepository to use new extensions.
Centralizes Retrofit callback handling into a single generic extension. Reduces ~45 lines of duplicated code across repository methods. No functional change - all existing tests pass.
- Delete WorldTidesJavaApiTest.kt (duplicate of WorldTidesTest) - Remove query param tests from heights/tides gateways (kept in extremes) - Remove trivial enum count tests from TideDataTypeTest - Remove trivial edge cases from HeightTest and TideHeightsTest Test count reduced from 76 to 59 while maintaining coverage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces support for fetching tide height predictions and flexible combined tide data in the WorldTides library. It adds new API methods, refactors the callback interface to be generic, and introduces new data models and enums. The changes include breaking API changes, updated documentation, and new architectural patterns to enable future extensibility.
API Changes and Breaking Changes
TidesCallback<T>, requiring migration for existing Java consumers. TheHeight.dateproperty is now non-nullable for consistency. [1] [2] [3] [4]New Features and Methods
getTideHeights()andgetTides()methods toWorldTides, allowing retrieval of tide heights and flexible combinations of tide data types (e.g., heights and extremes) via both Kotlin and Java-friendly interfaces. Introduced theTideDataTypeenum for specifying data types. [1] [2] [3] [4]Data Model and Architecture
TideHeights,Height, andTidesfor flexible responses, along with corresponding DTOs for parsing API responses. Updated the internal architecture to move repositories and gateways to package root and introduced new package structure for feature-specific and shared models. [1] [2] [3]Documentation and Developer Experience
Specification and Planning
These changes collectively modernize the WorldTides library, improve flexibility for future data types, and ensure a smooth developer experience across both Kotlin and Java.