Skip to content

Commit

Permalink
Include extra fields in Event
Browse files Browse the repository at this point in the history
  • Loading branch information
DanNixon committed Apr 23, 2024
1 parent c4ccb3e commit d5a403f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ clap = { version = "~4.4.0", features = ["derive", "env"] }
emfcamp-schedule-api = { path = "./client/" }
reqwest = { version = "0.11.27", default-features = false, features = ["json", "rustls-tls"] }
serde = { version = "1.0.198", features = ["derive"] }
serde_json = "1.0.116"
serde_with = "3.7.0"
tokio = { version = "1.37.0", features = ["rt-multi-thread", "macros"] }
tracing = "0.1.40"
Expand Down
1 change: 1 addition & 0 deletions client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ edition.workspace = true
chrono.workspace = true
reqwest.workspace = true
serde.workspace = true
serde_json.workspace = true
serde_with.workspace = true
url.workspace = true
8 changes: 6 additions & 2 deletions client/src/schedule/event/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ mod timestamp;

use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
use serde_json::Value;
use serde_with::{serde_as, NoneAsEmptyString};
use std::cmp::Ordering;
use std::{cmp::Ordering, collections::HashMap};
use url::Url;

pub use self::kind::{Kind, Workshop};
Expand Down Expand Up @@ -44,7 +45,9 @@ pub struct Event {
pub is_family_friendly: Option<bool>,

pub link: Url,
// TODO: other fields

#[serde(flatten)]
pub extra: HashMap<String, Value>,
}

impl Event {
Expand All @@ -69,6 +72,7 @@ impl Event {
may_record: None,
is_family_friendly: None,
link: Url::parse("http://example.com").unwrap(),
extra: Default::default(),
}
}

Expand Down

0 comments on commit d5a403f

Please sign in to comment.