<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

use App\Traits\OrderServiceOptions;

class AdslPlan extends Model
{
	use OrderServiceOptions;

	protected $table = 'ab_adsl_plan';

	protected $order_attributes = [
		'options.address'=>[
			'request'=>'options.address',
			'key'=>'service_address',
			'validation'=>'required|string:10',
			'validation_message'=>'Address is a required field.',
		],
		'options.notes'=>[
			'request'=>'options.notes',
			'key'=>'order_info.notes',
			'validation'=>'present',
			'validation_message'=>'Special Instructions here.',
		],
	];

	protected $order_model = Service\Adsl::class;

	public function product()
	{
		return $this->hasOne(AdslSupplierPlan::class,'id','adsl_supplier_plan_id');
	}
}