package Ġcom . zg . bur ger joint . data . model . impl s Ċ Ċ import Ġandroidx . lifecycle . LiveData Ċ import Ġandroidx . lifecycle . Mutable LiveData Ċ import Ġandroidx . lifecycle . Transform ations Ċ import Ġcom . zg . bur ger joint . data . model . Base App Model Ċ import Ġcom . zg . bur ger joint . data . model . Bur ger Model Ċ import Ġcom . zg . bur ger joint . data . v os . Bur ger VO Ċ import Ġio . reactivex . Observable Ċ Ċ object ĠBur ger Model Impl Ġ: ĠBur ger Model , ĠBase App Model () Ġ{ ĊĊĠĠĠ Ġvar Ġbur gers In Order Ġ: ĠMutable List < Bur ger VO > Ġ= Ġarray ListOf () ĊĠĠĠ Ġvar Ġbur gers In Order LiveData Ġ= ĠMutable LiveData < List < Bur ger VO >>() ĊĊĠĠĠ Ġoverride Ġfun Ġfind Bur ger ById ( bur ger Id : ĠInt ): ĠLive Data < Bur ger VO > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠTransform ations . distinct Until Changed ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġm Database . get Bur ger Dao (). find Bur ger ById ( bur ger Id ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠgetAll Bur gers (): ĠLive Data < List < Bur ger VO >> Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠTransform ations . distinct Until Changed ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġm Database . get Bur ger Dao (). getAll Bur gers () ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Bur gers In Cart (): ĠLive Data < List < Bur ger VO >> Ġ{ ĊĠĠĠĠĠĠĠ Ġbur gers In Order LiveData . post Value ( bur gers In Order ) ĊĠĠĠĠĠĠĠ Ġreturn Ġbur gers In Order LiveData ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġremove Item From Cart ( bur ger : ĠBur ger VO ) Ġ{ ĊĠĠĠĠĠĠĠ Ġbur gers In Order . remove ( bur ger ) ĊĠĠĠĠĠĠĠ Ġbur gers In Order LiveData . post Value ( bur gers In Order ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġadd Item To Cart ( bur ger : ĠBur ger VO ) Ġ{ ĊĠĠĠĠĠĠĠ Ġbur gers In Order . add ( bur ger ) ĊĠĠĠĠĠĠĠ Ġbur gers In Order LiveData . post Value ( bur gers In Order ) ĊĠĠĠ Ġ} Ċ }