Skip to content

Commit 18646bc

Browse files
Merge pull request #889 from bcgov/feature/registration-validation
Fixes
2 parents a080b7e + ebc1859 commit 18646bc

File tree

7 files changed

+19
-20
lines changed

7 files changed

+19
-20
lines changed

database/ddl/STR_DSS_Incremental_DB_DDL_Sprint_21.sql

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ COMMENT ON COLUMN dss_upload_delivery.registration_lines_success IS 'The number
2929
COMMENT ON COLUMN dss_upload_delivery.upload_user_guid IS 'The globally unique identifier (assigned by the identity provider) for the user who uploaded the file';
3030

3131
-- Create new columns in the upload line for holding registration validation status and text
32-
ALTER TABLE dss_upload_line ADD is_registration_failure boolean;
32+
ALTER TABLE dss_upload_line ADD is_registration_failure boolean DEFAULT false;
3333
ALTER TABLE dss_upload_line ADD registration_text varchar(32000);
3434

3535
COMMENT ON COLUMN dss_upload_line.is_registration_failure IS 'Indicates that there has been a problem validating the reg no, or determining if the property is straa exempt';
@@ -198,6 +198,10 @@ SET registration_status = dud.upload_status,
198198
registration_lines_failure = dud.upload_lines_error,
199199
registration_lines_success = dud.upload_lines_success;
200200

201+
update dss_upload_line dul
202+
set is_registration_failure = false
203+
where is_registration_failure is NULL;
204+
201205
-- Now that we've populated the columns, we can set the not null constraint on status and total lines
202206
ALTER TABLE dss_upload_delivery ALTER COLUMN upload_status SET NOT NULL;
203207
ALTER TABLE dss_upload_delivery ALTER COLUMN upload_lines_total SET NOT NULL;

server/StrDss.Data/Entities/DssDbContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1332,7 +1332,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
13321332
.HasColumnName("registration_lines_success");
13331333
entity.Property(e => e.RegistrationLinesError)
13341334
.HasComment("The number of lines in the uploaded file that failed to validate the registration number")
1335-
.HasColumnName("registration_lines_error");
1335+
.HasColumnName("registration_lines_failure");
13361336

13371337
entity.Property(e => e.UploadUserGuid)
13381338
.HasComment("The globally unique identifier (assigned by the identity provider) for the user who uploaded the file")

server/StrDss.Service/BizLicenceService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ private void SaveUploadLine(DssUploadLine uploadLine, Dictionary<string, List<st
162162
{
163163
uploadLine.IsValidationFailure = isValidationFailure;
164164
uploadLine.ErrorTxt = errors.ParseErrorWithUnderScoredKeyName();
165+
uploadLine.IsRegistrationFailure = false;
165166

166167
uploadLine.IsSystemFailure = systemError.IsNotEmpty();
167168
if (uploadLine.IsSystemFailure)

server/StrDss.Service/EmailTemplates/RegistrationValidationComplete.cs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,21 @@ public RegistrationValidationComplete(IEmailMessageService emailService) : base(
1010
From = Environment.GetEnvironmentVariable("ADMIN_EMAIL") ?? From;
1111
}
1212
public string UserName { get; set; } = "";
13-
public long NumErrors { get; set; }
1413
public string Link { get; set; } = "";
1514
public override string GetContent()
1615
{
17-
Subject = "B.C. STR Data Portal: Registration Validation";
16+
Subject = "B.C. STR Data Portal: Validation report ready ";
1817

1918
return
2019
$@"Dear {UserName},<br/><br/>
21-
Thank you for uploading a monthly registration validation report to British Columbia’s Short-term Rental Data Portal. Your upload has been processed and {NumErrors} error(s) have been found in your uploaded file.<br/><br/>
22-
Here’s how to fix errors: <br/><br/>
23-
<ol>
24-
<li>Download the file containing the error rows <a href='{Link}'>here</a>.</li>
25-
<li>Fix the highlighted errors in the columns.</li>
26-
<li>Upload the corrected file to the STR Data Portal like you would normally upload your monthly report.</li>
27-
</ol>
20+
Thank you for submitting your listings to British Columbia’s Short-term Rental Data Portal to validate that all listings include a valid host registration, as required under s. 17(1)(b)(ii) of the <i>Short-term Rental Accommodations Act</i>.<br/>
2821
<br/>
29-
Please contact DSSadmin@gov.bc.ca if you encounter any problems.<br/>
22+
Your upload has been processed, and the validation report is now available for download. The validation results are listed in the first column of the report. For any listings that failed validation, corresponding error messages are provided.<br/>
23+
<br/>
24+
<b>Next Steps</b><br/>
25+
Platforms are required to take specific actions when a registration is determined to be invalid. See the <a href={Link}>Guide to STR Registration validation for Minor Platforms</a> for more details.<br/>
26+
<br/>
27+
Please contact <a href=emailto:{From}>DSSadmin@gov.bc.ca</a> for technical support if needed.<br/>
3028
";
3129
}
3230
}

server/StrDss.Service/RegistrationService.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,7 @@ public async Task ProcessRegistrationDataUploadAsync(DssUploadDelivery upload)
134134
var template = new RegistrationValidationComplete(_emailService)
135135
{
136136
UserName = $"{user!.GivenNm}",
137-
NumErrors = errorCount,
138-
Link = GetHostUrl() + "/registration-validation-history",
137+
Link = "https://www2.gov.bc.ca/assets/gov/housing-and-tenancy/tools-for-government/short-term-rentals/quickstartguide_validation_for_minor_platforms_final.pdf",
139138
To = new string[] { user!.EmailAddressDsc! },
140139
Info = $"{EmailMessageTypes.ListingUploadError} for {user.FamilyNm}, {user.GivenNm}",
141140
From = adminEmail

server/StrDss.Service/RentalListingReportService.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -303,12 +303,8 @@ public async Task ProcessRentalReportUploadAsync(DssUploadDelivery upload)
303303
private void SaveUploadLine(DssUploadLine uploadLine, Dictionary<string, List<string>> errors, bool isValidationFailure, string systemError,
304304
bool doValidateRegistration, bool isRegistrationFailure, string registrationTxt)
305305
{
306-
if (doValidateRegistration)
307-
{
308-
uploadLine.IsRegistrationFailure = isRegistrationFailure;
309-
uploadLine.RegistrationTxt = registrationTxt;
310-
}
311-
306+
uploadLine.IsRegistrationFailure = isRegistrationFailure;
307+
uploadLine.RegistrationTxt = registrationTxt;
312308
uploadLine.IsValidationFailure = isValidationFailure;
313309
uploadLine.ErrorTxt = errors.ParseErrorWithUnderScoredKeyName();
314310

server/StrDss.Service/TakedownConfirmationService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ public async Task ProcessTakedownConfirmationUploadAsync(DssUploadDelivery uploa
139139
}
140140

141141
line.IsProcessed = true;
142+
line.IsRegistrationFailure = false;
142143

143144
_unitOfWork.Commit();
144145

0 commit comments

Comments
 (0)