diff --git a/source/backend/api/Areas/Leases/Models/Lease/AddressModel.cs b/source/backend/api/Areas/Leases/Models/Lease/AddressModel.cs
deleted file mode 100644
index 3c1d8bb170..0000000000
--- a/source/backend/api/Areas/Leases/Models/Lease/AddressModel.cs
+++ /dev/null
@@ -1,101 +0,0 @@
-namespace Pims.Api.Areas.Lease.Models.Lease
-{
- ///
- /// Provides a lease-oriented address model.
- ///
- public class AddressModel
- {
- #region Properties
-
- ///
- /// get/set - The primary key to identify the address.
- ///
- public long Id { get; set; }
-
- ///
- /// get/set - The concurrency row version.
- ///
- public long RowVersion { get; set; }
-
- ///
- /// get/set - Foreign key to the address type.
- ///
- public string AddressTypeId { get; set; }
-
- ///
- /// get/set - The address type description.
- ///
- public string AddressType { get; set; }
-
- ///
- /// get/set - The street address.
- ///
- public string StreetAddress1 { get; set; }
-
- ///
- /// get/set - The street address.
- ///
- public string StreetAddress2 { get; set; }
-
- ///
- /// get/set - The street address.
- ///
- public string StreetAddress3 { get; set; }
-
- ///
- /// get/set - Foreign key to the region.
- ///
- public int? RegionId { get; set; }
-
- ///
- /// get/set - The name of the region.
- ///
- public string Region { get; set; }
-
- ///
- /// get/set - Foreign key to the district.
- ///
- public int? DistrictId { get; set; }
-
- ///
- /// get/set - The name of the district.
- ///
- public string District { get; set; }
-
- ///
- /// get/set - The name of the municipality name.
- ///
- public string Municipality { get; set; }
-
- ///
- /// get/set - Foreign key to the province.
- ///
- public int ProvinceId { get; set; }
-
- ///
- /// get/set - The name of the province.
- ///
- public string Province { get; set; }
-
- ///
- /// get/set - The code name of the province.
- ///
- public string ProvinceCode { get; set; }
-
- ///
- /// get/set - Foreign key to country.
- ///
- public int CountryId { get; set; }
-
- ///
- /// get/set - The name of the country.
- ///
- public string Country { get; set; }
-
- ///
- /// get/set - The postal code.
- ///
- public string Postal { get; set; }
- #endregion
- }
-}
diff --git a/source/backend/api/Areas/Leases/Models/Lease/InsuranceModel.cs b/source/backend/api/Areas/Leases/Models/Lease/InsuranceModel.cs
deleted file mode 100644
index 74176cca96..0000000000
--- a/source/backend/api/Areas/Leases/Models/Lease/InsuranceModel.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-using System;
-using Pims.Api.Models;
-
-namespace Pims.Api.Areas.Lease.Models.Lease
-{
- ///
- /// Provides a lease-oriented insurance model.
- ///
- public class InsuranceModel : BaseModel
- {
- ///
- /// get/set - The insurance's Id.
- ///
- public long Id { get; set; }
-
- ///
- /// get/set - The insurance's type.
- ///
- public TypeModel InsuranceType { get; set; }
-
- ///
- /// get/set - The insurance's other insurance type.
- ///
- public string OtherInsuranceType { get; set; }
-
- ///
- /// get/set - The insurance's coverage description.
- ///
- public string CoverageDescription { get; set; }
-
- ///
- /// get/set - The insurance's coverage limit.
- ///
- public decimal? CoverageLimit { get; set; }
-
- ///
- /// get/set - The insurance's expiry date.
- ///
- public DateTime? ExpiryDate { get; set; }
-
- ///
- /// get/set - The insurance's is in place flag indicator.
- ///
- public bool IsInsuranceInPlace { get; set; }
- }
-}
diff --git a/source/backend/api/Areas/Leases/Models/Lease/PropertyImprovementModel.cs b/source/backend/api/Areas/Leases/Models/Lease/PropertyImprovementModel.cs
deleted file mode 100644
index 7143abb553..0000000000
--- a/source/backend/api/Areas/Leases/Models/Lease/PropertyImprovementModel.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-namespace Pims.Api.Areas.Lease.Models.Lease
-{
- ///
- /// PropertyImprovementModel class, provides lease-oriented property improvements.
- ///
- public class PropertyImprovementModel
- {
- #region PropertyImprovement
-
- ///
- /// get/set - The primary key to identify the property improvement.
- ///
- public long Id { get; set; }
-
- ///
- /// get/set - The id of the parent lease.
- ///
- public long LeaseId { get; set; }
-
- ///
- /// get/set - The concurrency row version.
- ///
- public long RowVersion { get; set; }
-
- ///
- /// get/set - Foreign key to the property improvement type.
- ///
- public string PropertyImprovementTypeId { get; set; }
-
- ///
- /// get/set - The property improvement type.
- ///
- public string PropertyImprovementType { get; set; }
-
- ///
- /// get/set - The improvement description.
- ///
- public string Description { get; set; }
-
- ///
- /// get/set - The size of the structure of the improvement.
- ///
- public string StructureSize { get; set; }
-
- ///
- /// get/set - Notes related to any address within the improvement.
- ///
- public string Address { get; set; }
- #endregion
- }
-}
diff --git a/source/backend/api/Areas/Leases/Models/Lease/PropertyModel.cs b/source/backend/api/Areas/Leases/Models/Lease/PropertyModel.cs
deleted file mode 100644
index 95e7da28a9..0000000000
--- a/source/backend/api/Areas/Leases/Models/Lease/PropertyModel.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-using Pims.Api.Models;
-
-namespace Pims.Api.Areas.Lease.Models.Lease
-{
- ///
- /// PropertyModel class, provides a lease-oriented property model.
- ///
- public class PropertyModel
- {
- #region Properties
- #region Identification
-
- ///
- /// get/set - The primary key to identify the property.
- ///
- public long Id { get; set; }
-
- ///
- /// get/set - The concurrency row version.
- ///
- public long RowVersion { get; set; }
-
- ///
- /// get/set - The property name.
- ///
- public string Name { get; set; }
-
- ///
- /// get/set - The descriptive name.
- ///
- public string PropertyName { get; set; }
-
- ///
- /// get/set - The legal description.
- ///
- public string LegalDescription { get; set; }
-
- ///
- /// get/set - The property description.
- ///
- public string Description { get; set; }
-
- ///
- /// get/set - Area unit type.
- ///
- public TypeModel AreaUnitType { get; set; }
-
- ///
- /// get/set - The land area of the property.
- ///
- public float? LandArea { get; set; }
-
- ///
- /// get/set - The property address.
- ///
- public AddressModel Address { get; set; }
-
- ///
- /// get/set - Whether the property is sensitive data.
- ///
- public bool IsSensitive { get; set; }
-
- ///
- /// get/set - A surplus declarations for the property.
- ///
- public SurplusDeclarationModel SurplusDeclaration { get; set; }
- #endregion
-
- #region Parcel Properties
-
- ///
- /// get/set - A unique identifier for the titled parcel.
- ///
- public string PID { get; set; }
-
- ///
- /// get/set - A unique identifier for an untitled parcel.
- ///
- public string PIN { get; set; }
-
- ///
- /// get/set - Latitude of untitled parcel.
- ///
- public double Latitude { get; set; }
-
- ///
- /// get/set - Longitude of untitled parcel.
- ///
- public double Longitude { get; set; }
- #endregion
- #endregion
- }
-}
diff --git a/source/backend/api/Areas/Leases/Models/Lease/RegionModel.cs b/source/backend/api/Areas/Leases/Models/Lease/RegionModel.cs
deleted file mode 100644
index 3267838b37..0000000000
--- a/source/backend/api/Areas/Leases/Models/Lease/RegionModel.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using Pims.Api.Models;
-
-namespace Pims.Api.Areas.Lease.Models.Lease
-{
- ///
- /// Provides a lease-oriented insurance model.
- ///
- public class RegionModel : BaseModel
- {
- ///
- /// get/set - The region code.
- ///
- public short RegionCode { get; set; }
-
- ///
- /// get/set - The region Name.
- ///
- public string RegionName { get; set; }
- }
-}
diff --git a/source/backend/api/Areas/Leases/Models/Lease/SurplusDeclarationModel.cs b/source/backend/api/Areas/Leases/Models/Lease/SurplusDeclarationModel.cs
deleted file mode 100644
index 3cdfad7d4f..0000000000
--- a/source/backend/api/Areas/Leases/Models/Lease/SurplusDeclarationModel.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using System;
-using Pims.Api.Models;
-
-namespace Pims.Api.Areas.Lease.Models.Lease
-{
- ///
- /// Provides a lease-property-oriented surplus declaration model.
- ///
- public class SurplusDeclarationModel
- {
- #region SurplusDeclaration
-
- ///
- /// get/set - The surplus declaration date.
- ///
- public DateTime? Date { get; set; }
-
- ///
- /// get/set - Surplus declaration type.
- ///
- public TypeModel Type { get; set; }
-
- ///
- /// get/set - Surplus declaration comment.
- ///
- public string Comment { get; set; }
- #endregion
- }
-}
diff --git a/source/backend/api/Areas/Leases/Models/Search/LeaseFilterModel.cs b/source/backend/api/Areas/Leases/Models/Search/LeaseFilterModel.cs
index 4795101b46..8671582b0c 100644
--- a/source/backend/api/Areas/Leases/Models/Search/LeaseFilterModel.cs
+++ b/source/backend/api/Areas/Leases/Models/Search/LeaseFilterModel.cs
@@ -47,12 +47,12 @@ public class LeaseFilterModel : PageFilter
///
/// get/set - The expiry filter start date.
///
- public DateTime? ExpiryStartDate { get; set; }
+ public DateOnly? ExpiryStartDate { get; set; }
///
/// get/set - The expiry filter end date.
///
- public DateTime? ExpiryEndDate { get; set; }
+ public DateOnly? ExpiryEndDate { get; set; }
///
/// get/set - The region type.
@@ -91,8 +91,8 @@ public LeaseFilterModel(Dictionary()
.Map(dest => dest.Id, src => src.LeaseId)
.Map(dest => dest.LFileNo, src => src.LFileNo)
- .Map(dest => dest.ExpiryDate, src => src.GetExpiryDate())
+ .Map(dest => dest.ExpiryDate, src => src.GetExpiryDate().ToNullableDateOnly())
.Map(dest => dest.ProgramName, src => src.GetProgramName())
.Map(dest => dest.TenantNames, src => src.PimsLeaseTenants.Select(t => t.GetTenantName()))
.Map(dest => dest.Properties, src => src.GetProperties())
diff --git a/source/backend/api/Areas/Leases/Models/Search/LeaseModel.cs b/source/backend/api/Areas/Leases/Models/Search/LeaseModel.cs
index 53c433e018..1b7b7f86b0 100644
--- a/source/backend/api/Areas/Leases/Models/Search/LeaseModel.cs
+++ b/source/backend/api/Areas/Leases/Models/Search/LeaseModel.cs
@@ -21,7 +21,7 @@ public class LeaseModel
///
/// get/set - The expiry date time.
///
- public DateTime? ExpiryDate { get; set; }
+ public DateOnly? ExpiryDate { get; set; }
///
/// get/set - The value of the program name.
diff --git a/source/backend/api/Areas/Reports/Mapping/Lease/LeaseMap.cs b/source/backend/api/Areas/Reports/Mapping/Lease/LeaseMap.cs
index 0c18e83e7e..bc0eac6126 100644
--- a/source/backend/api/Areas/Reports/Mapping/Lease/LeaseMap.cs
+++ b/source/backend/api/Areas/Reports/Mapping/Lease/LeaseMap.cs
@@ -22,10 +22,10 @@ private static void MapLease((Entity.PimsLeaseTerm term, Entity.PimsLease lease,
{
dest.LFileNo = src.lease.LFileNo;
dest.MotiRegion = src.lease.RegionCodeNavigation?.RegionName;
- dest.StartDate = src.lease.OrigStartDate.FilterSqlMinDate();
- dest.EndDate = src.lease.OrigExpiryDate?.FilterSqlMinDate();
- dest.CurrentTermStartDate = src.lease.GetCurrentTermStartDate()?.FilterSqlMinDate();
- dest.CurrentTermEndDate = src.lease.GetCurrentTermEndDate()?.FilterSqlMinDate();
+ dest.StartDate = src.lease.OrigStartDate.FilterSqlMinDate().ToNullableDateOnly();
+ dest.EndDate = src.lease.OrigExpiryDate?.FilterSqlMinDate().ToNullableDateOnly();
+ dest.CurrentTermStartDate = src.lease.GetCurrentTermStartDate()?.FilterSqlMinDate().ToNullableDateOnly();
+ dest.CurrentTermEndDate = src.lease.GetCurrentTermEndDate()?.FilterSqlMinDate().ToNullableDateOnly();
dest.ProgramName = src.lease.LeaseProgramTypeCodeNavigation?.GetTypeDescriptionOther(src.lease.OtherLeaseProgramType);
dest.PurposeType = src.lease.LeasePurposeTypeCodeNavigation?.GetTypeDescriptionOther(src.lease.OtherLeasePurposeType);
dest.StatusType = src.lease.LeaseStatusTypeCodeNavigation?.Description;
@@ -38,9 +38,9 @@ private static void MapLease((Entity.PimsLeaseTerm term, Entity.PimsLease lease,
dest.LeaseNotes = src.lease.LeaseNotes;
dest.IsExpired = (src.lease.GetExpiryDate() < DateTime.Now).BoolToYesNo();
dest.LeaseAmount = src.term?.PaymentAmount;
- dest.TermStartDate = src.term?.TermStartDate.FilterSqlMinDate();
- dest.TermExpiryDate = src.term?.TermExpiryDate?.FilterSqlMinDate();
- dest.TermRenewalDate = src.term?.TermRenewalDate?.FilterSqlMinDate();
+ dest.TermStartDate = src.term?.TermStartDate.FilterSqlMinDate().ToNullableDateOnly();
+ dest.TermExpiryDate = src.term?.TermExpiryDate?.FilterSqlMinDate().ToNullableDateOnly();
+ dest.TermRenewalDate = src.term?.TermRenewalDate?.FilterSqlMinDate().ToNullableDateOnly();
dest.LeasePaymentFrequencyType = src.term?.LeasePmtFreqTypeCodeNavigation?.Description;
dest.CivicAddress = src.property?.Property?.Address?.FormatAddress(true);
dest.Pid = src.property?.Property?.Pid;
diff --git a/source/backend/api/Areas/Reports/Models/Lease/LeaseModel.cs b/source/backend/api/Areas/Reports/Models/Lease/LeaseModel.cs
index aff9504de1..57637c6589 100644
--- a/source/backend/api/Areas/Reports/Models/Lease/LeaseModel.cs
+++ b/source/backend/api/Areas/Reports/Models/Lease/LeaseModel.cs
@@ -19,19 +19,19 @@ public class LeaseModel
[DisplayName("Start Date")]
[CsvHelper.Configuration.Attributes.Name("Start Date")]
- public DateTime? StartDate { get; set; }
+ public DateOnly? StartDate { get; set; }
[DisplayName("End Date")]
[CsvHelper.Configuration.Attributes.Name("End Date")]
- public DateTime? EndDate { get; set; }
+ public DateOnly? EndDate { get; set; }
[DisplayName("Current Term Start Date")]
[CsvHelper.Configuration.Attributes.Name("Current Term Start Date")]
- public DateTime? CurrentTermStartDate { get; set; }
+ public DateOnly? CurrentTermStartDate { get; set; }
[DisplayName("Current Term End Date")]
[CsvHelper.Configuration.Attributes.Name("Current Term End Date")]
- public DateTime? CurrentTermEndDate { get; set; }
+ public DateOnly? CurrentTermEndDate { get; set; }
[DisplayName("Tenant")]
[CsvHelper.Configuration.Attributes.Name("Tenant")]
@@ -79,15 +79,15 @@ public class LeaseModel
[DisplayName("Term Start Date")]
[CsvHelper.Configuration.Attributes.Name("Term Start Date")]
- public DateTime? TermStartDate { get; set; }
+ public DateOnly? TermStartDate { get; set; }
[DisplayName("Term Renewal Date")]
[CsvHelper.Configuration.Attributes.Name("Term Renewal Date")]
- public DateTime? TermRenewalDate { get; set; }
+ public DateOnly? TermRenewalDate { get; set; }
[DisplayName("Term Expiry Date")]
[CsvHelper.Configuration.Attributes.Name("Term Expiry Date")]
- public DateTime? TermExpiryDate { get; set; }
+ public DateOnly? TermExpiryDate { get; set; }
[DisplayName("Lease Payment Frequency")]
[CsvHelper.Configuration.Attributes.Name("Lease Payment Frequency")]
diff --git a/source/backend/api/Models/Concepts/Lease/InsuranceMap.cs b/source/backend/api/Models/Concepts/Lease/InsuranceMap.cs
index f813fdc577..44d18bd9bd 100644
--- a/source/backend/api/Models/Concepts/Lease/InsuranceMap.cs
+++ b/source/backend/api/Models/Concepts/Lease/InsuranceMap.cs
@@ -1,4 +1,5 @@
using Mapster;
+using Pims.Core.Extensions;
using Entity = Pims.Dal.Entities;
namespace Pims.Api.Models.Concepts
@@ -14,7 +15,7 @@ public void Register(TypeAdapterConfig config)
.Map(dest => dest.OtherInsuranceType, src => src.OtherInsuranceType)
.Map(dest => dest.CoverageDescription, src => src.CoverageDescription)
.Map(dest => dest.CoverageLimit, src => src.CoverageLimit)
- .Map(dest => dest.ExpiryDate, src => src.ExpiryDate)
+ .Map(dest => dest.ExpiryDate, src => src.ExpiryDate.ToNullableDateOnly())
.Map(dest => dest.IsInsuranceInPlace, src => src.IsInsuranceInPlace)
.Inherits();
@@ -25,7 +26,7 @@ public void Register(TypeAdapterConfig config)
.Map(dest => dest.OtherInsuranceType, src => src.OtherInsuranceType)
.Map(dest => dest.CoverageDescription, src => src.CoverageDescription)
.Map(dest => dest.CoverageLimit, src => src.CoverageLimit)
- .Map(dest => dest.ExpiryDate, src => src.ExpiryDate)
+ .Map(dest => dest.ExpiryDate, src => src.ExpiryDate.ToNullableDateTime())
.Map(dest => dest.IsInsuranceInPlace, src => src.IsInsuranceInPlace)
.Inherits();
}
diff --git a/source/backend/api/Models/Concepts/Lease/InsuranceModel.cs b/source/backend/api/Models/Concepts/Lease/InsuranceModel.cs
index 6fb799b97a..db574040fc 100644
--- a/source/backend/api/Models/Concepts/Lease/InsuranceModel.cs
+++ b/source/backend/api/Models/Concepts/Lease/InsuranceModel.cs
@@ -40,7 +40,7 @@ public class InsuranceModel : BaseAppModel
///
/// get/set - The insurance's expiry date.
///
- public DateTime? ExpiryDate { get; set; }
+ public DateOnly? ExpiryDate { get; set; }
///
/// get/set - The insurance's is in place flag indicator.
diff --git a/source/backend/api/Models/Concepts/Lease/LeaseMap.cs b/source/backend/api/Models/Concepts/Lease/LeaseMap.cs
index 062ae90fc1..7ca8c20fa6 100644
--- a/source/backend/api/Models/Concepts/Lease/LeaseMap.cs
+++ b/source/backend/api/Models/Concepts/Lease/LeaseMap.cs
@@ -37,7 +37,7 @@ public void Register(TypeAdapterConfig config)
.Map(dest => dest.PurposeType, src => src.LeasePurposeTypeCodeNavigation)
.Map(dest => dest.StatusType, src => src.LeaseStatusTypeCodeNavigation)
.Map(dest => dest.ResponsibilityType, src => src.LeaseResponsibilityTypeCodeNavigation)
- .Map(dest => dest.ResponsibilityEffectiveDate, src => src.ResponsibilityEffectiveDate)
+ .Map(dest => dest.ResponsibilityEffectiveDate, src => src.ResponsibilityEffectiveDate.ToNullableDateOnly())
.Map(dest => dest.DocumentationReference, src => src.DocumentationReference)
.Map(dest => dest.Note, src => src.LeaseNotes)
.Map(dest => dest.Description, src => src.LeaseDescription)
@@ -69,7 +69,7 @@ public void Register(TypeAdapterConfig config)
.Map(dest => dest.LeasePurposeOtherDesc, src => src.OtherPurposeType)
.Map(dest => dest.OtherLeaseLicenseType, src => src.OtherType)
.Map(dest => dest.OrigExpiryDate, src => src.ExpiryDate.ToNullableDateTime())
- .Map(dest => dest.OrigStartDate, src => src.StartDate.ToNullableDateTime())
+ .Map(dest => dest.OrigStartDate, src => src.StartDate.ToDateTime(TimeOnly.MinValue))
.Map(dest => dest.RegionCode, src => src.Region.Id)
.Map(dest => dest.LeaseProgramTypeCode, src => src.ProgramType.GetTypeId())
.Map(dest => dest.LeasePayRvblTypeCode, src => src.PaymentReceivableType.GetTypeId())
@@ -79,7 +79,7 @@ public void Register(TypeAdapterConfig config)
.Map(dest => dest.LeasePurposeTypeCode, src => src.PurposeType.GetTypeId())
.Map(dest => dest.LeaseResponsibilityTypeCode, src => src.ResponsibilityType.GetTypeId())
.Map(dest => dest.LeaseStatusTypeCode, src => src.StatusType.GetTypeId())
- .Map(dest => dest.ResponsibilityEffectiveDate, src => src.ResponsibilityEffectiveDate)
+ .Map(dest => dest.ResponsibilityEffectiveDate, src => src.ResponsibilityEffectiveDate.ToNullableDateTime())
.Map(dest => dest.DocumentationReference, src => src.DocumentationReference)
.Map(dest => dest.LeaseNotes, src => src.Note)
.Map(dest => dest.LeaseDescription, src => src.Description)
diff --git a/source/backend/api/Models/Concepts/Lease/LeaseModel.cs b/source/backend/api/Models/Concepts/Lease/LeaseModel.cs
index b10d73f598..ae81ca2ecd 100644
--- a/source/backend/api/Models/Concepts/Lease/LeaseModel.cs
+++ b/source/backend/api/Models/Concepts/Lease/LeaseModel.cs
@@ -99,7 +99,7 @@ public class LeaseModel : BaseAppModel
///
/// get/set - The original start date of the lease.
///
- public DateOnly? StartDate { get; set; }
+ public DateOnly StartDate { get; set; }
///
/// get/set - The most recent renewal date on the lease.
@@ -164,7 +164,7 @@ public class LeaseModel : BaseAppModel
///
/// get/set - The date this entity assumed responsibility for this lease.
///
- public DateTime? ResponsibilityEffectiveDate { get; set; }
+ public DateOnly? ResponsibilityEffectiveDate { get; set; }
///
/// get/set - A list of properties associated with this lease.
diff --git a/source/backend/api/Models/Concepts/Property/PropertyActivityMap.cs b/source/backend/api/Models/Concepts/Property/PropertyActivityMap.cs
index beb677936c..6c87ad42a2 100644
--- a/source/backend/api/Models/Concepts/Property/PropertyActivityMap.cs
+++ b/source/backend/api/Models/Concepts/Property/PropertyActivityMap.cs
@@ -1,4 +1,6 @@
+using System;
using Mapster;
+using Pims.Core.Extensions;
using Entity = Pims.Dal.Entities;
namespace Pims.Api.Models.Concepts
@@ -12,8 +14,8 @@ public void Register(TypeAdapterConfig config)
.Map(dest => dest.ActivityTypeCode, src => src.PropMgmtActivityTypeCodeNavigation)
.Map(dest => dest.ActivitySubtypeCode, src => src.PropMgmtActivitySubtypeCodeNavigation)
.Map(dest => dest.ActivityStatusTypeCode, src => src.PropMgmtActivityStatusTypeCodeNavigation)
- .Map(dest => dest.RequestAddedDateTime, src => src.RequestAddedDt)
- .Map(dest => dest.CompletionDateTime, src => src.CompletionDt)
+ .Map(dest => dest.RequestAddedDateTime, src => DateOnly.FromDateTime(src.RequestAddedDt))
+ .Map(dest => dest.CompletionDateTime, src => src.CompletionDt.ToNullableDateOnly())
.Map(dest => dest.Description, src => src.Description)
.Map(dest => dest.RequestSource, src => src.RequestSource)
.Map(dest => dest.PretaxAmt, src => src.PretaxAmt)
@@ -36,8 +38,8 @@ public void Register(TypeAdapterConfig config)
.Map(dest => dest.PropMgmtActivityTypeCode, src => src.ActivityTypeCode.Id)
.Map(dest => dest.PropMgmtActivitySubtypeCode, src => src.ActivitySubtypeCode.Id)
.Map(dest => dest.PropMgmtActivityStatusTypeCode, src => src.ActivityStatusTypeCode.Id)
- .Map(dest => dest.RequestAddedDt, src => src.RequestAddedDateTime)
- .Map(dest => dest.CompletionDt, src => src.CompletionDateTime)
+ .Map(dest => dest.RequestAddedDt, src => src.RequestAddedDateTime.ToDateTime(TimeOnly.MinValue))
+ .Map(dest => dest.CompletionDt, src => src.CompletionDateTime.ToNullableDateTime())
.Map(dest => dest.Description, src => src.Description)
.Map(dest => dest.RequestSource, src => src.RequestSource)
.Map(dest => dest.PretaxAmt, src => src.PretaxAmt)
diff --git a/source/backend/api/Models/Concepts/Property/PropertyActivityModel.cs b/source/backend/api/Models/Concepts/Property/PropertyActivityModel.cs
index f390110056..ca88c77595 100644
--- a/source/backend/api/Models/Concepts/Property/PropertyActivityModel.cs
+++ b/source/backend/api/Models/Concepts/Property/PropertyActivityModel.cs
@@ -15,9 +15,9 @@ public class PropertyActivityModel : BaseAppModel
public TypeModel ActivityStatusTypeCode { get; set; }
- public DateTime RequestAddedDateTime { get; set; }
+ public DateOnly RequestAddedDateTime { get; set; }
- public DateTime? CompletionDateTime { get; set; }
+ public DateOnly? CompletionDateTime { get; set; }
public string Description { get; set; }
diff --git a/source/backend/api/Models/Concepts/Take/TakeMap.cs b/source/backend/api/Models/Concepts/Take/TakeMap.cs
index 41cf623f29..b439cbd2a4 100644
--- a/source/backend/api/Models/Concepts/Take/TakeMap.cs
+++ b/source/backend/api/Models/Concepts/Take/TakeMap.cs
@@ -29,7 +29,7 @@ public void Register(TypeAdapterConfig config)
.Map(dest => dest.IsNewRightOfWay, src => src.IsNewHighwayDedication)
.Map(dest => dest.IsLandAct, src => src.IsNewLandAct)
.Map(dest => dest.IsNewInterestInSrw, src => src.IsNewInterestInSrw)
- .Map(dest => dest.SrwEndDt, src => src.SrwEndDt)
+ .Map(dest => dest.SrwEndDt, src => src.SrwEndDt.ToNullableDateOnly())
.Inherits();
config.NewConfig()
diff --git a/source/backend/api/Models/Concepts/Take/TakeModel.cs b/source/backend/api/Models/Concepts/Take/TakeModel.cs
index f5bad2407f..8f23b7826d 100644
--- a/source/backend/api/Models/Concepts/Take/TakeModel.cs
+++ b/source/backend/api/Models/Concepts/Take/TakeModel.cs
@@ -42,7 +42,7 @@ public class TakeModel : BaseAppModel
public float? StatutoryRightOfWayArea { get; set; }
- public DateTime? SrwEndDt { get; set; }
+ public DateOnly? SrwEndDt { get; set; }
public float? SurplusArea { get; set; }
diff --git a/source/backend/api/Pims.Api.csproj b/source/backend/api/Pims.Api.csproj
index 491d22d2e9..2f7a5da639 100644
--- a/source/backend/api/Pims.Api.csproj
+++ b/source/backend/api/Pims.Api.csproj
@@ -64,4 +64,7 @@
PreserveNewest
+
+
+
\ No newline at end of file
diff --git a/source/backend/api/Services/CompensationRequisitionService.cs b/source/backend/api/Services/CompensationRequisitionService.cs
index 2ee51c3e16..a2a452e9bd 100644
--- a/source/backend/api/Services/CompensationRequisitionService.cs
+++ b/source/backend/api/Services/CompensationRequisitionService.cs
@@ -61,7 +61,7 @@ public PimsCompensationRequisition Update(PimsCompensationRequisition compensati
CheckDraftStatusUpdateAuthorized(currentCompensation.IsDraft, compensationRequisition.IsDraft);
CheckTotalAllowableCompensation(compensationRequisition.AcquisitionFileId, compensationRequisition);
- compensationRequisition.FinalizedDate = CheckFinalizedDate(currentCompensation.IsDraft, compensationRequisition.IsDraft, currentCompensation.FinalizedDate);
+ compensationRequisition.FinalizedDate = CheckFinalizedDate(currentCompensation.IsDraft, compensationRequisition.IsDraft, currentCompensation.FinalizedDate.ToNullableDateOnly()).ToNullableDateTime();
PimsCompensationRequisition updatedEntity = _compensationRequisitionRepository.Update(compensationRequisition);
AddNoteIfStatusChanged(compensationRequisition.Internal_Id, compensationRequisition.AcquisitionFileId, currentCompensation.IsDraft, compensationRequisition.IsDraft);
@@ -69,7 +69,7 @@ public PimsCompensationRequisition Update(PimsCompensationRequisition compensati
return updatedEntity;
- DateTime? CheckFinalizedDate(bool? currentStatusIsDraft, bool? newStatusIsDraft, DateTime? currentValue)
+ DateOnly? CheckFinalizedDate(bool? currentStatusIsDraft, bool? newStatusIsDraft, DateOnly? currentValue)
{
if (currentStatusIsDraft.Equals(newStatusIsDraft))
{
@@ -78,7 +78,7 @@ public PimsCompensationRequisition Update(PimsCompensationRequisition compensati
if (newStatusIsDraft.HasValue)
{
- return newStatusIsDraft.Value ? null : DateTime.UtcNow;
+ return newStatusIsDraft.Value ? null : DateOnly.FromDateTime(DateTime.UtcNow);
}
return null;
diff --git a/source/backend/core/Extensions/DictionaryExtensions.cs b/source/backend/core/Extensions/DictionaryExtensions.cs
index b1ba2ce6e5..e76b9bcfa2 100644
--- a/source/backend/core/Extensions/DictionaryExtensions.cs
+++ b/source/backend/core/Extensions/DictionaryExtensions.cs
@@ -261,6 +261,18 @@ public static DateTime GetDateTimeValue(this IDictionary
+ /// Get the value from the dictionary for the specified 'key' and return it as an DateTime.
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static DateOnly? GetDateOnlyNullValue(this IDictionary dict, string key, DateOnly? defaultValue = null)
+ {
+ return dict.TryGetValue(key, out Microsoft.Extensions.Primitives.StringValues dValue) && DateOnly.TryParse(dValue, out DateOnly value) ? value : defaultValue;
+ }
+
///
/// Get the value from the dictionary for the specified 'key' and return it as an Enum of type 'T'.
///
diff --git a/source/backend/dal/Helpers/Extensions/LeaseExtensions.cs b/source/backend/dal/Helpers/Extensions/LeaseExtensions.cs
index af9da6293e..39ea1d95cd 100644
--- a/source/backend/dal/Helpers/Extensions/LeaseExtensions.cs
+++ b/source/backend/dal/Helpers/Extensions/LeaseExtensions.cs
@@ -151,6 +151,9 @@ public static string GetTenantName(this Pims.Dal.Entities.PimsLeaseTenant lease)
{
filter.ThrowIfNull(nameof(filter));
+ var filterExpiryStartDate = filter.ExpiryStartDate.ToNullableDateTime();
+ var filterExpiryEndDate = filter.ExpiryEndDate.ToNullableDateTime();
+
query = query.Where(l => !l.RegionCode.HasValue || regions.Contains(l.RegionCode.Value));
if (!string.IsNullOrWhiteSpace(filter.TenantName))
@@ -220,15 +223,15 @@ public static string GetTenantName(this Pims.Dal.Entities.PimsLeaseTenant lease)
if (filter.ExpiryStartDate != null && filter.ExpiryEndDate != null)
{
- query = query.Where(l => l.OrigExpiryDate >= filter.ExpiryStartDate && l.OrigExpiryDate <= filter.ExpiryEndDate);
+ query = query.Where(l => l.OrigExpiryDate >= filterExpiryStartDate && l.OrigExpiryDate <= filterExpiryEndDate);
}
else if (filter.ExpiryStartDate != null)
{
- query = query.Where(l => l.OrigExpiryDate >= filter.ExpiryStartDate);
+ query = query.Where(l => l.OrigExpiryDate >= filterExpiryStartDate);
}
else if (filter.ExpiryEndDate != null)
{
- query = query.Where(l => l.OrigExpiryDate <= filter.ExpiryEndDate);
+ query = query.Where(l => l.OrigExpiryDate <= filterExpiryEndDate);
}
if (filter.RegionType.HasValue)
diff --git a/source/backend/dal/Models/LeaseFilter.cs b/source/backend/dal/Models/LeaseFilter.cs
index 83a2841ee8..5ca7c0ce13 100644
--- a/source/backend/dal/Models/LeaseFilter.cs
+++ b/source/backend/dal/Models/LeaseFilter.cs
@@ -68,12 +68,12 @@ public class LeaseFilter : PageFilter
///
/// get/set - The expiry filter start date.
///
- public DateTime? ExpiryStartDate { get; set; }
+ public DateOnly? ExpiryStartDate { get; set; }
///
/// get/set - The expiry filter end date.
///
- public DateTime? ExpiryEndDate { get; set; }
+ public DateOnly? ExpiryEndDate { get; set; }
public LeaseFilter(string lFileNo, string tenantName, string pinOrPid, string historical, string[] sort)
{
diff --git a/source/backend/tests/unit/api/Controllers/Leases/LeaseControllerTest.cs b/source/backend/tests/unit/api/Controllers/Leases/LeaseControllerTest.cs
index 6a56bd0c4b..4a2b531fd2 100644
--- a/source/backend/tests/unit/api/Controllers/Leases/LeaseControllerTest.cs
+++ b/source/backend/tests/unit/api/Controllers/Leases/LeaseControllerTest.cs
@@ -16,7 +16,6 @@
using Pims.Dal.Repositories;
using Pims.Dal.Security;
using Xunit;
-using Model = Pims.Api.Areas.Lease.Models.Lease;
namespace Pims.Api.Test.Controllers.Lease
{
diff --git a/source/backend/tests/unit/api/Controllers/Leases/LeaseImprovementControllerTest.cs b/source/backend/tests/unit/api/Controllers/Leases/LeaseImprovementControllerTest.cs
index f0d69fce9c..4f56f38f8f 100644
--- a/source/backend/tests/unit/api/Controllers/Leases/LeaseImprovementControllerTest.cs
+++ b/source/backend/tests/unit/api/Controllers/Leases/LeaseImprovementControllerTest.cs
@@ -7,7 +7,6 @@
using Moq;
using Pims.Api.Areas.Acquisition.Controllers;
using Pims.Api.Areas.Lease.Controllers;
-using Pims.Api.Areas.Lease.Models.Lease;
using Pims.Api.Services;
using Pims.Core.Test;
using Pims.Dal;
diff --git a/source/backend/tests/unit/api/Controllers/Leases/LeasePaymentControllerTest.cs b/source/backend/tests/unit/api/Controllers/Leases/LeasePaymentControllerTest.cs
index 6d3737d593..c20e0c80b1 100644
--- a/source/backend/tests/unit/api/Controllers/Leases/LeasePaymentControllerTest.cs
+++ b/source/backend/tests/unit/api/Controllers/Leases/LeasePaymentControllerTest.cs
@@ -13,7 +13,6 @@
using Pims.Dal.Security;
using Pims.Dal.Services;
using Xunit;
-using Model = Pims.Api.Areas.Lease.Models.Lease;
namespace Pims.Api.Test.Controllers.Lease
{
diff --git a/source/backend/tests/unit/api/Controllers/Leases/LeaseTenantControllerTest.cs b/source/backend/tests/unit/api/Controllers/Leases/LeaseTenantControllerTest.cs
index 1ef41944c3..19df6e23d0 100644
--- a/source/backend/tests/unit/api/Controllers/Leases/LeaseTenantControllerTest.cs
+++ b/source/backend/tests/unit/api/Controllers/Leases/LeaseTenantControllerTest.cs
@@ -12,7 +12,6 @@
using Pims.Dal.Repositories;
using Pims.Dal.Security;
using Xunit;
-using Model = Pims.Api.Areas.Lease.Models.Lease;
namespace Pims.Api.Test.Controllers.Lease
{
diff --git a/source/backend/tests/unit/api/Controllers/Leases/LeaseTermControllerTest.cs b/source/backend/tests/unit/api/Controllers/Leases/LeaseTermControllerTest.cs
index 374be21255..1db7970cfa 100644
--- a/source/backend/tests/unit/api/Controllers/Leases/LeaseTermControllerTest.cs
+++ b/source/backend/tests/unit/api/Controllers/Leases/LeaseTermControllerTest.cs
@@ -13,7 +13,6 @@
using Pims.Dal.Security;
using Pims.Dal.Services;
using Xunit;
-using Model = Pims.Api.Areas.Lease.Models.Lease;
namespace Pims.Api.Test.Controllers.Lease
{
diff --git a/source/backend/tests/unit/api/Controllers/Reports/LeaseControllerTest.cs b/source/backend/tests/unit/api/Controllers/Reports/LeaseControllerTest.cs
index 26e57c1568..60b3aae7ef 100644
--- a/source/backend/tests/unit/api/Controllers/Reports/LeaseControllerTest.cs
+++ b/source/backend/tests/unit/api/Controllers/Reports/LeaseControllerTest.cs
@@ -13,6 +13,7 @@
using Pims.Api.Helpers.Constants;
using Pims.Api.Helpers.Exceptions;
using Pims.Api.Services;
+using Pims.Core.Extensions;
using Pims.Core.Test;
using Pims.Dal;
using Pims.Dal.Entities;
@@ -153,7 +154,7 @@ public void ExportLeases_Lease_Mapping()
this._leaseService.Verify(m => m.GetPage(It.IsAny(), false), Times.Once());
result.MotiRegion.Should().Be("region");
result.LFileNo.Should().Be("L-010-070");
- result.StartDate.Should().Be(new DateTime(2000, 1, 1));
+ result.StartDate.Should().Be(new DateOnly(2000, 1, 1));
result.ProgramName.Should().Be("otherprogramdesc - program");
result.StatusType.Should().Be("status");
result.PurposeType.Should().Be("otherpurposedesc - purpose");
@@ -190,11 +191,11 @@ public void ExportLeases_LeaseTerm_Mapping()
// Assert
this._leaseService.Verify(m => m.GetPage(It.IsAny(), false), Times.Once());
- result.CurrentTermStartDate.Should().Be(leaseTerm.TermStartDate);
- result.CurrentTermEndDate.Should().Be(leaseTerm.TermExpiryDate);
- result.TermStartDate.Should().Be(leaseTerm.TermStartDate);
- result.TermRenewalDate.Should().Be(leaseTerm.TermRenewalDate);
- result.TermExpiryDate.Should().Be(leaseTerm.TermExpiryDate);
+ result.CurrentTermStartDate.Should().Be(DateOnly.FromDateTime(leaseTerm.TermStartDate));
+ result.CurrentTermEndDate.Should().Be(leaseTerm.TermExpiryDate.ToNullableDateOnly());
+ result.TermStartDate.Should().Be(DateOnly.FromDateTime(leaseTerm.TermStartDate));
+ result.TermRenewalDate.Should().Be(leaseTerm.TermRenewalDate.ToNullableDateOnly());
+ result.TermExpiryDate.Should().Be(leaseTerm.TermExpiryDate.ToNullableDateOnly());
result.IsExpired.Should().Be("No");
result.LeasePaymentFrequencyType.Should().Be("pmt");
result.LeaseAmount.Should().Be(1000);
diff --git a/source/frontend/src/features/mapSideBar/property/tabs/propertyDetailsManagement/activity/detail/PropertyActivityDetailView.tsx b/source/frontend/src/features/mapSideBar/property/tabs/propertyDetailsManagement/activity/detail/PropertyActivityDetailView.tsx
index 250ead36a4..77391c5fd7 100644
--- a/source/frontend/src/features/mapSideBar/property/tabs/propertyDetailsManagement/activity/detail/PropertyActivityDetailView.tsx
+++ b/source/frontend/src/features/mapSideBar/property/tabs/propertyDetailsManagement/activity/detail/PropertyActivityDetailView.tsx
@@ -87,10 +87,10 @@ export const PropertyActivityDetailView: React.FunctionComponent<
{props.activity.activityStatusTypeCode?.description}
- {prettyFormatDate(props.activity.requestAddedDateTime)}
+ {prettyFormatDate(props.activity.requestAddedDateOnly)}
- {prettyFormatDate(props.activity.completionDateTime)}
+ {prettyFormatDate(props.activity.completionDateOnly)}
{props.activity.description}
diff --git a/source/frontend/src/features/mapSideBar/property/tabs/propertyDetailsManagement/activity/edit/models.ts b/source/frontend/src/features/mapSideBar/property/tabs/propertyDetailsManagement/activity/edit/models.ts
index e7d4901209..8f68ad3def 100644
--- a/source/frontend/src/features/mapSideBar/property/tabs/propertyDetailsManagement/activity/edit/models.ts
+++ b/source/frontend/src/features/mapSideBar/property/tabs/propertyDetailsManagement/activity/edit/models.ts
@@ -132,8 +132,8 @@ export class PropertyActivityFormModel {
activityTypeCode: toTypeCode(this.activityTypeCode) || {},
activitySubtypeCode: toTypeCode(this.activitySubtypeCode) || {},
activityStatusTypeCode: toTypeCode(this.activityStatusCode) || {},
- requestAddedDateTime: this.requestedDate,
- completionDateTime: emptyStringtoNullable(this.completionDate),
+ requestAddedDateOnly: this.requestedDate,
+ completionDateOnly: emptyStringtoNullable(this.completionDate),
description: this.description,
requestSource: this.requestedSource,
@@ -200,8 +200,8 @@ export class PropertyActivityFormModel {
formModel.activityTypeCode = model.activityTypeCode.id || '';
formModel.activitySubtypeCode = model.activitySubtypeCode.id || '';
formModel.activityStatusCode = model.activityStatusTypeCode.id || '';
- formModel.requestedDate = model.requestAddedDateTime;
- formModel.completionDate = model.completionDateTime || '';
+ formModel.requestedDate = model.requestAddedDateOnly;
+ formModel.completionDate = model.completionDateOnly || '';
formModel.description = model.description;
if (model.ministryContacts.length > 0) {
diff --git a/source/frontend/src/features/mapSideBar/property/tabs/propertyDetailsManagement/activity/list/models/PropertyActivityRow.ts b/source/frontend/src/features/mapSideBar/property/tabs/propertyDetailsManagement/activity/list/models/PropertyActivityRow.ts
index 26ca6efafc..5fadd7345f 100644
--- a/source/frontend/src/features/mapSideBar/property/tabs/propertyDetailsManagement/activity/list/models/PropertyActivityRow.ts
+++ b/source/frontend/src/features/mapSideBar/property/tabs/propertyDetailsManagement/activity/list/models/PropertyActivityRow.ts
@@ -19,7 +19,7 @@ export class PropertyActivityRow {
row.activityType = model.activityTypeCode;
row.activitySubType = model.activitySubtypeCode;
row.activityStatusType = model.activityStatusTypeCode;
- row.requestedAddedDate = model.requestAddedDateTime;
+ row.requestedAddedDate = model.requestAddedDateOnly;
return row;
}
diff --git a/source/frontend/src/mocks/PropertyManagementActivity.mock.ts b/source/frontend/src/mocks/PropertyManagementActivity.mock.ts
index 5d819bb2e5..1d3f82a8d4 100644
--- a/source/frontend/src/mocks/PropertyManagementActivity.mock.ts
+++ b/source/frontend/src/mocks/PropertyManagementActivity.mock.ts
@@ -20,8 +20,8 @@ const emptyActivity: Api_PropertyActivity = {
isDisabled: false,
displayOrder: 100,
},
- requestAddedDateTime: '',
- completionDateTime: null,
+ requestAddedDateOnly: '',
+ completionDateOnly: null,
description: '',
requestSource: '',
pretaxAmt: null,
@@ -63,7 +63,7 @@ export const mockGetPropertyManagementActivity = (
isDisabled: false,
displayOrder: 100,
},
- requestAddedDateTime: '2023-10-17T00:00:00',
+ requestAddedDateOnly: '2023-10-17T00:00:00',
rowVersion: 1,
activityProperties: [
{
@@ -101,7 +101,7 @@ export const mockGetPropertyManagementActivityNotStarted = (
isDisabled: false,
displayOrder: 100,
},
- requestAddedDateTime: '2023-10-17T00:00:00',
+ requestAddedDateOnly: '2023-10-17T00:00:00',
rowVersion: 1,
activityProperties: [
{
diff --git a/source/frontend/src/models/api/Project.ts b/source/frontend/src/models/api/Project.ts
index bb7968c27d..ec3434d191 100644
--- a/source/frontend/src/models/api/Project.ts
+++ b/source/frontend/src/models/api/Project.ts
@@ -2,6 +2,7 @@ import { Api_AcquisitionFile } from './AcquisitionFile';
import { Api_AuditFields } from './AuditFields';
import { Api_CodeType } from './CodeType';
import { Api_ConcurrentVersion_Null } from './ConcurrentVersion';
+import { DateOnly } from './DateOnly';
import { Api_FinancialCode } from './FinancialCode';
import Api_TypeCode from './TypeCode';
@@ -24,9 +25,9 @@ export interface Api_Product extends Api_ConcurrentVersion_Null, Api_AuditFields
parentProjectId: number | null;
code: string | null;
description: string | null;
- startDate: string | null;
+ startDate: DateOnly | null;
costEstimate: number | null;
- costEstimateDate: string | null;
+ costEstimateDate: DateOnly | null;
objective: string | null;
scope: string | null;
acquisitionFiles: Api_AcquisitionFile[];
diff --git a/source/frontend/src/models/api/PropertyActivity.ts b/source/frontend/src/models/api/PropertyActivity.ts
index 331cc7ab73..ad19acf24b 100644
--- a/source/frontend/src/models/api/PropertyActivity.ts
+++ b/source/frontend/src/models/api/PropertyActivity.ts
@@ -1,4 +1,5 @@
import { Api_ConcurrentVersion_Null } from './ConcurrentVersion';
+import { DateOnly } from './DateOnly';
import { Api_Organization } from './Organization';
import { Api_Person } from './Person';
import { Api_Property } from './Property';
@@ -9,8 +10,8 @@ export interface Api_PropertyActivity extends Api_ConcurrentVersion_Null {
activityTypeCode: Api_TypeCode;
activitySubtypeCode: Api_TypeCode;
activityStatusTypeCode: Api_TypeCode;
- requestAddedDateTime: string;
- completionDateTime: string | null;
+ requestAddedDateOnly: DateOnly;
+ completionDateOnly: DateOnly | null;
description: string;
requestSource: string;
pretaxAmt: number | null;
diff --git a/source/frontend/src/models/api/Take.ts b/source/frontend/src/models/api/Take.ts
index d816f17758..5bd2f11e72 100644
--- a/source/frontend/src/models/api/Take.ts
+++ b/source/frontend/src/models/api/Take.ts
@@ -19,7 +19,7 @@ export interface Api_Take extends Api_ConcurrentVersion, Api_AuditFields {
landActEndDt: DateOnly | null;
landActTypeCode: Api_TypeCode | null;
statutoryRightOfWayArea: number | null;
- srwEndDt: string | null;
+ srwEndDt: DateOnly | null;
surplusArea: number | null;
propertyAcquisitionFileId: number | null;
takeSiteContamTypeCode: string | null;