swift_mt_message/messages/
mt910.rs

1use crate::fields::*;
2use serde::{Deserialize, Serialize};
3use swift_mt_message_macros::{SwiftMessage, serde_swift_fields};
4
5/// MT910: Confirmation of Credit
6///
7/// ## Purpose
8/// Used to confirm that a credit entry has been posted to an account. This message serves
9/// as notification to the account holder that their account has been credited with the
10/// specified amount and provides complete details of the transaction.
11///
12/// ## Scope
13/// This message is:
14/// - Sent by the account servicing institution to the account holder
15/// - Used to confirm that a credit has been processed and posted
16/// - Applied to various types of credits including incoming transfers, deposits, and reversals
17/// - Essential for account reconciliation and cash management
18/// - Part of real-time liquidity monitoring and cash flow management
19///
20/// ## Key Features
21/// - **Credit Confirmation**: Official confirmation that account has been credited
22/// - **Transaction Details**: Complete information about the credit transaction
23/// - **Originator Information**: Details about who initiated the credit (field 50 or 52)
24/// - **Timing Information**: Optional date/time indication for processing details
25/// - **Reference Tracking**: Links to original payment instructions or related transactions
26/// - **Intermediary Details**: Optional information about intermediary institutions
27///
28/// ## Common Use Cases
29/// - Confirming incoming payment transfers to customer accounts
30/// - Notifying of investment proceeds and settlements
31/// - Confirming foreign exchange transaction proceeds
32/// - Trade settlement credit confirmations
33/// - Interest credit confirmations
34/// - Reversal and correction credit confirmations
35/// - Deposit and funding confirmations
36/// - Loan disbursement confirmations
37///
38/// ## Field Structure
39/// - **20**: Transaction Reference (mandatory) - Unique reference for this confirmation
40/// - **21**: Related Reference (mandatory) - Reference to original transaction/instruction
41/// - **25**: Account Identification (mandatory) - Account that has been credited
42/// - **13D**: Date/Time Indication (optional) - Processing timing details
43/// - **32A**: Value Date/Currency/Amount (mandatory) - Credit details
44/// - **50**: Ordering Customer (optional) - Customer who initiated the credit
45/// - **52**: Ordering Institution (optional) - Institution that initiated the credit
46/// - **56**: Intermediary Institution (optional) - Intermediary in the payment chain
47/// - **72**: Sender to Receiver Information (optional) - Additional transaction details
48///
49/// ## Network Validation Rules
50/// - **C1 Rule**: Either field 50 (Ordering Customer) or field 52 (Ordering Institution) must be present, but not both
51/// - **Reference Format**: Transaction references must follow SWIFT formatting standards
52/// - **Amount Validation**: Credit amounts must be positive
53/// - **Account Validation**: Account identification must be valid and properly formatted
54/// - **Date Validation**: Date/time indications must be valid when present
55/// - **Currency Validation**: Currency codes must be valid ISO 4217 codes
56///
57/// ## Processing Context
58/// ### Credit Processing Workflow
59/// 1. Incoming payment received (e.g., MT103, MT202, wire transfer)
60/// 2. Account credited by servicing institution
61/// 3. MT910 sent to confirm credit execution
62/// 4. Account holder updates records and cash position
63///
64/// ### Cash Management Integration
65/// - Real-time balance updates
66/// - Liquidity position management
67/// - Cash flow forecasting support
68/// - Working capital optimization
69///
70/// ## Originator Identification
71/// The message must identify the originator through either:
72/// - **Field 50**: When the credit originates from a customer
73/// - **Field 52**: When the credit originates from a financial institution
74///
75/// This distinction is important for:
76/// - Compliance and regulatory reporting
77/// - Know Your Customer (KYC) requirements
78/// - Anti-money laundering (AML) monitoring
79/// - Transaction categorization and analysis
80///
81/// ## SRG2025 Status
82/// - **No Structural Changes**: MT910 format remains unchanged in SRG2025
83/// - **Enhanced Validation**: Additional validation rules for improved transaction integrity
84/// - **Digital Banking Integration**: Better support for digital banking platforms
85/// - **Real-time Processing**: Enhanced capabilities for instant payment confirmations
86///
87/// ## Integration Considerations
88/// - **Banking Systems**: Direct integration with core banking and account management systems
89/// - **Treasury Systems**: Essential input for treasury and cash management platforms
90/// - **ERP Integration**: Critical for enterprise resource planning and financial reporting
91/// - **Reconciliation**: Automated matching with expected receipts and cash flow forecasts
92///
93/// ## Relationship to Other Messages
94/// - **Responds to**: MT103, MT202, MT205 and other payment instructions
95/// - **Complements**: MT900 (Confirmation of Debit) for complete transaction visibility
96/// - **Supports**: Cash management, liquidity monitoring, and reconciliation processes
97/// - **Integrates with**: Statement messages (MT940, MT950) for comprehensive account reporting
98
99#[serde_swift_fields]
100#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, SwiftMessage)]
101#[validation_rules(MT910_VALIDATION_RULES)]
102pub struct MT910 {
103    #[field("20")]
104    pub field_20: Field20,
105
106    #[field("21")]
107    pub field_21: Field21NoOption,
108
109    #[field("25")]
110    pub field_25: Field25AccountIdentification,
111
112    #[field("13D")]
113    pub field_13d: Option<Field13D>,
114
115    #[field("32A")]
116    pub field_32a: Field32A,
117
118    #[field("50")]
119    pub field_50: Option<Field50OrderingCustomerAFK>,
120
121    #[field("52")]
122    pub field_52: Option<Field52OrderingInstitution>,
123
124    #[field("56")]
125    pub field_56: Option<Field56Intermediary>,
126
127    #[field("72")]
128    pub field_72: Option<Field72>,
129}
130
131/// Validation rules for MT910 - Confirmation of Credit
132const MT910_VALIDATION_RULES: &str = r#"{
133  "rules": [
134    {
135      "id": "C1",
136      "description": "Either field 50a or field 52a must be present",
137      "condition": {
138        "or": [
139          {"exists": ["fields", "50"]},
140          {"exists": ["fields", "52"]}
141        ]
142      }
143    }
144  ]
145}"#;