Added link EventAgenda and SectionEvent + event agenda dto

This commit is contained in:
Thomas Fransolet 2025-07-10 17:08:08 +02:00
parent 8801c56f75
commit c89566c9a9
6 changed files with 1201 additions and 3 deletions

View File

@ -0,0 +1,64 @@
using ManagerService.Data.SubSection;
using System.Collections.Generic;
using System;
using static ManagerService.Data.SubSection.SectionEvent;
namespace ManagerService.DTOs
{
public class EventAgendaDTO
{
public int Id { get; set; }
public List<TranslationAndResourceDTO> Label { get; set; }
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 ResourceDTO Resource { get; set; } // Background image
public EventAddressDTO Address { get; set; }
public string Phone { get; set; }
public string Email { get; set; }
public string SectionAgendaId { get; set; }
}
public class EventAddressDTO
{
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

@ -36,7 +36,6 @@ namespace Manager.DTOs
public List<TranslationDTO> email { get; set; }
public List<TranslationDTO> site { get; set; }
public GeometryType geometryType { get; set; }
[Column(TypeName = "jsonb")]
public List<Coordinate> coordinates { get; set; } = new(); // 1 point = marker, plusieurs = polyline/polygon
public string polyColor { get; set; } // color of the polyline or polygon
}

View File

@ -20,11 +20,11 @@ namespace ManagerService.Data.SubSection
[Required]
[Column(TypeName = "jsonb")]
public List<TranslationAndResourceDTO> Label { get; set; }
public List<TranslationDTO> Label { get; set; }
[Required]
[Column(TypeName = "jsonb")]
public List<TranslationAndResourceDTO> Description { get; set; }
public List<TranslationDTO> Description { get; set; }
public string Type { get; set; }
@ -52,6 +52,11 @@ namespace ManagerService.Data.SubSection
[ForeignKey("SectionAgendaId")]
public SectionAgenda SectionAgenda { get; set; }
public string? SectionEventId { get; set; }
[ForeignKey("SectionEventId")]
public SectionEvent? SectionEvent { get; set; } // Genre lancer l'event (vue vraiment detail d'un event)
}
public class EventAddress

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,48 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ManagerService.Migrations
{
/// <inheritdoc />
public partial class AddedLinkEventAgendaAndSectionEvent : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "SectionEventId",
table: "EventAgenda",
type: "text",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_EventAgenda_SectionEventId",
table: "EventAgenda",
column: "SectionEventId");
migrationBuilder.AddForeignKey(
name: "FK_EventAgenda_Sections_SectionEventId",
table: "EventAgenda",
column: "SectionEventId",
principalTable: "Sections",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_EventAgenda_Sections_SectionEventId",
table: "EventAgenda");
migrationBuilder.DropIndex(
name: "IX_EventAgenda_SectionEventId",
table: "EventAgenda");
migrationBuilder.DropColumn(
name: "SectionEventId",
table: "EventAgenda");
}
}
}

View File

@ -340,6 +340,9 @@ namespace ManagerService.Migrations
b.Property<string>("SectionAgendaId")
.HasColumnType("text");
b.Property<string>("SectionEventId")
.HasColumnType("text");
b.Property<string>("Type")
.HasColumnType("text");
@ -352,6 +355,8 @@ namespace ManagerService.Migrations
b.HasIndex("SectionAgendaId");
b.HasIndex("SectionEventId");
b.ToTable("EventAgenda");
});
@ -912,9 +917,15 @@ namespace ManagerService.Migrations
.WithMany("EventAgendas")
.HasForeignKey("SectionAgendaId");
b.HasOne("ManagerService.Data.SubSection.SectionEvent", "SectionEvent")
.WithMany()
.HasForeignKey("SectionEventId");
b.Navigation("Resource");
b.Navigation("SectionAgenda");
b.Navigation("SectionEvent");
});
modelBuilder.Entity("ManagerService.Data.SubSection.GeoPoint", b =>