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
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files ( the "Software" ), to deal in the Software only with the scope of recruitment process, with
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
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.

View File

@ -4,8 +4,10 @@
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
includes some parts of the UI, basic network layer implementation with DTOs & DI setup. Feel free to modify any file
You are provided with a codebase containing a bit of code so that you can start working on the task
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.
Please develop an Android app with the following requirements:
@ -29,7 +31,8 @@ Please develop an Android app with the following requirements:
* User can use search field to filter the airports list
* Screen works with 2 configurations
* 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
@ -60,11 +63,14 @@ ___
### Questions for you
Please submit the answers to the following questions in the README.md file
* 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?
* 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 🙂
> ...
@ -72,13 +78,17 @@ Please submit the answers to the following questions in the README.md file
### 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
---
#### 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 {
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.flights.android.application.compose)

View File

@ -82,14 +82,14 @@
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/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
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/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

View File

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

View File

@ -1,3 +1,2 @@
<?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 dev.adriankuta.flights.configureAndroidLint
import dev.adriankuta.flights.configureDetektDependencies
import dev.adriankuta.flights.configureFlavors
import dev.adriankuta.flights.configureKotlinAndroid
import dev.adriankuta.flights.configureUnitTests
import org.gradle.api.Plugin

View File

@ -5,7 +5,7 @@
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/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>
</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

@ -5,7 +5,7 @@
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/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>
</issues>

View File

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

View File

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

View File

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

View File

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

View File

@ -3,5 +3,5 @@ package dev.adriankuta.flights.domain.types
data class Country(
val code: 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(
val currency: String,
val currPrecision: Int,
val trips: List<Trip>
val trips: List<Trip>,
)

View File

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

View File

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

View File

@ -1,5 +1,5 @@
package dev.adriankuta.flights.domain.types
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(
val departureAirport: Airport.Departure,
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 flightNumber: 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(
val dates: List<TripDate>,
val origin: String,
val destination: String
val destination: String,
)

View File

@ -2,5 +2,5 @@ package dev.adriankuta.flights.domain.types
data class TripDate(
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(
val type: String,
val amount: Double,
val count: Int
val count: Int,
)

View File

@ -7,5 +7,5 @@ data class TripFlight(
val dateTimes: List<String>,
val duration: String,
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")
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
@Headers(
"client: android",
"client-version: 3.300.0"
"client-version: 3.300.0",
)
@GET("v4/en-gb/Availability")
@Suppress("LongParameterList")
suspend fun getFlights(
@Query("dateout") date: String,
@Query("origin") origin: String,
@ -21,6 +22,6 @@ interface FlightService {
@Query("teen") teen: Int,
@Query("chd") child: Int,
@Query("inf") inf: Int = 0,
@Query("ToUs") toUs: String = "AGREED"
@Query("ToUs") toUs: String = "AGREED",
): FlightResponse
}

View File

@ -14,38 +14,38 @@ data class AirportResponse(
@Json(name = "macCity") val macCity: MacCity?,
@Json(name = "region") val region: Region?,
@Json(name = "country") val country: Country?,
@Json(name = "coordinates") val coordinates: Coordinates?
@Json(name = "coordinates") val coordinates: Coordinates?,
) {
@JsonClass(generateAdapter = true)
data class City(
@Json(name = "code") val code: String?,
@Json(name = "name") val name: String?
@Json(name = "name") val name: String?,
)
@JsonClass(generateAdapter = true)
data class MacCity(
@Json(name = "code") val code: String?,
@Json(name = "macCode") val macCode: String?,
@Json(name = "name") val name: String?
@Json(name = "name") val name: String?,
)
@JsonClass(generateAdapter = true)
data class Region(
@Json(name = "code") val code: String?,
@Json(name = "name") val name: String?
@Json(name = "name") val name: String?,
)
@JsonClass(generateAdapter = true)
data class Country(
@Json(name = "code") val code: String?,
@Json(name = "name") val name: String?,
@Json(name = "currency") val currencyCode: String?
@Json(name = "currency") val currencyCode: String?,
)
@JsonClass(generateAdapter = true)
data class Coordinates(
@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
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@ -8,20 +7,20 @@ import com.squareup.moshi.JsonClass
data class FlightResponse(
@Json(name = "currency") val currency: String?,
@Json(name = "currPrecision") val currPrecision: Int?,
@Json(name = "trips") val trips: List<Trip>?
@Json(name = "trips") val trips: List<Trip>?,
)
@JsonClass(generateAdapter = true)
data class Trip(
@Json(name = "dates") val dates: List<TripDate>?,
@Json(name = "origin") val origin: String?,
@Json(name = "destination") val destination: String?
@Json(name = "destination") val destination: String?,
)
@JsonClass(generateAdapter = true)
data class TripDate(
@Json(name = "dateOut") val dateOut: String?,
@Json(name = "flights") val flights: List<TripFlight>?
@Json(name = "flights") val flights: List<TripFlight>?,
)
@JsonClass(generateAdapter = true)
@ -37,14 +36,14 @@ data class TripFlight(
@JsonClass(generateAdapter = true)
data class RegularFare(
@Json(name = "fares") val fares: List<TripFare>?
@Json(name = "fares") val fares: List<TripFare>?,
)
@JsonClass(generateAdapter = true)
data class TripFare(
@Json(name = "type") val type: String?,
@Json(name = "amount") val amount: Double?,
@Json(name = "count") val count: Int?
@Json(name = "count") val count: Int?,
)
@JsonClass(generateAdapter = true)
@ -53,5 +52,5 @@ data class Segment(
@Json(name = "destination") val destination: String?,
@Json(name = "flightNumber") val flightNumber: 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(
@Json(name = "departureAirport") val departureAirport: Airport.Departure?,
@Json(name = "arrivalAirport") val arrivalAirport: Airport.Arrival?,
@Json(name = "connectingAirport") val connectingAirport: Airport.Connecting?
@Json(name = "connectingAirport") val connectingAirport: Airport.Connecting?,
) {
sealed interface Airport {
@ -32,19 +32,19 @@ data class RouteResponse(
data class Arrival(
override val code: String?,
override val name: String?,
override val macCity: MacCity?
override val macCity: MacCity?,
) : Airport
@JsonClass(generateAdapter = true)
data class Connecting(
override val code: String?,
override val name: String?,
override val macCity: MacCity?
override val macCity: MacCity?,
) : Airport
@JsonClass(generateAdapter = true)
data class MacCity(
@Json(name = "macCode") val macCode: String?
@Json(name = "macCode") val macCode: String?,
)
}
}

View File

@ -5,7 +5,7 @@
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/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>
</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
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> {
public companion object {
public inline fun <reified T> emptyCache(): CacheImpl<T> =
companion object {
inline fun <reified T> emptyCache(): CacheImpl<T> =
CacheImpl(null, null)
public inline fun <reified T> Cache<T>?.orEmpty(): Cache<T> =
inline fun <reified T> Cache<T>?.orEmpty(): Cache<T> =
this ?: emptyCache()
}
}

View File

@ -5,7 +5,7 @@
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/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>
</issues>

View File

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

View File

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

View File

@ -19,7 +19,7 @@ internal fun AirportResponse.toModel(): AirportInfoModel {
countryName = country?.name.orEmpty(),
countryCurrencyCode = country?.currencyCode.orEmpty(),
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 countryCurrencyCode: String,
override val latitude: Double,
override val longitude: Double
override val longitude: Double,
) : 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> {
public val cacheKey: String?
public val data: T?
interface Cache<T> {
val cacheKey: String?
val data: T?
}

View File

@ -5,7 +5,7 @@
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/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>
</issues>

View File

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

View File

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

View File

@ -5,14 +5,14 @@
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/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
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/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

View File

@ -5,14 +5,14 @@
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/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
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/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>
</issues>

View File

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

View File

@ -5,14 +5,14 @@
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/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
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/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>
</issues>