-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #153 from bcgov/yj
feat(dss-305): remove organization id from takedown request dto
- Loading branch information
Showing
10 changed files
with
28 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,7 +70,7 @@ | |
"header": [], | ||
"body": { | ||
"mode": "raw", | ||
"raw": "{\r\n \"platformId\": 2,\r\n \"listingId\": 1,\r\n \"listingUrl\": \"https://www.airbnb.com/rooms/16120388?check_in=2024-04-25&check_out=2024-04-27&guests=1&adults=1&s=67&unique_share_id=fa107d24-b0df-49bd-91e4-576dd7d368ab\",\r\n \"hostEmail\": \"[email protected]\",\r\n \"hostEmailSent\": false, \r\n \"reasonId\": 1,\r\n \"sendCopy\": true,\r\n \"ccList\": [\r\n \"[email protected]\"\r\n ],\r\n \"lgContactEmail\": \"[email protected]\",\r\n \"lgContactPhone\": \"123-456-7890\",\r\n \"strBylawUrl\": \"https://bylaw.ca\",\r\n \"comment\": \"Test comment\"\r\n}", | ||
"raw": "{\r\n \"platformId\": 2,\r\n \"listingId\": \"1\",\r\n \"listingUrl\": \"https://www.airbnb.com/rooms/16120388?check_in=2024-04-25&check_out=2024-04-27&guests=1&adults=1&s=67&unique_share_id=fa107d24-b0df-49bd-91e4-576dd7d368ab\",\r\n \"hostEmail\": \"[email protected]\",\r\n \"hostEmailSent\": false, \r\n \"reasonId\": 1,\r\n \"sendCopy\": true,\r\n \"ccList\": [\r\n \"[email protected]\"\r\n ],\r\n \"lgContactEmail\": \"[email protected]\",\r\n \"lgContactPhone\": \"123-456-7890\",\r\n \"strBylawUrl\": \"https://bylaw.ca\",\r\n \"comment\": \"Test comment\"\r\n}", | ||
"options": { | ||
"raw": { | ||
"language": "json" | ||
|
@@ -98,7 +98,7 @@ | |
"header": [], | ||
"body": { | ||
"mode": "raw", | ||
"raw": "{\r\n \"platformId\": 2,\r\n \"listingId\": 1,\r\n \"listingUrl\": \"https://www.airbnb.com/rooms/16120388?check_in=2024-04-25&check_out=2024-04-27&guests=1&adults=1&s=67&unique_share_id=fa107d24-b0df-49bd-91e4-576dd7d368ab\",\r\n \"hostEmail\": \"[email protected]\",\r\n \"hostEmailSent\": false, \r\n \"reasonId\": 5,\r\n \"sendCopy\": true,\r\n \"ccList\": [\r\n \"[email protected]\"\r\n ],\r\n \"lgContactEmail\": \"[email protected]\",\r\n \"lgContactPhone\": \"123-456-7890\",\r\n \"strBylawUrl\": \"https://bylaw.ca\",\r\n \"comment\": \"Test comment\"\r\n}", | ||
"raw": "{\r\n \"platformId\": 2,\r\n \"listingId\": \"1\",\r\n \"listingUrl\": \"https://www.airbnb.com/rooms/16120388?check_in=2024-04-25&check_out=2024-04-27&guests=1&adults=1&s=67&unique_share_id=fa107d24-b0df-49bd-91e4-576dd7d368ab\",\r\n \"hostEmail\": \"\",\r\n \"hostEmailSent\": true, \r\n \"reasonId\": 5,\r\n \"ccList\": [\r\n \"[email protected]\"\r\n ],\r\n \"lgContactEmail\": \"[email protected]\",\r\n \"lgContactPhone\": \"123-456-7890\",\r\n \"strBylawUrl\": \"https://bylaw.ca\",\r\n \"comment\": \"Test comment\"\r\n}", | ||
"options": { | ||
"raw": { | ||
"language": "json" | ||
|
@@ -127,7 +127,7 @@ | |
"header": [], | ||
"body": { | ||
"mode": "raw", | ||
"raw": "{\r\n \"lgId\": 1,\r\n \"platformId\": 2,\r\n \"listingId\": 1,\r\n \"listingUrl\": \"https://www.airbnb.com/rooms/16120388?check_in=2024-04-25&check_out=2024-04-27&guests=1&adults=1&s=67&unique_share_id=fa107d24-b0df-49bd-91e4-576dd7d368ab\",\r\n \"sendCopy\": true,\r\n \"ccList\": [\r\n \"[email protected]\"\r\n ]\r\n}", | ||
"raw": "{\r\n \"platformId\": 2,\r\n \"listingId\": \"1\",\r\n \"listingUrl\": \"https://www.airbnb.com/rooms/16120388?check_in=2024-04-25&check_out=2024-04-27&guests=1&adults=1&s=67&unique_share_id=fa107d24-b0df-49bd-91e4-576dd7d368ab\",\r\n \"sendCopy\": true,\r\n \"ccList\": [\r\n \"[email protected]\"\r\n ]\r\n}", | ||
"options": { | ||
"raw": { | ||
"language": "json" | ||
|
@@ -155,7 +155,7 @@ | |
"header": [], | ||
"body": { | ||
"mode": "raw", | ||
"raw": "{\r\n \"lgId\": 1,\r\n \"platformId\": 2,\r\n \"listingId\": 1,\r\n \"listingUrl\": \"https://www.airbnb.com/rooms/16120388?check_in=2024-04-25&check_out=2024-04-27&guests=1&adults=1&s=67&unique_share_id=fa107d24-b0df-49bd-91e4-576dd7d368ab\",\r\n \"sendCopy\": true,\r\n \"ccList\": [\r\n \"[email protected]\"\r\n ]\r\n}", | ||
"raw": "{\r\n \"platformId\": 2,\r\n \"listingId\": \"1\",\r\n \"listingUrl\": \"https://www.airbnb.com/rooms/16120388?check_in=2024-04-25&check_out=2024-04-27&guests=1&adults=1&s=67&unique_share_id=fa107d24-b0df-49bd-91e4-576dd7d368ab\",\r\n \"sendCopy\": true,\r\n \"ccList\": [\r\n \"[email protected]\"\r\n ]\r\n}", | ||
"options": { | ||
"raw": { | ||
"language": "json" | ||
|
@@ -559,7 +559,7 @@ | |
"formdata": [ | ||
{ | ||
"key": "ReportPeriod", | ||
"value": "2024-05", | ||
"value": "2024-03", | ||
"type": "text" | ||
}, | ||
{ | ||
|
@@ -570,7 +570,7 @@ | |
{ | ||
"key": "File", | ||
"type": "file", | ||
"src": "postman-cloud:///1eef47cf-0716-4770-88ff-15d6dd59453f" | ||
"src": "/C:/Users/chungy/OneDrive - Advanced Solutions, a DXC Technology Company/Documents/STR/listing-valid2.csv" | ||
} | ||
] | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,6 @@ | |
using Microsoft.Extensions.Logging; | ||
using Moq; | ||
using StrDss.Common; | ||
using StrDss.Data.Entities; | ||
using StrDss.Data.Repositories; | ||
using StrDss.Model; | ||
using StrDss.Model.DelistingDtos; | ||
using StrDss.Model.OrganizationDtos; | ||
|
@@ -323,18 +321,19 @@ public async Task ValidateDelistingRequest_NullLocalGovernment_ReturnsLocalGover | |
[Frozen] Mock<IConfiguration> configMock, | ||
[Frozen] Mock<IChesTokenApi> chesTokenApiMock, | ||
[Frozen] Mock<ILogger<StrDssLogger>> loggerMock, | ||
[Frozen] Mock<ICurrentUser> currentUserMock, | ||
DelistingService sut) | ||
{ | ||
// Arrange | ||
dto.LgId = 0; | ||
currentUserMock.Setup(m => m.OrganizationId).Returns(0); | ||
|
||
// Act | ||
var result = await sut.CreateTakedownRequestAsync(dto); | ||
|
||
// Assert | ||
Assert.Contains("lgId", result.Keys); | ||
Assert.Single(result["lgId"]); | ||
Assert.Equal($"Local Government ID ({dto.LgId}) does not exist.", result["lgId"].First()); | ||
Assert.Equal($"Local Government ID (0) does not exist.", result["lgId"].First()); | ||
} | ||
|
||
[Theory] | ||
|
@@ -506,12 +505,14 @@ public async Task SendDelistingRequestAsync_WhenCalled_ShouldSendEmail( | |
DelistingService sut) | ||
{ | ||
// Arrange | ||
dto.PlatformId = 2; | ||
currentUserMock.Setup(m => m.EmailAddress).Returns("[email protected]"); | ||
currentUserMock.Setup(m => m.OrganizationId).Returns(1); | ||
orgServiceMock.Setup(x => x.GetOrganizationByIdAsync(dto.PlatformId)).ReturnsAsync(platform); | ||
|
||
var lg = CommonUtils.CloneObject(platform); | ||
lg.OrganizationType = OrganizationTypes.LG; | ||
orgServiceMock.Setup(x => x.GetOrganizationByIdAsync(dto.LgId)).ReturnsAsync(lg); | ||
orgServiceMock.Setup(x => x.GetOrganizationByIdAsync(1)).ReturnsAsync(lg); | ||
|
||
platform.ContactPeople.First().EmailMessageType = EmailMessageTypes.TakedownRequest; | ||
|
||
|
@@ -534,13 +535,15 @@ public async Task SendDelistingRequestAsync_WhenSendCopyIsTrue_AddsCurrentUserEm | |
{ | ||
// Arrange | ||
dto.SendCopy = true; | ||
dto.PlatformId = 2; | ||
var currentUserEmail = "[email protected]"; | ||
currentUserMock.Setup(m => m.EmailAddress).Returns(currentUserEmail); | ||
currentUserMock.Setup(m => m.OrganizationId).Returns(1); | ||
orgServiceMock.Setup(x => x.GetOrganizationByIdAsync(dto.PlatformId)).ReturnsAsync(platform); | ||
|
||
var lg = CommonUtils.CloneObject(platform); | ||
lg.OrganizationType = OrganizationTypes.LG; | ||
orgServiceMock.Setup(x => x.GetOrganizationByIdAsync(dto.LgId)).ReturnsAsync(lg); | ||
orgServiceMock.Setup(x => x.GetOrganizationByIdAsync(1)).ReturnsAsync(lg); | ||
|
||
platform.ContactPeople.First().EmailMessageType = EmailMessageTypes.TakedownRequest; | ||
|
||
|