using System; using System.Collections.Generic; using Haoliang.Models.Common; namespace Haoliang.Models.Models.System { /// /// Production target configuration /// public class ProductionTargetConfig { public int DeviceId { get; set; } public string DeviceName { get; set; } public string ProgramName { get; set; } public decimal DailyTarget { get; set; } public decimal MonthlyTarget { get; set; } public decimal YearlyTarget { get; set; } public bool IsActive { get; set; } public DateTime CreatedAt { get; set; } public DateTime? UpdatedAt { get; set; } public string CreatedBy { get; set; } public string UpdatedBy { get; set; } } /// /// Working hours configuration /// public class WorkingHoursConfig { public List WorkingDays { get; set; } public TimeSpan WorkingHours { get; set; } public int StartHour { get; set; } public int EndHour { get; set; } public List BreakIntervals { get; set; } public bool IncludeWeekendProduction { get; set; } public decimal WeekendOvertimeRate { get; set; } public decimal NightShiftRate { get; set; } public DateTime CreatedAt { get; set; } public DateTime? UpdatedAt { get; set; } } /// /// Alert configuration /// public class AlertConfiguration { public bool EnableAlerts { get; set; } public List AlertTypes { get; set; } public Dictionary AlertThresholds { get; set; } public List NotificationChannels { get; set; } public EmailSettings EmailSettings { get; set; } public SMSSettings SMSSettings { get; set; } public WebhookSettings WebhookSettings { get; set; } public bool EnableAlertHistory { get; set; } public int AlertRetentionDays { get; set; } public DateTime CreatedAt { get; set; } public DateTime? UpdatedAt { get; set; } } /// /// Business rule configuration /// public class BusinessRuleConfig { public int RuleId { get; set; } public string RuleName { get; set; } public string Description { get; set; } public string RuleExpression { get; set; } public Dictionary Parameters { get; set; } public bool Enabled { get; set; } public DateTime CreatedAt { get; set; } public DateTime? UpdatedAt { get; set; } public string CreatedBy { get; set; } public string UpdatedBy { get; set; } public List Tags { get; set; } } /// /// Statistics rule configuration /// public class StatisticsRuleConfig { public int RuleId { get; set; } public string RuleName { get; set; } public string Description { get; set; } public string CalculationExpression { get; set; } public List InputFields { get; set; } public string OutputField { get; set; } public CalculationMethod CalculationMethod { get; set; } public bool Enabled { get; set; } public int Priority { get; set; } public DateTime CreatedAt { get; set; } public DateTime? UpdatedAt { get; set; } } /// /// Data retention configuration /// public class DataRetentionConfig { public int BusinessDataRetentionDays { get; set; } public int LogDataRetentionDays { get; set; } public int StatisticsDataRetentionDays { get; set; } public int AlertDataRetentionDays { get; set; } public bool AutoCleanupEnabled { get; set; } public string CleanupSchedule { get; set; } public bool CompressOldData { get; set; } public bool ArchiveDataBeforeDeletion { get; set; } public string ArchivePath { get; set; } public DateTime CreatedAt { get; set; } public DateTime? UpdatedAt { get; set; } } /// /// Dashboard configuration /// public class DashboardConfig { public int RefreshInterval { get; set; } public bool EnableRealTimeUpdates { get; set; } public string DefaultTimeRange { get; set; } public List AvailableTimeRanges { get; set; } public List AvailableWidgets { get; set; } public List DefaultWidgets { get; set; } public bool EnableExport { get; set; } public List ExportFormats { get; set; } public DateTime CreatedAt { get; set; } public DateTime? UpdatedAt { get; set; } } /// /// Export configuration /// public class ExportConfig { public List AvailableFormats { get; set; } public List AvailableFields { get; set; } public int MaxRecords { get; set; } public bool IncludeHeaders { get; set; } public string DateFormat { get; set; } public bool CompressFiles { get; set; } public string DefaultFormat { get; set; } public DateTime CreatedAt { get; set; } public DateTime? UpdatedAt { get; set; } } /// /// Data collection configuration /// public class CollectionConfig { public int DefaultCollectionInterval { get; set; } public int MaxCollectionInterval { get; set; } public int MinCollectionInterval { get; set; } public bool EnableRetry { get; set; } public int MaxRetries { get; set; } public int RetryDelayMs { get; set; } public bool EnableDataValidation { get; set; } public bool EnableAutoRecovery { get; set; } public List RequiredFields { get; set; } public DateTime CreatedAt { get; set; } public DateTime? UpdatedAt { get; set; } } /// /// Notification configuration /// public class NotificationConfig { public bool EnableNotifications { get; set; } public List NotificationTypes { get; set; } public EmailSettings EmailSettings { get; set; } public SMSSettings SMSSettings { get; set; } public WebhookSettings WebhookSettings { get; set; } bool PushNotificationSettings { get; set; } public int NotificationQueueSize { get; set; } public bool EnableNotificationHistory { get; set; } public int NotificationRetentionDays { get; set; } public DateTime CreatedAt { get; set; } public DateTime? UpdatedAt { get; set; } } /// /// Email settings /// public class EmailSettings { public bool EnableEmail { get; set; } public string SmtpServer { get; set; } public int SmtpPort { get; set; } public string SmtpUsername { get; set; } public string SmtpPassword { get; set; } public bool EnableSsl { get; set; } public List Recipients { get; set; } public string SenderEmail { get; set; } public string SenderName { get; set; } public bool EnableHtmlFormat { get; set; } } /// /// SMS settings /// public class SMSSettings { public bool EnableSMS { get; set; } public string Provider { get; set; } public string ApiKey { get; set; } public string ApiSecret { get; set; } public string PhoneNumber { get; set; } public List RecipientPhoneNumbers { get; set; } public bool EnableTestMode { get; set; } } /// /// Webhook settings /// public class WebhookSettings { public bool EnableWebhook { get; set; } public string WebhookUrl { get; set; } public string HttpMethod { get; set; } public Dictionary Headers { get; set; } public string PayloadFormat { get; set; } public bool EnableRetry { get; set; } public int MaxRetries { get; set; } public int RetryDelayMs { get; set; } public bool EnableSignature { get; set; } public string SignatureKey { get; set; } } /// /// Widget configuration /// public class WidgetConfig { public string WidgetType { get; set; } public string WidgetId { get; set; } public string Title { get; set; } public int PositionX { get; set; } public int PositionY { get; set; } public int Width { get; set; } public int Height { get; set; } public Dictionary Settings { get; set; } public bool IsVisible { get; set; } public int RefreshInterval { get; set; } } /// /// Configuration change tracking /// public class ConfigurationChange { public int ChangeId { get; set; } public string ConfigurationType { get; set; } public string ChangeType { get; set; } public string ChangedBy { get; set; } public DateTime ChangedAt { get; set; } public string OldValue { get; set; } public string NewValue { get; set; } public string Reason { get; set; } public string IPAddress { get; set; } } /// /// Calculation methods for statistics /// public enum CalculationMethod { Sum, Average, Minimum, Maximum, Count, Median, StandardDeviation, Percentage, Custom } }