<commit_before><?php
namespace App\Models;

use App\Helpers\Helper;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Lang;
use Illuminate\Database\Eloquent\SoftDeletes;
use Watson\Validating\ValidatingTrait;

/**
 * Model for Asset Maintenances.
 *
 * @version    v1.0
 */
class AssetMaintenance extends Model implements ICompanyableChild
{
    use SoftDeletes;
    use CompanyableChildTrait;
    use ValidatingTrait;


    protected $dates = [ 'deleted_at' ];
    protected $table = 'asset_maintenances';
    // Declaring rules for form validation
    protected $rules = [
        'asset_id'               => 'required|integer',
        'supplier_id'            => 'required|integer',
        'asset_maintenance_type' => 'required',
        'title'                  => 'required|max:100',
        'is_warranty'            => 'boolean',
        'start_date'             => 'required|date_format:"Y-m-d"',
        'completion_date'        => 'date_format:"Y-m-d"',
        'notes'                  => 'string|nullable',
        'cost'                   => 'numeric|nullable'
    ];

    public function getCompanyableParents()
    {
        return [ 'asset' ];
    }

    /**
       * getImprovementOptions
       *
       * @return array
       * @author  <NAME> <<EMAIL>>
       * @version v1.0
       */<commit_msg>Fixes #4220 - allow nullable for completion date<commit_after><?php
namespace App\Models;

use App\Helpers\Helper;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Lang;
use Illuminate\Database\Eloquent\SoftDeletes;
use Watson\Validating\ValidatingTrait;

/**
 * Model for Asset Maintenances.
 *
 * @version    v1.0
 */
class AssetMaintenance extends Model implements ICompanyableChild
{
    use SoftDeletes;
    use CompanyableChildTrait;
    use ValidatingTrait;


    protected $dates = [ 'deleted_at' ];
    protected $table = 'asset_maintenances';
    // Declaring rules for form validation
    protected $rules = [
        'asset_id'               => 'required|integer',
        'supplier_id'            => 'required|integer',
        'asset_maintenance_type' => 'required',
        'title'                  => 'required|max:100',
        'is_warranty'            => 'boolean',
        'start_date'             => 'required|date_format:"Y-m-d"',
        'completion_date'        => 'nullable|date_format:"Y-m-d"',
        'notes'                  => 'string|nullable',
        'cost'                   => 'numeric|nullable'
    ];

    public function getCompanyableParents()
    {
        return [ 'asset' ];
    }

    /**
       * getImprovementOptions
       *
       * @return array
       * @author  <NAME> <<EMAIL>>
       * @version v1.0
       */
{'fraction_non_alphanumeric': 0.12380602498163115, 'fraction_numerical': 0.006612784717119765, 'mean_word_length': 2.16260162601626, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2339012', 'n_tokens_mistral': 828, 'n_tokens_neox': 822, 'n_words': 156}