diff --git a/config/clockify.py b/config/clockify.py index 63773c3..588c6f1 100644 --- a/config/clockify.py +++ b/config/clockify.py @@ -2,33 +2,17 @@ class ClockifyConfig: def __init__(self, workspace_id: str, user_id: str): self.workspace_id = workspace_id self.user_id = user_id - - @property - def base_url(self): - return "https://api.clockify.me/api/v1" - - @property - def tags_url(self): - return f"/workspaces/{self.workspace_id}/tags" - - @property - def time_entries_url(self): - return f"/workspaces/{self.workspace_id}/user/{self.user_id}/time-entries" - - @property - def user_url(self): - return "/user" - - @property - def datetime_format(self): - return "%Y-%m-%dT%H:%M:%SZ" + self.datetime_format = "%Y-%m-%dT%H:%M:%SZ" + self.base_url = "https://api.clockify.me/api/v1" + self.workspace_url = f"/workspaces/{self.workspace_id}" + self.tags_url = f"{self.workspace_url}/tags" + self.time_entries_url = f"/{self.workspace_url}/user/{self.user_id}/time-entries" + self.user_url = "/user" + self.projects_url = f"{self.workspace_url}/projects" def update_time_entry(self, activity_id): - return f"/workspaces/{self.workspace_id}/time-entries/{activity_id}" - - @property - def projects_url(self): - return f"/workspaces/{self.workspace_id}/projects" + return f"{self.workspace_url}/time-entries/{activity_id}" def tasks_url(self, project_id: str): return f"{self.projects_url}/{project_id}/tasks" +