Skip to content

Commit

Permalink
Merge pull request #343 from gaepdit/342-facility-search-excel-export
Browse files Browse the repository at this point in the history
342 facility search excel export
  • Loading branch information
tom-karasch authored Feb 21, 2024
2 parents b227655 + 5467759 commit cf0fc2d
Show file tree
Hide file tree
Showing 47 changed files with 7,666 additions and 2,810 deletions.
14 changes: 8 additions & 6 deletions FMS.Domain/Dto/Cabinet/CabinetExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ namespace FMS.Domain.Dto
{
public static class CabinetExtensions
{
public static List<string> GetCabinetsForFile(this IEnumerable<CabinetSummaryDto> cabinets, string fileLabel)
public static List<string> GetCabinetsForFile(this IEnumerable<CabinetSummaryDto> cabinets, string fileLabel, bool testValidity = true)
{
Prevent.NullOrEmpty(fileLabel, nameof(fileLabel));

if (!File.IsValidFileLabelFormat(fileLabel))
{
throw new ArgumentException($"File label '{fileLabel}' is invalid.", nameof(fileLabel));
if (testValidity)
{
Prevent.NullOrEmpty(fileLabel, nameof(fileLabel));
if (!File.IsValidFileLabelFormat(fileLabel))
{
throw new ArgumentException($"File label '{fileLabel}' is invalid.", nameof(fileLabel));
}
}

return cabinets.Where(e =>
Expand Down
30 changes: 23 additions & 7 deletions FMS.Domain/Dto/Facility/FacilityCreateDto.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using System;
using FMS.Domain.Entities;
using System;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;

namespace FMS.Domain.Dto
{
public class FacilityCreateDto
{
{
[Required]
[Display(Name = "Facility Number")]
public string FacilityNumber { get; set; }
Expand All @@ -24,6 +26,7 @@ public class FacilityCreateDto
[Required]
[Display(Name = "Type/Environmental Interest")]
public Guid FacilityTypeId { get; set; }
public string FacilityTypeName { get; set; }

[Required]
[Display(Name = "Budget Code")]
Expand Down Expand Up @@ -75,8 +78,8 @@ public class FacilityCreateDto
[Display(Name = "HSI Number")]
public string HSInumber { get; set; }

[Display(Name = "Non-HSI Letter Date")]
public DateOnly NonHSILetterDate { get; set; }
[Display(Name = "Determination Letter Date")]
public DateOnly? DeterminationLetterDate { get; set; }

[Display(Name = "Comments")]
public string Comments { get; set; }
Expand All @@ -87,15 +90,27 @@ public class FacilityCreateDto
[Display(Name = "Image Checked")]
public bool ImageChecked { get; set; }

[Display(Name = "Deferred OnSite Scoring")]
[Display(Name = "Brownfield Deferral")]
public bool DeferredOnSiteScoring { get; set; }

[Display(Name = "Additional Data Requested")]
[Display(Name = "Add'l Data Requested")]
public bool AdditionalDataRequested { get; set; }

[Display(Name = "VRP Referral")]
[Display(Name = "VRP Deferral")]
public bool VRPReferral { get; set; }

[Display(Name = "Date Received")]
public DateOnly? RNDateReceived { get; set; }

[Display(Name = "Historical Unit")]
public string HistoricalUnit { get; set; }

[Display(Name = "Historical C.O.")]
public string HistoricalComplianceOfficer { get; set; }

[Display(Name = "Has Electronic Records")]
public bool HasERecord { get; set; }

public void TrimAll()
{
FacilityNumber = FacilityNumber?.Trim();
Expand All @@ -106,6 +121,7 @@ public void TrimAll()
City = City?.Trim();
PostalCode = PostalCode?.Trim();
HSInumber = HSInumber?.Trim();
HistoricalUnit = HistoricalUnit?.Trim();
}
}
}
63 changes: 57 additions & 6 deletions FMS.Domain/Dto/Facility/FacilityDetailDto.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using FMS.Domain.Entities;
using FMS.Domain.Extensions;
Expand All @@ -12,8 +13,8 @@ public class FacilityDetailDto
public FacilityDetailDto(Facility facility)
{
Id = facility.Id;
FileLabel = facility.File.FileLabel;
FileId = facility.File.Id;
FileLabel = facility.File?.FileLabel;
FileId = facility.File?.Id;
FacilityNumber = facility.FacilityNumber;
Name = facility.Name;
Active = facility.Active;
Expand All @@ -29,7 +30,20 @@ public FacilityDetailDto(Facility facility)
State = facility.State;
PostalCode = facility.PostalCode;
Latitude = facility.Latitude;
Longitude = facility.Longitude;
Longitude = facility.Longitude;
HasERecord = facility.HasERecord;
Comments = facility.Comments;
// *** these properties only apply to Release Notifications ***
HSInumber = facility.HSInumber;
DeterminationLetterDate = facility.DeterminationLetterDate;
PreRQSMcleanup = facility.PreRQSMcleanup;
ImageChecked = facility.ImageChecked;
DeferredOnSiteScoring = facility.DeferredOnSiteScoring;
AdditionalDataRequested = facility.AdditionalDataRequested;
VRPReferral = facility.VRPReferral;
RNDateReceived = facility.RNDateReceived;
HistoricalUnit = facility.HistoricalUnit;
HistoricalComplianceOfficer = facility.HistoricalComplianceOfficer;
IsRetained = facility.IsRetained;
Cabinets = new List<string>();
RetentionRecords = facility.RetentionRecords?
Expand All @@ -54,7 +68,7 @@ public FacilityDetailDto(Facility facility)
[Display(Name = "Facility Status")]
public FacilityStatus FacilityStatus { get; }

[Display(Name = "Type/Environmental Interest")]
[Display(Name = "Type/Env. Interest")]
public FacilityType FacilityType { get; }

[Display(Name = "Budget Code")]
Expand All @@ -69,7 +83,7 @@ public FacilityDetailDto(Facility facility)
[Display(Name = "File Label")]
public string FileLabel { get; }

public Guid FileId { get; }
public Guid? FileId { get; }

[Display(Name = "Location Description")]
public string Location { get; }
Expand All @@ -92,7 +106,44 @@ public FacilityDetailDto(Facility facility)

[Display(Name = "Longitude")]
[DisplayFormat(DataFormatString = "{0:F6}")]
public decimal Longitude { get; }
public decimal Longitude { get; }

// The following properties only apply to Release Notifications
[Display(Name = "HSI Number")]
public string HSInumber { get; set; }

[Display(Name = "Determination Letter Date", Prompt = "None Entered")]
public DateOnly? DeterminationLetterDate { get; set; }

[Display(Name = "Comments")]
public string Comments { get; set; }

[Display(Name = "Pre-RQSM Cleanup")]
public bool PreRQSMcleanup { get; set; }

[Display(Name = "Image Checked")]
public bool ImageChecked { get; set; }

[Display(Name = "Brownfield Deferral")]
public bool DeferredOnSiteScoring { get; set; }

[Display(Name = "Additional Data Requested")]
public bool AdditionalDataRequested { get; set; }

[Display(Name = "VRP Deferral")]
public bool VRPReferral { get; set; }

[Display(Name = "Date Received")]
public DateOnly? RNDateReceived { get; set; }

[Display(Name = "Historical Unit")]
public string HistoricalUnit { get; set; }

[Display(Name = "Historical C.O.")]
public string HistoricalComplianceOfficer { get; set; }

[Display(Name = "Has Electronic Records")]
public bool HasERecord { get; set; }

[Display(Name = "Is Retained Onsite")]
public bool IsRetained { get; }
Expand Down
56 changes: 55 additions & 1 deletion FMS.Domain/Dto/Facility/FacilityEditDto.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;

namespace FMS.Domain.Dto
{
Expand All @@ -15,6 +16,7 @@ public FacilityEditDto(FacilityDetailDto facility)
CountyId = facility.County.Id;
FacilityStatusId = facility.FacilityStatus?.Id;
FacilityTypeId = facility.FacilityType?.Id;
FacilityTypeName = facility.FacilityType?.Name;
BudgetCodeId = facility.BudgetCode?.Id;
OrganizationalUnitId = facility.OrganizationalUnit?.Id;
ComplianceOfficerId = facility.ComplianceOfficer?.Id;
Expand All @@ -25,6 +27,18 @@ public FacilityEditDto(FacilityDetailDto facility)
PostalCode = facility.PostalCode;
Latitude = facility.Latitude;
Longitude = facility.Longitude;
HSInumber = facility.HSInumber;
DeterminationLetterDate = facility.DeterminationLetterDate;
Comments = facility.Comments;
PreRQSMcleanup = facility.PreRQSMcleanup;
ImageChecked = facility.ImageChecked;
DeferredOnSiteScoring = facility.DeferredOnSiteScoring;
AdditionalDataRequested = facility.AdditionalDataRequested;
VRPReferral = facility.VRPReferral;
RNDateReceived = facility.RNDateReceived;
HistoricalUnit = facility.HistoricalUnit;
HistoricalComplianceOfficer = facility.HistoricalComplianceOfficer;
HasERecord = facility.HasERecord;
IsRetained = facility.IsRetained;
}

Expand All @@ -50,6 +64,7 @@ public FacilityEditDto(FacilityDetailDto facility)
[Required]
[Display(Name = "Type/Environmental Interest")]
public Guid? FacilityTypeId { get; set; }
public string FacilityTypeName { get; set; }

[Required]
[Display(Name = "Budget Code")]
Expand All @@ -65,7 +80,7 @@ public FacilityEditDto(FacilityDetailDto facility)
[Display(Name = "File Label")]
public string FileLabel { get; set; }

[Display(Name = "Location Description")]
[Display(Name = "Location Description/Tax Parcel ID")]
public string Location { get; set; }

[Required]
Expand Down Expand Up @@ -101,6 +116,43 @@ public FacilityEditDto(FacilityDetailDto facility)
[Display(Name = "Is Retained Onsite")]
public bool IsRetained { get; set; }

// The following properties only apply to Release Notifications
[Display(Name = "HSI Number")]
public string HSInumber { get; set; }

[Display(Name = "Determination Letter Date")]
public DateOnly? DeterminationLetterDate { get; set; }

[Display(Name = "Comments")]
public string Comments { get; set; }

[Display(Name = "Pre-RQSM Cleanup")]
public bool PreRQSMcleanup { get; set; }

[Display(Name = "Image Checked")]
public bool ImageChecked { get; set; }

[Display(Name = "Brownfield Deferral")]
public bool DeferredOnSiteScoring { get; set; }

[Display(Name = "Additional Data Requested")]
public bool AdditionalDataRequested { get; set; }

[Display(Name = "VRP Deferral")]
public bool VRPReferral { get; set; }

[Display(Name = "Date Received")]
public DateOnly? RNDateReceived { get; set; }

[Display(Name = "Historical Unit")]
public string HistoricalUnit { get; set; }

[Display(Name = "Historical Compliance Officer")]
public string HistoricalComplianceOfficer { get; set; }

[Display(Name = "Has Electronic Records")]
public bool HasERecord { get; set; }

public void TrimAll()
{
FacilityNumber = FacilityNumber?.Trim();
Expand All @@ -110,6 +162,8 @@ public void TrimAll()
Address = Address?.Trim();
City = City?.Trim();
PostalCode = PostalCode?.Trim();
HSInumber = HSInumber?.Trim();
HistoricalUnit = HistoricalUnit?.Trim();
}
}
}
83 changes: 44 additions & 39 deletions FMS.Domain/Dto/Facility/FacilityMapSpec.cs
Original file line number Diff line number Diff line change
@@ -1,40 +1,45 @@
using System.ComponentModel.DataAnnotations;

namespace FMS.Domain.Dto
{
public class FacilityMapSpec
{
[Display(Name = "Include deleted records")]
public bool ShowDeleted { get; set; }

[Display(Name = "Street Address")]
public string Address { get; set; }

[Display(Name = "City")]
public string City { get; set; }

[Display(Name = "State")]
public string State { get; set; } = "Georgia";

[Display(Name = "ZIP Code")]
[StringLength(10)]
public string PostalCode { get; set; }

[Display(Name = "Latitude")]
public decimal? Latitude { get; set; }

[Display(Name = "Longitude")]
public decimal? Longitude { get; set; }

[Display(Name = "Radius")]
public decimal Radius { get; set; }

[Display(Name = "Output")]
public string Output { get; set; }

// Internal geocode results
public string GeocodeLat { get; set; }
public string GeocodeLng { get; set; }
public string GeocodeAddress { get; set; }
}
using FMS.Domain.Entities;
using System;
using System.ComponentModel.DataAnnotations;

namespace FMS.Domain.Dto
{
public class FacilityMapSpec
{
[Display(Name = "Include deleted records")]
public bool ShowDeleted { get; set; }

[Display(Name = "Type/Environmental Interest")]
public Guid? FacilityTypeId { get; set; }

[Display(Name = "Street Address")]
public string Address { get; set; }

[Display(Name = "City")]
public string City { get; set; }

[Display(Name = "State")]
public string State { get; set; } = "Georgia";

[Display(Name = "ZIP Code")]
[StringLength(10)]
public string PostalCode { get; set; }

[Display(Name = "Latitude")]
public decimal? Latitude { get; set; }

[Display(Name = "Longitude")]
public decimal? Longitude { get; set; }

[Display(Name = "Radius")]
public decimal Radius { get; set; }

[Display(Name = "Output")]
public string Output { get; set; }

// Internal geocode results
public string GeocodeLat { get; set; }
public string GeocodeLng { get; set; }
public string GeocodeAddress { get; set; }
}
}
Loading

0 comments on commit cf0fc2d

Please sign in to comment.