wiki:UseCase0001PrototypeImplementation

Use-case UC0001 Implementation – Admin creates and assigns a task to workers

Initiating actor: Admin

Other actors: Worker (assigned to the task)

Description: The Admin creates a new task, links it to a client and a project, and assigns one or more workers to carry it out. The Admin selects the client, project, and workers from dropdown lists (never typing identifiers); on submit, the task and its worker assignments are written to the database in one transaction.

Scenario

  1. Admin opens the "New Task" form. The system pre-loads the selectable clients, projects, and workers so nothing has to be typed by ID. The Admin enters the task title ("Test Taskk") and description, selects the client (Elena Nikolova), the project (Nova Mobile App), the assigned worker (Bojan Ilievski), and the due date. The system loads the selectable projects and workers with these queries:
    SELECT p.id, p.name, p.status, u.name AS client
    FROM project.projects p
    LEFT JOIN project.users u ON u.id = p.client_id
    ORDER BY p.id;
    
    SELECT id, name, email, skills
    FROM project.users
    WHERE role = 'WORKER'
    ORDER BY name;
    
  2. Admin clicks "Add Task". The system inserts the new task and the worker assignment in one transaction:
    INSERT INTO project.tasks (title, description, status, due_date, client_id, project_id)
    VALUES ('Test Taskk', 'Test Test', 'PENDING', TIMESTAMP '2026-07-01', 5, 2)
    RETURNING id;
    
    INSERT INTO project.task_workers (task_id, user_id)
    VALUES (<new_task_id>, 2);
    
  3. System creates the task and opens its detail view, showing the task with status PENDING, the assigned worker (Bojan Ilievski), the due date, and its place within the "Nova Mobile App" project task list.

The task INSERT and the worker-assignment INSERT run together as one transaction, so a task is never stored without its worker assignment (and vice versa). Because the client, project, and worker are chosen from lists populated by the SELECT queries above, the Admin never has to remember or type any identifiers.

Last modified 4 days ago Last modified on 07/01/26 17:12:47

Attachments (2)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.