My Project
Loading...
Searching...
No Matches
Public Member Functions | List of all members
UserResidenceDatabase Class Reference

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

Public Member Functions

 UserResidenceDatabase ()
 Constructor for UserResidenceDatabase.
 
String getUserResidence (String user)
 Fetches a user's home country from the Redis database.
 

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's verified residence.

Constructor & Destructor Documentation

◆ UserResidenceDatabase()

UserResidenceDatabase.UserResidenceDatabase ( )

Constructor for UserResidenceDatabase.

Initializes the Redis connection pool and triggers the automatic seeding of data from the local USER_RESIDENCE_FILE.

Member Function Documentation

◆ getUserResidence()

String UserResidenceDatabase.getUserResidence ( String  user)

Fetches a user's home country from the Redis database.

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

Parameters
userThe username or ID of the customer.
Returns
String The country string representing the user's residence.
Exceptions
RuntimeExceptionif the user key does not exist in Redis.
Note
Absence of a user in the DB is treated as a critical data error.

The documentation for this class was generated from the following file: