Skip to main content

DunningLetter

Struct DunningLetter 

Source
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: String

Unique letter identifier.

§dunning_run_id: String

Reference to the dunning run.

§company_code: String

Company code.

§customer_id: String

Customer ID.

§customer_name: String

Customer name.

§dunning_level: u8

Dunning level (1-4).

§dunning_date: NaiveDate

Date of the dunning letter.

§dunning_items: Vec<DunningItem>

Items included in this letter.

§total_dunned_amount: Decimal

Total amount being dunned.

§dunning_charges: Decimal

Dunning charges applied.

§interest_amount: Decimal

Interest amount calculated.

§total_amount_due: Decimal

Total amount due (principal + charges + interest).

§currency: String

Currency.

§payment_deadline: NaiveDate

Payment deadline.

§is_sent: bool

Whether 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: DunningLetterStatus

Status of the letter.

§contact_address: Option<String>

Customer contact address.

§notes: Option<String>

Notes.

§created_at: DateTime<Utc>

Created timestamp.

Implementations§

Source§

impl DunningLetter

Source

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.

Source

pub fn add_item(&mut self, item: DunningItem)

Adds a dunning item to the letter.

Source

pub fn set_charges(&mut self, charges: Decimal)

Sets dunning charges.

Source

pub fn set_interest(&mut self, interest: Decimal)

Sets interest amount.

Source

pub fn mark_sent(&mut self, sent_date: NaiveDate)

Marks the letter as sent.

Source

pub fn record_response( &mut self, response: DunningResponseType, response_date: NaiveDate, )

Records customer response.

Source

pub fn escalate_to_collection(&mut self)

Marks as escalated to collection.

Trait Implementations§

Source§

impl Clone for DunningLetter

Source§

fn clone(&self) -> DunningLetter

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for DunningLetter

Source§

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

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

impl<'de> Deserialize<'de> for DunningLetter

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 DunningLetter

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

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