-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c40a93c
commit 2155856
Showing
13 changed files
with
139 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace MethodConf.Cms.Dtos; | ||
|
||
public class IssueResponseViewModel | ||
{ | ||
public required string Message { get; set; } | ||
public string? Resolution { get; set; } | ||
public string? Name { get; set; } | ||
public string? Email { get; set; } | ||
public string? Phone { get; set; } | ||
} |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace MethodConf.Cms.Dtos; | ||
|
||
public class NewIssueEmailViewModel | ||
{ | ||
public string? Title { get; set; } | ||
public required string Message { get; set; } | ||
public string? Resolution { get; set; } | ||
public string? Name { get; set; } | ||
public string? Email { get; set; } | ||
public string? Phone { get; set; } | ||
} |
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
40 changes: 39 additions & 1 deletion
40
backend/src/MethodConf.Cms/Services/ConferenceIssueService.cs
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 |
---|---|---|
@@ -1,8 +1,46 @@ | ||
using AutoMapper; | ||
using FluentResults; | ||
using MethodConf.Cms.Domain; | ||
using MethodConf.Cms.Domain.Errors; | ||
using MethodConf.Cms.Infrastructure; | ||
using MethodConf.Cms.Services.Interfaces; | ||
using RazorLight; | ||
using Umbraco.Cms.Core; | ||
using Umbraco.Cms.Core.Mail; | ||
using Umbraco.Cms.Web.Common.PublishedModels; | ||
|
||
namespace MethodConf.Cms.Services; | ||
|
||
public class ConferenceIssueService : IConferenceIssueService | ||
public class ConferenceIssueService( | ||
IPublishedContentQuery publishedContentQuery, | ||
AppDbContext dbContext, | ||
IEmailSender emailSender, | ||
IRazorLightEngine razorEngine, | ||
IMapper mapper) : IConferenceIssueService | ||
{ | ||
public async Task<Result<Issue>> CreateIssue(Guid conferenceId, CreateIssue createIssue) | ||
{ | ||
if (publishedContentQuery.Content(conferenceId) is not Conference conference) | ||
{ | ||
return Result.Fail(new InvalidEntityIdError(conferenceId.ToString())); | ||
} | ||
|
||
var newIssue = mapper.Map<Issue>(createIssue); | ||
newIssue.ConferenceId = conference.Key; | ||
|
||
dbContext.Add(newIssue); | ||
await dbContext.SaveChangesAsync(); | ||
|
||
return newIssue; | ||
} | ||
|
||
private async Task SendOrganizerEmail(Issue issue) | ||
{ | ||
var content = razorEngine. | ||
Check failure on line 39 in backend/src/MethodConf.Cms/Services/ConferenceIssueService.cs
|
||
} | ||
|
||
private async Task SendReporterEmail(Issue issue) | ||
{ | ||
|
||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
backend/src/MethodConf.Cms/Services/DependencyInjection.cs
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
3 changes: 2 additions & 1 deletion
3
backend/src/MethodConf.Cms/Services/Interfaces/IConferenceIssueService.cs
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 |
---|---|---|
@@ -1,8 +1,9 @@ | ||
using FluentResults; | ||
using MethodConf.Cms.Domain; | ||
|
||
namespace MethodConf.Cms.Services.Interfaces; | ||
|
||
public interface IConferenceIssueService | ||
{ | ||
public Task<Issue> CreateIssue(Guid conferenceId, CreateIssue createIssue); | ||
public Task<Result<Issue>> CreateIssue(Guid conferenceId, CreateIssue createIssue); | ||
} |
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
4 changes: 4 additions & 0 deletions
4
backend/src/MethodConf.Cms/Views/Templates/NewIssueAppResponse.cshtml
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<p>If you added contact information, an organizer will be in touch ASAP.</p> | ||
<p>If you added an email, a copy of your message will be sent to you.</p> | ||
<p>If this is urgent, text or call Levi Zitting <a href="tel:4178080501">417-808-0501</a>. You can also locate another conference organizer or volunteer. who are recognizable by their badges/t-shirts (or as otherwise explained by organizers at the beginning of the conference).</p> | ||
<p>In this is an emergency, please call 911.</p> |
19 changes: 19 additions & 0 deletions
19
backend/src/MethodConf.Cms/Views/Templates/NewIssueOrganizerEmail.cshtml
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
@model MethodConf.Cms.Dtos.NewIssueEmailViewModel | ||
@{ | ||
Layout = "~/Views/_EmailLayout.cshtml"; | ||
} | ||
|
||
<p>A new issue for Method Conference has been reported. Here are the details</p> | ||
<p> | ||
<strong>Message:</strong> | ||
<br> | ||
@Model.Message | ||
</p> | ||
<p> | ||
<strong>Resolution:</strong> | ||
<br> | ||
@Model.Resolution | ||
</p> | ||
<p><strong>Name: </strong>@Model.Name</p> | ||
<p><strong>Email: </strong>@Model.Email</p> | ||
<p><strong>Phone: </strong>@Model.Phone</p> |
19 changes: 19 additions & 0 deletions
19
backend/src/MethodConf.Cms/Views/Templates/NewIssueReporterEmail.cshtml
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
@model MethodConf.Cms.Dtos.NewIssueEmailViewModel | ||
@{ | ||
Layout = "~/Views/_EmailLayout.cshtml"; | ||
} | ||
|
||
<p>Here's a copy of the issue you reported. An organizer will follow up with you as soon as possible</p> | ||
<p> | ||
<strong>Message:</strong> | ||
<br> | ||
@Model.Message | ||
</p> | ||
<p> | ||
<strong>Resolution:</strong> | ||
<br> | ||
@Model.Resolution | ||
</p> | ||
<p><strong>Name: </strong>@Model.Name</p> | ||
<p><strong>Email: </strong>@Model.Email</p> | ||
<p><strong>Phone: </strong>@Model.Phone</p> |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>@Model.Title</title> | ||
</head> | ||
<body> | ||
@RenderBody() | ||
</body> | ||
</html> |