pub struct EnterpriseGroup {
pub group_id: String,
pub name: String,
pub group_currency: String,
pub companies: Vec<CompanyCode>,
pub intercompany_links: Vec<(String, String)>,
}Expand description
Enterprise group structure containing multiple company codes.
Fields§
§group_id: StringGroup identifier
name: StringGroup name
group_currency: StringGroup consolidation currency
companies: Vec<CompanyCode>Company codes in the group
intercompany_links: Vec<(String, String)>Intercompany relationships (from_code, to_code)
Implementations§
Source§impl EnterpriseGroup
impl EnterpriseGroup
Sourcepub fn new(group_id: String, name: String, group_currency: String) -> Self
pub fn new(group_id: String, name: String, group_currency: String) -> Self
Create a new enterprise group.
Sourcepub fn add_company(&mut self, company: CompanyCode)
pub fn add_company(&mut self, company: CompanyCode)
Add a company to the group.
Sourcepub fn add_intercompany_link(&mut self, from_code: String, to_code: String)
pub fn add_intercompany_link(&mut self, from_code: String, to_code: String)
Add an intercompany link.
Sourcepub fn get_company(&self, code: &str) -> Option<&CompanyCode>
pub fn get_company(&self, code: &str) -> Option<&CompanyCode>
Get company by code.
Sourcepub fn company_codes(&self) -> Vec<&str>
pub fn company_codes(&self) -> Vec<&str>
Get all company codes.
Sourcepub fn get_intercompany_partners(&self, code: &str) -> Vec<&str>
pub fn get_intercompany_partners(&self, code: &str) -> Vec<&str>
Get intercompany partners for a company.
Trait Implementations§
Source§impl Clone for EnterpriseGroup
impl Clone for EnterpriseGroup
Source§fn clone(&self) -> EnterpriseGroup
fn clone(&self) -> EnterpriseGroup
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 EnterpriseGroup
impl Debug for EnterpriseGroup
Source§impl<'de> Deserialize<'de> for EnterpriseGroup
impl<'de> Deserialize<'de> for EnterpriseGroup
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 EnterpriseGroup
impl RefUnwindSafe for EnterpriseGroup
impl Send for EnterpriseGroup
impl Sync for EnterpriseGroup
impl Unpin for EnterpriseGroup
impl UnwindSafe for EnterpriseGroup
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