From d42c2074f2695477f131255bffc3d1e6d11f469a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Sa=CC=88rkikoski?= Date: Mon, 20 May 2024 15:08:41 +0300 Subject: [PATCH 1/3] TTV model update 20.5.2024 --- .../src/DatabaseContext/ApiDbContext.cs | 326 ++++++++++++++---- .../Entities/DimCallDecision.cs | 32 ++ .../Entities/DimCallProgramme.cs | 8 + .../src/DatabaseContext/Entities/DimDate.cs | 6 + .../Entities/DimFundingDecision.cs | 16 +- .../src/DatabaseContext/Entities/DimName.cs | 2 + .../Entities/DimOrganization.cs | 2 + .../src/DatabaseContext/Entities/DimPid.cs | 5 +- .../Entities/DimReferencedatum.cs | 6 + .../Entities/DimRegisteredDataSource.cs | 2 + .../Entities/DimResearchCommunity.cs | 2 + .../Entities/DimResearchProject.cs | 64 ++++ .../Entities/DimTypeOfFunding.cs | 2 - .../Entities/DimUserProfile.cs | 1 + .../DatabaseContext/Entities/DimWebLink.cs | 1 + .../Entities/FactContribution.cs | 1 + 16 files changed, 389 insertions(+), 87 deletions(-) create mode 100644 aspnetcore/src/DatabaseContext/Entities/DimCallDecision.cs create mode 100644 aspnetcore/src/DatabaseContext/Entities/DimResearchProject.cs diff --git a/aspnetcore/src/DatabaseContext/ApiDbContext.cs b/aspnetcore/src/DatabaseContext/ApiDbContext.cs index 9121c43..0b31848 100644 --- a/aspnetcore/src/DatabaseContext/ApiDbContext.cs +++ b/aspnetcore/src/DatabaseContext/ApiDbContext.cs @@ -25,6 +25,7 @@ public ApiDbContext(DbContextOptions options) public virtual DbSet BrWordClusterDimFundingDecisions { get; set; } = null!; public virtual DbSet BrWordsDefineAClusters { get; set; } = null!; public virtual DbSet DimAffiliations { get; set; } = null!; + public virtual DbSet DimCallDecisions { get; set; } = null!; public virtual DbSet DimCallProgrammes { get; set; } = null!; public virtual DbSet DimCompetences { get; set; } = null!; public virtual DbSet DimDates { get; set; } = null!; @@ -63,6 +64,7 @@ public ApiDbContext(DbContextOptions options) public virtual DbSet DimResearchCommunities { get; set; } = null!; public virtual DbSet DimResearchDataCatalogs { get; set; } = null!; public virtual DbSet DimResearchDatasets { get; set; } = null!; + public virtual DbSet DimResearchProjects { get; set; } = null!; public virtual DbSet DimResearcherDescriptions { get; set; } = null!; public virtual DbSet DimResearcherToResearchCommunities { get; set; } = null!; public virtual DbSet DimSectors { get; set; } = null!; @@ -82,6 +84,11 @@ public ApiDbContext(DbContextOptions options) protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { + if (!optionsBuilder.IsConfigured) + { +#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263. + optionsBuilder.UseSqlServer("Server=localhost;User Id=ttvuser;Password=Tdsfkjds7632eDSG;database=Ttv_2024_05_20;Encrypt=False"); + } } protected override void OnModelCreating(ModelBuilder modelBuilder) @@ -89,7 +96,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { entity.HasKey(e => new { e.DimResearchDatasetId, e.DimResearchDatasetId2 }) - .HasName("PK__br_datas__9FEA685A8D199EEE"); + .HasName("PK__br_datas__9FEA685A42BC14F8"); entity.ToTable("br_dataset_dataset_relationship"); @@ -118,7 +125,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { entity.HasKey(e => new { e.DimFundingDecisionId, e.DimOrganizationid }) - .HasName("PK__br_fundi__3DB567F8ABF72B46"); + .HasName("PK__br_fundi__3DB567F8049F75A0"); entity.ToTable("br_funding_consortium_participation"); @@ -152,7 +159,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { entity.HasKey(e => new { e.DimUserProfileId, e.DimExternalServiceId, e.DimPermittedFieldGroup }) - .HasName("PK__br_grant__F51F7BCBD90F1E17"); + .HasName("PK__br_grant__F51F7BCBBAD8CEA9"); entity.ToTable("br_granted_permissions"); @@ -184,7 +191,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { entity.HasKey(e => new { e.DimFundingDecisionid, e.DimNameId }) - .HasName("PK__br_parti__5EC9BC6425248D7B"); + .HasName("PK_br_participates_in_funding_group_1"); entity.ToTable("br_participates_in_funding_group"); @@ -253,7 +260,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { entity.HasKey(e => new { e.DimWordClusterId, e.DimFundingDecisionId }) - .HasName("PK__br_word___7D640B5A043D2C38"); + .HasName("PK__br_word___7D640B5A5D4D7F32"); entity.ToTable("br_word_cluster_dim_funding_decision"); @@ -293,7 +300,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { entity.HasKey(e => new { e.DimMinedWordsId, e.DimWordClusterId }) - .HasName("PK__br_words__0602FA37415A3F94"); + .HasName("PK__br_words__0602FA376B95D316"); entity.ToTable("br_words_define_a_cluster"); @@ -427,6 +434,52 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasConstraintName("FKdim_affili706343"); }); + modelBuilder.Entity(entity => + { + entity.ToTable("dim_call_decisions"); + + entity.HasComment("Rahoituspäätöspaneeli"); + + entity.Property(e => e.Id).HasColumnName("id"); + + entity.Property(e => e.CallProcessingPhase) + .HasMaxLength(255) + .HasColumnName("call_processing_phase") + .HasComment("Rahoituspäätöspaneeli - Haun vaihe"); + + entity.Property(e => e.DecisionMaker).HasColumnName("decision_maker"); + + entity.Property(e => e.DimCallProgrammeId).HasColumnName("dim_call_programme_id"); + + entity.Property(e => e.DimDateIdApproval).HasColumnName("dim_date_id_approval"); + + entity.Property(e => e.SourceDescription) + .HasMaxLength(255) + .HasColumnName("source_description"); + + entity.Property(e => e.SourceId) + .HasMaxLength(255) + .HasColumnName("source_id"); + + entity.HasOne(d => d.DecisionMakerNavigation) + .WithMany(p => p.DimCallDecisions) + .HasForeignKey(d => d.DecisionMaker) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("decision_maker"); + + entity.HasOne(d => d.DimCallProgramme) + .WithMany(p => p.DimCallDecisions) + .HasForeignKey(d => d.DimCallProgrammeId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FKdim_call_d831756"); + + entity.HasOne(d => d.DimDateIdApprovalNavigation) + .WithMany(p => p.DimCallDecisions) + .HasForeignKey(d => d.DimDateIdApproval) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FKdim_call_d543999"); + }); + modelBuilder.Entity(entity => { entity.ToTable("dim_call_programme"); @@ -487,6 +540,10 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.IsOpenCall).HasColumnName("is_open_call"); + entity.Property(e => e.LocalIdentifier) + .HasMaxLength(255) + .HasColumnName("local_identifier"); + entity.Property(e => e.Modified) .HasColumnType("datetime") .HasColumnName("modified"); @@ -519,6 +576,13 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasMaxLength(55) .HasColumnName("source_programme_id"); + entity.Property(e => e.TypeOfFunding).HasColumnName("type_of_funding"); + + entity.HasOne(d => d.DimCallProgrammeNavigation) + .WithMany(p => p.InverseDimCallProgrammeNavigation) + .HasForeignKey(d => d.DimCallProgrammeId) + .HasConstraintName("parent_programme"); + entity.HasOne(d => d.DimDateIdDueNavigation) .WithMany(p => p.DimCallProgrammeDimDateIdDueNavigations) .HasForeignKey(d => d.DimDateIdDue) @@ -537,6 +601,11 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FKdim_call_p102028"); + entity.HasOne(d => d.TypeOfFundingNavigation) + .WithMany(p => p.DimCallProgrammesNavigation) + .HasForeignKey(d => d.TypeOfFunding) + .HasConstraintName("type_of_funding"); + entity.HasMany(d => d.DimCallProgrammeId2s) .WithMany(p => p.DimCallProgrammes) .UsingEntity>( @@ -545,7 +614,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) r => r.HasOne().WithMany().HasForeignKey("DimCallProgrammeId").OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("belongs to / a part of "), j => { - j.HasKey("DimCallProgrammeId", "DimCallProgrammeId2").HasName("PK__br_call___6F0CEDFBC6832712"); + j.HasKey("DimCallProgrammeId", "DimCallProgrammeId2").HasName("PK__br_call___6F0CEDFB0AA05110"); j.ToTable("br_call_programme_dim_call_programme"); @@ -562,7 +631,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) r => r.HasOne().WithMany().HasForeignKey("DimCallProgrammeId2").OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("FKbr_call_pr785575"), j => { - j.HasKey("DimCallProgrammeId", "DimCallProgrammeId2").HasName("PK__br_call___6F0CEDFBC6832712"); + j.HasKey("DimCallProgrammeId", "DimCallProgrammeId2").HasName("PK__br_call___6F0CEDFB0AA05110"); j.ToTable("br_call_programme_dim_call_programme"); @@ -579,7 +648,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) r => r.HasOne().WithMany().HasForeignKey("DimCallProgrammeId").OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("has disciplines"), j => { - j.HasKey("DimCallProgrammeId", "DimReferencedataId").HasName("PK__br_dim_r__0A5B885D68D6B6BA"); + j.HasKey("DimCallProgrammeId", "DimReferencedataId").HasName("PK__br_dim_r__0A5B885D12A8CA2F"); j.ToTable("br_dim_referencedata_dim_call_programme"); @@ -879,7 +948,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) r => r.HasOne().WithMany().HasForeignKey("DimEsfriId").OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("FKbr_esfri_d559740"), j => { - j.HasKey("DimEsfriId", "DimInfrastructureId").HasName("PK__br_esfri__A4A0FE10AD4EF08B"); + j.HasKey("DimEsfriId", "DimInfrastructureId").HasName("PK__br_esfri__A4A0FE10A76756CD"); j.ToTable("br_esfri_dim_infrastructure"); @@ -1043,7 +1112,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) r => r.HasOne().WithMany().HasForeignKey("DimFieldDisplaySettingsId").OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("FKbr_field_d783303"), j => { - j.HasKey("DimFieldDisplaySettingsId", "DimRegisteredDataSourceId").HasName("PK__br_field__6148A772D0543F96"); + j.HasKey("DimFieldDisplaySettingsId", "DimRegisteredDataSourceId").HasName("PK__br_field__6148A77214B78981"); j.ToTable("br_field_display_settings_dim_registered_data_source"); @@ -1082,6 +1151,10 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.DescriptionSv).HasColumnName("description_sv"); + entity.Property(e => e.DimCallDecisionsId) + .HasColumnName("dim_call_decisions_id") + .HasComment("Rahoituspäätös - Päätöspaneeli"); + entity.Property(e => e.DimCallProgrammeId).HasColumnName("dim_call_programme_id"); entity.Property(e => e.DimDateIdApproval).HasColumnName("dim_date_id_approval"); @@ -1108,7 +1181,8 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.FunderProjectNumber) .HasMaxLength(255) - .HasColumnName("funder_project_number"); + .HasColumnName("funder_project_number") + .HasComment("Päätöksen paikallinen tunniste (tiedon toimittajan)"); entity.Property(e => e.FundingDecisionCurrencyAbbreviation) .HasMaxLength(255) @@ -1138,6 +1212,11 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasMaxLength(255) .HasColumnName("source_id"); + entity.HasOne(d => d.DimCallDecisions) + .WithMany(p => p.DimFundingDecisions) + .HasForeignKey(d => d.DimCallDecisionsId) + .HasConstraintName("FKdim_fundin257658"); + entity.HasOne(d => d.DimCallProgramme) .WithMany(p => p.DimFundingDecisions) .HasForeignKey(d => d.DimCallProgrammeId) @@ -1199,30 +1278,13 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.HasMany(d => d.DimFundingDecisionFroms) .WithMany(p => p.DimFundingDecisionTos) - .UsingEntity>( - "BrPreviousFundingDecision", - l => l.HasOne().WithMany().HasForeignKey("DimFundingDecisionFromId").OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("FKbr_previou481541"), - r => r.HasOne().WithMany().HasForeignKey("DimFundingDecisionToId").OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("FKbr_previou440746"), - j => - { - j.HasKey("DimFundingDecisionFromId", "DimFundingDecisionToId").HasName("PK__br_previ__90966491D900CFFE"); - - j.ToTable("br_previous_funding_decision"); - - j.IndexerProperty("DimFundingDecisionFromId").HasColumnName("dim_funding_decision_from_id"); - - j.IndexerProperty("DimFundingDecisionToId").HasColumnName("dim_funding_decision_to_id"); - }); - - entity.HasMany(d => d.DimFundingDecisionFromsNavigation) - .WithMany(p => p.DimFundingDecisionTosNavigation) .UsingEntity>( "BrRelatedFundingDecision", l => l.HasOne().WithMany().HasForeignKey("DimFundingDecisionFromId").OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("FKbr_related232364"), r => r.HasOne().WithMany().HasForeignKey("DimFundingDecisionToId").OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("FKbr_related689923"), j => { - j.HasKey("DimFundingDecisionFromId", "DimFundingDecisionToId").HasName("PK__br_relat__90966491B1C830A1"); + j.HasKey("DimFundingDecisionFromId", "DimFundingDecisionToId").HasName("PK__br_relat__90966491CDC38E05"); j.ToTable("br_related_funding_decision"); @@ -1233,30 +1295,13 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.HasMany(d => d.DimFundingDecisionTos) .WithMany(p => p.DimFundingDecisionFroms) - .UsingEntity>( - "BrPreviousFundingDecision", - l => l.HasOne().WithMany().HasForeignKey("DimFundingDecisionToId").OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("FKbr_previou440746"), - r => r.HasOne().WithMany().HasForeignKey("DimFundingDecisionFromId").OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("FKbr_previou481541"), - j => - { - j.HasKey("DimFundingDecisionFromId", "DimFundingDecisionToId").HasName("PK__br_previ__90966491D900CFFE"); - - j.ToTable("br_previous_funding_decision"); - - j.IndexerProperty("DimFundingDecisionFromId").HasColumnName("dim_funding_decision_from_id"); - - j.IndexerProperty("DimFundingDecisionToId").HasColumnName("dim_funding_decision_to_id"); - }); - - entity.HasMany(d => d.DimFundingDecisionTosNavigation) - .WithMany(p => p.DimFundingDecisionFromsNavigation) .UsingEntity>( "BrRelatedFundingDecision", l => l.HasOne().WithMany().HasForeignKey("DimFundingDecisionToId").OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("FKbr_related689923"), r => r.HasOne().WithMany().HasForeignKey("DimFundingDecisionFromId").OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("FKbr_related232364"), j => { - j.HasKey("DimFundingDecisionFromId", "DimFundingDecisionToId").HasName("PK__br_relat__90966491B1C830A1"); + j.HasKey("DimFundingDecisionFromId", "DimFundingDecisionToId").HasName("PK__br_relat__90966491CDC38E05"); j.ToTable("br_related_funding_decision"); @@ -1555,7 +1600,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) r => r.HasOne().WithMany().HasForeignKey("DimKeywordId").OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("FKbr_keyword224605"), j => { - j.HasKey("DimKeywordId", "DimFundingDecisionId").HasName("PK__br_keywo__8C7B929BDDE68A36"); + j.HasKey("DimKeywordId", "DimFundingDecisionId").HasName("PK__br_keywo__8C7B929B2268F773"); j.ToTable("br_keyword_dim_funding_decision"); @@ -1572,7 +1617,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) r => r.HasOne().WithMany().HasForeignKey("DimKeywordId").OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("FKbr_keyword944303"), j => { - j.HasKey("DimKeywordId", "DimPublicationId").HasName("PK__br_keywo__C6E31F1AB85BCEDC"); + j.HasKey("DimKeywordId", "DimPublicationId").HasName("PK__br_keywo__C6E31F1AF3BA7AAC"); j.ToTable("br_keyword_dim_publication"); @@ -1720,7 +1765,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) r => r.HasOne().WithMany().HasForeignKey("DimMerilId").OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("FKbr_meril_d209645"), j => { - j.HasKey("DimMerilId", "DimInfrastructureId").HasName("PK__br_meril__A30C54DA7B91A1D5"); + j.HasKey("DimMerilId", "DimInfrastructureId").HasName("PK__br_meril__A30C54DA6D039B5E"); j.ToTable("br_meril_dim_infrastructure"); @@ -1846,7 +1891,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { entity.HasKey(e => new { e.Id, e.DimNewsFeedid }) - .HasName("PK__dim_news__B87E67033A02175D"); + .HasName("PK__dim_news__B87E670333B6CC8B"); entity.ToTable("dim_news_item"); @@ -2051,7 +2096,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) r => r.HasOne().WithMany().HasForeignKey("DimOrganizationid").OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("FKbr_organiz621686"), j => { - j.HasKey("DimOrganizationid", "DimCallProgrammeid").HasName("PK__br_organ__10F219BC2EED0BF5"); + j.HasKey("DimOrganizationid", "DimCallProgrammeid").HasName("PK__br_organ__10F219BCA44177EA"); j.ToTable("br_organizations_fund_call_programmes"); @@ -2068,7 +2113,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) r => r.HasOne().WithMany().HasForeignKey("DimOrganizationid").OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("FKbr_predece849307"), j => { - j.HasKey("DimOrganizationid", "DimOrganizationid2").HasName("PK__br_prede__A7CAD2F4A2C83C5C"); + j.HasKey("DimOrganizationid", "DimOrganizationid2").HasName("PK__br_prede__A7CAD2F456221723"); j.ToTable("br_predecessor_organization"); @@ -2085,7 +2130,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) r => r.HasOne().WithMany().HasForeignKey("DimOrganizationid").OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("FKbr_success452227"), j => { - j.HasKey("DimOrganizationid", "DimOrganizationid2").HasName("PK__br_succe__A7CAD2F4250F4028"); + j.HasKey("DimOrganizationid", "DimOrganizationid2").HasName("PK__br_succe__A7CAD2F48D15EF8C"); j.ToTable("br_successor organization"); @@ -2102,7 +2147,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) r => r.HasOne().WithMany().HasForeignKey("DimOrganizationid2").OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("FKbr_predece505451"), j => { - j.HasKey("DimOrganizationid", "DimOrganizationid2").HasName("PK__br_prede__A7CAD2F4A2C83C5C"); + j.HasKey("DimOrganizationid", "DimOrganizationid2").HasName("PK__br_prede__A7CAD2F456221723"); j.ToTable("br_predecessor_organization"); @@ -2119,7 +2164,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) r => r.HasOne().WithMany().HasForeignKey("DimOrganizationid2").OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("FKbr_success902531"), j => { - j.HasKey("DimOrganizationid", "DimOrganizationid2").HasName("PK__br_succe__A7CAD2F4250F4028"); + j.HasKey("DimOrganizationid", "DimOrganizationid2").HasName("PK__br_succe__A7CAD2F48D15EF8C"); j.ToTable("br_successor organization"); @@ -2141,8 +2186,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.DimEventId).HasColumnName("dim_event_id"); - entity.Property(e => e.DimFundingDecisionId).HasColumnName("dim_funding_decision_id"); - entity.Property(e => e.DimInfrastructureId).HasColumnName("dim_infrastructure_id"); entity.Property(e => e.DimKnownPersonId).HasColumnName("dim_known_person_id"); @@ -2161,10 +2204,14 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.DimResearchActivityId).HasColumnName("dim_research_activity_id"); + entity.Property(e => e.DimResearchCommunityId).HasColumnName("dim_research_community_id"); + entity.Property(e => e.DimResearchDataCatalogId).HasColumnName("dim_research_data_catalog_id"); entity.Property(e => e.DimResearchDatasetId).HasColumnName("dim_research_dataset_id"); + entity.Property(e => e.DimResearchProjectId).HasColumnName("dim_research_project_id"); + entity.Property(e => e.DimServiceId).HasColumnName("dim_service_id"); entity.Property(e => e.Modified) @@ -2193,12 +2240,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("event_identifier"); - entity.HasOne(d => d.DimFundingDecision) - .WithMany(p => p.DimPids) - .HasForeignKey(d => d.DimFundingDecisionId) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("ROI/RAID"); - entity.HasOne(d => d.DimInfrastructure) .WithMany(p => p.DimPids) .HasForeignKey(d => d.DimInfrastructureId) @@ -2251,6 +2292,11 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FKdim_pid725718"); + entity.HasOne(d => d.DimResearchCommunity) + .WithMany(p => p.DimPids) + .HasForeignKey(d => d.DimResearchCommunityId) + .HasConstraintName("FKdim_pid146045"); + entity.HasOne(d => d.DimResearchDataCatalog) .WithMany(p => p.DimPids) .HasForeignKey(d => d.DimResearchDataCatalogId) @@ -3037,7 +3083,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) r => r.HasOne().WithMany().HasForeignKey("DimPublicationId").OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("FKbr_artpubl464312"), j => { - j.HasKey("DimPublicationId", "DimReferencedataid").HasName("PK__br_artpu__879F18F32779168B"); + j.HasKey("DimPublicationId", "DimReferencedataid").HasName("PK__br_artpu__879F18F38C6299C1"); j.ToTable("br_artpublication_typecategory"); @@ -3201,7 +3247,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) r => r.HasOne().WithMany().HasForeignKey("DimReferencedataId").OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("FKfact_dim_r130466"), j => { - j.HasKey("DimReferencedataId", "DimPublicationId").HasName("PK__fact_dim__FD761943629A8020"); + j.HasKey("DimReferencedataId", "DimPublicationId").HasName("PK__fact_dim__62A1BBCB4C5919F9"); j.ToTable("fact_dim_referencedata_field_of_art"); @@ -3358,7 +3404,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { entity.HasKey(e => new { e.DimResearchActivityId, e.DimKeywordId }) - .HasName("PK__dim_rese__F7B536BCFC302E4A"); + .HasName("PK__dim_rese__F7B536BC16C738C6"); entity.ToTable("dim_research_activity_dim_keyword"); @@ -3591,7 +3637,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) r => r.HasOne().WithMany().HasForeignKey("DimResearchDatasetId").OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("dataset-keywords"), j => { - j.HasKey("DimResearchDatasetId", "DimKeywordId").HasName("PK__br_resea__4D226DF251ADDB75"); + j.HasKey("DimResearchDatasetId", "DimKeywordId").HasName("PK__br_resea__4D226DF2E27EABBA"); j.ToTable("br_research_dataset_dim_keyword"); @@ -3608,7 +3654,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) r => r.HasOne().WithMany().HasForeignKey("DimResearchDatasetId").OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("FKbr_languag34243"), j => { - j.HasKey("DimResearchDatasetId", "DimReferencedataId").HasName("PK__br_langu__576647BF5ACF45EF"); + j.HasKey("DimResearchDatasetId", "DimReferencedataId").HasName("PK__br_langu__576647BFC61E3D4B"); j.ToTable("br_language_codes_for_datasets"); @@ -3618,6 +3664,126 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) }); }); + modelBuilder.Entity(entity => + { + entity.ToTable("dim_research_project"); + + entity.Property(e => e.Id).HasColumnName("id"); + + entity.Property(e => e.AbbrevationEn) + .HasMaxLength(4000) + .HasColumnName("abbrevation_en"); + + entity.Property(e => e.AbbrevationFi) + .HasMaxLength(4000) + .HasColumnName("abbrevation_fi") + .HasComment("Hanke - lyhenne"); + + entity.Property(e => e.AbbrevationSv) + .HasMaxLength(4000) + .HasColumnName("abbrevation_sv"); + + entity.Property(e => e.AdditionalInformationEn).HasColumnName("additional_information_en"); + + entity.Property(e => e.AdditionalInfromationFi) + .HasColumnName("additional_infromation_fi") + .HasComment("Hanke - lisätieto"); + + entity.Property(e => e.AddtitionalInformationSv).HasColumnName("addtitional_information_sv"); + + entity.Property(e => e.Created) + .HasColumnType("datetime") + .HasColumnName("created"); + + entity.Property(e => e.DimRegisteredDataSourceId).HasColumnName("dim_registered_data_source_id"); + + entity.Property(e => e.EndDate) + .HasColumnName("end_date") + .HasComment("Hanke - päättymispäivämäärä"); + + entity.Property(e => e.GoalsEn).HasColumnName("goals_en"); + + entity.Property(e => e.GoalsFi).HasColumnName("goals_fi"); + + entity.Property(e => e.GoalsSv).HasColumnName("goals_sv"); + + entity.Property(e => e.Modified) + .HasColumnType("datetime") + .HasColumnName("modified"); + + entity.Property(e => e.NameEn) + .HasMaxLength(4000) + .HasColumnName("name_en"); + + entity.Property(e => e.NameFi) + .HasMaxLength(4000) + .HasColumnName("name_fi") + .HasComment("Hanke - nimi"); + + entity.Property(e => e.NameSv) + .HasMaxLength(4000) + .HasColumnName("name_sv"); + + entity.Property(e => e.OutcomeEffectEn).HasColumnName("outcome_effect_en"); + + entity.Property(e => e.OutcomeEffectFi).HasColumnName("outcome_effect_fi"); + + entity.Property(e => e.OutcomeEffectSv).HasColumnName("outcome_effect_sv"); + + entity.Property(e => e.ResponsibleOrganization) + .HasColumnName("responsible_organization") + .HasComment("Hanke - vastuuorganisaatio"); + + entity.Property(e => e.ResponsiblePerson).HasColumnName("responsible_person"); + + entity.Property(e => e.SourceDescription) + .HasMaxLength(255) + .HasColumnName("source_description"); + + entity.Property(e => e.SourceId) + .HasMaxLength(255) + .HasColumnName("source_id"); + + entity.Property(e => e.StartDate) + .HasColumnName("start_date") + .HasComment("Hanke - alkamispäivämäärä"); + + entity.Property(e => e.SummaryEn).HasColumnName("summary_en"); + + entity.Property(e => e.SummaryFi) + .HasColumnName("summary_fi") + .HasComment("Hanke - tiivistelmä"); + + entity.Property(e => e.SummarySv).HasColumnName("summary_sv"); + + entity.HasOne(d => d.DimRegisteredDataSource) + .WithMany(p => p.DimResearchProjects) + .HasForeignKey(d => d.DimRegisteredDataSourceId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FKdim_resear450820"); + + entity.HasOne(d => d.EndDateNavigation) + .WithMany(p => p.DimResearchProjectEndDateNavigations) + .HasForeignKey(d => d.EndDate) + .HasConstraintName("FKdim_resear517343"); + + entity.HasOne(d => d.ResponsibleOrganizationNavigation) + .WithMany(p => p.DimResearchProjects) + .HasForeignKey(d => d.ResponsibleOrganization) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FKdim_resear741036"); + + entity.HasOne(d => d.ResponsiblePersonNavigation) + .WithMany(p => p.DimResearchProjects) + .HasForeignKey(d => d.ResponsiblePerson) + .HasConstraintName("FKdim_resear684392"); + + entity.HasOne(d => d.StartDateNavigation) + .WithMany(p => p.DimResearchProjectStartDateNavigations) + .HasForeignKey(d => d.StartDate) + .HasConstraintName("FKdim_resear246050"); + }); + modelBuilder.Entity(entity => { entity.ToTable("dim_researcher_description"); @@ -3995,7 +4161,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) { entity.ToTable("dim_type_of_funding"); - entity.HasIndex(e => e.TypeId, "UQ__dim_type__2C00059939053CB5") + entity.HasIndex(e => e.TypeId, "UQ__dim_type__2C000599C4DA9E9E") .IsUnique(); entity.Property(e => e.Id).HasColumnName("id"); @@ -4122,6 +4288,8 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasMaxLength(255) .HasColumnName("orcid_token_scope"); + entity.Property(e => e.PublishNewOrcidData).HasColumnName("publish_new_orcid_data"); + entity.Property(e => e.SourceDescription) .HasMaxLength(255) .HasColumnName("source_description"); @@ -4173,6 +4341,8 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.DimResearchDatasetId).HasColumnName("dim_research_dataset_id"); + entity.Property(e => e.DimResearchProjectId).HasColumnName("dim_research_project_id"); + entity.Property(e => e.LanguageVariant) .HasMaxLength(255) .HasColumnName("language_variant"); @@ -4289,8 +4459,8 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => new { e.DimFundingDecisionId, e.DimOrganizationId, e.DimDateId, e.DimNameId, e.DimPublicationId, e.DimGeoId, e.DimInfrastructureId, e.DimNewsFeedId, e.DimResearchDatasetId, e.DimResearchDataCatalogId, e.DimIdentifierlessDataId, e.DimResearchActivityId, e.DimResearchCommunityId, e.DimReferencedataActorRoleId }) - .HasName("PK__fact_con__B7D7E1B56B3DE77D"); + entity.HasKey(e => new { e.DimFundingDecisionId, e.DimOrganizationId, e.DimDateId, e.DimNameId, e.DimPublicationId, e.DimGeoId, e.DimInfrastructureId, e.DimNewsFeedId, e.DimResearchDatasetId, e.DimResearchDataCatalogId, e.DimIdentifierlessDataId, e.DimResearchActivityId, e.DimResearchCommunityId, e.DimReferencedataActorRoleId, e.DimResearchProjectId }) + .HasName("PK__fact_con__7D4857055BA7D7F9"); entity.ToTable("fact_contribution"); @@ -4322,6 +4492,10 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.DimReferencedataActorRoleId).HasColumnName("dim_referencedata_actor_role_id"); + entity.Property(e => e.DimResearchProjectId) + .HasColumnName("dim_research_project_id") + .HasDefaultValueSql("('-1')"); + entity.Property(e => e.ContributionType) .HasMaxLength(50) .HasColumnName("contribution_type"); @@ -4430,7 +4604,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { entity.HasKey(e => new { e.DimReferencedataId, e.DimResearchDatasetId, e.DimKnownPersonId, e.DimPublicationId, e.DimResearchActivityId, e.DimFundingDecisionId, e.DimInfrastructureId }) - .HasName("PK__fact_dim__3CB15DD3757270A4"); + .HasName("PK__fact_dim__3CB15DD379EDCB7E"); entity.ToTable("fact_dim_referencedata_field_of_science"); @@ -4739,7 +4913,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { entity.HasKey(e => new { e.DimKeywordId, e.DimServiceId, e.DimServicePointId, e.DimInfrastructureId }) - .HasName("PK__fact_inf__3C29B6806CAFC072"); + .HasName("PK__fact_inf__3C29B6806204C32C"); entity.ToTable("fact_infra_keywords"); @@ -4795,7 +4969,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { entity.HasKey(e => new { e.DimOrganizationId, e.DimGeoId, e.DimInfrastructureId, e.DimServiceId, e.DimServicePointId, e.DimDateIdStart, e.DimDateIdEnd }) - .HasName("PK__fact_upk__850A8E30119C2EB4"); + .HasName("PK__fact_upk__850A8E300A3C70B3"); entity.ToTable("fact_upkeep"); diff --git a/aspnetcore/src/DatabaseContext/Entities/DimCallDecision.cs b/aspnetcore/src/DatabaseContext/Entities/DimCallDecision.cs new file mode 100644 index 0000000..0cc46ed --- /dev/null +++ b/aspnetcore/src/DatabaseContext/Entities/DimCallDecision.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; + +namespace CSC.PublicApi.DatabaseContext.Entities +{ + /// + /// Rahoituspäätöspaneeli + /// + public partial class DimCallDecision + { + public DimCallDecision() + { + DimFundingDecisions = new HashSet(); + } + + public int Id { get; set; } + public int DecisionMaker { get; set; } + public int DimDateIdApproval { get; set; } + public int DimCallProgrammeId { get; set; } + /// + /// Rahoituspäätöspaneeli - Haun vaihe + /// + public string CallProcessingPhase { get; set; } = null!; + public string? SourceId { get; set; } + public string? SourceDescription { get; set; } + + public virtual DimReferencedatum DecisionMakerNavigation { get; set; } = null!; + public virtual DimCallProgramme DimCallProgramme { get; set; } = null!; + public virtual DimDate DimDateIdApprovalNavigation { get; set; } = null!; + public virtual ICollection DimFundingDecisions { get; set; } + } +} diff --git a/aspnetcore/src/DatabaseContext/Entities/DimCallProgramme.cs b/aspnetcore/src/DatabaseContext/Entities/DimCallProgramme.cs index 084a472..06a3858 100644 --- a/aspnetcore/src/DatabaseContext/Entities/DimCallProgramme.cs +++ b/aspnetcore/src/DatabaseContext/Entities/DimCallProgramme.cs @@ -7,9 +7,11 @@ public partial class DimCallProgramme { public DimCallProgramme() { + DimCallDecisions = new HashSet(); DimFundingDecisions = new HashSet(); DimProfileOnlyFundingDecisions = new HashSet(); DimWebLinks = new HashSet(); + InverseDimCallProgrammeNavigation = new HashSet(); DimCallProgrammeId2s = new HashSet(); DimCallProgrammes = new HashSet(); DimOrganizations = new HashSet(); @@ -45,13 +47,19 @@ public DimCallProgramme() public string? CallNameDetailsFi { get; set; } public string? CallNameDetailsEn { get; set; } public string? CallNameDetailsSv { get; set; } + public string? LocalIdentifier { get; set; } + public int? TypeOfFunding { get; set; } + public virtual DimCallProgramme? DimCallProgrammeNavigation { get; set; } public virtual DimDate DimDateIdDueNavigation { get; set; } = null!; public virtual DimDate DimDateIdOpenNavigation { get; set; } = null!; public virtual DimRegisteredDataSource DimRegisteredDataSource { get; set; } = null!; + public virtual DimReferencedatum? TypeOfFundingNavigation { get; set; } + public virtual ICollection DimCallDecisions { get; set; } public virtual ICollection DimFundingDecisions { get; set; } public virtual ICollection DimProfileOnlyFundingDecisions { get; set; } public virtual ICollection DimWebLinks { get; set; } + public virtual ICollection InverseDimCallProgrammeNavigation { get; set; } public virtual ICollection DimCallProgrammeId2s { get; set; } public virtual ICollection DimCallProgrammes { get; set; } diff --git a/aspnetcore/src/DatabaseContext/Entities/DimDate.cs b/aspnetcore/src/DatabaseContext/Entities/DimDate.cs index c9ff66c..4b0113d 100644 --- a/aspnetcore/src/DatabaseContext/Entities/DimDate.cs +++ b/aspnetcore/src/DatabaseContext/Entities/DimDate.cs @@ -9,6 +9,7 @@ public DimDate() { DimAffiliationEndDateNavigations = new HashSet(); DimAffiliationStartDateNavigations = new HashSet(); + DimCallDecisions = new HashSet(); DimCallProgrammeDimDateIdDueNavigations = new HashSet(); DimCallProgrammeDimDateIdOpenNavigations = new HashSet(); DimEducationDimEndDateNavigations = new HashSet(); @@ -25,6 +26,8 @@ public DimDate() DimProfileOnlyResearchActivityDimDateIdStartNavigations = new HashSet(); DimResearchActivityDimEndDateNavigations = new HashSet(); DimResearchActivityDimStartDateNavigations = new HashSet(); + DimResearchProjectEndDateNavigations = new HashSet(); + DimResearchProjectStartDateNavigations = new HashSet(); DimResearcherToResearchCommunityEndDateNavigations = new HashSet(); DimResearcherToResearchCommunityStartDateNavigations = new HashSet(); FactContributions = new HashSet(); @@ -43,6 +46,7 @@ public DimDate() public virtual ICollection DimAffiliationEndDateNavigations { get; set; } public virtual ICollection DimAffiliationStartDateNavigations { get; set; } + public virtual ICollection DimCallDecisions { get; set; } public virtual ICollection DimCallProgrammeDimDateIdDueNavigations { get; set; } public virtual ICollection DimCallProgrammeDimDateIdOpenNavigations { get; set; } public virtual ICollection DimEducationDimEndDateNavigations { get; set; } @@ -59,6 +63,8 @@ public DimDate() public virtual ICollection DimProfileOnlyResearchActivityDimDateIdStartNavigations { get; set; } public virtual ICollection DimResearchActivityDimEndDateNavigations { get; set; } public virtual ICollection DimResearchActivityDimStartDateNavigations { get; set; } + public virtual ICollection DimResearchProjectEndDateNavigations { get; set; } + public virtual ICollection DimResearchProjectStartDateNavigations { get; set; } public virtual ICollection DimResearcherToResearchCommunityEndDateNavigations { get; set; } public virtual ICollection DimResearcherToResearchCommunityStartDateNavigations { get; set; } public virtual ICollection FactContributions { get; set; } diff --git a/aspnetcore/src/DatabaseContext/Entities/DimFundingDecision.cs b/aspnetcore/src/DatabaseContext/Entities/DimFundingDecision.cs index 949a124..86739c2 100644 --- a/aspnetcore/src/DatabaseContext/Entities/DimFundingDecision.cs +++ b/aspnetcore/src/DatabaseContext/Entities/DimFundingDecision.cs @@ -10,16 +10,13 @@ public DimFundingDecision() BrFundingConsortiumParticipations = new HashSet(); BrParticipatesInFundingGroups = new HashSet(); BrWordClusterDimFundingDecisions = new HashSet(); - DimPids = new HashSet(); DimWebLinks = new HashSet(); FactContributions = new HashSet(); FactDimReferencedataFieldOfSciences = new HashSet(); FactFieldValues = new HashSet(); InverseDimFundingDecisionIdParentDecisionNavigation = new HashSet(); DimFundingDecisionFroms = new HashSet(); - DimFundingDecisionFromsNavigation = new HashSet(); DimFundingDecisionTos = new HashSet(); - DimFundingDecisionTosNavigation = new HashSet(); DimKeywords = new HashSet(); } @@ -34,6 +31,9 @@ public DimFundingDecision() public int? DimOrganizationIdFunder { get; set; } public string? DimPidPidContent { get; set; } public int DimFundingDecisionIdParentDecision { get; set; } + /// + /// Päätöksen paikallinen tunniste (tiedon toimittajan) + /// public string? FunderProjectNumber { get; set; } public string? Acronym { get; set; } public string? NameFi { get; set; } @@ -53,7 +53,12 @@ public DimFundingDecision() public DateTime? Created { get; set; } public DateTime? Modified { get; set; } public int DimRegisteredDataSourceId { get; set; } + /// + /// Rahoituspäätös - Päätöspaneeli + /// + public int? DimCallDecisionsId { get; set; } + public virtual DimCallDecision? DimCallDecisions { get; set; } public virtual DimCallProgramme DimCallProgramme { get; set; } = null!; public virtual DimDate DimDateIdApprovalNavigation { get; set; } = null!; public virtual DimDate DimDateIdEndNavigation { get; set; } = null!; @@ -63,11 +68,10 @@ public DimFundingDecision() public virtual DimName DimNameIdContactPersonNavigation { get; set; } = null!; public virtual DimOrganization? DimOrganizationIdFunderNavigation { get; set; } public virtual DimRegisteredDataSource DimRegisteredDataSource { get; set; } = null!; - public virtual DimTypeOfFunding DimTypeOfFunding { get; set; } = null!; + public virtual DimReferencedatum DimTypeOfFunding { get; set; } = null!; public virtual ICollection BrFundingConsortiumParticipations { get; set; } public virtual ICollection BrParticipatesInFundingGroups { get; set; } public virtual ICollection BrWordClusterDimFundingDecisions { get; set; } - public virtual ICollection DimPids { get; set; } public virtual ICollection DimWebLinks { get; set; } public virtual ICollection FactContributions { get; set; } public virtual ICollection FactDimReferencedataFieldOfSciences { get; set; } @@ -75,9 +79,7 @@ public DimFundingDecision() public virtual ICollection InverseDimFundingDecisionIdParentDecisionNavigation { get; set; } public virtual ICollection DimFundingDecisionFroms { get; set; } - public virtual ICollection DimFundingDecisionFromsNavigation { get; set; } public virtual ICollection DimFundingDecisionTos { get; set; } - public virtual ICollection DimFundingDecisionTosNavigation { get; set; } public virtual ICollection DimKeywords { get; set; } } } diff --git a/aspnetcore/src/DatabaseContext/Entities/DimName.cs b/aspnetcore/src/DatabaseContext/Entities/DimName.cs index 8a864c0..14cc673 100644 --- a/aspnetcore/src/DatabaseContext/Entities/DimName.cs +++ b/aspnetcore/src/DatabaseContext/Entities/DimName.cs @@ -9,6 +9,7 @@ public DimName() { BrParticipatesInFundingGroups = new HashSet(); DimFundingDecisions = new HashSet(); + DimResearchProjects = new HashSet(); FactContributions = new HashSet(); FactFieldValues = new HashSet(); } @@ -29,6 +30,7 @@ public DimName() public virtual DimRegisteredDataSource DimRegisteredDataSource { get; set; } = null!; public virtual ICollection BrParticipatesInFundingGroups { get; set; } public virtual ICollection DimFundingDecisions { get; set; } + public virtual ICollection DimResearchProjects { get; set; } public virtual ICollection FactContributions { get; set; } public virtual ICollection FactFieldValues { get; set; } } diff --git a/aspnetcore/src/DatabaseContext/Entities/DimOrganization.cs b/aspnetcore/src/DatabaseContext/Entities/DimOrganization.cs index c84ead7..5bb49a0 100644 --- a/aspnetcore/src/DatabaseContext/Entities/DimOrganization.cs +++ b/aspnetcore/src/DatabaseContext/Entities/DimOrganization.cs @@ -18,6 +18,7 @@ public DimOrganization() DimPurposes = new HashSet(); DimRegisteredDataSources = new HashSet(); DimResearchActivities = new HashSet(); + DimResearchProjects = new HashSet(); DimWebLinks = new HashSet(); FactContributions = new HashSet(); FactUpkeeps = new HashSet(); @@ -72,6 +73,7 @@ public DimOrganization() public virtual ICollection DimPurposes { get; set; } public virtual ICollection DimRegisteredDataSources { get; set; } public virtual ICollection DimResearchActivities { get; set; } + public virtual ICollection DimResearchProjects { get; set; } public virtual ICollection DimWebLinks { get; set; } public virtual ICollection FactContributions { get; set; } public virtual ICollection FactUpkeeps { get; set; } diff --git a/aspnetcore/src/DatabaseContext/Entities/DimPid.cs b/aspnetcore/src/DatabaseContext/Entities/DimPid.cs index c2f9153..455869a 100644 --- a/aspnetcore/src/DatabaseContext/Entities/DimPid.cs +++ b/aspnetcore/src/DatabaseContext/Entities/DimPid.cs @@ -21,7 +21,6 @@ public DimPid() public int DimInfrastructureId { get; set; } public int DimPublicationChannelId { get; set; } public int DimResearchDatasetId { get; set; } - public int DimFundingDecisionId { get; set; } public int DimResearchDataCatalogId { get; set; } public int DimResearchActivityId { get; set; } public int DimEventId { get; set; } @@ -32,9 +31,10 @@ public DimPid() public DateTime? Modified { get; set; } public int? DimProfileOnlyDatasetId { get; set; } public int? DimProfileOnlyFundingDecisionId { get; set; } + public int? DimResearchProjectId { get; set; } + public int? DimResearchCommunityId { get; set; } public virtual DimEvent DimEvent { get; set; } = null!; - public virtual DimFundingDecision DimFundingDecision { get; set; } = null!; public virtual DimInfrastructure DimInfrastructure { get; set; } = null!; public virtual DimKnownPerson DimKnownPerson { get; set; } = null!; public virtual DimOrganization DimOrganization { get; set; } = null!; @@ -44,6 +44,7 @@ public DimPid() public virtual DimPublication DimPublication { get; set; } = null!; public virtual DimPublicationChannel DimPublicationChannel { get; set; } = null!; public virtual DimResearchActivity DimResearchActivity { get; set; } = null!; + public virtual DimResearchCommunity? DimResearchCommunity { get; set; } public virtual DimResearchDataCatalog DimResearchDataCatalog { get; set; } = null!; public virtual DimResearchDataset DimResearchDataset { get; set; } = null!; public virtual DimService DimService { get; set; } = null!; diff --git a/aspnetcore/src/DatabaseContext/Entities/DimReferencedatum.cs b/aspnetcore/src/DatabaseContext/Entities/DimReferencedatum.cs index 6b1b90e..3621a53 100644 --- a/aspnetcore/src/DatabaseContext/Entities/DimReferencedatum.cs +++ b/aspnetcore/src/DatabaseContext/Entities/DimReferencedatum.cs @@ -9,7 +9,10 @@ public DimReferencedatum() { BrGrantedPermissions = new HashSet(); DimAffiliations = new HashSet(); + DimCallDecisions = new HashSet(); + DimCallProgrammesNavigation = new HashSet(); DimEducations = new HashSet(); + DimFundingDecisions = new HashSet(); DimLocallyReportedPubInfoSelfArchivedLicenseCodeNavigations = new HashSet(); DimLocallyReportedPubInfoSelfArchivedVersionCodeNavigations = new HashSet(); DimProfileOnlyDatasets = new HashSet(); @@ -65,7 +68,10 @@ public DimReferencedatum() public virtual DimReferencedatum DimReferencedata { get; set; } = null!; public virtual ICollection BrGrantedPermissions { get; set; } public virtual ICollection DimAffiliations { get; set; } + public virtual ICollection DimCallDecisions { get; set; } + public virtual ICollection DimCallProgrammesNavigation { get; set; } public virtual ICollection DimEducations { get; set; } + public virtual ICollection DimFundingDecisions { get; set; } public virtual ICollection DimLocallyReportedPubInfoSelfArchivedLicenseCodeNavigations { get; set; } public virtual ICollection DimLocallyReportedPubInfoSelfArchivedVersionCodeNavigations { get; set; } public virtual ICollection DimProfileOnlyDatasets { get; set; } diff --git a/aspnetcore/src/DatabaseContext/Entities/DimRegisteredDataSource.cs b/aspnetcore/src/DatabaseContext/Entities/DimRegisteredDataSource.cs index a556098..06199b1 100644 --- a/aspnetcore/src/DatabaseContext/Entities/DimRegisteredDataSource.cs +++ b/aspnetcore/src/DatabaseContext/Entities/DimRegisteredDataSource.cs @@ -26,6 +26,7 @@ public DimRegisteredDataSource() DimResearchActivities = new HashSet(); DimResearchCommunities = new HashSet(); DimResearchDatasets = new HashSet(); + DimResearchProjects = new HashSet(); DimResearcherDescriptions = new HashSet(); DimResearcherToResearchCommunities = new HashSet(); DimTelephoneNumbers = new HashSet(); @@ -62,6 +63,7 @@ public DimRegisteredDataSource() public virtual ICollection DimResearchActivities { get; set; } public virtual ICollection DimResearchCommunities { get; set; } public virtual ICollection DimResearchDatasets { get; set; } + public virtual ICollection DimResearchProjects { get; set; } public virtual ICollection DimResearcherDescriptions { get; set; } public virtual ICollection DimResearcherToResearchCommunities { get; set; } public virtual ICollection DimTelephoneNumbers { get; set; } diff --git a/aspnetcore/src/DatabaseContext/Entities/DimResearchCommunity.cs b/aspnetcore/src/DatabaseContext/Entities/DimResearchCommunity.cs index c14c72f..e55b62c 100644 --- a/aspnetcore/src/DatabaseContext/Entities/DimResearchCommunity.cs +++ b/aspnetcore/src/DatabaseContext/Entities/DimResearchCommunity.cs @@ -7,6 +7,7 @@ public partial class DimResearchCommunity { public DimResearchCommunity() { + DimPids = new HashSet(); DimResearcherToResearchCommunities = new HashSet(); DimWebLinks = new HashSet(); FactContributions = new HashSet(); @@ -29,6 +30,7 @@ public DimResearchCommunity() public int DimRegisteredDataSourceId { get; set; } public virtual DimRegisteredDataSource DimRegisteredDataSource { get; set; } = null!; + public virtual ICollection DimPids { get; set; } public virtual ICollection DimResearcherToResearchCommunities { get; set; } public virtual ICollection DimWebLinks { get; set; } public virtual ICollection FactContributions { get; set; } diff --git a/aspnetcore/src/DatabaseContext/Entities/DimResearchProject.cs b/aspnetcore/src/DatabaseContext/Entities/DimResearchProject.cs new file mode 100644 index 0000000..87dc836 --- /dev/null +++ b/aspnetcore/src/DatabaseContext/Entities/DimResearchProject.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; + +namespace CSC.PublicApi.DatabaseContext.Entities +{ + public partial class DimResearchProject + { + public int Id { get; set; } + /// + /// Hanke - vastuuorganisaatio + /// + public int ResponsibleOrganization { get; set; } + /// + /// Hanke - nimi + /// + public string? NameFi { get; set; } + public string? NameEn { get; set; } + public string? NameSv { get; set; } + /// + /// Hanke - lyhenne + /// + public string? AbbrevationFi { get; set; } + public string? AbbrevationEn { get; set; } + public string? AbbrevationSv { get; set; } + /// + /// Hanke - tiivistelmä + /// + public string? SummaryFi { get; set; } + public string? SummaryEn { get; set; } + public string? SummarySv { get; set; } + /// + /// Hanke - lisätieto + /// + public string? AdditionalInfromationFi { get; set; } + public string? AdditionalInformationEn { get; set; } + public string? AddtitionalInformationSv { get; set; } + /// + /// Hanke - alkamispäivämäärä + /// + public int? StartDate { get; set; } + /// + /// Hanke - päättymispäivämäärä + /// + public int? EndDate { get; set; } + public string SourceId { get; set; } = null!; + public string? SourceDescription { get; set; } + public DateTime? Created { get; set; } + public DateTime? Modified { get; set; } + public int DimRegisteredDataSourceId { get; set; } + public int? ResponsiblePerson { get; set; } + public string? GoalsFi { get; set; } + public string? GoalsEn { get; set; } + public string? GoalsSv { get; set; } + public string? OutcomeEffectFi { get; set; } + public string? OutcomeEffectEn { get; set; } + public string? OutcomeEffectSv { get; set; } + + public virtual DimRegisteredDataSource DimRegisteredDataSource { get; set; } = null!; + public virtual DimDate? EndDateNavigation { get; set; } + public virtual DimOrganization ResponsibleOrganizationNavigation { get; set; } = null!; + public virtual DimName? ResponsiblePersonNavigation { get; set; } + public virtual DimDate? StartDateNavigation { get; set; } + } +} diff --git a/aspnetcore/src/DatabaseContext/Entities/DimTypeOfFunding.cs b/aspnetcore/src/DatabaseContext/Entities/DimTypeOfFunding.cs index 39e4515..4596706 100644 --- a/aspnetcore/src/DatabaseContext/Entities/DimTypeOfFunding.cs +++ b/aspnetcore/src/DatabaseContext/Entities/DimTypeOfFunding.cs @@ -7,7 +7,6 @@ public partial class DimTypeOfFunding { public DimTypeOfFunding() { - DimFundingDecisions = new HashSet(); DimProfileOnlyFundingDecisions = new HashSet(); InverseDimTypeOfFundingNavigation = new HashSet(); } @@ -24,7 +23,6 @@ public DimTypeOfFunding() public int DimTypeOfFundingId { get; set; } public virtual DimTypeOfFunding DimTypeOfFundingNavigation { get; set; } = null!; - public virtual ICollection DimFundingDecisions { get; set; } public virtual ICollection DimProfileOnlyFundingDecisions { get; set; } public virtual ICollection InverseDimTypeOfFundingNavigation { get; set; } } diff --git a/aspnetcore/src/DatabaseContext/Entities/DimUserProfile.cs b/aspnetcore/src/DatabaseContext/Entities/DimUserProfile.cs index 0be6b37..23f865c 100644 --- a/aspnetcore/src/DatabaseContext/Entities/DimUserProfile.cs +++ b/aspnetcore/src/DatabaseContext/Entities/DimUserProfile.cs @@ -27,6 +27,7 @@ public DimUserProfile() public string? OrcidId { get; set; } public int? Statuscode { get; set; } public bool Hidden { get; set; } + public bool PublishNewOrcidData { get; set; } public virtual DimKnownPerson DimKnownPerson { get; set; } = null!; public virtual ICollection BrGrantedPermissions { get; set; } diff --git a/aspnetcore/src/DatabaseContext/Entities/DimWebLink.cs b/aspnetcore/src/DatabaseContext/Entities/DimWebLink.cs index 4c60388..608116b 100644 --- a/aspnetcore/src/DatabaseContext/Entities/DimWebLink.cs +++ b/aspnetcore/src/DatabaseContext/Entities/DimWebLink.cs @@ -31,6 +31,7 @@ public DimWebLink() public int? DimProfileOnlyResearchActivityId { get; set; } public int? DimProfileOnlyDatasetId { get; set; } public int? DimProfileOnlyFundingDecisionId { get; set; } + public int? DimResearchProjectId { get; set; } public virtual DimCallProgramme? DimCallProgramme { get; set; } public virtual DimFundingDecision? DimFundingDecision { get; set; } diff --git a/aspnetcore/src/DatabaseContext/Entities/FactContribution.cs b/aspnetcore/src/DatabaseContext/Entities/FactContribution.cs index b8c8b72..e4eb447 100644 --- a/aspnetcore/src/DatabaseContext/Entities/FactContribution.cs +++ b/aspnetcore/src/DatabaseContext/Entities/FactContribution.cs @@ -24,6 +24,7 @@ public partial class FactContribution public string? SourceDescription { get; set; } public DateTime? Created { get; set; } public DateTime? Modified { get; set; } + public int DimResearchProjectId { get; set; } public virtual DimDate DimDate { get; set; } = null!; public virtual DimFundingDecision DimFundingDecision { get; set; } = null!; From 43004587b84cb7eab9623c587e470cb8a1474448 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Sa=CC=88rkikoski?= Date: Wed, 22 May 2024 09:36:14 +0300 Subject: [PATCH 2/3] Add missing projection in FundingDecision mapper --- .../Repositories/Maps/FundingDecisionProfile.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/aspnetcore/src/Repositories/Maps/FundingDecisionProfile.cs b/aspnetcore/src/Repositories/Maps/FundingDecisionProfile.cs index 9a7aacd..7526864 100644 --- a/aspnetcore/src/Repositories/Maps/FundingDecisionProfile.cs +++ b/aspnetcore/src/Repositories/Maps/FundingDecisionProfile.cs @@ -53,6 +53,13 @@ public FundingDecisionProfile() .ForMember(dst => dst.FundingReceivers, opt => opt.Ignore()) // GrantedFunding will be populated during the in memory operations; .ForMember(dst => dst.Funder, opt => opt.Ignore()) // Funder will be populated during the in memory operations; ; + + CreateProjection() + .AddTransform(s => string.IsNullOrWhiteSpace(s) ? null : s) + .ForMember(dst => dst.Code, opt => opt.MapFrom(src => src.CodeValue)) + .ForMember(dst => dst.NameFi, opt => opt.MapFrom(src => src.NameFi)) + .ForMember(dst => dst.NameSv, opt => opt.MapFrom(src => src.NameSv)) + .ForMember(dst => dst.NameEn, opt => opt.MapFrom(src => src.NameEn)); CreateProjection() .ConvertUsing(dimDate => dimDate.Id == -1 ? null : new DateTime(dimDate.Year, dimDate.Month, dimDate.Day)); @@ -105,14 +112,7 @@ public FundingDecisionProfile() .ForMember(dst => dst.NameEn, opt => opt.MapFrom(src => src.NameEn)) .ForMember(dst => dst.EuCallId, opt => opt.MapFrom(src => src.EuCallId)) .ForMember(dst => dst.TopicId, opt => opt.MapFrom(src => src.Abbreviation)); - - CreateProjection() - .AddTransform(s => string.IsNullOrWhiteSpace(s) ? null : s) - .ForMember(dst => dst.NameFi, opt => opt.MapFrom(src => src.NameFi)) - .ForMember(dst => dst.NameSv, opt => opt.MapFrom(src => src.NameSv)) - .ForMember(dst => dst.NameEn, opt => opt.MapFrom(src => src.NameEn)) - .ForMember(dst => dst.Code, opt => opt.MapFrom(src => src.TypeId)); - + CreateProjection() .AddTransform(s => string.IsNullOrWhiteSpace(s) ? null : s) .ForMember(dst => dst.NameFi, opt => opt.MapFrom(src => src.DimReferencedata.NameFi)) From a7c9a1fa16f39be3b9abc0e03e3508706d58e467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Sa=CC=88rkikoski?= Date: Wed, 22 May 2024 09:39:59 +0300 Subject: [PATCH 3/3] Fix error in FundingDecision indexer unit test --- .../test/Indexer.Tests/Maps/FundingDecisionProfileTest.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aspnetcore/test/Indexer.Tests/Maps/FundingDecisionProfileTest.cs b/aspnetcore/test/Indexer.Tests/Maps/FundingDecisionProfileTest.cs index 20d67d7..19b56a6 100644 --- a/aspnetcore/test/Indexer.Tests/Maps/FundingDecisionProfileTest.cs +++ b/aspnetcore/test/Indexer.Tests/Maps/FundingDecisionProfileTest.cs @@ -164,12 +164,12 @@ private static DimFundingDecision GetSource() } }, DimOrganizationIdFunder = 3, - DimTypeOfFunding = new DimTypeOfFunding + DimTypeOfFunding = new DimReferencedatum { NameFi = "type fi", NameSv = "type sv", NameEn = "type en", - TypeId = "type id" + CodeValue = "type id" }, DimCallProgramme = new DimCallProgramme {