Files
minattest/backend/src/MinAttest.Infrastructure/Data/Migrations/20250913104919_AddAttestVerificationCheck.Designer.cs
T
Stein Helge Riise ede31fbb7e Initial import
2025-11-17 08:32:46 +01:00

253 lines
8.9 KiB
C#

// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using MinAttest.Infrastructure.Data;
#nullable disable
namespace MinAttest.Infrastructure.Data.Migrations
{
[DbContext(typeof(AppDbContext))]
[Migration("20250913104919_AddAttestVerificationCheck")]
partial class AddAttestVerificationCheck
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.9")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("MinAttest.Api.Data.Entities.Attest", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("BlobHash")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("BlobPath")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b.Property<Guid?>("EmployerId")
.HasColumnType("uniqueidentifier");
b.Property<DateOnly>("From")
.HasColumnType("date");
b.Property<DateTimeOffset>("IssuedAt")
.HasColumnType("datetimeoffset");
b.Property<string>("IssuedBy")
.HasColumnType("nvarchar(max)");
b.Property<Guid>("PersonId")
.HasColumnType("uniqueidentifier");
b.Property<int>("Status")
.HasColumnType("int");
b.Property<string>("Summary")
.HasMaxLength(2000)
.HasColumnType("nvarchar(2000)");
b.Property<string>("Title")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<DateOnly>("To")
.HasColumnType("date");
b.HasKey("Id");
b.HasIndex("EmployerId", "Status");
b.HasIndex("PersonId", "Status");
b.ToTable("Attests", t =>
{
t.HasCheckConstraint("CK_Attests_Verification", "(([EmployerId] IS NULL AND [Status] = 2) OR ([EmployerId] IS NOT NULL AND [Status] IN (1,3)))");
});
});
modelBuilder.Entity("MinAttest.Api.Data.Entities.AuditLog", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Action")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<Guid?>("ActorId")
.HasColumnType("uniqueidentifier");
b.Property<int>("ActorType")
.HasColumnType("int");
b.Property<string>("Ip")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<Guid>("TargetId")
.HasColumnType("uniqueidentifier");
b.Property<string>("TargetType")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<DateTimeOffset>("Timestamp")
.HasColumnType("datetimeoffset");
b.HasKey("Id");
b.HasIndex("Timestamp");
b.ToTable("AuditLogs");
});
modelBuilder.Entity("MinAttest.Api.Data.Entities.Employer", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("OrgNumber")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("nvarchar(32)");
b.HasKey("Id");
b.HasIndex("OrgNumber");
b.ToTable("Employers");
});
modelBuilder.Entity("MinAttest.Api.Data.Entities.Person", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Email")
.HasColumnType("nvarchar(max)");
b.Property<string>("NationalIdEncrypted")
.HasColumnType("nvarchar(max)");
b.Property<string>("NationalIdHash")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<string>("Phone")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("NationalIdHash");
b.ToTable("Persons");
});
modelBuilder.Entity("MinAttest.Api.Data.Entities.ShareLink", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<Guid>("AttestId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<DateTimeOffset>("ExpiresAt")
.HasColumnType("datetimeoffset");
b.Property<bool>("OneTime")
.HasColumnType("bit");
b.Property<DateTimeOffset?>("RevokedAt")
.HasColumnType("datetimeoffset");
b.HasKey("Id");
b.HasIndex("AttestId");
b.HasIndex("Code")
.IsUnique();
b.ToTable("ShareLinks");
});
modelBuilder.Entity("MinAttest.Api.Data.Entities.Attest", b =>
{
b.HasOne("MinAttest.Api.Data.Entities.Employer", "Employer")
.WithMany("Attests")
.HasForeignKey("EmployerId")
.OnDelete(DeleteBehavior.Restrict);
b.HasOne("MinAttest.Api.Data.Entities.Person", "Person")
.WithMany("Attests")
.HasForeignKey("PersonId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Employer");
b.Navigation("Person");
});
modelBuilder.Entity("MinAttest.Api.Data.Entities.ShareLink", b =>
{
b.HasOne("MinAttest.Api.Data.Entities.Attest", "Attest")
.WithMany("ShareLinks")
.HasForeignKey("AttestId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Attest");
});
modelBuilder.Entity("MinAttest.Api.Data.Entities.Attest", b =>
{
b.Navigation("ShareLinks");
});
modelBuilder.Entity("MinAttest.Api.Data.Entities.Employer", b =>
{
b.Navigation("Attests");
});
modelBuilder.Entity("MinAttest.Api.Data.Entities.Person", b =>
{
b.Navigation("Attests");
});
#pragma warning restore 612, 618
}
}
}