diff --git a/internal/util/paginateutil/has_next_page.go b/internal/util/paginateutil/has_next_page.go deleted file mode 100644 index 9ea84e0..0000000 --- a/internal/util/paginateutil/has_next_page.go +++ /dev/null @@ -1,14 +0,0 @@ -package paginateutil - -// HasNextPage returns true if there are more pages to show. -func HasNextPage( - totalItems int, - limit int, - offset int, -) bool { - if totalItems <= 0 { - return false - } - - return totalItems > offset+limit -} diff --git a/internal/util/paginateutil/has_next_page_test.go b/internal/util/paginateutil/has_next_page_test.go deleted file mode 100644 index cf81e45..0000000 --- a/internal/util/paginateutil/has_next_page_test.go +++ /dev/null @@ -1,60 +0,0 @@ -package paginateutil - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestHasNextPage(t *testing.T) { - tests := []struct { - name string - totalItems int - limit int - offset int - want bool - }{ - { - name: "No items", - totalItems: 0, - limit: 10, - offset: 0, - want: false, - }, - { - name: "Exact number of items as limit", - totalItems: 10, - limit: 10, - offset: 0, - want: false, - }, - { - name: "More items than limit", - totalItems: 15, - limit: 10, - offset: 0, - want: true, - }, - { - name: "No more items beyond current page", - totalItems: 20, - limit: 10, - offset: 10, - want: false, - }, - { - name: "More items beyond current page", - totalItems: 25, - limit: 10, - offset: 10, - want: true, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - got := HasNextPage(tt.totalItems, tt.limit, tt.offset) - assert.Equal(t, tt.want, got) - }) - } -}