-
Notifications
You must be signed in to change notification settings - Fork 26
User/paulantal/add sms ingestion api #981
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
paul-antal
wants to merge
3
commits into
commitglobal:main
Choose a base branch
from
paul-antal:user/paulantal/add-sms-ingestion-api
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,104 @@ | ||
| | ||
| Microsoft Visual Studio Solution File, Format Version 12.00 | ||
| # Visual Studio Version 17 | ||
| VisualStudioVersion = 17.14.36310.24 | ||
| MinimumVisualStudioVersion = 10.0.40219.1 | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vote.Monitor.Ingestor.Core", "src\Vote.Monitor.Ingestor.Core\Vote.Monitor.Ingestor.Core.csproj", "{79AB5114-0915-17CE-0242-EA62DB5B8CA5}" | ||
| EndProject | ||
| Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}" | ||
| EndProject | ||
| Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{0E5E03C8-4D32-4739-814D-8FE9429C9B48}" | ||
| EndProject | ||
| Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{56C0C5FD-101A-474B-B6BC-9BEDA8BB9EEE}" | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vote.Monitor.Domain", "src\Vote.Monitor.Domain\Vote.Monitor.Domain.csproj", "{6B9F50DD-275A-3271-8ABA-CDA6810807F4}" | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vote.Monitor.Ingestor.Api", "src\Vote.Monitor.Ingestor.Api\Vote.Monitor.Ingestor.Api.csproj", "{81BC5DC5-5670-42AE-8A47-217A913BCF87}" | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vote.Monitor.Ingestor.Core.UnitTests", "tests\Vote.Monitor.Ingestor.Core.UnitTests\Vote.Monitor.Ingestor.Core.UnitTests.csproj", "{781679E9-0733-9CBE-CDFC-48312F4187A3}" | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authorization.Policies", "src\Authorization.Policies\Authorization.Policies.csproj", "{90976F7F-0DF4-DEC5-F418-C7C1EB13B6B7}" | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Module.Answers", "src\Module.Answers\Module.Answers.csproj", "{723225B2-3DAF-662C-8E0F-181BCED49C1B}" | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Feature.Auth", "src\Feature.Auth\Feature.Auth.csproj", "{ACC84E43-FD92-B72C-3859-1FF41C12C070}" | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vote.Monitor.Core", "src\Vote.Monitor.Core\Vote.Monitor.Core.csproj", "{C0A7C75B-FAF8-E938-0738-A9CC7F010721}" | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Feature.Form.Submission.SMS", "src\Feature.Form.Submission.SMS\Feature.Form.Submission.SMS.csproj", "{982CFDB2-C1EC-22B1-BC80-720B31D8EAC8}" | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Feature.Form.Submission.SMS.UnitTests", "tests\Feature.Form.Submission.SMS.UnitTests\Feature.Form.Submission.SMS.UnitTests.csproj", "{B5FD0884-6C63-4113-8D91-6031E00B979B}" | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vote.Monitor.TestUtils", "tests\Vote.Monitor.TestUtils\Vote.Monitor.TestUtils.csproj", "{E7E2E54A-3DBB-1A18-13A9-4C8E8C5DDD58}" | ||
| EndProject | ||
| Global | ||
| GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
| Debug|Any CPU = Debug|Any CPU | ||
| Release|Any CPU = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
| {79AB5114-0915-17CE-0242-EA62DB5B8CA5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {79AB5114-0915-17CE-0242-EA62DB5B8CA5}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {79AB5114-0915-17CE-0242-EA62DB5B8CA5}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {79AB5114-0915-17CE-0242-EA62DB5B8CA5}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {6B9F50DD-275A-3271-8ABA-CDA6810807F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {6B9F50DD-275A-3271-8ABA-CDA6810807F4}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {6B9F50DD-275A-3271-8ABA-CDA6810807F4}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {6B9F50DD-275A-3271-8ABA-CDA6810807F4}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {81BC5DC5-5670-42AE-8A47-217A913BCF87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {81BC5DC5-5670-42AE-8A47-217A913BCF87}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {81BC5DC5-5670-42AE-8A47-217A913BCF87}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {81BC5DC5-5670-42AE-8A47-217A913BCF87}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {781679E9-0733-9CBE-CDFC-48312F4187A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {781679E9-0733-9CBE-CDFC-48312F4187A3}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {781679E9-0733-9CBE-CDFC-48312F4187A3}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {781679E9-0733-9CBE-CDFC-48312F4187A3}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {90976F7F-0DF4-DEC5-F418-C7C1EB13B6B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {90976F7F-0DF4-DEC5-F418-C7C1EB13B6B7}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {90976F7F-0DF4-DEC5-F418-C7C1EB13B6B7}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {90976F7F-0DF4-DEC5-F418-C7C1EB13B6B7}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {723225B2-3DAF-662C-8E0F-181BCED49C1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {723225B2-3DAF-662C-8E0F-181BCED49C1B}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {723225B2-3DAF-662C-8E0F-181BCED49C1B}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {723225B2-3DAF-662C-8E0F-181BCED49C1B}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {ACC84E43-FD92-B72C-3859-1FF41C12C070}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {ACC84E43-FD92-B72C-3859-1FF41C12C070}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {ACC84E43-FD92-B72C-3859-1FF41C12C070}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {ACC84E43-FD92-B72C-3859-1FF41C12C070}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {C0A7C75B-FAF8-E938-0738-A9CC7F010721}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {C0A7C75B-FAF8-E938-0738-A9CC7F010721}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {C0A7C75B-FAF8-E938-0738-A9CC7F010721}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {C0A7C75B-FAF8-E938-0738-A9CC7F010721}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {982CFDB2-C1EC-22B1-BC80-720B31D8EAC8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {982CFDB2-C1EC-22B1-BC80-720B31D8EAC8}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {982CFDB2-C1EC-22B1-BC80-720B31D8EAC8}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {982CFDB2-C1EC-22B1-BC80-720B31D8EAC8}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {B5FD0884-6C63-4113-8D91-6031E00B979B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {B5FD0884-6C63-4113-8D91-6031E00B979B}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {B5FD0884-6C63-4113-8D91-6031E00B979B}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {B5FD0884-6C63-4113-8D91-6031E00B979B}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {E7E2E54A-3DBB-1A18-13A9-4C8E8C5DDD58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {E7E2E54A-3DBB-1A18-13A9-4C8E8C5DDD58}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {E7E2E54A-3DBB-1A18-13A9-4C8E8C5DDD58}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {E7E2E54A-3DBB-1A18-13A9-4C8E8C5DDD58}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(SolutionProperties) = preSolution | ||
| HideSolutionNode = FALSE | ||
| EndGlobalSection | ||
| GlobalSection(NestedProjects) = preSolution | ||
| {79AB5114-0915-17CE-0242-EA62DB5B8CA5} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} | ||
| {6B9F50DD-275A-3271-8ABA-CDA6810807F4} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} | ||
| {81BC5DC5-5670-42AE-8A47-217A913BCF87} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} | ||
| {781679E9-0733-9CBE-CDFC-48312F4187A3} = {0E5E03C8-4D32-4739-814D-8FE9429C9B48} | ||
| {90976F7F-0DF4-DEC5-F418-C7C1EB13B6B7} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} | ||
| {723225B2-3DAF-662C-8E0F-181BCED49C1B} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} | ||
| {ACC84E43-FD92-B72C-3859-1FF41C12C070} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} | ||
| {C0A7C75B-FAF8-E938-0738-A9CC7F010721} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} | ||
| {982CFDB2-C1EC-22B1-BC80-720B31D8EAC8} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} | ||
| {B5FD0884-6C63-4113-8D91-6031E00B979B} = {0E5E03C8-4D32-4739-814D-8FE9429C9B48} | ||
| {E7E2E54A-3DBB-1A18-13A9-4C8E8C5DDD58} = {0E5E03C8-4D32-4739-814D-8FE9429C9B48} | ||
| EndGlobalSection | ||
| GlobalSection(ExtensibilityGlobals) = postSolution | ||
| SolutionGuid = {D19E1043-BFA3-44D0-B12F-CFB706EC6754} | ||
| EndGlobalSection | ||
| EndGlobal |
20 changes: 20 additions & 0 deletions
20
api/src/Feature.Form.Submission.SMS/Feature.Form.Submission.SMS.csproj
This file contains hidden or 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,20 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>net8.0</TargetFramework> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| <Nullable>enable</Nullable> | ||
| </PropertyGroup> | ||
| <ItemGroup> | ||
| <PackageReference Include="Ardalis.SmartEnum.Dapper" /> | ||
| <PackageReference Include="Ardalis.SmartEnum.SystemTextJson" /> | ||
| <PackageReference Include="FastEndpoints" /> | ||
| <PackageReference Include="FastEndpoints.Security" /> | ||
| <PackageReference Include="Microsoft.AspNetCore.Authorization" /> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <ProjectReference Include="..\Authorization.Policies\Authorization.Policies.csproj" /> | ||
| <ProjectReference Include="..\Module.Answers\Module.Answers.csproj" /> | ||
| <ProjectReference Include="..\Vote.Monitor.Ingestor.Core\Vote.Monitor.Ingestor.Core.csproj" /> | ||
| </ItemGroup> | ||
| </Project> |
27 changes: 27 additions & 0 deletions
27
api/src/Feature.Form.Submission.SMS/FormSubmissionModel.cs
This file contains hidden or 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,27 @@ | ||
| using Module.Answers.Mappers; | ||
| using Module.Answers.Models; | ||
| using Vote.Monitor.Domain.Entities.FormSubmissionAggregate; | ||
|
|
||
| namespace Feature.Form.Submission.SMS; | ||
|
|
||
| public record FormSubmissionModel | ||
| { | ||
| public required Guid Id { get; init; } | ||
| public required Guid FormId { get; init; } | ||
| public required Guid PollingStationId { get; init; } | ||
| public SubmissionFollowUpStatus FollowUpStatus { get; init; } | ||
| public IReadOnlyList<BaseAnswerModel> Answers { get; init; } | ||
| public bool IsCompleted { get; init; } | ||
|
|
||
| public static FormSubmissionModel FromEntity(FormSubmission entity) => new() | ||
| { | ||
| Id = entity.Id, | ||
| PollingStationId = entity.PollingStationId, | ||
| FormId = entity.FormId, | ||
| Answers = entity.Answers | ||
| .Select(AnswerMapper.ToModel) | ||
| .ToList(), | ||
| FollowUpStatus = entity.FollowUpStatus, | ||
| IsCompleted = entity.IsCompleted | ||
| }; | ||
| } |
This file contains hidden or 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,3 @@ | ||
| global using FormAggregate = Vote.Monitor.Domain.Entities.FormAggregate.Form; | ||
| global using MonitoringObserverAggregate = Vote.Monitor.Domain.Entities.MonitoringObserverAggregate.MonitoringObserver; | ||
| global using PollingStationAggregate = Vote.Monitor.Domain.Entities.PollingStationAggregate.PollingStation; | ||
10 changes: 10 additions & 0 deletions
10
api/src/Feature.Form.Submission.SMS/Specifications/GetFormSpecification.cs
This file contains hidden or 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 @@ | ||
| using Ardalis.Specification; | ||
|
|
||
| namespace Feature.Form.Submission.SMS.Specifications; | ||
| public class GetFormSpecification : SingleResultSpecification<FormAggregate> | ||
| { | ||
| public GetFormSpecification(string formCode, Guid electionRoundId, Guid monitoringNgoId) | ||
| { | ||
| Query.Where(f => f.Code == formCode && f.ElectionRoundId == electionRoundId && f.MonitoringNgoId == monitoringNgoId); | ||
| } | ||
| } |
11 changes: 11 additions & 0 deletions
11
api/src/Feature.Form.Submission.SMS/Specifications/GetMonitoringObserver.cs
This file contains hidden or 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 @@ | ||
| using Ardalis.Specification; | ||
| using Vote.Monitor.Domain.Entities.MonitoringObserverAggregate; | ||
|
|
||
| namespace Feature.Form.Submission.SMS.Specifications; | ||
| public class GetMonitoringObserver : SingleResultSpecification<MonitoringObserver> | ||
| { | ||
| public GetMonitoringObserver(string phoneNumber, Guid monitoringNgoId, Guid electionRoundId) | ||
| { | ||
| Query.Where(mo => mo.PhoneNumber == phoneNumber && mo.MonitoringNgoId == monitoringNgoId && mo.ElectionRoundId == electionRoundId); | ||
| } | ||
| } |
12 changes: 12 additions & 0 deletions
12
api/src/Feature.Form.Submission.SMS/Specifications/GetPollingStation.cs
This file contains hidden or 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,12 @@ | ||
| using Ardalis.Specification; | ||
| using Vote.Monitor.Domain.Entities.MonitoringObserverAggregate; | ||
| using Vote.Monitor.Domain.Entities.PollingStationAggregate; | ||
|
|
||
| namespace Feature.Form.Submission.SMS.Specifications; | ||
| public class GetPollingStation : SingleResultSpecification<PollingStation> | ||
| { | ||
| public GetPollingStation(string pollingStationCode, Guid electionRoundId) | ||
| { | ||
| Query.Where(ps => ps.SecondaryId == pollingStationCode && ps.ElectionRoundId == electionRoundId); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.