User Details

This commit is contained in:
Sedat ÖZTÜRK 2025-06-16 09:36:27 +03:00
parent 0878da4a36
commit f5d339c699
9 changed files with 88 additions and 3798 deletions

View file

@ -22,5 +22,4 @@ public class Branch : FullAuditedEntity<Guid>
public string Email { get; set; }
public string Website { get; set; }
public bool? IsActive { get; set; }
public ICollection<BranchUsers> BranchUsers { get; set; }
}

View file

@ -9,6 +9,5 @@ public class BranchUsers : Entity<Guid>, IMultiTenant
public Guid UserId { get; set; }
public Guid BranchId { get; set; }
public Guid? TenantId { get; set; }
public Branch Branch { get; set; }
Guid? IMultiTenant.TenantId => TenantId;
}

View file

@ -213,25 +213,17 @@ namespace Kurs.Platform.EntityFrameworkCore;
b.ConfigureByConvention();
});
builder.Entity<Branch>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(Branch), PlatformConsts.DbSchema);
b.ConfigureByConvention();
});
builder.Entity<BranchUsers>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(BranchUsers), PlatformConsts.DbSchema);
b.HasKey(x => new { x.UserId, x.BranchId });
});
builder.Entity<Branch>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(Branch), PlatformConsts.DbSchema);
b.HasMany(x => x.BranchUsers)
.WithOne(x => x.Branch)
.HasForeignKey(x => x.BranchId)
.IsRequired(false)
.OnDelete(DeleteBehavior.Cascade);
b.HasOne<Tenant>()
.WithMany()
.HasForeignKey(x => x.TenantId)
.OnDelete(DeleteBehavior.Cascade);
b.ConfigureByConvention();
});
}
}

View file

@ -1,117 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Kurs.Platform.Migrations
{
/// <inheritdoc />
public partial class BranchEntity : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsBranch",
table: "PListForm",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "IsBranch",
table: "PChart",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.CreateTable(
name: "PBranch",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Code = table.Column<string>(type: "nvarchar(max)", nullable: true),
Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
VknTckn = table.Column<long>(type: "bigint", nullable: false),
TaxOffice = table.Column<string>(type: "nvarchar(max)", nullable: true),
Address = table.Column<string>(type: "nvarchar(max)", nullable: true),
Address2 = table.Column<string>(type: "nvarchar(max)", nullable: true),
District = table.Column<string>(type: "nvarchar(max)", nullable: true),
City = table.Column<string>(type: "nvarchar(max)", nullable: true),
PostalCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
Phone = table.Column<long>(type: "bigint", nullable: true),
Mobile = table.Column<long>(type: "bigint", nullable: false),
Fax = table.Column<long>(type: "bigint", nullable: true),
Email = table.Column<string>(type: "nvarchar(max)", nullable: true),
Website = table.Column<string>(type: "nvarchar(max)", nullable: true),
IsActive = table.Column<bool>(type: "bit", nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_PBranch", x => x.Id);
table.ForeignKey(
name: "FK_PBranch_AbpTenants_TenantId",
column: x => x.TenantId,
principalTable: "AbpTenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "PBranchUsers",
columns: table => new
{
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_PBranchUsers", x => new { x.UserId, x.BranchId });
table.ForeignKey(
name: "FK_PBranchUsers_PBranch_BranchId",
column: x => x.BranchId,
principalTable: "PBranch",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_PBranch_TenantId",
table: "PBranch",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_PBranchUsers_BranchId",
table: "PBranchUsers",
column: "BranchId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "PBranchUsers");
migrationBuilder.DropTable(
name: "PBranch");
migrationBuilder.DropColumn(
name: "IsBranch",
table: "PListForm");
migrationBuilder.DropColumn(
name: "IsBranch",
table: "PChart");
}
}
}

View file

@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
namespace Kurs.Platform.Migrations
{
[DbContext(typeof(PlatformDbContext))]
[Migration("20250615085246_BranchEntity")]
[Migration("20250616063457_BranchEntity")]
partial class BranchEntity
{
/// <inheritdoc />
@ -724,8 +724,6 @@ namespace Kurs.Platform.Migrations
b.HasKey("Id");
b.HasIndex("TenantId");
b.ToTable("PBranch", (string)null);
});
@ -746,8 +744,6 @@ namespace Kurs.Platform.Migrations
b.HasKey("UserId", "BranchId");
b.HasIndex("BranchId");
b.ToTable("PBranchUsers", (string)null);
});
@ -3510,25 +3506,6 @@ namespace Kurs.Platform.Migrations
.OnDelete(DeleteBehavior.SetNull);
});
modelBuilder.Entity("Kurs.Platform.Entities.Branch", b =>
{
b.HasOne("Volo.Abp.TenantManagement.Tenant", null)
.WithMany()
.HasForeignKey("TenantId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Kurs.Platform.Entities.BranchUsers", b =>
{
b.HasOne("Kurs.Platform.Entities.Branch", "Branch")
.WithMany("BranchUsers")
.HasForeignKey("BranchId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("Branch");
});
modelBuilder.Entity("Kurs.Platform.Entities.ListFormCustomization", b =>
{
b.HasOne("Kurs.Platform.Entities.ListForm", null)
@ -3696,11 +3673,6 @@ namespace Kurs.Platform.Migrations
b.Navigation("Texts");
});
modelBuilder.Entity("Kurs.Platform.Entities.Branch", b =>
{
b.Navigation("BranchUsers");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
{
b.Navigation("Actions");

View file

@ -1,15 +1,30 @@
using Microsoft.EntityFrameworkCore.Migrations;
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Kurs.Platform.Migrations
{
/// <inheritdoc />
public partial class TenantExtensions : Migration
public partial class BranchEntity : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsBranch",
table: "PListForm",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "IsBranch",
table: "PChart",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "Address",
table: "AbpTenants",
@ -100,11 +115,73 @@ namespace Kurs.Platform.Migrations
type: "nvarchar(256)",
maxLength: 256,
nullable: true);
migrationBuilder.CreateTable(
name: "PBranch",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Code = table.Column<string>(type: "nvarchar(max)", nullable: true),
Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
VknTckn = table.Column<long>(type: "bigint", nullable: false),
TaxOffice = table.Column<string>(type: "nvarchar(max)", nullable: true),
Address = table.Column<string>(type: "nvarchar(max)", nullable: true),
Address2 = table.Column<string>(type: "nvarchar(max)", nullable: true),
District = table.Column<string>(type: "nvarchar(max)", nullable: true),
City = table.Column<string>(type: "nvarchar(max)", nullable: true),
PostalCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
Phone = table.Column<long>(type: "bigint", nullable: true),
Mobile = table.Column<long>(type: "bigint", nullable: false),
Fax = table.Column<long>(type: "bigint", nullable: true),
Email = table.Column<string>(type: "nvarchar(max)", nullable: true),
Website = table.Column<string>(type: "nvarchar(max)", nullable: true),
IsActive = table.Column<bool>(type: "bit", nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_PBranch", x => x.Id);
});
migrationBuilder.CreateTable(
name: "PBranchUsers",
columns: table => new
{
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_PBranchUsers", x => new { x.UserId, x.BranchId });
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "PBranch");
migrationBuilder.DropTable(
name: "PBranchUsers");
migrationBuilder.DropColumn(
name: "IsBranch",
table: "PListForm");
migrationBuilder.DropColumn(
name: "IsBranch",
table: "PChart");
migrationBuilder.DropColumn(
name: "Address",
table: "AbpTenants");

View file

@ -721,8 +721,6 @@ namespace Kurs.Platform.Migrations
b.HasKey("Id");
b.HasIndex("TenantId");
b.ToTable("PBranch", (string)null);
});
@ -743,8 +741,6 @@ namespace Kurs.Platform.Migrations
b.HasKey("UserId", "BranchId");
b.HasIndex("BranchId");
b.ToTable("PBranchUsers", (string)null);
});
@ -3507,25 +3503,6 @@ namespace Kurs.Platform.Migrations
.OnDelete(DeleteBehavior.SetNull);
});
modelBuilder.Entity("Kurs.Platform.Entities.Branch", b =>
{
b.HasOne("Volo.Abp.TenantManagement.Tenant", null)
.WithMany()
.HasForeignKey("TenantId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Kurs.Platform.Entities.BranchUsers", b =>
{
b.HasOne("Kurs.Platform.Entities.Branch", "Branch")
.WithMany("BranchUsers")
.HasForeignKey("BranchId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("Branch");
});
modelBuilder.Entity("Kurs.Platform.Entities.ListFormCustomization", b =>
{
b.HasOne("Kurs.Platform.Entities.ListForm", null)
@ -3693,11 +3670,6 @@ namespace Kurs.Platform.Migrations
b.Navigation("Texts");
});
modelBuilder.Entity("Kurs.Platform.Entities.Branch", b =>
{
b.Navigation("BranchUsers");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
{
b.Navigation("Actions");

View file

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