Skip to content

🔄 5. Workflows & Lifecycle

This section describes the primary user flows from a technical perspective.

📝 5.1 Requirement Lifecycle

  1. Submission (Customer)
    • Customer fills form -> submitRequirement Server Action.
    • Action calls AI.validateRequirement().
      • If Invalid: Rejects immediately. Logs Violation. Returns error to user.
      • If Valid: Saves to DB with status PENDING_REVIEW.
  2. Review (Manager)
    • Manager views "Pending" list.
    • Action: approveRequirement or rejectRequirement.
    • If Approved, status -> APPROVED.
  3. Job Generation (Manager)
    • Manager clicks "Generate Jobs" on an Approved Requirement.
    • Action calls AI.generateJobsFromRequirement().
    • AI returns a list of Job objects.
    • Jobs are saved to DB with status OPEN (Available in Job Pool).

🔨 5.2 Development Lifecycle

  1. Job Pickup (Employee)
    • Employee views Job Pool (Filter: Status OPEN).
    • Clicks "Accept Job".
    • Action assigns job.assigneeId = currentUser.id and sets status ASSIGNED.
  2. Task Breakdown (Employee)
    • Employee can manually create tasks OR click "AI Breakdown".
    • AI.breakdownJobIntoTasks() creates 3-5 sub-tasks (e.g., "Setup DB", "Create UI").
  3. Execution (Kanban)
    • Employee moves Tasks: TODO -> IN_PROGRESS -> DONE.
    • Progress bar updates automatically based on % of completed tasks.
  4. Completion
    • When all Tasks are DONE, the Job is marked COMPLETED.
    • When all Jobs for a Requirement are COMPLETED, the Requirement is fulfilled.

🏃 5.3 Scrum Lifecycle

  1. Sprint Creation (Scrum Manager)
    • Admin/Manager creates a new Sprint (e.g., "Sprint 1") with start/end dates.
  2. Sprint Planning (Reviews Page)
    • Managers review "Backlog" tasks.
    • Action: Assign approved tasks to the "Planned" Sprint.
  3. Sprint Start
    • Manager clicks Start Sprint in Scrum Manager.
    • The Kanban board now filters to show only tasks in this Active Sprint.
  4. Execution & Closure
    • Team works on tasks.
    • Manager clicks End Sprint.
    • AI generates a summary. Incomplete tasks are moved to the Backlog or next Sprint.

🛡️ 5.4 Security Incident Lifecycle (Automated)

  1. Trigger: User submits "I want a script to hack Facebook".
  2. Detection: AI.validateRequirement flags as ILLEGAL.
  3. Enforcement:
    • DB: Insert ViolationLog.
    • DB: Update User.violationCount += 1.
    • Logic:
      • If Count == 1: Create AccountSuspension (24h).
      • If Count == 3: Create AccountSuspension (Indefinite).
  4. Lockout:
    • Next time user tries to log in or submit, isSuspended() check fails.
    • User sees "Account Suspended until [Date]" message.

Next: Deployment ➡️