X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=capifcore%2Finternal%2Fprovidermanagementapi%2Ftypevalidation.go;h=bb32991e3444241a826168c0e987de83a7736cc0;hb=bf237808ac109b30461a453c59ff4e9cc9b297f4;hp=c873f30fd9326e230adabda06daf649ac66455df;hpb=a421cac71a805f94c9093f945afedc083c0cf614;p=nonrtric%2Fplt%2Fsme.git diff --git a/capifcore/internal/providermanagementapi/typevalidation.go b/capifcore/internal/providermanagementapi/typevalidation.go index c873f30..bb32991 100644 --- a/capifcore/internal/providermanagementapi/typevalidation.go +++ b/capifcore/internal/providermanagementapi/typevalidation.go @@ -67,3 +67,10 @@ func (pd APIProviderEnrolmentDetails) validateFunctions() error { } return nil } + +func (pd APIProviderEnrolmentDetails) ValidateAlreadyRegistered(otherProvider APIProviderEnrolmentDetails) error { + if pd.RegSec == otherProvider.RegSec { + return errors.New("provider with identical regSec already registered") + } + return nil +}