feat(1099): EF migration for Payee1099, Form1099Box, mapping columns
Creates Form1099Boxes and Payee1099s tables; adds Form1099BoxId to ExpenseSubCategories and ExpenseCategoryGroups; adds PayeeId to Expenses. All new columns nullable, all FKs with SetNull, unique index on Form1099Boxes.BoxCode. No data backfill. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -598,6 +598,9 @@ namespace ROLAC.API.Migrations
|
||||
.HasMaxLength(450)
|
||||
.HasColumnType("character varying(450)");
|
||||
|
||||
b.Property<int?>("PayeeId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("ReceiptBlobPath")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("character varying(500)");
|
||||
@@ -652,6 +655,8 @@ namespace ROLAC.API.Migrations
|
||||
|
||||
b.HasIndex("MinistryId");
|
||||
|
||||
b.HasIndex("PayeeId");
|
||||
|
||||
b.HasIndex("Status")
|
||||
.HasFilter("\"IsDeleted\" = false");
|
||||
|
||||
@@ -674,6 +679,9 @@ namespace ROLAC.API.Migrations
|
||||
.HasMaxLength(450)
|
||||
.HasColumnType("character varying(450)");
|
||||
|
||||
b.Property<int?>("Form1099BoxId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int?>("Form990LineId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
@@ -702,6 +710,8 @@ namespace ROLAC.API.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Form1099BoxId");
|
||||
|
||||
b.HasIndex("Form990LineId");
|
||||
|
||||
b.ToTable("ExpenseCategoryGroups");
|
||||
@@ -900,6 +910,9 @@ namespace ROLAC.API.Migrations
|
||||
.HasMaxLength(450)
|
||||
.HasColumnType("character varying(450)");
|
||||
|
||||
b.Property<int?>("Form1099BoxId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int?>("Form990LineId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
@@ -931,6 +944,8 @@ namespace ROLAC.API.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Form1099BoxId");
|
||||
|
||||
b.HasIndex("Form990LineId");
|
||||
|
||||
b.HasIndex("GroupId");
|
||||
@@ -976,6 +991,63 @@ namespace ROLAC.API.Migrations
|
||||
b.ToTable("FamilyUnits");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ROLAC.API.Entities.Form1099Box", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("BoxCode")
|
||||
.IsRequired()
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("character varying(10)");
|
||||
|
||||
b.Property<DateTimeOffset>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasMaxLength(450)
|
||||
.HasColumnType("character varying(450)");
|
||||
|
||||
b.Property<string>("FormType")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("character varying(20)");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("Name_en")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("character varying(200)");
|
||||
|
||||
b.Property<string>("Name_zh")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("character varying(200)");
|
||||
|
||||
b.Property<int>("SortOrder")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTimeOffset>("UpdatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("UpdatedBy")
|
||||
.IsRequired()
|
||||
.HasMaxLength(450)
|
||||
.HasColumnType("character varying(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("BoxCode")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Form1099Boxes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ROLAC.API.Entities.Form990ExpenseLine", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
@@ -1925,6 +1997,128 @@ namespace ROLAC.API.Migrations
|
||||
b.ToTable("OfferingSessions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ROLAC.API.Entities.Payee1099", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("AddressLine1")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("character varying(200)");
|
||||
|
||||
b.Property<string>("AddressLine2")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("character varying(200)");
|
||||
|
||||
b.Property<string>("City")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("character varying(100)");
|
||||
|
||||
b.Property<DateTimeOffset>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasMaxLength(450)
|
||||
.HasColumnType("character varying(450)");
|
||||
|
||||
b.Property<DateTimeOffset?>("DeletedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("DeletedBy")
|
||||
.HasMaxLength(450)
|
||||
.HasColumnType("character varying(450)");
|
||||
|
||||
b.Property<string>("DisplayName")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("character varying(200)");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("character varying(200)");
|
||||
|
||||
b.Property<bool>("Is1099Tracked")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("LegalName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("character varying(200)");
|
||||
|
||||
b.Property<int?>("MemberId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Notes")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("character varying(500)");
|
||||
|
||||
b.Property<string>("Phone")
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("character varying(30)");
|
||||
|
||||
b.Property<string>("State")
|
||||
.HasMaxLength(2)
|
||||
.HasColumnType("character varying(2)");
|
||||
|
||||
b.Property<string>("TaxClassification")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("character varying(40)");
|
||||
|
||||
b.Property<string>("TinEncrypted")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("character varying(500)");
|
||||
|
||||
b.Property<string>("TinLast4")
|
||||
.HasMaxLength(4)
|
||||
.HasColumnType("character varying(4)");
|
||||
|
||||
b.Property<string>("TinType")
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("character varying(10)");
|
||||
|
||||
b.Property<DateTimeOffset>("UpdatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("UpdatedBy")
|
||||
.IsRequired()
|
||||
.HasMaxLength(450)
|
||||
.HasColumnType("character varying(450)");
|
||||
|
||||
b.Property<string>("W9BlobPath")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("character varying(500)");
|
||||
|
||||
b.Property<DateOnly?>("W9ReceivedDate")
|
||||
.HasColumnType("date");
|
||||
|
||||
b.Property<string>("W9Status")
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("character varying(20)")
|
||||
.HasDefaultValue("Missing");
|
||||
|
||||
b.Property<string>("Zip")
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("character varying(10)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("MemberId");
|
||||
|
||||
b.ToTable("Payee1099s");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ROLAC.API.Entities.RefreshToken", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
@@ -2208,18 +2402,32 @@ namespace ROLAC.API.Migrations
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("ROLAC.API.Entities.Payee1099", "Payee")
|
||||
.WithMany()
|
||||
.HasForeignKey("PayeeId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
b.Navigation("Member");
|
||||
|
||||
b.Navigation("Ministry");
|
||||
|
||||
b.Navigation("Payee");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ROLAC.API.Entities.ExpenseCategoryGroup", b =>
|
||||
{
|
||||
b.HasOne("ROLAC.API.Entities.Form1099Box", "Form1099Box")
|
||||
.WithMany()
|
||||
.HasForeignKey("Form1099BoxId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
b.HasOne("ROLAC.API.Entities.Form990ExpenseLine", "Form990Line")
|
||||
.WithMany()
|
||||
.HasForeignKey("Form990LineId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
b.Navigation("Form1099Box");
|
||||
|
||||
b.Navigation("Form990Line");
|
||||
});
|
||||
|
||||
@@ -2290,6 +2498,11 @@ namespace ROLAC.API.Migrations
|
||||
|
||||
modelBuilder.Entity("ROLAC.API.Entities.ExpenseSubCategory", b =>
|
||||
{
|
||||
b.HasOne("ROLAC.API.Entities.Form1099Box", "Form1099Box")
|
||||
.WithMany()
|
||||
.HasForeignKey("Form1099BoxId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
b.HasOne("ROLAC.API.Entities.Form990ExpenseLine", "Form990Line")
|
||||
.WithMany()
|
||||
.HasForeignKey("Form990LineId")
|
||||
@@ -2301,6 +2514,8 @@ namespace ROLAC.API.Migrations
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Form1099Box");
|
||||
|
||||
b.Navigation("Form990Line");
|
||||
|
||||
b.Navigation("Group");
|
||||
@@ -2380,6 +2595,16 @@ namespace ROLAC.API.Migrations
|
||||
b.Navigation("MessagingGroup");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ROLAC.API.Entities.Payee1099", b =>
|
||||
{
|
||||
b.HasOne("ROLAC.API.Entities.Member", "Member")
|
||||
.WithMany()
|
||||
.HasForeignKey("MemberId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
b.Navigation("Member");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ROLAC.API.Entities.RefreshToken", b =>
|
||||
{
|
||||
b.HasOne("ROLAC.API.Entities.AppUser", "User")
|
||||
|
||||
Reference in New Issue
Block a user