# Insentif Dinas

- Module key: `InsentifDinas`
- Category: `General`
- Path: `app/Modules/InsentifDinas`

## Ringkasan

Insentif Dinas berada di kategori General. Modul ini memiliki 18 definisi route, 1 controller, 2 model, dan 1 view. Database module terdeteksi pada tabel: `payroll_insentif_dinas_types`, `payroll_insentif_dinas_transactions`.

## Flowchart

```mermaid
flowchart TD
    A[User / Operator] --> B[Menu Insentif Dinas]
    B --> C[Routes: 18]
    C --> D[Controllers: 1]
    D --> E[Views: 1]
    D --> F[(Tables: 2<br/>payroll_insentif_dinas_types<br/>payroll_insentif_dinas_transactions)]
    D --> G[Validation / Business Rules]
    G --> F
    F --> H[Report / Export / Audit]
```


## Routes

- `Route::middleware(['auth', 'ip.block', 'menu.access'])->group(function () {`  
  File: `app/Modules/InsentifDinas/routes/web.php`
- `Route::prefix('insentif-dinas')->name('insentif_dinas.')->group(function () {`  
  File: `app/Modules/InsentifDinas/routes/web.php`
- `Route::get('/', [InsentifDinasController::class, 'index'])->name('index');`  
  File: `app/Modules/InsentifDinas/routes/web.php`
- `Route::get('refs', [InsentifDinasController::class, 'refs'])->name('refs');`  
  File: `app/Modules/InsentifDinas/routes/web.php`
- `Route::get('data', [InsentifDinasController::class, 'data'])->name('data');`  
  File: `app/Modules/InsentifDinas/routes/web.php`
- `Route::get('export', [InsentifDinasController::class, 'export'])->name('export');`  
  File: `app/Modules/InsentifDinas/routes/web.php`
- `Route::get('export-csv', [InsentifDinasController::class, 'exportCsv'])->name('export_csv');`  
  File: `app/Modules/InsentifDinas/routes/web.php`
- `Route::get('template', [InsentifDinasController::class, 'template'])->name('template');`  
  File: `app/Modules/InsentifDinas/routes/web.php`
- `Route::post('import', [InsentifDinasController::class, 'import'])->name('import');`  
  File: `app/Modules/InsentifDinas/routes/web.php`
- `Route::post('bulk-action', [InsentifDinasController::class, 'bulkAction'])->name('bulk_action');`  
  File: `app/Modules/InsentifDinas/routes/web.php`
- `Route::post('/', [InsentifDinasController::class, 'store'])->name('store');`  
  File: `app/Modules/InsentifDinas/routes/web.php`
- `Route::put('{id}', [InsentifDinasController::class, 'update'])->name('update');`  
  File: `app/Modules/InsentifDinas/routes/web.php`
- `Route::delete('{id}', [InsentifDinasController::class, 'destroy'])->name('destroy');`  
  File: `app/Modules/InsentifDinas/routes/web.php`
- `Route::post('{id}/submit', [InsentifDinasController::class, 'submit'])->name('submit');`  
  File: `app/Modules/InsentifDinas/routes/web.php`
- `Route::post('{id}/approve', [InsentifDinasController::class, 'approve'])->name('approve');`  
  File: `app/Modules/InsentifDinas/routes/web.php`
- `Route::post('{id}/reject', [InsentifDinasController::class, 'reject'])->name('reject');`  
  File: `app/Modules/InsentifDinas/routes/web.php`
- `Route::post('{id}/ready-to-pay', [InsentifDinasController::class, 'setReadyToPay'])->name('ready_to_pay');`  
  File: `app/Modules/InsentifDinas/routes/web.php`
- `Route::post('{id}/mark-paid-separate', [InsentifDinasController::class, 'markPaidSeparate'])->name('mark_paid_separate');`  
  File: `app/Modules/InsentifDinas/routes/web.php`

## Controllers

- `app/Modules/InsentifDinas/Http/Controllers/InsentifDinasController.php`

## Models

- `app/Modules/InsentifDinas/Models/InsentifDinasTransactionModel.php`
- `app/Modules/InsentifDinas/Models/InsentifDinasTypeModel.php`

## Views

- `app/Modules/InsentifDinas/Resources/views/index.blade.php`

## Database / Migration

### `payroll_insentif_dinas_types`
- Actions: `create`
- Columns: 6
  - `code:string`
  - `name:string`
  - `default_payment_method:string`
  - `need_deadline:boolean`
  - `description:text`
  - `is_active:boolean`
- Migrations:
  - `app/Modules/InsentifDinas/Database/migrations/2026_04_15_090000_create_payroll_insentif_dinas_types_table.php`
### `payroll_insentif_dinas_transactions`
- Actions: `create`, `table`
- Columns: 40
  - `transaction_no:string`
  - `transaction_date:date`
  - `karyawan_id:unsignedBigInteger`
  - `project_id:unsignedBigInteger`
  - `insentif_dinas_type_id:unsignedBigInteger`
  - `approval_flow_id:unsignedBigInteger`
  - `approval_request_id:unsignedBigInteger`
  - `work_date_from:date`
  - `work_date_to:date`
  - `claim_deadline:date`
  - `pay_deadline:date`
  - `amount:decimal`
  - `approved_amount:decimal`
  - `payment_method:string`
  - `target_profil_bulan_id:unsignedBigInteger`
  - `description:text`
  - `notes:text`
  - `status:string`
  - `submitted_by:unsignedBigInteger`
  - `submitted_at:timestamp`
  - `approved_by:unsignedBigInteger`
  - `approved_at:timestamp`
  - `rejected_by:unsignedBigInteger`
  - `rejected_at:timestamp`
  - `reject_reason:text`
  - `paid_by:unsignedBigInteger`
  - `paid_at:timestamp`
  - `payroll_reference_id:unsignedBigInteger`
  - `separate_payment_reference:string`
  - `payment_notes:text`
  - `is_locked:boolean`
  - `is_active:boolean`
  - `created_by:unsignedBigInteger`
  - `updated_by:unsignedBigInteger`
  - `karyawan_id:index`
  - `status:index`
  - `payment_method:index`
  - `target_profil_bulan_id:index`
  - `sk_reference_url:string`
  - `sk_reference_url:dropColumn`
- Migrations:
  - `app/Modules/InsentifDinas/Database/migrations/2026_04_15_090100_create_payroll_insentif_dinas_transactions_table.php`
  - `app/Modules/InsentifDinas/Database/migrations/2026_04_15_123000_add_sk_reference_url_to_payroll_insentif_dinas_transactions_table.php`
