Skip to main content

CheckReport

Struct CheckReport 

Source
pub struct CheckReport {
    pub outcome: CheckOutcome,
    pub findings: Vec<Finding>,
    pub pid: u32,
    pub total_net_invoic: Option<EuroAmount>,
    pub total_net_computed: Option<EuroAmount>,
    pub line_items_checked: usize,
}
Expand description

Full report from InvoicCheckEngine::check.

Fields§

§outcome: CheckOutcome

Overall outcome — highest severity across all findings.

§findings: Vec<Finding>

Ordered list of findings (empty when outcome == Ok).

§pid: u32

BDEW Prüfidentifikator from the checked INVOIC.

§total_net_invoic: Option<EuroAmount>

Total net amount as stated in Rechnung.gesamtnetto.

§total_net_computed: Option<EuroAmount>

Total net amount as re-computed by summing Rechnungsposition.gesamtpreis (BO4E v202607).

§line_items_checked: usize

Number of Rechnungsposition entries checked.

Implementations§

Source§

impl CheckReport

Source

pub fn from_findings( pid: u32, rechnung: &Rechnung, findings: Vec<Finding>, computed_total: Option<EuroAmount>, ) -> Self

Assemble a report from the findings a check pipeline produced.

The outcome is the highest severity across the findings: one dispute makes the whole report a dispute, any finding at all makes it at least a warning, none makes it Ok. That rule, the invoice’s own stated total and the line count were open-coded once per pipeline — three copies of the same four lines, in the one place where a divergence would silently change whether an invoice is auto-paid.

Source

pub fn is_ok(&self) -> bool

true when the invoice passed all checks without findings.

Source

pub fn has_dispute(&self) -> bool

true when at least one finding escalates to Dispute.

Trait Implementations§

Source§

impl Clone for CheckReport

Source§

fn clone(&self) -> CheckReport

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CheckReport

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for CheckReport

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for CheckReport

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.