Skip to content

Commit

Permalink
Merge pull request #804 from bcgov/yj
Browse files Browse the repository at this point in the history
chore: added is active for jurisdiction
  • Loading branch information
ychung-mot authored Nov 21, 2024
2 parents bb1d4ba + 5097352 commit d478176
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 20 deletions.
1 change: 1 addition & 0 deletions server/StrDss.Common/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}

Expand Down
21 changes: 1 addition & 20 deletions server/StrDss.Data/Repositories/RentalListingRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,26 +161,7 @@ public async Task<int> GetGroupedRentalListingsCount(string? all, string? addres

return count;
}
//public async Task<int> 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<int> CountHostListingsAsync(string hostName)
{
var query = _dbSet.AsNoTracking();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}
}
1 change: 1 addition & 0 deletions server/StrDss.Model/OrganizationDtos/OrganizationDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<ContactPersonDto> ContactPeople { get; set; } = new List<ContactPersonDto>();
Expand Down
8 changes: 8 additions & 0 deletions server/StrDss.Service/JurisdictionValidationRules.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ public static void LoadJurisdictionValidationRules(List<FieldValidationRule> 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,
Expand Down

0 comments on commit d478176

Please sign in to comment.