pub struct ICGenerator { /* private fields */ }Expand description
Generator for intercompany transactions.
Implementations§
Source§impl ICGenerator
impl ICGenerator
Sourcepub fn new(
config: ICGeneratorConfig,
ownership_structure: OwnershipStructure,
seed: u64,
) -> Self
pub fn new( config: ICGeneratorConfig, ownership_structure: OwnershipStructure, seed: u64, ) -> Self
Create a new IC generator.
Sourcepub fn add_transfer_pricing_policy(
&mut self,
relationship_id: String,
policy: TransferPricingPolicy,
)
pub fn add_transfer_pricing_policy( &mut self, relationship_id: String, policy: TransferPricingPolicy, )
Add a transfer pricing policy.
Sourcepub fn generate_ic_transaction(
&mut self,
date: NaiveDate,
_fiscal_period: &str,
) -> Option<ICMatchedPair>
pub fn generate_ic_transaction( &mut self, date: NaiveDate, _fiscal_period: &str, ) -> Option<ICMatchedPair>
Generate a single IC matched pair.
Sourcepub fn generate_journal_entries(
&mut self,
pair: &ICMatchedPair,
fiscal_year: i32,
fiscal_period: u32,
) -> (JournalEntry, JournalEntry)
pub fn generate_journal_entries( &mut self, pair: &ICMatchedPair, fiscal_year: i32, fiscal_period: u32, ) -> (JournalEntry, JournalEntry)
Generate IC journal entries from a matched pair.
Sourcepub fn generate_ic_loan(
&mut self,
lender: String,
borrower: String,
start_date: NaiveDate,
term_months: u32,
) -> ICLoan
pub fn generate_ic_loan( &mut self, lender: String, borrower: String, start_date: NaiveDate, term_months: u32, ) -> ICLoan
Generate an IC loan.
Sourcepub fn generate_loan_interest_entries(
&mut self,
as_of_date: NaiveDate,
fiscal_year: i32,
fiscal_period: u32,
) -> Vec<(JournalEntry, JournalEntry)>
pub fn generate_loan_interest_entries( &mut self, as_of_date: NaiveDate, fiscal_year: i32, fiscal_period: u32, ) -> Vec<(JournalEntry, JournalEntry)>
Generate interest entries for active loans.
Sourcepub fn get_matched_pairs(&self) -> &[ICMatchedPair]
pub fn get_matched_pairs(&self) -> &[ICMatchedPair]
Get all generated matched pairs.
Sourcepub fn get_open_pairs(&self) -> Vec<&ICMatchedPair>
pub fn get_open_pairs(&self) -> Vec<&ICMatchedPair>
Get open (unsettled) matched pairs.
Sourcepub fn get_active_loans(&self) -> &[ICLoan]
pub fn get_active_loans(&self) -> &[ICLoan]
Get active loans.
Sourcepub fn generate_transactions_for_period(
&mut self,
start_date: NaiveDate,
end_date: NaiveDate,
transactions_per_day: usize,
) -> Vec<ICMatchedPair>
pub fn generate_transactions_for_period( &mut self, start_date: NaiveDate, end_date: NaiveDate, transactions_per_day: usize, ) -> Vec<ICMatchedPair>
Generate multiple IC transactions for a date range.
Sourcepub fn reset_counters(&mut self)
pub fn reset_counters(&mut self)
Reset counters (for testing).
Auto Trait Implementations§
impl Freeze for ICGenerator
impl RefUnwindSafe for ICGenerator
impl Send for ICGenerator
impl Sync for ICGenerator
impl Unpin for ICGenerator
impl UnwindSafe for ICGenerator
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