classDiagram
%% Controller Package
class AbhaRegistrationController {
+generateSessionToken() ResponseEntity~SessionTokenResponse~
+getPublicCertificate() ResponseEntity~PublicKeyResponse~
+requestAadhaarOtp(AadhaarOtpRequest) ResponseEntity~OtpResponse~
+resendAadhaarOtp(ResendOtpRequest) ResponseEntity~OtpResponse~
+enrollAbha(AbhaEnrollmentRequest) ResponseEntity~AbhaEnrollmentResponse~
}
%% Service Package
class AbhaRegistrationService {
<<interface>>
+generateSessionToken() SessionTokenResponse
+getPublicCertificate() PublicKeyResponse
+requestAadhaarOtp(AadhaarOtpRequest) OtpResponse
+resendAadhaarOtp(ResendOtpRequest) OtpResponse
+enrollAbha(AbhaEnrollmentRequest) AbhaEnrollmentResponse
}
class AbhaRegistrationServiceImpl {
-authenticationService AuthenticationService
-encryptionService EncryptionService
-restTemplate RestTemplate
-objectMapper ObjectMapper
-applicationProperties ApplicationProperties
+generateSessionToken() SessionTokenResponse
+getPublicCertificate() PublicKeyResponse
+requestAadhaarOtp(AadhaarOtpRequest) OtpResponse
+resendAadhaarOtp(ResendOtpRequest) OtpResponse
+enrollAbha(AbhaEnrollmentRequest) AbhaEnrollmentResponse
}
class AuthenticationService {
<<interface>>
+generateSessionToken() String
}
class AuthenticationServiceImpl {
-restTemplate RestTemplate
-objectMapper ObjectMapper
-applicationProperties ApplicationProperties
+generateSessionToken() String
}
class EncryptionService {
<<interface>>
+getPublicKey() String
+encryptWithPublicKey(data String, publicKey String) String
}
class EncryptionServiceImpl {
-restTemplate RestTemplate
-objectMapper ObjectMapper
-applicationProperties ApplicationProperties
+getPublicKey() String
+encryptWithPublicKey(data String, publicKey String) String
}
%% Model Request Package
class AadhaarOtpRequest {
-txnId String
-scope List~String~
-loginHint String
-loginId String
-otpSystem String
}
class ResendOtpRequest {
-txnId String
-scope List~String~
-loginHint String
-loginId String
-otpSystem String
}
class AbhaEnrollmentRequest {
-authData AuthData
-consent Consent
}
class AuthData {
-authMethods List~String~
-otp OtpData
}
class OtpData {
-txnId String
-otpValue String
-mobile String
}
class Consent {
-code String
-version String
}
%% Model Response Package
class SessionTokenResponse {
-accessToken String
-expiresIn Long
-refreshToken String
-refreshExpiresIn Long
-tokenType String
}
class PublicKeyResponse {
-publicKey String
-keyId String
}
class OtpResponse {
-txnId String
-status String
-message String
}
class AbhaEnrollmentResponse {
-abhaNumber String
-phrAddress String
-name String
-gender String
-yearOfBirth String
-monthOfBirth String
-dayOfBirth String
-mobile String
-authMethods List~String~
-accessToken String
-refreshToken String
}
%% Config Package
class ApplicationProperties {
-abhaBaseUrl String
-clientId String
-clientSecret String
-sessionEndpoint String
-publicKeyEndpoint String
-otpRequestEndpoint String
-enrollmentEndpoint String
}
class RestTemplateConfig {
+restTemplate() RestTemplate
+objectMapper() ObjectMapper
}
class GlobalExceptionHandler {
+handleApiException(ApiException) ResponseEntity~ErrorResponse~
+handleValidationException(ValidationException) ResponseEntity~ErrorResponse~
+handleGeneralException(Exception) ResponseEntity~ErrorResponse~
}
%% Exception Package
class ApiException {
-errorCode String
-errorMessage String
-httpStatus HttpStatus
}
class ValidationException {
-errors Map~String,String~
}
class ErrorResponse {
-timestamp LocalDateTime
-status int
-error String
-message String
-path String
}
%% Util Package
class HeaderUtil {
+generateRequestId()$ String
+getTimestamp()$ String
+addCommonHeaders(HttpHeaders)$ HttpHeaders
}
class RsaEncryptionUtil {
+encrypt(data String, publicKey String)$ String
}
%% Relationships
AbhaRegistrationController --> AbhaRegistrationService
AbhaRegistrationService <|.. AbhaRegistrationServiceImpl
AbhaRegistrationServiceImpl --> AuthenticationService
AbhaRegistrationServiceImpl --> EncryptionService
AuthenticationService <|.. AuthenticationServiceImpl
EncryptionService <|.. EncryptionServiceImpl
AbhaRegistrationServiceImpl --> ApplicationProperties
AuthenticationServiceImpl --> ApplicationProperties
EncryptionServiceImpl --> ApplicationProperties
AbhaRegistrationServiceImpl ..> HeaderUtil
EncryptionServiceImpl ..> RsaEncryptionUtil
AbhaRegistrationServiceImpl ..> AadhaarOtpRequest
AbhaRegistrationServiceImpl ..> ResendOtpRequest
AbhaRegistrationServiceImpl ..> AbhaEnrollmentRequest
AbhaRegistrationServiceImpl ..> SessionTokenResponse
AbhaRegistrationServiceImpl ..> PublicKeyResponse
AbhaRegistrationServiceImpl ..> OtpResponse
AbhaRegistrationServiceImpl ..> AbhaEnrollmentResponse
AbhaEnrollmentRequest *-- AuthData
AuthData *-- OtpData
AbhaEnrollmentRequest *-- Consent
RestTemplateConfig ..> ApplicationProperties
GlobalExceptionHandler ..> ErrorResponse
GlobalExceptionHandler ..> ApiException
GlobalExceptionHandler ..> ValidationException