\doxysection{User\+Residence\+Database Class Reference}
\hypertarget{classUserResidenceDatabase}{}\label{classUserResidenceDatabase}\index{UserResidenceDatabase@{UserResidenceDatabase}}


High-\/performance database wrapper for user residence lookups using Redis.  


\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{classUserResidenceDatabase_a683f593e517452cac560bbd1a5fb9811}{User\+Residence\+Database}} ()
\begin{DoxyCompactList}\small\item\em Constructor for \doxylink{classUserResidenceDatabase}{User\+Residence\+Database}. \end{DoxyCompactList}\item 
String \mbox{\hyperlink{classUserResidenceDatabase_ac7e73ffcfc9177fa717fc648668fcb5e}{get\+User\+Residence}} (String user)
\begin{DoxyCompactList}\small\item\em Fetches a user\textquotesingle{}s home country from the Redis database. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
High-\/performance database wrapper for user residence lookups using Redis. 

This class interacts with a Redis instance to store and retrieve the home country of bank users. It is a critical component of the fraud detection system, allowing the Banking API to quickly compare transaction locations against a user\textquotesingle{}s verified residence. 

\doxysubsection{Constructor \& Destructor Documentation}
\Hypertarget{classUserResidenceDatabase_a683f593e517452cac560bbd1a5fb9811}\label{classUserResidenceDatabase_a683f593e517452cac560bbd1a5fb9811} 
\index{UserResidenceDatabase@{UserResidenceDatabase}!UserResidenceDatabase@{UserResidenceDatabase}}
\index{UserResidenceDatabase@{UserResidenceDatabase}!UserResidenceDatabase@{UserResidenceDatabase}}
\doxysubsubsection{\texorpdfstring{UserResidenceDatabase()}{UserResidenceDatabase()}}
{\footnotesize\ttfamily User\+Residence\+Database.\+User\+Residence\+Database (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Constructor for \doxylink{classUserResidenceDatabase}{User\+Residence\+Database}. 

Initializes the Redis connection pool and triggers the automatic seeding of data from the local USER\+\_\+\+RESIDENCE\+\_\+\+FILE. 

\doxysubsection{Member Function Documentation}
\Hypertarget{classUserResidenceDatabase_ac7e73ffcfc9177fa717fc648668fcb5e}\label{classUserResidenceDatabase_ac7e73ffcfc9177fa717fc648668fcb5e} 
\index{UserResidenceDatabase@{UserResidenceDatabase}!getUserResidence@{getUserResidence}}
\index{getUserResidence@{getUserResidence}!UserResidenceDatabase@{UserResidenceDatabase}}
\doxysubsubsection{\texorpdfstring{getUserResidence()}{getUserResidence()}}
{\footnotesize\ttfamily String User\+Residence\+Database.\+get\+User\+Residence (\begin{DoxyParamCaption}\item[{String}]{user }\end{DoxyParamCaption})}



Fetches a user\textquotesingle{}s home country from the Redis database. 

This method performs an O(1) lookup in Redis.


\begin{DoxyParams}{Parameters}
{\em user} & The username or ID of the customer. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
String The country string representing the user\textquotesingle{}s residence. 
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em Runtime\+Exception} & if the user key does not exist in Redis. \\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
Absence of a user in the DB is treated as a critical data error.
\end{DoxyNote}


The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
bank-\/api-\/service/src/main/java/\mbox{\hyperlink{UserResidenceDatabase_8java}{User\+Residence\+Database.\+java}}\end{DoxyCompactItemize}
