Add validators and services for Product Galleries and Product Tags

- Implemented Create, Delete, Get, and Update validators for Product Galleries.
- Added Create, Delete, Get, and Update validators for Product Tags.
- Created service classes for handling Discount Categories, Discount Orders, Discount Products, Discount Shopping Cart, Product Categories, Product Galleries, and Product Tags.
- Each service class integrates with CQRS for command and query handling.
- Established mapping profiles for Product Galleries.
This commit is contained in:
masoodafar-web
2025-12-04 02:40:49 +03:30
parent 40d54d08fc
commit f0f48118e7
436 changed files with 33159 additions and 2005 deletions
@@ -19,7 +19,7 @@ public class Category : BaseAuditableEntity
//ترتیب نمایش
public int SortOrder { get; set; }
//Category Collection Navigation Reference
public virtual ICollection<Category> Categorys { get; set; }
//PruductCategory Collection Navigation Reference
public virtual ICollection<PruductCategory> PruductCategorys { get; set; }
public virtual ICollection<Category> Categories { get; set; }
//ProductCategory Collection Navigation Reference
public virtual ICollection<ProductCategory> ProductCategories { get; set; }
}
@@ -30,6 +30,12 @@ public class ClubMembership : BaseAuditableEntity
/// </summary>
public long InitialContribution { get; set; }
/// <summary>
/// ارزش هدیه حق عضویت باشگاه (25,200,000 تومان)
/// این مبلغ از کیف پول کاربر کم نمی‌شود و صرفاً هدیه است
/// </summary>
public long GiftValue { get; set; }
/// <summary>
/// مجموع درآمد کارمزد تاکنون (ریال)
/// </summary>
@@ -55,5 +55,5 @@ public class DayaLoanContract : BaseAuditableEntity
/// <summary>
/// Transaction Navigation Property
/// </summary>
public virtual Transactions? Transaction { get; set; }
public virtual Transaction? Transaction { get; set; }
}
@@ -0,0 +1,59 @@
namespace CMSMicroservice.Domain.Entities.DiscountShop;
/// <summary>
/// دسته‌بندی محصولات فروشگاه تخفیفی
/// </summary>
public class DiscountCategory : BaseAuditableEntity
{
/// <summary>
/// نام لاتین (برای URL)
/// </summary>
public string Name { get; set; }
/// <summary>
/// عنوان فارسی
/// </summary>
public string Title { get; set; }
/// <summary>
/// توضیحات دسته‌بندی
/// </summary>
public string? Description { get; set; }
/// <summary>
/// آدرس تصویر دسته‌بندی
/// </summary>
public string? ImagePath { get; set; }
/// <summary>
/// شناسه دسته‌بندی والد (برای ساختار درختی)
/// </summary>
public long? ParentCategoryId { get; set; }
/// <summary>
/// مرتب‌سازی
/// </summary>
public int SortOrder { get; set; }
/// <summary>
/// وضعیت فعال/غیرفعال
/// </summary>
public bool IsActive { get; set; }
// ============= Navigation Properties =============
/// <summary>
/// دسته‌بندی والد
/// </summary>
public virtual DiscountCategory? ParentCategory { get; set; }
/// <summary>
/// دسته‌بندی‌های فرزند
/// </summary>
public virtual ICollection<DiscountCategory> ChildCategories { get; set; }
/// <summary>
/// محصولات این دسته‌بندی
/// </summary>
public virtual ICollection<DiscountProductCategory> ProductCategories { get; set; }
}
@@ -0,0 +1,97 @@
using CMSMicroservice.Domain.Enums;
namespace CMSMicroservice.Domain.Entities.DiscountShop;
/// <summary>
/// سفارش از فروشگاه تخفیفی
/// در این سفارش، پرداخت به صورت ترکیبی است:
/// - بخشی از DiscountBalance کاربر کسر می‌شود (محدود به MaxDiscountPercent)
/// - مابقی از درگاه پرداخت پرداخت می‌شود
/// </summary>
public class DiscountOrder : BaseAuditableEntity
{
/// <summary>
/// شناسه کاربر
/// </summary>
public long UserId { get; set; }
/// <summary>
/// مبلغ کل سفارش (قیمت تمام محصولات)
/// </summary>
public long TotalAmount { get; set; }
/// <summary>
/// مبلغ کسر شده از DiscountBalance
/// این مبلغ محدود به MaxDiscountPercent هر محصول است
/// </summary>
public long DiscountBalanceUsed { get; set; }
/// <summary>
/// مبلغ پرداخت شده از درگاه (IPG)
/// PayableAmount = TotalAmount - DiscountBalanceUsed
/// </summary>
public long GatewayAmountPaid { get; set; }
/// <summary>
/// مالیات بر ارزش افزوده (VAT) - 9%
/// محاسبه روی TotalAmount
/// </summary>
public long VatAmount { get; set; }
/// <summary>
/// وضعیت پرداخت
/// </summary>
public PaymentStatus PaymentStatus { get; set; }
/// <summary>
/// تاریخ پرداخت
/// </summary>
public DateTime? PaymentDate { get; set; }
/// <summary>
/// شناسه تراکنش (Transaction از درگاه پرداخت)
/// </summary>
public long? TransactionId { get; set; }
/// <summary>
/// شناسه آدرس تحویل
/// </summary>
public long UserAddressId { get; set; }
/// <summary>
/// وضعیت ارسال
/// </summary>
public DeliveryStatus DeliveryStatus { get; set; }
/// <summary>
/// کد رهگیری مرسوله
/// </summary>
public string? TrackingCode { get; set; }
/// <summary>
/// توضیحات وضعیت ارسال
/// </summary>
public string? DeliveryDescription { get; set; }
// ============= Navigation Properties =============
/// <summary>
/// کاربر
/// </summary>
public virtual User User { get; set; }
/// <summary>
/// تراکنش پرداخت از درگاه
/// </summary>
public virtual Transaction? Transaction { get; set; }
/// <summary>
/// آدرس تحویل
/// </summary>
public virtual UserAddress UserAddress { get; set; }
/// <summary>
/// جزئیات سفارش (محصولات)
/// </summary>
public virtual ICollection<DiscountOrderDetail> OrderDetails { get; set; }
}
@@ -0,0 +1,59 @@
namespace CMSMicroservice.Domain.Entities.DiscountShop;
/// <summary>
/// جزئیات سفارش فروشگاه تخفیفی
/// هر ردیف یک محصول و تعداد آن را نشان می‌دهد
/// </summary>
public class DiscountOrderDetail : BaseAuditableEntity
{
/// <summary>
/// شناسه سفارش
/// </summary>
public long DiscountOrderId { get; set; }
/// <summary>
/// شناسه محصول
/// </summary>
public long ProductId { get; set; }
/// <summary>
/// تعداد
/// </summary>
public int Count { get; set; }
/// <summary>
/// قیمت واحد (هنگام خرید)
/// قیمت ممکن است در آینده تغییر کند، پس در زمان خرید ذخیره می‌شود
/// </summary>
public long UnitPrice { get; set; }
/// <summary>
/// درصد تخفیف استفاده شده از DiscountBalance
/// این درصد محدود به MaxDiscountPercent محصول است
/// </summary>
public int DiscountPercentUsed { get; set; }
/// <summary>
/// مبلغ تخفیف استفاده شده برای این محصول
/// DiscountAmount = (UnitPrice × Count) × (DiscountPercentUsed / 100)
/// </summary>
public long DiscountAmount { get; set; }
/// <summary>
/// مبلغ نهایی پرداختی برای این محصول
/// FinalPrice = (UnitPrice × Count) - DiscountAmount
/// </summary>
public long FinalPrice { get; set; }
// ============= Navigation Properties =============
/// <summary>
/// سفارش
/// </summary>
public virtual DiscountOrder DiscountOrder { get; set; }
/// <summary>
/// محصول
/// </summary>
public virtual DiscountProduct Product { get; set; }
}
@@ -0,0 +1,86 @@
namespace CMSMicroservice.Domain.Entities.DiscountShop;
/// <summary>
/// محصول فروشگاه تخفیفی باشگاه
/// در این فروشگاه کاربر با ترکیب DiscountBalance و پرداخت واقعی خرید می‌کند
/// </summary>
public class DiscountProduct : BaseAuditableEntity
{
/// <summary>
/// عنوان محصول
/// </summary>
public string Title { get; set; }
/// <summary>
/// توضیحات مختصر
/// </summary>
public string ShortInfomation { get; set; }
/// <summary>
/// توضیحات کامل
/// </summary>
public string FullInformation { get; set; }
/// <summary>
/// قیمت اصلی محصول (ریال)
/// </summary>
public long Price { get; set; }
/// <summary>
/// حداکثر درصد تخفیفی که از DiscountBalance قابل استفاده است (0 تا 100)
/// مثال: 30 یعنی حداکثر 30% از قیمت را می‌توان با DiscountBalance پرداخت کرد
/// </summary>
public int MaxDiscountPercent { get; set; }
/// <summary>
/// امتیاز محصول (0 تا 5)
/// </summary>
public int Rate { get; set; }
/// <summary>
/// آدرس تصویر اصلی
/// </summary>
public string ImagePath { get; set; }
/// <summary>
/// آدرس تصویر کوچک (Thumbnail)
/// </summary>
public string ThumbnailPath { get; set; }
/// <summary>
/// تعداد فروش
/// </summary>
public int SaleCount { get; set; }
/// <summary>
/// تعداد بازدید
/// </summary>
public int ViewCount { get; set; }
/// <summary>
/// موجودی انبار
/// </summary>
public int RemainingCount { get; set; }
/// <summary>
/// وضعیت فعال/غیرفعال
/// </summary>
public bool IsActive { get; set; }
// ============= Navigation Properties =============
/// <summary>
/// سبدهای خریدی که این محصول در آن‌ها است
/// </summary>
public virtual ICollection<DiscountShoppingCart> ShoppingCarts { get; set; }
/// <summary>
/// جزئیات سفارشات شامل این محصول
/// </summary>
public virtual ICollection<DiscountOrderDetail> OrderDetails { get; set; }
/// <summary>
/// دسته‌بندی‌های این محصول
/// </summary>
public virtual ICollection<DiscountProductCategory> ProductCategories { get; set; }
}
@@ -0,0 +1,29 @@
namespace CMSMicroservice.Domain.Entities.DiscountShop;
/// <summary>
/// جدول رابطه چند به چند بین محصول و دسته‌بندی
/// </summary>
public class DiscountProductCategory : BaseAuditableEntity
{
/// <summary>
/// شناسه محصول
/// </summary>
public long ProductId { get; set; }
/// <summary>
/// شناسه دسته‌بندی
/// </summary>
public long CategoryId { get; set; }
// ============= Navigation Properties =============
/// <summary>
/// محصول
/// </summary>
public virtual DiscountProduct Product { get; set; }
/// <summary>
/// دسته‌بندی
/// </summary>
public virtual DiscountCategory Category { get; set; }
}
@@ -0,0 +1,35 @@
namespace CMSMicroservice.Domain.Entities.DiscountShop;
/// <summary>
/// سبد خرید فروشگاه تخفیفی
/// هر کاربر می‌تواند چندین محصول در سبد داشته باشد
/// </summary>
public class DiscountShoppingCart : BaseAuditableEntity
{
/// <summary>
/// شناسه کاربر
/// </summary>
public long UserId { get; set; }
/// <summary>
/// شناسه محصول
/// </summary>
public long ProductId { get; set; }
/// <summary>
/// تعداد
/// </summary>
public int Count { get; set; }
// ============= Navigation Properties =============
/// <summary>
/// کاربر
/// </summary>
public virtual User User { get; set; }
/// <summary>
/// محصول
/// </summary>
public virtual DiscountProduct Product { get; set; }
}
@@ -4,7 +4,7 @@ public class FactorDetails : BaseAuditableEntity
{
public long ProductId { get; set; }
//Product Navigation Property
public virtual Products Product { get; set; }
public virtual Product Product { get; set; }
public int Count { get; set; }
public long UnitPrice { get; set; }
public int UnitDiscount { get; set; }
@@ -0,0 +1,66 @@
using CMSMicroservice.Domain.Common;
using CMSMicroservice.Domain.Enums;
namespace CMSMicroservice.Domain.Entities.Message;
/// <summary>
/// پیام‌های عمومی سیستم
/// Admin می‌تواند پیام‌های عمومی برای نمایش در داشبورد کاربران ارسال کند
/// </summary>
public class PublicMessage : BaseAuditableEntity
{
/// <summary>
/// عنوان پیام (حداکثر 200 کاراکتر)
/// </summary>
public string Title { get; set; } = string.Empty;
/// <summary>
/// محتوای پیام (حداکثر 2000 کاراکتر)
/// </summary>
public string Content { get; set; } = string.Empty;
/// <summary>
/// نوع پیام (Announcement, News, Warning, Promotion, SystemUpdate, Event)
/// </summary>
public MessageType Type { get; set; }
/// <summary>
/// اولویت پیام (Low, Medium, High, Urgent)
/// </summary>
public MessagePriority Priority { get; set; }
/// <summary>
/// وضعیت فعال/غیرفعال
/// </summary>
public bool IsActive { get; set; }
/// <summary>
/// تاریخ شروع نمایش پیام
/// </summary>
public DateTime StartsAt { get; set; }
/// <summary>
/// تاریخ پایان نمایش پیام
/// </summary>
public DateTime ExpiresAt { get; set; }
/// <summary>
/// شناسه Admin ایجادکننده
/// </summary>
public long CreatedByUserId { get; set; }
/// <summary>
/// تعداد بازدید (اختیاری - برای آمار)
/// </summary>
public int ViewCount { get; set; }
/// <summary>
/// لینک اختیاری (برای اطلاعات بیشتر)
/// </summary>
public string? LinkUrl { get; set; }
/// <summary>
/// متن دکمه لینک (مثلاً "اطلاعات بیشتر")
/// </summary>
public string? LinkText { get; set; }
}
@@ -0,0 +1,55 @@
using CMSMicroservice.Domain.Common;
namespace CMSMicroservice.Domain.Entities.Order;
/// <summary>
/// مالیات بر ارزش افزوده (VAT) سفارش
/// محاسبه و ثبت مالیات ۹٪ برای سفارشات
/// </summary>
public class OrderVAT : BaseAuditableEntity
{
/// <summary>
/// شناسه سفارش
/// </summary>
public long OrderId { get; set; }
/// <summary>
/// UserOrder Navigation Property
/// </summary>
public virtual UserOrder Order { get; set; } = null!;
/// <summary>
/// نرخ مالیات (معمولاً ۹٪ = 0.09)
/// </summary>
public decimal VATRate { get; set; }
/// <summary>
/// مبلغ پایه (قبل از مالیات)
/// </summary>
public long BaseAmount { get; set; }
/// <summary>
/// مبلغ مالیات محاسبه شده
/// </summary>
public long VATAmount { get; set; }
/// <summary>
/// مبلغ کل (پایه + مالیات)
/// </summary>
public long TotalAmount { get; set; }
/// <summary>
/// آیا مالیات پرداخت شده است
/// </summary>
public bool IsPaid { get; set; }
/// <summary>
/// تاریخ پرداخت مالیات
/// </summary>
public DateTime? PaidAt { get; set; }
/// <summary>
/// یادداشت (اختیاری)
/// </summary>
public string? Note { get; set; }
}
@@ -0,0 +1,75 @@
using CMSMicroservice.Domain.Enums;
namespace CMSMicroservice.Domain.Entities.Payment;
/// <summary>
/// پرداخت دستی توسط Admin/SuperAdmin
/// برای موارد خاص: واریز نقدی، تسویه حساب، اصلاح خطا
/// </summary>
public class ManualPayment : BaseAuditableEntity
{
/// <summary>
/// شناسه کاربری که پرداخت برای او ثبت می‌شود
/// </summary>
public long UserId { get; set; }
/// <summary>
/// User Navigation Property
/// </summary>
public virtual User User { get; set; } = null!;
/// <summary>
/// مبلغ تراکنش (ریال)
/// </summary>
public long Amount { get; set; }
/// <summary>
/// نوع تراکنش دستی
/// </summary>
public ManualPaymentType Type { get; set; }
/// <summary>
/// توضیحات (اجباری)
/// </summary>
public string Description { get; set; } = string.Empty;
/// <summary>
/// شماره مرجع یا شماره فیش (اختیاری)
/// </summary>
public string? ReferenceNumber { get; set; }
/// <summary>
/// وضعیت تایید
/// </summary>
public ManualPaymentStatus Status { get; set; } = ManualPaymentStatus.Pending;
/// <summary>
/// شناسه Admin که درخواست را ثبت کرده
/// </summary>
public long RequestedBy { get; set; }
/// <summary>
/// شناسه SuperAdmin که تایید/رد کرده (nullable)
/// </summary>
public long? ApprovedBy { get; set; }
/// <summary>
/// تاریخ تایید/رد
/// </summary>
public DateTime? ApprovedAt { get; set; }
/// <summary>
/// دلیل رد (در صورت رد شدن)
/// </summary>
public string? RejectionReason { get; set; }
/// <summary>
/// شناسه تراکنش ایجاد شده (بعد از تایید)
/// </summary>
public long? TransactionId { get; set; }
/// <summary>
/// Transaction Navigation Property
/// </summary>
public virtual Transaction? Transaction { get; set; }
}
@@ -0,0 +1,42 @@
namespace CMSMicroservice.Domain.Entities;
//محصول
public class Product : BaseAuditableEntity
{
public string Title { get; set; }
public string Description { get; set; }
public string ShortInfomation { get; set; }
public string FullInformation { get; set; }
public long Price { get; set; }
public int Discount { get; set; }
public int Rate { get; set; }
public string ImagePath { get; set; }
public string ThumbnailPath { get; set; }
public int SaleCount { get; set; }
public int ViewCount { get; set; }
public int RemainingCount { get; set; }
// ============= Club Shop Fields =============
/// <summary>
/// آیا این محصول فقط در فروشگاه باشگاه موجود است
/// </summary>
public bool IsClubExclusive { get; set; }
/// <summary>
/// درصد تخفیف باشگاه (0 تا 100)
/// </summary>
public int ClubDiscountPercent { get; set; }
// ============= Navigation Properties =============
//UserCarts Collection Navigation Reference
public virtual ICollection<UserCart> UserCarts { get; set; }
//ProductGalleries Collection Navigation Reference
public virtual ICollection<ProductGallery> ProductGalleries { get; set; }
//FactorDetails Collection Navigation Reference
public virtual ICollection<FactorDetails> FactorDetails { get; set; }
//ProductCategory Collection Navigation Reference
public virtual ICollection<ProductCategory> ProductCategories { get; set; }
//ProductTag Collection Navigation Reference
public virtual ICollection<ProductTag> ProductTags { get; set; }
}
@@ -1,11 +1,11 @@
namespace CMSMicroservice.Domain.Entities;
//دسته بندی
public class PruductCategory : BaseAuditableEntity
public class ProductCategory : BaseAuditableEntity
{
//شناسه محصول
public long ProductId { get; set; }
//Product Navigation Property
public virtual Products Product { get; set; }
public virtual Product Product { get; set; }
//شناسه دسته بندی
public long CategoryId { get; set; }
//Category Navigation Property
@@ -1,10 +1,10 @@
namespace CMSMicroservice.Domain.Entities;
//توکن Otp
public class ProductGallerys : BaseAuditableEntity
//گالری تصاویر محصول
public class ProductGalleries : BaseAuditableEntity
{
public long ProductImageId { get; set; }
//ProductImage Navigation Property
public virtual ProductImages ProductImage { get; set; }
public virtual ProductImage ProductImage { get; set; }
public long ProductId { get; set; }
//Product Navigation Property
public virtual Products Product { get; set; }
@@ -0,0 +1,11 @@
namespace CMSMicroservice.Domain.Entities;
//گالری تصاویر محصول
public class ProductGallery : BaseAuditableEntity
{
public long ProductImageId { get; set; }
//ProductImage Navigation Property
public virtual ProductImage ProductImage { get; set; }
public long ProductId { get; set; }
//Product Navigation Property
public virtual Product Product { get; set; }
}
@@ -0,0 +1,10 @@
namespace CMSMicroservice.Domain.Entities;
//تصاویر محصول
public class ProductImage : BaseAuditableEntity
{
public string Title { get; set; }
public string ImagePath { get; set; }
public string ImageThumbnailPath { get; set; }
//ProductGalleries Collection Navigation Reference
public virtual ICollection<ProductGallery> ProductGalleries { get; set; }
}
@@ -5,6 +5,6 @@ public class ProductImages : BaseAuditableEntity
public string Title { get; set; }
public string ImagePath { get; set; }
public string ImageThumbnailPath { get; set; }
//ProductGallerys Collection Navigation Reference
public virtual ICollection<ProductGallerys> ProductGalleryss { get; set; }
//ProductGalleries Collection Navigation Reference
public virtual ICollection<ProductGalleries> ProductGalleries { get; set; }
}
@@ -1,11 +1,11 @@
namespace CMSMicroservice.Domain.Entities;
//برچسب محصول
public class PruductTag : BaseAuditableEntity
public class ProductTag : BaseAuditableEntity
{
//شناسه محصول
public long ProductId { get; set; }
//Product Navigation Property
public virtual Products Product { get; set; }
public virtual Product Product { get; set; }
//شناسه تگ
public long TagId { get; set; }
//Tag Navigation Property
@@ -30,13 +30,13 @@ public class Products : BaseAuditableEntity
// ============= Navigation Properties =============
//UserCarts Collection Navigation Reference
public virtual ICollection<UserCarts> UserCartss { get; set; }
//ProductGallerys Collection Navigation Reference
public virtual ICollection<ProductGallerys> ProductGalleryss { get; set; }
public virtual ICollection<UserCart> UserCarts { get; set; }
//ProductGalleries Collection Navigation Reference
public virtual ICollection<ProductGallery> ProductGalleries { get; set; }
//FactorDetails Collection Navigation Reference
public virtual ICollection<FactorDetails> FactorDetailss { get; set; }
//PruductCategory Collection Navigation Reference
public virtual ICollection<PruductCategory> PruductCategorys { get; set; }
//PruductTag Collection Navigation Reference
public virtual ICollection<PruductTag> PruductTags { get; set; }
public virtual ICollection<FactorDetails> FactorDetails { get; set; }
//ProductCategory Collection Navigation Reference
public virtual ICollection<ProductCategory> ProductCategories { get; set; }
//ProductTag Collection Navigation Reference
public virtual ICollection<ProductTag> ProductTags { get; set; }
}
+1 -1
View File
@@ -13,5 +13,5 @@ public class Tag : BaseAuditableEntity
//ترتیب نمایش
public int SortOrder { get; set; }
//PruductTag Collection Navigation Reference
public virtual ICollection<PruductTag> PruductTags { get; set; }
public virtual ICollection<ProductTag> ProductTags { get; set; }
}
@@ -1,8 +1,8 @@
using CMSMicroservice.Domain.Enums;
namespace CMSMicroservice.Domain.Entities;
//آدرس کاربر
public class Transactions : BaseAuditableEntity
//تراکنش
public class Transaction : BaseAuditableEntity
{
public long Amount { get; set; }
public string Description { get; set; }
+6 -8
View File
@@ -14,10 +14,6 @@ public class User : BaseAuditableEntity
public string? NationalCode { get; set; }
//آدرس آواتار
public string? AvatarPath { get; set; }
//شناسه والد
public long? ParentId { get; set; }
//User Navigation Property
public virtual User? Parent { get; set; }
//کد ارجاع
public string ReferralCode { get; set; }
//موبایل فعال شده؟
@@ -74,13 +70,11 @@ public class User : BaseAuditableEntity
// ============= Navigation Properties =============
//UserAddress Collection Navigation Reference
public virtual ICollection<UserAddress> UserAddresss { get; set; }
public virtual ICollection<UserAddress> UserAddresses { get; set; }
//UserRole Collection Navigation Reference
public virtual ICollection<UserRole> UserRoles { get; set; }
//UserCarts Collection Navigation Reference
public virtual ICollection<UserCarts> UserCartss { get; set; }
//User Collection Navigation Reference
public virtual ICollection<User> Users { get; set; }
public virtual ICollection<UserCart> UserCarts { get; set; }
//UserContract Collection Navigation Reference
public virtual ICollection<UserContract> UserContracts { get; set; }
//UserOrder Collection Navigation Reference
@@ -99,4 +93,8 @@ public class User : BaseAuditableEntity
public virtual ICollection<UserCommissionPayout>? CommissionPayouts { get; set; }
//DayaLoanContract Collection Navigation Reference
public virtual ICollection<DayaLoanContract>? DayaLoanContracts { get; set; }
//DiscountShoppingCart Collection Navigation Reference (سبد خرید فروشگاه تخفیفی)
public virtual ICollection<DiscountShop.DiscountShoppingCart>? DiscountShoppingCarts { get; set; }
//DiscountOrder Collection Navigation Reference (سفارشات فروشگاه تخفیفی)
public virtual ICollection<DiscountShop.DiscountOrder>? DiscountOrders { get; set; }
}
@@ -1,10 +1,10 @@
namespace CMSMicroservice.Domain.Entities;
//آدرس کاربر
public class UserCarts : BaseAuditableEntity
//سبد خرید کاربر
public class UserCart : BaseAuditableEntity
{
public long ProductId { get; set; }
//Product Navigation Property
public virtual Products Product { get; set; }
public virtual Product Product { get; set; }
public long UserId { get; set; }
//User Navigation Property
public virtual User User { get; set; }
@@ -1,6 +1,5 @@
using CMSMicroservice.Domain.Enums;
using CMSMicroservice.Domain.Enums;
using CMSMicroservice.Domain.Entities.Order;
namespace CMSMicroservice.Domain.Entities;
//سفارش کاربر
@@ -15,7 +14,7 @@ public class UserOrder : BaseAuditableEntity
//شناسه تراکنش
public long? TransactionId { get; set; }
//Transaction Navigation Property
public virtual Transactions? Transaction { get; set; }
public virtual Transaction? Transaction { get; set; }
//وضعیت پرداخت
public PaymentStatus PaymentStatus { get; set; }
//تاریخ پرداخت
@@ -35,6 +34,17 @@ public class UserOrder : BaseAuditableEntity
public string? TrackingCode { get; set; }
// توضیحات وضعیت ارسال / نکات پستی
public string? DeliveryDescription { get; set; }
/// <summary>
/// آیا این سفارش شامل مالیات است
/// </summary>
public bool HasVAT { get; set; }
/// <summary>
/// OrderVAT Navigation Property (اطلاعات مالیات)
/// </summary>
public virtual OrderVAT? OrderVAT { get; set; }
//FactorDetails Collection Navigation Reference
public virtual ICollection<FactorDetails> FactorDetailss { get; set; }
public virtual ICollection<FactorDetails> FactorDetails { get; set; }
}
@@ -0,0 +1,63 @@
namespace CMSMicroservice.Domain.Entities;
/// <summary>
/// خرید پکیج توسط کاربر
/// این جدول پشتیبانی از خرید چندین پکیج توسط یک کاربر را فراهم می‌کند
/// </summary>
public class UserPackagePurchase : BaseAuditableEntity
{
/// <summary>
/// شناسه کاربر
/// </summary>
public long UserId { get; set; }
/// <summary>
/// User Navigation Property
/// </summary>
public virtual User User { get; set; }
/// <summary>
/// شناسه پکیج
/// </summary>
public long PackageId { get; set; }
/// <summary>
/// Package Navigation Property
/// </summary>
public virtual Package Package { get; set; }
/// <summary>
/// نحوه خرید پکیج (دایا، خرید مستقیم)
/// </summary>
public PackagePurchaseMethod PurchaseMethod { get; set; }
/// <summary>
/// تاریخ خرید
/// </summary>
public DateTime PurchasedAt { get; set; }
/// <summary>
/// مبلغ پرداختی (ریال)
/// </summary>
public long Amount { get; set; }
/// <summary>
/// شناسه سفارش مرتبط (اختیاری)
/// </summary>
public long? OrderId { get; set; }
/// <summary>
/// UserOrder Navigation Property
/// </summary>
public virtual UserOrder? Order { get; set; }
/// <summary>
/// شناسه تراکنش مرتبط (اختیاری)
/// </summary>
public long? TransactionId { get; set; }
/// <summary>
/// Transaction Navigation Property
/// </summary>
public virtual Transaction? Transaction { get; set; }
}
@@ -23,5 +23,10 @@ public enum ConfigurationScope
/// <summary>
/// تنظیمات کمیسیون
/// </summary>
Commission = 3
Commission = 3,
/// <summary>
/// تنظیمات مالیات بر ارزش افزوده
/// </summary>
VAT = 4
}
@@ -0,0 +1,27 @@
namespace CMSMicroservice.Domain.Enums;
/// <summary>
/// وضعیت پرداخت دستی
/// </summary>
public enum ManualPaymentStatus
{
/// <summary>
/// در انتظار تایید SuperAdmin
/// </summary>
Pending = 0,
/// <summary>
/// تایید شده و اعمال شده
/// </summary>
Approved = 1,
/// <summary>
/// رد شده
/// </summary>
Rejected = 2,
/// <summary>
/// لغو شده توسط ایجادکننده
/// </summary>
Cancelled = 3
}
@@ -0,0 +1,42 @@
namespace CMSMicroservice.Domain.Enums;
/// <summary>
/// نوع پرداخت دستی
/// </summary>
public enum ManualPaymentType
{
/// <summary>
/// واریز نقدی
/// </summary>
CashDeposit = 1,
/// <summary>
/// شارژ کیف پول تخفیف
/// </summary>
DiscountWalletCharge = 2,
/// <summary>
/// شارژ کیف پول شبکه
/// </summary>
NetworkWalletCharge = 3,
/// <summary>
/// تسویه حساب
/// </summary>
Settlement = 4,
/// <summary>
/// اصلاح خطا
/// </summary>
ErrorCorrection = 5,
/// <summary>
/// بازگشت وجه
/// </summary>
Refund = 6,
/// <summary>
/// سایر موارد
/// </summary>
Other = 99
}
@@ -0,0 +1,27 @@
namespace CMSMicroservice.Domain.Enums;
/// <summary>
/// اولویت پیام
/// </summary>
public enum MessagePriority
{
/// <summary>
/// کم - 1
/// </summary>
Low = 1,
/// <summary>
/// متوسط - 2
/// </summary>
Medium = 2,
/// <summary>
/// بالا - 3
/// </summary>
High = 3,
/// <summary>
/// فوری - 4
/// </summary>
Urgent = 4
}
@@ -0,0 +1,37 @@
namespace CMSMicroservice.Domain.Enums;
/// <summary>
/// نوع پیام عمومی
/// </summary>
public enum MessageType
{
/// <summary>
/// اطلاعیه - 1
/// </summary>
Announcement = 1,
/// <summary>
/// اخبار - 2
/// </summary>
News = 2,
/// <summary>
/// هشدار - 3
/// </summary>
Warning = 3,
/// <summary>
/// تبلیغات - 4
/// </summary>
Promotion = 4,
/// <summary>
/// به‌روزرسانی سیستم - 5
/// </summary>
SystemUpdate = 5,
/// <summary>
/// رویداد - 6
/// </summary>
Event = 6
}
@@ -21,4 +21,9 @@ public enum TransactionType
/// شارژ کیف پول تخفیف
/// </summary>
DiscountWalletCharge = 12,
/// <summary>
/// خرید از فروشگاه تخفیف
/// </summary>
DiscountShopPurchase = 13,
}
@@ -2,10 +2,10 @@ namespace CMSMicroservice.Domain.Events;
public class ClearCartEvent : BaseEvent
{
public ClearCartEvent(UserCarts item)
public ClearCartEvent(UserCart item)
{
Item = item;
}
public UserCarts Item { get; }
public UserCart Item { get; }
}
@@ -2,7 +2,7 @@ namespace CMSMicroservice.Domain.Events;
public class DayaLoanApprovedEvent : BaseEvent
{
public DayaLoanApprovedEvent(User user, Transactions transaction, string contractNumber)
public DayaLoanApprovedEvent(User user, Transaction transaction, string contractNumber)
{
User = user;
Transaction = transaction;
@@ -10,6 +10,6 @@ public class DayaLoanApprovedEvent : BaseEvent
}
public User User { get; }
public Transactions Transaction { get; }
public Transaction Transaction { get; }
public string ContractNumber { get; }
}
@@ -0,0 +1,8 @@
namespace CMSMicroservice.Domain.Events;
public class CreateNewProductCategoryEvent : BaseEvent
{
public CreateNewProductCategoryEvent(ProductCategory item)
{
}
public ProductCategory Item { get; }
}
@@ -0,0 +1,8 @@
namespace CMSMicroservice.Domain.Events;
public class DeleteProductCategoryEvent : BaseEvent
{
public DeleteProductCategoryEvent(ProductCategory item)
{
}
public ProductCategory Item { get; }
}
@@ -0,0 +1,8 @@
namespace CMSMicroservice.Domain.Events;
public class UpdateProductCategoryEvent : BaseEvent
{
public UpdateProductCategoryEvent(ProductCategory item)
{
}
public ProductCategory Item { get; }
}
@@ -1,8 +1,8 @@
namespace CMSMicroservice.Domain.Events;
public class CreateNewProductGallerysEvent : BaseEvent
{
public CreateNewProductGallerysEvent(ProductGallerys item)
public CreateNewProductGallerysEvent(ProductGallery item)
{
}
public ProductGallerys Item { get; }
public ProductGallery Item { get; }
}
@@ -1,8 +1,8 @@
namespace CMSMicroservice.Domain.Events;
public class DeleteProductGallerysEvent : BaseEvent
{
public DeleteProductGallerysEvent(ProductGallerys item)
public DeleteProductGallerysEvent(ProductGallery item)
{
}
public ProductGallerys Item { get; }
public ProductGallery Item { get; }
}
@@ -1,8 +1,8 @@
namespace CMSMicroservice.Domain.Events;
public class UpdateProductGallerysEvent : BaseEvent
{
public UpdateProductGallerysEvent(ProductGallerys item)
public UpdateProductGallerysEvent(ProductGallery item)
{
}
public ProductGallerys Item { get; }
public ProductGallery Item { get; }
}
@@ -1,8 +1,8 @@
namespace CMSMicroservice.Domain.Events;
public class CreateNewProductImagesEvent : BaseEvent
{
public CreateNewProductImagesEvent(ProductImages item)
public CreateNewProductImagesEvent(ProductImage item)
{
}
public ProductImages Item { get; }
public ProductImage Item { get; }
}
@@ -1,8 +1,8 @@
namespace CMSMicroservice.Domain.Events;
public class DeleteProductImagesEvent : BaseEvent
{
public DeleteProductImagesEvent(ProductImages item)
public DeleteProductImagesEvent(ProductImage item)
{
}
public ProductImages Item { get; }
public ProductImage Item { get; }
}
@@ -1,8 +1,8 @@
namespace CMSMicroservice.Domain.Events;
public class UpdateProductImagesEvent : BaseEvent
{
public UpdateProductImagesEvent(ProductImages item)
public UpdateProductImagesEvent(ProductImage item)
{
}
public ProductImages Item { get; }
public ProductImage Item { get; }
}
@@ -0,0 +1,10 @@
namespace CMSMicroservice.Domain.Events;
public class CreateNewProductTagEvent : BaseEvent
{
public CreateNewProductTagEvent(ProductTag item)
{
Item = item;
}
public ProductTag Item { get; }
}
@@ -0,0 +1,10 @@
namespace CMSMicroservice.Domain.Events;
public class DeleteProductTagEvent : BaseEvent
{
public DeleteProductTagEvent(ProductTag item)
{
Item = item;
}
public ProductTag Item { get; }
}
@@ -0,0 +1,10 @@
namespace CMSMicroservice.Domain.Events;
public class UpdateProductTagEvent : BaseEvent
{
public UpdateProductTagEvent(ProductTag item)
{
Item = item;
}
public ProductTag Item { get; }
}
@@ -1,8 +1,8 @@
namespace CMSMicroservice.Domain.Events;
public class CreateNewProductsEvent : BaseEvent
{
public CreateNewProductsEvent(Products item)
public CreateNewProductsEvent(Product item)
{
}
public Products Item { get; }
public Product Item { get; }
}
@@ -1,8 +1,8 @@
namespace CMSMicroservice.Domain.Events;
public class DeleteProductsEvent : BaseEvent
{
public DeleteProductsEvent(Products item)
public DeleteProductsEvent(Product item)
{
}
public Products Item { get; }
public Product Item { get; }
}
@@ -1,8 +1,8 @@
namespace CMSMicroservice.Domain.Events;
public class UpdateProductsEvent : BaseEvent
{
public UpdateProductsEvent(Products item)
public UpdateProductsEvent(Product item)
{
}
public Products Item { get; }
public Product Item { get; }
}
@@ -1,8 +0,0 @@
namespace CMSMicroservice.Domain.Events;
public class CreateNewPruductCategoryEvent : BaseEvent
{
public CreateNewPruductCategoryEvent(PruductCategory item)
{
}
public PruductCategory Item { get; }
}
@@ -1,8 +0,0 @@
namespace CMSMicroservice.Domain.Events;
public class DeletePruductCategoryEvent : BaseEvent
{
public DeletePruductCategoryEvent(PruductCategory item)
{
}
public PruductCategory Item { get; }
}
@@ -1,8 +0,0 @@
namespace CMSMicroservice.Domain.Events;
public class UpdatePruductCategoryEvent : BaseEvent
{
public UpdatePruductCategoryEvent(PruductCategory item)
{
}
public PruductCategory Item { get; }
}
@@ -1,10 +0,0 @@
namespace CMSMicroservice.Domain.Events;
public class CreateNewPruductTagEvent : BaseEvent
{
public CreateNewPruductTagEvent(PruductTag item)
{
Item = item;
}
public PruductTag Item { get; }
}
@@ -1,10 +0,0 @@
namespace CMSMicroservice.Domain.Events;
public class DeletePruductTagEvent : BaseEvent
{
public DeletePruductTagEvent(PruductTag item)
{
Item = item;
}
public PruductTag Item { get; }
}
@@ -1,10 +0,0 @@
namespace CMSMicroservice.Domain.Events;
public class UpdatePruductTagEvent : BaseEvent
{
public UpdatePruductTagEvent(PruductTag item)
{
Item = item;
}
public PruductTag Item { get; }
}
@@ -2,12 +2,12 @@ namespace CMSMicroservice.Domain.Events;
public class RefundTransactionEvent : BaseEvent
{
public RefundTransactionEvent(Transactions refundTransaction, Transactions originalTransaction)
public RefundTransactionEvent(Transaction refundTransaction, Transaction originalTransaction)
{
RefundTransaction = refundTransaction;
OriginalTransaction = originalTransaction;
}
public Transactions RefundTransaction { get; }
public Transactions OriginalTransaction { get; }
public Transaction RefundTransaction { get; }
public Transaction OriginalTransaction { get; }
}
@@ -1,8 +1,8 @@
namespace CMSMicroservice.Domain.Events;
public class CreateNewTransactionsEvent : BaseEvent
{
public CreateNewTransactionsEvent(Transactions item)
public CreateNewTransactionsEvent(Transaction item)
{
}
public Transactions Item { get; }
public Transaction Item { get; }
}
@@ -1,8 +1,8 @@
namespace CMSMicroservice.Domain.Events;
public class DeleteTransactionsEvent : BaseEvent
{
public DeleteTransactionsEvent(Transactions item)
public DeleteTransactionsEvent(Transaction item)
{
}
public Transactions Item { get; }
public Transaction Item { get; }
}
@@ -1,8 +1,8 @@
namespace CMSMicroservice.Domain.Events;
public class UpdateTransactionsEvent : BaseEvent
{
public UpdateTransactionsEvent(Transactions item)
public UpdateTransactionsEvent(Transaction item)
{
}
public Transactions Item { get; }
public Transaction Item { get; }
}
@@ -1,8 +1,8 @@
namespace CMSMicroservice.Domain.Events;
public class CreateNewUserCartsEvent : BaseEvent
{
public CreateNewUserCartsEvent(UserCarts item)
public CreateNewUserCartsEvent(UserCart item)
{
}
public UserCarts Item { get; }
public UserCart Item { get; }
}
@@ -1,8 +1,8 @@
namespace CMSMicroservice.Domain.Events;
public class DeleteUserCartsEvent : BaseEvent
{
public DeleteUserCartsEvent(UserCarts item)
public DeleteUserCartsEvent(UserCart item)
{
}
public UserCarts Item { get; }
public UserCart Item { get; }
}
@@ -1,8 +1,8 @@
namespace CMSMicroservice.Domain.Events;
public class UpdateUserCartsEvent : BaseEvent
{
public UpdateUserCartsEvent(UserCarts item)
public UpdateUserCartsEvent(UserCart item)
{
}
public UserCarts Item { get; }
public UserCart Item { get; }
}
@@ -2,10 +2,10 @@ namespace CMSMicroservice.Domain.Events;
public class VerifyTransactionEvent : BaseEvent
{
public VerifyTransactionEvent(Transactions item)
public VerifyTransactionEvent(Transaction item)
{
Item = item;
}
public Transactions Item { get; }
public Transaction Item { get; }
}