package cloud.nstart.terravault.ordinis.readapi.dto;

import com.fasterxml.jackson.annotation.JsonInclude;

import java.util.List;

@JsonInclude(JsonInclude.Include.NON_NULL)
public record PageResponse<T>(
    List<T> items,
    int total,
    int page,
    int size) {

  public static <T> PageResponse<T> of(List<T> items, int page, int size, int total) {
    return new PageResponse<>(items, total, page, size);
  }
}
