feat: add create retrieve and update api endpoints for organization resource (#5361)

This commit is contained in:
Hrithikesh
2024-07-24 12:10:37 +05:30
committed by GitHub
parent 192203d3a9
commit 26b878308f
44 changed files with 739 additions and 180 deletions

View File

@ -1,13 +1,32 @@
use common_utils::id_type;
use utoipa::ToSchema;
pub struct OrganizationNew {
pub org_id: String,
pub org_id: id_type::OrganizationId,
pub org_name: Option<String>,
}
impl OrganizationNew {
pub fn new(org_name: Option<String>) -> Self {
Self {
org_id: common_utils::generate_id_with_default_len("org"),
org_id: id_type::OrganizationId::default(),
org_name,
}
}
}
#[derive(Clone, Debug, serde::Serialize)]
pub struct OrganizationId {
pub organization_id: id_type::OrganizationId,
}
#[derive(Debug, serde::Serialize, serde::Deserialize, Clone, ToSchema)]
pub struct OrganizationRequest {
pub organization_name: Option<String>,
}
#[derive(Debug, serde::Serialize, Clone, ToSchema)]
pub struct OrganizationResponse {
#[schema(value_type = String, max_length = 64, min_length = 1, example = "org_q98uSGAYbjEwqs0mJwnz")]
pub organization_id: id_type::OrganizationId,
pub organization_name: Option<String>,
}