package Ġru . ad av li at ov . atom y . example . transfer . service . repo Ċ Ċ import Ġru . ad av li at ov . atom y . common . domain . Id Ċ import Ġru . ad av li at ov . atom y . common . domain . State Ċ import Ġru . ad av li at ov . atom y . common . type . json . impl . Jack son Json Ċ import Ġru . ad av li at ov . atom y . common . type . json . impl . Jack son Json . Companion . toJson Ċ import Ġru . ad av li at ov . atom y . common . type . ref . impl . json . ext . Ref Extensions . ref Ċ import Ġru . ad av li at ov . atom y . example . transfer . domain . Account Ċ import Ġru . ad av li at ov . atom y . example . transfer . domain . Operation Ċ import Ġru . ad av li at ov . atom y . example . transfer . domain . Transaction Ċ import Ġru . ad av li at ov . atom y . example . transfer . service . repo . generated . transaction . tables . da os . Transactions Dao Ċ import Ġru . ad av li at ov . atom y . example . transfer . service . repo . generated . transaction . tables . po jos . Transactions Ċ import Ġru . ad av li at ov . atom y . example . transfer . service . repo . generated . transaction . tables . records . Transactions Record Ċ import Ġru . ad av li at ov . atom y . example . transfer . type . Money Ċ import Ġru . ad av li at ov . atom y . toolkit . jooq . ext . Postgres J oo q Extensions . to J oo q Config Ċ import Ġru . ad av li at ov . atom y . toolkit . jooq . service . Model J oo q Dao Adapter Ċ import Ġru . ad av li at ov . atom y . toolkit . jooq . service . be haviour . With J oo q Fetch OrCreate Or Ignore Ċ import Ġjavax . sql . DataSource Ċ Ċ open Ġclass ĠTransaction J oo q Repo ( ds : ĠDataSource ) Ġ: ĠModel J oo q Dao Adapter < Transaction , ĠTransactions Record , ĠTransactions >( ds ), ĊĠ ĠWith J oo q Fetch OrCreate Or Ignore < Transaction , ĠTransactions Record , ĠTransactions >, ĊĠ ĠTransaction Repo Ġ{ ĊĠ Ġoverride Ġval Ġdao Ġ= ĠTransactions Dao ( ds . to J oo q Config ()) ĊĊĠ Ġoverride Ġval Ġentity Class Ġ= ĠTransaction :: class . java ĊĠ Ġoverride Ġval Ġpo jo Class Ġ= ĠTransactions :: class . java ĊĊĠ Ġoverride Ġfun ĠTransaction . to Po jo (): ĠTransactions Ġ= ĠTransactions ( ĊĠĠĠ Ġid . checked Id , ĊĠĠĠ Ġid . uid , ĊĠĠĠ Ġnull , ĊĠĠĠ Ġstate . name , ĊĠĠĠ ĠcreatedAt , ĊĠĠĠ Ġmodified At , ĊĠĠĠ Ġfrom ?. id , ĊĠĠĠ Ġto . id , ĊĠĠĠ Ġoperation . name , ĊĠĠĠ Ġnull ĊĠ Ġ) ĊĊĠ Ġoverride Ġfun ĠTransactions . to Model (): ĠTransaction Ġ= ĠTransaction ( ĊĠĠĠ ĠId ( id , Ġuid , Ġref ( ref ), ĠTransaction :: class . java ), ĊĠĠĠ ĠState ( state ), ĊĠĠĠ ĠcreatedAt , ĊĠĠĠ Ġmodified At , ĊĠĠĠ ĠId ( id Ġ= Ġfrom Account , Ġref Ġ= Ġref ( ref ), Ġmodel Ġ= ĠAccount :: class . java ), ĊĠĠĠ ĠId ( id Ġ= Ġto Account , Ġref Ġ= Ġref ( ref ), Ġmodel Ġ= ĠAccount :: class . java ), ĊĠĠĠ ĠMoney ( Ċ // ĠĠĠĠĠ Ġmoney . node [" currency "]. as Text (), Ċ // ĠĠĠĠĠ Ġmoney . node [" amount "]. as Long () ĊĠĠĠĠĠ Ġ" gb p ", ĊĠĠĠĠĠĠ 0 L ĊĠĠĠ Ġ), ĊĠĠĠ ĠOperation ( operation ) ĊĠ Ġ) Ċ Ċ } Ċ Ċ fun Ġref ( json : ĠJack son Json ) Ġ= Ġref ( ĊĠ Ġjson . node . get (" consumer "). toJson () Ċ ) Ċ