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

api data updated

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