private void ExpireAllocations(Guid employerId) { var allocations = _allocationsQuery.GetAllocationsByOwnerId(employerId); foreach (var allocation in allocations) { allocation.CreatedTime = DateTime.Now.AddDays(-10); allocation.ExpiryDate = DateTime.Now.AddDays(-5).Date; _creditsRepository.UpdateAllocation(allocation); } }
void IAllocationsCommand.Deallocate(Guid allocationId) { var allocation = _repository.GetAllocation(allocationId); if (allocation != null) { allocation.DeallocatedTime = DateTime.Now; _repository.UpdateAllocation(allocation); } }
private void Expire(Allocation allocation, DateTime date) { allocation.ExpiryDate = date; _creditsRepository.UpdateAllocation(allocation); }