1
0
mirror of https://github.com/aclindsa/ofxgo.git synced 2024-10-30 05:20:05 -04:00

Make optional struct fields pointers

This allows encoding/xml to properly comparison against nil to see if
they should be marshalled if the 'xml' tag contains ",omitempty" and for
users to test against nil to see if a field was present in the parsed
OFX.

This commit also fixes up cmd/ofx to use the new pointers.
This commit is contained in:
Aaron Lindsay 2017-03-29 05:31:01 -04:00
parent 119c01f99b
commit 1d8ba5c19a
11 changed files with 130 additions and 150 deletions

View File

@ -9,8 +9,8 @@ type StatementRequest struct {
XMLName xml.Name `xml:"STMTTRNRQ"`
TrnUID UID `xml:"TRNUID"`
BankAcctFrom BankAcct `xml:"STMTRQ>BANKACCTFROM"`
DtStart Date `xml:"STMTRQ>INCTRAN>DTSTART,omitempty"`
DtEnd Date `xml:"STMTRQ>INCTRAN>DTEND,omitempty"`
DtStart *Date `xml:"STMTRQ>INCTRAN>DTSTART,omitempty"`
DtEnd *Date `xml:"STMTRQ>INCTRAN>DTEND,omitempty"`
Include Boolean `xml:"STMTRQ>INCTRAN>INCLUDE"` // Include transactions (instead of just balance)
IncludePending Boolean `xml:"STMTRQ>INCLUDEPENDING,omitempty"` // Include pending transactions
IncTranImg Boolean `xml:"STMTRQ>INCTRANIMG,omitempty"` // Include transaction images
@ -47,7 +47,7 @@ type ImageData struct {
ImageRefType String `xml:"IMAGEREFTYPE"` // One of OPAQUE, URL, FORMURL (see spec for more details on how to access images of each of these types)
// Only one of the next two should be valid at any given time
ImageDelay Int `xml:"IMAGEDELAY,omitempty"` // Number of calendar days from DTSERVER (for statement images) or DTPOSTED (for transaction image) the image will become available
DtImageAvail Date `xml:"DTIMAGEAVAIL,omitempty"` // Date image will become available
DtImageAvail *Date `xml:"DTIMAGEAVAIL,omitempty"` // Date image will become available
ImageTTL Int `xml:"IMAGETTL,omitempty"` // Number of days after image becomes available that it will remain available
CheckSup String `xml:"CHECKSUP,omitempty"` // What is contained in check images. One of FRONTONLY, BACKONLY, FRONTANDBACK
}
@ -56,8 +56,8 @@ type Transaction struct {
XMLName xml.Name `xml:"STMTTRN"`
TrnType String `xml:"TRNTYPE"` // One of CREDIT, DEBIT, INT (interest earned or paid. Note: Depends on signage of amount), DIV, FEE, SRVCHG (service charge), DEP (deposit), ATM (Note: Depends on signage of amount), POS (Note: Depends on signage of amount), XFER, CHECK, PAYMENT, CASH, DIRECTDEP, DIRECTDEBIT, REPEATPMT, OTHER
DtPosted Date `xml:"DTPOSTED"`
DtUser Date `xml:"DTUSER,omitempty"`
DtAvail Date `xml:"DTAVAIL,omitempty"`
DtUser *Date `xml:"DTUSER,omitempty"`
DtAvail *Date `xml:"DTAVAIL,omitempty"`
TrnAmt Amount `xml:"TRNAMT"`
FiTId String `xml:"FITID"`
CorrectFiTId String `xml:"CORRECTFITID,omitempty"` // Transaction Id that this transaction corrects, if present
@ -69,10 +69,10 @@ type Transaction struct {
PayeeId String `xml:"PAYEEID,omitempty"`
// Note: Servers should provide NAME or PAYEE, but not both
Name String `xml:"NAME,omitempty"`
Payee Payee `xml:"PAYEE,omitempty"`
Payee *Payee `xml:"PAYEE,omitempty"`
ExtdName String `xml:"EXTDNAME,omitempty"` // Extended name of payee or transaction description
BankAcctTo BankAcct `xml:"BANKACCTTO,omitempty"` // If the transfer was to a bank account we have the account information for
CCAcctTo CCAcct `xml:"CCACCTTO,omitempty"` // If the transfer was to a credit card account we have the account information for
BankAcctTo *BankAcct `xml:"BANKACCTTO,omitempty"` // If the transfer was to a bank account we have the account information for
CCAcctTo *CCAcct `xml:"CCACCTTO,omitempty"` // If the transfer was to a credit card account we have the account information for
Memo String `xml:"MEMO,omitempty"` // Extra information (not in NAME)
ImageData []ImageData `xml:"IMAGEDATA,omitempty"`
Currency String `xml:"CURRENCY,omitempty"` // If different from CURDEF in STMTTRS
@ -91,7 +91,7 @@ type PendingTransaction struct {
XMLName xml.Name `xml:"STMTTRN"`
TrnType String `xml:"TRNTYPE"` // One of CREDIT, DEBIT, INT (interest earned or paid. Note: Depends on signage of amount), DIV, FEE, SRVCHG (service charge), DEP (deposit), ATM (Note: Depends on signage of amount), POS (Note: Depends on signage of amount), XFER, CHECK, PAYMENT, CASH, DIRECTDEP, DIRECTDEBIT, REPEATPMT, HOLD, OTHER
DtTran Date `xml:"DTTRAN"`
DtExpire Date `xml:"DTEXPIRE,omitempty"` // only valid for TrnType==HOLD, the date the hold will expire
DtExpire *Date `xml:"DTEXPIRE,omitempty"` // only valid for TrnType==HOLD, the date the hold will expire
TrnAmt Amount `xml:"TRNAMT"`
RefNum String `xml:"REFNUM,omitempty"`
Name String `xml:"NAME,omitempty"`
@ -120,26 +120,26 @@ type Balance struct {
// NUMBER = number (value formatted as is)
BalType String `xml:"BALTYPE"`
Value Amount `xml:"VALUE"`
DtAsOf Date `xml:"DTASOF,omitempty"`
Currency Currency `xml:"CURRENCY,omitempty"` // if BALTYPE is DOLLAR
Value Amount `xml:"VALUE"`
DtAsOf *Date `xml:"DTASOF,omitempty"`
Currency *Currency `xml:"CURRENCY,omitempty"` // if BALTYPE is DOLLAR
}
type StatementResponse struct {
XMLName xml.Name `xml:"STMTTRNRS"`
TrnUID UID `xml:"TRNUID"`
CurDef String `xml:"STMTRS>CURDEF"`
BankAcctFrom BankAcct `xml:"STMTRS>BANKACCTFROM"`
BankTranList TransactionList `xml:"STMTRS>BANKTRANLIST,omitempty"`
BankTranListP PendingTransactionList `xml:"STMTRS>BANKTRANLISTP,omitempty"`
BalAmt Amount `xml:"STMTRS>LEDGERBAL>BALAMT"`
DtAsOf Date `xml:"STMTRS>LEDGERBAL>DTASOF"`
AvailBalAmt Amount `xml:"STMTRS>AVAILBAL>BALAMT,omitempty"`
AvailDtAsOf Date `xml:"STMTRS>AVAILBAL>DTASOF,omitempty"`
CashAdvBalAmt Amount `xml:"STMTRS>CASHADVBALAMT,omitempty"` // Only for CREDITLINE accounts, available balance for cash advances
IntRate Amount `xml:"STMTRS>INTRATE,omitempty"` // Current interest rate
BalList []Balance `xml:"STMTRS>BALLIST>BAL,omitempty"`
MktgInfo String `xml:"STMTRS>MKTGINFO,omitempty"` // Marketing information
XMLName xml.Name `xml:"STMTTRNRS"`
TrnUID UID `xml:"TRNUID"`
CurDef String `xml:"STMTRS>CURDEF"`
BankAcctFrom BankAcct `xml:"STMTRS>BANKACCTFROM"`
BankTranList *TransactionList `xml:"STMTRS>BANKTRANLIST,omitempty"`
BankTranListP *PendingTransactionList `xml:"STMTRS>BANKTRANLISTP,omitempty"`
BalAmt Amount `xml:"STMTRS>LEDGERBAL>BALAMT"`
DtAsOf Date `xml:"STMTRS>LEDGERBAL>DTASOF"`
AvailBalAmt *Amount `xml:"STMTRS>AVAILBAL>BALAMT,omitempty"`
AvailDtAsOf *Date `xml:"STMTRS>AVAILBAL>DTASOF,omitempty"`
CashAdvBalAmt *Amount `xml:"STMTRS>CASHADVBALAMT,omitempty"` // Only for CREDITLINE accounts, available balance for cash advances
IntRate *Amount `xml:"STMTRS>INTRATE,omitempty"` // Current interest rate
BalList []Balance `xml:"STMTRS>BALLIST>BAL,omitempty"`
MktgInfo String `xml:"STMTRS>MKTGINFO,omitempty"` // Marketing information
}
func (sr StatementResponse) Name() string {

View File

@ -6,7 +6,6 @@ import (
"github.com/aclindsa/ofxgo"
"io"
"os"
"time"
)
var downloadCommand = Command{
@ -54,8 +53,6 @@ func download() {
AcctId: ofxgo.String(acctId),
AcctType: ofxgo.String(acctType),
},
DtStart: ofxgo.Date(time.Now().AddDate(-1, 0, 0)),
DtEnd: ofxgo.Date(time.Now()),
Include: true,
}
query.Banking = append(query.Banking, &statementRequest)

View File

@ -5,7 +5,6 @@ import (
"fmt"
"github.com/aclindsa/ofxgo"
"os"
"time"
)
var bankTransactionsCommand = Command{
@ -39,8 +38,6 @@ func bankTransactions() {
AcctId: ofxgo.String(acctId),
AcctType: ofxgo.String(acctType),
},
DtStart: ofxgo.Date(time.Now().AddDate(-1, 0, 0)),
DtEnd: ofxgo.Date(time.Now()),
Include: true,
}
query.Banking = append(query.Banking, &statementRequest)
@ -82,7 +79,7 @@ func printTransaction(defCurrency ofxgo.String, tran *ofxgo.Transaction) {
var name string
if len(tran.Name) > 0 {
name = string(tran.Name)
} else {
} else if tran.Payee != nil {
name = string(tran.Payee.Name)
}

View File

@ -6,7 +6,6 @@ import (
"github.com/aclindsa/ofxgo"
"io"
"os"
"time"
)
var ccDownloadCommand = Command{
@ -48,8 +47,6 @@ func ccDownload() {
CCAcctFrom: ofxgo.CCAcct{
AcctId: ofxgo.String(acctId),
},
DtStart: ofxgo.Date(time.Now().AddDate(-1, 0, 0)),
DtEnd: ofxgo.Date(time.Now()),
Include: true,
}
query.CreditCards = append(query.CreditCards, &statementRequest)

View File

@ -5,7 +5,6 @@ import (
"fmt"
"github.com/aclindsa/ofxgo"
"os"
"time"
)
var ccTransactionsCommand = Command{
@ -35,8 +34,6 @@ func ccTransactions() {
CCAcctFrom: ofxgo.CCAcct{
AcctId: ofxgo.String(acctId),
},
DtStart: ofxgo.Date(time.Now().AddDate(-1, 0, 0)),
DtEnd: ofxgo.Date(time.Now()),
Include: true,
}
query.CreditCards = append(query.CreditCards, &statementRequest)

View File

@ -6,7 +6,6 @@ import (
"github.com/aclindsa/ofxgo"
"io"
"os"
"time"
)
var invDownloadCommand = Command{
@ -52,11 +51,8 @@ func invDownload() {
BrokerId: ofxgo.String(brokerId),
AcctId: ofxgo.String(acctId),
},
DtStart: ofxgo.Date(time.Now().AddDate(-1, 0, 0)), // a year ago
DtEnd: ofxgo.Date(time.Now().AddDate(0, 0, -1)), // Some FIs (*cough* Fidelity) return errors if DTEND is the current day
Include: true,
IncludeOO: true,
PosDtAsOf: ofxgo.Date(time.Now()),
IncludePos: true,
IncludeBalance: true,
Include401K: true,

View File

@ -6,7 +6,6 @@ import (
"github.com/aclindsa/ofxgo"
"math/big"
"os"
"time"
)
var invTransactionsCommand = Command{
@ -38,11 +37,8 @@ func invTransactions() {
BrokerId: ofxgo.String(brokerId),
AcctId: ofxgo.String(acctId),
},
DtStart: ofxgo.Date(time.Now().AddDate(-1, 0, 0)), // a year ago
DtEnd: ofxgo.Date(time.Now().AddDate(0, 0, -1)), // Some FIs (*cough* Fidelity) return errors if DTEND is the current day
Include: true,
IncludeOO: true,
PosDtAsOf: ofxgo.Date(time.Now()),
IncludePos: true,
IncludeBalance: true,
Include401K: true,
@ -99,9 +95,9 @@ func invTransactions() {
case ofxgo.Income:
printInvTran(&tran.InvTran)
currency := stmt.CurDef
if len(tran.Currency.CurSym) > 0 {
if tran.Currency != nil {
currency = tran.Currency.CurSym
} else if len(tran.OrigCurrency.CurSym) > 0 {
} else if tran.OrigCurrency != nil {
currency = tran.Currency.CurSym
}
fmt.Printf(" %s %s %s (%s %s)\n", tran.IncomeType, tran.Total, currency, tran.SecId.UniqueIdType, tran.SecId.UniqueId)
@ -109,9 +105,9 @@ func invTransactions() {
case ofxgo.InvExpense:
printInvTran(&tran.InvTran)
currency := stmt.CurDef
if len(tran.Currency.CurSym) > 0 {
if tran.Currency != nil {
currency = tran.Currency.CurSym
} else if len(tran.OrigCurrency.CurSym) > 0 {
} else if tran.OrigCurrency != nil {
currency = tran.Currency.CurSym
}
fmt.Printf(" %s %s (%s %s)\n", tran.Total, currency, tran.SecId.UniqueIdType, tran.SecId.UniqueId)
@ -126,18 +122,18 @@ func invTransactions() {
case ofxgo.MarginInterest:
printInvTran(&tran.InvTran)
currency := stmt.CurDef
if len(tran.Currency.CurSym) > 0 {
if tran.Currency != nil {
currency = tran.Currency.CurSym
} else if len(tran.OrigCurrency.CurSym) > 0 {
} else if tran.OrigCurrency != nil {
currency = tran.Currency.CurSym
}
fmt.Printf(" %s %s\n", tran.Total, currency)
case ofxgo.Reinvest:
printInvTran(&tran.InvTran)
currency := stmt.CurDef
if len(tran.Currency.CurSym) > 0 {
if tran.Currency != nil {
currency = tran.Currency.CurSym
} else if len(tran.OrigCurrency.CurSym) > 0 {
} else if tran.OrigCurrency != nil {
currency = tran.Currency.CurSym
}
fmt.Printf(" %s (%s %s)@%s %s (Total: %s)\n", tran.Units, tran.SecId.UniqueIdType, tran.SecId.UniqueId, tran.UnitPrice, currency, tran.Total)
@ -145,9 +141,9 @@ func invTransactions() {
case ofxgo.RetOfCap:
printInvTran(&tran.InvTran)
currency := stmt.CurDef
if len(tran.Currency.CurSym) > 0 {
if tran.Currency != nil {
currency = tran.Currency.CurSym
} else if len(tran.OrigCurrency.CurSym) > 0 {
} else if tran.OrigCurrency != nil {
currency = tran.Currency.CurSym
}
fmt.Printf(" %s %s (%s %s)\n", tran.Total, currency, tran.SecId.UniqueIdType, tran.SecId.UniqueId)
@ -165,9 +161,9 @@ func invTransactions() {
case ofxgo.Split:
printInvTran(&tran.InvTran)
currency := stmt.CurDef
if len(tran.Currency.CurSym) > 0 {
if tran.Currency != nil {
currency = tran.Currency.CurSym
} else if len(tran.OrigCurrency.CurSym) > 0 {
} else if tran.OrigCurrency != nil {
currency = tran.Currency.CurSym
}
fmt.Printf(" %d/%d %s -> %s shares of %s %s (%s %s for fractional shares)\n", tran.Numerator, tran.Denominator, tran.OldUnits, tran.NewUnits, tran.SecId.UniqueIdType, tran.SecId.UniqueId, tran.FracCash, currency)
@ -188,9 +184,9 @@ func printInvTran(it *ofxgo.InvTran) {
func printInvBuy(defCurrency ofxgo.String, ib *ofxgo.InvBuy) {
printInvTran(&ib.InvTran)
currency := defCurrency
if len(ib.Currency.CurSym) > 0 {
if ib.Currency != nil {
currency = ib.Currency.CurSym
} else if len(ib.OrigCurrency.CurSym) > 0 {
} else if ib.OrigCurrency != nil {
currency = ib.Currency.CurSym
}
@ -201,9 +197,9 @@ func printInvBuy(defCurrency ofxgo.String, ib *ofxgo.InvBuy) {
func printInvSell(defCurrency ofxgo.String, is *ofxgo.InvSell) {
printInvTran(&is.InvTran)
currency := defCurrency
if len(is.Currency.CurSym) > 0 {
if is.Currency != nil {
currency = is.Currency.CurSym
} else if len(is.OrigCurrency.CurSym) > 0 {
} else if is.OrigCurrency != nil {
currency = is.Currency.CurSym
}

View File

@ -9,8 +9,8 @@ type CCStatementRequest struct {
XMLName xml.Name `xml:"CCSTMTTRNRQ"`
TrnUID UID `xml:"TRNUID"`
CCAcctFrom CCAcct `xml:"CCSTMTRQ>CCACCTFROM"`
DtStart Date `xml:"CCSTMTRQ>INCTRAN>DTSTART,omitempty"`
DtEnd Date `xml:"CCSTMTRQ>INCTRAN>DTEND,omitempty"`
DtStart *Date `xml:"CCSTMTRQ>INCTRAN>DTSTART,omitempty"`
DtEnd *Date `xml:"CCSTMTRQ>INCTRAN>DTEND,omitempty"`
Include Boolean `xml:"CCSTMTRQ>INCTRAN>INCLUDE"` // Include transactions (instead of just balance)
IncludePending Boolean `xml:"CCSTMTRQ>INCLUDEPENDING,omitempty"` // Include pending transactions
IncTranImg Boolean `xml:"CCSTMTRQ>INCTRANIMG,omitempty"` // Include transaction images
@ -28,16 +28,16 @@ func (r *CCStatementRequest) Valid() (bool, error) {
}
type CCStatementResponse struct {
XMLName xml.Name `xml:"CCSTMTTRNRS"`
TrnUID UID `xml:"TRNUID"`
CurDef String `xml:"CCSTMTRS>CURDEF"`
CCAcctFrom CCAcct `xml:"CCSTMTRS>CCACCTFROM"`
BankTranList TransactionList `xml:"CCSTMTRS>BANKTRANLIST,omitempty"`
XMLName xml.Name `xml:"CCSTMTTRNRS"`
TrnUID UID `xml:"TRNUID"`
CurDef String `xml:"CCSTMTRS>CURDEF"`
CCAcctFrom CCAcct `xml:"CCSTMTRS>CCACCTFROM"`
BankTranList *TransactionList `xml:"CCSTMTRS>BANKTRANLIST,omitempty"`
//BANKTRANLISTP
BalAmt Amount `xml:"CCSTMTRS>LEDGERBAL>BALAMT"`
DtAsOf Date `xml:"CCSTMTRS>LEDGERBAL>DTASOF"`
AvailBalAmt Amount `xml:"CCSTMTRS>AVAILBAL>BALAMT,omitempty"`
AvailDtAsOf Date `xml:"CCSTMTRS>AVAILBAL>DTASOF,omitempty"`
AvailDtAsOf *Date `xml:"CCSTMTRS>AVAILBAL>DTASOF,omitempty"`
CashAdvBalAmt Amount `xml:"CCSTMTRS>CASHADVBALAMT,omitempty"` // Only for CREDITLINE accounts, available balance for cash advances
IntRatePurch Amount `xml:"CCSTMTRS>INTRATEPURCH,omitempty"` // Current interest rate for purchases
IntRateCash Amount `xml:"CCSTMTRS>INTRATECASH,omitempty"` // Current interest rate for cash advances

View File

@ -12,11 +12,11 @@ type InvStatementRequest struct {
TAN String `xml:"TAN,omitempty"` // Transaction authorization number
// TODO `xml:"OFXEXTENSION,omitempty"`
InvAcctFrom InvAcct `xml:"INVSTMTRQ>INVACCTFROM"`
DtStart Date `xml:"INVSTMTRQ>INCTRAN>DTSTART,omitempty"`
DtEnd Date `xml:"INVSTMTRQ>INCTRAN>DTEND,omitempty"`
DtStart *Date `xml:"INVSTMTRQ>INCTRAN>DTSTART,omitempty"`
DtEnd *Date `xml:"INVSTMTRQ>INCTRAN>DTEND,omitempty"`
Include Boolean `xml:"INVSTMTRQ>INCTRAN>INCLUDE"` // Include transactions (instead of just balance)
IncludeOO Boolean `xml:"INVSTMTRQ>INCOO"` // Include open orders
PosDtAsOf Date `xml:"INVSTMTRQ>INCPOS>DTASOF,omitempty"` // Date that positions should be sent down for, if present
PosDtAsOf *Date `xml:"INVSTMTRQ>INCPOS>DTASOF,omitempty"` // Date that positions should be sent down for, if present
IncludePos Boolean `xml:"INVSTMTRQ>INCPOS>INCLUDE"` // Include position data in response
IncludeBalance Boolean `xml:"INVSTMTRQ>INCBAL"` // Include investment balance in response
Include401K Boolean `xml:"INVSTMTRQ>INC401K,omitempty"` // Include 401k information
@ -40,7 +40,7 @@ type InvTran struct {
FiTId String `xml:"FITID"`
SrvrTId String `xml:"SRVRTID,omitempty"`
DtTrade Date `xml:"DTTRADE"` // trade date; for stock splits, day of record
DtSettle Date `xml:"DTSETTLE,omitempty"` // settlement date; for stock splits, execution date
DtSettle *Date `xml:"DTSETTLE,omitempty"` // settlement date; for stock splits, execution date
ReversalFiTId String `xml:"REVERSALFITID,omitempty"` // For a reversal transaction, the FITID of the transaction that is being reversed.
Memo String `xml:"MEMO,omitempty"`
}
@ -57,8 +57,8 @@ type InvBuy struct {
Fees Amount `xml:"FEES,omitempty"`
Load Amount `xml:"LOAD,omitempty"`
Total Amount `xml:"TOTAL"` // Transaction total. Buys, sells, etc.:((quan. * (price +/- markup/markdown)) +/-(commission + fees + load + taxes + penalty + withholding + statewithholding)). Distributions, interest, margin interest, misc. expense, etc.: amount. Return of cap: cost basis
Currency Currency `xml:"CURRENCY,omitempty"` // Overriding currency for UNITPRICE
OrigCurrency Currency `xml:"ORIGCURRENCY,omitempty"` // Overriding currency for UNITPRICE
Currency *Currency `xml:"CURRENCY,omitempty"` // Overriding currency for UNITPRICE
OrigCurrency *Currency `xml:"ORIGCURRENCY,omitempty"` // Overriding currency for UNITPRICE
SubAcctSec String `xml:"SUBACCTSEC"` // Sub-account type for this security. One of CASH, MARGIN, SHORT, OTHER
SubAcctFund String `xml:"SUBACCTFUND"` // Where did the money for the transaction come from or go to? CASH, MARGIN, SHORT, OTHER
@ -68,7 +68,7 @@ type InvBuy struct {
LoanInterest Amount `xml:"LOANINTEREST,omitempty"` // For 401(k) accounts only. Indicates how much of the loan repayment was interest
Inv401kSource String `xml:"INV401KSOURCE,omitempty"` // Source of money for this transaction. One of PRETAX, AFTERTAX, MATCH, PROFITSHARING, ROLLOVER, OTHERVEST, OTHERNONVEST for 401(k) accounts. Default if not present is OTHERNONVEST. The following cash source types are subject to vesting: MATCH, PROFITSHARING, and OTHERVEST
DtPayroll Date `xml:"DTPAYROLL,omitempty"` // For 401(k)accounts, date the funds for this transaction was obtained via payroll deduction
DtPayroll *Date `xml:"DTPAYROLL,omitempty"` // For 401(k)accounts, date the funds for this transaction was obtained via payroll deduction
PriorYearContrib Boolean `xml:"PRIORYEARCONTRIB,omitempty"` // For 401(k) accounts, indicates that this Buy was made with a prior year contribution
}
@ -87,8 +87,8 @@ type InvSell struct {
TaxExempt Boolean `xml:"TAXEXEMPT,omitempty"` // Tax-exempt transaction
Total Amount `xml:"TOTAL"` // Transaction total. Buys, sells, etc.:((quan. * (price +/- markup/markdown)) +/-(commission + fees + load + taxes + penalty + withholding + statewithholding)). Distributions, interest, margin interest, misc. expense, etc.: amount. Return of cap: cost basis
Gain Amount `xml:"GAIN,omitempty"` // Total gain
Currency Currency `xml:"CURRENCY,omitempty"` // Overriding currency for UNITPRICE
OrigCurrency Currency `xml:"ORIGCURRENCY,omitempty"` // Overriding currency for UNITPRICE
Currency *Currency `xml:"CURRENCY,omitempty"` // Overriding currency for UNITPRICE
OrigCurrency *Currency `xml:"ORIGCURRENCY,omitempty"` // Overriding currency for UNITPRICE
SubAcctSec String `xml:"SUBACCTSEC"` // Sub-account type for this security. One of CASH, MARGIN, SHORT, OTHER
SubAcctFund String `xml:"SUBACCTFUND"` // Where did the money for the transaction come from or go to? CASH, MARGIN, SHORT, OTHER
@ -177,8 +177,8 @@ type Income struct {
SubAcctFund String `xml:"SUBACCTFUND"` // Where did the money for the transaction come from or go to? CASH, MARGIN, SHORT, OTHER
TaxExempt Boolean `xml:"TAXEXEMPT,omitempty"` // Tax-exempt transaction
Witholding Amount `xml:"WITHHOLDING,omitempty"` // Federal tax witholdings
Currency Currency `xml:"CURRENCY,omitempty"` // Overriding currency for UNITPRICE
OrigCurrency Currency `xml:"ORIGCURRENCY,omitempty"` // Overriding currency for UNITPRICE
Currency *Currency `xml:"CURRENCY,omitempty"` // Overriding currency for UNITPRICE
OrigCurrency *Currency `xml:"ORIGCURRENCY,omitempty"` // Overriding currency for UNITPRICE
Inv401kSource String `xml:"INV401KSOURCE,omitempty"` // Source of money for this transaction. One of PRETAX, AFTERTAX, MATCH, PROFITSHARING, ROLLOVER, OTHERVEST, OTHERNONVEST for 401(k) accounts. Default if not present is OTHERNONVEST. The following cash source types are subject to vesting: MATCH, PROFITSHARING, and OTHERVEST
}
@ -194,8 +194,8 @@ type InvExpense struct {
Total Amount `xml:"TOTAL"`
SubAcctSec String `xml:"SUBACCTSEC"` // Sub-account type for this security. One of CASH, MARGIN, SHORT, OTHER
SubAcctFund String `xml:"SUBACCTFUND"` // Where did the money for the transaction come from or go to? CASH, MARGIN, SHORT, OTHER
Currency Currency `xml:"CURRENCY,omitempty"` // Overriding currency for UNITPRICE
OrigCurrency Currency `xml:"ORIGCURRENCY,omitempty"` // Overriding currency for UNITPRICE
Currency *Currency `xml:"CURRENCY,omitempty"` // Overriding currency for UNITPRICE
OrigCurrency *Currency `xml:"ORIGCURRENCY,omitempty"` // Overriding currency for UNITPRICE
Inv401kSource String `xml:"INV401KSOURCE,omitempty"` // Source of money for this transaction. One of PRETAX, AFTERTAX, MATCH, PROFITSHARING, ROLLOVER, OTHERVEST, OTHERNONVEST for 401(k) accounts. Default if not present is OTHERNONVEST. The following cash source types are subject to vesting: MATCH, PROFITSHARING, and OTHERVEST
}
@ -231,12 +231,12 @@ func (t JrnlSec) TransactionType() string {
}
type MarginInterest struct {
XMLName xml.Name `xml:"MARGININTEREST"`
InvTran InvTran `xml:"INVTRAN"`
Total Amount `xml:"TOTAL"`
SubAcctFund String `xml:"SUBACCTFUND"` // Where did the money for the transaction come from or go to? CASH, MARGIN, SHORT, OTHER
Currency Currency `xml:"CURRENCY,omitempty"` // Overriding currency for UNITPRICE
OrigCurrency Currency `xml:"ORIGCURRENCY,omitempty"` // Overriding currency for UNITPRICE
XMLName xml.Name `xml:"MARGININTEREST"`
InvTran InvTran `xml:"INVTRAN"`
Total Amount `xml:"TOTAL"`
SubAcctFund String `xml:"SUBACCTFUND"` // Where did the money for the transaction come from or go to? CASH, MARGIN, SHORT, OTHER
Currency *Currency `xml:"CURRENCY,omitempty"` // Overriding currency for UNITPRICE
OrigCurrency *Currency `xml:"ORIGCURRENCY,omitempty"` // Overriding currency for UNITPRICE
}
func (t MarginInterest) TransactionType() string {
@ -258,8 +258,8 @@ type Reinvest struct {
Fees Amount `xml:"FEES,omitempty"`
Load Amount `xml:"LOAD,omitempty"`
TaxExempt Boolean `xml:"TAXEXEMPT,omitempty"` // Tax-exempt transaction
Currency Currency `xml:"CURRENCY,omitempty"` // Overriding currency for UNITPRICE
OrigCurrency Currency `xml:"ORIGCURRENCY,omitempty"` // Overriding currency for UNITPRICE
Currency *Currency `xml:"CURRENCY,omitempty"` // Overriding currency for UNITPRICE
OrigCurrency *Currency `xml:"ORIGCURRENCY,omitempty"` // Overriding currency for UNITPRICE
Inv401kSource String `xml:"INV401KSOURCE,omitempty"` // Source of money for this transaction. One of PRETAX, AFTERTAX, MATCH, PROFITSHARING, ROLLOVER, OTHERVEST, OTHERNONVEST for 401(k) accounts. Default if not present is OTHERNONVEST. The following cash source types are subject to vesting: MATCH, PROFITSHARING, and OTHERVEST
}
@ -274,8 +274,8 @@ type RetOfCap struct {
Total Amount `xml:"TOTAL"`
SubAcctSec String `xml:"SUBACCTSEC"` // Sub-account type for this security. One of CASH, MARGIN, SHORT, OTHER
SubAcctFund String `xml:"SUBACCTFUND"` // Where did the money for the transaction come from or go to? CASH, MARGIN, SHORT, OTHER
Currency Currency `xml:"CURRENCY,omitempty"` // Overriding currency for UNITPRICE
OrigCurrency Currency `xml:"ORIGCURRENCY,omitempty"` // Overriding currency for UNITPRICE
Currency *Currency `xml:"CURRENCY,omitempty"` // Overriding currency for UNITPRICE
OrigCurrency *Currency `xml:"ORIGCURRENCY,omitempty"` // Overriding currency for UNITPRICE
Inv401kSource String `xml:"INV401KSOURCE,omitempty"` // Source of money for this transaction. One of PRETAX, AFTERTAX, MATCH, PROFITSHARING, ROLLOVER, OTHERVEST, OTHERNONVEST for 401(k) accounts. Default if not present is OTHERNONVEST. The following cash source types are subject to vesting: MATCH, PROFITSHARING, and OTHERVEST
}
@ -348,8 +348,8 @@ type Split struct {
NewUnits Amount `xml:"NEWUNITS"` // number of shares after the split
Numerator Int `xml:"NUMERATOR"` // split ratio numerator
Denominator Int `xml:"DENOMINATOR"` // split ratio denominator
Currency Currency `xml:"CURRENCY,omitempty"` // Overriding currency for UNITPRICE
OrigCurrency Currency `xml:"ORIGCURRENCY,omitempty"` // Overriding currency for UNITPRICE
Currency *Currency `xml:"CURRENCY,omitempty"` // Overriding currency for UNITPRICE
OrigCurrency *Currency `xml:"ORIGCURRENCY,omitempty"` // Overriding currency for UNITPRICE
FracCash Amount `xml:"FRACCASH,omitempty"` // cash for fractional units
SubAcctFund String `xml:"SUBACCTFUND,omitempty"` // Where did the money for the transaction come from or go to? CASH, MARGIN, SHORT, OTHER
Inv401kSource String `xml:"INV401KSOURCE,omitempty"` // Source of money for this transaction. One of PRETAX, AFTERTAX, MATCH, PROFITSHARING, ROLLOVER, OTHERVEST, OTHERNONVEST for 401(k) accounts. Default if not present is OTHERNONVEST. The following cash source types are subject to vesting: MATCH, PROFITSHARING, and OTHERVEST
@ -370,7 +370,7 @@ type Transfer struct {
InvAcctFrom InvAcct `xml:"INVACCTFROM,omitempty"`
AvgCostBasis Amount `xml:"AVGCOSTBASIS,omitempty"`
UnitPrice Amount `xml:"UNITPRICE,omitempty"` // For stocks, MFs, other, price per share. Bonds = percentage of par. Option = premium per share of underlying security
DtPurchase Date `xml:"DTPURCHASE,omitempty"`
DtPurchase *Date `xml:"DTPURCHASE,omitempty"`
Inv401kSource String `xml:"INV401KSOURCE,omitempty"` // Source of money for this transaction. One of PRETAX, AFTERTAX, MATCH, PROFITSHARING, ROLLOVER, OTHERVEST, OTHERNONVEST for 401(k) accounts. Default if not present is OTHERNONVEST. The following cash source types are subject to vesting: MATCH, PROFITSHARING, and OTHERVEST
}
@ -564,7 +564,7 @@ type InvPosition struct {
MktVal Amount `xml:"MKTVAL"` // Market value of this position
AvgCostBasis Amount `xml:"AVGCOSTBASIS,omitempty"` //
DtPriceAsOf Date `xml:"DTPRICEASOF"` // Date and time of unit price and market value, and cost basis. If this date is unknown, use 19900101 as the placeholder; do not use 0,
Currency Currency `xml:"CURRENCY,omitempty"` // Overriding currency for UNITPRICE
Currency *Currency `xml:"CURRENCY,omitempty"` // Overriding currency for UNITPRICE
Memo String `xml:"MEMO,omitempty"`
Inv401kSource String `xml:"INV401KSOURCE,omitempty"` // One of PRETAX, AFTERTAX, MATCH, PROFITSHARING, ROLLOVER, OTHERVEST, OTHERNONVEST for 401(k) accounts. Default if not present is OTHERNONVEST. The following cash source types are subject to vesting: MATCH, PROFITSHARING, and OTHERVEST
}
@ -707,7 +707,7 @@ type ContribSecurity struct {
type VestInfo struct {
XMLName xml.Name `xml:"VESTINFO"`
VestDate Date `xml:"VESTDATE,omitempty"` // Date at which vesting percentage changes. Default (if empty) is that the vesting percentage below applies to the current date
VestDate *Date `xml:"VESTDATE,omitempty"` // Date at which vesting percentage changes. Default (if empty) is that the vesting percentage below applies to the current date
VestPct Amount `xml:"VESTPCT"`
}
@ -716,18 +716,18 @@ type LoanInfo struct {
LoanID String `xml:"LOANID"` // Identifier of this loan
LoanDesc String `xml:"LOANDESC,omitempty"` // Loan description
InitialLoanBal Amount `xml:"INITIALLOANBAL,omitempty"` // Initial loan balance
LoanStartDate Date `xml:"LOANSTARTDATE,omitempty"` // Start date of loan
LoanStartDate *Date `xml:"LOANSTARTDATE,omitempty"` // Start date of loan
CurrentLoanBal Amount `xml:"CURRENTLOANBAL"` // Current loan principal balance
DtAsOf Date `xml:"DTASOF"` // Date and time of the current loan balance
DtAsOf *Date `xml:"DTASOF"` // Date and time of the current loan balance
LoanRate Amount `xml:"LOANRATE,omitempty"` // Loan annual interest rate
LoanPmtAmt Amount `xml:"LOANPMTAMT,omitempty"` // Loan payment amount
LoanPmtFreq String `xml:"LOANPMTFREQ,omitempty"` // Frequency of loan repayments: WEEKLY, BIWEEKLY, TWICEMONTHLY, MONTHLY, FOURWEEKS, BIMONTHLY, QUARTERLY, SEMIANNUALLY, ANNUALLY, OTHER. See section 10.2.1 for calculation rules.
LoanPmtsInitial Int `xml:"LOANPMTSINITIAL,omitempty"` // Initial number of loan payments.
LoanPmtsRemaining Int `xml:"LOANPMTSREMAINING,omitempty"` // Remaining number of loan payments
LoanMaturityDate Date `xml:"LOANMATURITYDATE,omitempty"` // Expected loan end date
LoanMaturityDate *Date `xml:"LOANMATURITYDATE,omitempty"` // Expected loan end date
LoanTotalProjInterest Amount `xml:"LOANTOTALPROJINTEREST,omitempty"` // Total projected interest to be paid on this loan
LoanInterestToDate Amount `xml:"LOANINTERESTTODATE,omitempty"` // Total interested paid to date on this loan
LoanExtPmtDate Date `xml:"LOANNEXTPMTDATE,omitempty"` // Next payment due date
LoanExtPmtDate *Date `xml:"LOANNEXTPMTDATE,omitempty"` // Next payment due date
}
type Inv401KSummaryAggregate struct {
@ -743,38 +743,38 @@ type Inv401KSummaryAggregate struct {
}
type Inv401KSummaryPeriod struct {
XMLName xml.Name // One of YEARTODATE, INCEPTODATE, or PERIODTODATE
DtStart Date `xml:"DTSTART"`
DtEnd Date `xml:"DTEND"`
Contributions Inv401KSummaryAggregate `xml:"CONTRIBUTIONS,omitempty"` // 401(k) contribution aggregate. Note: this includes loan payments.
Withdrawls Inv401KSummaryAggregate `xml:"WITHDRAWLS,omitempty"` // 401(k) withdrawals aggregate. Note: this includes loan withdrawals.
Earnings Inv401KSummaryAggregate `xml:"EARNINGS,omitempty"` // 401(k) earnings aggregate. This is the market value change. It includes dividends/interest, and capital gains - realized and unrealized.
XMLName xml.Name // One of YEARTODATE, INCEPTODATE, or PERIODTODATE
DtStart Date `xml:"DTSTART"`
DtEnd Date `xml:"DTEND"`
Contributions *Inv401KSummaryAggregate `xml:"CONTRIBUTIONS,omitempty"` // 401(k) contribution aggregate. Note: this includes loan payments.
Withdrawls *Inv401KSummaryAggregate `xml:"WITHDRAWLS,omitempty"` // 401(k) withdrawals aggregate. Note: this includes loan withdrawals.
Earnings *Inv401KSummaryAggregate `xml:"EARNINGS,omitempty"` // 401(k) earnings aggregate. This is the market value change. It includes dividends/interest, and capital gains - realized and unrealized.
}
type Inv401K struct {
XMLName xml.Name `xml:"INV401K"`
EmployerName String `xml:"EMPLOYERNAME"`
PlanID String `xml:"PLANID,omitempty"` // Plan number
PlanJoinDate Date `xml:"PLANJOINDATE,omitempty"` // Date the employee joined the plan
PlanJoinDate *Date `xml:"PLANJOINDATE,omitempty"` // Date the employee joined the plan
EmployerContactInfo String `xml:"EMPLOYERCONTACTINFO,omitempty"` // Name of contact person at employer, plus any available contact information, such as phone number
BrokerContactInfo String `xml:"BROKERCONTACTINFO,omitempty"` // Name of contact person at broker, plus any available contact information, such as phone number
DeferPctPreTax Amount `xml:"DEFERPCTPRETAX,omitempty"` // Percent of employee salary deferred before tax
DeferPctAfterTax Amount `xml:"DEFERPCTAFTERTAX,omitempty"` // Percent of employee salary deferred after tax
//<MATCHINFO> Aggregate containing employer match information. Absent if employer does not contribute matching funds.
MatchPct Amount `xml:"MATCHINFO>MATCHPCT,omitempty"` // Percent of employee contribution matched, e.g., 75% if contribution rate is $0.75/$1.00
MaxMatchAmt Amount `xml:"MATCHINFO>MAXMATCHAMT,omitempty"` // Maximum employer contribution amount in any year
MaxMatchPct Amount `xml:"MATCHINFO>MAXMATCHPCT,omitempty"` // Current maximum employer contribution percentage. Maximum match in a year is MAXMATCHPCT up to the MAXMATCHAMT, if provided
StartOfYear Date `xml:"MATCHINFO>STARTOFYEAR,omitempty"` // Specifies when the employer contribution max is reset. Some plans have a maximum based on the company fiscal year rather than calendar year. Assume calendar year if omitted. Only the month and day (MMDD) are used; year (YYYY) and time are ignored
BaseMatchAmt Amount `xml:"MATCHINFO>BASEMATCHAMT"` // Specifies a fixed dollar amount contributed by the employer if the employee participates in the plan at all. This may be present in addition to the <MATCHPCT>. $0 if omitted
BaseMatchPct Amount `xml:"MATCHINFO>BASEMATCHPCT"` // Specifies a fixed percent of employee salary matched if the employee participates in the plan at all. This may be present in addition to the MATCHPCT>. 0% if omitted. Base match in a year is BASEMATCHPCT up to the BASEMATCHAMT,if provided
ContribInfo []ContribSecurity `xml:"CONTRIBINTO>CONTRIBSECURITY"` // Aggregate to describe how new contributions are distributed among the available securities.
CurrentVestPct Amount `xml:"CURRENTVESTPCT,omitempty"` // Estimated percentage of employer contributions vested as of the current date. If omitted, assume 100%
VestInfo []VestInfo `xml:"VESTINFO,omitempty"` // Vest change dates. Provides the vesting percentage as of any particular past, current, or future date. 0 or more.
LoanInfo []LoanInfo `xml:"LOANINFO,omitempty"` // List of any loans outstanding against this account
YearToDateSummary Inv401KSummaryPeriod `xml:"INV401KSUMMARY>YEARTODATE"` // Contributions to date for this calendar year.
InceptToDateSummary Inv401KSummaryPeriod `xml:"INV401KSUMMARY>INCEPTODATE,omitempty"` // Total contributions to date (since inception)
PeriodToDate Inv401KSummaryPeriod `xml:"INV401KSUMMARY>PERIODTODATE,omitempty"` // Total contributions this contribution period
MatchPct Amount `xml:"MATCHINFO>MATCHPCT,omitempty"` // Percent of employee contribution matched, e.g., 75% if contribution rate is $0.75/$1.00
MaxMatchAmt Amount `xml:"MATCHINFO>MAXMATCHAMT,omitempty"` // Maximum employer contribution amount in any year
MaxMatchPct Amount `xml:"MATCHINFO>MAXMATCHPCT,omitempty"` // Current maximum employer contribution percentage. Maximum match in a year is MAXMATCHPCT up to the MAXMATCHAMT, if provided
StartOfYear *Date `xml:"MATCHINFO>STARTOFYEAR,omitempty"` // Specifies when the employer contribution max is reset. Some plans have a maximum based on the company fiscal year rather than calendar year. Assume calendar year if omitted. Only the month and day (MMDD) are used; year (YYYY) and time are ignored
BaseMatchAmt Amount `xml:"MATCHINFO>BASEMATCHAMT"` // Specifies a fixed dollar amount contributed by the employer if the employee participates in the plan at all. This may be present in addition to the <MATCHPCT>. $0 if omitted
BaseMatchPct Amount `xml:"MATCHINFO>BASEMATCHPCT"` // Specifies a fixed percent of employee salary matched if the employee participates in the plan at all. This may be present in addition to the MATCHPCT>. 0% if omitted. Base match in a year is BASEMATCHPCT up to the BASEMATCHAMT,if provided
ContribInfo []ContribSecurity `xml:"CONTRIBINTO>CONTRIBSECURITY"` // Aggregate to describe how new contributions are distributed among the available securities.
CurrentVestPct Amount `xml:"CURRENTVESTPCT,omitempty"` // Estimated percentage of employer contributions vested as of the current date. If omitted, assume 100%
VestInfo []VestInfo `xml:"VESTINFO,omitempty"` // Vest change dates. Provides the vesting percentage as of any particular past, current, or future date. 0 or more.
LoanInfo []LoanInfo `xml:"LOANINFO,omitempty"` // List of any loans outstanding against this account
YearToDateSummary Inv401KSummaryPeriod `xml:"INV401KSUMMARY>YEARTODATE"` // Contributions to date for this calendar year.
InceptToDateSummary *Inv401KSummaryPeriod `xml:"INV401KSUMMARY>INCEPTODATE,omitempty"` // Total contributions to date (since inception)
PeriodToDate *Inv401KSummaryPeriod `xml:"INV401KSUMMARY>PERIODTODATE,omitempty"` // Total contributions this contribution period
}
type Inv401KBal struct {
@ -800,13 +800,13 @@ type InvStatementResponse struct {
DtAsOf Date `xml:"INVSTMTRS>DTASOF"`
CurDef String `xml:"INVSTMTRS>CURDEF"`
InvAcctFrom InvAcct `xml:"INVSTMTRS>INVACCTFROM"`
InvTranList InvTranList `xml:"INVSTMTRS>INVTRANLIST,omitempty"`
InvTranList *InvTranList `xml:"INVSTMTRS>INVTRANLIST,omitempty"`
InvPosList PositionList `xml:"INVSTMTRS>INVPOSLIST,omitempty"`
InvBal InvBalance `xml:"INVSTMTRS>INVBAL,omitempty"`
InvBal *InvBalance `xml:"INVSTMTRS>INVBAL,omitempty"`
// TODO INVOOLIST
MktgInfo String `xml:"INVSTMTRS>MKTGINFO,omitempty"` // Marketing information
Inv401K Inv401K `xml:"INVSTMTRS>INV401K,omitempty"`
Inv401KBal Inv401KBal `xml:"INVSTMTRS>INV401KBAL,omitempty"`
MktgInfo String `xml:"INVSTMTRS>MKTGINFO,omitempty"` // Marketing information
Inv401K *Inv401K `xml:"INVSTMTRS>INV401K,omitempty"`
Inv401KBal *Inv401KBal `xml:"INVSTMTRS>INV401KBAL,omitempty"`
}
func (sr InvStatementResponse) Name() string {

View File

@ -14,9 +14,9 @@ type SecurityId struct {
type SecurityRequest struct {
XMLName xml.Name `xml:"SECRQ"`
// Only one of the next three should be present
SecId SecurityId `xml:"SECID,omitempty"`
Ticker String `xml:"TICKER,omitempty"`
FiId String `xml:"FIID,omitempty"`
SecId *SecurityId `xml:"SECID,omitempty"`
Ticker String `xml:"TICKER,omitempty"`
FiId String `xml:"FIID,omitempty"`
}
type SecListRequest struct {
@ -69,8 +69,8 @@ type SecInfo struct {
FiId String `xml:"FIID,omitempty"`
Rating String `xml:"RATING,omitempty"`
UnitPrice Amount `xml:"UNITPRICE,omitempty"` // Current price, as of DTASOF
DtAsOf Date `xml:"DTASOF,omitempty"` // Date UNITPRICE was for
Currency Currency `xml:"CURRENCY,omitempty"` // Overriding currency for UNITPRICE
DtAsOf *Date `xml:"DTASOF,omitempty"` // Date UNITPRICE was for
Currency *Currency `xml:"CURRENCY,omitempty"` // Overriding currency for UNITPRICE
Memo String `xml:"MEMO,omitempty"`
}
@ -81,14 +81,14 @@ type DebtInfo struct {
DebtType String `xml:"DEBTTYPE"` // One of COUPON, ZERO (zero coupon)
DebtClass String `xml:"DEBTCLASS,omitempty"` // One of TREASURY, MUNICIPAL, CORPORATE, OTHER
CouponRate Amount `xml:"COUPONRT,omitempty"` // Bond coupon rate for next closest call date
DtCoupon Date `xml:"DTCOUPON,omitempty"` // Maturity date for next coupon
DtCoupon *Date `xml:"DTCOUPON,omitempty"` // Maturity date for next coupon
CouponFreq String `xml:"COUPONFREQ,omitempty"` // When coupons mature - one of MONTHLY, QUARTERLY, SEMIANNUAL, ANNUAL, or OTHER
CallPrice Amount `xml:"CALLPRICE,omitempty"` // Bond call price
YieldToCall Amount `xml:"YIELDTOCALL,omitempty"` // Yield to next call
DtCall Date `xml:"DTCALL,omitempty"` // Next call date
DtCall *Date `xml:"DTCALL,omitempty"` // Next call date
CallType String `xml:"CALLTYPE,omitempt"` // Type of next call. One of CALL, PUT, PREFUND, MATURITY
YieldToMat Amount `xml:"YIELDTOMAT,omitempty"` // Yield to maturity
DtMat Date `xml:"DTMAT,omitempty"` // Debt maturity date
DtMat *Date `xml:"DTMAT,omitempty"` // Debt maturity date
AssetClass String `xml:"ASSETCLASS,omitempty"` // One of DOMESTICBOND, INTLBOND, LARGESTOCK, SMALLSTOCK, INTLSTOCK, MONEYMRKT, OTHER
FiAssetClass String `xml:"FIASSETCLASS,omitempty"` // FI-defined asset class
}
@ -114,7 +114,7 @@ type MFInfo struct {
SecInfo SecInfo `xml:"SECINFO"`
MfType String `xml:"MFTYPE"` // One of OPEN, END, CLOSEEND, OTHER
Yield Amount `xml:"YIELD,omitempty"` // Current yield reported as the dividend expressed as a portion of the current stock price
DtYieldAsOf Date `xml:"DTYIELDASOF,omitempty"` // Date YIELD is valid for
DtYieldAsOf *Date `xml:"DTYIELDASOF,omitempty"` // Date YIELD is valid for
AssetClasses []AssetPortion `xml:"MFASSETCLASS>PORTION"`
FiAssetClasses []FiAssetPortion `xml:"FIMFASSETCLASS>FIPORTION"`
}
@ -124,15 +124,15 @@ func (i MFInfo) SecurityType() string {
}
type OptInfo struct {
XMLName xml.Name `xml:"OPTINFO"`
SecInfo SecInfo `xml:"SECINFO"`
OptType String `xml:"OPTTYPE"` // One of PUT, CALL
StrikePrice Amount `xml:"STRIKEPRICE"`
DtExpire Date `xml:"DTEXPIRE"` // Expiration date
ShPerCtrct Int `xml:"SHPERCTRCT"` // Shares per contract
SecId SecurityId `xml:"SECID,omitempty"` // Security ID of the underlying security
AssetClass String `xml:"ASSETCLASS,omitempty"` // One of DOMESTICBOND, INTLBOND, LARGESTOCK, SMALLSTOCK, INTLSTOCK, MONEYMRKT, OTHER
FiAssetClass String `xml:"FIASSETCLASS,omitempty"` // FI-defined asset class
XMLName xml.Name `xml:"OPTINFO"`
SecInfo SecInfo `xml:"SECINFO"`
OptType String `xml:"OPTTYPE"` // One of PUT, CALL
StrikePrice Amount `xml:"STRIKEPRICE"`
DtExpire Date `xml:"DTEXPIRE"` // Expiration date
ShPerCtrct Int `xml:"SHPERCTRCT"` // Shares per contract
SecId *SecurityId `xml:"SECID,omitempty"` // Security ID of the underlying security
AssetClass String `xml:"ASSETCLASS,omitempty"` // One of DOMESTICBOND, INTLBOND, LARGESTOCK, SMALLSTOCK, INTLSTOCK, MONEYMRKT, OTHER
FiAssetClass String `xml:"FIASSETCLASS,omitempty"` // FI-defined asset class
}
func (i OptInfo) SecurityType() string {
@ -156,7 +156,7 @@ type StockInfo struct {
SecInfo SecInfo `xml:"SECINFO"`
StockType String `xml:"STOCKTYPE,omitempty"` // One of COMMON, PREFERRED, CONVERTIBLE, OTHER
Yield Amount `xml:"YIELD,omitempty"` // Current yield reported as the dividend expressed as a portion of the current stock price
DtYieldAsOf Date `xml:"DTYIELDASOF,omitempty"` // Date YIELD is valid for
DtYieldAsOf *Date `xml:"DTYIELDASOF,omitempty"` // Date YIELD is valid for
AssetClass String `xml:"ASSETCLASS,omitempty"` // One of DOMESTICBOND, INTLBOND, LARGESTOCK, SMALLSTOCK, INTLSTOCK, MONEYMRKT, OTHER
FiAssetClass String `xml:"FIASSETCLASS,omitempty"` // FI-defined asset class
}

View File

@ -60,10 +60,10 @@ type SignonResponse struct {
Status Status `xml:"STATUS"`
DtServer Date `xml:"DTSERVER"`
UserKey String `xml:"USERKEY,omitempty"`
TsKeyExpire Date `xml:"TSKEYEXPIRE,omitempty"`
TsKeyExpire *Date `xml:"TSKEYEXPIRE,omitempty"`
Language String `xml:"LANGUAGE"`
DtProfUp Date `xml:"DTPROFUP,omitempty"`
DtAcctUp Date `xml:"DTACCTUP,omitempty"`
DtProfUp *Date `xml:"DTPROFUP,omitempty"`
DtAcctUp *Date `xml:"DTACCTUP,omitempty"`
Org String `xml:"FI>ORG"`
Fid String `xml:"FI>FID"`
SessCookie String `xml:"SESSCOOKIE,omitempty"`