summaryrefslogtreecommitdiff
path: root/config.py
diff options
context:
space:
mode:
authormatin <matin.kaufmann@gmail.com>2025-09-12 20:45:28 +0200
committermatin <matin.kaufmann@gmail.com>2025-09-12 20:45:28 +0200
commit95d784fb414c6270e560fc0cf7ed289765ddd3ab (patch)
tree31f66d2c230634d9325beb82f1125876a3a63e30 /config.py
parent315bdeffd7b8c7c1a1792cb91d25ff0ac17fecda (diff)
AI refactoring (see architecture analysis and refactoring_summary)
Diffstat (limited to 'config.py')
-rw-r--r--config.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/config.py b/config.py
new file mode 100644
index 0000000..990a2c3
--- /dev/null
+++ b/config.py
@@ -0,0 +1,39 @@
+# config.py
+from datetime import timedelta
+from dateutil.relativedelta import relativedelta
+
+class EventConfig:
+ """Configuration constants for the application"""
+
+ # Event type keywords
+ KEYWORDS = ["EZ 100%", "EZ 50%", "EZ pauschal", "Sonstige"]
+
+ # Event type durations
+ EZ_PAUSCHAL_DURATION_YEARS = 2
+ EZ_PAUSCHAL_DURATION_DAYS_OFFSET = -1 # End date is start + 2 years - 1 day
+
+ # Prediction limits
+ MAX_PREDICTION_YEARS = 6
+
+ # UI Configuration
+ DATE_FORMAT = "dd.MM.yyyy"
+ DATE_FORMAT_ISO = "yyyy-MM-dd"
+
+ # File Configuration
+ DEFAULT_FILE_EXTENSION = ".json"
+ FILE_FILTER = "JSON Files (*.json)"
+
+ @classmethod
+ def get_ez_pauschal_duration(cls):
+ """Get the duration for EZ pauschal events"""
+ return relativedelta(years=cls.EZ_PAUSCHAL_DURATION_YEARS, days=cls.EZ_PAUSCHAL_DURATION_DAYS_OFFSET)
+
+ @classmethod
+ def get_max_prediction_duration(cls):
+ """Get the maximum prediction duration"""
+ return relativedelta(years=cls.MAX_PREDICTION_YEARS)
+
+ @classmethod
+ def is_valid_keyword(cls, keyword):
+ """Check if a keyword is valid"""
+ return keyword in cls.KEYWORDS