mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-02-02 12:54:22 +01:00
Providing overridable NotificationType property, direct mapping
This commit is contained in:
@@ -1,8 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using BTCPayServer.Data;
|
||||
using BTCPayServer.Models.NotificationViewModels;
|
||||
using ExchangeSharp;
|
||||
@@ -12,6 +8,8 @@ namespace BTCPayServer.Events.Notifications
|
||||
{
|
||||
public abstract class NotificationEventBase
|
||||
{
|
||||
public virtual string NotificationType { get { return GetType().Name; } }
|
||||
|
||||
public NotificationData ToData()
|
||||
{
|
||||
var obj = JsonConvert.SerializeObject(this);
|
||||
@@ -19,7 +17,7 @@ namespace BTCPayServer.Events.Notifications
|
||||
var data = new NotificationData
|
||||
{
|
||||
Created = DateTimeOffset.UtcNow,
|
||||
NotificationType = GetType().Name,
|
||||
NotificationType = NotificationType,
|
||||
Blob = obj.ToBytesUTF8(),
|
||||
Seen = false
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user