package Ġcom . f 2 h . f 2 h _ buyer . network Ċ Ċ import Ġcom . f 2 h . f 2 h _ buyer . constants . F 2 H Constants . SERVER _ URL Ċ import Ġcom . f 2 h . f 2 h _ buyer . network . models . Order Ċ import Ġcom . f 2 h . f 2 h _ buyer . network . models . Order CreateRequest Ċ import Ġcom . f 2 h . f 2 h _ buyer . network . models . Order Header Ċ import Ġcom . f 2 h . f 2 h _ buyer . network . models . Order Update Request Ċ import Ġcom . jak ew h art on . ret rofit 2 . adapter . kotlin . coroutines . Coroutine Call Adapter Factory Ċ import Ġcom . squareup . mos hi . M oshi Ċ import Ġcom . squareup . mos hi . kotlin . reflect . Kotlin Json Adapter Factory Ċ import Ġkotlinx . coroutines . Deferred Ċ import Ġretrofit 2 . Ret rofit Ċ import Ġretrofit 2 . converter . mos hi . M oshi Converter Factory Ċ import Ġretrofit 2 . http .* Ċ Ċ private Ġconst Ġval ĠBASE _ URL Ġ= ĠSERVER _ URL Ċ Ċ private Ġval Ġm oshi Ġ= ĠM oshi . Builder () ĊĠĠĠ Ġ. add ( Kotlin Json Adapter Factory ()) ĊĠĠĠ Ġ. build () Ċ Ċ private Ġval Ġretrofit Ġ= ĠRet rofit . Builder () ĊĠĠĠ Ġ. add Converter Factory ( M oshi Converter Factory . create ( mos hi )) ĊĠĠĠ Ġ. add Call Adapter Factory ( Coroutine Call Adapter Factory ()) ĊĠĠĠ Ġ. baseUrl ( BASE _ URL ) ĊĠĠĠ Ġ. build () Ċ Ċ interface ĠOrder ApiService Ġ{ ĊĠĠĠ Ġ@ GET (" order _ header ") ĊĠĠĠ Ġfun Ġget Order Headers For Group User And Item (@ Query (" group _ id ") ĠgroupId : ĠLong , Ġ@ Query (" buyer _ user _ id ") Ġbuy er UserId : ĠLong , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ@ Query (" item _ id ") ĠitemId : ĠLong ?, Ġ@ Query (" start _ date ") ĠstartDate : ĠString ?, ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ@ Query (" end _ date ") ĠendDate : ĠString ?): ĠDeferred < List < Order Header >> ĊĊĠĠĠ Ġ@ GET (" order ") ĊĠĠĠ Ġfun Ġget Orders For Group User And Item (@ Query (" group _ id ") ĠgroupId : ĠLong , Ġ@ Query (" buyer _ user _ id ") Ġbuy er UserId : ĠLong , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ@ Query (" item _ id ") ĠitemId : ĠLong ?, Ġ@ Query (" start _ date ") ĠstartDate : ĠString ?, ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ@ Query (" end _ date ") ĠendDate : ĠString ?): ĠDeferred < List < Order >> ĊĊĠĠĠ Ġ@ PUT (" orders / update _ all ") ĊĠĠĠ Ġfun Ġupdate Orders (@ Body Ġorder Update Requests : ĠList < Order Update Request >): ĠDeferred < List < Order >> ĊĊĠĠĠ Ġ@ POST (" orders / save _ all ") ĊĠĠĠ Ġfun Ġcreate Orders (@ Body Ġcreate Orders : ĠList < Order CreateRequest >): ĠDeferred < List < Order >> Ċ Ċ } Ċ Ċ object ĠOrder Api Ġ{ ĊĠĠĠ Ġval Ġretrofit Service Ġ: ĠOrder ApiService Ġby Ġlazy Ġ{ ĊĠĠĠĠĠĠĠ Ġretrofit . create ( Order ApiService :: class . java ) ĊĠĠĠ Ġ} Ċ } Ċ