My Project

Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
Transaction Class Reference

Data model representing a financial purchase event. More...

## Classes
class | TransactionDeserializer
| Custom Kafka Deserializer implementation for Transaction objects.
class | TransactionSerializer
| Custom Kafka Serializer implementation for the Transaction class.

## Public Member Functions
| Transaction ()
| Default constructor.
String | getUser ()
| Gets the username associated with the transaction.
double | getAmount ()
| Gets the transaction amount.
String | getTransactionLocation ()
| Gets the location where the transaction occurred.
void | setUser (String user)
| Sets the username for the transaction.
void | setAmount (double amount)
| Sets the monetary amount for the transaction.
void | setTransactionLocation (String transactionLocation)
| Sets the location for the transaction.
String | toString ()
| Returns a string representation of the Transaction object.
| Transaction (String user, double amount, String transactionLocation)
| Constructor to initialize a Transaction with specific data.
String | getUser ()
| Gets the username associated with this transaction.
double | getAmount ()
| Gets the monetary amount of the transaction.
String | getTransactionLocation ()
| Gets the location of the transaction.
String | toString ()
| Provides a string-based representation of the transaction data.
| Transaction ()
| Default constructor.
String | getUser ()
| Gets the username associated with the transaction.
double | getAmount ()
| Gets the transaction amount.
String | getTransactionLocation ()
| Gets the location where the transaction occurred.
void | setUser (String user)
| Sets the username for the transaction.
void | setAmount (double amount)
| Sets the monetary amount for the transaction.
void | setTransactionLocation (String transactionLocation)
| Sets the location for the transaction.
String | toString ()
| Returns a string representation of the Transaction object.
| Transaction ()
| Default constructor.
String | getUser ()
| Gets the username associated with the transaction.
double | getAmount ()
| Gets the transaction amount.
String | getTransactionLocation ()
| Gets the location where the transaction occurred.
void | setUser (String user)
| Sets the username for the transaction.
void | setAmount (double amount)
| Sets the monetary amount for the transaction.
void | setTransactionLocation (String transactionLocation)
| Sets the location for the transaction.
String | toString ()
| Returns a string representation of the Transaction object.

## Detailed Description

Data model representing a financial purchase event.

Data model representing a financial purchase event for the producer service.

This class is shared across all microservices (Banking API, Account Manager, Notification, and Reporting) to represent a credit card transaction.

In the Banking API service, this class is used to model incoming raw transactions. It provides the structure required to perform fraud detection and is then serialized into JSON format to be published to Kafka topics.

## Constructor & Destructor Documentation

## ◆ Transaction() [1/4]

Transaction.Transaction | ( |  | ) |

Default constructor.

Required by Jackson ObjectMapper for JSON deserialization.

## ◆ Transaction() [2/4]

Transaction.Transaction | ( | String | user,
|  | double | amount,
|  | String | transactionLocation
| ) |  |

Constructor to initialize a Transaction with specific data.

Parameters

  user | The customer's username or ID.
  amount | The cost of the items purchased.
  transactionLocation | The country where the credit card was used.

## ◆ Transaction() [3/4]

Transaction.Transaction | ( |  | ) |

Default constructor.

Required by Jackson ObjectMapper for JSON deserialization.

## ◆ Transaction() [4/4]

Transaction.Transaction | ( |  | ) |

Default constructor.

Required by Jackson ObjectMapper for JSON deserialization.

## Member Function Documentation

## ◆ getAmount() [1/4]

double Transaction.getAmount | ( |  | ) |

Gets the transaction amount.

Returns
  double The purchase amount.

## ◆ getAmount() [2/4]

double Transaction.getAmount | ( |  | ) |

Gets the monetary amount of the transaction.

Returns
  double The transaction value.

## ◆ getAmount() [3/4]

double Transaction.getAmount | ( |  | ) |

Gets the transaction amount.

Returns
  double The purchase amount.

## ◆ getAmount() [4/4]

double Transaction.getAmount | ( |  | ) |

Gets the transaction amount.

Returns
  double The purchase amount.

## ◆ getTransactionLocation() [1/4]

String Transaction.getTransactionLocation | ( |  | ) |

Gets the location where the transaction occurred.

Returns
  String The transaction location.

## ◆ getTransactionLocation() [2/4]

String Transaction.getTransactionLocation | ( |  | ) |

Gets the location of the transaction.

Returns
  String The country name/code.

## ◆ getTransactionLocation() [3/4]

String Transaction.getTransactionLocation | ( |  | ) |

Gets the location where the transaction occurred.

Returns
  String The transaction location.

## ◆ getTransactionLocation() [4/4]

String Transaction.getTransactionLocation | ( |  | ) |

Gets the location where the transaction occurred.

Returns
  String The transaction location.

## ◆ getUser() [1/4]

String Transaction.getUser | ( |  | ) |

Gets the username associated with the transaction.

Returns
  String The user ID.

## ◆ getUser() [2/4]

String Transaction.getUser | ( |  | ) |

Gets the username associated with this transaction.

Returns
  String The user identifier.

## ◆ getUser() [3/4]

String Transaction.getUser | ( |  | ) |

Gets the username associated with the transaction.

Returns
  String The user ID.

## ◆ getUser() [4/4]

String Transaction.getUser | ( |  | ) |

Gets the username associated with the transaction.

Returns
  String The user ID.

## ◆ setAmount() [1/3]

void Transaction.setAmount | ( | double | amount | ) |

Sets the monetary amount for the transaction.

Parameters

  amount | The value to set.

## ◆ setAmount() [2/3]

void Transaction.setAmount | ( | double | amount | ) |

Sets the monetary amount for the transaction.

Parameters

  amount | The value to set.

## ◆ setAmount() [3/3]

void Transaction.setAmount | ( | double | amount | ) |

Sets the monetary amount for the transaction.

Parameters

  amount | The value to set.

## ◆ setTransactionLocation() [1/3]

void Transaction.setTransactionLocation | ( | String | transactionLocation | ) |

Sets the location for the transaction.

Parameters

  transactionLocation | The country/location string.

## ◆ setTransactionLocation() [2/3]

void Transaction.setTransactionLocation | ( | String | transactionLocation | ) |

Sets the location for the transaction.

Parameters

  transactionLocation | The country/location string.

## ◆ setTransactionLocation() [3/3]

void Transaction.setTransactionLocation | ( | String | transactionLocation | ) |

Sets the location for the transaction.

Parameters

  transactionLocation | The country/location string.

## ◆ setUser() [1/3]

void Transaction.setUser | ( | String | user | ) |

Sets the username for the transaction.

Parameters

  user | The user ID to set.

## ◆ setUser() [2/3]

void Transaction.setUser | ( | String | user | ) |

Sets the username for the transaction.

Parameters

  user | The user ID to set.

## ◆ setUser() [3/3]

void Transaction.setUser | ( | String | user | ) |

Sets the username for the transaction.

Parameters

  user | The user ID to set.

## ◆ toString() [1/4]

String Transaction.toString | ( |  | ) |

Returns a string representation of the Transaction object.

Returns
  String Formatted transaction details.

## ◆ toString() [2/4]

String Transaction.toString | ( |  | ) |

Provides a string-based representation of the transaction data.

Returns
  String A formatted debug string containing user, amount, and location.

## ◆ toString() [3/4]

String Transaction.toString | ( |  | ) |

Returns a string representation of the Transaction object.

Returns
  String Formatted transaction details.

## ◆ toString() [4/4]

String Transaction.toString | ( |  | ) |

Returns a string representation of the Transaction object.

Returns
  String Formatted transaction details.

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

- account-manager/src/main/java/Transaction.java
- bank-api-service/src/main/java/Transaction.java
- reporting-service/src/main/java/Transaction.java
- user-notification-service/src/main/java/Transaction.java