-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Rework exported data * Add export note functionality * fix condition * updated queries to always show polling station and county info * Revert ngo changes Co-authored-by: Irina Borozan <[email protected]>
- Loading branch information
Showing
9 changed files
with
279 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
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
19 changes: 19 additions & 0 deletions
19
src/api/VoteMonitor.Api.DataExport/Models/NotesExportModel.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System; | ||
|
||
namespace VoteMonitor.Api.DataExport.Models | ||
{ | ||
public class NotesExportModel | ||
{ | ||
public string ObserverPhone { get; set; } | ||
public int IdNgo { get; set; } | ||
public string FormCode { get; set; } | ||
public string QuestionText { get; set; } | ||
public string OptionText { get; set; } | ||
public string AnswerFreeText { get; set; } | ||
public string NoteText { get; set; } | ||
public string NoteAttachmentPath { get; set; } | ||
public DateTime LastModified { get; set; } | ||
public string CountyCode { get; set; } | ||
public int PollingStationNumber { 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 |
---|---|---|
|
@@ -13,4 +13,5 @@ public GenerateCSVFile(IEnumerable<ExportModelDto> data) | |
Data = data; | ||
} | ||
} | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
src/api/VoteMonitor.Api.DataExport/Queries/GenerateNotesCSVFile.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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using MediatR; | ||
using System.Collections.Generic; | ||
using VoteMonitor.Api.DataExport.Models; | ||
|
||
namespace VoteMonitor.Api.DataExport.Queries | ||
{ | ||
public class GenerateNotesCSVFile : IRequest<byte[]> | ||
{ | ||
public IEnumerable<NotesExportModel> Data { get; } | ||
|
||
public GenerateNotesCSVFile(IEnumerable<NotesExportModel> data) | ||
{ | ||
Data = data; | ||
} | ||
} | ||
|
||
} |
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
20 changes: 20 additions & 0 deletions
20
src/api/VoteMonitor.Api.DataExport/Queries/GetNotesForExport.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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using MediatR; | ||
using System; | ||
using System.Collections.Generic; | ||
using VoteMonitor.Api.DataExport.Models; | ||
|
||
namespace VoteMonitor.Api.DataExport.Queries | ||
{ | ||
public class GetNotesForExport : IRequest<IEnumerable<NotesExportModel>> | ||
{ | ||
public int? NgoId { get; set; } | ||
public int? ObserverId { get; set; } | ||
public int? PollingStationNumber { get; set; } | ||
public string County { get; set; } | ||
public DateTime? From { get; set; } | ||
public DateTime? To { get; set; } | ||
|
||
public bool ApplyFilters => NgoId.HasValue || ObserverId.HasValue || PollingStationNumber.HasValue || | ||
From.HasValue || To.HasValue || !string.IsNullOrEmpty(County); | ||
} | ||
} |