Skip to main content

Project Registration

Revision 1.0 (2026-01-14) - Complete documentation with workflow integration

Feature Summary

Project Registration (การลงทะเบียนโครงการ) is a workflow feature that manages the approval process for new projects. It coordinates between Work Owner, Purchasing, and Contractor roles to complete project setup before work permits can be issued.

Key Capabilities:

  • Create and track project registration tasks
  • Multi-role workflow: Work Owner → Purchasing → Contractor → Approval
  • Document form management (Project Registration Form, Pre-Work Procedures Form)
  • Form edit permissions based on workflow state
  • Task assignment with email notifications
  • Workflow history and audit trail
  • Optional command support (planned) - Skip Purchasing if project has PO No.

Workflow Relationship:

Project Registration is the first workflow in the Safety App process:

  1. Work Owner searches project by PR.No → Creates registration task
  2. Workflow progresses through 8 states (see Workflow Documentation)
  3. Upon approval, project can proceed to Work Permit Workflow

Prerequisites:

  • Project must exist in Project Settings with PR.No assigned
  • Contractor must be configured with coordinator and supervisor

Role Matrix

Revision 1.0 (2026-01-14) - Initial version

Feature-Level Access

ActionAdminPurchasingWork OwnerSafety OfficerWorkspace OwnerContractor
View all tasksOwn onlyAssigned only
Create task
Execute commandsOwn onlyOwn onlyOwn only
View task historyOwn onlyOwn onlyOwn only
Add notesOwn onlyOwn onlyOwn only
Delete taskOwn only

Workflow State Access

StateWho Can ActAvailable Commands
FillInProjectInfoWork OwnerSend to Purchasing, Cancel
FillInPurchasingInfoPurchasingSubmit Back
ReviewPurchasingInfoWork OwnerSend to Purchasing, Send to Contractor, Cancel
FillInPreWorkProceduresFormContractorAcknowledge Procedures
ReviewPreWorkProceduresFormWork OwnerApprove, Send to Purchasing, Send to Contractor, Cancel

Form Edit Permissions by State

StateProjectRegistrationFormPreWorkProceduresForm
FillInProjectInfo✅ WorkOwner-
FillInPurchasingInfo✅ Purchasing-
ReviewPurchasingInfo✅ WorkOwner-
FillInPreWorkProceduresForm🔒 Locked✅ Contractor
ReviewPreWorkProceduresForm🔒 Locked🔒 Locked
Approved/Canceled🔒 Locked🔒 Locked

Legend:

  • ✅ = Can edit
  • 🔒 = Read-only (locked)
  • Own only = Can only access tasks where user is current assignee
  • Assigned only = Can only see tasks assigned to them

Backend Test Report

Location: backend/tests/http/project-registration/ (planned) Status: Test files to be created in Phase 6

API Endpoints

MethodEndpointDescriptionAuthorization
POST/api/tasks/searchSearch tasks by type, statusRealmBasic
GET/api/tasks/get/{id}Get task details with workflow stateRealmBasic
POST/api/tasks/createTaskCreate new workflow taskRealmBasic
POST/api/tasks/preExecuteCommandValidate and prepare commandRealmBasic
POST/api/tasks/executeCommandExecute workflow state transitionRealmBasic
POST/api/tasks/upload/formAttachmentUpload form attachmentRealmBasic
POST/api/tasks/remove/formAttachmentRemove form attachmentRealmBasic
POST/api/tasks/saveDocumentFormAuto-save form dataRealmBasic
POST/api/tasks/notes/createCreate task noteRealmBasic
PUT/api/tasks/notes/{noteId}Update task noteRealmBasic
DELETE/api/tasks/notes/{noteId}Delete task noteRealmBasic
POST/api/tasks/removeDelete task (Admin/Owner only)RealmBasic

Workflow-Specific Endpoints

MethodEndpointDescriptionAuthorization
GET/api/projects/searchByPrNoSearch project by PR.No for task creationProjectMgmt

Test Coverage (Planned)

PartSectionTestsDescription
ATask Creation6Create task with project link
ATask Get4Retrieve task with workflow state
BStandard Path8Full workflow: WO → Purchasing → WO → Contractor → WO → Approve
BSkip Path6Optional: WO → Contractor (skip Purchasing)
CCommands12All 6 commands with role validation
DForm Attachments4Upload/download/remove attachments
ENotes4Create/update/delete notes

Frontend Test Report

Location: frontend/e2e/features/project-registration/ (planned) Status: E2E tests to be created in Phase 6

Components

ComponentTypeDescription
review-task.component.tsSmartMain container component
review-task.service.tsServiceState management (to be migrated to rxResource)
review-task-toolbar.component.tsDumbCommand buttons and actions
review-task-form.component.tsDumbForm wrapper with tabs
review-task-workflow.component.tsDumbWorkflow visualization (stepper + diagram)
review-task-stepper.component.tsDumbHorizontal workflow stepper
review-task-transaction.component.tsDumbTask history/log table
review-task-note.component.tsDumbNotes section
workflow-svg-viewer.component.tsDumbSVG diagram viewer

Workflow Visualization Components

ComponentPurpose
StepperShows workflow progress with circular step indicators
Full DiagramSVG visualization of complete workflow
State Info CardsCurrent state and branch target information

E2E Test Plan (Phase 6)

Test IDDescription
TC-PR-E2E-001Work Owner creates task from project
TC-PR-E2E-002Work Owner sends to Purchasing
TC-PR-E2E-003Purchasing fills PO info and submits
TC-PR-E2E-004Work Owner reviews and sends to Contractor
TC-PR-E2E-005Contractor acknowledges procedures
TC-PR-E2E-006Work Owner approves registration
TC-PR-E2E-007Work Owner skips Purchasing (when has PO No.)
TC-PR-E2E-008Stepper shows correct state transitions
TC-PR-E2E-009Optional step shows dashed border
TC-PR-E2E-010Transaction log shows all state changes

Manual Test Cases

For comprehensive manual testing documentation, see: Project Registration Test Cases

Test Summary:

  • Standard Workflow Path (31 test cases)
  • Optional Path - Skip Purchasing (9 test cases)
  • Total: 40 test cases

Workflow States Reference

For complete workflow documentation including:

  • All 9 workflow states with Thai names
  • State transition diagram
  • Document form mappings
  • Form edit permissions matrix

See: Project Registration Workflow


Labels verified against:

  • review-task-toolbar.component.ts (command button labels)
  • review-task-stepper.component.ts (step labels)
  • review-task-transaction.component.ts (log table headers)
  • review-task-note.component.ts (notes section)
  • project-registration-state-metadata.config.ts (state names)