task_id: task_create_model_user entity_id: model_user generated_at: '2025-12-18T15:16:50.217528' workflow_version: v001 target: type: model definition: id: model_user name: User table_name: users description: Base user entity with authentication fields: - name: id type: uuid constraints: - primary_key - name: email type: string constraints: - unique - not_null - name: password_hash type: string constraints: - not_null - name: name type: string constraints: - not_null - name: role type: enum values: - musician - listener - label constraints: - not_null - name: email_verified type: boolean default: false - name: avatar_url type: string constraints: - nullable - name: created_at type: timestamp constraints: - not_null - name: updated_at type: timestamp constraints: - not_null relations: - type: has_one to: model_artist foreign_key: user_id condition: role = 'musician' - type: has_one to: model_label foreign_key: user_id condition: role = 'label' - type: has_many to: model_playlist foreign_key: user_id indexes: - fields: - email unique: true - fields: - role timestamps: true related: models: [] apis: [] components: [] dependencies: entity_ids: [] definitions: [] files: to_create: - prisma/schema.prisma - app/models/user.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