func (addenda02 *Addenda02) ReferenceInformationTwoField() string {
	return addenda02.alphaField(addenda02.ReferenceInformationOne, 3)
}
ReferenceInformationTwoField returns a space padded ReferenceInformationTwo string
package ach
import (
	"strings"
	"unicode/utf8"
)
type Addenda02 struct {
	ID string `json:"id"`
	recordType string
	TypeCode string `json:"typeCode"`
	ReferenceInformationOne string `json:"referenceInformationOne,omitempty"`
	ReferenceInformationTwo string `json:"referenceInformationTwo,omitempty"`
	TerminalIdentificationCode string `json:"terminalIdentificationCode"`
	TransactionSerialNumber string `json:"transactionSerialNumber"`
	TransactionDate string `json:"transactionDate"`
	AuthorizationCodeOrExpireDate string `json:"authorizationCodeOrExpireDate,omitempty"`
	TerminalLocation string `json:"terminalLocation"`
	TerminalCity string `json:"terminalCity"`
	TerminalState string `json:"terminalState"`
	TraceNumber string `json:"traceNumber,omitempty"`
	validator
	converters
}
func NewAddenda02() *Addenda02 {
	addenda02 := new(Addenda02)
	addenda02.recordType = "7"
	addenda02.TypeCode = "02"
	return addenda02
}
func (addenda02 *Addenda02) Parse(record string) {
	if utf8.RuneCountInString(record) != 94 {
		return
	}
	addenda02.recordType = "7"
	addenda02.TypeCode = record[1:3]
	addenda02.ReferenceInformationOne = strings.TrimSpace(record[3:10])
	addenda02.ReferenceInformationTwo = strings.TrimSpace(record[10:13])
	addenda02.TerminalIdentificationCode = strings.TrimSpace(record[13:19])
	addenda02.TransactionSerialNumber = strings.TrimSpace(record[19:25])
	addenda02.TransactionDate = strings.TrimSpace(record[25:29])
	addenda02.AuthorizationCodeOrExpireDate = strings.TrimSpace(record[29:35])
	addenda02.TerminalLocation = strings.TrimSpace(record[35:62])
	addenda02.TerminalCity = strings.TrimSpace(record[62:77])
	addenda02.TerminalState = strings.TrimSpace(record[77:79])
	addenda02.TraceNumber = strings.TrimSpace(record[79:94])
}
func (addenda02 *Addenda02) String() string {
	var buf strings.Builder
	buf.Grow(94)
	buf.WriteString(addenda02.recordType)
	buf.WriteString(addenda02.TypeCode)
	buf.WriteString(addenda02.ReferenceInformationOneField())
	buf.WriteString(addenda02.ReferenceInformationTwoField())
	buf.WriteString(addenda02.TerminalIdentificationCodeField())
	buf.WriteString(addenda02.TransactionSerialNumberField())
	buf.WriteString(addenda02.TransactionDateField())
	buf.WriteString(addenda02.AuthorizationCodeOrExpireDateField())
	buf.WriteString(addenda02.TerminalLocationField())
	buf.WriteString(addenda02.TerminalCityField())
	buf.WriteString(addenda02.TerminalStateField())
	buf.WriteString(addenda02.TraceNumberField())
	return buf.String()
}
func (addenda02 *Addenda02) Validate() error {
	if err := addenda02.fieldInclusion(); err != nil {
		return err
	}
	if addenda02.recordType != "7" {
		return fieldError("recordType", NewErrRecordType(7), addenda02.recordType)
	}
	if err := addenda02.isTypeCode(addenda02.TypeCode); err != nil {
		return fieldError("TypeCode", err, addenda02.TypeCode)
	}
	if addenda02.TypeCode != "02" {
		return fieldError("TypeCode", ErrAddendaTypeCode, addenda02.TypeCode)
	}
	if err := addenda02.isAlphanumeric(addenda02.ReferenceInformationOne); err != nil {
		return fieldError("ReferenceInformationOne", err, addenda02.ReferenceInformationOne)
	}
	if err := addenda02.isAlphanumeric(addenda02.ReferenceInformationTwo); err != nil {
		return fieldError("ReferenceInformationTwo", err, addenda02.ReferenceInformationTwo)
	}
	if err := addenda02.isAlphanumeric(addenda02.TerminalIdentificationCode); err != nil {
		return fieldError("TerminalIdentificationCode", err, addenda02.TerminalIdentificationCode)
	}
	if err := addenda02.isAlphanumeric(addenda02.TransactionSerialNumber); err != nil {
		return fieldError("TransactionSerialNumber", err, addenda02.TransactionSerialNumber)
	}
	mm := addenda02.parseStringField(addenda02.TransactionDateField()[0:2])
	dd := addenda02.parseStringField(addenda02.TransactionDateField()[2:4])
	if err := addenda02.isMonth(mm); err != nil {
		return fieldError("TransactionDate", ErrValidMonth, mm)
	}
	if err := addenda02.isDay(mm, dd); err != nil {
		return fieldError("TransactionDate", ErrValidDay, mm)
	}
	if err := addenda02.isAlphanumeric(addenda02.AuthorizationCodeOrExpireDate); err != nil {
		return fieldError("AuthorizationCodeOrExpireDate", err, addenda02.AuthorizationCodeOrExpireDate)
	}
	if err := addenda02.isAlphanumeric(addenda02.TerminalLocation); err != nil {
		return fieldError("TerminalLocation", err, addenda02.TerminalLocation)
	}
	if err := addenda02.isAlphanumeric(addenda02.TerminalCity); err != nil {
		return fieldError("TerminalCity", err, addenda02.TerminalCity)
	}
	if err := addenda02.isAlphanumeric(addenda02.TerminalState); err != nil {
		return fieldError("TerminalState", err, addenda02.TerminalState)
	}
	return nil
}
func (addenda02 *Addenda02) fieldInclusion() error {
	if addenda02.recordType == "" {
		return fieldError("recordType", ErrConstructor, addenda02.recordType)
	}
	if addenda02.TypeCode == "" {
		return fieldError("TypeCode", ErrConstructor, addenda02.TypeCode)
	}
	if addenda02.TerminalIdentificationCode == "" {
		return fieldError("TerminalIdentificationCode", ErrFieldRequired, addenda02.TerminalIdentificationCode)
	}
	if addenda02.TransactionSerialNumber == "" {
		return fieldError("TransactionSerialNumber", ErrFieldRequired, addenda02.TransactionSerialNumber)
	}
	if addenda02.TransactionDate == "" {
		return fieldError("TransactionDate", ErrFieldRequired, addenda02.TransactionDate)
	}
	if addenda02.TerminalLocation == "" {
		return fieldError("TerminalLocation", ErrFieldRequired, addenda02.TerminalLocation)
	}
	if addenda02.TerminalCity == "" {
		return fieldError("TerminalCity", ErrFieldRequired, addenda02.TerminalCity)
	}
	if addenda02.TerminalState == "" {
		return fieldError("TerminalState", ErrFieldRequired, addenda02.TerminalState)
	}
	return nil
}
func (addenda02 *Addenda02) ReferenceInformationOneField() string {
	return addenda02.alphaField(addenda02.ReferenceInformationOne, 7)
}