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