feat: implement Kavenegar SMS service and refactor system configurations to use static constants
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 1m38s
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 1m38s
This commit is contained in:
-35
@@ -1,35 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace CMSMicroservice.Infrastructure.Persistence.Configurations;
|
||||
|
||||
/// <summary>
|
||||
/// تنظیمات پویای سیستم
|
||||
/// </summary>
|
||||
public class SystemConfigurationConfiguration : IEntityTypeConfiguration<SystemConfiguration>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<SystemConfiguration> builder)
|
||||
{
|
||||
builder.HasQueryFilter(p => !p.IsDeleted);
|
||||
builder.Ignore(entity => entity.DomainEvents);
|
||||
|
||||
builder.HasKey(entity => entity.Id);
|
||||
builder.Property(entity => entity.Id).UseIdentityColumn();
|
||||
|
||||
builder.Property(entity => entity.Scope).IsRequired();
|
||||
builder.Property(entity => entity.Key).IsRequired().HasMaxLength(200);
|
||||
builder.Property(entity => entity.Value).IsRequired().HasMaxLength(1000);
|
||||
builder.Property(entity => entity.DataType).IsRequired(false).HasMaxLength(50);
|
||||
builder.Property(entity => entity.Description).IsRequired(false).HasMaxLength(500);
|
||||
builder.Property(entity => entity.IsActive).IsRequired();
|
||||
|
||||
// Composite Index برای جستجوی سریع
|
||||
builder.HasIndex(e => new { e.Scope, e.Key })
|
||||
.IsUnique()
|
||||
.HasDatabaseName("IX_SystemConfiguration_Scope_Key");
|
||||
|
||||
// Index برای IsActive
|
||||
builder.HasIndex(e => e.IsActive)
|
||||
.HasDatabaseName("IX_SystemConfiguration_IsActive");
|
||||
}
|
||||
}
|
||||
-41
@@ -1,41 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace CMSMicroservice.Infrastructure.Persistence.Configurations;
|
||||
|
||||
/// <summary>
|
||||
/// تاریخچه تغییرات تنظیمات سیستم
|
||||
/// </summary>
|
||||
public class SystemConfigurationHistoryConfiguration : IEntityTypeConfiguration<SystemConfigurationHistory>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<SystemConfigurationHistory> builder)
|
||||
{
|
||||
builder.HasQueryFilter(p => !p.IsDeleted);
|
||||
builder.Ignore(entity => entity.DomainEvents);
|
||||
|
||||
builder.HasKey(entity => entity.Id);
|
||||
builder.Property(entity => entity.Id).UseIdentityColumn();
|
||||
|
||||
builder.Property(entity => entity.ConfigurationId).IsRequired();
|
||||
builder.Property(entity => entity.Scope).IsRequired();
|
||||
builder.Property(entity => entity.Key).IsRequired().HasMaxLength(200);
|
||||
builder.Property(entity => entity.OldValue).IsRequired().HasMaxLength(1000);
|
||||
builder.Property(entity => entity.NewValue).IsRequired().HasMaxLength(1000);
|
||||
builder.Property(entity => entity.Reason).IsRequired(false).HasMaxLength(500);
|
||||
builder.Property(entity => entity.PerformedBy).IsRequired(false).HasMaxLength(100);
|
||||
|
||||
// رابطه با SystemConfiguration
|
||||
builder.HasOne(entity => entity.Configuration)
|
||||
.WithMany(sc => sc.SystemConfigurationHistories)
|
||||
.HasForeignKey(entity => entity.ConfigurationId)
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
// Index برای ConfigurationId و Created
|
||||
builder.HasIndex(e => new { e.ConfigurationId, e.Created })
|
||||
.HasDatabaseName("IX_SystemConfigurationHistory_ConfigId_Created");
|
||||
|
||||
// Index برای Scope و Key
|
||||
builder.HasIndex(e => new { e.Scope, e.Key })
|
||||
.HasDatabaseName("IX_SystemConfigurationHistory_Scope_Key");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user