refactor: update InstitutionContractAmendment and InstitutionContractAmendmentChange constructors for improved encapsulation

This commit is contained in:
2025-10-16 08:01:10 +03:30
parent 5f324a6fa1
commit db40ab567c

View File

@@ -6,6 +6,7 @@ using System.Security.Cryptography;
using _0_Framework.Domain;
using Company.Domain.InstitutionContractContactInfoAgg;
using CompanyManagment.App.Contracts.InstitutionContract;
using OfficeOpenXml.Table.PivotTable;
namespace Company.Domain.InstitutionContractAgg;
@@ -252,12 +253,12 @@ public class InstitutionContract : EntityBase
public class InstitutionContractAmendment : EntityBase
{
public InstitutionContractAmendment(long institutionContractId, InstitutionContract institutionContract,
private InstitutionContractAmendment(){}
public InstitutionContractAmendment(long institutionContractId,
List<InstitutionContractInstallment> installments, double amount, bool hasInstallment,
InstitutionContractAmendmentChange amendmentChange, long lawId)
{
InstitutionContractId = institutionContractId;
InstitutionContract = institutionContract;
Installments = installments is { Count: > 0} ? installments : [];
Amount = amount;
HasInstallment = hasInstallment;
@@ -285,6 +286,7 @@ public class InstitutionContractAmendment : EntityBase
public class InstitutionContractAmendmentChange : EntityBase
{
private InstitutionContractAmendmentChange() { }
private InstitutionContractAmendmentChange(long institutionContractAmendmentId,
InstitutionContractAmendment institutionContractAmendment, InstitutionContractAmendmentChangeType changeType,
DateTime changeDateGr, bool? hasRollCallPlan, bool? hasCustomizeCheckoutPlan, bool? hasContractPlan,