Rapihin setup/member/lot-parking + fitur intercom, exclude WIP controller & file sampah dari git
Kumpulan perubahan yang udah numpuk di working tree: refactor Setup (Gate/Vehicle/Member), rapihin memberin & stiker, service parking baru (ParkingUtilsServices, NetworkService), model/migration lot-parking & DHCP reservation, dan fitur baru Intercom (controller/model/migration/ view). ReportTransaksiController versi lokal ini WIP (~90%, masih didebug) - versi yang bener ada di server, jadi dikeluarin dari git (ditambahin ke .gitignore) biar gak numpuk nindihin punya server pas git pull di sana. Sekalian keluarin dump mentah tabel softseting (1.8MB, nyasar ke-commit), file .bak, dan arsip ad-hoc (api.tgz, c.zip) yang emang bukan source code. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01EAJc2mrpj2cSTe4oowLPzQ
This commit is contained in:
@@ -11,10 +11,18 @@ class ConfigHardware extends Model
|
||||
|
||||
protected $table = 'config_pos_hardware';
|
||||
|
||||
// # tabel ini tidak punya kolom id, kuncinya id_pos (satu baris per pintu)
|
||||
protected $primaryKey = 'id_pos';
|
||||
public $incrementing = false;
|
||||
protected $keyType = 'string';
|
||||
|
||||
// # tabel ini tidak punya kolom created_at / updated_at
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = [
|
||||
'printer1_avail','printer1_conn','printer1_spd','printer1_stdfile','printer1_autocutter','printer1_bgconnect',
|
||||
'printer1_dummy','video1_avail','video1_conn','video1_channel','video1_version','feedisplay_avail',
|
||||
'feedisplay_conn','feedisplay_paralel','feedisplay_version','bg_avail',' bg_conn ','bg_paralel','bg_value',
|
||||
'feedisplay_conn','feedisplay_paralel', 'feedisplay_version','bg_avail','bg_conn','bg_paralel','bg_value',
|
||||
'sound_avail','sound_conn','sound_version','sound_partisi','id_pos','sizeable','pjg_lcd','video1_bright',
|
||||
'video2_avail','video2_conn','video2_channel','video2_version','video2_bright','video2_sizeable','smartcard_avail',
|
||||
'smartcard_speed','smartcard_port','printer2_avail','printer2_conn','printer2_spd','printer2_stdfile','printer2_autocutter',
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ConfigPosNetwork extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $primaryKey = "id_pos";
|
||||
|
||||
public $incrementing = false;
|
||||
protected $keyType = "int";
|
||||
protected $table = "config_pos_network";
|
||||
protected $fillable = ["id_pos", "hostname", "mac_address", "ip_address", "enabled"];
|
||||
|
||||
protected $casts = [
|
||||
"enabled" => "boolean",
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class IntercomCall extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'intercom_calls';
|
||||
|
||||
protected $fillable = [
|
||||
'device_id', 'arah', 'status',
|
||||
'requested_at', 'started_at', 'ended_at',
|
||||
'durasi_detik', 'recording_path', 'ended_by',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'requested_at' => 'datetime',
|
||||
'started_at' => 'datetime',
|
||||
'ended_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class IntercomDevice extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'intercom_devices';
|
||||
|
||||
protected $fillable = [
|
||||
'device_id', 'nama', 'mac_address', 'ip_address',
|
||||
'udp_port', 'status', 'last_seen_at',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'last_seen_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
@@ -9,14 +9,11 @@ class JenisMobil extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'jenis_mobil';
|
||||
protected $table = "jenis_mobil";
|
||||
|
||||
protected $casts = [
|
||||
'id' => 'string',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'nama','short_cut'
|
||||
"id" => "string",
|
||||
];
|
||||
|
||||
protected $fillable = ["id", "nama", "short_cut", "validasi"];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\LotParking;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class LotParkingLog extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = "lot_parking_log";
|
||||
|
||||
protected $fillable = ["area", "lot_number", "status", "created_at", "updated_at"];
|
||||
|
||||
// public function siteUser()
|
||||
// {
|
||||
// return $this->belongsTo(User::class,'id','id');
|
||||
// }
|
||||
|
||||
// public function siteGroups()
|
||||
// {
|
||||
// return $this->belongsTo(User::class, 'site_group', 'company');
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\LotParking;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class SiteParking extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = "site_parkinglot";
|
||||
|
||||
protected $fillable = ["sitearea_id", "name", "space_parking"];
|
||||
|
||||
// public function siteUser()
|
||||
// {
|
||||
// return $this->belongsTo(User::class,'id','id');
|
||||
// }
|
||||
|
||||
// public function siteGroups()
|
||||
// {
|
||||
// return $this->belongsTo(User::class, 'site_group', 'company');
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class MasterTarifStiker extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = "tarif_stiker";
|
||||
// protected $primaryKey = "id_mobil"; // Primary key tabel
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = [
|
||||
"id_mobil','jenis_langganan','tarif','tgl_akhir','last_member','jenis','jenis_member',
|
||||
'hitung_awal_bulan','tarif_id','available_online','langganan','kode_akses','stasiunkerja_id",
|
||||
];
|
||||
|
||||
public function tarifStiker()
|
||||
{
|
||||
return $this->hasOne(StikerTransDetail::class, "jenis_member", "jenis_langganan");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Origin;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class MasterJenisLangganan extends Model
|
||||
{
|
||||
/**
|
||||
* Nama tabel di database.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = "jenis_langganan";
|
||||
|
||||
/**
|
||||
* Kolom "id" di tabel ini varchar dan bukan auto-increment,
|
||||
* tapi tetap dipakai sebagai identifier utama secara logis.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $primaryKey = "id";
|
||||
|
||||
/**
|
||||
* Karena id bukan integer auto-increment.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $incrementing = false;
|
||||
|
||||
/**
|
||||
* Tipe data primary key.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $keyType = "string";
|
||||
|
||||
/**
|
||||
* Tabel ini tidak memiliki kolom created_at / updated_at.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* Kolom yang boleh diisi secara mass assignment.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $fillable = ["id", "nama", "bayar", "tarif", "periode_awal", "masa_berlaku", "maks", "jenis_mobil"];
|
||||
|
||||
/**
|
||||
* Casting tipe data kolom.
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected $casts = [
|
||||
"bayar" => "integer",
|
||||
"tarif" => "integer",
|
||||
"periode_awal" => "datetime",
|
||||
"masa_berlaku" => "integer",
|
||||
"maks" => "integer",
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Origin;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany; // <-- tambahin ini
|
||||
|
||||
class MasterStasiunKerja extends Model
|
||||
{
|
||||
/**
|
||||
* Nama tabel di database.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = "stasiunkerja";
|
||||
|
||||
/**
|
||||
* "kode" dipakai sebagai identifier utama secara logis
|
||||
* (tidak ada PK asli di tabel ini).
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $primaryKey = "kode";
|
||||
|
||||
/**
|
||||
* kode bukan integer auto-increment.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $incrementing = false;
|
||||
|
||||
/**
|
||||
* Tipe data primary key.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $keyType = "string";
|
||||
|
||||
/**
|
||||
* Tabel ini tidak memiliki kolom created_at / updated_at.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* Kolom yang boleh diisi secara mass assignment.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
"kode",
|
||||
"nama",
|
||||
"margin",
|
||||
"spv",
|
||||
"target",
|
||||
"id_lokasi",
|
||||
"lantai",
|
||||
"status",
|
||||
"alamat",
|
||||
"bank",
|
||||
"telp",
|
||||
"kode_akses",
|
||||
];
|
||||
|
||||
/**
|
||||
* Casting tipe data kolom.
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected $casts = [
|
||||
"margin" => "integer",
|
||||
"target" => "integer",
|
||||
"status" => "integer",
|
||||
];
|
||||
|
||||
/**
|
||||
* Relasi ke tarif_stiker.
|
||||
* stasiunkerja.kode = tarif_stiker.langganan
|
||||
*
|
||||
* @return HasMany
|
||||
*/
|
||||
public function tarifStiker(): HasMany
|
||||
{
|
||||
return $this->hasMany(MasterTarifStiker::class, "langganan", "kode");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Origin;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo; // <-- tambahin ini
|
||||
|
||||
class MasterTarifStiker extends Model
|
||||
{
|
||||
/**
|
||||
* Nama tabel di database.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = "tarif_stiker";
|
||||
|
||||
/**
|
||||
* "tarif_id" dipakai sebagai identifier utama secara logis
|
||||
* (kolom bigint not null, tidak ada PK asli di tabel ini).
|
||||
* Karena belum pasti ini sequence auto-increment di DB,
|
||||
* incrementing sengaja dimatikan. Ubah ke true kalau
|
||||
* ternyata kolom ini memang identity/serial di database.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $primaryKey = "tarif_id";
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
public $incrementing = false;
|
||||
|
||||
/**
|
||||
* Tipe data primary key.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $keyType = "integer";
|
||||
|
||||
/**
|
||||
* Tabel ini tidak memiliki kolom created_at / updated_at.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* Kolom yang boleh diisi secara mass assignment.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
"id_mobil",
|
||||
"jenis_langganan",
|
||||
"tarif",
|
||||
"last_member",
|
||||
"tgl_akhir",
|
||||
"jenis",
|
||||
"jenis_member",
|
||||
"hitung_awal_bulan",
|
||||
"tarif_id",
|
||||
"available_online",
|
||||
"langganan",
|
||||
"kode_akses",
|
||||
];
|
||||
|
||||
/**
|
||||
* Casting tipe data kolom.
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected $casts = [
|
||||
"tarif" => "float",
|
||||
"hitung_awal_bulan" => "integer",
|
||||
"tarif_id" => "integer",
|
||||
"available_online" => "boolean",
|
||||
];
|
||||
|
||||
/**
|
||||
* Relasi ke stasiunkerja.
|
||||
* tarif_stiker.langganan = stasiunkerja.kode
|
||||
*
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function stasiunKerja(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(MasterStasiunKerja::class, "langganan", "kode");
|
||||
}
|
||||
}
|
||||
+38
-10
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\StikerTransDetail;
|
||||
use App\Models\MemberCard;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
@@ -9,24 +11,50 @@ class StikerTrans extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'transaksi_stiker';
|
||||
protected $table = "transaksi_stiker";
|
||||
|
||||
protected $fillable = [
|
||||
'notrans','nama','alamat', 'telepon', 'jenis_transaksi', 'awal', 'harga', 'keterangan', 'tanggal' , 'operator' ,
|
||||
'akhir' , 'maks' , 'no_id' , 'unit_kerja', 'no_induk' , 'jenis_stiker' , 'hari_ke' ,'jenis_langganan' ,
|
||||
'exit_pass' , 'no_kuitansi', 'tgl_edited', 'tipe_exit_pass', 'seq_code' , 'unitno' , 'area' , 'reserved',
|
||||
'batasan_jam', 'batasan_awal', 'batasan_akhir', 'asuransi'
|
||||
"notrans",
|
||||
"nama",
|
||||
"alamat",
|
||||
"telepon",
|
||||
"jenis_transaksi",
|
||||
"awal",
|
||||
"harga",
|
||||
"keterangan",
|
||||
"tanggal",
|
||||
"operator",
|
||||
"akhir",
|
||||
"maks",
|
||||
"no_id",
|
||||
"unit_kerja",
|
||||
"no_induk",
|
||||
"jenis_stiker",
|
||||
"hari_ke",
|
||||
"jenis_langganan",
|
||||
"exit_pass",
|
||||
"no_kuitansi",
|
||||
"tgl_edited",
|
||||
"tipe_exit_pass",
|
||||
"seq_code",
|
||||
"unitno",
|
||||
"area",
|
||||
"reserved",
|
||||
"batasan_jam",
|
||||
"batasan_awal",
|
||||
"batasan_akhir",
|
||||
"asuransi",
|
||||
];
|
||||
|
||||
public $with = ['stiker_details', 'memberCard'];
|
||||
// public $with = ["stiker_details", "memberCard"];
|
||||
|
||||
public function stiker_details ()
|
||||
public function stiker_details()
|
||||
{
|
||||
return $this->hasMany(StikerTransDetail::class, 'notrans', 'notrans');
|
||||
return $this->hasMany(StikerTransDetail::class, "notrans", "notrans");
|
||||
}
|
||||
|
||||
public function memberCard ()
|
||||
public function memberCard()
|
||||
{
|
||||
return $this->hasMany(MemberCard::class, 'notrans', 'no_id');
|
||||
return $this->hasMany(MemberCard::class, "notrans", "no_id");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\StikerTrans;
|
||||
use App\Models\VehicleItem;
|
||||
use App\Models\MasterTarifStiker;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
@@ -10,22 +13,43 @@ class StikerTransDetail extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'detail_transaksi_stiker';
|
||||
protected $table = "detail_transaksi_stiker";
|
||||
|
||||
protected $fillable = [
|
||||
'notrans', 'nopol', 'jenis_mobil', 'adm', 'kategori',
|
||||
'jenis_member', 'akses', 'akses_out', 'status', 'merk',
|
||||
'tipe', 'tahun', 'warna', 'keterangan',
|
||||
"notrans",
|
||||
"nopol",
|
||||
"jenis_mobil",
|
||||
"adm",
|
||||
"kategori",
|
||||
"jenis_member",
|
||||
"akses",
|
||||
"akses_out",
|
||||
"status",
|
||||
"merk",
|
||||
"tipe",
|
||||
"tahun",
|
||||
"warna",
|
||||
"keterangan",
|
||||
];
|
||||
|
||||
public function stiker_details ()
|
||||
public function stiker_details()
|
||||
{
|
||||
return $this->belongsTo(StikerTrans::class, 'notrans', 'notrans');
|
||||
return $this->belongsTo(StikerTrans::class, "notrans", "notrans");
|
||||
}
|
||||
|
||||
public function tarifStiker()
|
||||
{
|
||||
return $this->hasOne(MasterTarifStiker::class, "jenis_member", "jenis_langganan");
|
||||
}
|
||||
|
||||
// Relasi ke tabel jenis_mobil
|
||||
public function vehicle()
|
||||
{
|
||||
return $this->belongsTo(VehicleItem::class, 'id', 'jenis_mobil');
|
||||
return $this->belongsTo(VehicleItem::class, "jenis_mobil", "id");
|
||||
}
|
||||
|
||||
public function details()
|
||||
{
|
||||
return $this->with(["vehicle:id, nama", "tarifStiker:jenis_langganan,tarif"]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user