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-6887 add date and time aliases to frontend. Add model typing to backend. #3516

Closed
wants to merge 2 commits into from
Closed
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
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
Loading