clean_base/dtos/
paginated_record.rs

1use serde::{Deserialize, Serialize};
2use utoipa::ToSchema;
3
4/// A default pagination response
5///
6/// This is usual during offset base pagination:
7///  `https://www.prisma.io/docs/concepts/components/prisma-client/pagination`
8///
9/// A paginated record include the total number of records found into a query
10/// plus page size which records will be retrieved, the number of records to be
11/// ignored (such value should be discovered after the first query), and the
12/// records itself.
13#[derive(Clone, Debug, Deserialize, Serialize, ToSchema)]
14#[serde(rename_all = "camelCase")]
15pub struct PaginatedRecord<T> {
16    pub count: i64,
17    pub skip: Option<i64>,
18    pub size: Option<i64>,
19    pub records: Vec<T>,
20}