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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AuditSample
impl Debug for AuditSample
Source§impl<'de> Deserialize<'de> for AuditSample
impl<'de> Deserialize<'de> for AuditSample
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>,
Auto Trait Implementations§
impl Freeze for AuditSample
impl RefUnwindSafe for AuditSample
impl Send for AuditSample
impl Sync for AuditSample
impl Unpin for AuditSample
impl UnsafeUnpin for AuditSample
impl UnwindSafe for AuditSample
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.