pub struct DunningLetter {Show 22 fields
pub letter_id: String,
pub dunning_run_id: String,
pub company_code: String,
pub customer_id: String,
pub customer_name: String,
pub dunning_level: u8,
pub dunning_date: NaiveDate,
pub dunning_items: Vec<DunningItem>,
pub total_dunned_amount: Decimal,
pub dunning_charges: Decimal,
pub interest_amount: Decimal,
pub total_amount_due: Decimal,
pub currency: String,
pub payment_deadline: NaiveDate,
pub is_sent: bool,
pub sent_date: Option<NaiveDate>,
pub response_type: Option<DunningResponseType>,
pub response_date: Option<NaiveDate>,
pub status: DunningLetterStatus,
pub contact_address: Option<String>,
pub notes: Option<String>,
pub created_at: DateTime<Utc>,
}Expand description
A dunning letter sent to a customer.
Fields§
§letter_id: StringUnique letter identifier.
dunning_run_id: StringReference to the dunning run.
company_code: StringCompany code.
customer_id: StringCustomer ID.
customer_name: StringCustomer name.
dunning_level: u8Dunning level (1-4).
dunning_date: NaiveDateDate of the dunning letter.
dunning_items: Vec<DunningItem>Items included in this letter.
total_dunned_amount: DecimalTotal amount being dunned.
dunning_charges: DecimalDunning charges applied.
interest_amount: DecimalInterest amount calculated.
total_amount_due: DecimalTotal amount due (principal + charges + interest).
currency: StringCurrency.
payment_deadline: NaiveDatePayment deadline.
is_sent: boolWhether the letter has been sent.
sent_date: Option<NaiveDate>Date sent.
response_type: Option<DunningResponseType>Response received from customer.
response_date: Option<NaiveDate>Response date.
status: DunningLetterStatusStatus of the letter.
contact_address: Option<String>Customer contact address.
notes: Option<String>Notes.
created_at: DateTime<Utc>Created timestamp.
Implementations§
Source§impl DunningLetter
impl DunningLetter
Sourcepub fn new(
letter_id: String,
dunning_run_id: String,
company_code: String,
customer_id: String,
customer_name: String,
dunning_level: u8,
dunning_date: NaiveDate,
payment_deadline: NaiveDate,
currency: String,
) -> Self
pub fn new( letter_id: String, dunning_run_id: String, company_code: String, customer_id: String, customer_name: String, dunning_level: u8, dunning_date: NaiveDate, payment_deadline: NaiveDate, currency: String, ) -> Self
Creates a new dunning letter.
Sourcepub fn add_item(&mut self, item: DunningItem)
pub fn add_item(&mut self, item: DunningItem)
Adds a dunning item to the letter.
Sourcepub fn set_charges(&mut self, charges: Decimal)
pub fn set_charges(&mut self, charges: Decimal)
Sets dunning charges.
Sourcepub fn set_interest(&mut self, interest: Decimal)
pub fn set_interest(&mut self, interest: Decimal)
Sets interest amount.
Sourcepub fn record_response(
&mut self,
response: DunningResponseType,
response_date: NaiveDate,
)
pub fn record_response( &mut self, response: DunningResponseType, response_date: NaiveDate, )
Records customer response.
Sourcepub fn escalate_to_collection(&mut self)
pub fn escalate_to_collection(&mut self)
Marks as escalated to collection.
Trait Implementations§
Source§impl Clone for DunningLetter
impl Clone for DunningLetter
Source§fn clone(&self) -> DunningLetter
fn clone(&self) -> DunningLetter
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DunningLetter
impl Debug for DunningLetter
Source§impl<'de> Deserialize<'de> for DunningLetter
impl<'de> Deserialize<'de> for DunningLetter
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for DunningLetter
impl RefUnwindSafe for DunningLetter
impl Send for DunningLetter
impl Sync for DunningLetter
impl Unpin for DunningLetter
impl UnsafeUnpin for DunningLetter
impl UnwindSafe for DunningLetter
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
Mutably borrows from an owned value. Read more