-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added request with handling response
- Loading branch information
1 parent
755baa4
commit 61346e7
Showing
24 changed files
with
219 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
personalization-sdk/src/main/kotlin/com/personalization/api/responses/products/Brand.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.personalization.api.responses.products | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class Brand( | ||
@SerializedName("name") | ||
val name: String, | ||
@SerializedName("picture") | ||
val picture: String, | ||
@SerializedName("count") | ||
val count: Int | ||
) |
20 changes: 20 additions & 0 deletions
20
personalization-sdk/src/main/kotlin/com/personalization/api/responses/products/Category.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.personalization.api.responses.products | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class Category( | ||
@SerializedName("id") | ||
val id: String, | ||
@SerializedName("name") | ||
val name: String, | ||
@SerializedName("url") | ||
val url: String, | ||
@SerializedName("url_handle") | ||
val urlHandle: String, | ||
@SerializedName("count") | ||
val count: Int, | ||
@SerializedName("parent") | ||
val parent: String?, | ||
@SerializedName("alias") | ||
val alias: String? | ||
) |
8 changes: 8 additions & 0 deletions
8
personalization-sdk/src/main/kotlin/com/personalization/api/responses/products/Filter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.personalization.api.responses.products | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class Filter( | ||
@SerializedName("filter") | ||
val filter: FilterDetails | ||
) |
14 changes: 14 additions & 0 deletions
14
...alization-sdk/src/main/kotlin/com/personalization/api/responses/products/FilterDetails.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.personalization.api.responses.products | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class FilterDetails( | ||
@SerializedName("count") | ||
val count: Int, | ||
@SerializedName("priority") | ||
val priority: Int, | ||
@SerializedName("ranges") | ||
val ranges: List<Int>?, | ||
@SerializedName("values") | ||
val values: List<FilterValue> | ||
) |
10 changes: 10 additions & 0 deletions
10
...onalization-sdk/src/main/kotlin/com/personalization/api/responses/products/FilterValue.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.personalization.api.responses.products | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class FilterValue( | ||
@SerializedName("value") | ||
val value: String, | ||
@SerializedName("count") | ||
val count: Int | ||
) |
4 changes: 2 additions & 2 deletions
4
...domain/models/products/ImageUrlResized.kt → ...api/responses/products/ImageUrlResized.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package com.personalization.sdk.domain.models.products | ||
package com.personalization.api.responses.products | ||
|
||
data class ImageUrlResized( | ||
val sizeToPath: Map<String, String> | ||
) | ||
) |
10 changes: 10 additions & 0 deletions
10
personalization-sdk/src/main/kotlin/com/personalization/api/responses/products/PriceRange.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.personalization.api.responses.products | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class PriceRange( | ||
@SerializedName("min") | ||
val min: Double, | ||
@SerializedName("max") | ||
val max: Double | ||
) |
10 changes: 10 additions & 0 deletions
10
...lization-sdk/src/main/kotlin/com/personalization/api/responses/products/PriceRangeItem.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.personalization.api.responses.products | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class PriceRangeItem( | ||
@SerializedName("to") | ||
val to: Double, | ||
@SerializedName("count") | ||
val count: Int | ||
) |
55 changes: 55 additions & 0 deletions
55
personalization-sdk/src/main/kotlin/com/personalization/api/responses/products/Product.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package com.personalization.api.responses.products | ||
|
||
import com.google.gson.annotations.SerializedName | ||
import com.personalization.api.responses.product.ImageUrlResized | ||
|
||
data class Product( | ||
@SerializedName("brand") | ||
val brand: String, | ||
@SerializedName("currency") | ||
val currency: String, | ||
@SerializedName("id") | ||
val id: String, | ||
@SerializedName("is_new") | ||
val isNew: Boolean? = null, | ||
@SerializedName("name") | ||
val name: String, | ||
@SerializedName("old_price") | ||
val oldPrice: String = "0", | ||
@SerializedName("price") | ||
val price: Double, | ||
@SerializedName("price_formatted") | ||
val priceFormatted: String, | ||
@SerializedName("price_full_formatted") | ||
val priceFullFormatted: String, | ||
@SerializedName("picture") | ||
val picture: String, | ||
@SerializedName("url") | ||
val url: String, | ||
@SerializedName("description") | ||
val description: String, | ||
@SerializedName("category_ids") | ||
val categoryIds: List<String>, | ||
@SerializedName("fashion_feature") | ||
val fashionFeature: String?, | ||
@SerializedName("fashion_gender") | ||
val fashionGender: String?, | ||
@SerializedName("sales_rate") | ||
val salesRate: Int, | ||
@SerializedName("relative_sales_rate") | ||
val relativeSalesRate: Double, | ||
@SerializedName("image_url") | ||
val imageUrl: String, | ||
@SerializedName("image_url_handle") | ||
val imageUrlHandle: String, | ||
@SerializedName("image_url_resized") | ||
val imageUrlResized: ImageUrlResized, | ||
@SerializedName("_id") | ||
val internalId: String, | ||
@SerializedName("group_id") | ||
val groupId: String, | ||
@SerializedName("barcode") | ||
val barcode: String, | ||
@SerializedName("categories") | ||
val categories: List<ProductCategory> | ||
) |
2 changes: 1 addition & 1 deletion
2
...domain/models/products/ProductCategory.kt → ...api/responses/products/ProductCategory.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...dk/domain/models/products/ProductParam.kt → ...on/api/responses/products/ProductParam.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...zation-sdk/src/main/kotlin/com/personalization/api/responses/products/ProductsResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.personalization.api.responses.products | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class ProductsResponse( | ||
@SerializedName("brands") | ||
val brands: List<Brand>, | ||
@SerializedName("categories") | ||
val categories: List<Category>, | ||
@SerializedName("filters") | ||
val filters: List<Filter>, | ||
@SerializedName("price_range") | ||
val priceRange: PriceRange, | ||
@SerializedName("products") | ||
val products: List<Product>, | ||
@SerializedName("products_total") | ||
val productsTotal: Int, | ||
@SerializedName("price_ranges") | ||
val priceRanges: List<PriceRangeItem>, | ||
@SerializedName("price_median") | ||
val priceMedian: Double | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 0 additions & 12 deletions
12
...ization-sdk/src/main/kotlin/com/personalization/sdk/domain/models/products/ApiResponse.kt
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
personalization-sdk/src/main/kotlin/com/personalization/sdk/domain/models/products/Brand.kt
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
...nalization-sdk/src/main/kotlin/com/personalization/sdk/domain/models/products/Category.kt
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
personalization-sdk/src/main/kotlin/com/personalization/sdk/domain/models/products/Filter.kt
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
...ation-sdk/src/main/kotlin/com/personalization/sdk/domain/models/products/FilterDetails.kt
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
...ization-sdk/src/main/kotlin/com/personalization/sdk/domain/models/products/FilterValue.kt
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
...lization-sdk/src/main/kotlin/com/personalization/sdk/domain/models/products/PriceRange.kt
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
...tion-sdk/src/main/kotlin/com/personalization/sdk/domain/models/products/PriceRangeItem.kt
This file was deleted.
Oops, something went wrong.
28 changes: 0 additions & 28 deletions
28
...onalization-sdk/src/main/kotlin/com/personalization/sdk/domain/models/products/Product.kt
This file was deleted.
Oops, something went wrong.