<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class TransaksiStiker extends Model
{
    use HasFactory;

    protected $table = 'transaksi_stiker';
    const id = null;
    const updated_at = null;
    const created_at = null;

    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','kartu','visitor'
    ];

    public function details() {
        return $this->hasMany(DetailTransaksiStiker::class, 'notrans', 'notrans');
    }

    public function cardMember()
    {
        return $this->hasOne(CardMember::class, 'no_id', 'notrans');
    }
}
