Commit 33732db9 authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

api data updated

parent 38f8b251
......@@ -26,7 +26,7 @@ import javax.inject.Inject
//
const val TEST_DEAL_TOKEN =
"185|_Zs1k17uO_Ezn7wqZ8ostl8XJ5_G2rDez3x9F4qxj-do4wV1bxiUfLgOZZMUvc5guXScNN3Dr9yfNEBVvxGkQw=="
"183|iauhqAKpzrex9g1JYFYcp4443_PU5tm8ioce8G-QhtQbjNP-_a8CnW0WBw8O7dj4Rm2xdRGTuqvkfAF2zyMUSg=="
class EstateRepository @Inject constructor(
private val local: ILocalStore,
......@@ -228,7 +228,7 @@ class EstateRepository @Inject constructor(
override fun getDeals(): Observable<List<DealModel>> {
return Observable.mergeDelayError(
arrayListOf(
getDealsDb, getDealsApi
getDealsApi,getDealsDb
)
).map { fromEntity(it, ::fromEntity) }
.doOnError(Timber::e)
......
......@@ -16,8 +16,8 @@ data class AuthRaw(
data class StatusResponse(val status:String)
data class DealRaw(
val id:Int,
val estate_id:Int,
val id:String,
val estate_id:String,
val opportunity_sum:Int,
val payment_sum:Int,
val amount_pay_sum:Int,
......
......@@ -10,8 +10,8 @@ import io.requery.*
interface Deal : Persistable {
@get:Key
val id:Int
val estateCrmId:Int
val id:String
val estateCrmId:String
val opportunitySum:Int
val paymentSum:Int
val amountPaySum:Int
......
......@@ -108,13 +108,13 @@ fun fromRaw(raw:DealRaw):DealEntity {
entity.setAmountPaySum(raw.amount_pay_sum)
entity.setStatusId(raw.status_id)
entity.setManagerName(raw.manager)
entity.estate = fromRaw(raw.estate)
return entity
}
fun fromRaw(raw:DealRaw,user:UserEntity):DealEntity {
val entity = fromRaw(raw)
entity.estate = fromRaw(raw.estate)
entity.user = user
return entity
}
......
......@@ -13,7 +13,7 @@ class DealInteractor @Inject constructor(
val useCase : DealContract
){
fun getDeal(id:Int): Observable<DealModel> =
fun getDeal(id:String): Observable<DealModel> =
useCase.getDeals()
.map { it.first { it.id==id } }
......@@ -198,8 +198,8 @@ class DealInteractor @Inject constructor(
type = "flat",
url = "https://stage.room-park.ru:38386/choose/flat/1/14/1086/"
),
estate_id = 2156,
id = 1562623,
estate_id = "2156",
id = "1562623",
managerName = "\u0411\u043e\u0441\u043e\u0432\u0430, \u0418\u0440\u0438\u043d\u0430",
opportunitySum= 5035860,
paymentSum= 500000,
......@@ -307,8 +307,8 @@ class DealInteractor @Inject constructor(
type = "flat",
url = "https://stage.room-park.ru:38386/choose/flat/1/2/88/"
),
estate_id = 6222,
id = 42341,
estate_id = "6222",
id = "42341",
managerName = "Босова, Ирина",
opportunitySum = 5618160,
paymentSum = 500000,
......
......@@ -195,8 +195,8 @@ class DealsInteractor @Inject constructor(
type = "flat",
url = "https://stage.room-park.ru:38386/choose/flat/1/14/1086/"
),
estate_id = 1425,
id = 4621213,
estate_id = "1425",
id = "4621213",
managerName = "\u0411\u043e\u0441\u043e\u0432\u0430, \u0418\u0440\u0438\u043d\u0430",
opportunitySum= 5035860,
paymentSum= 500000,
......@@ -304,8 +304,8 @@ class DealsInteractor @Inject constructor(
type = "flat",
url = "https://stage.room-park.ru:38386/choose/flat/1/2/88/"
),
estate_id = 1231,
id = 42342342,
estate_id = "1231",
id = "42342342",
managerName = "Босова, Ирина",
opportunitySum = 5618160,
paymentSum = 500000,
......
......@@ -21,8 +21,8 @@ data class StatusModel(
)
data class DealModel(
val id:Int,
val estate_id:Int,
val id:String,
val estate_id:String,
val opportunitySum:Int,
val paymentSum:Int,
val amount_pay_sum:Int,
......
......@@ -33,7 +33,7 @@ class DealScreenController :
constructor(args: Bundle):super(args)
constructor(id: Int) : super(bundleOf(SELECTED_DEAL_ID_KEY to id))
constructor(id: String) : super(bundleOf(SELECTED_DEAL_ID_KEY to id))
override fun injectDependencies() {
getComponent()
......@@ -161,7 +161,7 @@ class DealScreenController :
private fun getComponent() = DaggerDealScreenComponent.factory()
.create(RoomParkApplication.component,activity as RoomParkMainActivity
, args.getInt(SELECTED_DEAL_ID_KEY)
, args.getString(SELECTED_DEAL_ID_KEY)?: error("Deal id not found!")
)
.inject(this)
......
......@@ -22,7 +22,7 @@ interface DealScreenComponent {
fun create(
appComponent: AppComponent
,@BindsInstance activity: RoomParkMainActivity
,@BindsInstance @Named(SELECTED_DEAL_ID_KEY) selectedDealId:Int
,@BindsInstance @Named(SELECTED_DEAL_ID_KEY) selectedDealId:String
): DealScreenComponent
}
......
......@@ -22,7 +22,7 @@ import javax.inject.Named
class DealScreenPresenter @Inject constructor(
private val interactor: DealInteractor,
private val context: Context,
@Named(SELECTED_DEAL_ID_KEY) private val dealId:Int
@Named(SELECTED_DEAL_ID_KEY) private val dealId:String
)
: BigantoBasePresenter<DealScreen, DealScreenViewState>() {
......
......@@ -13,7 +13,7 @@ interface DealsScreen : BigantoBaseContract<DealsScreenViewState> {
data class DealPreviewModel(
val id:Int,
val id:String,
val type:String,
val name:String,
val building:Int?,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment