✨ Payment grpc services and perks in proto
This commit is contained in:
@@ -32,7 +32,7 @@ public class Account : ModelBase
|
||||
|
||||
[JsonIgnore] public ICollection<Relationship> OutgoingRelationships { get; set; } = new List<Relationship>();
|
||||
[JsonIgnore] public ICollection<Relationship> IncomingRelationships { get; set; } = new List<Relationship>();
|
||||
|
||||
|
||||
[NotMapped] public SubscriptionReferenceObject? PerkSubscription { get; set; }
|
||||
|
||||
public Shared.Proto.Account ToProtoValue()
|
||||
@@ -46,6 +46,7 @@ public class Account : ModelBase
|
||||
ActivatedAt = ActivatedAt?.ToTimestamp(),
|
||||
IsSuperuser = IsSuperuser,
|
||||
Profile = Profile.ToProtoValue(),
|
||||
PerkSubscription = PerkSubscription?.ToProtoValue(),
|
||||
CreatedAt = CreatedAt.ToTimestamp(),
|
||||
UpdatedAt = UpdatedAt.ToTimestamp()
|
||||
};
|
||||
@@ -72,6 +73,9 @@ public class Account : ModelBase
|
||||
Language = proto.Language,
|
||||
ActivatedAt = proto.ActivatedAt?.ToInstant(),
|
||||
IsSuperuser = proto.IsSuperuser,
|
||||
PerkSubscription = proto.PerkSubscription is not null
|
||||
? SubscriptionReferenceObject.FromProtoValue(proto.PerkSubscription)
|
||||
: null,
|
||||
CreatedAt = proto.CreatedAt.ToInstant(),
|
||||
UpdatedAt = proto.UpdatedAt.ToInstant(),
|
||||
};
|
||||
|
@@ -39,7 +39,7 @@ public class AccountCurrentController(
|
||||
.Where(e => e.Id == userId)
|
||||
.FirstOrDefaultAsync();
|
||||
|
||||
var perk = await subscriptions.GetPerkSubscriptionAsync(account.Id);
|
||||
var perk = await subscriptions.GetPerkSubscriptionAsync(account!.Id);
|
||||
account.PerkSubscription = perk?.ToReference();
|
||||
|
||||
return Ok(account);
|
||||
|
@@ -10,7 +10,7 @@ namespace DysonNetwork.Pass.Account;
|
||||
|
||||
public class AccountEventService(
|
||||
AppDatabase db,
|
||||
PaymentService payment,
|
||||
Wallet.PaymentService payment,
|
||||
ICacheService cache,
|
||||
IStringLocalizer<Localization.AccountEventResource> localizer,
|
||||
PusherService.PusherServiceClient pusher
|
||||
|
Reference in New Issue
Block a user