-
- All Implemented Interfaces:
-
android.os.Parcelable
,java.io.Serializable
,java.lang.Cloneable
public class MenigaTransactionRule implements Parcelable, Serializable, Cloneable
Represents a user generated rule in the Meniga system that automatically executes some transformation on data for the user that created the rule when certain criteria defined in the rule are met.
Copyright 2017 Meniga Iceland Inc.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
MenigaTransactionRule.SplitAction
Represents details on a split action to be executed by a rule when criteria are met.
Copyright 2017 Meniga Iceland Inc.
-
Field Summary
Fields Modifier and Type Field Description public final static Parcelable.Creator<MenigaTransactionRule>
CREATOR
protected long
id
protected long
userId
protected DateTime
createdDate
protected DateTime
modifiedDate
protected String
name
protected String
textCriteria
protected TransactionRuleTextCriteriaOperatorType
textCriteriaOperatorType
protected DateMatchTypeCriteria
dateMatchTypeCriteria
protected Integer
daysLimitCriteria
protected AmountLimitTypeCriteria
amountLimitTypeCriteria
protected AmountLimitSignCriteria
amountLimitSignCriteria
protected MenigaDecimal
amountCriteria
protected String
accountCategoryCriteria
protected Boolean
acceptAction
protected Integer
monthShiftAction
protected Boolean
removeAction
protected String
textAction
protected String
commentAction
protected Long
categoryIdAction
protected List<MenigaTransactionRule.SplitAction>
splitActions
protected Boolean
flagAction
protected String
tagAction
-
Method Summary
-
-
Method Detail
-
setOperator
static void setOperator(MenigaTransactionRuleOperations operator)
Sets the api operator for doing api calls
- Parameters:
operator
- An object that implements the MenigaTransactionRuleOperations interface for carrying out api operations on this class.
-
writeToParcel
void writeToParcel(Parcel dest, int flags)
-
describeContents
int describeContents()
-
clone
MenigaTransactionRule clone()
-
hashCode
int hashCode()
-
getIsAcceptAction
boolean getIsAcceptAction()
-
getIsRemoveAction
boolean getIsRemoveAction()
-
update
Result<Void> update(boolean applyOnExisting)
Updates a transaction rule by id
- Parameters:
applyOnExisting
- Should this updated rule be applied to existing transactions.
-
refresh
Result<MenigaTransactionRule> refresh()
Fetches the server version of this object and updates all fields in this object with the server values, essentially syncing it with the server
-
fetch
static Result<List<MenigaTransactionRule>> fetch()
Fetches a list of all transaction rules for the current user
-
create
static Result<MenigaTransactionRule> create(String name, String textCriteria, TransactionRuleTextCriteriaOperatorType textCriteriaOperatorType, DateMatchTypeCriteria dateMatchTypeCriteria, Integer daysLimitCriteria, AmountLimitTypeCriteria amountLimitTypeCriteria, AmountLimitSignCriteria amountLimitSignCriteria, MenigaDecimal amountCriteria, String accountCategoryCriteria, Boolean acceptAction, Integer monthShiftAction, Boolean removeAction, String textAction, String commentAction, Long categoryIdAction, List<MenigaTransactionRule.SplitAction> splitActions, Boolean flagAction)
Creates a new transaction rule
- Parameters:
name
- User-defined name of the ruletextCriteria
- A text criteria to match by this rule, or null if this rule has no text criteriatextCriteriaOperatorType
- The type of operator to use when evaluating the TextCriteriadateMatchTypeCriteria
- A date match criteria for this ruledaysLimitCriteria
- The number of days to use when using DateMatchTypeCriteria criteria for this ruleamountLimitTypeCriteria
- Amount criteria for this ruleamountLimitSignCriteria
- Amount limit sign criteria for this ruleamountCriteria
- Amount criteria for this ruleaccountCategoryCriteria
- A comma seperated list of account category integers that should be matched before applying actions The meaning of the integers are as follows AccountCategoryEnum: 1 = Current, 2 = Credit, 3 = Savings Example: AccountCategoryCriteria="1,2" means that this rule should only apply to Current and Credit accounts, not SavingsacceptAction
- Accept action for this rulemonthShiftAction
- Month shift action for this ruleremoveAction
- Remove action for this ruletextAction
- Text action for this rulecommentAction
- Comment action for this rulecategoryIdAction
- Categorization to apply by this rulesplitActions
- Split action to perform by this ruleflagAction
- Flag or not flag transactions matching this rule
-
fetch
static Result<MenigaTransactionRule> fetch(long id)
Retrieves a transaction ryle by id
- Parameters:
id
- The id of the rule to retrieve
-
getId
long getId()
-
getUserId
long getUserId()
-
getCreatedDate
DateTime getCreatedDate()
-
getModifiedDate
DateTime getModifiedDate()
-
getTextCriteria
String getTextCriteria()
-
getTextCriteriaOperatorType
TransactionRuleTextCriteriaOperatorType getTextCriteriaOperatorType()
-
getDateMatchTypeCriteria
DateMatchTypeCriteria getDateMatchTypeCriteria()
-
getDaysLimitCriteria
Integer getDaysLimitCriteria()
-
getAmountLimitTypeCriteria
AmountLimitTypeCriteria getAmountLimitTypeCriteria()
-
getAmountLimitSignCriteria
AmountLimitSignCriteria getAmountLimitSignCriteria()
-
getAmountCriteria
MenigaDecimal getAmountCriteria()
-
getAccountCategoryCriteria
String getAccountCategoryCriteria()
-
getAcceptAction
Boolean getAcceptAction()
-
getMonthShiftAction
Integer getMonthShiftAction()
-
getRemoveAction
Boolean getRemoveAction()
-
getTextAction
String getTextAction()
-
getCommentAction
String getCommentAction()
-
getCategoryIdAction
Long getCategoryIdAction()
-
getSplitActions
List<MenigaTransactionRule.SplitAction> getSplitActions()
-
getFlagAction
Boolean getFlagAction()
-
getTagAction
String getTagAction()
-
setTextCriteria
void setTextCriteria(String textCriteria)
- Parameters:
textCriteria
- set a text criteria to be matched by this rule, or null if no text criteria is wanted.
-
setTextCriteriaOperatorType
void setTextCriteriaOperatorType(TransactionRuleTextCriteriaOperatorType textCriteriaOperatorType)
- Parameters:
textCriteriaOperatorType
- set a new text criteria operator type for the rule.
-
setDateMatchTypeCriteria
void setDateMatchTypeCriteria(DateMatchTypeCriteria dateMatchTypeCriteria)
- Parameters:
dateMatchTypeCriteria
- set a new date to match type criteria.
-
setDaysLimitCriteria
void setDaysLimitCriteria(int daysLimitCriteria)
- Parameters:
daysLimitCriteria
- update the day limit for the rule.
-
setAmountLimitTypeCriteria
void setAmountLimitTypeCriteria(AmountLimitTypeCriteria amountLimitTypeCriteria)
- Parameters:
amountLimitTypeCriteria
- set a new amount type for the rule.
-
setAmountLimitSignCriteria
void setAmountLimitSignCriteria(AmountLimitSignCriteria amountLimitSignCriteria)
- Parameters:
amountLimitSignCriteria
- set a new amount limit for the rule.
-
setAmountCriteria
void setAmountCriteria(MenigaDecimal amountCriteria)
- Parameters:
amountCriteria
- set a new amount criteria.
-
setAccountCategoryCriteria
void setAccountCategoryCriteria(String accountCategoryCriteria)
- Parameters:
accountCategoryCriteria
- set a new account category criteria.
-
setAcceptAction
void setAcceptAction(boolean acceptAction)
- Parameters:
acceptAction
- set accepted action.
-
setMonthShiftAction
void setMonthShiftAction(int monthShiftAction)
- Parameters:
monthShiftAction
- set number of months to shift transactions matched by this rule.
-
setRemoveAction
void setRemoveAction(boolean removeAction)
- Parameters:
removeAction
- set remove actions.
-
setTextAction
void setTextAction(String textAction)
- Parameters:
textAction
- set text action.
-
setCommentAction
void setCommentAction(String commentAction)
- Parameters:
commentAction
- set comment action.
-
setCategoryIdAction
void setCategoryIdAction(long categoryIdAction)
- Parameters:
categoryIdAction
- set category ID action.
-
setSplitActions
void setSplitActions(List<MenigaTransactionRule.SplitAction> splitActions)
- Parameters:
splitActions
- set split action.
-
setFlagAction
void setFlagAction(Boolean flagAction)
- Parameters:
flagAction
- set flag action.
-
-
-
-