Skip to content

Commit

Permalink
UAT Release - IS82 (#4450)
Browse files Browse the repository at this point in the history
* psp-9235 | Contact Navigation check (#4416)

* improved logic to contacts navigation checking
---------

Co-authored-by: Manuel Rodriguez <[email protected]>

* CI: Bump version to v5.6.0-91.24

* Version bump IS92 (#4418)

* Bump DEV version

* Lint fixes

* CI: Bump version to v5.6.0-92.1

* PSP-9268 Add sub-interest files to a main file (#4413)

* Inject parentId into create-acq-file route

* Update container and form to copy information from parent file to sub-files on creation

* Improve JS typing

* Add sub-interest files

* Fix bug in model mappings

* Changes to navigation from sub-files

* Fix bug when copying acquisition team from parent file into sub-file

* Backend changes to support adding sub-files

* Hide button for sub-files

* Fix bug creating sub-files

* Ask user for confirmation when changing main file project or product

* Test updates

* Fix merge conflicts

* Test updates

* PR feedback

* Fix typing error after merging another PR

* Update snapshots

* CI: Bump version to v5.6.0-92.2

* PSP-9351 UI/UX: The close button at the top right side of the sub-menu should be integrated within the header (#4414)

* PSP-9351 UI changes to side tray close button for consistency

* Update snapshots

* Test updates

* Update snapshots

* CI: Bump version to v5.6.0-92.3

* PSP-9411 : FT-REG: Lease & Licences: Header still displays "Tenant" when the lease is payable. (#4419)

Co-authored-by: Herrera <[email protected]>
Co-authored-by: Alejandro Sanchez <[email protected]>

* CI: Bump version to v5.6.0-92.4

* Fixed repository not updating doc purpose (#4420)

* CI: Bump version to v5.6.0-92.5

* IS-92.00 Database Schema (#4408)

* IS-92.00 Database Schema

PSP_PIMS | Development Sprint: S92.00 | Design Sprint: 91 | Date: 2024-Oct-21
- Added tables:
  - PIMS_DOCUMENT_QUEUE
  - PIMS_DOCUMENT_QUEUE_HIST
  - PIMS_DOCUMENT_QUEUE_STATUS_TYPE
  - PIMS_SUBFILE_INTEREST_TYPE
- Altered tables:
  - PIMS_ACQUISITION_FILE
  - PIMS_ACQUISITION_FILE_HIST
  - PIMS_DOCUMENT
  - PIMS_DOCUMENT_HIST
- Added seed script:
  - 049_DML_PIMS_DATA_SOURCE_TYPE.sql
  - 157_DML_PIMS_SUBFILE_INTEREST_TYPE.sql
  - 158_DML_PIMS_DOCUMENT_QUEUE_STATUS_TYPE.sql
- Requires additional metadata to meet standards

* Added Lease/License Alters

- Regenerated master.sql

* Changed comments to work with current settings

---------

Co-authored-by: Manuel Rodriguez <[email protected]>

* CI: Bump version to v5.6.0-92.6

* Generated scaffold (#4421)

* CI: Bump version to v5.6.0-92.7

* psp-9186 prevent merging of pims and parcel map data - use pims if exists, otherwise use parcel map. (#4412)

Co-authored-by: Alejandro Sanchez <[email protected]>

* CI: Bump version to v5.6.0-92.8

* Changes on automation branch IS92 (#4425)

* CI: Bump version to v5.6.0-92.9

* Fix faulty logic when closing property info panel (#4424)

* CI: Bump version to v5.6.0-92.10

* PSP-9406 fix

* PSP-9252 Add date fields to acquisition file (major projects) (#4428)

* Model updates

* Include new fields in Create Acquisition form

* Show new fields on acquisition detail view

* Capture new fields in Update acquisition form

* Test updates

* Update snapshots

* CI: Bump version to v5.6.0-92.11

* PSP-9089 Warn user if they are about to lose data when cancelling "Add Document" (#4422)

* Display confirmation message before closing document upload modal

* Inject view into document upload container

* Code cleanup

* Update snapshots

* Test updates

* PR feedback

* CI: Bump version to v5.6.0-92.12

* PSP-9341 : Sub-file interest type (#4423)

* PSP-9341 : Sub-file interest type

* - test updates

* - updates

* - updates

* - test updates

---------

Co-authored-by: Herrera <[email protected]>
Co-authored-by: Alejandro Sanchez <[email protected]>

* CI: Bump version to v5.6.0-92.13

* PSP-9331: UI UX Clean Up - Replace notes field (#4429)

* Changes made

* Update snapshots and unit tests

* Disposition notes and Property Details Yup updated

---------

Co-authored-by: devinleighsmith <[email protected]>
Co-authored-by: Alejandro Sanchez <[email protected]>

* CI: Bump version to v5.6.0-92.14

* PSP-8596 : UI UX Clean Up - Menu order (#4430)

* PSP-8596 : UI UX Clean Up - Menu order

* PSP-8596 : UI UX Clean Up - Menu order

---------

Co-authored-by: Herrera <[email protected]>
Co-authored-by: Alejandro Sanchez <[email protected]>

* CI: Bump version to v5.6.0-92.15

* PSP-9205 : UI UX Clean Up - tab menu - color replacement (#4426)

Co-authored-by: Herrera <[email protected]>

* CI: Bump version to v5.6.0-92.16

* PSP-9412 fix

* CI: Bump version to v5.6.0-92.17

* CI: Bump version to v5.6.0-92.18

* PSP-9465 Sub interest section is missing on the view screen of Sub-interest file  (#4438)

* Add missing sub-interest section to acquisition sub-files

* Test updates

* CI: Bump version to v5.6.0-92.19

* PSP-9435 : FT-REG: Lease & Licences: Payee Header is not refreshed as soon as the user deletes the payee (#4440)

Co-authored-by: Herrera <[email protected]>

* CI: Bump version to v5.6.0-92.20

* PSP-9205 : UI UX Clean Up - tab menu - color replacement (#4441)

Co-authored-by: Herrera <[email protected]>

* CI: Bump version to v5.6.0-92.21

* psp-9466 ensure that the full pims location data is included in the map marker click event - since the minimal layer does not have all necessary properties. (#4445)

Signed-off-by: devinleighsmith <[email protected]>

* CI: Bump version to v5.6.0-92.22

* PSP-9474 : FT: Acquisition File: Sub-interest File: For Other file interest type Placeholder text is missing on the free text box (#4442)

Co-authored-by: Herrera <[email protected]>

* CI: Bump version to v5.6.0-92.23

* Adding tooltip of Acquisition File Create form (#4447)

* CI: Bump version to v5.6.0-92.24

* Updated sync helper to work with new format of files. Sorting before creating json to help in comparing. Other fixes (#4444)

Co-authored-by: Alejandro Sanchez <[email protected]>

* CI: Bump version to v5.6.0-92.25

* PSP-9302 Leases Compensation: 500 error should throw a friendlier message when a user attempts to delete a stakeholder that is associated to a compensation (#4449)

* WIP

* Fix typo

* PSP-9302 Provide user-friendly message

* Reset lease stakeholder state when API responds with error 409

* Test updates

* Fix merge conflicts

* CI: Bump version to v5.6.0-92.26

* PSP-8720 UI-UX cleanup - Disabled Buttons (#4436)

* UI UX clean up for disabled buttons

* Update snapshots

* CI: Bump version to v5.6.0-92.27

* Psp 9318 - document queue base etl (#4443)

* psp-9318 pat_pims_document_import etl wip.

* update to new PIMS table.

* psp-9317 create base ETL to import documents from TAP.

* revert password.

---------

Co-authored-by: Alejandro Sanchez <[email protected]>

* CI: Bump version to v5.6.0-92.28

* PSP-8759 : Creating and Editing Property Records – Property Address F… (#4433)

* PSP-8759 : Creating and Editing Property Records – Property Address Fields

* - test updates

* - test updates

---------

Co-authored-by: Herrera <[email protected]>
Co-authored-by: Alejandro Sanchez <[email protected]>

* CI: Bump version to v5.6.0-92.29

* PSP-8569 : UI UX Clean Up - Properties Menu (Acquisition, Disposition… (#4437)

* PSP-8569 : UI UX Clean Up - Properties Menu (Acquisition, Disposition & Research File)

* - updates

* Update snapshots

---------

Co-authored-by: Herrera <[email protected]>
Co-authored-by: Alejandro Sanchez <[email protected]>

* CI: Bump version to v5.6.0-92.30

* Psp 9405 allow layers to be refreshed programatically. (#4439)

* psp-9405 allow updates that cause changes to map layers to be refreshed

* formatting corrections.

* mock correction.

* code review corrections.

* CI: Bump version to v5.6.0-92.31

* psp-9436, require the user to change the advanced filter for it to be… (#4434)

* psp-9436, require the user to change the advanced filter for it to be applied.
requires tests.

* psp-9436 change advanced filter so that the default filter is "always on".
- Update point clusterer to not cluster properties that are unable to display a marker.

* re-sort dependencies

---------

Co-authored-by: Smith <[email protected]>

* CI: Bump version to v5.6.0-92.32

* PSP-9488 Titles are missing on Properties links and File Summary (#4456)

* Titles are missing on Properties links and File Summary

* Update snapshots

* CI: Bump version to v5.6.0-92.33

* PSP-9489 : FT: Property Details: The default option for the Province should be "British Columbia" (#4454)

Co-authored-by: Herrera <[email protected]>
Co-authored-by: Alejandro Sanchez <[email protected]>

* CI: Bump version to v5.6.0-92.34

* correct inconsistent reset of advanced filter. (#4455)

* correct inconsistent reset of advanced filter.

* test correction.

---------

Co-authored-by: Alejandro Sanchez <[email protected]>

* CI: Bump version to v5.6.0-92.35

* Updated repository to only retrieve the necessary information for a report (#4457)

* CI: Bump version to v5.6.0-92.36

---------

Signed-off-by: devinleighsmith <[email protected]>
Co-authored-by: devinleighsmith <[email protected]>
Co-authored-by: Sue Tairaku <[email protected]>
Co-authored-by: Manuel Rodriguez <[email protected]>
Co-authored-by: Manuel Rodriguez <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Eduardo <[email protected]>
Co-authored-by: Herrera <[email protected]>
Co-authored-by: Doug Filteau <[email protected]>
Co-authored-by: Sue Tairaku <[email protected]>
Co-authored-by: Smith <[email protected]>
  • Loading branch information
11 people authored Nov 7, 2024
1 parent d18d511 commit bbac297
Show file tree
Hide file tree
Showing 571 changed files with 112,037 additions and 13,941 deletions.
2,615 changes: 2,615 additions & 0 deletions etl/PAT_PIMS_DOCUMENT_IMPORT/PAT_PIMS_DOCUMENT_IMPORT/DOCUMENT_IMPORT.dtsx

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<DataTransformationsUserConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Configurations>
<Configuration>
<Name>Development</Name>
<Options>
<AssessmentRuleSuppressionSetting />
<UseWinAuth>false</UseWinAuth>
<WinAuthUserName />
<WinAuthDomain />
<UserIDs />
<UserPasswords />
<OfflineMode>false</OfflineMode>
<ProgressReporting>true</ProgressReporting>
<ParameterConfigurationSensitiveValues>
<ConfigurationSetting>
<Id>LastModifiedTime</Id>
<Name>LastModifiedTime</Name>
<Value xsi:type="xsd:dateTime">2024-10-11T23:15:29.0697001Z</Value>
</ConfigurationSetting>
</ParameterConfigurationSensitiveValues>
</Options>
</Configuration>
</Configurations>
</DataTransformationsUserConfiguration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.33027.164
MinimumVisualStudioVersion = 10.0.40219.1
Project("{C9674DCB-5085-4A16-B785-4C70DD1589BD}") = "PAT_PIMS_DOCUMENT_IMPORT", "PAT_PIMS_DOCUMENT_IMPORT.dtproj", "{8D688065-BC77-4671-BF5F-057201FBF3F4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Development|Default = Development|Default
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8D688065-BC77-4671-BF5F-057201FBF3F4}.Development|Default.ActiveCfg = Development
{8D688065-BC77-4671-BF5F-057201FBF3F4}.Development|Default.Build.0 = Development
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A0AAEAFE-BC23-413A-AC3B-8C50D579C4D3}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0"?>
<SSIS:Parameters xmlns:SSIS="www.microsoft.com/SqlServer/SSIS" />
2 changes: 2 additions & 0 deletions source/backend/api/Controllers/LookupController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ public IActionResult GetAll()
var leaseChecklistSectionTypes = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllLeaseChecklistSectionTypes());
var leasePaymentCategoryTypes = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllLeasePaymentCategoryTypes());
var consultationOutcomeTypes = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllConsultationOutcomeTypes());
var subfileInterestTypes = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllSubfileInterestTypes());

var codes = new List<object>();
codes.AddRange(areaUnitTypes);
Expand Down Expand Up @@ -207,6 +208,7 @@ public IActionResult GetAll()
codes.AddRange(leaseChecklistSectionTypes);
codes.AddRange(leasePaymentCategoryTypes);
codes.AddRange(consultationOutcomeTypes);
codes.AddRange(subfileInterestTypes);

var response = new JsonResult(codes);

Expand Down
6 changes: 3 additions & 3 deletions source/backend/api/Pims.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<UserSecretsId>0ef6255f-9ea0-49ec-8c65-c172304b4926</UserSecretsId>
<Version>5.6.0-91.23</Version>
<Version>5.6.0-91.23</Version>
<AssemblyVersion>5.6.0.91</AssemblyVersion>
<Version>5.6.0-92.36</Version>
<Version>5.6.0-92.36</Version>
<AssemblyVersion>5.6.0.92</AssemblyVersion>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<ProjectGuid>16BC0468-78F6-4C91-87DA-7403C919E646</ProjectGuid>
<TargetFramework>net8.0</TargetFramework>
Expand Down
22 changes: 18 additions & 4 deletions source/backend/api/Services/AcquisitionFileService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,11 @@ public PimsAcquisitionFile Update(PimsAcquisitionFile acquisitionFile, IEnumerab
ValidateMinistryRegion(acquisitionFile.Internal_Id, acquisitionFile.RegionCode);
}

if (!userOverrides.Contains(UserOverrideCode.UpdateSubFilesProjectProduct))
{
ValidateSubFileDependency(acquisitionFile);
}

ValidateStaff(acquisitionFile);
ValidateOrganizationStaff(acquisitionFile);

Expand Down Expand Up @@ -567,7 +572,7 @@ public PimsExpropriationPayment AddExpropriationPayment(long acquisitionFileId,
public IList<PimsExpropriationPayment> GetAcquisitionExpropriationPayments(long acquisitionFileId)
{

_logger.LogInformation("Getting Expropiation Payments for acquisition file id: {acquisitionFileId}", acquisitionFileId);
_logger.LogInformation("Getting Expropriation Payments for acquisition file id: {acquisitionFileId}", acquisitionFileId);
_user.ThrowIfNotAuthorized(Permissions.AcquisitionFileView);
_user.ThrowInvalidAccessToAcquisitionFile(_userRepository, _acqFileRepository, acquisitionFileId);

Expand All @@ -576,14 +581,14 @@ public IList<PimsExpropriationPayment> GetAcquisitionExpropriationPayments(long

public List<PimsAcquisitionFile> GetAcquisitionSubFiles(long id)
{
_logger.LogInformation("Fetch acquistion sub-files for fileId: {id}", id);
_logger.LogInformation("Fetch acquisition sub-files for file id: {id}", id);
_user.ThrowIfNotAuthorized(Permissions.AcquisitionFileView);
_user.ThrowInvalidAccessToAcquisitionFile(_userRepository, _acqFileRepository, id);

var currentAcquisitionFile = GetById(id);
if(currentAcquisitionFile.PrntAcquisitionFileId is not null)
if (currentAcquisitionFile.PrntAcquisitionFileId is not null)
{
throw new BadRequestException("Acquistion file should not be a sub-file.");
throw new BadRequestException("Acquisition file should not be a sub-file.");
}

// Limit search results to user's assigned region(s)
Expand Down Expand Up @@ -699,6 +704,15 @@ private void ValidateMinistryRegion(long acqFileId, short updatedRegion)
}
}

private void ValidateSubFileDependency(PimsAcquisitionFile incomingFile)
{
var currentAcquisitionFile = _acqFileRepository.GetById(incomingFile.Internal_Id);
if (currentAcquisitionFile.ProjectId != incomingFile.ProjectId || currentAcquisitionFile.ProductId != incomingFile.ProductId)
{
throw new UserOverrideException(UserOverrideCode.UpdateSubFilesProjectProduct, "This change will be reflected on other related entities - generated documents, sub-files, etc.\n\nDo you want to proceed?");
}
}

private void ValidateDraftsOnComplete(PimsAcquisitionFile incomingFile)
{
var agreements = _agreementRepository.GetAgreementsByAcquisitionFile(incomingFile.AcquisitionFileId);
Expand Down
35 changes: 34 additions & 1 deletion source/backend/api/Services/LeaseService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class LeaseService : BaseService, ILeaseService
private readonly IEntityNoteRepository _entityNoteRepository;
private readonly IInsuranceRepository _insuranceRepository;
private readonly ILeaseStakeholderRepository _stakeholderRepository;
private readonly ICompensationRequisitionRepository _compensationRequisitionRepository;
private readonly ILeaseRenewalRepository _renewalRepository;
private readonly IConsultationRepository _consultationRepository;
private readonly IUserRepository _userRepository;
Expand All @@ -42,13 +43,13 @@ public LeaseService(
ClaimsPrincipal user,
ILogger<LeaseService> logger,
ILeaseRepository leaseRepository,
ICoordinateTransformService coordinateTransformService,
IPropertyRepository propertyRepository,
IPropertyLeaseRepository propertyLeaseRepository,
IPropertyImprovementRepository propertyImprovementRepository,
IEntityNoteRepository entityNoteRepository,
IInsuranceRepository insuranceRepository,
ILeaseStakeholderRepository stakeholderRepository,
ICompensationRequisitionRepository compensationRequisitionRepository,
ILeaseRenewalRepository renewalRepository,
IConsultationRepository consultationRepository,
IUserRepository userRepository,
Expand All @@ -66,6 +67,7 @@ public LeaseService(
_propertyImprovementRepository = propertyImprovementRepository;
_insuranceRepository = insuranceRepository;
_stakeholderRepository = stakeholderRepository;
_compensationRequisitionRepository = compensationRequisitionRepository;
_renewalRepository = renewalRepository;
_consultationRepository = consultationRepository;
_userRepository = userRepository;
Expand Down Expand Up @@ -180,6 +182,7 @@ public IEnumerable<PimsLeaseStakeholder> UpdateStakeholdersByLeaseId(long leaseI
var pimsUser = _userRepository.GetByKeycloakUserId(_user.GetUserKey());
pimsUser.ThrowInvalidAccessToLeaseFile(_leaseRepository.GetNoTracking(leaseId).RegionCode);

ValidateStakeholdersDependency(leaseId, pimsLeaseStakeholders);
_stakeholderRepository.Update(leaseId, pimsLeaseStakeholders);
_stakeholderRepository.CommitTransaction();

Expand Down Expand Up @@ -667,5 +670,35 @@ private void AppendNewItemsToChecklist(PimsLease lease, ref List<PimsLeaseCheckl
}
}
}

private void ValidateStakeholdersDependency(long leaseId, IEnumerable<PimsLeaseStakeholder> stakeholders)
{
var currentLease = _leaseRepository.GetNoTracking(leaseId);
var compensationRequisitions = _compensationRequisitionRepository.GetAllByLeaseFileId(leaseId);

if (compensationRequisitions.Count == 0)
{
return;
}

foreach (var compReq in compensationRequisitions)
{
var leaseStakeholderCompensationRequisitions = compReq.PimsLeaseStakeholderCompReqs;
if (leaseStakeholderCompensationRequisitions is null || leaseStakeholderCompensationRequisitions.Count == 0)
{
continue;
}

// Check for lease stakeholders
foreach (var leaseStakeholderCompReq in leaseStakeholderCompensationRequisitions)
{
if (!stakeholders.Any(x => x.Internal_Id.Equals(leaseStakeholderCompReq.LeaseStakeholderId))
&& currentLease.PimsLeaseStakeholders.Any(x => x.Internal_Id.Equals(leaseStakeholderCompReq.LeaseStakeholderId)))
{
throw new ForeignKeyDependencyException("Lease File Stakeholder can not be removed since it's assigned as a payee for a compensation requisition");
}
}
}
}
}
}
39 changes: 39 additions & 0 deletions source/backend/apimodels/CodeTypes/SubfileInterestTypes.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using System.Runtime.Serialization;
using System.Text.Json.Serialization;

namespace Pims.Api.Models.CodeTypes
{
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public enum SubfileInterestTypes
{
[EnumMember(Value = "EASEMENT")]
EASEMENT,

[EnumMember(Value = "LICOCCUPY")]
LICOCCUPY,

[EnumMember(Value = "LIEN")]
LIEN,

[EnumMember(Value = "MORTGAGE")]
MORTGAGE,

[EnumMember(Value = "OTHER")]
OTHER,

[EnumMember(Value = "SRWUTILITY")]
SRWUTILITY,

[EnumMember(Value = "STRATALOT")]
STRATALOT,

[EnumMember(Value = "SUBTENANT")]
SUBTENANT,

[EnumMember(Value = "TENANT")]
TENANT,

[EnumMember(Value = "XINGPERMIT")]
XINGPERMIT,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,15 @@ public void Register(TypeAdapterConfig config)
.Map(dest => dest.FundingOther, src => src.FundingOther)
.Map(dest => dest.AssignedDate, src => src.AssignedDate)
.Map(dest => dest.DeliveryDate, src => src.DeliveryDate.ToNullableDateOnly())
.Map(dest => dest.EstimatedCompletionDate, src => src.EstCompletionDt.ToNullableDateOnly())
.Map(dest => dest.PossessionDate, src => src.PossessionDt.ToNullableDateOnly())
.Map(dest => dest.TotalAllowableCompensation, src => src.TotalAllowableCompensation)
.Map(dest => dest.FileStatusTypeCode, src => src.AcquisitionFileStatusTypeCodeNavigation)
.Map(dest => dest.AcquisitionPhysFileStatusTypeCode, src => src.AcqPhysFileStatusTypeCodeNavigation)
.Map(dest => dest.AcquisitionTypeCode, src => src.AcquisitionTypeCodeNavigation)
.Map(dest => dest.RegionCode, src => src.RegionCodeNavigation)
.Map(dest => dest.SubfileInterestTypeCode, src => src.SubfileInterestTypeCodeNavigation)
.Map(dest => dest.OtherSubfileInterestType, src => src.OtherSubfileInterestType)
.Map(dest => dest.FileProperties, src => src.PimsPropertyAcquisitionFiles)
.Map(dest => dest.AcquisitionTeam, src => src.PimsAcquisitionFileTeams)
.Map(dest => dest.AcquisitionFileOwners, src => src.PimsAcquisitionOwners)
Expand All @@ -46,7 +50,7 @@ public void Register(TypeAdapterConfig config)
config.NewConfig<AcquisitionFileModel, PimsAcquisitionFile>()
.PreserveReference(true)
.Map(dest => dest.AcquisitionFileId, src => src.Id)
.Map(dest => dest.PrntAcquisitionFile, src => src.ParentAcquisitionFileId)
.Map(dest => dest.PrntAcquisitionFileId, src => src.ParentAcquisitionFileId)
.Map(dest => dest.FileNo, src => src.FileNo)
.Map(dest => dest.FileNumber, src => src.FileNumber)
.Map(dest => dest.FileName, src => src.FileName)
Expand All @@ -57,11 +61,15 @@ public void Register(TypeAdapterConfig config)
.Map(dest => dest.FundingOther, src => src.FundingOther)
.Map(dest => dest.AssignedDate, src => src.AssignedDate)
.Map(dest => dest.DeliveryDate, src => src.DeliveryDate.ToNullableDateTime())
.Map(dest => dest.EstCompletionDt, src => src.EstimatedCompletionDate.ToNullableDateTime())
.Map(dest => dest.PossessionDt, src => src.PossessionDate.ToNullableDateTime())
.Map(dest => dest.TotalAllowableCompensation, src => src.TotalAllowableCompensation)
.Map(dest => dest.AcquisitionFileStatusTypeCode, src => src.FileStatusTypeCode.Id)
.Map(dest => dest.AcqPhysFileStatusTypeCode, src => src.AcquisitionPhysFileStatusTypeCode.Id)
.Map(dest => dest.AcquisitionTypeCode, src => src.AcquisitionTypeCode.Id)
.Map(dest => dest.RegionCode, src => src.RegionCode.Id)
.Map(dest => dest.SubfileInterestTypeCode, src => src.SubfileInterestTypeCode.Id)
.Map(dest => dest.OtherSubfileInterestType, src => src.OtherSubfileInterestType)
.Map(dest => dest.PimsPropertyAcquisitionFiles, src => src.FileProperties.ToImmutableList())
.Map(dest => dest.PimsAcquisitionFileTeams, src => src.AcquisitionTeam)
.Map(dest => dest.PimsAcquisitionOwners, src => src.AcquisitionFileOwners)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ public class AcquisitionFileModel : FileWithChecklistModel
/// </summary>
public DateOnly? DeliveryDate { get; set; }

/// <summary>
/// Estimated date by which the acquisition would be completed.
/// </summary>
public DateOnly? EstimatedCompletionDate { get; set; }

/// <summary>
/// Date of possession following acquisition completion.
/// </summary>
public DateOnly? PossessionDate { get; set; }

/// <summary>
/// get/set - The acquisition physical file status type.
/// </summary>
Expand Down Expand Up @@ -88,6 +98,16 @@ public class AcquisitionFileModel : FileWithChecklistModel
/// </summary>
public CodeTypeModel<short> RegionCode { get; set; }

/// <summary>
/// get/set - The SubfileInterestTypeCode that this acquisition file falls under.
/// </summary>
public CodeTypeModel<string> SubfileInterestTypeCode { get; set; }

/// <summary>
/// get/set - Description wheb 'Other' SubfileInterestTypeCode.
/// </summary>
public string OtherSubfileInterestType { get; set; }

/// <summary>
/// get/set - List of Legacy Stakeholders.
/// </summary>
Expand Down
6 changes: 6 additions & 0 deletions source/backend/dal/Exceptions/OverrideExceptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ public static UserOverrideCode DeleteTakeActiveDisposition
get { return new UserOverrideCode("DELETE_TAKE_ACTIVE_DISPOSITION"); }
}

public static UserOverrideCode UpdateSubFilesProjectProduct
{
get { return new UserOverrideCode("UPDATE_SUBFILES_PROJECT_PRODUCT"); }
}

public string Code { get; private set; }

private static List<UserOverrideCode> UserOverrideCodes => new List<UserOverrideCode>()
Expand All @@ -81,6 +86,7 @@ public static UserOverrideCode DeleteTakeActiveDisposition
UserOverrideCode.DeleteCompletedTake,
UserOverrideCode.DeleteLastTake,
UserOverrideCode.DeleteTakeActiveDisposition,
UserOverrideCode.UpdateSubFilesProjectProduct,
};

private UserOverrideCode(string code)
Expand Down
31 changes: 31 additions & 0 deletions source/backend/dal/Helpers/Extensions/AcquisitionFileExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using Pims.Dal.Entities;

namespace Pims.Dal.Helpers.Extensions
{
public static class AcquisitionFileExtensions
{
/// <summary>
/// Returns the suffix portion of the supplied Acquisition File Number.
/// </summary>
/// <param name="pimsAcquisitionFile">The Acquisition File entity.</param>
/// <returns>The file number suffix (e.g. "1", "2", "3", etc) if it is found, or -1 if it is not.</returns>
public static int GetAcquisitionNumberSuffix(this PimsAcquisitionFile pimsAcquisitionFile)
{
if (pimsAcquisitionFile is null)
{
return -1;
}

int lastIndex = pimsAcquisitionFile.FileNumber.LastIndexOf('-');
if (lastIndex >= 0 && lastIndex < pimsAcquisitionFile.FileNumber.Length - 1)
{
string suffix = pimsAcquisitionFile.FileNumber.Substring(lastIndex + 1);
return int.TryParse(suffix, out int number) ? number : -1;
}
else
{
return -1;
}
}
}
}
Loading

0 comments on commit bbac297

Please sign in to comment.