use serde::{Deserialize, Serialize};

/// Trace number information for tracking eligibility check transactions.
///
/// Trace numbers help identify and track eligibility check requests and responses
/// between the provider, Stedi, and the payer. Both Stedi and payers can assign
/// trace numbers for transaction tracking purposes.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SubscriberTraceNumber {
    /// The identifier of the organization that assigned the trace number.
    #[serde(
        rename = "originatingCompanyIdentifier",
        skip_serializing_if = "Option::is_none"
    )]
    pub originating_company_identifier: Option<String>,
    /// The unique trace number assigned to the transaction.
    #[serde(
        rename = "referenceIdentification",
        skip_serializing_if = "Option::is_none"
    )]
    pub reference_identification: Option<String>,
    /// Identifies a subdivision within the organization that assigned the trace number.
    #[serde(
        rename = "secondaryReferenceIdentification",
        skip_serializing_if = "Option::is_none"
    )]
    pub secondary_reference_identification: Option<String>,
    /// The full name of the `traceTypeCode`. For example `Current Transaction Trace Numbers`.
    #[serde(rename = "traceType", skip_serializing_if = "Option::is_none")]
    pub trace_type: Option<String>,
    /// The code that identifies the type of trace number. Can be `1` - Current Transaction Trace Numbers (refers to trace numbers assigned by the payer) or `2` - Referenced Trace Numbers (refers to numbers sent in the original eligibility check request).
    #[serde(rename = "traceTypeCode", skip_serializing_if = "Option::is_none")]
    pub trace_type_code: Option<String>,
}

impl SubscriberTraceNumber {
    /// Create a new empty SubscriberTraceNumber instance.
    pub fn new() -> SubscriberTraceNumber {
        SubscriberTraceNumber {
            originating_company_identifier: None,
            reference_identification: None,
            secondary_reference_identification: None,
            trace_type: None,
            trace_type_code: None,
        }
    }
}
