mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 22:25:28 +01:00
* App: Add events which the app subscribes to Various events, which are relevant for the app to react to changes made on the server. * Refactor events * Do not extend NewBlockEvent * Refactoring events * Add store role events * Refactoring: Rename StoreUserEvent * Fix: Subscribe to UserEvent.Invited --------- Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
37 lines
1.1 KiB
C#
37 lines
1.1 KiB
C#
#nullable enable
|
|
using BTCPayServer.Data;
|
|
|
|
namespace BTCPayServer.Events;
|
|
|
|
public class AppEvent(AppData app, string? detail = null)
|
|
{
|
|
public class Created(AppData app, string? detail = null) : AppEvent(app, detail ?? app.AppType)
|
|
{
|
|
protected override string ToString()
|
|
{
|
|
return $"{base.ToString()} has been created";
|
|
}
|
|
}
|
|
public class Deleted(AppData app, string? detail = null) : AppEvent(app, detail ?? app.AppType)
|
|
{
|
|
protected override string ToString()
|
|
{
|
|
return $"{base.ToString()} has been deleted";
|
|
}
|
|
}
|
|
public class Updated(AppData app, string? detail = null) : AppEvent(app, detail ?? app.AppType)
|
|
{
|
|
protected override string ToString()
|
|
{
|
|
return $"{base.ToString()} has been updated";
|
|
}
|
|
}
|
|
public string AppId { get; } = app.Id;
|
|
public string StoreId { get; } = app.StoreDataId;
|
|
public string? Detail { get; } = detail;
|
|
|
|
protected new virtual string ToString()
|
|
{
|
|
return $"AppEvent: App \"{app.Name}\" ({StoreId})";
|
|
}
|
|
}
|