package Ġcom . br un ot iba . repository Ċ Ċ import Ġcom . br un ot iba . domain . model . Location Ċ import Ġcom . br un ot iba . domain . repository . Selected Location Repository Ċ import Ġcom . br un ot iba . repository . datasource . Location DataSource Ċ import Ġcom . br un ot iba . repository . datasource . Selected Location DataSource Ċ import Ġcom . br un ot iba . repository . mapper . Location Mapper Ċ import Ġkotlinx . coroutines . flow . Flow Ċ import Ġkotlinx . coroutines . flow . map Ċ import Ġtim ber . log . Tim ber Ċ import Ġjavax . inject . Inject Ċ Ċ /** Ċ Ġ* Ġ[ Selected Location Repository ] Ġimplementation . Ċ Ġ*/ Ċ class ĠSelected Location Repository Impl Ġ@ Inject Ġconstructor ( ĊĠĠĠ Ġprivate Ġval Ġlocation DataSource : ĠLocation DataSource , ĊĠĠĠ Ġprivate Ġval Ġselected Location DataSource : ĠSelected Location DataSource , ĊĠĠĠ Ġprivate Ġval Ġmapper : ĠLocation Mapper , Ċ ) Ġ: ĠSelected Location Repository Ġ{ ĊĊĠĠĠ Ġoverride Ġsuspend Ġfun Ġadd Selected Location ( location Name : ĠString ): ĠLong Ġ{ ĊĠĠĠĠĠĠĠ ĠTim ber . d (" add Selected Location : Ġlocation Name Ġ= Ġ$ location Name ") ĊĠĠĠĠĠĠĠ Ġval Ġlocation Ġ= Ġlocation DataSource . getLocation FromName ( location Name ) ĊĠĠĠĠĠĠĠ Ġreturn Ġselected Location DataSource . add Selected Location ( location ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġsuspend Ġfun Ġget Selected Locations (): ĠFlow < List < Location >> Ġ{ ĊĠĠĠĠĠĠĠ ĠTim ber . d (" getSelected Locations ") ĊĠĠĠĠĠĠĠ Ġreturn Ġselected Location DataSource . getSelected Locations (). map Ġ{ Ġrepo Locations Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġrepo Locations . map Ġ{ Ġmapper . to Domain ( it ) Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ