@@ -8,7 +8,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
88
99Ferrio API is a Symfony 7.4 / PHP 8.5 application that serves holiday data (fixed and floating) across multiple
1010languages and countries. It exposes a versioned JSON REST API (v1, v2, v3) and includes a Twig-based admin UI (
11- ` /manage ` ) protected by HTTP Basic Auth.
11+ ` /admin ` , with a 301 redirect from the legacy ` / manage` prefix ) protected by HTTP Basic Auth.
1212
1313## Commands
1414
@@ -76,7 +76,8 @@ Single endpoint: `GET /v3/holidays` with query parameters:
7676- ` grouping ` (optional, default ` false ` ) — when ` true ` , groups holidays by day in v2-compatible ` HolidayDay ` format
7777
7878The v3 merges fixed and floating holidays into a unified flat list sorted by date. Each item has a prefixed ` id ` (
79- ` fixed-* ` or ` floating-* ` ).
79+ ` fixed-* ` or ` floating-* ` ) and includes a ` categories ` array of tag names translated into the requested ` lang ` (falling
80+ back to the tag slug when no translation exists). Categories are bulk-loaded once per side via DQL to avoid N+1.
8081
8182### Algorithm Resolver (v3)
8283
@@ -105,14 +106,19 @@ Available algorithms with v1/v2 `args` → v3 `algorithmArgs` mapping (dayOfWeek
105106
106107### Admin UI
107108
108- ` ManageController ` + ` WebController ` serve Twig templates under ` /manage ` for managing holiday data (create, translate,
109- check). Protected by ` ROLE_USER ` via HTTP Basic Auth.
110-
111- ` GenerateDescriptionController ` (` POST /manage/generate-description ` ) calls the Anthropic API (Claude Haiku 4.5) to
112- generate Polish holiday descriptions. It accepts ` {day, month, name} ` JSON and returns ` {description} ` . The system
113- prompt enforces Ferrio's copywriting style (150-250 words, informative tone, Polish language). The API key is configured
114- via ` ANTHROPIC_API_KEY ` env var. The create/update forms in ` create.html.twig ` have an AI generate button (sparkle icon)
115- next to each description textarea that calls this endpoint via fetch.
109+ ` ManageController ` + ` WebController ` serve Twig templates under ` /admin ` for managing holiday data (create, translate,
110+ check). Protected by ` ROLE_USER ` via HTTP Basic Auth. ` AdminTagController ` (under ` /admin/tags ` ) handles tag (category)
111+ management with chip UI and per-type usage counters. Legacy ` /manage/* ` URLs return 301 redirects to ` /admin/* ` via
112+ ` ManageRedirectController ` .
113+
114+ ` GenerateDescriptionController ` (` POST /admin/api/generate ` ) calls the Anthropic API (Claude Sonnet 4.6) to
115+ generate Polish holiday descriptions. It accepts ` {day, month, name, type?, language?} ` JSON and returns ` {result} ` (or
116+ ` {error} ` ). ` type ` selects the prompt set: ` description_pl ` (default, Polish description), ` description ` (English-style
117+ description), or ` name ` (translates a Polish holiday name into the target ` language ` ). The system prompts enforce
118+ Ferrio's copywriting style (150-250 words, informative tone) and live in ` config/prompts/ ` . The API key is configured
119+ via ` ANTHROPIC_API_KEY ` env var. The create row in ` create.html.twig ` has an AI sparkle button next to its description
120+ textarea, and the per-row edit modal has sparkle buttons next to both the name and description fields. All call this
121+ endpoint via axios.
116122
117123### Testing
118124
0 commit comments