Skip to content

Commit fa7e988

Browse files
dmealingclaude
andcommitted
test(codegen-kotlin): add 4 snapshot fixtures (FK / payload origins / enum / @storage)
Locks down regression-test coverage for the features shipped in Phases A-G that previously had only unit-test coverage. Each fixture exercises one feature class end-to-end through the generators registered in config.json. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 6c84b70 commit fa7e988

8 files changed

Lines changed: 97 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "generators": ["entity", "table"] }
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"metadata.root": {
3+
"package": "acme::game",
4+
"children": [
5+
{ "object.entity": { "name": "Player", "children": [
6+
{ "field.long": { "name": "id" } },
7+
{ "field.string": { "name": "username", "@maxLength": 50 } },
8+
{ "field.enum": { "name": "status", "@values": ["ACTIVE", "INACTIVE", "BANNED"] } },
9+
{ "source.rdb": { "@table": "players" } },
10+
{ "identity.primary": { "@fields": "id", "@generation": "increment" } }
11+
] } }
12+
]
13+
}
14+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "generators": ["entity", "table"] }
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"metadata.root": {
3+
"package": "acme::blog",
4+
"children": [
5+
{ "object.entity": { "name": "Author", "children": [
6+
{ "field.long": { "name": "id" } },
7+
{ "field.string": { "name": "name", "@maxLength": 100 } },
8+
{ "source.rdb": { "@table": "authors" } },
9+
{ "identity.primary": { "@fields": "id", "@generation": "increment" } }
10+
] } },
11+
{ "object.entity": { "name": "Post", "children": [
12+
{ "field.long": { "name": "id" } },
13+
{ "field.string": { "name": "title", "@maxLength": 255 } },
14+
{ "relationship.composition": { "name": "author",
15+
"@objectRef": "Author",
16+
"@onDelete": "cascade" } },
17+
{ "source.rdb": { "@table": "posts" } },
18+
{ "identity.primary": { "@fields": "id", "@generation": "increment" } }
19+
] } }
20+
]
21+
}
22+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "generators": ["entity", "table"] }
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"metadata.root": {
3+
"package": "acme::commerce",
4+
"children": [
5+
{ "object.value": { "name": "Address", "children": [
6+
{ "field.string": { "name": "street", "@maxLength": 200 } },
7+
{ "field.string": { "name": "city", "@maxLength": 100 } },
8+
{ "field.string": { "name": "zip", "@maxLength": 20 } }
9+
] } },
10+
{ "object.value": { "name": "UserMetadata", "children": [
11+
{ "field.string": { "name": "locale" } },
12+
{ "field.string": { "name": "timezone" } }
13+
] } },
14+
{ "object.entity": { "name": "User", "children": [
15+
{ "field.long": { "name": "id" } },
16+
{ "field.string": { "name": "email", "@maxLength": 255 } },
17+
{ "field.object": { "name": "address",
18+
"@objectRef": "Address",
19+
"@storage": "flattened" } },
20+
{ "field.object": { "name": "preferences",
21+
"@objectRef": "UserMetadata",
22+
"@storage": "jsonb" } },
23+
{ "source.rdb": { "@table": "users" } },
24+
{ "identity.primary": { "@fields": "id", "@generation": "increment" } }
25+
] } }
26+
]
27+
}
28+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "generators": ["payload"] }
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"metadata.root": {
3+
"package": "acme::ai",
4+
"children": [
5+
{ "object.entity": { "name": "Author", "children": [
6+
{ "field.long": { "name": "id" } },
7+
{ "field.string": { "name": "name" } },
8+
{ "field.string": { "name": "bio" } },
9+
{ "relationship.association": { "name": "posts", "@objectRef": "Post" } }
10+
] } },
11+
{ "object.entity": { "name": "Post", "children": [
12+
{ "field.long": { "name": "id" } },
13+
{ "field.string": { "name": "title" } },
14+
{ "relationship.composition": { "name": "author", "@objectRef": "Author" } }
15+
] } },
16+
{ "object.value": { "name": "AuthorReport", "children": [
17+
{ "field.string": { "name": "name", "children": [
18+
{ "origin.passthrough": { "@from": "Author.name" } }
19+
] } },
20+
{ "field.long": { "name": "postCount", "children": [
21+
{ "origin.aggregate": { "@agg": "count", "@of": "Post.id", "@via": "Author.posts" } }
22+
] } }
23+
] } },
24+
{ "template.prompt": { "name": "AuthorBio",
25+
"@payloadRef": "AuthorReport",
26+
"@textRef": "ai/bio" } }
27+
]
28+
}
29+
}

0 commit comments

Comments
 (0)