예제 #1
0
        public async Task UpdateFocusItems(string userId, Location newLocation)
        {
            var triggered = await GetTriggered(userId, newLocation);

            foreach (var t in triggered)
            {
                if (t.Id.StartsWith("start"))
                {
                    await _focusStore.SetTravelStatus(userId, t.FocusItemId, TravelStatus.OnJourney);
                }
                else if (t.Id.StartsWith("end"))
                {
                    await _focusStore.SetTravelStatus(userId, t.FocusItemId, TravelStatus.Finished);
                }
                await _locationStore.SetTriggered(userId, triggered);
            }
        }