2c9e74776e
- New builtin plugin app/plugins/builtins/tasks/ with full CRUD
- Task model with TenantMixin (title, description, status, priority, due_date, assigned_to, contact_id)
- Routes: GET/POST /tasks, GET/PATCH/DELETE /tasks/{id}, POST /tasks/{id}/assign, POST /tasks/{id}/status
- All routes RBAC-protected (tasks:read, tasks:write, tasks:delete)
- ARQ cron job tasks_due_reminder (daily 8:00) sends notifications for due tasks
- Migration 0001_initial.sql creates tasks table with indexes
- Frontend: Tasks.tsx page with list, filter, create/edit modal, detail modal
- Frontend: api/tasks.ts with React Query hooks
- Route /tasks in routes/index.tsx, sidebar entry via plugin manifest
- i18n keys for nav.tasks and tasks.* in de.json and en.json
- Tests: test_tasks.py (11 tests) + Tasks.test.tsx (3 tests)
- Registered TasksPlugin in conftest.py and worker.py
66 lines
1.8 KiB
Python
66 lines
1.8 KiB
Python
"""Tasks plugin — manage free tasks/activities linked to contacts."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from app.plugins.base import BasePlugin
|
|
from app.plugins.manifest import (
|
|
PluginManifest,
|
|
PluginRouteDef,
|
|
FrontendMenuItem,
|
|
FrontendPageRoute,
|
|
CronJobContribution,
|
|
)
|
|
|
|
|
|
class TasksPlugin(BasePlugin):
|
|
"""Tasks plugin for managing activities (calls, notes, visits) linked to contacts."""
|
|
|
|
manifest = PluginManifest(
|
|
name="tasks",
|
|
version="1.0.0",
|
|
display_name="Tasks",
|
|
description="Manage free tasks/activities with status, priority, due dates, and contact links.",
|
|
dependencies=["permissions"],
|
|
routes=[
|
|
PluginRouteDef(
|
|
path="/api/v1/tasks",
|
|
module="app.plugins.builtins.tasks.routes",
|
|
router_attr="router",
|
|
),
|
|
],
|
|
events=[],
|
|
migrations=["0001_initial.sql"],
|
|
permissions=[
|
|
"tasks:read",
|
|
"tasks:write",
|
|
"tasks:delete",
|
|
],
|
|
is_core=True,
|
|
menu_items=[
|
|
FrontendMenuItem(
|
|
label_key="nav.tasks",
|
|
label="Tasks",
|
|
path="/tasks",
|
|
icon="CheckSquare",
|
|
order=30,
|
|
),
|
|
],
|
|
page_routes=[
|
|
FrontendPageRoute(
|
|
path="/tasks",
|
|
component="@/pages/Tasks",
|
|
protected=True,
|
|
order=30,
|
|
),
|
|
],
|
|
cron_jobs=[
|
|
CronJobContribution(
|
|
name="tasks_due_reminder",
|
|
cron_expression="0 8 * * *",
|
|
job_type="custom",
|
|
target_name="tasks_due_reminder",
|
|
plugin_name="tasks",
|
|
),
|
|
],
|
|
)
|