btcpayserver/BTCPayServer/Models/AppViewModels/UpdateCrowdfundViewModel.cs

107 lines
3.6 KiB
C#
Raw Normal View History

2020-06-28 21:44:35 -05:00
using System;
using System.Collections.Generic;
2018-12-11 16:36:25 +01:00
using System.ComponentModel.DataAnnotations;
using BTCPayServer.Services.Apps;
using BTCPayServer.Validation;
2018-12-11 16:36:25 +01:00
namespace BTCPayServer.Models.AppViewModels
{
public class UpdateCrowdfundViewModel
{
public string StoreId { get; set; }
2020-01-23 20:19:24 -06:00
[Required]
[MaxLength(30)]
public string Title { get; set; }
[MaxLength(50)]
public string Tagline { get; set; }
2020-01-23 20:19:24 -06:00
[Required]
public string Description { get; set; }
2019-01-04 12:58:29 +01:00
[Display(Name = "Featured Image")]
2018-12-22 15:02:16 +01:00
public string MainImageUrl { get; set; }
2020-01-23 20:19:24 -06:00
[Display(Name = "Callback Notification Url")]
[Uri]
2018-12-22 15:02:16 +01:00
public string NotificationUrl { get; set; }
2018-12-11 16:36:25 +01:00
[Required]
[Display(Name = "Allow crowdfund to be publicly visible (still visible to you)")]
2018-12-28 17:38:20 +01:00
public bool Enabled { get; set; } = false;
2018-12-31 11:38:05 +01:00
[Required]
[Display(Name = "Enable background animations on new payments")]
public bool AnimationsEnabled { get; set; } = true;
2018-12-31 11:38:05 +01:00
[Required]
[Display(Name = "Enable sounds on new payments")]
public bool SoundsEnabled { get; set; } = true;
2018-12-31 11:38:05 +01:00
[Required]
[Display(Name = "Enable Disqus Comments")]
public bool DisqusEnabled { get; set; } = true;
[Display(Name = "Disqus Shortname")] public string DisqusShortname { get; set; }
2018-12-11 16:36:25 +01:00
public DateTime? StartDate { get; set; }
public DateTime? EndDate { get; set; }
2018-12-31 11:38:05 +01:00
[Required]
2018-12-11 16:36:25 +01:00
[MaxLength(5)]
[Display(Name = "Primary currency used for targets and stats. (e.g. BTC, LTC, USD, etc.)")]
2018-12-31 11:38:05 +01:00
public string TargetCurrency { get; set; } = "BTC";
2018-12-11 16:36:25 +01:00
[Display(Name = "Set a Target amount ")]
[Range(0, double.PositiveInfinity)]
2018-12-11 16:36:25 +01:00
public decimal? TargetAmount { get; set; }
public IEnumerable<string> ResetEveryValues = Enum.GetNames(typeof(CrowdfundResetEvery));
2020-01-23 20:19:24 -06:00
[Display(Name = "Reset goal every")]
public string ResetEvery { get; set; } = nameof(CrowdfundResetEvery.Never);
public int ResetEveryAmount { get; set; } = 1;
2018-12-11 16:36:25 +01:00
[Display(Name = "Do not allow additional contributions after target has been reached")]
public bool EnforceTargetAmount { get; set; }
2018-12-29 11:52:07 +01:00
[Display(Name = "Contribution Perks Template")]
public string PerksTemplate { get; set; }
2018-12-11 16:36:25 +01:00
[MaxLength(500)]
[Display(Name = "Custom bootstrap CSS file")]
public string CustomCSSLink { get; set; }
2018-12-22 15:02:16 +01:00
2019-01-04 12:58:29 +01:00
[Display(Name = "Custom CSS Code")]
2018-12-22 15:43:40 +01:00
public string EmbeddedCSS { get; set; }
2019-01-02 12:47:06 +01:00
2019-01-04 12:58:29 +01:00
[Display(Name = "Count all invoices created on the store as part of the crowdfunding goal")]
2020-01-23 20:19:24 -06:00
public bool UseAllStoreInvoices { get; set; }
2019-01-05 10:17:52 +01:00
public string AppId { get; set; }
public string SearchTerm { get; set; }
2019-01-09 12:22:36 +01:00
[Display(Name = "Sort contribution perks by popularity")]
public bool SortPerksByPopularity { get; set; }
[Display(Name = "Display contribution ranking")]
public bool DisplayPerksRanking { get; set; }
[Display(Name = "Sounds to play when a payment is made. One sound per line")]
2020-01-23 20:19:24 -06:00
public string Sounds { get; set; }
[Display(Name = "Colors to rotate between with animation when a payment is made. First color is the default background. One color per line. Can be any valid css color value.")]
2020-01-23 20:19:24 -06:00
public string AnimationColors { get; set; }
2020-01-23 20:19:24 -06:00
// NOTE: Improve validation if needed
public bool ModelWithMinimumData
{
get { return Description != null && Title != null && TargetCurrency != null; }
}
2018-12-11 16:36:25 +01:00
}
}