Refactor: Format code and update lint baselines

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 is contained in:
2025-06-13 22:20:25 +02:00
parent a7f8ca75be
commit 7e70d8e62d
55 changed files with 503 additions and 204 deletions

117
.idea/codeStyles/Project.xml generated Normal file
View File

@ -0,0 +1,117 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<codeStyleSettings language="XML">
<option name="FORCE_REARRANGE_MODE" value="1" />
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
</indentOptions>
<arrangement>
<rules>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:android</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:id</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>style</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>ANDROID_ATTRIBUTE_ORDER</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>.*</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
</rules>
</arrangement>
</codeStyleSettings>
</code_scheme>
</component>

5
.idea/codeStyles/codeStyleConfig.xml generated Normal file
View File

@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
</state>
</component>

View File

@ -2,6 +2,8 @@
Copyright &copy; 2022 Ryanair Labs Copyright &copy; 2022 Ryanair Labs
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
documentation files ( the "Software" ), to deal in the Software only with the scope of recruitment process, with associated
documentation files ( the "Software" ), to deal in the Software only with the scope of recruitment
process, with
limitation the rights to publish, distribute, sublicense, and/or sell copies of the Software. limitation the rights to publish, distribute, sublicense, and/or sell copies of the Software.

View File

@ -4,8 +4,10 @@
We would like you to build an app to search for flights. We would like you to build an app to search for flights.
You are provided with a codebase containing a bit of code so that you can start working on the task faster. It You are provided with a codebase containing a bit of code so that you can start working on the task
includes some parts of the UI, basic network layer implementation with DTOs & DI setup. Feel free to modify any file faster. It
includes some parts of the UI, basic network layer implementation with DTOs & DI setup. Feel free to
modify any file
you find in the repo this is only there to help you out. you find in the repo this is only there to help you out.
Please develop an Android app with the following requirements: Please develop an Android app with the following requirements:
@ -29,11 +31,12 @@ Please develop an Android app with the following requirements:
* User can use search field to filter the airports list * User can use search field to filter the airports list
* Screen works with 2 configurations * Screen works with 2 configurations
* Origin selection all stations are available for selection * Origin selection all stations are available for selection
* Destination selection only stations to which we can travel from origin selection are available for selection * Destination selection only stations to which we can travel from origin selection are
available for selection
### Results screen ### Results screen
* A list of results for the specified search criteria is shown * A list of results for the specified search criteria is shown
* Show only the crucial information about the trip * Show only the crucial information about the trip
* Make sure to handle network errors and empty results * Make sure to handle network errors and empty results
@ -44,7 +47,7 @@ ___
* for `AirportService` and `RoutesService`: <https://services-api.ryanair.com/> * for `AirportService` and `RoutesService`: <https://services-api.ryanair.com/>
* for `FlightService`: <https://nativeapps.ryanair.com/api/> * for `FlightService`: <https://nativeapps.ryanair.com/api/>
*Tip: For test purposes try DUB (Dublin) STN (London Stansted) route it has flights every day.* *Tip: For test purposes try DUB (Dublin) STN (London Stansted) route it has flights every day.*
--- ---
@ -60,11 +63,14 @@ ___
### Questions for you ### Questions for you
Please submit the answers to the following questions in the README.md file Please submit the answers to the following questions in the README.md file
* How long did you spend on the task? * How long did you spend on the task?
* Rate from 0-10, how would you assess the complexity of the task? _0 - very trivial_, _10 - extremely complex_ * Rate from 0-10, how would you assess the complexity of the task? _0 - very trivial_, _10 -
extremely complex_
* If you had more time (or if you were doing it in production) what would you have changed/improved? * If you had more time (or if you were doing it in production) what would you have changed/improved?
* Which parts of the code would you like to highlight? * Which parts of the code would you like to highlight?
* In your opinion, which Google library was the best addition to the Android Dev world in the last years? * In your opinion, which Google library was the best addition to the Android Dev world in the last
years?
> If you have the need to comment the provided task, we would love to hear that from you 🙂 > If you have the need to comment the provided task, we would love to hear that from you 🙂
> ... > ...
@ -72,13 +78,17 @@ Please submit the answers to the following questions in the README.md file
### Time frame ### Time frame
You have __4 days__ to submit your solution. There is no need to spend more than 12 hours on the task as we don't seek perfection. You have __4 days__ to submit your solution. There is no need to spend more than 12 hours on the
task as we don't seek perfection.
Focus on the key areas of Android development Focus on the key areas of Android development
--- ---
#### Please fork this repository. After finishing a task, create pull request to the parent repository ``main`` branch. #### Please fork this repository. After finishing a task, create pull request to the parent repository
You are allowed to use AI tools to assist with this programming task. However, you will be asked to explain your solutions in detail. ``main`` branch.
You are allowed to use AI tools to assist with this programming task. However, you will be asked to
explain your solutions in detail.
--- ---

View File

@ -1,6 +1,3 @@
import java.io.FileInputStream
import java.util.Properties
plugins { plugins {
alias(libs.plugins.kotlin.serialization) alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.flights.android.application.compose) alias(libs.plugins.flights.android.application.compose)

View File

@ -82,14 +82,14 @@
id="Aligned16KB" id="Aligned16KB"
message="The native library `arm64-v8a/libmockkjvmtiagent.so` (from `io.mockk:mockk-agent-android:1.14.2`) is not 16 KB aligned"> message="The native library `arm64-v8a/libmockkjvmtiagent.so` (from `io.mockk:mockk-agent-android:1.14.2`) is not 16 KB aligned">
<location <location
file="$GRADLE_USER_HOME/caches/8.11.1/transforms/9ee3fe20033b4dd897c7dfcf7c303d16/transformed/mockk-agent-android-1.14.2/jni/arm64-v8a/libmockkjvmtiagent.so"/> file="$GRADLE_USER_HOME/caches/8.11.1/transforms/78a476c196dc0b141a854b3fe010ce3f/transformed/mockk-agent-android-1.14.2/jni/arm64-v8a/libmockkjvmtiagent.so"/>
</issue> </issue>
<issue <issue
id="Aligned16KB" id="Aligned16KB"
message="The native library `arm64-v8a/libmockkjvmtiagent.so` (from `io.mockk:mockk-agent-android:1.14.2`) is not 16 KB aligned"> message="The native library `arm64-v8a/libmockkjvmtiagent.so` (from `io.mockk:mockk-agent-android:1.14.2`) is not 16 KB aligned">
<location <location
file="$GRADLE_USER_HOME/caches/8.11.1/transforms/9ee3fe20033b4dd897c7dfcf7c303d16/transformed/mockk-agent-android-1.14.2/jni/arm64-v8a/libmockkjvmtiagent.so"/> file="$GRADLE_USER_HOME/caches/8.11.1/transforms/78a476c196dc0b141a854b3fe010ce3f/transformed/mockk-agent-android-1.14.2/jni/arm64-v8a/libmockkjvmtiagent.so"/>
</issue> </issue>
<issue <issue

View File

@ -1,74 +1,170 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<vector <vector android:height="108dp"
android:height="108dp"
android:width="108dp" android:width="108dp"
android:viewportHeight="108" android:viewportHeight="108"
android:viewportWidth="108" android:viewportWidth="108"
xmlns:android="http://schemas.android.com/apk/res/android"> xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#3DDC84" <path
android:pathData="M0,0h108v108h-108z"/> android:fillColor="#3DDC84"
<path android:fillColor="#00000000" android:pathData="M9,0L9,108" android:pathData="M0,0h108v108h-108z" />
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> <path
<path android:fillColor="#00000000" android:pathData="M19,0L19,108" android:fillColor="#00000000"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> android:pathData="M9,0L9,108"
<path android:fillColor="#00000000" android:pathData="M29,0L29,108" android:strokeColor="#33FFFFFF"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> android:strokeWidth="0.8" />
<path android:fillColor="#00000000" android:pathData="M39,0L39,108" <path
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> android:fillColor="#00000000"
<path android:fillColor="#00000000" android:pathData="M49,0L49,108" android:pathData="M19,0L19,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> android:strokeColor="#33FFFFFF"
<path android:fillColor="#00000000" android:pathData="M59,0L59,108" android:strokeWidth="0.8" />
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> <path
<path android:fillColor="#00000000" android:pathData="M69,0L69,108" android:fillColor="#00000000"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> android:pathData="M29,0L29,108"
<path android:fillColor="#00000000" android:pathData="M79,0L79,108" android:strokeColor="#33FFFFFF"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> android:strokeWidth="0.8" />
<path android:fillColor="#00000000" android:pathData="M89,0L89,108" <path
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> android:fillColor="#00000000"
<path android:fillColor="#00000000" android:pathData="M99,0L99,108" android:pathData="M39,0L39,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> android:strokeColor="#33FFFFFF"
<path android:fillColor="#00000000" android:pathData="M0,9L108,9" android:strokeWidth="0.8" />
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> <path
<path android:fillColor="#00000000" android:pathData="M0,19L108,19" android:fillColor="#00000000"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> android:pathData="M49,0L49,108"
<path android:fillColor="#00000000" android:pathData="M0,29L108,29" android:strokeColor="#33FFFFFF"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> android:strokeWidth="0.8" />
<path android:fillColor="#00000000" android:pathData="M0,39L108,39" <path
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> android:fillColor="#00000000"
<path android:fillColor="#00000000" android:pathData="M0,49L108,49" android:pathData="M59,0L59,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> android:strokeColor="#33FFFFFF"
<path android:fillColor="#00000000" android:pathData="M0,59L108,59" android:strokeWidth="0.8" />
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> <path
<path android:fillColor="#00000000" android:pathData="M0,69L108,69" android:fillColor="#00000000"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> android:pathData="M69,0L69,108"
<path android:fillColor="#00000000" android:pathData="M0,79L108,79" android:strokeColor="#33FFFFFF"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> android:strokeWidth="0.8" />
<path android:fillColor="#00000000" android:pathData="M0,89L108,89" <path
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> android:fillColor="#00000000"
<path android:fillColor="#00000000" android:pathData="M0,99L108,99" android:pathData="M79,0L79,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> android:strokeColor="#33FFFFFF"
<path android:fillColor="#00000000" android:pathData="M19,29L89,29" android:strokeWidth="0.8" />
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> <path
<path android:fillColor="#00000000" android:pathData="M19,39L89,39" android:fillColor="#00000000"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> android:pathData="M89,0L89,108"
<path android:fillColor="#00000000" android:pathData="M19,49L89,49" android:strokeColor="#33FFFFFF"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> android:strokeWidth="0.8" />
<path android:fillColor="#00000000" android:pathData="M19,59L89,59" <path
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> android:fillColor="#00000000"
<path android:fillColor="#00000000" android:pathData="M19,69L89,69" android:pathData="M99,0L99,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> android:strokeColor="#33FFFFFF"
<path android:fillColor="#00000000" android:pathData="M19,79L89,79" android:strokeWidth="0.8" />
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> <path
<path android:fillColor="#00000000" android:pathData="M29,19L29,89" android:fillColor="#00000000"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> android:pathData="M0,9L108,9"
<path android:fillColor="#00000000" android:pathData="M39,19L39,89" android:strokeColor="#33FFFFFF"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> android:strokeWidth="0.8" />
<path android:fillColor="#00000000" android:pathData="M49,19L49,89" <path
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> android:fillColor="#00000000"
<path android:fillColor="#00000000" android:pathData="M59,19L59,89" android:pathData="M0,19L108,19"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> android:strokeColor="#33FFFFFF"
<path android:fillColor="#00000000" android:pathData="M69,19L69,89" android:strokeWidth="0.8" />
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> <path
<path android:fillColor="#00000000" android:pathData="M79,19L79,89" android:fillColor="#00000000"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> android:pathData="M0,29L108,29"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
</vector> </vector>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/> <background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@mipmap/ic_launcher_foreground"/> <foreground android:drawable="@mipmap/ic_launcher_foreground" />
</adaptive-icon> </adaptive-icon>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/> <background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@mipmap/ic_launcher_foreground"/> <foreground android:drawable="@mipmap/ic_launcher_foreground" />
</adaptive-icon> </adaptive-icon>

View File

@ -1,3 +1,2 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources></resources>
</resources>

View File

@ -17,7 +17,6 @@
import com.android.build.api.dsl.ApplicationExtension import com.android.build.api.dsl.ApplicationExtension
import dev.adriankuta.flights.configureAndroidLint import dev.adriankuta.flights.configureAndroidLint
import dev.adriankuta.flights.configureDetektDependencies import dev.adriankuta.flights.configureDetektDependencies
import dev.adriankuta.flights.configureFlavors
import dev.adriankuta.flights.configureKotlinAndroid import dev.adriankuta.flights.configureKotlinAndroid
import dev.adriankuta.flights.configureUnitTests import dev.adriankuta.flights.configureUnitTests
import org.gradle.api.Plugin import org.gradle.api.Plugin

View File

@ -5,7 +5,7 @@
id="Aligned16KB" id="Aligned16KB"
message="The native library `arm64-v8a/libmockkjvmtiagent.so` (from `io.mockk:mockk-agent-android:1.14.2`) is not 16 KB aligned"> message="The native library `arm64-v8a/libmockkjvmtiagent.so` (from `io.mockk:mockk-agent-android:1.14.2`) is not 16 KB aligned">
<location <location
file="$GRADLE_USER_HOME/caches/8.11.1/transforms/9ee3fe20033b4dd897c7dfcf7c303d16/transformed/mockk-agent-android-1.14.2/jni/arm64-v8a/libmockkjvmtiagent.so"/> file="$GRADLE_USER_HOME/caches/8.11.1/transforms/78a476c196dc0b141a854b3fe010ce3f/transformed/mockk-agent-android-1.14.2/jni/arm64-v8a/libmockkjvmtiagent.so"/>
</issue> </issue>
</issues> </issues>

View File

@ -13,4 +13,4 @@ sealed interface Result<out T> {
fun <T> Flow<T>.asResult(): Flow<Result<T>> = map<T, Result<T>> { Result.Success(it) } fun <T> Flow<T>.asResult(): Flow<Result<T>> = map<T, Result<T>> { Result.Success(it) }
.onStart { emit(Result.Loading) } .onStart { emit(Result.Loading) }
.catch { emit(Result.Error(it)) } .catch { emit(Result.Error(it)) }

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<issues format="6" by="lint 8.10.1" type="baseline" client="gradle" dependencies="false" name="AGP (8.10.1)" variant="all" version="8.10.1">
<issue
id="Aligned16KB"
message="The native library `arm64-v8a/libmockkjvmtiagent.so` (from `io.mockk:mockk-agent-android:1.14.2`) is not 16 KB aligned">
<location
file="$GRADLE_USER_HOME/caches/8.11.1/transforms/78a476c196dc0b141a854b3fe010ce3f/transformed/mockk-agent-android-1.14.2/jni/arm64-v8a/libmockkjvmtiagent.so"/>
</issue>
</issues>

View File

@ -5,4 +5,4 @@ import kotlinx.coroutines.flow.Flow
fun interface ObserveAirportsUseCase { fun interface ObserveAirportsUseCase {
operator fun invoke(): Flow<List<AirportInfo>?> operator fun invoke(): Flow<List<AirportInfo>?>
} }

View File

@ -5,7 +5,7 @@
id="Aligned16KB" id="Aligned16KB"
message="The native library `arm64-v8a/libmockkjvmtiagent.so` (from `io.mockk:mockk-agent-android:1.14.2`) is not 16 KB aligned"> message="The native library `arm64-v8a/libmockkjvmtiagent.so` (from `io.mockk:mockk-agent-android:1.14.2`) is not 16 KB aligned">
<location <location
file="$GRADLE_USER_HOME/caches/8.11.1/transforms/9ee3fe20033b4dd897c7dfcf7c303d16/transformed/mockk-agent-android-1.14.2/jni/arm64-v8a/libmockkjvmtiagent.so"/> file="$GRADLE_USER_HOME/caches/8.11.1/transforms/78a476c196dc0b141a854b3fe010ce3f/transformed/mockk-agent-android-1.14.2/jni/arm64-v8a/libmockkjvmtiagent.so"/>
</issue> </issue>
</issues> </issues>

View File

@ -8,18 +8,18 @@ sealed interface Airport {
data class Departure( data class Departure(
override val code: String, override val code: String,
override val name: String, override val name: String,
override val macCity: MacCity? override val macCity: MacCity?,
) : Airport ) : Airport
data class Arrival( data class Arrival(
override val code: String, override val code: String,
override val name: String, override val name: String,
override val macCity: MacCity? override val macCity: MacCity?,
) : Airport ) : Airport
data class Connecting( data class Connecting(
override val code: String, override val code: String,
override val name: String, override val name: String,
override val macCity: MacCity? override val macCity: MacCity?,
) : Airport ) : Airport
} }

View File

@ -10,5 +10,5 @@ data class AirportInfo(
val macCity: MacCity, val macCity: MacCity,
val region: Region, val region: Region,
val country: Country, val country: Country,
val coordinates: Coordinates val coordinates: Coordinates,
) )

View File

@ -2,5 +2,5 @@ package dev.adriankuta.flights.domain.types
data class City( data class City(
val code: String, val code: String,
val name: String val name: String,
) )

View File

@ -2,5 +2,5 @@ package dev.adriankuta.flights.domain.types
data class Coordinates( data class Coordinates(
val latitude: Double, val latitude: Double,
val longitude: Double val longitude: Double,
) )

View File

@ -3,5 +3,5 @@ package dev.adriankuta.flights.domain.types
data class Country( data class Country(
val code: String, val code: String,
val name: String, val name: String,
val currencyCode: String val currencyCode: String,
) )

View File

@ -3,5 +3,5 @@ package dev.adriankuta.flights.domain.types
data class Flight( data class Flight(
val currency: String, val currency: String,
val currPrecision: Int, val currPrecision: Int,
val trips: List<Trip> val trips: List<Trip>,
) )

View File

@ -1,5 +1,5 @@
package dev.adriankuta.flights.domain.types package dev.adriankuta.flights.domain.types
data class MacCity( data class MacCity(
val macCode: String val macCode: String,
) )

View File

@ -2,5 +2,5 @@ package dev.adriankuta.flights.domain.types
data class Region( data class Region(
val code: String, val code: String,
val name: String val name: String,
) )

View File

@ -1,5 +1,5 @@
package dev.adriankuta.flights.domain.types package dev.adriankuta.flights.domain.types
data class RegularFare( data class RegularFare(
val fares: List<TripFare> val fares: List<TripFare>,
) )

View File

@ -3,5 +3,5 @@ package dev.adriankuta.flights.domain.types
data class Route( data class Route(
val departureAirport: Airport.Departure, val departureAirport: Airport.Departure,
val arrivalAirport: Airport.Arrival, val arrivalAirport: Airport.Arrival,
val connectingAirport: Airport.Connecting? val connectingAirport: Airport.Connecting?,
) )

View File

@ -5,5 +5,5 @@ data class Segment(
val destination: String, val destination: String,
val flightNumber: String, val flightNumber: String,
val dateTimes: List<String>, val dateTimes: List<String>,
val duration: String val duration: String,
) )

View File

@ -3,5 +3,5 @@ package dev.adriankuta.flights.domain.types
data class Trip( data class Trip(
val dates: List<TripDate>, val dates: List<TripDate>,
val origin: String, val origin: String,
val destination: String val destination: String,
) )

View File

@ -2,5 +2,5 @@ package dev.adriankuta.flights.domain.types
data class TripDate( data class TripDate(
val dateOut: String, val dateOut: String,
val flights: List<TripFlight> val flights: List<TripFlight>,
) )

View File

@ -3,5 +3,5 @@ package dev.adriankuta.flights.domain.types
data class TripFare( data class TripFare(
val type: String, val type: String,
val amount: Double, val amount: Double,
val count: Int val count: Int,
) )

View File

@ -7,5 +7,5 @@ data class TripFlight(
val dateTimes: List<String>, val dateTimes: List<String>,
val duration: String, val duration: String,
val segments: List<Segment>, val segments: List<Segment>,
val operatedBy: String val operatedBy: String,
) )

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<issues format="6" by="lint 8.10.1" type="baseline" client="gradle" dependencies="false" name="AGP (8.10.1)" variant="all" version="8.10.1">
<issue
id="Aligned16KB"
message="The native library `arm64-v8a/libmockkjvmtiagent.so` (from `io.mockk:mockk-agent-android:1.14.2`) is not 16 KB aligned">
<location
file="$GRADLE_USER_HOME/caches/8.11.1/transforms/78a476c196dc0b141a854b3fe010ce3f/transformed/mockk-agent-android-1.14.2/jni/arm64-v8a/libmockkjvmtiagent.so"/>
</issue>
</issues>

View File

@ -8,5 +8,4 @@ interface AirportService {
@GET("/views/locate/5/airports/{language}/active") @GET("/views/locate/5/airports/{language}/active")
suspend fun getAirports(@Path("language") languageCode: String): List<AirportResponse> suspend fun getAirports(@Path("language") languageCode: String): List<AirportResponse>
} }

View File

@ -10,9 +10,10 @@ interface FlightService {
// example query: v4/en-gb/Availability?dateout=2025-09-17&origin=WRO&destination=DUB&adt=1&ToUs=AGREED // example query: v4/en-gb/Availability?dateout=2025-09-17&origin=WRO&destination=DUB&adt=1&ToUs=AGREED
@Headers( @Headers(
"client: android", "client: android",
"client-version: 3.300.0" "client-version: 3.300.0",
) )
@GET("v4/en-gb/Availability") @GET("v4/en-gb/Availability")
@Suppress("LongParameterList")
suspend fun getFlights( suspend fun getFlights(
@Query("dateout") date: String, @Query("dateout") date: String,
@Query("origin") origin: String, @Query("origin") origin: String,
@ -21,6 +22,6 @@ interface FlightService {
@Query("teen") teen: Int, @Query("teen") teen: Int,
@Query("chd") child: Int, @Query("chd") child: Int,
@Query("inf") inf: Int = 0, @Query("inf") inf: Int = 0,
@Query("ToUs") toUs: String = "AGREED" @Query("ToUs") toUs: String = "AGREED",
): FlightResponse ): FlightResponse
} }

View File

@ -14,38 +14,38 @@ data class AirportResponse(
@Json(name = "macCity") val macCity: MacCity?, @Json(name = "macCity") val macCity: MacCity?,
@Json(name = "region") val region: Region?, @Json(name = "region") val region: Region?,
@Json(name = "country") val country: Country?, @Json(name = "country") val country: Country?,
@Json(name = "coordinates") val coordinates: Coordinates? @Json(name = "coordinates") val coordinates: Coordinates?,
) { ) {
@JsonClass(generateAdapter = true) @JsonClass(generateAdapter = true)
data class City( data class City(
@Json(name = "code") val code: String?, @Json(name = "code") val code: String?,
@Json(name = "name") val name: String? @Json(name = "name") val name: String?,
) )
@JsonClass(generateAdapter = true) @JsonClass(generateAdapter = true)
data class MacCity( data class MacCity(
@Json(name = "code") val code: String?, @Json(name = "code") val code: String?,
@Json(name = "macCode") val macCode: String?, @Json(name = "macCode") val macCode: String?,
@Json(name = "name") val name: String? @Json(name = "name") val name: String?,
) )
@JsonClass(generateAdapter = true) @JsonClass(generateAdapter = true)
data class Region( data class Region(
@Json(name = "code") val code: String?, @Json(name = "code") val code: String?,
@Json(name = "name") val name: String? @Json(name = "name") val name: String?,
) )
@JsonClass(generateAdapter = true) @JsonClass(generateAdapter = true)
data class Country( data class Country(
@Json(name = "code") val code: String?, @Json(name = "code") val code: String?,
@Json(name = "name") val name: String?, @Json(name = "name") val name: String?,
@Json(name = "currency") val currencyCode: String? @Json(name = "currency") val currencyCode: String?,
) )
@JsonClass(generateAdapter = true) @JsonClass(generateAdapter = true)
data class Coordinates( data class Coordinates(
@Json(name = "latitude") val latitude: Double?, @Json(name = "latitude") val latitude: Double?,
@Json(name = "longitude") val longitude: Double? @Json(name = "longitude") val longitude: Double?,
) )
} }

View File

@ -1,6 +1,5 @@
package dev.adriankuta.model.data.api.entities package dev.adriankuta.model.data.api.entities
import com.squareup.moshi.Json import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass import com.squareup.moshi.JsonClass
@ -8,20 +7,20 @@ import com.squareup.moshi.JsonClass
data class FlightResponse( data class FlightResponse(
@Json(name = "currency") val currency: String?, @Json(name = "currency") val currency: String?,
@Json(name = "currPrecision") val currPrecision: Int?, @Json(name = "currPrecision") val currPrecision: Int?,
@Json(name = "trips") val trips: List<Trip>? @Json(name = "trips") val trips: List<Trip>?,
) )
@JsonClass(generateAdapter = true) @JsonClass(generateAdapter = true)
data class Trip( data class Trip(
@Json(name = "dates") val dates: List<TripDate>?, @Json(name = "dates") val dates: List<TripDate>?,
@Json(name = "origin") val origin: String?, @Json(name = "origin") val origin: String?,
@Json(name = "destination") val destination: String? @Json(name = "destination") val destination: String?,
) )
@JsonClass(generateAdapter = true) @JsonClass(generateAdapter = true)
data class TripDate( data class TripDate(
@Json(name = "dateOut") val dateOut: String?, @Json(name = "dateOut") val dateOut: String?,
@Json(name = "flights") val flights: List<TripFlight>? @Json(name = "flights") val flights: List<TripFlight>?,
) )
@JsonClass(generateAdapter = true) @JsonClass(generateAdapter = true)
@ -37,14 +36,14 @@ data class TripFlight(
@JsonClass(generateAdapter = true) @JsonClass(generateAdapter = true)
data class RegularFare( data class RegularFare(
@Json(name = "fares") val fares: List<TripFare>? @Json(name = "fares") val fares: List<TripFare>?,
) )
@JsonClass(generateAdapter = true) @JsonClass(generateAdapter = true)
data class TripFare( data class TripFare(
@Json(name = "type") val type: String?, @Json(name = "type") val type: String?,
@Json(name = "amount") val amount: Double?, @Json(name = "amount") val amount: Double?,
@Json(name = "count") val count: Int? @Json(name = "count") val count: Int?,
) )
@JsonClass(generateAdapter = true) @JsonClass(generateAdapter = true)
@ -53,5 +52,5 @@ data class Segment(
@Json(name = "destination") val destination: String?, @Json(name = "destination") val destination: String?,
@Json(name = "flightNumber") val flightNumber: String?, @Json(name = "flightNumber") val flightNumber: String?,
@Json(name = "time") val dateTimes: List<String>?, @Json(name = "time") val dateTimes: List<String>?,
@Json(name = "duration") val duration: String? @Json(name = "duration") val duration: String?,
) )

View File

@ -7,7 +7,7 @@ import com.squareup.moshi.JsonClass
data class RouteResponse( data class RouteResponse(
@Json(name = "departureAirport") val departureAirport: Airport.Departure?, @Json(name = "departureAirport") val departureAirport: Airport.Departure?,
@Json(name = "arrivalAirport") val arrivalAirport: Airport.Arrival?, @Json(name = "arrivalAirport") val arrivalAirport: Airport.Arrival?,
@Json(name = "connectingAirport") val connectingAirport: Airport.Connecting? @Json(name = "connectingAirport") val connectingAirport: Airport.Connecting?,
) { ) {
sealed interface Airport { sealed interface Airport {
@ -32,19 +32,19 @@ data class RouteResponse(
data class Arrival( data class Arrival(
override val code: String?, override val code: String?,
override val name: String?, override val name: String?,
override val macCity: MacCity? override val macCity: MacCity?,
) : Airport ) : Airport
@JsonClass(generateAdapter = true) @JsonClass(generateAdapter = true)
data class Connecting( data class Connecting(
override val code: String?, override val code: String?,
override val name: String?, override val name: String?,
override val macCity: MacCity? override val macCity: MacCity?,
) : Airport ) : Airport
@JsonClass(generateAdapter = true) @JsonClass(generateAdapter = true)
data class MacCity( data class MacCity(
@Json(name = "macCode") val macCode: String? @Json(name = "macCode") val macCode: String?,
) )
} }
} }

View File

@ -5,7 +5,7 @@
id="Aligned16KB" id="Aligned16KB"
message="The native library `arm64-v8a/libmockkjvmtiagent.so` (from `io.mockk:mockk-agent-android:1.14.2`) is not 16 KB aligned"> message="The native library `arm64-v8a/libmockkjvmtiagent.so` (from `io.mockk:mockk-agent-android:1.14.2`) is not 16 KB aligned">
<location <location
file="$GRADLE_USER_HOME/caches/8.11.1/transforms/9ee3fe20033b4dd897c7dfcf7c303d16/transformed/mockk-agent-android-1.14.2/jni/arm64-v8a/libmockkjvmtiagent.so"/> file="$GRADLE_USER_HOME/caches/8.11.1/transforms/78a476c196dc0b141a854b3fe010ce3f/transformed/mockk-agent-android-1.14.2/jni/arm64-v8a/libmockkjvmtiagent.so"/>
</issue> </issue>
</issues> </issues>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<issues format="6" by="lint 8.10.1" type="baseline" client="gradle" dependencies="false" name="AGP (8.10.1)" variant="all" version="8.10.1">
<issue
id="Aligned16KB"
message="The native library `arm64-v8a/libmockkjvmtiagent.so` (from `io.mockk:mockk-agent-android:1.14.2`) is not 16 KB aligned">
<location
file="$GRADLE_USER_HOME/caches/8.11.1/transforms/78a476c196dc0b141a854b3fe010ce3f/transformed/mockk-agent-android-1.14.2/jni/arm64-v8a/libmockkjvmtiagent.so"/>
</issue>
</issues>

View File

@ -2,13 +2,13 @@ package dev.adriankuta.flights.model.data.shared
import dev.adriankuta.flights.model.datasource.shared.Cache import dev.adriankuta.flights.model.datasource.shared.Cache
public data class CacheImpl<T>(override val cacheKey: String?, override val data: T?) : data class CacheImpl<T>(override val cacheKey: String?, override val data: T?) :
Cache<T> { Cache<T> {
public companion object { companion object {
public inline fun <reified T> emptyCache(): CacheImpl<T> = inline fun <reified T> emptyCache(): CacheImpl<T> =
CacheImpl(null, null) CacheImpl(null, null)
public inline fun <reified T> Cache<T>?.orEmpty(): Cache<T> = inline fun <reified T> Cache<T>?.orEmpty(): Cache<T> =
this ?: emptyCache() this ?: emptyCache()
} }
} }

View File

@ -5,7 +5,7 @@
id="Aligned16KB" id="Aligned16KB"
message="The native library `arm64-v8a/libmockkjvmtiagent.so` (from `io.mockk:mockk-agent-android:1.14.2`) is not 16 KB aligned"> message="The native library `arm64-v8a/libmockkjvmtiagent.so` (from `io.mockk:mockk-agent-android:1.14.2`) is not 16 KB aligned">
<location <location
file="$GRADLE_USER_HOME/caches/8.11.1/transforms/9ee3fe20033b4dd897c7dfcf7c303d16/transformed/mockk-agent-android-1.14.2/jni/arm64-v8a/libmockkjvmtiagent.so"/> file="$GRADLE_USER_HOME/caches/8.11.1/transforms/78a476c196dc0b141a854b3fe010ce3f/transformed/mockk-agent-android-1.14.2/jni/arm64-v8a/libmockkjvmtiagent.so"/>
</issue> </issue>
</issues> </issues>

View File

@ -2,56 +2,77 @@
"data": [ "data": [
{ {
"name": "Adam Małysz" "name": "Adam Małysz"
}, { },
{
"name": "Harry Potter" "name": "Harry Potter"
}, { },
{
"name": "SpongeBob" "name": "SpongeBob"
}, { },
{
"name": "Miś uszatek" "name": "Miś uszatek"
}, { },
{
"name": "Brzydkie kaczątko" "name": "Brzydkie kaczątko"
}, { },
{
"name": "Papa Smerf" "name": "Papa Smerf"
}, { },
{
"name": "Smerfetka" "name": "Smerfetka"
}, { },
{
"name": "Gargamel", "name": "Gargamel",
"category": "Smerfy" "category": "Smerfy"
}, { },
{
"name": "Ważniak", "name": "Ważniak",
"category": "Smerfy" "category": "Smerfy"
}, { },
{
"name": "Roszpunka" "name": "Roszpunka"
}, { },
{
"name": "Myszka Miki" "name": "Myszka Miki"
}, { },
{
"name": "Król Lew" "name": "Król Lew"
}, { },
{
"name": "Elsa", "name": "Elsa",
"category": "Kraina lodu" "category": "Kraina lodu"
}, { },
{
"name": "Olaf", "name": "Olaf",
"category": "Kraina lodu" "category": "Kraina lodu"
}, { },
{
"name": "Mała syrenka" "name": "Mała syrenka"
}, { },
{
"name": "Kubuś Puchatek" "name": "Kubuś Puchatek"
}, { },
{
"name": "Prosiaczek", "name": "Prosiaczek",
"category": "Kubuś Puchatek" "category": "Kubuś Puchatek"
}, { },
{
"name": "Kłapouchy", "name": "Kłapouchy",
"category": "Kubuś Puchatek" "category": "Kubuś Puchatek"
}, { },
{
"name": "Królik", "name": "Królik",
"category": "Kubuś Puchatek" "category": "Kubuś Puchatek"
}, { },
{
"name": "Maleństwo", "name": "Maleństwo",
"category": "Kubuś Puchatek" "category": "Kubuś Puchatek"
}, { },
{
"name": "Pan Sowa", "name": "Pan Sowa",
"category": "Kubuś Puchatek" "category": "Kubuś Puchatek"
}, { },
{
"name": "Krzyś", "name": "Krzyś",
"category": "Kubuś Puchatek" "category": "Kubuś Puchatek"
} }

View File

@ -18,11 +18,11 @@ internal class AirportsDatasourceImpl : AirportsDatasource {
override suspend fun setAirportsInfo( override suspend fun setAirportsInfo(
airports: List<AirportResponse>, airports: List<AirportResponse>,
cacheKey: String cacheKey: String,
) { ) {
_airports.value = CacheImpl( _airports.value = CacheImpl(
cacheKey = cacheKey, cacheKey = cacheKey,
data = airports.map { it.toModel() } data = airports.map { it.toModel() },
) )
} }
} }

View File

@ -27,4 +27,4 @@ internal class AirportsDatasourceImplModule {
@Provides @Provides
@Singleton @Singleton
fun provide(): AirportsDatasourceImpl = AirportsDatasourceImpl() fun provide(): AirportsDatasourceImpl = AirportsDatasourceImpl()
} }

View File

@ -19,7 +19,7 @@ internal fun AirportResponse.toModel(): AirportInfoModel {
countryName = country?.name.orEmpty(), countryName = country?.name.orEmpty(),
countryCurrencyCode = country?.currencyCode.orEmpty(), countryCurrencyCode = country?.currencyCode.orEmpty(),
latitude = coordinates?.latitude ?: 0.0, latitude = coordinates?.latitude ?: 0.0,
longitude = coordinates?.longitude ?: 0.0 longitude = coordinates?.longitude ?: 0.0,
) )
} }
@ -38,5 +38,5 @@ private data class AirportInfoModelImpl(
override val countryName: String, override val countryName: String,
override val countryCurrencyCode: String, override val countryCurrencyCode: String,
override val latitude: Double, override val latitude: Double,
override val longitude: Double override val longitude: Double,
) : AirportInfoModel ) : AirportInfoModel

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<issues format="6" by="lint 8.10.1" type="baseline" client="gradle" dependencies="false" name="AGP (8.10.1)" variant="all" version="8.10.1">
<issue
id="Aligned16KB"
message="The native library `arm64-v8a/libmockkjvmtiagent.so` (from `io.mockk:mockk-agent-android:1.14.2`) is not 16 KB aligned">
<location
file="$GRADLE_USER_HOME/caches/8.11.1/transforms/78a476c196dc0b141a854b3fe010ce3f/transformed/mockk-agent-android-1.14.2/jni/arm64-v8a/libmockkjvmtiagent.so"/>
</issue>
</issues>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<issues format="6" by="lint 8.10.1" type="baseline" client="gradle" dependencies="false" name="AGP (8.10.1)" variant="all" version="8.10.1">
<issue
id="Aligned16KB"
message="The native library `arm64-v8a/libmockkjvmtiagent.so` (from `io.mockk:mockk-agent-android:1.14.2`) is not 16 KB aligned">
<location
file="$GRADLE_USER_HOME/caches/8.11.1/transforms/78a476c196dc0b141a854b3fe010ce3f/transformed/mockk-agent-android-1.14.2/jni/arm64-v8a/libmockkjvmtiagent.so"/>
</issue>
</issues>

View File

@ -1,6 +1,6 @@
package dev.adriankuta.flights.model.datasource.shared; package dev.adriankuta.flights.model.datasource.shared
public interface Cache<T> { interface Cache<T> {
public val cacheKey: String? val cacheKey: String?
public val data: T? val data: T?
} }

View File

@ -5,7 +5,7 @@
id="Aligned16KB" id="Aligned16KB"
message="The native library `arm64-v8a/libmockkjvmtiagent.so` (from `io.mockk:mockk-agent-android:1.14.2`) is not 16 KB aligned"> message="The native library `arm64-v8a/libmockkjvmtiagent.so` (from `io.mockk:mockk-agent-android:1.14.2`) is not 16 KB aligned">
<location <location
file="$GRADLE_USER_HOME/caches/8.11.1/transforms/9ee3fe20033b4dd897c7dfcf7c303d16/transformed/mockk-agent-android-1.14.2/jni/arm64-v8a/libmockkjvmtiagent.so"/> file="$GRADLE_USER_HOME/caches/8.11.1/transforms/78a476c196dc0b141a854b3fe010ce3f/transformed/mockk-agent-android-1.14.2/jni/arm64-v8a/libmockkjvmtiagent.so"/>
</issue> </issue>
</issues> </issues>

View File

@ -14,6 +14,6 @@ internal abstract class ObserveAirportsUseCaseModule {
@Binds @Binds
abstract fun bind( abstract fun bind(
observeAirportsUseCaseImpl: ObserveAirportsUseCaseImpl observeAirportsUseCaseImpl: ObserveAirportsUseCaseImpl,
): ObserveAirportsUseCase ): ObserveAirportsUseCase
} }

View File

@ -17,23 +17,23 @@ internal fun AirportInfoModel.toDomain(): AirportInfo {
timeZone = timeZone, timeZone = timeZone,
city = City( city = City(
code = cityCode, code = cityCode,
name = cityName name = cityName,
), ),
macCity = MacCity( macCity = MacCity(
macCode = macCode macCode = macCode,
), ),
region = Region( region = Region(
code = regionCode, code = regionCode,
name = regionName name = regionName,
), ),
country = Country( country = Country(
code = countryCode, code = countryCode,
name = countryName, name = countryName,
currencyCode = countryCurrencyCode currencyCode = countryCurrencyCode,
), ),
coordinates = Coordinates( coordinates = Coordinates(
latitude = latitude, latitude = latitude,
longitude = longitude longitude = longitude,
) ),
) )
} }

View File

@ -5,14 +5,14 @@
id="Aligned16KB" id="Aligned16KB"
message="The native library `arm64-v8a/libmockkjvmtiagent.so` (from `io.mockk:mockk-agent-android:1.14.2`) is not 16 KB aligned"> message="The native library `arm64-v8a/libmockkjvmtiagent.so` (from `io.mockk:mockk-agent-android:1.14.2`) is not 16 KB aligned">
<location <location
file="$GRADLE_USER_HOME/caches/8.11.1/transforms/9ee3fe20033b4dd897c7dfcf7c303d16/transformed/mockk-agent-android-1.14.2/jni/arm64-v8a/libmockkjvmtiagent.so"/> file="$GRADLE_USER_HOME/caches/8.11.1/transforms/78a476c196dc0b141a854b3fe010ce3f/transformed/mockk-agent-android-1.14.2/jni/arm64-v8a/libmockkjvmtiagent.so"/>
</issue> </issue>
<issue <issue
id="Aligned16KB" id="Aligned16KB"
message="The native library `arm64-v8a/libmockkjvmtiagent.so` (from `io.mockk:mockk-agent-android:1.14.2`) is not 16 KB aligned"> message="The native library `arm64-v8a/libmockkjvmtiagent.so` (from `io.mockk:mockk-agent-android:1.14.2`) is not 16 KB aligned">
<location <location
file="$GRADLE_USER_HOME/caches/8.11.1/transforms/9ee3fe20033b4dd897c7dfcf7c303d16/transformed/mockk-agent-android-1.14.2/jni/arm64-v8a/libmockkjvmtiagent.so"/> file="$GRADLE_USER_HOME/caches/8.11.1/transforms/78a476c196dc0b141a854b3fe010ce3f/transformed/mockk-agent-android-1.14.2/jni/arm64-v8a/libmockkjvmtiagent.so"/>
</issue> </issue>
<issue <issue

View File

@ -5,14 +5,14 @@
id="Aligned16KB" id="Aligned16KB"
message="The native library `arm64-v8a/libmockkjvmtiagent.so` (from `io.mockk:mockk-agent-android:1.14.2`) is not 16 KB aligned"> message="The native library `arm64-v8a/libmockkjvmtiagent.so` (from `io.mockk:mockk-agent-android:1.14.2`) is not 16 KB aligned">
<location <location
file="$GRADLE_USER_HOME/caches/8.11.1/transforms/9ee3fe20033b4dd897c7dfcf7c303d16/transformed/mockk-agent-android-1.14.2/jni/arm64-v8a/libmockkjvmtiagent.so"/> file="$GRADLE_USER_HOME/caches/8.11.1/transforms/78a476c196dc0b141a854b3fe010ce3f/transformed/mockk-agent-android-1.14.2/jni/arm64-v8a/libmockkjvmtiagent.so"/>
</issue> </issue>
<issue <issue
id="Aligned16KB" id="Aligned16KB"
message="The native library `arm64-v8a/libmockkjvmtiagent.so` (from `io.mockk:mockk-agent-android:1.14.2`) is not 16 KB aligned"> message="The native library `arm64-v8a/libmockkjvmtiagent.so` (from `io.mockk:mockk-agent-android:1.14.2`) is not 16 KB aligned">
<location <location
file="$GRADLE_USER_HOME/caches/8.11.1/transforms/9ee3fe20033b4dd897c7dfcf7c303d16/transformed/mockk-agent-android-1.14.2/jni/arm64-v8a/libmockkjvmtiagent.so"/> file="$GRADLE_USER_HOME/caches/8.11.1/transforms/78a476c196dc0b141a854b3fe010ce3f/transformed/mockk-agent-android-1.14.2/jni/arm64-v8a/libmockkjvmtiagent.so"/>
</issue> </issue>
</issues> </issues>

View File

@ -15,11 +15,11 @@ import javax.inject.Inject
@HiltViewModel @HiltViewModel
class HomeScreenViewModel @Inject constructor( class HomeScreenViewModel @Inject constructor(
private val observeAirportsUseCase: ObserveAirportsUseCase private val observeAirportsUseCase: ObserveAirportsUseCase,
) : ViewModel() { ) : ViewModel() {
internal val uiState = homeUiState( internal val uiState = homeUiState(
useCase = observeAirportsUseCase useCase = observeAirportsUseCase,
) )
.stateIn( .stateIn(
scope = viewModelScope, scope = viewModelScope,
@ -29,9 +29,8 @@ class HomeScreenViewModel @Inject constructor(
} }
private fun homeUiState( private fun homeUiState(
useCase: ObserveAirportsUseCase useCase: ObserveAirportsUseCase,
): Flow<HomeUiState> { ): Flow<HomeUiState> {
return useCase() return useCase()
.asResult() .asResult()
.map { result -> .map { result ->

View File

@ -5,14 +5,14 @@
id="Aligned16KB" id="Aligned16KB"
message="The native library `arm64-v8a/libmockkjvmtiagent.so` (from `io.mockk:mockk-agent-android:1.14.2`) is not 16 KB aligned"> message="The native library `arm64-v8a/libmockkjvmtiagent.so` (from `io.mockk:mockk-agent-android:1.14.2`) is not 16 KB aligned">
<location <location
file="$GRADLE_USER_HOME/caches/8.11.1/transforms/9ee3fe20033b4dd897c7dfcf7c303d16/transformed/mockk-agent-android-1.14.2/jni/arm64-v8a/libmockkjvmtiagent.so"/> file="$GRADLE_USER_HOME/caches/8.11.1/transforms/78a476c196dc0b141a854b3fe010ce3f/transformed/mockk-agent-android-1.14.2/jni/arm64-v8a/libmockkjvmtiagent.so"/>
</issue> </issue>
<issue <issue
id="Aligned16KB" id="Aligned16KB"
message="The native library `arm64-v8a/libmockkjvmtiagent.so` (from `io.mockk:mockk-agent-android:1.14.2`) is not 16 KB aligned"> message="The native library `arm64-v8a/libmockkjvmtiagent.so` (from `io.mockk:mockk-agent-android:1.14.2`) is not 16 KB aligned">
<location <location
file="$GRADLE_USER_HOME/caches/8.11.1/transforms/9ee3fe20033b4dd897c7dfcf7c303d16/transformed/mockk-agent-android-1.14.2/jni/arm64-v8a/libmockkjvmtiagent.so"/> file="$GRADLE_USER_HOME/caches/8.11.1/transforms/78a476c196dc0b141a854b3fe010ce3f/transformed/mockk-agent-android-1.14.2/jni/arm64-v8a/libmockkjvmtiagent.so"/>
</issue> </issue>
</issues> </issues>