summaryrefslogtreecommitdiff
path: root/config.py
diff options
context:
space:
mode:
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