package Ġname . gy ger . j money . report Ċ Ċ import Ġname . gy ger . j money . account . Entry Ċ import Ġname . gy ger . j money . account . Entry Service Ċ import Ġname . gy ger . j money . util . parse Ċ import Ġorg . springframework . web . bind . annotation . GetMapping Ċ import Ġorg . springframework . web . bind . annotation . RequestMapping Ċ import Ġorg . springframework . web . bind . annotation . RequestParam Ċ import Ġorg . springframework . web . bind . annotation . RestController ĊĊ Ċ @ RestController Ċ @ RequestMapping ("/ api / reports ") Ċ class ĠReport Controller ( private Ġval Ġreport Service : ĠReport Service , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġprivate Ġval Ġentry Service : ĠEntry Service ) Ġ{ ĊĊĠĠĠ Ġ@ GetMapping ("/ balances ") ĊĠĠĠ Ġfun Ġget Balances (@ RequestParam ( value Ġ= Ġ" date ", Ġrequired Ġ= Ġfalse ) Ġdate String : ĠString ?): ĠList < Balance > Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġdate Ġ= Ġparse ( date String ) ĊĠĠĠĠĠĠĠ Ġreturn Ġreport Service . get Balances ( date ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ GetMapping ("/ cash - flows ") ĊĠĠĠ Ġfun Ġget Cash Flow (@ RequestParam ( value Ġ= Ġ" from Date ") Ġfrom DateString : ĠString , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ@ RequestParam ( value Ġ= Ġ" toDate ") Ġto DateString : ĠString ): ĠList < Cash Flow > Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġfrom Date Ġ= Ġparse ( from DateString ) ĊĠĠĠĠĠĠĠ Ġval Ġto Date Ġ= Ġparse ( toDate String ) ĊĠĠĠĠĠĠĠ Ġreturn Ġreport Service . getC ash Flow ( from Date , Ġto Date ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ GetMapping ("/ entries - with - category ") ĊĠĠĠ Ġfun Ġget Entries (@ RequestParam ( value Ġ= Ġ" categoryId ") Ġcategory Id : ĠLong , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ@ RequestParam ( value Ġ= Ġ" from Date ") Ġfrom DateString : ĠString , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ@ RequestParam ( value Ġ= Ġ" toDate ") Ġto DateString : ĠString ): ĠList < Entry > Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġfrom Ġ= Ġparse ( from DateString ) ĊĠĠĠĠĠĠĠ Ġval Ġto Ġ= Ġparse ( toDate String ) ĊĠĠĠĠĠĠĠ Ġreturn Ġentry Service . get Entries For Category ( categoryId , Ġfrom , Ġto ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ GetMapping ("/ consistency / in consistent - split - entries ") ĊĠĠĠ Ġfun Ġget In consistent Split Entries (): ĠList < Entry > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġreport Service . getIn consistent Split Entries () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ GetMapping ("/ consistency / entries - without - category ") ĊĠĠĠ Ġfun Ġget Entries Without Category (): ĠList < Entry > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġentry Service . get Entries Without Category () ĊĠĠĠ Ġ} Ċ Ċ } Ċ