project-standalo-todo-super/.workflow/versions/v001/contexts/model_points.yml

100 lines
2.3 KiB
YAML

{
"task_id": "task_create_model_points",
"entity_id": "model_points",
"generated_at": "2025-12-18T01:57:52.721807",
"workflow_version": "v001",
"target": {
"type": "model",
"definition": {
"id": "model_points",
"name": "Points",
"description": "Points transaction history",
"file_path": "app/lib/db/schema/points.ts",
"status": "PENDING",
"fields": [
{
"name": "id",
"type": "string",
"required": true,
"description": "Unique transaction identifier (UUID)",
"constraints": [
"primary_key"
]
},
{
"name": "user_id",
"type": "string",
"required": true,
"description": "Foreign key to User"
},
{
"name": "amount",
"type": "integer",
"required": true,
"description": "Points amount (positive for earned, negative for spent)"
},
{
"name": "type",
"type": "enum",
"required": true,
"description": "Transaction type",
"enum_values": [
"earned",
"spent"
]
},
{
"name": "source",
"type": "string",
"required": true,
"description": "Source of points (task_id, purchase_id, etc.)"
},
{
"name": "created_at",
"type": "timestamp",
"required": true,
"description": "Transaction timestamp"
}
],
"indexes": [
{
"fields": [
"user_id",
"created_at"
],
"unique": false
}
]
}
},
"related": {
"models": [],
"apis": [],
"components": []
},
"dependencies": {
"entity_ids": [],
"definitions": []
},
"files": {
"to_create": [
"prisma/schema.prisma",
"app/models/points.ts"
],
"reference": []
},
"acceptance": [
{
"criterion": "Model defined in Prisma schema",
"verification": "Check prisma/schema.prisma"
},
{
"criterion": "TypeScript types exported",
"verification": "Import type in test file"
},
{
"criterion": "Relations properly configured",
"verification": "Check Prisma relations"
}
]
}