Untitled

 avatar
unknown
plain_text
6 months ago
2.4 kB
2
Indexable
@startuml
class User {
  - name: String
  - email: String
  - password_digest: String
  - monthly_income: Decimal
  - target_savings: Decimal
  - role: String
  - created_at: DateTime
  - updated_at: DateTime
  + authenticate(password: String): Boolean
  + calculate_monthly_savings(): Decimal
  + update_profile(attributes: Hash): Boolean
}

class Expense {
  - user_id: Integer
  - category: String
  - amount: Decimal
  - frequency: String
  - date: Date
  - created_at: DateTime
  - updated_at: DateTime
  + calculate_total_expenses(): Decimal
  + categorize_expense(): String
}

class SavingsPlan {
  - user_id: Integer
  - goal_amount: Decimal
  - monthly_savings: Decimal
  - duration_months: Integer
  - ai_suggestions: Text
  - status: String
  - start_date: Date
  - end_date: Date
  - created_at: DateTime
  - updated_at: DateTime
  + update_status(new_status: String): Void
  + calculate_remaining_amount(): Decimal
  + generate_ai_suggestions(): Text
}

class AIInteraction {
  - user_id: Integer
  - prompt_id: Integer
  - response: Text
  - created_at: DateTime
  - updated_at: DateTime
  + log_interaction(): Void
  + analyze_response(): Hash
}

class Transaction {
  - user_id: Integer
  - amount: Decimal
  - transaction_type: String
  - category: String
  - date: Date
  - description: String
  - created_at: DateTime
  - updated_at: DateTime
  + record_transaction(): Boolean
  + summarize_transactions(): Hash
}

class Notification {
  - user_id: Integer
  - message: String
  - read: Boolean
  - created_at: DateTime
  - updated_at: DateTime
  + mark_as_read(): Void
  + send_notification(): Boolean
}

class Integration {
  - user_id: Integer
  - provider: String
  - access_token: String
  - refresh_token: String
  - expires_at: DateTime
  - created_at: DateTime
  - updated_at: DateTime
  + refresh_access_token(): Boolean
  + revoke_integration(): Boolean
}

class Prompt {
  - user_id: Integer
  - content: Text
  - context: String
  - created_at: DateTime
  - updated_at: DateTime
  + generate_prompt(): String
  + associate_with_interaction(ai_interaction_id: Integer): Void
}

User "1" -- "0..*" Expense
User "1" -- "0..*" SavingsPlan
User "1" -- "0..*" AIInteraction
User "1" -- "0..*" Transaction
User "1" -- "0..*" Notification
User "1" -- "0..*" Integration
User "1" -- "0..*" Prompt
Prompt "1" -- "0..1" AIInteraction
AIInteraction "0..1" -- "1" Prompt
@enduml
Editor is loading...
Leave a Comment