swift_mt_message/fields/
field65.rs

1use chrono::NaiveDate;
2use serde::{Deserialize, Serialize};
3use swift_mt_message_macros::SwiftField;
4
5///   **Field 65: Forward Available Balance**
6///
7/// ## Purpose
8/// Specifies the forward available balance of an account, representing the funds that will
9/// be available on a future value date. This field provides forward-looking liquidity
10/// information, accounting for future-dated transactions, maturity dates, and scheduled
11/// fund movements that will affect account availability.
12///
13/// ## Business Context Applications
14/// - **Cash Forecasting**: Future fund availability for planning
15/// - **Liquidity Management**: Forward liquidity position assessment
16/// - **Treasury Operations**: Future cash position planning
17/// - **Credit Facilities**: Future available credit assessments
18///
19/// ## Network Validation Requirements
20/// - **Date Validation**: Value date must be valid future calendar date
21/// - **Currency Validation**: Must be valid ISO 4217 currency code
22/// - **Amount Format**: Decimal amount with proper precision
23/// - **Mark Validation**: Debit/Credit mark must be D (Debit) or C (Credit)
24/// - **Future Date Logic**: Value date should be in the future relative to statement date
25///
26/// ## Forward Balance Calculation
27/// ### Calculation Components
28/// ```logic
29/// Forward Available = Current Available + Scheduled Credits - Scheduled Debits - Future Holds
30/// ```
31///
32/// ### Forward Factors
33/// - **Scheduled Transactions**: Future-dated transactions affecting availability
34/// - **Maturity Events**: Investment maturities and loan repayments
35/// - **Standing Orders**: Recurring payment obligations
36/// - **Credit Facilities**: Available credit that may be utilized
37/// - **Float Projections**: Expected clearing and settlement timing
38///
39/// ## Time Horizon Considerations
40/// - **Short-term Forward**: 1-7 days forward availability
41/// - **Medium-term Forward**: 1-4 weeks forward availability
42/// - **Long-term Forward**: Monthly or quarterly forward projections
43/// - **Scenario Analysis**: Multiple forward balance scenarios
44///
45/// ## Regional Considerations
46/// - **European Banking**: Euro area liquidity forecasting requirements
47/// - **US Banking**: Federal Reserve and commercial bank forward planning
48/// - **Asian Markets**: Local market forward liquidity requirements
49/// - **Cross-Border**: Multi-currency forward balance coordination
50///
51/// ## Error Prevention Guidelines
52/// - **Date Logic**: Verify forward date is logical and within reasonable range
53/// - **Calculation Verification**: Confirm forward balance calculation methodology
54/// - **Currency Consistency**: Ensure currency matches account and related balances
55/// - **Scenario Validation**: Verify forward projections are realistic
56///
57/// ## Related Fields Integration
58/// - **Field 64**: Closing Available Balance (current availability baseline)
59/// - **Field 62**: Closing Balance (book balance context)
60/// - **Field 61**: Statement Line (transactions affecting forward balance)
61/// - **Field 60**: Opening Balance (period context)
62///
63/// ## Compliance Framework
64/// - **Regulatory Reporting**: Forward liquidity reporting requirements
65/// - **Risk Management**: Forward liquidity risk assessment
66/// - **Basel Requirements**: Liquidity coverage ratio and forward planning
67/// - **Audit Documentation**: Forward balance calculation methodology
68///
69/// ## Treasury Management Applications
70/// - **Cash Flow Forecasting**: Input for cash flow projections
71/// - **Investment Planning**: Available funds for future investments
72/// - **Debt Management**: Future capacity for debt service
73/// - **Working Capital**: Forward working capital availability
74///
75/// ## See Also
76/// - Swift FIN User Handbook: Forward Available Balance Specifications
77/// - Treasury Management: Forward Liquidity Planning
78/// - Cash Flow Forecasting: Forward Balance Projections
79/// - Basel Liquidity Standards: Forward Liquidity Requirements
80///
81///   **Field 65: Forward Available Balance Structure**
82///
83/// Contains the forward available balance with debit/credit indication, future value date,
84/// currency, and amount representing funds that will be available.
85#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, SwiftField)]
86pub struct Field65 {
87    /// Debit or Credit mark
88    ///
89    /// Format: 1!a - 'D' (Debit) or 'C' (Credit)
90    /// Indicates whether the forward available balance will be a debit or credit position
91    #[component("1!a")]
92    pub debit_credit_mark: String,
93
94    /// Future value date of the available balance
95    ///
96    /// Format: 6!n (YYMMDD) - Future date when balance will be effective
97    /// Should be later than current statement date
98    #[component("6!n")]
99    pub value_date: NaiveDate,
100
101    /// Currency of the forward available balance
102    ///
103    /// Format: 3!a - ISO 4217 currency code (USD, EUR, GBP, etc.)
104    /// Must match account currency for consistency
105    #[component("3!a")]
106    pub currency: String,
107
108    /// Forward available balance amount
109    ///
110    /// Format: 15d - Decimal amount with comma separator
111    /// Projected funds that will be available on the future value date
112    #[component("15d")]
113    pub amount: f64,
114}