Exemplo n.º 1
0
        public void Handle(PromotionDraftReady @event)
        {
            IEnumerable <Editor> editors = _userInRoleRepository.GetAllEditors()
                                           .Where(e => e.Id != @event.OwnerId);

            ApprovalProcess approvalProcess = ApprovalProcess.StartFor(@event.PromotionId, new HashSet <Editor>(editors));

            _approvalRepository.Store(approvalProcess);
            _sheduler.RequestTimeout(new ApprovalProcessTimeout(approvalProcess.Id), TimeSpan.FromDays(3));
        }
 public void Store(ApprovalProcess approvalProcess)
 {
     _context.ApprovalProcesses.Add(approvalProcess);
 }
Exemplo n.º 3
0
        public void HandleTimeout(ApprovalProcessTimeout timeoutData)
        {
            ApprovalProcess process = _approvalRepository.GetApprovalProcess(timeoutData.ApprovalProcessId);

            process.Complete();
        }