Skip to content

Commit

Permalink
build bundle control records when creating files
Browse files Browse the repository at this point in the history
  • Loading branch information
atonks2 committed Oct 23, 2024
1 parent eaa50fc commit 71355ab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 4 additions & 0 deletions file.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,10 @@ func (f *File) Create() error {

fileTotalAmount = fileTotalAmount + rd.ItemAmount
}

if err := b.build(); err != nil {
return fmt.Errorf("building control record for bundle %s: %w", b.BundleHeader.BundleSequenceNumber, err)
}
}
}

Expand Down
11 changes: 4 additions & 7 deletions internal/files/files_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,12 @@ import (
"strings"
"testing"

"github.com/stretchr/testify/assert"

"github.com/stretchr/testify/require"

"github.com/moov-io/base"
"github.com/moov-io/imagecashletter"

"github.com/gorilla/mux"
"github.com/moov-io/base"
"github.com/moov-io/base/log"
"github.com/moov-io/imagecashletter"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestFileId(t *testing.T) {
Expand Down

0 comments on commit 71355ab

Please sign in to comment.