pub struct Project {
pub project_id: String,
pub name: String,
pub description: String,
pub project_type: ProjectType,
pub status: ProjectStatus,
pub budget: Decimal,
pub responsible_cost_center: String,
pub wbs_elements: Vec<WbsElement>,
pub company_code: String,
pub start_date: Option<String>,
pub end_date: Option<String>,
}Expand description
Project master data.
Fields§
§project_id: StringProject ID (e.g., “P-001234”)
name: StringProject name
description: StringProject description
project_type: ProjectTypeType of project
status: ProjectStatusCurrent status
budget: DecimalTotal budget
responsible_cost_center: StringResponsible cost center
wbs_elements: Vec<WbsElement>WBS elements
company_code: StringCompany code
start_date: Option<String>Start date (YYYY-MM-DD)
end_date: Option<String>End date (YYYY-MM-DD)
Implementations§
Source§impl Project
impl Project
Sourcepub fn new(project_id: &str, name: &str, project_type: ProjectType) -> Self
pub fn new(project_id: &str, name: &str, project_type: ProjectType) -> Self
Create a new project.
Sourcepub fn with_budget(self, budget: Decimal) -> Self
pub fn with_budget(self, budget: Decimal) -> Self
Set the budget.
Sourcepub fn with_company(self, company_code: &str) -> Self
pub fn with_company(self, company_code: &str) -> Self
Set the company code.
Sourcepub fn add_wbs_element(&mut self, element: WbsElement)
pub fn add_wbs_element(&mut self, element: WbsElement)
Add a WBS element.
Sourcepub fn active_wbs_elements(&self) -> Vec<&WbsElement>
pub fn active_wbs_elements(&self) -> Vec<&WbsElement>
Get active WBS elements.
Sourcepub fn allows_postings(&self) -> bool
pub fn allows_postings(&self) -> bool
Check if project allows postings.
Sourcepub fn total_actual_costs(&self) -> Decimal
pub fn total_actual_costs(&self) -> Decimal
Get total actual costs across all WBS elements.
Sourcepub fn is_over_budget(&self) -> bool
pub fn is_over_budget(&self) -> bool
Check if project is over budget.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Project
impl<'de> Deserialize<'de> for Project
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Project
impl RefUnwindSafe for Project
impl Send for Project
impl Sync for Project
impl Unpin for Project
impl UnwindSafe for Project
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more