public async Task AddOrUpdate(TimeEntryEventDto timeEntry) { var dto = new TimeEntryReadDto(timeEntry.Id, timeEntry.When, (int)timeEntry.Type, timeEntry.Job); await _repository.Set(timeEntry.Id, dto); await _repository.SortedSetAdd($"by-when|by-user|{timeEntry.User}", dto.When.UtcTicks, timeEntry.Id); }
public static TimeEntry Create(TimeEntryEventDto eventDto) { var instance = new TimeEntry(); instance.ApplyChange(new TimeEntryAdded(eventDto)); return(instance); }
public TimeEntryUpdated(TimeEntryEventDto timeEntry) { TimeEntry = timeEntry; }
public TimeEntryAdded(TimeEntryEventDto timeEntry) { TimeEntry = timeEntry; }
public void Update(TimeEntryEventDto eventDto) { ApplyChange(new TimeEntryUpdated(eventDto)); }