btcpayserver/BTCPayServer/Events/StoreRoleEvent.cs
d11n 00cc16455c
App: Add events which the app subscribes to (#6435)
* 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>
2024-12-11 20:11:51 +09:00

37 lines
1007 B
C#

#nullable enable
namespace BTCPayServer.Events;
public abstract class StoreRoleEvent(string storeId, string roleId)
{
public string StoreId { get; } = storeId;
public string RoleId { get; } = roleId;
public class Added(string storeId, string roleId) : StoreRoleEvent(storeId, roleId)
{
protected override string ToString()
{
return $"{base.ToString()} has been added";
}
}
public class Removed(string storeId, string roleId) : StoreRoleEvent(storeId, roleId)
{
protected override string ToString()
{
return $"{base.ToString()} has been removed";
}
}
public class Updated(string storeId, string roleId) : StoreRoleEvent(storeId, roleId)
{
protected override string ToString()
{
return $"{base.ToString()} has been updated";
}
}
protected new virtual string ToString()
{
return $"StoreRoleEvent: Store {StoreId}, Role {RoleId}";
}
}