btcpayserver/BTCPayServer/Events/StoreUserEvent.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

38 lines
1.1 KiB
C#

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