Skip to main content

Work Permit Workflow

Last Updated: 2026-03-04 Status: Core lifecycle implemented. Structural changes blocked — needs business domain input.


Blocked — Cannot Proceed Without Business Requirements

The dev team has zero domain knowledge about real-world Permit to Work (PTW) operations. Unlike previous workflows where we could iterate (implement → tester feedback → fix), the Work Permit involves safety-critical business rules that cannot be guessed:

  • How does the daily permit cycle actually work on the plant floor?
  • What signatures are needed, by whom, and when?
  • What happens when a permit type changes the rules (Hot Work vs Confined Space)?
  • When and how does a project-level job close?

6 design decisions are blocked — see Open Questions.

Next step: Requirements workshop with a Safety Officer or PTW administrator from a real plant. Use the Requirements Clarification Questionnaire to collect answers.


Full Lifecycle


Daily Operation Cycle

  • Each permit = one day, with its own WP number and audit trail
  • Closed permits cannot reopen — a new permit is created the next day
  • Close Job (#509) for project-level closure is not yet implemented

Co-Review Pattern

Co-Review StateReviewersRequiredNext State
Co-ReviewSO + WO + WAO3 of 3Work In Progress
Extension ReviewSO + WO2 of 2Work In Progress
Request CloseSO + WO + WAO3 of 3Approved (Closed)
  • Request Change at any co-review → clears all approvals, sends back
  • Commands are list-view only — reviewers approve from the task list

Quick Reference

Roles

RoleThaiKey Actions
Contractorผู้รับเหมาFill, extend, close
Safety Officer (SO)จป.Co-review, approve extension/close
Work Owner (WO)เจ้าของงานCo-review, approve extension/close
Area Owner (WAO)เจ้าของพื้นที่Co-review, approve close

States

StateThaiWhoEditable?
Fill In Permit RequestกรอกใบขออนุญาตContractorYes
Co-Reviewตรวจสอบร่วมSO + WO + WAOLocked
Work In ProgressกำลังปฏิบัติงานContractorLocked
Extension ReviewตรวจสอบการขยายเวลาSO + WOLocked
Request CloseรอปิดงานSO + WO + WAOLocked
Approved / Rejected / CancelledLocked

Commands

CommandThaiAvailable InAssigns To
Submit Permit Requestส่งใบขออนุญาตFill InSO + WO + WAO
CancelยกเลิกFill In
Approve PermitอนุมัติใบขออนุญาตCo-ReviewNext reviewer
Request Changeส่งกลับแก้ไขCo-Review, Req CloseContractor
Reject PermitปฏิเสธใบขออนุญาตCo-Review
Request ExtensionขอขยายเวลาWork In ProgressSO + WO
Approve ExtensionอนุมัติขยายเวลาExtension ReviewNext reviewer
Reject ExtensionปฏิเสธขยายเวลาExtension Review
Request CloseขอปิดงานWork In ProgressSO + WO + WAO
Approve CloseอนุมัติปิดงานReq CloseNext reviewer

Email Notifications

TriggerRecipient
All 3 approve permitContractor
Reject permitContractor
Cancel permitContractor
Work startedSafety Officer
All 3 approve closeContractor

Prerequisite Workflows

  • Project Registration must be Approved
  • JSA and Tool List shown as read-only reference documents

Permit Types

8 legacy types (built-in):

IDTypeThai
13General Workใบอนุญาตปฏิบัติงานทั่วไป
8Work at Heightใบอนุญาตปฏิบัติงานในที่สูง
11Hot Workใบอนุญาตงานเชื่อม/ตัด
12Confined Spaceใบอนุญาตงานในที่อับอากาศ
9Chemicalใบอนุญาตงานกับวัตถุอันตรายหรือสารเคมี
10High Voltageใบอนุญาตปฏิบัติงานไฟฟ้าแรงสูง
14Radiationใบอนุญาตงานรังสี
15Excavationใบอนุญาตงานขุดเจาะ

Template-based (ID 1000+): Admin-configurable via Work Permit Template Setting.


Form Structure (5 Parts)

PartTitleKey FieldsWho Fills
1Permit Details & WorkersProject info (read-only), permit number, dates, work location, supervisor, worker table, work description, PPE checklist, JSA selectionContractor
2Client Safety CheckType-specific checklist (6-11 items), Pass/Fail/N/A per item + remarksReviewer
3Work AuthorizationDate + time range, 4 signatures (Contractor, Supervisor, SO, Area Owner)All parties
4Extension RequestExtension cards (date, original→new time, reason, 4 signatures, status badge)Contractor + reviewers
5Work CompletionInspection date/inspector, 6 inspection categories, work acceptance, remarks, 4 signaturesContractor + reviewers
Part 3 — Design Decision Pending (#506)

Current: 3 phases x 4 signatures = 12 slots. Paper form: 3 simple signatures. See gap #4.

Part 2 — Inspector removed (#505)

Reviewer/inspector section removed per MoM 2026-02-27.


Paper Form Reference

Three sample paper PTW forms were analyzed. Download: Vendor Evaluation Form II

FormColorCodeImage
Clearance Work PermitYellowRW-F06-01Clearance
Confined Space EntryPinkRW-F06-03Confined Space
Hot Work PermitGreenRW-F06-02Hot Work

Common Structure

All paper forms share: permit number, company name, date+time (start/end), work location, hazard ID, PPE checklist, safety checklist, 3 authorization signatures (Requestor / Controller / Permit Issuer), close-out signatures.

Type-specific additions:

  • Clearance only: surrender/re-issue table (time-stamped)
  • Confined Space only: worker entry/exit time log (up to 6 workers)

Original Digital Template

Starting point for the codebase (General Work Permit, converted from DOCX). All 8 permit types follow this 5-part structure.

PartView
1Contractor — permit details, workers, PPE
2Client Check — safety checklist
3Authorization — 3-phase sign-off
4Extension — time extension
5Completion — close-out inspection

Paper vs Digital — Gap Analysis

#FindingPaper FormDigital (Current)PriorityIssue
1Start/end date-time not renderedAll forms show valid from/toFixedptw-permit-details renders startDateTime and endDateTimeP1
2Worker entry/exit timeConfined Space onlyNot implementedP3
3N/A option in checklistYes/No/NAFixed — checklist supports Pass/Fail/N/A ('na' value)P3
4Authorization too complex3 signatures, 1 entry3 phases x 4 sigs = 12 slotsP1#506
5Signature role mismatchRequestor/Controller/Permit IssuerContractor/Supervisor/SO/Area OwnerP2#506
6Extension co-review rolesSO + WO only (need WAO?)P2#508
7Generic completion categoriesType-specific close-out itemsSame 6 categories for all typesP3
8No project-level "Close Job"Paper has project close-outDaily WP closure onlyP2#509
9No backend signature validationSignatures required before workBackend approves without checking if signatures existP1
10Extension form stubExtension fields on paperBackend model ExtensionRequestForm has zero fieldsP2

Original Design Diagrams (Draft)

warning

These are draft designs from draw.io — includes unbuilt phases (Prerequisites, Evaluation). Reference only.

DiagramStatus
WP FlowPrerequisites → check only, PTW Fill → implemented, Co-Review → implemented, Execution → implemented, Evaluation → not built
Dev DiagramSimplified dev view
Full SystemAll workflows

Source: frontend/src/assets/workflows/ and docs/static/img/diagrams/


Open Questions (Blocked)

info

6 design decisions require business domain expert input. Full details and fill-in questionnaire: Requirements Clarification.

#QuestionPriorityIssue
1Daily close/reopen — new WP each day? reuse? shift-based?P1
2Authorization — who are the 3 signers? how many phases?P1#506
3Extension vs surrender/re-issue — same concept? who reviews?P2#508
4Close Job (project-level) — who closes? prerequisites?P2#509
5Evaluation phase — when? who? what form?Future
6Permit type variations — what's different per type?P3

Issue Tracker

MoM 2026-02-27

#ItemIssueStatus
2Trained workers popup#503
4Remove inspector from Part 2#505
5Simplify authorization#506🚧 Blocked
6Validate extension/closure data#507
7Extension + close co-review#508🚧 Blocked
8Close Job menu#509🚧 Blocked
9Disable cancel on approved#510
IssueTitleStatus
#309WP Workflow Testing Pending
#161Permit Type Selection FlowPartially done
#162Missing Tabs (Tools, JSA, Project Info)Done (reference docs)
#163Trained Worker Selection → #503🔍 Done
#164JSA Tab with Tick Marks Pending
#165Form Verification vs Paper → This doc Pending
#191Daily Closure Rules → #509🚧 Blocked
#338System Isolate Checkbox Pending

Roadmap

PhaseItemsStatus
Done#510 cancel removal, #505 inspector removal, #503 trained workers, #507 validation
Next (blocked)#506 Part 3 authorization, gap #1 date-time render, #508 extension roles🚧
Backlog (blocked)#509 Close Job, type-specific completion, entry/exit log, N/A option🚧
FutureEvaluation phase (SO + WO), Vendor Evaluation Form IINot designed

Tester Checklist

Basics

  • Create work permit from approved project
  • Pre-populated project data (PO, dates, contractor, location)
  • Reference documents visible (Project Reg, JSA, Tool List)
  • Auto-save works on all parts
  • Permit type selection works (legacy + template)

Fill & Submit

  • Add workers from trained worker registry popup
  • PPE checkbox grid works
  • JSA document selection works
  • Submit sends to SO + WO + WAO simultaneously

Co-Review

  • All 3 reviewers see permit (read-only)
  • Each can approve independently, task reassigns to next
  • All 3 approve → Work In Progress + email to contractor
  • Request Change → clears approvals, back to contractor
  • Reject → Rejected + email

Work In Progress

  • No cancel button (#510)
  • "Request Extension" and "Request Close" available
  • All form parts locked

Extension

  • Fill Part 4 data, submit to SO + WO
  • Both approve → back to Work In Progress
  • Reject → back to Work In Progress

Closure

  • Fill Part 5 data, submit to SO + WO + WAO
  • All 3 approve → task Closed + email
  • Request Change → back to Work In Progress