pub struct CustomerGenerator { /* private fields */ }Expand description
Generator for customer master data.
Implementations§
Source§impl CustomerGenerator
impl CustomerGenerator
Sourcepub fn with_config(seed: u64, config: CustomerGeneratorConfig) -> Self
pub fn with_config(seed: u64, config: CustomerGeneratorConfig) -> Self
Create a new customer generator with custom configuration.
Sourcepub fn with_segmentation_config(
seed: u64,
config: CustomerGeneratorConfig,
segmentation_config: CustomerSegmentationConfig,
) -> Self
pub fn with_segmentation_config( seed: u64, config: CustomerGeneratorConfig, segmentation_config: CustomerSegmentationConfig, ) -> Self
Create a new customer generator with segmentation configuration.
Sourcepub fn set_coa_framework(&mut self, framework: CoAFramework)
pub fn set_coa_framework(&mut self, framework: CoAFramework)
Set the accounting framework for auxiliary GL account generation.
Sourcepub fn set_template_provider(&mut self, provider: SharedTemplateProvider)
pub fn set_template_provider(&mut self, provider: SharedTemplateProvider)
Set a template provider so user-supplied customer names override the embedded pools. (v3.2.0+)
When None (default), the embedded CUSTOMER_NAME_TEMPLATES
pool is used — byte-identical to pre-v3.2.0 output.
Sourcepub fn set_segmentation_config(
&mut self,
segmentation_config: CustomerSegmentationConfig,
)
pub fn set_segmentation_config( &mut self, segmentation_config: CustomerSegmentationConfig, )
Set segmentation configuration.
Sourcepub fn set_country_pack(&mut self, pack: CountryPack)
pub fn set_country_pack(&mut self, pack: CountryPack)
Set the country pack for locale-aware generation.
Sourcepub fn set_counter_offset(&mut self, offset: usize)
pub fn set_counter_offset(&mut self, offset: usize)
Set a counter offset so that generated IDs start after a given value.
This is used when generating customers for multiple companies in parallel to ensure globally unique IDs. For example, if company 0 generates 100 customers (C-000001..C-000100), company 1 should set offset=100 so its customers start at C-000101.
Sourcepub fn generate_customer(
&mut self,
company_code: &str,
_effective_date: NaiveDate,
) -> Customer
pub fn generate_customer( &mut self, company_code: &str, _effective_date: NaiveDate, ) -> Customer
Generate a single customer.
Sourcepub fn generate_intercompany_customer(
&mut self,
company_code: &str,
partner_company_code: &str,
effective_date: NaiveDate,
) -> Customer
pub fn generate_intercompany_customer( &mut self, company_code: &str, partner_company_code: &str, effective_date: NaiveDate, ) -> Customer
Generate an intercompany customer (always intercompany).
Sourcepub fn generate_customer_with_credit(
&mut self,
company_code: &str,
credit_rating: CreditRating,
credit_limit: Decimal,
effective_date: NaiveDate,
) -> Customer
pub fn generate_customer_with_credit( &mut self, company_code: &str, credit_rating: CreditRating, credit_limit: Decimal, effective_date: NaiveDate, ) -> Customer
Generate a customer with specific credit profile.
Sourcepub fn generate_customer_pool(
&mut self,
count: usize,
company_code: &str,
effective_date: NaiveDate,
) -> CustomerPool
pub fn generate_customer_pool( &mut self, count: usize, company_code: &str, effective_date: NaiveDate, ) -> CustomerPool
Generate a customer pool with specified count.
Sourcepub fn generate_customer_pool_with_ic(
&mut self,
count: usize,
company_code: &str,
partner_company_codes: &[String],
effective_date: NaiveDate,
) -> CustomerPool
pub fn generate_customer_pool_with_ic( &mut self, count: usize, company_code: &str, partner_company_codes: &[String], effective_date: NaiveDate, ) -> CustomerPool
Generate a customer pool with intercompany customers.
Sourcepub fn generate_diverse_pool(
&mut self,
count: usize,
company_code: &str,
effective_date: NaiveDate,
) -> CustomerPool
pub fn generate_diverse_pool( &mut self, count: usize, company_code: &str, effective_date: NaiveDate, ) -> CustomerPool
Generate a diverse customer pool with various credit profiles.
Sourcepub fn generate_segmented_pool(
&mut self,
count: usize,
company_code: &str,
effective_date: NaiveDate,
total_annual_revenue: Decimal,
) -> SegmentedCustomerPool
pub fn generate_segmented_pool( &mut self, count: usize, company_code: &str, effective_date: NaiveDate, total_annual_revenue: Decimal, ) -> SegmentedCustomerPool
Generate a segmented customer pool with value segments, lifecycle stages, and networks.
Sourcepub fn generate_pool_with_segmentation(
&mut self,
count: usize,
company_code: &str,
effective_date: NaiveDate,
total_annual_revenue: Decimal,
) -> (CustomerPool, SegmentedCustomerPool)
pub fn generate_pool_with_segmentation( &mut self, count: usize, company_code: &str, effective_date: NaiveDate, total_annual_revenue: Decimal, ) -> (CustomerPool, SegmentedCustomerPool)
Generate a combined output of CustomerPool and SegmentedCustomerPool.
Auto Trait Implementations§
impl !RefUnwindSafe for CustomerGenerator
impl !UnwindSafe for CustomerGenerator
impl Freeze for CustomerGenerator
impl Send for CustomerGenerator
impl Sync for CustomerGenerator
impl Unpin for CustomerGenerator
impl UnsafeUnpin for CustomerGenerator
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.