Skip to content

Plan the move of fund documents out of the templates - #101

Closed
taavipertman-glitch wants to merge 1 commit into
masterfrom
docs/fund-document-automation-plan
Closed

Plan the move of fund documents out of the templates#101
taavipertman-glitch wants to merge 1 commit into
masterfrom
docs/fund-document-automation-plan

Conversation

@taavipertman-glitch

Copy link
Copy Markdown
Contributor

Summary

Adds docs/TODO — Fund document automation.md: the plan for making every document on every fund page updatable without a code change.

Two things drove it. First, the four funds do not carry the same document set — TKF100 is a UCITS fund with a summary of investor rights and its own NAV procedure, the pension funds have neither, and CO2 intensity is not calculated for TKF100 — so a shared field vocabulary needs an explicit per-fund declaration of what applies, not just if ($url). Second, the automated path does not currently work at all, for any fund.

What the plan proposes

One catalogue of document field definitions plus a scope table declaring, per page template, whether each document is required, optional, or absent. ACF binds groups by page template and each fund has its own, so applicability is a location-rule list with per-fund granularity and no if fund == in any template. With show_in_rest, GET /wp-json/wp/v2/pages/{id} then returns exactly the field set that applies to that fund, so the publishing script can reject a not-applicable field instead of ACF silently dropping it.

Steps are ordered so nothing visible changes until the fields are populated and verified, and the hardcoded fallbacks come out last.

Silent failures the plan has to fix

Verified against production, not inferred:

  • No ACF field is REST-writable. No field group in the theme sets show_in_rest, so ACF drops the acf key from every write. GET /wp-json/wp/v2/pages/35292 and /17533 both return "acf": []. scripts/update_acf.py and onboarding-service's WordPressMediaClient both get HTTP 200 and change nothing — TKF100's automated path has never worked.
  • nav_procedure_upcoming_file is read but registered nowhere. fund-savings-details.php:40 reads it; no ACF group defines it. It always returns null, so that row always comes from the hardcoded URL and cannot be set in wp-admin.
  • onboarding-service targets the wrong TKF100 page. FundReportMapping.TKF100 uses slug taiendav-kogumisfond → page 37325, the landing page on page_savings-fund-landing.php. The document fields live on 35292.
  • Neither writer verifies the write. updateAcfReportField treats HTTP 200 as success without checking the field changed.

Why not just rebase #69

#69 predates 19 commits of master and moves one field. Master has since added upcoming prospectus, terms and NAV procedure rows to all four pages — every one of them as a hardcoded template URL, including on TKF100, the fund that is supposed to be ACF-driven. Rebuilding on master with the full field set is less work than rebasing and then repeating the same PR four more times.

Doc only, no code.

🤖 Generated with Claude Code

Every document on a fund page should be updatable without a code change, with
one field vocabulary across all four funds and an explicit declaration of which
documents each fund actually has — TKF100 is a UCITS fund and does not carry the
same set as the pension funds.

The plan records the four silent failures that motivate it: no field group sets
show_in_rest so no ACF write has ever landed, nav_procedure_upcoming_file is
read but registered nowhere, onboarding-service points at the TKF100 landing
page instead of the documents page, and neither writer checks that the field
changed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@taavipertman-glitch

Copy link
Copy Markdown
Contributor Author

Superseded — the plan lives in the private tuleva repo at work/investeerimistegevus/docs/TODO — Fund page document publishing.md, raised as TulevaEE/tuleva#511. TODO docs belong there, not in this repo.

@taavipertman-glitch
taavipertman-glitch deleted the docs/fund-document-automation-plan branch September 10, 2026 08:06
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