Update batch.go
Replace numeric TransactionCode with constant
@@ -790,9 +790,9 @@ func (batch *Batch) IsADV() bool {
// ValidTranCodeForServiceClassCode validates a TransactionCode is valid for a ServiceClassCode
func (batch *Batch) ValidTranCodeForServiceClassCode(entry *EntryDetail) error {
// ADV should use ADVEntryDetail
- // ADV Transaction Codes are 81, 82, 83, 84, 85, 86, 87, 88
switch entry.TransactionCode {
- case 81, 82, 83, 84, 85, 86, 87, 88:
+ case CreditForDebitsOriginated, CreditForCreditsReceived, CreditForCreditsRejected, CreditSummary,
+ DebitForCreditsOriginated, DebitForDebitsReceived, DebitForDebitsRejectedBatches, DebitSummary:
msg := fmt.Sprintf(msgBatchServiceClassTranCode, entry.TransactionCode, batch.Header.StandardEntryClassCode)
return &BatchError{BatchNumber: batch.Header.BatchNumber, FieldName: "TransactionCode", Msg: msg}
}
