Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create the Page data structure #6

Open
4 tasks
gsdenys opened this issue Nov 15, 2023 · 0 comments
Open
4 tasks

Create the Page data structure #6

gsdenys opened this issue Nov 15, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request pageable
Milestone

Comments

@gsdenys
Copy link
Owner

gsdenys commented Nov 15, 2023

Description

Implement the Page data structure that contains the functions Next() and Prev(). It also stores the content of request and the page data.

During the implementation, this data structure will be discussed and a consensus must be defined

This data structure must have minimum these fields:

type Page[T any] struct {
  Elements []*T  `json:"elements"`
  Count    int64 `json:"count"`
  Page     uint  `json:"page"`
  PageSize uint  `json:"pageSize"`
  NumPages int64 `json:"totalPages"`
  HasNext  bool  `json:"hasNext"`
  HasPrev  bool  `json:"hasPrev"`
}

And the function signature are:

func (pg *Page[T]) Next() (*Page[T], error)
func (pg *Page[T]) Prev() (*Page[T], error) 

Acceptance Criteria

  • 1. The Data structure must be defined and implemented
  • 2. The unity test should be developed
  • 3. The test coverture must be 100%
  • 4. The serialization elements to json must not print the auxiliar objects like connection or repository.
@gsdenys gsdenys added the enhancement New feature or request label Nov 15, 2023
@gsdenys gsdenys added this to the V1.0 milestone Nov 15, 2023
@gsdenys gsdenys self-assigned this Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pageable
Projects
None yet
Development

No branches or pull requests

1 participant