コード例 #1
0
        public bool IsEligible(LoanApplication application)
        {
            bool personalDetailsAreValid = new PersonalDetailVerifier().VerifyDetails(application);

            bool professionalDetailsAreValid = new ProfessionalDetailVerifier().VerifyDetails(application);

            bool creditHistoryVerified = new CreditHistoryVerifier().Verify(application);

            bool isPreferredDeveloper = new DeveloperVerifier().IsPreferredDeveloper(application.DeveloperName);

            bool isProjectApproved = isPreferredDeveloper ? true : new ProjectVerifier().IsBlackListedProject(application.ProjectName);

            return personalDetailsAreValid
                && professionalDetailsAreValid
                && creditHistoryVerified
                && isProjectApproved;
        }
コード例 #2
0
        public void Process(LoanApplication application)
        {
            bool personalDetailsAreValid = new PersonalDetailVerifier().VerifyDetails(application);

            bool professionalDetailsAreValid = new ProfessionalDetailVerifier().VerifyDetails(application);

            bool creditHistoryVerified = new CreditHistoryVerifier().Verify(application);

            bool isPreferredDeveloper = new DeveloperVerifier().IsPreferredDeveloper(application.DeveloperName);

            bool isProjectApproved = isPreferredDeveloper ? true : new ProjectVerifier().IsBlackListedProject(application.ProjectName);

            bool isEligible = personalDetailsAreValid
                && professionalDetailsAreValid
                && creditHistoryVerified
                && isProjectApproved;

            application.IsApproved = isEligible;

            NotificationService notificationService = new NotificationService();
            notificationService.Notify(application);
        }