Commit Graph

5 Commits

Author SHA1 Message Date
fcc84dc728 feat: Implement airport data fetching and display
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`.
2025-06-13 21:45:55 +02:00
0fb82d57dd Refactor: Update domain types for flight data
This commit refactors the domain types to better represent flight-related data.

Key changes:
- Deleted the unused `Character` data class.
- Introduced new data classes:
    - `Airport`: Represents airport information with sealed subtypes for `Departure`, `Arrival`, and `Connecting` airports.
    - `AirportInfo`: Contains detailed information about an airport, including `City`, `MacCity`, `Region`, `Country`, and `Coordinates`.
    - `City`: Represents city data with code and name.
    - `Coordinates`: Represents geographical coordinates.
    - `Country`: Represents country data including currency code.
    - `Flight`: Top-level data class for flight information, including currency and a list of `Trip` objects.
    - `MacCity`: Represents MAC (Multi-Airport City) code.
    - `Region`: Represents region data.
    - `RegularFare`: Contains a list of `TripFare` objects.
    - `Route`: Defines a flight route with departure, arrival, and optional connecting airports.
    - `Segment`: Represents a flight segment with origin, destination, flight number, dates, and duration.
    - `Trip`: Represents a trip with a list of `TripDate` objects, origin, and destination.
    - `TripDate`: Contains a date and a list of `TripFlight` objects for that date.
    - `TripFare`: Represents a fare type with amount and count.
    - `TripFlight`: Represents a specific flight within a trip, including fare information, segments, and operator.
2025-06-13 12:56:20 +02:00
a6202c5383 feat: Add Retrofit and Moshi for network operations
This commit introduces Retrofit and Moshi to handle network requests and JSON parsing.

Key changes include:
- Added Retrofit, Moshi, OkHttp, and OkHttp Logging Interceptor dependencies to `libs.versions.toml` and `model/data/api/build.gradle.kts`.
- Created data classes for API responses: `AirportResponse`, `RouteResponse`, and `FlightResponse`.
- Defined Retrofit service interfaces: `AirportService`, `RoutesService`, and `FlightService`.
- Implemented a Hilt `NetworkModule` to provide Retrofit, Moshi, and OkHttpClient instances.
- Added a Detekt configuration file for the `model/data/api` module.
- Temporarily commented out `configureFlavors` in `AndroidApplicationConvention.kt` and `ConfigureLibrary.kt`.
2025-06-12 23:44:05 +02:00
714cdb6795 Initial commit 2025-06-12 23:20:21 +02:00
1656e706a0 Initial commit 2025-06-12 10:14:10 +02:00