Skip to content

Commit

Permalink
stoicflame#64 - support for <INV401KSOURCE> for buy transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
maor11 committed Mar 21, 2022
1 parent dded748 commit e7ebcac
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package com.webcohesion.ofx4j.domain.data.investment.transactions;

import com.webcohesion.ofx4j.domain.data.investment.accounts.SubAccountType;
import com.webcohesion.ofx4j.domain.data.investment.positions.Inv401KSource;
import com.webcohesion.ofx4j.domain.data.seclist.SecurityId;
import com.webcohesion.ofx4j.meta.ChildAggregate;

Expand Down Expand Up @@ -256,4 +257,25 @@ public Double getLoanInterest() {
public Double getLoanPrincipal() {
return getBuyInvestment().getLoanPrincipal();
}

/**
* Gets the 401K source for the sale. Should be one of "PRETAX", "AFTERTAX", "MATCH",
* "PROFITSHARING", "ROLLOVER", "OTHERVEST", "OTHERNONVEST". This is an optional field
* according to the OFX spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @return the 401k source
*/
public String get401kSource() {
return getBuyInvestment().get401kSource();
}

/**
* Gets the 401k source as one of the well-known types.
*
* @return the 401k source or null if its not one of the well-known types
*/
public Inv401KSource get401kSourceEnum() {
return Inv401KSource.fromOfx(get401kSource());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package com.webcohesion.ofx4j.domain.data.investment.transactions;

import com.webcohesion.ofx4j.domain.data.investment.accounts.SubAccountType;
import com.webcohesion.ofx4j.domain.data.investment.positions.Inv401KSource;
import com.webcohesion.ofx4j.domain.data.seclist.SecurityId;
import com.webcohesion.ofx4j.meta.Aggregate;
import com.webcohesion.ofx4j.meta.ChildAggregate;
Expand Down Expand Up @@ -48,6 +49,7 @@ public class BuyInvestmentTransaction {
private String loanId;
private Double loanInterest;
private Double loanPrincipal;
private String inv401kSource;

/**
* Gets the investment transaction child aggregate.
Expand Down Expand Up @@ -447,4 +449,38 @@ public Double getLoanPrincipal() {
public void setLoanPrincipal(Double loanPrincipal) {
this.loanPrincipal = loanPrincipal;
}

/**
* Gets the 401K source for the buy. Should be one of "PRETAX", "AFTERTAX", "MATCH",
* "PROFITSHARING", "ROLLOVER", "OTHERVEST", "OTHERNONVEST". This is an optional field
* according to the OFX spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @return the 401k source
*/
@Element( name = "INV401KSOURCE", order = 180)
public String get401kSource() {
return inv401kSource;
}

/**
* Sets the 401K source for the buy. Should be one of "PRETAX", "AFTERTAX", "MATCH",
* "PROFITSHARING", "ROLLOVER", "OTHERVEST", "OTHERNONVEST". This is an optional field
* according to the OFX spec.
* @see "Section 13.9.2.4.3, OFX Spec"
*
* @param inv401kSource the 401k source
*/
public void set401kSource(String inv401kSource) {
this.inv401kSource = inv401kSource;
}

/**
* Gets the 401k source as one of the well-known types.
*
* @return the 401k source or null if its not one of the well-known types
*/
public Inv401KSource get401kSourceEnum() {
return Inv401KSource.fromOfx(get401kSource());
}
}

0 comments on commit e7ebcac

Please sign in to comment.