settings_applications Modul 2: Konfigurasi Approval

Rencana implementasi teknis PHP Native 8.2 & simulator interaktif.

2. Konfigurasi Approval

Sistem approval bersifat fleksibel dan dapat dikonfigurasi oleh Super Admin tanpa perlu perubahan kode. Setiap modul yang membutuhkan persetujuan memiliki konfigurasi chain yang bisa diatur melalui panel Admin.

Struktur Konfigurasi Approval

Approval Config:

  • Modul : [Leave / Payroll / Recruitment / dll]
  • Level : 1 / 2 / 3
  • Approver L1 : Role atau User spesifik
  • Approver L2 : Role atau User spesifik (opsional)
  • Approver L3 : Role atau User spesifik (opsional)
  • Kondisi : Threshold (misal: cuti > 5 hari wajib L2)
  • Timeout : Eskalasi otomatis jika tidak ada respons dalam X hari
  • Skip Rule : Boleh skip level jika Approver L1 = L2 (misal Dept Head = HR Manager)

Contoh Konfigurasi Per Modul

ModulDefault LevelKonfigurasi Default
Leave Management2 LevelEmployee → Dept Head → HR Manager
Payroll2 LevelHR Manager → Finance
Recruitment (Hire)3 LevelRecruiter → HR Manager → Dept Head
Overtime Request2 LevelEmployee → Dept Head → HR Manager
Training Request2 LevelEmployee → Dept Head → HR Manager

Diagram Alur Approval (Generik)

flowchart TD A([Pengaju / Pemohon]) --> B[Buat Permintaan] B --> C{Konfigurasi\nApproval} C -->|1 Level| D1[Approver Level 1] C -->|2 Level| D1 C -->|3 Level| D1 D1 -->|Approve| E1{Apakah Ada\nLevel 2?} D1 -->|Tolak| REJ([❌ Ditolak — Notifikasi ke Pengaju]) D1 -->|Timeout| ESC1[Eskalasi Otomatis ke Level 2] E1 -->|Tidak| FIN1([✅ Disetujui — Proses Lanjut]) E1 -->|Ya| D2[Approver Level 2] D2 -->|Approve| E2{Apakah Ada\nLevel 3?} D2 -->|Tolak| REJ D2 -->|Timeout| ESC2[Eskalasi Otomatis ke Level 3] E2 -->|Tidak| FIN1 E2 -->|Ya| D3[Approver Level 3] D3 -->|Approve| FIN1 D3 -->|Tolak| REJ FIN1 --> NOTIF[📧 Notifikasi ke Semua Pihak] REJ --> NOTIF2[📧 Notifikasi Penolakan + Alasan]

interactive_space Interactive Simulator
Modul 2

Super Admin dapat menyesuaikan jumlah level approval (1, 2, atau 3) secara dinamis tanpa mengubah file PHP.

Konfigurasi Aktif di Database:
  • Leave Request: 2 Level Approval (Default: Dept Head → HR Manager)
  • Payroll Process: 2 Level Approval (Default: HR Manager → Finance)