Summary
POST /api/dts/enrich returns unsupported webhook type: showcase for the showcase DTS type, so operators cannot live-preview or iterate Showcase templates in the config/DTS editor. Every other alert type previews fine.
Impact
Operator-side tooling only — the DTS editor's "enrich preview" feature. Live delivery and the test command are not affected (see below).
Explicitly NOT affected (these work — do not change them)
- Live Showcase delivery —
ProcessShowcase (processor/cmd/processor/showcase.go:68), called from the webhook receiver (processor/internal/webhook/receiver.go:162).
!poracle-test showcase — processTestShowcase (processor/cmd/processor/test.go:297), a separate path that does not go through enrichForType.
Reproduction
POST /api/dts/enrich with {"type": "showcase", "webhook": <a showcase sample from fallbacks/testdata.json>, ...} → error unsupported webhook type: showcase.
Root cause
ProcessorService.enrichForType (processor/cmd/processor/enrich.go:41) dispatches non-derived types via a switch webhookType with cases for pokemon, raid, egg, quest, invasion, lure, nest, gym, fort_update, max_battle — but no case "showcase" — so it falls to default: return nil, fmt.Errorf("unsupported webhook type: %s", ...).
Meanwhile dtsAlias("showcase") (processor/internal/dtsmap/dtsmap.go:68) resolves to {WebhookType: "showcase", TemplateType: "showcase"} — so the type is declared but not dispatched. EnrichWebhook (processor/cmd/processor/enrich.go:155, which POST /api/dts/enrich calls via processor/internal/api/huma_dts_writes.go:375) therefore errors.
The enrichment logic already exists — it's just not wired into enrichForType
Both ProcessShowcase and processTestShowcase build the showcase enrichment the same way: enricher.Invasion(...) for the base pokéstop fields, an override base["pokestop_name"] = sc.Name, then InvasionTranslate + ShowcaseFocusTranslate for the per-language focus/leaderboard fields (see processTestShowcase at processor/cmd/processor/test.go:297, and ShowcaseFocusTranslate in processor/internal/enrichment/showcase.go).
Proposed fix
- Factor the showcase enrichment into a shared
ps.enrichShowcase(raw, language, freshenStaleTime) (*enrichResult, error) returning templateType: "showcase".
- Add
case "showcase": result, err = ps.enrichShowcase(...) to the enrichForType switch.
- Ideally have
ProcessShowcase / processTestShowcase call the same shared method to remove the current duplication.
Cleanup enabled by the fix
The api-pack conformance test currently works around this gap with a mirror helper — enrichShowcaseForConformance in processor/cmd/processor/api_pack_conformance_test.go:157 (a duplicate of processTestShowcase's enrichment). Once enrichForType("showcase", ...) works, delete that helper and switch the test's showcase subtest to the standard enrichForType path (as every other type already uses).
Acceptance criteria
POST /api/dts/enrich with a showcase sample returns a populated variable map (templateType: "showcase"; non-empty base incl. pokestop_name, showcasePresent, the showcase[] leaderboard entries, and focus fields).
enrichForType("showcase", raw, "en", true) returns a non-error *enrichResult.
api_pack_conformance_test.go drops enrichShowcaseForConformance and renders showcase via enrichForType, still passing.
- No change to live Showcase delivery or
!poracle-test showcase behaviour.
go build ./... && go vet ./... && go test -count=1 ./... && golangci-lint run ./... all green.
Scope note
Independent of the API delivery work (PR #171) — a pre-existing gap in the enrich-dispatch / editor-preview path, surfaced (not caused) by that PR's conformance test. Safe to do as its own PR.
Summary
POST /api/dts/enrichreturnsunsupported webhook type: showcasefor theshowcaseDTS type, so operators cannot live-preview or iterate Showcase templates in the config/DTS editor. Every other alert type previews fine.Impact
Operator-side tooling only — the DTS editor's "enrich preview" feature. Live delivery and the test command are not affected (see below).
Explicitly NOT affected (these work — do not change them)
ProcessShowcase(processor/cmd/processor/showcase.go:68), called from the webhook receiver (processor/internal/webhook/receiver.go:162).!poracle-test showcase—processTestShowcase(processor/cmd/processor/test.go:297), a separate path that does not go throughenrichForType.Reproduction
POST /api/dts/enrichwith{"type": "showcase", "webhook": <a showcase sample from fallbacks/testdata.json>, ...}→ errorunsupported webhook type: showcase.Root cause
ProcessorService.enrichForType(processor/cmd/processor/enrich.go:41) dispatches non-derived types via aswitch webhookTypewith cases forpokemon,raid,egg,quest,invasion,lure,nest,gym,fort_update,max_battle— but nocase "showcase"— so it falls todefault: return nil, fmt.Errorf("unsupported webhook type: %s", ...).Meanwhile
dtsAlias("showcase")(processor/internal/dtsmap/dtsmap.go:68) resolves to{WebhookType: "showcase", TemplateType: "showcase"}— so the type is declared but not dispatched.EnrichWebhook(processor/cmd/processor/enrich.go:155, whichPOST /api/dts/enrichcalls viaprocessor/internal/api/huma_dts_writes.go:375) therefore errors.The enrichment logic already exists — it's just not wired into
enrichForTypeBoth
ProcessShowcaseandprocessTestShowcasebuild the showcase enrichment the same way:enricher.Invasion(...)for the base pokéstop fields, an overridebase["pokestop_name"] = sc.Name, thenInvasionTranslate+ShowcaseFocusTranslatefor the per-language focus/leaderboard fields (seeprocessTestShowcaseatprocessor/cmd/processor/test.go:297, andShowcaseFocusTranslateinprocessor/internal/enrichment/showcase.go).Proposed fix
ps.enrichShowcase(raw, language, freshenStaleTime) (*enrichResult, error)returningtemplateType: "showcase".case "showcase": result, err = ps.enrichShowcase(...)to theenrichForTypeswitch.ProcessShowcase/processTestShowcasecall the same shared method to remove the current duplication.Cleanup enabled by the fix
The api-pack conformance test currently works around this gap with a mirror helper —
enrichShowcaseForConformanceinprocessor/cmd/processor/api_pack_conformance_test.go:157(a duplicate ofprocessTestShowcase's enrichment). OnceenrichForType("showcase", ...)works, delete that helper and switch the test'sshowcasesubtest to the standardenrichForTypepath (as every other type already uses).Acceptance criteria
POST /api/dts/enrichwith a showcase sample returns a populated variable map (templateType: "showcase"; non-empty base incl.pokestop_name,showcasePresent, theshowcase[]leaderboard entries, and focus fields).enrichForType("showcase", raw, "en", true)returns a non-error*enrichResult.api_pack_conformance_test.godropsenrichShowcaseForConformanceand rendersshowcaseviaenrichForType, still passing.!poracle-test showcasebehaviour.go build ./... && go vet ./... && go test -count=1 ./... && golangci-lint run ./...all green.Scope note
Independent of the API delivery work (PR #171) — a pre-existing gap in the enrich-dispatch / editor-preview path, surfaced (not caused) by that PR's conformance test. Safe to do as its own PR.