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-8780 scaffold of IS84 #4157

Merged
merged 4 commits into from
Jul 5, 2024
Merged
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
8 changes: 2 additions & 6 deletions source/backend/api/Controllers/LookupController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public IActionResult GetAll()
var takeSiteContamTypes = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllTakeSiteContamTypes());
var landActTypes = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllLandActTypes());
var acqChecklistSectionTypes = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllAcquisitionChecklistSectionTypes());
var acqChecklistItemStatusTypes = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllAcquisitionChecklistItemStatusTypes());
var checklistItemStatusTypes = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllChecklistItemStatusTypes());
var agreementTypes = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllAgreementTypes());
var agreementStatusTypes = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllAgreementStatusTypes());
var interestHolderInterestTypes = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllInterestHolderInterestTypes());
Expand All @@ -143,11 +143,9 @@ public IActionResult GetAll()
var dispositionInitiatingDocTypes = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllDispositionInitiatingDocTypes());
var dispositionTypes = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllDispositionTypes());
var dispositionOfferStatusTypes = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllDispositionOfferStatusTypes());
var dispositionChecklistItemStatusTypes = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllDispositionChecklistItemStatusTypes());
var dispositionChecklistItemTypes = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllDispositionChecklistItemTypes());
var dispositionChecklistSectionTypes = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllDispositionChecklistSectionTypes());
var historicalNumberTypes = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllHistoricalNumberTypes());
var leaseChecklistStatusTypes = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllLeaseChecklistItemStatusTypes());
var leaseChecklistSectionTypes = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllLeaseChecklistSectionTypes());

var codes = new List<object>();
Expand Down Expand Up @@ -203,7 +201,7 @@ public IActionResult GetAll()
codes.AddRange(takeSiteContamTypes);
codes.AddRange(landActTypes);
codes.AddRange(acqChecklistSectionTypes);
codes.AddRange(acqChecklistItemStatusTypes);
codes.AddRange(checklistItemStatusTypes);
codes.AddRange(agreementTypes);
codes.AddRange(agreementStatusTypes);
codes.AddRange(interestHolderInterestTypes);
Expand All @@ -220,11 +218,9 @@ public IActionResult GetAll()
codes.AddRange(dispositionTypes);
codes.AddRange(dispositionStatusTypes);
codes.AddRange(dispositionOfferStatusTypes);
codes.AddRange(dispositionChecklistItemStatusTypes);
codes.AddRange(dispositionChecklistItemTypes);
codes.AddRange(dispositionChecklistSectionTypes);
codes.AddRange(historicalNumberTypes);
codes.AddRange(leaseChecklistStatusTypes);
codes.AddRange(leaseChecklistSectionTypes);

var response = new JsonResult(codes);
Expand Down
10 changes: 5 additions & 5 deletions source/backend/api/Services/AcquisitionFileService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ public PimsAcquisitionFile UpdateChecklistItems(IList<PimsAcquisitionChecklistIt
{
_checklistRepository.Add(incomingItem);
}
else if (existingItem.AcqChklstItemStatusTypeCode != incomingItem.AcqChklstItemStatusTypeCode)
else if (existingItem.ChklstItemStatusTypeCode != incomingItem.ChklstItemStatusTypeCode)
{
_checklistRepository.Update(incomingItem);
}
Expand Down Expand Up @@ -759,7 +759,7 @@ private void PopulateAcquisitionChecklist(PimsAcquisitionFile acquisitionFile)
var checklistItem = new PimsAcquisitionChecklistItem
{
AcqChklstItemTypeCode = itemType.AcqChklstItemTypeCode,
AcqChklstItemStatusTypeCode = "INCOMP",
ChklstItemStatusTypeCode = ChecklistItemStatusTypes.INCOMP.ToString(),
};

acquisitionFile.PimsAcquisitionChecklistItems.Add(checklistItem);
Expand All @@ -773,7 +773,7 @@ private void AppendToAcquisitionChecklist(PimsAcquisitionFile acquisitionFile, r
{
return;
}
var checklistStatusTypes = _lookupRepository.GetAllAcquisitionChecklistItemStatusTypes();
var checklistStatusTypes = _lookupRepository.GetAllChecklistItemStatusTypes();
foreach (var itemType in _checklistRepository.GetAllChecklistItemTypes().Where(x => !x.IsExpiredType()))
{
if (!pimsAcquisitionChecklistItems.Any(cli => cli.AcqChklstItemTypeCode == itemType.AcqChklstItemTypeCode) && DateOnly.FromDateTime(acquisitionFile.AppCreateTimestamp) >= itemType.EffectiveDate)
Expand All @@ -782,9 +782,9 @@ private void AppendToAcquisitionChecklist(PimsAcquisitionFile acquisitionFile, r
{
AcqChklstItemTypeCode = itemType.AcqChklstItemTypeCode,
AcqChklstItemTypeCodeNavigation = itemType,
AcqChklstItemStatusTypeCode = "INCOMP",
ChklstItemStatusTypeCode = ChecklistItemStatusTypes.INCOMP.ToString(),
AcquisitionFileId = acquisitionFile.AcquisitionFileId,
AcqChklstItemStatusTypeCodeNavigation = checklistStatusTypes.FirstOrDefault(cst => cst.Id == "INCOMP"),
ChklstItemStatusTypeCodeNavigation = checklistStatusTypes.FirstOrDefault(cst => cst.Id == ChecklistItemStatusTypes.INCOMP.ToString()),
};

pimsAcquisitionChecklistItems.Add(checklistItem);
Expand Down
8 changes: 4 additions & 4 deletions source/backend/api/Services/DispositionFileService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ public PimsDispositionFile UpdateChecklistItems(IList<PimsDispositionChecklistIt
{
_checklistRepository.Add(incomingItem);
}
else if (existingItem.DspChklstItemStatusTypeCode != incomingItem.DspChklstItemStatusTypeCode)
else if (existingItem.ChklstItemStatusTypeCode != incomingItem.ChklstItemStatusTypeCode)
{
_checklistRepository.Update(incomingItem);
}
Expand Down Expand Up @@ -770,7 +770,7 @@ private void AppendToDispositionChecklist(PimsDispositionFile dispositionFile, r
{
return;
}
var checklistStatusTypes = _lookupRepository.GetAllDispositionChecklistItemStatusTypes();
var checklistStatusTypes = _lookupRepository.GetAllChecklistItemStatusTypes();
foreach (var itemType in _checklistRepository.GetAllChecklistItemTypes().Where(x => !x.IsExpiredType()))
{
if (!pimsDispositionChecklistItems.Any(cli => cli.DspChklstItemTypeCode == itemType.DspChklstItemTypeCode) && DateOnly.FromDateTime(dispositionFile.AppCreateTimestamp) >= itemType.EffectiveDate)
Expand All @@ -779,9 +779,9 @@ private void AppendToDispositionChecklist(PimsDispositionFile dispositionFile, r
{
DspChklstItemTypeCode = itemType.DspChklstItemTypeCode,
DspChklstItemTypeCodeNavigation = itemType,
DspChklstItemStatusTypeCode = "INCOMP",
ChklstItemStatusTypeCode = ChecklistItemStatusTypes.INCOMP.ToString(),
DispositionFileId = dispositionFile.DispositionFileId,
DspChklstItemStatusTypeCodeNavigation = checklistStatusTypes.FirstOrDefault(cst => cst.Id == "INCOMP"),
ChklstItemStatusTypeCodeNavigation = checklistStatusTypes.FirstOrDefault(cst => cst.Id == ChecklistItemStatusTypes.INCOMP.ToString()),
};

pimsDispositionChecklistItems.Add(checklistItem);
Expand Down
10 changes: 5 additions & 5 deletions source/backend/api/Services/LeaseService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ public PimsLease UpdateChecklistItems(long leaseId, IList<PimsLeaseChecklistItem
{
_leaseRepository.AddChecklistItem(incomingItem);
}
else if (existingItem.LeaseChklstItemStatusTypeCode != incomingItem.LeaseChklstItemStatusTypeCode)
else if (existingItem.ChklstItemStatusTypeCode != incomingItem.ChklstItemStatusTypeCode)
{
_leaseRepository.UpdateChecklistItem(incomingItem);
}
Expand Down Expand Up @@ -442,7 +442,7 @@ private List<PimsLeaseChecklistItem> GetActiveChecklistItemsForLease()
PimsLeaseChecklistItem checklistItem = new()
{
LeaseChklstItemTypeCode = itemType.LeaseChklstItemTypeCode,
LeaseChklstItemStatusTypeCode = LeaseChecklistItemStatusTypes.INCOMP.ToString(),
ChklstItemStatusTypeCode = ChecklistItemStatusTypes.INCOMP.ToString(),
};

chklistItems.Add(checklistItem);
Expand All @@ -453,7 +453,7 @@ private List<PimsLeaseChecklistItem> GetActiveChecklistItemsForLease()

private void AppendNewItemsToChecklist(PimsLease lease, ref List<PimsLeaseChecklistItem> pimsLeaseChecklistItems)
{
PimsLeaseChklstItemStatusType incompleteStatusType = _lookupRepository.GetAllLeaseChecklistItemStatusTypes().FirstOrDefault(cst => cst.Id == LeaseChecklistItemStatusTypes.INCOMP.ToString());
PimsChklstItemStatusType incompleteStatusType = _lookupRepository.GetAllChecklistItemStatusTypes().FirstOrDefault(cst => cst.Id == ChecklistItemStatusTypes.INCOMP.ToString());
foreach (var itemType in _leaseRepository.GetAllChecklistItemTypes().Where(x => !x.IsExpiredType() && !x.IsDisabled))
{
if (!pimsLeaseChecklistItems.Any(cli => cli.LeaseChklstItemTypeCode == itemType.LeaseChklstItemTypeCode))
Expand All @@ -462,9 +462,9 @@ private void AppendNewItemsToChecklist(PimsLease lease, ref List<PimsLeaseCheckl
{
LeaseChklstItemTypeCode = itemType.LeaseChklstItemTypeCode,
LeaseChklstItemTypeCodeNavigation = itemType,
LeaseChklstItemStatusTypeCode = incompleteStatusType.Id,
ChklstItemStatusTypeCode = incompleteStatusType.Id,
LeaseId = lease.LeaseId,
LeaseChklstItemStatusTypeCodeNavigation = incompleteStatusType,
ChklstItemStatusTypeCodeNavigation = incompleteStatusType,
};

pimsLeaseChecklistItems.Add(checklistItem);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Pims.Api.Models.CodeTypes
{
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public enum LeaseChecklistItemStatusTypes
public enum ChecklistItemStatusTypes
{
[EnumMember(Value = "COMPLT")]
COMPLT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ public void Register(TypeAdapterConfig config)
.Map(dest => dest.Id, src => src.Internal_Id)
.Map(dest => dest.FileId, src => src.AcquisitionFileId)
.Map(dest => dest.ItemType, src => src.AcqChklstItemTypeCodeNavigation)
.Map(dest => dest.StatusTypeCode, src => src.AcqChklstItemStatusTypeCodeNavigation)
.Map(dest => dest.StatusTypeCode, src => src.ChklstItemStatusTypeCodeNavigation)
.Inherits<Entity.IBaseAppEntity, BaseAuditModel>();

config.NewConfig<FileChecklistItemModel, Entity.PimsAcquisitionChecklistItem>()
.Map(dest => dest.Internal_Id, src => src.Id)
.Map(dest => dest.AcquisitionFileId, src => src.FileId)
.Map(dest => dest.AcqChklstItemTypeCode, src => src.ItemType.Code)
.Map(dest => dest.AcqChklstItemStatusTypeCode, src => src.StatusTypeCode.Id)
.Map(dest => dest.ChklstItemStatusTypeCode, src => src.StatusTypeCode.Id)
.Inherits<BaseAuditModel, Entity.IBaseAppEntity>();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ public void Register(TypeAdapterConfig config)
.Map(dest => dest.Id, src => src.Internal_Id)
.Map(dest => dest.FileId, src => src.DispositionFileId)
.Map(dest => dest.ItemType, src => src.DspChklstItemTypeCodeNavigation)
.Map(dest => dest.StatusTypeCode, src => src.DspChklstItemStatusTypeCodeNavigation)
.Map(dest => dest.StatusTypeCode, src => src.ChklstItemStatusTypeCodeNavigation)
.Inherits<Entity.IBaseAppEntity, BaseAuditModel>();

config.NewConfig<FileChecklistItemModel, Entity.PimsDispositionChecklistItem>()
.Map(dest => dest.Internal_Id, src => src.Id)
.Map(dest => dest.DispositionFileId, src => src.FileId)
.Map(dest => dest.DspChklstItemTypeCode, src => src.ItemType.Code)
.Map(dest => dest.DspChklstItemStatusTypeCode, src => src.StatusTypeCode.Id)
.Map(dest => dest.ChklstItemStatusTypeCode, src => src.StatusTypeCode.Id)
.Inherits<BaseAuditModel, Entity.IBaseAppEntity>();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ public void Register(TypeAdapterConfig config)
.Map(dest => dest.Id, src => src.LeaseChecklistItemId)
.Map(dest => dest.FileId, src => src.LeaseId)
.Map(dest => dest.ItemType, src => src.LeaseChklstItemTypeCodeNavigation)
.Map(dest => dest.StatusTypeCode, src => src.LeaseChklstItemStatusTypeCodeNavigation)
.Map(dest => dest.StatusTypeCode, src => src.ChklstItemStatusTypeCodeNavigation)
.Inherits<Entity.IBaseAppEntity, BaseAuditModel>();

config.NewConfig<FileChecklistItemModel, Entity.PimsLeaseChecklistItem>()
.Map(dest => dest.LeaseChecklistItemId, src => src.Id)
.Map(dest => dest.LeaseId, src => src.FileId)
.Map(dest => dest.LeaseChklstItemTypeCode, src => src.ItemType.Code)
.Map(dest => dest.LeaseChklstItemStatusTypeCode, src => src.StatusTypeCode.Id)
.Map(dest => dest.ChklstItemStatusTypeCode, src => src.StatusTypeCode.Id)
.Inherits<BaseAuditModel, Entity.IBaseAppEntity>();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public void Register(TypeAdapterConfig config)
.Map(dest => dest.PaymentNote, src => src.PaymentNote)
.Map(dest => dest.PaymentDueDateStr, src => src.PaymentDueDate)
.Map(dest => dest.Payments, src => src.PimsLeasePayments)
.Map(dest => dest.IsFlexible, src => src.PeriodDuration)
.Map(dest => dest.IsVariable, src => src.PaymentType)
.Map(dest => dest.IsFlexible, src => src.IsFlexibleDuration)
.Map(dest => dest.IsVariable, src => src.IsVariablePayment)
.Inherits<Entity.IBaseAppEntity, BaseAuditModel>();

config.NewConfig<LeasePeriodModel, Entity.PimsLeasePeriod>()
Expand All @@ -45,8 +45,8 @@ public void Register(TypeAdapterConfig config)
.Map(dest => dest.PaymentNote, src => src.PaymentNote)
.Map(dest => dest.PaymentDueDate, src => src.PaymentDueDateStr)
.Map(dest => dest.PimsLeasePayments, src => src.Payments)
.Map(dest => dest.PeriodDuration, src => src.IsFlexible)
.Map(dest => dest.PaymentType, src => src.IsVariable)
.Map(dest => dest.IsFlexibleDuration, src => src.IsFlexible)
.Map(dest => dest.IsVariablePayment, src => src.IsVariable)
.Inherits<BaseAuditModel, Entity.IBaseAppEntity>();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public List<PimsAcquisitionChecklistItem> GetAllChecklistItemsByAcquisitionFileI

return Context.PimsAcquisitionChecklistItems
.Where(ci => ci.AcquisitionFileId == acquisitionFileId)
.Include(ci => ci.AcqChklstItemStatusTypeCodeNavigation)
.Include(ci => ci.ChklstItemStatusTypeCodeNavigation)
.Include(ci => ci.AcqChklstItemTypeCodeNavigation)
.ThenInclude(it => it.AcqChklstSectionTypeCodeNavigation)
.AsNoTracking()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public List<PimsDispositionChecklistItem> GetAllChecklistItemsByDispositionFileI

return Context.PimsDispositionChecklistItems
.Where(ci => ci.DispositionFileId == dispositionFileId)
.Include(ci => ci.DspChklstItemStatusTypeCodeNavigation)
.Include(ci => ci.ChklstItemStatusTypeCodeNavigation)
.Include(ci => ci.DspChklstItemTypeCodeNavigation)
.ThenInclude(it => it.DspChklstSectionTypeCodeNavigation)
.AsNoTracking()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ public interface ILookupRepository : IRepository

IEnumerable<PimsAcqChklstSectionType> GetAllAcquisitionChecklistSectionTypes();

IEnumerable<PimsAcqChklstItemStatusType> GetAllAcquisitionChecklistItemStatusTypes();

IEnumerable<PimsAgreementType> GetAllAgreementTypes();

IEnumerable<PimsInterestHolderInterestType> GetAllInterestHolderInterestTypes();
Expand Down Expand Up @@ -150,16 +148,14 @@ public interface ILookupRepository : IRepository

IEnumerable<PimsDispositionOfferStatusType> GetAllDispositionOfferStatusTypes();

IEnumerable<PimsDspChklstItemStatusType> GetAllDispositionChecklistItemStatusTypes();
IEnumerable<PimsChklstItemStatusType> GetAllChecklistItemStatusTypes();

IEnumerable<PimsDspChklstItemType> GetAllDispositionChecklistItemTypes();

IEnumerable<PimsDspChklstSectionType> GetAllDispositionChecklistSectionTypes();

IEnumerable<PimsHistoricalFileNumberType> GetAllHistoricalNumberTypes();

IEnumerable<PimsLeaseChklstItemStatusType> GetAllLeaseChecklistItemStatusTypes();

IEnumerable<PimsLeaseChklstSectionType> GetAllLeaseChecklistSectionTypes();
}
}
2 changes: 1 addition & 1 deletion source/backend/dal/Repositories/LeaseRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ public List<PimsLeaseChecklistItem> GetAllChecklistItemsByLeaseId(long leaseId)

return Context.PimsLeaseChecklistItems
.Where(ci => ci.LeaseId == leaseId)
.Include(ci => ci.LeaseChklstItemStatusTypeCodeNavigation)
.Include(ci => ci.ChklstItemStatusTypeCodeNavigation)
.Include(ci => ci.LeaseChklstItemTypeCodeNavigation)
.ThenInclude(it => it.LeaseChklstSectionTypeCodeNavigation)
.AsNoTracking()
Expand Down
Loading
Loading