pub struct AuditSample {Show 19 fields
pub sample_id: Uuid,
pub sample_ref: String,
pub workpaper_id: Uuid,
pub engagement_id: Uuid,
pub population_description: String,
pub population_size: u64,
pub population_value: Option<Decimal>,
pub sampling_method: SamplingMethod,
pub sample_size: u32,
pub sampling_interval: Option<Decimal>,
pub confidence_level: f64,
pub tolerable_misstatement: Option<Decimal>,
pub expected_misstatement: Option<Decimal>,
pub items: Vec<SampleItem>,
pub total_misstatement_found: Decimal,
pub projected_misstatement: Option<Decimal>,
pub conclusion: Option<SampleConclusion>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
A documented audit sample per ISA 530.
Fields§
§sample_id: UuidUnique sample ID
sample_ref: StringSample reference code, e.g. “SAMP-a1b2c3d4”
workpaper_id: UuidWorkpaper this sample is part of
engagement_id: UuidEngagement this sample belongs to
population_description: StringDescription of the population tested
population_size: u64Total number of items in the population
population_value: Option<Decimal>Total monetary value of the population (for MUS / projection)
sampling_method: SamplingMethodSampling methodology used
sample_size: u32Planned / actual number of items selected
sampling_interval: Option<Decimal>Sampling interval (used for systematic / MUS selection)
confidence_level: f64Confidence level (e.g. 0.95 for 95 %)
tolerable_misstatement: Option<Decimal>Tolerable misstatement threshold
expected_misstatement: Option<Decimal>Expected misstatement used in sample size determination
items: Vec<SampleItem>Individual items tested
total_misstatement_found: DecimalCumulative misstatement found across all items
projected_misstatement: Option<Decimal>Projected population misstatement
conclusion: Option<SampleConclusion>Conclusion reached
created_at: DateTime<Utc>Creation timestamp
updated_at: DateTime<Utc>Last-modified timestamp
Implementations§
Source§impl AuditSample
impl AuditSample
Sourcepub fn new(
workpaper_id: Uuid,
engagement_id: Uuid,
population_description: impl Into<String>,
population_size: u64,
sampling_method: SamplingMethod,
sample_size: u32,
) -> Self
pub fn new( workpaper_id: Uuid, engagement_id: Uuid, population_description: impl Into<String>, population_size: u64, sampling_method: SamplingMethod, sample_size: u32, ) -> Self
Create a new audit sample.
Sourcepub fn add_item(&mut self, item: SampleItem)
pub fn add_item(&mut self, item: SampleItem)
Add a tested item to the sample and accumulate total misstatement.
Sourcepub fn compute_projected_misstatement(&mut self)
pub fn compute_projected_misstatement(&mut self)
Compute projected population misstatement based on sample results.
Formula: (total_misstatement / sample_value) × population_value
Falls back to 0 when there are no items or the sample value is zero.
Trait Implementations§
Source§impl Clone for AuditSample
impl Clone for AuditSample
Source§fn clone(&self) -> AuditSample
fn clone(&self) -> AuditSample
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more