Added EventAgenda

This commit is contained in:
Thomas Fransolet 2025-07-10 16:43:29 +02:00
parent 400084fad5
commit 8801c56f75
10 changed files with 2329 additions and 4 deletions

View File

@ -1,7 +1,9 @@
using ManagerService.DTOs;
using ManagerService.Data.SubSection;
using ManagerService.DTOs;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ManagerService.Data
{
@ -47,6 +49,9 @@ namespace ManagerService.Data
public LayoutMainPageType LayoutMainPage { get; set; } = LayoutMainPageType.MasonryGrid;
public List<string> Languages { get; set; } // All app must support languages, if not, client's problem
public string? SectionEventId { get; set; }
[ForeignKey("SectionEventId")]
public SectionEvent? SectionEvent { get; set; } // => To Display in large a event with countdown (in mobile app).
public ApplicationInstanceDTO ToDTO()

View File

@ -45,6 +45,8 @@ namespace ManagerService.Data
public string LoaderImageUrl { get; set; } // Config can have their specific loader if needed
public bool IsQRCode { get; set; }
public ConfigurationDTO ToDTO(List<string> sectionIds)
{
return new ConfigurationDTO()

View File

@ -0,0 +1,81 @@
using Manager.DTOs;
using ManagerService.DTOs;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Drawing.Drawing2D;
using static ManagerService.Data.SubSection.SectionEvent;
namespace ManagerService.Data.SubSection
{
/// <summary>
/// Event Agenda
/// </summary>
public class EventAgenda
{
[Key]
[Required]
public int Id { get; set; }
[Required]
[Column(TypeName = "jsonb")]
public List<TranslationAndResourceDTO> Label { get; set; }
[Required]
[Column(TypeName = "jsonb")]
public List<TranslationAndResourceDTO> Description { get; set; }
public string Type { get; set; }
public DateTime? DateAdded { get; set; }
public DateTime? DateFrom { get; set; }
public DateTime? DateTo { get; set; }
public string? Website { get; set; }
public string ResourceId { get; set; } // Background image id
public Resource Resource { get; set; } // Background image
[Column(TypeName = "jsonb")]
public EventAddress Address { get; set; }
public string Phone { get; set; }
public string Email { get; set; }
public string SectionAgendaId { get; set; }
[ForeignKey("SectionAgendaId")]
public SectionAgenda SectionAgenda { get; set; }
}
public class EventAddress
{
public string Address { get; set; }
public string StreetNumber { get; set; }
public string StreetName { get; set; }
public string City { get; set; }
public string State { get; set; }
public string PostCode { get; set; }
public string Country { get; set; }
public GeometryType GeometryType { get; set; }
public List<Coordinate> Coordinates { get; set; } = new(); // 1 point = marker, plusieurs = polyline/polygon
public string PolyColor { get; set; } // color of the polyline or polygon
public int Zoom { get; set; }
}
}

View File

@ -1,6 +1,5 @@
using Manager.DTOs;
using ManagerService.DTOs;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@ -14,12 +13,18 @@ namespace ManagerService.Data.SubSection
/// </summary>
public class SectionAgenda : Section
{
[Required]
public bool IsOnlineAgenda { get; set; } = true;
[Required]
[Column(TypeName = "jsonb")]
public List<TranslationDTO> AgendaResourceIds { get; set; } // All json files for all languages
public MapProvider? AgendaMapProvider { get; set; } // Default = Google
[Required]
public List<EventAgenda> EventAgendas { get; set; }
public AgendaDTO ToDTO()
{
return new AgendaDTO()

View File

@ -14,7 +14,7 @@ namespace ManagerService.Data.SubSection
{
[Required]
[Column(TypeName = "jsonb")]
public List<TranslationDTO> ArticleContent { get; set; }
public List<TranslationDTO> ArticleContent { get; set; } // Content of article
public bool ArticleIsContentTop { get; set; } // MyVisit - True if content is displayed at top, false otherwise
@ -26,7 +26,7 @@ namespace ManagerService.Data.SubSection
[Required]
[Column(TypeName = "jsonb")]
public List<ContentDTO> ArticleContents { get; set; }
public List<ContentDTO> ArticleContents { get; set; } // List of picture etc
public ArticleDTO ToDTO()
{

View File

@ -0,0 +1,981 @@
// <auto-generated />
using System;
using System.Collections.Generic;
using Manager.DTOs;
using ManagerService.DTOs;
using ManagerService.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace ManagerService.Migrations
{
[DbContext(typeof(MyInfoMateDbContext))]
[Migration("20250710143452_AddedEventAgendaAndMisc")]
partial class AddedEventAgendaAndMisc
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.2")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("ManagerService.DTOs.ResourceDTO", b =>
{
b.Property<string>("id")
.HasColumnType("text");
b.Property<DateTime>("dateCreation")
.HasColumnType("timestamp with time zone");
b.Property<string>("instanceId")
.HasColumnType("text");
b.Property<string>("label")
.HasColumnType("text");
b.Property<int>("type")
.HasColumnType("integer");
b.Property<string>("url")
.HasColumnType("text");
b.HasKey("id");
b.ToTable("ResourceDTO");
});
modelBuilder.Entity("ManagerService.Data.Configuration", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<DateTime>("DateCreation")
.HasColumnType("timestamp with time zone");
b.Property<string>("ImageId")
.HasColumnType("text");
b.Property<string>("ImageSource")
.HasColumnType("text");
b.Property<string>("InstanceId")
.IsRequired()
.HasColumnType("text");
b.Property<bool>("IsOffline")
.HasColumnType("boolean");
b.Property<bool>("IsQRCode")
.HasColumnType("boolean");
b.Property<string>("Label")
.IsRequired()
.HasColumnType("text");
b.PrimitiveCollection<List<string>>("Languages")
.HasColumnType("text[]");
b.Property<string>("LoaderImageId")
.HasColumnType("text");
b.Property<string>("LoaderImageUrl")
.HasColumnType("text");
b.Property<string>("PrimaryColor")
.HasColumnType("text");
b.Property<string>("SecondaryColor")
.HasColumnType("text");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("jsonb");
b.HasKey("Id");
b.ToTable("Configurations");
});
modelBuilder.Entity("ManagerService.Data.Device", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("BatteryLevel")
.HasColumnType("text");
b.Property<string>("ConfigurationId")
.IsRequired()
.HasColumnType("text");
b.Property<bool>("Connected")
.HasColumnType("boolean");
b.Property<string>("ConnectionLevel")
.HasColumnType("text");
b.Property<DateTime>("DateCreation")
.HasColumnType("timestamp with time zone");
b.Property<DateTime>("DateUpdate")
.HasColumnType("timestamp with time zone");
b.Property<string>("Identifier")
.HasColumnType("text");
b.Property<string>("InstanceId")
.IsRequired()
.HasColumnType("text");
b.Property<string>("IpAddressETH")
.HasColumnType("text");
b.Property<string>("IpAddressWLAN")
.HasColumnType("text");
b.Property<DateTime>("LastBatteryLevel")
.HasColumnType("timestamp with time zone");
b.Property<DateTime>("LastConnectionLevel")
.HasColumnType("timestamp with time zone");
b.Property<string>("Name")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("ConfigurationId");
b.ToTable("Devices");
});
modelBuilder.Entity("ManagerService.Data.Instance", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<DateTime>("DateCreation")
.HasColumnType("timestamp with time zone");
b.Property<bool>("IsMobile")
.HasColumnType("boolean");
b.Property<bool>("IsPushNotification")
.HasColumnType("boolean");
b.Property<bool>("IsStatistic")
.HasColumnType("boolean");
b.Property<bool>("IsTablet")
.HasColumnType("boolean");
b.Property<bool>("IsVR")
.HasColumnType("boolean");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<string>("PinCode")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Instances");
});
modelBuilder.Entity("ManagerService.Data.Resource", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<DateTime>("DateCreation")
.HasColumnType("timestamp with time zone");
b.Property<string>("InstanceId")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Label")
.IsRequired()
.HasColumnType("text");
b.Property<int>("Type")
.HasColumnType("integer");
b.Property<string>("Url")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Resources");
});
modelBuilder.Entity("ManagerService.Data.Section", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<int?>("BeaconId")
.HasColumnType("integer");
b.Property<string>("ConfigurationId")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("DateCreation")
.HasColumnType("timestamp with time zone");
b.Property<string>("Description")
.HasColumnType("jsonb");
b.Property<string>("Discriminator")
.IsRequired()
.HasMaxLength(13)
.HasColumnType("character varying(13)");
b.Property<string>("ImageId")
.HasColumnType("text");
b.Property<string>("ImageSource")
.HasColumnType("text");
b.Property<string>("InstanceId")
.IsRequired()
.HasColumnType("text");
b.Property<bool>("IsBeacon")
.HasColumnType("boolean");
b.Property<bool>("IsSubSection")
.HasColumnType("boolean");
b.Property<string>("Label")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Latitude")
.HasColumnType("text");
b.Property<string>("Longitude")
.HasColumnType("text");
b.Property<int?>("MeterZoneGPS")
.HasColumnType("integer");
b.Property<int>("Order")
.HasColumnType("integer");
b.Property<string>("ParentId")
.HasColumnType("text");
b.Property<string>("SectionMenuId")
.HasColumnType("text");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("jsonb");
b.Property<int>("Type")
.HasColumnType("integer");
b.Property<bool>("isActive")
.HasColumnType("boolean");
b.HasKey("Id");
b.HasIndex("SectionMenuId");
b.ToTable("Sections");
b.HasDiscriminator().HasValue("Base");
b.UseTphMappingStrategy();
});
modelBuilder.Entity("ManagerService.Data.SubSection.GeoPoint", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int?>("CategorieId")
.HasColumnType("integer");
b.Property<string>("Contents")
.IsRequired()
.HasColumnType("jsonb");
b.Property<string>("Coordinates")
.HasColumnType("jsonb");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("jsonb");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("jsonb");
b.Property<int>("GeometryType")
.HasColumnType("integer");
b.Property<string>("ImageResourceId")
.HasColumnType("text");
b.Property<string>("ImageUrl")
.HasColumnType("text");
b.Property<string>("Phone")
.IsRequired()
.HasColumnType("jsonb");
b.Property<string>("PolyColor")
.HasColumnType("text");
b.Property<string>("Prices")
.IsRequired()
.HasColumnType("jsonb");
b.Property<string>("Schedules")
.IsRequired()
.HasColumnType("jsonb");
b.Property<string>("SectionEventId")
.HasColumnType("text");
b.Property<string>("SectionMapId")
.HasColumnType("text");
b.Property<string>("Site")
.IsRequired()
.HasColumnType("jsonb");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("jsonb");
b.HasKey("Id");
b.HasIndex("SectionEventId");
b.HasIndex("SectionMapId");
b.ToTable("GeoPoints");
});
modelBuilder.Entity("ManagerService.Data.SubSection.GuidedPath", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Description")
.HasColumnType("jsonb");
b.Property<bool>("HideNextStepsUntilComplete")
.HasColumnType("boolean");
b.Property<string>("InstanceId")
.IsRequired()
.HasColumnType("text");
b.Property<bool>("IsLinear")
.HasColumnType("boolean");
b.Property<int>("Order")
.HasColumnType("integer");
b.Property<bool>("RequireSuccessToAdvance")
.HasColumnType("boolean");
b.Property<string>("SectionEventId")
.HasColumnType("text");
b.Property<string>("SectionMapId")
.HasColumnType("text");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("jsonb");
b.HasKey("Id");
b.HasIndex("SectionEventId");
b.HasIndex("SectionMapId");
b.ToTable("GuidedPaths");
});
modelBuilder.Entity("ManagerService.Data.SubSection.GuidedStep", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Coordinates")
.HasColumnType("jsonb");
b.Property<string>("Description")
.HasColumnType("jsonb");
b.Property<string>("ExpectedAnswer")
.HasColumnType("jsonb");
b.Property<int>("GeometryType")
.HasColumnType("integer");
b.Property<string>("GuidedPathId")
.IsRequired()
.HasColumnType("text");
b.Property<string>("ImageUrl")
.HasColumnType("text");
b.Property<bool>("IsHiddenInitially")
.HasColumnType("boolean");
b.Property<bool>("IsStepLocked")
.HasColumnType("boolean");
b.Property<bool>("IsStepTimer")
.HasColumnType("boolean");
b.Property<string>("MultipleChoiceOptions")
.HasColumnType("jsonb");
b.Property<int>("Order")
.HasColumnType("integer");
b.Property<string>("TimerExpiredMessage")
.HasColumnType("jsonb");
b.Property<int?>("TimerSeconds")
.HasColumnType("integer");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("jsonb");
b.Property<int?>("TriggerGeoPointId")
.HasColumnType("integer");
b.Property<string>("ValidationQuestion")
.HasColumnType("jsonb");
b.Property<int>("ValidationQuestionType")
.HasColumnType("integer");
b.Property<double?>("ZoneRadiusMeters")
.HasColumnType("double precision");
b.HasKey("Id");
b.HasIndex("GuidedPathId");
b.HasIndex("TriggerGeoPointId");
b.ToTable("GuidedSteps");
});
modelBuilder.Entity("ManagerService.Data.SubSection.QuizQuestion", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<List<TranslationAndResourceDTO>>("Label")
.IsRequired()
.HasColumnType("jsonb");
b.Property<int>("Order")
.HasColumnType("integer");
b.Property<string>("ResourceId")
.HasColumnType("text");
b.Property<List<ResponseDTO>>("Responses")
.IsRequired()
.HasColumnType("jsonb");
b.Property<string>("SectionQuizId")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("ResourceId");
b.HasIndex("SectionQuizId");
b.ToTable("QuizQuestions");
});
modelBuilder.Entity("ManagerService.Data.SubSection.SectionEvent+MapAnnotation", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Coordinates")
.HasColumnType("jsonb");
b.Property<int>("GeometryType")
.HasColumnType("integer");
b.Property<string>("Icon")
.HasColumnType("text");
b.Property<string>("IconResourceDTOid")
.HasColumnType("text");
b.Property<List<TranslationDTO>>("Label")
.HasColumnType("jsonb");
b.Property<string>("ProgrammeBlockId")
.HasColumnType("text");
b.Property<List<TranslationDTO>>("Type")
.HasColumnType("jsonb");
b.HasKey("Id");
b.HasIndex("IconResourceDTOid");
b.HasIndex("ProgrammeBlockId");
b.ToTable("MapAnnotation");
});
modelBuilder.Entity("ManagerService.Data.SubSection.SectionEvent+ProgrammeBlock", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<List<TranslationDTO>>("Description")
.HasColumnType("jsonb");
b.Property<DateTime>("EndTime")
.HasColumnType("timestamp with time zone");
b.Property<string>("SectionEventId")
.HasColumnType("text");
b.Property<DateTime>("StartTime")
.HasColumnType("timestamp with time zone");
b.Property<List<TranslationDTO>>("Title")
.HasColumnType("jsonb");
b.HasKey("Id");
b.HasIndex("SectionEventId");
b.ToTable("ProgrammeBlock");
});
modelBuilder.Entity("ManagerService.Data.User", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<DateTime>("DateCreation")
.HasColumnType("timestamp with time zone");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("text");
b.Property<string>("FirstName")
.HasColumnType("text");
b.Property<string>("InstanceId")
.IsRequired()
.HasColumnType("text");
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Token")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Users");
});
modelBuilder.Entity("ManagerService.Data.SubSection.SectionAgenda", b =>
{
b.HasBaseType("ManagerService.Data.Section");
b.Property<int?>("AgendaMapProvider")
.HasColumnType("integer");
b.Property<List<TranslationDTO>>("AgendaResourceIds")
.IsRequired()
.HasColumnType("jsonb");
b.HasDiscriminator().HasValue("Agenda");
});
modelBuilder.Entity("ManagerService.Data.SubSection.SectionArticle", b =>
{
b.HasBaseType("ManagerService.Data.Section");
b.Property<List<TranslationDTO>>("ArticleAudioIds")
.IsRequired()
.HasColumnType("jsonb");
b.Property<List<TranslationDTO>>("ArticleContent")
.IsRequired()
.HasColumnType("jsonb");
b.Property<List<ContentDTO>>("ArticleContents")
.IsRequired()
.HasColumnType("jsonb");
b.Property<bool>("ArticleIsContentTop")
.HasColumnType("boolean");
b.Property<bool>("ArticleIsReadAudioAuto")
.HasColumnType("boolean");
b.HasDiscriminator().HasValue("Article");
});
modelBuilder.Entity("ManagerService.Data.SubSection.SectionEvent", b =>
{
b.HasBaseType("ManagerService.Data.Section");
b.Property<DateTime>("EndDate")
.HasColumnType("timestamp with time zone");
b.Property<List<string>>("ParcoursIds")
.HasColumnType("jsonb");
b.Property<DateTime>("StartDate")
.HasColumnType("timestamp with time zone");
b.HasDiscriminator().HasValue("SectionEvent");
});
modelBuilder.Entity("ManagerService.Data.SubSection.SectionMap", b =>
{
b.HasBaseType("ManagerService.Data.Section");
b.Property<List<CategorieDTO>>("MapCategories")
.IsRequired()
.HasColumnType("jsonb");
b.Property<string>("MapCenterLatitude")
.HasColumnType("text");
b.Property<string>("MapCenterLongitude")
.HasColumnType("text");
b.Property<int?>("MapMapProvider")
.HasColumnType("integer");
b.Property<int?>("MapMapType")
.HasColumnType("integer");
b.Property<string>("MapResourceId")
.HasColumnType("text");
b.Property<int?>("MapTypeMapbox")
.HasColumnType("integer");
b.Property<int>("MapZoom")
.HasColumnType("integer");
b.HasIndex("MapResourceId");
b.HasDiscriminator().HasValue("Map");
});
modelBuilder.Entity("ManagerService.Data.SubSection.SectionMenu", b =>
{
b.HasBaseType("ManagerService.Data.Section");
b.HasDiscriminator().HasValue("Menu");
});
modelBuilder.Entity("ManagerService.Data.SubSection.SectionPdf", b =>
{
b.HasBaseType("ManagerService.Data.Section");
b.Property<List<OrderedTranslationAndResourceDTO>>("PDFOrderedTranslationAndResources")
.IsRequired()
.HasColumnType("jsonb");
b.HasDiscriminator().HasValue("PDF");
});
modelBuilder.Entity("ManagerService.Data.SubSection.SectionPuzzle", b =>
{
b.HasBaseType("ManagerService.Data.Section");
b.Property<bool>("IsSlidingPuzzle")
.HasColumnType("boolean");
b.Property<int>("PuzzleCols")
.HasColumnType("integer");
b.Property<string>("PuzzleImageId")
.HasColumnType("text");
b.Property<List<TranslationAndResourceDTO>>("PuzzleMessageDebut")
.IsRequired()
.HasColumnType("jsonb");
b.Property<List<TranslationAndResourceDTO>>("PuzzleMessageFin")
.IsRequired()
.HasColumnType("jsonb");
b.Property<int>("PuzzleRows")
.HasColumnType("integer");
b.HasIndex("PuzzleImageId");
b.HasDiscriminator().HasValue("Puzzle");
});
modelBuilder.Entity("ManagerService.Data.SubSection.SectionQuiz", b =>
{
b.HasBaseType("ManagerService.Data.Section");
b.Property<List<TranslationAndResourceDTO>>("QuizBadLevel")
.IsRequired()
.HasColumnType("jsonb");
b.Property<List<TranslationAndResourceDTO>>("QuizGoodLevel")
.IsRequired()
.HasColumnType("jsonb");
b.Property<List<TranslationAndResourceDTO>>("QuizGreatLevel")
.IsRequired()
.HasColumnType("jsonb");
b.Property<List<TranslationAndResourceDTO>>("QuizMediumLevel")
.IsRequired()
.HasColumnType("jsonb");
b.HasDiscriminator().HasValue("Quiz");
});
modelBuilder.Entity("ManagerService.Data.SubSection.SectionSlider", b =>
{
b.HasBaseType("ManagerService.Data.Section");
b.Property<List<ContentDTO>>("SliderContents")
.IsRequired()
.HasColumnType("jsonb");
b.HasDiscriminator().HasValue("Slider");
});
modelBuilder.Entity("ManagerService.Data.SubSection.SectionVideo", b =>
{
b.HasBaseType("ManagerService.Data.Section");
b.Property<string>("VideoSource")
.IsRequired()
.HasColumnType("text");
b.HasDiscriminator().HasValue("Video");
});
modelBuilder.Entity("ManagerService.Data.SubSection.SectionWeather", b =>
{
b.HasBaseType("ManagerService.Data.Section");
b.Property<string>("WeatherCity")
.HasColumnType("text");
b.Property<string>("WeatherResult")
.HasColumnType("text");
b.Property<DateTimeOffset?>("WeatherUpdatedDate")
.HasColumnType("timestamp with time zone");
b.HasDiscriminator().HasValue("Weather");
});
modelBuilder.Entity("ManagerService.Data.SubSection.SectionWeb", b =>
{
b.HasBaseType("ManagerService.Data.Section");
b.Property<string>("WebSource")
.IsRequired()
.HasColumnType("text");
b.HasDiscriminator().HasValue("Web");
});
modelBuilder.Entity("ManagerService.Data.Device", b =>
{
b.HasOne("ManagerService.Data.Configuration", "Configuration")
.WithMany()
.HasForeignKey("ConfigurationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Configuration");
});
modelBuilder.Entity("ManagerService.Data.Section", b =>
{
b.HasOne("ManagerService.Data.SubSection.SectionMenu", null)
.WithMany("MenuSections")
.HasForeignKey("SectionMenuId");
});
modelBuilder.Entity("ManagerService.Data.SubSection.GeoPoint", b =>
{
b.HasOne("ManagerService.Data.SubSection.SectionEvent", "SectionEvent")
.WithMany()
.HasForeignKey("SectionEventId");
b.HasOne("ManagerService.Data.SubSection.SectionMap", "SectionMap")
.WithMany("MapPoints")
.HasForeignKey("SectionMapId");
b.Navigation("SectionEvent");
b.Navigation("SectionMap");
});
modelBuilder.Entity("ManagerService.Data.SubSection.GuidedPath", b =>
{
b.HasOne("ManagerService.Data.SubSection.SectionEvent", "SectionEvent")
.WithMany()
.HasForeignKey("SectionEventId");
b.HasOne("ManagerService.Data.SubSection.SectionMap", "SectionMap")
.WithMany()
.HasForeignKey("SectionMapId");
b.Navigation("SectionEvent");
b.Navigation("SectionMap");
});
modelBuilder.Entity("ManagerService.Data.SubSection.GuidedStep", b =>
{
b.HasOne("ManagerService.Data.SubSection.GuidedPath", "GuidedPath")
.WithMany("Steps")
.HasForeignKey("GuidedPathId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("ManagerService.Data.SubSection.GeoPoint", "TriggerGeoPoint")
.WithMany()
.HasForeignKey("TriggerGeoPointId");
b.Navigation("GuidedPath");
b.Navigation("TriggerGeoPoint");
});
modelBuilder.Entity("ManagerService.Data.SubSection.QuizQuestion", b =>
{
b.HasOne("ManagerService.Data.Resource", "Resource")
.WithMany()
.HasForeignKey("ResourceId");
b.HasOne("ManagerService.Data.SubSection.SectionQuiz", "SectionQuiz")
.WithMany("QuizQuestions")
.HasForeignKey("SectionQuizId");
b.Navigation("Resource");
b.Navigation("SectionQuiz");
});
modelBuilder.Entity("ManagerService.Data.SubSection.SectionEvent+MapAnnotation", b =>
{
b.HasOne("ManagerService.DTOs.ResourceDTO", "IconResourceDTO")
.WithMany()
.HasForeignKey("IconResourceDTOid");
b.HasOne("ManagerService.Data.SubSection.SectionEvent+ProgrammeBlock", null)
.WithMany("MapAnnotations")
.HasForeignKey("ProgrammeBlockId");
b.Navigation("IconResourceDTO");
});
modelBuilder.Entity("ManagerService.Data.SubSection.SectionEvent+ProgrammeBlock", b =>
{
b.HasOne("ManagerService.Data.SubSection.SectionEvent", null)
.WithMany("Programme")
.HasForeignKey("SectionEventId");
});
modelBuilder.Entity("ManagerService.Data.SubSection.SectionMap", b =>
{
b.HasOne("ManagerService.Data.Resource", "MapResource")
.WithMany()
.HasForeignKey("MapResourceId");
b.Navigation("MapResource");
});
modelBuilder.Entity("ManagerService.Data.SubSection.SectionPuzzle", b =>
{
b.HasOne("ManagerService.Data.Resource", "PuzzleImage")
.WithMany()
.HasForeignKey("PuzzleImageId");
b.Navigation("PuzzleImage");
});
modelBuilder.Entity("ManagerService.Data.SubSection.GuidedPath", b =>
{
b.Navigation("Steps");
});
modelBuilder.Entity("ManagerService.Data.SubSection.SectionEvent+ProgrammeBlock", b =>
{
b.Navigation("MapAnnotations");
});
modelBuilder.Entity("ManagerService.Data.SubSection.SectionEvent", b =>
{
b.Navigation("Programme");
});
modelBuilder.Entity("ManagerService.Data.SubSection.SectionMap", b =>
{
b.Navigation("MapPoints");
});
modelBuilder.Entity("ManagerService.Data.SubSection.SectionMenu", b =>
{
b.Navigation("MenuSections");
});
modelBuilder.Entity("ManagerService.Data.SubSection.SectionQuiz", b =>
{
b.Navigation("QuizQuestions");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -0,0 +1,29 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ManagerService.Migrations
{
/// <inheritdoc />
public partial class AddedEventAgendaAndMisc : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsQRCode",
table: "Configurations",
type: "boolean",
nullable: false,
defaultValue: false);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsQRCode",
table: "Configurations");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,80 @@
using System;
using System.Collections.Generic;
using ManagerService.DTOs;
using ManagerService.Data.SubSection;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace ManagerService.Migrations
{
/// <inheritdoc />
public partial class MissingChangesEventAgenda : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsOnlineAgenda",
table: "Sections",
type: "boolean",
nullable: true);
migrationBuilder.CreateTable(
name: "EventAgenda",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Label = table.Column<List<TranslationAndResourceDTO>>(type: "jsonb", nullable: false),
Description = table.Column<List<TranslationAndResourceDTO>>(type: "jsonb", nullable: false),
Type = table.Column<string>(type: "text", nullable: true),
DateAdded = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
DateFrom = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
DateTo = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
Website = table.Column<string>(type: "text", nullable: true),
ResourceId = table.Column<string>(type: "text", nullable: true),
Address = table.Column<EventAddress>(type: "jsonb", nullable: true),
Phone = table.Column<string>(type: "text", nullable: true),
Email = table.Column<string>(type: "text", nullable: true),
SectionAgendaId = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_EventAgenda", x => x.Id);
table.ForeignKey(
name: "FK_EventAgenda_Resources_ResourceId",
column: x => x.ResourceId,
principalTable: "Resources",
principalColumn: "Id");
table.ForeignKey(
name: "FK_EventAgenda_Sections_SectionAgendaId",
column: x => x.SectionAgendaId,
principalTable: "Sections",
principalColumn: "Id");
});
migrationBuilder.CreateIndex(
name: "IX_EventAgenda_ResourceId",
table: "EventAgenda",
column: "ResourceId");
migrationBuilder.CreateIndex(
name: "IX_EventAgenda_SectionAgendaId",
table: "EventAgenda",
column: "SectionAgendaId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "EventAgenda");
migrationBuilder.DropColumn(
name: "IsOnlineAgenda",
table: "Sections");
}
}
}

View File

@ -4,6 +4,7 @@ using System.Collections.Generic;
using Manager.DTOs;
using ManagerService.DTOs;
using ManagerService.Data;
using ManagerService.Data.SubSection;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
@ -71,6 +72,9 @@ namespace ManagerService.Migrations
b.Property<bool>("IsOffline")
.HasColumnType("boolean");
b.Property<bool>("IsQRCode")
.HasColumnType("boolean");
b.Property<string>("Label")
.IsRequired()
.HasColumnType("text");
@ -296,6 +300,61 @@ namespace ManagerService.Migrations
b.UseTphMappingStrategy();
});
modelBuilder.Entity("ManagerService.Data.SubSection.EventAgenda", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<EventAddress>("Address")
.HasColumnType("jsonb");
b.Property<DateTime?>("DateAdded")
.HasColumnType("timestamp with time zone");
b.Property<DateTime?>("DateFrom")
.HasColumnType("timestamp with time zone");
b.Property<DateTime?>("DateTo")
.HasColumnType("timestamp with time zone");
b.Property<List<TranslationAndResourceDTO>>("Description")
.IsRequired()
.HasColumnType("jsonb");
b.Property<string>("Email")
.HasColumnType("text");
b.Property<List<TranslationAndResourceDTO>>("Label")
.IsRequired()
.HasColumnType("jsonb");
b.Property<string>("Phone")
.HasColumnType("text");
b.Property<string>("ResourceId")
.HasColumnType("text");
b.Property<string>("SectionAgendaId")
.HasColumnType("text");
b.Property<string>("Type")
.HasColumnType("text");
b.Property<string>("Website")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("ResourceId");
b.HasIndex("SectionAgendaId");
b.ToTable("EventAgenda");
});
modelBuilder.Entity("ManagerService.Data.SubSection.GeoPoint", b =>
{
b.Property<int>("Id")
@ -625,6 +684,9 @@ namespace ManagerService.Migrations
.IsRequired()
.HasColumnType("jsonb");
b.Property<bool>("IsOnlineAgenda")
.HasColumnType("boolean");
b.HasDiscriminator().HasValue("Agenda");
});
@ -840,6 +902,21 @@ namespace ManagerService.Migrations
.HasForeignKey("SectionMenuId");
});
modelBuilder.Entity("ManagerService.Data.SubSection.EventAgenda", b =>
{
b.HasOne("ManagerService.Data.Resource", "Resource")
.WithMany()
.HasForeignKey("ResourceId");
b.HasOne("ManagerService.Data.SubSection.SectionAgenda", "SectionAgenda")
.WithMany("EventAgendas")
.HasForeignKey("SectionAgendaId");
b.Navigation("Resource");
b.Navigation("SectionAgenda");
});
modelBuilder.Entity("ManagerService.Data.SubSection.GeoPoint", b =>
{
b.HasOne("ManagerService.Data.SubSection.SectionEvent", "SectionEvent")
@ -950,6 +1027,11 @@ namespace ManagerService.Migrations
b.Navigation("MapAnnotations");
});
modelBuilder.Entity("ManagerService.Data.SubSection.SectionAgenda", b =>
{
b.Navigation("EventAgendas");
});
modelBuilder.Entity("ManagerService.Data.SubSection.SectionEvent", b =>
{
b.Navigation("Programme");