versa 1.9.0

Versa types and utilities for developing Versa client applications in Rust
Documentation
#[test]
fn test_currency_enums() {
  // Test that both versions have currency enums
  let v1_usd = versa::schema::v1_11_0::receipt::Currency::Usd;
  let v2_usd = versa::schema::v2_0_0::receipt::Currency::Usd;

  // They serialize to uppercase
  let v1_json = serde_json::to_value(&v1_usd).unwrap();
  let v2_json = serde_json::to_value(&v2_usd).unwrap();

  // Both should serialize to lowercase (based on test failure)
  assert_eq!(v1_json.as_str().unwrap(), "usd");
  assert_eq!(v2_json.as_str().unwrap(), "usd");
}

#[test]
fn test_schema_version_type() {
  use std::str::FromStr;

  // v1.11.0 uses a newtype
  let v1_version = versa::schema::v1_11_0::receipt::SchemaVersion::from_str("1.11.0").unwrap();
  assert_eq!(&*v1_version, "1.11.0");

  let v2_version_result = versa::schema::v2_0_0::receipt::SchemaVersion::from_str("2.0.0");
  if let Ok(v2_version) = v2_version_result {
    assert_eq!(&*v2_version, "2.0.0");
  } else {
    // If strict validation fails, the type might accept different patterns
    println!("v2 SchemaVersion has strict semver validation");
  }
}

#[test]
fn test_person_type_exists() {
  // v2.0.0 has Person type
  let person = versa::schema::v2_0_0::receipt::Person {
    first_name: Some("Test".to_string()),
    last_name: None,
    preferred_first_name: None,
    email: None,
    phone: None,
    metadata: Some(vec![]),
  };

  assert_eq!(person.first_name, Some("Test".to_string()));
}

#[test]
fn test_metadatum_structure() {
  // Both versions should have Metadatum
  let v1_meta = versa::schema::v1_11_0::receipt::Metadatum {
    key: "test_key".to_string(),
    value: "test_value".to_string(),
  };

  let v2_meta = versa::schema::v2_0_0::receipt::Metadatum {
    key: "test_key".to_string(),
    value: "test_value".to_string(),
  };

  assert_eq!(v1_meta.key, "test_key");
  assert_eq!(v2_meta.key, "test_key");
}