Files
pfm/PostFundManagement.Infrastructure/Database/Migrations/ApplicationDbContextModelSnapshot.cs
T
2026-08-15 20:30:51 +02:00

1622 lines
59 KiB
C#

// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using PostFundManagement.Infrastructure.Database;
#nullable disable
namespace PostFundManagement.Infrastructure.Database.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
partial class ApplicationDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.11")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("PostFundManagement.Domain.Entities.AuditLog", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<string>("Action")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)");
b.PrimitiveCollection<string>("Changes")
.HasColumnType("jsonb");
b.Property<long>("EntityId")
.HasColumnType("bigint");
b.Property<string>("EntityName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<Guid>("PerformedBy")
.HasColumnType("uuid");
b.Property<DateTime>("Timestamp")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("now()");
b.HasKey("Id");
b.HasIndex("PerformedBy");
b.ToTable("AuditLogs", (string)null);
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Award", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<decimal>("Amount")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)");
b.Property<Guid?>("ApprovedBy")
.HasColumnType("uuid");
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("now()");
b.Property<Guid>("CreatedBy")
.HasColumnType("uuid");
b.Property<long>("OrganisationId")
.HasColumnType("bigint");
b.Property<long>("ProgrammeId")
.HasColumnType("bigint");
b.Property<long?>("ProjectId")
.HasColumnType("bigint");
b.Property<int>("Status")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValueSql("1");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid?>("UpdatedBy")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("ApprovedBy");
b.HasIndex("CreatedBy");
b.HasIndex("OrganisationId");
b.HasIndex("ProgrammeId");
b.HasIndex("ProjectId");
b.HasIndex("UpdatedBy");
b.ToTable("Awards", (string)null);
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Beneficiary", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<string>("Category")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("now()");
b.Property<Guid>("CreatedBy")
.HasColumnType("uuid");
b.Property<string>("Location")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<long>("ProjectId")
.HasColumnType("bigint");
b.Property<int>("ReachedCount")
.HasColumnType("integer");
b.Property<int>("TargetCount")
.HasColumnType("integer");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("CreatedBy");
b.HasIndex("ProjectId");
b.HasIndex("UserId");
b.ToTable("Beneficiaries", (string)null);
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Budget", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<decimal>("Amount")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)");
b.Property<Guid?>("ApprovedBy")
.HasColumnType("uuid");
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("now()");
b.Property<Guid>("CreatedBy")
.HasColumnType("uuid");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<long>("ProjectId")
.HasColumnType("bigint");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("ApprovedBy");
b.HasIndex("CreatedBy");
b.HasIndex("ProjectId");
b.ToTable("Budgets", (string)null);
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.ChangeRequest", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<Guid?>("ApprovedBy")
.HasColumnType("uuid");
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("now()");
b.Property<Guid>("CreatedBy")
.HasColumnType("uuid");
b.Property<string>("Justification")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("character varying(1024)");
b.Property<long>("ProjectId")
.HasColumnType("bigint");
b.Property<decimal?>("RevisedBudget")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)");
b.Property<DateTime?>("RevisedEndedAt")
.HasColumnType("timestamp with time zone");
b.Property<int>("Status")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValueSql("1");
b.Property<string>("Title")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("ApprovedBy");
b.HasIndex("CreatedBy");
b.HasIndex("ProjectId");
b.ToTable("ChangeRequests", (string)null);
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.ComplianceItem", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("now()");
b.Property<Guid>("CreatedBy")
.HasColumnType("uuid");
b.Property<long>("ProjectId")
.HasColumnType("bigint");
b.Property<string>("Requirements")
.IsRequired()
.HasMaxLength(2048)
.HasColumnType("character varying(2048)");
b.Property<int>("Status")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValueSql("1");
b.Property<string>("Title")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid?>("VerifiedBy")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("CreatedBy");
b.HasIndex("ProjectId");
b.HasIndex("VerifiedBy");
b.ToTable("ComplianceItems", (string)null);
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Contract", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<long>("AwardId")
.HasColumnType("bigint");
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("now()");
b.Property<Guid>("CreatedBy")
.HasColumnType("uuid");
b.Property<DateTime?>("EffectiveAt")
.HasColumnType("timestamp with time zone");
b.Property<DateTime?>("ExpiresAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("ExternalSignatureId")
.HasColumnType("text");
b.Property<string>("SignedDocumentUrl")
.HasColumnType("text");
b.Property<int>("Status")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValueSql("1");
b.Property<decimal>("TotalValue")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)");
b.HasKey("Id");
b.HasIndex("AwardId")
.IsUnique();
b.HasIndex("CreatedBy");
b.ToTable("Contracts", (string)null);
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Disbursement", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<decimal>("Amount")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)");
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("now()");
b.Property<Guid>("CreatedBy")
.HasColumnType("uuid");
b.Property<long?>("MilestoneId")
.HasColumnType("bigint");
b.Property<long>("ProjectId")
.HasColumnType("bigint");
b.Property<int>("Status")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValueSql("1");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid?>("UpdatedBy")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("CreatedBy");
b.HasIndex("MilestoneId");
b.HasIndex("ProjectId");
b.HasIndex("UpdatedBy");
b.ToTable("Disbursements", (string)null);
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Evidence", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("now()");
b.Property<Guid>("CreatedBy")
.HasColumnType("uuid");
b.Property<string>("DocumentUrl")
.IsRequired()
.HasColumnType("text");
b.Property<long>("IndicatorId")
.HasColumnType("bigint");
b.Property<long>("MilestoneId")
.HasColumnType("bigint");
b.Property<long>("ProjectId")
.HasColumnType("bigint");
b.Property<int>("Status")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValueSql("1");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("UpdatedBy")
.HasColumnType("uuid");
b.Property<int>("Version")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValue(1);
b.HasKey("Id");
b.HasIndex("CreatedBy");
b.HasIndex("IndicatorId");
b.HasIndex("MilestoneId");
b.HasIndex("ProjectId");
b.HasIndex("UpdatedBy");
b.ToTable("Evidences", (string)null);
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Indicator", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<decimal>("ActualAmount")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)");
b.Property<decimal>("BaselineAmount")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)");
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("now()");
b.Property<Guid>("CreatedBy")
.HasColumnType("uuid");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<long>("ProjectId")
.HasColumnType("bigint");
b.Property<decimal>("TargetAmount")
.HasPrecision(18, 2)
.HasColumnType("numeric(18,2)");
b.Property<int>("UnitOfMeasure")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValueSql("2");
b.HasKey("Id");
b.HasIndex("CreatedBy");
b.HasIndex("ProjectId");
b.ToTable("Indicators", (string)null);
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Instrument", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("now()");
b.Property<Guid>("CreatedBy")
.HasColumnType("uuid");
b.Property<string>("Description")
.HasMaxLength(1024)
.HasColumnType("character varying(1024)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<int>("Status")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValueSql("2");
b.HasKey("Id");
b.HasIndex("CreatedBy");
b.ToTable("Instruments", (string)null);
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Issue", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("now()");
b.Property<Guid>("CreatedBy")
.HasColumnType("uuid");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("character varying(1024)");
b.Property<int>("Priority")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValueSql("1");
b.Property<long>("ProjectId")
.HasColumnType("bigint");
b.Property<DateTime?>("ResolvedAt")
.HasColumnType("timestamp with time zone");
b.Property<int>("Status")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValueSql("1");
b.Property<string>("Title")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.HasKey("Id");
b.HasIndex("CreatedBy");
b.HasIndex("ProjectId");
b.ToTable("Issues", (string)null);
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Milestone", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("now()");
b.Property<Guid>("CreatedBy")
.HasColumnType("uuid");
b.Property<DateTime>("DueAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<long>("ProjectId")
.HasColumnType("bigint");
b.Property<int>("Status")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValueSql("1");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid?>("UpdatedBy")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("CreatedBy");
b.HasIndex("ProjectId");
b.HasIndex("UpdatedBy");
b.ToTable("Milestones", (string)null);
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Organisation", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("now()");
b.Property<Guid>("CreatedBy")
.HasColumnType("uuid");
b.Property<string>("Email")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("RegistrationNo")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<int>("Status")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValueSql("1");
b.Property<int>("Type")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValueSql("5");
b.HasKey("Id");
b.HasIndex("CreatedBy");
b.ToTable("Organisations", (string)null);
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Outcome", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<long>("BeneficiaryId")
.HasColumnType("bigint");
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("now()");
b.Property<Guid>("CreatedBy")
.HasColumnType("uuid");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("character varying(1024)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.HasKey("Id");
b.HasIndex("BeneficiaryId");
b.HasIndex("CreatedBy");
b.ToTable("Outcomes", (string)null);
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Portfolio", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("now()");
b.Property<Guid>("CreatedBy")
.HasColumnType("uuid");
b.Property<string>("Description")
.HasMaxLength(1024)
.HasColumnType("character varying(1024)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<Guid>("OwnedBy")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("CreatedBy");
b.HasIndex("OwnedBy");
b.ToTable("Portfolios", (string)null);
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Programme", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("now()");
b.Property<Guid>("CreatedBy")
.HasColumnType("uuid");
b.Property<long>("InstrumentId")
.HasColumnType("bigint");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<Guid>("OwnedBy")
.HasColumnType("uuid");
b.Property<long>("PortfolioId")
.HasColumnType("bigint");
b.Property<int>("Status")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValueSql("1");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid?>("UpdatedBy")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("CreatedBy");
b.HasIndex("InstrumentId");
b.HasIndex("OwnedBy");
b.HasIndex("PortfolioId");
b.ToTable("Programmes", (string)null);
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Project", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("now()");
b.Property<Guid>("CreatedBy")
.HasColumnType("uuid");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("character varying(1024)");
b.Property<DateTime?>("EndedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<long>("ProgrammeId")
.HasColumnType("bigint");
b.Property<DateTime?>("StartedAt")
.HasColumnType("timestamp with time zone");
b.Property<int>("Status")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValueSql("1");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid?>("UpdatedBy")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("CreatedBy");
b.HasIndex("ProgrammeId");
b.HasIndex("UpdatedBy");
b.ToTable("Projects", (string)null);
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Risk", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("now()");
b.Property<Guid>("CreatedBy")
.HasColumnType("uuid");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("character varying(1024)");
b.Property<int>("Impact")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValueSql("1");
b.Property<int>("Likelihood")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValueSql("3");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<long>("ProjectId")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("CreatedBy");
b.HasIndex("ProjectId");
b.ToTable("Risks", (string)null);
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Rule", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("now()");
b.Property<Guid>("CreatedBy")
.HasColumnType("uuid");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<long>("ProgrammeId")
.HasColumnType("bigint");
b.Property<int>("Status")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValueSql("2");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid?>("UpdatedBy")
.HasColumnType("uuid");
b.Property<int>("Version")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValue(1);
b.HasKey("Id");
b.HasIndex("CreatedBy");
b.HasIndex("ProgrammeId");
b.HasIndex("UpdatedBy");
b.ToTable("Rules", (string)null);
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.SiteVisit", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<DateTime>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("now()");
b.Property<Guid>("CreatedBy")
.HasColumnType("uuid");
b.Property<string>("Findings")
.HasMaxLength(4096)
.HasColumnType("character varying(4096)");
b.Property<string>("InspectorName")
.IsRequired()
.HasColumnType("text");
b.Property<long>("ProjectId")
.HasColumnType("bigint");
b.Property<int>("Status")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValueSql("1");
b.Property<DateTime>("VisitedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("CreatedBy");
b.HasIndex("ProjectId");
b.ToTable("SiteVisits", (string)null);
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.User", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("Email")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<DateTime?>("LastLoginAt")
.HasColumnType("timestamp with time zone");
b.Property<int>("Status")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasDefaultValueSql("2");
b.HasKey("Id");
b.ToTable("Users", (string)null);
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.AuditLog", b =>
{
b.HasOne("PostFundManagement.Domain.Entities.User", "Performer")
.WithMany()
.HasForeignKey("PerformedBy")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Performer");
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Award", b =>
{
b.HasOne("PostFundManagement.Domain.Entities.User", "Approver")
.WithMany()
.HasForeignKey("ApprovedBy")
.OnDelete(DeleteBehavior.NoAction);
b.HasOne("PostFundManagement.Domain.Entities.User", "Creator")
.WithMany()
.HasForeignKey("CreatedBy")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
b.HasOne("PostFundManagement.Domain.Entities.Organisation", "Organisation")
.WithMany()
.HasForeignKey("OrganisationId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("PostFundManagement.Domain.Entities.Programme", "Programme")
.WithMany("Awards")
.HasForeignKey("ProgrammeId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("PostFundManagement.Domain.Entities.Project", "Project")
.WithMany("Awards")
.HasForeignKey("ProjectId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("PostFundManagement.Domain.Entities.User", "Updator")
.WithMany()
.HasForeignKey("UpdatedBy")
.OnDelete(DeleteBehavior.NoAction);
b.Navigation("Approver");
b.Navigation("Creator");
b.Navigation("Organisation");
b.Navigation("Programme");
b.Navigation("Project");
b.Navigation("Updator");
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Beneficiary", b =>
{
b.HasOne("PostFundManagement.Domain.Entities.User", "Creator")
.WithMany()
.HasForeignKey("CreatedBy")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
b.HasOne("PostFundManagement.Domain.Entities.Project", "Project")
.WithMany()
.HasForeignKey("ProjectId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("PostFundManagement.Domain.Entities.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
b.Navigation("Creator");
b.Navigation("Project");
b.Navigation("User");
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Budget", b =>
{
b.HasOne("PostFundManagement.Domain.Entities.User", "Approver")
.WithMany()
.HasForeignKey("ApprovedBy")
.OnDelete(DeleteBehavior.NoAction);
b.HasOne("PostFundManagement.Domain.Entities.User", "Creator")
.WithMany()
.HasForeignKey("CreatedBy")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
b.HasOne("PostFundManagement.Domain.Entities.Project", "Project")
.WithMany()
.HasForeignKey("ProjectId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Approver");
b.Navigation("Creator");
b.Navigation("Project");
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.ChangeRequest", b =>
{
b.HasOne("PostFundManagement.Domain.Entities.User", "Approver")
.WithMany()
.HasForeignKey("ApprovedBy")
.OnDelete(DeleteBehavior.NoAction);
b.HasOne("PostFundManagement.Domain.Entities.User", "Creator")
.WithMany()
.HasForeignKey("CreatedBy")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
b.HasOne("PostFundManagement.Domain.Entities.Project", "Project")
.WithMany()
.HasForeignKey("ProjectId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Approver");
b.Navigation("Creator");
b.Navigation("Project");
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.ComplianceItem", b =>
{
b.HasOne("PostFundManagement.Domain.Entities.User", "Creator")
.WithMany()
.HasForeignKey("CreatedBy")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
b.HasOne("PostFundManagement.Domain.Entities.Project", "Project")
.WithMany()
.HasForeignKey("ProjectId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("PostFundManagement.Domain.Entities.User", "Verifier")
.WithMany()
.HasForeignKey("VerifiedBy")
.OnDelete(DeleteBehavior.NoAction);
b.Navigation("Creator");
b.Navigation("Project");
b.Navigation("Verifier");
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Contract", b =>
{
b.HasOne("PostFundManagement.Domain.Entities.Award", "Award")
.WithOne("Contract")
.HasForeignKey("PostFundManagement.Domain.Entities.Contract", "AwardId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("PostFundManagement.Domain.Entities.User", "Creator")
.WithMany()
.HasForeignKey("CreatedBy")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
b.Navigation("Award");
b.Navigation("Creator");
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Disbursement", b =>
{
b.HasOne("PostFundManagement.Domain.Entities.User", "Creator")
.WithMany()
.HasForeignKey("CreatedBy")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
b.HasOne("PostFundManagement.Domain.Entities.Milestone", "Milestone")
.WithMany()
.HasForeignKey("MilestoneId")
.OnDelete(DeleteBehavior.Restrict);
b.HasOne("PostFundManagement.Domain.Entities.Project", "Project")
.WithMany()
.HasForeignKey("ProjectId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("PostFundManagement.Domain.Entities.User", "Updator")
.WithMany()
.HasForeignKey("UpdatedBy")
.OnDelete(DeleteBehavior.NoAction);
b.Navigation("Creator");
b.Navigation("Milestone");
b.Navigation("Project");
b.Navigation("Updator");
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Evidence", b =>
{
b.HasOne("PostFundManagement.Domain.Entities.User", "Creator")
.WithMany()
.HasForeignKey("CreatedBy")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
b.HasOne("PostFundManagement.Domain.Entities.Indicator", "Indicator")
.WithMany()
.HasForeignKey("IndicatorId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PostFundManagement.Domain.Entities.Milestone", "Milestone")
.WithMany()
.HasForeignKey("MilestoneId")
.OnDelete(DeleteBehavior.Restrict);
b.HasOne("PostFundManagement.Domain.Entities.Project", "Project")
.WithMany()
.HasForeignKey("ProjectId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("PostFundManagement.Domain.Entities.User", "Updator")
.WithMany()
.HasForeignKey("UpdatedBy")
.OnDelete(DeleteBehavior.NoAction);
b.Navigation("Creator");
b.Navigation("Indicator");
b.Navigation("Milestone");
b.Navigation("Project");
b.Navigation("Updator");
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Indicator", b =>
{
b.HasOne("PostFundManagement.Domain.Entities.User", "Creator")
.WithMany()
.HasForeignKey("CreatedBy")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
b.HasOne("PostFundManagement.Domain.Entities.Project", "Project")
.WithMany()
.HasForeignKey("ProjectId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Creator");
b.Navigation("Project");
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Instrument", b =>
{
b.HasOne("PostFundManagement.Domain.Entities.User", "Creator")
.WithMany()
.HasForeignKey("CreatedBy")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
b.Navigation("Creator");
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Issue", b =>
{
b.HasOne("PostFundManagement.Domain.Entities.User", "Creator")
.WithMany()
.HasForeignKey("CreatedBy")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
b.HasOne("PostFundManagement.Domain.Entities.Project", "Project")
.WithMany()
.HasForeignKey("ProjectId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Creator");
b.Navigation("Project");
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Milestone", b =>
{
b.HasOne("PostFundManagement.Domain.Entities.User", "Creator")
.WithMany()
.HasForeignKey("CreatedBy")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
b.HasOne("PostFundManagement.Domain.Entities.Project", "Project")
.WithMany()
.HasForeignKey("ProjectId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("PostFundManagement.Domain.Entities.User", "Updator")
.WithMany()
.HasForeignKey("UpdatedBy")
.OnDelete(DeleteBehavior.NoAction);
b.Navigation("Creator");
b.Navigation("Project");
b.Navigation("Updator");
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Organisation", b =>
{
b.HasOne("PostFundManagement.Domain.Entities.User", "Creator")
.WithMany()
.HasForeignKey("CreatedBy")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
b.Navigation("Creator");
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Outcome", b =>
{
b.HasOne("PostFundManagement.Domain.Entities.Beneficiary", "Beneficiary")
.WithMany()
.HasForeignKey("BeneficiaryId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("PostFundManagement.Domain.Entities.User", "Creator")
.WithMany()
.HasForeignKey("CreatedBy")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
b.Navigation("Beneficiary");
b.Navigation("Creator");
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Portfolio", b =>
{
b.HasOne("PostFundManagement.Domain.Entities.User", "Creator")
.WithMany()
.HasForeignKey("CreatedBy")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
b.HasOne("PostFundManagement.Domain.Entities.User", "Owner")
.WithMany()
.HasForeignKey("OwnedBy")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
b.Navigation("Creator");
b.Navigation("Owner");
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Programme", b =>
{
b.HasOne("PostFundManagement.Domain.Entities.User", "Creator")
.WithMany()
.HasForeignKey("CreatedBy")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
b.HasOne("PostFundManagement.Domain.Entities.Instrument", "Instrument")
.WithMany("Programmes")
.HasForeignKey("InstrumentId")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
b.HasOne("PostFundManagement.Domain.Entities.User", "Owner")
.WithMany()
.HasForeignKey("OwnedBy")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
b.HasOne("PostFundManagement.Domain.Entities.Portfolio", "Portfolio")
.WithMany("Programmes")
.HasForeignKey("PortfolioId")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
b.Navigation("Creator");
b.Navigation("Instrument");
b.Navigation("Owner");
b.Navigation("Portfolio");
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Project", b =>
{
b.HasOne("PostFundManagement.Domain.Entities.User", "Creator")
.WithMany()
.HasForeignKey("CreatedBy")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
b.HasOne("PostFundManagement.Domain.Entities.Programme", "Programme")
.WithMany("Projects")
.HasForeignKey("ProgrammeId")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
b.HasOne("PostFundManagement.Domain.Entities.User", "Updator")
.WithMany()
.HasForeignKey("UpdatedBy")
.OnDelete(DeleteBehavior.NoAction);
b.Navigation("Creator");
b.Navigation("Programme");
b.Navigation("Updator");
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Risk", b =>
{
b.HasOne("PostFundManagement.Domain.Entities.User", "Creator")
.WithMany()
.HasForeignKey("CreatedBy")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
b.HasOne("PostFundManagement.Domain.Entities.Project", "Project")
.WithMany()
.HasForeignKey("ProjectId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Creator");
b.Navigation("Project");
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Rule", b =>
{
b.HasOne("PostFundManagement.Domain.Entities.User", "Creator")
.WithMany()
.HasForeignKey("CreatedBy")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
b.HasOne("PostFundManagement.Domain.Entities.Programme", "Programme")
.WithMany("Rules")
.HasForeignKey("ProgrammeId")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
b.HasOne("PostFundManagement.Domain.Entities.User", "Updator")
.WithMany()
.HasForeignKey("UpdatedBy")
.OnDelete(DeleteBehavior.NoAction);
b.Navigation("Creator");
b.Navigation("Programme");
b.Navigation("Updator");
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.SiteVisit", b =>
{
b.HasOne("PostFundManagement.Domain.Entities.User", "Creator")
.WithMany()
.HasForeignKey("CreatedBy")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
b.HasOne("PostFundManagement.Domain.Entities.Project", "Project")
.WithMany()
.HasForeignKey("ProjectId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Creator");
b.Navigation("Project");
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Award", b =>
{
b.Navigation("Contract");
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Instrument", b =>
{
b.Navigation("Programmes");
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Portfolio", b =>
{
b.Navigation("Programmes");
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Programme", b =>
{
b.Navigation("Awards");
b.Navigation("Projects");
b.Navigation("Rules");
});
modelBuilder.Entity("PostFundManagement.Domain.Entities.Project", b =>
{
b.Navigation("Awards");
});
#pragma warning restore 612, 618
}
}
}