feat(noc): tambahkan fitur Noc untuk pengelolaan data penyelesaian
- Menambahkan model baru untuk tabel `noc` beserta relasinya pada `Permohonan` dan `PersetujuanPenawaran`. - Menambahkan migrasi untuk membuat tabel `noc` di database. - Memodifikasi logika dan format data pada `NocController` untuk mendukung data terkait `noc`. - Mendefinisikan relasi baru di model `Permohonan` dan `PersetujuanPenawaran` untuk mendukung fitur `noc`. Signed-off-by: Daeng Deni Mardaeni <ddeni05@gmail.com>
This commit is contained in:
61
app/Models/Noc.php
Normal file
61
app/Models/Noc.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
// use Modules\Lpj\Database\Factories\NocFactory;
|
||||
|
||||
class Noc extends Base
|
||||
{
|
||||
protected $table = 'noc';
|
||||
|
||||
protected $fillable = [
|
||||
'permohonan_id',
|
||||
'persetujuan_penawaran_id',
|
||||
'bukti_bayar',
|
||||
'nominal_bayar',
|
||||
'status_bayar',
|
||||
'tanggal_pembayaran',
|
||||
'nominal_penyelesaian',
|
||||
'status_penyelesaiaan',
|
||||
'tanggal_penyelesaian',
|
||||
'bukti_penyelesaian',
|
||||
'bukti_ksl',
|
||||
'memo_penyelesaian',
|
||||
'status',
|
||||
'authorized_status',
|
||||
'authorized_at',
|
||||
'authorized_by',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'nominal_bayar' => 'decimal:2',
|
||||
'status_bayar' => 'boolean',
|
||||
'tanggal_pembayaran' => 'date',
|
||||
'nominal_penyelesaian' => 'decimal:2',
|
||||
'status_penyelesaiaan' => 'boolean',
|
||||
'tanggal_penyelesaian' => 'date',
|
||||
'status' => 'boolean',
|
||||
'authorized_status' => 'boolean',
|
||||
'authorized_at' => 'datetime',
|
||||
];
|
||||
|
||||
// Relationship with Permohonan
|
||||
public function permohonan()
|
||||
{
|
||||
return $this->belongsTo(Permohonan::class, 'permohonan_id');
|
||||
}
|
||||
|
||||
// Relationship with PersetujuanPenawaran
|
||||
public function persetujuanPenawaran()
|
||||
{
|
||||
return $this->belongsTo(PersetujuanPenawaran::class, 'persetujuan_penawaran_id');
|
||||
}
|
||||
|
||||
// Relationship with User (for authorized_by)
|
||||
public function authorizedBy()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'authorized_by');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user