2017-09-12 02:07:43 +00:00
|
|
|
package cy.agorise.crystalwallet.models;
|
|
|
|
|
|
|
|
import android.arch.persistence.room.ColumnInfo;
|
|
|
|
import android.arch.persistence.room.Entity;
|
|
|
|
import android.arch.persistence.room.PrimaryKey;
|
|
|
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
2017-09-13 16:12:22 +00:00
|
|
|
import cy.agorise.crystalwallet.enums.CryptoCoin;
|
|
|
|
|
2017-09-12 02:07:43 +00:00
|
|
|
/**
|
2017-09-13 21:52:36 +00:00
|
|
|
* Represents a generic CryptoNet Transaction
|
|
|
|
*
|
2017-09-12 02:07:43 +00:00
|
|
|
* Created by Henry Varona on 11/9/2017.
|
|
|
|
*/
|
|
|
|
@Entity(tableName="crypto_coin_transaction")
|
|
|
|
public class CryptoCoinTransaction {
|
|
|
|
|
2017-09-13 21:52:36 +00:00
|
|
|
/**
|
|
|
|
* The account associated with this transaction
|
|
|
|
*/
|
2017-09-12 02:07:43 +00:00
|
|
|
protected CryptoNetAccount account;
|
|
|
|
|
2017-09-13 21:52:36 +00:00
|
|
|
/**
|
|
|
|
* The id on the database
|
|
|
|
*/
|
2017-09-12 02:07:43 +00:00
|
|
|
@PrimaryKey(autoGenerate = true)
|
|
|
|
@ColumnInfo(name="id")
|
|
|
|
protected int id;
|
2017-09-13 21:52:36 +00:00
|
|
|
/**
|
|
|
|
* The full date of this transaction
|
|
|
|
*/
|
2017-09-12 02:07:43 +00:00
|
|
|
@ColumnInfo(name="date")
|
|
|
|
protected Date date;
|
2017-09-13 21:52:36 +00:00
|
|
|
/**
|
|
|
|
* If this transaction is input of the account associated with it
|
|
|
|
*/
|
2017-09-12 02:07:43 +00:00
|
|
|
@ColumnInfo(name="is_input")
|
|
|
|
protected boolean isInput;
|
2017-09-13 21:52:36 +00:00
|
|
|
/**
|
|
|
|
* The id of the account assoiciated, this is used for the foreign key definition
|
|
|
|
*/
|
2017-09-12 02:07:43 +00:00
|
|
|
@ColumnInfo(name="account_id")
|
|
|
|
protected int accountId;
|
2017-09-13 21:52:36 +00:00
|
|
|
/**
|
|
|
|
* The amount of asset is moved in this transaction
|
|
|
|
*/
|
2017-09-13 16:12:22 +00:00
|
|
|
@ColumnInfo(name="amount")
|
|
|
|
protected int amount;
|
2017-09-13 21:52:36 +00:00
|
|
|
/**
|
|
|
|
* The crypto Coin associated with this transaction
|
|
|
|
*/
|
2017-09-13 16:12:22 +00:00
|
|
|
@ColumnInfo(name="crypto_coin")
|
|
|
|
protected CryptoCoin coin;
|
2017-09-13 21:52:36 +00:00
|
|
|
/**
|
|
|
|
* If this transaction is confirmed
|
|
|
|
*/
|
2017-09-13 16:12:22 +00:00
|
|
|
@ColumnInfo(name="is_confirmed")
|
|
|
|
protected boolean isConfirmed;
|
2017-09-12 02:07:43 +00:00
|
|
|
|
2017-09-14 01:06:51 +00:00
|
|
|
public int getAmount() {
|
|
|
|
return amount;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setAmount(int amount) {
|
|
|
|
this.amount = amount;
|
|
|
|
}
|
|
|
|
|
|
|
|
@ColumnInfo(name="from")
|
|
|
|
protected String from;
|
|
|
|
@ColumnInfo(name="to")
|
|
|
|
protected String to;
|
|
|
|
|
|
|
|
public String getFrom() {
|
|
|
|
return from;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setFrom(String from) {
|
|
|
|
this.from = from;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getTo() {
|
|
|
|
return to;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setTo(String to) {
|
|
|
|
this.to = to;
|
|
|
|
}
|
|
|
|
|
2017-09-12 02:07:43 +00:00
|
|
|
public int getAccountId() {
|
|
|
|
return accountId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setAccountId(int accountId) {
|
|
|
|
this.accountId = accountId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public CryptoNetAccount getAccount() {
|
|
|
|
return account;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setAccount(CryptoNetAccount account) {
|
|
|
|
this.account = account;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getId() {
|
|
|
|
return id;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setId(int id) {
|
|
|
|
this.id = id;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Date getDate() {
|
|
|
|
return date;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setDate(Date date) {
|
|
|
|
this.date = date;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean getInput() {
|
|
|
|
return isInput;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setInput(boolean input) {
|
|
|
|
this.isInput = input;
|
|
|
|
}
|
|
|
|
}
|