2020-06-28 21:44:35 -05:00
using System ;
2019-01-04 11:42:37 +01:00
using System.Collections.Generic ;
2018-12-11 16:36:25 +01:00
using System.ComponentModel.DataAnnotations ;
2019-02-19 13:07:10 +09:00
using BTCPayServer.Services.Apps ;
2019-03-29 07:51:00 +01:00
using BTCPayServer.Validation ;
2018-12-11 16:36:25 +01:00
namespace BTCPayServer.Models.AppViewModels
{
public class UpdateCrowdfundViewModel
{
2019-07-14 22:54:27 +09:00
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 ; }
2019-01-04 11:42:37 +01:00
2020-01-23 20:19:24 -06:00
[Required]
public string Description { get ; set ; }
2019-01-04 11:42:37 +01:00
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")]
2019-03-29 07:51:00 +01:00
[Uri]
2018-12-22 15:02:16 +01:00
public string NotificationUrl { get ; set ; }
2019-01-04 11:42:37 +01:00
2018-12-11 16:36:25 +01:00
[Required]
2019-01-10 14:19:06 +01:00
[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 ;
2019-01-04 11:42:37 +01:00
2018-12-31 11:38:05 +01:00
[Required]
[Display(Name = "Enable background animations on new payments")]
public bool AnimationsEnabled { get ; set ; } = true ;
2019-01-04 11:42:37 +01:00
2018-12-31 11:38:05 +01:00
[Required]
[Display(Name = "Enable sounds on new payments")]
public bool SoundsEnabled { get ; set ; } = true ;
2019-01-04 11:42:37 +01:00
2018-12-31 11:38:05 +01:00
[Required]
[Display(Name = "Enable Disqus Comments")]
public bool DisqusEnabled { get ; set ; } = true ;
2019-01-04 11:42:37 +01:00
[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
2019-02-11 21:53:45 -06:00
[Required]
2018-12-11 16:36:25 +01:00
[MaxLength(5)]
2019-02-11 21:53:45 -06:00
[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" ;
2019-01-04 11:42:37 +01:00
2018-12-11 16:36:25 +01:00
[Display(Name = "Set a Target amount ")]
2019-03-07 06:29:29 +01:00
[Range(0, double.PositiveInfinity)]
2018-12-11 16:36:25 +01:00
public decimal? TargetAmount { get ; set ; }
2019-01-04 11:42:37 +01:00
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 ) ;
2019-01-04 11:42:37 +01:00
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 ; }
2019-01-04 11:42:37 +01:00
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 ; }
2019-02-19 12:48:48 +09:00
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 ; }
2019-03-07 06:25:09 +01:00
[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 ; }
2019-03-07 06:25:09 +01:00
[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 ; }
2019-04-28 08:27:10 +02:00
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
}
}