package Ġorg . ire ader . domain . use _ cases . local . insert _ use cases Ċ Ċ import Ġorg . ire ader . common _ models . entities . Book Ċ import Ġorg . ire ader . common _ models . entities . Library Book Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠInsert Book Ġ@ Inject Ġconstructor ( private Ġval Ġlocal Book Repository : Ġorg . ire ader . common _ data . repository . Local Book Repository ) Ġ{ ĊĠĠĠ Ġsuspend Ġoperator Ġfun Ġinvoke ( book : ĠBook ): ĠLong Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġorg . ire ader . common _ extensions . with IO Context Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn @ with IO Context Ġlocal Book Repository . insert Book ( book ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ class ĠUpdate Book Ġ@ Inject Ġconstructor ( private Ġval Ġlocal Book Repository : Ġorg . ire ader . common _ data . repository . Local Book Repository ) Ġ{ ĊĠĠĠ Ġsuspend Ġfun Ġupdate ( book : ĠLibrary Book , favorite : Boolean ) Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġorg . ire ader . common _ extensions . with IO Context Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn @ with IO Context Ġlocal Book Repository . update Book ( book , Ġfavorite Ġ= Ġfavorite ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠĠĠ Ġsuspend Ġfun Ġupdate ( book : ĠBook ) Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġorg . ire ader . common _ extensions . with IO Context Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn @ with IO Context Ġlocal Book Repository . update Book ( book ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠĠĠ Ġsuspend Ġfun Ġupdate ( book : ĠList < Book >) Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġorg . ire ader . common _ extensions . with IO Context Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn @ with IO Context Ġlocal Book Repository . update Book ( book ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } ĊĊ