private async Task <List <Message> > CheckBafuSpots() { var messages = new List <Message>(); var bafuSpots = await _databaseService.GetAllBafuSurfSpotsAsync(); foreach (var bafuSpot in bafuSpots) { BafuData bafuData = await _bafuDataProvider.GetOutflowData(bafuSpot.Url); if (_bafuEvaluator.IsFiring(bafuData, bafuSpot)) { messages.Add(new Message() { Dates = bafuData.Dates, SpotName = bafuSpot.Name, SpotUrl = bafuSpot.Url }); } } return(messages); }
public bool IsFiring(BafuData bafuData, BafuSurfSpot bafuSurfSpot) { return(bafuData.OutflowCurrent > bafuSurfSpot.Outflow || bafuData.OutflowMax24hours > bafuSurfSpot.Outflow); }