Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSP-9604 : Acquisition file- Progress statuses #4554

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions source/backend/api/Controllers/LookupController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ public IActionResult GetAll()
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 acquisitionFileProgressStatuses = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllAcquisitionFileProgressStatusTypes());
var acquisitionFileAppraisalStatuses = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllAcquisitionFileAppraisalStatusTypes());
var acquisitionFileLegalSurveyStatuses = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllAcquisitionFileLegalSurveyStatusTypes());
var acquisitionFileTakeTypesStatuses = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllAcquisitionFileTakeStatusTypes());
var acquisitionFileExpropiationRiskStatuses = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllAcquisitionFileExpropiationRiskStatusTypes());

var codes = new List<object>();
codes.AddRange(areaUnitTypes);
Expand Down Expand Up @@ -209,6 +214,11 @@ public IActionResult GetAll()
codes.AddRange(leasePaymentCategoryTypes);
codes.AddRange(consultationOutcomeTypes);
codes.AddRange(subfileInterestTypes);
codes.AddRange(acquisitionFileProgressStatuses);
codes.AddRange(acquisitionFileAppraisalStatuses);
codes.AddRange(acquisitionFileLegalSurveyStatuses);
codes.AddRange(acquisitionFileTakeTypesStatuses);
codes.AddRange(acquisitionFileExpropiationRiskStatuses);

var response = new JsonResult(codes);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ public void Register(TypeAdapterConfig config)
.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.AcquisitionFileProgressStatuses, src => src.PimsAcqFileAcqProgresses)
.Map(dest => dest.AcquisitionFileAppraisalStatusTypeCode, src => src.AcqFileAppraisalTypeCodeNavigation)
.Map(dest => dest.AcquisitionFileLegalSurveyStatusTypeCode, src => src.AcqFileLglSrvyTypeCodeNavigation)
.Map(dest => dest.AcquisitionFileTakingStatuses, src => src.PimsAcqFileAcqFlTakeTyps)
.Map(dest => dest.AcquisitionFileExpropiationRiskStatusTypeCode, src => src.AcqFileExpropRiskTypeCodeNavigation)
.Map(dest => dest.TotalAllowableCompensation, src => src.TotalAllowableCompensation)
.Map(dest => dest.FileStatusTypeCode, src => src.AcquisitionFileStatusTypeCodeNavigation)
.Map(dest => dest.AcquisitionPhysFileStatusTypeCode, src => src.AcqPhysFileStatusTypeCodeNavigation)
Expand Down Expand Up @@ -62,6 +67,11 @@ public void Register(TypeAdapterConfig config)
.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.PimsAcqFileAcqProgresses, src => src.AcquisitionFileProgressStatuses)
.Map(dest => dest.AcqFileAppraisalTypeCode, src => src.AcquisitionFileAppraisalStatusTypeCode.Id)
.Map(dest => dest.AcqFileLglSrvyTypeCode, src => src.AcquisitionFileLegalSurveyStatusTypeCode.Id)
.Map(dest => dest.PimsAcqFileAcqFlTakeTyps, src => src.AcquisitionFileTakingStatuses)
.Map(dest => dest.AcqFileExpropRiskTypeCode, src => src.AcquisitionFileExpropiationRiskStatusTypeCode.Id)
.Map(dest => dest.TotalAllowableCompensation, src => src.TotalAllowableCompensation)
.Map(dest => dest.AcquisitionFileStatusTypeCode, src => src.FileStatusTypeCode.Id)
.Map(dest => dest.AcqPhysFileStatusTypeCode, src => src.AcquisitionPhysFileStatusTypeCode.Id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,31 @@ public class AcquisitionFileModel : FileWithChecklistModel
/// </summary>
public DateOnly? PossessionDate { get; set; }

/// <summary>
/// get/set - The list of progress statuses for this file.
/// </summary>
public IList<AcquisitionFileProgressStatusesModel> AcquisitionFileProgressStatuses { get; set; }

/// <summary>
/// get/set - The acquisition file appraisal status type.
/// </summary>
public CodeTypeModel<string> AcquisitionFileAppraisalStatusTypeCode { get; set; }

/// <summary>
/// get/set - The acquisition file Legal Survey status type.
/// </summary>
public CodeTypeModel<string> AcquisitionFileLegalSurveyStatusTypeCode { get; set; }

/// <summary>
/// get/set - The list of progress statuses for this file.
/// </summary>
public IList<AcquisitionFileTakingStatusesModel> AcquisitionFileTakingStatuses { get; set; }

/// <summary>
/// get/set - The acquisition file Legal Survey status type.
/// </summary>
public CodeTypeModel<string> AcquisitionFileExpropiationRiskStatusTypeCode { get; set; }

/// <summary>
/// get/set - The acquisition physical file status type.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Mapster;
using Pims.Api.Models.Base;
using Entity = Pims.Dal.Entities;

namespace Pims.Api.Models.Concepts.AcquisitionFile
{
public class AcquisitionFileProgressStatusesMap : IRegister
{
public void Register(TypeAdapterConfig config)
{
config.NewConfig<Entity.PimsAcqFileAcqProgress, AcquisitionFileProgressStatusesModel>()
.Map(dest => dest.Id, src => src.AcqFileAcqProgressId)
.Map(dest => dest.AcquisitionFileId, src => src.AcquisitionFileId)
.Map(dest => dest.ProgressStatusTypeCode, src => src.AcqFileProgessTypeCodeNavigation)
.Inherits<Entity.IBaseAppEntity, BaseAuditModel>();

config.NewConfig<AcquisitionFileProgressStatusesModel, Entity.PimsAcqFileAcqProgress>()
.Map(dest => dest.AcqFileAcqProgressId, src => src.Id)
.Map(dest => dest.AcquisitionFileId, src => src.AcquisitionFileId)
.Map(dest => dest.AcqFileProgessTypeCode, src => src.ProgressStatusTypeCode.Id)
.Inherits<BaseAuditModel, Entity.IBaseAppEntity>();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using Pims.Api.Models.Base;

namespace Pims.Api.Models.Concepts.AcquisitionFile
{
public class AcquisitionFileProgressStatusesModel : BaseAuditModel
{
/// <summary>
/// get/set - AcquisitionFile Progress id.
/// </summary>
public long Id { get; set; }

/// <summary>
/// get/set - Parent Acquisition file id.
/// </summary>
public long AcquisitionFileId { get; set; }

/// <summary>
/// get/set - Progress Status type code.
/// </summary>
public virtual CodeTypeModel<string> ProgressStatusTypeCode { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Mapster;
using Pims.Api.Models.Base;
using Entity = Pims.Dal.Entities;

namespace Pims.Api.Models.Concepts.AcquisitionFile
{
public class AcquisitionFileTakingStatusesMap : IRegister
{
public void Register(TypeAdapterConfig config)
{
config.NewConfig <Entity.PimsAcqFileAcqFlTakeTyp, AcquisitionFileTakingStatusesModel>()
.Map(dest => dest.Id, src => src.AcqFileAcqFlTakeTypeId)
.Map(dest => dest.AcquisitionFileId, src => src.AcquisitionFileId)
.Map(dest => dest.TakingStatusTypeCode, src => src.AcqFileTakeTypeCodeNavigation)
.Inherits<Entity.IBaseAppEntity, BaseAuditModel>();

config.NewConfig<AcquisitionFileTakingStatusesModel, Entity.PimsAcqFileAcqFlTakeTyp>()
.Map(dest => dest.AcqFileAcqFlTakeTypeId, src => src.Id)
.Map(dest => dest.AcquisitionFileId, src => src.AcquisitionFileId)
.Map(dest => dest.AcqFileTakeTypeCode, src => src.TakingStatusTypeCode.Id)
.Inherits<BaseAuditModel, Entity.IBaseAppEntity>();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using Pims.Api.Models.Base;

namespace Pims.Api.Models.Concepts.AcquisitionFile
{
public class AcquisitionFileTakingStatusesModel : BaseAuditModel
{
/// <summary>
/// get/set - AcquisitionFile Taking type id.
/// </summary>
public long Id { get; set; }

/// <summary>
/// get/set - Parent Acquisition file id.
/// </summary>
public long AcquisitionFileId { get; set; }

/// <summary>
/// get/set - Taking type code.
/// </summary>
public virtual CodeTypeModel<string> TakingStatusTypeCode { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,5 @@ public class DocumentQueueModel : BaseAuditModel
/// </summary>
public CodeTypeModel<string> DocumentQueueStatusTypeCode { get; set; }
#endregion
}
}
}
9 changes: 9 additions & 0 deletions source/backend/dal/Repositories/AcquisitionFileRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ public PimsAcquisitionFile GetById(long id)
.Include(r => r.RegionCodeNavigation)
.Include(r => r.AcquisitionFundingTypeCodeNavigation)
.Include(r => r.SubfileInterestTypeCodeNavigation)
.Include(s => s.PimsAcqFileAcqProgresses)
.ThenInclude(p => p.AcqFileProgessTypeCodeNavigation)
.Include(s => s.AcqFileAppraisalTypeCodeNavigation)
.Include(s => s.AcqFileLglSrvyTypeCodeNavigation)
.Include(s => s.PimsAcqFileAcqFlTakeTyps)
.ThenInclude(t => t.AcqFileTakeTypeCodeNavigation)
.Include(s => s.AcqFileExpropRiskTypeCodeNavigation)
.Include(r => r.Project)
.ThenInclude(x => x.WorkActivityCode)
.Include(r => r.Project)
Expand Down Expand Up @@ -730,6 +737,8 @@ public PimsAcquisitionFile Update(PimsAcquisitionFile acquisitionFile)
Context.UpdateChild<PimsAcquisitionFile, long, PimsAcquisitionFileTeam, long>(p => p.PimsAcquisitionFileTeams, acquisitionFile.Internal_Id, acquisitionFile.PimsAcquisitionFileTeams.ToArray());
Context.UpdateChild<PimsAcquisitionFile, long, PimsInterestHolder, long>(p => p.PimsInterestHolders, acquisitionFile.Internal_Id, acquisitionFile.PimsInterestHolders.ToArray());
Context.UpdateGrandchild<PimsAcquisitionFile, long, PimsAcquisitionOwner>(o => o.PimsAcquisitionOwners, oa => oa.Address, acquisitionFile.Internal_Id, acquisitionFile.PimsAcquisitionOwners.ToArray());
Context.UpdateChild<PimsAcquisitionFile, long, PimsAcqFileAcqProgress, long>(p => p.PimsAcqFileAcqProgresses, acquisitionFile.AcquisitionFileId, acquisitionFile.PimsAcqFileAcqProgresses.ToArray());
Context.UpdateChild<PimsAcquisitionFile, long, PimsAcqFileAcqFlTakeTyp, long>(p => p.PimsAcqFileAcqFlTakeTyps, acquisitionFile.AcquisitionFileId, acquisitionFile.PimsAcqFileAcqFlTakeTyps.ToArray());

return acquisitionFile;
}
Expand Down
10 changes: 10 additions & 0 deletions source/backend/dal/Repositories/Interfaces/ILookupRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,5 +159,15 @@ public interface ILookupRepository : IRepository
IEnumerable<PimsConsultationOutcomeType> GetAllConsultationOutcomeTypes();

IEnumerable<PimsSubfileInterestType> GetAllSubfileInterestTypes();

IEnumerable<PimsAcqFileProgessType> GetAllAcquisitionFileProgressStatusTypes();

IEnumerable<PimsAcqFileAppraisalType> GetAllAcquisitionFileAppraisalStatusTypes();

IEnumerable<PimsAcqFileLglSrvyType> GetAllAcquisitionFileLegalSurveyStatusTypes();

IEnumerable<PimsAcqFileTakeType> GetAllAcquisitionFileTakeStatusTypes();

IEnumerable<PimsAcqFileExpropRiskType> GetAllAcquisitionFileExpropiationRiskStatusTypes();
}
}
25 changes: 25 additions & 0 deletions source/backend/dal/Repositories/LookupRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,31 @@ public IEnumerable<PimsSubfileInterestType> GetAllSubfileInterestTypes()
return Context.PimsSubfileInterestTypes.AsNoTracking().OrderBy(a => a.DisplayOrder).ToList();
}

public IEnumerable<PimsAcqFileProgessType> GetAllAcquisitionFileProgressStatusTypes()
{
return Context.PimsAcqFileProgessTypes.AsNoTracking().OrderBy(a => a.DisplayOrder).ToList();
}

public IEnumerable<PimsAcqFileAppraisalType> GetAllAcquisitionFileAppraisalStatusTypes()
{
return Context.PimsAcqFileAppraisalTypes.AsNoTracking().OrderBy(a => a.DisplayOrder).ToList();
}

public IEnumerable<PimsAcqFileLglSrvyType> GetAllAcquisitionFileLegalSurveyStatusTypes()
{
return Context.PimsAcqFileLglSrvyTypes.AsNoTracking().OrderBy(a => a.DisplayOrder).ToList();
}

public IEnumerable<PimsAcqFileTakeType> GetAllAcquisitionFileTakeStatusTypes()
{
return Context.PimsAcqFileTakeTypes.AsNoTracking().OrderBy(a => a.DisplayOrder).ToList();
}

public IEnumerable<PimsAcqFileExpropRiskType> GetAllAcquisitionFileExpropiationRiskStatusTypes()
{
return Context.PimsAcqFileExpropRiskTypes.AsNoTracking().OrderBy(a => a.DisplayOrder).ToList();
}

#endregion
}
}
30 changes: 30 additions & 0 deletions source/backend/entities/Partials/AcquisitionFileAppraisalType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System.ComponentModel.DataAnnotations.Schema;

namespace Pims.Dal.Entities
{
/// <summary>
/// PimsAcqFileAppraisalType class, provides an entity for the datamodel to manage acquisition status types.
/// </summary>
public partial class PimsAcqFileAppraisalType : ITypeEntity<string>
{
/// <summary>
/// get/set - Primary key to identify acquisition file appraisal status type.
/// </summary>
[NotMapped]
public string Id { get => AcqFileAppraisalTypeCode; set => AcqFileAppraisalTypeCode = value; }

/// <summary>
/// Create a new instance of a PimsAcqFileAppraisalType class.
/// </summary>
/// <param name="id"></param>
public PimsAcqFileAppraisalType(string id)
: this()
{
Id = id;
}

public PimsAcqFileAppraisalType()
{
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System.ComponentModel.DataAnnotations.Schema;

namespace Pims.Dal.Entities
{
/// <summary>
/// PimsAcqFileExpropRiskType class, provides an entity for the datamodel to manage acquisition file progress status types.
/// </summary>
public partial class PimsAcqFileExpropRiskType : ITypeEntity<string>
{
/// <summary>
/// get/set - Primary key to identify acquisition file risk type status type.
/// </summary>
[NotMapped]
public string Id { get => AcqFileExpropRiskTypeCode; set => AcqFileExpropRiskTypeCode = value; }

/// <summary>
/// Create a new instance of a PimsAcqFileExpropRiskType class.
/// </summary>
/// <param name="id"></param>
public PimsAcqFileExpropRiskType(string id)
: this()
{
Id = id;
}

public PimsAcqFileExpropRiskType()
{
}
}
}
30 changes: 30 additions & 0 deletions source/backend/entities/Partials/AcquisitionFileLegalSurveyType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System.ComponentModel.DataAnnotations.Schema;

namespace Pims.Dal.Entities
{
/// <summary>
/// PimsAcqFileProgessType class, provides an entity for the datamodel to manage acquisition file legal survey status types.
/// </summary>
public partial class PimsAcqFileLglSrvyType : ITypeEntity<string>
{
/// <summary>
/// get/set - Primary key to identify acquisition file legal survey status type.
/// </summary>
[NotMapped]
public string Id { get => AcqFileLglSrvyTypeCode; set => AcqFileLglSrvyTypeCode = value; }

/// <summary>
/// Create a new instance of a PimsAcqFileProgessType class.
/// </summary>
/// <param name="id"></param>
public PimsAcqFileLglSrvyType(string id)
: this()
{
Id = id;
}

public PimsAcqFileLglSrvyType()
{
}
}
}
30 changes: 30 additions & 0 deletions source/backend/entities/Partials/AcquisitionFileProgressType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System.ComponentModel.DataAnnotations.Schema;

namespace Pims.Dal.Entities
{
/// <summary>
/// PimsAcqFileProgessType class, provides an entity for the datamodel to manage acquisition file progress status types.
/// </summary>
public partial class PimsAcqFileProgessType : ITypeEntity<string>
{
/// <summary>
/// get/set - Primary key to identify acquisition file progress status type.
/// </summary>
[NotMapped]
public string Id { get => AcqFileProgessTypeCode; set => AcqFileProgessTypeCode = value; }

/// <summary>
/// Create a new instance of a PimsAcqFileProgessType class.
/// </summary>
/// <param name="id"></param>
public PimsAcqFileProgessType(string id)
: this()
{
Id = id;
}

public PimsAcqFileProgessType()
{
}
}
}
Loading
Loading