🐛 Fix some issues in sepration of the Pass and Wallet service

This commit is contained in:
2026-02-04 00:04:54 +08:00
parent 9a1f36ee26
commit 148117c54a
18 changed files with 5157 additions and 158 deletions

View File

@@ -32,7 +32,7 @@ public class SnLottery : ModelBase
{
public Guid Id { get; init; } = Guid.NewGuid();
public SnAccount Account { get; init; } = null!;
[NotMapped] public SnAccount Account { get; init; } = null!;
public Guid AccountId { get; init; }
[Column(TypeName = "jsonb")]

View File

@@ -74,13 +74,13 @@ public class SnWalletGift : ModelBase
/// The user who purchased/gave the gift.
/// </summary>
public Guid GifterId { get; set; }
public SnAccount Gifter { get; set; } = null!;
[NotMapped] public SnAccount Gifter { get; set; } = null!;
/// <summary>
/// The intended recipient. Null for open gifts that anyone can redeem.
/// </summary>
public Guid? RecipientId { get; set; }
public SnAccount? Recipient { get; set; }
[NotMapped] public SnAccount? Recipient { get; set; }
/// <summary>
/// Unique redemption code/link identifier for the gift.
@@ -124,7 +124,7 @@ public class SnWalletGift : ModelBase
/// The user who redeemed the gift (if different from recipient).
/// </summary>
public Guid? RedeemerId { get; set; }
public SnAccount? Redeemer { get; set; }
[NotMapped] public SnAccount? Redeemer { get; set; }
/// <summary>
/// The subscription created when the gift is redeemed.
@@ -331,7 +331,7 @@ public class SnWalletSubscription : ModelBase
public Instant? RenewalAt { get; set; }
public Guid AccountId { get; set; }
public SnAccount Account { get; set; } = null!;
[NotMapped] public SnAccount Account { get; set; } = null!;
/// <summary>
/// If this subscription was redeemed from a gift, this references the gift record.

View File

@@ -1,4 +1,5 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Globalization;
using System.Text.Json.Serialization;
using MessagePack;
@@ -14,7 +15,7 @@ public class SnWallet : ModelBase
public List<SnWalletPocket> Pockets { get; set; } = new List<SnWalletPocket>();
public Guid AccountId { get; set; }
public SnAccount Account { get; set; } = null!;
[NotMapped] public SnAccount Account { get; set; } = null!;
public Proto.Wallet ToProtoValue()
{
@@ -95,7 +96,7 @@ public class SnWalletFund : ModelBase
// Creator
public Guid CreatorAccountId { get; set; }
public SnAccount CreatorAccount { get; set; } = null!;
[NotMapped] public SnAccount CreatorAccount { get; set; } = null!;
// Recipients
public List<SnWalletFundRecipient> Recipients { get; set; } = new List<SnWalletFundRecipient>();
@@ -139,7 +140,7 @@ public class SnWalletFundRecipient : ModelBase
[JsonIgnore] public SnWalletFund Fund { get; set; } = null!;
public Guid RecipientAccountId { get; set; }
public SnAccount RecipientAccount { get; set; } = null!;
[NotMapped] public SnAccount RecipientAccount { get; set; } = null!;
public decimal Amount { get; set; }
public bool IsReceived { get; set; } = false;