namespace GreenHome.Domain; /// /// نوع پیام در گروه مجازی دستگاه /// public enum DevicePostType { /// متن Text = 0, /// تصویر Image = 1, /// ویس Voice = 2, /// اسنپ‌شات وضعیت سنسورها و رله‌ها SensorSnapshot = 3 } /// /// پست‌های گروه مجازی دستگاه (تایم‌لاین مشترک) /// public sealed class DevicePost { public int Id { get; set; } /// /// شناسه دستگاه /// public int DeviceId { get; set; } public Device Device { get; set; } = null!; /// /// شناسه کاربر نویسنده پست /// public int AuthorUserId { get; set; } public User AuthorUser { get; set; } = null!; /// /// متن پست /// public string Content { get; set; } = string.Empty; /// /// نوع پیام /// public DevicePostType PostType { get; set; } = DevicePostType.Text; /// /// مسیر نسبی فایل صوتی (برای پیام ویس) /// public string? VoiceFilePath { get; set; } /// /// مدت‌زمان ویس (ثانیه) /// public int? VoiceDurationSeconds { get; set; } /// /// تصاویر پیوست /// public ICollection Images { get; set; } = new List(); /// /// زمان ایجاد /// public DateTime CreatedAt { get; set; } /// /// زمان آخرین ویرایش /// public DateTime? UpdatedAt { get; set; } } /// /// تصاویر پیوست پست /// public sealed class DevicePostImage { public int Id { get; set; } /// /// شناسه پست /// public int DevicePostId { get; set; } public DevicePost DevicePost { get; set; } = null!; /// /// نام فایل /// public string FileName { get; set; } = string.Empty; /// /// مسیر ذخیره فایل /// public string FilePath { get; set; } = string.Empty; /// /// نوع فایل (MIME type) /// public string ContentType { get; set; } = string.Empty; /// /// حجم فایل (بایت) /// public long FileSize { get; set; } /// /// زمان آپلود /// public DateTime UploadedAt { get; set; } }