feat(pack): persist daily_free_gacha_count on PackChildGachaEntry

This commit is contained in:
gamer147
2026-06-08 21:31:02 -04:00
parent 7e4a9654b2
commit d762c5766f
7 changed files with 4282 additions and 0 deletions

View File

@@ -190,5 +190,42 @@
"dialog_title": "Dia_BuyCard_005_Title"
}
]
},
{
"parent_gacha_id": 80032,
"base_pack_id": 80001,
"gacha_type": 1,
"pack_category": 1,
"poster_type": 0,
"commence_date": "2026-06-01 02:00:00",
"complete_date": "2026-07-01 01:59:59",
"sleeve_id": 5090001,
"special_sleeve_id": 0,
"override_draw_effect_pack_id": 80001,
"override_ui_effect_pack_id": 80001,
"gacha_detail": "Throwback test pack with a free-pack-of-the-day child.",
"is_hide": true,
"is_new": false,
"is_pre_release": false,
"is_enabled": false,
"open_count_limit": 0,
"sales_period_time": "2026-07-01 01:59:59",
"gacha_point": null,
"child_gachas": [
{
"gacha_id": 780032,
"type_detail": 10,
"cost": 1,
"card_count": 8,
"item_id": null,
"is_daily_single": false,
"override_increase_gacha_point": 0,
"purchase_limit_count": 1,
"daily_free_gacha_count": 1,
"free_gacha_campaign_id": 49,
"campaign_name": "New Season Release Bonus"
}
],
"banners": []
}
]

View File

@@ -77,6 +77,7 @@ public class PackImporter
IsDailySingle = c.IsDailySingle,
OverrideIncreaseGachaPoint = c.OverrideIncreaseGachaPoint,
PurchaseLimitCount = c.PurchaseLimitCount,
DailyFreeGachaCount = c.DailyFreeGachaCount,
FreeGachaCampaignId = c.FreeGachaCampaignId,
CampaignName = c.CampaignName,
});
@@ -151,6 +152,7 @@ public class PackImporter
IsDailySingle = c.IsDailySingle,
OverrideIncreaseGachaPoint = c.OverrideIncreaseGachaPoint,
PurchaseLimitCount = c.PurchaseLimitCount,
DailyFreeGachaCount = c.DailyFreeGachaCount,
FreeGachaCampaignId = c.FreeGachaCampaignId,
CampaignName = c.CampaignName,
});

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,29 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace SVSim.Database.Migrations
{
/// <inheritdoc />
public partial class AddPackChildGachaDailyFreeGachaCount : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "DailyFreeGachaCount",
table: "PackChildGachaEntry",
type: "integer",
nullable: false,
defaultValue: 0);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "DailyFreeGachaCount",
table: "PackChildGachaEntry");
}
}
}

View File

@@ -3441,6 +3441,9 @@ namespace SVSim.Database.Migrations
b1.Property<int>("Cost")
.HasColumnType("integer");
b1.Property<int>("DailyFreeGachaCount")
.HasColumnType("integer");
b1.Property<int?>("FreeGachaCampaignId")
.HasColumnType("integer");

View File

@@ -21,6 +21,7 @@ public class PackChildGachaEntry
public bool IsDailySingle { get; set; }
public int OverrideIncreaseGachaPoint { get; set; }
public int PurchaseLimitCount { get; set; }
public int DailyFreeGachaCount { get; set; }
public int? FreeGachaCampaignId { get; set; }
public string? CampaignName { get; set; }
}

View File

@@ -58,4 +58,21 @@ public class PackSeedingPipelineTests
Assert.That(pack.ChildGachas.Count, Is.EqualTo(3),
"child_gacha_info is owned — rerun must replace, not stack.");
}
[Test]
public async Task SeedGlobals_preserves_daily_free_gacha_count_on_free_child()
{
using var factory = new SVSimTestFactory();
await factory.SeedGlobalsAsync();
using var scope = factory.Services.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<SVSimDbContext>();
var pack = await db.Packs.AsNoTracking().FirstAsync(p => p.Id == 80032);
var freeChild = pack.ChildGachas.Single(c => c.TypeDetail == 10);
Assert.That(freeChild.DailyFreeGachaCount, Is.EqualTo(1));
Assert.That(freeChild.PurchaseLimitCount, Is.EqualTo(1));
Assert.That(freeChild.FreeGachaCampaignId, Is.EqualTo(49));
Assert.That(freeChild.CampaignName, Is.EqualTo("New Season Release Bonus"));
}
}