Updated on 2026-08-14
This commit is contained in:
parent
6171aa8097
commit
3e1a45dbad
23 changed files with 360 additions and 40 deletions
|
|
@ -54,4 +54,10 @@ interface TangemTechApi {
|
|||
|
||||
@GET("shops")
|
||||
suspend fun getShopInfo(@Query(value = "name") name: String): ShopResponse
|
||||
|
||||
@GET("sales")
|
||||
suspend fun getSalesInfo(
|
||||
@Query(value = "locale") locale: String,
|
||||
@Query(value = "shops") shops: String,
|
||||
): SalesResponse
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
package com.tangem.datasource.api.tangemTech.models
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
|
||||
/**
|
||||
* Sales response
|
||||
*/
|
||||
data class SalesResponse(
|
||||
@Json(name = "sales") val sales: List<Sales>,
|
||||
)
|
||||
|
||||
/**
|
||||
* Sales info
|
||||
*
|
||||
* @property id sales id
|
||||
* @property state state as order, sold-out, pre-order
|
||||
* @property product product that is sales
|
||||
* @property notification optional notification for product
|
||||
*/
|
||||
data class Sales(
|
||||
@Json(name = "id") val id: String,
|
||||
@Json(name = "state") val state: String,
|
||||
@Json(name = "product") val product: Product,
|
||||
@Json(name = "notification") val notification: Notification?,
|
||||
)
|
||||
|
||||
/**
|
||||
* Product
|
||||
*
|
||||
* @property id product id
|
||||
* @property code code that shows what product it is
|
||||
* @property name product name
|
||||
*/
|
||||
data class Product(
|
||||
@Json(name = "id") val id: String,
|
||||
@Json(name = "code") val code: String,
|
||||
@Json(name = "name") val name: String,
|
||||
)
|
||||
|
||||
data class Notification(
|
||||
@Json(name = "type") val type: String,
|
||||
@Json(name = "title") val title: String,
|
||||
@Json(name = "description") val description: String,
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue