Skip to content

Commit

Permalink
Merge branch 'PSP-8923' of https://github.com/stairaku/PSP into PSP-8923
Browse files Browse the repository at this point in the history
  • Loading branch information
stairaku committed Dec 10, 2024
2 parents fb0f8ca + 7951b3c commit 4473230
Show file tree
Hide file tree
Showing 240 changed files with 82,368 additions and 1,191 deletions.
2 changes: 1 addition & 1 deletion source/backend/api/Pims.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<UserSecretsId>0ef6255f-9ea0-49ec-8c65-c172304b4926</UserSecretsId>
<Version>5.7.0-95.5</Version>
<Version>5.7.0-95.8</Version>
<AssemblyVersion>5.7.0.95</AssemblyVersion>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<ProjectGuid>{16BC0468-78F6-4C91-87DA-7403C919E646}</ProjectGuid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public void Register(TypeAdapterConfig config)
.Map(dest => dest.IsPaymentInTrust, src => src.IsPaymentInTrust)
.Map(dest => dest.GstNumber, src => src.GstNumber)
.Map(dest => dest.FinalizedDate, src => src.FinalizedDate)
.Map(dest => dest.AdvancedPaymentServedDate, src => src.AdvPmtServedDt)
.Map(dest => dest.SpecialInstruction, src => src.SpecialInstruction)
.Map(dest => dest.DetailedRemarks, src => src.DetailedRemarks)
.Map(dest => dest.AlternateProjectId, src => src.AlternateProjectId)
Expand All @@ -60,7 +59,6 @@ public void Register(TypeAdapterConfig config)
.Map(dest => dest.AgreementDt, src => src.AgreementDate)
.Map(dest => dest.ExpropNoticeServedDt, src => src.ExpropriationNoticeServedDate)
.Map(dest => dest.ExpropVestingDt, src => src.ExpropriationVestingDate)
.Map(dest => dest.AdvPmtServedDt, src => src.AdvancedPaymentServedDate)
.Map(dest => dest.GenerationDt, src => src.GenerationDate)
.Map(dest => dest.PimsCompReqFinancials, src => src.Financials)
.Map(dest => dest.AcquisitionOwnerId, src => src.AcquisitionOwnerId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ public class CompensationRequisitionModel : BaseAuditModel

public DateOnly? ExpropriationVestingDate { get; set; }

public DateOnly? AdvancedPaymentServedDate { get; set; }

public DateOnly? GenerationDate { get; set; }

public List<CompensationFinancialModel> Financials { get; set; }
Expand Down
6 changes: 1 addition & 5 deletions source/backend/dal/Repositories/AcquisitionFileRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -690,9 +690,6 @@ public PimsAcquisitionFile Add(PimsAcquisitionFile acquisitionFile)
acquisitionFile.FileNoSuffix = nextSuffix;
}

// TODO: Remove this once the FILE_NUMBER column gets removed. We need this here because it is not nullable
acquisitionFile.FileNumber = string.Empty;

Context.PimsAcquisitionFiles.Add(acquisitionFile);
return acquisitionFile;
}
Expand All @@ -713,7 +710,6 @@ public PimsAcquisitionFile Update(PimsAcquisitionFile acquisitionFile)
// Make sure the frontend cannot override these auto-generated fields
acquisitionFile.FileNo = existingAcqFile.FileNo;
acquisitionFile.FileNoSuffix = existingAcqFile.FileNoSuffix;
acquisitionFile.FileNumber = existingAcqFile.FileNumber; // TODO: Remove this once the FILE_NUMBER column gets removed. We need this here because it is not nullable

// PSP-9268 Changes to Project/Product on the main file need to be propagated to all sub-files
if (existingAcqFile.ProjectId != acquisitionFile.ProjectId || existingAcqFile.ProductId != acquisitionFile.ProductId)
Expand Down Expand Up @@ -804,7 +800,7 @@ public List<PimsAcquisitionFile> GetAcquisitionSubFiles(long acquisitionFileId,

return Context.PimsAcquisitionFiles.AsNoTracking()
.Include(s => s.AcquisitionFileStatusTypeCodeNavigation)
.Where(predicate).OrderBy(x => x.FileNumber).ToList();
.Where(predicate).OrderBy(x => x.FileNoSuffix).ToList();
}

/// <summary>
Expand Down
113 changes: 87 additions & 26 deletions source/backend/entities/PimsBaseContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.FileNoSuffix)
.HasDefaultValue((short)1)
.HasComment("Acquisition file number suffix");
entity.Property(e => e.FileNumber).HasComment("Formatted file number assigned to the acquisition file. Format follows YY-XXXXXX-ZZ where YY = MoTI region number, XXXXXX = generated integer sequence number, and ZZ = file suffix number (defaulting to '01')");
entity.Property(e => e.FundingOther).HasComment("Description of other funding type.");
entity.Property(e => e.LegacyFileNumber).HasComment("Legacy formatted file number assigned to the acquisition file. Format follows YY-XXXXXX-ZZ where YY = MoTI region number, XXXXXX = generated integer sequence number, and ZZ = file suffix number (defaulting to '01'). Required due to some files having t");
entity.Property(e => e.LegacyStakeholder).HasComment("Legacy stakeholders imported from PAIMS.");
Expand Down Expand Up @@ -1691,29 +1690,58 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
tb.HasTrigger("PIMS_CMPREQ_I_S_U_TR");
});

entity.Property(e => e.CompensationRequisitionId).HasDefaultValueSql("(NEXT VALUE FOR [PIMS_COMPENSATION_REQUISITION_ID_SEQ])");
entity.Property(e => e.CompensationRequisitionId)
.HasDefaultValueSql("(NEXT VALUE FOR [PIMS_COMPENSATION_REQUISITION_ID_SEQ])")
.HasComment("Generated surrogate primary key.");
entity.Property(e => e.AcquisitionFileId).HasComment("Foreign key to the PIMS_ACQUISITION_FILE table.");
entity.Property(e => e.AdvPmtServedDt).HasComment("Date that the advanced payment was made.");
entity.Property(e => e.AcquisitionFileTeamId).HasComment("Foreign key to the PIMS_ACQUISITION_FILE_TEAM table.");
entity.Property(e => e.AcquisitionOwnerId).HasComment("Foreign key to the PIMS_ACQUISITION_OWNER table.");
entity.Property(e => e.AgreementDt).HasComment("Agreement date.");
entity.Property(e => e.AlternateProjectId).HasComment("Link a file to an \"Alternate Project\", so the user can make alternate payments that may be due after the original file's project closes.");
entity.Property(e => e.AppCreateTimestamp).HasDefaultValueSql("(getutcdate())");
entity.Property(e => e.AppCreateUserDirectory).HasDefaultValueSql("(user_name())");
entity.Property(e => e.AppCreateUserid).HasDefaultValueSql("(user_name())");
entity.Property(e => e.AppLastUpdateTimestamp).HasDefaultValueSql("(getutcdate())");
entity.Property(e => e.AppLastUpdateUserDirectory).HasDefaultValueSql("(user_name())");
entity.Property(e => e.AppLastUpdateUserid).HasDefaultValueSql("(user_name())");
entity.Property(e => e.ConcurrencyControlNumber).HasDefaultValue(1L);
entity.Property(e => e.DbCreateTimestamp).HasDefaultValueSql("(getutcdate())");
entity.Property(e => e.DbCreateUserid).HasDefaultValueSql("(user_name())");
entity.Property(e => e.DbLastUpdateTimestamp).HasDefaultValueSql("(getutcdate())");
entity.Property(e => e.DbLastUpdateUserid).HasDefaultValueSql("(user_name())");
entity.Property(e => e.AppCreateTimestamp)
.HasDefaultValueSql("(getutcdate())")
.HasComment("The date and time the user created the record.");
entity.Property(e => e.AppCreateUserDirectory)
.HasDefaultValueSql("(user_name())")
.HasComment("The directory of the user account that created the record.");
entity.Property(e => e.AppCreateUserGuid).HasComment("The GUID of the user account that created the record.");
entity.Property(e => e.AppCreateUserid)
.HasDefaultValueSql("(user_name())")
.HasComment("The user account that created the record.");
entity.Property(e => e.AppLastUpdateTimestamp)
.HasDefaultValueSql("(getutcdate())")
.HasComment("The date and time the user updated the record.");
entity.Property(e => e.AppLastUpdateUserDirectory)
.HasDefaultValueSql("(user_name())")
.HasComment("The directory of the user account that updated the record.");
entity.Property(e => e.AppLastUpdateUserGuid).HasComment("The GUID of the user account that updated the record.");
entity.Property(e => e.AppLastUpdateUserid)
.HasDefaultValueSql("(user_name())")
.HasComment("The user account that updated the record.");
entity.Property(e => e.ChartOfAccountsId).HasComment("Foreign key to the PIMS_CHART_OF_ACCOUNTS table.");
entity.Property(e => e.ConcurrencyControlNumber)
.HasDefaultValue(1L)
.HasComment("Application code is responsible for retrieving the row and then incrementing the value of the CONCURRENCY_CONTROL_NUMBER column by one prior to issuing an update. If this is done then the update will succeed, provided that the row was not updated by any o");
entity.Property(e => e.DbCreateTimestamp)
.HasDefaultValueSql("(getutcdate())")
.HasComment("The date and time the record was created.");
entity.Property(e => e.DbCreateUserid)
.HasDefaultValueSql("(user_name())")
.HasComment("The user or proxy account that created the record.");
entity.Property(e => e.DbLastUpdateTimestamp)
.HasDefaultValueSql("(getutcdate())")
.HasComment("The date and time the record was created or last updated.");
entity.Property(e => e.DbLastUpdateUserid)
.HasDefaultValueSql("(user_name())")
.HasComment("The user or proxy account that created or last updated the record.");
entity.Property(e => e.DetailedRemarks).HasComment("Detailed remarks for the compensation requisition.");
entity.Property(e => e.ExpropNoticeServedDt).HasComment("Expropriation notice served date.");
entity.Property(e => e.ExpropVestingDt).HasComment("Expropriation vesting date.");
entity.Property(e => e.FinalizedDate).HasComment("Date that the draft Compensation Req changed from Draft to Final status.");
entity.Property(e => e.FiscalYear).HasComment("Fiscal year of the compensation requisition.");
entity.Property(e => e.GenerationDt).HasComment("Document generation date.");
entity.Property(e => e.GstNumber).HasComment("GST number of the organization receiving the payment.");
entity.Property(e => e.InterestHolderId).HasComment("Foreign key to the PIMS_INTEREST_HOLDER table.");
entity.Property(e => e.IsDisabled)
.HasDefaultValue(false)
.HasComment("Indicates if the requisition is inactive.");
Expand All @@ -1725,7 +1753,9 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.HasComment("Indicates if the payment was made in trust.");
entity.Property(e => e.LeaseId).HasComment("Foreign key to the PIMS_LEASE table.");
entity.Property(e => e.LegacyPayee).HasComment("Payee where only the name is known from the PAIMS system,");
entity.Property(e => e.ResponsibilityId).HasComment("Foreign key to the PIMS_RESPONSIBILITY table.");
entity.Property(e => e.SpecialInstruction).HasComment("Special instructions for the compensation requisition.");
entity.Property(e => e.YearlyFinancialId).HasComment("Foreign key to the PIMS_YEARLY_FINANCIAL table.");

entity.HasOne(d => d.AcquisitionFile).WithMany(p => p.PimsCompensationRequisitions).HasConstraintName("PIM_ACQNFL_PIM_CMPREQ_FK");

Expand Down Expand Up @@ -3668,19 +3698,50 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
tb.HasTrigger("PIMS_EXPPMT_I_S_U_TR");
});

entity.Property(e => e.ExpropriationPaymentId).HasDefaultValueSql("(NEXT VALUE FOR [PIMS_EXPROPRIATION_PAYMENT_ID_SEQ])");
entity.Property(e => e.AppCreateTimestamp).HasDefaultValueSql("(getutcdate())");
entity.Property(e => e.AppCreateUserDirectory).HasDefaultValueSql("(user_name())");
entity.Property(e => e.AppCreateUserid).HasDefaultValueSql("(user_name())");
entity.Property(e => e.AppLastUpdateTimestamp).HasDefaultValueSql("(getutcdate())");
entity.Property(e => e.AppLastUpdateUserDirectory).HasDefaultValueSql("(user_name())");
entity.Property(e => e.AppLastUpdateUserid).HasDefaultValueSql("(user_name())");
entity.Property(e => e.ConcurrencyControlNumber).HasDefaultValue(1L);
entity.Property(e => e.DbCreateTimestamp).HasDefaultValueSql("(getutcdate())");
entity.Property(e => e.DbCreateUserid).HasDefaultValueSql("(user_name())");
entity.Property(e => e.DbLastUpdateTimestamp).HasDefaultValueSql("(getutcdate())");
entity.Property(e => e.DbLastUpdateUserid).HasDefaultValueSql("(user_name())");
entity.Property(e => e.ExpropriationPaymentId)
.HasDefaultValueSql("(NEXT VALUE FOR [PIMS_EXPROPRIATION_PAYMENT_ID_SEQ])")
.HasComment("Unique auto-generated surrogate primary key");
entity.Property(e => e.AcquisitionFileId).HasComment("Foreign key of the acquisition file.");
entity.Property(e => e.AcquisitionOwnerId).HasComment("Foreign key of the acquisition owner.");
entity.Property(e => e.AdvPmtServedDt).HasComment("Date that the advanced payment was made.");
entity.Property(e => e.AppCreateTimestamp)
.HasDefaultValueSql("(getutcdate())")
.HasComment("The date and time the user created the record.");
entity.Property(e => e.AppCreateUserDirectory)
.HasDefaultValueSql("(user_name())")
.HasComment("The directory of the user account that created the record.");
entity.Property(e => e.AppCreateUserGuid).HasComment("The GUID of the user account that created the record.");
entity.Property(e => e.AppCreateUserid)
.HasDefaultValueSql("(user_name())")
.HasComment("The user account that created the record.");
entity.Property(e => e.AppLastUpdateTimestamp)
.HasDefaultValueSql("(getutcdate())")
.HasComment("The date and time the user updated the record.");
entity.Property(e => e.AppLastUpdateUserDirectory)
.HasDefaultValueSql("(user_name())")
.HasComment("The directory of the user account that updated the record.");
entity.Property(e => e.AppLastUpdateUserGuid).HasComment("The GUID of the user account that updated the record.");
entity.Property(e => e.AppLastUpdateUserid)
.HasDefaultValueSql("(user_name())")
.HasComment("The user account that updated the record.");
entity.Property(e => e.ConcurrencyControlNumber)
.HasDefaultValue(1L)
.HasComment("Application code is responsible for retrieving the row and then incrementing the value of the CONCURRENCY_CONTROL_NUMBER column by one prior to issuing an update. If this is done then the update will succeed, provided that the row was not updated by any o");
entity.Property(e => e.DbCreateTimestamp)
.HasDefaultValueSql("(getutcdate())")
.HasComment("The date and time the record was created.");
entity.Property(e => e.DbCreateUserid)
.HasDefaultValueSql("(user_name())")
.HasComment("The user or proxy account that created the record.");
entity.Property(e => e.DbLastUpdateTimestamp)
.HasDefaultValueSql("(getutcdate())")
.HasComment("The date and time the record was created or last updated.");
entity.Property(e => e.DbLastUpdateUserid)
.HasDefaultValueSql("(user_name())")
.HasComment("The user or proxy account that created or last updated the record.");
entity.Property(e => e.Description).HasComment("Form 8 description field. There are lawyer remarks pending. This field could be used for: - providing remarks particular to an expropriation form, and /or - for any ETL descriptive fields as well as - a place-holder forfields that do not have a mapping");
entity.Property(e => e.ExpropriatingAuthority).HasComment("Foreign key of the expropriating authoritry.");
entity.Property(e => e.InterestHolderId).HasComment("Foreign key of the acquisition interest holder.");
entity.Property(e => e.IsDisabled)
.HasDefaultValue(false)
.HasComment("Indicates if the Form 8 payment is inactive.");
Expand Down
8 changes: 0 additions & 8 deletions source/backend/entities/ef/PimsAcquisitionFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,6 @@ public partial class PimsAcquisitionFile
[Column("FILE_NO_SUFFIX")]
public short FileNoSuffix { get; set; }

/// <summary>
/// Formatted file number assigned to the acquisition file. Format follows YY-XXXXXX-ZZ where YY = MoTI region number, XXXXXX = generated integer sequence number, and ZZ = file suffix number (defaulting to &apos;01&apos;)
/// </summary>
[Required]
[Column("FILE_NUMBER")]
[StringLength(18)]
public string FileNumber { get; set; }

/// <summary>
/// Legacy formatted file number assigned to the acquisition file. Format follows YY-XXXXXX-ZZ where YY = MoTI region number, XXXXXX = generated integer sequence number, and ZZ = file suffix number (defaulting to &apos;01&apos;). Required due to some files having t
/// </summary>
Expand Down
9 changes: 4 additions & 5 deletions source/backend/entities/ef/PimsAcquisitionFileHist.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@ public partial class PimsAcquisitionFileHist
[Column("FILE_NO_SUFFIX")]
public short FileNoSuffix { get; set; }

[Required]
[Column("FILE_NUMBER")]
[StringLength(18)]
public string FileNumber { get; set; }

[Column("LEGACY_FILE_NUMBER")]
[StringLength(18)]
public string LegacyFileNumber { get; set; }
Expand Down Expand Up @@ -160,4 +155,8 @@ public partial class PimsAcquisitionFileHist

[Column("COMPLETION_DATE", TypeName = "datetime")]
public DateTime? CompletionDate { get; set; }

[Column("FILE_NUMBER")]
[StringLength(18)]
public string FileNumber { get; set; }
}
Loading

0 comments on commit 4473230

Please sign in to comment.