Skip to content

Commit

Permalink
psp-6887 update backend/frontend to support dateonly/ts
Browse files Browse the repository at this point in the history
  • Loading branch information
devinleighsmith committed Nov 15, 2023
1 parent d262e1a commit 3ffacc2
Show file tree
Hide file tree
Showing 37 changed files with 91 additions and 411 deletions.
101 changes: 0 additions & 101 deletions source/backend/api/Areas/Leases/Models/Lease/AddressModel.cs

This file was deleted.

46 changes: 0 additions & 46 deletions source/backend/api/Areas/Leases/Models/Lease/InsuranceModel.cs

This file was deleted.

This file was deleted.

93 changes: 0 additions & 93 deletions source/backend/api/Areas/Leases/Models/Lease/PropertyModel.cs

This file was deleted.

20 changes: 0 additions & 20 deletions source/backend/api/Areas/Leases/Models/Lease/RegionModel.cs

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ public class LeaseFilterModel : PageFilter
/// <summary>
/// get/set - The expiry filter start date.
/// </summary>
public DateTime? ExpiryStartDate { get; set; }
public DateOnly? ExpiryStartDate { get; set; }

/// <summary>
/// get/set - The expiry filter end date.
/// </summary>
public DateTime? ExpiryEndDate { get; set; }
public DateOnly? ExpiryEndDate { get; set; }

/// <summary>
/// get/set - The region type.
Expand Down Expand Up @@ -91,8 +91,8 @@ public LeaseFilterModel(Dictionary<string, Microsoft.Extensions.Primitives.Strin
this.LeaseStatusTypes = filter.GetStringArrayValue(nameof(this.LeaseStatusTypes));
this.TenantName = filter.GetStringValue(nameof(this.TenantName));
this.Programs = filter.GetStringArrayValue(nameof(this.Programs));
this.ExpiryStartDate = filter.GetDateTimeNullValue(nameof(this.ExpiryStartDate));
this.ExpiryEndDate = filter.GetDateTimeNullValue(nameof(this.ExpiryEndDate));
this.ExpiryStartDate = filter.GetDateOnlyNullValue(nameof(this.ExpiryStartDate));
this.ExpiryEndDate = filter.GetDateOnlyNullValue(nameof(this.ExpiryEndDate));
this.RegionType = filter.GetIntNullValue(nameof(this.RegionType));
this.Details = filter.GetStringValue(nameof(this.Details));
this.Sort = filter.GetStringArrayValue(nameof(this.Sort));
Expand Down
3 changes: 2 additions & 1 deletion source/backend/api/Areas/Leases/Models/Search/LeaseMap.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Linq;
using Mapster;
using Pims.Core.Extensions;
using Pims.Dal.Helpers.Extensions;
using Entity = Pims.Dal.Entities;
using Model = Pims.Api.Areas.Lease.Models.Search;
Expand All @@ -13,7 +14,7 @@ public void Register(TypeAdapterConfig config)
config.NewConfig<Entity.PimsLease, Model.LeaseModel>()
.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())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class LeaseModel
/// <summary>
/// get/set - The expiry date time.
/// </summary>
public DateTime? ExpiryDate { get; set; }
public DateOnly? ExpiryDate { get; set; }

/// <summary>
/// get/set - The value of the program name.
Expand Down
Loading

0 comments on commit 3ffacc2

Please sign in to comment.