From 0d0aee87b16cb71961a0738222c5de9795435f2b Mon Sep 17 00:00:00 2001 From: Rogee Date: Mon, 29 Dec 2025 12:01:08 +0800 Subject: [PATCH] feat(llm): update --- backend/llm.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/llm.txt b/backend/llm.txt index e900783..cdf40a6 100644 --- a/backend/llm.txt +++ b/backend/llm.txt @@ -156,6 +156,8 @@ Models live in: 4) Map complex field types (JSON/ARRAY/UUID/…) via transform file: - `backend/database/.transform.yaml` → `field_type.` +- MUST: For ALL enum fields (even simple `VARCHAR`), you MUST map them to their corresponding Go enum type (defined in `backend/pkg/consts`) in `.transform.yaml`. This ensures strong typing in the generated models and avoids unsafe manual casting (e.g., `string(consts.GenderMale)`). +- MUST: For deterministic JSONB fields (where the structure is known), define a corresponding Go struct in `backend/database/fields/` and map the field to `types.JSONType[fields.StructName]` in `.transform.yaml`. 5) Generate models: @@ -460,4 +462,4 @@ func (s *XxxTestSuite) Test_Method() { So(got, ShouldBeNil) }) } -``` +``` \ No newline at end of file