Add action gathering functionality: implement ActionGathered model and repository, update Pet model and services, and enhance GameItemsRepository with item retrieval methods.

This commit is contained in:
2025-02-09 21:22:52 -03:00
parent 653cc451d2
commit 215d4ecb72
18 changed files with 481 additions and 41 deletions

View File

@@ -17,6 +17,34 @@ namespace PetCompanion.Migrations
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "9.0.1");
modelBuilder.Entity("PetCompanion.Models.ActionGathered", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("Amount")
.HasColumnType("INTEGER");
b.Property<int?>("ItemId")
.HasColumnType("INTEGER");
b.Property<string>("PetId")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Resource")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("ItemId");
b.HasIndex("PetId");
b.ToTable("ActionGathered");
});
modelBuilder.Entity("PetCompanion.Models.EquippedItem", b =>
{
b.Property<int>("Id")
@@ -665,6 +693,23 @@ namespace PetCompanion.Migrations
});
});
modelBuilder.Entity("PetCompanion.Models.ActionGathered", b =>
{
b.HasOne("PetCompanion.Models.GameItem", "GameItem")
.WithMany()
.HasForeignKey("ItemId");
b.HasOne("PetCompanion.Models.Pet", "Pet")
.WithMany("ActionGathered")
.HasForeignKey("PetId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("GameItem");
b.Navigation("Pet");
});
modelBuilder.Entity("PetCompanion.Models.EquippedItem", b =>
{
b.HasOne("PetCompanion.Models.GameItem", "GameItem")
@@ -756,6 +801,8 @@ namespace PetCompanion.Migrations
modelBuilder.Entity("PetCompanion.Models.Pet", b =>
{
b.Navigation("ActionGathered");
b.Navigation("EquippedItemsList");
b.Navigation("Inventory")