Skip to content

FAO tenant village census backend contract#84

Open
pphetra wants to merge 20 commits into
mainfrom
feature/fao-pending-slices
Open

FAO tenant village census backend contract#84
pphetra wants to merge 20 commits into
mainfrom
feature/fao-pending-slices

Conversation

@pphetra

@pphetra pphetra commented May 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements the backend pieces for the FAO Tenant Village Census MVP on the shared feature/fao-pending-slices branch.

Changes include:

  • animal census capability gated behind village capability
  • animal species admin contract
  • official/volunteer census role semantics on village reporter assignments
  • complete VillageCensusSnapshot and AnimalCensusFact persistence
  • submit mutation with complete active-species validation and zero quantity support
  • latest village census read contract
  • read-only animalSpecies query for mobile/reporters

Validation

  • pytest accounts/tests/test_animal_census_backend.py -> 12 passed, 2 warnings
  • pytest accounts/tests/test_animal_census_backend.py accounts/tests/test_village_capability.py accounts/tests/test_village_reporter_onboarding.py -> 28 passed, 2 warnings
  • pytest accounts/tests/test_animal_census_backend.py accounts/tests/test_village_capability.py accounts/tests/test_village_reporter_onboarding.py accounts/tests/test_admin_village_crud.py -> 39 passed, 2 warnings
  • python manage.py check -> no issues
  • git diff --check -> clean

Notes

Full accounts/tests still has the pre-existing unrelated OAuth hash_client_secret issue noted during the slice work. Manual browser/device smoke was not run in this closure pass.

Companion PRs are expected in ohtk-ms and ohtk-mobile from the same branch name.

@pphetra pphetra marked this pull request as ready for review May 5, 2026 08:58
pphetra and others added 17 commits May 14, 2026 11:54
- add tenant-scoped integration clients, webhooks, audit, idempotency, and risk storage

- add report-submitted webhook delivery and external AI/risk/cluster REST APIs

- add incident and census read APIs with focused integration tests
graphene-django 3.x + django-filter 23.x collapse an empty list passed to an
`__in` filter to "match nothing", so a client sending `authorities: []` /
`reportTypes: []` for an unselected multi-value filter got zero results instead
of all. Add EmptyListInsensitiveFilterSet, which strips empty-list args before
validation, and apply it to IncidentReportTypeFilter (covers incidentReports and
boundaryConnectedIncidentReports) and CaseTypeFilter.

Also harden child_authorities_filter in both: read self.data via .get() to avoid
a KeyError once empty keys are stripped, and drop a stray debug print.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant