pub struct Field23B {
pub bank_operation_code: String,
}
Expand description
§Field 23B: Bank Operation Code
§Overview
Field 23B specifies the type of operation being performed in the SWIFT MT message. This field is mandatory in most MT messages and determines how the financial institution should process the transaction. The operation code influences routing, processing rules, and regulatory reporting requirements.
§Format Specification
Format: 4!c
- 4!c: Exactly 4 alphabetic characters
- Character set: A-Z (uppercase letters only)
- Case handling: Automatically converted to uppercase
- Validation: Must be exactly 4 characters, all alphabetic
§Standard Operation Codes
The most commonly used operation codes in SWIFT MT messages:
§Primary Codes
- CRED: Credit Transfer - Standard customer credit transfer
- CRTS: Credit Transfer Same Day - Same day credit transfer
- SPAY: Supplementary Payment - Additional payment information
- SSTD: Standing Order - Recurring payment instruction
§Extended Codes (Institution-specific)
- SPRI: Special Priority - High priority processing
- URGP: Urgent Payment - Expedited processing required
- RTGS: Real Time Gross Settlement - RTGS system processing
- NETS: Net Settlement - Net settlement processing
§Usage Context
Field 23B is used in numerous SWIFT MT message types:
- MT103: Single Customer Credit Transfer
- MT202: General Financial Institution Transfer
- MT202COV: Cover for customer credit transfer
- MT205: Financial Institution Transfer for its Own Account
- MT210: Notice to Receive
§Business Applications
- Payment routing: Determines processing path and priority
- STP processing: Enables straight-through processing rules
- Regulatory compliance: Affects reporting and monitoring
- Fee calculation: May influence pricing and charges
- Risk management: Impacts fraud detection and AML screening
- Settlement timing: Affects when funds are made available
§Processing Rules
Different operation codes trigger specific processing behaviors:
§CRED (Credit Transfer)
- Standard processing timeline
- Normal priority in payment queues
- Standard regulatory reporting
- Typical settlement timing
§CRTS (Credit Transfer Same Day)
- Expedited processing required
- Higher priority in payment queues
- Same-day settlement mandate
- Enhanced monitoring and tracking
§SPAY (Supplementary Payment)
- Additional payment details provided
- May require manual review
- Enhanced compliance checking
- Detailed audit trail required
§SSTD (Standing Order)
- Recurring payment processing
- Template-based validation
- Automated scheduling
- Long-term relationship tracking
§Validation Rules
- Length: Must be exactly 4 characters
- Character set: Only alphabetic characters (A-Z)
- Case: Automatically normalized to uppercase
- Standards compliance: Should use recognized codes
- Business rules: Must align with message type and context
§Network Validated Rules (SWIFT Standards)
- Operation code must be exactly 4 alphabetic characters (Error: T26)
- Must contain only valid SWIFT character set (Error: T61)
- Should be a recognized operation code (Warning: recommended practice)
- Must be consistent with message type (Error: T40)
§Examples
:23B:CRED
└─── Standard credit transfer
:23B:CRTS
└─── Same day credit transfer
:23B:SPAY
└─── Supplementary payment
:23B:SSTD
└─── Standing order payment
Fields§
§bank_operation_code: String
Bank operation code (exactly 4 alphabetic characters)
Specifies the type of operation being performed in the SWIFT MT message. This code determines processing rules, routing behavior, and regulatory requirements for the transaction.
Format: Exactly 4 uppercase alphabetic characters Character set: A-Z only Case handling: Automatically converted to uppercase
§Standard Codes
"CRED"
- Credit Transfer (standard processing)"CRTS"
- Credit Transfer Same Day (expedited)"SPAY"
- Supplementary Payment (additional details)"SSTD"
- Standing Order (recurring payment)
§Extended Codes
"SPRI"
- Special Priority (high priority)"URGP"
- Urgent Payment (expedited processing)"RTGS"
- Real Time Gross Settlement"NETS"
- Net Settlement processing
Implementations§
Source§impl Field23B
impl Field23B
Sourcepub fn new(bank_operation_code: String) -> Self
pub fn new(bank_operation_code: String) -> Self
Create a new Field23B with comprehensive validation
Creates a new bank operation code field with the provided code string. The code is automatically normalized to uppercase and validated for format compliance and business rules.
§Arguments
bank_operation_code
- The 4-character operation code
§Examples
use swift_mt_message::fields::Field23B;
// Standard credit transfer
let field = Field23B::new("CRED".to_string());
// Same day credit transfer
let field = Field23B::new("CRTS".to_string());
// Case insensitive (automatically converted to uppercase)
let field = Field23B::new("cred".to_string());
assert_eq!(field.operation_code(), "CRED");
§Validation
The constructor performs format validation and case normalization. Full business rule validation occurs during SWIFT message processing.
Sourcepub fn operation_code(&self) -> &str
pub fn operation_code(&self) -> &str
Sourcepub fn is_standard_code(&self) -> bool
pub fn is_standard_code(&self) -> bool
Check if this is a standard operation code
Determines if the operation code is one of the widely recognized standard codes used in SWIFT MT messages.
§Returns
true
if the code is a standard operation code
§Example
let standard = Field23B::new("CRED".to_string());
assert!(standard.is_standard_code());
let custom = Field23B::new("CUST".to_string());
assert!(!custom.is_standard_code());
Sourcepub fn is_extended_code(&self) -> bool
pub fn is_extended_code(&self) -> bool
Check if this is an extended operation code
Determines if the operation code is one of the extended codes that may be used by specific institutions or regions.
§Returns
true
if the code is an extended operation code
§Example
let extended = Field23B::new("SPRI".to_string());
assert!(extended.is_extended_code());
let standard = Field23B::new("CRED".to_string());
assert!(!standard.is_extended_code());
Sourcepub fn requires_same_day_processing(&self) -> bool
pub fn requires_same_day_processing(&self) -> bool
Check if this operation code requires same-day processing
Determines if the operation code mandates same-day settlement or expedited processing.
§Returns
true
if same-day processing is required
§Example
let same_day = Field23B::new("CRTS".to_string());
assert!(same_day.requires_same_day_processing());
let standard = Field23B::new("CRED".to_string());
assert!(!standard.requires_same_day_processing());
Sourcepub fn allows_field_23e(&self) -> bool
pub fn allows_field_23e(&self) -> bool
Check if this operation code allows Field 23E
Determines if instruction codes (Field 23E) are permitted when using this operation code, based on SWIFT business rules.
§Returns
true
if Field 23E is allowed with this operation code
§Example
let allows_23e = Field23B::new("CRED".to_string());
assert!(allows_23e.allows_field_23e());
let no_23e = Field23B::new("SSTD".to_string());
assert!(!no_23e.allows_field_23e());
Sourcepub fn processing_priority(&self) -> u8
pub fn processing_priority(&self) -> u8
Get the processing priority level
Returns the processing priority associated with this operation code. Higher numbers indicate higher priority.
§Returns
Priority level (1=low, 2=normal, 3=high, 4=urgent)
§Example
let urgent = Field23B::new("URGP".to_string());
assert_eq!(urgent.processing_priority(), 4);
let standard = Field23B::new("CRED".to_string());
assert_eq!(standard.processing_priority(), 2);
Sourcepub fn description(&self) -> &'static str
pub fn description(&self) -> &'static str
Sourcepub fn settlement_timing(&self) -> &'static str
pub fn settlement_timing(&self) -> &'static str
Sourcepub fn is_well_formed(&self) -> bool
pub fn is_well_formed(&self) -> bool
Check if the operation code is well-formed
Performs additional validation beyond basic format checking, ensuring the code follows institutional standards.
§Returns
true
if the operation code is well-formed
§Example
let good_code = Field23B::new("CRED".to_string());
assert!(good_code.is_well_formed());
let poor_code = Field23B::new("XXXX".to_string());
assert!(!poor_code.is_well_formed());