package Ġcom . github . ca ay 2 0 0 0 . tt k . context . vehicle . configuration . secondary . database Ċ Ċ import Ġarrow . core . Either Ċ import Ġcom . github . ca ay 2 0 0 0 . tt k . context . shared . domain . Vehicle TypeEnum Ċ import Ġcom . github . ca ay 2 0 0 0 . tt k . context . vehicle . configuration . domain . Vehicle Configuration Ċ import Ġcom . github . ca ay 2 0 0 0 . tt k . context . vehicle . configuration . domain . Vehicle Configuration Repository Ċ import Ġcom . github . ca ay 2 0 0 0 . tt k . lib . database . InMemory Database Ċ Ċ class ĠIn Memory Vehicle Configuration Repository ( private Ġval Ġdatabase : ĠIn Memory Database ) Ġ: ĠVehicle Configuration Repository Ġ{ ĊĊĠĠĠ Ġ// ĠTODO Ġcreate Ġa ĠD TO Ġobject Ġfor Ġvehicle ĊĠĠĠ Ġoverride Ġfun Ġsave ( configuration : ĠVehicle Configuration ): ĠEither < Throwable , ĠVehicle Configuration > Ġ= ĊĠĠĠĠĠĠĠ ĠEither . catch Ġ{ Ġdatabase . save ( DATABASE _ TABLE , Ġconfiguration . type . name , Ġconfiguration ) Ġas ĠVehicle Configuration Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget ( type : ĠVehicle TypeEnum ): ĠEither < Throwable , ĠVehicle Configuration > Ġ= ĊĠĠĠĠĠĠĠ ĠEither . catch Ġ{ Ġdatabase . getById ( DATABASE _ TABLE , Ġtype . name ) Ġas ĠVehicle Configuration Ġ} ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġprivate Ġconst Ġval ĠDATABASE _ TABLE Ġ= Ġ" VE H IC LE _ CTX _ vehicle _ configuration " ĊĠĠĠ Ġ} Ċ } Ċ