[CLAUDE] Domain+App+Infra: Plan B G-H1 Mig 34 EmployeeProfile + seed 30 demo
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 3m38s
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 3m38s
Phase 10.1 G-H1 Hồ sơ Nhân sự Foundation — port từ NamGroup CT_NHANSU
(1675 NV, 10 bảng TblNhanVien*) sau anh main chốt S32 4 quyết định
(scope FULL 11 module + DB single schema dbo + reuse Workflow V2 +
chunk per-module Plan riêng). G-H1 CRITICAL FIRST vì depend by 8/11
module Phase 10 sau (Đề xuất/Đơn từ/OT/Đặt xe/Ticket/Dashboard NS/
Chấm công đều cần EmployeeProfile data).
Investigator pre-flight (a103d20) audit NamGroup confirm:
- Main TblNhanVien 105 cols (drop 35 cols duplicate User/UX legacy)
- 5 satellite Phase 10.1 (defer 3 HĐLĐ Plan H2): WorkHistory + Education
+ FamilyRelation + Skill polymorphic Kind + Document
- 6 enum thay catalog FK (Gender/MaritalStatus/EmployeeStatus/...)
- DiaChi dual-write FK + freetext lesson Plan C NamGroup 1675 NV drift
Em main 4 decision chốt:
1. 5 satellite Phase 10.1 (defer 3 HĐLĐ Plan H2)
2. Skill polymorphic Kind enum (gộp 3 NamGroup table)
3. DiaChi 6 FK Province/District/Ward declare nullable + freetext dual-write
ngày đầu (FK constraint defer G-H2 khi catalog scaffold — Implementer
smart decision documented EmployeeProfile.cs comment line 14-17)
4. MaNhanVien format NV/{YYYY}/{Seq:D4} atomic Serializable reset/year
Implementer Case 2 (a8f4567) Pattern 12-bis cross-module mirror PE → Hrm
cookie-cutter scaffold 17 file mới + 4 modified + 3-file mig rule:
Domain (8 file SolutionErp.Domain.Hrm):
- EmployeeProfile.cs (main ~70 cols inherit AuditableEntity, 1-1 UNIQUE User)
- EmployeeWorkHistory.cs + EmployeeEducation.cs + EmployeeFamilyRelation.cs
- EmployeeSkill.cs (polymorphic Kind=Computer/Language/Other)
- EmployeeDocument.cs (IdCard/Passport/Degree/Certificate/LaborContract/Other)
- EmployeeCodeSequence.cs (PK string Prefix, NOT BaseEntity Id Guid)
- Enums.cs (10 enum gọn 1 file)
Application (1 file):
- IEmployeeCodeGenerator.cs interface (mirror IContractCodeGenerator)
Infrastructure (8 file):
- EmployeeCodeGenerator.cs impl IsolationLevel.Serializable transaction
- 7 EF Configuration file (HasIndex UNIQUE UserId/EmployeeCode/Phone +
HasMaxLength + HasColumnType decimal(18,2) + FK Cascade satellite)
- DependencyInjection.cs (M): register IEmployeeCodeGenerator → impl
Persistence (3 file modified + 2 new mig + 1 snapshot):
- IApplicationDbContext.cs (M): +7 DbSet<EmployeeProfile/...>
- ApplicationDbContext.cs (M): +7 DbSet impl
- ApplicationDbContextModelSnapshot.cs (M): EF auto-update
- 20260526110207_AddEmployeeProfiles.cs (NEW, EF auto-gen)
- 20260526110207_AddEmployeeProfiles.Designer.cs (NEW, EF auto-gen)
DbInitializer.cs (M, em main solo Task 3b ~90 LOC):
- using SolutionErp.Domain.Hrm import added
- SeedDemoEmployeeProfilesAsync method appended (end of class)
- Register call after SeedDemoUsersAsync line 88 (depend user exist first)
- NOT gated DemoSeed:Disabled flag (infrastructure data per gotcha #51 lesson)
- 30 demo profile mirror 30 user @solutions.com.vn + sequential code
NV/{YYYY}/0001..0030 + placeholder masked CMND/BHXH/Bank (bro UAT update
qua FE Page Task 5) + EmployeeCodeSequence row LastSeq=30 → production
gen tiếp 0031+
Verify:
- dotnet build: 0 err 2 unrelated warn DocxRenderer (2.49s + 7.86s rebuild)
- dotnet ef database update _Dev: Mig 34 applied (top of __EFMigrationsHistory)
- dotnet test: **120/120 PASS** baseline preserved (no test add Phase 10
test-after per §7 UAT mode — test bundle defer Task 4+5+6 done)
Stats target Phase 10 end: 33→42 mig (+9 Mig 34-42), 60→85 tables (+25),
~148→250 endpoint (+100), 38→60 FE pages (+22). Current after this commit:
33→34 mig + 60→66 tables + endpoint/FE unchanged (G-H1 Task 4+5 next).
Pattern reusable cross-project:
- Pattern 12-bis cross-module entity cookie-cutter mirror reinforced 3×
(S29 Plan B Contract V2 + S33 Plan B G-H1 EmployeeProfile)
- Infrastructure seed OUT of DemoSeed gate (gotcha #51 lesson, mirror Mig 32
SeedSampleContractWorkflowV2)
- DiaChi dual-write FK + freetext từ ngày đầu (NamGroup 1675 NV drift lesson)
Pending Plan B G-H1 Phase 2 (chờ anh main signal kick off):
- Task 4 — Implementer BE CQRS handler + 6 endpoint controller
- Task 5 — Implementer FE 2 app EmployeesPage 3-panel + 6 section tabs
- Task 6 — Em main Permission menu Hrm_HoSo* seed
- Task 7 — Reviewer pre-commit + CICD post-deploy verify
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
4712
src/Backend/SolutionErp.Infrastructure/Persistence/Migrations/20260526110207_AddEmployeeProfiles.Designer.cs
generated
Normal file
4712
src/Backend/SolutionErp.Infrastructure/Persistence/Migrations/20260526110207_AddEmployeeProfiles.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,356 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace SolutionErp.Infrastructure.Persistence.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddEmployeeProfiles : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "EmployeeCodeSequences",
|
||||
columns: table => new
|
||||
{
|
||||
Prefix = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
|
||||
LastSeq = table.Column<int>(type: "int", nullable: false),
|
||||
UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_EmployeeCodeSequences", x => x.Prefix);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "EmployeeProfiles",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
EmployeeCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
|
||||
EmployeeStatus = table.Column<int>(type: "int", nullable: false),
|
||||
Gender = table.Column<int>(type: "int", nullable: true),
|
||||
MaritalStatus = table.Column<int>(type: "int", nullable: true),
|
||||
EmployeeType = table.Column<int>(type: "int", nullable: true),
|
||||
DateOfBirth = table.Column<DateOnly>(type: "date", nullable: true),
|
||||
BirthPlace = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||
Hometown = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||
Phone = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
|
||||
PersonalEmail = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||
InternalPhone = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
|
||||
Ethnicity = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||||
Religion = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||||
Nationality = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
|
||||
IdCardNumber = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
|
||||
IdCardIssueDate = table.Column<DateOnly>(type: "date", nullable: true),
|
||||
IdCardIssuePlace = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||
TaxCode = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
|
||||
SocialInsuranceNumber = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
|
||||
PassportNumber = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
|
||||
PermanentAddressText = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
|
||||
PermanentProvinceId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
PermanentDistrictId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
PermanentWardId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
StreetAddressPermanent = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||
TemporaryAddressText = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
|
||||
TemporaryProvinceId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
TemporaryDistrictId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
TemporaryWardId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
StreetAddressTemporary = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||
HireDate = table.Column<DateOnly>(type: "date", nullable: true),
|
||||
ResignDate = table.Column<DateOnly>(type: "date", nullable: true),
|
||||
EmergencyContactName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||
EmergencyContactPhone = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
|
||||
EmergencyContactAddress = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
|
||||
Qualification = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||
AcademicTitle = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||
WorkLocation = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||
TimekeepingCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||||
BankAccount = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||||
BankName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||
BankBranch = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||
HeightCm = table.Column<int>(type: "int", nullable: true),
|
||||
WeightKg = table.Column<int>(type: "int", nullable: true),
|
||||
BloodType = table.Column<string>(type: "nvarchar(5)", maxLength: 5, nullable: true),
|
||||
BaseSalary = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
|
||||
TotalSalary = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
|
||||
AnnualLeaveDays = table.Column<decimal>(type: "decimal(5,2)", nullable: true),
|
||||
RemainingLeaveDays = table.Column<decimal>(type: "decimal(5,2)", nullable: true),
|
||||
CompensatoryLeaveDays = table.Column<decimal>(type: "decimal(5,2)", nullable: true),
|
||||
SeniorityLeaveDays = table.Column<decimal>(type: "decimal(5,2)", nullable: true),
|
||||
SocialInsuranceStartDate = table.Column<DateOnly>(type: "date", nullable: true),
|
||||
MedicalRegistrationPlace = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||
IsCommunistParty = table.Column<bool>(type: "bit", nullable: false),
|
||||
CommunistPartyJoinDate = table.Column<DateOnly>(type: "date", nullable: true),
|
||||
IsYouthUnion = table.Column<bool>(type: "bit", nullable: false),
|
||||
YouthUnionJoinDate = table.Column<DateOnly>(type: "date", nullable: true),
|
||||
IsTradeUnion = table.Column<bool>(type: "bit", nullable: false),
|
||||
TradeUnionJoinDate = table.Column<DateOnly>(type: "date", nullable: true),
|
||||
PhotoUrl = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
|
||||
Notes = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
CreatedBy = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
UpdatedBy = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
|
||||
DeletedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
DeletedBy = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_EmployeeProfiles", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_EmployeeProfiles_Users_UserId",
|
||||
column: x => x.UserId,
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "EmployeeDocuments",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
EmployeeProfileId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
DocumentType = table.Column<int>(type: "int", nullable: false),
|
||||
FileName = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false),
|
||||
FilePath = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: false),
|
||||
FileSize = table.Column<long>(type: "bigint", nullable: false),
|
||||
ContentType = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
|
||||
IssueDate = table.Column<DateOnly>(type: "date", nullable: true),
|
||||
ExpiryDate = table.Column<DateOnly>(type: "date", nullable: true),
|
||||
Notes = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
CreatedBy = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
UpdatedBy = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
|
||||
DeletedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
DeletedBy = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_EmployeeDocuments", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_EmployeeDocuments_EmployeeProfiles_EmployeeProfileId",
|
||||
column: x => x.EmployeeProfileId,
|
||||
principalTable: "EmployeeProfiles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "EmployeeEducations",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
EmployeeProfileId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
SchoolName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
|
||||
Major = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||
DegreeLevel = table.Column<int>(type: "int", nullable: true),
|
||||
EducationMode = table.Column<int>(type: "int", nullable: true),
|
||||
GradeLevel = table.Column<int>(type: "int", nullable: true),
|
||||
FromDate = table.Column<DateOnly>(type: "date", nullable: true),
|
||||
ToDate = table.Column<DateOnly>(type: "date", nullable: true),
|
||||
CertificateIssueDate = table.Column<DateOnly>(type: "date", nullable: true),
|
||||
Notes = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
CreatedBy = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
UpdatedBy = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
|
||||
DeletedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
DeletedBy = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_EmployeeEducations", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_EmployeeEducations_EmployeeProfiles_EmployeeProfileId",
|
||||
column: x => x.EmployeeProfileId,
|
||||
principalTable: "EmployeeProfiles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "EmployeeFamilyRelations",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
EmployeeProfileId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
FullName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
|
||||
Relationship = table.Column<int>(type: "int", nullable: false),
|
||||
BirthYear = table.Column<int>(type: "int", nullable: true),
|
||||
Occupation = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||
CurrentAddress = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
|
||||
Phone = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
CreatedBy = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
UpdatedBy = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
|
||||
DeletedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
DeletedBy = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_EmployeeFamilyRelations", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_EmployeeFamilyRelations_EmployeeProfiles_EmployeeProfileId",
|
||||
column: x => x.EmployeeProfileId,
|
||||
principalTable: "EmployeeProfiles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "EmployeeSkills",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
EmployeeProfileId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
Kind = table.Column<int>(type: "int", nullable: false),
|
||||
Name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
|
||||
LanguageId = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
|
||||
Level = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
CreatedBy = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
UpdatedBy = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
|
||||
DeletedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
DeletedBy = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_EmployeeSkills", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_EmployeeSkills_EmployeeProfiles_EmployeeProfileId",
|
||||
column: x => x.EmployeeProfileId,
|
||||
principalTable: "EmployeeProfiles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "EmployeeWorkHistories",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
EmployeeProfileId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
CompanyName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
|
||||
CompanyAddress = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
|
||||
Industry = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||
FromDate = table.Column<DateOnly>(type: "date", nullable: true),
|
||||
ToDate = table.Column<DateOnly>(type: "date", nullable: true),
|
||||
JobTitle = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||
JobDescription = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true),
|
||||
ResignReason = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
CreatedBy = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
UpdatedBy = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
|
||||
DeletedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
DeletedBy = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_EmployeeWorkHistories", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_EmployeeWorkHistories_EmployeeProfiles_EmployeeProfileId",
|
||||
column: x => x.EmployeeProfileId,
|
||||
principalTable: "EmployeeProfiles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EmployeeDocuments_DocumentType",
|
||||
table: "EmployeeDocuments",
|
||||
column: "DocumentType");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EmployeeDocuments_EmployeeProfileId",
|
||||
table: "EmployeeDocuments",
|
||||
column: "EmployeeProfileId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EmployeeEducations_EmployeeProfileId",
|
||||
table: "EmployeeEducations",
|
||||
column: "EmployeeProfileId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EmployeeFamilyRelations_EmployeeProfileId",
|
||||
table: "EmployeeFamilyRelations",
|
||||
column: "EmployeeProfileId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EmployeeProfiles_EmployeeCode",
|
||||
table: "EmployeeProfiles",
|
||||
column: "EmployeeCode",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EmployeeProfiles_IsDeleted",
|
||||
table: "EmployeeProfiles",
|
||||
column: "IsDeleted");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EmployeeProfiles_Phone",
|
||||
table: "EmployeeProfiles",
|
||||
column: "Phone");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EmployeeProfiles_UserId",
|
||||
table: "EmployeeProfiles",
|
||||
column: "UserId",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EmployeeSkills_EmployeeProfileId",
|
||||
table: "EmployeeSkills",
|
||||
column: "EmployeeProfileId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EmployeeSkills_Kind",
|
||||
table: "EmployeeSkills",
|
||||
column: "Kind");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EmployeeWorkHistories_EmployeeProfileId",
|
||||
table: "EmployeeWorkHistories",
|
||||
column: "EmployeeProfileId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "EmployeeCodeSequences");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "EmployeeDocuments");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "EmployeeEducations");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "EmployeeFamilyRelations");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "EmployeeSkills");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "EmployeeWorkHistories");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "EmployeeProfiles");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1894,6 +1894,606 @@ namespace SolutionErp.Infrastructure.Persistence.Migrations
|
||||
b.ToTable("ContractTemplates", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SolutionErp.Domain.Hrm.EmployeeCodeSequence", b =>
|
||||
{
|
||||
b.Property<string>("Prefix")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<int>("LastSeq")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("UpdatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.HasKey("Prefix");
|
||||
|
||||
b.ToTable("EmployeeCodeSequences", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SolutionErp.Domain.Hrm.EmployeeDocument", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("ContentType")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("CreatedBy")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime?>("DeletedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("DeletedBy")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int>("DocumentType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<Guid>("EmployeeProfileId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateOnly?>("ExpiryDate")
|
||||
.HasColumnType("date");
|
||||
|
||||
b.Property<string>("FileName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("nvarchar(255)");
|
||||
|
||||
b.Property<string>("FilePath")
|
||||
.IsRequired()
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("nvarchar(500)");
|
||||
|
||||
b.Property<long>("FileSize")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateOnly?>("IssueDate")
|
||||
.HasColumnType("date");
|
||||
|
||||
b.Property<string>("Notes")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("nvarchar(500)");
|
||||
|
||||
b.Property<DateTime?>("UpdatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("UpdatedBy")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("DocumentType");
|
||||
|
||||
b.HasIndex("EmployeeProfileId");
|
||||
|
||||
b.ToTable("EmployeeDocuments", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SolutionErp.Domain.Hrm.EmployeeEducation", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateOnly?>("CertificateIssueDate")
|
||||
.HasColumnType("date");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("CreatedBy")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int?>("DegreeLevel")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime?>("DeletedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("DeletedBy")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int?>("EducationMode")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<Guid>("EmployeeProfileId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateOnly?>("FromDate")
|
||||
.HasColumnType("date");
|
||||
|
||||
b.Property<int?>("GradeLevel")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Major")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<string>("Notes")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("nvarchar(500)");
|
||||
|
||||
b.Property<string>("SchoolName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<DateOnly?>("ToDate")
|
||||
.HasColumnType("date");
|
||||
|
||||
b.Property<DateTime?>("UpdatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("UpdatedBy")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmployeeProfileId");
|
||||
|
||||
b.ToTable("EmployeeEducations", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SolutionErp.Domain.Hrm.EmployeeFamilyRelation", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int?>("BirthYear")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("CreatedBy")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("CurrentAddress")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("nvarchar(500)");
|
||||
|
||||
b.Property<DateTime?>("DeletedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("DeletedBy")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("EmployeeProfileId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Occupation")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<string>("Phone")
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<int>("Relationship")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime?>("UpdatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("UpdatedBy")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmployeeProfileId");
|
||||
|
||||
b.ToTable("EmployeeFamilyRelations", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SolutionErp.Domain.Hrm.EmployeeProfile", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("AcademicTitle")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<decimal?>("AnnualLeaveDays")
|
||||
.HasColumnType("decimal(5,2)");
|
||||
|
||||
b.Property<string>("BankAccount")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("BankBranch")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<string>("BankName")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<decimal?>("BaseSalary")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<string>("BirthPlace")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<string>("BloodType")
|
||||
.HasMaxLength(5)
|
||||
.HasColumnType("nvarchar(5)");
|
||||
|
||||
b.Property<DateOnly?>("CommunistPartyJoinDate")
|
||||
.HasColumnType("date");
|
||||
|
||||
b.Property<decimal?>("CompensatoryLeaveDays")
|
||||
.HasColumnType("decimal(5,2)");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("CreatedBy")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateOnly?>("DateOfBirth")
|
||||
.HasColumnType("date");
|
||||
|
||||
b.Property<DateTime?>("DeletedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("DeletedBy")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("EmergencyContactAddress")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("nvarchar(500)");
|
||||
|
||||
b.Property<string>("EmergencyContactName")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<string>("EmergencyContactPhone")
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<string>("EmployeeCode")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<int>("EmployeeStatus")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int?>("EmployeeType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Ethnicity")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<int?>("Gender")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int?>("HeightCm")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateOnly?>("HireDate")
|
||||
.HasColumnType("date");
|
||||
|
||||
b.Property<string>("Hometown")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<DateOnly?>("IdCardIssueDate")
|
||||
.HasColumnType("date");
|
||||
|
||||
b.Property<string>("IdCardIssuePlace")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<string>("IdCardNumber")
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<string>("InternalPhone")
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<bool>("IsCommunistParty")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsTradeUnion")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsYouthUnion")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<int?>("MaritalStatus")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("MedicalRegistrationPlace")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<string>("Nationality")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("Notes")
|
||||
.HasMaxLength(2000)
|
||||
.HasColumnType("nvarchar(2000)");
|
||||
|
||||
b.Property<string>("PassportNumber")
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<string>("PermanentAddressText")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("nvarchar(500)");
|
||||
|
||||
b.Property<Guid?>("PermanentDistrictId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("PermanentProvinceId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("PermanentWardId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("PersonalEmail")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<string>("Phone")
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<string>("PhotoUrl")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("nvarchar(500)");
|
||||
|
||||
b.Property<string>("Qualification")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<string>("Religion")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<decimal?>("RemainingLeaveDays")
|
||||
.HasColumnType("decimal(5,2)");
|
||||
|
||||
b.Property<DateOnly?>("ResignDate")
|
||||
.HasColumnType("date");
|
||||
|
||||
b.Property<decimal?>("SeniorityLeaveDays")
|
||||
.HasColumnType("decimal(5,2)");
|
||||
|
||||
b.Property<string>("SocialInsuranceNumber")
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<DateOnly?>("SocialInsuranceStartDate")
|
||||
.HasColumnType("date");
|
||||
|
||||
b.Property<string>("StreetAddressPermanent")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<string>("StreetAddressTemporary")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<string>("TaxCode")
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<string>("TemporaryAddressText")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("nvarchar(500)");
|
||||
|
||||
b.Property<Guid?>("TemporaryDistrictId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("TemporaryProvinceId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("TemporaryWardId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("TimekeepingCode")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<decimal?>("TotalSalary")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<DateOnly?>("TradeUnionJoinDate")
|
||||
.HasColumnType("date");
|
||||
|
||||
b.Property<DateTime?>("UpdatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("UpdatedBy")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int?>("WeightKg")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("WorkLocation")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<DateOnly?>("YouthUnionJoinDate")
|
||||
.HasColumnType("date");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmployeeCode")
|
||||
.IsUnique();
|
||||
|
||||
b.HasIndex("IsDeleted");
|
||||
|
||||
b.HasIndex("Phone");
|
||||
|
||||
b.HasIndex("UserId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("EmployeeProfiles", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SolutionErp.Domain.Hrm.EmployeeSkill", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("CreatedBy")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime?>("DeletedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("DeletedBy")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("EmployeeProfileId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<int>("Kind")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("LanguageId")
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<string>("Level")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<DateTime?>("UpdatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("UpdatedBy")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmployeeProfileId");
|
||||
|
||||
b.HasIndex("Kind");
|
||||
|
||||
b.ToTable("EmployeeSkills", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SolutionErp.Domain.Hrm.EmployeeWorkHistory", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("CompanyAddress")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("nvarchar(500)");
|
||||
|
||||
b.Property<string>("CompanyName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("CreatedBy")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime?>("DeletedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("DeletedBy")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("EmployeeProfileId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateOnly?>("FromDate")
|
||||
.HasColumnType("date");
|
||||
|
||||
b.Property<string>("Industry")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("JobDescription")
|
||||
.HasMaxLength(2000)
|
||||
.HasColumnType("nvarchar(2000)");
|
||||
|
||||
b.Property<string>("JobTitle")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<string>("ResignReason")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("nvarchar(500)");
|
||||
|
||||
b.Property<DateOnly?>("ToDate")
|
||||
.HasColumnType("date");
|
||||
|
||||
b.Property<DateTime?>("UpdatedAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("UpdatedBy")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EmployeeProfileId");
|
||||
|
||||
b.ToTable("EmployeeWorkHistories", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SolutionErp.Domain.Identity.MenuItem", b =>
|
||||
{
|
||||
b.Property<string>("Key")
|
||||
@ -3731,6 +4331,72 @@ namespace SolutionErp.Infrastructure.Persistence.Migrations
|
||||
b.Navigation("Step");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SolutionErp.Domain.Hrm.EmployeeDocument", b =>
|
||||
{
|
||||
b.HasOne("SolutionErp.Domain.Hrm.EmployeeProfile", "EmployeeProfile")
|
||||
.WithMany("Documents")
|
||||
.HasForeignKey("EmployeeProfileId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("EmployeeProfile");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SolutionErp.Domain.Hrm.EmployeeEducation", b =>
|
||||
{
|
||||
b.HasOne("SolutionErp.Domain.Hrm.EmployeeProfile", "EmployeeProfile")
|
||||
.WithMany("Educations")
|
||||
.HasForeignKey("EmployeeProfileId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("EmployeeProfile");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SolutionErp.Domain.Hrm.EmployeeFamilyRelation", b =>
|
||||
{
|
||||
b.HasOne("SolutionErp.Domain.Hrm.EmployeeProfile", "EmployeeProfile")
|
||||
.WithMany("FamilyRelations")
|
||||
.HasForeignKey("EmployeeProfileId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("EmployeeProfile");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SolutionErp.Domain.Hrm.EmployeeProfile", b =>
|
||||
{
|
||||
b.HasOne("SolutionErp.Domain.Identity.User", "User")
|
||||
.WithOne()
|
||||
.HasForeignKey("SolutionErp.Domain.Hrm.EmployeeProfile", "UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SolutionErp.Domain.Hrm.EmployeeSkill", b =>
|
||||
{
|
||||
b.HasOne("SolutionErp.Domain.Hrm.EmployeeProfile", "EmployeeProfile")
|
||||
.WithMany("Skills")
|
||||
.HasForeignKey("EmployeeProfileId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("EmployeeProfile");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SolutionErp.Domain.Hrm.EmployeeWorkHistory", b =>
|
||||
{
|
||||
b.HasOne("SolutionErp.Domain.Hrm.EmployeeProfile", "EmployeeProfile")
|
||||
.WithMany("WorkHistories")
|
||||
.HasForeignKey("EmployeeProfileId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("EmployeeProfile");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SolutionErp.Domain.Identity.MenuItem", b =>
|
||||
{
|
||||
b.HasOne("SolutionErp.Domain.Identity.MenuItem", "Parent")
|
||||
@ -3982,6 +4648,19 @@ namespace SolutionErp.Infrastructure.Persistence.Migrations
|
||||
b.Navigation("Approvers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SolutionErp.Domain.Hrm.EmployeeProfile", b =>
|
||||
{
|
||||
b.Navigation("Documents");
|
||||
|
||||
b.Navigation("Educations");
|
||||
|
||||
b.Navigation("FamilyRelations");
|
||||
|
||||
b.Navigation("Skills");
|
||||
|
||||
b.Navigation("WorkHistories");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SolutionErp.Domain.Identity.MenuItem", b =>
|
||||
{
|
||||
b.Navigation("Children");
|
||||
|
||||
Reference in New Issue
Block a user