Exemple #1
0
        public bool IsComplete()
        {
            AdoxioApplicantTypeCodes?businessType = null;

            if (Account.businessType != null)
            {
                businessType = (AdoxioApplicantTypeCodes?)Enum.Parse(typeof(AdoxioApplicantTypeCodes), Account.businessType);
            }

            var directorsExist = ChildEntities.Any(c => c.AdoxioLegalEntity.isDirector == true ||
                                                   c.AdoxioLegalEntity.isOfficer == true ||
                                                   c.AdoxioLegalEntity.isSeniorManagement == true) ||
                                 businessType == AdoxioApplicantTypeCodes.SoleProprietor ||
                                 businessType == AdoxioApplicantTypeCodes.GeneralPartnership ||
                                 businessType == AdoxioApplicantTypeCodes.LimitedLiabilityPartnership ||
                                 businessType == AdoxioApplicantTypeCodes.LimitedPartnership;

            var shareholdersExist = ChildEntities.Any(c => c.AdoxioLegalEntity.isShareholder == true) ||
                                    businessType == AdoxioApplicantTypeCodes.GeneralPartnership ||
                                    businessType == AdoxioApplicantTypeCodes.LimitedLiabilityPartnership ||
                                    businessType == AdoxioApplicantTypeCodes.LimitedPartnership ||
                                    businessType == AdoxioApplicantTypeCodes.SoleProprietor ||
                                    businessType == AdoxioApplicantTypeCodes.Society ||
                                    businessType == AdoxioApplicantTypeCodes.PublicCorporation;

            var partnersExist = ChildEntities.Any(c => c.AdoxioLegalEntity.isPartner == true) ||
                                (
                businessType != AdoxioApplicantTypeCodes.GeneralPartnership &&
                businessType != AdoxioApplicantTypeCodes.LimitedLiabilityPartnership &&
                businessType != AdoxioApplicantTypeCodes.LimitedPartnership
                                );

            var isShareholderComplete = shareholdersExist && partnersExist &&
                                        ChildEntities.Where(c => c.AdoxioLegalEntity.isShareholder == true || c.AdoxioLegalEntity.isPartner == true)
                                        .Select(c => c.AdoxioLegalEntity.isShareholderComplete(businessType, shareholderFilesExists, shareholdersExist, partnersExist))
                                        .All(s => s == true);
            var isDirectorAndOfficersComplete = directorsExist &&
                                                ChildEntities.Where(c => c.AdoxioLegalEntity.isDirector == true ||
                                                                    c.AdoxioLegalEntity.isOfficer == true ||
                                                                    c.AdoxioLegalEntity.isSeniorManagement == true)
                                                .Select(c => c.AdoxioLegalEntity.isDirectorOfficerComplete(businessType, directorsExist))
                                                .All(s => s == true);
            var isSecurityAssessmentComplete = ChildEntities.Where(c => c.AdoxioLegalEntity.isDirector == true ||
                                                                   c.AdoxioLegalEntity.isOfficer == true ||
                                                                   c.AdoxioLegalEntity.isSeniorManagement == true ||
                                                                   (c.AdoxioLegalEntity.isindividual == true && c.AdoxioLegalEntity.isShareholder == true))
                                               .All(c => c.AdoxioLegalEntity.securityAssessmentEmailSentOn != null);


            var result = Account.isCorporateDetailsComplete(businessType, corporateDetailsFilesExists) &&
                         isDirectorAndOfficersComplete &&
                         isShareholderComplete &&
                         TiedHouse.isConnectionToProducersComplete(businessType) &&
                         organizationStructureFilesExists &&
                         keyPersonnelFilesExists &&
                         financialInformationFilesExists &&
                         isSecurityAssessmentComplete;

            return(result);
        }
Exemple #2
0
        public DynamicEntity(Guid id)
        {
            // In this example, we use Guid to represent an entity identifier.
            // In a real-life application, the identifier can be of any type or even missing.
            mId = id;

            // In this example, we simply initialize fields in the constructor.
            // In a real-life application, these fields can be initialized lazily
            // at the corresponding properties, if needed.
            mEntities = new ReferencedEntities(this);
            mChildren = new ChildEntities(this);
        }
Exemple #3
0
        public void AddChild(string parentName, Entity entity)
        {
            if (Type != Types.PARENT && Type != Types.ARRAY && Type != Types.REPEAT)
            {
                throw new Exception($"{parentName} must have type Parent, Array or Repeat to add child entities");
            }

            // Make sure name does not already exist
            if (ChildEntities.ContainsKey(entity.Name))
            {
                throw new Exception($"{parentName} defines attribute {entity.Name} multiple times");
            }

            ChildEntities.Add(entity.Name, entity);
            ChildOrder.Add(entity.Name);
        }
Exemple #4
0
 public void AddChild(EntityManager.Entity entity)
 {
     ChildEntities.Add(entity);
 }