pub struct PaymentCorrection {Show 21 fields
pub correction_id: String,
pub company_code: String,
pub customer_id: String,
pub original_payment_id: String,
pub correction_type: PaymentCorrectionType,
pub original_amount: Decimal,
pub correction_amount: Decimal,
pub currency: String,
pub correction_date: NaiveDate,
pub reversal_je_id: Option<String>,
pub correcting_payment_id: Option<String>,
pub affected_invoice_ids: Vec<String>,
pub status: CorrectionStatus,
pub reason: Option<String>,
pub bank_reference: Option<String>,
pub chargeback_code: Option<String>,
pub fee_amount: Decimal,
pub created_at: DateTime<Utc>,
pub created_by: Option<String>,
pub resolved_at: Option<DateTime<Utc>>,
pub notes: Option<String>,
}Expand description
A payment correction record.
Fields§
§correction_id: StringUnique correction identifier.
company_code: StringCompany code.
customer_id: StringCustomer ID.
original_payment_id: StringOriginal payment ID being corrected.
correction_type: PaymentCorrectionTypeType of correction.
original_amount: DecimalOriginal payment amount.
correction_amount: DecimalCorrection amount (positive for reversals, negative for adjustments).
currency: StringCurrency.
correction_date: NaiveDateDate of correction.
reversal_je_id: Option<String>Reversal journal entry ID if applicable.
correcting_payment_id: Option<String>Correcting payment ID (new payment if re-processed).
affected_invoice_ids: Vec<String>Related invoice IDs affected.
status: CorrectionStatusStatus of the correction.
reason: Option<String>Reason for correction.
bank_reference: Option<String>Bank reference (for NSF/chargeback).
chargeback_code: Option<String>Chargeback code if applicable.
fee_amount: DecimalFee amount (bank fees, chargeback fees).
created_at: DateTime<Utc>Created timestamp.
created_by: Option<String>Created by user.
resolved_at: Option<DateTime<Utc>>Resolved timestamp.
notes: Option<String>Notes.
Implementations§
Source§impl PaymentCorrection
impl PaymentCorrection
Sourcepub fn new(
correction_id: String,
company_code: String,
customer_id: String,
original_payment_id: String,
correction_type: PaymentCorrectionType,
original_amount: Decimal,
correction_amount: Decimal,
currency: String,
correction_date: NaiveDate,
) -> Self
pub fn new( correction_id: String, company_code: String, customer_id: String, original_payment_id: String, correction_type: PaymentCorrectionType, original_amount: Decimal, correction_amount: Decimal, currency: String, correction_date: NaiveDate, ) -> Self
Creates a new payment correction.
Sourcepub fn nsf(
correction_id: String,
company_code: String,
customer_id: String,
original_payment_id: String,
original_amount: Decimal,
currency: String,
correction_date: NaiveDate,
bank_reference: String,
nsf_fee: Decimal,
) -> Self
pub fn nsf( correction_id: String, company_code: String, customer_id: String, original_payment_id: String, original_amount: Decimal, currency: String, correction_date: NaiveDate, bank_reference: String, nsf_fee: Decimal, ) -> Self
Creates an NSF (Non-Sufficient Funds) correction.
Sourcepub fn chargeback(
correction_id: String,
company_code: String,
customer_id: String,
original_payment_id: String,
chargeback_amount: Decimal,
currency: String,
correction_date: NaiveDate,
chargeback_code: String,
reason: String,
) -> Self
pub fn chargeback( correction_id: String, company_code: String, customer_id: String, original_payment_id: String, chargeback_amount: Decimal, currency: String, correction_date: NaiveDate, chargeback_code: String, reason: String, ) -> Self
Creates a chargeback correction.
Sourcepub fn with_reversal_je(self, je_id: String) -> Self
pub fn with_reversal_je(self, je_id: String) -> Self
Sets the reversal journal entry.
Sourcepub fn add_affected_invoice(&mut self, invoice_id: String)
pub fn add_affected_invoice(&mut self, invoice_id: String)
Adds an affected invoice.
Trait Implementations§
Source§impl Clone for PaymentCorrection
impl Clone for PaymentCorrection
Source§fn clone(&self) -> PaymentCorrection
fn clone(&self) -> PaymentCorrection
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 PaymentCorrection
impl Debug for PaymentCorrection
Source§impl<'de> Deserialize<'de> for PaymentCorrection
impl<'de> Deserialize<'de> for PaymentCorrection
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 PaymentCorrection
impl RefUnwindSafe for PaymentCorrection
impl Send for PaymentCorrection
impl Sync for PaymentCorrection
impl Unpin for PaymentCorrection
impl UnsafeUnpin for PaymentCorrection
impl UnwindSafe for PaymentCorrection
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.