package de.avatic.lcc.repositories.pagination;

import jakarta.validation.constraints.Min;

public class SearchQueryPagination {

    @Min(1)
    private final Integer page;

    private final Integer size;

    public SearchQueryPagination(Integer page, Integer size) {
        this.page = page;
        this.size = size;
    }

    public Integer getLimit() {
        return size;
    }

    public Integer getOffset() {
        return (page - 1) * size;
    }

    public Integer getPage() { return page; }

}
