swift_mt_message/fields/common/summary_field.rs
1use serde::{Deserialize, Serialize};
2use swift_mt_message_macros::SwiftField;
3
4/// Generic Summary Field
5///
6/// Used for summary fields with entry count, currency, and amount.
7#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, SwiftField)]
8pub struct GenericSummaryField {
9 /// Number of entries
10 #[component("5n", validate = ["positive_amount"])]
11 pub entry_count: u32,
12 /// Currency code (ISO 4217)
13 #[component("3!a", validate = ["currency_code"])]
14 pub currency: String,
15 /// Total amount
16 #[component("15d", validate = ["amount_format"])]
17 pub amount: f64,
18}