task_id: task_create_model_generated_app entity_id: model_generated_app generated_at: '2025-12-19T06:08:12.140756' workflow_version: v001 target: type: model definition: id: model_generated_app name: GeneratedApp description: AI-generated application from recording content table_name: generated_apps fields: - name: id type: uuid constraints: - primary_key description: Unique app identifier - name: user_id type: uuid constraints: - foreign_key - not_null - indexed description: Owner of this app - name: recording_id type: uuid constraints: - foreign_key - not_null - indexed description: Source recording that triggered generation - name: title type: string constraints: - not_null description: App title from AI analysis - name: description type: text constraints: [] description: App description - name: html_content type: text constraints: - not_null description: Complete HTML/CSS/JS for iframe rendering - name: prd_content type: text constraints: [] description: Product Requirements Document (PRD) generated by AI - name: ui_ux_design type: text constraints: [] description: UI/UX design notes from AI - name: app_type type: string constraints: [] description: Type of app determined by AI (e.g., todo, calculator, form) - name: status type: enum enum_values: - generating - completed - failed constraints: - not_null - default default: generating description: Generation status relations: - type: belongs_to target: model_user foreign_key: user_id on_delete: cascade - type: belongs_to target: model_recording foreign_key: recording_id on_delete: cascade indexes: - fields: - user_id - created_at unique: false name: idx_apps_user_created - fields: - recording_id unique: false name: idx_apps_recording timestamps: true soft_delete: false validations: [] related: models: - id: model_user definition: &id001 id: model_user name: User description: Application user account with email/password authentication table_name: users fields: - name: id type: uuid constraints: - primary_key description: Unique user identifier - name: email type: string constraints: - unique - not_null - indexed description: User email address for login - name: name type: string constraints: - not_null description: User's display name - name: password_hash type: string constraints: - not_null description: Bcrypt hashed password relations: [] indexes: - fields: - email unique: true name: idx_users_email timestamps: true soft_delete: false validations: - field: email rule: email message: Invalid email format - field: name rule: min:1 message: Name is required - field: password_hash rule: min:60 message: Invalid password hash external: false - id: model_recording definition: &id002 id: model_recording name: Recording description: Voice recording with transcript and summary table_name: recordings fields: - name: id type: uuid constraints: - primary_key description: Unique recording identifier - name: user_id type: uuid constraints: - foreign_key - not_null - indexed description: Owner of this recording - name: title type: string constraints: - not_null description: Recording title (auto-generated or user-edited) - name: audio_file_path type: string constraints: - not_null description: Path to audio file in MinIO/S3 - name: duration type: integer constraints: - not_null description: Recording duration in seconds - name: transcript type: text constraints: [] description: Full transcript from Whisper STT - name: summary type: text constraints: [] description: AI-generated summary from Gemini - name: is_transcribing type: boolean constraints: - not_null - default default: false description: Whether currently transcribing relations: - type: belongs_to target: model_user foreign_key: user_id on_delete: cascade indexes: - fields: - user_id - created_at unique: false name: idx_recordings_user_created timestamps: true soft_delete: false validations: - field: duration rule: min:1 message: Duration must be at least 1 second external: false apis: [] components: [] dependencies: entity_ids: - model_user - model_recording definitions: - id: model_user type: model definition: *id001 external: false - id: model_recording type: model definition: *id002 external: false files: to_create: - prisma/schema.prisma - app/models/generatedapp.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