package Ġbr . com . al ura . config . validator Ċ Ċ import Ġbr . com . al ura . clients . Cont as Client Ċ import Ġio . mic ronaut . http . HttpStatus Ċ import Ġjak arta . inject . Singleton Ċ import Ġjavax . validation . Constraint Ċ import Ġjavax . validation . Constraint Validator Ċ import Ġjavax . validation . Constraint Validator Context Ċ import Ġkotlin . reflect . K Class Ċ Ċ @ Must Be Document ed Ċ @ Target ( Annotation Target . CON STRUCTOR , ĠAnnotation Target . FIELD ) Ċ @ Retention ( Annotation Retention . RUNTIME ) Ċ @ Constraint ( validated By Ġ= Ġ[ Valid Id Cliente Class :: class ]) Ċ annotation Ġclass ĠValid Id Cliente ( ĊĠĠĠ Ġval Ġmessage : String Ġ= Ġ" Id Ġdo Ġcliente Ġinv Ã¡l ido ", ĊĠĠĠ Ġval Ġgroups : ĠArray < K Class < Any >> Ġ= Ġ[], ĊĠĠĠ Ġval Ġpayload : ĠArray < K Class < Any >> Ġ= Ġ[] Ċ ) ĊĊ Ċ @ Singleton Ċ class ĠValid Id Cliente Class ( val Ġcont as Client : ĠCont as Client ): ĠConstraint Validator < Valid Id Cliente , ĠString > Ġ{ ĊĠĠĠ Ġoverride Ġfun ĠisValid ( value : ĠString , Ġcontext : ĠConstraint Validator Context ?): ĠBoolean Ġ{ ĊĊĠĠĠĠĠĠĠ Ġval Ġresponse Ġ= Ġcont as Client . bus ca Cliente ( value ) ĊĠĠĠĠĠĠĠ Ġreturn Ġresponse . status . equals ( HttpStatus . OK ) ĊĠĠĠ Ġ} Ċ Ċ } Ċ