btcpayserver/BTCPayServer/Plugins/Crowdfund/Models/ViewCrowdfundViewModel.cs

85 lines
3.3 KiB
C#
Raw Normal View History

2020-06-28 21:44:35 -05:00
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using BTCPayServer.Models;
2022-07-18 20:51:53 +02:00
using BTCPayServer.Plugins.PointOfSale.Models;
2019-01-08 15:49:07 +01:00
using BTCPayServer.Services.Rates;
2022-07-18 20:51:53 +02:00
namespace BTCPayServer.Plugins.Crowdfund.Models
2018-12-11 16:36:25 +01:00
{
public class ViewCrowdfundViewModel
{
2019-03-09 16:08:31 +09:00
public string HubPath { get; set; }
public string StoreId { get; set; }
public string AppId { get; set; }
2018-12-11 16:36:25 +01:00
public string Title { get; set; }
public string Description { get; set; }
2018-12-22 15:02:16 +01:00
public string MainImageUrl { get; set; }
public string StoreName { get; set; }
public DateTime? StartDate { get; set; }
public DateTime? EndDate { get; set; }
public string TargetCurrency { get; set; }
public decimal? TargetAmount { get; set; }
public bool EnforceTargetAmount { get; set; }
public CrowdfundInfo Info { get; set; }
2018-12-22 15:02:16 +01:00
public string Tagline { get; set; }
public StoreBrandingViewModel StoreBranding { get; set; }
2018-12-29 11:52:07 +01:00
public ViewPointOfSaleViewModel.Item[] Perks { get; set; }
public bool SimpleDisplay { get; set; }
2018-12-31 11:38:05 +01:00
public bool DisqusEnabled { get; set; }
public bool SoundsEnabled { get; set; }
public string DisqusShortname { get; set; }
public bool AnimationsEnabled { get; set; }
public string[] AnimationColors { get; set; }
public string[] Sounds { get; set; }
public int ResetEveryAmount { get; set; }
public bool NeverReset { get; set; }
public string FormUrl { get; set; }
2019-01-08 15:10:05 +01:00
public Dictionary<string, int> PerkCount { get; set; }
2019-01-08 15:49:07 +01:00
public CurrencyData CurrencyData { get; set; }
2020-06-28 17:55:27 +09:00
public class CrowdfundInfo
{
public class PaymentStat
{
public string Label { get; set; }
public decimal Percent { get; set; }
public bool IsLightning { get; set; }
}
public int TotalContributors { get; set; }
public decimal CurrentPendingAmount { get; set; }
public decimal CurrentAmount { get; set; }
2018-12-22 15:02:16 +01:00
public decimal? ProgressPercentage { get; set; }
2018-12-28 17:38:20 +01:00
public decimal? PendingProgressPercentage { get; set; }
2019-01-02 09:45:04 +01:00
public DateTime LastUpdated { get; set; }
public Dictionary<string, PaymentStat> PaymentStats { get; set; }
public Dictionary<string, PaymentStat> PendingPaymentStats { get; set; }
public DateTime? LastResetDate { get; set; }
public DateTime? NextResetDate { get; set; }
}
2023-04-10 11:07:03 +09:00
public bool Started => !StartDate.HasValue || DateTime.UtcNow > StartDate;
2019-01-07 14:39:04 +01:00
public bool Ended => EndDate.HasValue && DateTime.UtcNow > EndDate;
2019-01-09 12:22:36 +01:00
public bool DisplayPerksRanking { get; set; }
public bool DisplayPerksValue { get; set; }
public bool Enabled { get; set; }
public string ResetEvery { get; set; }
public Dictionary<string, decimal> PerkValue { get; set; }
}
public class ContributeToCrowdfund
{
2018-12-22 15:02:16 +01:00
public ViewCrowdfundViewModel ViewCrowdfundViewModel { get; set; }
2021-10-08 13:11:00 +02:00
[Required] public decimal? Amount { get; set; }
public string Email { get; set; }
2018-12-29 11:52:07 +01:00
public string ChoiceKey { get; set; }
public bool RedirectToCheckout { get; set; }
public string RedirectUrl { get; set; }
2018-12-11 16:36:25 +01:00
}
}