Skip to content

Fix/v2 filters and staff access - #1102

Merged
idormenco merged 7 commits into
mainfrom
fix/v2-filters-and-staff-access
Oct 12, 2026
Merged

idormenco merged 7 commits into
mainfrom
fix/v2-filters-and-staff-access

Conversation

@idormenco

Copy link
Copy Markdown
Contributor

No description provided.

@vercel

vercel Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
votemonitor Error Error Oct 12, 2026 1:23pm UTC

Request Review

ion.dormenco and others added 7 commits October 12, 2026 16:23
…f access

- Fix GetCitizenReportEntries, GetIncidentReportEntries and GetQuickReportEntries
  (missing MonitoringNgos join, varchar/text mismatches, missing listing columns)
  in a new migration
- Rewrite v2 listings to read from the entry functions with whitelisted
  ORDER BY clauses; byObserverV2 lists only matching observers when filtered
- Remove CitizenReportFilterQuery; inline the citizen by-form query
- Add coalitionMemberId v2 filter field for submissions, incidents and quick reports
- exported-data:v2 takes `filter` and validates it up front
- Fix citizen export hasFlaggedAnswers=true always returning nothing
- NGO staff: add ngo_id claim, fix admin-or-staff handler, add citizen reporting
  admin-or-staff requirement; reads and exports allowed, writes admin-only
- Require an active monitoring NGO on remaining NGO list/statistics reads
- Restrict monitoring NGO removal, disable citizen reporting and NGO admin/staff
  activation to platform admins

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Back IReadRepository<T> with a new EfReadRepository<T> that runs every query,
  projection and GetByIdAsync with AsNoTracking (IReadRepository previously
  resolved to the same tracking EfRepository)
- Move write endpoints that load entities later attached to saved aggregates
  from IReadRepository to IRepository so they keep tracking
- Use IReadRepository in NgoAdmins/Get and NgoStaff/Get
- Add AsNoTracking to root EF queries in read endpoints using VoteMonitorContext
- Update unit test mocks for the repository changes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Remove EfReadRepository; IReadRepository resolves to EfRepository again
- Restore write endpoints and their tests to IReadRepository
- Add Query.AsNoTracking() to specifications used only by read endpoints
  (https://specification.ardalis.com/features/asnotracking.html)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Specifications used by both read and write endpoints keep tracking for the
writes; read endpoints now use a *ReadOnlySpecification copy that adds
Query.AsNoTracking().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- New Feature.PollingStationCorrections module with AddPollingStationCorrections migration
- ListAll and Move endpoints for form submissions, quick reports, incident reports,
  citizen reports and polling station information
- NotObservers authorization policy
- PersonalDataMasker helper with tests
- Remove orphaned IssueReports unit test projects
@idormenco
idormenco force-pushed the fix/v2-filters-and-staff-access branch from a087c6f to af3c81b Compare October 12, 2026 13:23
@idormenco
idormenco merged commit f5014c8 into main Oct 12, 2026
3 of 4 checks passed
@idormenco
idormenco deleted the fix/v2-filters-and-staff-access branch October 12, 2026 13:30
{
electionRoundId = req.ElectionRoundId,
recordType = req.RecordType.Value,
recordId = (Guid?)req.RecordId,
electionRoundId = req.ElectionRoundId,
recordType = req.RecordType.Value,
recordId = (Guid?)req.RecordId,
monitoringNgoId = (Guid?)null,
recordType = req.RecordType.Value,
recordId = (Guid?)req.RecordId,
monitoringNgoId = (Guid?)null,
searchText = (string?)null,
recordId = (Guid?)req.RecordId,
monitoringNgoId = (Guid?)null,
searchText = (string?)null,
pollingStationNumber = (string?)null,
monitoringNgoId = (Guid?)null,
searchText = (string?)null,
pollingStationNumber = (string?)null,
correctedOnly = (bool?)null,
level1 = (string?)null,
level2 = (string?)null,
level3 = (string?)null,
level4 = (string?)null,
level2 = (string?)null,
level3 = (string?)null,
level4 = (string?)null,
level5 = (string?)null
{
electionRoundId = req.ElectionRoundId,
recordType = req.RecordType?.Value,
recordId = (Guid?)null,

Query
.Where(x => x.ElectionRoundId == electionRoundId && quickReportIds.Contains(x.QuickReportId))
.Where(x=>x.IsDeleted == false)

/// <param name="recordTypeExpression">The SQL expression holding the record type, e.g. <c>R."RecordType"</c>.</param>
/// <param name="recordIdColumn">The SQL expression holding the record id, e.g. <c>R."Id"</c>.</param>
public static string ForRecord(string recordTypeExpression, string recordIdColumn) => $"""

This branch had an error being deployed

1 failed deployment
Preview — af3c81bf Deployed Oct 12, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants