Initial Commit
This commit is contained in:
46
app/Models/Analisa.php
Normal file
46
app/Models/Analisa.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\AnalisaFactory;
|
||||
|
||||
class Analisa extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'analisa';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['permohonan_id', 'type', 'luas', 'jenis_jaminan_id'];
|
||||
|
||||
|
||||
public function analisaTanahBangunan(){
|
||||
return $this->hasOne(AnalisaTanahBagunan::class, 'analisa_id');
|
||||
}
|
||||
|
||||
|
||||
public function analisaLingkungan(){
|
||||
return $this->hasOne(AnalisaLingkungan::class, 'analisa_id');
|
||||
}
|
||||
|
||||
|
||||
public function analisaFakta(){
|
||||
return $this->hasOne(AnalisaFakta::class, 'analisa_id');
|
||||
}
|
||||
|
||||
public function jenisJaminan(){
|
||||
return $this->belongsTo(JenisJaminan::class, 'jenis_jaminan_id');
|
||||
}
|
||||
|
||||
public function analisaUnit(){
|
||||
return $this->hasOne(AnalisaUnit::class, 'analisa_id');
|
||||
}
|
||||
|
||||
|
||||
protected static function newFactory(): AnalisaFactory
|
||||
{
|
||||
//return AnalisaFactory::new();
|
||||
}
|
||||
}
|
||||
29
app/Models/AnalisaFakta.php
Normal file
29
app/Models/AnalisaFakta.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\AnalisaFaktaFactory;
|
||||
|
||||
class AnalisaFakta extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'analisa_fakta';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['analisa_id', 'fakta_positif', 'fakta_negatif','rute_menju','batas_batas','kondisi_linkungan','kondisi_lain_bangunan','informasi_dokument','peruntukan','kdb','kdh','gsb','max_lantai','klb','gss','pelebaran_jalan','nama_petugas','foto_tempat','lat','lng', 'keterangan'];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
protected static function newFactory(): AnalisaFaktaFactory
|
||||
{
|
||||
//return AnalisaFaktaFactory::new();
|
||||
}
|
||||
}
|
||||
23
app/Models/AnalisaLingkungan.php
Normal file
23
app/Models/AnalisaLingkungan.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\AnalisaLingkunganFactory;
|
||||
|
||||
class AnalisaLingkungan extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'analisa_lingkungan';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['analisa_id', 'jarak_jalan_utama', 'alamat', 'jarak_cbd_point','lebar_perkerasan_jalan','perkerasan_jalan','lalu_lintas','gol_mas_sekitar','tingkat_keramaian','terletak_diarea','disekitar_lokasi','dekat_makam','dekat_tps','merupakan_daerah','fasilitas_dekat_object'];
|
||||
|
||||
protected static function newFactory(): AnalisaLingkunganFactory
|
||||
{
|
||||
//return AnalisaLingkunganFactory::new();
|
||||
}
|
||||
}
|
||||
40
app/Models/AnalisaTanahBagunan.php
Normal file
40
app/Models/AnalisaTanahBagunan.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\AnalisaTanahBagunanFactory;
|
||||
|
||||
class AnalisaTanahBagunan extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'analisa_tanah_bangunan';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['bentuk_tanah', 'kontur_tanah', 'posisi_kavling', 'ketinggian_jalan','kontur_jalan', 'kondisi_fisik_tanah','jenis_bangunan', 'kondisi_bangunan', 'sifat_bangunan', 'sarana_pelengkap', 'analisa_id', 'tusuk_sate','lockland'];
|
||||
|
||||
|
||||
public function analisa()
|
||||
{
|
||||
return $this->belongsTo(Analisa::class);
|
||||
}
|
||||
|
||||
public function spekBangunanAnalisa()
|
||||
{
|
||||
return $this->hasMany(SpekBangunanAnalisa::class, 'analisa_tanah_bangunan_id');
|
||||
}
|
||||
|
||||
public function spekBagunanAnalisaDetail()
|
||||
{
|
||||
return $this->hasMany(SpekBagunanAnalisaDetail::class, 'analisa_tanah_bangunan_id');
|
||||
}
|
||||
|
||||
protected static function newFactory(): AnalisaTanahBagunanFactory
|
||||
{
|
||||
//return AnalisaTanahBagunanFactory::new();
|
||||
}
|
||||
}
|
||||
23
app/Models/AnalisaUnit.php
Normal file
23
app/Models/AnalisaUnit.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\AnalisaUnitFactory;
|
||||
|
||||
class AnalisaUnit extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'analisa_unit';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['jenis_unit', 'analisa_id', 'kondisi_unit','posisi_unit', 'lantai', 'view', 'bentuk_unit'];
|
||||
|
||||
protected static function newFactory(): AnalisaUnitFactory
|
||||
{
|
||||
//return AnalisaUnitFactory::new();
|
||||
}
|
||||
}
|
||||
9
app/Models/ArahMataAngin.php
Normal file
9
app/Models/ArahMataAngin.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
class ArahMataAngin extends Base
|
||||
{
|
||||
protected $table = 'arah_mata_angin';
|
||||
protected $fillable = ['name','authorized_at','authorized_status','authorized_by'];
|
||||
}
|
||||
71
app/Models/Authorization.php
Normal file
71
app/Models/Authorization.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Modules\Usermanagement\Models\User;
|
||||
|
||||
class Authorization extends Model
|
||||
{
|
||||
protected $table = 'authorizations';
|
||||
|
||||
protected $fillable = [
|
||||
'permohonan_id',
|
||||
'jenis',
|
||||
'approve_so',
|
||||
'status_so',
|
||||
'keterangan_so',
|
||||
'approve_so_at',
|
||||
'approve_eo',
|
||||
'status_eo',
|
||||
'keterangan_eo',
|
||||
'approve_eo_at',
|
||||
'approve_dd',
|
||||
'status_dd',
|
||||
'keterangan_dd',
|
||||
'approve_dd_at',
|
||||
'status',
|
||||
'keterangan',
|
||||
'request',
|
||||
'alasan',
|
||||
'user_id',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
// 'approve_so' => 'boolean',
|
||||
// 'approve_eo' => 'boolean',
|
||||
// 'approve_dd' => 'boolean',
|
||||
'approve_so_at' => 'datetime',
|
||||
'approve_eo_at' => 'datetime',
|
||||
'approve_dd_at' => 'datetime',
|
||||
];
|
||||
|
||||
/**
|
||||
* Get the permohonan that owns the authorization.
|
||||
*/
|
||||
public function permohonan(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Permohonan::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the user that owns the authorization.
|
||||
*/
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function approveEo(){
|
||||
return $this->belongsTo(User::class, 'approve_eo', 'id');
|
||||
}
|
||||
|
||||
public function approveDd(){
|
||||
return $this->belongsTo(User::class, 'approve_dd', 'id');
|
||||
}
|
||||
|
||||
public function approveSo(){
|
||||
return $this->belongsTo(User::class, 'approve_so', 'id');
|
||||
}
|
||||
}
|
||||
104
app/Models/BankData.php
Normal file
104
app/Models/BankData.php
Normal file
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
use Modules\Location\Models\City;
|
||||
use Modules\Location\Models\District;
|
||||
use Modules\Location\Models\Province;
|
||||
use Modules\Location\Models\Village;
|
||||
|
||||
class BankData extends Base
|
||||
{
|
||||
|
||||
protected $table = 'bank_data';
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
protected $casts = [
|
||||
'tahun' => 'integer',
|
||||
'luas_tanah' => 'decimal:2',
|
||||
'luas_bangunan' => 'decimal:2',
|
||||
'tahun_bangunan' => 'integer',
|
||||
'harga' => 'decimal:2',
|
||||
'harga_diskon' => 'decimal:2',
|
||||
'diskon' => 'decimal:2',
|
||||
'total' => 'decimal:2',
|
||||
'kordinat_lat' => 'decimal:8',
|
||||
'kordinat_lng' => 'decimal:8',
|
||||
'harga_penawaran' => 'decimal:2',
|
||||
'tanggal' => 'date',
|
||||
'tgl_final_laporan' => 'date',
|
||||
'nilai_pasar' => 'decimal:2',
|
||||
'indikasi_nilai_likuidasi' => 'decimal:2',
|
||||
'indikasi_nilai_pasar_tanah' => 'decimal:2',
|
||||
'estimasi_harga_tanah' => 'decimal:2',
|
||||
'estimasi_harga_bangunan' => 'decimal:2',
|
||||
'indikasi_nilai_pasar_bangunan' => 'decimal:2',
|
||||
'indikasi_nilai_pasar_sarana_pelengkap' => 'decimal:2',
|
||||
'indikasi_nilai_pasar_mesin' => 'decimal:2',
|
||||
'indikasi_nilai_pasar_kendaraan_alat_berat' => 'decimal:2',
|
||||
'photos' => 'array'
|
||||
];
|
||||
|
||||
// Scope for filtering by asset type
|
||||
public function scopeOfAssetType($query, $assetType)
|
||||
{
|
||||
return $query->where('jenis_aset', $assetType);
|
||||
}
|
||||
|
||||
// Scope for filtering by village
|
||||
public function scopeOfVillage($query, $villageCode)
|
||||
{
|
||||
return $query->where('village_code', $villageCode);
|
||||
}
|
||||
|
||||
// Scope for filtering by district
|
||||
public function scopeOfDistrict($query, $districtCode)
|
||||
{
|
||||
return $query->where('district_code', $districtCode);
|
||||
}
|
||||
|
||||
// Scope for filtering by city
|
||||
public function scopeOfCity($query, $cityCode)
|
||||
{
|
||||
return $query->where('city_code', $cityCode);
|
||||
}
|
||||
|
||||
// Scope for filtering by province
|
||||
public function scopeOfProvince($query, $provinceCode)
|
||||
{
|
||||
return $query->where('province_code', $provinceCode);
|
||||
}
|
||||
|
||||
// Scope for filtering by date
|
||||
public function scopeOfDate($query, $date)
|
||||
{
|
||||
return $query->whereDate('tanggal', $date);
|
||||
}
|
||||
|
||||
// Scope for filtering by date range
|
||||
public function scopeBetweenDates($query, $startDate, $endDate)
|
||||
{
|
||||
return $query->whereBetween('tanggal', [$startDate, $endDate]);
|
||||
}
|
||||
|
||||
public function village()
|
||||
{
|
||||
return $this->belongsTo(Village::class, 'village_code', 'code');
|
||||
}
|
||||
|
||||
public function district()
|
||||
{
|
||||
return $this->belongsTo(District::class, 'district_code', 'code');
|
||||
}
|
||||
|
||||
public function city()
|
||||
{
|
||||
return $this->belongsTo(City::class, 'city_code', 'code');
|
||||
}
|
||||
|
||||
public function province()
|
||||
{
|
||||
return $this->belongsTo(Province::class, 'province_code', 'code');
|
||||
}
|
||||
|
||||
}
|
||||
52
app/Models/Base.php
Normal file
52
app/Models/Base.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Spatie\Activitylog\LogOptions;
|
||||
use Spatie\Activitylog\Traits\LogsActivity;
|
||||
use Wildside\Userstamps\Userstamps;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Base extends Model
|
||||
{
|
||||
use LogsActivity, SoftDeletes, Userstamps, Notifiable;
|
||||
|
||||
protected $connection;
|
||||
|
||||
/**
|
||||
* Constructs a new instance of the class.
|
||||
*
|
||||
* @param array $attributes Optional attributes to initialize the object with.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
parent::__construct($attributes);
|
||||
|
||||
// Retrieve the module configuration from the module.json file
|
||||
$modulePath = dirname(__FILE__, 3) . '/module.json';
|
||||
$module = file_get_contents($modulePath);
|
||||
$module = json_decode($module);
|
||||
|
||||
// Set the connection property to the database connection specified in the module configuration
|
||||
$this->connection = $module->database;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the activity log options for the User Management.
|
||||
*
|
||||
* @return LogOptions The activity log options.
|
||||
*/
|
||||
public function getActivitylogOptions()
|
||||
: LogOptions
|
||||
{
|
||||
return LogOptions::defaults()->logAll()->useLogName('LPJ : ');
|
||||
}
|
||||
}
|
||||
24
app/Models/BentukTanah.php
Normal file
24
app/Models/BentukTanah.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\BentukTanahFactory;
|
||||
|
||||
class BentukTanah extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'bentuk_tanah';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
|
||||
protected static function newFactory(): BentukTanahFactory
|
||||
{
|
||||
//return BentukTanahFactory::new();
|
||||
}
|
||||
}
|
||||
24
app/Models/BentukUnit.php
Normal file
24
app/Models/BentukUnit.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
// use Modules\Lpj\Database\Factories\BentukUnitFactory;
|
||||
|
||||
class BentukUnit extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'bentuk_unit';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
// protected static function newFactory(): BentukUnitFactory
|
||||
// {
|
||||
// // return BentukUnitFactory::new();
|
||||
// }
|
||||
}
|
||||
13
app/Models/Branch.php
Normal file
13
app/Models/Branch.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Modules\Basicdata\Models\Branch as BasicdataBranch;
|
||||
|
||||
class Branch extends BasicdataBranch
|
||||
{
|
||||
public function debitures()
|
||||
{
|
||||
return $this->hasMany(Debiture::class, 'branch_id', 'id');
|
||||
}
|
||||
}
|
||||
26
app/Models/CustomField.php
Normal file
26
app/Models/CustomField.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
// use Modules\Lpj\Database\Factories\CustomFieldFactory;
|
||||
|
||||
class CustomField extends Base
|
||||
{
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'type',
|
||||
'urutan_prioritas',
|
||||
'label'
|
||||
];
|
||||
|
||||
// protected static function newFactory(): CustomFieldFactory
|
||||
// {
|
||||
// // return CustomFieldFactory::new();
|
||||
// }
|
||||
}
|
||||
72
app/Models/Debiture.php
Normal file
72
app/Models/Debiture.php
Normal file
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Modules\Location\Models\City;
|
||||
use Modules\Location\Models\District;
|
||||
use Modules\Location\Models\Province;
|
||||
use Modules\Location\Models\Village;
|
||||
|
||||
class Debiture extends Base
|
||||
{
|
||||
protected $table = 'debitures';
|
||||
protected $fillable = [
|
||||
'branch_id',
|
||||
'cif',
|
||||
'name',
|
||||
'registered_at',
|
||||
'npwp',
|
||||
'email',
|
||||
'phone',
|
||||
'nomor_rekening',
|
||||
'province_code',
|
||||
'city_code',
|
||||
'district_code',
|
||||
'village_code',
|
||||
'postal_code',
|
||||
'address',
|
||||
'status',
|
||||
'authorized_at',
|
||||
'authorized_status',
|
||||
'authorized_by'
|
||||
];
|
||||
|
||||
public function branch()
|
||||
{
|
||||
return $this->belongsTo(Branch::class, 'branch_id', 'id');
|
||||
}
|
||||
|
||||
public function province()
|
||||
{
|
||||
return $this->belongsTo(Province::class, 'province_code', 'code');
|
||||
}
|
||||
|
||||
public function city()
|
||||
{
|
||||
return $this->belongsTo(City::class, 'city_code', 'code');
|
||||
}
|
||||
|
||||
public function district()
|
||||
{
|
||||
return $this->belongsTo(District::class, 'district_code', 'code');
|
||||
}
|
||||
|
||||
public function village()
|
||||
{
|
||||
return $this->belongsTo(Village::class, 'village_code', 'code');
|
||||
}
|
||||
|
||||
public function documents(){
|
||||
return $this->hasMany(DokumenJaminan::class);
|
||||
}
|
||||
|
||||
public function permohonan(){
|
||||
return $this->hasMany(Permohonan::class, 'debiture_id', 'id' );
|
||||
}
|
||||
|
||||
public function laporanAdminKredit(): HasMany
|
||||
{
|
||||
return $this->hasMany(LaporanAdminKredit::class);
|
||||
}
|
||||
|
||||
}
|
||||
27
app/Models/Denah.php
Normal file
27
app/Models/Denah.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\DenahFactory;
|
||||
|
||||
class Denah extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'denah';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['permohonan_id', 'foto_denah', 'luas', 'jenis_jaminan_id'];
|
||||
|
||||
public function jenisJaminan(){
|
||||
return $this->belongsTo(JenisJaminan::class, 'jenis_jaminan_id');
|
||||
}
|
||||
|
||||
protected static function newFactory(): DenahFactory
|
||||
{
|
||||
//return DenahFactory::new();
|
||||
}
|
||||
}
|
||||
35
app/Models/DetailDokumenJaminan.php
Normal file
35
app/Models/DetailDokumenJaminan.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Modules\Location\Models\City;
|
||||
use Modules\Location\Models\District;
|
||||
use Modules\Location\Models\Province;
|
||||
use Modules\Location\Models\Village;
|
||||
use Modules\Lpj\Database\Factories\DokumenJaminanFactory;
|
||||
|
||||
class DetailDokumenJaminan extends Base
|
||||
{
|
||||
protected $table = 'detail_dokumen_jaminan';
|
||||
protected $fillable = [
|
||||
'dokumen_jaminan_id',
|
||||
'jenis_legalitas_jaminan_id',
|
||||
'name',
|
||||
'dokumen_jaminan',
|
||||
'dokumen_nomor',
|
||||
'keterangan',
|
||||
'details',
|
||||
'status',
|
||||
'authorized_at',
|
||||
'authorized_status',
|
||||
'authorized_by',
|
||||
];
|
||||
|
||||
public function jenisLegalitasJaminan(){
|
||||
return $this->belongsTo(JenisLegalitasJaminan::class, 'jenis_legalitas_jaminan_id', 'id');
|
||||
}
|
||||
|
||||
public function dokumenJaminan(){
|
||||
return $this->belongsTo(DokumenJaminan::class, 'dokumen_jaminan_id', 'id');
|
||||
}
|
||||
}
|
||||
74
app/Models/DokumenJaminan.php
Normal file
74
app/Models/DokumenJaminan.php
Normal file
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Modules\Location\Models\City;
|
||||
use Modules\Location\Models\District;
|
||||
use Modules\Location\Models\Province;
|
||||
use Modules\Location\Models\Village;
|
||||
use Modules\Lpj\Database\Factories\DokumenJaminanFactory;
|
||||
|
||||
class DokumenJaminan extends Base
|
||||
{
|
||||
protected $table = 'dokumen_jaminan';
|
||||
protected $fillable = [
|
||||
'debiture_id',
|
||||
'permohonan_id',
|
||||
'pemilik_jaminan_id',
|
||||
'jenis_jaminan_id',
|
||||
'province_code',
|
||||
'city_code',
|
||||
'district_code',
|
||||
'village_code',
|
||||
'postal_code',
|
||||
'address',
|
||||
'status',
|
||||
'authorized_at',
|
||||
'authorized_status',
|
||||
'authorized_by',
|
||||
];
|
||||
|
||||
public function province()
|
||||
{
|
||||
return $this->belongsTo(Province::class, 'province_code', 'code');
|
||||
}
|
||||
|
||||
public function city()
|
||||
{
|
||||
return $this->belongsTo(City::class, 'city_code', 'code');
|
||||
}
|
||||
|
||||
public function district()
|
||||
{
|
||||
return $this->belongsTo(District::class, 'district_code', 'code');
|
||||
}
|
||||
|
||||
public function village()
|
||||
{
|
||||
return $this->belongsTo(Village::class, 'village_code', 'code');
|
||||
}
|
||||
|
||||
public function debiture(){
|
||||
return $this->belongsTo(Debiture::class, 'debiture_id', 'id');
|
||||
}
|
||||
|
||||
public function pemilik(){
|
||||
return $this->belongsTo(PemilikJaminan::class, 'pemilik_jaminan_id', 'id');
|
||||
}
|
||||
|
||||
public function jenisJaminan(){
|
||||
return $this->belongsTo(JenisJaminan::class, 'jenis_jaminan_id', 'id');
|
||||
}
|
||||
|
||||
public function permohonan(){
|
||||
return $this->belongsTo(Permohonan::class, 'permohonan_id', 'id');
|
||||
}
|
||||
|
||||
public function detail(){
|
||||
return $this->hasMany(DetailDokumenJaminan::class, 'dokumen_jaminan_id', 'id');
|
||||
}
|
||||
public function inspeksi()
|
||||
{
|
||||
return $this->hasMany(Inspeksi::class, 'dokument_id', 'id');
|
||||
}
|
||||
}
|
||||
23
app/Models/FasilitasObjek.php
Normal file
23
app/Models/FasilitasObjek.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
// use Modules\Lpj\Database\Factories\FasilitasObjekFactory;
|
||||
|
||||
class FasilitasObjek extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'fasilitas_objek';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
// protected static function newFactory(): FasilitasObjekFactory
|
||||
// {
|
||||
// // return FasilitasObjekFactory::new();
|
||||
// }
|
||||
}
|
||||
41
app/Models/FotoJaminan.php
Normal file
41
app/Models/FotoJaminan.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\FotoJaminanFactory;
|
||||
|
||||
class FotoJaminan extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'foto_jaminan';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['permohonan_id', 'pendamping', 'jenis_jaminan_id'];
|
||||
|
||||
|
||||
|
||||
public function objekJaminan(){
|
||||
|
||||
return $this->hasMany(ObjekJaminan::class, 'foto_jaminan_id');
|
||||
}
|
||||
|
||||
|
||||
public function ruteJaminan(){
|
||||
return $this->hasMany(RuteJaminan::class, 'foto_jaminan_id');
|
||||
}
|
||||
|
||||
|
||||
public function lingkungan(){
|
||||
return $this->hasMany(Lingkungan::class, 'foto_jaminan_id');
|
||||
}
|
||||
|
||||
|
||||
public function lantaiUnit(){
|
||||
return $this->hasMany(lantaiUnit::class, 'objek_jaminan_id', 'id');
|
||||
}
|
||||
}
|
||||
24
app/Models/FotoObjekJaminan.php
Normal file
24
app/Models/FotoObjekJaminan.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
// use Modules\Lpj\Database\Factories\FotoObjekJaminanFactory;
|
||||
|
||||
class FotoObjekJaminan extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'foto_objek_jaminan';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $guarded = ['id'];
|
||||
|
||||
// protected static function newFactory(): FotoObjekJaminanFactory
|
||||
// {
|
||||
// // return FotoObjekJaminanFactory::new();
|
||||
// }
|
||||
}
|
||||
24
app/Models/GolonganMasySekitar.php
Normal file
24
app/Models/GolonganMasySekitar.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\GolonganMasySekitarFactory;
|
||||
|
||||
class GolonganMasySekitar extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'gol_mas_sekitar';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
|
||||
protected static function newFactory(): GolonganMasySekitarFactory
|
||||
{
|
||||
//return GolonganMasySekitarFactory::new();
|
||||
}
|
||||
}
|
||||
10
app/Models/HolidayCalendar.php
Normal file
10
app/Models/HolidayCalendar.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Modules\Basicdata\Models\HolidayCalendar as BasicdataHolidayCalendar;
|
||||
|
||||
class HolidayCalendar extends BasicdataHolidayCalendar
|
||||
{
|
||||
|
||||
}
|
||||
9
app/Models/HubunganPemilikJaminan.php
Normal file
9
app/Models/HubunganPemilikJaminan.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
class HubunganPemilikJaminan extends Base
|
||||
{
|
||||
protected $table = 'hubungan_pemilik_jaminan';
|
||||
protected $fillable = ['name','authorized_at','authorized_status','authorized_by'];
|
||||
}
|
||||
9
app/Models/HubunganPenghuniJaminan.php
Normal file
9
app/Models/HubunganPenghuniJaminan.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
class HubunganPenghuniJaminan extends Base
|
||||
{
|
||||
protected $table = 'hubungan_penghuni_jaminan';
|
||||
protected $fillable = ['name','authorized_at','authorized_status','authorized_by'];
|
||||
}
|
||||
18
app/Models/IjinUsaha.php
Normal file
18
app/Models/IjinUsaha.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class IjinUsaha extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'ijin_usaha';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name'];
|
||||
}
|
||||
28
app/Models/Inspeksi.php
Normal file
28
app/Models/Inspeksi.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
// use Modules\Lpj\Database\Factories\InspeksiFactory;
|
||||
|
||||
class Inspeksi extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'inspeksi';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['data_form', 'foto_form', 'denah_form','permohonan_id', 'name', 'status', 'authorized_status', 'authorized_at', 'authorized_by', 'created_by', 'updated_by', 'deleted_by','dokument_id','data_pembanding'];
|
||||
|
||||
public function permohonan()
|
||||
{
|
||||
return $this->belongsTo(Permohonan::class, 'permohonan_id');
|
||||
}
|
||||
|
||||
public function dokument()
|
||||
{
|
||||
return $this->belongsTo(DokumenJaminan::class, 'dokument_id');
|
||||
}
|
||||
}
|
||||
11
app/Models/JenisAset.php
Normal file
11
app/Models/JenisAset.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Modules\Lpj\Database\Factories\JenisAsetFactory;
|
||||
|
||||
class JenisAset extends Base
|
||||
{
|
||||
protected $table = 'jenis_aset';
|
||||
protected $fillable = ['code', 'name'];
|
||||
}
|
||||
23
app/Models/JenisBangunan.php
Normal file
23
app/Models/JenisBangunan.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\JenisBangunanFactory;
|
||||
|
||||
class JenisBangunan extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'jenis_bangunan';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
protected static function newFactory(): JenisBangunanFactory
|
||||
{
|
||||
//return JenisBangunanFactory::new();
|
||||
}
|
||||
}
|
||||
10
app/Models/JenisDokumen.php
Normal file
10
app/Models/JenisDokumen.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
|
||||
class JenisDokumen extends Base
|
||||
{
|
||||
protected $table = 'jenis_dokumen';
|
||||
protected $fillable = ['name','max_size', 'description'];
|
||||
}
|
||||
11
app/Models/JenisFasilitasKredit.php
Normal file
11
app/Models/JenisFasilitasKredit.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
class JenisFasilitasKredit extends Base
|
||||
{
|
||||
protected $table = 'jenis_fasilitas_kredit';
|
||||
|
||||
protected $fillable = ['code', 'name'];
|
||||
|
||||
}
|
||||
9
app/Models/JenisJaminan.php
Normal file
9
app/Models/JenisJaminan.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
class JenisJaminan extends Base
|
||||
{
|
||||
protected $table = 'jenis_jaminan';
|
||||
protected $fillable = ['code', 'name', 'slug', 'jenis_legalitas_jaminan_id', 'form_kategori'];
|
||||
}
|
||||
24
app/Models/JenisKapal.php
Normal file
24
app/Models/JenisKapal.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
// use Modules\Lpj\Database\Factories\JenisKapalFactory;
|
||||
|
||||
class JenisKapal extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'jenis_kapal';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
|
||||
|
||||
protected $fillable = ['name', 'code', 'status', 'authorized_status', 'authorized_at', 'authorized_by', 'created_by', 'updated_by', 'deleted_by'];
|
||||
// protected static function newFactory(): JenisKapalFactory
|
||||
// {
|
||||
// // return JenisKapalFactory::new();
|
||||
// }
|
||||
}
|
||||
23
app/Models/JenisKendaraan.php
Normal file
23
app/Models/JenisKendaraan.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
// use Modules\Lpj\Database\Factories\JenisKendaraanFactory;
|
||||
|
||||
class JenisKendaraan extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'jenis_kendaraan';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['name', 'code', 'status', 'authorized_status', 'authorized_at', 'authorized_by', 'created_by', 'updated_by', 'deleted_by'];
|
||||
|
||||
// protected static function newFactory(): JenisKendaraanFactory
|
||||
// {
|
||||
// // return JenisKendaraanFactory::new();
|
||||
// }
|
||||
}
|
||||
20
app/Models/JenisLampiran.php
Normal file
20
app/Models/JenisLampiran.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Modules\Lpj\Models\Base;
|
||||
use Modules\Lpj\Models\LampiranDokumen;
|
||||
|
||||
class JenisLampiran extends Base
|
||||
{
|
||||
|
||||
protected $table = 'jenis_lampiran';
|
||||
protected $fillable = ['nama', 'deskripsi'];
|
||||
|
||||
public function lampiranDokumen()
|
||||
{
|
||||
return $this->hasMany(LampiranDokumen::class);
|
||||
}
|
||||
}
|
||||
27
app/Models/JenisLaporan.php
Normal file
27
app/Models/JenisLaporan.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\JenisLaporanFactory;
|
||||
|
||||
class JenisLaporan extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
|
||||
// Define the table if not using default table naming
|
||||
protected $table = 'jenis_laporan';
|
||||
|
||||
|
||||
protected $fillable = ['code', 'name'];
|
||||
|
||||
public function penawaran()
|
||||
{
|
||||
return $this->hasMany(PenawaranTender::class, 'jenis_laporan_id', 'id');
|
||||
}
|
||||
}
|
||||
20
app/Models/JenisLegalitasJaminan.php
Normal file
20
app/Models/JenisLegalitasJaminan.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Modules\Lpj\Database\Factories\JenisLegalitasJaminanFactory;
|
||||
|
||||
class JenisLegalitasJaminan extends Base
|
||||
{
|
||||
protected $table = 'jenis_legalitas_jaminan';
|
||||
protected $fillable = ['code', 'name','slug','custom_field','custom_field_type','custom_fields'];
|
||||
|
||||
protected $casts = [
|
||||
'custom_fields' => 'array',
|
||||
];
|
||||
|
||||
public function customFields()
|
||||
{
|
||||
return $this->hasMany(CustomField::class);
|
||||
}
|
||||
}
|
||||
25
app/Models/JenisPenilaian.php
Normal file
25
app/Models/JenisPenilaian.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Modules\Lpj\Database\Factories\JenisPenilaianFactory;
|
||||
use Modules\Lpj\Models\Penilaian;
|
||||
class JenisPenilaian extends Base
|
||||
{
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $table = 'jenis_penilaian';
|
||||
|
||||
protected $fillable = [
|
||||
'code', 'name', 'status', 'authorized_status', 'authorized_at', 'authorized_by',
|
||||
'created_at', 'created_by', 'updated_at', 'updated_by', 'deleted_at', 'deleted_by'
|
||||
];
|
||||
|
||||
public function penilaian(){
|
||||
return $this->hasMany(Penilaian::class , 'jenis_penilaian_id', 'id');
|
||||
}
|
||||
|
||||
}
|
||||
23
app/Models/JenisPesawat.php
Normal file
23
app/Models/JenisPesawat.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
// use Modules\Lpj\Database\Factories\JenisPesawatFactory;
|
||||
|
||||
class JenisPesawat extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'jenis_pesawat';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['name', 'code', 'status', 'authorized_status', 'authorized_at', 'authorized_by', 'created_by', 'updated_by', 'deleted_by'];
|
||||
|
||||
// protected static function newFactory(): JenisPesawatFactory
|
||||
// {
|
||||
// // return JenisPesawatFactory::new();
|
||||
// }
|
||||
}
|
||||
24
app/Models/JenisUnit.php
Normal file
24
app/Models/JenisUnit.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
// use Modules\Lpj\Database\Factories\JenisUnitFactory;
|
||||
|
||||
class JenisUnit extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'jenis_unit';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
// protected static function newFactory(): JenisUnitFactory
|
||||
// {
|
||||
// // return JenisUnitFactory::new();
|
||||
// }
|
||||
}
|
||||
36
app/Models/KJPP.php
Normal file
36
app/Models/KJPP.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Modules\Location\Models\City;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
// use Modules\Lpj\Database\Factories\KJPPFactory;
|
||||
|
||||
class KJPP extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
// Define the table if not using default table naming
|
||||
protected $table = 'kjpp';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $guarded = ['id'];
|
||||
|
||||
public function PenawaranDetailTender(): HasMany
|
||||
{
|
||||
return $this->hasMany(PenawaranDetailTender::class, 'kjpp_rekanan_id', 'id');
|
||||
}
|
||||
|
||||
public function city()
|
||||
{
|
||||
return $this->belongsTo(City::class, 'city_code', 'code');
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
24
app/Models/KetinggianTanah.php
Normal file
24
app/Models/KetinggianTanah.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\KetinggianTanahFactory;
|
||||
|
||||
class KetinggianTanah extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'ketinggian_tanah';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
protected static function newFactory(): KetinggianTanahFactory
|
||||
{
|
||||
//return KetinggianTanahFactory::new();
|
||||
}
|
||||
}
|
||||
23
app/Models/KondisiBangunan.php
Normal file
23
app/Models/KondisiBangunan.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\KondisiBangunanFactory;
|
||||
|
||||
class KondisiBangunan extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'kondisi_bangunan';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code','name'];
|
||||
|
||||
protected static function newFactory(): KondisiBangunanFactory
|
||||
{
|
||||
//return KondisiBangunanFactory::new();
|
||||
}
|
||||
}
|
||||
23
app/Models/KondisiFisikTanah.php
Normal file
23
app/Models/KondisiFisikTanah.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\KondisiFisikTanahFactory;
|
||||
|
||||
class KondisiFisikTanah extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'kondisi_fisik_tanah';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
protected static function newFactory(): KondisiFisikTanahFactory
|
||||
{
|
||||
//return KondisiFisikTanahFactory::new();
|
||||
}
|
||||
}
|
||||
23
app/Models/KonturTanah.php
Normal file
23
app/Models/KonturTanah.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\KonturTanahFactory;
|
||||
|
||||
class KonturTanah extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'kontur_tanah';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
protected static function newFactory(): KonturTanahFactory
|
||||
{
|
||||
//return KonturTanahFactory::new();
|
||||
}
|
||||
}
|
||||
23
app/Models/LaluLintasLokasi.php
Normal file
23
app/Models/LaluLintasLokasi.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\LaluLintasLokasiFactory;
|
||||
|
||||
class LaluLintasLokasi extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'lalu_lintas_lokasi';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
protected static function newFactory(): LaluLintasLokasiFactory
|
||||
{
|
||||
//return LaluLintasLokasiFactory::new();
|
||||
}
|
||||
}
|
||||
71
app/Models/LampiranDokumen.php
Normal file
71
app/Models/LampiranDokumen.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class LampiranDokumen extends Base
|
||||
{
|
||||
protected $table = 'lampiran_dokumen';
|
||||
|
||||
protected $fillable = ['permohonan_id', 'nama_file', 'path_file', 'keterangan','jenis_lampiran_id'];
|
||||
|
||||
public function permohonan()
|
||||
{
|
||||
return $this->belongsTo(Permohonan::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Upload lampiran dokumen for penilai or administrator
|
||||
*
|
||||
* @param int $permohonanId
|
||||
* @param array $fileData
|
||||
* @return LampiranDokumen|null
|
||||
*/
|
||||
public static function uploadLampiran($fileData)
|
||||
{
|
||||
$user = Auth::user();
|
||||
|
||||
if ($user && $user->hasAnyRole(['penilai', 'administrator', 'Penilai', 'admin','surveyor'])) {
|
||||
$file = $fileData['file'];
|
||||
$fileName = $fileData['nama_file'] ?? time() . '_' . $file->getClientOriginalName();
|
||||
$filePath = $file->storeAs('lampiran_dokumen', $fileName, 'public');
|
||||
|
||||
return self::create([
|
||||
'permohonan_id' => $fileData['permohonan_id'] ?? null,
|
||||
'jenis_lampiran_id' => $fileData['jenis_lampiran_id'] ?? null,
|
||||
'nama_file' => $fileName,
|
||||
'path_file' => $filePath,
|
||||
'keterangan' => $fileData['keterangan'] ?? null,
|
||||
]);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete lampiran dokumen
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteLampiran()
|
||||
{
|
||||
$user = Auth::user();
|
||||
|
||||
if ($user && ($user->hasRole('penilai') || $user->hasRole('administrator'))) {
|
||||
// Delete the file from storage
|
||||
Storage::disk('public')->delete($this->path_file);
|
||||
|
||||
// Delete the database record
|
||||
return $this->delete();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function jenisLampiran()
|
||||
{
|
||||
return $this->belongsTo(JenisLampiran::class);
|
||||
}
|
||||
}
|
||||
23
app/Models/Lantai.php
Normal file
23
app/Models/Lantai.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\LokasiUnitFactory;
|
||||
|
||||
class Lantai extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'lantai';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['name', 'code', 'status', 'authorized_status', 'authorized_at', 'authorized_by', 'created_by', 'updated_by', 'deleted_by'];
|
||||
|
||||
protected static function newFactory(): LokasiUnitFactory
|
||||
{
|
||||
//return LokasiUnitFactory::new();
|
||||
}
|
||||
}
|
||||
24
app/Models/LantaiUnit.php
Normal file
24
app/Models/LantaiUnit.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\LantaiUnitFactory;
|
||||
|
||||
class LantaiUnit extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'lantai_unit';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['name_lantai_unit','foto_lantai_unit', 'objek_jaminan_id'];
|
||||
|
||||
protected static function newFactory(): LantaiUnitFactory
|
||||
{
|
||||
//return LantaiUnitFactory::new();
|
||||
}
|
||||
}
|
||||
36
app/Models/Laporan.php
Normal file
36
app/Models/Laporan.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
// use Modules\Lpj\Database\Factories\LaporanFactory;
|
||||
|
||||
class Laporan extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'laporan';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $guarded = ['id'];
|
||||
|
||||
|
||||
public function jenisLaporan(){
|
||||
return $this->belongsTo(JenisLaporan::class);
|
||||
}
|
||||
|
||||
public function dokument(){
|
||||
return $this->belongsTo(DokumenJaminan::class);
|
||||
}
|
||||
|
||||
public function permohonan(){
|
||||
return $this->belongsTo(Permohonan::class);
|
||||
}
|
||||
|
||||
// protected static function newFactory(): LaporanFactory
|
||||
// {
|
||||
// // return LaporanFactory::new();
|
||||
// }
|
||||
}
|
||||
37
app/Models/LaporanAdminKredit.php
Normal file
37
app/Models/LaporanAdminKredit.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class LaporanAdminKredit extends Base
|
||||
{
|
||||
protected $table = 'laporan_admin_kredit';
|
||||
|
||||
protected $fillable = [
|
||||
'debiture_id',
|
||||
'kode_register_t24',
|
||||
'jenis_agunan',
|
||||
'bukti_kepemilikan',
|
||||
'alamat_agunan',
|
||||
'nama_pemilik',
|
||||
'tanggal_kunjungan',
|
||||
'nilai_pasar_wajar',
|
||||
'nilai_likuidasi',
|
||||
'nama_penilai'
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'tanggal_kunjungan' => 'date',
|
||||
'nilai_pasar_wajar' => 'decimal:2',
|
||||
'nilai_likuidasi' => 'decimal:2',
|
||||
];
|
||||
|
||||
/**
|
||||
* Get the debiture that owns the laporan admin kredit.
|
||||
*/
|
||||
public function debiture(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Debiture::class);
|
||||
}
|
||||
}
|
||||
32
app/Models/LaporanExternal.php
Normal file
32
app/Models/LaporanExternal.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
// use Modules\Lpj\Database\Factories\LaporanExternalFactory;
|
||||
|
||||
class LaporanExternal extends Base
|
||||
{
|
||||
protected $fillable = [
|
||||
'permohonan_id',
|
||||
'nomor_laporan',
|
||||
'tgl_final_laporan',
|
||||
'nilai_pasar',
|
||||
'indikasi_nilai_likuidasi',
|
||||
'indikasi_nilai_pasar_tanah',
|
||||
'estimasi_harga_tanah',
|
||||
'estimasi_harga_bangunan',
|
||||
'indikasi_nilai_pasar_bangunan',
|
||||
'indikasi_nilai_pasar_sarana_pelengkap',
|
||||
'indikasi_nilai_pasar_mesin',
|
||||
'indikasi_nilai_pasar_kendaraan_alat_berat',
|
||||
'file_resume',
|
||||
'file_laporan',
|
||||
];
|
||||
|
||||
public function permohonan()
|
||||
{
|
||||
return $this->belongsTo(Permohonan::class);
|
||||
}
|
||||
}
|
||||
23
app/Models/Lingkungan.php
Normal file
23
app/Models/Lingkungan.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\LingkunganFactory;
|
||||
|
||||
class Lingkungan extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'lingkungan';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['name_lingkungan', 'foto_jaminan_id', 'foto_lingkungan'];
|
||||
|
||||
protected static function newFactory(): LingkunganFactory
|
||||
{
|
||||
//return LingkunganFactory::new();
|
||||
}
|
||||
}
|
||||
24
app/Models/MerupakanDaerah.php
Normal file
24
app/Models/MerupakanDaerah.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
// use Modules\Lpj\Database\Factories\MerupakanDaerahFactory;
|
||||
|
||||
class MerupakanDaerah extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'merupakan_daerah';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
// protected static function newFactory(): MerupakanDaerahFactory
|
||||
// {
|
||||
// // return MerupakanDaerahFactory::new();
|
||||
// }
|
||||
}
|
||||
23
app/Models/ModelAlatBerat.php
Normal file
23
app/Models/ModelAlatBerat.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
// use Modules\Lpj\Database\Factories\ModelAlatBeratFactory;
|
||||
|
||||
class ModelAlatBerat extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'model_alat_berat';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['name', 'code', 'status', 'authorized_status', 'authorized_at', 'authorized_by', 'created_by', 'updated_by', 'deleted_by'];
|
||||
|
||||
// protected static function newFactory(): ModelAlatBeratFactory
|
||||
// {
|
||||
// // return ModelAlatBeratFactory::new();
|
||||
// }
|
||||
}
|
||||
10
app/Models/NilaiPlafond.php
Normal file
10
app/Models/NilaiPlafond.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
|
||||
class NilaiPlafond extends Base
|
||||
{
|
||||
protected $table = 'nilai_plafond';
|
||||
protected $fillable = ['code', 'name'];
|
||||
}
|
||||
62
app/Models/Noc.php
Normal file
62
app/Models/Noc.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?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',
|
||||
'catatan_noc',
|
||||
'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');
|
||||
}
|
||||
}
|
||||
29
app/Models/ObjekJaminan.php
Normal file
29
app/Models/ObjekJaminan.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\ObjekJaminanFactory;
|
||||
|
||||
class ObjekJaminan extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'objek_jaminan';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['name_objek', 'foto_jaminan_id', 'foto_objek'];
|
||||
|
||||
|
||||
|
||||
public function lantaiUnit(){
|
||||
return $this->hasMany(LantaiUnit::class, 'objek_jaminan_id', 'foto_jaminan_id');
|
||||
}
|
||||
|
||||
protected static function newFactory(): ObjekJaminanFactory
|
||||
{
|
||||
//return ObjekJaminanFactory::new();
|
||||
}
|
||||
}
|
||||
68
app/Models/PemilikJaminan.php
Normal file
68
app/Models/PemilikJaminan.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Location\Models\City;
|
||||
use Modules\Location\Models\District;
|
||||
use Modules\Location\Models\Province;
|
||||
use Modules\Location\Models\Village;
|
||||
use Modules\Lpj\Database\Factories\PemilikJaminanFactory;
|
||||
|
||||
class PemilikJaminan extends Base
|
||||
{
|
||||
protected $table = 'pemilik_jaminan';
|
||||
protected $fillable = [
|
||||
'debiture_id',
|
||||
'hubungan_pemilik_jaminan_id',
|
||||
'name',
|
||||
'npwp',
|
||||
'email',
|
||||
'phone',
|
||||
'nomor_id',
|
||||
'province_code',
|
||||
'city_code',
|
||||
'district_code',
|
||||
'village_code',
|
||||
'postal_code',
|
||||
'address',
|
||||
'status',
|
||||
'authorized_at',
|
||||
'authorized_status',
|
||||
'authorized_by',
|
||||
'detail_sertifikat',
|
||||
];
|
||||
|
||||
public function province()
|
||||
{
|
||||
return $this->belongsTo(Province::class, 'province_code', 'code');
|
||||
}
|
||||
|
||||
public function city()
|
||||
{
|
||||
return $this->belongsTo(City::class, 'city_code', 'code');
|
||||
}
|
||||
|
||||
public function district()
|
||||
{
|
||||
return $this->belongsTo(District::class, 'district_code', 'code');
|
||||
}
|
||||
|
||||
public function village()
|
||||
{
|
||||
return $this->belongsTo(Village::class, 'village_code', 'code');
|
||||
}
|
||||
|
||||
public function debitur(){
|
||||
return $this->belongsTo(Debiture::class, 'debiture_id', 'id');
|
||||
}
|
||||
|
||||
public function dokumen(){
|
||||
return $this->hasMany(DokumenJaminan::class, 'pemilik_jaminan_id', 'id');
|
||||
}
|
||||
|
||||
public function hubungan_pemilik(){
|
||||
return $this->belongsTo(HubunganPemilikJaminan::class, 'hubungan_pemilik_jaminan_id', 'id');
|
||||
}
|
||||
}
|
||||
30
app/Models/PenawaranDetailTender.php
Normal file
30
app/Models/PenawaranDetailTender.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
// use Modules\Lpj\Database\Factories\PenawaranDetailTenderFactory;
|
||||
|
||||
class PenawaranDetailTender extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $table = 'detail_penawaran';
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
public function penawaran(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(PenawaranTender::class, 'penawaran_id', 'id');
|
||||
}
|
||||
|
||||
public function kjpp(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(KJPP::class, 'kjpp_rekanan_id', 'id');
|
||||
}
|
||||
}
|
||||
30
app/Models/PenawaranDetailTenderLog.php
Normal file
30
app/Models/PenawaranDetailTenderLog.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
// use Modules\Lpj\Database\Factories\PenawaranDetailTenderFactory;
|
||||
|
||||
class PenawaranDetailTenderLog extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $table = 'detail_penawaran_logs';
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
public function penawaran(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(PenawaranTender::class, 'penawaran_id', 'id');
|
||||
}
|
||||
|
||||
public function penawarandetail(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(PenawaranDetailTender::class, 'detail_penawaran_id', 'id');
|
||||
}
|
||||
}
|
||||
23
app/Models/PenawaranEmailTenderLog.php
Normal file
23
app/Models/PenawaranEmailTenderLog.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
// use Modules\Lpj\Database\Factories\PenawaranEmailTenderLogFactory;
|
||||
|
||||
class PenawaranEmailTenderLog extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'penawaran_email_tender_log';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $guarded = ['id'];
|
||||
|
||||
public function penawaran()
|
||||
{
|
||||
return $this->belongsTo(PenawaranTender::class, 'penawaran_id', 'id');
|
||||
}
|
||||
}
|
||||
70
app/Models/PenawaranTender.php
Normal file
70
app/Models/PenawaranTender.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Modules\Lpj\Models\TujuanPenilaianKJPP;
|
||||
use Modules\Lpj\Models\PenawaranDetailTender;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany; // andy add
|
||||
|
||||
class PenawaranTender extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $table = 'penawaran';
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
// andy add
|
||||
public function penawarandetails(): HasMany
|
||||
{
|
||||
return $this->hasMany(PenawaranDetailTender::class, 'penawaran_id', 'id')->where('status', '=', 1);
|
||||
}
|
||||
|
||||
public function detail(){
|
||||
return $this->belongsTo(PenawaranDetailTender::class, 'id', 'penawaran_id')->where('status', 1);
|
||||
}
|
||||
// andy add
|
||||
|
||||
public function emailTenderLog(): HasMany
|
||||
{
|
||||
return $this->hasMany(PenawaranEmailTenderLog::class, 'penawaran_id', 'id');
|
||||
}
|
||||
|
||||
public function penawaranKjpp()
|
||||
{
|
||||
return $this->hasMany(PenawaranDetailTender::class, 'penawaran_id');
|
||||
}
|
||||
|
||||
// menambahkan relasi tujuan penilaian KJPP
|
||||
public function tujuanPenilaianKjpp()
|
||||
{
|
||||
return $this->belongsTo(TujuanPenilaianKJPP::class, 'tujuan_penilaian_kjpp_id', 'id');
|
||||
}
|
||||
|
||||
public function permohonan()
|
||||
{
|
||||
return $this->belongsTo(Permohonan::class, 'nomor_registrasi', 'nomor_registrasi');
|
||||
}
|
||||
|
||||
public function jenisLaporan()
|
||||
{
|
||||
return $this->belongsTo(JenisLaporan::class, 'jenis_laporan_id', 'id');
|
||||
}
|
||||
|
||||
public function persetujuan(){
|
||||
return $this->belongsTo(PersetujuanPenawaran::class, 'id', 'penawaran_id');
|
||||
}
|
||||
|
||||
public function penilaian(){
|
||||
return $this->belongsTo(Penilaian::class, 'nomor_registrasi', 'nomor_registrasi');
|
||||
}
|
||||
|
||||
public function persetujuan_penawaran(){
|
||||
return $this->belongsTo(PersetujuanPenawaran::class, 'id', 'penawaran_id');
|
||||
}
|
||||
}
|
||||
37
app/Models/Penilai.php
Normal file
37
app/Models/Penilai.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
// use Modules\Lpj\Database\Factories\PenilaiFactory;
|
||||
|
||||
class Penilai extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'penilai';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $guarded = ['id'];
|
||||
|
||||
// protected static function newFactory(): PenilaiFactory
|
||||
// {
|
||||
// // return PenilaiFactory::new();
|
||||
// }
|
||||
public function dokument(){
|
||||
return $this->belongsTo(DokumenJaminan::class);
|
||||
}
|
||||
public function permohonan(){
|
||||
return $this->belongsTo(Permohonan::class);
|
||||
}
|
||||
public function inspeksi(){
|
||||
return $this->belongsTo(Inspeksi::class);
|
||||
}
|
||||
|
||||
public function penilai_nilai_likuidasi(){
|
||||
return $this->hasMany(PenilaiNilaiLikuidasi::class);
|
||||
}
|
||||
|
||||
}
|
||||
62
app/Models/Penilaian.php
Normal file
62
app/Models/Penilaian.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\PenilaianFactory;
|
||||
use Modules\Lpj\Models\JenisPenilaian;
|
||||
use Modules\Lpj\Models\Teams;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
use Modules\Usermanagement\Models\User;
|
||||
|
||||
class Penilaian extends Base
|
||||
{
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $table = 'penilaian';
|
||||
protected $fillable = [
|
||||
'jenis_penilaian_id', 'penilaian_id', 'tanggal_kunjungan', 'keterangan','nomor_registrasi',
|
||||
'status', 'authorized_status', 'authorized_at', 'authorized_by', 'created_at',
|
||||
'created_by', 'updated_at', 'updated_by', 'deleted_at', 'deleted_by','waktu_penilaian', 'deskripsi_penilaian', 'reschedule_date','reschedule_note','rejected_note'
|
||||
];
|
||||
|
||||
public function jenis_penilaian()
|
||||
{
|
||||
return $this->belongsTo(JenisPenilaian::class, 'jenis_penilaian_id', 'id');
|
||||
}
|
||||
|
||||
public function teams()
|
||||
{
|
||||
return $this->belongsTo(Teams::class, 'teams_id', 'id');
|
||||
}
|
||||
|
||||
public function teamLeader(){
|
||||
return $this->belongsTo(Teams::class, 'teams_id', 'id')
|
||||
->with(['teamsUsers' => function($query) {
|
||||
$query->whereHas('user', function($q) {
|
||||
$q->whereHas('roles', function($r) {
|
||||
$r->where('name', 'senior-officer');
|
||||
});
|
||||
})->with('user');
|
||||
}]);
|
||||
}
|
||||
|
||||
public function userPenilai()
|
||||
{
|
||||
return $this->hasMany(PenilaianTeam::class, 'penilaian_id', 'id');
|
||||
}
|
||||
|
||||
public function _user_penilai()
|
||||
{
|
||||
return $this->hasOne(PenilaianTeam::class, 'penilaian_id', 'id')
|
||||
->where('role', 'penilai')
|
||||
->with('userPenilaiTeam');
|
||||
}
|
||||
|
||||
public function permohonan()
|
||||
{
|
||||
return $this->belongsTo(Permohonan::class, 'nomor_registrasi', 'nomor_registrasi');
|
||||
}
|
||||
}
|
||||
47
app/Models/PenilaianTeam.php
Normal file
47
app/Models/PenilaianTeam.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Modules\Usermanagement\Models\User;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\PenilaianTeamFactory;
|
||||
|
||||
class PenilaianTeam extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'penilaian_team';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['penilaian_id', 'team_id', 'user_id', 'role'];
|
||||
|
||||
|
||||
public function userPenilaiTeam()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id', 'id');
|
||||
}
|
||||
|
||||
public function team()
|
||||
{
|
||||
|
||||
return $this->belongsTo(Teams::class, 'team_id', 'id');
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id', 'id');
|
||||
}
|
||||
|
||||
public function penilaian()
|
||||
{
|
||||
|
||||
return $this->belongsTo(Penilaian::class, 'penilaian_id', 'id');
|
||||
}
|
||||
|
||||
protected static function newFactory(): PenilaianTeamFactory
|
||||
{
|
||||
//return PenilaianTeamFactory::new();
|
||||
}
|
||||
}
|
||||
25
app/Models/Perizinan.php
Normal file
25
app/Models/Perizinan.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
// use Modules\Lpj\Database\Factories\PerizinanFactory;
|
||||
|
||||
class Perizinan extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'perizinan';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $guarded = ['id'];
|
||||
|
||||
|
||||
// protected static function newFactory(): PerizinanFactory
|
||||
// {
|
||||
// // return PerizinanFactory::new();
|
||||
// }
|
||||
}
|
||||
23
app/Models/PerkerasanJalan.php
Normal file
23
app/Models/PerkerasanJalan.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\PerkerasanJalanFactory;
|
||||
|
||||
class PerkerasanJalan extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'perkerasan_jalan';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
protected static function newFactory(): PerkerasanJalanFactory
|
||||
{
|
||||
//return PerkerasanJalanFactory::new();
|
||||
}
|
||||
}
|
||||
268
app/Models/Permohonan.php
Normal file
268
app/Models/Permohonan.php
Normal file
@@ -0,0 +1,268 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Modules\Lpj\Database\Factories\PermohonanFactory;
|
||||
use Modules\Lpj\Services\PermohonanHistoryService;
|
||||
use Modules\Usermanagement\Models\User;
|
||||
|
||||
class Permohonan extends Base
|
||||
{
|
||||
protected $table = 'permohonan';
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'nomor_registrasi',
|
||||
'tanggal_permohonan',
|
||||
'user_id',
|
||||
'branch_id',
|
||||
'tujuan_penilaian_id',
|
||||
'debiture_id',
|
||||
'keterangan',
|
||||
'dokumen',
|
||||
'jenis_fasilitas_kredit_id',
|
||||
'nilai_plafond_id',
|
||||
'status',
|
||||
'authorized_at',
|
||||
'authorized_status',
|
||||
'authorized_by',
|
||||
// andy add
|
||||
'registrasi_catatan',
|
||||
'registrasi_by',
|
||||
'registrasi_at',
|
||||
'jenis_penilaian_id',
|
||||
'region_id',
|
||||
// andy add
|
||||
'status_bayar',
|
||||
'nilai_njop',
|
||||
// andy add
|
||||
'registrasi_catatan',
|
||||
'registrasi_by',
|
||||
'registrasi_at',
|
||||
'region_id',
|
||||
'sla',
|
||||
// andy add
|
||||
'approve_keterangan_bayar',
|
||||
'approve_bayar_by',
|
||||
'approve_bayar_at',
|
||||
|
||||
'approval_eo',
|
||||
'approval_eo_at',
|
||||
'approval_dd',
|
||||
'approval_dd_at',
|
||||
'approval_so',
|
||||
'approval_so_at',
|
||||
'tanggal_paparan'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'tanggal_permohonan',
|
||||
'authorized_at',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'registrasi_at',
|
||||
'approve_bayar_at',
|
||||
'approval_eo_at',
|
||||
'approval_dd_at',
|
||||
'approval_so_at',
|
||||
];
|
||||
|
||||
protected static function boot()
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
static::creating(function ($permohonan) {
|
||||
static::handleFileUpload($permohonan);
|
||||
});
|
||||
|
||||
static::updating(function ($permohonan) {
|
||||
static::handleFileUpload($permohonan);
|
||||
});
|
||||
|
||||
static::created(function ($permohonan) {
|
||||
static::createHistory($permohonan, 'created');
|
||||
});
|
||||
|
||||
static::updated(function ($permohonan) {
|
||||
static::createHistory($permohonan, 'updated');
|
||||
});
|
||||
}
|
||||
|
||||
protected static function handleFileUpload($permohonan)
|
||||
{
|
||||
if (request()->hasFile('attachment')) {
|
||||
$file = request()->file('attachment');
|
||||
$fileName = time() . '_' . $file->getClientOriginalName();
|
||||
$filePath = $file->storeAs('permohonan_attachments', $fileName, 'public');
|
||||
|
||||
$permohonan->dokumen = $filePath;
|
||||
}
|
||||
}
|
||||
|
||||
protected static function createHistory($permohonan, $action)
|
||||
{
|
||||
$historyService = app(PermohonanHistoryService::class);
|
||||
|
||||
$keterangan = request()->input('keterangan', '');
|
||||
if (request()->filled('registrasi_catatan')) {
|
||||
if (!empty($keterangan)) {
|
||||
$keterangan .= "\n";
|
||||
}
|
||||
$keterangan .= request()->input('registrasi_catatan');
|
||||
}
|
||||
|
||||
$status = $permohonan->status;
|
||||
$beforeRequest = $action === 'updated' ? $permohonan->getOriginal() : [];
|
||||
$afterRequest = $permohonan->toArray();
|
||||
|
||||
$file = null;
|
||||
if (request()->hasFile('attachment')) {
|
||||
$file = request()->file('attachment');
|
||||
$fileName = time() . '_' . $file->getClientOriginalName();
|
||||
$filePath = $file->storeAs('permohonan_attachments', $fileName, 'public');
|
||||
|
||||
$file = $filePath;
|
||||
}
|
||||
|
||||
$historyService->createHistory(
|
||||
$permohonan,
|
||||
$status,
|
||||
$keterangan,
|
||||
$beforeRequest,
|
||||
$afterRequest,
|
||||
$file,
|
||||
);
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function branch()
|
||||
{
|
||||
return $this->belongsTo(Branch::class);
|
||||
}
|
||||
|
||||
public function tujuanPenilaian()
|
||||
{
|
||||
return $this->belongsTo(TujuanPenilaian::class);
|
||||
}
|
||||
|
||||
public function debiture()
|
||||
{
|
||||
return $this->belongsTo(Debiture::class);
|
||||
}
|
||||
|
||||
public function documents()
|
||||
{
|
||||
return $this->hasMany(DokumenJaminan::class);
|
||||
}
|
||||
|
||||
public function nilaiPlafond()
|
||||
{
|
||||
return $this->belongsTo(NilaiPlafond::class);
|
||||
}
|
||||
|
||||
public function jenisFasilitasKredit()
|
||||
{
|
||||
return $this->belongsTo(JenisFasilitasKredit::class);
|
||||
}
|
||||
|
||||
public function jenisPenilaian()
|
||||
{
|
||||
return $this->belongsTo(JenisPenilaian::class);
|
||||
}
|
||||
|
||||
public function penilaian()
|
||||
{
|
||||
return $this->belongsTo(Penilaian::class, 'nomor_registrasi', 'nomor_registrasi');
|
||||
}
|
||||
|
||||
public function penilai()
|
||||
{
|
||||
return $this->belongsTo(Penilai::class, 'id', 'permohonan_id');
|
||||
}
|
||||
|
||||
public function penawaranTender()
|
||||
{
|
||||
return $this->belongsTo(PenawaranTender::class, 'nomor_registrasi', 'nomor_registrasi');
|
||||
}
|
||||
|
||||
public function region()
|
||||
{
|
||||
return $this->belongsTo(Regions::class, 'region_id');
|
||||
}
|
||||
|
||||
public function penawaran()
|
||||
{
|
||||
return $this->belongsTo(PenawaranTender::class, 'nomor_registrasi', 'nomor_registrasi');
|
||||
}
|
||||
|
||||
public function histories()
|
||||
{
|
||||
return $this->hasMany(PermohonanHistory::class, 'permohonan_id', 'id')->orderBy('created_at', 'desc');
|
||||
}
|
||||
|
||||
public function dokumenjaminan()
|
||||
{
|
||||
return $this->hasMany(DokumenJaminan::class);
|
||||
}
|
||||
|
||||
public function pembatalan()
|
||||
{
|
||||
return $this->hasMany(PermohonanPembatalan::class);
|
||||
}
|
||||
|
||||
public function approveBayar()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'approve_bayar_by', 'id');
|
||||
}
|
||||
|
||||
public function approveEo()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'approval_eo', 'id');
|
||||
}
|
||||
|
||||
public function approveDd()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'approval_dd', 'id');
|
||||
}
|
||||
|
||||
public function approveSo()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'approval_so', 'id');
|
||||
}
|
||||
|
||||
public function authorization()
|
||||
{
|
||||
return $this->belongsTo(Authorization::class, 'id', 'permohonan_id');
|
||||
}
|
||||
|
||||
public function lampiranDokumen()
|
||||
{
|
||||
return $this->hasMany(LampiranDokumen::class);
|
||||
}
|
||||
|
||||
public function laporanExternal()
|
||||
{
|
||||
return $this->belongsTo(LaporanExternal::class,'id','permohonan_id');
|
||||
}
|
||||
|
||||
|
||||
public function laporan()
|
||||
{
|
||||
return $this->belongsTo(Laporan::class,'id','permohonan_id');
|
||||
}
|
||||
|
||||
public function inspeksi(){
|
||||
return $this->belongsTo(Inspeksi::class, 'permohonan_id');
|
||||
}
|
||||
|
||||
// Add this relationship
|
||||
public function noc()
|
||||
{
|
||||
return $this->hasOne(Noc::class, 'permohonan_id');
|
||||
}
|
||||
|
||||
}
|
||||
33
app/Models/PermohonanHistory.php
Normal file
33
app/Models/PermohonanHistory.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Usermanagement\Models\User;
|
||||
|
||||
// use Modules\Lpj\Database\Factories\PermohonanHistoryFactory;
|
||||
|
||||
class PermohonanHistory extends Base
|
||||
{
|
||||
protected $fillable = [
|
||||
'permohonan_id',
|
||||
'status',
|
||||
'keterangan',
|
||||
'before_request',
|
||||
'after_request',
|
||||
'file_path',
|
||||
'user_id'
|
||||
];
|
||||
|
||||
|
||||
public function permohonan()
|
||||
{
|
||||
return $this->belongsTo(Permohonan::class);
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
}
|
||||
23
app/Models/PermohonanJaminan.php
Normal file
23
app/Models/PermohonanJaminan.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\PermohonanJaminanFactory;
|
||||
|
||||
class PermohonanJaminan extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'dokumen_jaminan';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
// protected $fillable = [];
|
||||
protected $guarded = [];
|
||||
|
||||
protected static function newFactory(): PermohonanJaminanFactory
|
||||
{
|
||||
//return PermohonanJaminanFactory::new();
|
||||
}
|
||||
}
|
||||
53
app/Models/PermohonanPembatalan.php
Normal file
53
app/Models/PermohonanPembatalan.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Modules\Usermanagement\Models\User;
|
||||
|
||||
class PermohonanPembatalan extends Base
|
||||
{
|
||||
|
||||
protected $table = 'permohonan_pembatalan';
|
||||
|
||||
protected $fillable = [
|
||||
'permohonan_id',
|
||||
'alasan_pembatalan',
|
||||
'file_pembatalan',
|
||||
'status',
|
||||
'keterangan',
|
||||
'authorized_at',
|
||||
'authorized_status',
|
||||
'created_by',
|
||||
'updated_by',
|
||||
'deleted_by',
|
||||
'authorized_by',
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'deleted_at',
|
||||
'authorized_at',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'authorized_status' => 'string',
|
||||
];
|
||||
|
||||
// Relationship with Permohonan
|
||||
public function permohonan()
|
||||
{
|
||||
return $this->belongsTo(Permohonan::class, 'permohonan_id');
|
||||
}
|
||||
|
||||
public function user(){
|
||||
return $this->belongsTo(User::class, 'created_by');
|
||||
}
|
||||
|
||||
public function authorizedUser(){
|
||||
return $this->belongsTo(User::class, 'authorized_by');
|
||||
}
|
||||
}
|
||||
66
app/Models/PersetujuanPenawaran.php
Normal file
66
app/Models/PersetujuanPenawaran.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Modules\Usermanagemenet\Models\User;
|
||||
|
||||
class PersetujuanPenawaran extends Base
|
||||
{
|
||||
|
||||
protected $table = 'persetujuan_penawaran';
|
||||
|
||||
protected $fillable = [
|
||||
'permohonan_id',
|
||||
'penawaran_id',
|
||||
'nomor_proposal_penawaran',
|
||||
'tanggal_proposal_penawaran',
|
||||
'biaya_final',
|
||||
'sla_resume',
|
||||
'sla_final',
|
||||
'file_persetujuan_penawaran',
|
||||
'surat_representasi',
|
||||
'bukti_bayar',
|
||||
'nominal_bayar',
|
||||
'status',
|
||||
'authorized_status',
|
||||
'authorized_at',
|
||||
'authorized_by',
|
||||
'catatan',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'tanggal_proposal_penawaran' => 'date',
|
||||
'biaya_final' => 'decimal:2',
|
||||
'status' => 'boolean',
|
||||
'authorized_status' => 'boolean',
|
||||
'authorized_at' => 'datetime',
|
||||
];
|
||||
|
||||
// Relationship with Penawaran
|
||||
public function penawaran()
|
||||
{
|
||||
return $this->belongsTo(PenawaranTender::class, 'penawaran_id');
|
||||
}
|
||||
|
||||
public function permohonan(){
|
||||
return $this->belongsTo(Permohonan::class, 'permohonan_id');
|
||||
}
|
||||
|
||||
// Relationship with Region
|
||||
public function region()
|
||||
{
|
||||
return $this->belongsTo(Region::class);
|
||||
}
|
||||
|
||||
// Relationship with User (for authorized_by)
|
||||
public function authorizedBy()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'authorized_by');
|
||||
}
|
||||
|
||||
// Relationship with Noc
|
||||
public function noc()
|
||||
{
|
||||
return $this->hasOne(Noc::class, 'persetujuan_penawaran_id');
|
||||
}
|
||||
}
|
||||
24
app/Models/PosisiKavling.php
Normal file
24
app/Models/PosisiKavling.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\PosisiKavlingFactory;
|
||||
|
||||
class PosisiKavling extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'posisi_kavling';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
protected static function newFactory(): PosisiKavlingFactory
|
||||
{
|
||||
//return PosisiKavlingFactory::new();
|
||||
}
|
||||
}
|
||||
24
app/Models/PosisiUnit.php
Normal file
24
app/Models/PosisiUnit.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
// use Modules\Lpj\Database\Factories\PosisiUnitFactory;
|
||||
|
||||
class PosisiUnit extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'posisi_unit';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
// protected static function newFactory(): PosisiUnitFactory
|
||||
// {
|
||||
// // return PosisiUnitFactory::new();
|
||||
// }
|
||||
}
|
||||
30
app/Models/Regions.php
Normal file
30
app/Models/Regions.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\RegionsFactory;
|
||||
use Modules\Lpj\Models\Teams;
|
||||
|
||||
class Regions extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $table = 'regions';
|
||||
|
||||
protected $fillable = [
|
||||
'code', 'name', 'status', 'name_url','url','authorized_status', 'authorized_at', 'authorized_by'
|
||||
];
|
||||
|
||||
public function teams(){
|
||||
return $this->hasMany(Teams::class, 'regions_id', 'id');
|
||||
}
|
||||
|
||||
public function penilaiTeam(){
|
||||
return $this->hasMany(PenilaianTeam::class, 'team_id', 'id');
|
||||
}
|
||||
}
|
||||
24
app/Models/RuteJaminan.php
Normal file
24
app/Models/RuteJaminan.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\RuteJaminanFactory;
|
||||
|
||||
class RuteJaminan extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'rute_jaminan';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['name_rute', 'foto_jaminan_id', 'foto_rute'];
|
||||
|
||||
protected static function newFactory(): RuteJaminanFactory
|
||||
{
|
||||
//return RuteJaminanFactory::new();
|
||||
}
|
||||
}
|
||||
24
app/Models/SaranaPelengkap.php
Normal file
24
app/Models/SaranaPelengkap.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\SaranaPelengkapFactory;
|
||||
|
||||
class SaranaPelengkap extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'sarana_pelengkap';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
protected static function newFactory(): SaranaPelengkapFactory
|
||||
{
|
||||
//return SaranaPelengkapFactory::new();
|
||||
}
|
||||
}
|
||||
24
app/Models/SifatBangunan.php
Normal file
24
app/Models/SifatBangunan.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\SifatBangunanFactory;
|
||||
|
||||
class SifatBangunan extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'sifat_bangunan';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
protected static function newFactory(): SifatBangunanFactory
|
||||
{
|
||||
//return SifatBangunanFactory::new();
|
||||
}
|
||||
}
|
||||
23
app/Models/SpekBagunanAnalisa.php
Normal file
23
app/Models/SpekBagunanAnalisa.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\SpekBagunanAnalisaFactory;
|
||||
|
||||
class SpekBagunanAnalisa extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'spek_bagunan_analisa';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['kategori', 'analisa_tanah_bagunan_id'];
|
||||
|
||||
protected static function newFactory(): SpekBagunanAnalisaFactory
|
||||
{
|
||||
//return SpekBagunanAnalisaFactory::new();
|
||||
}
|
||||
}
|
||||
24
app/Models/SpekBagunanAnalisaDetail.php
Normal file
24
app/Models/SpekBagunanAnalisaDetail.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\SpekBagunanAnalisaDetailFactory;
|
||||
|
||||
class SpekBagunanAnalisaDetail extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'spek_bagunan_analisa_detail';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['name', 'spek_bagunan_analisa_id', 'kategori'];
|
||||
|
||||
protected static function newFactory(): SpekBagunanAnalisaDetailFactory
|
||||
{
|
||||
//return SpekBagunanAnalisaDetailFactory::new();
|
||||
}
|
||||
}
|
||||
31
app/Models/SpekBangunan.php
Normal file
31
app/Models/SpekBangunan.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\SpekBangunanFactory;
|
||||
|
||||
class SpekBangunan extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'spek_bangunan';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code','name','status','spek_kategori_bangunan_id','authorized_status'];
|
||||
|
||||
|
||||
|
||||
public function bangunanKategori(){
|
||||
return $this->belongsTo(SpekKategoritBangunan::class, 'spek_kategori_bangunan_id');
|
||||
}
|
||||
|
||||
protected static function newFactory(): SpekBangunanFactory
|
||||
{
|
||||
//return SpekBangunanFactory::new();
|
||||
}
|
||||
|
||||
}
|
||||
28
app/Models/SpekKategoritBangunan.php
Normal file
28
app/Models/SpekKategoritBangunan.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\SpekKategoritBangunanFactory;
|
||||
|
||||
class SpekKategoritBangunan extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'spek_kategori_bangunan';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code','name','status','authorized_status'];
|
||||
|
||||
|
||||
public function bangunan()
|
||||
{
|
||||
return $this->hasMany(SpekBangunan::class, 'spek_kategori_bangunan_id');
|
||||
}
|
||||
protected static function newFactory(): SpekKategoritBangunanFactory
|
||||
{
|
||||
//return SpekKategoritBangunanFactory::new();
|
||||
}
|
||||
}
|
||||
9
app/Models/Spk.php
Normal file
9
app/Models/Spk.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
class Spk extends Base
|
||||
{
|
||||
protected $table = 'arah_mata_angin';
|
||||
protected $fillable = ['name','authorized_at','authorized_status','authorized_by'];
|
||||
}
|
||||
9
app/Models/StatusPermohonan.php
Normal file
9
app/Models/StatusPermohonan.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
class StatusPermohonan extends Base
|
||||
{
|
||||
protected $table = 'status_permohonan';
|
||||
protected $fillable = ['name', 'description','status','slug'];
|
||||
}
|
||||
40
app/Models/Teams.php
Normal file
40
app/Models/Teams.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\TeamsFactory;
|
||||
use Modules\Lpj\Models\TeamsUsers;
|
||||
use Modules\Lpj\Models\Regions;
|
||||
use Modules\Lpj\Models\Penilaian;
|
||||
|
||||
|
||||
class Teams extends Base
|
||||
{
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $table = 'teams';
|
||||
protected $fillable = [
|
||||
'regions_id', 'code', 'name', 'status', 'authorized_status', 'authorized_at',
|
||||
'authorized_by', 'created_at', 'created_by', 'updated_at', 'updated_by',
|
||||
'deleted_at', 'deleted_by'
|
||||
];
|
||||
|
||||
public function regions(){
|
||||
return $this->belongsTo(Regions::class, 'regions_id', 'id');
|
||||
}
|
||||
|
||||
public function teamsUsers(){
|
||||
return $this->hasMany(TeamsUsers::class, 'teams_id', 'id');
|
||||
}
|
||||
|
||||
public function penilaianTeam(){
|
||||
return $this->hasMany(PenilaianTeam::class, 'team_id', 'id');
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
40
app/Models/TeamsUsers.php
Normal file
40
app/Models/TeamsUsers.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Modules\Lpj\Database\Factories\TeamsUsersFactory;
|
||||
use Modules\Usermanagement\Models\User;
|
||||
use Modules\Lpj\Models\Teams;
|
||||
use Modules\Lpj\Models\Penilaian;
|
||||
|
||||
class TeamsUsers extends Base
|
||||
{
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $table = 'teams_users';
|
||||
protected $fillable = [
|
||||
'teams_id', 'user_id', 'status', 'authorized_status', 'authorized_at',
|
||||
'authorized_by', 'created_at', 'created_by', 'updated_at', 'updated_by',
|
||||
'deleted_at', 'deleted_by'
|
||||
];
|
||||
|
||||
public function team()
|
||||
{
|
||||
return $this->belongsTo(Teams::class, 'teams_id', 'id');
|
||||
}
|
||||
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id', 'id');
|
||||
}
|
||||
|
||||
public function penilaianTeam()
|
||||
{
|
||||
return $this->belongsTo(PenilaianTeam::class, 'team_id', 'id');
|
||||
}
|
||||
|
||||
}
|
||||
25
app/Models/TerletakArea.php
Normal file
25
app/Models/TerletakArea.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
// use Modules\Lpj\Database\Factories\TerletakAreaFactory;
|
||||
|
||||
class TerletakArea extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'terletak_area';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
// protected static function newFactory(): TerletakAreaFactory
|
||||
// {
|
||||
// // return TerletakAreaFactory::new();
|
||||
// }
|
||||
}
|
||||
23
app/Models/TingkatKeramaian.php
Normal file
23
app/Models/TingkatKeramaian.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\TingkatKeramaianFactory;
|
||||
|
||||
class TingkatKeramaian extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'tingkat_keramaian';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
protected static function newFactory(): TingkatKeramaianFactory
|
||||
{
|
||||
//return TingkatKeramaianFactory::new();
|
||||
}
|
||||
}
|
||||
9
app/Models/TujuanPenilaian.php
Normal file
9
app/Models/TujuanPenilaian.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
class TujuanPenilaian extends Base
|
||||
{
|
||||
protected $table = 'tujuan_penilaian';
|
||||
protected $fillable = ['code', 'name'];
|
||||
}
|
||||
19
app/Models/TujuanPenilaianKJPP.php
Normal file
19
app/Models/TujuanPenilaianKJPP.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\TujuanPenilaianKJPPFactory;
|
||||
|
||||
class TujuanPenilaianKJPP extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'tujuan_penilaian_kjpp';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name'];
|
||||
}
|
||||
23
app/Models/ViewUnit.php
Normal file
23
app/Models/ViewUnit.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\ViewUnitFactory;
|
||||
|
||||
class ViewUnit extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'view_unit';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['name', 'status', 'authorized_status', 'authorized_at', 'authorized_by', 'code'];
|
||||
|
||||
protected static function newFactory(): ViewUnitFactory
|
||||
{
|
||||
//return ViewUnitFactory::new();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user