package Ġtax With holding Ċ Ċ import Ġauth . Users Service Ċ import Ġgener ics . Generic Router Ċ import Ġhistory . History Service Ċ import Ġio . ktor . application . Application Call Ċ import Ġio . ktor . util . pipeline . Pipeline Context Ċ import Ġorg . jetbrains . ex posed . sql . Sql Expression Builder . eq Ċ import Ġshared . tax Fetcher . Tax With holding Ċ import Ġshared . tax Fetcher . responses . Tax With holding Response Ċ Ċ class ĠTax With holding Router ( ĊĠĠĠ ĠbasePath : ĠString , ĊĠĠĠ Ġtax With holding Service : ĠTax With holding Service , ĊĠĠĠ Ġprivate Ġval Ġusers Service : ĠUsers Service , ĊĠĠĠ Ġprivate Ġval Ġhistory Service : ĠHistory Service Ċ ) Ġ: ĠGeneric Router < Tax With holding , ĠTax With holding Table >( ĊĠĠĠ ĠbasePath , ĊĠĠĠ Ġtax With holding Service , ĊĠĠĠ ĠTax With holding Response () Ċ ) Ġ{ ĊĠĠĠ Ġoverride Ġsuspend Ġfun Ġpost Qualifier ( received Item : ĠTax With holding ) Ġ= ĊĠĠĠĠĠĠĠ Ġservice . getAll (). first OrNull Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . year Ġ== Ġreceived Item . year Ġ&& Ġit . type Ġ== Ġreceived Item . type Ġ&& Ġit . pay Period Ġ== Ġreceived Item . pay Period ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġsingle Eq ( param : ĠString ) Ġ= Ġservice . table . year Ġeq Ġparam . toInt () ĊĊĠĠĠ Ġoverride Ġsuspend Ġfun ĠPipeline Context < Unit , ĠApplication Call >. put Additional ( ĊĠĠĠĠĠĠĠ Ġitem : ĠTax With holding , ĊĠĠĠĠĠĠĠ Ġupdated Item : ĠTax With holding ĊĠĠĠ Ġ): ĠTax With holding ? Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġhistory Ġ= Ġhandle History ( item , Ġupdated Item , Ġusers Service , Ġhistory Service ) ĊĠĠĠĠĠĠĠ Ġreturn Ġupdated Item . copy ( history Ġ= Ġhistory ) ĊĠĠĠ Ġ} Ċ } Ċ