Example #1
0
        internal void Approve(ApprovalData approvalData)
        {
            if (approvalData.DecisionDate < CompletedDate)
            {
                throw new InvalidOperationException("Cannot set the decision date to before the completed date. Id: " + Id);
            }

            stateMachine.Fire(approvedTrigger, approvalData);
        }
Example #2
0
 private void OnApproved(ApprovalData approvalData)
 {
     DecisionDate         = approvalData.DecisionDate;
     Decision             = FinancialGuaranteeDecision.Approved;
     ActiveLoadsPermitted = approvalData.ActiveLoadsPermitted;
     ReferenceNumber      = approvalData.ReferenceNumber;
     IsBlanketBond        = approvalData.IsBlanketBond;
     CoverAmount          = approvalData.CoverAmount;
     CalculationContinued = approvalData.CalculationContinued;
 }
        public async Task Approve(Guid notificationId, Guid financialGuaranteeId, ApprovalData approvalData)
        {
            var financialGuaranteeCollection = await repository.GetByNotificationId(notificationId);
            var approvedFinancialGuarantee = financialGuaranteeCollection.GetCurrentApprovedFinancialGuarantee();
            var financialGuarantee = financialGuaranteeCollection.GetFinancialGuarantee(financialGuaranteeId);

            financialGuarantee.Approve(approvalData);

            if (approvedFinancialGuarantee != null)
            {
                if (approvedFinancialGuarantee.ReferenceNumber == financialGuarantee.ReferenceNumber)
                {
                    approvedFinancialGuarantee.Supersede();
                }
                else
                {
                    approvedFinancialGuarantee.Release(SystemTime.UtcNow);
                }
            }
        }
Example #4
0
        public async Task Approve(Guid notificationId, Guid financialGuaranteeId, ApprovalData approvalData)
        {
            var financialGuaranteeCollection = await repository.GetByNotificationId(notificationId);

            var approvedFinancialGuarantee = financialGuaranteeCollection.GetCurrentApprovedFinancialGuarantee();
            var financialGuarantee         = financialGuaranteeCollection.GetFinancialGuarantee(financialGuaranteeId);

            financialGuarantee.Approve(approvalData);

            if (approvedFinancialGuarantee != null)
            {
                if (approvedFinancialGuarantee.ReferenceNumber == financialGuarantee.ReferenceNumber)
                {
                    approvedFinancialGuarantee.Supersede();
                }
                else
                {
                    approvedFinancialGuarantee.Release(SystemTime.UtcNow);
                }
            }
        }
 private void OnApproved(ApprovalData approvalData)
 {
     DecisionDate = approvalData.DecisionDate;
     Decision = FinancialGuaranteeDecision.Approved;
     ActiveLoadsPermitted = approvalData.ActiveLoadsPermitted;
     ReferenceNumber = approvalData.ReferenceNumber;
     IsBlanketBond = approvalData.IsBlanketBond;
 }
        internal void Approve(ApprovalData approvalData)
        {
            if (approvalData.DecisionDate < CompletedDate)
            {
                throw new InvalidOperationException("Cannot set the decision date to before the completed date. Id: " + Id);
            }

            stateMachine.Fire(approvedTrigger, approvalData);
        }