diff --git a/MoneyMap/Pages/Recategorize.cshtml b/MoneyMap/Pages/Recategorize.cshtml index d4193fa..a389664 100644 --- a/MoneyMap/Pages/Recategorize.cshtml +++ b/MoneyMap/Pages/Recategorize.cshtml @@ -48,10 +48,10 @@
- Auto-Categorize Existing Transactions + Rule-Based Categorization
-

Use the category mappings to automatically categorize transactions that are already in your database.

+

Use the category mappings to automatically categorize transactions based on pattern matching.

@@ -87,6 +87,51 @@
+
+
+ AI-Powered Categorization + @Model.AIProvider +
+
+

Use AI to analyze transaction names and suggest categories. High-confidence matches will automatically create new mapping rules for future use.

+ +
+
+
+
AI Categorize Uncategorized
+

+ Process up to 50 uncategorized transactions. Review AI suggestions before applying. +

+ @if (Model.Stats.Uncategorized > 0) + { + + AI Categorize with Preview + + } + else + { + + } +
+
+ +
+
+
How AI Categorization Works
+
    +
  • AI analyzes transaction name, memo, and amount
  • +
  • Suggests category and canonical merchant name
  • +
  • Creates pattern rules for 70%+ confidence matches
  • +
  • Future transactions auto-match the new rules
  • +
+
+
+
+
+
+
How It Works diff --git a/MoneyMap/Pages/Recategorize.cshtml.cs b/MoneyMap/Pages/Recategorize.cshtml.cs index c5acae9..82f4095 100644 --- a/MoneyMap/Pages/Recategorize.cshtml.cs +++ b/MoneyMap/Pages/Recategorize.cshtml.cs @@ -11,15 +11,22 @@ namespace MoneyMap.Pages private readonly MoneyMapContext _db; private readonly ITransactionCategorizer _categorizer; private readonly ITransactionStatisticsService _statsService; + private readonly IConfiguration _config; - public RecategorizeModel(MoneyMapContext db, ITransactionCategorizer categorizer, ITransactionStatisticsService statsService) + public RecategorizeModel( + MoneyMapContext db, + ITransactionCategorizer categorizer, + ITransactionStatisticsService statsService, + IConfiguration config) { _db = db; _categorizer = categorizer; _statsService = statsService; + _config = config; } public RecategorizeStats Stats { get; set; } = new(); + public string AIProvider => _config["AI:CategorizationProvider"] ?? "OpenAI"; [TempData] public string? SuccessMessage { get; set; }