Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.29 release #109

Merged
merged 7 commits into from
Dec 11, 2023
79 changes: 38 additions & 41 deletions aspnetcore/src/DatabaseContext/ApiDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ public ApiDbContext(DbContextOptions<ApiDbContext> options)
public virtual DbSet<FactDimReferencedataFieldOfScience> FactDimReferencedataFieldOfSciences { get; set; } = null!;
public virtual DbSet<FactFieldValue> FactFieldValues { get; set; } = null!;
public virtual DbSet<FactInfraKeyword> FactInfraKeywords { get; set; } = null!;
public virtual DbSet<FactJufoClassCodesForPubChannel> FactJufoClassCodesForPubChannels { get; set; } = null!;
public virtual DbSet<FactUpkeep> FactUpkeeps { get; set; } = null!;

protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
Expand Down Expand Up @@ -2808,6 +2807,8 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.HasColumnType("datetime")
.HasColumnName("created");

entity.Property(e => e.DimPublicationChannelId).HasColumnName("dim_publication_channel_id");

entity.Property(e => e.DimRegisteredDataSourceId).HasColumnName("dim_registered_data_source_id");

entity.Property(e => e.Doi)
Expand Down Expand Up @@ -2850,13 +2851,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.HasMaxLength(4000)
.HasColumnName("journal_name");

entity.Property(e => e.JufoClassCode)
.HasMaxLength(255)
.HasColumnName("jufo_class_code");

entity.Property(e => e.JufoCode)
.HasMaxLength(255)
.HasColumnName("jufo_code");
entity.Property(e => e.JufoClass).HasColumnName("jufo_class");

entity.Property(e => e.JuuliAddress)
.HasMaxLength(4000)
Expand All @@ -2876,10 +2871,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.HasMaxLength(255)
.HasColumnName("open_access");

entity.Property(e => e.OpenAccessCode)
.HasMaxLength(255)
.HasColumnName("open_access_code");

entity.Property(e => e.OriginalPublicationId)
.HasMaxLength(255)
.HasColumnName("original_publication_id");
Expand Down Expand Up @@ -2934,9 +2925,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.HasMaxLength(4000)
.HasColumnName("publisher_name");

entity.Property(e => e.PublisherOpenAccessCode)
.HasMaxLength(255)
.HasColumnName("publisher_open_access_code");
entity.Property(e => e.PublisherOpenAccessCode).HasColumnName("publisher_open_access_code");

entity.Property(e => e.Report).HasColumnName("report");

Expand Down Expand Up @@ -2967,12 +2956,24 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.HasForeignKey(d => d.ArticleTypeCode)
.HasConstraintName("article_type_code");

entity.HasOne(d => d.DimPublicationChannel)
.WithMany(p => p.DimPublications)
.HasForeignKey(d => d.DimPublicationChannelId)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("publication_channel");

entity.HasOne(d => d.DimRegisteredDataSource)
.WithMany(p => p.DimPublications)
.HasForeignKey(d => d.DimRegisteredDataSourceId)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FKdim_public896887");

entity.HasOne(d => d.JufoClassNavigation)
.WithMany(p => p.DimPublicationJufoClassNavigations)
.HasForeignKey(d => d.JufoClass)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("jufo_class");

entity.HasOne(d => d.LanguageCodeNavigation)
.WithMany(p => p.DimPublicationLanguageCodeNavigations)
.HasForeignKey(d => d.LanguageCode)
Expand Down Expand Up @@ -3007,6 +3008,12 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.HasForeignKey(d => d.PublicationTypeCode2)
.HasConstraintName("publication_type_code2");

entity.HasOne(d => d.PublisherOpenAccessCodeNavigation)
.WithMany(p => p.DimPublicationPublisherOpenAccessCodeNavigations)
.HasForeignKey(d => d.PublisherOpenAccessCode)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("publisher_open_access");

entity.HasOne(d => d.TargetAudienceCodeNavigation)
.WithMany(p => p.DimPublicationTargetAudienceCodeNavigations)
.HasForeignKey(d => d.TargetAudienceCode)
Expand Down Expand Up @@ -3046,13 +3053,29 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.HasMaxLength(4000)
.HasColumnName("channel_name_anylang");

entity.Property(e => e.Created)
.HasColumnType("datetime")
.HasColumnName("created");

entity.Property(e => e.JufoCode)
.HasMaxLength(255)
.HasColumnName("jufo_code");

entity.Property(e => e.Modified)
.HasColumnType("datetime")
.HasColumnName("modified");

entity.Property(e => e.PublisherNameText)
.HasMaxLength(4000)
.HasColumnName("publisher_name_text");

entity.Property(e => e.SourceDescription)
.HasMaxLength(255)
.HasColumnName("source_description");

entity.Property(e => e.SourceId)
.HasMaxLength(255)
.HasColumnName("source_id");
});

modelBuilder.Entity<DimPurpose>(entity =>
Expand Down Expand Up @@ -4765,32 +4788,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.HasConstraintName("FKfact_infra619117");
});

modelBuilder.Entity<FactJufoClassCodesForPubChannel>(entity =>
{
entity.HasKey(e => new { e.DimPublicationChannelId, e.DimReferencedataId, e.Year })
.HasName("PK__fact_juf__0E099E4B39813744");

entity.ToTable("fact_jufo_class_codes_for_pub_channels");

entity.Property(e => e.DimPublicationChannelId).HasColumnName("dim_publication_channel_id");

entity.Property(e => e.DimReferencedataId).HasColumnName("dim_referencedata_id");

entity.Property(e => e.Year).HasColumnName("year");

entity.HasOne(d => d.DimPublicationChannel)
.WithMany(p => p.FactJufoClassCodesForPubChannels)
.HasForeignKey(d => d.DimPublicationChannelId)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("jufo_classes");

entity.HasOne(d => d.DimReferencedata)
.WithMany(p => p.FactJufoClassCodesForPubChannels)
.HasForeignKey(d => d.DimReferencedataId)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FKfact_jufo_876058");
});

modelBuilder.Entity<FactUpkeep>(entity =>
{
entity.HasKey(e => new { e.DimOrganizationId, e.DimGeoId, e.DimInfrastructureId, e.DimServiceId, e.DimServicePointId, e.DimDateIdStart, e.DimDateIdEnd })
Expand Down
10 changes: 6 additions & 4 deletions aspnetcore/src/DatabaseContext/Entities/DimPublication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ public DimPublication()
public string? ArticleNumberText { get; set; }
public string? Isbn { get; set; }
public string? Isbn2 { get; set; }
public string? JufoCode { get; set; }
public string? JufoClassCode { get; set; }
public int PublicationCountryCode { get; set; }
public string? JournalName { get; set; }
public string? Issn { get; set; }
Expand All @@ -49,7 +47,6 @@ public DimPublication()
public bool GovermentCollaboration { get; set; }
public bool OtherCollaboration { get; set; }
public int LanguageCode { get; set; }
public string? OpenAccessCode { get; set; }
public bool SpecialStateSubsidy { get; set; }
public bool? BusinessCollaboration { get; set; }
public string? DoiHandle { get; set; }
Expand All @@ -74,17 +71,22 @@ public DimPublication()
public DateTime? Modified { get; set; }
public int DimRegisteredDataSourceId { get; set; }
public string? OpenAccess { get; set; }
public string? PublisherOpenAccessCode { get; set; }
public int PublisherOpenAccessCode { get; set; }
public string? Abstract { get; set; }
public int DimPublicationChannelId { get; set; }
public int JufoClass { get; set; }

public virtual DimReferencedatum? ArticleTypeCodeNavigation { get; set; }
public virtual DimPublicationChannel DimPublicationChannel { get; set; } = null!;
public virtual DimRegisteredDataSource DimRegisteredDataSource { get; set; } = null!;
public virtual DimReferencedatum JufoClassNavigation { get; set; } = null!;
public virtual DimReferencedatum LanguageCodeNavigation { get; set; } = null!;
public virtual DimReferencedatum LicenseCodeNavigation { get; set; } = null!;
public virtual DimReferencedatum? ParentPublicationTypeCodeNavigation { get; set; }
public virtual DimReferencedatum PublicationCountryCodeNavigation { get; set; } = null!;
public virtual DimReferencedatum? PublicationTypeCode2Navigation { get; set; }
public virtual DimReferencedatum PublicationTypeCodeNavigation { get; set; } = null!;
public virtual DimReferencedatum PublisherOpenAccessCodeNavigation { get; set; } = null!;
public virtual DimReferencedatum? TargetAudienceCodeNavigation { get; set; }
public virtual DimReferencedatum ThesisTypeCodeNavigation { get; set; } = null!;
public virtual ICollection<DimLocallyReportedPubInfo> DimLocallyReportedPubInfos { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,21 @@ public partial class DimPublicationChannel
public DimPublicationChannel()
{
DimPids = new HashSet<DimPid>();
DimPublications = new HashSet<DimPublication>();
DimResearchActivities = new HashSet<DimResearchActivity>();
FactJufoClassCodesForPubChannels = new HashSet<FactJufoClassCodesForPubChannel>();
}

public int Id { get; set; }
public string? JufoCode { get; set; }
public string? ChannelNameAnylang { get; set; }
public string? PublisherNameText { get; set; }
public string SourceId { get; set; } = null!;
public string? SourceDescription { get; set; }
public DateTime? Created { get; set; }
public DateTime? Modified { get; set; }

public virtual ICollection<DimPid> DimPids { get; set; }
public virtual ICollection<DimPublication> DimPublications { get; set; }
public virtual ICollection<DimResearchActivity> DimResearchActivities { get; set; }
public virtual ICollection<FactJufoClassCodesForPubChannel> FactJufoClassCodesForPubChannels { get; set; }
}
}
6 changes: 4 additions & 2 deletions aspnetcore/src/DatabaseContext/Entities/DimReferencedatum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ public DimReferencedatum()
DimProfileOnlyPublicationThesisTypeCodeNavigations = new HashSet<DimProfileOnlyPublication>();
DimProfileOnlyPublicationTypeClassificationCodeNavigations = new HashSet<DimProfileOnlyPublication>();
DimPublicationArticleTypeCodeNavigations = new HashSet<DimPublication>();
DimPublicationJufoClassNavigations = new HashSet<DimPublication>();
DimPublicationLanguageCodeNavigations = new HashSet<DimPublication>();
DimPublicationLicenseCodeNavigations = new HashSet<DimPublication>();
DimPublicationParentPublicationTypeCodeNavigations = new HashSet<DimPublication>();
DimPublicationPublicationCountryCodeNavigations = new HashSet<DimPublication>();
DimPublicationPublicationTypeCode2Navigations = new HashSet<DimPublication>();
DimPublicationPublicationTypeCodeNavigations = new HashSet<DimPublication>();
DimPublicationPublisherOpenAccessCodeNavigations = new HashSet<DimPublication>();
DimPublicationTargetAudienceCodeNavigations = new HashSet<DimPublication>();
DimPublicationThesisTypeCodeNavigations = new HashSet<DimPublication>();
DimResearchDatasetDimReferencedataAvailabilityNavigations = new HashSet<DimResearchDataset>();
Expand All @@ -38,7 +40,6 @@ public DimReferencedatum()
FactDimReferencedataFieldOfSciences = new HashSet<FactDimReferencedataFieldOfScience>();
FactFieldValueDimReferencedataActorRoles = new HashSet<FactFieldValue>();
FactFieldValueDimReferencedataFieldOfSciences = new HashSet<FactFieldValue>();
FactJufoClassCodesForPubChannels = new HashSet<FactJufoClassCodesForPubChannel>();
InverseDimReferencedata = new HashSet<DimReferencedatum>();
DimCallProgrammes = new HashSet<DimCallProgramme>();
DimPublications = new HashSet<DimPublication>();
Expand Down Expand Up @@ -77,12 +78,14 @@ public DimReferencedatum()
public virtual ICollection<DimProfileOnlyPublication> DimProfileOnlyPublicationThesisTypeCodeNavigations { get; set; }
public virtual ICollection<DimProfileOnlyPublication> DimProfileOnlyPublicationTypeClassificationCodeNavigations { get; set; }
public virtual ICollection<DimPublication> DimPublicationArticleTypeCodeNavigations { get; set; }
public virtual ICollection<DimPublication> DimPublicationJufoClassNavigations { get; set; }
public virtual ICollection<DimPublication> DimPublicationLanguageCodeNavigations { get; set; }
public virtual ICollection<DimPublication> DimPublicationLicenseCodeNavigations { get; set; }
public virtual ICollection<DimPublication> DimPublicationParentPublicationTypeCodeNavigations { get; set; }
public virtual ICollection<DimPublication> DimPublicationPublicationCountryCodeNavigations { get; set; }
public virtual ICollection<DimPublication> DimPublicationPublicationTypeCode2Navigations { get; set; }
public virtual ICollection<DimPublication> DimPublicationPublicationTypeCodeNavigations { get; set; }
public virtual ICollection<DimPublication> DimPublicationPublisherOpenAccessCodeNavigations { get; set; }
public virtual ICollection<DimPublication> DimPublicationTargetAudienceCodeNavigations { get; set; }
public virtual ICollection<DimPublication> DimPublicationThesisTypeCodeNavigations { get; set; }
public virtual ICollection<DimResearchDataset> DimResearchDatasetDimReferencedataAvailabilityNavigations { get; set; }
Expand All @@ -92,7 +95,6 @@ public DimReferencedatum()
public virtual ICollection<FactDimReferencedataFieldOfScience> FactDimReferencedataFieldOfSciences { get; set; }
public virtual ICollection<FactFieldValue> FactFieldValueDimReferencedataActorRoles { get; set; }
public virtual ICollection<FactFieldValue> FactFieldValueDimReferencedataFieldOfSciences { get; set; }
public virtual ICollection<FactJufoClassCodesForPubChannel> FactJufoClassCodesForPubChannels { get; set; }
public virtual ICollection<DimReferencedatum> InverseDimReferencedata { get; set; }

public virtual ICollection<DimCallProgramme> DimCallProgrammes { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ namespace CSC.PublicApi.DatabaseContext.Entities
public partial class FactJufoClassCodesForPubChannel
{
public int DimPublicationChannelId { get; set; }
public int DimReferencedataId { get; set; }
public int JufoClasses { get; set; }
public int Year { get; set; }
public string SourceId { get; set; } = null!;
public string? SourceDescription { get; set; }
public DateTime? Created { get; set; }
public DateTime? Modified { get; set; }

public virtual DimPublicationChannel DimPublicationChannel { get; set; } = null!;
public virtual DimReferencedatum DimReferencedata { get; set; } = null!;
public virtual DimReferencedatum JufoClassesNavigation { get; set; } = null!;
}
}
7 changes: 3 additions & 4 deletions aspnetcore/src/Repositories/Maps/PublicationProfile.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using CSC.PublicApi.DatabaseContext.Entities;
using CSC.PublicApi.Service.Models;
using CSC.PublicApi.Service.Models.Publication;
using Microsoft.Data.SqlClient;
using FactContribution = CSC.PublicApi.Service.Models.Publication.FactContribution;
using Name = CSC.PublicApi.Service.Models.Publication.Name;
using Profile = AutoMapper.Profile;
Expand Down Expand Up @@ -45,13 +44,13 @@ public PublicationProfile()
.ForMember(dst => dst.ParentPublicationName, opt => opt.MapFrom(src => src.ParentPublicationName))
.ForMember(dst => dst.ParentPublicationPublisher, opt => opt.MapFrom(src => src.ParentPublicationPublisher))
.ForMember(dst => dst.OpenAccess, opt => opt.MapFrom(src => src.OpenAccess != "9" ? src.OpenAccess : null))
.ForMember(dst => dst.PublisherOpenAccess, opt => opt.MapFrom(src => src.PublisherOpenAccessCode != "9" ? src.PublisherOpenAccessCode : null))
.ForMember(dst => dst.PublisherOpenAccess, opt => opt.MapFrom(src => src.PublisherOpenAccessCodeNavigation.CodeValue != "9" ? src.PublisherOpenAccessCodeNavigation : null))
.ForMember(dst => dst.Isbn1, opt => opt.MapFrom(src => src.Isbn))
.ForMember(dst => dst.Isbn2, opt => opt.MapFrom(src => src.Isbn2))
.ForMember(dst => dst.PublisherName, opt => opt.MapFrom(src => src.PublisherName))
.ForMember(dst => dst.PublisherLocation, opt => opt.MapFrom(src => src.PublisherLocation))
.ForMember(dst => dst.JufoCode, opt => opt.MapFrom(src => src.JufoCode))
.ForMember(dst => dst.JufoClass, opt => opt.MapFrom(src => src.JufoClassCode))
.ForMember(dst => dst.JufoCode, opt => opt.MapFrom(src => src.DimPublicationChannel.JufoCode))
.ForMember(dst => dst.JufoClass, opt => opt.MapFrom(src => src.JufoClassNavigation))
.ForMember(dst => dst.Doi, opt => opt.MapFrom(src => src.Doi))
.ForMember(dst => dst.DoiHandle, opt => opt.MapFrom(src => src.DoiHandle))
.ForMember(dst => dst.FieldsOfScience, opt => opt.MapFrom(src => src.FactDimReferencedataFieldOfSciences.Select(f => f.DimReferencedata)))
Expand Down
Loading
Loading