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; }
|
2021-04-08 15:32:42 +02:00
|
|
|
public string StoreName { get; set; }
|
2021-10-29 06:29:02 -04:00
|
|
|
|
|
|
|
[Required]
|
|
|
|
[MaxLength(50)]
|
|
|
|
[MinLength(1)]
|
|
|
|
[Display(Name = "App Name")]
|
|
|
|
public string AppName { get; set; }
|
2021-04-08 15:32:42 +02:00
|
|
|
|
2020-01-23 20:19:24 -06:00
|
|
|
[Required]
|
|
|
|
[MaxLength(30)]
|
2021-10-29 06:29:02 -04:00
|
|
|
[Display(Name = "Display Title")]
|
2020-01-23 20:19:24 -06:00
|
|
|
public string Title { get; set; }
|
|
|
|
|
|
|
|
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
|
|
|
|
2021-07-23 03:57:19 -07: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]
|
2021-07-29 22:31:44 -07:00
|
|
|
[Display(Name = "Make Crowdfund Public")]
|
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
|
|
|
|
2021-07-29 22:31:44 -07:00
|
|
|
[Display(Name = "Disqus Shortname")]
|
|
|
|
public string DisqusShortname { get; set; }
|
|
|
|
|
|
|
|
[Display(Name = "Start date")]
|
2018-12-11 16:36:25 +01:00
|
|
|
public DateTime? StartDate { get; set; }
|
2021-07-29 22:31:44 -07:00
|
|
|
|
|
|
|
[Display(Name = "End date")]
|
2018-12-11 16:36:25 +01:00
|
|
|
public DateTime? EndDate { get; set; }
|
2018-12-31 11:38:05 +01:00
|
|
|
|
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.)")]
|
2021-10-25 16:54:36 +09:00
|
|
|
public string TargetCurrency { get; set; }
|
2019-01-04 11:42:37 +01:00
|
|
|
|
2021-07-29 22:31:44 -07: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; }
|
2021-07-29 22:31:44 -07:00
|
|
|
|
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;
|
2021-07-29 22:31:44 -07:00
|
|
|
|
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)]
|
2021-07-23 03:57:19 -07:00
|
|
|
[Display(Name = "Custom CSS URL")]
|
2018-12-11 16:36:25 +01:00
|
|
|
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
|
|
|
|
2021-07-29 22:31:44 -07:00
|
|
|
[Display(Name = "Count all invoices created on the store as part of the 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; }
|
2021-07-29 22:31:44 -07:00
|
|
|
|
2019-01-09 12:22:36 +01:00
|
|
|
[Display(Name = "Display contribution ranking")]
|
|
|
|
public bool DisplayPerksRanking { get; set; }
|
2021-10-04 07:54:06 +02:00
|
|
|
|
|
|
|
[Display(Name = "Display contribution value")]
|
|
|
|
public bool DisplayPerksValue { 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; }
|
2021-07-29 22:31:44 -07:00
|
|
|
|
2021-09-27 04:46:56 +02:00
|
|
|
[Display(Name = "Colors to rotate between with animation when a payment is made. One color per line (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
|
2021-04-08 15:32:42 +02:00
|
|
|
public bool ModelWithMinimumData => Description != null && Title != null && TargetCurrency != null;
|
2018-12-11 16:36:25 +01:00
|
|
|
}
|
|
|
|
}
|