// 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 pib_service_core_types::{BodyId, BodyPermissionId, Entity, UserId};
use serde::{Deserialize, Serialize};

pub mod get;
pub mod post;

pub mod by_id;

#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)]
pub struct Permission {
    pub user_id: UserId,
}

#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Deserialize, Serialize)]
pub struct PermissionParentId {
    pub body_id: BodyId,
}

impl Entity<PermissionParentId, BodyPermissionId> for Permission {}

#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)]
pub struct NewPermission {
    pub user_id: UserId,
}
