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);
        }
Esempio n. 2
0
        public static TimeEntry Create(TimeEntryEventDto eventDto)
        {
            var instance = new TimeEntry();

            instance.ApplyChange(new TimeEntryAdded(eventDto));

            return(instance);
        }
Esempio n. 3
0
 public TimeEntryUpdated(TimeEntryEventDto timeEntry)
 {
     TimeEntry = timeEntry;
 }
Esempio n. 4
0
 public TimeEntryAdded(TimeEntryEventDto timeEntry)
 {
     TimeEntry = timeEntry;
 }
Esempio n. 5
0
 public void Update(TimeEntryEventDto eventDto)
 {
     ApplyChange(new TimeEntryUpdated(eventDto));
 }