use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use uuid::Uuid;
use utoipa::ToSchema;
use super::{Address, ContactPoint};
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
pub struct Organization {
pub id: Uuid,
pub identifiers: Vec<super::Identifier>,
pub active: bool,
pub org_type: Vec<String>,
pub name: String,
pub alias: Vec<String>,
pub telecom: Vec<ContactPoint>,
pub addresses: Vec<Address>,
pub part_of: Option<Uuid>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}
impl Organization {
pub fn new(name: String) -> Self {
let now = Utc::now();
Self {
id: Uuid::new_v4(),
identifiers: Vec::new(),
active: true,
org_type: Vec::new(),
name,
alias: Vec::new(),
telecom: Vec::new(),
addresses: Vec::new(),
part_of: None,
created_at: now,
updated_at: now,
}
}
}