using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using _0_Framework.Domain; using AccountManagement.Domain.AccountAgg; using Company.Domain.WorkshopAgg; namespace Company.Domain.RollCallServiceAgg; public class RollCallService : EntityBase { public RollCallService(string serviceType, DateTime startService, DateTime endService, long workshopId, long accountId, int maxPersonValid, double amount, string duration) { ServiceType = serviceType; StartService = startService; EndService = endService; WorkshopId = workshopId; AccountId = accountId; MaxPersonValid = maxPersonValid; Amount = amount; Duration = duration; IsActiveString = "true"; HasCustomizeCheckoutService = "false"; } public string ServiceType { get; private set; } public DateTime StartService { get; private set; } public DateTime EndService { get; private set; } public long WorkshopId { get; private set; } public long AccountId { get; private set; } public string IsActiveString { get; private set; } public int MaxPersonValid { get; private set; } public double Amount { get; private set; } public string Duration { get; private set; } #region CustomizeCheckoutService public string HasCustomizeCheckoutService { get; private set; } public DateTime? CustomizeCheckoutServiceStart { get; private set; } public DateTime? CustomizeCheckoutServiceEnd{ get; private set; } public double CustomizeCheckoutAmount { get; private set; } #endregion public Workshop Workshop { get; set; } public void AddOrRemoveCoustomizeCheckoutServiceVip(string hasCustomizeCheckoutServise,DateTime endService, DateTime startService) { HasCustomizeCheckoutService = hasCustomizeCheckoutServise; CustomizeCheckoutServiceStart = hasCustomizeCheckoutServise == "true" ? DateTime.Now : startService; CustomizeCheckoutServiceEnd = hasCustomizeCheckoutServise == "true" ? endService : DateTime.Now; CustomizeCheckoutAmount = 0; } public void UpgradeService(string serviceType, DateTime startService, DateTime endService, int maxPersonValid, double amount, string duration) { ServiceType = serviceType; StartService = startService; EndService = endService; MaxPersonValid = maxPersonValid; Amount = amount; Duration = duration; } public void StopVipService(bool hasCustomizeCheckoutBefor) { IsActiveString = "false"; EndService = DateTime.Now; if (hasCustomizeCheckoutBefor) { CustomizeCheckoutServiceEnd = DateTime.Now; HasCustomizeCheckoutService = "false"; } } public void DeActive() { IsActiveString = "false"; } public void Active() { IsActiveString = "true"; } }