Add new entities
This commit is contained in:
41
src/main/java/entities/Expense.java
Normal file
41
src/main/java/entities/Expense.java
Normal file
@@ -0,0 +1,41 @@
|
||||
package entities;
|
||||
|
||||
public class Expense extends MoneyTransaction {
|
||||
|
||||
private int userId;
|
||||
private int amount;
|
||||
private ExpensesCategory category;
|
||||
|
||||
public Expense(int userId, int amount, ExpensesCategory category) {
|
||||
this.userId = userId;
|
||||
this.amount = amount;
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(int userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public void setAmount(int amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCategory() {
|
||||
return category.toString();
|
||||
}
|
||||
|
||||
public void setCategory(ExpensesCategory category) {
|
||||
this.category = category;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user