package Ġcom . th om ask io ko . pay bill manager . data Ċ Ċ import Ġcom . th om ask io ko . pay bill manager . data . mapper . Category Mapper Ċ import Ġcom . th om ask io ko . pay bill manager . data . store . category . Category DataStore Factory Ċ import Ġcom . th om ask io ko . pay bill manager . domain . model . Category Ċ import Ġcom . th om ask io ko . pay bill manager . domain . repository . Category Repository Ċ import Ġio . reactivex . Comp letable Ċ import Ġio . reactivex . Flow able Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠCategory Data Repository Ġ@ Inject Ġconstructor ( ĊĠĠĠĠĠĠĠ Ġprivate Ġval Ġmapper : ĠCategory Mapper , ĊĠĠĠĠĠĠĠ Ġprivate Ġval Ġfactory : ĠCategory DataStore Factory Ċ ) Ġ: ĠCategory Repository Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġcreate Categories ( categories : ĠList < Category >): ĠComp letable Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġfactory . getCache DataStore (). create Categories ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcategories . map Ġ{ Ġmapper . map To Entity ( it ) Ġ} ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Category ById ( categoryId : ĠString ): ĠFlow able < Category > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġfactory . getCache DataStore (). get Category ById ( categoryId ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. map Ġ{ Ġmapper . map From Entity ( it ) Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Categories (): ĠFlow able < List < Category >> Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġfactory . getCache DataStore (). getC ategories () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. map Ġ{ Ġit . map Ġ{ Ġmapper . map From Entity ( it ) Ġ} Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġcreate Category ( category : ĠCategory ): ĠComp letable Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġfactory . getCache DataStore (). create Category ( mapper . map To Entity ( category )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġupdate Category ( category : ĠCategory ): ĠComp letable Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġfactory . getCache DataStore (). update Category ( mapper . map To Entity ( category )) ĊĠĠĠ Ġ} Ċ Ċ }