feat(giving): add EF migration for giving module

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Chris Chen
2026-05-28 16:25:11 -07:00
parent 577ae1aabe
commit 8b52572fad
3 changed files with 1172 additions and 0 deletions
@@ -283,6 +283,135 @@ namespace ROLAC.API.Migrations
b.ToTable("FamilyUnits");
});
modelBuilder.Entity("ROLAC.API.Entities.Giving", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<decimal>("Amount")
.HasColumnType("decimal(18,2)");
b.Property<string>("CheckNumber")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("CreatedBy")
.IsRequired()
.HasMaxLength(450)
.HasColumnType("character varying(450)");
b.Property<int>("GivingCategoryId")
.HasColumnType("integer");
b.Property<DateOnly>("GivingDate")
.HasColumnType("date");
b.Property<bool>("IsAnonymous")
.HasColumnType("boolean");
b.Property<int?>("MemberId")
.HasColumnType("integer");
b.Property<string>("Notes")
.HasMaxLength(500)
.HasColumnType("character varying(500)");
b.Property<int?>("OfferingSessionId")
.HasColumnType("integer");
b.Property<string>("PayPalTransactionId")
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.Property<string>("PaymentMethod")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("character varying(20)");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("UpdatedBy")
.IsRequired()
.HasMaxLength(450)
.HasColumnType("character varying(450)");
b.Property<string>("ZelleReferenceCode")
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.HasKey("Id");
b.HasIndex("GivingCategoryId");
b.HasIndex("GivingDate");
b.HasIndex("OfferingSessionId")
.HasFilter("\"OfferingSessionId\" IS NOT NULL");
b.HasIndex("MemberId", "GivingDate");
b.ToTable("Givings");
});
modelBuilder.Entity("ROLAC.API.Entities.GivingCategory", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("CreatedBy")
.IsRequired()
.HasMaxLength(450)
.HasColumnType("character varying(450)");
b.Property<string>("Description_en")
.HasMaxLength(500)
.HasColumnType("character varying(500)");
b.Property<string>("Description_zh")
.HasMaxLength(500)
.HasColumnType("character varying(500)");
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.ToTable("GivingCategories");
});
modelBuilder.Entity("ROLAC.API.Entities.Member", b =>
{
b.Property<int>("Id")
@@ -428,6 +557,77 @@ namespace ROLAC.API.Migrations
b.ToTable("Members");
});
modelBuilder.Entity("ROLAC.API.Entities.OfferingSession", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<decimal>("CashTotal")
.HasColumnType("decimal(18,2)");
b.Property<decimal>("CheckTotal")
.HasColumnType("decimal(18,2)");
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("CreatedBy")
.IsRequired()
.HasMaxLength(450)
.HasColumnType("character varying(450)");
b.Property<decimal>("Difference")
.HasColumnType("decimal(18,2)");
b.Property<string>("Notes")
.HasColumnType("text");
b.Property<DateTimeOffset?>("ReconciledAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("ReconciledBy")
.HasMaxLength(450)
.HasColumnType("character varying(450)");
b.Property<DateOnly>("SessionDate")
.HasColumnType("date");
b.Property<string>("Status")
.IsRequired()
.ValueGeneratedOnAdd()
.HasMaxLength(20)
.HasColumnType("character varying(20)")
.HasDefaultValue("Draft");
b.Property<DateTimeOffset?>("SubmittedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("SubmittedBy")
.HasMaxLength(450)
.HasColumnType("character varying(450)");
b.Property<decimal>("SystemTotal")
.HasColumnType("decimal(18,2)");
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("SessionDate")
.IsUnique();
b.ToTable("OfferingSessions");
});
modelBuilder.Entity("ROLAC.API.Entities.RefreshToken", b =>
{
b.Property<int>("Id")
@@ -528,6 +728,31 @@ namespace ROLAC.API.Migrations
.IsRequired();
});
modelBuilder.Entity("ROLAC.API.Entities.Giving", b =>
{
b.HasOne("ROLAC.API.Entities.GivingCategory", "GivingCategory")
.WithMany()
.HasForeignKey("GivingCategoryId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("ROLAC.API.Entities.Member", "Member")
.WithMany()
.HasForeignKey("MemberId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("ROLAC.API.Entities.OfferingSession", "OfferingSession")
.WithMany("Givings")
.HasForeignKey("OfferingSessionId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("GivingCategory");
b.Navigation("Member");
b.Navigation("OfferingSession");
});
modelBuilder.Entity("ROLAC.API.Entities.Member", b =>
{
b.HasOne("ROLAC.API.Entities.FamilyUnit", "FamilyUnit")
@@ -553,6 +778,11 @@ namespace ROLAC.API.Migrations
{
b.Navigation("RefreshTokens");
});
modelBuilder.Entity("ROLAC.API.Entities.OfferingSession", b =>
{
b.Navigation("Givings");
});
#pragma warning restore 612, 618
}
}