package Ġcom . zm . org . wallet . domain . user transactions Ċ Ċ import Ġcom . zm . org . wallet . domain . entity . Transaction Ċ import Ġcom . zm . org . wallet . data . user transactions . User Transactions Repository Ċ import Ġcom . zm . org . wallet . util . Time Millis Ċ import Ġcom . zm . org . wallet . util . to Day TimeStamp Millis Ċ Ċ /** Ċ Ġ* ĠResp ons ible Ġcollect Ġuser Ġbalance ĠSum m ery ĠExp enses Ġ, Ġincome Ġ, Ġbalance Ċ Ġ*/ Ċ class ĠGetUser Transactions Categor ized By Date UseCase ( ĊĠĠĠ Ġprivate Ġval Ġuser Transactions Repository : ĠUser Transactions Repository , ĊĠĠĠ Ġprivate Ġval Ġtransaction Mapper : ĠTransaction Mapper , Ċ ) Ġ{ ĊĊĠĠĠ Ġsuspend Ġoperator Ġfun Ġinvoke (): ĠMap < Time Millis , ĠList < Transaction >> Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Transactions Repository . getUser All Transactions (). map Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Mapper . from Transaction Entity ( it ) ĊĠĠĠĠĠĠĠ Ġ}. sorted By Descending Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . creation Date Millis . time Millis ĊĠĠĠĠĠĠĠ Ġ}. groupBy Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . creation Date Millis . to Day TimeStamp Millis () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ