Skip to content

Commit

Permalink
twiq: Fix events to use domain::event::EventType
Browse files Browse the repository at this point in the history
  • Loading branch information
bouzuya committed Sep 23, 2022
1 parent 28653e2 commit 4ab11a4
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
Expand Up @@ -38,7 +38,7 @@ impl From<UserCreated> for RawEvent {
fn from(event: UserCreated) -> Self {
RawEvent::new(
EventId::from_str(event.id.as_str()).expect("id"),
EventType::from_str("user_created").expect("event_type"),
EventType::from(crate::event::EventType::UserCreated),
EventStreamId::from_str(event.stream_id.as_str()).expect("stream_id"),
EventStreamSeq::from(event.stream_seq),
EventData::try_from(serde_json::to_string(&event).expect("event")).expect("data"),
Expand Down
Expand Up @@ -53,7 +53,7 @@ impl From<UserRequested> for RawEvent {
fn from(event: UserRequested) -> Self {
RawEvent::new(
EventId::from_str(event.id.as_str()).expect("id"),
EventType::from_str("user_requested").expect("event_type"),
EventType::from(crate::event::EventType::UserRequested),
EventStreamId::from_str(event.stream_id.as_str()).expect("stream_id"),
EventStreamSeq::from(event.stream_seq),
EventData::try_from(serde_json::to_string(&event).expect("event")).expect("data"),
Expand Down
Expand Up @@ -44,7 +44,7 @@ impl From<UserUpdated> for RawEvent {
fn from(event: UserUpdated) -> Self {
RawEvent::new(
EventId::from_str(event.id.as_str()).expect("id"),
EventType::from_str("user_updated").expect("event_type"),
EventType::from(crate::event::EventType::UserUpdated),
EventStreamId::from_str(event.stream_id.as_str()).expect("stream_id"),
EventStreamSeq::from(event.stream_seq),
EventData::try_from(serde_json::to_string(&event).expect("event")).expect("data"),
Expand Down
Expand Up @@ -49,7 +49,7 @@ impl From<UserRequestCreated> for RawEvent {
fn from(event: UserRequestCreated) -> Self {
RawEvent::new(
EventId::from_str(event.id.as_str()).expect("id"),
EventType::from_str("user_request_created").expect("event_type"),
EventType::from(crate::event::EventType::UserRequestCreated),
EventStreamId::from_str(event.stream_id.as_str()).expect("stream_id"),
EventStreamSeq::from(event.stream_seq),
EventData::try_from(serde_json::to_string(&event).expect("event")).expect("data"),
Expand Down
Expand Up @@ -62,7 +62,7 @@ impl From<UserRequestFinished> for RawEvent {
fn from(event: UserRequestFinished) -> Self {
RawEvent::new(
EventId::from_str(event.id.as_str()).expect("id"),
EventType::from_str("user_request_finished").expect("event_type"),
EventType::from(crate::event::EventType::UserRequestFinished),
EventStreamId::from_str(event.stream_id.as_str()).expect("stream_id"),
EventStreamSeq::from(event.stream_seq),
EventData::try_from(serde_json::to_string(&event).expect("event")).expect("data"),
Expand Down
Expand Up @@ -35,7 +35,7 @@ impl From<UserRequestStarted> for RawEvent {
fn from(event: UserRequestStarted) -> Self {
RawEvent::new(
EventId::from_str(event.id.as_str()).expect("id"),
EventType::from_str("user_request_started").expect("event_type"),
EventType::from(crate::event::EventType::UserRequestStarted),
EventStreamId::from_str(event.stream_id.as_str()).expect("stream_id"),
EventStreamSeq::from(event.stream_seq),
EventData::try_from(serde_json::to_string(&event).expect("event")).expect("data"),
Expand Down

0 comments on commit 4ab11a4

Please sign in to comment.