package Ġnet . rom . exchange . mapper Ċ Ċ import Ġcom . github . mike phil . chart ing . formatter . Percent Formatter Ċ import Ġnet . rom . exchange . format er . Z eny Formatter Ċ import Ġnet . rom . exchange . model . Item Exchange ViewModel Ċ import Ġnet . rom . exchange . presentation . model . rom . Item Exchange View Ċ import Ġjavax . inject . Inject Ċ Ċ /** Ċ Ġ* ĠMap Ġa Ġ[ Item Exchange View ] Ġto Ġand Ġfrom Ġa Ġ[ Item Exchange ViewModel ] Ġinstance Ġwhen Ġdata Ġis Ġmoving Ġbetween Ċ Ġ* Ġthis Ġlayer Ġand Ġthe ĠDomain Ġlayer Ċ Ġ*/ Ċ open Ġclass ĠItem Exchange ViewModel Mapper Ġ@ Inject Ġconstructor ( private Ġval Ġdata Graph ViewModel Mapper : ĠData Graph ViewModel Mapper ) Ġ: ĠMapper < Item Exchange ViewModel , ĠItem Exchange View > Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġmap To ViewModel ( type : ĠItem Exchange View ): ĠItem Exchange ViewModel Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠItem Exchange ViewModel ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġname Ġ= Ġtype . name , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġglobal Price Ġ= ĠZ eny Formatter . make Z eny ( type . global . latest ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġsea Price Ġ= ĠZ eny Formatter . make Z eny ( type . sea . latest ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġglobal Change Ġ= ĠPercent Formatter (). get Formatted Value ( type . global . all . change . toFloat (), Ġnull ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġsea Change Ġ= ĠPercent Formatter (). get Formatted Value ( type . sea . all . change . toFloat (), Ġnull ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġsea DataSet Ġ= Ġtype . sea . all . data . map Ġ{ Ġdata Graph ViewModel Mapper . map To View ( it ) Ġ}. distinct By Ġ{ Ġit . x Ġ}, Ġ// TODO : Ġselect Ġonly Ġthe Ġhighest Ġprice Ġof Ġthe Ġmonth ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġglobal DataSet Ġ= Ġtype . global . all . data . map Ġ{ Ġdata Graph ViewModel Mapper . map To View ( it ) Ġ}. distinct By Ġ{ Ġit . x Ġ} Ġ Ġ// TODO : Ġselect Ġonly Ġthe Ġhighest Ġprice Ġof Ġthe Ġmonth ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} Ċ }