Skip to content

Commit 48a4f68

Browse files
authored
Merge pull request #787 from bcgov/yj
Yj
2 parents 535543b + 2682d95 commit 48a4f68

File tree

4 files changed

+16
-43
lines changed

4 files changed

+16
-43
lines changed

.github/workflows/deploy-prod.yml

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,40 +5,6 @@ on:
55
types: [published]
66

77
jobs:
8-
# deploy-silver:
9-
# runs-on: ubuntu-22.04
10-
# timeout-minutes: 5
11-
# permissions:
12-
# contents: read
13-
# environment:
14-
# name: prod
15-
# url: https://prod-strdata.apps.silver.devops.gov.bc.ca/
16-
17-
# steps:
18-
# - uses: hmarr/debug-action@a701ed95a46e6f2fb0df25e1a558c16356fae35a
19-
# - uses: actions/checkout@96f53100ba2a5449eb71d2e6604bbcd94b9449b5
20-
# with:
21-
# ref: main # one source of truth for CI/CD pipeline
22-
23-
# - name: Authenticate and set context
24-
# uses: redhat-actions/oc-login@9b79eb6d8ec51bce42cb4e77f0a174fc80cf3cb9
25-
# with:
26-
# openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }}
27-
# openshift_token: ${{ secrets.OPENSHIFT_TOKEN }}
28-
# namespace: f4a30d-prod
29-
# insecure_skip_tls_verify: true
30-
31-
# - name: Deploy apps with Helm chart
32-
# run: |
33-
# vtag=${{ github.ref_name }}
34-
# make upgrade \
35-
# NAMESPACE=f4a30d-prod \
36-
# NAME=strdss-prod \
37-
# ENV_NAME=prod \
38-
# IMAGE_TAG_FRONTEND=${vtag//v} \
39-
# IMAGE_TAG_BACKEND=${vtag//v} \
40-
# IMAGE_TAG_HANGFIRE=${vtag//v} \
41-
# working-directory: ./helm/main
428

439
deploy-emerald:
4410
runs-on: ubuntu-22.04
@@ -50,7 +16,7 @@ jobs:
5016
uses: actions/checkout@v4
5117
with:
5218
repository: bcgov-c/tenant-gitops-b0471a
53-
ref: main
19+
ref: prod
5420
token: ${{ secrets.GITOPS }} # `GITOPS` is a secret that contains your PAT
5521
- name: Update Helm Values and Commit
5622
id: helm

server/StrDss.Api/Controllers/BizLicencesController.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
using StrDss.Common;
77
using StrDss.Model;
88
using StrDss.Service;
9-
using System.Security.Cryptography;
10-
using static System.Runtime.InteropServices.JavaScript.JSType;
119

1210
namespace StrDss.Api.Controllers
1311
{

server/StrDss.Service/DelistingService.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,6 +1103,13 @@ private async Task ProcessComplianceOrderListings(ComplianceOrderDto[] listings,
11031103
{
11041104
var emailRegex = RegexDefs.GetRegexInfo(RegexDefs.Email);
11051105
var commentError = false;
1106+
var cc = Environment.GetEnvironmentVariable("STR_CEU_EMAIL");
1107+
1108+
if (!Regex.IsMatch(_currentUser.EmailAddress, emailRegex.Regex))
1109+
{
1110+
errors.AddItem("email", $"Your email address ({_currentUser.EmailAddress}) is invalid");
1111+
return;
1112+
}
11061113

11071114
foreach (var listing in listings)
11081115
{
@@ -1112,6 +1119,8 @@ private async Task ProcessComplianceOrderListings(ComplianceOrderDto[] listings,
11121119

11131120
var template = CreateComplianceOrderTemplate(listing, rentalListing);
11141121

1122+
listing.BccList.Add(_currentUser.EmailAddress);
1123+
11151124
ValidateEmails(listing.BccList, emailRegex, "bccList", errors);
11161125

11171126
listing.HostEmails = GetValidHostEmails(rentalListing.Hosts.ToArray(), emailRegex);
@@ -1123,6 +1132,7 @@ private async Task ProcessComplianceOrderListings(ComplianceOrderDto[] listings,
11231132
template.RentalListingId = rentalListing.RentalListingId ?? 0;
11241133
template.To = listing.HostEmails;
11251134
template.Bcc = listing.BccList;
1135+
template.Cc = cc == "" ? [] : new string[] { cc! };
11261136
template.Comment = listing.Comment;
11271137
templates.Add(template);
11281138
}
@@ -1194,7 +1204,7 @@ private async Task SendComplianceOrderEmailFromListingAsync(ComplianceOrderDto[]
11941204
EmailMessageType = template.EmailMessageType,
11951205
MessageDeliveryDtm = DateTime.UtcNow,
11961206
MessageTemplateDsc = template.GetContent(),
1197-
IsSubmitterCcRequired = true, //todo:
1207+
IsSubmitterCcRequired = true,
11981208
UnreportedListingNo = template.ListingId,
11991209
HostEmailAddressDsc = listing.HostEmails.FirstOrDefault(),
12001210
LgEmailAddressDsc = null,

server/StrDss.Service/EmailTemplates/ComplianceOrderFromListing.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ public ComplianceOrderFromListing(IEmailMessageService emailService)
88
: base(emailService)
99
{
1010
EmailMessageType = EmailMessageTypes.ComplianceOrder;
11-
From = Environment.GetEnvironmentVariable("STR_CEU_EMAIL") ?? From;
12-
Subject = "New mail from the Short-term Rental Compliance and Enforcement Unit";
11+
//From = Environment.GetEnvironmentVariable("STR_CEU_EMAIL") ?? From;
12+
Subject = "New mail regarding your short-term rental listing";
1313
}
1414

1515
public long RentalListingId { get; set; }
@@ -22,9 +22,8 @@ public override string GetContent()
2222
{
2323
return (Preview ? GetPreviewHeader() : "") + $@"
2424
Dear Host,<br/><br/>
25-
This message has been sent to you by B.C.'s Short-Term Rental Compliance Unit regarding your short-term rental<br/>
26-
listing: <b>{Url}</b><br/><br/>
27-
{Comment}<br/>
25+
<b>This message has been sent to you by B.C.'s Short-term Rental Compliance Unit regarding your short-term rental listing:</b><br/><b>{Url}</b><br/><br/>
26+
<b>{Comment}</b><br/>
2827
";
2928
}
3029

0 commit comments

Comments
 (0)