diff --git a/src/variant.rs b/src/variant.rs index 03f3dc5..82a3400 100644 --- a/src/variant.rs +++ b/src/variant.rs @@ -43,6 +43,8 @@ pub struct Variant { pub min: Option, /// Days until expiry pub expiry: Option, + /// Associated barcodes + pub barcodes: Option> } impl Variant { @@ -69,6 +71,9 @@ impl Variant { .unwrap() .get("expiry") .map(|x| x.as_i64().unwrap()), + barcodes: json.as_mapping().unwrap().get("barcodes").map(|x| { + x.as_sequence().unwrap().into_iter().map(|x| x.as_i64().unwrap()).collect() + }) } } @@ -294,7 +299,8 @@ impl Variant { "variant": self.variant, "name": self.name, "min": self.min, - "expiry": self.expiry + "expiry": self.expiry, + "barcodes": self.barcodes }) } }