feat: improve notification filters configuration format

- Change filters config from nested dict to simple arrays
- Update NotificationFilters model to use List[str] instead of Dict[str, str]
- Modify notification service to handle list-based filters
- Update API routes and tests for new format
- Update README with new configuration example

Before: [filters.case-insensitive] salary = 'salary'
After: [filters] case-insensitive = ['salary', 'utility']
This commit is contained in:
Elisiário Couto
2025-09-09 16:51:26 +01:00
committed by Elisiário Couto
parent bc947183e3
commit 2191fe9066
5 changed files with 31 additions and 13 deletions

View File

@@ -1,4 +1,4 @@
from typing import Dict, Optional, List
from typing import Optional, List
from pydantic import BaseModel
@@ -21,8 +21,8 @@ class TelegramConfig(BaseModel):
class NotificationFilters(BaseModel):
"""Notification filters configuration"""
case_insensitive: Dict[str, str] = {}
case_sensitive: Optional[Dict[str, str]] = None
case_insensitive: List[str] = []
case_sensitive: Optional[List[str]] = None
amount_threshold: Optional[float] = None
keywords: List[str] = []