private bool IsApplicable(APTran transaction, APRegister payment)
        {
            var projectId = LienWaiverProjectDataProvider.GetProjectId(Graph, transaction);

            return(AreThereAnyLienWaiverRecipientsForVendorClass(payment.VendorID, projectId) &&
                   DoesCommitmentAmountExceedMinimumCommitmentAmount(payment.VendorID, transaction));
        }
        private bool AreThereAnyOutstandingLienWaivers(int?vendorId)
        {
            var projectIds = Transactions.Select(tran => LienWaiverProjectDataProvider.GetProjectId(Graph, tran))
                             .Distinct();

            return(LienWaiverDataProvider.DoesAnyOutstandingComplianceExistForPrimaryVendor(vendorId, projectIds));
        }
        protected bool DoesCommitmentAmountExceedMinimumCommitmentAmount(int?vendorId, APTran transaction)
        {
            var commitment = GetCommitment(transaction);

            if (commitment == null)
            {
                return(false);
            }
            var vendor              = VendorDataProvider.GetVendor(Graph, vendorId);
            var projectId           = LienWaiverProjectDataProvider.GetProjectId(Graph, transaction);
            var lienWaiverRecipient = LienWaiverRecipientDataProvider.GetLienWaiverRecipient(Graph,
                                                                                             vendor.VendorClassID, projectId);

            return(commitment.CuryOrderTotal > lienWaiverRecipient.MinimumCommitmentAmount);
        }