// SPDX-FileCopyrightText: Politik im Blick developers
// SPDX-FileCopyrightText: Wolfgang Silbermayr <wolfgang@silbermayr.at>
//
// SPDX-License-Identifier: AGPL-3.0-or-later OR EUPL-1.2

use crate::{Page, PageSize};

#[derive(
    Default,
    Debug,
    Clone,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash,
    serde::Deserialize,
    serde::Serialize,
)]
pub struct Pagination {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub page: Option<Page>,

    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub per_page: Option<PageSize>,
}

impl Pagination {
    pub const DEFAULT: Pagination = Pagination {
        page: None,
        per_page: None,
    };
}
