pub struct Message {
pub transaction_ref_no: String,
pub ref_to_related_msg: Option<String>,
pub account_id: String,
pub statement_no: String,
pub sequence_no: Option<String>,
pub opening_balance: Balance,
pub statement_lines: Vec<StatementLine>,
pub closing_balance: Balance,
pub closing_available_balance: Option<AvailableBalance>,
pub forward_available_balance: Option<AvailableBalance>,
pub information_to_account_owner: Option<String>,
}
Expand description
A single, parsed MT940 message.
Many of these might be contained in a bank statement.
For specific field documentation, see here: http://www.sepaforcorporates.com/swift-for-corporates/account-statement-mt940-file-format-overview/
Fields
transaction_ref_no: String
Tag :20:
Tag :21:
account_id: String
Tag :25:
statement_no: String
Tag :28C:
sequence_no: Option<String>
Optional part of tag :28C:
opening_balance: Balance
Tag :60F:
or :60M:
In case this is :60F:
it is the first opening Balance
.
In case of :60M:
this is the intermediate opening balance for statements following the
first one.
statement_lines: Vec<StatementLine>
Tag :61:
and :86:
Any :86:
preceeded by :61:
will provide more information to that :61:
closing_balance: Balance
Tag :62F:
or :62M:
In case this is :62F:
it is the first closing Balance
.
In case of :62M:
this is the intermediate closing balance for statements following the
first one.
closing_available_balance: Option<AvailableBalance>
Tag :64:
forward_available_balance: Option<AvailableBalance>
Tag :65:
information_to_account_owner: Option<String>
Tag :86:
A tag :86:
not preceeded by a tag :61
will provide information for the whole
Message
as opposed to just the StatementLine
.
Implementations
sourceimpl Message
impl Message
sourcepub fn from_fields(fields: Vec<Field>) -> Result<Message, ParseError>
pub fn from_fields(fields: Vec<Field>) -> Result<Message, ParseError>
Construct a new Message
from a list of [Field]
s.
Must start with field :20:
. Must not contain more than one :20:
tag.