diff --git a/.idea/other.xml b/.idea/other.xml
index 4604c44..1b1a2c5 100644
--- a/.idea/other.xml
+++ b/.idea/other.xml
@@ -69,6 +69,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -146,6 +168,17 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -235,6 +268,17 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/core/domain/src/main/java/com/example/domain/network/GetGridItemUseCase.kt b/core/domain/src/main/java/com/example/domain/network/GetGridItemUseCase.kt
index 80c7ba0..2fdb7b4 100644
--- a/core/domain/src/main/java/com/example/domain/network/GetGridItemUseCase.kt
+++ b/core/domain/src/main/java/com/example/domain/network/GetGridItemUseCase.kt
@@ -16,8 +16,8 @@ class GetGridItemUseCase @Inject constructor(
.map { result ->
result.map {
GridItemsModel(
- placeID = it.placeId,
- name = it.name,
+ placeID = it.placeId ?: "",
+ name = it.name ?: "",
photoRef = if (it.photos.isNotEmpty()) {
it.photos[0].getFullPhotoReference(BuildConfig.PLACE_API_KEY)
} else {
diff --git a/core/domain/src/main/java/com/example/domain/network/GetMainBannerUseCase.kt b/core/domain/src/main/java/com/example/domain/network/GetMainBannerUseCase.kt
index 2ce0e48..af7a68e 100644
--- a/core/domain/src/main/java/com/example/domain/network/GetMainBannerUseCase.kt
+++ b/core/domain/src/main/java/com/example/domain/network/GetMainBannerUseCase.kt
@@ -16,8 +16,8 @@ class GetMainBannerUseCase @Inject constructor(
.map { result ->
result.map {
BannerItemsModel(
- placeID = it.placeId,
- name = it.name,
+ placeID = it.placeId ?: "",
+ name = it.name ?: "",
photoRef = it.photos[0].getFullPhotoReference(BuildConfig.PLACE_API_KEY)
)
}
diff --git a/core/domain/src/main/java/com/example/domain/network/GetPlaceDetailUseCase.kt b/core/domain/src/main/java/com/example/domain/network/GetPlaceDetailUseCase.kt
index da85269..8712d0b 100644
--- a/core/domain/src/main/java/com/example/domain/network/GetPlaceDetailUseCase.kt
+++ b/core/domain/src/main/java/com/example/domain/network/GetPlaceDetailUseCase.kt
@@ -16,7 +16,9 @@ class GetPlaceDetailUseCase @Inject constructor(
DetailedModel(
placeId = value?.placeId.toString(),
placeName = value?.name.toString(),
- placeImgUrl = value?.photos?.get(0)?.getFullPhotoReference(BuildConfig.PLACE_API_KEY) ?: "",
+ placeImgUrl = value?.photos?.let { photos ->
+ if (photos.isNotEmpty()) photos[0].getFullPhotoReference(BuildConfig.PLACE_API_KEY) else ""
+ } ?: "",
placeRating = value?.rating.toString(),
placeAddress = value?.formattedAddress.toString(),
placePhoneNumber = value?.formattedPhoneNumber.toString(),
diff --git a/core/model/src/main/java/com/example/model/network/AddressComponent.kt b/core/model/src/main/java/com/example/model/network/AddressComponent.kt
index 6ccc328..0fa77b6 100644
--- a/core/model/src/main/java/com/example/model/network/AddressComponent.kt
+++ b/core/model/src/main/java/com/example/model/network/AddressComponent.kt
@@ -5,7 +5,7 @@ import kotlinx.serialization.Serializable
@Serializable
data class AddressComponent(
- @SerialName("long_name") val longName: String,
- @SerialName("short_name") val shortName: String,
- @SerialName("types") val types: List
+ @SerialName("long_name") val longName: String? = "",
+ @SerialName("short_name") val shortName: String? = "",
+ @SerialName("types") val types: List? = emptyList()
)
\ No newline at end of file
diff --git a/core/model/src/main/java/com/example/model/network/CurrentOpeningHours.kt b/core/model/src/main/java/com/example/model/network/CurrentOpeningHours.kt
index b890a85..0baaa93 100644
--- a/core/model/src/main/java/com/example/model/network/CurrentOpeningHours.kt
+++ b/core/model/src/main/java/com/example/model/network/CurrentOpeningHours.kt
@@ -5,7 +5,7 @@ import kotlinx.serialization.Serializable
@Serializable
data class CurrentOpeningHours(
- @SerialName("open_now") val openNow: Boolean,
- @SerialName("periods") val periods: List,
- @SerialName("weekday_text") val weekdayText: List
+ @SerialName("open_now") val openNow: Boolean? = null,
+ @SerialName("periods") val periods: List? = emptyList(),
+ @SerialName("weekday_text") val weekdayText: List? = emptyList()
)
\ No newline at end of file
diff --git a/core/model/src/main/java/com/example/model/network/Geometry.kt b/core/model/src/main/java/com/example/model/network/Geometry.kt
index c6570ce..9953d0c 100644
--- a/core/model/src/main/java/com/example/model/network/Geometry.kt
+++ b/core/model/src/main/java/com/example/model/network/Geometry.kt
@@ -5,6 +5,6 @@ import kotlinx.serialization.Serializable
@Serializable
data class Geometry(
- @SerialName("location") val location: Location,
- @SerialName("viewport") val viewport: Viewport
+ @SerialName("location") val location: Location? = null,
+ @SerialName("viewport") val viewport: Viewport? = null
)
\ No newline at end of file
diff --git a/core/model/src/main/java/com/example/model/network/Location.kt b/core/model/src/main/java/com/example/model/network/Location.kt
index 97341ff..6a3d3dd 100644
--- a/core/model/src/main/java/com/example/model/network/Location.kt
+++ b/core/model/src/main/java/com/example/model/network/Location.kt
@@ -5,6 +5,6 @@ import kotlinx.serialization.Serializable
@Serializable
data class Location(
- @SerialName("lat") val lat: Double,
- @SerialName("lng") val lng: Double
+ @SerialName("lat") val lat: Double? = 0.0,
+ @SerialName("lng") val lng: Double? = 0.0
)
\ No newline at end of file
diff --git a/core/model/src/main/java/com/example/model/network/OpeningHours.kt b/core/model/src/main/java/com/example/model/network/OpeningHours.kt
index cf0c6b5..3ab8e75 100644
--- a/core/model/src/main/java/com/example/model/network/OpeningHours.kt
+++ b/core/model/src/main/java/com/example/model/network/OpeningHours.kt
@@ -5,7 +5,7 @@ import kotlinx.serialization.Serializable
@Serializable
data class OpeningHours(
- @SerialName("open_now") val openNow: Boolean,
+ @SerialName("open_now") val openNow: Boolean? = null,
@SerialName("periods") val periods: List = emptyList(),
@SerialName("weekday_text") val weekdayText: List = emptyList()
)
\ No newline at end of file
diff --git a/core/model/src/main/java/com/example/model/network/Period.kt b/core/model/src/main/java/com/example/model/network/Period.kt
index d2115a1..2384e9d 100644
--- a/core/model/src/main/java/com/example/model/network/Period.kt
+++ b/core/model/src/main/java/com/example/model/network/Period.kt
@@ -11,14 +11,14 @@ data class Period(
@Serializable
data class Open(
- @SerialName("date") val date: String,
- @SerialName("day") val day: Int,
- @SerialName("time") val time: String
+ @SerialName("date") val date: String? = "",
+ @SerialName("day") val day: Int? = 0,
+ @SerialName("time") val time: String? = ""
)
@Serializable
data class Close(
- @SerialName("date") val date: String,
- @SerialName("day") val day: Int,
- @SerialName("time") val time: String
+ @SerialName("date") val date: String? = "",
+ @SerialName("day") val day: Int? = 0,
+ @SerialName("time") val time: String? = ""
)
\ No newline at end of file
diff --git a/core/model/src/main/java/com/example/model/network/PeriodX.kt b/core/model/src/main/java/com/example/model/network/PeriodX.kt
index f4304df..4acdfb7 100644
--- a/core/model/src/main/java/com/example/model/network/PeriodX.kt
+++ b/core/model/src/main/java/com/example/model/network/PeriodX.kt
@@ -5,18 +5,18 @@ import kotlinx.serialization.Serializable
@Serializable
data class PeriodX(
- @SerialName("open") val open: OpenX,
- @SerialName("close") val close: CloseX
+ @SerialName("open") val open: OpenX? = null,
+ @SerialName("close") val close: CloseX? = null
)
@Serializable
data class OpenX(
- @SerialName("day") val day: Int,
- @SerialName("time") val time: String
+ @SerialName("day") val day: Int? = 0,
+ @SerialName("time") val time: String? = ""
)
@Serializable
data class CloseX(
- @SerialName("day") val day: Int,
- @SerialName("time") val time: String
+ @SerialName("day") val day: Int? = 0,
+ @SerialName("time") val time: String? = ""
)
\ No newline at end of file
diff --git a/core/model/src/main/java/com/example/model/network/Photo.kt b/core/model/src/main/java/com/example/model/network/Photo.kt
index 03a9a5c..2e1e4ed 100644
--- a/core/model/src/main/java/com/example/model/network/Photo.kt
+++ b/core/model/src/main/java/com/example/model/network/Photo.kt
@@ -5,10 +5,10 @@ import kotlinx.serialization.Serializable
@Serializable
data class Photo(
- @SerialName("height") val height: Int,
- @SerialName("html_attributions") val htmlAttributions: List,
- @SerialName("photo_reference") val photoReference: String = "",
- @SerialName("width") val width: Int
+ @SerialName("height") val height: Int? = 0,
+ @SerialName("width") val width: Int? = 0,
+ @SerialName("html_attributions") val htmlAttributions: List? = emptyList(),
+ @SerialName("photo_reference") val photoReference: String = ""
) {
fun getFullPhotoReference(apiKey: String): String {
return StringBuilder("https://maps.googleapis.com/maps/api/place/photo")
diff --git a/core/model/src/main/java/com/example/model/network/PlusCode.kt b/core/model/src/main/java/com/example/model/network/PlusCode.kt
index 107dc3a..173554d 100644
--- a/core/model/src/main/java/com/example/model/network/PlusCode.kt
+++ b/core/model/src/main/java/com/example/model/network/PlusCode.kt
@@ -5,6 +5,6 @@ import kotlinx.serialization.Serializable
@Serializable
data class PlusCode(
- @SerialName("compound_code") val compoundCode: String,
- @SerialName("global_code") val globalCode: String
+ @SerialName("compound_code") val compoundCode: String? = "",
+ @SerialName("global_code") val globalCode: String? = ""
)
\ No newline at end of file
diff --git a/core/model/src/main/java/com/example/model/network/Review.kt b/core/model/src/main/java/com/example/model/network/Review.kt
index cc6594a..d6cf4fa 100644
--- a/core/model/src/main/java/com/example/model/network/Review.kt
+++ b/core/model/src/main/java/com/example/model/network/Review.kt
@@ -5,14 +5,14 @@ import kotlinx.serialization.Serializable
@Serializable
data class Review(
- @SerialName("author_name") val authorName: String,
- @SerialName("author_url") val authorUrl: String,
- @SerialName("language") val language: String,
- @SerialName("original_language") val originalLanguage: String,
- @SerialName("profile_photo_url") val profilePhotoUrl: String,
- @SerialName("rating") val rating: Int,
- @SerialName("relative_time_description") val relativeTimeDescription: String,
- @SerialName("text") val text: String,
- @SerialName("time") val time: Int,
- @SerialName("translated") val translated: Boolean
+ @SerialName("author_name") val authorName: String ? = "",
+ @SerialName("author_url") val authorUrl: String? = "",
+ @SerialName("language") val language: String? = "",
+ @SerialName("original_language") val originalLanguage: String? = "",
+ @SerialName("profile_photo_url") val profilePhotoUrl: String? = "",
+ @SerialName("rating") val rating: Int? = 0,
+ @SerialName("relative_time_description") val relativeTimeDescription: String? = "",
+ @SerialName("text") val text: String? = "",
+ @SerialName("time") val time: Int? = 0,
+ @SerialName("translated") val translated: Boolean? = null
)
\ No newline at end of file
diff --git a/core/model/src/main/java/com/example/model/network/Viewport.kt b/core/model/src/main/java/com/example/model/network/Viewport.kt
index 182ed6f..5875b03 100644
--- a/core/model/src/main/java/com/example/model/network/Viewport.kt
+++ b/core/model/src/main/java/com/example/model/network/Viewport.kt
@@ -11,12 +11,12 @@ data class Viewport(
@Serializable
data class Southwest(
- @SerialName("lat") val lat: Double,
- @SerialName("lng") val lng: Double
+ @SerialName("lat") val lat: Double? = 0.0,
+ @SerialName("lng") val lng: Double? = 0.0
)
@Serializable
data class Northeast(
- @SerialName("lat") val lat: Double,
- @SerialName("lng") val lng: Double
+ @SerialName("lat") val lat: Double? = 0.0,
+ @SerialName("lng") val lng: Double? = 0.0
)
\ No newline at end of file
diff --git a/core/model/src/main/java/com/example/model/network/detailPlace/DetailedPlace.kt b/core/model/src/main/java/com/example/model/network/detailPlace/DetailedPlace.kt
index 1e3acfb..2714125 100644
--- a/core/model/src/main/java/com/example/model/network/detailPlace/DetailedPlace.kt
+++ b/core/model/src/main/java/com/example/model/network/detailPlace/DetailedPlace.kt
@@ -13,7 +13,7 @@ import kotlinx.serialization.Serializable
@Serializable
data class DetailedPlace(
@SerialName("status") val status : String,
- @SerialName("result") val result : DetailedResult
+ @SerialName("result") val result : DetailedResult? = null
)
@Serializable
diff --git a/core/model/src/main/java/com/example/model/network/nearBySearch/NearBySearch.kt b/core/model/src/main/java/com/example/model/network/nearBySearch/NearBySearch.kt
index fa627a3..8fd8b7d 100644
--- a/core/model/src/main/java/com/example/model/network/nearBySearch/NearBySearch.kt
+++ b/core/model/src/main/java/com/example/model/network/nearBySearch/NearBySearch.kt
@@ -10,26 +10,26 @@ import kotlinx.serialization.Serializable
@Serializable
data class NearBySearch(
@SerialName("status") val status: String,
- @SerialName("results") val results: List = listOf()
+ @SerialName("results") val results: List = emptyList()
)
@Serializable
data class NearBySearchResult(
- @SerialName("business_status") val businessStatus: String,
- @SerialName("geometry") val geometry: Geometry,
- @SerialName("icon") val icon: String,
- @SerialName("icon_background_color") val iconBackgroundColor: String,
- @SerialName("icon_mask_base_uri") val iconMaskBaseUri: String,
- @SerialName("name") val name: String,
+ @SerialName("business_status") val businessStatus: String? = "",
+ @SerialName("geometry") val geometry: Geometry? = null,
+ @SerialName("icon") val icon: String? = "",
+ @SerialName("icon_background_color") val iconBackgroundColor: String? = "",
+ @SerialName("icon_mask_base_uri") val iconMaskBaseUri: String? = "",
+ @SerialName("name") val name: String? = "",
@SerialName("opening_hours") val openingHours: OpeningHours? = null,
- @SerialName("photos") val photos: List = listOf(),
- @SerialName("place_id") val placeId: String,
- @SerialName("plus_code") val plusCode: PlusCode,
+ @SerialName("photos") val photos: List = emptyList(),
+ @SerialName("place_id") val placeId: String? = "",
+ @SerialName("plus_code") val plusCode: PlusCode? = null,
@SerialName("price_level") val priceLevel: Int? = null,
- @SerialName("rating") val rating: Double,
- @SerialName("reference") val reference: String,
- @SerialName("scope") val scope: String,
- @SerialName("types") val types: List,
- @SerialName("user_ratings_total") val userRatingsTotal: Int,
- @SerialName("vicinity") val vicinity: String
+ @SerialName("rating") val rating: Double? = 0.0,
+ @SerialName("reference") val reference: String? = "",
+ @SerialName("scope") val scope: String? = "",
+ @SerialName("types") val types: List? = emptyList(),
+ @SerialName("user_ratings_total") val userRatingsTotal: Int? = 0,
+ @SerialName("vicinity") val vicinity: String? = ""
)
\ No newline at end of file