swift_mt_message/fields/
field71.rs

1use serde::{Deserialize, Serialize};
2use swift_mt_message_macros::SwiftField;
3
4///   **Field 71: Charges and Fee Information**
5///
6/// ## Purpose
7/// Specifies charge allocation and fee details for payment transactions. This field family
8/// determines which party bears transaction costs and provides detailed charge amounts
9/// for various fees associated with payment processing. Essential for transparent
10/// cost allocation and compliance with payment regulations.
11///
12/// ## Field Options Overview
13/// - **Field 71A**: Details of Charges (charge allocation code)
14/// - **Field 71F**: Sender's Charges (specific charge amounts)
15/// - **Field 71G**: Receiver's Charges (additional charge amounts)
16///
17/// ## Business Context Applications
18/// - **Payment Processing**: Charge allocation in MT 103 and other payment messages
19/// - **Cost Transparency**: Clear identification of transaction costs
20/// - **Regulatory Compliance**: Meeting charge disclosure requirements
21/// - **Customer Communication**: Transparent fee structure communication
22///
23/// ## Charge Allocation Principles
24/// ### Allocation Options (Field 71A)
25/// - **BEN**: Beneficiary bears all charges
26/// - **OUR**: Ordering customer bears all charges
27/// - **SHA**: Shared charges (sender pays own bank, beneficiary pays others)
28///
29/// ### Charge Types
30/// - **Correspondent Charges**: Fees charged by intermediary banks
31/// - **Beneficiary Bank Charges**: Fees charged by receiving bank
32/// - **Service Charges**: Additional service fees
33/// - **Conversion Charges**: Currency conversion fees
34///
35/// ## Regional Considerations
36/// - **European Payments**: SEPA charge regulations and transparency requirements
37/// - **US Payments**: Federal Reserve and commercial bank fee structures
38/// - **Asian Markets**: Local charge allocation practices
39/// - **Cross-Border**: International payment fee coordination
40///
41/// ## Error Prevention Guidelines
42/// - **Code Validation**: Verify charge allocation codes are valid
43/// - **Amount Verification**: Confirm charge amounts are reasonable
44/// - **Currency Consistency**: Ensure charge currency matches context
45/// - **Disclosure Compliance**: Meet regulatory charge disclosure requirements
46///
47/// ## Related Fields Integration
48/// - **Field 32A**: Value Date, Currency, Amount (transaction amount context)
49/// - **Field 33B**: Currency/Instructed Amount (original amount before charges)
50/// - **Field 72**: Sender to Receiver Information (charge instructions)
51/// - **Field 64**: Closing Available Balance (net amount after charges)
52///
53/// ## Compliance Framework
54/// - **Regulatory Requirements**: Charge transparency and disclosure regulations
55/// - **Consumer Protection**: Clear charge communication requirements
56/// - **Fee Regulation**: Compliance with local fee regulation standards
57/// - **Audit Documentation**: Complete charge allocation documentation
58///
59/// ## See Also
60/// - Swift FIN User Handbook: Charge Field Specifications
61/// - Payment Regulations: Charge Transparency Requirements
62/// - Banking Fee Standards: International Charge Allocation
63/// - Customer Protection: Charge Disclosure Guidelines
64///
65///   **Field 71A: Details of Charges**
66///
67/// Specifies which party will bear the charges for the transaction.
68/// Mandatory field in payment messages for charge allocation transparency.
69#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, SwiftField)]
70pub struct Field71A {
71    /// Charge allocation code
72    ///
73    /// Format: 3!a - Three alphabetic characters
74    /// Values: BEN (Beneficiary), OUR (Ordering customer), SHA (Shared)
75    /// Error T08 if invalid code used
76    #[component("3!a")]
77    pub code: String,
78}
79
80///   **Field 71F: Sender's Charges**
81///
82/// Specifies the currency and amount of charges to be borne by the sender.
83/// Used to detail specific charge amounts in sender's currency.
84#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, SwiftField)]
85pub struct Field71F {
86    /// Currency of sender's charges
87    ///
88    /// Format: 3!a - ISO 4217 currency code (USD, EUR, GBP, etc.)
89    /// Must be valid currency for charge specification
90    #[component("3!a")]
91    pub currency: String,
92
93    /// Amount of sender's charges
94    ///
95    /// Format: 15d - Decimal amount with comma separator
96    /// Precision must match currency requirements
97    #[component("15d")]
98    pub amount: f64,
99}
100
101///   **Field 71G: Receiver's Charges**
102///
103/// Specifies the currency and amount of charges to be borne by the receiver.
104/// Used to detail specific charge amounts in receiver's currency.
105#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, SwiftField)]
106pub struct Field71G {
107    /// Currency of receiver's charges
108    ///
109    /// Format: 3!a - ISO 4217 currency code (USD, EUR, GBP, etc.)
110    /// Must be valid currency for charge specification
111    #[component("3!a")]
112    pub currency: String,
113
114    /// Amount of receiver's charges
115    ///
116    /// Format: 15d - Decimal amount with comma separator
117    /// Represents additional charges for receiver
118    #[component("15d")]
119    pub amount: f64,
120}
121
122///   **Field 71B: Details of Charges**
123///
124/// Specifies detailed information about charges, interest and other adjustments.
125/// Used in MT n90 messages (MT190, MT290, etc.) to provide comprehensive charge details.
126#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, SwiftField)]
127pub struct Field71B {
128    /// Details of charges
129    ///
130    /// Format: 6*35x - Up to 6 lines of 35 characters each
131    /// Contains detailed breakdown of charges, interest and other adjustments
132    #[component("6*35x")]
133    pub details: Vec<String>,
134}