refactor(pack): type PackChildGachaEntry.TypeDetail as CardPackType enum

This commit is contained in:
gamer147
2026-06-09 08:48:16 -04:00
parent 833bd85d36
commit 7118b92522
10 changed files with 84 additions and 58 deletions

View File

@@ -25,7 +25,7 @@ public class PackControllerInfoTests
Id = parentId, BasePackId = baseId, PackCategory = cat,
CommenceDate = DateTime.UtcNow.AddDays(-1), CompleteDate = DateTime.UtcNow.AddDays(30),
GachaType = 1, GachaDetail = "test",
ChildGachas = { new PackChildGachaEntry { GachaId = parentId * 10 + 7, TypeDetail = 7, Cost = 100, CardCount = 8 } },
ChildGachas = { new PackChildGachaEntry { GachaId = parentId * 10 + 7, TypeDetail = CardPackType.RupyMulti, Cost = 100, CardCount = 8 } },
});
await db.SaveChangesAsync();
}
@@ -112,7 +112,7 @@ public class PackControllerInfoTests
CommenceDate = DateTime.UtcNow.AddDays(-1), CompleteDate = DateTime.UtcNow.AddDays(30),
GachaType = 1, GachaDetail = "legendary special", SleeveId = 5090001,
GachaPointConfig = null,
ChildGachas = { new PackChildGachaEntry { GachaId = 920002, TypeDetail = 5, Cost = 1, CardCount = 8, ItemId = 92001 } },
ChildGachas = { new PackChildGachaEntry { GachaId = 920002, TypeDetail = CardPackType.TicketMulti, Cost = 1, CardCount = 8, ItemId = 92001 } },
});
await db.SaveChangesAsync();
}
@@ -149,7 +149,7 @@ public class PackControllerInfoTests
{
// Must include at least one non-ticket child so this pack is NOT ticket-only
// and remains visible with a gacha_point block.
new PackChildGachaEntry { GachaId = 100087, TypeDetail = 7, Cost = 100, CardCount = 8 },
new PackChildGachaEntry { GachaId = 100087, TypeDetail = CardPackType.RupyMulti, Cost = 100, CardCount = 8 },
},
});
var viewer = await db.Viewers
@@ -190,7 +190,7 @@ public class PackControllerInfoTests
GachaPointConfig = new PackGachaPointConfig { ExchangeablePoint = 400, IncreaseGachaPoint = 1 },
ChildGachas =
{
new PackChildGachaEntry { GachaId = 990475, TypeDetail = 5, Cost = 0, CardCount = 8 },
new PackChildGachaEntry { GachaId = 990475, TypeDetail = CardPackType.TicketMulti, Cost = 0, CardCount = 8 },
},
});
await db.SaveChangesAsync();
@@ -227,10 +227,10 @@ public class PackControllerInfoTests
GachaType = 1, GachaDetail = "throwback test", SleeveId = 5090001,
ChildGachas =
{
new PackChildGachaEntry { GachaId = 800032, TypeDetail = 5, Cost = 1, CardCount = 8, ItemId = 80001 },
new PackChildGachaEntry { GachaId = 800032, TypeDetail = CardPackType.TicketMulti, Cost = 1, CardCount = 8, ItemId = 80001 },
new PackChildGachaEntry
{
GachaId = 780032, TypeDetail = 10, Cost = 1, CardCount = 8,
GachaId = 780032, TypeDetail = CardPackType.FreePacks, Cost = 1, CardCount = 8,
PurchaseLimitCount = 1, DailyFreeGachaCount = 1,
FreeGachaCampaignId = 49, CampaignName = "Test Campaign",
},
@@ -272,10 +272,10 @@ public class PackControllerInfoTests
GachaType = 1, GachaDetail = "throwback test", SleeveId = 5090001,
ChildGachas =
{
new PackChildGachaEntry { GachaId = 800033, TypeDetail = 5, Cost = 1, CardCount = 8, ItemId = 80001 },
new PackChildGachaEntry { GachaId = 800033, TypeDetail = CardPackType.TicketMulti, Cost = 1, CardCount = 8, ItemId = 80001 },
new PackChildGachaEntry
{
GachaId = 780033, TypeDetail = 10, Cost = 1, CardCount = 8,
GachaId = 780033, TypeDetail = CardPackType.FreePacks, Cost = 1, CardCount = 8,
DailyFreeGachaCount = 1, FreeGachaCampaignId = 50, CampaignName = "X",
},
},