feat: update logic

This commit is contained in:
Maulana Sodiqin
2025-03-30 02:46:16 +07:00
parent a97044edfc
commit 0816566d03
23 changed files with 782 additions and 305 deletions
+31 -1
View File
@@ -1,5 +1,6 @@
use crate::PermissionsItemDto;
use crate::{PermissionsItemDto, PermissionsItemDtoRaw};
use serde::{Deserialize, Serialize};
use surrealdb::sql::Thing;
use utoipa::ToSchema;
use validator::Validate;
@@ -27,6 +28,15 @@ pub struct RolesItemListDto {
#[derive(Clone, Debug, Serialize, Deserialize, ToSchema)]
pub struct RolesItemDto {
pub id: String,
pub name: String,
pub permissions: Vec<PermissionsItemDto>,
pub created_at: Option<String>,
pub updated_at: Option<String>,
}
#[derive(Clone, Debug, Serialize, Deserialize, ToSchema)]
pub struct RolesItemByIdDto {
pub id: String,
pub name: String,
pub is_deleted: bool,
@@ -34,3 +44,23 @@ pub struct RolesItemDto {
pub created_at: Option<String>,
pub updated_at: Option<String>,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct RolesItemByIdDtoRaw {
pub id: Thing,
pub name: String,
pub permissions: Vec<PermissionsItemDtoRaw>,
pub is_deleted: bool,
pub created_at: Option<String>,
pub updated_at: Option<String>,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct RolesItemDtoRaw {
pub id: Thing,
pub name: String,
pub permissions: Vec<PermissionsItemDtoRaw>,
pub is_deleted: bool,
pub created_at: Option<String>,
pub updated_at: Option<String>,
}