pub enum ChargeDistributionError {
QuotaOutOfRange(Decimal),
NegativeTotalAmount,
QuotaSumExceeds {
total_quota: Decimal,
},
InvalidTotalTantiemes(Decimal),
UnknownCriteria(String),
}Expand description
Domain-typed validation error for charge distribution (quote-part exactness).
Pure domain type — no infrastructure/application dependency (hexagonal
purity). Follows the codebase precedent JournalEntryError
(journal_entry.rs) / ProxyValidationError (vote.rs): the entity returns
its own typed error; the application layer maps it to AppError
(see impl From<ChargeDistributionError> for AppError) so a malformed
distribution surfaces as a 400 validation error, not a 500 Internal
(#433 / WP-A4 — EXP-005).
Variants§
QuotaOutOfRange(Decimal)
Quota percentage is outside the valid [0, 1] range.
NegativeTotalAmount
Total amount to distribute is negative.
QuotaSumExceeds
Sum of all quotas exceeds 100% beyond the rounding tolerance. Over-distribution would over-charge owners — financial integrity guard.
Fields
total_quota: DecimalInvalidTotalTantiemes(Decimal)
Story H12 — base de tantièmes invalide (acte de base ≤ 0) : impossible de calculer une quote-part de lot (division par zéro / base négative).
UnknownCriteria(String)
Story H12 — critère de répartition non reconnu (≠ value/utility/mixed). Garde @security : un critère non prévu par la loi (Art. 3.84/3.86) est refusé, pas appliqué silencieusement.
Trait Implementations§
Source§impl Clone for ChargeDistributionError
impl Clone for ChargeDistributionError
Source§fn clone(&self) -> ChargeDistributionError
fn clone(&self) -> ChargeDistributionError
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 ChargeDistributionError
impl Debug for ChargeDistributionError
Source§impl Display for ChargeDistributionError
impl Display for ChargeDistributionError
Source§impl Error for ChargeDistributionError
impl Error for ChargeDistributionError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<ChargeDistributionError> for AppError
impl From<ChargeDistributionError> for AppError
Source§fn from(e: ChargeDistributionError) -> Self
fn from(e: ChargeDistributionError) -> Self
Une répartition de charges malformée est une erreur d’entrée client
(quote-part hors [0, 1], total négatif, somme des quotités > 100%) →
400 validation, jamais 500 Internal (le From<String> générique
mappait à tort vers Internal) — #433 / WP-A4 EXP-005.
Source§impl From<ChargeDistributionError> for String
Bridge so existing Result<_, String> use-cases keep compiling while the
entity is typed (the use-case/port String→AppError cascade is a distinct,
broader slice — out of WP-A4 scope, mirrors WP-A3). Pure, std-only.
impl From<ChargeDistributionError> for String
Bridge so existing Result<_, String> use-cases keep compiling while the
entity is typed (the use-case/port String→AppError cascade is a distinct,
broader slice — out of WP-A4 scope, mirrors WP-A3). Pure, std-only.
Source§fn from(e: ChargeDistributionError) -> String
fn from(e: ChargeDistributionError) -> String
Source§impl PartialEq for ChargeDistributionError
impl PartialEq for ChargeDistributionError
Source§fn eq(&self, other: &ChargeDistributionError) -> bool
fn eq(&self, other: &ChargeDistributionError) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ChargeDistributionError
Auto Trait Implementations§
impl Freeze for ChargeDistributionError
impl RefUnwindSafe for ChargeDistributionError
impl Send for ChargeDistributionError
impl Sync for ChargeDistributionError
impl Unpin for ChargeDistributionError
impl UnsafeUnpin for ChargeDistributionError
impl UnwindSafe for ChargeDistributionError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Fake for T
impl<T> Fake for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more