pub struct ProjectCostLine {
pub id: String,
pub project_id: String,
pub wbs_id: String,
pub entity_id: String,
pub posting_date: NaiveDate,
pub cost_category: CostCategory,
pub source_type: CostSourceType,
pub source_document_id: String,
pub amount: Decimal,
pub currency: String,
pub hours: Option<Decimal>,
pub description: String,
}Expand description
A single cost posting against a project WBS element.
Fields§
§id: StringUnique cost line ID
project_id: StringProject ID this cost belongs to
wbs_id: StringWBS element ID for cost assignment
entity_id: StringEntity that incurred the cost
posting_date: NaiveDateDate the cost was incurred
cost_category: CostCategoryCategory of the cost
source_type: CostSourceTypeType of source document
source_document_id: StringReference to the source document
amount: DecimalCost amount (always positive)
currency: StringCurrency
hours: Option<Decimal>Hours (for labor costs)
description: StringDescription
Implementations§
Source§impl ProjectCostLine
impl ProjectCostLine
Sourcepub fn new(
id: impl Into<String>,
project_id: impl Into<String>,
wbs_id: impl Into<String>,
entity_id: impl Into<String>,
posting_date: NaiveDate,
cost_category: CostCategory,
source_type: CostSourceType,
source_document_id: impl Into<String>,
amount: Decimal,
currency: impl Into<String>,
) -> Self
pub fn new( id: impl Into<String>, project_id: impl Into<String>, wbs_id: impl Into<String>, entity_id: impl Into<String>, posting_date: NaiveDate, cost_category: CostCategory, source_type: CostSourceType, source_document_id: impl Into<String>, amount: Decimal, currency: impl Into<String>, ) -> Self
Creates a new project cost line.
Sourcepub fn with_hours(self, hours: Decimal) -> Self
pub fn with_hours(self, hours: Decimal) -> Self
Sets the hours (for labor costs).
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Sets the description.
Sourcepub fn hourly_rate(&self) -> Option<Decimal>
pub fn hourly_rate(&self) -> Option<Decimal>
Computes an effective hourly rate (if hours are available).
Trait Implementations§
Source§impl Clone for ProjectCostLine
impl Clone for ProjectCostLine
Source§fn clone(&self) -> ProjectCostLine
fn clone(&self) -> ProjectCostLine
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProjectCostLine
impl Debug for ProjectCostLine
Source§impl<'de> Deserialize<'de> for ProjectCostLine
impl<'de> Deserialize<'de> for ProjectCostLine
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
Source§impl Serialize for ProjectCostLine
impl Serialize for ProjectCostLine
Source§impl ToNodeProperties for ProjectCostLine
impl ToNodeProperties for ProjectCostLine
Source§fn node_type_name(&self) -> &'static str
fn node_type_name(&self) -> &'static str
Entity type name (snake_case), e.g.
"uncertain_tax_position".Source§fn node_type_code(&self) -> u16
fn node_type_code(&self) -> u16
Numeric entity type code for registry, e.g.
416.Source§fn to_node_properties(&self) -> HashMap<String, GraphPropertyValue>
fn to_node_properties(&self) -> HashMap<String, GraphPropertyValue>
Convert all fields to a property map with camelCase keys.
Auto Trait Implementations§
impl Freeze for ProjectCostLine
impl RefUnwindSafe for ProjectCostLine
impl Send for ProjectCostLine
impl Sync for ProjectCostLine
impl Unpin for ProjectCostLine
impl UnsafeUnpin for ProjectCostLine
impl UnwindSafe for ProjectCostLine
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