<?php

namespace App\Models;

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

class BandGoal extends Model
{
    use HasFactory;

    public const DAY_TYPE = "day";
    public const WEEK_TYPE = "week";
    public const MONTH_TYPE = "month";

    public const DAY_NUM = 1;
    public const WEEK_NUM = 7;
    public const MONTH_NUM = 30;
    public $fillable = ['user_id', 'band_id', 'step_num', 'distance', 'kcal', 'sleep'];

    public function scopeOwner($query, $user_id)
    {
        return $query->where("user_id", $user_id);
    }

    public function scopeBand($query, $band_id)
    {
        return $query->where("band_id", $band_id);
    }

}
