Cascading Sistemi ve Seeder

This commit is contained in:
Sedat Öztürk 2025-08-19 22:26:50 +03:00
parent ca18bbc6a8
commit caf9927976
15 changed files with 1199 additions and 1026 deletions

View file

@ -15,11 +15,12 @@ public class CreateUpdateTenantInput
public string Founder { get; set; } public string Founder { get; set; }
public long VknTckn { get; set; } public long VknTckn { get; set; }
public string TaxOffice { get; set; } public string TaxOffice { get; set; }
public string Address { get; set; }
public string Address2 { get; set; }
public string District { get; set; }
public string Country { get; set; } public string Country { get; set; }
public string City { get; set; } public string City { get; set; }
public string District { get; set; }
public string Street { get; set; }
public string Address { get; set; }
public string Address2 { get; set; }
public string PostalCode { get; set; } public string PostalCode { get; set; }
public long Phone { get; set; } public long Phone { get; set; }
public long Mobile { get; set; } public long Mobile { get; set; }

View file

@ -12,11 +12,12 @@ public class CustomTenantDto
public string Founder { get; set; } public string Founder { get; set; }
public long VknTckn { get; set; } public long VknTckn { get; set; }
public string TaxOffice { get; set; } public string TaxOffice { get; set; }
public string Address { get; set; }
public string Address2 { get; set; }
public string District { get; set; }
public string Country { get; set; } public string Country { get; set; }
public string City { get; set; } public string City { get; set; }
public string District { get; set; }
public string Street { get; set; }
public string Address { get; set; }
public string Address2 { get; set; }
public string PostalCode { get; set; } public string PostalCode { get; set; }
public long Phone { get; set; } public long Phone { get; set; }
public long Mobile { get; set; } public long Mobile { get; set; }

View file

@ -117,11 +117,12 @@ public class ListFormDynamicApiAppService : PlatformAppService, IListFormDynamic
entity.SetFounder(input.Data.Founder); entity.SetFounder(input.Data.Founder);
entity.SetVknTckn(input.Data.VknTckn); entity.SetVknTckn(input.Data.VknTckn);
entity.SetTaxOffice(input.Data.TaxOffice); entity.SetTaxOffice(input.Data.TaxOffice);
entity.SetAddress(input.Data.Address);
entity.SetAddress2(input.Data.Address2);
entity.SetDistrict(input.Data.District);
entity.SetCountry(input.Data.Country); entity.SetCountry(input.Data.Country);
entity.SetCity(input.Data.City); entity.SetCity(input.Data.City);
entity.SetDistrict(input.Data.District);
entity.SetStreet(input.Data.Street);
entity.SetAddress(input.Data.Address);
entity.SetAddress2(input.Data.Address2);
entity.SetPostalCode(input.Data.PostalCode); entity.SetPostalCode(input.Data.PostalCode);
entity.SetPhone(input.Data.Phone); entity.SetPhone(input.Data.Phone);
entity.SetMobile(input.Data.Mobile); entity.SetMobile(input.Data.Mobile);
@ -150,11 +151,12 @@ public class ListFormDynamicApiAppService : PlatformAppService, IListFormDynamic
entity.SetFounder(input.Data.Founder); entity.SetFounder(input.Data.Founder);
entity.SetVknTckn(input.Data.VknTckn); entity.SetVknTckn(input.Data.VknTckn);
entity.SetTaxOffice(input.Data.TaxOffice); entity.SetTaxOffice(input.Data.TaxOffice);
entity.SetAddress(input.Data.Address);
entity.SetAddress2(input.Data.Address2);
entity.SetDistrict(input.Data.District);
entity.SetCountry(input.Data.Country); entity.SetCountry(input.Data.Country);
entity.SetCity(input.Data.City); entity.SetCity(input.Data.City);
entity.SetDistrict(input.Data.District);
entity.SetStreet(input.Data.Street);
entity.SetAddress(input.Data.Address);
entity.SetAddress2(input.Data.Address2);
entity.SetPostalCode(input.Data.PostalCode); entity.SetPostalCode(input.Data.PostalCode);
entity.SetPhone(input.Data.Phone); entity.SetPhone(input.Data.Phone);
entity.SetMobile(input.Data.Mobile); entity.SetMobile(input.Data.Mobile);

View file

@ -79,11 +79,12 @@ public class PlatformTenantAppService : TenantAppService, IPlatformTenantAppServ
dto.Founder = tenant.GetFounder(); dto.Founder = tenant.GetFounder();
dto.VknTckn = tenant.GetVknTckn(); dto.VknTckn = tenant.GetVknTckn();
dto.TaxOffice = tenant.GetTaxOffice(); dto.TaxOffice = tenant.GetTaxOffice();
dto.Address = tenant.GetAddress();
dto.Address2 = tenant.GetAddress2();
dto.District = tenant.GetDistrict();
dto.Country = tenant.GetCountry(); dto.Country = tenant.GetCountry();
dto.City = tenant.GetCity(); dto.City = tenant.GetCity();
dto.District = tenant.GetDistrict();
dto.Street = tenant.GetStreet();
dto.Address = tenant.GetAddress();
dto.Address2 = tenant.GetAddress2();
dto.PostalCode = tenant.GetPostalCode(); dto.PostalCode = tenant.GetPostalCode();
dto.Phone = tenant.GetPhone(); dto.Phone = tenant.GetPhone();
dto.Mobile = tenant.GetMobile(); dto.Mobile = tenant.GetMobile();

File diff suppressed because it is too large Load diff

View file

@ -31,11 +31,12 @@ public static class PlatformConsts
public const string VknTckn = "VknTckn"; public const string VknTckn = "VknTckn";
public const string Founder = "Founder"; public const string Founder = "Founder";
public const string TaxOffice = "TaxOffice"; public const string TaxOffice = "TaxOffice";
public const string Address = "Address";
public const string Address2 = "Address2";
public const string Country = "Country"; public const string Country = "Country";
public const string City = "City"; public const string City = "City";
public const string District = "District"; public const string District = "District";
public const string Street = "Street";
public const string Address = "Address";
public const string Address2 = "Address2";
public const string PostalCode = "PostalCode"; public const string PostalCode = "PostalCode";
public const string Phone = "Phone"; public const string Phone = "Phone";
public const string Mobile = "Mobile"; public const string Mobile = "Mobile";

View file

@ -10,11 +10,12 @@ public class Branch : FullAuditedEntity<Guid>
public string Name { get; set; } public string Name { get; set; }
public long VknTckn { get; set; } public long VknTckn { get; set; }
public string TaxOffice { get; set; } public string TaxOffice { get; set; }
public string Address { get; set; }
public string Address2 { get; set; }
public string District { get; set; }
public string Country { get; set; } public string Country { get; set; }
public string City { get; set; } public string City { get; set; }
public string District { get; set; }
public string Street { get; set; }
public string Address { get; set; }
public string Address2 { get; set; }
public string PostalCode { get; set; } public string PostalCode { get; set; }
public long? Phone { get; set; } public long? Phone { get; set; }
public long Mobile { get; set; } public long Mobile { get; set; }

View file

@ -52,6 +52,40 @@ public static class AbpTenantExtensions
return tenant.GetProperty<string>(PlatformConsts.Tenants.TaxOffice); return tenant.GetProperty<string>(PlatformConsts.Tenants.TaxOffice);
} }
public static void SetCountry(this Tenant tenant, string country)
{
tenant.SetProperty(PlatformConsts.Tenants.Country, country);
}
public static string GetCountry(this Tenant tenant)
{
return tenant.GetProperty<string>(PlatformConsts.Tenants.Country);
}
public static void SetCity(this Tenant tenant, string city)
{
tenant.SetProperty(PlatformConsts.Tenants.City, city);
}
public static string GetCity(this Tenant tenant)
{
return tenant.GetProperty<string>(PlatformConsts.Tenants.City);
}
public static void SetDistrict(this Tenant tenant, string district)
{
tenant.SetProperty(PlatformConsts.Tenants.District, district);
}
public static string GetDistrict(this Tenant tenant)
{
return tenant.GetProperty<string>(PlatformConsts.Tenants.District);
}
public static void SetStreet(this Tenant tenant, string street)
{
tenant.SetProperty(PlatformConsts.Tenants.Street, street);
}
public static string GetStreet(this Tenant tenant)
{
return tenant.GetProperty<string>(PlatformConsts.Tenants.Street);
}
public static void SetAddress(this Tenant tenant, string address) public static void SetAddress(this Tenant tenant, string address)
{ {
tenant.SetProperty(PlatformConsts.Tenants.Address, address); tenant.SetProperty(PlatformConsts.Tenants.Address, address);
@ -69,35 +103,7 @@ public static class AbpTenantExtensions
{ {
return tenant.GetProperty<string>(PlatformConsts.Tenants.Address2); return tenant.GetProperty<string>(PlatformConsts.Tenants.Address2);
} }
public static void SetPostalCode(this Tenant tenant, string postalCode)
public static void SetDistrict(this Tenant tenant, string district)
{
tenant.SetProperty(PlatformConsts.Tenants.District, district);
}
public static string GetDistrict(this Tenant tenant)
{
return tenant.GetProperty<string>(PlatformConsts.Tenants.District);
}
public static void SetCity(this Tenant tenant, string city)
{
tenant.SetProperty(PlatformConsts.Tenants.City, city);
}
public static string GetCity(this Tenant tenant)
{
return tenant.GetProperty<string>(PlatformConsts.Tenants.City);
}
public static void SetCountry(this Tenant tenant, string country)
{
tenant.SetProperty(PlatformConsts.Tenants.Country, country);
}
public static string GetCountry(this Tenant tenant)
{
return tenant.GetProperty<string>(PlatformConsts.Tenants.Country);
}
public static void SetPostalCode(this Tenant tenant, string postalCode)
{ {
tenant.SetProperty(PlatformConsts.Tenants.PostalCode, postalCode); tenant.SetProperty(PlatformConsts.Tenants.PostalCode, postalCode);
} }

View file

@ -7,7 +7,6 @@ using Volo.Abp.Domain.Entities.Events;
using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Repositories;
using Volo.Abp.EventBus; using Volo.Abp.EventBus;
using Volo.Abp.TenantManagement; using Volo.Abp.TenantManagement;
using static Kurs.Settings.SettingsConsts;
namespace Kurs.Platform.Tenants; namespace Kurs.Platform.Tenants;

View file

@ -91,24 +91,6 @@ public static class PlatformEfCoreEntityExtensionMappings
} }
); );
ObjectExtensionManager.Instance
.MapEfCoreProperty<Tenant, string>(
PlatformConsts.Tenants.Address,
(entityBuilder, propertyBuilder) =>
{
propertyBuilder.HasMaxLength(256).HasDefaultValue(null);
}
);
ObjectExtensionManager.Instance
.MapEfCoreProperty<Tenant, string>(
PlatformConsts.Tenants.Address2,
(entityBuilder, propertyBuilder) =>
{
propertyBuilder.HasMaxLength(256).HasDefaultValue(null);
}
);
ObjectExtensionManager.Instance ObjectExtensionManager.Instance
.MapEfCoreProperty<Tenant, string>( .MapEfCoreProperty<Tenant, string>(
PlatformConsts.Tenants.Country, PlatformConsts.Tenants.Country,
@ -136,6 +118,33 @@ public static class PlatformEfCoreEntityExtensionMappings
} }
); );
ObjectExtensionManager.Instance
.MapEfCoreProperty<Tenant, string>(
PlatformConsts.Tenants.Street,
(entityBuilder, propertyBuilder) =>
{
propertyBuilder.HasMaxLength(128).HasDefaultValue(null);
}
);
ObjectExtensionManager.Instance
.MapEfCoreProperty<Tenant, string>(
PlatformConsts.Tenants.Address,
(entityBuilder, propertyBuilder) =>
{
propertyBuilder.HasMaxLength(256).HasDefaultValue(null);
}
);
ObjectExtensionManager.Instance
.MapEfCoreProperty<Tenant, string>(
PlatformConsts.Tenants.Address2,
(entityBuilder, propertyBuilder) =>
{
propertyBuilder.HasMaxLength(256).HasDefaultValue(null);
}
);
ObjectExtensionManager.Instance ObjectExtensionManager.Instance
.MapEfCoreProperty<Tenant, string>( .MapEfCoreProperty<Tenant, string>(
PlatformConsts.Tenants.PostalCode, PlatformConsts.Tenants.PostalCode,

View file

@ -13,8 +13,8 @@ using Volo.Abp.EntityFrameworkCore;
namespace Kurs.Platform.Migrations namespace Kurs.Platform.Migrations
{ {
[DbContext(typeof(PlatformDbContext))] [DbContext(typeof(PlatformDbContext))]
[Migration("20250819080748_Districs")] [Migration("20250819182323_Districts")]
partial class Districs partial class Districts
{ {
/// <inheritdoc /> /// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder) protected override void BuildTargetModel(ModelBuilder modelBuilder)
@ -1276,6 +1276,9 @@ namespace Kurs.Platform.Migrations
b.Property<string>("PostalCode") b.Property<string>("PostalCode")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("Street")
.HasColumnType("nvarchar(max)");
b.Property<string>("TaxOffice") b.Property<string>("TaxOffice")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
@ -2182,11 +2185,9 @@ namespace Kurs.Platform.Migrations
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("CountryCode", "CityCode"); b.HasIndex("CountryCode", "CityCode", "Name", "Township", "Street", "ZipCode")
b.HasIndex("CityCode", "Name", "Township", "Street", "ZipCode")
.IsUnique() .IsUnique()
.HasFilter("[Township] IS NOT NULL AND [Street] IS NOT NULL AND [ZipCode] IS NOT NULL"); .HasFilter("[CountryCode] IS NOT NULL AND [Township] IS NOT NULL AND [Street] IS NOT NULL AND [ZipCode] IS NOT NULL");
b.ToTable("PDistrict", (string)null); b.ToTable("PDistrict", (string)null);
}); });
@ -6056,6 +6057,10 @@ namespace Kurs.Platform.Migrations
.HasMaxLength(10) .HasMaxLength(10)
.HasColumnType("nvarchar(10)"); .HasColumnType("nvarchar(10)");
b.Property<string>("Street")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("TaxOffice") b.Property<string>("TaxOffice")
.HasMaxLength(64) .HasMaxLength(64)
.HasColumnType("nvarchar(64)"); .HasColumnType("nvarchar(64)");

View file

@ -6,7 +6,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
namespace Kurs.Platform.Migrations namespace Kurs.Platform.Migrations
{ {
/// <inheritdoc /> /// <inheritdoc />
public partial class Districs : Migration public partial class Districts : Migration
{ {
/// <inheritdoc /> /// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder) protected override void Up(MigrationBuilder migrationBuilder)
@ -82,6 +82,19 @@ namespace Kurs.Platform.Migrations
maxLength: 20, maxLength: 20,
nullable: true); nullable: true);
migrationBuilder.AddColumn<string>(
name: "Street",
table: "PBranch",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Street",
table: "AbpTenants",
type: "nvarchar(128)",
maxLength: 128,
nullable: true);
migrationBuilder.AddUniqueConstraint( migrationBuilder.AddUniqueConstraint(
name: "AK_PCity_CountryCode_Code", name: "AK_PCity_CountryCode_Code",
table: "PCity", table: "PCity",
@ -124,16 +137,11 @@ namespace Kurs.Platform.Migrations
unique: true); unique: true);
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_PDistrict_CityCode_Name_Township_Street_ZipCode", name: "IX_PDistrict_CountryCode_CityCode_Name_Township_Street_ZipCode",
table: "PDistrict", table: "PDistrict",
columns: new[] { "CityCode", "Name", "Township", "Street", "ZipCode" }, columns: new[] { "CountryCode", "CityCode", "Name", "Township", "Street", "ZipCode" },
unique: true, unique: true,
filter: "[Township] IS NOT NULL AND [Street] IS NOT NULL AND [ZipCode] IS NOT NULL"); filter: "[CountryCode] IS NOT NULL AND [Township] IS NOT NULL AND [Street] IS NOT NULL AND [ZipCode] IS NOT NULL");
migrationBuilder.CreateIndex(
name: "IX_PDistrict_CountryCode_CityCode",
table: "PDistrict",
columns: new[] { "CountryCode", "CityCode" });
} }
/// <inheritdoc /> /// <inheritdoc />
@ -154,6 +162,14 @@ namespace Kurs.Platform.Migrations
name: "PlateCode", name: "PlateCode",
table: "PCity"); table: "PCity");
migrationBuilder.DropColumn(
name: "Street",
table: "PBranch");
migrationBuilder.DropColumn(
name: "Street",
table: "AbpTenants");
migrationBuilder.AlterColumn<string>( migrationBuilder.AlterColumn<string>(
name: "Phone", name: "Phone",
table: "PDemo", table: "PDemo",

View file

@ -1273,6 +1273,9 @@ namespace Kurs.Platform.Migrations
b.Property<string>("PostalCode") b.Property<string>("PostalCode")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("Street")
.HasColumnType("nvarchar(max)");
b.Property<string>("TaxOffice") b.Property<string>("TaxOffice")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
@ -2179,11 +2182,9 @@ namespace Kurs.Platform.Migrations
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("CountryCode", "CityCode"); b.HasIndex("CountryCode", "CityCode", "Name", "Township", "Street", "ZipCode")
b.HasIndex("CityCode", "Name", "Township", "Street", "ZipCode")
.IsUnique() .IsUnique()
.HasFilter("[Township] IS NOT NULL AND [Street] IS NOT NULL AND [ZipCode] IS NOT NULL"); .HasFilter("[CountryCode] IS NOT NULL AND [Township] IS NOT NULL AND [Street] IS NOT NULL AND [ZipCode] IS NOT NULL");
b.ToTable("PDistrict", (string)null); b.ToTable("PDistrict", (string)null);
}); });
@ -6053,6 +6054,10 @@ namespace Kurs.Platform.Migrations
.HasMaxLength(10) .HasMaxLength(10)
.HasColumnType("nvarchar(10)"); .HasColumnType("nvarchar(10)");
b.Property<string>("Street")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("TaxOffice") b.Property<string>("TaxOffice")
.HasMaxLength(64) .HasMaxLength(64)
.HasColumnType("nvarchar(64)"); .HasColumnType("nvarchar(64)");

View file

@ -82,7 +82,7 @@ define(['./workbox-54d0af47'], (function (workbox) { 'use strict';
"revision": "3ca0b8505b4bec776b69afdba2768812" "revision": "3ca0b8505b4bec776b69afdba2768812"
}, { }, {
"url": "index.html", "url": "index.html",
"revision": "0.8rvvf2rf6hg" "revision": "0.vah6gtb83uo"
}], {}); }], {});
workbox.cleanupOutdatedCaches(); workbox.cleanupOutdatedCaches();
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), { workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {

View file

@ -5,11 +5,11 @@ import './index.css'
import { UiEvalService } from './services/UiEvalService' import { UiEvalService } from './services/UiEvalService'
import 'devextreme-react/text-area' import 'devextreme-react/text-area'
import 'devextreme-react/html-editor' import 'devextreme-react/html-editor'
import config from 'devextreme/core/config' // import config from 'devextreme/core/config'
import { licenseKey } from './devextreme-license' // import { licenseKey } from './devextreme-license'
// Lisansı uygulama başlamadan önce kaydediyoruz // // Lisansı uygulama başlamadan önce kaydediyoruz
config({ licenseKey }) // config({ licenseKey })
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(<App />) ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(<App />)