Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Serve household reports at /v2/reports

Aberta
#4,131 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 2 dias

@anth-volk já está trabalhando nisso.

Desde 29/10/2026.

  • #4132 de @anth-volk — aberto

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
48/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
python
Domínio
api, backend

Direção de pesquisa

Start by tracing the existing economy report routes and simulation service flow for POST /v2/reports, report reads, reruns, and saved reports. Then follow the household and policy validation paths described in the issue, including country checks and default-year handling. Done means household reports can be created, read, rerun, and saved by ID, including for household-only countries, while the specified invalid requests are rejected.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

What

Add the household kind of /v2/reports. A household report calculates a household stored through /v2/households under a baseline policy and an optional reform policy, each a stored /v2/policies policy or current law, for the household's default year. The simulation service calculates and stores it, as it does economy reports.

  • POST /v2/reports accepts kind: "household" with the household and the policies.
  • GET /v2/reports/{report_id} and GET /v2/reports?report_id=… read household reports beside economy reports.
  • POST /v2/reports/{report_id}/runs runs a household report again, with force to recalculate.
  • Saved reports (/v2/user-reports) accept household report IDs.

It works for any country whose countries row has household_enabled, including a household-only country, where economy reports are refused with 422.

Why

The newer app interface needs persisted, shareable household reports with their own IDs once it moves to the v2 routes, and the economy kind of /v2/reports cannot hold a household. Before asking the simulation service, the Public API checks what it decides itself: that the country has household calculations, that the household and policies are the country's, and that the household has a default year. The simulation service reads the household and policies from the Public API's tables itself, so the Public API sends only their IDs.

Linguagem predominante
Python
Estrelas
18
Forks
33
Merge médio
2d 7h
PRs com merge (30d)
64

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de PolicyEngine/policyengine-api

Todas as issues de PolicyEngine/policyengine-api

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.