Files
redmine_tracker/config.py
2025-05-15 15:02:23 +03:00

59 lines
1.2 KiB
Python

from pydantic_settings import BaseSettings
class Config(BaseSettings):
CLOCKIFY_TOKEN: str
REDMINE_TOKEN: str
CLOCKIFY_USER_ID: str
CLOCKIFY_WORKSPACE_ID: str
DATETIME_FORMAT: str = "%Y-%m-%dT%H:%M:%SZ"
class RedmineConfig:
@property
def base_url(self):
return "https://redmine.sbps.ru"
@property
def time_entries_url(self):
return "/time_entries.json"
@property
def my_account_url(self):
return "/my/account.json"
@property
def datetime_format(self):
return "%Y-%m-%d"
class ClockifyConfig:
@property
def base_url(self):
return "https://api.clockify.me/api/v1"
@property
def tags_url(self):
return "/workspaces/{workspace_id}/tags"
@property
def time_entries_url(self):
return "/workspaces/{workspace_id}/user/{user_id}/time-entries"
@property
def user_url(self):
return "/user"
@property
def datetime_format(self):
return "%Y-%m-%dT%H:%M:%SZ"
@property
def update_time_entry(self):
return "/workspaces/{workspaceId}/time-entries/{id}"
config = Config()