This commit migrates date handling from `java.time` to `kotlinx-datetime` across various modules. It also introduces the display of flight search results on the home screen.
Key changes:
- Replaced `java.time.LocalDate` and related classes with `kotlinx.datetime.LocalDate` in:
- `ui/home/src/main/kotlin/dev/adriankuta/flights/ui/home/components/DatePicker.kt`
- `model/repository/src/main/kotlin/dev/adriankuta/flights/model/repository/usecases/GetFlightsSearchContentUseCaseImpl.kt`
- `ui/home/src/main/kotlin/dev/adriankuta/flights/ui/home/HomeScreen.kt`
- `ui/home/src/main/kotlin/dev/adriankuta/flights/ui/home/HomeScreenViewModel.kt`
- `domain/types/src/main/kotlin/dev/adriankuta/flights/domain/types/TripDate.kt`
- `ui/home/src/main/kotlin/dev/adriankuta/flights/ui/home/components/PassengersOptions.kt`
- `ui/home/src/main/kotlin/dev/adriankuta/flights/ui/home/components/SearchForm.kt`
- `domain/search/src/main/kotlin/dev/adriankuta/flights/domain/search/entities/SearchOptions.kt`
- Added `kotlinx-datetime` dependency to `build-logic/convention/src/main/kotlin/dev/adriankuta/partymania/ConfigureKotlinAndroid.kt`.
- Implemented `SearchResults.kt` composable to display flight search results.
- Updated `HomeScreen.kt` to show `SearchResults` when results are available and handle back navigation.
- Modified `HomeScreenViewModel.kt`:
- Introduced `SearchResultUiState` to manage search result states (Loading, Success, Error, Idle).
- Updated `search()` function to fetch and expose flight results.
- Adjusted initial airport list in `homeUiState` to filter for "DUB" and "STN" and ensure destination isn't the same as origin.
- Updated `FlightDomainMapper.kt` to parse date strings into `kotlinx.datetime.LocalDate`.
- Added `HomeUiStatePreviewParameterProvider.kt` and `FlightPreviewParameterProvider.kt` for Compose previews.
- Removed Timber dependency from `ui/home`, `domain/search`, and `domain/types` modules as it's now provided via convention plugin.
This commit introduces the ability to search for flights based on user-defined criteria.
Key changes:
- Added `GetFlightsSearchContentUseCase` interface in the domain layer and its implementation `GetFlightsSearchContentUseCaseImpl` in the repository layer to handle flight search logic.
- Implemented `FlightDomainMapper` to map `FlightResponse` from the API to the domain `Flight` model.
- Updated `NetworkModule`:
- Introduced `ServicesAPI` and `NativeAppsAPI` qualifiers to differentiate between Retrofit instances for different Ryanair APIs.
- Configured a new Retrofit instance for the `nativeapps.ryanair.com` base URL.
- Modified `FlightService` to use the `nativeapps.ryanair.com` base URL.
- Updated `FlightService` endpoint to `api/v4/en-gb/Availability`.
- Integrated `GetFlightsSearchContentUseCase` into `HomeScreenViewModel` to trigger flight searches.
- Created `SearchOptions` data class in the domain layer to encapsulate search parameters.
- Added `GetFlightsSearchContentUseCaseModule` to provide the use case implementation via Hilt.
This commit applies code formatting changes across multiple files and updates lint baseline files.
Key changes:
- Added trailing commas to data classes in the `domain/types` module and related files.
- Formatted `HomeScreenViewModel.kt`, `Result.kt`, `ObserveAirportsUseCase.kt`, `AirportService.kt`, `ObserveAirportsUseCaseModule.kt`, `AirportInfoDomainMapper.kt`, `AirportInfoModelMapper.kt`, `AirportsDatasourceModule.kt`, `AirportsDatasourceImpl.kt`, `FlightService.kt`, `Cache.kt`, and `CacheImpl.kt`.
- Updated `README.md` and `LICENCE.md` with minor formatting adjustments.
- Updated various `lint-baseline.xml` files due to changes in cached dependencies or formatting.
- Added new `lint-baseline.xml` files for `model/datasource/airports`, `model/datasource/shared`, `domain/search`, and `model/data/api`.
- Removed unused imports from `app/build.gradle.kts`.
- Reformatted XML files: `ic_launcher_round.xml`, `ic_launcher.xml`, `strings.xml`, `ic_launcher_background.xml`.
- Added project code style configuration files: `.idea/codeStyles/codeStyleConfig.xml` and `.idea/codeStyles/Project.xml`.
- Reformatted `characters.json`.
- Updated response data classes in `model/data/api/entities` with trailing commas and minor formatting.
This commit introduces the functionality to fetch airport data from the Ryanair API and display it in the UI.
Key changes:
- Added `AirportInfoModel` interface and its implementation `AirportInfoModelImpl` to represent airport data in the data layer.
- Created `AirportInfoModelMapper` to map `AirportResponse` to `AirportInfoModel`.
- Set the base URL for Retrofit in `NetworkModule` to `https://services-api.ryanair.com`.
- Added new Gradle modules: `model:data:shared`, `model:datasource:airports`, `model:datasource:shared`, and `domain:search`.
- Implemented `CacheImpl` in `model:data:shared` for generic caching.
- Defined `ObserveAirportsUseCase` interface in `domain:search` to observe airport data.
- Added Detekt configuration for the `domain:search` and `model:datasource:shared` modules.
- Created `AirportsDatasource` interface and its implementation `AirportsDatasourceImpl` to manage airport data.
- Implemented `AirportInfoDomainMapper` to map `AirportInfoModel` to the domain `AirportInfo`.
- Updated `HomeScreen` to display a list of airports using `LazyColumn`.
- Updated `HomeScreenViewModel` to fetch and expose airport data via `ObserveAirportsUseCase`.
- Added `ObserveAirportsUseCaseModule` to provide the `ObserveAirportsUseCase` implementation.
- Implemented `ObserveAirportsUseCaseImpl` in the repository layer to fetch data from the API and update the datasource.
- Added `kotlinx-datetime` dependency.
- Created `AirportsDatasourceModule` to provide `AirportsDatasource` and its implementation.
- Added `CacheObservers.kt` with a utility function `loadData` to handle cache observation and data loading logic.
- Updated dependencies in `model:data:simple`, `model:repository`, and `ui:home` build files.
- Updated `settings.gradle.kts` to include new modules.
- Defined `Cache` interface in `model:datasource:shared`.