Refactor enums and update Interaction entity field
Moved enums to a dedicated namespace and updated references across the codebase. Renamed the `Info` field in the `Interaction` entity to `Info1`, including necessary migrations and UI adjustments. These changes improve the organization and consistency of the codebase.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using FoodsharingSiegen.Contracts;
|
||||
using FoodsharingSiegen.Contracts.Entity;
|
||||
using FoodsharingSiegen.Contracts.Enums;
|
||||
using FoodsharingSiegen.Contracts.Helper;
|
||||
using FoodsharingSiegen.Server.Data;
|
||||
using FoodsharingSiegen.Server.Service;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
@using FoodsharingSiegen.Contracts.Entity
|
||||
@using FoodsharingSiegen.Contracts.Enums
|
||||
@using FoodsharingSiegen.Shared.Helper
|
||||
|
||||
@inherits FsBase
|
||||
@@ -30,9 +31,9 @@
|
||||
}
|
||||
</div>
|
||||
|
||||
@if (!string.IsNullOrWhiteSpace(interaction.Info))
|
||||
@if (!string.IsNullOrWhiteSpace(interaction.Info1))
|
||||
{
|
||||
<span>(<i>@interaction.Info</i>)</span>
|
||||
<span>(<i>@interaction.Info1</i>)</span>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using FoodsharingSiegen.Contracts.Entity;
|
||||
using FoodsharingSiegen.Contracts.Enums;
|
||||
using FoodsharingSiegen.Server.BaseClasses;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
@using FoodsharingSiegen.Shared.Helper
|
||||
@using FoodsharingSiegen.Contracts.Enums
|
||||
@using FoodsharingSiegen.Shared.Helper
|
||||
@inherits FsBase
|
||||
|
||||
@{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using FoodsharingSiegen.Contracts.Entity;
|
||||
using FoodsharingSiegen.Contracts.Enums;
|
||||
using FoodsharingSiegen.Server.Data.Service;
|
||||
using FoodsharingSiegen.Server.Dialogs;
|
||||
using FoodsharingSiegen.Shared.Helper;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
@using FoodsharingSiegen.Contracts.Model
|
||||
@using FoodsharingSiegen.Contracts.Enums
|
||||
@using FoodsharingSiegen.Contracts.Model
|
||||
@inherits FsBase
|
||||
@code {
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
@code {
|
||||
@using FoodsharingSiegen.Contracts.Enums
|
||||
@code {
|
||||
|
||||
[Parameter] public List<Prospect>? Prospects { get; set; }
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using FoodsharingSiegen.Contracts.Entity;
|
||||
using FoodsharingSiegen.Contracts.Enums;
|
||||
|
||||
namespace FoodsharingSiegen.Server.Data
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using FoodsharingSiegen.Contracts;
|
||||
using FoodsharingSiegen.Contracts.Entity;
|
||||
using FoodsharingSiegen.Contracts.Enums;
|
||||
using FoodsharingSiegen.Server.Auth;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using FoodsharingSiegen.Contracts;
|
||||
using FoodsharingSiegen.Contracts.Entity;
|
||||
using FoodsharingSiegen.Contracts.Enums;
|
||||
using FoodsharingSiegen.Contracts.Model;
|
||||
using FoodsharingSiegen.Server.Auth;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using FoodsharingSiegen.Contracts;
|
||||
using FoodsharingSiegen.Contracts.Entity;
|
||||
using FoodsharingSiegen.Contracts.Enums;
|
||||
using FoodsharingSiegen.Server.Auth;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
{
|
||||
<Field>
|
||||
<FieldLabel>@InfoName</FieldLabel>
|
||||
<TextEdit @bind-Text="Interaction.Info"></TextEdit>
|
||||
<TextEdit @bind-Text="Interaction.Info1"></TextEdit>
|
||||
</Field>
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Blazorise;
|
||||
using FoodsharingSiegen.Contracts.Entity;
|
||||
using FoodsharingSiegen.Contracts.Enums;
|
||||
using FoodsharingSiegen.Server.BaseClasses;
|
||||
using FoodsharingSiegen.Server.Data.Service;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
208
FoodsharingSiegen.Server/Migrations/20250401075051_Rename-Info.Designer.cs
generated
Normal file
208
FoodsharingSiegen.Server/Migrations/20250401075051_Rename-Info.Designer.cs
generated
Normal file
@@ -0,0 +1,208 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using FoodsharingSiegen.Server.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace FoodsharingSiegen.Server.Migrations
|
||||
{
|
||||
[DbContext(typeof(FsContext))]
|
||||
[Migration("20250401075051_Rename-Info")]
|
||||
partial class RenameInfo
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "9.0.3");
|
||||
|
||||
modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Audit", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("Created")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Data1")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Data2")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("Type")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<Guid?>("UserID")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserID");
|
||||
|
||||
b.ToTable("Audits");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Interaction", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("Alert")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("Created")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("Date")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Info1")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("NotNeeded")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<Guid>("ProspectID")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("Type")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<Guid>("UserID")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ProspectID");
|
||||
|
||||
b.HasIndex("UserID");
|
||||
|
||||
b.ToTable("Interactions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("Created")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("FsId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Memo")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime?>("Modified")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("RecordState")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("Warning")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Prospects");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.User", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("Created")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("EncryptedPassword")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("ForceLogout")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Groups")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Mail")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Memo")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("Network")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("Type")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("Verified")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Audit", b =>
|
||||
{
|
||||
b.HasOne("FoodsharingSiegen.Contracts.Entity.User", "User")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserID");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Interaction", b =>
|
||||
{
|
||||
b.HasOne("FoodsharingSiegen.Contracts.Entity.Prospect", "Prospect")
|
||||
.WithMany("Interactions")
|
||||
.HasForeignKey("ProspectID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("FoodsharingSiegen.Contracts.Entity.User", "User")
|
||||
.WithMany("Interactions")
|
||||
.HasForeignKey("UserID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Prospect");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b =>
|
||||
{
|
||||
b.Navigation("Interactions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.User", b =>
|
||||
{
|
||||
b.Navigation("Interactions");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace FoodsharingSiegen.Server.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class RenameInfo : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "Info",
|
||||
table: "Interactions",
|
||||
newName: "Info1");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "Info1",
|
||||
table: "Interactions",
|
||||
newName: "Info");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -60,7 +60,7 @@ namespace FoodsharingSiegen.Server.Migrations
|
||||
b.Property<DateTime>("Date")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Info")
|
||||
b.Property<string>("Info1")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("NotNeeded")
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
@page "/profile"
|
||||
|
||||
@using FoodsharingSiegen.Contracts.Enums
|
||||
@inherits FsBase
|
||||
|
||||
<PageTitle>Profil - @AppSettings.Terms.Title</PageTitle>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
@page "/prospect"
|
||||
@page "/prospects"
|
||||
|
||||
@using FoodsharingSiegen.Contracts.Enums
|
||||
@using FoodsharingSiegen.Shared.Helper
|
||||
@inherits FsBase
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using FoodsharingSiegen.Contracts.Entity;
|
||||
using FoodsharingSiegen.Contracts.Enums;
|
||||
using FoodsharingSiegen.Contracts.Model;
|
||||
using FoodsharingSiegen.Server.Data.Service;
|
||||
using FoodsharingSiegen.Server.Dialogs;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
@page "/all"
|
||||
|
||||
@using FoodsharingSiegen.Contracts.Enums
|
||||
@using FoodsharingSiegen.Shared.Helper
|
||||
@inherits FsBase
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
@page "/done"
|
||||
|
||||
@using FoodsharingSiegen.Contracts.Enums
|
||||
@using FoodsharingSiegen.Shared.Helper
|
||||
@inherits FsBase
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using FoodsharingSiegen.Contracts.Entity;
|
||||
using FoodsharingSiegen.Contracts.Enums;
|
||||
using FoodsharingSiegen.Contracts.Model;
|
||||
using FoodsharingSiegen.Server.Data.Service;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
@page "/verify"
|
||||
|
||||
@using FoodsharingSiegen.Contracts.Enums
|
||||
@using FoodsharingSiegen.Shared.Helper
|
||||
@inherits FsBase
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using FoodsharingSiegen.Contracts.Entity;
|
||||
using FoodsharingSiegen.Contracts.Enums;
|
||||
using FoodsharingSiegen.Contracts.Model;
|
||||
using FoodsharingSiegen.Server.Data.Service;
|
||||
using FoodsharingSiegen.Server.Dialogs;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
@page "/user"
|
||||
@page "/users"
|
||||
@using FoodsharingSiegen.Contracts.Entity
|
||||
@using FoodsharingSiegen.Contracts.Enums
|
||||
@using FoodsharingSiegen.Server.Dialogs
|
||||
|
||||
@inherits FoodsharingSiegen.Server.BaseClasses.FsBase
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Blazorise.DataGrid;
|
||||
using FoodsharingSiegen.Contracts.Entity;
|
||||
using FoodsharingSiegen.Contracts.Enums;
|
||||
using FoodsharingSiegen.Contracts.Helper;
|
||||
using FoodsharingSiegen.Server.Data.Service;
|
||||
using FoodsharingSiegen.Server.Dialogs;
|
||||
|
||||
Reference in New Issue
Block a user