Example #1
0
        public static void BuildOfficialDocumentShortDescription(this LegalPartyContext legalPartyContext)
        {
            legalPartyContext.SystemType.Add(new SystemType
            {
                Id         = 455,
                BegEffDate = new DateTime(2016, 4, 1),
                ShortDescr = "foo a   "
            });

            legalPartyContext.SystemType.Add(new SystemType
            {
                Id         = 455,
                BegEffDate = new DateTime(2017, 4, 1),
                ShortDescr = "foo d   "
            });

            legalPartyContext.SystemType.Add(new SystemType
            {
                Id         = 46,
                BegEffDate = new DateTime(2015, 4, 1),
                ShortDescr = "fooa b   "
            });

            legalPartyContext.SystemType.Add(new SystemType
            {
                Id         = 8132,
                BegEffDate = new DateTime(2016, 2, 1),
                ShortDescr = "barr c   "
            });

            legalPartyContext.SaveChanges();
        }
        public RepositoryTests()
        {
            var optionsBuilder = new DbContextOptionsBuilder();

            optionsBuilder.UseInMemoryDatabase(Guid.NewGuid().ToString("N"));

            _legalPartyContext = new LegalPartyContext(optionsBuilder);

            TestDataBuilder.Build(_legalPartyContext);
        }
Example #3
0
        public LegalPartyOfficialDocumentRepositoryTests()
        {
            var optionsBuilder = new DbContextOptionsBuilder();

            optionsBuilder.UseInMemoryDatabase(Guid.NewGuid().ToString("N"));

            var legalPartyContext = new LegalPartyContext(optionsBuilder);

            legalPartyContext.BuildLegalPartyDocument();

            _legalPartyDocumentRepository = new LegalPartyOfficialDocumentRepository(legalPartyContext);
        }
        public OfficialDocumentShortDescriptionRepositoryTests()
        {
            var optionsBuilder = new DbContextOptionsBuilder();

            optionsBuilder.UseInMemoryDatabase(Guid.NewGuid().ToString("N"));

            var legalPartyContext = new LegalPartyContext(optionsBuilder);

            _officialDocumentShortDescriptionRepository = new OfficialDocumentShortDescriptionRepository(legalPartyContext);

            legalPartyContext.BuildOfficialDocumentShortDescription();
        }
        public static void BuildGrmEventRightTransfer(this LegalPartyContext legalPartyContext)
        {
            legalPartyContext.GrmEventArtifacts.Add(new GrmEventArtifact
            {
                Id         = 1,
                GrmEventId = 1,
                ObjectId   = 1,
                ObjectType = SysType.RightTransferId
            });

            legalPartyContext.GrmEvents.Add(new GrmEvent
            {
                Id        = 1,
                EventType = SysType.TransferId
            });

            legalPartyContext.GrmEventArtifacts.Add(new GrmEventArtifact
            {
                Id         = 2,
                GrmEventId = 2,
                ObjectId   = 2,
                ObjectType = SysType.RightTransferId
            });

            legalPartyContext.GrmEvents.Add(new GrmEvent
            {
                Id        = 2,
                EventType = SysType.TransferId
            });

            // This record should not show up because the SysType.RightTransferId and
            // SysType.TransferId don't match with our expected query.

            legalPartyContext.GrmEventArtifacts.Add(new GrmEventArtifact
            {
                Id         = 3,
                GrmEventId = 3,
                ObjectId   = 3,
                ObjectType = 64
            });

            legalPartyContext.GrmEvents.Add(new GrmEvent
            {
                Id        = 3,
                EventType = 88
            });



            legalPartyContext.SaveChanges();
        }
        public GrmEventRightTransferRepositoryTests()
        {
            var optionsBuilder = new DbContextOptionsBuilder();

            optionsBuilder.UseInMemoryDatabase(Guid.NewGuid().ToString("N"));

            var legalPartyContext = new LegalPartyContext(optionsBuilder);

            legalPartyContext.BuildLegalPartyDocument();

            _grmEventRightTransferRepository = new GrmEventRightTransferRepository(legalPartyContext);

            legalPartyContext.BuildGrmEventRightTransfer();
        }
        public static void Build(LegalPartyContext legalPartyContext)
        {
            legalPartyContext.LegalParty.Add(new TAGov.Services.Core.LegalParty.Repository.Models.V1.LegalParty
            {
                Id             = LegalPartyId1,
                AliasType      = 0,
                CombineToId    = 0,
                DisplayName    = "Some Test",
                FunclRole      = 0,
                LPSubType      = 0,
                LegalPartyType = 0,
                PrimeLPId      = 0,
                TranId         = 0,
                CompressedName = "Compressed Name",
                Confidential   = 0,
                DateOfBirth    = DateTime.Now,
                DateOfDeath    = DateTime.Now,
                FirstName      = "First Name",
                LastName       = "Last Name",
                MiddleName     = "Middle Name",
                NamePrefix     = "Prefix",
                NameSfx        = "Suffix",
                ResidVerified  = 0,
                SoundexCd      = "SND1"
            });

            legalPartyContext.LegalPartyRole.Add(new LegalPartyRole
            {
                Id                    = LegalPartyRoleId1,
                BegEffDate            = OldestEffectiveDate,
                EffectiveStatus       = EffectiveStatuses.Active,
                TranId                = 0,
                LegalPartyId          = LegalPartyId1,
                ObjectType            = SysType.SysTypeRevObj,
                ObjectId              = RevenueObjectId1,
                AcctId                = 0,
                LegalPartyRoleType    = 0,
                PrimeLegalParty       = 0,
                OwnershipType         = 0,
                PercentInt            = 0,
                Numerator             = 0,
                Denominator           = 0,
                GroupSequence         = 0,
                LegalPartyRoleSubtype = 0,
                OriginalTransferor    = 0,
                Survivorship          = 0
            });

            legalPartyContext.LegalPartyRole.Add(new LegalPartyRole
            {
                Id                    = LegalPartyRoleId1,
                BegEffDate            = NewestEffectiveDate,
                EffectiveStatus       = EffectiveStatuses.InActive,
                TranId                = 0,
                LegalPartyId          = LegalPartyId1,
                ObjectType            = RevenueObjectId1,
                ObjectId              = 0,
                AcctId                = 0,
                LegalPartyRoleType    = 0,
                PrimeLegalParty       = 0,
                OwnershipType         = 0,
                PercentInt            = 0,
                Numerator             = 0,
                Denominator           = 0,
                GroupSequence         = 0,
                LegalPartyRoleSubtype = 0,
                OriginalTransferor    = 0,
                Survivorship          = 0
            });

            legalPartyContext.LegalParty.Add(new TAGov.Services.Core.LegalParty.Repository.Models.V1.LegalParty
            {
                Id             = LegalPartyId2,
                AliasType      = 0,
                CombineToId    = 0,
                DisplayName    = "Some Test",
                FunclRole      = 0,
                LPSubType      = 0,
                LegalPartyType = 0,
                PrimeLPId      = 0,
                TranId         = 0,
                CompressedName = "Compressed Name",
                Confidential   = 0,
                DateOfBirth    = DateTime.Now,
                DateOfDeath    = DateTime.Now,
                FirstName      = "First Name",
                LastName       = "Last Name",
                MiddleName     = "Middle Name",
                NamePrefix     = "Prefix",
                NameSfx        = "Suffix",
                ResidVerified  = 0,
                SoundexCd      = "SND1"
            });

            legalPartyContext.LegalPartyRole.Add(new LegalPartyRole
            {
                Id                    = LegalPartyRoleId3,
                BegEffDate            = OlderEffectiveDate,
                EffectiveStatus       = EffectiveStatuses.Active,
                TranId                = 0,
                LegalPartyId          = LegalPartyId2,
                ObjectType            = SysType.SysTypeRevObj,
                ObjectId              = RevenueObjectId1,
                AcctId                = 0,
                LegalPartyRoleType    = SysType.SysTypeOwner,
                PrimeLegalParty       = 0,
                OwnershipType         = 0,
                PercentInt            = 0,
                Numerator             = 0,
                Denominator           = 0,
                GroupSequence         = 0,
                LegalPartyRoleSubtype = 0,
                OriginalTransferor    = 0,
                Survivorship          = 0
            });
            legalPartyContext.LegalPartyRole.Add(new LegalPartyRole
            {
                Id                    = LegalPartyRoleId3,
                BegEffDate            = OldestEffectiveDate,
                EffectiveStatus       = EffectiveStatuses.Active,
                TranId                = 0,
                LegalPartyId          = LegalPartyId2,
                ObjectType            = SysType.SysTypeLegalPartyRole,
                ObjectId              = RevenueObjectId1,
                AcctId                = 0,
                LegalPartyRoleType    = 0,
                PrimeLegalParty       = 1,
                OwnershipType         = 0,
                PercentInt            = 0,
                Numerator             = 0,
                Denominator           = 0,
                GroupSequence         = 0,
                LegalPartyRoleSubtype = 0,
                OriginalTransferor    = 0,
                Survivorship          = 0
            });

            legalPartyContext.LegalPartyRole.Add(new LegalPartyRole
            {
                Id                    = LegalPartyRoleId4,
                BegEffDate            = OldestEffectiveDate,
                EffectiveStatus       = EffectiveStatuses.Active,
                TranId                = 0,
                LegalPartyId          = LegalPartyId1,
                ObjectType            = SysType.SysTypeRevObj,
                ObjectId              = RevenueObjectId2,
                AcctId                = 0,
                LegalPartyRoleType    = 0,
                PrimeLegalParty       = 0,
                OwnershipType         = 0,
                PercentInt            = 0,
                Numerator             = 0,
                Denominator           = 0,
                GroupSequence         = 0,
                LegalPartyRoleSubtype = 0,
                OriginalTransferor    = 0,
                Survivorship          = 0
            });

            //RevObj 3
            legalPartyContext.LegalPartyRole.Add(new LegalPartyRole
            {
                Id                    = LegalPartyRoleId5,
                BegEffDate            = OldestEffectiveDate,
                EffectiveStatus       = EffectiveStatuses.Active,
                TranId                = 0,
                LegalPartyId          = LegalPartyId1,
                ObjectType            = SysType.SysTypeRevObj,
                ObjectId              = RevenueObjectId3,
                AcctId                = 0,
                LegalPartyRoleType    = 0,
                PrimeLegalParty       = 1,
                OwnershipType         = 0,
                PercentInt            = 0,
                Numerator             = 0,
                Denominator           = 0,
                GroupSequence         = 0,
                LegalPartyRoleSubtype = 0,
                OriginalTransferor    = 0,
                Survivorship          = 0
            });

            legalPartyContext.LegalPartyRole.Add(new LegalPartyRole
            {
                Id                    = LegalPartyRoleId6,
                BegEffDate            = OldestEffectiveDate.AddSeconds(1),
                EffectiveStatus       = EffectiveStatuses.InActive,
                TranId                = 0,
                LegalPartyId          = LegalPartyId1,
                ObjectType            = SysType.SysTypeRevObj,
                ObjectId              = RevenueObjectId3,
                AcctId                = 0,
                LegalPartyRoleType    = 0,
                PrimeLegalParty       = 1,
                OwnershipType         = 0,
                PercentInt            = 0,
                Numerator             = 0,
                Denominator           = 0,
                GroupSequence         = 0,
                LegalPartyRoleSubtype = 0,
                OriginalTransferor    = 0,
                Survivorship          = 0
            });

            legalPartyContext.LegalPartyRole.Add(new LegalPartyRole
            {
                Id                    = LegalPartyRoleId7,
                BegEffDate            = OldestEffectiveDate,
                EffectiveStatus       = EffectiveStatuses.Active,
                TranId                = 0,
                LegalPartyId          = LegalPartyId2,
                ObjectType            = SysType.SysTypeRevObj,
                ObjectId              = RevenueObjectId3,
                AcctId                = 0,
                LegalPartyRoleType    = 0,
                PrimeLegalParty       = 1,
                OwnershipType         = 0,
                PercentInt            = 0,
                Numerator             = 0,
                Denominator           = 0,
                GroupSequence         = 0,
                LegalPartyRoleSubtype = 0,
                OriginalTransferor    = 0,
                Survivorship          = 0
            });

            legalPartyContext.SystemTypeCat.Add(new SysTypeCat
            {
                Id = SysTypeCatId,
                BeginEffectiveDate = NewestEffectiveDate,
                ShortDescription   = SysTypeCatShortDescription,
                EffectiveStatus    = EffectiveStatuses.Active
            });
            legalPartyContext.SystemTypeCat.Add(new SysTypeCat
            {
                Id = SysTypeCatId,
                BeginEffectiveDate = OlderEffectiveDate,
                ShortDescription   = "older SysTypeCat description",
                EffectiveStatus    = EffectiveStatuses.Active
            });
            legalPartyContext.SystemTypeCat.Add(new SysTypeCat
            {
                Id = SysTypeCatId,
                BeginEffectiveDate = OldestEffectiveDate,
                ShortDescription   = "oldest SysTypeCat description",
                EffectiveStatus    = EffectiveStatuses.Active
            });

            legalPartyContext.SystemType.Add(new SystemType
            {
                Id = SysTypeId,
                EffectiveStatus = EffectiveStatuses.Active,
                BegEffDate      = NewestEffectiveDate,
                ShortDescr      = SysTypeShortDescription,
                SysTypeCatId    = SysTypeCatId
            });
            legalPartyContext.SystemType.Add(new SystemType
            {
                Id = SysTypeId,
                EffectiveStatus = EffectiveStatuses.Active,
                BegEffDate      = OlderEffectiveDate,
                ShortDescr      = "older SysType description",
                SysTypeCatId    = SysTypeCatId
            });
            legalPartyContext.SystemType.Add(new SystemType
            {
                Id = SysTypeId,
                EffectiveStatus = EffectiveStatuses.Active,
                BegEffDate      = OldestEffectiveDate,
                ShortDescr      = "oldest SysType description",
                SysTypeCatId    = SysTypeCatId
            });

            legalPartyContext.SaveChanges();
        }
 public GrmEventRightTransferRepository(LegalPartyContext legalPartyContext)
 {
     _legalPartyContext = legalPartyContext;
 }
 public LegalPartyRepository(LegalPartyContext legalPartyContext)
 {
     _legalPartyContext = legalPartyContext;
 }
        public static void BuildLegalPartyDocument(this LegalPartyContext legalPartyContext)
        {
            var date = new DateTime(2016, 4, 3);

            // Legal Party 1.

            legalPartyContext.LegalParty.Add(new LegalParty
            {
                Id          = 1,
                DisplayName = "foo"
            });

            legalPartyContext.LegalPartyRole.Add(new LegalPartyRole
            {
                Id           = 1,
                LegalPartyId = 1,
                BegEffDate   = date,
                PercentBeneficialInterest = 40
            });

            legalPartyContext.RightHistories.Add(new RightHistory
            {
                Id = 1,
                LegalPartyRoleId   = 1,
                BeginEffectiveDate = date,
                LegalPartyRoleBeginEffectiveDate = date,
                RightTransferId = 23,
                GrantorGrantee  = 1,
                EffectiveStatus = "A"
            });

            // Should not be picked up because it is "inactive"
            legalPartyContext.RightHistories.Add(new RightHistory
            {
                Id = 1,
                LegalPartyRoleId   = 1,
                BeginEffectiveDate = new DateTime(2016, 4, 4),
                LegalPartyRoleBeginEffectiveDate = new DateTime(2016, 4, 4),
                RightTransferId = 24,
                GrantorGrantee  = 1,
                EffectiveStatus = "I"
            });

            // Should not be picked up because this is NOT the max.
            legalPartyContext.RightHistories.Add(new RightHistory
            {
                Id = 1,
                LegalPartyRoleId   = 1,
                BeginEffectiveDate = new DateTime(2016, 4, 1),
                LegalPartyRoleBeginEffectiveDate = date,
                RightTransferId = 28,
                GrantorGrantee  = 1,
                EffectiveStatus = "A"
            });

            legalPartyContext.RightTransfers.Add(new RightTransfer
            {
                Id = 23,
                OfficialDocumentId = 33,
                BeginEffectiveDate = date,
                EffectiveStatus    = "A"
            });

            // Related to the "none max" right history record.
            legalPartyContext.RightTransfers.Add(new RightTransfer
            {
                Id = 24,
                OfficialDocumentId = 3190,
                BeginEffectiveDate = new DateTime(2016, 4, 1),
                EffectiveStatus    = "A"
            });

            // Related to the "inactive" right history record.
            legalPartyContext.RightTransfers.Add(new RightTransfer
            {
                Id = 28,
                OfficialDocumentId = 313,
                BeginEffectiveDate = new DateTime(2016, 4, 4),
                EffectiveStatus    = "I"
            });

            legalPartyContext.OfficialDocuments.Add(new OfficialDocument
            {
                Id = 33,
                BeginEffectiveDate = date,
                EffectiveStatus    = "A",
                DocumentDate       = date,
                DocumentNumber     = "doc 433555",
                DocumentType       = 3
            });

            // Related to the "none max" Official Document record.
            legalPartyContext.OfficialDocuments.Add(new OfficialDocument
            {
                Id = 3190,
                BeginEffectiveDate = new DateTime(2016, 4, 1),
                EffectiveStatus    = "A",
                DocumentDate       = new DateTime(2016, 4, 1),
                DocumentNumber     = "doc dsfd 548935",
                DocumentType       = 3
            });

            // Related to the "inactive" right history record.
            legalPartyContext.OfficialDocuments.Add(new OfficialDocument
            {
                Id = 313,
                BeginEffectiveDate = new DateTime(2016, 4, 4),
                EffectiveStatus    = "I",
                DocumentDate       = date,
                DocumentNumber     = "doc SJFDD",
                DocumentType       = 3
            });

            // Legal Party 2.
            legalPartyContext.LegalParty.Add(new LegalParty
            {
                Id          = 2,
                DisplayName = "bar"
            });

            legalPartyContext.LegalPartyRole.Add(new LegalPartyRole
            {
                Id           = 2,
                LegalPartyId = 2,
                BegEffDate   = date,
                PercentBeneficialInterest = 60
            });

            legalPartyContext.RightHistories.Add(new RightHistory
            {
                Id = 2,
                LegalPartyRoleId   = 2,
                BeginEffectiveDate = date,
                LegalPartyRoleBeginEffectiveDate = date,
                RightTransferId = 25,
                GrantorGrantee  = 0,
                EffectiveStatus = "A"
            });

            legalPartyContext.RightTransfers.Add(new RightTransfer
            {
                Id = 25,
                OfficialDocumentId = 4533,
                BeginEffectiveDate = date,
                EffectiveStatus    = "A"
            });

            legalPartyContext.OfficialDocuments.Add(new OfficialDocument
            {
                Id = 4533,
                BeginEffectiveDate = date,
                EffectiveStatus    = "A",
                DocumentDate       = date,
                DocumentNumber     = "doc 35567bxc",
                DocumentType       = 6
            });

            legalPartyContext.SaveChanges();
        }
 public LegalPartyOfficialDocumentRepository(LegalPartyContext legalPartyContext)
 {
     _legalPartyContext = legalPartyContext;
 }
 public OfficialDocumentShortDescriptionRepository(LegalPartyContext legalPartyContext)
 {
     _legalPartyContext = legalPartyContext;
 }