package Ġorg . w ats i . device . db . models Ċ Ċ import Ġandroid . arch . persistence . room . Embedded Ċ import Ġandroid . arch . persistence . room . Relation Ċ import Ġorg . w ats i . domain . relations . Bill able With Price Schedule Ċ Ċ data Ġclass ĠPrice Schedule With Bill able Model ( ĊĠĠĠ Ġ@ Embedded Ġvar Ġprice Schedule Model : ĠPrice Schedule Model ? Ġ= Ġnull , ĊĠĠĠ Ġ@ Relation ( parent Column Ġ= Ġ" bill able Id ", Ġentity Column Ġ= Ġ" id ", Ġentity Ġ= ĠBill able Model :: class ) ĊĠĠĠ Ġvar Ġbill able Model : ĠList < Bill able Model >? Ġ= Ġnull , ĊĠĠĠ Ġ@ Relation ( parent Column Ġ= Ġ" previous Price Schedule Id ", Ġentity Column Ġ= Ġ" id ", Ġentity Ġ= ĠPrice Schedule Model :: class ) ĊĠĠĠ Ġvar Ġprevious Price Schedule Model : ĠList < Price Schedule Model >? Ġ= Ġnull Ċ ) Ġ{ ĊĠĠĠ Ġfun Ġto Bill able With Price Schedule (): ĠBill able With Price Schedule Ġ{ ĊĠĠĠĠĠĠĠ Ġprice Schedule Model ?. to Price Schedule ()?. let Ġ{ Ġprice Schedule Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġbill able Model ?. first OrNull ()?. to Bill able ()?. let Ġ{ Ġbill able Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĠBill able With Price Schedule ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġbill able , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġprice Schedule , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġprevious Price Schedule Model ?. first OrNull ()?. to Price Schedule () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġthrow ĠIllegalStateException (" Bill able Model Ġcannot Ġbe Ġnull ") ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġthrow ĠIllegalStateException (" Price Schedule Model Ġcannot Ġbe Ġnull ") ĊĠĠĠ Ġ} Ċ } Ċ