package Ġorg . mot ive pick . web Ċ Ċ import Ġorg . mot ive pick . domain . model . Schedule Ċ import Ġorg . mot ive pick . repository . Task Repository Ċ import Ġorg . mot ive pick . security . CurrentUser Ċ import Ġorg . mot ive pick . service . Schedule Factory Ċ import Ġorg . springframework . http . Response Entity Ċ import Ġorg . springframework . http . Response Entity . ok Ċ import Ġorg . springframework . web . bind . annotation . GetMapping Ċ import Ġorg . springframework . web . bind . annotation . RestController Ċ Ċ @ RestController Ċ internal Ġclass ĠSchedule Controller ( private Ġval ĠcurrentUser : ĠCurrent User , Ġprivate Ġval Ġtask Repository : ĠTask Repository , ĊĠĠĠĠĠĠĠ Ġprivate Ġval Ġschedule Factory : ĠSchedule Factory ) Ġ{ ĊĊĠĠĠ Ġ@ GetMapping ("/ schedule ") ĊĠĠĠ Ġfun Ġschedule (): ĠResponseEntity < Schedule > Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġtasks Ġ= Ġtask Repository . findAll ByUser AccountId And Closed False And Due Date NotNull And Visible True ( currentUser . get AccountId ()) ĊĠĠĠĠĠĠĠ Ġreturn Ġok ( schedule Factory . schedule For ( tasks )) ĊĠĠĠ Ġ} Ċ } Ċ