private async Task RelayGlobalSummaryAsync(RawCovidReport report) { var sumRespose = await _covidClient.RegisterReportSummaryAsync(new CovidGlobalReport { Date = DateTime.UtcNow.ToProtoDateTime(), NewConfirmed = report.Global.NewConfirmed, TotalConfirmed = report.Global.TotalConfirmed, NewDeaths = report.Global.NewDeaths, TotalDeaths = report.Global.TotalDeaths, NewRecovered = report.Global.NewRecovered, TotalRecovered = report.Global.TotalRecovered, }); if (!string.IsNullOrWhiteSpace(sumRespose.ServerToken)) { this._logger.LogInformation("Successfully registered the Global summary payload"); } }
private async Task RelayCountryUpdatesAsync(RawCovidReport report) { foreach (var country in report.Countries) { var conResponse = await _covidClient.RegisterCountryReportAsync(new CovidCountryReport { CountryCode = country.CountryCode, CountryCountry = country.Country, Slug = country.Slug, Date = DateTime.UtcNow.ToProtoDateTime(), NewConfirmed = country.NewConfirmed, TotalConfirmed = country.TotalConfirmed, NewDeaths = country.NewDeaths, TotalDeaths = country.TotalDeaths, NewRecovered = country.NewRecovered, TotalRecovered = country.TotalRecovered, }); if (!string.IsNullOrWhiteSpace(conResponse.ServerToken)) { this._logger.LogInformation($"Successfully registered the Country {country.Country} summary payload"); } } }