Ejemplo n.º 1
0
        public static TimeAbsenceEntry Create(TimeAbsenceEntryEventDto timeAbsenceEntry)
        {
            var instance = new TimeAbsenceEntry();

            instance.ApplyChange(new TimeAbsenceEntryAdded(timeAbsenceEntry));

            return(instance);
        }
Ejemplo n.º 2
0
        public async Task AddOrUpdate(TimeAbsenceEntryEventDto timeAbsenceEntry)
        {
            var dto = new TimeAbsenceEntryReadDto(timeAbsenceEntry.Id, timeAbsenceEntry.Description,
                                                  timeAbsenceEntry.Start, timeAbsenceEntry.End, (int)timeAbsenceEntry.Type);

            await _repository.Set(timeAbsenceEntry.Id, dto);

            await _repository.SortedSetAdd($"by-when|by-user|{timeAbsenceEntry.User}", dto.Start.UtcTicks,
                                           timeAbsenceEntry.Id);
        }
Ejemplo n.º 3
0
 public TimeAbsenceEntryAdded(TimeAbsenceEntryEventDto timeAbsenceEntry)
 {
     TimeAbsenceEntry = timeAbsenceEntry;
 }
Ejemplo n.º 4
0
 public void Update(TimeAbsenceEntryEventDto eventDto)
 {
     ApplyChange(new TimeAbsenceEntryUpdated(eventDto));
 }
 public TimeAbsenceEntryUpdated(TimeAbsenceEntryEventDto timeAbsenceEntry)
 {
     TimeAbsenceEntry = timeAbsenceEntry;
 }