swift_mt_message/messages/mt291.rs
1use crate::fields::*;
2use serde::{Deserialize, Serialize};
3use swift_mt_message_macros::{SwiftMessage, serde_swift_fields};
4
5/// MT291: Request for Payment of Charges, Interest and Other Expenses Cancellation
6///
7/// ## Purpose
8/// Used to cancel or withdraw a previously sent MT191 request for payment of charges.
9/// This message notifies the receiving institution that a previous expense claim should be
10/// disregarded, ensuring proper handling of erroneous or superseded charge requests.
11///
12/// ## Scope
13/// This message is:
14/// - Sent between financial institutions to cancel expense reimbursement requests
15/// - Used to withdraw previously claimed charges, interest, or expenses
16/// - Applied when errors are discovered or claims need withdrawal
17/// - Essential for maintaining accurate inter-bank expense records
18/// - Part of the error correction and expense management process
19///
20/// ## Key Features
21/// - **Cancellation Notification**: Official cancellation of previous MT191 request
22/// - **Reference Linking**: Clear reference to the original MT191 being cancelled
23/// - **Amount Details**: Complete information about the claim being withdrawn
24/// - **Institution Identification**: Clear identification of parties involved
25/// - **Charge Details**: Explanation of the cancellation reason
26/// - **Audit Trail**: Maintains complete documentation of requests and cancellations
27///
28/// ## Common Use Cases
29/// - Cancelling erroneously submitted expense claims
30/// - Withdrawing duplicate charge requests
31/// - Correcting miscalculated interest claims
32/// - Cancelling provisional expense requests
33/// - Withdrawing charges due to billing errors
34/// - Correcting service fee claims
35/// - Cancelling requests due to system errors
36/// - Withdrawing claims per bilateral agreement changes
37///
38/// ## Message Structure
39/// - **Field 20**: Transaction Reference Number (mandatory) - Unique reference for this cancellation
40/// - **Field 21**: Related Reference (mandatory) - Reference to original MT191 being cancelled
41/// - **Field 32B**: Currency Code, Amount (mandatory) - Original requested amount
42/// - **Field 52a**: Ordering Institution (optional) - Institution initiating cancellation (A or D)
43/// - **Field 57a**: Account With Institution (optional) - Settlement account details (A, B, or D)
44/// - **Field 71B**: Details of Charges (mandatory) - Explanation of cancellation/withdrawal
45/// - **Field 72**: Sender to Receiver Information (optional) - Additional cancellation details
46///
47/// ## Network Validation Rules
48/// - **Reference Matching**: Field 21 must reference a valid MT191 transaction
49/// - **Amount Consistency**: Amount should match the original MT191 request
50/// - **Institution Validation**: Institutions must match the original MT191
51/// - **Cancellation Details**: Field 71B must explain the cancellation reason
52/// - **Timing Rules**: Cancellation typically before payment processing
53///
54/// ## Processing Context
55/// ### Cancellation Processing Workflow
56/// 1. Error or withdrawal requirement identified
57/// 2. Original MT191 request marked for cancellation
58/// 3. MT291 sent to advise cancellation
59/// 4. Receiving institution cancels pending claim
60/// 5. Reconciliation updated accordingly
61///
62/// ### Claim Management
63/// - Automatic claim withdrawal
64/// - Audit trail maintenance
65/// - Expense tracking updates
66/// - Billing system adjustments
67///
68/// ## SRG2025 Status
69/// - **No Structural Changes**: MT291 format remains stable
70/// - **Enhanced Processing**: Improved cancellation workflow support
71/// - **Validation Updates**: Stricter reference matching validation
72/// - **Real-time Capability**: Support for immediate cancellation notifications
73///
74/// ## Integration Considerations
75/// - **Expense Systems**: Integrated with expense management platforms
76/// - **Audit Systems**: Complete audit trail for compliance
77/// - **Reconciliation**: Automatic expense reconciliation adjustment
78/// - **Reporting**: Reflected in inter-bank expense reports
79///
80/// ## Relationship to Other Messages
81/// - **Cancels**: MT191 request messages
82/// - **May trigger**: New MT191 with corrected information
83/// - **Related to**: MT292 for payment request cancellation
84/// - **Supports**: Error correction and expense management processes
85///
86/// ## Best Practices
87/// - Send MT291 promptly upon discovering errors
88/// - Provide clear cancellation reasons in Field 71B
89/// - Ensure amount and institution details match original MT191
90/// - Consider sending corrected MT191 if claim still valid
91/// - Maintain complete audit trail of requests and cancellations
92/// - Notify affected departments of claim withdrawal
93
94#[serde_swift_fields]
95#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, SwiftMessage)]
96pub struct MT291 {
97 #[field("20")]
98 pub field_20: Field20,
99
100 #[field("21")]
101 pub field_21: Field21NoOption,
102
103 #[field("32B")]
104 pub field_32b: Field32B,
105
106 #[field("52")]
107 pub field_52: Option<Field52OrderingInstitution>,
108
109 #[field("57")]
110 pub field_57: Option<Field57AccountWithInstitution>,
111
112 #[field("71B")]
113 pub field_71b: Field71B,
114
115 #[field("72")]
116 pub field_72: Option<Field72>,
117}