package Ġdigital . cap sa . ar che types . query . services Ċ Ċ import Ġdigital . cap sa . ar che types . core . aggreg ates . Member Id Ċ import Ġdigital . cap sa . ar che types . query . model . member . Member Ċ import Ġdigital . cap sa . ar che types . query . repo . Member Repository Ċ import Ġorg . springframework . stereotype . Component Ċ Ċ @ Component Ċ class ĠMember Service ( private Ġval Ġrepository : ĠMember Repository ) Ġ{ ĊĊĠĠĠ Ġfun Ġget Member ( member Id : ĠMember Id ): ĠMember Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġrepository . getOne ( member Id ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget Member List (): ĠList < Member > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġrepository . findAll () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġregister Member ( member : ĠMember ) Ġ{ ĊĠĠĠĠĠĠĠ Ġif Ġ( repository . exists ById ( member . id )) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġthrow ĠError (" Member Ġwith Ġ${ member . id } Ġalready Ġexist ") ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġrepository . save ( member ) ĊĠĠĠ Ġ} Ċ } Ċ