From cc7d18f937e37d591058ab3604679a9401df33f6 Mon Sep 17 00:00:00 2001 From: Daniel Tonks Date: Thu, 19 Nov 2020 14:42:53 -0700 Subject: [PATCH] remove Java-like getters/setters --- beneficiaryIntermediaryFI_test.go | 2 +- cmd/server/mock_test.go | 60 +- examples/bankDrawDownRequest-write/main.go | 58 +- examples/bankTransfer-write/main.go | 54 +- examples/checkSameDaySettlement-write/main.go | 54 +- .../main.go | 58 +- examples/customerTransfer-write/main.go | 60 +- examples/customerTransferPlus-write/main.go | 66 +- .../customerTransferPlusCOVS-write/main.go | 74 +- examples/depositSendersAccount-write/main.go | 54 +- examples/drawDownRequest-write/main.go | 58 +- examples/fedFundsReturned-write/main.go | 54 +- examples/fedFundsSold-write/main.go | 54 +- examples/serviceMessage-write/main.go | 56 +- fedWireMessage.go | 606 ------------- fedWiremessage_test.go | 450 ++++------ reader.go | 122 +-- serviceMessage_test.go | 48 +- writer.go | 120 +-- writer_test.go | 840 +++++++++--------- 20 files changed, 1117 insertions(+), 1831 deletions(-) diff --git a/beneficiaryIntermediaryFI_test.go b/beneficiaryIntermediaryFI_test.go index 7f1e9e71..d540b610 100644 --- a/beneficiaryIntermediaryFI_test.go +++ b/beneficiaryIntermediaryFI_test.go @@ -134,7 +134,7 @@ func TestParseBeneficiaryIntermediaryFIReaderParseError(t *testing.T) { r.line = line fwm := new(FEDWireMessage) bifi := mockBeneficiaryIntermediaryFI() - fwm.SetBeneficiaryIntermediaryFI(bifi) + fwm.BeneficiaryIntermediaryFI = bifi err := r.parseBeneficiaryIntermediaryFI() diff --git a/cmd/server/mock_test.go b/cmd/server/mock_test.go index 58693bf8..c151e651 100644 --- a/cmd/server/mock_test.go +++ b/cmd/server/mock_test.go @@ -17,53 +17,53 @@ import ( }*/ func mockFEDWireMessage() wire.FEDWireMessage { - fwm := wire.NewFEDWireMessage() + fwm := wire.FEDWireMessage{} fwm.ID = "12345" // Mandatory Fields ss := wire.NewSenderSupplied() ss.UserRequestCorrelation = "User Req" ss.MessageDuplicationCode = wire.MessageDuplicationOriginal - fwm.SetSenderSupplied(ss) + fwm.SenderSupplied = ss tst := wire.NewTypeSubType() tst.TypeCode = wire.FundsTransfer tst.SubTypeCode = wire.BasicFundsTransfer - fwm.SetTypeSubType(tst) + fwm.TypeSubType = tst imad := wire.NewInputMessageAccountabilityData() imad.InputCycleDate = time.Now().Format("20060102") imad.InputSource = "Source08" imad.InputSequenceNumber = "000001" - fwm.SetInputMessageAccountabilityData(imad) + fwm.InputMessageAccountabilityData = imad amt := wire.NewAmount() amt.Amount = "000001234567" - fwm.SetAmount(amt) + fwm.Amount = amt sdi := wire.NewSenderDepositoryInstitution() sdi.SenderABANumber = "121042882" sdi.SenderShortName = "Wells Fargo NA" - fwm.SetSenderDepositoryInstitution(sdi) + fwm.SenderDepositoryInstitution = sdi rdi := wire.NewReceiverDepositoryInstitution() rdi.ReceiverABANumber = "231380104" rdi.ReceiverShortName = "Citadel" - fwm.SetReceiverDepositoryInstitution(rdi) + fwm.ReceiverDepositoryInstitution = rdi bfc := wire.NewBusinessFunctionCode() bfc.BusinessFunctionCode = wire.CustomerTransfer bfc.TransactionTypeCode = " " - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc // Other Transfer Information sr := wire.NewSenderReference() sr.SenderReference = "Sender Reference" - fwm.SetSenderReference(sr) + fwm.SenderReference = sr pmi := wire.NewPreviousMessageIdentifier() pmi.PreviousMessageIdentifier = "Previous Message Ident" - fwm.SetPreviousMessageIdentifier(pmi) + fwm.PreviousMessageIdentifier = pmi c := wire.NewCharges() c.ChargeDetails = "B" @@ -71,16 +71,16 @@ func mockFEDWireMessage() wire.FEDWireMessage { c.SendersChargesTwo = "USD2,99" c.SendersChargesThree = "USD3,99" c.SendersChargesFour = "USD1,00" - fwm.SetCharges(c) + fwm.Charges = c ia := wire.NewInstructedAmount() ia.CurrencyCode = "USD" ia.Amount = "4567,89" - fwm.SetInstructedAmount(ia) + fwm.InstructedAmount = ia eRate := wire.NewExchangeRate() eRate.ExchangeRate = "1,2345" - fwm.SetExchangeRate(eRate) + fwm.ExchangeRate = eRate // Beneficiary bifi := wire.NewBeneficiaryIntermediaryFI() @@ -90,7 +90,7 @@ func mockFEDWireMessage() wire.FEDWireMessage { bifi.FinancialInstitution.Address.AddressLineOne = "Address One" bifi.FinancialInstitution.Address.AddressLineTwo = "Address Two" bifi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiaryIntermediaryFI(bifi) + fwm.BeneficiaryIntermediaryFI = bifi bfi := wire.NewBeneficiaryFI() bfi.FinancialInstitution.IdentificationCode = wire.DemandDepositAccountNumber @@ -99,7 +99,7 @@ func mockFEDWireMessage() wire.FEDWireMessage { bfi.FinancialInstitution.Address.AddressLineOne = "Address One" bfi.FinancialInstitution.Address.AddressLineTwo = "Address Two" bfi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiaryFI(bfi) + fwm.BeneficiaryFI = bfi ben := wire.NewBeneficiary() ben.Personal.IdentificationCode = wire.DriversLicenseNumber @@ -108,11 +108,11 @@ func mockFEDWireMessage() wire.FEDWireMessage { ben.Personal.Address.AddressLineOne = "Address One" ben.Personal.Address.AddressLineTwo = "Address Two" ben.Personal.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiary(ben) + fwm.Beneficiary = ben br := wire.NewBeneficiaryReference() br.BeneficiaryReference = "Reference" - fwm.SetBeneficiaryReference(br) + fwm.BeneficiaryReference = br // Originator o := wire.NewOriginator() @@ -122,7 +122,7 @@ func mockFEDWireMessage() wire.FEDWireMessage { o.Personal.Address.AddressLineOne = "Address One" o.Personal.Address.AddressLineTwo = "Address Two" o.Personal.Address.AddressLineThree = "Address Three" - fwm.SetOriginator(o) + fwm.Originator = o ofi := wire.NewOriginatorFI() ofi.FinancialInstitution.IdentificationCode = wire.DemandDepositAccountNumber @@ -131,7 +131,7 @@ func mockFEDWireMessage() wire.FEDWireMessage { ofi.FinancialInstitution.Address.AddressLineOne = "Address One" ofi.FinancialInstitution.Address.AddressLineTwo = "Address Two" ofi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetOriginatorFI(ofi) + fwm.OriginatorFI = ofi ifi := wire.NewInstructingFI() ifi.FinancialInstitution.IdentificationCode = wire.DemandDepositAccountNumber @@ -140,14 +140,14 @@ func mockFEDWireMessage() wire.FEDWireMessage { ifi.FinancialInstitution.Address.AddressLineOne = "Address One" ifi.FinancialInstitution.Address.AddressLineTwo = "Address Two" ifi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetInstructingFI(ifi) + fwm.InstructingFI = ifi ob := wire.NewOriginatorToBeneficiary() ob.LineOne = "LineOne" ob.LineTwo = "LineTwo" ob.LineThree = "LineThree" ob.LineFour = "LineFour" - fwm.SetOriginatorToBeneficiary(ob) + fwm.OriginatorToBeneficiary = ob // FI to FI firfi := wire.NewFIReceiverFI() @@ -157,7 +157,7 @@ func mockFEDWireMessage() wire.FEDWireMessage { firfi.FIToFI.LineOne = "Line Four" firfi.FIToFI.LineOne = "Line Five" firfi.FIToFI.LineOne = "Line Six" - fwm.SetFIReceiverFI(firfi) + fwm.FIReceiverFI = firfi fiifi := wire.NewFIIntermediaryFI() fiifi.FIToFI.LineOne = "Line One" @@ -166,7 +166,7 @@ func mockFEDWireMessage() wire.FEDWireMessage { fiifi.FIToFI.LineOne = "Line Four" fiifi.FIToFI.LineOne = "Line Five" fiifi.FIToFI.LineOne = "Line Six" - fwm.SetFIIntermediaryFI(fiifi) + fwm.FIIntermediaryFI = fiifi fiifia := wire.NewFIIntermediaryFIAdvice() fiifia.Advice.AdviceCode = wire.AdviceCodeLetter @@ -176,7 +176,7 @@ func mockFEDWireMessage() wire.FEDWireMessage { fiifia.Advice.LineFour = "Line Four" fiifia.Advice.LineFive = "Line Five" fiifia.Advice.LineSix = "Line Six" - fwm.SetFIIntermediaryFIAdvice(fiifia) + fwm.FIIntermediaryFIAdvice = fiifia fibfi := wire.NewFIBeneficiaryFI() fibfi.FIToFI.LineOne = "Line One" @@ -185,7 +185,7 @@ func mockFEDWireMessage() wire.FEDWireMessage { fibfi.FIToFI.LineFour = "Line Four" fibfi.FIToFI.LineFive = "Line Five" fibfi.FIToFI.LineSix = "Line Six" - fwm.SetFIBeneficiaryFI(fibfi) + fwm.FIBeneficiaryFI = fibfi fibfia := wire.NewFIBeneficiaryFIAdvice() fibfia.Advice.AdviceCode = wire.AdviceCodeTelex @@ -195,7 +195,7 @@ func mockFEDWireMessage() wire.FEDWireMessage { fibfia.Advice.LineFour = "Line Four" fibfia.Advice.LineFive = "Line Five" fibfia.Advice.LineSix = "Line Six" - fwm.SetFIBeneficiaryFIAdvice(fibfia) + fwm.FIBeneficiaryFIAdvice = fibfia fib := wire.NewFIBeneficiary() fib.FIToFI.LineOne = "Line One" @@ -204,7 +204,7 @@ func mockFEDWireMessage() wire.FEDWireMessage { fib.FIToFI.LineFour = "Line Four" fib.FIToFI.LineFive = "Line Five" fib.FIToFI.LineSix = "Line Six" - fwm.SetFIBeneficiary(fib) + fwm.FIBeneficiary = fib fiba := wire.NewFIBeneficiaryAdvice() fiba.Advice.AdviceCode = wire.AdviceCodeLetter @@ -214,11 +214,11 @@ func mockFEDWireMessage() wire.FEDWireMessage { fiba.Advice.LineFour = "Line Four" fiba.Advice.LineFive = "Line Five" fiba.Advice.LineSix = "Line Six" - fwm.SetFIBeneficiaryAdvice(fiba) + fwm.FIBeneficiaryAdvice = fiba pm := wire.NewFIPaymentMethodToBeneficiary() pm.AdditionalInformation = "Additional Information" - fwm.SetFIPaymentMethodToBeneficiary(pm) + fwm.FIPaymentMethodToBeneficiary = pm fifi := wire.NewFIAdditionalFIToFI() fifi.AdditionalFIToFI.LineOne = "Line One" @@ -227,7 +227,7 @@ func mockFEDWireMessage() wire.FEDWireMessage { fifi.AdditionalFIToFI.LineFour = "Line Four" fifi.AdditionalFIToFI.LineFive = "Line Five" fifi.AdditionalFIToFI.LineSix = "Line Six" - fwm.SetFIAdditionalFIToFI(fifi) + fwm.FIAdditionalFIToFI = fifi return fwm } diff --git a/examples/bankDrawDownRequest-write/main.go b/examples/bankDrawDownRequest-write/main.go index c3fa51ea..5e81de94 100644 --- a/examples/bankDrawDownRequest-write/main.go +++ b/examples/bankDrawDownRequest-write/main.go @@ -14,52 +14,52 @@ import ( func main() { file := wire.NewFile() - fwm := wire.NewFEDWireMessage() + fwm := wire.FEDWireMessage{} // Mandatory Fields ss := wire.NewSenderSupplied() ss.UserRequestCorrelation = "User Req" ss.MessageDuplicationCode = wire.MessageDuplicationOriginal - fwm.SetSenderSupplied(ss) + fwm.SenderSupplied = ss tst := wire.NewTypeSubType() tst.TypeCode = wire.SettlementTransfer tst.SubTypeCode = wire.RequestCredit - fwm.SetTypeSubType(tst) + fwm.TypeSubType = tst imad := wire.NewInputMessageAccountabilityData() imad.InputCycleDate = time.Now().Format("20060102") imad.InputSource = "Source08" imad.InputSequenceNumber = "000001" - fwm.SetInputMessageAccountabilityData(imad) + fwm.InputMessageAccountabilityData = imad amt := wire.NewAmount() amt.Amount = "000001234567" - fwm.SetAmount(amt) + fwm.Amount = amt sdi := wire.NewSenderDepositoryInstitution() sdi.SenderABANumber = "121042882" sdi.SenderShortName = "Wells Fargo NA" - fwm.SetSenderDepositoryInstitution(sdi) + fwm.SenderDepositoryInstitution = sdi rdi := wire.NewReceiverDepositoryInstitution() rdi.ReceiverABANumber = "231380104" rdi.ReceiverShortName = "Citadel" - fwm.SetReceiverDepositoryInstitution(rdi) + fwm.ReceiverDepositoryInstitution = rdi bfc := wire.NewBusinessFunctionCode() bfc.BusinessFunctionCode = wire.BankDrawDownRequest bfc.TransactionTypeCode = " " - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc // Other Transfer Information sr := wire.NewSenderReference() sr.SenderReference = "Sender Reference" - fwm.SetSenderReference(sr) + fwm.SenderReference = sr pmi := wire.NewPreviousMessageIdentifier() pmi.PreviousMessageIdentifier = "Previous Message Ident" - fwm.SetPreviousMessageIdentifier(pmi) + fwm.PreviousMessageIdentifier = pmi // Beneficiary bifi := wire.NewBeneficiaryIntermediaryFI() @@ -69,7 +69,7 @@ func main() { bifi.FinancialInstitution.Address.AddressLineOne = "Address One" bifi.FinancialInstitution.Address.AddressLineTwo = "Address Two" bifi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiaryIntermediaryFI(bifi) + fwm.BeneficiaryIntermediaryFI = bifi bfi := wire.NewBeneficiaryFI() bfi.FinancialInstitution.IdentificationCode = wire.DemandDepositAccountNumber @@ -78,7 +78,7 @@ func main() { bfi.FinancialInstitution.Address.AddressLineOne = "Address One" bfi.FinancialInstitution.Address.AddressLineTwo = "Address Two" bfi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiaryFI(bfi) + fwm.BeneficiaryFI = bfi ben := wire.NewBeneficiary() ben.Personal.IdentificationCode = wire.DriversLicenseNumber @@ -87,11 +87,11 @@ func main() { ben.Personal.Address.AddressLineOne = "Address One" ben.Personal.Address.AddressLineTwo = "Address Two" ben.Personal.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiary(ben) + fwm.Beneficiary = ben br := wire.NewBeneficiaryReference() br.BeneficiaryReference = "Reference" - fwm.SetBeneficiaryReference(br) + fwm.BeneficiaryReference = br debitDD := wire.NewAccountDebitedDrawdown() debitDD.IdentificationCode = wire.DemandDepositAccountNumber @@ -100,7 +100,7 @@ func main() { debitDD.Address.AddressLineOne = "Address One" debitDD.Address.AddressLineTwo = "Address Two" debitDD.Address.AddressLineThree = "Address Three" - fwm.SetAccountDebitedDrawdown(debitDD) + fwm.AccountDebitedDrawdown = debitDD // Originator o := wire.NewOriginator() @@ -110,7 +110,7 @@ func main() { o.Personal.Address.AddressLineOne = "Address One" o.Personal.Address.AddressLineTwo = "Address Two" o.Personal.Address.AddressLineThree = "Address Three" - fwm.SetOriginator(o) + fwm.Originator = o ofi := wire.NewOriginatorFI() ofi.FinancialInstitution.IdentificationCode = wire.DemandDepositAccountNumber @@ -119,7 +119,7 @@ func main() { ofi.FinancialInstitution.Address.AddressLineOne = "Address One" ofi.FinancialInstitution.Address.AddressLineTwo = "Address Two" ofi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetOriginatorFI(ofi) + fwm.OriginatorFI = ofi ifi := wire.NewInstructingFI() ifi.FinancialInstitution.IdentificationCode = wire.DemandDepositAccountNumber @@ -128,18 +128,18 @@ func main() { ifi.FinancialInstitution.Address.AddressLineOne = "Address One" ifi.FinancialInstitution.Address.AddressLineTwo = "Address Two" ifi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetInstructingFI(ifi) + fwm.InstructingFI = ifi creditDD := wire.NewAccountCreditedDrawdown() creditDD.DrawdownCreditAccountNumber = "123456789" - fwm.SetAccountCreditedDrawdown(creditDD) + fwm.AccountCreditedDrawdown = creditDD ob := wire.NewOriginatorToBeneficiary() ob.LineOne = "LineOne" ob.LineTwo = "LineTwo" ob.LineThree = "LineThree" ob.LineFour = "LineFour" - fwm.SetOriginatorToBeneficiary(ob) + fwm.OriginatorToBeneficiary = ob // FI to FI firfi := wire.NewFIReceiverFI() @@ -149,7 +149,7 @@ func main() { firfi.FIToFI.LineOne = "Line Four" firfi.FIToFI.LineOne = "Line Five" firfi.FIToFI.LineOne = "Line Six" - fwm.SetFIReceiverFI(firfi) + fwm.FIReceiverFI = firfi fiifi := wire.NewFIIntermediaryFI() fiifi.FIToFI.LineOne = "Line One" @@ -158,7 +158,7 @@ func main() { fiifi.FIToFI.LineOne = "Line Four" fiifi.FIToFI.LineOne = "Line Five" fiifi.FIToFI.LineOne = "Line Six" - fwm.SetFIIntermediaryFI(fiifi) + fwm.FIIntermediaryFI = fiifi fiifia := wire.NewFIIntermediaryFIAdvice() fiifia.Advice.AdviceCode = wire.AdviceCodeLetter @@ -168,7 +168,7 @@ func main() { fiifia.Advice.LineFour = "Line Four" fiifia.Advice.LineFive = "Line Five" fiifia.Advice.LineSix = "Line Six" - fwm.SetFIIntermediaryFIAdvice(fiifia) + fwm.FIIntermediaryFIAdvice = fiifia fibfi := wire.NewFIBeneficiaryFI() fibfi.FIToFI.LineOne = "Line One" @@ -177,7 +177,7 @@ func main() { fibfi.FIToFI.LineFour = "Line Four" fibfi.FIToFI.LineFive = "Line Five" fibfi.FIToFI.LineSix = "Line Six" - fwm.SetFIBeneficiaryFI(fibfi) + fwm.FIBeneficiaryFI = fibfi fibfia := wire.NewFIBeneficiaryFIAdvice() fibfia.Advice.AdviceCode = wire.AdviceCodeTelex @@ -187,7 +187,7 @@ func main() { fibfia.Advice.LineFour = "Line Four" fibfia.Advice.LineFive = "Line Five" fibfia.Advice.LineSix = "Line Six" - fwm.SetFIBeneficiaryFIAdvice(fibfia) + fwm.FIBeneficiaryFIAdvice = fibfia fib := wire.NewFIBeneficiary() fib.FIToFI.LineOne = "Line One" @@ -196,7 +196,7 @@ func main() { fib.FIToFI.LineFour = "Line Four" fib.FIToFI.LineFive = "Line Five" fib.FIToFI.LineSix = "Line Six" - fwm.SetFIBeneficiary(fib) + fwm.FIBeneficiary = fib fiba := wire.NewFIBeneficiaryAdvice() fiba.Advice.AdviceCode = wire.AdviceCodeLetter @@ -206,12 +206,12 @@ func main() { fiba.Advice.LineFour = "Line Four" fiba.Advice.LineFive = "Line Five" fiba.Advice.LineSix = "Line Six" - fwm.SetFIBeneficiaryAdvice(fiba) + fwm.FIBeneficiaryAdvice = fiba pm := wire.NewFIPaymentMethodToBeneficiary() pm.PaymentMethod = "CHECK" pm.AdditionalInformation = "Additional Information" - fwm.SetFIPaymentMethodToBeneficiary(pm) + fwm.FIPaymentMethodToBeneficiary = pm fifi := wire.NewFIAdditionalFIToFI() fiifi.FIToFI.LineOne = "Line One" @@ -220,7 +220,7 @@ func main() { fiifi.FIToFI.LineOne = "Line Four" fiifi.FIToFI.LineOne = "Line Five" fiifi.FIToFI.LineOne = "Line Six" - fwm.SetFIAdditionalFIToFI(fifi) + fwm.FIAdditionalFIToFI = fifi file.AddFEDWireMessage(fwm) diff --git a/examples/bankTransfer-write/main.go b/examples/bankTransfer-write/main.go index b81a3d25..e2f933f6 100644 --- a/examples/bankTransfer-write/main.go +++ b/examples/bankTransfer-write/main.go @@ -14,7 +14,7 @@ import ( func main() { file := wire.NewFile() - fwm := wire.NewFEDWireMessage() + fwm := wire.FEDWireMessage{} // Mandatory Fields ; senderSupplied, TypeSubType, InputMessageAccountabilityData @@ -22,51 +22,51 @@ func main() { ss := wire.NewSenderSupplied() ss.UserRequestCorrelation = "User Req" ss.MessageDuplicationCode = wire.MessageDuplicationOriginal - fwm.SetSenderSupplied(ss) + fwm.SenderSupplied = ss // TypeSubType typeSubtype := wire.NewTypeSubType() typeSubtype.TypeCode = wire.FundsTransfer typeSubtype.SubTypeCode = wire.BasicFundsTransfer - fwm.SetTypeSubType(typeSubtype) + fwm.TypeSubType = typeSubtype // InputMessageAccountabilityData imad := wire.NewInputMessageAccountabilityData() imad.InputCycleDate = time.Now().Format("20060102") imad.InputSource = "Source08" imad.InputSequenceNumber = "000001" - fwm.SetInputMessageAccountabilityData(imad) + fwm.InputMessageAccountabilityData = imad // Amount amt := wire.NewAmount() amt.Amount = "000001234567" - fwm.SetAmount(amt) + fwm.Amount = amt // SenderDepositoryInstitution sdi := wire.NewSenderDepositoryInstitution() sdi.SenderABANumber = "121042882" sdi.SenderShortName = "Wells Fargo NA" - fwm.SetSenderDepositoryInstitution(sdi) + fwm.SenderDepositoryInstitution = sdi rdi := wire.NewReceiverDepositoryInstitution() rdi.ReceiverABANumber = "231380104" rdi.ReceiverShortName = "Citadel" - fwm.SetReceiverDepositoryInstitution(rdi) + fwm.ReceiverDepositoryInstitution = rdi bfc := wire.NewBusinessFunctionCode() bfc.BusinessFunctionCode = "BTR" bfc.TransactionTypeCode = " " - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc // Sender Reference sr := wire.NewSenderReference() sr.SenderReference = "Sender Reference" - fwm.SetSenderReference(sr) + fwm.SenderReference = sr // Previous Message Identifier pmi := wire.NewPreviousMessageIdentifier() pmi.PreviousMessageIdentifier = "Previous Message Ident" - fwm.SetPreviousMessageIdentifier(pmi) + fwm.PreviousMessageIdentifier = pmi // Beneficiary Intermediary FI bifi := wire.NewBeneficiaryIntermediaryFI() @@ -76,7 +76,7 @@ func main() { bifi.FinancialInstitution.Address.AddressLineOne = "Address One" bifi.FinancialInstitution.Address.AddressLineTwo = "Address Two" bifi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiaryIntermediaryFI(bifi) + fwm.BeneficiaryIntermediaryFI = bifi // Beneficiary FI bfi := wire.NewBeneficiaryFI() @@ -86,7 +86,7 @@ func main() { bfi.FinancialInstitution.Address.AddressLineOne = "Address One" bfi.FinancialInstitution.Address.AddressLineTwo = "Address Two" bfi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiaryFI(bfi) + fwm.BeneficiaryFI = bfi // Beneficiary ben := wire.NewBeneficiary() @@ -96,12 +96,12 @@ func main() { ben.Personal.Address.AddressLineOne = "Address One" ben.Personal.Address.AddressLineTwo = "Address Two" ben.Personal.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiary(ben) + fwm.Beneficiary = ben // Beneficiary Reference br := wire.NewBeneficiaryReference() br.BeneficiaryReference = "Reference" - fwm.SetBeneficiaryReference(br) + fwm.BeneficiaryReference = br // Originator o := wire.NewOriginator() @@ -111,7 +111,7 @@ func main() { o.Personal.Address.AddressLineOne = "Address One" o.Personal.Address.AddressLineTwo = "Address Two" o.Personal.Address.AddressLineThree = "Address Three" - fwm.SetOriginator(o) + fwm.Originator = o // Originator FI ofi := wire.NewOriginatorFI() @@ -121,7 +121,7 @@ func main() { ofi.FinancialInstitution.Address.AddressLineOne = "Address One" ofi.FinancialInstitution.Address.AddressLineTwo = "Address Two" ofi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetOriginatorFI(ofi) + fwm.OriginatorFI = ofi // Instructing FI ifi := wire.NewInstructingFI() @@ -131,7 +131,7 @@ func main() { ifi.FinancialInstitution.Address.AddressLineOne = "Address One" ifi.FinancialInstitution.Address.AddressLineTwo = "Address Two" ifi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetInstructingFI(ifi) + fwm.InstructingFI = ifi // Originator To Beneficiary ob := wire.NewOriginatorToBeneficiary() @@ -139,7 +139,7 @@ func main() { ob.LineTwo = "LineTwo" ob.LineThree = "LineThree" ob.LineFour = "LineFour" - fwm.SetOriginatorToBeneficiary(ob) + fwm.OriginatorToBeneficiary = ob // FI to FI @@ -151,7 +151,7 @@ func main() { firfi.FIToFI.LineOne = "FIToFI Line Four" firfi.FIToFI.LineOne = "FIToFI Line Five" firfi.FIToFI.LineOne = "FIToFI Line Six" - fwm.SetFIReceiverFI(firfi) + fwm.FIReceiverFI = firfi // FIIntermediaryFI fiifi := wire.NewFIIntermediaryFI() @@ -161,7 +161,7 @@ func main() { fiifi.FIToFI.LineOne = "FIIntermediaryFI Line Four" fiifi.FIToFI.LineOne = "FIIntermediaryFI Line Five" fiifi.FIToFI.LineOne = "FIIntermediaryFI Line Six" - fwm.SetFIIntermediaryFI(fiifi) + fwm.FIIntermediaryFI = fiifi // FIIntermediaryFIAdvice fiifia := wire.NewFIIntermediaryFIAdvice() @@ -172,7 +172,7 @@ func main() { fiifia.Advice.LineFour = "FIInterFIAdvice Line Four" fiifia.Advice.LineFive = "FIInterFIAdvice Line Five" fiifia.Advice.LineSix = "FIInterFIAdvice Line Six" - fwm.SetFIIntermediaryFIAdvice(fiifia) + fwm.FIIntermediaryFIAdvice = fiifia // FIBeneficiaryFI fibfi := wire.NewFIBeneficiaryFI() @@ -182,7 +182,7 @@ func main() { fibfi.FIToFI.LineFour = "FIBenFI Line Four" fibfi.FIToFI.LineFive = "FIBenFI Line Five" fibfi.FIToFI.LineSix = "FIBenFI Line Six" - fwm.SetFIBeneficiaryFI(fibfi) + fwm.FIBeneficiaryFI = fibfi // FIBeneficiaryFIAdvice fibfia := wire.NewFIBeneficiaryFIAdvice() @@ -193,7 +193,7 @@ func main() { fibfia.Advice.LineFour = "FIBenFIAdvice Line Four" fibfia.Advice.LineFive = "FIBenFIAdvice Line Five" fibfia.Advice.LineSix = "FIBenFIAdvice Line Six" - fwm.SetFIBeneficiaryFIAdvice(fibfia) + fwm.FIBeneficiaryFIAdvice = fibfia // FIBeneficiary fib := wire.NewFIBeneficiary() @@ -203,7 +203,7 @@ func main() { fib.FIToFI.LineFour = "FIBen Line Four" fib.FIToFI.LineFive = "FIBen Line Five" fib.FIToFI.LineSix = "FIBen Line Six" - fwm.SetFIBeneficiary(fib) + fwm.FIBeneficiary = fib // FIBeneficiaryAdvice fiba := wire.NewFIBeneficiaryAdvice() @@ -214,13 +214,13 @@ func main() { fiba.Advice.LineFour = "FIBenAdvice Line Four" fiba.Advice.LineFive = "FIBenAdvice Line Five" fiba.Advice.LineSix = "FIBenAdvice Line Six" - fwm.SetFIBeneficiaryAdvice(fiba) + fwm.FIBeneficiaryAdvice = fiba // FIPaymentMethodToBeneficiary pm := wire.NewFIPaymentMethodToBeneficiary() pm.PaymentMethod = "CHECK" pm.AdditionalInformation = "Additional Information" - fwm.SetFIPaymentMethodToBeneficiary(pm) + fwm.FIPaymentMethodToBeneficiary = pm // FIAdditionalFIToFI fifi := wire.NewFIAdditionalFIToFI() @@ -230,7 +230,7 @@ func main() { fifi.AdditionalFIToFI.LineFour = "FIAddFI Line Four" fifi.AdditionalFIToFI.LineFive = "FIAddFI Line Five" fifi.AdditionalFIToFI.LineSix = "FIAddFI Line Six" - fwm.SetFIAdditionalFIToFI(fifi) + fwm.FIAdditionalFIToFI = fifi file.AddFEDWireMessage(fwm) diff --git a/examples/checkSameDaySettlement-write/main.go b/examples/checkSameDaySettlement-write/main.go index 4a00db7a..38847755 100644 --- a/examples/checkSameDaySettlement-write/main.go +++ b/examples/checkSameDaySettlement-write/main.go @@ -14,52 +14,52 @@ import ( func main() { file := wire.NewFile() - fwm := wire.NewFEDWireMessage() + fwm := wire.FEDWireMessage{} // Mandatory Fields ss := wire.NewSenderSupplied() ss.UserRequestCorrelation = "User Req" ss.MessageDuplicationCode = wire.MessageDuplicationOriginal - fwm.SetSenderSupplied(ss) + fwm.SenderSupplied = ss tst := wire.NewTypeSubType() tst.TypeCode = wire.SettlementTransfer tst.SubTypeCode = wire.BasicFundsTransfer - fwm.SetTypeSubType(tst) + fwm.TypeSubType = tst imad := wire.NewInputMessageAccountabilityData() imad.InputCycleDate = time.Now().Format("20060102") imad.InputSource = "Source08" imad.InputSequenceNumber = "000001" - fwm.SetInputMessageAccountabilityData(imad) + fwm.InputMessageAccountabilityData = imad amt := wire.NewAmount() amt.Amount = "000001234567" - fwm.SetAmount(amt) + fwm.Amount = amt sdi := wire.NewSenderDepositoryInstitution() sdi.SenderABANumber = "121042882" sdi.SenderShortName = "Wells Fargo NA" - fwm.SetSenderDepositoryInstitution(sdi) + fwm.SenderDepositoryInstitution = sdi rdi := wire.NewReceiverDepositoryInstitution() rdi.ReceiverABANumber = "231380104" rdi.ReceiverShortName = "Citadel" - fwm.SetReceiverDepositoryInstitution(rdi) + fwm.ReceiverDepositoryInstitution = rdi bfc := wire.NewBusinessFunctionCode() bfc.BusinessFunctionCode = wire.CheckSameDaySettlement bfc.TransactionTypeCode = " " - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc // Other Transfer Information sr := wire.NewSenderReference() sr.SenderReference = "Sender Reference" - fwm.SetSenderReference(sr) + fwm.SenderReference = sr pmi := wire.NewPreviousMessageIdentifier() pmi.PreviousMessageIdentifier = "Previous Message Ident" - fwm.SetPreviousMessageIdentifier(pmi) + fwm.PreviousMessageIdentifier = pmi // Beneficiary bifi := wire.NewBeneficiaryIntermediaryFI() @@ -69,7 +69,7 @@ func main() { bifi.FinancialInstitution.Address.AddressLineOne = "Address One" bifi.FinancialInstitution.Address.AddressLineTwo = "Address Two" bifi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiaryIntermediaryFI(bifi) + fwm.BeneficiaryIntermediaryFI = bifi bfi := wire.NewBeneficiaryFI() bfi.FinancialInstitution.IdentificationCode = wire.DemandDepositAccountNumber @@ -78,7 +78,7 @@ func main() { bfi.FinancialInstitution.Address.AddressLineOne = "Address One" bfi.FinancialInstitution.Address.AddressLineTwo = "Address Two" bfi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiaryFI(bfi) + fwm.BeneficiaryFI = bfi ben := wire.NewBeneficiary() ben.Personal.IdentificationCode = wire.DriversLicenseNumber @@ -87,11 +87,11 @@ func main() { ben.Personal.Address.AddressLineOne = "Address One" ben.Personal.Address.AddressLineTwo = "Address Two" ben.Personal.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiary(ben) + fwm.Beneficiary = ben br := wire.NewBeneficiaryReference() br.BeneficiaryReference = "Reference" - fwm.SetBeneficiaryReference(br) + fwm.BeneficiaryReference = br // Originator o := wire.NewOriginator() @@ -101,7 +101,7 @@ func main() { o.Personal.Address.AddressLineOne = "Address One" o.Personal.Address.AddressLineTwo = "Address Two" o.Personal.Address.AddressLineThree = "Address Three" - fwm.SetOriginator(o) + fwm.Originator = o ofi := wire.NewOriginatorFI() ofi.FinancialInstitution.IdentificationCode = wire.DemandDepositAccountNumber @@ -110,7 +110,7 @@ func main() { ofi.FinancialInstitution.Address.AddressLineOne = "Address One" ofi.FinancialInstitution.Address.AddressLineTwo = "Address Two" ofi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetOriginatorFI(ofi) + fwm.OriginatorFI = ofi ifi := wire.NewInstructingFI() ifi.FinancialInstitution.IdentificationCode = wire.DemandDepositAccountNumber @@ -119,14 +119,14 @@ func main() { ifi.FinancialInstitution.Address.AddressLineOne = "Address One" ifi.FinancialInstitution.Address.AddressLineTwo = "Address Two" ifi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetInstructingFI(ifi) + fwm.InstructingFI = ifi ob := wire.NewOriginatorToBeneficiary() ob.LineOne = "LineOne" ob.LineTwo = "LineTwo" ob.LineThree = "LineThree" ob.LineFour = "LineFour" - fwm.SetOriginatorToBeneficiary(ob) + fwm.OriginatorToBeneficiary = ob // FI to FI firfi := wire.NewFIReceiverFI() @@ -136,7 +136,7 @@ func main() { firfi.FIToFI.LineOne = "Line Four" firfi.FIToFI.LineOne = "Line Five" firfi.FIToFI.LineOne = "Line Six" - fwm.SetFIReceiverFI(firfi) + fwm.FIReceiverFI = firfi fiifi := wire.NewFIIntermediaryFI() fiifi.FIToFI.LineOne = "Line One" @@ -145,7 +145,7 @@ func main() { fiifi.FIToFI.LineOne = "Line Four" fiifi.FIToFI.LineOne = "Line Five" fiifi.FIToFI.LineOne = "Line Six" - fwm.SetFIIntermediaryFI(fiifi) + fwm.FIIntermediaryFI = fiifi fiifia := wire.NewFIIntermediaryFIAdvice() fiifia.Advice.AdviceCode = wire.AdviceCodeLetter @@ -155,7 +155,7 @@ func main() { fiifia.Advice.LineFour = "Line Four" fiifia.Advice.LineFive = "Line Five" fiifia.Advice.LineSix = "Line Six" - fwm.SetFIIntermediaryFIAdvice(fiifia) + fwm.FIIntermediaryFIAdvice = fiifia fibfi := wire.NewFIBeneficiaryFI() fibfi.FIToFI.LineOne = "Line One" @@ -164,7 +164,7 @@ func main() { fibfi.FIToFI.LineFour = "Line Four" fibfi.FIToFI.LineFive = "Line Five" fibfi.FIToFI.LineSix = "Line Six" - fwm.SetFIBeneficiaryFI(fibfi) + fwm.FIBeneficiaryFI = fibfi fibfia := wire.NewFIBeneficiaryFIAdvice() fibfia.Advice.AdviceCode = wire.AdviceCodeTelex @@ -174,7 +174,7 @@ func main() { fibfia.Advice.LineFour = "Line Four" fibfia.Advice.LineFive = "Line Five" fibfia.Advice.LineSix = "Line Six" - fwm.SetFIBeneficiaryFIAdvice(fibfia) + fwm.FIBeneficiaryFIAdvice = fibfia fib := wire.NewFIBeneficiary() fib.FIToFI.LineOne = "Line One" @@ -183,7 +183,7 @@ func main() { fib.FIToFI.LineFour = "Line Four" fib.FIToFI.LineFive = "Line Five" fib.FIToFI.LineSix = "Line Six" - fwm.SetFIBeneficiary(fib) + fwm.FIBeneficiary = fib fiba := wire.NewFIBeneficiaryAdvice() fiba.Advice.AdviceCode = wire.AdviceCodeLetter @@ -193,12 +193,12 @@ func main() { fiba.Advice.LineFour = "Line Four" fiba.Advice.LineFive = "Line Five" fiba.Advice.LineSix = "Line Six" - fwm.SetFIBeneficiaryAdvice(fiba) + fwm.FIBeneficiaryAdvice = fiba pm := wire.NewFIPaymentMethodToBeneficiary() pm.PaymentMethod = "CHECK" pm.AdditionalInformation = "Additional Information" - fwm.SetFIPaymentMethodToBeneficiary(pm) + fwm.FIPaymentMethodToBeneficiary = pm fifi := wire.NewFIAdditionalFIToFI() fiifi.FIToFI.LineOne = "Line One" @@ -207,7 +207,7 @@ func main() { fiifi.FIToFI.LineOne = "Line Four" fiifi.FIToFI.LineOne = "Line Five" fiifi.FIToFI.LineOne = "Line Six" - fwm.SetFIAdditionalFIToFI(fifi) + fwm.FIAdditionalFIToFI = fifi file.AddFEDWireMessage(fwm) diff --git a/examples/customerCorporateDrawDownRequest-write/main.go b/examples/customerCorporateDrawDownRequest-write/main.go index 0e8c04b7..14363ac9 100644 --- a/examples/customerCorporateDrawDownRequest-write/main.go +++ b/examples/customerCorporateDrawDownRequest-write/main.go @@ -15,16 +15,16 @@ import ( func main() { file := wire.NewFile() - fwm := wire.NewFEDWireMessage() + fwm := wire.FEDWireMessage{} // Mandatory Fields ss := wire.NewSenderSupplied() ss.UserRequestCorrelation = "User Req" ss.MessageDuplicationCode = wire.MessageDuplicationOriginal - fwm.SetSenderSupplied(ss) + fwm.SenderSupplied = ss tst := wire.NewTypeSubType() - fwm.SetTypeSubType(tst) + fwm.TypeSubType = tst tst.TypeCode = wire.FundsTransfer tst.SubTypeCode = wire.RequestCredit @@ -32,35 +32,35 @@ func main() { imad.InputCycleDate = time.Now().Format("20060102") imad.InputSource = "Source08" imad.InputSequenceNumber = "000001" - fwm.SetInputMessageAccountabilityData(imad) + fwm.InputMessageAccountabilityData = imad amt := wire.NewAmount() amt.Amount = "000001234567" - fwm.SetAmount(amt) + fwm.Amount = amt sdi := wire.NewSenderDepositoryInstitution() sdi.SenderABANumber = "121042882" sdi.SenderShortName = "Wells Fargo NA" - fwm.SetSenderDepositoryInstitution(sdi) + fwm.SenderDepositoryInstitution = sdi rdi := wire.NewReceiverDepositoryInstitution() rdi.ReceiverABANumber = "231380104" rdi.ReceiverShortName = "Citadel" - fwm.SetReceiverDepositoryInstitution(rdi) + fwm.ReceiverDepositoryInstitution = rdi bfc := wire.NewBusinessFunctionCode() bfc.BusinessFunctionCode = wire.CustomerCorporateDrawdownRequest bfc.TransactionTypeCode = " " - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc // Other Transfer Information sr := wire.NewSenderReference() sr.SenderReference = "Sender Reference" - fwm.SetSenderReference(sr) + fwm.SenderReference = sr pmi := wire.NewPreviousMessageIdentifier() pmi.PreviousMessageIdentifier = "Previous Message Ident" - fwm.SetPreviousMessageIdentifier(pmi) + fwm.PreviousMessageIdentifier = pmi // Beneficiary bifi := wire.NewBeneficiaryIntermediaryFI() @@ -70,7 +70,7 @@ func main() { bifi.FinancialInstitution.Address.AddressLineOne = "Address One" bifi.FinancialInstitution.Address.AddressLineTwo = "Address Two" bifi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiaryIntermediaryFI(bifi) + fwm.BeneficiaryIntermediaryFI = bifi bfi := wire.NewBeneficiaryFI() bfi.FinancialInstitution.IdentificationCode = wire.DemandDepositAccountNumber @@ -79,7 +79,7 @@ func main() { bfi.FinancialInstitution.Address.AddressLineOne = "Address One" bfi.FinancialInstitution.Address.AddressLineTwo = "Address Two" bfi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiaryFI(bfi) + fwm.BeneficiaryFI = bfi ben := wire.NewBeneficiary() ben.Personal.IdentificationCode = wire.DriversLicenseNumber @@ -88,11 +88,11 @@ func main() { ben.Personal.Address.AddressLineOne = "Address One" ben.Personal.Address.AddressLineTwo = "Address Two" ben.Personal.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiary(ben) + fwm.Beneficiary = ben br := wire.NewBeneficiaryReference() br.BeneficiaryReference = "Reference" - fwm.SetBeneficiaryReference(br) + fwm.BeneficiaryReference = br debitDD := wire.NewAccountDebitedDrawdown() debitDD.IdentificationCode = wire.DemandDepositAccountNumber @@ -101,7 +101,7 @@ func main() { debitDD.Address.AddressLineOne = "Address One" debitDD.Address.AddressLineTwo = "Address Two" debitDD.Address.AddressLineThree = "Address Three" - fwm.SetAccountDebitedDrawdown(debitDD) + fwm.AccountDebitedDrawdown = debitDD // Originator o := wire.NewOriginator() @@ -111,7 +111,7 @@ func main() { o.Personal.Address.AddressLineOne = "Address One" o.Personal.Address.AddressLineTwo = "Address Two" o.Personal.Address.AddressLineThree = "Address Three" - fwm.SetOriginator(o) + fwm.Originator = o ofi := wire.NewOriginatorFI() ofi.FinancialInstitution.IdentificationCode = wire.DemandDepositAccountNumber @@ -120,7 +120,7 @@ func main() { ofi.FinancialInstitution.Address.AddressLineOne = "Address One" ofi.FinancialInstitution.Address.AddressLineTwo = "Address Two" ofi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetOriginatorFI(ofi) + fwm.OriginatorFI = ofi ifi := wire.NewInstructingFI() ifi.FinancialInstitution.IdentificationCode = wire.DemandDepositAccountNumber @@ -129,18 +129,18 @@ func main() { ifi.FinancialInstitution.Address.AddressLineOne = "Address One" ifi.FinancialInstitution.Address.AddressLineTwo = "Address Two" ifi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetInstructingFI(ifi) + fwm.InstructingFI = ifi creditDD := wire.NewAccountCreditedDrawdown() creditDD.DrawdownCreditAccountNumber = "123456789" - fwm.SetAccountCreditedDrawdown(creditDD) + fwm.AccountCreditedDrawdown = creditDD ob := wire.NewOriginatorToBeneficiary() ob.LineOne = "LineOne" ob.LineTwo = "LineTwo" ob.LineThree = "LineThree" ob.LineFour = "LineFour" - fwm.SetOriginatorToBeneficiary(ob) + fwm.OriginatorToBeneficiary = ob // FI to FI firfi := wire.NewFIReceiverFI() @@ -150,7 +150,7 @@ func main() { firfi.FIToFI.LineOne = "Line Four" firfi.FIToFI.LineOne = "Line Five" firfi.FIToFI.LineOne = "Line Six" - fwm.SetFIReceiverFI(firfi) + fwm.FIReceiverFI = firfi fiifi := wire.NewFIIntermediaryFI() fiifi.FIToFI.LineOne = "Line One" @@ -159,7 +159,7 @@ func main() { fiifi.FIToFI.LineOne = "Line Four" fiifi.FIToFI.LineOne = "Line Five" fiifi.FIToFI.LineOne = "Line Six" - fwm.SetFIIntermediaryFI(fiifi) + fwm.FIIntermediaryFI = fiifi fiifia := wire.NewFIIntermediaryFIAdvice() fiifia.Advice.AdviceCode = wire.AdviceCodeLetter @@ -169,7 +169,7 @@ func main() { fiifia.Advice.LineFour = "Line Four" fiifia.Advice.LineFive = "Line Five" fiifia.Advice.LineSix = "Line Six" - fwm.SetFIIntermediaryFIAdvice(fiifia) + fwm.FIIntermediaryFIAdvice = fiifia fibfi := wire.NewFIBeneficiaryFI() fibfi.FIToFI.LineOne = "Line One" @@ -178,7 +178,7 @@ func main() { fibfi.FIToFI.LineFour = "Line Four" fibfi.FIToFI.LineFive = "Line Five" fibfi.FIToFI.LineSix = "Line Six" - fwm.SetFIBeneficiaryFI(fibfi) + fwm.FIBeneficiaryFI = fibfi fibfia := wire.NewFIBeneficiaryFIAdvice() fibfia.Advice.AdviceCode = wire.AdviceCodeTelex @@ -188,7 +188,7 @@ func main() { fibfia.Advice.LineFour = "Line Four" fibfia.Advice.LineFive = "Line Five" fibfia.Advice.LineSix = "Line Six" - fwm.SetFIBeneficiaryFIAdvice(fibfia) + fwm.FIBeneficiaryFIAdvice = fibfia fib := wire.NewFIBeneficiary() fib.FIToFI.LineOne = "Line One" @@ -197,7 +197,7 @@ func main() { fib.FIToFI.LineFour = "Line Four" fib.FIToFI.LineFive = "Line Five" fib.FIToFI.LineSix = "Line Six" - fwm.SetFIBeneficiary(fib) + fwm.FIBeneficiary = fib fiba := wire.NewFIBeneficiaryAdvice() fiba.Advice.AdviceCode = wire.AdviceCodeLetter @@ -207,12 +207,12 @@ func main() { fiba.Advice.LineFour = "Line Four" fiba.Advice.LineFive = "Line Five" fiba.Advice.LineSix = "Line Six" - fwm.SetFIBeneficiaryAdvice(fiba) + fwm.FIBeneficiaryAdvice = fiba pm := wire.NewFIPaymentMethodToBeneficiary() pm.PaymentMethod = "CHECK" pm.AdditionalInformation = "Additional Information" - fwm.SetFIPaymentMethodToBeneficiary(pm) + fwm.FIPaymentMethodToBeneficiary = pm fifi := wire.NewFIAdditionalFIToFI() fiifi.FIToFI.LineOne = "Line One" @@ -221,7 +221,7 @@ func main() { fiifi.FIToFI.LineOne = "Line Four" fiifi.FIToFI.LineOne = "Line Five" fiifi.FIToFI.LineOne = "Line Six" - fwm.SetFIAdditionalFIToFI(fifi) + fwm.FIAdditionalFIToFI = fifi file.AddFEDWireMessage(fwm) diff --git a/examples/customerTransfer-write/main.go b/examples/customerTransfer-write/main.go index 132a7777..167c03ba 100644 --- a/examples/customerTransfer-write/main.go +++ b/examples/customerTransfer-write/main.go @@ -15,52 +15,52 @@ import ( func main() { file := wire.NewFile() - fwm := wire.NewFEDWireMessage() + fwm := wire.FEDWireMessage{} // Mandatory Fields ss := wire.NewSenderSupplied() ss.UserRequestCorrelation = "User Req" ss.MessageDuplicationCode = wire.MessageDuplicationOriginal - fwm.SetSenderSupplied(ss) + fwm.SenderSupplied = ss tst := wire.NewTypeSubType() tst.TypeCode = wire.FundsTransfer tst.SubTypeCode = wire.BasicFundsTransfer - fwm.SetTypeSubType(tst) + fwm.TypeSubType = tst imad := wire.NewInputMessageAccountabilityData() imad.InputCycleDate = time.Now().Format("20060102") imad.InputSource = "Source08" imad.InputSequenceNumber = "000001" - fwm.SetInputMessageAccountabilityData(imad) + fwm.InputMessageAccountabilityData = imad amt := wire.NewAmount() amt.Amount = "000001234567" - fwm.SetAmount(amt) + fwm.Amount = amt sdi := wire.NewSenderDepositoryInstitution() sdi.SenderABANumber = "121042882" sdi.SenderShortName = "Wells Fargo NA" - fwm.SetSenderDepositoryInstitution(sdi) + fwm.SenderDepositoryInstitution = sdi rdi := wire.NewReceiverDepositoryInstitution() rdi.ReceiverABANumber = "231380104" rdi.ReceiverShortName = "Citadel" - fwm.SetReceiverDepositoryInstitution(rdi) + fwm.ReceiverDepositoryInstitution = rdi bfc := wire.NewBusinessFunctionCode() bfc.BusinessFunctionCode = wire.CustomerTransfer bfc.TransactionTypeCode = " " - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc // Other Transfer Information sr := wire.NewSenderReference() sr.SenderReference = "Sender Reference" - fwm.SetSenderReference(sr) + fwm.SenderReference = sr pmi := wire.NewPreviousMessageIdentifier() pmi.PreviousMessageIdentifier = "Previous Message Ident" - fwm.SetPreviousMessageIdentifier(pmi) + fwm.PreviousMessageIdentifier = pmi c := wire.NewCharges() c.ChargeDetails = "B" @@ -68,16 +68,16 @@ func main() { c.SendersChargesTwo = "USD2,99" c.SendersChargesThree = "USD3,99" c.SendersChargesFour = "USD1,00" - fwm.SetCharges(c) + fwm.Charges = c ia := wire.NewInstructedAmount() ia.CurrencyCode = "USD" ia.Amount = "4567,89" - fwm.SetInstructedAmount(ia) + fwm.InstructedAmount = ia eRate := wire.NewExchangeRate() eRate.ExchangeRate = "1,2345" - fwm.SetExchangeRate(eRate) + fwm.ExchangeRate = eRate // Beneficiary bifi := wire.NewBeneficiaryIntermediaryFI() @@ -87,7 +87,7 @@ func main() { bifi.FinancialInstitution.Address.AddressLineOne = "Address One" bifi.FinancialInstitution.Address.AddressLineTwo = "Address Two" bifi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiaryIntermediaryFI(bifi) + fwm.BeneficiaryIntermediaryFI = bifi bfi := wire.NewBeneficiaryFI() bfi.FinancialInstitution.IdentificationCode = wire.DemandDepositAccountNumber @@ -96,7 +96,7 @@ func main() { bfi.FinancialInstitution.Address.AddressLineOne = "Address One" bfi.FinancialInstitution.Address.AddressLineTwo = "Address Two" bfi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiaryFI(bfi) + fwm.BeneficiaryFI = bfi ben := wire.NewBeneficiary() ben.Personal.IdentificationCode = wire.DriversLicenseNumber @@ -105,11 +105,11 @@ func main() { ben.Personal.Address.AddressLineOne = "Address One" ben.Personal.Address.AddressLineTwo = "Address Two" ben.Personal.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiary(ben) + fwm.Beneficiary = ben br := wire.NewBeneficiaryReference() br.BeneficiaryReference = "Reference" - fwm.SetBeneficiaryReference(br) + fwm.BeneficiaryReference = br // Originator o := wire.NewOriginator() @@ -119,7 +119,7 @@ func main() { o.Personal.Address.AddressLineOne = "Address One" o.Personal.Address.AddressLineTwo = "Address Two" o.Personal.Address.AddressLineThree = "Address Three" - fwm.SetOriginator(o) + fwm.Originator = o ofi := wire.NewOriginatorFI() ofi.FinancialInstitution.IdentificationCode = wire.DemandDepositAccountNumber @@ -128,7 +128,7 @@ func main() { ofi.FinancialInstitution.Address.AddressLineOne = "Address One" ofi.FinancialInstitution.Address.AddressLineTwo = "Address Two" ofi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetOriginatorFI(ofi) + fwm.OriginatorFI = ofi ifi := wire.NewInstructingFI() ifi.FinancialInstitution.IdentificationCode = wire.DemandDepositAccountNumber @@ -137,14 +137,14 @@ func main() { ifi.FinancialInstitution.Address.AddressLineOne = "Address One" ifi.FinancialInstitution.Address.AddressLineTwo = "Address Two" ifi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetInstructingFI(ifi) + fwm.InstructingFI = ifi ob := wire.NewOriginatorToBeneficiary() ob.LineOne = "LineOne" ob.LineTwo = "LineTwo" ob.LineThree = "LineThree" ob.LineFour = "LineFour" - fwm.SetOriginatorToBeneficiary(ob) + fwm.OriginatorToBeneficiary = ob // FI to FI firfi := wire.NewFIReceiverFI() @@ -154,7 +154,7 @@ func main() { firfi.FIToFI.LineOne = "Line Four" firfi.FIToFI.LineOne = "Line Five" firfi.FIToFI.LineOne = "Line Six" - fwm.SetFIReceiverFI(firfi) + fwm.FIReceiverFI = firfi fiifi := wire.NewFIIntermediaryFI() fiifi.FIToFI.LineOne = "Line One" @@ -163,7 +163,7 @@ func main() { fiifi.FIToFI.LineOne = "Line Four" fiifi.FIToFI.LineOne = "Line Five" fiifi.FIToFI.LineOne = "Line Six" - fwm.SetFIIntermediaryFI(fiifi) + fwm.FIIntermediaryFI = fiifi fiifia := wire.NewFIIntermediaryFIAdvice() fiifia.Advice.AdviceCode = wire.AdviceCodeLetter @@ -173,7 +173,7 @@ func main() { fiifia.Advice.LineFour = "Line Four" fiifia.Advice.LineFive = "Line Five" fiifia.Advice.LineSix = "Line Six" - fwm.SetFIIntermediaryFIAdvice(fiifia) + fwm.FIIntermediaryFIAdvice = fiifia fibfi := wire.NewFIBeneficiaryFI() fibfi.FIToFI.LineOne = "Line One" @@ -182,7 +182,7 @@ func main() { fibfi.FIToFI.LineFour = "Line Four" fibfi.FIToFI.LineFive = "Line Five" fibfi.FIToFI.LineSix = "Line Six" - fwm.SetFIBeneficiaryFI(fibfi) + fwm.FIBeneficiaryFI = fibfi fibfia := wire.NewFIBeneficiaryFIAdvice() fibfia.Advice.AdviceCode = wire.AdviceCodeTelex @@ -192,7 +192,7 @@ func main() { fibfia.Advice.LineFour = "Line Four" fibfia.Advice.LineFive = "Line Five" fibfia.Advice.LineSix = "Line Six" - fwm.SetFIBeneficiaryFIAdvice(fibfia) + fwm.FIBeneficiaryFIAdvice = fibfia fib := wire.NewFIBeneficiary() fib.FIToFI.LineOne = "Line One" @@ -201,7 +201,7 @@ func main() { fib.FIToFI.LineFour = "Line Four" fib.FIToFI.LineFive = "Line Five" fib.FIToFI.LineSix = "Line Six" - fwm.SetFIBeneficiary(fib) + fwm.FIBeneficiary = fib fiba := wire.NewFIBeneficiaryAdvice() fiba.Advice.AdviceCode = wire.AdviceCodeLetter @@ -211,11 +211,11 @@ func main() { fiba.Advice.LineFour = "Line Four" fiba.Advice.LineFive = "Line Five" fiba.Advice.LineSix = "Line Six" - fwm.SetFIBeneficiaryAdvice(fiba) + fwm.FIBeneficiaryAdvice = fiba pm := wire.NewFIPaymentMethodToBeneficiary() pm.AdditionalInformation = "Additional Information" - fwm.SetFIPaymentMethodToBeneficiary(pm) + fwm.FIPaymentMethodToBeneficiary = pm fifi := wire.NewFIAdditionalFIToFI() fifi.AdditionalFIToFI.LineOne = "Line One" @@ -224,7 +224,7 @@ func main() { fifi.AdditionalFIToFI.LineFour = "Line Four" fifi.AdditionalFIToFI.LineFive = "Line Five" fifi.AdditionalFIToFI.LineSix = "Line Six" - fwm.SetFIAdditionalFIToFI(fifi) + fwm.FIAdditionalFIToFI = fifi file.AddFEDWireMessage(fwm) diff --git a/examples/customerTransferPlus-write/main.go b/examples/customerTransferPlus-write/main.go index b417244b..34cccb1c 100644 --- a/examples/customerTransferPlus-write/main.go +++ b/examples/customerTransferPlus-write/main.go @@ -14,57 +14,57 @@ import ( func main() { file := wire.NewFile() - fwm := wire.NewFEDWireMessage() + fwm := wire.FEDWireMessage{} // Mandatory Fields ss := wire.NewSenderSupplied() ss.UserRequestCorrelation = "User Req" ss.MessageDuplicationCode = wire.MessageDuplicationOriginal - fwm.SetSenderSupplied(ss) + fwm.SenderSupplied = ss tst := wire.NewTypeSubType() tst.TypeCode = wire.FundsTransfer tst.SubTypeCode = wire.BasicFundsTransfer - fwm.SetTypeSubType(tst) + fwm.TypeSubType = tst imad := wire.NewInputMessageAccountabilityData() imad.InputCycleDate = time.Now().Format("20060102") imad.InputSource = "Source08" imad.InputSequenceNumber = "000001" - fwm.SetInputMessageAccountabilityData(imad) + fwm.InputMessageAccountabilityData = imad amt := wire.NewAmount() amt.Amount = "000001234567" - fwm.SetAmount(amt) + fwm.Amount = amt sdi := wire.NewSenderDepositoryInstitution() sdi.SenderABANumber = "121042882" sdi.SenderShortName = "Wells Fargo NA" - fwm.SetSenderDepositoryInstitution(sdi) + fwm.SenderDepositoryInstitution = sdi rdi := wire.NewReceiverDepositoryInstitution() rdi.ReceiverABANumber = "231380104" rdi.ReceiverShortName = "Citadel" - fwm.SetReceiverDepositoryInstitution(rdi) + fwm.ReceiverDepositoryInstitution = rdi bfc := wire.NewBusinessFunctionCode() bfc.BusinessFunctionCode = wire.CustomerTransferPlus bfc.TransactionTypeCode = " " - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc // Other Transfer Information sr := wire.NewSenderReference() sr.SenderReference = "Sender Reference" - fwm.SetSenderReference(sr) + fwm.SenderReference = sr pmi := wire.NewPreviousMessageIdentifier() pmi.PreviousMessageIdentifier = "Previous Message Ident" - fwm.SetPreviousMessageIdentifier(pmi) + fwm.PreviousMessageIdentifier = pmi li := wire.NewLocalInstrument() li.LocalInstrumentCode = wire.ProprietaryLocalInstrumentCode li.ProprietaryCode = "PROP CODE" - fwm.SetLocalInstrument(li) + fwm.LocalInstrument = li pn := wire.NewPaymentNotification() pn.PaymentNotificationIndicator = "1" @@ -73,7 +73,7 @@ func main() { pn.ContactPhoneNumber = "5555551212" pn.ContactMobileNumber = "5551231212" pn.ContactFaxNumber = "5554561212" - fwm.SetPaymentNotification(pn) + fwm.PaymentNotification = pn c := wire.NewCharges() c.ChargeDetails = "B" @@ -81,16 +81,16 @@ func main() { c.SendersChargesTwo = "USD2,99" c.SendersChargesThree = "USD3,99" c.SendersChargesFour = "USD1,00" - fwm.SetCharges(c) + fwm.Charges = c ia := wire.NewInstructedAmount() ia.CurrencyCode = "USD" ia.Amount = "4567,89" - fwm.SetInstructedAmount(ia) + fwm.InstructedAmount = ia eRate := wire.NewExchangeRate() eRate.ExchangeRate = "1,2345" - fwm.SetExchangeRate(eRate) + fwm.ExchangeRate = eRate // Beneficiary bifi := wire.NewBeneficiaryIntermediaryFI() @@ -100,7 +100,7 @@ func main() { bifi.FinancialInstitution.Address.AddressLineOne = "Address One" bifi.FinancialInstitution.Address.AddressLineTwo = "Address Two" bifi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiaryIntermediaryFI(bifi) + fwm.BeneficiaryIntermediaryFI = bifi bfi := wire.NewBeneficiaryFI() bfi.FinancialInstitution.IdentificationCode = wire.DemandDepositAccountNumber @@ -109,7 +109,7 @@ func main() { bfi.FinancialInstitution.Address.AddressLineOne = "Address One" bfi.FinancialInstitution.Address.AddressLineTwo = "Address Two" bfi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiaryFI(bfi) + fwm.BeneficiaryFI = bfi ben := wire.NewBeneficiary() ben.Personal.IdentificationCode = wire.DriversLicenseNumber @@ -118,11 +118,11 @@ func main() { ben.Personal.Address.AddressLineOne = "Address One" ben.Personal.Address.AddressLineTwo = "Address Two" ben.Personal.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiary(ben) + fwm.Beneficiary = ben br := wire.NewBeneficiaryReference() br.BeneficiaryReference = "Reference" - fwm.SetBeneficiaryReference(br) + fwm.BeneficiaryReference = br // Originator o := wire.NewOriginator() @@ -132,7 +132,7 @@ func main() { o.Personal.Address.AddressLineOne = "Address One" o.Personal.Address.AddressLineTwo = "Address Two" o.Personal.Address.AddressLineThree = "Address Three" - fwm.SetOriginator(o) + fwm.Originator = o oof := wire.NewOriginatorOptionF() oof.PartyIdentifier = "TXID/123-45-6789" @@ -140,7 +140,7 @@ func main() { oof.LineOne = "1/1234" oof.LineTwo = "2/1000 Colonial Farm Rd" oof.LineThree = "5/Pottstown" - fwm.SetOriginatorOptionF(oof) + fwm.OriginatorOptionF = oof ofi := wire.NewOriginatorFI() ofi.FinancialInstitution.IdentificationCode = wire.DemandDepositAccountNumber @@ -149,7 +149,7 @@ func main() { ofi.FinancialInstitution.Address.AddressLineOne = "Address One" ofi.FinancialInstitution.Address.AddressLineTwo = "Address Two" ofi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetOriginatorFI(ofi) + fwm.OriginatorFI = ofi ifi := wire.NewInstructingFI() ifi.FinancialInstitution.IdentificationCode = wire.DemandDepositAccountNumber @@ -158,14 +158,14 @@ func main() { ifi.FinancialInstitution.Address.AddressLineOne = "FI Address One" ifi.FinancialInstitution.Address.AddressLineTwo = "FI Address Two" ifi.FinancialInstitution.Address.AddressLineThree = "FI Address Three" - fwm.SetInstructingFI(ifi) + fwm.InstructingFI = ifi ob := wire.NewOriginatorToBeneficiary() ob.LineOne = "LineOne" ob.LineTwo = "LineTwo" ob.LineThree = "LineThree" ob.LineFour = "LineFour" - fwm.SetOriginatorToBeneficiary(ob) + fwm.OriginatorToBeneficiary = ob // FI to FI fiifi := wire.NewFIIntermediaryFI() @@ -175,7 +175,7 @@ func main() { fiifi.FIToFI.LineOne = "" fiifi.FIToFI.LineOne = "" fiifi.FIToFI.LineOne = "" - fwm.SetFIIntermediaryFI(fiifi) + fwm.FIIntermediaryFI = fiifi fiifia := wire.NewFIIntermediaryFIAdvice() fiifia.Advice.AdviceCode = wire.AdviceCodeLetter @@ -185,7 +185,7 @@ func main() { fiifia.Advice.LineFour = "Intermediary Advice Line Four" fiifia.Advice.LineFive = "Line Five" fiifia.Advice.LineSix = "Line Six" - fwm.SetFIIntermediaryFIAdvice(fiifia) + fwm.FIIntermediaryFIAdvice = fiifia fibfi := wire.NewFIBeneficiaryFI() fibfi.FIToFI.LineOne = "Beneficiary FI Line One" @@ -194,7 +194,7 @@ func main() { fibfi.FIToFI.LineFour = "Beneficiary FI Line Four" fibfi.FIToFI.LineFive = "Beneficiary FI Line Five" fibfi.FIToFI.LineSix = "Beneficiary FI Line Six" - fwm.SetFIBeneficiaryFI(fibfi) + fwm.FIBeneficiaryFI = fibfi fibfia := wire.NewFIBeneficiaryFIAdvice() fibfia.Advice.AdviceCode = wire.AdviceCodeTelex @@ -204,7 +204,7 @@ func main() { fibfia.Advice.LineFour = "Line Four" fibfia.Advice.LineFive = "Line Five" fibfia.Advice.LineSix = "Line Six" - fwm.SetFIBeneficiaryFIAdvice(fibfia) + fwm.FIBeneficiaryFIAdvice = fibfia fib := wire.NewFIBeneficiary() fib.FIToFI.LineOne = "Line One" @@ -213,7 +213,7 @@ func main() { fib.FIToFI.LineFour = "Line Four" fib.FIToFI.LineFive = "Line Five" fib.FIToFI.LineSix = "Line Six" - fwm.SetFIBeneficiary(fib) + fwm.FIBeneficiary = fib fiba := wire.NewFIBeneficiaryAdvice() fiba.Advice.AdviceCode = wire.AdviceCodeLetter @@ -223,11 +223,11 @@ func main() { fiba.Advice.LineFour = "Line Four" fiba.Advice.LineFive = "Line Five" fiba.Advice.LineSix = "Line Six" - fwm.SetFIBeneficiaryAdvice(fiba) + fwm.FIBeneficiaryAdvice = fiba pm := wire.NewFIPaymentMethodToBeneficiary() pm.AdditionalInformation = "Additional Information" - fwm.SetFIPaymentMethodToBeneficiary(pm) + fwm.FIPaymentMethodToBeneficiary = pm fifi := wire.NewFIAdditionalFIToFI() fifi.AdditionalFIToFI.LineOne = "Line One" @@ -236,7 +236,7 @@ func main() { fifi.AdditionalFIToFI.LineFour = "Line Four" fifi.AdditionalFIToFI.LineFive = "Line Five" fifi.AdditionalFIToFI.LineSix = "Line Six" - fwm.SetFIAdditionalFIToFI(fifi) + fwm.FIAdditionalFIToFI = fifi // ServiceMessage sm := wire.NewServiceMessage() @@ -252,7 +252,7 @@ func main() { sm.LineTen = "Line Ten" sm.LineEleven = "Line Eleven" sm.LineTwelve = "line Twelve" - fwm.SetServiceMessage(sm) + fwm.ServiceMessage = sm file.AddFEDWireMessage(fwm) diff --git a/examples/customerTransferPlusCOVS-write/main.go b/examples/customerTransferPlusCOVS-write/main.go index df63392f..05c02da6 100644 --- a/examples/customerTransferPlusCOVS-write/main.go +++ b/examples/customerTransferPlusCOVS-write/main.go @@ -14,57 +14,57 @@ import ( func main() { file := wire.NewFile() - fwm := wire.NewFEDWireMessage() + fwm := wire.FEDWireMessage{} // Mandatory Fields ss := wire.NewSenderSupplied() ss.UserRequestCorrelation = "User Req" ss.MessageDuplicationCode = wire.MessageDuplicationOriginal - fwm.SetSenderSupplied(ss) + fwm.SenderSupplied = ss tst := wire.NewTypeSubType() tst.TypeCode = wire.FundsTransfer tst.SubTypeCode = wire.BasicFundsTransfer - fwm.SetTypeSubType(tst) + fwm.TypeSubType = tst imad := wire.NewInputMessageAccountabilityData() imad.InputCycleDate = time.Now().Format("20060102") imad.InputSource = "Source08" imad.InputSequenceNumber = "000001" - fwm.SetInputMessageAccountabilityData(imad) + fwm.InputMessageAccountabilityData = imad amt := wire.NewAmount() amt.Amount = "000001234567" - fwm.SetAmount(amt) + fwm.Amount = amt sdi := wire.NewSenderDepositoryInstitution() sdi.SenderABANumber = "121042882" sdi.SenderShortName = "Wells Fargo NA" - fwm.SetSenderDepositoryInstitution(sdi) + fwm.SenderDepositoryInstitution = sdi rdi := wire.NewReceiverDepositoryInstitution() rdi.ReceiverABANumber = "231380104" rdi.ReceiverShortName = "Citadel" - fwm.SetReceiverDepositoryInstitution(rdi) + fwm.ReceiverDepositoryInstitution = rdi bfc := wire.NewBusinessFunctionCode() bfc.BusinessFunctionCode = wire.CustomerTransferPlus bfc.TransactionTypeCode = " " - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc // Other Transfer Information sr := wire.NewSenderReference() sr.SenderReference = "Sender Reference" - fwm.SetSenderReference(sr) + fwm.SenderReference = sr pmi := wire.NewPreviousMessageIdentifier() pmi.PreviousMessageIdentifier = "Previous Message Ident" - fwm.SetPreviousMessageIdentifier(pmi) + fwm.PreviousMessageIdentifier = pmi li := wire.NewLocalInstrument() li.LocalInstrumentCode = wire.SequenceBCoverPaymentStructured li.ProprietaryCode = "" - fwm.SetLocalInstrument(li) + fwm.LocalInstrument = li pn := wire.NewPaymentNotification() pn.PaymentNotificationIndicator = "1" @@ -73,7 +73,7 @@ func main() { pn.ContactPhoneNumber = "5555551212" pn.ContactMobileNumber = "5551231212" pn.ContactFaxNumber = "5554561212" - fwm.SetPaymentNotification(pn) + fwm.PaymentNotification = pn // Beneficiary bifi := wire.NewBeneficiaryIntermediaryFI() @@ -83,7 +83,7 @@ func main() { bifi.FinancialInstitution.Address.AddressLineOne = "Address One" bifi.FinancialInstitution.Address.AddressLineTwo = "Address Two" bifi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiaryIntermediaryFI(bifi) + fwm.BeneficiaryIntermediaryFI = bifi bfi := wire.NewBeneficiaryFI() bfi.FinancialInstitution.IdentificationCode = wire.DemandDepositAccountNumber @@ -92,7 +92,7 @@ func main() { bfi.FinancialInstitution.Address.AddressLineOne = "Address One" bfi.FinancialInstitution.Address.AddressLineTwo = "Address Two" bfi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiaryFI(bfi) + fwm.BeneficiaryFI = bfi ben := wire.NewBeneficiary() ben.Personal.IdentificationCode = wire.DriversLicenseNumber @@ -101,11 +101,11 @@ func main() { ben.Personal.Address.AddressLineOne = "Address One" ben.Personal.Address.AddressLineTwo = "Address Two" ben.Personal.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiary(ben) + fwm.Beneficiary = ben br := wire.NewBeneficiaryReference() br.BeneficiaryReference = "Reference" - fwm.SetBeneficiaryReference(br) + fwm.BeneficiaryReference = br // Originator o := wire.NewOriginator() @@ -115,7 +115,7 @@ func main() { o.Personal.Address.AddressLineOne = "Address One" o.Personal.Address.AddressLineTwo = "Address Two" o.Personal.Address.AddressLineThree = "Address Three" - fwm.SetOriginator(o) + fwm.Originator = o oof := wire.NewOriginatorOptionF() oof.PartyIdentifier = "TXID/123-45-6789" @@ -123,7 +123,7 @@ func main() { oof.LineOne = "1/1234" oof.LineTwo = "2/1000 Colonial Farm Rd" oof.LineThree = "5/Pottstown" - fwm.SetOriginatorOptionF(oof) + fwm.OriginatorOptionF = oof ofi := wire.NewOriginatorFI() ofi.FinancialInstitution.IdentificationCode = wire.DemandDepositAccountNumber @@ -132,7 +132,7 @@ func main() { ofi.FinancialInstitution.Address.AddressLineOne = "Address One" ofi.FinancialInstitution.Address.AddressLineTwo = "Address Two" ofi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetOriginatorFI(ofi) + fwm.OriginatorFI = ofi ifi := wire.NewInstructingFI() ifi.FinancialInstitution.IdentificationCode = wire.DemandDepositAccountNumber @@ -141,14 +141,14 @@ func main() { ifi.FinancialInstitution.Address.AddressLineOne = "Address One" ifi.FinancialInstitution.Address.AddressLineTwo = "Address Two" ifi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetInstructingFI(ifi) + fwm.InstructingFI = ifi ob := wire.NewOriginatorToBeneficiary() ob.LineOne = "LineOne" ob.LineTwo = "LineTwo" ob.LineThree = "LineThree" ob.LineFour = "LineFour" - fwm.SetOriginatorToBeneficiary(ob) + fwm.OriginatorToBeneficiary = ob // FI to FI fiifi := wire.NewFIIntermediaryFI() @@ -158,7 +158,7 @@ func main() { fiifi.FIToFI.LineOne = "Line Four" fiifi.FIToFI.LineOne = "Line Five" fiifi.FIToFI.LineOne = "Line Six" - fwm.SetFIIntermediaryFI(fiifi) + fwm.FIIntermediaryFI = fiifi fiifia := wire.NewFIIntermediaryFIAdvice() fiifia.Advice.AdviceCode = wire.AdviceCodeLetter @@ -168,7 +168,7 @@ func main() { fiifia.Advice.LineFour = "Line Four" fiifia.Advice.LineFive = "Line Five" fiifia.Advice.LineSix = "Line Six" - fwm.SetFIIntermediaryFIAdvice(fiifia) + fwm.FIIntermediaryFIAdvice = fiifia fibfi := wire.NewFIBeneficiaryFI() fibfi.FIToFI.LineOne = "Line One" @@ -177,7 +177,7 @@ func main() { fibfi.FIToFI.LineFour = "Line Four" fibfi.FIToFI.LineFive = "Line Five" fibfi.FIToFI.LineSix = "Line Six" - fwm.SetFIBeneficiaryFI(fibfi) + fwm.FIBeneficiaryFI = fibfi fibfia := wire.NewFIBeneficiaryFIAdvice() fibfia.Advice.AdviceCode = wire.AdviceCodeTelex @@ -187,7 +187,7 @@ func main() { fibfia.Advice.LineFour = "Line Four" fibfia.Advice.LineFive = "Line Five" fibfia.Advice.LineSix = "Line Six" - fwm.SetFIBeneficiaryFIAdvice(fibfia) + fwm.FIBeneficiaryFIAdvice = fibfia fib := wire.NewFIBeneficiary() fib.FIToFI.LineOne = "Line One" @@ -196,7 +196,7 @@ func main() { fib.FIToFI.LineFour = "Line Four" fib.FIToFI.LineFive = "Line Five" fib.FIToFI.LineSix = "Line Six" - fwm.SetFIBeneficiary(fib) + fwm.FIBeneficiary = fib fiba := wire.NewFIBeneficiaryAdvice() fiba.Advice.AdviceCode = wire.AdviceCodeLetter @@ -206,11 +206,11 @@ func main() { fiba.Advice.LineFour = "Line Four" fiba.Advice.LineFive = "Line Five" fiba.Advice.LineSix = "Line Six" - fwm.SetFIBeneficiaryAdvice(fiba) + fwm.FIBeneficiaryAdvice = fiba pm := wire.NewFIPaymentMethodToBeneficiary() pm.AdditionalInformation = "Additional Information" - fwm.SetFIPaymentMethodToBeneficiary(pm) + fwm.FIPaymentMethodToBeneficiary = pm fifi := wire.NewFIAdditionalFIToFI() fifi.AdditionalFIToFI.LineOne = "Line One" @@ -219,13 +219,13 @@ func main() { fifi.AdditionalFIToFI.LineFour = "Line Four" fifi.AdditionalFIToFI.LineFive = "Line Five" fifi.AdditionalFIToFI.LineSix = "Line Six" - fwm.SetFIAdditionalFIToFI(fifi) + fwm.FIAdditionalFIToFI = fifi // Cover Payment Information cia := wire.NewCurrencyInstructedAmount() cia.SwiftFieldTag = "Swift Field Tag" cia.Amount = "1500,49" - fwm.SetCurrencyInstructedAmount(cia) + fwm.CurrencyInstructedAmount = cia oc := wire.NewOrderingCustomer() oc.CoverPayment.SwiftFieldTag = "Swift Field Tag" oc.CoverPayment.SwiftLineOne = "Swift Line One" @@ -233,7 +233,7 @@ func main() { oc.CoverPayment.SwiftLineThree = "Swift Line Three" oc.CoverPayment.SwiftLineFour = "Swift Line Four" oc.CoverPayment.SwiftLineFive = "Swift Line Five" - fwm.SetOrderingCustomer(oc) + fwm.OrderingCustomer = oc oi := wire.NewOrderingInstitution() oi.CoverPayment.SwiftFieldTag = "Swift Field Tag" oi.CoverPayment.SwiftLineOne = "Swift Line One" @@ -241,7 +241,7 @@ func main() { oi.CoverPayment.SwiftLineThree = "Swift Line Three" oi.CoverPayment.SwiftLineFour = "Swift Line Four" oi.CoverPayment.SwiftLineFive = "Swift Line Five" - fwm.SetOrderingInstitution(oi) + fwm.OrderingInstitution = oi ii := wire.NewIntermediaryInstitution() ii.CoverPayment.SwiftFieldTag = "Swift Field Tag" ii.CoverPayment.SwiftLineOne = "Swift Line One" @@ -249,7 +249,7 @@ func main() { ii.CoverPayment.SwiftLineThree = "Swift Line Three" ii.CoverPayment.SwiftLineFour = "Swift Line Four" ii.CoverPayment.SwiftLineFive = "Swift Line Five" - fwm.SetIntermediaryInstitution(ii) + fwm.IntermediaryInstitution = ii iAccount := wire.NewInstitutionAccount() iAccount.CoverPayment.SwiftFieldTag = "Swift Field Tag" iAccount.CoverPayment.SwiftLineOne = "Swift Line One" @@ -257,7 +257,7 @@ func main() { iAccount.CoverPayment.SwiftLineThree = "Swift Line Three" iAccount.CoverPayment.SwiftLineFour = "Swift Line Four" iAccount.CoverPayment.SwiftLineFive = "Swift Line Five" - fwm.SetInstitutionAccount(iAccount) + fwm.InstitutionAccount = iAccount bc := wire.NewBeneficiaryCustomer() bc.CoverPayment.SwiftFieldTag = "Swift Field Tag" bc.CoverPayment.SwiftLineOne = "Swift Line One" @@ -265,14 +265,14 @@ func main() { bc.CoverPayment.SwiftLineThree = "Swift Line Three" bc.CoverPayment.SwiftLineFour = "Swift Line Four" bc.CoverPayment.SwiftLineFive = "Swift Line Five" - fwm.SetBeneficiaryCustomer(bc) + fwm.BeneficiaryCustomer = bc ri := wire.NewRemittance() ri.CoverPayment.SwiftFieldTag = "Swift Field Tag" ri.CoverPayment.SwiftLineOne = "Swift Line One" ri.CoverPayment.SwiftLineTwo = "Swift Line Two" ri.CoverPayment.SwiftLineThree = "Swift Line Three" ri.CoverPayment.SwiftLineFour = "Swift Line Four" - fwm.SetRemittance(ri) + fwm.Remittance = ri str := wire.NewSenderToReceiver() str.CoverPayment.SwiftFieldTag = "Swift Field Tag" str.CoverPayment.SwiftLineOne = "Swift Line One" @@ -281,7 +281,7 @@ func main() { str.CoverPayment.SwiftLineFour = "Swift Line Four" str.CoverPayment.SwiftLineFive = "Swift Line Five" str.CoverPayment.SwiftLineSix = "Swift Line Six" - fwm.SetSenderToReceiver(str) + fwm.SenderToReceiver = str file.AddFEDWireMessage(fwm) diff --git a/examples/depositSendersAccount-write/main.go b/examples/depositSendersAccount-write/main.go index 7f4694a1..a8a15bd0 100644 --- a/examples/depositSendersAccount-write/main.go +++ b/examples/depositSendersAccount-write/main.go @@ -14,57 +14,57 @@ import ( func main() { file := wire.NewFile() - fwm := wire.NewFEDWireMessage() + fwm := wire.FEDWireMessage{} // Mandatory Fields ss := wire.NewSenderSupplied() ss.UserRequestCorrelation = "User Req" ss.MessageDuplicationCode = wire.MessageDuplicationOriginal - fwm.SetSenderSupplied(ss) + fwm.SenderSupplied = ss tst := wire.NewTypeSubType() tst.TypeCode = wire.SettlementTransfer tst.SubTypeCode = wire.BasicFundsTransfer - fwm.SetTypeSubType(tst) + fwm.TypeSubType = tst // InputMessageAccountabilityData imad := wire.NewInputMessageAccountabilityData() imad.InputCycleDate = time.Now().Format("20060102") imad.InputSource = "Source08" imad.InputSequenceNumber = "000001" - fwm.SetInputMessageAccountabilityData(imad) + fwm.InputMessageAccountabilityData = imad // Amount amt := wire.NewAmount() amt.Amount = "000001234567" - fwm.SetAmount(amt) + fwm.Amount = amt // SenderDepositoryInstitution sdi := wire.NewSenderDepositoryInstitution() sdi.SenderABANumber = "121042882" sdi.SenderShortName = "Wells Fargo NA" - fwm.SetSenderDepositoryInstitution(sdi) + fwm.SenderDepositoryInstitution = sdi rdi := wire.NewReceiverDepositoryInstitution() rdi.ReceiverABANumber = "231380104" rdi.ReceiverShortName = "Citadel" - fwm.SetReceiverDepositoryInstitution(rdi) + fwm.ReceiverDepositoryInstitution = rdi bfc := wire.NewBusinessFunctionCode() bfc.BusinessFunctionCode = wire.DepositSendersAccount bfc.TransactionTypeCode = " " - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc // Other Transfer Information // Sender Reference sr := wire.NewSenderReference() sr.SenderReference = "Sender Reference" - fwm.SetSenderReference(sr) + fwm.SenderReference = sr // Previous Message Identifier pmi := wire.NewPreviousMessageIdentifier() pmi.PreviousMessageIdentifier = "Previous Message Ident" - fwm.SetPreviousMessageIdentifier(pmi) + fwm.PreviousMessageIdentifier = pmi // Beneficiary // Beneficiary Intermediary FI @@ -75,7 +75,7 @@ func main() { bifi.FinancialInstitution.Address.AddressLineOne = "Address One" bifi.FinancialInstitution.Address.AddressLineTwo = "Address Two" bifi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiaryIntermediaryFI(bifi) + fwm.BeneficiaryIntermediaryFI = bifi // Beneficiary FI bfi := wire.NewBeneficiaryFI() @@ -85,7 +85,7 @@ func main() { bfi.FinancialInstitution.Address.AddressLineOne = "Address One" bfi.FinancialInstitution.Address.AddressLineTwo = "Address Two" bfi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiaryFI(bfi) + fwm.BeneficiaryFI = bfi // Beneficiary ben := wire.NewBeneficiary() @@ -95,12 +95,12 @@ func main() { ben.Personal.Address.AddressLineOne = "Address One" ben.Personal.Address.AddressLineTwo = "Address Two" ben.Personal.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiary(ben) + fwm.Beneficiary = ben // Beneficiary Reference br := wire.NewBeneficiaryReference() br.BeneficiaryReference = "Reference" - fwm.SetBeneficiaryReference(br) + fwm.BeneficiaryReference = br // Originator o := wire.NewOriginator() @@ -110,7 +110,7 @@ func main() { o.Personal.Address.AddressLineOne = "Address One" o.Personal.Address.AddressLineTwo = "Address Two" o.Personal.Address.AddressLineThree = "Address Three" - fwm.SetOriginator(o) + fwm.Originator = o // Originator FI ofi := wire.NewOriginatorFI() @@ -120,7 +120,7 @@ func main() { ofi.FinancialInstitution.Address.AddressLineOne = "Address One" ofi.FinancialInstitution.Address.AddressLineTwo = "Address Two" ofi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetOriginatorFI(ofi) + fwm.OriginatorFI = ofi // Instructing FI ifi := wire.NewInstructingFI() @@ -130,7 +130,7 @@ func main() { ifi.FinancialInstitution.Address.AddressLineOne = "Address One" ifi.FinancialInstitution.Address.AddressLineTwo = "Address Two" ifi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetInstructingFI(ifi) + fwm.InstructingFI = ifi // Originator To Beneficiary ob := wire.NewOriginatorToBeneficiary() @@ -138,7 +138,7 @@ func main() { ob.LineTwo = "LineTwo" ob.LineThree = "LineThree" ob.LineFour = "LineFour" - fwm.SetOriginatorToBeneficiary(ob) + fwm.OriginatorToBeneficiary = ob // FI to FI // FIReceiverFI @@ -149,7 +149,7 @@ func main() { firfi.FIToFI.LineOne = "FIToFI Line Four" firfi.FIToFI.LineOne = "FIToFI Line Five" firfi.FIToFI.LineOne = "FIToFI Line Six" - fwm.SetFIReceiverFI(firfi) + fwm.FIReceiverFI = firfi // FIIntermediaryFI fiifi := wire.NewFIIntermediaryFI() @@ -159,7 +159,7 @@ func main() { fiifi.FIToFI.LineOne = "FIIntermediaryFI Line Four" fiifi.FIToFI.LineOne = "FIIntermediaryFI Line Five" fiifi.FIToFI.LineOne = "FIIntermediaryFI Line Six" - fwm.SetFIIntermediaryFI(fiifi) + fwm.FIIntermediaryFI = fiifi // FIIntermediaryFIAdvice fiifia := wire.NewFIIntermediaryFIAdvice() @@ -170,7 +170,7 @@ func main() { fiifia.Advice.LineFour = "FIInterFIAdvice Line Four" fiifia.Advice.LineFive = "FIInterFIAdvice Line Five" fiifia.Advice.LineSix = "FIInterFIAdvice Line Six" - fwm.SetFIIntermediaryFIAdvice(fiifia) + fwm.FIIntermediaryFIAdvice = fiifia // FIBeneficiaryFI fibfi := wire.NewFIBeneficiaryFI() @@ -180,7 +180,7 @@ func main() { fibfi.FIToFI.LineFour = "FIBenFI Line Four" fibfi.FIToFI.LineFive = "FIBenFI Line Five" fibfi.FIToFI.LineSix = "FIBenFI Line Six" - fwm.SetFIBeneficiaryFI(fibfi) + fwm.FIBeneficiaryFI = fibfi // FIBeneficiaryFIAdvice fibfia := wire.NewFIBeneficiaryFIAdvice() @@ -191,7 +191,7 @@ func main() { fibfia.Advice.LineFour = "FIBenFIAdvice Line Four" fibfia.Advice.LineFive = "FIBenFIAdvice Line Five" fibfia.Advice.LineSix = "FIBenFIAdvice Line Six" - fwm.SetFIBeneficiaryFIAdvice(fibfia) + fwm.FIBeneficiaryFIAdvice = fibfia // FIBeneficiary fib := wire.NewFIBeneficiary() @@ -201,7 +201,7 @@ func main() { fib.FIToFI.LineFour = "FIBen Line Four" fib.FIToFI.LineFive = "FIBen Line Five" fib.FIToFI.LineSix = "FIBen Line Six" - fwm.SetFIBeneficiary(fib) + fwm.FIBeneficiary = fib // FIBeneficiaryAdvice fiba := wire.NewFIBeneficiaryAdvice() @@ -212,13 +212,13 @@ func main() { fiba.Advice.LineFour = "FIBenAdvice Line Four" fiba.Advice.LineFive = "FIBenAdvice Line Five" fiba.Advice.LineSix = "FIBenAdvice Line Six" - fwm.SetFIBeneficiaryAdvice(fiba) + fwm.FIBeneficiaryAdvice = fiba // FIPaymentMethodToBeneficiary pm := wire.NewFIPaymentMethodToBeneficiary() pm.PaymentMethod = "CHECK" pm.AdditionalInformation = "Additional Information" - fwm.SetFIPaymentMethodToBeneficiary(pm) + fwm.FIPaymentMethodToBeneficiary = pm // FIAdditionalFIToFI fifi := wire.NewFIAdditionalFIToFI() @@ -228,7 +228,7 @@ func main() { fifi.AdditionalFIToFI.LineFour = "FIAddFI Line Four" fifi.AdditionalFIToFI.LineFive = "FIAddFI Line Five" fifi.AdditionalFIToFI.LineSix = "FIAddFI Line Six" - fwm.SetFIAdditionalFIToFI(fifi) + fwm.FIAdditionalFIToFI = fifi file.AddFEDWireMessage(fwm) diff --git a/examples/drawDownRequest-write/main.go b/examples/drawDownRequest-write/main.go index f6f97082..cd0b56ab 100644 --- a/examples/drawDownRequest-write/main.go +++ b/examples/drawDownRequest-write/main.go @@ -14,52 +14,52 @@ import ( func main() { file := wire.NewFile() - fwm := wire.NewFEDWireMessage() + fwm := wire.FEDWireMessage{} // Mandatory Fields ss := wire.NewSenderSupplied() ss.UserRequestCorrelation = "User Req" ss.MessageDuplicationCode = wire.MessageDuplicationOriginal - fwm.SetSenderSupplied(ss) + fwm.SenderSupplied = ss tst := wire.NewTypeSubType() tst.TypeCode = wire.SettlementTransfer tst.SubTypeCode = wire.RequestCredit - fwm.SetTypeSubType(tst) + fwm.TypeSubType = tst imad := wire.NewInputMessageAccountabilityData() imad.InputCycleDate = time.Now().Format("20060102") imad.InputSource = "Source08" imad.InputSequenceNumber = "000001" - fwm.SetInputMessageAccountabilityData(imad) + fwm.InputMessageAccountabilityData = imad amt := wire.NewAmount() amt.Amount = "000001234567" - fwm.SetAmount(amt) + fwm.Amount = amt sdi := wire.NewSenderDepositoryInstitution() sdi.SenderABANumber = "121042882" sdi.SenderShortName = "Wells Fargo NA" - fwm.SetSenderDepositoryInstitution(sdi) + fwm.SenderDepositoryInstitution = sdi rdi := wire.NewReceiverDepositoryInstitution() rdi.ReceiverABANumber = "231380104" rdi.ReceiverShortName = "Citadel" - fwm.SetReceiverDepositoryInstitution(rdi) + fwm.ReceiverDepositoryInstitution = rdi bfc := wire.NewBusinessFunctionCode() bfc.BusinessFunctionCode = wire.BankDrawDownRequest bfc.TransactionTypeCode = " " - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc // Other Transfer Information sr := wire.NewSenderReference() sr.SenderReference = "Sender Reference" - fwm.SetSenderReference(sr) + fwm.SenderReference = sr pmi := wire.NewPreviousMessageIdentifier() pmi.PreviousMessageIdentifier = "Previous Message Ident" - fwm.SetPreviousMessageIdentifier(pmi) + fwm.PreviousMessageIdentifier = pmi // Beneficiary bifi := wire.NewBeneficiaryIntermediaryFI() @@ -69,7 +69,7 @@ func main() { bifi.FinancialInstitution.Address.AddressLineOne = "DrawDown Address One" bifi.FinancialInstitution.Address.AddressLineTwo = "DrawDown Address Two" bifi.FinancialInstitution.Address.AddressLineThree = "DrawDown Address Three" - fwm.SetBeneficiaryIntermediaryFI(bifi) + fwm.BeneficiaryIntermediaryFI = bifi bfi := wire.NewBeneficiaryFI() bfi.FinancialInstitution.IdentificationCode = wire.DemandDepositAccountNumber @@ -78,7 +78,7 @@ func main() { bfi.FinancialInstitution.Address.AddressLineOne = "DrawDown Address One" bfi.FinancialInstitution.Address.AddressLineTwo = "DrawDown Address Two" bfi.FinancialInstitution.Address.AddressLineThree = "DrawDown Address Three" - fwm.SetBeneficiaryFI(bfi) + fwm.BeneficiaryFI = bfi ben := wire.NewBeneficiary() ben.Personal.IdentificationCode = wire.DriversLicenseNumber @@ -87,11 +87,11 @@ func main() { ben.Personal.Address.AddressLineOne = "DrawDown Address One" ben.Personal.Address.AddressLineTwo = "DrawDown Address Two" ben.Personal.Address.AddressLineThree = "DrawDown Address Three" - fwm.SetBeneficiary(ben) + fwm.Beneficiary = ben br := wire.NewBeneficiaryReference() br.BeneficiaryReference = "Drawdown Reference" - fwm.SetBeneficiaryReference(br) + fwm.BeneficiaryReference = br debitDD := wire.NewAccountDebitedDrawdown() debitDD.IdentificationCode = wire.DemandDepositAccountNumber @@ -100,7 +100,7 @@ func main() { debitDD.Address.AddressLineOne = "DrawDown Address One" debitDD.Address.AddressLineTwo = "DrawDown Address Two" debitDD.Address.AddressLineThree = "DrawDown Address Three" - fwm.SetAccountDebitedDrawdown(debitDD) + fwm.AccountDebitedDrawdown = debitDD // Originator o := wire.NewOriginator() @@ -110,7 +110,7 @@ func main() { o.Personal.Address.AddressLineOne = "Address" o.Personal.Address.AddressLineTwo = "Address" o.Personal.Address.AddressLineThree = "Address" - fwm.SetOriginator(o) + fwm.Originator = o ofi := wire.NewOriginatorFI() ofi.FinancialInstitution.IdentificationCode = wire.DemandDepositAccountNumber @@ -119,7 +119,7 @@ func main() { ofi.FinancialInstitution.Address.AddressLineOne = "Address One" ofi.FinancialInstitution.Address.AddressLineTwo = "Address Two" ofi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetOriginatorFI(ofi) + fwm.OriginatorFI = ofi ifi := wire.NewInstructingFI() ifi.FinancialInstitution.IdentificationCode = wire.DemandDepositAccountNumber @@ -128,18 +128,18 @@ func main() { ifi.FinancialInstitution.Address.AddressLineOne = "Address One" ifi.FinancialInstitution.Address.AddressLineTwo = "Address Two" ifi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetInstructingFI(ifi) + fwm.InstructingFI = ifi creditDD := wire.NewAccountCreditedDrawdown() creditDD.DrawdownCreditAccountNumber = "123456789" - fwm.SetAccountCreditedDrawdown(creditDD) + fwm.AccountCreditedDrawdown = creditDD ob := wire.NewOriginatorToBeneficiary() ob.LineOne = "Line 1" ob.LineTwo = "Line 2 " ob.LineThree = "Line 3" ob.LineFour = "Line 4" - fwm.SetOriginatorToBeneficiary(ob) + fwm.OriginatorToBeneficiary = ob // FI to FI firfi := wire.NewFIReceiverFI() @@ -149,7 +149,7 @@ func main() { firfi.FIToFI.LineOne = "Line 4" firfi.FIToFI.LineOne = "Line 5" firfi.FIToFI.LineOne = "Line 6" - fwm.SetFIReceiverFI(firfi) + fwm.FIReceiverFI = firfi fiifi := wire.NewFIIntermediaryFI() fiifi.FIToFI.LineOne = "Line 1" @@ -158,7 +158,7 @@ func main() { fiifi.FIToFI.LineOne = "Line 4" fiifi.FIToFI.LineOne = "Line 5" fiifi.FIToFI.LineOne = "Line 6" - fwm.SetFIIntermediaryFI(fiifi) + fwm.FIIntermediaryFI = fiifi fiifia := wire.NewFIIntermediaryFIAdvice() fiifia.Advice.AdviceCode = wire.AdviceCodeLetter @@ -168,7 +168,7 @@ func main() { fiifia.Advice.LineFour = "Line 4" fiifia.Advice.LineFive = "Line 5" fiifia.Advice.LineSix = "Line 6" - fwm.SetFIIntermediaryFIAdvice(fiifia) + fwm.FIIntermediaryFIAdvice = fiifia fibfi := wire.NewFIBeneficiaryFI() fibfi.FIToFI.LineOne = "Line One" @@ -177,7 +177,7 @@ func main() { fibfi.FIToFI.LineFour = "Line Four" fibfi.FIToFI.LineFive = "Line Five" fibfi.FIToFI.LineSix = "Line Six" - fwm.SetFIBeneficiaryFI(fibfi) + fwm.FIBeneficiaryFI = fibfi fibfia := wire.NewFIBeneficiaryFIAdvice() fibfia.Advice.AdviceCode = wire.AdviceCodeTelex @@ -187,7 +187,7 @@ func main() { fibfia.Advice.LineFour = "Line Four" fibfia.Advice.LineFive = "Line Five" fibfia.Advice.LineSix = "Line Six" - fwm.SetFIBeneficiaryFIAdvice(fibfia) + fwm.FIBeneficiaryFIAdvice = fibfia fib := wire.NewFIBeneficiary() fib.FIToFI.LineOne = "Line One" @@ -196,7 +196,7 @@ func main() { fib.FIToFI.LineFour = "Line Four" fib.FIToFI.LineFive = "Line Five" fib.FIToFI.LineSix = "Line Six" - fwm.SetFIBeneficiary(fib) + fwm.FIBeneficiary = fib fiba := wire.NewFIBeneficiaryAdvice() fiba.Advice.AdviceCode = wire.AdviceCodeLetter @@ -206,12 +206,12 @@ func main() { fiba.Advice.LineFour = "Line Four" fiba.Advice.LineFive = "Line Five" fiba.Advice.LineSix = "Line Six" - fwm.SetFIBeneficiaryAdvice(fiba) + fwm.FIBeneficiaryAdvice = fiba pm := wire.NewFIPaymentMethodToBeneficiary() pm.PaymentMethod = "CHECK" pm.AdditionalInformation = "Additional Information" - fwm.SetFIPaymentMethodToBeneficiary(pm) + fwm.FIPaymentMethodToBeneficiary = pm fifi := wire.NewFIAdditionalFIToFI() fifi.AdditionalFIToFI.LineOne = "Line One" @@ -220,7 +220,7 @@ func main() { fifi.AdditionalFIToFI.LineFour = "Line Four" fifi.AdditionalFIToFI.LineFive = "Line Five" fifi.AdditionalFIToFI.LineSix = "Line Six" - fwm.SetFIAdditionalFIToFI(fifi) + fwm.FIAdditionalFIToFI = fifi file.AddFEDWireMessage(fwm) diff --git a/examples/fedFundsReturned-write/main.go b/examples/fedFundsReturned-write/main.go index b0134501..f7671998 100644 --- a/examples/fedFundsReturned-write/main.go +++ b/examples/fedFundsReturned-write/main.go @@ -15,57 +15,57 @@ import ( func main() { file := wire.NewFile() - fwm := wire.NewFEDWireMessage() + fwm := wire.FEDWireMessage{} // Mandatory Fields ss := wire.NewSenderSupplied() ss.UserRequestCorrelation = "User Req" ss.MessageDuplicationCode = wire.MessageDuplicationOriginal - fwm.SetSenderSupplied(ss) + fwm.SenderSupplied = ss tst := wire.NewTypeSubType() tst.TypeCode = wire.SettlementTransfer tst.SubTypeCode = wire.BasicFundsTransfer - fwm.SetTypeSubType(tst) + fwm.TypeSubType = tst // InputMessageAccountabilityData imad := wire.NewInputMessageAccountabilityData() imad.InputCycleDate = time.Now().Format("20060102") imad.InputSource = "Source08" imad.InputSequenceNumber = "000001" - fwm.SetInputMessageAccountabilityData(imad) + fwm.InputMessageAccountabilityData = imad // Amount amt := wire.NewAmount() amt.Amount = "000001234567" - fwm.SetAmount(amt) + fwm.Amount = amt // SenderDepositoryInstitution sdi := wire.NewSenderDepositoryInstitution() sdi.SenderABANumber = "121042882" sdi.SenderShortName = "Wells Fargo NA" - fwm.SetSenderDepositoryInstitution(sdi) + fwm.SenderDepositoryInstitution = sdi rdi := wire.NewReceiverDepositoryInstitution() rdi.ReceiverABANumber = "231380104" rdi.ReceiverShortName = "Citadel" - fwm.SetReceiverDepositoryInstitution(rdi) + fwm.ReceiverDepositoryInstitution = rdi bfc := wire.NewBusinessFunctionCode() bfc.BusinessFunctionCode = wire.FEDFundsReturned bfc.TransactionTypeCode = " " - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc // Other Transfer Information // Sender Reference sr := wire.NewSenderReference() sr.SenderReference = "Sender Reference" - fwm.SetSenderReference(sr) + fwm.SenderReference = sr // Previous Message Identifier pmi := wire.NewPreviousMessageIdentifier() pmi.PreviousMessageIdentifier = "Previous Message Ident" - fwm.SetPreviousMessageIdentifier(pmi) + fwm.PreviousMessageIdentifier = pmi // Beneficiary // Beneficiary Intermediary FI @@ -76,7 +76,7 @@ func main() { bifi.FinancialInstitution.Address.AddressLineOne = "Address One" bifi.FinancialInstitution.Address.AddressLineTwo = "Address Two" bifi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiaryIntermediaryFI(bifi) + fwm.BeneficiaryIntermediaryFI = bifi // Beneficiary FI bfi := wire.NewBeneficiaryFI() @@ -86,7 +86,7 @@ func main() { bfi.FinancialInstitution.Address.AddressLineOne = "Address One" bfi.FinancialInstitution.Address.AddressLineTwo = "Address Two" bfi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiaryFI(bfi) + fwm.BeneficiaryFI = bfi // Beneficiary ben := wire.NewBeneficiary() @@ -96,12 +96,12 @@ func main() { ben.Personal.Address.AddressLineOne = "Address One" ben.Personal.Address.AddressLineTwo = "Address Two" ben.Personal.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiary(ben) + fwm.Beneficiary = ben // Beneficiary Reference br := wire.NewBeneficiaryReference() br.BeneficiaryReference = "Reference" - fwm.SetBeneficiaryReference(br) + fwm.BeneficiaryReference = br // Originator o := wire.NewOriginator() @@ -111,7 +111,7 @@ func main() { o.Personal.Address.AddressLineOne = "Address One" o.Personal.Address.AddressLineTwo = "Address Two" o.Personal.Address.AddressLineThree = "Address Three" - fwm.SetOriginator(o) + fwm.Originator = o // Originator FI ofi := wire.NewOriginatorFI() @@ -121,7 +121,7 @@ func main() { ofi.FinancialInstitution.Address.AddressLineOne = "Address One" ofi.FinancialInstitution.Address.AddressLineTwo = "Address Two" ofi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetOriginatorFI(ofi) + fwm.OriginatorFI = ofi // Instructing FI ifi := wire.NewInstructingFI() @@ -131,7 +131,7 @@ func main() { ifi.FinancialInstitution.Address.AddressLineOne = "Address One" ifi.FinancialInstitution.Address.AddressLineTwo = "Address Two" ifi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetInstructingFI(ifi) + fwm.InstructingFI = ifi // Originator To Beneficiary ob := wire.NewOriginatorToBeneficiary() @@ -139,7 +139,7 @@ func main() { ob.LineTwo = "LineTwo" ob.LineThree = "LineThree" ob.LineFour = "LineFour" - fwm.SetOriginatorToBeneficiary(ob) + fwm.OriginatorToBeneficiary = ob // FI to FI // FIReceiverFI @@ -150,7 +150,7 @@ func main() { firfi.FIToFI.LineOne = "FIToFI Line Four" firfi.FIToFI.LineOne = "FIToFI Line Five" firfi.FIToFI.LineOne = "FIToFI Line Six" - fwm.SetFIReceiverFI(firfi) + fwm.FIReceiverFI = firfi // FIIntermediaryFI fiifi := wire.NewFIIntermediaryFI() @@ -160,7 +160,7 @@ func main() { fiifi.FIToFI.LineOne = "FIIntermediaryFI Line Four" fiifi.FIToFI.LineOne = "FIIntermediaryFI Line Five" fiifi.FIToFI.LineOne = "FIIntermediaryFI Line Six" - fwm.SetFIIntermediaryFI(fiifi) + fwm.FIIntermediaryFI = fiifi // FIIntermediaryFIAdvice fiifia := wire.NewFIIntermediaryFIAdvice() @@ -171,7 +171,7 @@ func main() { fiifia.Advice.LineFour = "FIInterFIAdvice Line Four" fiifia.Advice.LineFive = "FIInterFIAdvice Line Five" fiifia.Advice.LineSix = "FIInterFIAdvice Line Six" - fwm.SetFIIntermediaryFIAdvice(fiifia) + fwm.FIIntermediaryFIAdvice = fiifia // FIBeneficiaryFI fibfi := wire.NewFIBeneficiaryFI() @@ -181,7 +181,7 @@ func main() { fibfi.FIToFI.LineFour = "FIBenFI Line Four" fibfi.FIToFI.LineFive = "FIBenFI Line Five" fibfi.FIToFI.LineSix = "FIBenFI Line Six" - fwm.SetFIBeneficiaryFI(fibfi) + fwm.FIBeneficiaryFI = fibfi // FIBeneficiaryFIAdvice fibfia := wire.NewFIBeneficiaryFIAdvice() @@ -192,7 +192,7 @@ func main() { fibfia.Advice.LineFour = "FIBenFIAdvice Line Four" fibfia.Advice.LineFive = "FIBenFIAdvice Line Five" fibfia.Advice.LineSix = "FIBenFIAdvice Line Six" - fwm.SetFIBeneficiaryFIAdvice(fibfia) + fwm.FIBeneficiaryFIAdvice = fibfia // FIBeneficiary fib := wire.NewFIBeneficiary() @@ -202,7 +202,7 @@ func main() { fib.FIToFI.LineFour = "FIBen Line Four" fib.FIToFI.LineFive = "FIBen Line Five" fib.FIToFI.LineSix = "FIBen Line Six" - fwm.SetFIBeneficiary(fib) + fwm.FIBeneficiary = fib // FIBeneficiaryAdvice fiba := wire.NewFIBeneficiaryAdvice() @@ -213,13 +213,13 @@ func main() { fiba.Advice.LineFour = "FIBenAdvice Line Four" fiba.Advice.LineFive = "FIBenAdvice Line Five" fiba.Advice.LineSix = "FIBenAdvice Line Six" - fwm.SetFIBeneficiaryAdvice(fiba) + fwm.FIBeneficiaryAdvice = fiba // FIPaymentMethodToBeneficiary pm := wire.NewFIPaymentMethodToBeneficiary() pm.PaymentMethod = "CHECK" pm.AdditionalInformation = "Additional Information" - fwm.SetFIPaymentMethodToBeneficiary(pm) + fwm.FIPaymentMethodToBeneficiary = pm // FIAdditionalFIToFI fifi := wire.NewFIAdditionalFIToFI() @@ -229,7 +229,7 @@ func main() { fifi.AdditionalFIToFI.LineFour = "FIAddFI Line Four" fifi.AdditionalFIToFI.LineFive = "FIAddFI Line Five" fifi.AdditionalFIToFI.LineSix = "FIAddFI Line Six" - fwm.SetFIAdditionalFIToFI(fifi) + fwm.FIAdditionalFIToFI = fifi file.AddFEDWireMessage(fwm) diff --git a/examples/fedFundsSold-write/main.go b/examples/fedFundsSold-write/main.go index d0305b60..1029088d 100644 --- a/examples/fedFundsSold-write/main.go +++ b/examples/fedFundsSold-write/main.go @@ -15,57 +15,57 @@ import ( func main() { file := wire.NewFile() - fwm := wire.NewFEDWireMessage() + fwm := wire.FEDWireMessage{} // Mandatory Fields ss := wire.NewSenderSupplied() ss.UserRequestCorrelation = "User Req" ss.MessageDuplicationCode = wire.MessageDuplicationOriginal - fwm.SetSenderSupplied(ss) + fwm.SenderSupplied = ss tst := wire.NewTypeSubType() tst.TypeCode = wire.SettlementTransfer tst.SubTypeCode = wire.BasicFundsTransfer - fwm.SetTypeSubType(tst) + fwm.TypeSubType = tst // InputMessageAccountabilityData imad := wire.NewInputMessageAccountabilityData() imad.InputCycleDate = time.Now().Format("20060102") imad.InputSource = "Source08" imad.InputSequenceNumber = "000001" - fwm.SetInputMessageAccountabilityData(imad) + fwm.InputMessageAccountabilityData = imad // Amount amt := wire.NewAmount() amt.Amount = "000001234567" - fwm.SetAmount(amt) + fwm.Amount = amt // SenderDepositoryInstitution sdi := wire.NewSenderDepositoryInstitution() sdi.SenderABANumber = "121042882" sdi.SenderShortName = "Wells Fargo NA" - fwm.SetSenderDepositoryInstitution(sdi) + fwm.SenderDepositoryInstitution = sdi rdi := wire.NewReceiverDepositoryInstitution() rdi.ReceiverABANumber = "231380104" rdi.ReceiverShortName = "Citadel" - fwm.SetReceiverDepositoryInstitution(rdi) + fwm.ReceiverDepositoryInstitution = rdi bfc := wire.NewBusinessFunctionCode() bfc.BusinessFunctionCode = wire.FEDFundsSold bfc.TransactionTypeCode = " " - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc // Other Transfer Information // Sender Reference sr := wire.NewSenderReference() sr.SenderReference = "Sender Reference" - fwm.SetSenderReference(sr) + fwm.SenderReference = sr // Previous Message Identifier pmi := wire.NewPreviousMessageIdentifier() pmi.PreviousMessageIdentifier = "Previous Message Ident" - fwm.SetPreviousMessageIdentifier(pmi) + fwm.PreviousMessageIdentifier = pmi // Beneficiary // Beneficiary Intermediary FI @@ -76,7 +76,7 @@ func main() { bifi.FinancialInstitution.Address.AddressLineOne = "Address One" bifi.FinancialInstitution.Address.AddressLineTwo = "Address Two" bifi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiaryIntermediaryFI(bifi) + fwm.BeneficiaryIntermediaryFI = bifi // Beneficiary FI bfi := wire.NewBeneficiaryFI() @@ -86,7 +86,7 @@ func main() { bfi.FinancialInstitution.Address.AddressLineOne = "Address One" bfi.FinancialInstitution.Address.AddressLineTwo = "Address Two" bfi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiaryFI(bfi) + fwm.BeneficiaryFI = bfi // Beneficiary ben := wire.NewBeneficiary() @@ -96,12 +96,12 @@ func main() { ben.Personal.Address.AddressLineOne = "Address One" ben.Personal.Address.AddressLineTwo = "Address Two" ben.Personal.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiary(ben) + fwm.Beneficiary = ben // Beneficiary Reference br := wire.NewBeneficiaryReference() br.BeneficiaryReference = "Reference" - fwm.SetBeneficiaryReference(br) + fwm.BeneficiaryReference = br // Originator // Originator @@ -112,7 +112,7 @@ func main() { o.Personal.Address.AddressLineOne = "Address One" o.Personal.Address.AddressLineTwo = "Address Two" o.Personal.Address.AddressLineThree = "Address Three" - fwm.SetOriginator(o) + fwm.Originator = o // Originator FI ofi := wire.NewOriginatorFI() @@ -122,7 +122,7 @@ func main() { ofi.FinancialInstitution.Address.AddressLineOne = "Address One" ofi.FinancialInstitution.Address.AddressLineTwo = "Address Two" ofi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetOriginatorFI(ofi) + fwm.OriginatorFI = ofi // Instructing FI ifi := wire.NewInstructingFI() @@ -132,7 +132,7 @@ func main() { ifi.FinancialInstitution.Address.AddressLineOne = "Address One" ifi.FinancialInstitution.Address.AddressLineTwo = "Address Two" ifi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetInstructingFI(ifi) + fwm.InstructingFI = ifi // Originator To Beneficiary ob := wire.NewOriginatorToBeneficiary() @@ -140,7 +140,7 @@ func main() { ob.LineTwo = "LineTwo" ob.LineThree = "LineThree" ob.LineFour = "LineFour" - fwm.SetOriginatorToBeneficiary(ob) + fwm.OriginatorToBeneficiary = ob // FI to FI // FIReceiverFI @@ -151,7 +151,7 @@ func main() { firfi.FIToFI.LineOne = "FIToFI Line Four" firfi.FIToFI.LineOne = "FIToFI Line Five" firfi.FIToFI.LineOne = "FIToFI Line Six" - fwm.SetFIReceiverFI(firfi) + fwm.FIReceiverFI = firfi // FIIntermediaryFI fiifi := wire.NewFIIntermediaryFI() @@ -161,7 +161,7 @@ func main() { fiifi.FIToFI.LineOne = "FIIntermediaryFI Line Four" fiifi.FIToFI.LineOne = "FIIntermediaryFI Line Five" fiifi.FIToFI.LineOne = "FIIntermediaryFI Line Six" - fwm.SetFIIntermediaryFI(fiifi) + fwm.FIIntermediaryFI = fiifi // FIIntermediaryFIAdvice fiifia := wire.NewFIIntermediaryFIAdvice() @@ -172,7 +172,7 @@ func main() { fiifia.Advice.LineFour = "FIInterFIAdvice Line Four" fiifia.Advice.LineFive = "FIInterFIAdvice Line Five" fiifia.Advice.LineSix = "FIInterFIAdvice Line Six" - fwm.SetFIIntermediaryFIAdvice(fiifia) + fwm.FIIntermediaryFIAdvice = fiifia // FIBeneficiaryFI fibfi := wire.NewFIBeneficiaryFI() @@ -182,7 +182,7 @@ func main() { fibfi.FIToFI.LineFour = "FIBenFI Line Four" fibfi.FIToFI.LineFive = "FIBenFI Line Five" fibfi.FIToFI.LineSix = "FIBenFI Line Six" - fwm.SetFIBeneficiaryFI(fibfi) + fwm.FIBeneficiaryFI = fibfi // FIBeneficiaryFIAdvice fibfia := wire.NewFIBeneficiaryFIAdvice() @@ -193,7 +193,7 @@ func main() { fibfia.Advice.LineFour = "FIBenFIAdvice Line Four" fibfia.Advice.LineFive = "FIBenFIAdvice Line Five" fibfia.Advice.LineSix = "FIBenFIAdvice Line Six" - fwm.SetFIBeneficiaryFIAdvice(fibfia) + fwm.FIBeneficiaryFIAdvice = fibfia // FIBeneficiary fib := wire.NewFIBeneficiary() @@ -203,7 +203,7 @@ func main() { fib.FIToFI.LineFour = "FIBen Line Four" fib.FIToFI.LineFive = "FIBen Line Five" fib.FIToFI.LineSix = "FIBen Line Six" - fwm.SetFIBeneficiary(fib) + fwm.FIBeneficiary = fib // FIBeneficiaryAdvice fiba := wire.NewFIBeneficiaryAdvice() @@ -214,13 +214,13 @@ func main() { fiba.Advice.LineFour = "FIBenAdvice Line Four" fiba.Advice.LineFive = "FIBenAdvice Line Five" fiba.Advice.LineSix = "FIBenAdvice Line Six" - fwm.SetFIBeneficiaryAdvice(fiba) + fwm.FIBeneficiaryAdvice = fiba // FIPaymentMethodToBeneficiary pm := wire.NewFIPaymentMethodToBeneficiary() pm.PaymentMethod = "CHECK" pm.AdditionalInformation = "Additional Information" - fwm.SetFIPaymentMethodToBeneficiary(pm) + fwm.FIPaymentMethodToBeneficiary = pm // FIAdditionalFIToFI fifi := wire.NewFIAdditionalFIToFI() @@ -230,7 +230,7 @@ func main() { fifi.AdditionalFIToFI.LineFour = "FIAddFI Line Four" fifi.AdditionalFIToFI.LineFive = "FIAddFI Line Five" fifi.AdditionalFIToFI.LineSix = "FIAddFI Line Six" - fwm.SetFIAdditionalFIToFI(fifi) + fwm.FIAdditionalFIToFI = fifi file.AddFEDWireMessage(fwm) diff --git a/examples/serviceMessage-write/main.go b/examples/serviceMessage-write/main.go index 5cbe37cc..1e843f84 100644 --- a/examples/serviceMessage-write/main.go +++ b/examples/serviceMessage-write/main.go @@ -14,58 +14,58 @@ import ( func main() { file := wire.NewFile() - fwm := wire.NewFEDWireMessage() + fwm := wire.FEDWireMessage{} // Mandatory Fields // SenderSupplied ss := wire.NewSenderSupplied() ss.UserRequestCorrelation = "User Req" ss.MessageDuplicationCode = wire.MessageDuplicationOriginal - fwm.SetSenderSupplied(ss) + fwm.SenderSupplied = ss tst := wire.NewTypeSubType() tst.TypeCode = wire.FundsTransfer tst.SubTypeCode = wire.RequestReversal - fwm.SetTypeSubType(tst) + fwm.TypeSubType = tst // InputMessageAccountabilityData imad := wire.NewInputMessageAccountabilityData() imad.InputCycleDate = time.Now().Format("20060102") imad.InputSource = "Source08" imad.InputSequenceNumber = "000001" - fwm.SetInputMessageAccountabilityData(imad) + fwm.InputMessageAccountabilityData = imad // Amount amt := wire.NewAmount() amt.Amount = "000001234567" - fwm.SetAmount(amt) + fwm.Amount = amt // SenderDepositoryInstitution sdi := wire.NewSenderDepositoryInstitution() sdi.SenderABANumber = "121042882" sdi.SenderShortName = "Wells Fargo NA" - fwm.SetSenderDepositoryInstitution(sdi) + fwm.SenderDepositoryInstitution = sdi rdi := wire.NewReceiverDepositoryInstitution() rdi.ReceiverABANumber = "231380104" rdi.ReceiverShortName = "Citadel" - fwm.SetReceiverDepositoryInstitution(rdi) + fwm.ReceiverDepositoryInstitution = rdi bfc := wire.NewBusinessFunctionCode() bfc.BusinessFunctionCode = wire.BFCServiceMessage bfc.TransactionTypeCode = " " - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc // Other Transfer Information // Sender Reference sr := wire.NewSenderReference() sr.SenderReference = "Sender Reference" - fwm.SetSenderReference(sr) + fwm.SenderReference = sr // Previous Message Identifier pmi := wire.NewPreviousMessageIdentifier() pmi.PreviousMessageIdentifier = "Previous Message Ident" - fwm.SetPreviousMessageIdentifier(pmi) + fwm.PreviousMessageIdentifier = pmi // Beneficiary // Beneficiary Intermediary FI @@ -76,7 +76,7 @@ func main() { bifi.FinancialInstitution.Address.AddressLineOne = "Address One" bifi.FinancialInstitution.Address.AddressLineTwo = "Address Two" bifi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiaryIntermediaryFI(bifi) + fwm.BeneficiaryIntermediaryFI = bifi // Beneficiary FI bfi := wire.NewBeneficiaryFI() @@ -86,7 +86,7 @@ func main() { bfi.FinancialInstitution.Address.AddressLineOne = "Address One" bfi.FinancialInstitution.Address.AddressLineTwo = "Address Two" bfi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiaryFI(bfi) + fwm.BeneficiaryFI = bfi // Beneficiary ben := wire.NewBeneficiary() @@ -96,12 +96,12 @@ func main() { ben.Personal.Address.AddressLineOne = "Address One" ben.Personal.Address.AddressLineTwo = "Address Two" ben.Personal.Address.AddressLineThree = "Address Three" - fwm.SetBeneficiary(ben) + fwm.Beneficiary = ben // Beneficiary Reference br := wire.NewBeneficiaryReference() br.BeneficiaryReference = "Reference" - fwm.SetBeneficiaryReference(br) + fwm.BeneficiaryReference = br // Originator o := wire.NewOriginator() @@ -111,7 +111,7 @@ func main() { o.Personal.Address.AddressLineOne = "Address One" o.Personal.Address.AddressLineTwo = "Address Two" o.Personal.Address.AddressLineThree = "Address Three" - fwm.SetOriginator(o) + fwm.Originator = o // Originator FI ofi := wire.NewOriginatorFI() @@ -121,7 +121,7 @@ func main() { ofi.FinancialInstitution.Address.AddressLineOne = "Address One" ofi.FinancialInstitution.Address.AddressLineTwo = "Address Two" ofi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetOriginatorFI(ofi) + fwm.OriginatorFI = ofi // Instructing FI ifi := wire.NewInstructingFI() @@ -131,7 +131,7 @@ func main() { ifi.FinancialInstitution.Address.AddressLineOne = "Address One" ifi.FinancialInstitution.Address.AddressLineTwo = "Address Two" ifi.FinancialInstitution.Address.AddressLineThree = "Address Three" - fwm.SetInstructingFI(ifi) + fwm.InstructingFI = ifi // Originator To Beneficiary ob := wire.NewOriginatorToBeneficiary() @@ -139,7 +139,7 @@ func main() { ob.LineTwo = "LineTwo" ob.LineThree = "LineThree" ob.LineFour = "LineFour" - fwm.SetOriginatorToBeneficiary(ob) + fwm.OriginatorToBeneficiary = ob // FI to FI // FIReceiverFI @@ -150,7 +150,7 @@ func main() { firfi.FIToFI.LineOne = "FIToFI Line Four" firfi.FIToFI.LineOne = "FIToFI Line Five" firfi.FIToFI.LineOne = "FIToFI Line Six" - fwm.SetFIReceiverFI(firfi) + fwm.FIReceiverFI = firfi // FIIntermediaryFI fiifi := wire.NewFIIntermediaryFI() @@ -160,7 +160,7 @@ func main() { fiifi.FIToFI.LineOne = "FIIntermediaryFI Line Four" fiifi.FIToFI.LineOne = "FIIntermediaryFI Line Five" fiifi.FIToFI.LineOne = "FIIntermediaryFI Line Six" - fwm.SetFIIntermediaryFI(fiifi) + fwm.FIIntermediaryFI = fiifi // FIIntermediaryFIAdvice fiifia := wire.NewFIIntermediaryFIAdvice() @@ -171,7 +171,7 @@ func main() { fiifia.Advice.LineFour = "FIInterFIAdvice Line Four" fiifia.Advice.LineFive = "FIInterFIAdvice Line Five" fiifia.Advice.LineSix = "FIInterFIAdvice Line Six" - fwm.SetFIIntermediaryFIAdvice(fiifia) + fwm.FIIntermediaryFIAdvice = fiifia // FIBeneficiaryFI fibfi := wire.NewFIBeneficiaryFI() @@ -181,7 +181,7 @@ func main() { fibfi.FIToFI.LineFour = "FIBenFI Line Four" fibfi.FIToFI.LineFive = "FIBenFI Line Five" fibfi.FIToFI.LineSix = "FIBenFI Line Six" - fwm.SetFIBeneficiaryFI(fibfi) + fwm.FIBeneficiaryFI = fibfi // FIBeneficiaryFIAdvice fibfia := wire.NewFIBeneficiaryFIAdvice() @@ -192,7 +192,7 @@ func main() { fibfia.Advice.LineFour = "FIBenFIAdvice Line Four" fibfia.Advice.LineFive = "FIBenFIAdvice Line Five" fibfia.Advice.LineSix = "FIBenFIAdvice Line Six" - fwm.SetFIBeneficiaryFIAdvice(fibfia) + fwm.FIBeneficiaryFIAdvice = fibfia // FIBeneficiary fib := wire.NewFIBeneficiary() @@ -202,7 +202,7 @@ func main() { fib.FIToFI.LineFour = "FIBen Line Four" fib.FIToFI.LineFive = "FIBen Line Five" fib.FIToFI.LineSix = "FIBen Line Six" - fwm.SetFIBeneficiary(fib) + fwm.FIBeneficiary = fib // FIBeneficiaryAdvice fiba := wire.NewFIBeneficiaryAdvice() @@ -213,13 +213,13 @@ func main() { fiba.Advice.LineFour = "FIBenAdvice Line Four" fiba.Advice.LineFive = "FIBenAdvice Line Five" fiba.Advice.LineSix = "FIBenAdvice Line Six" - fwm.SetFIBeneficiaryAdvice(fiba) + fwm.FIBeneficiaryAdvice = fiba // FIPaymentMethodToBeneficiary pm := wire.NewFIPaymentMethodToBeneficiary() pm.PaymentMethod = "CHECK" pm.AdditionalInformation = "Additional Information" - fwm.SetFIPaymentMethodToBeneficiary(pm) + fwm.FIPaymentMethodToBeneficiary = pm // FIAdditionalFIToFI fifi := wire.NewFIAdditionalFIToFI() @@ -229,10 +229,10 @@ func main() { fifi.AdditionalFIToFI.LineFour = "FIAddFI Line Four" fifi.AdditionalFIToFI.LineFive = "FIAddFI Line Five" fifi.AdditionalFIToFI.LineSix = "FIAddFI Line Six" - fwm.SetFIAdditionalFIToFI(fifi) + fwm.FIAdditionalFIToFI = fifi sm := wire.NewServiceMessage() - fwm.SetServiceMessage(sm) + fwm.ServiceMessage = sm file.AddFEDWireMessage(fwm) diff --git a/fedWireMessage.go b/fedWireMessage.go index 7761d73d..c26f5f83 100644 --- a/fedWireMessage.go +++ b/fedWireMessage.go @@ -133,12 +133,6 @@ type FEDWireMessage struct { ServiceMessage *ServiceMessage `json:"serviceMessage,omitempty"` } -// NewFEDWireMessage returns a new FEDWireMessage -func NewFEDWireMessage() FEDWireMessage { - fwm := FEDWireMessage{} - return fwm -} - // verify checks basic WIRE rules. Assumes properly parsed records. Each validation func should // check for the expected relationships between fields within a FedWireMessage. func (fwm *FEDWireMessage) verify() error { @@ -937,606 +931,6 @@ func (fwm *FEDWireMessage) invalidCoverPaymentTags() error { return nil } -// SetSenderSupplied appends a SenderSupplied to the FEDWireMessage -func (fwm *FEDWireMessage) SetSenderSupplied(ss *SenderSupplied) { - fwm.SenderSupplied = ss -} - -// GetSenderSupplied returns the current SenderSupplied -func (fwm *FEDWireMessage) GetSenderSupplied() *SenderSupplied { - return fwm.SenderSupplied -} - -// SetTypeSubType appends a TypeSubType to the FEDWireMessage -func (fwm *FEDWireMessage) SetTypeSubType(tst *TypeSubType) { - fwm.TypeSubType = tst -} - -// GetTypeSubType returns the current TypeSubType -func (fwm *FEDWireMessage) GetTypeSubType() *TypeSubType { - return fwm.TypeSubType -} - -// SetInputMessageAccountabilityData appends a InputMessageAccountabilityData to the FEDWireMessage -func (fwm *FEDWireMessage) SetInputMessageAccountabilityData(imad *InputMessageAccountabilityData) { - fwm.InputMessageAccountabilityData = imad -} - -// GetInputMessageAccountabilityData returns the current InputMessageAccountabilityData -func (fwm *FEDWireMessage) GetInputMessageAccountabilityData() *InputMessageAccountabilityData { - return fwm.InputMessageAccountabilityData -} - -// SetAmount appends a Amount to the FEDWireMessage -func (fwm *FEDWireMessage) SetAmount(amt *Amount) { - fwm.Amount = amt -} - -// GetAmount returns the current Amount -func (fwm *FEDWireMessage) GetAmount() *Amount { - return fwm.Amount -} - -// SetSenderDepositoryInstitution appends a SenderDepositoryInstitution to the FEDWireMessage -func (fwm *FEDWireMessage) SetSenderDepositoryInstitution(sdi *SenderDepositoryInstitution) { - fwm.SenderDepositoryInstitution = sdi -} - -// GetSenderDepositoryInstitution returns the current SenderDepositoryInstitution -func (fwm *FEDWireMessage) GetSenderDepositoryInstitution() *SenderDepositoryInstitution { - return fwm.SenderDepositoryInstitution -} - -// SetReceiverDepositoryInstitution appends a ReceiverDepositoryInstitution to the FEDWireMessage -func (fwm *FEDWireMessage) SetReceiverDepositoryInstitution(rdi *ReceiverDepositoryInstitution) { - fwm.ReceiverDepositoryInstitution = rdi -} - -// GetReceiverDepositoryInstitution returns the current ReceiverDepositoryInstitution -func (fwm *FEDWireMessage) GetReceiverDepositoryInstitution() *ReceiverDepositoryInstitution { - return fwm.ReceiverDepositoryInstitution -} - -// SetBusinessFunctionCode appends a BusinessFunctionCode to the FEDWireMessage -func (fwm *FEDWireMessage) SetBusinessFunctionCode(bfc *BusinessFunctionCode) { - fwm.BusinessFunctionCode = bfc -} - -// GetBusinessFunctionCode returns the current BusinessFunctionCode -func (fwm *FEDWireMessage) GetBusinessFunctionCode() *BusinessFunctionCode { - return fwm.BusinessFunctionCode -} - -// SetSenderReference appends a SenderReference to the FEDWireMessage -func (fwm *FEDWireMessage) SetSenderReference(sr *SenderReference) { - fwm.SenderReference = sr -} - -// GetSenderReference returns the current SenderReference -func (fwm *FEDWireMessage) GetSenderReference() *SenderReference { - return fwm.SenderReference -} - -// SetPreviousMessageIdentifier appends a PreviousMessageIdentifier to the FEDWireMessage -func (fwm *FEDWireMessage) SetPreviousMessageIdentifier(pmi *PreviousMessageIdentifier) { - fwm.PreviousMessageIdentifier = pmi -} - -// GetPreviousMessageIdentifier returns the current PreviousMessageIdentifier -func (fwm *FEDWireMessage) GetPreviousMessageIdentifier() *PreviousMessageIdentifier { - return fwm.PreviousMessageIdentifier -} - -// SetLocalInstrument appends a LocalInstrument to the FEDWireMessage -func (fwm *FEDWireMessage) SetLocalInstrument(li *LocalInstrument) { - fwm.LocalInstrument = li -} - -// GetLocalInstrument returns the current LocalInstrument -func (fwm *FEDWireMessage) GetLocalInstrument() *LocalInstrument { - return fwm.LocalInstrument -} - -// SetPaymentNotification appends a PaymentNotification to the FEDWireMessage -func (fwm *FEDWireMessage) SetPaymentNotification(pn *PaymentNotification) { - fwm.PaymentNotification = pn -} - -// GetPaymentNotification returns the current PaymentNotification -func (fwm *FEDWireMessage) GetPaymentNotification() *PaymentNotification { - return fwm.PaymentNotification -} - -// SetCharges appends a Charges to the FEDWireMessage -func (fwm *FEDWireMessage) SetCharges(c *Charges) { - fwm.Charges = c -} - -// GetCharges returns the current Charges -func (fwm *FEDWireMessage) GetCharges() *Charges { - return fwm.Charges -} - -// SetInstructedAmount appends a InstructedAmount to the FEDWireMessage -func (fwm *FEDWireMessage) SetInstructedAmount(ia *InstructedAmount) { - fwm.InstructedAmount = ia -} - -// GetInstructedAmount returns the current Instructed Amount -func (fwm *FEDWireMessage) GetInstructedAmount() *InstructedAmount { - return fwm.InstructedAmount -} - -// SetExchangeRate appends a ExchangeRate to the FEDWireMessage -func (fwm *FEDWireMessage) SetExchangeRate(er *ExchangeRate) { - fwm.ExchangeRate = er -} - -// GetExchangeRate returns the current ExchangeRate -func (fwm *FEDWireMessage) GetExchangeRate() *ExchangeRate { - return fwm.ExchangeRate -} - -// SetBeneficiaryIntermediaryFI appends a BeneficiaryIntermediaryFI to the FEDWireMessage -func (fwm *FEDWireMessage) SetBeneficiaryIntermediaryFI(bifi *BeneficiaryIntermediaryFI) { - fwm.BeneficiaryIntermediaryFI = bifi -} - -// GetBeneficiaryIntermediaryFI returns the current BeneficiaryIntermediaryFI -func (fwm *FEDWireMessage) GetBeneficiaryIntermediaryFI() *BeneficiaryIntermediaryFI { - return fwm.BeneficiaryIntermediaryFI -} - -// SetBeneficiaryFI appends a BeneficiaryFI to the FEDWireMessage -func (fwm *FEDWireMessage) SetBeneficiaryFI(bfi *BeneficiaryFI) { - fwm.BeneficiaryFI = bfi -} - -// GetBeneficiaryFI returns the current BeneficiaryFI -func (fwm *FEDWireMessage) GetBeneficiaryFI() *BeneficiaryFI { - return fwm.BeneficiaryFI -} - -// SetBeneficiary appends a Beneficiary to the FEDWireMessage -func (fwm *FEDWireMessage) SetBeneficiary(ben *Beneficiary) { - fwm.Beneficiary = ben -} - -// GetBeneficiary returns the current Beneficiary -func (fwm *FEDWireMessage) GetBeneficiary() *Beneficiary { - return fwm.Beneficiary -} - -// SetBeneficiaryReference appends a BeneficiaryReference to the FEDWireMessage -func (fwm *FEDWireMessage) SetBeneficiaryReference(br *BeneficiaryReference) { - fwm.BeneficiaryReference = br -} - -// GetBeneficiaryReference returns the current BeneficiaryReference -func (fwm *FEDWireMessage) GetBeneficiaryReference() *BeneficiaryReference { - return fwm.BeneficiaryReference -} - -// SetAccountDebitedDrawdown appends a AccountDebitedDrawdown to the FEDWireMessage -func (fwm *FEDWireMessage) SetAccountDebitedDrawdown(debitDD *AccountDebitedDrawdown) { - fwm.AccountDebitedDrawdown = debitDD -} - -// GetAccountDebitedDrawdown returns the current AccountDebitedDrawdown -func (fwm *FEDWireMessage) GetAccountDebitedDrawdown() *AccountDebitedDrawdown { - return fwm.AccountDebitedDrawdown -} - -// SetOriginator appends a Originator to the FEDWireMessage -func (fwm *FEDWireMessage) SetOriginator(o *Originator) { - fwm.Originator = o -} - -// GetOriginator returns the current Originator -func (fwm *FEDWireMessage) GetOriginator() *Originator { - return fwm.Originator -} - -// SetOriginatorOptionF appends a OriginatorOptionF to the FEDWireMessage -func (fwm *FEDWireMessage) SetOriginatorOptionF(oof *OriginatorOptionF) { - fwm.OriginatorOptionF = oof -} - -// GetOriginatorOptionF returns the current OriginatorOptionF -func (fwm *FEDWireMessage) GetOriginatorOptionF() *OriginatorOptionF { - return fwm.OriginatorOptionF -} - -// SetOriginatorFI appends a OriginatorFI to the FEDWireMessage -func (fwm *FEDWireMessage) SetOriginatorFI(ofi *OriginatorFI) { - fwm.OriginatorFI = ofi -} - -// GetOriginatorFI returns the current OriginatorFI -func (fwm *FEDWireMessage) GetOriginatorFI() *OriginatorFI { - return fwm.OriginatorFI -} - -// SetInstructingFI appends a InstructingFI to the FEDWireMessage -func (fwm *FEDWireMessage) SetInstructingFI(ifi *InstructingFI) { - fwm.InstructingFI = ifi -} - -// GetInstructingFI returns the current InstructingFI -func (fwm *FEDWireMessage) GetInstructingFI() *InstructingFI { - return fwm.InstructingFI -} - -// SetAccountCreditedDrawdown appends a AccountCreditedDrawdown to the FEDWireMessage -func (fwm *FEDWireMessage) SetAccountCreditedDrawdown(creditDD *AccountCreditedDrawdown) { - fwm.AccountCreditedDrawdown = creditDD -} - -// GetAccountCreditedDrawdown returns the current AccountCreditedDrawdown -func (fwm *FEDWireMessage) GetAccountCreditedDrawdown() *AccountCreditedDrawdown { - return fwm.AccountCreditedDrawdown -} - -// SetOriginatorToBeneficiary appends a OriginatorToBeneficiary to the FEDWireMessage -func (fwm *FEDWireMessage) SetOriginatorToBeneficiary(ob *OriginatorToBeneficiary) { - fwm.OriginatorToBeneficiary = ob -} - -// GetOriginatorToBeneficiary returns the current OriginatorToBeneficiary -func (fwm *FEDWireMessage) GetOriginatorToBeneficiary() *OriginatorToBeneficiary { - return fwm.OriginatorToBeneficiary -} - -// SetFIReceiverFI appends a FIReceiverFI to the FEDWireMessage -func (fwm *FEDWireMessage) SetFIReceiverFI(firfi *FIReceiverFI) { - fwm.FIReceiverFI = firfi -} - -// GetFIReceiverFI returns the current FIReceiverFI -func (fwm *FEDWireMessage) GetFIReceiverFI() *FIReceiverFI { - return fwm.FIReceiverFI -} - -// SetFIDrawdownDebitAccountAdvice appends a FIDrawdownDebitAccountAdvice to the FEDWireMessage -func (fwm *FEDWireMessage) SetFIDrawdownDebitAccountAdvice(debitDDAdvice *FIDrawdownDebitAccountAdvice) { - fwm.FIDrawdownDebitAccountAdvice = debitDDAdvice -} - -// GetFIDrawdownDebitAccountAdvice returns the current FIDrawdownDebitAccountAdvice -func (fwm *FEDWireMessage) GetFIDrawdownDebitAccountAdvice() *FIDrawdownDebitAccountAdvice { - return fwm.FIDrawdownDebitAccountAdvice -} - -// SetFIIntermediaryFI appends a FIIntermediaryFI to the FEDWireMessage -func (fwm *FEDWireMessage) SetFIIntermediaryFI(fiifi *FIIntermediaryFI) { - fwm.FIIntermediaryFI = fiifi -} - -// GetFIIntermediaryFI returns the current FIIntermediaryFI -func (fwm *FEDWireMessage) GetFIIntermediaryFI() *FIIntermediaryFI { - return fwm.FIIntermediaryFI -} - -// SetFIIntermediaryFIAdvice appends a FIIntermediaryFIAdvice to the FEDWireMessage -func (fwm *FEDWireMessage) SetFIIntermediaryFIAdvice(fiifia *FIIntermediaryFIAdvice) { - fwm.FIIntermediaryFIAdvice = fiifia -} - -// GetFIIntermediaryFIAdvice returns the current FIIntermediaryFIAdvice -func (fwm *FEDWireMessage) GetFIIntermediaryFIAdvice() *FIIntermediaryFIAdvice { - return fwm.FIIntermediaryFIAdvice -} - -// SetFIBeneficiaryFI appends a FIBeneficiaryFI to the FEDWireMessage -func (fwm *FEDWireMessage) SetFIBeneficiaryFI(fibfi *FIBeneficiaryFI) { - fwm.FIBeneficiaryFI = fibfi -} - -// GetFIBeneficiaryFI returns the current FIBeneficiaryFI -func (fwm *FEDWireMessage) GetFIBeneficiaryFI() *FIBeneficiaryFI { - return fwm.FIBeneficiaryFI -} - -// SetFIBeneficiaryFIAdvice appends a FIBeneficiaryFIAdvice to the FEDWireMessage -func (fwm *FEDWireMessage) SetFIBeneficiaryFIAdvice(fibfia *FIBeneficiaryFIAdvice) { - fwm.FIBeneficiaryFIAdvice = fibfia -} - -// GetFIBeneficiaryFIAdvice returns the current FIBeneficiaryFIAdvice -func (fwm *FEDWireMessage) GetFIBeneficiaryFIAdvice() *FIBeneficiaryFIAdvice { - return fwm.FIBeneficiaryFIAdvice -} - -// SetFIBeneficiary appends a FIBeneficiary to the FEDWireMessage -func (fwm *FEDWireMessage) SetFIBeneficiary(fib *FIBeneficiary) { - fwm.FIBeneficiary = fib -} - -// GetFIBeneficiary returns the current FIBeneficiary -func (fwm *FEDWireMessage) GetFIBeneficiary() *FIBeneficiary { - return fwm.FIBeneficiary -} - -// SetFIBeneficiaryAdvice appends a FIBeneficiaryAdviceto the FEDWireMessage -func (fwm *FEDWireMessage) SetFIBeneficiaryAdvice(fiba *FIBeneficiaryAdvice) { - fwm.FIBeneficiaryAdvice = fiba -} - -// GetFIBeneficiaryAdvice returns the current FIBeneficiaryAdvice -func (fwm *FEDWireMessage) GetFIBeneficiaryAdvice() *FIBeneficiaryAdvice { - return fwm.FIBeneficiaryAdvice -} - -// SetFIPaymentMethodToBeneficiary appends a FIPaymentMethodToBeneficiary to the FEDWireMessage -func (fwm *FEDWireMessage) SetFIPaymentMethodToBeneficiary(pm *FIPaymentMethodToBeneficiary) { - fwm.FIPaymentMethodToBeneficiary = pm -} - -// GetFIPaymentMethodToBeneficiary returns the current FIPaymentMethodToBeneficiary -func (fwm *FEDWireMessage) GetFIPaymentMethodToBeneficiary() *FIPaymentMethodToBeneficiary { - return fwm.FIPaymentMethodToBeneficiary -} - -// SetFIAdditionalFIToFI appends a FIAdditionalFIToFI to the FEDWireMessage -func (fwm *FEDWireMessage) SetFIAdditionalFIToFI(fifi *FIAdditionalFIToFI) { - fwm.FIAdditionalFIToFI = fifi -} - -// GetFIAdditionalFIToFI returns the current FIAdditionalFIToFI -func (fwm *FEDWireMessage) GetFIAdditionalFIToFI() *FIAdditionalFIToFI { - return fwm.FIAdditionalFIToFI -} - -// SetCurrencyInstructedAmount appends a CurrencyInstructedAmount to the FEDWireMessage -func (fwm *FEDWireMessage) SetCurrencyInstructedAmount(cia *CurrencyInstructedAmount) { - fwm.CurrencyInstructedAmount = cia -} - -// GetCurrencyInstructedAmount returns the current CurrencyInstructedAmount -func (fwm *FEDWireMessage) GetCurrencyInstructedAmount() *CurrencyInstructedAmount { - return fwm.CurrencyInstructedAmount -} - -// SetOrderingCustomer appends a OrderingCustomer to the FEDWireMessage -func (fwm *FEDWireMessage) SetOrderingCustomer(oc *OrderingCustomer) { - fwm.OrderingCustomer = oc -} - -// GetOrderingCustomer returns the current OrderingCustomer -func (fwm *FEDWireMessage) GetOrderingCustomer() *OrderingCustomer { - return fwm.OrderingCustomer -} - -// SetOrderingInstitution appends a OrderingInstitution to the FEDWireMessage -func (fwm *FEDWireMessage) SetOrderingInstitution(oi *OrderingInstitution) { - fwm.OrderingInstitution = oi -} - -// GetOrderingInstitution returns the current OrderingInstitution -func (fwm *FEDWireMessage) GetOrderingInstitution() *OrderingInstitution { - return fwm.OrderingInstitution -} - -// SetIntermediaryInstitution appends a IntermediaryInstitution to the FEDWireMessage -func (fwm *FEDWireMessage) SetIntermediaryInstitution(ii *IntermediaryInstitution) { - fwm.IntermediaryInstitution = ii -} - -// GetIntermediaryInstitution returns the current IntermediaryInstitution -func (fwm *FEDWireMessage) GetIntermediaryInstitution() *IntermediaryInstitution { - return fwm.IntermediaryInstitution -} - -// SetInstitutionAccount appends a InstitutionAccount to the FEDWireMessage -func (fwm *FEDWireMessage) SetInstitutionAccount(iAccount *InstitutionAccount) { - fwm.InstitutionAccount = iAccount -} - -// GetInstitutionAccount returns the current InstitutionAccount -func (fwm *FEDWireMessage) GetInstitutionAccount() *InstitutionAccount { - return fwm.InstitutionAccount -} - -// SetBeneficiaryCustomer appends a BeneficiaryCustomer to the FEDWireMessage -func (fwm *FEDWireMessage) SetBeneficiaryCustomer(bc *BeneficiaryCustomer) { - fwm.BeneficiaryCustomer = bc -} - -// GetBeneficiaryCustomer returns the current BeneficiaryCustomer -func (fwm *FEDWireMessage) GetBeneficiaryCustomer() *BeneficiaryCustomer { - return fwm.BeneficiaryCustomer -} - -// SetRemittance appends a Remittance to the FEDWireMessage -func (fwm *FEDWireMessage) SetRemittance(ri *Remittance) { - fwm.Remittance = ri -} - -// GetRemittance returns the current Remittance -func (fwm *FEDWireMessage) GetRemittance() *Remittance { - return fwm.Remittance -} - -// SetSenderToReceiver appends a SenderToReceiver to the FEDWireMessage -func (fwm *FEDWireMessage) SetSenderToReceiver(str *SenderToReceiver) { - fwm.SenderToReceiver = str -} - -// GetSenderToReceiver returns the current SenderToReceiver -func (fwm *FEDWireMessage) GetSenderToReceiver() *SenderToReceiver { - return fwm.SenderToReceiver -} - -// SetUnstructuredAddenda appends a UnstructuredAddenda to the FEDWireMessage -func (fwm *FEDWireMessage) SetUnstructuredAddenda(ua *UnstructuredAddenda) { - fwm.UnstructuredAddenda = ua -} - -// GetUnstructuredAddenda returns the current UnstructuredAddenda -func (fwm *FEDWireMessage) GetUnstructuredAddenda() *UnstructuredAddenda { - return fwm.UnstructuredAddenda -} - -// SetRelatedRemittance appends a RelatedRemittance to the FEDWireMessage -func (fwm *FEDWireMessage) SetRelatedRemittance(rr *RelatedRemittance) { - fwm.RelatedRemittance = rr -} - -// GetRelatedRemittance returns the current RelatedRemittance -func (fwm *FEDWireMessage) GetRelatedRemittance() *RelatedRemittance { - return fwm.RelatedRemittance -} - -// SetRemittanceOriginator appends a RemittanceOriginator to the FEDWireMessage -func (fwm *FEDWireMessage) SetRemittanceOriginator(ro *RemittanceOriginator) { - fwm.RemittanceOriginator = ro -} - -// GetRemittanceOriginator returns the current RemittanceOriginator -func (fwm *FEDWireMessage) GetRemittanceOriginator() *RemittanceOriginator { - return fwm.RemittanceOriginator -} - -// SetRemittanceBeneficiary appends a RemittanceBeneficiary to the FEDWireMessage -func (fwm *FEDWireMessage) SetRemittanceBeneficiary(rb *RemittanceBeneficiary) { - fwm.RemittanceBeneficiary = rb -} - -// GetRemittanceBeneficiary returns the current RemittanceBeneficiary -func (fwm *FEDWireMessage) GetRemittanceBeneficiary() *RemittanceBeneficiary { - return fwm.RemittanceBeneficiary -} - -// SetPrimaryRemittanceDocument appends a PrimaryRemittanceDocument to the FEDWireMessage -func (fwm *FEDWireMessage) SetPrimaryRemittanceDocument(prd *PrimaryRemittanceDocument) { - fwm.PrimaryRemittanceDocument = prd -} - -// GetPrimaryRemittanceDocument returns the current PrimaryRemittanceDocument -func (fwm *FEDWireMessage) GetPrimaryRemittanceDocument() *PrimaryRemittanceDocument { - return fwm.PrimaryRemittanceDocument -} - -// SetActualAmountPaid appends a ActualAmountPaid to the FEDWireMessage -func (fwm *FEDWireMessage) SetActualAmountPaid(aap *ActualAmountPaid) { - fwm.ActualAmountPaid = aap -} - -// GetActualAmountPaid returns the current ActualAmountPaid -func (fwm *FEDWireMessage) GetActualAmountPaid() *ActualAmountPaid { - return fwm.ActualAmountPaid -} - -// SetGrossAmountRemittanceDocument appends a GrossAmountRemittanceDocument to the FEDWireMessage -func (fwm *FEDWireMessage) SetGrossAmountRemittanceDocument(gard *GrossAmountRemittanceDocument) { - fwm.GrossAmountRemittanceDocument = gard -} - -// GetGrossAmountRemittanceDocument returns the current GrossAmountRemittanceDocument -func (fwm *FEDWireMessage) GetGrossAmountRemittanceDocument() *GrossAmountRemittanceDocument { - return fwm.GrossAmountRemittanceDocument -} - -// SetAmountNegotiatedDiscount appends a AmountNegotiatedDiscount to the FEDWireMessage -func (fwm *FEDWireMessage) SetAmountNegotiatedDiscount(nd *AmountNegotiatedDiscount) { - fwm.AmountNegotiatedDiscount = nd -} - -// GetAmountNegotiatedDiscount returns the current AmountNegotiatedDiscount -func (fwm *FEDWireMessage) GetAmountNegotiatedDiscount() *AmountNegotiatedDiscount { - return fwm.AmountNegotiatedDiscount -} - -// SetAdjustment appends a Adjustment to the FEDWireMessage -func (fwm *FEDWireMessage) SetAdjustment(adj *Adjustment) { - fwm.Adjustment = adj -} - -// GetAdjustment returns the current Adjustment -func (fwm *FEDWireMessage) GetAdjustment() *Adjustment { - return fwm.Adjustment -} - -// SetDateRemittanceDocument appends a DateRemittanceDocument to the FEDWireMessage -func (fwm *FEDWireMessage) SetDateRemittanceDocument(drd *DateRemittanceDocument) { - fwm.DateRemittanceDocument = drd -} - -// GetDateRemittanceDocument returns the current DateRemittanceDocument -func (fwm *FEDWireMessage) GetDateRemittanceDocument() *DateRemittanceDocument { - return fwm.DateRemittanceDocument -} - -// SetSecondaryRemittanceDocument appends a SecondaryRemittanceDocument to the FEDWireMessage -func (fwm *FEDWireMessage) SetSecondaryRemittanceDocument(srd *SecondaryRemittanceDocument) { - fwm.SecondaryRemittanceDocument = srd -} - -// GetSecondaryRemittanceDocument returns the current SecondaryRemittanceDocument -func (fwm *FEDWireMessage) GetSecondaryRemittanceDocument() *SecondaryRemittanceDocument { - return fwm.SecondaryRemittanceDocument -} - -// SetRemittanceFreeText appends a RemittanceFreeText to the FEDWireMessage -func (fwm *FEDWireMessage) SetRemittanceFreeText(rft *RemittanceFreeText) { - fwm.RemittanceFreeText = rft -} - -// GetRemittanceFreeText returns the current RemittanceFreeText -func (fwm *FEDWireMessage) GetRemittanceFreeText() *RemittanceFreeText { - return fwm.RemittanceFreeText -} - -// SetServiceMessage appends a ServiceMessage to the FEDWireMessage -func (fwm *FEDWireMessage) SetServiceMessage(sm *ServiceMessage) { - fwm.ServiceMessage = sm -} - -// GetServiceMessage returns the current ServiceMessage -func (fwm *FEDWireMessage) GetServiceMessage() *ServiceMessage { - return fwm.ServiceMessage -} - -// SetMessageDisposition appends a MessageDisposition to the FEDWireMessage -func (fwm *FEDWireMessage) SetMessageDisposition(md *MessageDisposition) { - fwm.MessageDisposition = md -} - -// GetMessageDisposition returns the current MessageDisposition -func (fwm *FEDWireMessage) GetMessageDisposition() *MessageDisposition { - return fwm.MessageDisposition -} - -// SetReceiptTimeStamp appends a ReceiptTimeStamp to the FEDWireMessage -func (fwm *FEDWireMessage) SetReceiptTimeStamp(rts *ReceiptTimeStamp) { - fwm.ReceiptTimeStamp = rts -} - -// GetReceiptTimeStamp returns the current ReceiptTimeStamp -func (fwm *FEDWireMessage) GetReceiptTimeStamp() *ReceiptTimeStamp { - return fwm.ReceiptTimeStamp -} - -// SetOutputMessageAccountabilityData appends a ErrorWire to the FEDWireMessage -func (fwm *FEDWireMessage) SetOutputMessageAccountabilityData(omad *OutputMessageAccountabilityData) { - fwm.OutputMessageAccountabilityData = omad -} - -// GetOutputMessageAccountabilityData returns the current OutputMessageAccountabilityData -func (fwm *FEDWireMessage) GetOutputMessageAccountabilityData() *OutputMessageAccountabilityData { - return fwm.OutputMessageAccountabilityData -} - -// SetErrorWire appends a ErrorWire to the FEDWireMessage -func (fwm *FEDWireMessage) SetErrorWire(ew *ErrorWire) { - fwm.ErrorWire = ew -} - -// GetErrorWire returns the current ErrorWire -func (fwm *FEDWireMessage) GetErrorWire() *ErrorWire { - return fwm.ErrorWire -} - // Only allowed if BusinessFunctionCode is CustomerTransferPlus. func (fwm *FEDWireMessage) validateLocalInstrumentCode() error { if fwm.LocalInstrument != nil { diff --git a/fedWiremessage_test.go b/fedWiremessage_test.go index 661ea6ea..ec5ae604 100644 --- a/fedWiremessage_test.go +++ b/fedWiremessage_test.go @@ -7,25 +7,19 @@ import ( ) func mockCustomerTransferData() FEDWireMessage { - fwm := NewFEDWireMessage() + fwm := FEDWireMessage{} // Mandatory Fields - ss := mockSenderSupplied() - fwm.SetSenderSupplied(ss) - tst := mockTypeSubType() - fwm.SetTypeSubType(tst) - imad := mockInputMessageAccountabilityData() - fwm.SetInputMessageAccountabilityData(imad) - amt := mockAmount() - fwm.SetAmount(amt) - sdi := mockSenderDepositoryInstitution() - fwm.SetSenderDepositoryInstitution(sdi) - rdi := mockReceiverDepositoryInstitution() - fwm.SetReceiverDepositoryInstitution(rdi) + fwm.SenderSupplied = mockSenderSupplied() + fwm.TypeSubType = mockTypeSubType() + fwm.InputMessageAccountabilityData = mockInputMessageAccountabilityData() + fwm.Amount = mockAmount() + fwm.SenderDepositoryInstitution = mockSenderDepositoryInstitution() + fwm.ReceiverDepositoryInstitution = mockReceiverDepositoryInstitution() bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = CustomerTransfer bfc.TransactionTypeCode = " " - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc return fwm } @@ -35,11 +29,9 @@ func TestFEDWireMessage_invalidAmount(t *testing.T) { // Override to trigger error (can only be zeros is TypeSubType code is 90) fwm.Amount.Amount = "000000000000" // Beneficiary - ben := mockBeneficiary() - fwm.SetBeneficiary(ben) + fwm.Beneficiary = mockBeneficiary() // Originator - o := mockOriginator() - fwm.SetOriginator(o) + fwm.Originator = mockOriginator() file.AddFEDWireMessage(fwm) // Create file if err := file.Create(); err != nil { @@ -69,7 +61,7 @@ func TestFEDWireMessage_invalidLocalInstrument(t *testing.T) { fwm := mockCustomerTransferData() li := mockLocalInstrument() li.LocalInstrumentCode = SequenceBCoverPaymentStructured - fwm.SetLocalInstrument(li) + fwm.LocalInstrument = li fwm.BusinessFunctionCode.BusinessFunctionCode = BankTransfer // local instrument only permitted for CTP err := fwm.validateLocalInstrumentCode() @@ -83,9 +75,8 @@ func TestFEDWireMessage_invalidCharges(t *testing.T) { // Override to trigger error li := mockLocalInstrument() li.LocalInstrumentCode = SequenceBCoverPaymentStructured - fwm.SetLocalInstrument(li) - c := mockCharges() - fwm.SetCharges(c) + fwm.LocalInstrument = li + fwm.Charges = mockCharges() fwm.BusinessFunctionCode.BusinessFunctionCode = CustomerTransferPlus err := fwm.validateCharges() @@ -99,9 +90,8 @@ func TestFEDWireMessage_invalidInstructedAmount(t *testing.T) { // Override to trigger error li := mockLocalInstrument() li.LocalInstrumentCode = SequenceBCoverPaymentStructured - fwm.SetLocalInstrument(li) - ia := mockInstructedAmount() - fwm.SetInstructedAmount(ia) + fwm.LocalInstrument = li + fwm.InstructedAmount = mockInstructedAmount() fwm.BusinessFunctionCode.BusinessFunctionCode = CustomerTransferPlus err := fwm.validateInstructedAmount() @@ -113,8 +103,7 @@ func TestFEDWireMessage_invalidInstructedAmount(t *testing.T) { func TestFEDWireMessage_validateExchangeRate_missingInstructedAmount(t *testing.T) { fwm := mockCustomerTransferData() // Override to trigger error - eRate := mockExchangeRate() - fwm.SetExchangeRate(eRate) + fwm.ExchangeRate = mockExchangeRate() fwm.BusinessFunctionCode.BusinessFunctionCode = CustomerTransferPlus err := fwm.validateExchangeRate() @@ -128,11 +117,9 @@ func TestFEDWireMessage_isExchangeRateValid_missingLocalInstrumentCode(t *testin // Override to trigger error li := mockLocalInstrument() li.LocalInstrumentCode = SequenceBCoverPaymentStructured - fwm.SetLocalInstrument(li) - eRate := mockExchangeRate() - fwm.SetExchangeRate(eRate) - ia := mockInstructedAmount() - fwm.SetInstructedAmount(ia) + fwm.LocalInstrument = li + fwm.ExchangeRate = mockExchangeRate() + fwm.InstructedAmount = mockInstructedAmount() fwm.BusinessFunctionCode.BusinessFunctionCode = CustomerTransferPlus err := fwm.validateExchangeRate() @@ -143,8 +130,7 @@ func TestFEDWireMessage_isExchangeRateValid_missingLocalInstrumentCode(t *testin func TestFEDWireMessage_validateBeneficiaryIntermediaryFI(t *testing.T) { fwm := mockCustomerTransferData() - bifi := mockBeneficiaryIntermediaryFI() - fwm.SetBeneficiaryIntermediaryFI(bifi) + fwm.BeneficiaryIntermediaryFI = mockBeneficiaryIntermediaryFI() fwm.BusinessFunctionCode.BusinessFunctionCode = CustomerTransfer // BeneficiaryFI required field check @@ -152,8 +138,7 @@ func TestFEDWireMessage_validateBeneficiaryIntermediaryFI(t *testing.T) { require.EqualError(t, err, fieldError("BeneficiaryFI", ErrFieldRequired).Error()) - bfi := mockBeneficiaryFI() - fwm.SetBeneficiaryFI(bfi) + fwm.BeneficiaryFI = mockBeneficiaryFI() // Beneficiary required field check err = fwm.validateBeneficiaryIntermediaryFI() @@ -163,8 +148,7 @@ func TestFEDWireMessage_validateBeneficiaryIntermediaryFI(t *testing.T) { func TestFEDWireMessage_validateBeneficiaryFI(t *testing.T) { fwm := mockCustomerTransferData() - bfi := mockBeneficiaryFI() - fwm.SetBeneficiaryFI(bfi) + fwm.BeneficiaryFI = mockBeneficiaryFI() fwm.BusinessFunctionCode.BusinessFunctionCode = CustomerTransfer // Beneficiary required field check @@ -175,8 +159,7 @@ func TestFEDWireMessage_validateBeneficiaryFI(t *testing.T) { func TestFEDWireMessage_validateOriginatorFI(t *testing.T) { fwm := mockCustomerTransferData() - ofi := mockOriginatorFI() - fwm.SetOriginatorFI(ofi) + fwm.OriginatorFI = mockOriginatorFI() fwm.BusinessFunctionCode.BusinessFunctionCode = CustomerTransfer // Originator required field check @@ -185,8 +168,7 @@ func TestFEDWireMessage_validateOriginatorFI(t *testing.T) { require.EqualError(t, err, fieldError("Originator", ErrFieldRequired).Error()) fwm.BusinessFunctionCode.BusinessFunctionCode = CustomerTransferPlus - o := mockOriginator() - fwm.SetOriginator(o) + fwm.Originator = mockOriginator() // OriginatorOptionF required field check err = fwm.validateOriginatorFI() @@ -196,8 +178,7 @@ func TestFEDWireMessage_validateOriginatorFI(t *testing.T) { func TestFEDWireMessage_validateInstructingFI(t *testing.T) { fwm := mockCustomerTransferData() - ifi := mockInstructingFI() - fwm.SetInstructingFI(ifi) + fwm.InstructingFI = mockInstructingFI() fwm.BusinessFunctionCode.BusinessFunctionCode = CustomerTransfer // Originator required field check @@ -207,8 +188,7 @@ func TestFEDWireMessage_validateInstructingFI(t *testing.T) { require.EqualError(t, err, expected) fwm.BusinessFunctionCode.BusinessFunctionCode = CustomerTransferPlus - o := mockOriginator() - fwm.SetOriginator(o) + fwm.Originator = mockOriginator() // OriginatorOptionF required field check err = fwm.validateInstructingFI() @@ -219,8 +199,7 @@ func TestFEDWireMessage_validateInstructingFI(t *testing.T) { func TestNewFEDWireMessage_validateOriginatorToBeneficiary(t *testing.T) { fwm := mockCustomerTransferData() - ob := mockOriginatorToBeneficiary() - fwm.SetOriginatorToBeneficiary(ob) + fwm.OriginatorToBeneficiary = mockOriginatorToBeneficiary() fwm.BusinessFunctionCode.BusinessFunctionCode = CustomerTransfer // Beneficiary required field check @@ -229,8 +208,7 @@ func TestNewFEDWireMessage_validateOriginatorToBeneficiary(t *testing.T) { expected := fieldError("Beneficiary", ErrFieldRequired).Error() require.EqualError(t, err, expected) - ben := mockBeneficiary() - fwm.SetBeneficiary(ben) + fwm.Beneficiary = mockBeneficiary() // Originator required Field check err = fwm.validateOriginatorToBeneficiary() @@ -238,8 +216,7 @@ func TestNewFEDWireMessage_validateOriginatorToBeneficiary(t *testing.T) { expected = fieldError("Originator", ErrFieldRequired).Error() require.EqualError(t, err, expected) - o := mockOriginator() - fwm.SetOriginator(o) + fwm.Originator = mockOriginator() fwm.BusinessFunctionCode.BusinessFunctionCode = CustomerTransferPlus // OriginatorOptionF required Field check @@ -249,7 +226,7 @@ func TestNewFEDWireMessage_validateOriginatorToBeneficiary(t *testing.T) { require.EqualError(t, err, expected) // check beneficiary still required - fwm.SetBeneficiary(nil) + fwm.Beneficiary = nil err = fwm.validateOriginatorToBeneficiary() @@ -259,8 +236,7 @@ func TestNewFEDWireMessage_validateOriginatorToBeneficiary(t *testing.T) { func TestFEDWireMessage_validateFIIntermediaryFI(t *testing.T) { fwm := mockCustomerTransferData() - fiifi := mockFIIntermediaryFI() - fwm.SetFIIntermediaryFI(fiifi) + fwm.FIIntermediaryFI = mockFIIntermediaryFI() fwm.BusinessFunctionCode.BusinessFunctionCode = CustomerTransfer // BeneficiaryIntermediaryFI required field check @@ -269,8 +245,7 @@ func TestFEDWireMessage_validateFIIntermediaryFI(t *testing.T) { expected := fieldError("BeneficiaryIntermediaryFI", ErrFieldRequired).Error() require.EqualError(t, err, expected) - bifi := mockBeneficiaryIntermediaryFI() - fwm.SetBeneficiaryIntermediaryFI(bifi) + fwm.BeneficiaryIntermediaryFI = mockBeneficiaryIntermediaryFI() // BeneficiaryFI required field check err = fwm.validateFIIntermediaryFI() @@ -278,8 +253,7 @@ func TestFEDWireMessage_validateFIIntermediaryFI(t *testing.T) { expected = fieldError("BeneficiaryFI", ErrFieldRequired).Error() require.EqualError(t, err, expected) - bfi := mockBeneficiaryFI() - fwm.SetBeneficiaryFI(bfi) + fwm.BeneficiaryFI = mockBeneficiaryFI() // Beneficiary required field check err = fwm.validateFIIntermediaryFI() @@ -290,8 +264,7 @@ func TestFEDWireMessage_validateFIIntermediaryFI(t *testing.T) { func TestFEDWireMessage_validateFIIntermediaryFIAdvice(t *testing.T) { fwm := mockCustomerTransferData() - fiifia := mockFIIntermediaryFIAdvice() - fwm.SetFIIntermediaryFIAdvice(fiifia) + fwm.FIIntermediaryFIAdvice = mockFIIntermediaryFIAdvice() fwm.BusinessFunctionCode.BusinessFunctionCode = CustomerTransfer // BeneficiaryIntermediaryFI required field check @@ -300,16 +273,14 @@ func TestFEDWireMessage_validateFIIntermediaryFIAdvice(t *testing.T) { expected := fieldError("BeneficiaryIntermediaryFI", ErrFieldRequired).Error() require.EqualError(t, err, expected) - bifi := mockBeneficiaryIntermediaryFI() - fwm.SetBeneficiaryIntermediaryFI(bifi) + fwm.BeneficiaryIntermediaryFI = mockBeneficiaryIntermediaryFI() // BeneficiaryFI required field check err = fwm.validateFIIntermediaryFIAdvice() expected = fieldError("BeneficiaryFI", ErrFieldRequired).Error() require.EqualError(t, err, expected) - bfi := mockBeneficiaryFI() - fwm.SetBeneficiaryFI(bfi) + fwm.BeneficiaryFI = mockBeneficiaryFI() // Beneficiary required field check err = fwm.validateFIIntermediaryFIAdvice() @@ -320,8 +291,7 @@ func TestFEDWireMessage_validateFIIntermediaryFIAdvice(t *testing.T) { func TestFEDWireMessage_validateFIBeneficiaryFI(t *testing.T) { fwm := mockCustomerTransferData() - fibfi := mockFIBeneficiaryFI() - fwm.SetFIBeneficiaryFI(fibfi) + fwm.FIBeneficiaryFI = mockFIBeneficiaryFI() fwm.BusinessFunctionCode.BusinessFunctionCode = CustomerTransfer // BeneficiaryFI required field check @@ -330,8 +300,7 @@ func TestFEDWireMessage_validateFIBeneficiaryFI(t *testing.T) { expected := fieldError("BeneficiaryFI", ErrFieldRequired).Error() require.EqualError(t, err, expected) - bfi := mockBeneficiaryFI() - fwm.SetBeneficiaryFI(bfi) + fwm.BeneficiaryFI = mockBeneficiaryFI() // Beneficiary required field check err = fwm.validateFIBeneficiaryFI() @@ -342,8 +311,7 @@ func TestFEDWireMessage_validateFIBeneficiaryFI(t *testing.T) { func TestFEDWireMessage_validateFIBeneficiaryFIAdvice(t *testing.T) { fwm := mockCustomerTransferData() - fibfia := mockFIBeneficiaryFIAdvice() - fwm.SetFIBeneficiaryFIAdvice(fibfia) + fwm.FIBeneficiaryFIAdvice = mockFIBeneficiaryFIAdvice() fwm.BusinessFunctionCode.BusinessFunctionCode = CustomerTransfer // BeneficiaryFI required field check @@ -352,8 +320,7 @@ func TestFEDWireMessage_validateFIBeneficiaryFIAdvice(t *testing.T) { expected := fieldError("BeneficiaryFI", ErrFieldRequired).Error() require.EqualError(t, err, expected) - bfi := mockBeneficiaryFI() - fwm.SetBeneficiaryFI(bfi) + fwm.BeneficiaryFI = mockBeneficiaryFI() // Beneficiary required field check err = fwm.validateFIBeneficiaryFIAdvice() @@ -364,8 +331,7 @@ func TestFEDWireMessage_validateFIBeneficiaryFIAdvice(t *testing.T) { func TestFEDWireMessage_validateFIBeneficiary(t *testing.T) { fwm := mockCustomerTransferData() - fib := mockFIBeneficiary() - fwm.SetFIBeneficiary(fib) + fwm.FIBeneficiary = mockFIBeneficiary() fwm.BusinessFunctionCode.BusinessFunctionCode = CustomerTransfer // Beneficiary required field check @@ -377,8 +343,7 @@ func TestFEDWireMessage_validateFIBeneficiary(t *testing.T) { func TestFEDWireMessage_validateFIBeneficiaryAdvice(t *testing.T) { fwm := mockCustomerTransferData() - fiba := mockFIBeneficiaryAdvice() - fwm.SetFIBeneficiaryAdvice(fiba) + fwm.FIBeneficiaryAdvice = mockFIBeneficiaryAdvice() fwm.BusinessFunctionCode.BusinessFunctionCode = CustomerTransfer // Beneficiary required field check @@ -393,9 +358,8 @@ func TestFEDWireMessage_validateUnstructuredAddenda(t *testing.T) { fwm.BusinessFunctionCode.BusinessFunctionCode = CustomerTransferPlus li := NewLocalInstrument() li.LocalInstrumentCode = SequenceBCoverPaymentStructured - fwm.SetLocalInstrument(li) - ua := mockUnstructuredAddenda() - fwm.SetUnstructuredAddenda(ua) + fwm.LocalInstrument = li + fwm.UnstructuredAddenda = mockUnstructuredAddenda() // UnstructuredAddenda Invalid Property err := fwm.validateUnstructuredAddenda() @@ -410,9 +374,8 @@ func TestFEDWireMessage_validateRelatedRemittance(t *testing.T) { fwm.BusinessFunctionCode.BusinessFunctionCode = CustomerTransferPlus li := NewLocalInstrument() li.LocalInstrumentCode = RemittanceInformationStructured - fwm.SetLocalInstrument(li) - rr := mockRelatedRemittance() - fwm.SetRelatedRemittance(rr) + fwm.LocalInstrument = li + fwm.RelatedRemittance = mockRelatedRemittance() // RelatedRemittance Invalid Property err := fwm.validateRelatedRemittance() @@ -426,9 +389,8 @@ func TestFEDWireMessage_validateRemittanceOriginator(t *testing.T) { fwm.BusinessFunctionCode.BusinessFunctionCode = CustomerTransferPlus li := NewLocalInstrument() li.LocalInstrumentCode = RelatedRemittanceInformation - fwm.SetLocalInstrument(li) - ro := mockRemittanceOriginator() - fwm.SetRemittanceOriginator(ro) + fwm.LocalInstrument = li + fwm.RemittanceOriginator = mockRemittanceOriginator() // RemittanceOriginator Invalid Property err := fwm.validateRemittanceOriginator() @@ -442,9 +404,8 @@ func TestFEDWireMessage_validateRemittanceBeneficiary(t *testing.T) { fwm.BusinessFunctionCode.BusinessFunctionCode = CustomerTransferPlus li := NewLocalInstrument() li.LocalInstrumentCode = RelatedRemittanceInformation - fwm.SetLocalInstrument(li) - rb := mockRemittanceBeneficiary() - fwm.SetRemittanceBeneficiary(rb) + fwm.LocalInstrument = li + fwm.RemittanceBeneficiary = mockRemittanceBeneficiary() // RemittanceBeneficiary Invalid Property err := fwm.validateRemittanceBeneficiary() @@ -467,9 +428,8 @@ func TestFEDWireMessage_validatePrimaryRemittanceDocument(t *testing.T) { fwm.BusinessFunctionCode.BusinessFunctionCode = CustomerTransferPlus li := NewLocalInstrument() li.LocalInstrumentCode = RelatedRemittanceInformation - fwm.SetLocalInstrument(li) - prd := mockPrimaryRemittanceDocument() - fwm.SetPrimaryRemittanceDocument(prd) + fwm.LocalInstrument = li + fwm.PrimaryRemittanceDocument = mockPrimaryRemittanceDocument() // PrimaryRemittanceDocument Invalid Property err := fwm.validatePrimaryRemittanceDocument() @@ -483,9 +443,8 @@ func TestFEDWireMessage_validateActualAmountPaid(t *testing.T) { fwm.BusinessFunctionCode.BusinessFunctionCode = CustomerTransferPlus li := NewLocalInstrument() li.LocalInstrumentCode = RelatedRemittanceInformation - fwm.SetLocalInstrument(li) - aap := mockActualAmountPaid() - fwm.SetActualAmountPaid(aap) + fwm.LocalInstrument = li + fwm.ActualAmountPaid = mockActualAmountPaid() // ActualAmountPaid only permitted for CTP and RMTS err := fwm.validateActualAmountPaid() @@ -500,9 +459,8 @@ func TestFEDWireMessage_validateGrossAmountRemittanceDocument(t *testing.T) { fwm.BusinessFunctionCode.BusinessFunctionCode = CustomerTransferPlus li := NewLocalInstrument() li.LocalInstrumentCode = RelatedRemittanceInformation - fwm.SetLocalInstrument(li) - gard := mockGrossAmountRemittanceDocument() - fwm.SetGrossAmountRemittanceDocument(gard) + fwm.LocalInstrument = li + fwm.GrossAmountRemittanceDocument = mockGrossAmountRemittanceDocument() // GrossAmountRemittanceDocument only permitted for CTP and RMTS err := fwm.validateGrossAmountRemittanceDocument() @@ -516,9 +474,8 @@ func TestFEDWireMessage_validateAdjustment(t *testing.T) { fwm.BusinessFunctionCode.BusinessFunctionCode = CustomerTransferPlus li := NewLocalInstrument() li.LocalInstrumentCode = RelatedRemittanceInformation - fwm.SetLocalInstrument(li) - adj := mockAdjustment() - fwm.SetAdjustment(adj) + fwm.LocalInstrument = li + fwm.Adjustment = mockAdjustment() // Adjustment Invalid Property err := fwm.validateAdjustment() @@ -533,9 +490,8 @@ func TestFEDWireMessage_validateDateRemittanceDocument(t *testing.T) { fwm.BusinessFunctionCode.BusinessFunctionCode = CustomerTransferPlus li := NewLocalInstrument() li.LocalInstrumentCode = RelatedRemittanceInformation - fwm.SetLocalInstrument(li) - drd := mockDateRemittanceDocument() - fwm.SetDateRemittanceDocument(drd) + fwm.LocalInstrument = li + fwm.DateRemittanceDocument = mockDateRemittanceDocument() // DateRemittanceDocument Invalid Property err := fwm.validateDateRemittanceDocument() @@ -549,9 +505,8 @@ func TestFEDWireMessage_validateSecondaryRemittanceDocument(t *testing.T) { fwm.BusinessFunctionCode.BusinessFunctionCode = CustomerTransferPlus li := NewLocalInstrument() li.LocalInstrumentCode = RelatedRemittanceInformation - fwm.SetLocalInstrument(li) - srd := mockSecondaryRemittanceDocument() - fwm.SetSecondaryRemittanceDocument(srd) + fwm.LocalInstrument = li + fwm.SecondaryRemittanceDocument = mockSecondaryRemittanceDocument() // SecondaryRemittanceDocument Invalid Property err := fwm.validateSecondaryRemittanceDocument() @@ -565,9 +520,8 @@ func TestFEDWireMessage_isRemittanceFreeTextValid(t *testing.T) { fwm.BusinessFunctionCode.BusinessFunctionCode = CustomerTransferPlus li := NewLocalInstrument() li.LocalInstrumentCode = RelatedRemittanceInformation - fwm.SetLocalInstrument(li) - rft := mockRemittanceFreeText() - fwm.SetRemittanceFreeText(rft) + fwm.LocalInstrument = li + fwm.RemittanceFreeText = mockRemittanceFreeText() // RemittanceFreeTextValid Invalid Property err := fwm.validateRemittanceFreeText() @@ -581,11 +535,11 @@ func TestFEDWireMessage_validateBankTransfer(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = BankTransfer - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc tst := mockTypeSubType() tst.TypeCode = FundsTransfer tst.SubTypeCode = RequestCredit - fwm.SetTypeSubType(tst) + fwm.TypeSubType = tst err := fwm.validateBankTransfer() @@ -600,7 +554,7 @@ func TestFEDWireMessage_invalidTransTypeCodeBankTransfer(t *testing.T) { bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = BankTransfer bfc.TransactionTypeCode = "COV" - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc err := fwm.checkProhibitedBankTransferTags() @@ -614,9 +568,8 @@ func TestInvalidLocalInstrumentForBankTransfer(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = BankTransfer - fwm.SetBusinessFunctionCode(bfc) - li := mockLocalInstrument() - fwm.SetLocalInstrument(li) + fwm.BusinessFunctionCode = bfc + fwm.LocalInstrument = mockLocalInstrument() err := fwm.checkProhibitedBankTransferTags() @@ -629,9 +582,8 @@ func TestInvalidPaymentNotificationForBankTransfer(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = BankTransfer - fwm.SetBusinessFunctionCode(bfc) - pn := mockPaymentNotification() - fwm.SetPaymentNotification(pn) + fwm.BusinessFunctionCode = bfc + fwm.PaymentNotification = mockPaymentNotification() err := fwm.checkProhibitedBankTransferTags() @@ -644,9 +596,8 @@ func TestInvalidChargesForBankTransfer(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = BankTransfer - fwm.SetBusinessFunctionCode(bfc) - c := mockCharges() - fwm.SetCharges(c) + fwm.BusinessFunctionCode = bfc + fwm.Charges = mockCharges() err := fwm.checkProhibitedBankTransferTags() @@ -659,9 +610,8 @@ func TestInvalidInstructedAmountForBankTransfer(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = BankTransfer - fwm.SetBusinessFunctionCode(bfc) - ia := mockInstructedAmount() - fwm.SetInstructedAmount(ia) + fwm.BusinessFunctionCode = bfc + fwm.InstructedAmount = mockInstructedAmount() err := fwm.checkProhibitedBankTransferTags() @@ -674,9 +624,8 @@ func TestInvalidExchangeRateForBankTransfer(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = BankTransfer - fwm.SetBusinessFunctionCode(bfc) - eRate := mockExchangeRate() - fwm.SetExchangeRate(eRate) + fwm.BusinessFunctionCode = bfc + fwm.ExchangeRate = mockExchangeRate() err := fwm.checkProhibitedBankTransferTags() @@ -689,10 +638,10 @@ func TestInvalidBeneficiaryIdentificationCodeForBankTransfer(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = BankTransfer - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc ben := mockBeneficiary() ben.Personal.IdentificationCode = SWIFTBICORBEIANDAccountNumber - fwm.SetBeneficiary(ben) + fwm.Beneficiary = ben err := fwm.checkProhibitedBankTransferTags() @@ -706,9 +655,8 @@ func TestInvalidAccountDebitedDrawdownForBankTransfer(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = BankTransfer - fwm.SetBusinessFunctionCode(bfc) - debitDD := mockAccountDebitedDrawdown() - fwm.SetAccountDebitedDrawdown(debitDD) + fwm.BusinessFunctionCode = bfc + fwm.AccountDebitedDrawdown = mockAccountDebitedDrawdown() err := fwm.checkProhibitedBankTransferTags() @@ -721,10 +669,10 @@ func TestInvalidOriginatorIdentificationCodeForBankTransfer(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = BankTransfer - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc o := mockOriginator() o.Personal.IdentificationCode = SWIFTBICORBEIANDAccountNumber - fwm.SetOriginator(o) + fwm.Originator = o err := fwm.checkProhibitedBankTransferTags() @@ -738,9 +686,8 @@ func TestInvalidOriginatorOptionFForBankTransfer(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = BankTransfer - fwm.SetBusinessFunctionCode(bfc) - off := mockOriginatorOptionF() - fwm.SetOriginatorOptionF(off) + fwm.BusinessFunctionCode = bfc + fwm.OriginatorOptionF = mockOriginatorOptionF() err := fwm.checkProhibitedBankTransferTags() @@ -753,9 +700,8 @@ func TestInvalidAccountCreditedDrawdownForBankTransfer(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = BankTransfer - fwm.SetBusinessFunctionCode(bfc) - creditDD := mockAccountCreditedDrawdown() - fwm.SetAccountCreditedDrawdown(creditDD) + fwm.BusinessFunctionCode = bfc + fwm.AccountCreditedDrawdown = mockAccountCreditedDrawdown() err := fwm.checkProhibitedBankTransferTags() @@ -768,9 +714,8 @@ func TestInvalidFIDrawdownDebitAccountAdviceForBankTransfer(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = BankTransfer - fwm.SetBusinessFunctionCode(bfc) - debitDDAdvice := mockFIDrawdownDebitAccountAdvice() - fwm.SetFIDrawdownDebitAccountAdvice(debitDDAdvice) + fwm.BusinessFunctionCode = bfc + fwm.FIDrawdownDebitAccountAdvice = mockFIDrawdownDebitAccountAdvice() err := fwm.checkProhibitedBankTransferTags() @@ -783,9 +728,8 @@ func TestInvalidServiceMessageForBankTransfer(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = BankTransfer - fwm.SetBusinessFunctionCode(bfc) - sm := mockServiceMessage() - fwm.SetServiceMessage(sm) + fwm.BusinessFunctionCode = bfc + fwm.ServiceMessage = mockServiceMessage() err := fwm.checkProhibitedBankTransferTags() @@ -798,9 +742,8 @@ func TestInvalidUnstructuredAddendaForBankTransfer(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = BankTransfer - fwm.SetBusinessFunctionCode(bfc) - ua := mockUnstructuredAddenda() - fwm.SetUnstructuredAddenda(ua) + fwm.BusinessFunctionCode = bfc + fwm.UnstructuredAddenda = mockUnstructuredAddenda() err := fwm.checkProhibitedBankTransferTags() @@ -813,9 +756,8 @@ func TestInvalidCurrencyInstructedAmountForBankTransfer(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = BankTransfer - fwm.SetBusinessFunctionCode(bfc) - cia := mockCurrencyInstructedAmount() - fwm.SetCurrencyInstructedAmount(cia) + fwm.BusinessFunctionCode = bfc + fwm.CurrencyInstructedAmount = mockCurrencyInstructedAmount() err := fwm.checkProhibitedBankTransferTags() @@ -828,9 +770,8 @@ func TestInvalidRelatedRemittanceForBankTransfer(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = BankTransfer - fwm.SetBusinessFunctionCode(bfc) - rr := mockRelatedRemittance() - fwm.SetRelatedRemittance(rr) + fwm.BusinessFunctionCode = bfc + fwm.RelatedRemittance = mockRelatedRemittance() err := fwm.checkProhibitedBankTransferTags() @@ -844,7 +785,7 @@ func TestInvalidTransactionTypeCodeForCustomerTransfer(t *testing.T) { bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = CustomerTransfer bfc.TransactionTypeCode = "COV" - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc err := fwm.checkProhibitedCustomerTransferTags() @@ -858,9 +799,8 @@ func TestInvalidLocalInstrumentForCustomerTransfer(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = CustomerTransfer - fwm.SetBusinessFunctionCode(bfc) - li := mockLocalInstrument() - fwm.SetLocalInstrument(li) + fwm.BusinessFunctionCode = bfc + fwm.LocalInstrument = mockLocalInstrument() err := fwm.checkProhibitedCustomerTransferTags() @@ -873,9 +813,8 @@ func TestInvalidPaymentNotificationForCustomerTransfer(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = CustomerTransfer - fwm.SetBusinessFunctionCode(bfc) - pn := mockPaymentNotification() - fwm.SetPaymentNotification(pn) + fwm.BusinessFunctionCode = bfc + fwm.PaymentNotification = mockPaymentNotification() err := fwm.checkProhibitedCustomerTransferTags() @@ -888,9 +827,8 @@ func TestInvalidAccountDebitedDrawdownForCustomerTransfer(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = CustomerTransfer - fwm.SetBusinessFunctionCode(bfc) - debitDD := mockAccountDebitedDrawdown() - fwm.SetAccountDebitedDrawdown(debitDD) + fwm.BusinessFunctionCode = bfc + fwm.AccountDebitedDrawdown = mockAccountDebitedDrawdown() err := fwm.checkProhibitedCustomerTransferTags() @@ -903,9 +841,8 @@ func TestInvalidOriginatorOptionFForCustomerTransfer(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = CustomerTransfer - fwm.SetBusinessFunctionCode(bfc) - off := mockOriginatorOptionF() - fwm.SetOriginatorOptionF(off) + fwm.BusinessFunctionCode = bfc + fwm.OriginatorOptionF = mockOriginatorOptionF() err := fwm.checkProhibitedCustomerTransferTags() @@ -918,9 +855,8 @@ func TestInvalidAccountCreditedDrawdownForCustomerTransfer(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = CustomerTransfer - fwm.SetBusinessFunctionCode(bfc) - creditDD := mockAccountCreditedDrawdown() - fwm.SetAccountCreditedDrawdown(creditDD) + fwm.BusinessFunctionCode = bfc + fwm.AccountCreditedDrawdown = mockAccountCreditedDrawdown() err := fwm.checkProhibitedCustomerTransferTags() @@ -933,9 +869,8 @@ func TestInvalidFIDrawdownDebitAccountAdviceForCustomerTransfer(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = CustomerTransfer - fwm.SetBusinessFunctionCode(bfc) - debitDDAdvice := mockFIDrawdownDebitAccountAdvice() - fwm.SetFIDrawdownDebitAccountAdvice(debitDDAdvice) + fwm.BusinessFunctionCode = bfc + fwm.FIDrawdownDebitAccountAdvice = mockFIDrawdownDebitAccountAdvice() err := fwm.checkProhibitedCustomerTransferTags() @@ -948,9 +883,8 @@ func TestInvalidServiceMessageForCustomerTransfer(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = CustomerTransfer - fwm.SetBusinessFunctionCode(bfc) - sm := mockServiceMessage() - fwm.SetServiceMessage(sm) + fwm.BusinessFunctionCode = bfc + fwm.ServiceMessage = mockServiceMessage() err := fwm.checkProhibitedCustomerTransferTags() @@ -963,9 +897,8 @@ func TestInvalidUnstructuredAddendaForCustomerTransfer(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = CustomerTransfer - fwm.SetBusinessFunctionCode(bfc) - ua := mockUnstructuredAddenda() - fwm.SetUnstructuredAddenda(ua) + fwm.BusinessFunctionCode = bfc + fwm.UnstructuredAddenda = mockUnstructuredAddenda() err := fwm.checkProhibitedCustomerTransferTags() @@ -978,9 +911,8 @@ func TestInvalidCurrencyInstructedAmountForCustomerTransfer(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = CustomerTransfer - fwm.SetBusinessFunctionCode(bfc) - cia := mockCurrencyInstructedAmount() - fwm.SetCurrencyInstructedAmount(cia) + fwm.BusinessFunctionCode = bfc + fwm.CurrencyInstructedAmount = mockCurrencyInstructedAmount() err := fwm.checkProhibitedCustomerTransferTags() @@ -993,9 +925,8 @@ func TestInvalidRelatedRemittanceForCustomerTransfer(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = CustomerTransfer - fwm.SetBusinessFunctionCode(bfc) - rr := mockRelatedRemittance() - fwm.SetRelatedRemittance(rr) + fwm.BusinessFunctionCode = bfc + fwm.RelatedRemittance = mockRelatedRemittance() err := fwm.checkProhibitedCustomerTransferTags() @@ -1009,13 +940,10 @@ func TestLocalInstrumentUnstructuredAddendaForCustomerTransferPlus(t *testing.T) fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = CustomerTransferPlus - fwm.SetBusinessFunctionCode(bfc) - ben := mockBeneficiary() - fwm.SetBeneficiary(ben) - o := mockOriginator() - fwm.SetOriginator(o) - li := mockLocalInstrument() - fwm.SetLocalInstrument(li) + fwm.BusinessFunctionCode = bfc + fwm.Beneficiary = mockBeneficiary() + fwm.Originator = mockOriginator() + fwm.LocalInstrument = mockLocalInstrument() err := fwm.checkMandatoryCustomerTransferPlusTags() @@ -1029,14 +957,12 @@ func TestLocalInstrumentRelatedRemittanceForCustomerTransferPlus(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = CustomerTransferPlus - fwm.SetBusinessFunctionCode(bfc) - ben := mockBeneficiary() - fwm.SetBeneficiary(ben) - o := mockOriginator() - fwm.SetOriginator(o) + fwm.BusinessFunctionCode = bfc + fwm.Beneficiary = mockBeneficiary() + fwm.Originator = mockOriginator() li := mockLocalInstrument() li.LocalInstrumentCode = RelatedRemittanceInformation - fwm.SetLocalInstrument(li) + fwm.LocalInstrument = li err := fwm.checkMandatoryCustomerTransferPlusTags() @@ -1050,14 +976,12 @@ func TestLocalInstrumentBeneficiaryReferenceForCustomerTransferPlus(t *testing.T fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = CustomerTransferPlus - fwm.SetBusinessFunctionCode(bfc) - ben := mockBeneficiary() - fwm.SetBeneficiary(ben) - o := mockOriginator() - fwm.SetOriginator(o) + fwm.BusinessFunctionCode = bfc + fwm.Beneficiary = mockBeneficiary() + fwm.Originator = mockOriginator() li := mockLocalInstrument() li.LocalInstrumentCode = SequenceBCoverPaymentStructured - fwm.SetLocalInstrument(li) + fwm.LocalInstrument = li err := fwm.checkMandatoryCustomerTransferPlusTags() @@ -1071,16 +995,13 @@ func TestLocalInstrumentOrderingCustomerForCustomerTransferPlus(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = CustomerTransferPlus - fwm.SetBusinessFunctionCode(bfc) - ben := mockBeneficiary() - fwm.SetBeneficiary(ben) - o := mockOriginator() - fwm.SetOriginator(o) + fwm.BusinessFunctionCode = bfc + fwm.Beneficiary = mockBeneficiary() + fwm.Originator = mockOriginator() li := mockLocalInstrument() li.LocalInstrumentCode = SequenceBCoverPaymentStructured - fwm.SetLocalInstrument(li) - br := mockBeneficiaryReference() - fwm.SetBeneficiaryReference(br) + fwm.LocalInstrument = li + fwm.BeneficiaryReference = mockBeneficiaryReference() err := fwm.checkMandatoryCustomerTransferPlusTags() @@ -1094,18 +1015,14 @@ func TestLocalInstrumentBeneficiaryCustomerForCustomerTransferPlus(t *testing.T) fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = CustomerTransferPlus - fwm.SetBusinessFunctionCode(bfc) - ben := mockBeneficiary() - fwm.SetBeneficiary(ben) - o := mockOriginator() - fwm.SetOriginator(o) + fwm.BusinessFunctionCode = bfc + fwm.Beneficiary = mockBeneficiary() + fwm.Originator = mockOriginator() li := mockLocalInstrument() li.LocalInstrumentCode = SequenceBCoverPaymentStructured - fwm.SetLocalInstrument(li) - br := mockBeneficiaryReference() - fwm.SetBeneficiaryReference(br) - oc := mockOrderingCustomer() - fwm.SetOrderingCustomer(oc) + fwm.LocalInstrument = li + fwm.BeneficiaryReference = mockBeneficiaryReference() + fwm.OrderingCustomer = mockOrderingCustomer() err := fwm.checkMandatoryCustomerTransferPlusTags() @@ -1119,14 +1036,12 @@ func TestLocalInstrumentProprietaryCodeForCustomerTransferPlus(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = CustomerTransferPlus - fwm.SetBusinessFunctionCode(bfc) - ben := mockBeneficiary() - fwm.SetBeneficiary(ben) - o := mockOriginator() - fwm.SetOriginator(o) + fwm.BusinessFunctionCode = bfc + fwm.Beneficiary = mockBeneficiary() + fwm.Originator = mockOriginator() li := mockLocalInstrument() li.LocalInstrumentCode = ProprietaryLocalInstrumentCode - fwm.SetLocalInstrument(li) + fwm.LocalInstrument = li err := fwm.checkMandatoryCustomerTransferPlusTags() @@ -1140,14 +1055,12 @@ func TestLocalInstrumentRemittanceOriginatorForCustomerTransferPlus(t *testing.T fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = CustomerTransferPlus - fwm.SetBusinessFunctionCode(bfc) - ben := mockBeneficiary() - fwm.SetBeneficiary(ben) - o := mockOriginator() - fwm.SetOriginator(o) + fwm.BusinessFunctionCode = bfc + fwm.Beneficiary = mockBeneficiary() + fwm.Originator = mockOriginator() li := mockLocalInstrument() li.LocalInstrumentCode = RemittanceInformationStructured - fwm.SetLocalInstrument(li) + fwm.LocalInstrument = li err := fwm.checkMandatoryCustomerTransferPlusTags() @@ -1161,16 +1074,13 @@ func TestLocalInstrumentRemittanceBeneficiaryForCustomerTransferPlus(t *testing. fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = CustomerTransferPlus - fwm.SetBusinessFunctionCode(bfc) - ben := mockBeneficiary() - fwm.SetBeneficiary(ben) - o := mockOriginator() - fwm.SetOriginator(o) + fwm.BusinessFunctionCode = bfc + fwm.Beneficiary = mockBeneficiary() + fwm.Originator = mockOriginator() li := mockLocalInstrument() li.LocalInstrumentCode = RemittanceInformationStructured - fwm.SetLocalInstrument(li) - ro := mockRemittanceOriginator() - fwm.SetRemittanceOriginator(ro) + fwm.LocalInstrument = li + fwm.RemittanceOriginator = mockRemittanceOriginator() err := fwm.checkMandatoryCustomerTransferPlusTags() @@ -1184,18 +1094,14 @@ func TestLocalInstrumentPrimaryRemittanceDocumentForCustomerTransferPlus(t *test fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = CustomerTransferPlus - fwm.SetBusinessFunctionCode(bfc) - ben := mockBeneficiary() - fwm.SetBeneficiary(ben) - o := mockOriginator() - fwm.SetOriginator(o) + fwm.BusinessFunctionCode = bfc + fwm.Beneficiary = mockBeneficiary() + fwm.Originator = mockOriginator() li := mockLocalInstrument() li.LocalInstrumentCode = RemittanceInformationStructured - fwm.SetLocalInstrument(li) - ro := mockRemittanceOriginator() - fwm.SetRemittanceOriginator(ro) - rb := mockRemittanceBeneficiary() - fwm.SetRemittanceBeneficiary(rb) + fwm.LocalInstrument = li + fwm.RemittanceOriginator = mockRemittanceOriginator() + fwm.RemittanceBeneficiary = mockRemittanceBeneficiary() err := fwm.checkMandatoryCustomerTransferPlusTags() @@ -1209,20 +1115,15 @@ func TestLocalInstrumentActualAmountPaidForCustomerTransferPlus(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = CustomerTransferPlus - fwm.SetBusinessFunctionCode(bfc) - ben := mockBeneficiary() - fwm.SetBeneficiary(ben) - o := mockOriginator() - fwm.SetOriginator(o) + fwm.BusinessFunctionCode = bfc + fwm.Beneficiary = mockBeneficiary() + fwm.Originator = mockOriginator() li := mockLocalInstrument() li.LocalInstrumentCode = RemittanceInformationStructured - fwm.SetLocalInstrument(li) - ro := mockRemittanceOriginator() - fwm.SetRemittanceOriginator(ro) - rb := mockRemittanceBeneficiary() - fwm.SetRemittanceBeneficiary(rb) - prd := mockPrimaryRemittanceDocument() - fwm.SetPrimaryRemittanceDocument(prd) + fwm.LocalInstrument = li + fwm.RemittanceOriginator = mockRemittanceOriginator() + fwm.RemittanceBeneficiary = mockRemittanceBeneficiary() + fwm.PrimaryRemittanceDocument = mockPrimaryRemittanceDocument() err := fwm.checkMandatoryCustomerTransferPlusTags() @@ -1235,7 +1136,7 @@ func TestBeneficiaryIdentificationCodeForCustomerTransferPlus(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = CustomerTransferPlus - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc err := fwm.checkMandatoryCustomerTransferPlusTags() @@ -1248,9 +1149,8 @@ func TestOriginatorIdentificationCodeForCustomerTransferPlus(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = CustomerTransferPlus - fwm.SetBusinessFunctionCode(bfc) - ben := mockBeneficiary() - fwm.SetBeneficiary(ben) + fwm.BusinessFunctionCode = bfc + fwm.Beneficiary = mockBeneficiary() err := fwm.checkMandatoryCustomerTransferPlusTags() @@ -1263,9 +1163,8 @@ func TestInvalidAccountDebitedDrawdownForCustomerTransferPlus(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = CustomerTransferPlus - fwm.SetBusinessFunctionCode(bfc) - debitDD := mockAccountDebitedDrawdown() - fwm.SetAccountDebitedDrawdown(debitDD) + fwm.BusinessFunctionCode = bfc + fwm.AccountDebitedDrawdown = mockAccountDebitedDrawdown() err := fwm.checkProhibitedCustomerTransferPlusTags() @@ -1278,9 +1177,8 @@ func TestInvalidAccountCreditedDrawdownForCustomerTransferPlus(t *testing.T) { fwm := new(FEDWireMessage) bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = CustomerTransferPlus - fwm.SetBusinessFunctionCode(bfc) - creditDD := mockAccountCreditedDrawdown() - fwm.SetAccountCreditedDrawdown(creditDD) + fwm.BusinessFunctionCode = bfc + fwm.AccountCreditedDrawdown = mockAccountCreditedDrawdown() err := fwm.checkProhibitedCustomerTransferPlusTags() diff --git a/reader.go b/reader.go index 8f971f8c..99fad589 100644 --- a/reader.go +++ b/reader.go @@ -77,7 +77,7 @@ func (r *Reader) Read() (File, error) { } r.File.AddFEDWireMessage(r.currentFEDWireMessage) - r.currentFEDWireMessage = NewFEDWireMessage() + r.currentFEDWireMessage = FEDWireMessage{} if r.errors.Empty() { return r.File, nil @@ -330,7 +330,7 @@ func (r *Reader) parseSenderSupplied() error { if err := ss.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetSenderSupplied(ss) + r.currentFEDWireMessage.SenderSupplied = ss return nil } @@ -343,7 +343,7 @@ func (r *Reader) parseTypeSubType() error { if err := tst.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetTypeSubType(tst) + r.currentFEDWireMessage.TypeSubType = tst return nil } @@ -356,7 +356,7 @@ func (r *Reader) parseInputMessageAccountabilityData() error { if err := imad.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetInputMessageAccountabilityData(imad) + r.currentFEDWireMessage.InputMessageAccountabilityData = imad return nil } @@ -369,7 +369,7 @@ func (r *Reader) parseAmount() error { if err := amt.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetAmount(amt) + r.currentFEDWireMessage.Amount = amt return nil } @@ -382,7 +382,7 @@ func (r *Reader) parseSenderDepositoryInstitution() error { if err := sdi.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetSenderDepositoryInstitution(sdi) + r.currentFEDWireMessage.SenderDepositoryInstitution = sdi return nil } @@ -395,7 +395,7 @@ func (r *Reader) parseReceiverDepositoryInstitution() error { if err := rdi.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetReceiverDepositoryInstitution(rdi) + r.currentFEDWireMessage.ReceiverDepositoryInstitution = rdi return nil } @@ -408,7 +408,7 @@ func (r *Reader) parseBusinessFunctionCode() error { if err := bfc.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetBusinessFunctionCode(bfc) + r.currentFEDWireMessage.BusinessFunctionCode = bfc return nil } @@ -421,7 +421,7 @@ func (r *Reader) parseSenderReference() error { if err := sr.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetSenderReference(sr) + r.currentFEDWireMessage.SenderReference = sr return nil } @@ -434,7 +434,7 @@ func (r *Reader) parsePreviousMessageIdentifier() error { if err := pmi.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetPreviousMessageIdentifier(pmi) + r.currentFEDWireMessage.PreviousMessageIdentifier = pmi return nil } @@ -447,7 +447,7 @@ func (r *Reader) parseLocalInstrument() error { if err := li.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetLocalInstrument(li) + r.currentFEDWireMessage.LocalInstrument = li return nil } @@ -460,7 +460,7 @@ func (r *Reader) parsePaymentNotification() error { if err := pn.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetPaymentNotification(pn) + r.currentFEDWireMessage.PaymentNotification = pn return nil } @@ -471,7 +471,7 @@ func (r *Reader) parseCharges() error { if err := c.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetCharges(c) + r.currentFEDWireMessage.Charges = c return nil } @@ -484,7 +484,7 @@ func (r *Reader) parseInstructedAmount() error { if err := ia.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetInstructedAmount(ia) + r.currentFEDWireMessage.InstructedAmount = ia return nil } @@ -497,7 +497,7 @@ func (r *Reader) parseExchangeRate() error { if err := eRate.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetExchangeRate(eRate) + r.currentFEDWireMessage.ExchangeRate = eRate return nil } @@ -510,7 +510,7 @@ func (r *Reader) parseBeneficiaryIntermediaryFI() error { if err := bifi.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetBeneficiaryIntermediaryFI(bifi) + r.currentFEDWireMessage.BeneficiaryIntermediaryFI = bifi return nil } @@ -523,7 +523,7 @@ func (r *Reader) parseBeneficiaryFI() error { if err := bfi.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetBeneficiaryFI(bfi) + r.currentFEDWireMessage.BeneficiaryFI = bfi return nil } @@ -536,7 +536,7 @@ func (r *Reader) parseBeneficiary() error { if err := ben.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetBeneficiary(ben) + r.currentFEDWireMessage.Beneficiary = ben return nil } @@ -549,7 +549,7 @@ func (r *Reader) parseBeneficiaryReference() error { if err := br.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetBeneficiaryReference(br) + r.currentFEDWireMessage.BeneficiaryReference = br return nil } @@ -562,7 +562,7 @@ func (r *Reader) parseAccountDebitedDrawdown() error { if err := debitDD.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetAccountDebitedDrawdown(debitDD) + r.currentFEDWireMessage.AccountDebitedDrawdown = debitDD return nil } @@ -575,7 +575,7 @@ func (r *Reader) parseOriginator() error { if err := o.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetOriginator(o) + r.currentFEDWireMessage.Originator = o return nil } @@ -588,7 +588,7 @@ func (r *Reader) parseOriginatorOptionF() error { if err := oof.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetOriginatorOptionF(oof) + r.currentFEDWireMessage.OriginatorOptionF = oof return nil } @@ -601,7 +601,7 @@ func (r *Reader) parseOriginatorFI() error { if err := ofi.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetOriginatorFI(ofi) + r.currentFEDWireMessage.OriginatorFI = ofi return nil } @@ -614,7 +614,7 @@ func (r *Reader) parseInstructingFI() error { if err := ifi.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetInstructingFI(ifi) + r.currentFEDWireMessage.InstructingFI = ifi return nil } @@ -627,7 +627,7 @@ func (r *Reader) parseAccountCreditedDrawdown() error { if err := creditDD.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetAccountCreditedDrawdown(creditDD) + r.currentFEDWireMessage.AccountCreditedDrawdown = creditDD return nil } @@ -640,7 +640,7 @@ func (r *Reader) parseOriginatorToBeneficiary() error { if err := ob.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetOriginatorToBeneficiary(ob) + r.currentFEDWireMessage.OriginatorToBeneficiary = ob return nil } @@ -653,7 +653,7 @@ func (r *Reader) parseFIReceiverFI() error { if err := firfi.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetFIReceiverFI(firfi) + r.currentFEDWireMessage.FIReceiverFI = firfi return nil } @@ -666,7 +666,7 @@ func (r *Reader) parseFIDrawdownDebitAccountAdvice() error { if err := debitDDAdvice.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetFIDrawdownDebitAccountAdvice(debitDDAdvice) + r.currentFEDWireMessage.FIDrawdownDebitAccountAdvice = debitDDAdvice return nil } @@ -679,7 +679,7 @@ func (r *Reader) parseFIIntermediaryFI() error { if err := fiifi.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetFIIntermediaryFI(fiifi) + r.currentFEDWireMessage.FIIntermediaryFI = fiifi return nil } @@ -692,7 +692,7 @@ func (r *Reader) parseFIIntermediaryFIAdvice() error { if err := fiifia.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetFIIntermediaryFIAdvice(fiifia) + r.currentFEDWireMessage.FIIntermediaryFIAdvice = fiifia return nil } @@ -705,7 +705,7 @@ func (r *Reader) parseFIBeneficiaryFI() error { if err := fibfi.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetFIBeneficiaryFI(fibfi) + r.currentFEDWireMessage.FIBeneficiaryFI = fibfi return nil } @@ -718,7 +718,7 @@ func (r *Reader) parseFIBeneficiaryFIAdvice() error { if err := fibfia.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetFIBeneficiaryFIAdvice(fibfia) + r.currentFEDWireMessage.FIBeneficiaryFIAdvice = fibfia return nil } @@ -731,7 +731,7 @@ func (r *Reader) parseFIBeneficiary() error { if err := fib.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetFIBeneficiary(fib) + r.currentFEDWireMessage.FIBeneficiary = fib return nil } @@ -744,7 +744,7 @@ func (r *Reader) parseFIBeneficiaryAdvice() error { if err := fiba.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetFIBeneficiaryAdvice(fiba) + r.currentFEDWireMessage.FIBeneficiaryAdvice = fiba return nil } @@ -757,7 +757,7 @@ func (r *Reader) parseFIPaymentMethodToBeneficiary() error { if err := pm.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetFIPaymentMethodToBeneficiary(pm) + r.currentFEDWireMessage.FIPaymentMethodToBeneficiary = pm return nil } @@ -770,7 +770,7 @@ func (r *Reader) parseFIAdditionalFIToFI() error { if err := fifi.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetFIAdditionalFIToFI(fifi) + r.currentFEDWireMessage.FIAdditionalFIToFI = fifi return nil } @@ -783,7 +783,7 @@ func (r *Reader) parseCurrencyInstructedAmount() error { if err := cia.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetCurrencyInstructedAmount(cia) + r.currentFEDWireMessage.CurrencyInstructedAmount = cia return nil } @@ -796,7 +796,7 @@ func (r *Reader) parseOrderingCustomer() error { if err := oc.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetOrderingCustomer(oc) + r.currentFEDWireMessage.OrderingCustomer = oc return nil } @@ -809,7 +809,7 @@ func (r *Reader) parseOrderingInstitution() error { if err := oi.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetOrderingInstitution(oi) + r.currentFEDWireMessage.OrderingInstitution = oi return nil } @@ -822,7 +822,7 @@ func (r *Reader) parseIntermediaryInstitution() error { if err := ii.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetIntermediaryInstitution(ii) + r.currentFEDWireMessage.IntermediaryInstitution = ii return nil } @@ -835,7 +835,7 @@ func (r *Reader) parseInstitutionAccount() error { if err := iAccount.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetInstitutionAccount(iAccount) + r.currentFEDWireMessage.InstitutionAccount = iAccount return nil } @@ -848,7 +848,7 @@ func (r *Reader) parseBeneficiaryCustomer() error { if err := bc.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetBeneficiaryCustomer(bc) + r.currentFEDWireMessage.BeneficiaryCustomer = bc return nil } @@ -861,7 +861,7 @@ func (r *Reader) parseRemittance() error { if err := ri.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetRemittance(ri) + r.currentFEDWireMessage.Remittance = ri return nil } @@ -874,7 +874,7 @@ func (r *Reader) parseSenderToReceiver() error { if err := sr.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetSenderToReceiver(sr) + r.currentFEDWireMessage.SenderToReceiver = sr return nil } @@ -887,7 +887,7 @@ func (r *Reader) parseUnstructuredAddenda() error { if err := ua.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetUnstructuredAddenda(ua) + r.currentFEDWireMessage.UnstructuredAddenda = ua return nil } @@ -900,7 +900,7 @@ func (r *Reader) parseRelatedRemittance() error { if err := rr.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetRelatedRemittance(rr) + r.currentFEDWireMessage.RelatedRemittance = rr return nil } @@ -913,7 +913,7 @@ func (r *Reader) parseRemittanceOriginator() error { if err := ro.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetRemittanceOriginator(ro) + r.currentFEDWireMessage.RemittanceOriginator = ro return nil } @@ -926,7 +926,7 @@ func (r *Reader) parseRemittanceBeneficiary() error { if err := rb.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetRemittanceBeneficiary(rb) + r.currentFEDWireMessage.RemittanceBeneficiary = rb return nil } @@ -939,7 +939,7 @@ func (r *Reader) parsePrimaryRemittanceDocument() error { if err := prd.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetPrimaryRemittanceDocument(prd) + r.currentFEDWireMessage.PrimaryRemittanceDocument = prd return nil } @@ -952,7 +952,7 @@ func (r *Reader) parseActualAmountPaid() error { if err := aap.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetActualAmountPaid(aap) + r.currentFEDWireMessage.ActualAmountPaid = aap return nil } @@ -965,7 +965,7 @@ func (r *Reader) parseGrossAmountRemittanceDocument() error { if err := gard.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetGrossAmountRemittanceDocument(gard) + r.currentFEDWireMessage.GrossAmountRemittanceDocument = gard return nil } @@ -978,7 +978,7 @@ func (r *Reader) parseAmountNegotiatedDiscount() error { if err := nd.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetAmountNegotiatedDiscount(nd) + r.currentFEDWireMessage.AmountNegotiatedDiscount = nd return nil } @@ -991,7 +991,7 @@ func (r *Reader) parseAdjustment() error { if err := adj.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetAdjustment(adj) + r.currentFEDWireMessage.Adjustment = adj return nil } @@ -1004,7 +1004,7 @@ func (r *Reader) parseDateRemittanceDocument() error { if err := drd.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetDateRemittanceDocument(drd) + r.currentFEDWireMessage.DateRemittanceDocument = drd return nil } @@ -1017,7 +1017,7 @@ func (r *Reader) parseSecondaryRemittanceDocument() error { if err := srd.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetSecondaryRemittanceDocument(srd) + r.currentFEDWireMessage.SecondaryRemittanceDocument = srd return nil } @@ -1030,7 +1030,7 @@ func (r *Reader) parseRemittanceFreeText() error { if err := rft.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetRemittanceFreeText(rft) + r.currentFEDWireMessage.RemittanceFreeText = rft return nil } @@ -1043,7 +1043,7 @@ func (r *Reader) parseServiceMessage() error { if err := sm.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetServiceMessage(sm) + r.currentFEDWireMessage.ServiceMessage = sm return nil } @@ -1054,7 +1054,7 @@ func (r *Reader) parseMessageDisposition() error { if err := md.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetMessageDisposition(md) + r.currentFEDWireMessage.MessageDisposition = md return nil } @@ -1065,7 +1065,7 @@ func (r *Reader) parseReceiptTimeStamp() error { if err := rts.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetReceiptTimeStamp(rts) + r.currentFEDWireMessage.ReceiptTimeStamp = rts return nil } @@ -1076,7 +1076,7 @@ func (r *Reader) parseOutputMessageAccountabilityData() error { if err := omad.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetOutputMessageAccountabilityData(omad) + r.currentFEDWireMessage.OutputMessageAccountabilityData = omad return nil } @@ -1087,6 +1087,6 @@ func (r *Reader) parseErrorWire() error { if err := ew.Validate(); err != nil { return r.parseError(err) } - r.currentFEDWireMessage.SetErrorWire(ew) + r.currentFEDWireMessage.ErrorWire = ew return nil } diff --git a/serviceMessage_test.go b/serviceMessage_test.go index a0458437..26b18fc0 100644 --- a/serviceMessage_test.go +++ b/serviceMessage_test.go @@ -192,10 +192,10 @@ func TestParseServiceMessageReaderParseError(t *testing.T) { func TestInvalidTransactionTypeCodeForServiceMessage(t *testing.T) { fwm := new(FEDWireMessage) sm := mockServiceMessage() - fwm.SetServiceMessage(sm) + fwm.ServiceMessage = sm bfc := mockBusinessFunctionCode() bfc.TransactionTypeCode = "COV" - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc err := fwm.checkProhibitedServiceMessageTags() @@ -206,9 +206,9 @@ func TestInvalidTransactionTypeCodeForServiceMessage(t *testing.T) { func TestInvalidLocalInstrumentForServiceMessage(t *testing.T) { fwm := new(FEDWireMessage) sm := mockServiceMessage() - fwm.SetServiceMessage(sm) + fwm.ServiceMessage = sm li := mockLocalInstrument() - fwm.SetLocalInstrument(li) + fwm.LocalInstrument = li err := fwm.checkProhibitedServiceMessageTags() @@ -219,9 +219,9 @@ func TestInvalidLocalInstrumentForServiceMessage(t *testing.T) { func TestInvalidPaymentNotificationForServiceMessage(t *testing.T) { fwm := new(FEDWireMessage) sm := mockServiceMessage() - fwm.SetServiceMessage(sm) + fwm.ServiceMessage = sm pn := mockPaymentNotification() - fwm.SetPaymentNotification(pn) + fwm.PaymentNotification = pn err := fwm.checkProhibitedServiceMessageTags() @@ -232,9 +232,9 @@ func TestInvalidPaymentNotificationForServiceMessage(t *testing.T) { func TestInvalidChargesForServiceMessage(t *testing.T) { fwm := new(FEDWireMessage) sm := mockServiceMessage() - fwm.SetServiceMessage(sm) + fwm.ServiceMessage = sm c := mockCharges() - fwm.SetCharges(c) + fwm.Charges = c err := fwm.checkProhibitedServiceMessageTags() @@ -245,9 +245,9 @@ func TestInvalidChargesForServiceMessage(t *testing.T) { func TestInvalidInstructedAmountForServiceMessage(t *testing.T) { fwm := new(FEDWireMessage) sm := mockServiceMessage() - fwm.SetServiceMessage(sm) + fwm.ServiceMessage = sm ia := mockInstructedAmount() - fwm.SetInstructedAmount(ia) + fwm.InstructedAmount = ia err := fwm.checkProhibitedServiceMessageTags() @@ -258,9 +258,9 @@ func TestInvalidInstructedAmountForServiceMessage(t *testing.T) { func TestInvalidExchangeRateForServiceMessage(t *testing.T) { fwm := new(FEDWireMessage) sm := mockServiceMessage() - fwm.SetServiceMessage(sm) + fwm.ServiceMessage = sm eRate := mockExchangeRate() - fwm.SetExchangeRate(eRate) + fwm.ExchangeRate = eRate err := fwm.checkProhibitedServiceMessageTags() @@ -271,10 +271,10 @@ func TestInvalidExchangeRateForServiceMessage(t *testing.T) { func TestInvalidBeneficiaryIdentificationCodeForServiceMessage(t *testing.T) { fwm := new(FEDWireMessage) sm := mockServiceMessage() - fwm.SetServiceMessage(sm) + fwm.ServiceMessage = sm ben := mockBeneficiary() ben.Personal.IdentificationCode = SWIFTBICORBEIANDAccountNumber - fwm.SetBeneficiary(ben) + fwm.Beneficiary = ben err := fwm.checkProhibitedServiceMessageTags() @@ -285,10 +285,10 @@ func TestInvalidBeneficiaryIdentificationCodeForServiceMessage(t *testing.T) { func TestInvalidOriginatorIdentificationCodeForServiceMessage(t *testing.T) { fwm := new(FEDWireMessage) sm := mockServiceMessage() - fwm.SetServiceMessage(sm) + fwm.ServiceMessage = sm o := mockOriginator() o.Personal.IdentificationCode = SWIFTBICORBEIANDAccountNumber - fwm.SetOriginator(o) + fwm.Originator = o err := fwm.checkProhibitedServiceMessageTags() @@ -299,9 +299,9 @@ func TestInvalidOriginatorIdentificationCodeForServiceMessage(t *testing.T) { func TestInvalidOriginatorOptionFForServiceMessage(t *testing.T) { fwm := new(FEDWireMessage) sm := mockServiceMessage() - fwm.SetServiceMessage(sm) + fwm.ServiceMessage = sm off := mockOriginatorOptionF() - fwm.SetOriginatorOptionF(off) + fwm.OriginatorOptionF = off err := fwm.checkProhibitedServiceMessageTags() @@ -312,9 +312,9 @@ func TestInvalidOriginatorOptionFForServiceMessage(t *testing.T) { func TestInvalidUnstructuredAddendaForServiceMessage(t *testing.T) { fwm := new(FEDWireMessage) sm := mockServiceMessage() - fwm.SetServiceMessage(sm) + fwm.ServiceMessage = sm ua := mockUnstructuredAddenda() - fwm.SetUnstructuredAddenda(ua) + fwm.UnstructuredAddenda = ua err := fwm.checkProhibitedServiceMessageTags() @@ -325,9 +325,9 @@ func TestInvalidUnstructuredAddendaForServiceMessage(t *testing.T) { func TestInvalidCurrencyInstructedAmountForServiceMessage(t *testing.T) { fwm := new(FEDWireMessage) sm := mockServiceMessage() - fwm.SetServiceMessage(sm) + fwm.ServiceMessage = sm cia := mockCurrencyInstructedAmount() - fwm.SetCurrencyInstructedAmount(cia) + fwm.CurrencyInstructedAmount = cia err := fwm.checkProhibitedServiceMessageTags() @@ -338,9 +338,9 @@ func TestInvalidCurrencyInstructedAmountForServiceMessage(t *testing.T) { func TestInvalidRelatedRemittanceForServiceMessage(t *testing.T) { fwm := new(FEDWireMessage) sm := mockServiceMessage() - fwm.SetServiceMessage(sm) + fwm.ServiceMessage = sm rr := mockRelatedRemittance() - fwm.SetRelatedRemittance(rr) + fwm.RelatedRemittance = rr err := fwm.checkProhibitedServiceMessageTags() diff --git a/writer.go b/writer.go index ffe26f61..e2b644a6 100644 --- a/writer.go +++ b/writer.go @@ -72,7 +72,7 @@ func (w *Writer) writeFEDWireMessage(file *File) error { } if fwm.UnstructuredAddenda != nil { - if _, err := w.w.WriteString(fwm.GetUnstructuredAddenda().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.UnstructuredAddenda.String() + "\n"); err != nil { return err } } @@ -80,29 +80,29 @@ func (w *Writer) writeFEDWireMessage(file *File) error { return err } if fwm.ServiceMessage != nil { - if _, err := w.w.WriteString(fwm.GetServiceMessage().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.ServiceMessage.String() + "\n"); err != nil { return err } } // Information Appended by FedWire Funds Service - Commented for now /* if fwm.MessageDisposition != nil { - if _, err := w.w.WriteString(fwm.GetMessageDisposition().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.MessageDisposition.String() + "\n"); err != nil { return err } }*/ /* if fwm.ReceiptTimeStamp != nil { - if _, err := w.w.WriteString(fwm.GetReceiptTimeStamp().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.ReceiptTimeStamp.String() + "\n"); err != nil { return err } }*/ /* if fwm.OutputMessageAccountabilityData != nil { - if _, err := w.w.WriteString(fwm.GetOutputMessageAccountabilityData().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.OutputMessageAccountabilityData.String() + "\n"); err != nil { return err } }*/ /* if fwm.ErrorWire != nil { - if _, err := w.w.WriteString(fwm.GetErrorWire().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.ErrorWire.String() + "\n"); err != nil { return err } }*/ @@ -111,7 +111,7 @@ func (w *Writer) writeFEDWireMessage(file *File) error { func (w *Writer) writeMandatory(fwm FEDWireMessage) error { if fwm.SenderSupplied != nil { - if _, err := w.w.WriteString(fwm.GetSenderSupplied().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.SenderSupplied.String() + "\n"); err != nil { return err } } else { @@ -119,42 +119,42 @@ func (w *Writer) writeMandatory(fwm FEDWireMessage) error { } if fwm.TypeSubType != nil { - if _, err := w.w.WriteString(fwm.GetTypeSubType().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.TypeSubType.String() + "\n"); err != nil { return err } } else { return fieldError("TypeSubType", ErrFieldRequired) } if fwm.InputMessageAccountabilityData != nil { - if _, err := w.w.WriteString(fwm.GetInputMessageAccountabilityData().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.InputMessageAccountabilityData.String() + "\n"); err != nil { return err } } else { return fieldError("InputMessageAccountabilityData", ErrFieldRequired) } if fwm.Amount != nil { - if _, err := w.w.WriteString(fwm.GetAmount().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.Amount.String() + "\n"); err != nil { return err } } else { return fieldError("Amount", ErrFieldRequired) } if fwm.SenderDepositoryInstitution != nil { - if _, err := w.w.WriteString(fwm.GetSenderDepositoryInstitution().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.SenderDepositoryInstitution.String() + "\n"); err != nil { return err } } else { return fieldError("SenderDepositoryInstitution", ErrFieldRequired) } if fwm.ReceiverDepositoryInstitution != nil { - if _, err := w.w.WriteString(fwm.GetReceiverDepositoryInstitution().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.ReceiverDepositoryInstitution.String() + "\n"); err != nil { return err } } else { return fieldError("ReceiverDepositoryInstitution", ErrFieldRequired) } if fwm.BusinessFunctionCode != nil { - if _, err := w.w.WriteString(fwm.GetBusinessFunctionCode().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.BusinessFunctionCode.String() + "\n"); err != nil { return err } } else { @@ -165,37 +165,37 @@ func (w *Writer) writeMandatory(fwm FEDWireMessage) error { func (w *Writer) writeOtherTransferInfo(fwm FEDWireMessage) error { if fwm.SenderReference != nil { - if _, err := w.w.WriteString(fwm.GetSenderReference().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.SenderReference.String() + "\n"); err != nil { return err } } if fwm.PreviousMessageIdentifier != nil { - if _, err := w.w.WriteString(fwm.GetPreviousMessageIdentifier().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.PreviousMessageIdentifier.String() + "\n"); err != nil { return err } } if fwm.LocalInstrument != nil { - if _, err := w.w.WriteString(fwm.GetLocalInstrument().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.LocalInstrument.String() + "\n"); err != nil { return err } } if fwm.PaymentNotification != nil { - if _, err := w.w.WriteString(fwm.GetPaymentNotification().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.PaymentNotification.String() + "\n"); err != nil { return err } } if fwm.Charges != nil { - if _, err := w.w.WriteString(fwm.GetCharges().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.Charges.String() + "\n"); err != nil { return err } } if fwm.InstructedAmount != nil { - if _, err := w.w.WriteString(fwm.GetInstructedAmount().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.InstructedAmount.String() + "\n"); err != nil { return err } } if fwm.ExchangeRate != nil { - if _, err := w.w.WriteString(fwm.GetExchangeRate().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.ExchangeRate.String() + "\n"); err != nil { return err } } @@ -204,34 +204,34 @@ func (w *Writer) writeOtherTransferInfo(fwm FEDWireMessage) error { func (w *Writer) writeBeneficiary(fwm FEDWireMessage) error { if fwm.BeneficiaryIntermediaryFI != nil { - if _, err := w.w.WriteString(fwm.GetBeneficiaryIntermediaryFI().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.BeneficiaryIntermediaryFI.String() + "\n"); err != nil { return err } } if fwm.BeneficiaryFI != nil { if fwm.BeneficiaryFI != nil { - if _, err := w.w.WriteString(fwm.GetBeneficiaryFI().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.BeneficiaryFI.String() + "\n"); err != nil { return err } } } if fwm.Beneficiary != nil { if fwm.Beneficiary != nil { - if _, err := w.w.WriteString(fwm.GetBeneficiary().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.Beneficiary.String() + "\n"); err != nil { return err } } } if fwm.BeneficiaryReference != nil { if fwm.BeneficiaryReference != nil { - if _, err := w.w.WriteString(fwm.GetBeneficiaryReference().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.BeneficiaryReference.String() + "\n"); err != nil { return err } } } if fwm.AccountDebitedDrawdown != nil { if fwm.AccountDebitedDrawdown != nil { - if _, err := w.w.WriteString(fwm.GetAccountDebitedDrawdown().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.AccountDebitedDrawdown.String() + "\n"); err != nil { return err } } @@ -241,32 +241,32 @@ func (w *Writer) writeBeneficiary(fwm FEDWireMessage) error { func (w *Writer) writeOriginator(fwm FEDWireMessage) error { if fwm.Originator != nil { - if _, err := w.w.WriteString(fwm.GetOriginator().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.Originator.String() + "\n"); err != nil { return err } } if fwm.OriginatorOptionF != nil { - if _, err := w.w.WriteString(fwm.GetOriginatorOptionF().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.OriginatorOptionF.String() + "\n"); err != nil { return err } } if fwm.OriginatorFI != nil { - if _, err := w.w.WriteString(fwm.GetOriginatorFI().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.OriginatorFI.String() + "\n"); err != nil { return err } } if fwm.InstructingFI != nil { - if _, err := w.w.WriteString(fwm.GetInstructingFI().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.InstructingFI.String() + "\n"); err != nil { return err } } if fwm.AccountCreditedDrawdown != nil { - if _, err := w.w.WriteString(fwm.GetAccountCreditedDrawdown().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.AccountCreditedDrawdown.String() + "\n"); err != nil { return err } } if fwm.OriginatorToBeneficiary != nil { - if _, err := w.w.WriteString(fwm.GetOriginatorToBeneficiary().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.OriginatorToBeneficiary.String() + "\n"); err != nil { return err } } @@ -275,52 +275,52 @@ func (w *Writer) writeOriginator(fwm FEDWireMessage) error { func (w *Writer) writeFinancialInstitution(fwm FEDWireMessage) error { if fwm.FIReceiverFI != nil { - if _, err := w.w.WriteString(fwm.GetFIReceiverFI().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.FIReceiverFI.String() + "\n"); err != nil { return err } } if fwm.FIDrawdownDebitAccountAdvice != nil { - if _, err := w.w.WriteString(fwm.GetFIDrawdownDebitAccountAdvice().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.FIDrawdownDebitAccountAdvice.String() + "\n"); err != nil { return err } } if fwm.FIIntermediaryFI != nil { - if _, err := w.w.WriteString(fwm.GetFIIntermediaryFI().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.FIIntermediaryFI.String() + "\n"); err != nil { return err } } if fwm.FIIntermediaryFIAdvice != nil { - if _, err := w.w.WriteString(fwm.GetFIIntermediaryFIAdvice().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.FIIntermediaryFIAdvice.String() + "\n"); err != nil { return err } } if fwm.FIBeneficiaryFI != nil { - if _, err := w.w.WriteString(fwm.GetFIBeneficiaryFI().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.FIBeneficiaryFI.String() + "\n"); err != nil { return err } } if fwm.FIBeneficiaryFIAdvice != nil { - if _, err := w.w.WriteString(fwm.GetFIBeneficiaryFIAdvice().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.FIBeneficiaryFIAdvice.String() + "\n"); err != nil { return err } } if fwm.FIBeneficiary != nil { - if _, err := w.w.WriteString(fwm.GetFIBeneficiary().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.FIBeneficiary.String() + "\n"); err != nil { return err } } if fwm.FIBeneficiaryAdvice != nil { - if _, err := w.w.WriteString(fwm.GetFIBeneficiaryAdvice().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.FIBeneficiaryAdvice.String() + "\n"); err != nil { return err } } if fwm.FIPaymentMethodToBeneficiary != nil { - if _, err := w.w.WriteString(fwm.GetFIPaymentMethodToBeneficiary().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.FIPaymentMethodToBeneficiary.String() + "\n"); err != nil { return err } } if fwm.FIAdditionalFIToFI != nil { - if _, err := w.w.WriteString(fwm.GetFIAdditionalFIToFI().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.FIAdditionalFIToFI.String() + "\n"); err != nil { return err } } @@ -329,42 +329,42 @@ func (w *Writer) writeFinancialInstitution(fwm FEDWireMessage) error { func (w *Writer) writeCoverPayment(fwm FEDWireMessage) error { if fwm.CurrencyInstructedAmount != nil { - if _, err := w.w.WriteString(fwm.GetCurrencyInstructedAmount().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.CurrencyInstructedAmount.String() + "\n"); err != nil { return err } } if fwm.OrderingCustomer != nil { - if _, err := w.w.WriteString(fwm.GetOrderingCustomer().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.OrderingCustomer.String() + "\n"); err != nil { return err } } if fwm.OrderingInstitution != nil { - if _, err := w.w.WriteString(fwm.GetOrderingInstitution().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.OrderingInstitution.String() + "\n"); err != nil { return err } } if fwm.IntermediaryInstitution != nil { - if _, err := w.w.WriteString(fwm.GetIntermediaryInstitution().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.IntermediaryInstitution.String() + "\n"); err != nil { return err } } if fwm.InstitutionAccount != nil { - if _, err := w.w.WriteString(fwm.GetInstitutionAccount().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.InstitutionAccount.String() + "\n"); err != nil { return err } } if fwm.BeneficiaryCustomer != nil { - if _, err := w.w.WriteString(fwm.GetBeneficiaryCustomer().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.BeneficiaryCustomer.String() + "\n"); err != nil { return err } } if fwm.Remittance != nil { - if _, err := w.w.WriteString(fwm.GetRemittance().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.Remittance.String() + "\n"); err != nil { return err } } if fwm.SenderToReceiver != nil { - if _, err := w.w.WriteString(fwm.GetSenderToReceiver().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.SenderToReceiver.String() + "\n"); err != nil { return err } } @@ -375,58 +375,58 @@ func (w *Writer) writeRemittance(fwm FEDWireMessage) error { // Related Remittance if fwm.RelatedRemittance != nil { - if _, err := w.w.WriteString(fwm.GetRelatedRemittance().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.RelatedRemittance.String() + "\n"); err != nil { return err } } // Structured Remittance if fwm.RemittanceOriginator != nil { - if _, err := w.w.WriteString(fwm.GetRemittanceOriginator().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.RemittanceOriginator.String() + "\n"); err != nil { return err } } if fwm.RemittanceBeneficiary != nil { - if _, err := w.w.WriteString(fwm.GetRemittanceBeneficiary().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.RemittanceBeneficiary.String() + "\n"); err != nil { return err } } if fwm.PrimaryRemittanceDocument != nil { - if _, err := w.w.WriteString(fwm.GetPrimaryRemittanceDocument().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.PrimaryRemittanceDocument.String() + "\n"); err != nil { return err } } if fwm.ActualAmountPaid != nil { - if _, err := w.w.WriteString(fwm.GetActualAmountPaid().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.ActualAmountPaid.String() + "\n"); err != nil { return err } } if fwm.GrossAmountRemittanceDocument != nil { - if _, err := w.w.WriteString(fwm.GetGrossAmountRemittanceDocument().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.GrossAmountRemittanceDocument.String() + "\n"); err != nil { return err } } if fwm.AmountNegotiatedDiscount != nil { - if _, err := w.w.WriteString(fwm.GetAmountNegotiatedDiscount().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.AmountNegotiatedDiscount.String() + "\n"); err != nil { return err } } if fwm.Adjustment != nil { - if _, err := w.w.WriteString(fwm.GetAdjustment().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.Adjustment.String() + "\n"); err != nil { return err } } if fwm.DateRemittanceDocument != nil { - if _, err := w.w.WriteString(fwm.GetDateRemittanceDocument().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.DateRemittanceDocument.String() + "\n"); err != nil { return err } } if fwm.SecondaryRemittanceDocument != nil { - if _, err := w.w.WriteString(fwm.GetSecondaryRemittanceDocument().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.SecondaryRemittanceDocument.String() + "\n"); err != nil { return err } } if fwm.RemittanceFreeText != nil { - if _, err := w.w.WriteString(fwm.GetRemittanceFreeText().String() + "\n"); err != nil { + if _, err := w.w.WriteString(fwm.RemittanceFreeText.String() + "\n"); err != nil { return err } } diff --git a/writer_test.go b/writer_test.go index 2bbe7724..76a76ede 100644 --- a/writer_test.go +++ b/writer_test.go @@ -10,21 +10,21 @@ import ( func TestSenderSupplied_Mandatory(t *testing.T) { file := NewFile() - fwm := NewFEDWireMessage() + fwm := FEDWireMessage{} // Mandatory Fields tst := mockTypeSubType() - fwm.SetTypeSubType(tst) + fwm.TypeSubType = tst imad := mockInputMessageAccountabilityData() - fwm.SetInputMessageAccountabilityData(imad) + fwm.InputMessageAccountabilityData = imad amt := mockAmount() - fwm.SetAmount(amt) + fwm.Amount = amt rdi := mockReceiverDepositoryInstitution() - fwm.SetReceiverDepositoryInstitution(rdi) + fwm.ReceiverDepositoryInstitution = rdi sdi := mockSenderDepositoryInstitution() - fwm.SetSenderDepositoryInstitution(sdi) + fwm.SenderDepositoryInstitution = sdi bfc := mockBusinessFunctionCode() - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc file.AddFEDWireMessage(fwm) @@ -38,21 +38,21 @@ func TestSenderSupplied_Mandatory(t *testing.T) { func TestTypeSubType_Mandatory(t *testing.T) { file := NewFile() - fwm := NewFEDWireMessage() + fwm := FEDWireMessage{} // Mandatory Fields ss := mockSenderSupplied() - fwm.SetSenderSupplied(ss) + fwm.SenderSupplied = ss imad := mockInputMessageAccountabilityData() - fwm.SetInputMessageAccountabilityData(imad) + fwm.InputMessageAccountabilityData = imad amt := mockAmount() - fwm.SetAmount(amt) + fwm.Amount = amt rdi := mockReceiverDepositoryInstitution() - fwm.SetReceiverDepositoryInstitution(rdi) + fwm.ReceiverDepositoryInstitution = rdi sdi := mockSenderDepositoryInstitution() - fwm.SetSenderDepositoryInstitution(sdi) + fwm.SenderDepositoryInstitution = sdi bfc := mockBusinessFunctionCode() - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc file.AddFEDWireMessage(fwm) @@ -66,21 +66,21 @@ func TestTypeSubType_Mandatory(t *testing.T) { func TestInputMessageAccountabilityData_Mandatory(t *testing.T) { file := NewFile() - fwm := NewFEDWireMessage() + fwm := FEDWireMessage{} // Mandatory Fields ss := mockSenderSupplied() - fwm.SetSenderSupplied(ss) + fwm.SenderSupplied = ss tst := mockTypeSubType() - fwm.SetTypeSubType(tst) + fwm.TypeSubType = tst amt := mockAmount() - fwm.SetAmount(amt) + fwm.Amount = amt rdi := mockReceiverDepositoryInstitution() - fwm.SetReceiverDepositoryInstitution(rdi) + fwm.ReceiverDepositoryInstitution = rdi sdi := mockSenderDepositoryInstitution() - fwm.SetSenderDepositoryInstitution(sdi) + fwm.SenderDepositoryInstitution = sdi bfc := mockBusinessFunctionCode() - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc file.AddFEDWireMessage(fwm) @@ -94,21 +94,21 @@ func TestInputMessageAccountabilityData_Mandatory(t *testing.T) { func TestAmount_Mandatory(t *testing.T) { file := NewFile() - fwm := NewFEDWireMessage() + fwm := FEDWireMessage{} // Mandatory Fields ss := mockSenderSupplied() - fwm.SetSenderSupplied(ss) + fwm.SenderSupplied = ss tst := mockTypeSubType() - fwm.SetTypeSubType(tst) + fwm.TypeSubType = tst imad := mockInputMessageAccountabilityData() - fwm.SetInputMessageAccountabilityData(imad) + fwm.InputMessageAccountabilityData = imad rdi := mockReceiverDepositoryInstitution() - fwm.SetReceiverDepositoryInstitution(rdi) + fwm.ReceiverDepositoryInstitution = rdi sdi := mockSenderDepositoryInstitution() - fwm.SetSenderDepositoryInstitution(sdi) + fwm.SenderDepositoryInstitution = sdi bfc := mockBusinessFunctionCode() - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc file.AddFEDWireMessage(fwm) @@ -122,21 +122,21 @@ func TestAmount_Mandatory(t *testing.T) { func TestSenderDepositoryInstitution_Mandatory(t *testing.T) { file := NewFile() - fwm := NewFEDWireMessage() + fwm := FEDWireMessage{} // Mandatory Fields ss := mockSenderSupplied() - fwm.SetSenderSupplied(ss) + fwm.SenderSupplied = ss tst := mockTypeSubType() - fwm.SetTypeSubType(tst) + fwm.TypeSubType = tst imad := mockInputMessageAccountabilityData() - fwm.SetInputMessageAccountabilityData(imad) + fwm.InputMessageAccountabilityData = imad amt := mockAmount() - fwm.SetAmount(amt) + fwm.Amount = amt rdi := mockReceiverDepositoryInstitution() - fwm.SetReceiverDepositoryInstitution(rdi) + fwm.ReceiverDepositoryInstitution = rdi bfc := mockBusinessFunctionCode() - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc file.AddFEDWireMessage(fwm) @@ -150,21 +150,21 @@ func TestSenderDepositoryInstitution_Mandatory(t *testing.T) { func TestReceiverDepositoryInstitution_Mandatory(t *testing.T) { file := NewFile() - fwm := NewFEDWireMessage() + fwm := FEDWireMessage{} // Mandatory Fields ss := mockSenderSupplied() - fwm.SetSenderSupplied(ss) + fwm.SenderSupplied = ss tst := mockTypeSubType() - fwm.SetTypeSubType(tst) + fwm.TypeSubType = tst imad := mockInputMessageAccountabilityData() - fwm.SetInputMessageAccountabilityData(imad) + fwm.InputMessageAccountabilityData = imad amt := mockAmount() - fwm.SetAmount(amt) + fwm.Amount = amt sdi := mockSenderDepositoryInstitution() - fwm.SetSenderDepositoryInstitution(sdi) + fwm.SenderDepositoryInstitution = sdi bfc := mockBusinessFunctionCode() - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc file.AddFEDWireMessage(fwm) @@ -178,21 +178,21 @@ func TestReceiverDepositoryInstitution_Mandatory(t *testing.T) { func TestBusinessFunctionCode_Mandatory(t *testing.T) { file := NewFile() - fwm := NewFEDWireMessage() + fwm := FEDWireMessage{} // Mandatory Fields ss := mockSenderSupplied() - fwm.SetSenderSupplied(ss) + fwm.SenderSupplied = ss tst := mockTypeSubType() - fwm.SetTypeSubType(tst) + fwm.TypeSubType = tst imad := mockInputMessageAccountabilityData() - fwm.SetInputMessageAccountabilityData(imad) + fwm.InputMessageAccountabilityData = imad amt := mockAmount() - fwm.SetAmount(amt) + fwm.Amount = amt sdi := mockSenderDepositoryInstitution() - fwm.SetSenderDepositoryInstitution(sdi) + fwm.SenderDepositoryInstitution = sdi rdi := mockReceiverDepositoryInstitution() - fwm.SetReceiverDepositoryInstitution(rdi) + fwm.ReceiverDepositoryInstitution = rdi file.AddFEDWireMessage(fwm) @@ -207,71 +207,71 @@ func TestBusinessFunctionCode_Mandatory(t *testing.T) { // TestFEDWireMessageWriteBankTransfer writes a FEDWireMessage to a file with BusinessFunctionCode = BTR func TestFEDWireMessageWriteBankTransfer(t *testing.T) { file := NewFile() - fwm := NewFEDWireMessage() + fwm := FEDWireMessage{} // Mandatory Fields ss := mockSenderSupplied() - fwm.SetSenderSupplied(ss) + fwm.SenderSupplied = ss tst := mockTypeSubType() - fwm.SetTypeSubType(tst) + fwm.TypeSubType = tst imad := mockInputMessageAccountabilityData() - fwm.SetInputMessageAccountabilityData(imad) + fwm.InputMessageAccountabilityData = imad amt := mockAmount() - fwm.SetAmount(amt) + fwm.Amount = amt sdi := mockSenderDepositoryInstitution() - fwm.SetSenderDepositoryInstitution(sdi) + fwm.SenderDepositoryInstitution = sdi rdi := mockReceiverDepositoryInstitution() - fwm.SetReceiverDepositoryInstitution(rdi) + fwm.ReceiverDepositoryInstitution = rdi bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = "BTR" bfc.TransactionTypeCode = " " - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc // Other Transfer Information sr := mockSenderReference() - fwm.SetSenderReference(sr) + fwm.SenderReference = sr pmi := mockPreviousMessageIdentifier() - fwm.SetPreviousMessageIdentifier(pmi) + fwm.PreviousMessageIdentifier = pmi // Beneficiary bifi := mockBeneficiaryIntermediaryFI() - fwm.SetBeneficiaryIntermediaryFI(bifi) + fwm.BeneficiaryIntermediaryFI = bifi bfi := mockBeneficiaryFI() - fwm.SetBeneficiaryFI(bfi) + fwm.BeneficiaryFI = bfi ben := mockBeneficiary() - fwm.SetBeneficiary(ben) + fwm.Beneficiary = ben br := mockBeneficiaryReference() - fwm.SetBeneficiaryReference(br) + fwm.BeneficiaryReference = br // Originator o := mockOriginator() - fwm.SetOriginator(o) + fwm.Originator = o ofi := mockOriginatorFI() - fwm.SetOriginatorFI(ofi) + fwm.OriginatorFI = ofi ifi := mockInstructingFI() - fwm.SetInstructingFI(ifi) + fwm.InstructingFI = ifi ob := mockOriginatorToBeneficiary() - fwm.SetOriginatorToBeneficiary(ob) + fwm.OriginatorToBeneficiary = ob // FI to FI firfi := mockFIReceiverFI() - fwm.SetFIReceiverFI(firfi) + fwm.FIReceiverFI = firfi fiifi := mockFIIntermediaryFI() - fwm.SetFIIntermediaryFI(fiifi) + fwm.FIIntermediaryFI = fiifi fiifia := mockFIIntermediaryFIAdvice() - fwm.SetFIIntermediaryFIAdvice(fiifia) + fwm.FIIntermediaryFIAdvice = fiifia fibfi := mockFIBeneficiaryFI() - fwm.SetFIBeneficiaryFI(fibfi) + fwm.FIBeneficiaryFI = fibfi fibfia := mockFIBeneficiaryFIAdvice() - fwm.SetFIBeneficiaryFIAdvice(fibfia) + fwm.FIBeneficiaryFIAdvice = fibfia fib := mockFIBeneficiary() - fwm.SetFIBeneficiary(fib) + fwm.FIBeneficiary = fib fiba := mockFIBeneficiaryAdvice() - fwm.SetFIBeneficiaryAdvice(fiba) + fwm.FIBeneficiaryAdvice = fiba pm := mockFIPaymentMethodToBeneficiary() - fwm.SetFIPaymentMethodToBeneficiary(pm) + fwm.FIPaymentMethodToBeneficiary = pm fifi := mockFIAdditionalFIToFI() - fwm.SetFIAdditionalFIToFI(fifi) + fwm.FIAdditionalFIToFI = fifi file.AddFEDWireMessage(fwm) @@ -281,77 +281,77 @@ func TestFEDWireMessageWriteBankTransfer(t *testing.T) { // TestFEDWireMessageWriteCustomerTransfer writes a FEDWireMessage to a file with BusinessFunctionCode = CTR func TestFEDWireMessageWriteCustomerTransfer(t *testing.T) { file := NewFile() - fwm := NewFEDWireMessage() + fwm := FEDWireMessage{} // Mandatory Fields ss := mockSenderSupplied() - fwm.SetSenderSupplied(ss) + fwm.SenderSupplied = ss tst := mockTypeSubType() - fwm.SetTypeSubType(tst) + fwm.TypeSubType = tst imad := mockInputMessageAccountabilityData() - fwm.SetInputMessageAccountabilityData(imad) + fwm.InputMessageAccountabilityData = imad amt := mockAmount() - fwm.SetAmount(amt) + fwm.Amount = amt sdi := mockSenderDepositoryInstitution() - fwm.SetSenderDepositoryInstitution(sdi) + fwm.SenderDepositoryInstitution = sdi rdi := mockReceiverDepositoryInstitution() - fwm.SetReceiverDepositoryInstitution(rdi) + fwm.ReceiverDepositoryInstitution = rdi bfc := mockBusinessFunctionCode() - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc // Other Transfer Information sr := mockSenderReference() - fwm.SetSenderReference(sr) + fwm.SenderReference = sr pmi := mockPreviousMessageIdentifier() - fwm.SetPreviousMessageIdentifier(pmi) + fwm.PreviousMessageIdentifier = pmi //li := mockLocalInstrument() - //fwm.SetLocalInstrument(li) + //fwm.LocalInstrument = li c := mockCharges() - fwm.SetCharges(c) + fwm.Charges = c ia := mockInstructedAmount() - fwm.SetInstructedAmount(ia) + fwm.InstructedAmount = ia eRate := mockExchangeRate() - fwm.SetExchangeRate(eRate) + fwm.ExchangeRate = eRate // Beneficiary bifi := mockBeneficiaryIntermediaryFI() - fwm.SetBeneficiaryIntermediaryFI(bifi) + fwm.BeneficiaryIntermediaryFI = bifi bfi := mockBeneficiaryFI() - fwm.SetBeneficiaryFI(bfi) + fwm.BeneficiaryFI = bfi ben := mockBeneficiary() - fwm.SetBeneficiary(ben) + fwm.Beneficiary = ben br := mockBeneficiaryReference() - fwm.SetBeneficiaryReference(br) + fwm.BeneficiaryReference = br // Originator o := mockOriginator() - fwm.SetOriginator(o) + fwm.Originator = o ofi := mockOriginatorFI() - fwm.SetOriginatorFI(ofi) + fwm.OriginatorFI = ofi ifi := mockInstructingFI() - fwm.SetInstructingFI(ifi) + fwm.InstructingFI = ifi ob := mockOriginatorToBeneficiary() - fwm.SetOriginatorToBeneficiary(ob) + fwm.OriginatorToBeneficiary = ob // FI to FI firfi := mockFIReceiverFI() - fwm.SetFIReceiverFI(firfi) + fwm.FIReceiverFI = firfi fiifi := mockFIIntermediaryFI() - fwm.SetFIIntermediaryFI(fiifi) + fwm.FIIntermediaryFI = fiifi fiifia := mockFIIntermediaryFIAdvice() - fwm.SetFIIntermediaryFIAdvice(fiifia) + fwm.FIIntermediaryFIAdvice = fiifia fibfi := mockFIBeneficiaryFI() - fwm.SetFIBeneficiaryFI(fibfi) + fwm.FIBeneficiaryFI = fibfi fibfia := mockFIBeneficiaryFIAdvice() - fwm.SetFIBeneficiaryFIAdvice(fibfia) + fwm.FIBeneficiaryFIAdvice = fibfia fib := mockFIBeneficiary() - fwm.SetFIBeneficiary(fib) + fwm.FIBeneficiary = fib fiba := mockFIBeneficiaryAdvice() - fwm.SetFIBeneficiaryAdvice(fiba) + fwm.FIBeneficiaryAdvice = fiba pm := mockFIPaymentMethodToBeneficiary() - fwm.SetFIPaymentMethodToBeneficiary(pm) + fwm.FIPaymentMethodToBeneficiary = pm fifi := mockFIAdditionalFIToFI() - fwm.SetFIAdditionalFIToFI(fifi) + fwm.FIAdditionalFIToFI = fifi file.AddFEDWireMessage(fwm) @@ -361,87 +361,87 @@ func TestFEDWireMessageWriteCustomerTransfer(t *testing.T) { // TestFEDWireMessageWriteCustomerTransferPlus writes a FEDWireMessage to a file with BusinessFunctionCode = CTP func TestFEDWireMessageWriteCustomerTransferPlus(t *testing.T) { file := NewFile() - fwm := NewFEDWireMessage() + fwm := FEDWireMessage{} // Mandatory Fields ss := mockSenderSupplied() - fwm.SetSenderSupplied(ss) + fwm.SenderSupplied = ss tst := mockTypeSubType() - fwm.SetTypeSubType(tst) + fwm.TypeSubType = tst imad := mockInputMessageAccountabilityData() - fwm.SetInputMessageAccountabilityData(imad) + fwm.InputMessageAccountabilityData = imad amt := mockAmount() - fwm.SetAmount(amt) + fwm.Amount = amt sdi := mockSenderDepositoryInstitution() - fwm.SetSenderDepositoryInstitution(sdi) + fwm.SenderDepositoryInstitution = sdi rdi := mockReceiverDepositoryInstitution() - fwm.SetReceiverDepositoryInstitution(rdi) + fwm.ReceiverDepositoryInstitution = rdi bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = CustomerTransferPlus bfc.TransactionTypeCode = " " - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc // Other Transfer Information sr := mockSenderReference() - fwm.SetSenderReference(sr) + fwm.SenderReference = sr pmi := mockPreviousMessageIdentifier() - fwm.SetPreviousMessageIdentifier(pmi) + fwm.PreviousMessageIdentifier = pmi li := mockLocalInstrument() li.LocalInstrumentCode = ProprietaryLocalInstrumentCode li.ProprietaryCode = "PROP CODE" - fwm.SetLocalInstrument(li) + fwm.LocalInstrument = li pn := mockPaymentNotification() - fwm.SetPaymentNotification(pn) + fwm.PaymentNotification = pn c := mockCharges() - fwm.SetCharges(c) + fwm.Charges = c ia := mockInstructedAmount() - fwm.SetInstructedAmount(ia) + fwm.InstructedAmount = ia eRate := mockExchangeRate() - fwm.SetExchangeRate(eRate) + fwm.ExchangeRate = eRate // Beneficiary bifi := mockBeneficiaryIntermediaryFI() - fwm.SetBeneficiaryIntermediaryFI(bifi) + fwm.BeneficiaryIntermediaryFI = bifi bfi := mockBeneficiaryFI() - fwm.SetBeneficiaryFI(bfi) + fwm.BeneficiaryFI = bfi ben := mockBeneficiary() - fwm.SetBeneficiary(ben) + fwm.Beneficiary = ben br := mockBeneficiaryReference() - fwm.SetBeneficiaryReference(br) + fwm.BeneficiaryReference = br // Originator o := mockOriginator() - fwm.SetOriginator(o) + fwm.Originator = o oof := mockOriginatorOptionF() - fwm.SetOriginatorOptionF(oof) + fwm.OriginatorOptionF = oof ofi := mockOriginatorFI() - fwm.SetOriginatorFI(ofi) + fwm.OriginatorFI = ofi ifi := mockInstructingFI() - fwm.SetInstructingFI(ifi) + fwm.InstructingFI = ifi ob := mockOriginatorToBeneficiary() - fwm.SetOriginatorToBeneficiary(ob) + fwm.OriginatorToBeneficiary = ob // FI to FI fiifi := mockFIIntermediaryFI() - fwm.SetFIIntermediaryFI(fiifi) + fwm.FIIntermediaryFI = fiifi fiifia := mockFIIntermediaryFIAdvice() - fwm.SetFIIntermediaryFIAdvice(fiifia) + fwm.FIIntermediaryFIAdvice = fiifia fibfi := mockFIBeneficiaryFI() - fwm.SetFIBeneficiaryFI(fibfi) + fwm.FIBeneficiaryFI = fibfi fibfia := mockFIBeneficiaryFIAdvice() - fwm.SetFIBeneficiaryFIAdvice(fibfia) + fwm.FIBeneficiaryFIAdvice = fibfia fib := mockFIBeneficiary() - fwm.SetFIBeneficiary(fib) + fwm.FIBeneficiary = fib fiba := mockFIBeneficiaryAdvice() - fwm.SetFIBeneficiaryAdvice(fiba) + fwm.FIBeneficiaryAdvice = fiba pm := mockFIPaymentMethodToBeneficiary() - fwm.SetFIPaymentMethodToBeneficiary(pm) + fwm.FIPaymentMethodToBeneficiary = pm fifi := mockFIAdditionalFIToFI() - fwm.SetFIAdditionalFIToFI(fifi) + fwm.FIAdditionalFIToFI = fifi // ServiceMessage sm := mockServiceMessage() - fwm.SetServiceMessage(sm) + fwm.ServiceMessage = sm file.AddFEDWireMessage(fwm) @@ -451,73 +451,73 @@ func TestFEDWireMessageWriteCustomerTransferPlus(t *testing.T) { // TestFEDWireMessageWriteCheckSameDaySettlement writes a FEDWireMessage to a file with BusinessFunctionCode = CKS func TestFEDWireMessageWriteCheckSameDaySettlement(t *testing.T) { file := NewFile() - fwm := NewFEDWireMessage() + fwm := FEDWireMessage{} // Mandatory Fields ss := mockSenderSupplied() - fwm.SetSenderSupplied(ss) + fwm.SenderSupplied = ss tst := mockTypeSubType() tst.TypeCode = SettlementTransfer tst.SubTypeCode = BasicFundsTransfer - fwm.SetTypeSubType(tst) + fwm.TypeSubType = tst imad := mockInputMessageAccountabilityData() - fwm.SetInputMessageAccountabilityData(imad) + fwm.InputMessageAccountabilityData = imad amt := mockAmount() - fwm.SetAmount(amt) + fwm.Amount = amt sdi := mockSenderDepositoryInstitution() - fwm.SetSenderDepositoryInstitution(sdi) + fwm.SenderDepositoryInstitution = sdi rdi := mockReceiverDepositoryInstitution() - fwm.SetReceiverDepositoryInstitution(rdi) + fwm.ReceiverDepositoryInstitution = rdi bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = CheckSameDaySettlement bfc.TransactionTypeCode = " " - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc // Other Transfer Information sr := mockSenderReference() - fwm.SetSenderReference(sr) + fwm.SenderReference = sr pmi := mockPreviousMessageIdentifier() - fwm.SetPreviousMessageIdentifier(pmi) + fwm.PreviousMessageIdentifier = pmi // Beneficiary bifi := mockBeneficiaryIntermediaryFI() - fwm.SetBeneficiaryIntermediaryFI(bifi) + fwm.BeneficiaryIntermediaryFI = bifi bfi := mockBeneficiaryFI() - fwm.SetBeneficiaryFI(bfi) + fwm.BeneficiaryFI = bfi ben := mockBeneficiary() - fwm.SetBeneficiary(ben) + fwm.Beneficiary = ben br := mockBeneficiaryReference() - fwm.SetBeneficiaryReference(br) + fwm.BeneficiaryReference = br // Originator o := mockOriginator() - fwm.SetOriginator(o) + fwm.Originator = o ofi := mockOriginatorFI() - fwm.SetOriginatorFI(ofi) + fwm.OriginatorFI = ofi ifi := mockInstructingFI() - fwm.SetInstructingFI(ifi) + fwm.InstructingFI = ifi ob := mockOriginatorToBeneficiary() - fwm.SetOriginatorToBeneficiary(ob) + fwm.OriginatorToBeneficiary = ob // FI to FI firfi := mockFIReceiverFI() - fwm.SetFIReceiverFI(firfi) + fwm.FIReceiverFI = firfi fiifi := mockFIIntermediaryFI() - fwm.SetFIIntermediaryFI(fiifi) + fwm.FIIntermediaryFI = fiifi fiifia := mockFIIntermediaryFIAdvice() - fwm.SetFIIntermediaryFIAdvice(fiifia) + fwm.FIIntermediaryFIAdvice = fiifia fibfi := mockFIBeneficiaryFI() - fwm.SetFIBeneficiaryFI(fibfi) + fwm.FIBeneficiaryFI = fibfi fibfia := mockFIBeneficiaryFIAdvice() - fwm.SetFIBeneficiaryFIAdvice(fibfia) + fwm.FIBeneficiaryFIAdvice = fibfia fib := mockFIBeneficiary() - fwm.SetFIBeneficiary(fib) + fwm.FIBeneficiary = fib fiba := mockFIBeneficiaryAdvice() - fwm.SetFIBeneficiaryAdvice(fiba) + fwm.FIBeneficiaryAdvice = fiba pm := mockFIPaymentMethodToBeneficiary() - fwm.SetFIPaymentMethodToBeneficiary(pm) + fwm.FIPaymentMethodToBeneficiary = pm fifi := mockFIAdditionalFIToFI() - fwm.SetFIAdditionalFIToFI(fifi) + fwm.FIAdditionalFIToFI = fifi file.AddFEDWireMessage(fwm) @@ -527,73 +527,73 @@ func TestFEDWireMessageWriteCheckSameDaySettlement(t *testing.T) { // TestFEDWireMessageWriteDepositSendersAccount writes a FEDWireMessage to a file with BusinessFunctionCode = DEP func TestFEDWireMessageWriteDepositSendersAccount(t *testing.T) { file := NewFile() - fwm := NewFEDWireMessage() + fwm := FEDWireMessage{} // Mandatory Fields ss := mockSenderSupplied() - fwm.SetSenderSupplied(ss) + fwm.SenderSupplied = ss tst := mockTypeSubType() tst.TypeCode = SettlementTransfer tst.SubTypeCode = BasicFundsTransfer - fwm.SetTypeSubType(tst) + fwm.TypeSubType = tst imad := mockInputMessageAccountabilityData() - fwm.SetInputMessageAccountabilityData(imad) + fwm.InputMessageAccountabilityData = imad amt := mockAmount() - fwm.SetAmount(amt) + fwm.Amount = amt sdi := mockSenderDepositoryInstitution() - fwm.SetSenderDepositoryInstitution(sdi) + fwm.SenderDepositoryInstitution = sdi rdi := mockReceiverDepositoryInstitution() - fwm.SetReceiverDepositoryInstitution(rdi) + fwm.ReceiverDepositoryInstitution = rdi bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = DepositSendersAccount bfc.TransactionTypeCode = " " - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc // Other Transfer Information sr := mockSenderReference() - fwm.SetSenderReference(sr) + fwm.SenderReference = sr pmi := mockPreviousMessageIdentifier() - fwm.SetPreviousMessageIdentifier(pmi) + fwm.PreviousMessageIdentifier = pmi // Beneficiary bifi := mockBeneficiaryIntermediaryFI() - fwm.SetBeneficiaryIntermediaryFI(bifi) + fwm.BeneficiaryIntermediaryFI = bifi bfi := mockBeneficiaryFI() - fwm.SetBeneficiaryFI(bfi) + fwm.BeneficiaryFI = bfi ben := mockBeneficiary() - fwm.SetBeneficiary(ben) + fwm.Beneficiary = ben br := mockBeneficiaryReference() - fwm.SetBeneficiaryReference(br) + fwm.BeneficiaryReference = br // Originator o := mockOriginator() - fwm.SetOriginator(o) + fwm.Originator = o ofi := mockOriginatorFI() - fwm.SetOriginatorFI(ofi) + fwm.OriginatorFI = ofi ifi := mockInstructingFI() - fwm.SetInstructingFI(ifi) + fwm.InstructingFI = ifi ob := mockOriginatorToBeneficiary() - fwm.SetOriginatorToBeneficiary(ob) + fwm.OriginatorToBeneficiary = ob // FI to FI firfi := mockFIReceiverFI() - fwm.SetFIReceiverFI(firfi) + fwm.FIReceiverFI = firfi fiifi := mockFIIntermediaryFI() - fwm.SetFIIntermediaryFI(fiifi) + fwm.FIIntermediaryFI = fiifi fiifia := mockFIIntermediaryFIAdvice() - fwm.SetFIIntermediaryFIAdvice(fiifia) + fwm.FIIntermediaryFIAdvice = fiifia fibfi := mockFIBeneficiaryFI() - fwm.SetFIBeneficiaryFI(fibfi) + fwm.FIBeneficiaryFI = fibfi fibfia := mockFIBeneficiaryFIAdvice() - fwm.SetFIBeneficiaryFIAdvice(fibfia) + fwm.FIBeneficiaryFIAdvice = fibfia fib := mockFIBeneficiary() - fwm.SetFIBeneficiary(fib) + fwm.FIBeneficiary = fib fiba := mockFIBeneficiaryAdvice() - fwm.SetFIBeneficiaryAdvice(fiba) + fwm.FIBeneficiaryAdvice = fiba pm := mockFIPaymentMethodToBeneficiary() - fwm.SetFIPaymentMethodToBeneficiary(pm) + fwm.FIPaymentMethodToBeneficiary = pm fifi := mockFIAdditionalFIToFI() - fwm.SetFIAdditionalFIToFI(fifi) + fwm.FIAdditionalFIToFI = fifi file.AddFEDWireMessage(fwm) @@ -603,73 +603,73 @@ func TestFEDWireMessageWriteDepositSendersAccount(t *testing.T) { // TestFEDWireMessageWriteFEDFundsReturned writes a FEDWireMessage to a file with BusinessFunctionCode = FFR func TestFEDWireMessageWriteFEDFundsReturned(t *testing.T) { file := NewFile() - fwm := NewFEDWireMessage() + fwm := FEDWireMessage{} // Mandatory Fields ss := mockSenderSupplied() - fwm.SetSenderSupplied(ss) + fwm.SenderSupplied = ss tst := mockTypeSubType() tst.TypeCode = "16" tst.SubTypeCode = "00" - fwm.SetTypeSubType(tst) + fwm.TypeSubType = tst imad := mockInputMessageAccountabilityData() - fwm.SetInputMessageAccountabilityData(imad) + fwm.InputMessageAccountabilityData = imad amt := mockAmount() - fwm.SetAmount(amt) + fwm.Amount = amt sdi := mockSenderDepositoryInstitution() - fwm.SetSenderDepositoryInstitution(sdi) + fwm.SenderDepositoryInstitution = sdi rdi := mockReceiverDepositoryInstitution() - fwm.SetReceiverDepositoryInstitution(rdi) + fwm.ReceiverDepositoryInstitution = rdi bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = FEDFundsReturned bfc.TransactionTypeCode = " " - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc // Other Transfer Information sr := mockSenderReference() - fwm.SetSenderReference(sr) + fwm.SenderReference = sr pmi := mockPreviousMessageIdentifier() - fwm.SetPreviousMessageIdentifier(pmi) + fwm.PreviousMessageIdentifier = pmi // Beneficiary bifi := mockBeneficiaryIntermediaryFI() - fwm.SetBeneficiaryIntermediaryFI(bifi) + fwm.BeneficiaryIntermediaryFI = bifi bfi := mockBeneficiaryFI() - fwm.SetBeneficiaryFI(bfi) + fwm.BeneficiaryFI = bfi ben := mockBeneficiary() - fwm.SetBeneficiary(ben) + fwm.Beneficiary = ben br := mockBeneficiaryReference() - fwm.SetBeneficiaryReference(br) + fwm.BeneficiaryReference = br // Originator o := mockOriginator() - fwm.SetOriginator(o) + fwm.Originator = o ofi := mockOriginatorFI() - fwm.SetOriginatorFI(ofi) + fwm.OriginatorFI = ofi ifi := mockInstructingFI() - fwm.SetInstructingFI(ifi) + fwm.InstructingFI = ifi ob := mockOriginatorToBeneficiary() - fwm.SetOriginatorToBeneficiary(ob) + fwm.OriginatorToBeneficiary = ob // FI to FI firfi := mockFIReceiverFI() - fwm.SetFIReceiverFI(firfi) + fwm.FIReceiverFI = firfi fiifi := mockFIIntermediaryFI() - fwm.SetFIIntermediaryFI(fiifi) + fwm.FIIntermediaryFI = fiifi fiifia := mockFIIntermediaryFIAdvice() - fwm.SetFIIntermediaryFIAdvice(fiifia) + fwm.FIIntermediaryFIAdvice = fiifia fibfi := mockFIBeneficiaryFI() - fwm.SetFIBeneficiaryFI(fibfi) + fwm.FIBeneficiaryFI = fibfi fibfia := mockFIBeneficiaryFIAdvice() - fwm.SetFIBeneficiaryFIAdvice(fibfia) + fwm.FIBeneficiaryFIAdvice = fibfia fib := mockFIBeneficiary() - fwm.SetFIBeneficiary(fib) + fwm.FIBeneficiary = fib fiba := mockFIBeneficiaryAdvice() - fwm.SetFIBeneficiaryAdvice(fiba) + fwm.FIBeneficiaryAdvice = fiba pm := mockFIPaymentMethodToBeneficiary() - fwm.SetFIPaymentMethodToBeneficiary(pm) + fwm.FIPaymentMethodToBeneficiary = pm fifi := mockFIAdditionalFIToFI() - fwm.SetFIAdditionalFIToFI(fifi) + fwm.FIAdditionalFIToFI = fifi file.AddFEDWireMessage(fwm) @@ -679,73 +679,73 @@ func TestFEDWireMessageWriteFEDFundsReturned(t *testing.T) { // TestFEDWireMessageWriteFEDFundsSold writes a FEDWireMessage to a file with BusinessFunctionCode = FFS func TestFEDWireMessageWriteFEDFundsSold(t *testing.T) { file := NewFile() - fwm := NewFEDWireMessage() + fwm := FEDWireMessage{} // Mandatory Fields ss := mockSenderSupplied() - fwm.SetSenderSupplied(ss) + fwm.SenderSupplied = ss tst := mockTypeSubType() tst.TypeCode = SettlementTransfer tst.SubTypeCode = BasicFundsTransfer - fwm.SetTypeSubType(tst) + fwm.TypeSubType = tst imad := mockInputMessageAccountabilityData() - fwm.SetInputMessageAccountabilityData(imad) + fwm.InputMessageAccountabilityData = imad amt := mockAmount() - fwm.SetAmount(amt) + fwm.Amount = amt sdi := mockSenderDepositoryInstitution() - fwm.SetSenderDepositoryInstitution(sdi) + fwm.SenderDepositoryInstitution = sdi rdi := mockReceiverDepositoryInstitution() - fwm.SetReceiverDepositoryInstitution(rdi) + fwm.ReceiverDepositoryInstitution = rdi bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = FEDFundsSold bfc.TransactionTypeCode = " " - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc // Other Transfer Information sr := mockSenderReference() - fwm.SetSenderReference(sr) + fwm.SenderReference = sr pmi := mockPreviousMessageIdentifier() - fwm.SetPreviousMessageIdentifier(pmi) + fwm.PreviousMessageIdentifier = pmi // Beneficiary bifi := mockBeneficiaryIntermediaryFI() - fwm.SetBeneficiaryIntermediaryFI(bifi) + fwm.BeneficiaryIntermediaryFI = bifi bfi := mockBeneficiaryFI() - fwm.SetBeneficiaryFI(bfi) + fwm.BeneficiaryFI = bfi ben := mockBeneficiary() - fwm.SetBeneficiary(ben) + fwm.Beneficiary = ben br := mockBeneficiaryReference() - fwm.SetBeneficiaryReference(br) + fwm.BeneficiaryReference = br // Originator o := mockOriginator() - fwm.SetOriginator(o) + fwm.Originator = o ofi := mockOriginatorFI() - fwm.SetOriginatorFI(ofi) + fwm.OriginatorFI = ofi ifi := mockInstructingFI() - fwm.SetInstructingFI(ifi) + fwm.InstructingFI = ifi ob := mockOriginatorToBeneficiary() - fwm.SetOriginatorToBeneficiary(ob) + fwm.OriginatorToBeneficiary = ob // FI to FI firfi := mockFIReceiverFI() - fwm.SetFIReceiverFI(firfi) + fwm.FIReceiverFI = firfi fiifi := mockFIIntermediaryFI() - fwm.SetFIIntermediaryFI(fiifi) + fwm.FIIntermediaryFI = fiifi fiifia := mockFIIntermediaryFIAdvice() - fwm.SetFIIntermediaryFIAdvice(fiifia) + fwm.FIIntermediaryFIAdvice = fiifia fibfi := mockFIBeneficiaryFI() - fwm.SetFIBeneficiaryFI(fibfi) + fwm.FIBeneficiaryFI = fibfi fibfia := mockFIBeneficiaryFIAdvice() - fwm.SetFIBeneficiaryFIAdvice(fibfia) + fwm.FIBeneficiaryFIAdvice = fibfia fib := mockFIBeneficiary() - fwm.SetFIBeneficiary(fib) + fwm.FIBeneficiary = fib fiba := mockFIBeneficiaryAdvice() - fwm.SetFIBeneficiaryAdvice(fiba) + fwm.FIBeneficiaryAdvice = fiba pm := mockFIPaymentMethodToBeneficiary() - fwm.SetFIPaymentMethodToBeneficiary(pm) + fwm.FIPaymentMethodToBeneficiary = pm fifi := mockFIAdditionalFIToFI() - fwm.SetFIAdditionalFIToFI(fifi) + fwm.FIAdditionalFIToFI = fifi file.AddFEDWireMessage(fwm) @@ -755,73 +755,73 @@ func TestFEDWireMessageWriteFEDFundsSold(t *testing.T) { // TestFEDWireMessageWriteDrawdownRequest writes a FEDWireMessage to a file with BusinessFunctionCode = DRW func TestFEDWireMessageWriteDrawdownRequest(t *testing.T) { file := NewFile() - fwm := NewFEDWireMessage() + fwm := FEDWireMessage{} // Mandatory Fields ss := mockSenderSupplied() - fwm.SetSenderSupplied(ss) + fwm.SenderSupplied = ss tst := mockTypeSubType() tst.TypeCode = FundsTransfer tst.SubTypeCode = FundsTransferRequestCredit - fwm.SetTypeSubType(tst) + fwm.TypeSubType = tst imad := mockInputMessageAccountabilityData() - fwm.SetInputMessageAccountabilityData(imad) + fwm.InputMessageAccountabilityData = imad amt := mockAmount() - fwm.SetAmount(amt) + fwm.Amount = amt sdi := mockSenderDepositoryInstitution() - fwm.SetSenderDepositoryInstitution(sdi) + fwm.SenderDepositoryInstitution = sdi rdi := mockReceiverDepositoryInstitution() - fwm.SetReceiverDepositoryInstitution(rdi) + fwm.ReceiverDepositoryInstitution = rdi bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = DrawdownResponse bfc.TransactionTypeCode = " " - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc // Other Transfer Information sr := mockSenderReference() - fwm.SetSenderReference(sr) + fwm.SenderReference = sr pmi := mockPreviousMessageIdentifier() - fwm.SetPreviousMessageIdentifier(pmi) + fwm.PreviousMessageIdentifier = pmi // Beneficiary bifi := mockBeneficiaryIntermediaryFI() - fwm.SetBeneficiaryIntermediaryFI(bifi) + fwm.BeneficiaryIntermediaryFI = bifi bfi := mockBeneficiaryFI() - fwm.SetBeneficiaryFI(bfi) + fwm.BeneficiaryFI = bfi ben := mockBeneficiary() - fwm.SetBeneficiary(ben) + fwm.Beneficiary = ben br := mockBeneficiaryReference() - fwm.SetBeneficiaryReference(br) + fwm.BeneficiaryReference = br // Originator o := mockOriginator() - fwm.SetOriginator(o) + fwm.Originator = o ofi := mockOriginatorFI() - fwm.SetOriginatorFI(ofi) + fwm.OriginatorFI = ofi ifi := mockInstructingFI() - fwm.SetInstructingFI(ifi) + fwm.InstructingFI = ifi ob := mockOriginatorToBeneficiary() - fwm.SetOriginatorToBeneficiary(ob) + fwm.OriginatorToBeneficiary = ob // FI to FI firfi := mockFIReceiverFI() - fwm.SetFIReceiverFI(firfi) + fwm.FIReceiverFI = firfi fiifi := mockFIIntermediaryFI() - fwm.SetFIIntermediaryFI(fiifi) + fwm.FIIntermediaryFI = fiifi fiifia := mockFIIntermediaryFIAdvice() - fwm.SetFIIntermediaryFIAdvice(fiifia) + fwm.FIIntermediaryFIAdvice = fiifia fibfi := mockFIBeneficiaryFI() - fwm.SetFIBeneficiaryFI(fibfi) + fwm.FIBeneficiaryFI = fibfi fibfia := mockFIBeneficiaryFIAdvice() - fwm.SetFIBeneficiaryFIAdvice(fibfia) + fwm.FIBeneficiaryFIAdvice = fibfia fib := mockFIBeneficiary() - fwm.SetFIBeneficiary(fib) + fwm.FIBeneficiary = fib fiba := mockFIBeneficiaryAdvice() - fwm.SetFIBeneficiaryAdvice(fiba) + fwm.FIBeneficiaryAdvice = fiba pm := mockFIPaymentMethodToBeneficiary() - fwm.SetFIPaymentMethodToBeneficiary(pm) + fwm.FIPaymentMethodToBeneficiary = pm fifi := mockFIAdditionalFIToFI() - fwm.SetFIAdditionalFIToFI(fifi) + fwm.FIAdditionalFIToFI = fifi file.AddFEDWireMessage(fwm) @@ -831,77 +831,77 @@ func TestFEDWireMessageWriteDrawdownRequest(t *testing.T) { // TestFEDWireMessageWriteBankDrawdownRequest writes a FEDWireMessage to a file with BusinessFunctionCode = DRB func TestFEDWireMessageWriteBankDrawdownRequest(t *testing.T) { file := NewFile() - fwm := NewFEDWireMessage() + fwm := FEDWireMessage{} // Mandatory Fields ss := mockSenderSupplied() - fwm.SetSenderSupplied(ss) + fwm.SenderSupplied = ss tst := mockTypeSubType() tst.TypeCode = SettlementTransfer tst.SubTypeCode = RequestCredit - fwm.SetTypeSubType(tst) + fwm.TypeSubType = tst imad := mockInputMessageAccountabilityData() - fwm.SetInputMessageAccountabilityData(imad) + fwm.InputMessageAccountabilityData = imad amt := mockAmount() - fwm.SetAmount(amt) + fwm.Amount = amt sdi := mockSenderDepositoryInstitution() - fwm.SetSenderDepositoryInstitution(sdi) + fwm.SenderDepositoryInstitution = sdi rdi := mockReceiverDepositoryInstitution() - fwm.SetReceiverDepositoryInstitution(rdi) + fwm.ReceiverDepositoryInstitution = rdi bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = BankDrawDownRequest bfc.TransactionTypeCode = " " - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc // Other Transfer Information sr := mockSenderReference() - fwm.SetSenderReference(sr) + fwm.SenderReference = sr pmi := mockPreviousMessageIdentifier() - fwm.SetPreviousMessageIdentifier(pmi) + fwm.PreviousMessageIdentifier = pmi // Beneficiary bifi := mockBeneficiaryIntermediaryFI() - fwm.SetBeneficiaryIntermediaryFI(bifi) + fwm.BeneficiaryIntermediaryFI = bifi bfi := mockBeneficiaryFI() - fwm.SetBeneficiaryFI(bfi) + fwm.BeneficiaryFI = bfi ben := mockBeneficiary() - fwm.SetBeneficiary(ben) + fwm.Beneficiary = ben br := mockBeneficiaryReference() - fwm.SetBeneficiaryReference(br) + fwm.BeneficiaryReference = br debitDD := mockAccountDebitedDrawdown() - fwm.SetAccountDebitedDrawdown(debitDD) + fwm.AccountDebitedDrawdown = debitDD // Originator o := mockOriginator() - fwm.SetOriginator(o) + fwm.Originator = o ofi := mockOriginatorFI() - fwm.SetOriginatorFI(ofi) + fwm.OriginatorFI = ofi ifi := mockInstructingFI() - fwm.SetInstructingFI(ifi) + fwm.InstructingFI = ifi creditDD := mockAccountCreditedDrawdown() - fwm.SetAccountCreditedDrawdown(creditDD) + fwm.AccountCreditedDrawdown = creditDD ob := mockOriginatorToBeneficiary() - fwm.SetOriginatorToBeneficiary(ob) + fwm.OriginatorToBeneficiary = ob // FI to FI firfi := mockFIReceiverFI() - fwm.SetFIReceiverFI(firfi) + fwm.FIReceiverFI = firfi fiifi := mockFIIntermediaryFI() - fwm.SetFIIntermediaryFI(fiifi) + fwm.FIIntermediaryFI = fiifi fiifia := mockFIIntermediaryFIAdvice() - fwm.SetFIIntermediaryFIAdvice(fiifia) + fwm.FIIntermediaryFIAdvice = fiifia fibfi := mockFIBeneficiaryFI() - fwm.SetFIBeneficiaryFI(fibfi) + fwm.FIBeneficiaryFI = fibfi fibfia := mockFIBeneficiaryFIAdvice() - fwm.SetFIBeneficiaryFIAdvice(fibfia) + fwm.FIBeneficiaryFIAdvice = fibfia fib := mockFIBeneficiary() - fwm.SetFIBeneficiary(fib) + fwm.FIBeneficiary = fib fiba := mockFIBeneficiaryAdvice() - fwm.SetFIBeneficiaryAdvice(fiba) + fwm.FIBeneficiaryAdvice = fiba pm := mockFIPaymentMethodToBeneficiary() - fwm.SetFIPaymentMethodToBeneficiary(pm) + fwm.FIPaymentMethodToBeneficiary = pm fifi := mockFIAdditionalFIToFI() - fwm.SetFIAdditionalFIToFI(fifi) + fwm.FIAdditionalFIToFI = fifi file.AddFEDWireMessage(fwm) @@ -911,79 +911,79 @@ func TestFEDWireMessageWriteBankDrawdownRequest(t *testing.T) { // TestFEDWireMessageWriteCustomerCorporateDrawdownRequest writes a FEDWireMessage to a file with BusinessFunctionCode = DRC func TestFEDWireMessageWriteCustomerCorporateDrawdownRequest(t *testing.T) { file := NewFile() - fwm := NewFEDWireMessage() + fwm := FEDWireMessage{} // Mandatory Fields ss := mockSenderSupplied() - fwm.SetSenderSupplied(ss) + fwm.SenderSupplied = ss tst := mockTypeSubType() - fwm.SetTypeSubType(tst) + fwm.TypeSubType = tst tst.TypeCode = FundsTransfer tst.SubTypeCode = RequestCredit imad := mockInputMessageAccountabilityData() - fwm.SetInputMessageAccountabilityData(imad) + fwm.InputMessageAccountabilityData = imad amt := mockAmount() - fwm.SetAmount(amt) + fwm.Amount = amt sdi := mockSenderDepositoryInstitution() - fwm.SetSenderDepositoryInstitution(sdi) + fwm.SenderDepositoryInstitution = sdi rdi := mockReceiverDepositoryInstitution() - fwm.SetReceiverDepositoryInstitution(rdi) + fwm.ReceiverDepositoryInstitution = rdi bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = CustomerCorporateDrawdownRequest bfc.TransactionTypeCode = " " - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc // Other Transfer Information sr := mockSenderReference() - fwm.SetSenderReference(sr) + fwm.SenderReference = sr pmi := mockPreviousMessageIdentifier() - fwm.SetPreviousMessageIdentifier(pmi) + fwm.PreviousMessageIdentifier = pmi // Beneficiary bifi := mockBeneficiaryIntermediaryFI() - fwm.SetBeneficiaryIntermediaryFI(bifi) + fwm.BeneficiaryIntermediaryFI = bifi bfi := mockBeneficiaryFI() - fwm.SetBeneficiaryFI(bfi) + fwm.BeneficiaryFI = bfi ben := mockBeneficiary() - fwm.SetBeneficiary(ben) + fwm.Beneficiary = ben br := mockBeneficiaryReference() - fwm.SetBeneficiaryReference(br) + fwm.BeneficiaryReference = br debitDD := mockAccountDebitedDrawdown() - fwm.SetAccountDebitedDrawdown(debitDD) + fwm.AccountDebitedDrawdown = debitDD // Originator o := mockOriginator() - fwm.SetOriginator(o) + fwm.Originator = o ofi := mockOriginatorFI() - fwm.SetOriginatorFI(ofi) + fwm.OriginatorFI = ofi ifi := mockInstructingFI() - fwm.SetInstructingFI(ifi) + fwm.InstructingFI = ifi creditDD := mockAccountCreditedDrawdown() - fwm.SetAccountCreditedDrawdown(creditDD) + fwm.AccountCreditedDrawdown = creditDD ob := mockOriginatorToBeneficiary() - fwm.SetOriginatorToBeneficiary(ob) + fwm.OriginatorToBeneficiary = ob // FI to FI firfi := mockFIReceiverFI() - fwm.SetFIReceiverFI(firfi) + fwm.FIReceiverFI = firfi debitDDAdvice := mockFIDrawdownDebitAccountAdvice() - fwm.SetFIDrawdownDebitAccountAdvice(debitDDAdvice) + fwm.FIDrawdownDebitAccountAdvice = debitDDAdvice fiifi := mockFIIntermediaryFI() - fwm.SetFIIntermediaryFI(fiifi) + fwm.FIIntermediaryFI = fiifi fiifia := mockFIIntermediaryFIAdvice() - fwm.SetFIIntermediaryFIAdvice(fiifia) + fwm.FIIntermediaryFIAdvice = fiifia fibfi := mockFIBeneficiaryFI() - fwm.SetFIBeneficiaryFI(fibfi) + fwm.FIBeneficiaryFI = fibfi fibfia := mockFIBeneficiaryFIAdvice() - fwm.SetFIBeneficiaryFIAdvice(fibfia) + fwm.FIBeneficiaryFIAdvice = fibfia fib := mockFIBeneficiary() - fwm.SetFIBeneficiary(fib) + fwm.FIBeneficiary = fib fiba := mockFIBeneficiaryAdvice() - fwm.SetFIBeneficiaryAdvice(fiba) + fwm.FIBeneficiaryAdvice = fiba pm := mockFIPaymentMethodToBeneficiary() - fwm.SetFIPaymentMethodToBeneficiary(pm) + fwm.FIPaymentMethodToBeneficiary = pm fifi := mockFIAdditionalFIToFI() - fwm.SetFIAdditionalFIToFI(fifi) + fwm.FIAdditionalFIToFI = fifi file.AddFEDWireMessage(fwm) @@ -996,11 +996,9 @@ func TestFEDWireMessageWriteServiceMessage(t *testing.T) { fwm := createMockServiceMessageData() fwm.TypeSubType.TypeCode = FundsTransfer fwm.TypeSubType.SubTypeCode = RequestReversal - fwm.SetTypeSubType(fwm.TypeSubType) fwm.BusinessFunctionCode.BusinessFunctionCode = BFCServiceMessage fwm.BusinessFunctionCode.TransactionTypeCode = " " - fwm.SetBusinessFunctionCode(fwm.BusinessFunctionCode) file.AddFEDWireMessage(fwm) @@ -1034,163 +1032,163 @@ func writeFile(file *File) error { } func createMockServiceMessageData() FEDWireMessage { - fwm := NewFEDWireMessage() + fwm := FEDWireMessage{} // Mandatory Fields ss := mockSenderSupplied() - fwm.SetSenderSupplied(ss) + fwm.SenderSupplied = ss tst := mockTypeSubType() tst.TypeCode = FundsTransfer tst.SubTypeCode = RequestReversal - fwm.SetTypeSubType(tst) + fwm.TypeSubType = tst imad := mockInputMessageAccountabilityData() - fwm.SetInputMessageAccountabilityData(imad) + fwm.InputMessageAccountabilityData = imad amt := mockAmount() - fwm.SetAmount(amt) + fwm.Amount = amt sdi := mockSenderDepositoryInstitution() - fwm.SetSenderDepositoryInstitution(sdi) + fwm.SenderDepositoryInstitution = sdi rdi := mockReceiverDepositoryInstitution() - fwm.SetReceiverDepositoryInstitution(rdi) + fwm.ReceiverDepositoryInstitution = rdi bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = BFCServiceMessage bfc.TransactionTypeCode = " " - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc // Other Transfer Information sr := mockSenderReference() - fwm.SetSenderReference(sr) + fwm.SenderReference = sr pmi := mockPreviousMessageIdentifier() - fwm.SetPreviousMessageIdentifier(pmi) + fwm.PreviousMessageIdentifier = pmi // Beneficiary bifi := mockBeneficiaryIntermediaryFI() - fwm.SetBeneficiaryIntermediaryFI(bifi) + fwm.BeneficiaryIntermediaryFI = bifi bfi := mockBeneficiaryFI() - fwm.SetBeneficiaryFI(bfi) + fwm.BeneficiaryFI = bfi ben := mockBeneficiary() - fwm.SetBeneficiary(ben) + fwm.Beneficiary = ben br := mockBeneficiaryReference() - fwm.SetBeneficiaryReference(br) + fwm.BeneficiaryReference = br debitDD := mockAccountDebitedDrawdown() - fwm.SetAccountDebitedDrawdown(debitDD) + fwm.AccountDebitedDrawdown = debitDD // Originator o := mockOriginator() - fwm.SetOriginator(o) + fwm.Originator = o ofi := mockOriginatorFI() - fwm.SetOriginatorFI(ofi) + fwm.OriginatorFI = ofi ifi := mockInstructingFI() - fwm.SetInstructingFI(ifi) + fwm.InstructingFI = ifi creditDD := mockAccountCreditedDrawdown() - fwm.SetAccountCreditedDrawdown(creditDD) + fwm.AccountCreditedDrawdown = creditDD ob := mockOriginatorToBeneficiary() - fwm.SetOriginatorToBeneficiary(ob) + fwm.OriginatorToBeneficiary = ob // FI to FI firfi := mockFIReceiverFI() - fwm.SetFIReceiverFI(firfi) + fwm.FIReceiverFI = firfi debitDDAdvice := mockFIDrawdownDebitAccountAdvice() - fwm.SetFIDrawdownDebitAccountAdvice(debitDDAdvice) + fwm.FIDrawdownDebitAccountAdvice = debitDDAdvice fiifi := mockFIIntermediaryFI() - fwm.SetFIIntermediaryFI(fiifi) + fwm.FIIntermediaryFI = fiifi fiifia := mockFIIntermediaryFIAdvice() - fwm.SetFIIntermediaryFIAdvice(fiifia) + fwm.FIIntermediaryFIAdvice = fiifia fibfi := mockFIBeneficiaryFI() - fwm.SetFIBeneficiaryFI(fibfi) + fwm.FIBeneficiaryFI = fibfi fibfia := mockFIBeneficiaryFIAdvice() - fwm.SetFIBeneficiaryFIAdvice(fibfia) + fwm.FIBeneficiaryFIAdvice = fibfia fib := mockFIBeneficiary() - fwm.SetFIBeneficiary(fib) + fwm.FIBeneficiary = fib fiba := mockFIBeneficiaryAdvice() - fwm.SetFIBeneficiaryAdvice(fiba) + fwm.FIBeneficiaryAdvice = fiba pm := mockFIPaymentMethodToBeneficiary() - fwm.SetFIPaymentMethodToBeneficiary(pm) + fwm.FIPaymentMethodToBeneficiary = pm fifi := mockFIAdditionalFIToFI() - fwm.SetFIAdditionalFIToFI(fifi) + fwm.FIAdditionalFIToFI = fifi // ServiceMessage sm := mockServiceMessage() - fwm.SetServiceMessage(sm) + fwm.ServiceMessage = sm return fwm } func createCustomerTransferData() FEDWireMessage { - fwm := NewFEDWireMessage() + fwm := FEDWireMessage{} // Mandatory Fields ss := mockSenderSupplied() - fwm.SetSenderSupplied(ss) + fwm.SenderSupplied = ss tst := mockTypeSubType() - fwm.SetTypeSubType(tst) + fwm.TypeSubType = tst imad := mockInputMessageAccountabilityData() - fwm.SetInputMessageAccountabilityData(imad) + fwm.InputMessageAccountabilityData = imad amt := mockAmount() - fwm.SetAmount(amt) + fwm.Amount = amt sdi := mockSenderDepositoryInstitution() - fwm.SetSenderDepositoryInstitution(sdi) + fwm.SenderDepositoryInstitution = sdi rdi := mockReceiverDepositoryInstitution() - fwm.SetReceiverDepositoryInstitution(rdi) + fwm.ReceiverDepositoryInstitution = rdi bfc := mockBusinessFunctionCode() bfc.BusinessFunctionCode = CustomerTransferPlus bfc.TransactionTypeCode = " " - fwm.SetBusinessFunctionCode(bfc) + fwm.BusinessFunctionCode = bfc // Other Transfer Information sr := mockSenderReference() - fwm.SetSenderReference(sr) + fwm.SenderReference = sr pmi := mockPreviousMessageIdentifier() - fwm.SetPreviousMessageIdentifier(pmi) + fwm.PreviousMessageIdentifier = pmi li := mockLocalInstrument() li.LocalInstrumentCode = ProprietaryLocalInstrumentCode li.ProprietaryCode = "PROP CODE" - fwm.SetLocalInstrument(li) + fwm.LocalInstrument = li pn := mockPaymentNotification() - fwm.SetPaymentNotification(pn) + fwm.PaymentNotification = pn /* c := mockCharges() - fwm.SetCharges(c) + fwm.Charges = c ia := mockInstructedAmount() - fwm.SetInstructedAmount(ia) + fwm.InstructedAmount = ia eRate := mockExchangeRate() - fwm.SetExchangeRate(eRate)*/ + fwm.ExchangeRate = eRate*/ // Beneficiary bifi := mockBeneficiaryIntermediaryFI() - fwm.SetBeneficiaryIntermediaryFI(bifi) + fwm.BeneficiaryIntermediaryFI = bifi bfi := mockBeneficiaryFI() - fwm.SetBeneficiaryFI(bfi) + fwm.BeneficiaryFI = bfi ben := mockBeneficiary() - fwm.SetBeneficiary(ben) + fwm.Beneficiary = ben br := mockBeneficiaryReference() - fwm.SetBeneficiaryReference(br) + fwm.BeneficiaryReference = br // Originator o := mockOriginator() - fwm.SetOriginator(o) + fwm.Originator = o oof := mockOriginatorOptionF() - fwm.SetOriginatorOptionF(oof) + fwm.OriginatorOptionF = oof ofi := mockOriginatorFI() - fwm.SetOriginatorFI(ofi) + fwm.OriginatorFI = ofi ifi := mockInstructingFI() - fwm.SetInstructingFI(ifi) + fwm.InstructingFI = ifi ob := mockOriginatorToBeneficiary() - fwm.SetOriginatorToBeneficiary(ob) + fwm.OriginatorToBeneficiary = ob // FI to FI fiifi := mockFIIntermediaryFI() - fwm.SetFIIntermediaryFI(fiifi) + fwm.FIIntermediaryFI = fiifi fiifia := mockFIIntermediaryFIAdvice() - fwm.SetFIIntermediaryFIAdvice(fiifia) + fwm.FIIntermediaryFIAdvice = fiifia fibfi := mockFIBeneficiaryFI() - fwm.SetFIBeneficiaryFI(fibfi) + fwm.FIBeneficiaryFI = fibfi fibfia := mockFIBeneficiaryFIAdvice() - fwm.SetFIBeneficiaryFIAdvice(fibfia) + fwm.FIBeneficiaryFIAdvice = fibfia fib := mockFIBeneficiary() - fwm.SetFIBeneficiary(fib) + fwm.FIBeneficiary = fib fiba := mockFIBeneficiaryAdvice() - fwm.SetFIBeneficiaryAdvice(fiba) + fwm.FIBeneficiaryAdvice = fiba pm := mockFIPaymentMethodToBeneficiary() - fwm.SetFIPaymentMethodToBeneficiary(pm) + fwm.FIPaymentMethodToBeneficiary = pm fifi := mockFIAdditionalFIToFI() - fwm.SetFIAdditionalFIToFI(fifi) + fwm.FIAdditionalFIToFI = fifi return fwm } @@ -1203,25 +1201,24 @@ func TestFEDWireMessageWriteCustomerTransferPlusCOVS(t *testing.T) { fwm.LocalInstrument.LocalInstrumentCode = SequenceBCoverPaymentStructured fwm.LocalInstrument.ProprietaryCode = "" - fwm.SetLocalInstrument(fwm.LocalInstrument) // Cover Payment Information cia := mockCurrencyInstructedAmount() - fwm.SetCurrencyInstructedAmount(cia) + fwm.CurrencyInstructedAmount = cia oc := mockOrderingCustomer() - fwm.SetOrderingCustomer(oc) + fwm.OrderingCustomer = oc oi := mockOrderingInstitution() - fwm.SetOrderingInstitution(oi) + fwm.OrderingInstitution = oi ii := mockIntermediaryInstitution() - fwm.SetIntermediaryInstitution(ii) + fwm.IntermediaryInstitution = ii iAccount := mockInstitutionAccount() - fwm.SetInstitutionAccount(iAccount) + fwm.InstitutionAccount = iAccount bc := mockBeneficiaryCustomer() - fwm.SetBeneficiaryCustomer(bc) + fwm.BeneficiaryCustomer = bc ri := mockRemittance() - fwm.SetRemittance(ri) + fwm.Remittance = ri str := mockSenderToReceiver() - fwm.SetSenderToReceiver(str) + fwm.SenderToReceiver = str file.AddFEDWireMessage(fwm) @@ -1236,11 +1233,10 @@ func TestFEDWireMessageWriteCustomerTransferPlusRelatedRemittance(t *testing.T) fwm.LocalInstrument.LocalInstrumentCode = RelatedRemittanceInformation fwm.LocalInstrument.ProprietaryCode = "" - fwm.SetLocalInstrument(fwm.LocalInstrument) // Related Remittance Information rr := mockRelatedRemittance() - fwm.SetRelatedRemittance(rr) + fwm.RelatedRemittance = rr file.AddFEDWireMessage(fwm) @@ -1255,32 +1251,31 @@ func TestFEDWireMessageWriteCustomerTransferPlusRemittanceInformationStructured( fwm.LocalInstrument.LocalInstrumentCode = RemittanceInformationStructured fwm.LocalInstrument.ProprietaryCode = "" - fwm.SetLocalInstrument(fwm.LocalInstrument) // Structured Remittance Information ro := mockRemittanceOriginator() - fwm.SetRemittanceOriginator(ro) + fwm.RemittanceOriginator = ro rb := mockRemittanceBeneficiary() rb.RemittanceData.DateBirthPlace = "" - fwm.SetRemittanceBeneficiary(rb) + fwm.RemittanceBeneficiary = rb // Additional Remittance Data prd := mockPrimaryRemittanceDocument() - fwm.SetPrimaryRemittanceDocument(prd) + fwm.PrimaryRemittanceDocument = prd aap := mockActualAmountPaid() - fwm.SetActualAmountPaid(aap) + fwm.ActualAmountPaid = aap gard := mockGrossAmountRemittanceDocument() - fwm.SetGrossAmountRemittanceDocument(gard) + fwm.GrossAmountRemittanceDocument = gard nd := mockAmountNegotiatedDiscount() - fwm.SetAmountNegotiatedDiscount(nd) + fwm.AmountNegotiatedDiscount = nd adj := mockAdjustment() - fwm.SetAdjustment(adj) + fwm.Adjustment = adj drd := mockDateRemittanceDocument() - fwm.SetDateRemittanceDocument(drd) + fwm.DateRemittanceDocument = drd srd := mockSecondaryRemittanceDocument() - fwm.SetSecondaryRemittanceDocument(srd) + fwm.SecondaryRemittanceDocument = srd rft := mockRemittanceFreeText() - fwm.SetRemittanceFreeText(rft) + fwm.RemittanceFreeText = rft file.AddFEDWireMessage(fwm) @@ -1295,11 +1290,10 @@ func TestFEDWireMessageWriteCustomerTransferPlusUnstructuredAddenda(t *testing.T fwm.LocalInstrument.LocalInstrumentCode = ANSIX12format fwm.LocalInstrument.ProprietaryCode = "" - fwm.SetLocalInstrument(fwm.LocalInstrument) // Unstructured Addenda ua := mockUnstructuredAddenda() - fwm.SetUnstructuredAddenda(ua) + fwm.UnstructuredAddenda = ua file.AddFEDWireMessage(fwm)