feat: add LawId to InstitutionContract and related classes for improved contract management

This commit is contained in:
2025-10-13 09:29:59 +03:30
parent fdf7fa0d3c
commit 8efffe8b75
9 changed files with 11021 additions and 5 deletions

View File

@@ -17,7 +17,7 @@ public class InstitutionContract : EntityBase
string contractEndFa, double contractAmount, double dailyCompenseation, double obligation,
double totalAmount, int extensionNo, string workshopManualCount, string employeeManualCount, string description,
string officialCompany, string typeOfcontract, string hasValueAddedTax, double valueAddedTax,
List<InstitutionContractWorkshopInitial> workshopDetails)
List<InstitutionContractWorkshopInitial> workshopDetails, long lawId)
{
ContractNo = contractNo;
RepresentativeId = representativeId;
@@ -54,8 +54,11 @@ public class InstitutionContract : EntityBase
Installments = [];
WorkshopGroup = new InstitutionContractWorkshopGroup(id, workshopDetails);
PublicId = Guid.NewGuid();
LawId = lawId;
}
public long LawId { get; private set; }
public string ContractNo { get; private set; }
public long RepresentativeId { get; private set; }

View File

@@ -8,6 +8,7 @@ namespace CompanyManagment.App.Contracts.InstitutionContract;
public class CreateInstitutionContract
{
public long LawId { get; set; }
public string ContractNo { get; set; }
[Required(ErrorMessage = "انتخاب معرف اجباری است")]

View File

@@ -100,6 +100,8 @@ public class CreateInstitutionContractRequest
public double TaxAmount { get; set; }
public double OneMonthAmount { get; set; }
public long LawId { get; set; }
}
/// <summary>
/// مدت زمان قرارداد نهاد

View File

@@ -242,6 +242,7 @@ public class InstitutionContractExtensionCompleteRequest
{
public Guid TemporaryId { get; set; }
public bool IsInstallment { get; set; }
public long LawId { get; set; }
}
public class InstitutionContractExtensionPaymentResponse

View File

@@ -209,7 +209,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
command.ContractStartFa, contractEndGr, command.ContractEndFa, command.ContractAmount,
command.DailyCompenseation, command.Obligation,
command.TotalAmount, 0, command.WorkshopManualCount, command.EmployeeManualCount, command.Description,
command.OfficialCompany, command.TypeOfContract, command.HasValueAddedTax, command.ValueAddedTax, []);
command.OfficialCompany, command.TypeOfContract, command.HasValueAddedTax, command.ValueAddedTax, [],command.LawId);
_institutionContractRepository.Create(createContract);
_institutionContractRepository.SaveChanges();
@@ -318,7 +318,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
command.DailyCompenseation, command.Obligation,
command.TotalAmount, command.ExtensionNo, command.WorkshopManualCount, command.EmployeeManualCount,
command.Description, command.OfficialCompany, command.TypeOfContract, command.HasValueAddedTax,
command.ValueAddedTax, []);
command.ValueAddedTax, [],command.LawId);
_institutionContractRepository.Create(createContract);
_institutionContractRepository.SaveChanges();
@@ -1046,7 +1046,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
command.Workshops.Count.ToString(),
command.Workshops.Sum(x => x.PersonnelCount).ToString(), command.Description,
"NotOfficial", "JobRelation", hasValueAddedTax,
command.TaxAmount, workshopDetails);
command.TaxAmount, workshopDetails,command.LawId);
FinancialStatment financialStatement;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,40 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CompanyManagment.EFCore.Migrations
{
/// <inheritdoc />
public partial class AddLawIdtoinstitutionContract : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "Version",
table: "Law",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<long>(
name: "LawId",
table: "InstitutionContracts",
type: "bigint",
nullable: false,
defaultValue: 0L);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Version",
table: "Law");
migrationBuilder.DropColumn(
name: "LawId",
table: "InstitutionContracts");
}
}
}

View File

@@ -3130,6 +3130,9 @@ namespace CompanyManagment.EFCore.Migrations
b.Property<bool>("IsInstallment")
.HasColumnType("bit");
b.Property<long>("LawId")
.HasColumnType("bigint");
b.Property<double>("Obligation")
.HasColumnType("float");
@@ -4073,6 +4076,9 @@ namespace CompanyManagment.EFCore.Migrations
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<int>("Version")
.HasColumnType("int");
b.HasKey("id");
b.ToTable("Law", (string)null);

View File

@@ -2227,7 +2227,8 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
extensionNo, workshopsCount, employeeCount,
previousInstitutionContract.Description,
"NotOfficial", "JobRelation", hasValueAddedTax,
payment.Tax.MoneyToDouble(),[]);
payment.Tax.MoneyToDouble(),[],
request.LawId);
await CreateAsync(entity);
await SaveChangesAsync();