wiki:UseCase0002

Version 1 (modified by 221544, 4 days ago) ( diff )

--

Use-case UC0002 – Client views project and task status

Initiating actor: Client

Other actors:

Description: The Client logs in to check the progress of the work being done for them. The system shows the Client's own projects and, for a selected project, the tasks within it together with their status and the workers assigned.

Scenario

  1. Client opens their dashboard. The system lists the projects that belong to this client:
    SELECT id, name, status, service_type, created_at::date AS created
    FROM project.projects
    WHERE client_id = 4
    ORDER BY created_at DESC;
    
  2. Client selects one of their projects to see its tasks.
  3. System lists the tasks in that project with status, due date, and the assigned workers:
    SELECT t.id, t.title, t.status,
           t.due_date::date AS due_date,
           COALESCE(string_agg(u.name, ', ' ORDER BY u.name), '(unassigned)') AS assigned_workers
    FROM project.tasks t
    LEFT JOIN project.task_workers tw ON tw.task_id = t.id
    LEFT JOIN project.users u          ON u.id = tw.user_id
    WHERE t.project_id = 1
    GROUP BY t.id, t.title, t.status, t.due_date
    ORDER BY t.id;
    
  4. System displays the task list; the Client can see, for example, that "Develop landing page" is assigned to Bojan Ilievski and Ivana Petrova, while "Set up hosting" is still unassigned.

The LEFT JOINs ensure that tasks with no assigned workers still appear (shown as "(unassigned)"), and string_agg collapses the many-to-many worker assignments into one readable column.

Note: See TracWiki for help on using the wiki.