mirror of
https://github.com/bitwarden/server.git
synced 2026-02-10 10:55:10 +08:00
[PM-12420] Stripe events recovery (#4793)
* Billing: Add event recovery endpoints * Core: Add InternalBilling to BaseServiceUriSettings * Admin: Scaffold billing section * Admin: Scaffold ProcessStripeEvents section * Admin: Implement event processing * Run dotnet format
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Bit.Admin.Billing.Models.ProcessStripeEvents;
|
||||
|
||||
public class EventsFormModel : IValidatableObject
|
||||
{
|
||||
[Required]
|
||||
public string EventIds { get; set; }
|
||||
|
||||
[Required]
|
||||
[DisplayName("Inspect Only")]
|
||||
public bool Inspect { get; set; }
|
||||
|
||||
public List<string> GetEventIds() =>
|
||||
EventIds?.Split([Environment.NewLine], StringSplitOptions.RemoveEmptyEntries)
|
||||
.Select(eventId => eventId.Trim())
|
||||
.ToList() ?? [];
|
||||
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
var eventIds = GetEventIds();
|
||||
|
||||
if (eventIds.Any(eventId => !eventId.StartsWith("evt_")))
|
||||
{
|
||||
yield return new ValidationResult("Event Ids must start with 'evt_'.");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user