diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e859c83..1488541 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,12 +13,12 @@ jobs: uses: actions/checkout@v2 - name: Read version number id: read_toml - uses: outcome-co/action-read-toml@v2.0.10 + uses: SebRollen/toml-action@v1.0.0 with: - path: Cargo.toml - key: package.version + file: Cargo.toml + field: package.version - name: Set tag env variable - run: echo IMAGE_TAG=v${{steps.read_toml.outputs.package_version}} >> $GITHUB_ENV + run: echo IMAGE_TAG=v${{steps.read_toml.outputs.value}} >> $GITHUB_ENV - uses: ncipollo/release-action@v1 continue-on-error: true with: diff --git a/Cargo.toml b/Cargo.toml index e26db06..2fb1a63 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "iex" -version = "0.1.1" +version = "0.2.0" authors = ["Sebastian Rollen "] edition = "2018" @@ -9,12 +9,10 @@ edition = "2018" [dependencies] chrono = { version = "0.4", features = ["serde"] } futures = { version = "0.3"} -itertools = "0.10.0" reqwest = { version = "0.11", features = ["json"] } -rust_decimal = { version = "1.11.1", features = ["serde-float"] } +rust_decimal = { version = "1.11", features = ["serde-float"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -serde_repr = "0.1" thiserror = "1.0" tokio = { version = "1.0", default-features = false, features = ["net"], optional = true} tracing = "0.1" @@ -22,5 +20,5 @@ tracing = "0.1" [dev-dependencies] futures-channel = "0.3" mockito = "0.29" -rust_decimal_macros = "1.11.1" +rust_decimal_macros = "1.11" tokio = { version = "1.0", default-features = false, features = ["macros", "rt-multi-thread"] } diff --git a/src/dividends.rs b/src/dividends.rs index 1709731..940e189 100644 --- a/src/dividends.rs +++ b/src/dividends.rs @@ -33,7 +33,8 @@ pub struct Dividend { pub amount: Decimal, pub currency: String, pub description: String, - pub declared_date: NaiveDate, + // This field is sometimes formatted as 0000-00-00, which breaks deserialization. + // pub declared_date: Option, pub ex_date: NaiveDate, pub flag: Flag, pub frequency: String, @@ -69,7 +70,7 @@ mod test { .match_query(Matcher::AllOf(vec![ Matcher::UrlEncoded("token".into(), "TOKEN".into()), ])) - .with_body(r#"[{"amount":0.70919585493507512,"currency":"USD","declaredDate":"2020-10-19","description":"OrdinaryShares","exDate":"2020-10-28","flag":"Cash","frequency":"quarterly","paymentDate":"2020-11-06","recordDate":"2020-10-28","refid":2096218,"symbol":"AAPL","id":"DIVIDENDS","key":"AAPL","subkey":"2053393","date":1612392166191,"updated":1612392166191}]"#) + .with_body(r#"[{"amount":0.22,"currency":"USD","declaredDate":"0000-00-00","description":"Ordinary Shares","exDate":"2021-08-06","flag":"Cash","frequency":"quarterly","paymentDate":"2021-08-12","recordDate":"2021-08-09","refid":2274911,"symbol":"AAPL","id":"DIVIDENDS","key":"AAPL","subkey":"2274911","date":1628208000000,"updated":1627518795000}]"#) .create(); let url = mockito::server_url();