use monk_sdk::{Event, MonkError};

#[test]
fn event_builder_requires_event_name() {
    let err = Event::builder()
        .customer_id("cust_123")
        .build()
        .expect_err("missing event_name must return an error");

    match err {
        MonkError::Validation(msg) => assert!(msg.contains("eventName is required")),
        other => panic!("unexpected error variant: {other}"),
    }
}

#[test]
fn event_builder_builds_event_successfully() {
    let event = Event::builder()
        .customer_id("cust_123")
        .event_name("api_call")
        .property("tokens", 42)
        .build()
        .expect("valid event should build");

    assert_eq!(event.event_name, "api_call");
    assert_eq!(event.customer_id.as_deref(), Some("cust_123"));
    assert!(event.idempotency_key.is_none());
}
