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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more