<?php

namespace RadiusTheme\RadiusBooking\Models;

use RadiusTheme\RadiusBooking\Abstracts\BaseModel;
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}
/**
 * Class EmployeeService
 *
 * @package RadiusTheme\RadiusBooking\Models
 *
 * @property int    $id
 * @property string $name
 */
class EmployeeService extends BaseModel {

	/**
	 * The database table associated with the model.
	 *
	 * @var string
	 */
	protected string $table = 'radius_booking_employees_services';

	/**
	 * The attributes that are mass assignable.
	 *
	 * @var array
	 */
	protected array $fillable = array(
		'name',
		'user_id',
		'service_id',
		'price',
		'min_capacity',
		'max_capacity',
		'custom_pricing',
	);

	/**
	 * The attributes that should be cast to native types.
	 *
	 * @var array
	 */
	protected array $casts = array(
		'price'          => 'float',
		'min_capacity'   => 'integer',
		'max_capacity'   => 'integer',
		'custom_pricing' => 'json',
	);

	/**
	 * Defines a one-to-many relationship with the Service model.
	 */
	public function service() {
		return $this->hasMany( Service::class, 'id', 'service_id' );
	}
}
