mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 09:07:09 +08:00
feat: add create retrieve and update api endpoints for organization resource (#5361)
This commit is contained in:
@ -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>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user