diff --git a/server/StrDss.Common/Constants.cs b/server/StrDss.Common/Constants.cs index 2f51ad29..6df4a620 100644 --- a/server/StrDss.Common/Constants.cs +++ b/server/StrDss.Common/Constants.cs @@ -135,6 +135,7 @@ public static class JurisdictionFields public const string IsStrProhibited = "IsStrProhibited"; public const string IsBusinessLicenceRequired = "IsBusinessLicenceRequired"; public const string IsStraaExempt = "IsStraaExempt"; + public const string IsActive = "IsActive"; public const string EconomicRegionDsc = "EconomicRegionDsc"; } diff --git a/server/StrDss.Data/Repositories/RentalListingRepository.cs b/server/StrDss.Data/Repositories/RentalListingRepository.cs index b13a367e..fba887e1 100644 --- a/server/StrDss.Data/Repositories/RentalListingRepository.cs +++ b/server/StrDss.Data/Repositories/RentalListingRepository.cs @@ -161,26 +161,7 @@ public async Task GetGroupedRentalListingsCount(string? all, string? addres return count; } - //public async Task CountHostListingsAsync(string hostName) - //{ - // var query = _dbSet.AsNoTracking(); - - // if (_currentUser.OrganizationType == OrganizationTypes.LG) - // { - // query = query.Where(x => x.ManagingOrganizationId == _currentUser.OrganizationId); - // } - - // return await query - // .Where(x => x.EffectiveHostNm == hostName) - // .GroupBy(x => new { x.EffectiveBusinessLicenceNo, x.EffectiveHostNm, x.MatchAddressTxt }) - // .Select(g => new RentalListingGroupDto - // { - // EffectiveBusinessLicenceNo = g.Key.EffectiveBusinessLicenceNo, - // EffectiveHostNm = g.Key.EffectiveHostNm, - // MatchAddressTxt = g.Key.MatchAddressTxt - // }) - // .CountAsync(); - //} + public async Task CountHostListingsAsync(string hostName) { var query = _dbSet.AsNoTracking(); diff --git a/server/StrDss.Model/OrganizationDtos/JurisdictionsViewDto.cs b/server/StrDss.Model/OrganizationDtos/JurisdictionsViewDto.cs index e22e825f..eefd0c73 100644 --- a/server/StrDss.Model/OrganizationDtos/JurisdictionsViewDto.cs +++ b/server/StrDss.Model/OrganizationDtos/JurisdictionsViewDto.cs @@ -14,6 +14,7 @@ public class JurisdictionsViewDto public bool? IsBusinessLicenceRequired { get; set; } public bool? IsStraaExempt { get; set; } public string? EconomicRegionDsc { get; set; } + public bool? IsActive { get; set; } public DateTime UpdDtm { get; set; } } } diff --git a/server/StrDss.Model/OrganizationDtos/OrganizationDto.cs b/server/StrDss.Model/OrganizationDtos/OrganizationDto.cs index f2b5ba77..4429afd2 100644 --- a/server/StrDss.Model/OrganizationDtos/OrganizationDto.cs +++ b/server/StrDss.Model/OrganizationDtos/OrganizationDto.cs @@ -28,6 +28,7 @@ public class OrganizationDto public bool? IsBusinessLicenceRequired { get; set; } public bool? IsStrProhibited { get; set; } public bool? IsStraaExempt { get; set; } + public bool? IsActive { get; set; } public string? PlatformType { get; set; } public string? BusinessLicenceFormatTxt { get; set; } public virtual ICollection ContactPeople { get; set; } = new List(); diff --git a/server/StrDss.Service/JurisdictionValidationRules.cs b/server/StrDss.Service/JurisdictionValidationRules.cs index 163be2fa..db7bb5a7 100644 --- a/server/StrDss.Service/JurisdictionValidationRules.cs +++ b/server/StrDss.Service/JurisdictionValidationRules.cs @@ -38,6 +38,14 @@ public static void LoadJurisdictionValidationRules(List rul Required = true }); + rules.Add(new FieldValidationRule + { + EntityName = Entities.Jurisdiction, + FieldName = JurisdictionFields.IsActive, + FieldType = FieldTypes.Bool, + Required = true + }); + rules.Add(new FieldValidationRule { EntityName = Entities.Jurisdiction,