feat(campaign): CampaignController.RegisterSerialCode + DTOs + tests

Adds POST /campaign/regist_serial_code with 9 integration tests covering
success path, all disqualifier conditions (unknown/disabled/expired/future/
already-redeemed/unsupported-reward-type), 401 on missing auth, and case-
sensitivity. IsSupportedGiftRewardType uses gift-wire literals (1/4/9) not
UserGoodsType enum values, matching GiftController.WireRewardTypeToUserGoodsType.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-06-09 18:51:03 -04:00
parent 9f7e78691b
commit 0d32d2167b
4 changed files with 356 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
using System.Text.Json.Serialization;
using MessagePack;
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Campaign;
/// <summary>
/// Body of <c>POST /campaign/regist_serial_code</c>. Client task:
/// <c>MyPageCodeInputTask</c> (Shadowverse_Code_2026-05-23/Wizard/MyPageCodeInputTask.cs).
/// </summary>
[MessagePackObject]
public sealed class RegisterSerialCodeRequest
{
/// <summary>User-typed serial code. Case-sensitive on the server.</summary>
[JsonPropertyName("serial_code")]
[Key("serial_code")]
public string SerialCode { get; set; } = string.Empty;
}