Eksik single formlar

This commit is contained in:
Sedat Öztürk 2025-08-20 00:01:24 +03:00
parent 61af16d0b5
commit 7386ff91fa
13 changed files with 8301 additions and 178 deletions

View file

@ -11,7 +11,6 @@ public class UomDto : AuditedEntityDto<Guid>
public decimal Ratio { get; set; }
public bool IsActive { get; set; }
public decimal Rounding { get; set; }
public Guid UomCategoryId { get; set; }
public string UomCategoryName { get; set; } // Listelemede gösterim için opsiyonel
}

File diff suppressed because it is too large Load diff

View file

@ -434,10 +434,7 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
if (!exists)
{
await _uomCategoryRepository.InsertAsync(new UomCategory
{
Name = item.Name
});
await _uomCategoryRepository.InsertAsync(new UomCategory(item.Id, item.Name));
}
}
@ -454,7 +451,7 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
Ratio = item.Ratio,
IsActive = item.IsActive,
Rounding = item.Rounding,
CategoryName = item.CategoryName
UomCategoryId = item.UomCategoryId
});
}
}

File diff suppressed because it is too large Load diff

View file

@ -132,6 +132,8 @@ public class SectorSeedDto
public class UomCategorySeedDto
{
public Guid Id { get; set; }
public string Name { get; set; }
}
@ -142,7 +144,7 @@ public class UomSeedDto
public decimal Ratio { get; set; }
public bool IsActive { get; set; }
public decimal Rounding { get; set; }
public string CategoryName { get; set; }
public Guid UomCategoryId { get; set; }
}
public class CurrencySeedDto

View file

@ -361,7 +361,10 @@ public static class PlatformConsts
public const string City = "list-city";
public const string District = "list-district";
public const string SkillType = "list-skilltype";
public const string Skill = "list-skill";
public const string SkillLevel = "list-skilllevel";
public const string UomCategory = "list-uomcategory";
public const string Uom = "list-uom";
public const string BlogCategory = "list-blogcategory";
public const string BlogPost = "list-blogpost";
public const string Route = "list-route";

View file

@ -382,7 +382,10 @@ public static class SeedConsts
public const string City = Default + ".City";
public const string District = Default + ".District";
public const string SkillType = Default + ".SkillType";
public const string SkillLevel = Default + ".SkillLevel";
public const string Skill = Default + ".Skill";
public const string UomCategory = Default + ".UomCategory";
public const string Uom = Default + ".Uom";
}
public const string Routes = Prefix.App + ".Routes";

View file

@ -1,26 +1,18 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Volo.Abp.Domain.Entities.Auditing;
namespace Kurs.Platform.Entities;
public class Uom : FullAuditedEntity<Guid>
{
[Required]
[MaxLength(64)]
public string Name { get; set; }
[Required]
public string Type { get; set; } // Referans birime göre durumu
public decimal Ratio { get; set; }
public bool IsActive { get; set; }
public decimal Rounding { get; set; }
public Guid UomCategoryId { get; set; }
public string CategoryName { get; set; }
public UomCategory UomCategory { get; set; }
}

View file

@ -1,15 +1,19 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Domain.Entities.Auditing;
namespace Kurs.Platform.Entities;
public class UomCategory : FullAuditedEntity<Guid>
{
[Required]
[MaxLength(128)]
public string Name { get; set; }
public ICollection<Uom> Units { get; set; }
public ICollection<Uom> Uoms { get; set; }
protected UomCategory() { }
public UomCategory(Guid id, string name): base(id)
{
Name = name;
}
}

View file

@ -312,14 +312,13 @@ public class PlatformDbContext :
b.Property(x => x.Ratio).HasPrecision(18, 6);
b.Property(x => x.Rounding).HasPrecision(18, 6);
b.Property(x => x.CategoryName)
.IsRequired()
.HasMaxLength(128);
b.Property(x => x.UomCategoryId)
.IsRequired();
b.HasOne(x => x.UomCategory)
.WithMany(x => x.Units)
.HasPrincipalKey(x => x.Name)
.HasForeignKey(x => x.CategoryName)
.WithMany(x => x.Uoms)
.HasPrincipalKey(x => x.Id)
.HasForeignKey(x => x.UomCategoryId)
.OnDelete(DeleteBehavior.Restrict);
});

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,93 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Kurs.Platform.Migrations
{
/// <inheritdoc />
public partial class UomChange : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_PUom_PUomCategory_CategoryName",
table: "PUom");
migrationBuilder.DropUniqueConstraint(
name: "AK_PUomCategory_Name",
table: "PUomCategory");
migrationBuilder.DropIndex(
name: "IX_PUom_CategoryName",
table: "PUom");
migrationBuilder.DropColumn(
name: "CategoryName",
table: "PUom");
migrationBuilder.AddColumn<Guid>(
name: "UomCategoryId",
table: "PUom",
type: "uniqueidentifier",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
migrationBuilder.CreateIndex(
name: "IX_PUom_UomCategoryId",
table: "PUom",
column: "UomCategoryId");
migrationBuilder.AddForeignKey(
name: "FK_PUom_PUomCategory_UomCategoryId",
table: "PUom",
column: "UomCategoryId",
principalTable: "PUomCategory",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_PUom_PUomCategory_UomCategoryId",
table: "PUom");
migrationBuilder.DropIndex(
name: "IX_PUom_UomCategoryId",
table: "PUom");
migrationBuilder.DropColumn(
name: "UomCategoryId",
table: "PUom");
migrationBuilder.AddColumn<string>(
name: "CategoryName",
table: "PUom",
type: "nvarchar(128)",
maxLength: 128,
nullable: false,
defaultValue: "");
migrationBuilder.AddUniqueConstraint(
name: "AK_PUomCategory_Name",
table: "PUomCategory",
column: "Name");
migrationBuilder.CreateIndex(
name: "IX_PUom_CategoryName",
table: "PUom",
column: "CategoryName");
migrationBuilder.AddForeignKey(
name: "FK_PUom_PUomCategory_CategoryName",
table: "PUom",
column: "CategoryName",
principalTable: "PUomCategory",
principalColumn: "Name",
onDelete: ReferentialAction.Restrict);
}
}
}

View file

@ -3451,11 +3451,6 @@ namespace Kurs.Platform.Migrations
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<string>("CategoryName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
@ -3507,9 +3502,12 @@ namespace Kurs.Platform.Migrations
.HasMaxLength(32)
.HasColumnType("nvarchar(32)");
b.Property<Guid>("UomCategoryId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("CategoryName");
b.HasIndex("UomCategoryId");
b.ToTable("PUom", (string)null);
});
@ -6251,9 +6249,8 @@ namespace Kurs.Platform.Migrations
modelBuilder.Entity("Kurs.Platform.Entities.Uom", b =>
{
b.HasOne("Kurs.Platform.Entities.UomCategory", "UomCategory")
.WithMany("Units")
.HasForeignKey("CategoryName")
.HasPrincipalKey("Name")
.WithMany("Uoms")
.HasForeignKey("UomCategoryId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
@ -6492,7 +6489,7 @@ namespace Kurs.Platform.Migrations
modelBuilder.Entity("Kurs.Platform.Entities.UomCategory", b =>
{
b.Navigation("Units");
b.Navigation("Uoms");
});
modelBuilder.Entity("Kurs.Platform.Forum.ForumCategory", b =>